/* ============================================
   SMART GAME IMPORT — CYBER AESTHETIC
   ============================================ */

.import-page {
    background: #0a0a0f;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.import-page *,
.import-page *::before,
.import-page *::after {
    box-sizing: border-box;
}

/* ── Ambient ── */
.import-page::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(0, 204, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.import-page::after {
    content: '';
    position: fixed;
    bottom: -15%;
    left: -10%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(255, 102, 204, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   HERO
   ============================================ */
.import-hero {
    text-align: center;
    padding: 7rem 1.5rem 2.5rem;
    position: relative;
    z-index: 2;
}

.import-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 204, 255, 0.09) 0%, rgba(255, 102, 204, 0.04) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.import-hero>* {
    position: relative;
    z-index: 1;
}

.import-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.5rem;
    letter-spacing: 0.5px;
    animation: impFadeInDown 0.8s ease-out;
}

.import-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 1rem;
    animation: impFadeInUp 0.8s ease-out;
}

.import-title .highlight {
    background: linear-gradient(135deg, #00CCFF 0%, #FF66CC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.import-subtitle {
    font-size: 1.05rem;
    color: #94a3b8;
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.8;
    animation: impFadeInUp 0.8s ease-out 0.15s both;
}

/* ============================================
   CONNECT SECTION
   ============================================ */
.import-connect {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    position: relative;
    z-index: 2;
}

.connect-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: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.connect-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00CCFF, #FF66CC, transparent);
}

/* ── Single Username Input ── */
.import-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0 18px;
    margin-bottom: 1.2rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.import-input-wrapper:focus-within {
    border-color: rgba(138, 43, 226, 0.55);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.15), 0 0 4px rgba(138, 43, 226, 0.1) inset;
}

.import-input-icon {
    font-size: 15px;
    color: #4a5568;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.import-input-wrapper:focus-within .import-input-icon {
    color: #8a2be2;
}

.import-username-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    padding: 16px 0;
    direction: ltr;
    text-align: left;
}

.import-username-input::placeholder {
    color: #4a5568;
    font-family: inherit;
}

/* ── Platform Selector Cards ── */
.platform-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 1.5rem;
}

.platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    color: #5a5969;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
}

.platform-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: #a0a0ab;
}

.platform-card-icon {
    font-size: 28px;
    opacity: 0.5;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.platform-card-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Active (selected) platform with Official Brand Colors */
.platform-card[data-platform="chesscom"].active {
    border-color: rgba(129, 182, 76, 0.6); /* #81b64c */
    background: rgba(129, 182, 76, 0.08);
    color: #fff;
    box-shadow: 0 4px 25px rgba(129, 182, 76, 0.18);
}

.platform-card[data-platform="lichess"].active {
    border-color: rgba(172, 172, 171, 0.6); /* #acacab */
    background: rgba(172, 172, 171, 0.08);
    color: #fff;
    box-shadow: 0 4px 25px rgba(172, 172, 171, 0.18);
}

.platform-card.active .platform-card-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Fetch button */
.fetch-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #000;
    background: linear-gradient(135deg, #00CCFF 0%, #FF66CC 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: impPulse 2.5s ease-in-out infinite;
}

.fetch-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 0 35px rgba(0, 204, 255, 0.4), 0 0 70px rgba(255, 102, 204, 0.2);
}

.fetch-btn:active {
    transform: translateY(0) scale(1);
}

.fetch-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.fetch-btn i {
    font-size: 0.9rem;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: impSpin 0.7s linear infinite;
    display: none;
}

.fetch-btn.loading .spinner {
    display: block;
}

.fetch-btn.loading .fetch-btn-text {
    display: none;
}

.fetch-btn.loading .fetch-btn-icon {
    display: none;
}

@keyframes impSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes impPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(0, 204, 255, 0.25), 0 0 40px rgba(255, 102, 204, 0.08);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 204, 255, 0.4), 0 0 60px rgba(255, 102, 204, 0.15);
    }
}

/* ============================================
   ERROR / STATUS MESSAGES
   ============================================ */
.import-message {
    text-align: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 1rem;
    display: none;
    animation: impFadeInUp 0.4s ease-out;
}

.import-message.show {
    display: block;
}

.import-message.error {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.import-message.success {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.import-message.info {
    background: rgba(0, 204, 255, 0.08);
    color: #00ccff;
    border: 1px solid rgba(0, 204, 255, 0.2);
}

/* ── Loading Dots Animation ── */
.loading-dots::after {
    content: '';
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* ============================================
   RESULTS DASHBOARD
   ============================================ */
.import-results {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    position: relative;
    z-index: 2;
    display: none;
}

.import-results.active {
    display: block;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 10px;
}

.results-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.results-count {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.results-platform-tabs {
    display: flex;
    gap: 8px;
}

.platform-tab {
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.platform-tab.active {
    background: rgba(0, 204, 255, 0.1);
    border-color: rgba(0, 204, 255, 0.3);
    color: #00CCFF;
}

/* ── Results Stats Dashboard ── */
.results-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.results-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-pill .sp-label {
    font-size: 0.7rem;
    opacity: 0.6;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-pill.win {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.05);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.05);
}

.stat-pill.win.active {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.stat-pill.loss {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
    background: rgba(248, 113, 113, 0.05);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.05);
}

.stat-pill.loss.active {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.2);
}

.stat-pill.draw {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(148, 163, 184, 0.05);
}

.stat-pill.draw.active {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 0 15px rgba(148, 163, 184, 0.2);
}

.stat-pill:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.05);
}

/* ── Game Cards List ── */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-card {
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    animation: impFadeInUp 0.5s ease-out both;
}

.game-card:hover {
    border-color: rgba(0, 204, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Result indicator bar */
.game-result-bar {
    width: 4px;
    height: 44px;
    border-radius: 4px;
    flex-shrink: 0;
}

.game-result-bar.win {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.game-result-bar.loss {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.game-result-bar.draw {
    background: #4a5568;
}

/* Game info */
.game-info {
    flex: 1;
    min-width: 0;
}

.game-opponent {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-opponent-rating {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
}

.game-meta {
    font-size: 0.75rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.game-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.game-meta i {
    font-size: 0.65rem;
}

/* ── Color Indicator ── */
.game-color-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    transition: all 0.3s ease;
    margin-inline-start: -4px; /* Move it closer to the time */
}

.game-color-indicator.white {
    color: #ffffff;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.game-color-indicator.black {
    color: #64748b; /* Sleek grey for black pieces on dark theme */
}

.game-card:hover .game-color-indicator {
    transform: scale(1.2);
}

/* Result badge */
.game-result-badge {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.game-result-badge.win {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.game-result-badge.loss {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.game-result-badge.draw {
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.2);
}

/* Accuracy */
.game-accuracy {
    font-size: 0.72rem;
    font-weight: 600;
    color: #00CCFF;
    flex-shrink: 0;
    text-align: center;
    width: 60px;
    min-width: 60px;
}

.game-accuracy .acc-value {
    font-size: 1rem;
    font-weight: 800;
    display: block;
}

.game-accuracy .acc-label {
    font-size: 0.6rem;
    color: #4a5568;
    text-transform: uppercase;
}

/* Analyze button */
.game-analyze-btn {
    padding: 8px 16px;
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 204, 255, 0.06);
    color: #00CCFF;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-analyze-btn:hover {
    background: rgba(0, 204, 255, 0.15);
    border-color: rgba(0, 204, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.2);
    transform: translateY(-1px);
}

.game-analyze-btn i {
    font-size: 0.7rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #4a5568;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   FOOTER
   ============================================ */
.import-footer {
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 40px 0;
    position: relative;
    z-index: 2;
}

.import-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.import-footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.import-footer-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.import-footer-links a:hover {
    color: #00CCFF;
}

.import-footer-copy {
    color: #3f3f46;
    font-size: 0.85rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes impFadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes impFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger game cards */
.game-card:nth-child(1) {
    animation-delay: 0.03s;
}

.game-card:nth-child(2) {
    animation-delay: 0.06s;
}

.game-card:nth-child(3) {
    animation-delay: 0.09s;
}

.game-card:nth-child(4) {
    animation-delay: 0.12s;
}

.game-card:nth-child(5) {
    animation-delay: 0.15s;
}

.game-card:nth-child(6) {
    animation-delay: 0.18s;
}

.game-card:nth-child(7) {
    animation-delay: 0.21s;
}

.game-card:nth-child(8) {
    animation-delay: 0.24s;
}

.game-card:nth-child(9) {
    animation-delay: 0.27s;
}

.game-card:nth-child(10) {
    animation-delay: 0.30s;
}

/* ============================================
   DIVIDER
   ============================================ */
.import-divider {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 204, 255, 0.3), rgba(255, 102, 204, 0.3), transparent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .import-hero {
        padding: 6rem 1rem 2rem;
    }

    .connect-card {
        padding: 1.5rem;
    }

    .game-card {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }

    .game-result-bar {
        width: 100%;
        height: 3px;
        order: -1;
    }

    .game-info {
        width: 100%;
    }

    .game-accuracy {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .game-accuracy .acc-value {
        font-size: 0.85rem;
        display: inline;
    }

    .game-accuracy .acc-label {
        display: inline;
    }

    .game-analyze-btn {
        width: 100%;
        justify-content: center;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .import-title {
        font-size: 1.7rem;
    }

    .import-input-wrapper {
        padding: 0 14px;
    }

    .import-username-input {
        font-size: 0.9rem;
        padding: 14px 0;
    }

    .platform-card {
        padding: 20px 12px;
    }

    .platform-card-icon {
        font-size: 24px;
    }
}

/* ============================================
   INLINE ANALYZER
   ============================================ */
.analyzer-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    position: relative;
    z-index: 2;
    display: none;
}

.analyzer-section.active {
    display: block;
    animation: impFadeInUp 0.5s ease-out;
}

/* Back button */
.analyzer-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 204, 255, 0.05);
    color: #00CCFF;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.analyzer-back-btn:hover {
    background: rgba(0, 204, 255, 0.12);
    border-color: rgba(0, 204, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.15);
}

/* ── 3-Column Grid ── */
.analyzer-grid {
    display: grid;
    grid-template-columns: 28px 1fr 340px;
    gap: 18px;
    align-items: start;
}

/* ── Eval Bar (Left) ── */
.eval-bar {
    width: 28px;
    height: 100%;
    min-height: 300px;
    background: #FF66CC;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    align-self: stretch;
    box-shadow: 0 0 10px rgba(255, 102, 204, 0.2);
}

.eval-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #00CCFF;
    transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.3);
}

.eval-bar-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 800;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    z-index: 1;
    pointer-events: none;
}

.eval-bar-label.white-label {
    top: 6px;
    color: #000;
}

.eval-bar-label.black-label {
    bottom: 6px;
    color: #fff;
}

/* ── Board (Center) ── */
.board-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
}

.board-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.15), rgba(255, 102, 204, 0.1));
    border-radius: 12px;
    z-index: -1;
    filter: blur(8px);
}

#analyzerBoard {
    width: 100%;
    height: 100%;
}

/* cm-chessboard overrides */
.board-wrapper .cm-chessboard .board .square.highlight {
    fill: rgba(0, 204, 255, 0.25) !important;
}

/* ── Nav Buttons ── */
.nav-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.nav-btn {
    width: 44px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    color: #FF66CC;
    border-color: rgba(255, 102, 204, 0.3);
    box-shadow: 0 0 12px rgba(255, 102, 204, 0.15);
    background: rgba(255, 102, 204, 0.06);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* ── Data Panel (Right) ── */
.data-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 160px);
}

/* PGN Input */
.pgn-input-box {
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    max-height: 200px;
    opacity: 1;
}

.pgn-input-box.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
}

.pgn-textarea {
    width: 100%;
    height: 100px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 12px;
    outline: none;
    resize: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    direction: ltr;
    text-align: left;
}

.pgn-textarea:focus {
    border-color: rgba(0, 204, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.12), 0 0 4px rgba(0, 204, 255, 0.08) inset;
}

.pgn-textarea::placeholder {
    color: #3e4a5c;
}

.pgn-load-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #00CCFF, #FF66CC);
    color: #000;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pgn-load-btn:hover {
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.3);
    transform: translateY(-1px);
}

/* Move List */
.move-list-panel {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
    max-height: 320px;
}

.move-list-title {
    padding: 10px 14px 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.move-list {
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 30px 1fr 1fr;
    gap: 2px 0;
}

.move-number {
    font-size: 0.72rem;
    color: #4a5568;
    font-weight: 600;
    padding: 4px 4px;
    display: flex;
    align-items: center;
}

.move-cell {
    padding: 4px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: 'Courier New', monospace;
}

.move-cell:hover {
    background: rgba(255, 255, 255, 0.06);
}

.move-cell.active {
    background: rgba(176, 125, 255, 0.25);
    color: #fff;
    box-shadow: 0 0 8px rgba(176, 125, 255, 0.15);
}

/* Engine Analysis */
.engine-panel {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 14px;
}

.engine-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.engine-eval {
    font-size: 1.4rem;
    font-weight: 900;
    color: #00CCFF;
    margin-bottom: 4px;
}

.engine-line {
    font-size: 0.78rem;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

.engine-depth {
    font-size: 0.65rem;
    color: #4a5568;
    margin-top: 4px;
}

/* Game Info Bar */
.analyzer-game-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.analyzer-game-info .agi-player {
    font-weight: 700;
    color: #e2e8f0;
}

.analyzer-game-info .agi-vs {
    color: #4a5568;
    font-weight: 600;
}

.analyzer-game-info .agi-result {
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .analyzer-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .eval-bar {
        width: 100%;
        height: 20px;
        min-height: auto;
        display: flex;
        flex-direction: row;
        border-radius: 4px;
    }

    .eval-bar-fill {
        height: 100%;
        width: 50%;
        transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .eval-bar-label {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }

    .eval-bar-label.white-label {
        top: 50%;
        left: 8px;
        transform: translateY(-50%);
    }

    .eval-bar-label.black-label {
        bottom: auto;
        top: 50%;
        right: 8px;
        left: auto;
        transform: translateY(-50%);
    }

    .board-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }

    .data-panel {
        max-height: none;
    }

    .move-list-panel {
        max-height: 200px;
    }
}