/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #0a0a16;
    color: #e8e8f0;
    min-height: 100vh;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; }

/* ── INDEX / HERO ─────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #1a1028 0%, #0a0a16 70%);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(212,175,55,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212,175,55,0.04) 0%, transparent 50%);
}
.hero-content {
    position: relative;
    text-align: center;
    padding: 40px 24px;
    max-width: 600px;
}
.crown-icon {
    font-size: 64px;
    filter: drop-shadow(0 0 30px rgba(212,175,55,0.4));
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.hero-title {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #d4af37 0%, #f5e6a3 50%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 18px;
    color: #a8a8c0;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 40px;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 32px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-number {
    font-family: 'Raleway', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #d4af37;
}
.stat-label { font-size: 13px; color: #888; margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.hero-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #8888a0;
    margin-bottom: 40px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}
.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 48px;
    background: linear-gradient(135deg, #d4af37, #f5c542);
    color: #0a0a16;
    border: none;
    border-radius: 60px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 30px rgba(212,175,55,0.3);
    letter-spacing: 0.5px;
}
.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(212,175,55,0.5);
}

/* ── TOURNAMENT ───────────────────────────────────────────────── */
.tournament-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.tournament-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: #0e0e1a;
    border-bottom: 1px solid #1a1a30;
}
.tournament-logo {
    font-family: 'Raleway', sans-serif;
    font-size: 20px;
    color: #d4af37;
}
.round-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
#round-label {
    font-size: 14px;
    font-weight: 600;
    color: #d4af37;
}
#match-counter {
    font-size: 12px;
    color: #666;
}

.progress-wrap {
    position: relative;
    height: 4px;
    background: #1a1a30;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f5c542);
    transition: width 0.5s ease;
    width: 0%;
    border-radius: 0 2px 2px 0;
}
.progress-text {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 11px;
    color: #666;
}

.match-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.loading-spinner {
    text-align: center;
    color: #666;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #1a1a30;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Match cards */
.match-wrapper {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 24px;
    max-width: 1000px;
    width: 100%;
    animation: matchIn 0.5s ease;
}
@keyframes matchIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.girl-card {
    flex: 1;
    max-width: 440px;
    background: #12121f;
    border: 2px solid #1e1e35;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}
.girl-card:hover {
    border-color: #d4af3788;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(212,175,55,0.15);
}
.girl-card:active {
    transform: translateY(-2px) scale(0.99);
}
.girl-card.selected {
    border-color: #d4af37;
    box-shadow: 0 0 40px rgba(212,175,55,0.3);
}

.card-photo-main {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    position: relative;
    background: #0a0a16;
}
.card-photo-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.girl-card:hover .card-photo-main img {
    transform: scale(1.03);
}

/* Thumbnail slider */
.thumb-slider {
    position: relative;
    overflow: hidden;
}
.card-thumbnails {
    display: flex;
    gap: 4px;
    padding: 6px 28px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}
.card-thumbnails::-webkit-scrollbar { display: none; }
.slider-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 26px;
    z-index: 4;
    border: none;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    color: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}
.slider-arrow-left {
    left: 0;
    background: linear-gradient(90deg, #12121f 60%, transparent);
}
.slider-arrow-right {
    right: 0;
    background: linear-gradient(-90deg, #12121f 60%, transparent);
}
.slider-arrow:hover { color: #f5c542; }
.slider-arrow.hidden { opacity: 0; pointer-events: none; }
.card-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    scroll-snap-align: start;
}
.card-thumb.active { border-color: #d4af37; }
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Locked / private thumbnails */
.card-thumb.locked {
    background: linear-gradient(135deg, #1a1028, #12121f);
    border: 2px solid #d4af3733;
    cursor: pointer;
    position: relative;
}
.card-thumb.locked:hover {
    border-color: #d4af37;
}
.locked-thumb-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #1e1530 0%, #0e0e1a 100%);
}
.badge-18 {
    font-size: 13px;
    font-weight: 800;
    color: #d4af37;
    letter-spacing: -0.5px;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Blurred main photo overlay */
.card-photo-main img.blurred {
    filter: blur(20px) brightness(0.5);
    transform: scale(1.1) !important;
}
.locked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    cursor: pointer;
    background: rgba(10, 10, 22, 0.3);
}
.locked-overlay.hidden { display: none; }
.locked-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
}
.locked-overlay-content span {
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    color: #d4af37;
    font-weight: 600;
}
.locked-overlay-content small {
    font-size: 12px;
    color: #aaa;
}

/* Private photo modal */
.private-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}
.private-modal.hidden { display: none; }
.private-modal-card {
    background: linear-gradient(145deg, #1a1a2e, #12121f);
    border: 1px solid #d4af3733;
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(212, 175, 55, 0.08);
}
.private-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.private-modal-close:hover { color: #d4af37; }
.private-modal-icon {
    margin-bottom: 16px;
}
.private-modal-card h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 22px;
    color: #d4af37;
    margin-bottom: 12px;
}
.private-modal-card p {
    font-size: 14px;
    line-height: 1.7;
    color: #a0a0b8;
    margin-bottom: 24px;
}
.btn-register {
    display: inline-block;
    padding: 14px 44px;
    background: linear-gradient(135deg, #d4af37, #f5c542);
    color: #0a0a16;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
}
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
}
.private-modal-hint {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: #555;
}

.card-info {
    padding: 16px 20px 20px;
    text-align: center;
}
.card-name {
    font-family: 'Raleway', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}
.btn-choose {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 36px;
    background: linear-gradient(135deg, #d4af37, #f5c542);
    color: #0a0a16;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 20px rgba(212,175,55,0.2);
}
.btn-choose:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(212,175,55,0.4);
}

.vs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a1a30;
    border: 2px solid #d4af3744;
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #d4af37;
    flex-shrink: 0;
    z-index: 2;
}

/* ── WINNER OVERLAY ───────────────────────────────────────────── */
.winner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,22,0.97);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}
.winner-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.winner-content {
    position: relative;
    text-align: center;
    z-index: 2;
    animation: winnerIn 0.8s ease 0.3s both;
}
@keyframes winnerIn {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.winner-crown {
    font-size: 80px;
    filter: drop-shadow(0 0 40px rgba(212,175,55,0.6));
    animation: float 2.5s ease-in-out infinite;
}
.winner-content h1 {
    font-family: 'Raleway', sans-serif;
    font-size: 36px;
    color: #d4af37;
    margin: 8px 0 24px;
}
.winner-card {
    margin: 0 auto 32px;
    max-width: 320px;
}
.winner-card img {
    width: 240px;
    height: 320px;
    object-fit: cover;
    border-radius: 16px;
    border: 3px solid #d4af37;
    box-shadow: 0 8px 40px rgba(212,175,55,0.3);
    margin: 0 auto 16px;
}
.winner-card h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 28px;
    color: #fff;
}
.btn-results {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, #d4af37, #f5c542);
    color: #0a0a16;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(212,175,55,0.3);
}
.btn-results:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(212,175,55,0.5); }

/* ── RESULTS ──────────────────────────────────────────────────── */
.results-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px 60px;
}
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #1a1a30;
    margin-bottom: 40px;
}
.back-link {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.back-link:hover { color: #d4af37; }
.results-logo {
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    color: #d4af37;
}

.winner-section { text-align: center; margin-bottom: 56px; }
.winner-crown-lg {
    font-size: 56px;
    filter: drop-shadow(0 0 24px rgba(212,175,55,0.5));
    margin-bottom: 8px;
}
.winner-section h1 {
    font-family: 'Raleway', sans-serif;
    font-size: 28px;
    color: #d4af37;
    margin-bottom: 32px;
}
.winner-showcase {}
.winner-photo-main {
    width: 260px;
    height: 340px;
    margin: 0 auto 16px;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid #d4af37;
    box-shadow: 0 8px 40px rgba(212,175,55,0.2);
}
.winner-photo-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.winner-name-lg {
    font-family: 'Raleway', sans-serif;
    font-size: 32px;
    color: #fff;
    margin-bottom: 20px;
}
.gallery-slider {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}
.gallery-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 4;
    border: none;
    cursor: pointer;
    font-size: 22px;
    font-weight: 700;
    color: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}
.gallery-arrow-left {
    left: -4px;
    background: linear-gradient(90deg, #0a0a16 50%, transparent);
}
.gallery-arrow-right {
    right: -4px;
    background: linear-gradient(-90deg, #0a0a16 50%, transparent);
}
.gallery-arrow:hover { color: #f5c542; }
.winner-gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 24px;
    scroll-snap-type: x mandatory;
}
.winner-gallery::-webkit-scrollbar { display: none; }
.gallery-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #1e1e35;
    transition: all 0.2s;
    flex-shrink: 0;
    scroll-snap-align: start;
}
.gallery-thumb:hover { border-color: #d4af37; transform: scale(1.08); }
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-thumb.locked-gallery {
    background: linear-gradient(135deg, #1a1028, #12121f);
    border-color: #d4af3733;
    cursor: pointer;
}
.gallery-thumb.locked-gallery:hover { border-color: #d4af37; }
.gallery-thumb.locked-gallery .locked-thumb-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #1e1530 0%, #0e0e1a 100%);
    border-radius: 8px;
}

.section-title {
    font-family: 'Raleway', sans-serif;
    font-size: 24px;
    color: #fff;
    text-align: center;
    margin-bottom: 4px;
}
.section-desc {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-bottom: 28px;
}

/* Chat CTA */
.chat-cta-section {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 48px;
    border: 1px solid #d4af3722;
    border-radius: 20px;
    background: linear-gradient(145deg, #14121f, #1a1630);
}
.chat-cta-section .section-title {
    margin-bottom: 20px;
}
.btn-chat-cta {
    font-size: 18px;
    padding: 16px 64px;
    letter-spacing: 1px;
}

.ranking-list { display: flex; flex-direction: column; gap: 6px; }
.ranking-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #12121f;
    border: 1px solid #1a1a30;
    border-radius: 12px;
    transition: all 0.2s;
}
.ranking-item:hover { background: #16162a; }
.ranking-item.is-winner {
    border-color: #d4af3744;
    background: linear-gradient(135deg, #1a1608, #12121f);
}
.rank-pos {
    width: 36px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #666;
    flex-shrink: 0;
}
.ranking-item:nth-child(1) .rank-pos,
.ranking-item:nth-child(2) .rank-pos,
.ranking-item:nth-child(3) .rank-pos { font-size: 22px; }
.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.rank-name {
    font-weight: 500;
    font-size: 14px;
    color: #fff;
    min-width: 90px;
}
.rank-bar-wrap {
    flex: 1;
    height: 6px;
    background: #1a1a30;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}
.rank-bar {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f5c542);
    border-radius: 3px;
    transition: width 1s ease;
}
.rank-rate {
    font-size: 14px;
    font-weight: 600;
    color: #d4af37;
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}
.rank-stats {
    font-size: 12px;
    color: #555;
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}

.restart-section {
    text-align: center;
    margin-top: 48px;
}
.btn-restart {
    padding: 14px 40px;
    background: transparent;
    border: 2px solid #d4af3744;
    color: #d4af37;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-restart:hover {
    background: #d4af37;
    color: #0a0a16;
    box-shadow: 0 4px 20px rgba(212,175,55,0.3);
}

/* Photo modal */
.photo-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s;
}
.photo-modal.hidden { display: none; }
.photo-modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .match-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 0 8px;
    }
    .girl-card { max-width: 360px; width: 100%; }
    .card-photo-main { aspect-ratio: 3/4; }
    .vs-badge {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }
    .card-name { font-size: 20px; }
    .tournament-header { padding: 16px 20px; }
    .hero-stats { gap: 32px; }
    .ranking-item { gap: 10px; padding: 10px 12px; }
    .rank-stats { display: none; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 36px; }
    .hero-subtitle { font-size: 14px; }
    .card-photo-main { aspect-ratio: 2/3; }
}
