/* ============================================
   CHESS LEGENDS PAGE — CYBER AESTHETIC
   ============================================ */

/* ── Base ── */
.legends-page {
    background: #0a0a0f;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.legends-page *,
.legends-page *::before,
.legends-page *::after {
    box-sizing: border-box;
}

/* ── Ambient Background ── */
.legends-page::before {
    content: '';
    position: fixed;
    top: -25%;
    right: -15%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(0, 204, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.legends-page::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 102, 204, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Decorative Chess Symbols ── */
.bg-decor {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    font-size: 120px;
    opacity: 0.018;
    color: #fff;
    font-family: serif;
    user-select: none;
}

.bg-decor.d1 {
    top: 12%;
    left: 5%;
    transform: rotate(-15deg);
}

.bg-decor.d2 {
    top: 40%;
    right: 3%;
    transform: rotate(20deg);
}

.bg-decor.d3 {
    bottom: 15%;
    left: 10%;
    transform: rotate(-8deg);
}

.bg-decor.d4 {
    top: 65%;
    left: 45%;
    transform: rotate(12deg);
    font-size: 90px;
}

.bg-decor.d5 {
    bottom: 35%;
    right: 12%;
    transform: rotate(-25deg);
    font-size: 100px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.legends-hero {
    text-align: center;
    padding: 7rem 1.5rem 3.5rem;
    position: relative;
    z-index: 2;
}

.legends-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(0, 204, 255, 0.1) 0%, rgba(255, 102, 204, 0.05) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.legends-hero>* {
    position: relative;
    z-index: 1;
}

.legends-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 22px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #00CCFF;
    background: rgba(0, 204, 255, 0.08);
    border: 1px solid rgba(0, 204, 255, 0.25);
    margin-bottom: 1.8rem;
    letter-spacing: 0.5px;
    animation: fadeInDown 0.8s ease-out;
}

.legends-badge i {
    font-size: 0.8rem;
}

.legends-title {
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
    animation: fadeInUp 0.8s ease-out;
}

.legends-title .highlight {
    background: linear-gradient(135deg, #00CCFF 0%, #FF66CC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legends-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.15s both;
}

/* ============================================
   PLAYER GRID
   ============================================ */

/* ── Era-Specific Glow Colors ── */
.player-card[data-era="classic"] {
    --era-color: #222222;
    --era-color-rgb: 34, 34, 34;
}

/* Fix zoom icon visibility for classical era */
.player-card[data-era="classic"] .player-card-zoom {
    color: #cbd5e1;
    border-color: rgba(203, 213, 225, 0.4);
}

.player-card[data-era="soviet"] {
    --era-color: #800080;
    --era-color-rgb: 128, 0, 128;
}

.player-card[data-era="golden"] {
    --era-color: #FFD700;
    --era-color-rgb: 255, 215, 0;
}

.player-card[data-era="digital"] {
    --era-color: #00FFFF;
    --era-color-rgb: 0, 255, 255;
}

/* ============================================
   FILTER & SEARCH BAR
   ============================================ */
.legends-filter-bar {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 5;
}

.filter-bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
    justify-content: center;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn i {
    font-size: 0.72rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

.filter-btn:hover i {
    opacity: 1;
}

/* Active states per era */
.filter-btn.active {
    color: #fff;
    border-color: rgba(0, 204, 255, 0.4);
    background: rgba(0, 204, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.15);
}

.filter-btn.active i {
    opacity: 1;
}

.filter-btn[data-era="classic"].active {
    color: #C0C0C0;
    border-color: rgba(192, 192, 192, 0.4);
    background: rgba(192, 192, 192, 0.08);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.12);
}

.filter-btn[data-era="soviet"].active {
    color: #800080;
    border-color: rgba(128, 0, 128, 0.4);
    background: rgba(128, 0, 128, 0.08);
    box-shadow: 0 0 20px rgba(128, 0, 128, 0.12);
}

.filter-btn[data-era="golden"].active {
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.12);
}

.filter-btn[data-era="digital"].active {
    color: #00FFFF;
    border-color: rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.12);
}

/* Count badge */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.06);
    color: #64748b;
    transition: all 0.3s ease;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
}

/* Search input */
.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.filter-search i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.8rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

[dir="ltr"] .filter-search i {
    right: auto;
    left: 14px;
}

.filter-search input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.filter-search input::placeholder {
    color: #4a5568;
}

.filter-search input:focus {
    border-color: rgba(0, 204, 255, 0.3);
    background: rgba(0, 204, 255, 0.04);
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.08);
}

.filter-search input:focus+i,
.filter-search:focus-within i {
    color: #00CCFF;
}

/* ============================================
   PLAYER GRID LAYOUT
   ============================================ */

.legends-grid-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    position: relative;
    z-index: 2;
}

.legends-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
}

/* ── Player Card ── */
.player-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.player-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(var(--era-color-rgb, 0, 204, 255), 0.4);
    background: rgba(var(--era-color-rgb, 0, 204, 255), 0.12); 
    box-shadow: 0 0 35px rgba(var(--era-color-rgb, 0, 204, 255), 0.2),
        0 0 70px rgba(var(--era-color-rgb, 0, 204, 255), 0.08),
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Image container */
.player-card-img {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
}

.player-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    filter: grayscale(100%);
    transition: filter 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.player-card:hover .player-card-img img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Gradient overlay at bottom of image */
.player-card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(10, 10, 15, 1) 0%, transparent 100%);
    pointer-events: none;
}

/* Fallback with initials + neon king */
.player-card-fallback {
    width: 100%;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.06) 0%, rgba(255, 102, 204, 0.04) 100%);
}

.fallback-icon {
    font-size: 3.5rem;
    color: rgba(0, 204, 255, 0.15);
    text-shadow: 0 0 20px rgba(0, 204, 255, 0.1);
    line-height: 1;
}

.fallback-initials {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #00CCFF, #FF66CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
}

/* Neon glow ring on hover */
.player-card-img::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.3), rgba(255, 102, 204, 0.2));
    opacity: 0;
    z-index: -1;
    filter: blur(10px);
    transition: opacity 0.4s ease;
}

.player-card:hover .player-card-img::before {
    opacity: 1;
}

/* Card body */
.player-card-body {
    padding: 1rem 1.25rem 1.3rem;
    position: relative;
    z-index: 2;
    margin-top: -30px;
}

.player-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

.player-card-title {
    font-size: 0.8rem;
    color: #00CCFF;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.85;
}

.player-card-years {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
}

/* Era badge */
.player-card-era {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: rgba(var(--era-color-rgb, 0, 204, 255), 0.55);
    backdrop-filter: blur(8px);
    z-index: 3;
    letter-spacing: 0.3px;
    border: 1px solid rgba(var(--era-color-rgb, 0, 204, 255), 0.3);
}

/* Zoom button */
.player-card-zoom {
    position: absolute;
    bottom: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(var(--era-color-rgb, 0, 204, 255), 0.3);
    color: var(--era-color, #00CCFF);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.6;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.player-card-zoom:hover {
    opacity: 1;
    background: rgba(var(--era-color-rgb, 0, 204, 255), 0.3);
    border-color: var(--era-color, #00CCFF);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(var(--era-color-rgb, 0, 204, 255), 0.4);
}

.player-card-zoom i {
    font-size: 0.9rem;
}

[dir="rtl"] .player-card-zoom {
    left: 14px;
    right: auto;
}

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 2rem;
}

.image-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    animation: lightboxZoom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lightboxZoom {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.lightbox-neon-border {
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #00CCFF, #FF66CC);
    z-index: 1;
    filter: blur(8px);
    opacity: 0.5;
}

.lightbox-close {
    position: absolute;
    top: -45px;
    right: -10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
    z-index: 5;
}

.lightbox-close:hover {
    color: #FF66CC;
    transform: scale(1.2);
}

/* Filter animations */
.player-card.card-hidden {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.player-card.card-visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* No results message */
.no-results-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
    font-size: 1.1rem;
}

.no-results-msg i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #374151;
}

[dir="rtl"] .player-card-era {
    left: auto;
    right: 12px;
}

/* ============================================
   LEGEND DETAIL — FULL PAGE
   ============================================ */
.legend-detail {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: #0a0a0f;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.legend-detail.active {
    display: block;
    opacity: 1;
}

/* Neon smoke ambient */
.detail-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0, 204, 255, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 102, 204, 0.04) 0%, transparent 55%);
}

/* Back button */
.detail-back-btn {
    position: sticky;
    top: 20px;
    right: 24px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    margin: 20px 24px 0;
    border: 1px solid rgba(0, 204, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 204, 255, 0.07);
    backdrop-filter: blur(12px);
    color: #00CCFF;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.detail-back-btn:hover {
    background: rgba(0, 204, 255, 0.15);
    box-shadow: 0 0 25px rgba(0, 204, 255, 0.2);
    border-color: rgba(0, 204, 255, 0.5);
}

.detail-back-btn:hover i {
    transform: translateX(4px);
}

.detail-back-btn i {
    transition: transform 0.3s ease;
}

/* Two-column layout */
.detail-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

/* ── Player Spotlight (Right) ── */
.detail-spotlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.spotlight-img-wrap {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 4 / 5;
    border-radius: 16px;
    overflow: hidden;
}

.spotlight-glow {
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.25), rgba(255, 102, 204, 0.2));
    filter: blur(20px);
    z-index: 0;
    opacity: 0.7;
    animation: glowPulse 4s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 0.9;
    }
}

.spotlight-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    z-index: 1;
    animation: fadeInImg 0.8s ease-out both;
}

@keyframes fadeInImg {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spotlight-fallback {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.06), rgba(255, 102, 204, 0.04));
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    z-index: 1;
}

.spotlight-fallback .fallback-icon {
    font-size: 5rem;
    color: rgba(0, 204, 255, 0.12);
    text-shadow: 0 0 30px rgba(0, 204, 255, 0.1);
}

.spotlight-fallback .fallback-initials {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #00CCFF, #FF66CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.spotlight-info {
    text-align: center;
    width: 100%;
}

.spotlight-era {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.6), rgba(255, 102, 204, 0.6));
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.spotlight-name {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #00CCFF 50%, #FF66CC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    line-height: 1.3;
}

.spotlight-name-en {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
}

.spotlight-title {
    font-size: 0.9rem;
    color: #00CCFF;
    font-weight: 600;
    margin-bottom: 1.2rem;
    opacity: 0.9;
}

.spotlight-bio {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.9;
    max-width: 360px;
    margin: 0 auto;
}

/* ── Masterpieces List (Left) ── */
.detail-games {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-games-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(0, 204, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.detail-games-header i {
    font-size: 0.85rem;
}

.detail-games-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Game Card ── */
.detail-game-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.detail-game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 204, 255, 0.4), rgba(255, 102, 204, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.detail-game-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 204, 255, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 204, 255, 0.08);
}

.detail-game-card:hover::before {
    opacity: 1;
}

.detail-game-card.expanded {
    border-color: rgba(0, 204, 255, 0.3);
    background: rgba(0, 204, 255, 0.04);
}

.game-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.game-card-color {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-card-color.white-piece {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.game-card-color.black-piece {
    background: rgba(0, 0, 0, 0.4);
    color: #94a3b8;
}

.game-card-info {
    flex: 1;
    min-width: 0;
}

.game-card-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    color: #64748b;
}

.game-card-opening {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.game-card-opening i {
    font-size: 0.6rem;
    color: #FF66CC;
}

/* Accuracy neon circle */
.game-card-accuracy {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.accuracy-ring {
    width: 38px;
    height: 38px;
    position: relative;
}

.accuracy-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.accuracy-ring .ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
}

.accuracy-ring .ring-fill {
    fill: none;
    stroke: #00CCFF;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.accuracy-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 800;
    color: #00CCFF;
}

/* Result badge */
.game-card-result {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.game-card-result.win {
    color: #00CCFF;
    background: rgba(0, 204, 255, 0.12);
    border: 1px solid rgba(0, 204, 255, 0.2);
}

.game-card-result.draw {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.game-card-result.loss {
    color: #FF66CC;
    background: rgba(255, 102, 204, 0.1);
    border: 1px solid rgba(255, 102, 204, 0.2);
}

/* Expanded area */
.game-card-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        padding 0.3s ease;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.detail-game-card.expanded .game-card-expand {
    max-height: 120px;
    padding-top: 14px;
}

.game-review-btn, .game-analyze-btn, .game-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-review-btn {
    border: 1px solid rgba(255, 102, 204, 0.35);
    background: rgba(255, 102, 204, 0.08);
    color: #FF66CC;
}

.game-review-btn:hover {
    background: rgba(255, 102, 204, 0.18);
    box-shadow: 0 0 20px rgba(255, 102, 204, 0.2);
    border-color: rgba(255, 102, 204, 0.5);
}

.game-analyze-btn {
    border: 1px solid rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.08);
    color: #00E5FF;
}

.game-analyze-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
    border-color: rgba(0, 229, 255, 0.6);
}

.game-copy-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    padding: 8px 12px;
}

.game-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.game-review-btn i, .game-analyze-btn i, .game-copy-btn i {
    font-size: 0.75rem;
}

/* ============================================
   BOARD POPUP MODAL
   ============================================ */
.board-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
}

.board-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.board-popup-panel {
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: min(500px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 204, 255, 0.1),
        0 0 120px rgba(255, 102, 204, 0.05);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.board-popup-overlay.active .board-popup-panel {
    transform: scale(1);
}

.board-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.board-popup-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.board-popup-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.board-popup-close:hover {
    background: rgba(255, 102, 204, 0.12);
    border-color: rgba(255, 102, 204, 0.3);
    color: #FF66CC;
}

.board-popup-body {
    padding: 20px;
}

.board-popup-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.board-popup-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.board-popup-move-info {
    text-align: center;
    margin-top: 10px;
    font-size: 0.78rem;
    color: #64748b;
}

/* Board nav buttons (shared) */
.board-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.board-nav-btn:hover {
    background: rgba(0, 204, 255, 0.1);
    border-color: rgba(0, 204, 255, 0.3);
    color: #00CCFF;
}

.board-nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* ============================================
   FOOTER (matches about.html)
   ============================================ */
.legends-footer {
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 40px 0;
    position: relative;
    z-index: 2;
}

.legends-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.legends-footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legends-footer-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.legends-footer-links a:hover {
    color: #00CCFF;
}

.legends-footer-copy {
    color: #3f3f46;
    font-size: 0.85rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger cards */
.player-card {
    animation: fadeInUp 0.6s ease-out both;
}

.player-card:nth-child(1) {
    animation-delay: 0.05s;
}

.player-card:nth-child(2) {
    animation-delay: 0.1s;
}

.player-card:nth-child(3) {
    animation-delay: 0.15s;
}

.player-card:nth-child(4) {
    animation-delay: 0.2s;
}

.player-card:nth-child(5) {
    animation-delay: 0.25s;
}

.player-card:nth-child(6) {
    animation-delay: 0.3s;
}

.player-card:nth-child(7) {
    animation-delay: 0.35s;
}

.player-card:nth-child(8) {
    animation-delay: 0.4s;
}

.player-card:nth-child(9) {
    animation-delay: 0.45s;
}

.player-card:nth-child(10) {
    animation-delay: 0.5s;
}

.player-card:nth-child(11) {
    animation-delay: 0.55s;
}

.player-card:nth-child(12) {
    animation-delay: 0.6s;
}

.player-card:nth-child(13) {
    animation-delay: 0.65s;
}

.player-card:nth-child(14) {
    animation-delay: 0.7s;
}

.player-card:nth-child(15) {
    animation-delay: 0.75s;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .legends-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.4rem;
    }

    .detail-layout {
        gap: 2rem;
    }

    .filter-bar-inner {
        gap: 12px;
        padding: 12px 16px;
    }

    .filter-btn {
        padding: 7px 12px;
        font-size: 0.78rem;
    }
}

@media (max-width: 768px) {
    .legends-hero {
        padding: 6rem 1rem 2.5rem;
    }

    .legends-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .filter-bar-inner {
        flex-direction: column;
        gap: 12px;
    }

    .filter-search {
        max-width: 100%;
        width: 100%;
    }

    .filter-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 5px;
    }

    .filter-btn i {
        font-size: 0.65rem;
    }

    .player-card-img {
        height: 220px;
    }

    /* Detail page: single column, portrait on top */
    .detail-layout {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem 3rem;
        gap: 2rem;
    }

    .spotlight-img-wrap {
        max-width: 260px;
    }

    .spotlight-bio {
        max-width: 100%;
    }

    .board-popup-panel {
        width: 96vw;
        max-height: 85vh;
        border-radius: 14px;
    }

    .board-popup-container {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .legends-title {
        font-size: 1.8rem;
    }

    .player-card-img {
        height: 200px;
    }

    .detail-back-btn {
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .spotlight-name {
        font-size: 1.5rem;
    }
}

/* ── Section divider ── */
.legends-divider {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 204, 255, 0.3), rgba(255, 102, 204, 0.3), transparent);
}