* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #432456;
    background-image: linear-gradient(135deg, #432456 0%, #5a3069 100%);
    color: #fff;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    padding-top: calc(10vh);
}

.container {
    width: 1500px;
    height: 781px;
    max-width: 100%;
    max-height: 100vh;
    background-color: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

nav {
    padding: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

nav a {
    margin-right: 38px;
    margin-bottom: 12px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    position: relative;
    font-size: 20px;
}

nav a:nth-child(1) {
    text-decoration: underline;
    text-underline-offset: 6px;
}

#content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 25px 25px;
    overflow-y: auto;
}

.gallery-title {
    font-size: 45px;
    color: #333;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: center;
}

.gallery-row {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.gallery-item {
    width: 360px;
    height: 180px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

/* Staggered animation delay for gallery items */
.gallery-row:nth-child(1) .gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-row:nth-child(1) .gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-row:nth-child(1) .gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-row:nth-child(2) .gallery-item:nth-child(1) { animation-delay: 0.4s; }
.gallery-row:nth-child(2) .gallery-item:nth-child(2) { animation-delay: 0.5s; }
.gallery-row:nth-child(2) .gallery-item:nth-child(3) { animation-delay: 0.6s; }
.gallery-row:nth-child(3) .gallery-item:nth-child(1) { animation-delay: 0.7s; }
.gallery-row:nth-child(3) .gallery-item:nth-child(2) { animation-delay: 0.8s; }
.gallery-row:nth-child(3) .gallery-item:nth-child(3) { animation-delay: 0.9s; }

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.overlay-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    transform: translateY(10px);
    transition: transform 0.3s ease 0.1s;
}

.gallery-item:hover .overlay-title,
.gallery-item:hover .overlay-subtitle {
    transform: translateY(0);
}

.tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #73264d;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    transform: translateX(0);
    opacity: 1;
}

.tag-group {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.tag-group .tag {
    position: static;
}

.tag.new-tag {
    background: #ff0033;
    font-size: 14px;
    padding: 5px 12px;
}

/* Responsive styles */
@media screen and (max-width: 1500px) {
    .container {
        width: 100%;
        height: auto;
        aspect-ratio: 1500/781;
    }
}

@media screen and (max-width: 1200px) {
    .gallery-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .gallery-item {
        width: 300px;
        height: 150px;
    }
}

@media screen and (max-width: 830px) {
    body {
        padding-top: 5vh;
    }
    
    .container {
        aspect-ratio: auto;
        height: auto;
        min-height: 700px;
    }
    
    nav {
        justify-content: center;
    }
    
    .gallery-title {
        font-size: 40px;
        margin-bottom: 25px;
    }
    
    .gallery-item {
        width: 280px;
        height: 140px;
    }
    
    .overlay-title {
        font-size: 20px;
    }
    
    .overlay-subtitle {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        border-radius: 15px;
        min-height: 650px;
    }
    
    nav a {
        margin-right: 15px;
        font-size: 14px;
    }
    
    .gallery-title {
        font-size: 35px;
        margin-bottom: 20px;
    }
    
    .gallery-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .gallery-grid {
        gap: 15px;
    }
    
    .gallery-item {
        width: 100%;
        max-width: 320px;
        height: 160px;
    }
}

/* Ad container styles */
.ad-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
}

.ad-container > div,
.ad-container > iframe {
    max-width: 100%;
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transform: scale(1.1);
}

/* Specific style for the third ad with atOptions */
.ad-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    overflow: hidden;
    transform-origin: center;
    transform: scale(1.5);
}

/* Update animation delay for the 4th row */
.gallery-row:nth-child(4) .gallery-item:nth-child(1) { animation-delay: 1.0s; }
.gallery-row:nth-child(4) .gallery-item:nth-child(2) { animation-delay: 1.1s; }
.gallery-row:nth-child(4) .gallery-item:nth-child(3) { animation-delay: 1.2s; }

/* Mobile-only ad banner */
.ad-mobile-banner {
    display: none;
    width: 100%;
    justify-content: center;
    align-items: center;
    margin: 10px 0 15px 0;
}
@media screen and (max-width: 830px) {
    .ad-mobile-banner {
        display: flex;
    }
}

/* Popup 18+ styles */
.popup-18plus-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popup-18plus-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 90vw;
    padding: 32px 24px 24px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.popup-18plus-title {
    font-size: 2rem;
    font-weight: bold;
    color: #e53935;
    margin-bottom: 18px;
    text-align: center;
}
.popup-18plus-content {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 28px;
    text-align: center;
    font-weight: normal;
}
.popup-18plus-footer {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    margin-bottom: 0;
}
.popup-18plus-btn {
    flex: 1 1 0;
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0;
}
.popup-18plus-btn.ok {
    background: #2196f3;
    color: #fff;
}
.popup-18plus-btn.ok:hover {
    background: #1769aa;
}
.popup-18plus-btn.cancel {
    background: #e53935;
    color: #fff;
}
.popup-18plus-btn.cancel:hover {
    background: #a02725;
}
.popup-18plus-rage {
    color: #e53935;
    font-size: 2.2rem;
    font-weight: bold;
    text-align: center;
    margin-top: 24px;
    letter-spacing: 2px;
}
@media (max-width: 600px) {
    .popup-18plus-modal {
        padding: 18px 6vw 18px 6vw;
        max-width: 98vw;
    }
    .popup-18plus-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .popup-18plus-btn {
        width: 100%;
        font-size: 1.05rem;
    }
}