/* ============================================
   Ultimate Aura Analyzer — Ultra-Modern Glassmorphism
   Maximized Board & Side-Player Layout
   ============================================ */

/* ── Page Reset & Base ── */
.analyzer-page {
    min-height: 100vh;
    background: #000000;
    color: #ffffff;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

/* ── 3-Column Layout (70/30 Split) ── */
.analyzer-layout {
    display: grid;
    grid-template-columns: 36px auto minmax(300px, 400px);
    gap: 10px;
    max-width: 1800px;
    margin: 0 auto 80px auto;
    padding: 70px 12px 12px;
    align-items: start;
    justify-content: center;
    height: calc(100vh - 70px);
}

/* The grid order will naturally flip in RTL (dir="rtl") 
   so we don't need manual grid-column overrides. */

/* ════════════════════════════════════════════
   ARENA STYLE EVALUATION BAR
   ════════════════════════════════════════════ */
.eval-bar-container {
    width: 32px;
    background: #111;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: center;
    height: calc(100% - 120px); /* Reduce height significantly */
    transition: width 0.3s ease, opacity 0.3s ease;
}

.eval-bar-container.is-flipped {
    flex-direction: column;
}

.eval-bar-fill {
    width: 100%;
    background: #fff;
    height: 50%;
    transition: height 0.3s ease;
}

.eval-bar-score {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    z-index: 2;
    color: #000; /* Start black since it will be at bottom */
    bottom: 10px; /* Instead of top: 10px, match initial 50% state */
    top: auto;
    pointer-events: none;
    direction: ltr;
}

/* ════════════════════════════════════════════
   BOARD SECTION (Maximized)
   ════════════════════════════════════════════ */
.analyzer-board-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: relative;
    align-self: start;
    /* Board + player bars must fit in viewport height */
    max-width: calc(100vh - 180px);
    width: calc(100vh - 180px);
}

/* ── Peripheral Player Identity — Glass Cards ── */
.board-player-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(10, 14, 20, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 5;
    transition: all 0.3s ease;
}

.board-player-bar.top-bar {
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    border-color: rgba(204, 0, 255, 0.15);
    box-shadow:
        0 -4px 20px rgba(204, 0, 255, 0.06),
        inset 0 1px 0 rgba(204, 0, 255, 0.1);
}

.board-player-bar.bottom-bar {
    border-radius: 0 0 12px 12px;
    border-top: none;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* -- Flipping Logic — Vertical Slide -- */
.analyzer-board-wrapper, .popup-board-wrapper {
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

/* We removed the .is-flipped column-reverse here because the JavaScript 
   updatePlayerLabels() now dynamically maps players to top/bottom bars 
   based on orientation. CSS flipping would double-reverse the names. */



.bp-avatar {
    width: 32px; height: 32px;
    border-radius: 50%; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

.bp-avatar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    z-index: -1;
}

.black-avatar::after {
    background: linear-gradient(135deg, #333, #000);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.white-avatar::after {
    background: linear-gradient(135deg, #fff, #ddd);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.bp-avatar img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.bp-avatar-fallback {
    font-size: 16px; opacity: 0.7;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
.bp-avatar img[src=''] { display: none; }
.bp-avatar img[src=''] + .bp-avatar-fallback { display: flex; }

[dir="rtl"] .bp-elo {
    margin-inline-start: 10px;
    margin-inline-end: auto;
}

.bp-name {
    font-family: 'Montserrat', 'Cairo', sans-serif;
    font-size: 13px; font-weight: 800; color: #e2e8f0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.bp-elo {
    font-size: 12px; font-weight: 700;
    margin-inline-start: auto;
    font-family: 'Montserrat', sans-serif;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.top-bar .bp-elo {
    color: #CC00FF;
    border: 1px solid rgba(204, 0, 255, 0.2);
}

.bottom-bar .bp-elo {
    color: #00E5FF;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.analyzer-board-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: visible;
    position: relative;
    z-index: 1;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 229, 255, 0.03),
        0 0 20px rgba(204, 0, 255, 0.02);
}

/* ── On-Board Move Icon Overlay ── */
.onboard-move-icon {
    position: absolute;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    pointer-events: none;
    transition: all 0.3s ease;
    animation: iconPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.onboard-move-icon.quality-aura { filter: drop-shadow(0 0 8px #CC00FF); }
.onboard-move-icon.quality-brilliant { filter: drop-shadow(0 0 8px #00E5FF); }
.onboard-move-icon.quality-great { filter: drop-shadow(0 0 6px rgba(59,130,246,0.8)); }
.onboard-move-icon.quality-best { filter: drop-shadow(0 0 6px rgba(92,184,92,0.8)); }
.onboard-move-icon.quality-good { filter: drop-shadow(0 0 4px rgba(255,255,255,0.4)); }
.onboard-move-icon.quality-book { filter: drop-shadow(0 0 6px rgba(217,119,6,0.8)); }
.onboard-move-icon.quality-inaccuracy { filter: drop-shadow(0 0 6px rgba(250,204,21,0.8)); }
.onboard-move-icon.quality-mistake { filter: drop-shadow(0 0 6px rgba(249,115,22,0.8)); }
.onboard-move-icon.quality-blunder { filter: drop-shadow(0 0 8px #ef4444); }
.onboard-move-icon.quality-miss { filter: drop-shadow(0 0 8px #ef4444); }

@keyframes iconPop {
    0% { transform: scale(0) rotate(-20deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* cm-chessboard Marker Overrides */
.analyzer-board-container .cm-chessboard .marker.frame .marker-frame {
    stroke: #00E5FF !important;
    stroke-width: 3px !important;
    opacity: 0.8 !important;
    filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.6));
}

.analyzer-board-container .cm-chessboard .marker.framePrimary .marker-frame {
    stroke: #00E5FF !important;
    stroke-width: 3px !important;
    opacity: 0.6 !important;
}

.analyzer-board-container .cm-chessboard .marker.square .marker-square {
    fill: rgba(0, 229, 255, 0.15) !important;
}

.analyzer-board-container .cm-chessboard .coordinates .coordinate {
    font-weight: 700 !important;
    opacity: 0.85 !important;
}

.analyzer-board-container .cm-chessboard.default .coordinates .coordinate.black { fill: rgba(255,255,255,0.85) !important; }
.analyzer-board-container .cm-chessboard.default .coordinates .coordinate.white { fill: rgba(100,140,160,0.9) !important; }
.analyzer-board-container .cm-chessboard.green .coordinates .coordinate.black { fill: rgba(224,221,204,0.9) !important; }
.analyzer-board-container .cm-chessboard.green .coordinates .coordinate.white { fill: rgba(50,90,55,0.9) !important; }
.analyzer-board-container .cm-chessboard.blue .coordinates .coordinate.black { fill: rgba(255,255,255,0.85) !important; }
.analyzer-board-container .cm-chessboard.blue .coordinates .coordinate.white { fill: rgba(60,100,140,0.9) !important; }
.analyzer-board-container .cm-chessboard.chess-club .coordinates .coordinate.black { fill: rgba(230,211,177,0.9) !important; }
.analyzer-board-container .cm-chessboard.chess-club .coordinates .coordinate.white { fill: rgba(120,70,30,0.9) !important; }
.analyzer-board-container .cm-chessboard.chessboard-js .coordinates .coordinate.black { fill: rgba(240,217,181,0.9) !important; }
.analyzer-board-container .cm-chessboard.chessboard-js .coordinates .coordinate.white { fill: rgba(120,85,55,0.9) !important; }
.analyzer-board-container .cm-chessboard.black-and-white .coordinates .coordinate.black { fill: rgba(255,255,255,0.9) !important; }
.analyzer-board-container .cm-chessboard.black-and-white .coordinates .coordinate.white { fill: rgba(80,80,80,0.9) !important; }

/* ════════════════════════════════════════════
   SIDEBAR DATA PANEL (100vh Fixed)
   ════════════════════════════════════════════ */
.data-panel {
    background: rgba(10, 14, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - 82px);
    overflow: hidden;
    position: sticky;
    top: 70px;
}

.data-panel-inner {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

/* ── PGN Input Section ── */
.pgn-input-section {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding: 14px;
}
.pgn-input-section.hidden {
    max-height: 0; opacity: 0; margin: 0; padding: 0; pointer-events: none;
}

.pgn-input-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: #00E5FF;
    text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px;
}
.pgn-input-label i { font-size: 14px; }

.pgn-textarea {
    width: 100%;
    min-height: 160px;
    background: rgba(0, 229, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(0, 229, 255, 0.25);
    border-radius: 12px;
    padding: 14px;
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.08);
}
.pgn-textarea::placeholder { color: #4a5568; font-family: 'Cairo', sans-serif; }
.pgn-textarea:focus {
    border-color: #00E5FF;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12), 0 0 20px rgba(0, 229, 255, 0.15);
}

.pgn-actions { display: flex; gap: 10px; margin-top: 12px; }

.pgn-btn {
    flex: 1; padding: 10px 16px; border-radius: 10px;
    font-family: 'Cairo', sans-serif; font-size: 14px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 6px; transition: all 0.3s ease; border: none;
}
.pgn-btn-analyze {
    background: linear-gradient(135deg, #00E5FF 0%, #00b8cc 100%);
    color: #000; box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}
.pgn-btn-analyze:hover { box-shadow: 0 0 25px rgba(0, 229, 255, 0.5); transform: translateY(-2px); }
.pgn-btn-sample {
    background: rgba(255, 255, 255, 0.06); color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.pgn-btn-sample:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ── Analysis Section ── */
.analysis-section {
    display: none; flex-direction: column; gap: 0;
    animation: fadeSlideIn 0.5s ease-out;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.analysis-section.active { display: flex; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════ */
.analysis-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    padding: 0 14px;
    flex-shrink: 0;
}

.tab-btn {
    flex: 1; background: transparent; border: none;
    color: #64748b; padding: 11px 8px;
    font-family: 'Cairo', sans-serif; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.3s ease;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-btn:hover { color: #e2e8f0; }
.tab-btn.active {
    color: #00E5FF;
    border-bottom-color: #00E5FF;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent outer scrolling for analysis tab specifically */
    min-height: 0;
    padding: 0 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,229,255,0.15) transparent;
}

.tab-content::-webkit-scrollbar { width: 4px; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.tab-content::-webkit-scrollbar-thumb {
    background: rgba(0,229,255,0.15); border-radius: 2px;
}
.tab-content::-webkit-scrollbar-thumb:hover { background: rgba(0,229,255,0.3); }

.tab-pane {
    display: none; flex-direction: column; gap: 12px;
    animation: fadeSlideIn 0.3s ease-out; height: 100%;
    padding-bottom: 10px;
    padding-top: 14px;
    overflow: hidden; /* Default to hidden for flex layouts like Analysis */
}

#tab-report {
    overflow-y: auto; /* Report tab needs to scroll its entire content */
}

#tab-analysis {
    flex-direction: column;
    min-height: 0; /* Critical for flex child scrolling */
}

.tab-pane.active { display: flex; }

/* ════════════════════════════════════════════
   REPORT TAB
   ════════════════════════════════════════════ */

/* ── Result Badge (inline in accuracy section) ── */
.report-result-row {
    display: flex; justify-content: center; margin-bottom: 6px;
}
.rp-result-badge {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 6px; padding: 2px 14px;
    font-size: 13px; font-weight: 800; color: #00E5FF;
    letter-spacing: 1px;
}

/* ── Accuracy Row ── */
.accuracy-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
}
.acc-card {
    flex: 1; text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 10px; padding: 10px 8px;
}
.acc-card.black-acc { border-color: rgba(204, 0, 255, 0.15); }

.acc-val {
    display: block;
    font-size: 26px; font-weight: 800; color: #fff;
    font-family: 'Montserrat', sans-serif;
}
.acc-bar-track {
    height: 4px; background: rgba(255, 255, 255, 0.08);
    border-radius: 2px; overflow: hidden; margin-top: 6px;
}
.acc-bar-fill {
    height: 100%; width: 0%; border-radius: 2px;
    background: #00E5FF;
    transition: width 0.6s ease;
}
.black-acc .acc-bar-fill { background: #CC00FF; }

.acc-center {
    text-align: center; flex-shrink: 0;
    font-size: 11px; font-weight: 700; color: #64748b;
}
.acc-center i { display: block; font-size: 16px; color: #00E5FF; margin-bottom: 2px; }

/* ── ELO Row ── */
.elo-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
}
.elo-box {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px; padding: 6px 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px; font-weight: 800; color: #fff;
}
.elo-box i { font-size: 12px; color: #00E5FF; }
.black-elo i { color: #CC00FF; }
.elo-label {
    font-size: 11px; font-weight: 800; color: #64748b;
    text-transform: uppercase; letter-spacing: 1px;
}

/* ── Interactive Eval Graph ── */
.eval-graph-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    cursor: crosshair;
    flex-shrink: 0;
}
.eval-graph-container canvas {
    display: block;
    width: 100%;
    height: 90px;
}
.eval-graph-cursor {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: rgba(0, 229, 255, 0.6);
    pointer-events: none;
    display: none;
    z-index: 2;
    box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

/* ── Eval Graph Hover Tooltip ── */
.eval-graph-tooltip {
    position: absolute;
    top: 4px;
    left: 0;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 100;
    display: none;
    background: rgba(15, 23, 35, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.eval-graph-tooltip::after {
    display: none;
}

.egt-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.egt-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.egt-eval {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: -0.02em;
}

.egt-move {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 2px;
}

.eval-graph-container:hover .eval-graph-tooltip {
    display: block;
}
.eval-graph-container:hover .eval-graph-cursor { display: block; }

/* ── Classification Feed (Custom Scroll) ── */
.classification-feed {
    display: flex; flex-direction: column; gap: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.cf-header {
    display: grid;
    grid-template-columns: 1fr 50px 60px 60px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px 6px 12px;
    font-size: 13px; font-weight: 800; color: #64748b;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.3);
}

.cf-row {
    display: grid;
    grid-template-columns: 1fr 50px 60px 60px;
    gap: 10px;
    align-items: center;
    padding: 7px 12px;
    transition: background 0.2s;
}
.cf-row:hover { background: rgba(255, 255, 255, 0.03); }

/* ── Collapsible Stats UI ── */
.toggle-stats-btn {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Montserrat', 'Cairo', sans-serif;
    outline: none;
}

.toggle-stats-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toggle-stats-btn i {
    font-size: 12px;
    transition: transform 0.4s ease;
}

.toggle-stats-btn.active i {
    transform: rotate(180deg);
}

.extra-stats-collapsible {
    max-height: 1000px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.extra-stats-collapsible.hidden {
    display: block !important; /* Keep it in DOM for transition */
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    margin-top: 0;
    margin-bottom: 0;
}

/* Unified Ordering + Alignment */
.cf-name, .cf-h-name { 
    order: 1; 
    text-align: right; 
    font-size: 13px; 
    font-weight: 700; 
    color: #cbd5e1; 
}
.cf-h-name { color: #64748b; font-weight: 800; font-size: 13px; }

.cf-icon, .cf-h-icon { 
    order: 2; 
    justify-self: center; 
    font-size: 14px; 
    font-weight: 800; 
    font-family: 'Montserrat', sans-serif;
}

.cf-w, .cf-h-w { 
    order: 3; 
    justify-self: center; 
    text-align: center; 
    font-size: 14px; 
    font-weight: 800; 
    font-family: 'Montserrat', sans-serif;
}

.cf-b, .cf-h-b { 
    order: 4; 
    justify-self: center; 
    text-align: center; 
    font-size: 14px; 
    font-weight: 800; 
    font-family: 'Montserrat', sans-serif;
}

/* Coloring the labels and numbers to match the icons */
.cf-row[data-type="aura"] :is(.cf-name, .cf-w, .cf-b) { color: #CC00FF; text-shadow: 0 0 6px rgba(204,0,255,0.4); }
.cf-row[data-type="brilliant"] :is(.cf-name, .cf-w, .cf-b) { color: #00E5FF; text-shadow: 0 0 6px rgba(0,229,255,0.4); }
.cf-row[data-type="critical"] :is(.cf-name, .cf-w, .cf-b) { color: #7197ba; }
.cf-row[data-type="best"] :is(.cf-name, .cf-w, .cf-b) { color: #5cb85c; }
.cf-row[data-type="excellent"] :is(.cf-name, .cf-w, .cf-b) { color: #7fb44b; }
.cf-row[data-type="good"] :is(.cf-name, .cf-w, .cf-b) { color: #4ade80; }
.cf-row[data-type="book"] :is(.cf-name, .cf-w, .cf-b) { color: #d97706; }
.cf-row[data-type="forced"] :is(.cf-name, .cf-w, .cf-b) { color: #94ae8b; }
.cf-row[data-type="inaccuracy"] :is(.cf-name, .cf-w, .cf-b) { color: #facc15; }
.cf-row[data-type="mistake"] :is(.cf-name, .cf-w, .cf-b) { color: #f97316; }
.cf-row[data-type="miss"] :is(.cf-name, .cf-w, .cf-b) { color: #ef4444; }
.cf-row[data-type="blunder"] :is(.cf-name, .cf-w, .cf-b) { color: #ef4444; }

.cf-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    margin: 4px 0;
}

/* Classification Colors */
.aura-glow {
    color: #CC00FF;
    text-shadow: 0 0 8px #CC00FF, 0 0 16px #00E5FF;
    font-style: italic; font-size: 15px;
}
.brilliant-glow {
    color: #00E5FF;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}
.great-mark { color: #3b82f6; }
.book-mark { font-size: 13px; }
.inaccuracy-mark { color: #facc15; }
.mistake-mark { color: #f97316; font-size: 16px; }
.blunder-mark { color: #ef4444; }

/* ════════════════════════════════════════════
   ANALYSIS TAB
   ════════════════════════════════════════════ */

/* Engine Header */
.engine-live {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px; padding: 10px 14px;
    flex-shrink: 0;
}
.engine-toggle { display: flex; align-items: center; gap: 12px; }
.live-eval { font-size: 20px; font-weight: 800; color: #fff; font-family: 'Montserrat', sans-serif; }

.engine-depth-info {
    text-align: left; font-size: 12px; color: #00E5FF; font-weight: 700;
}
.engine-depth-info i { margin-left: 4px; }
.engine-depth-info small { color: #64748b; font-weight: 600; }

/* Switch */
.switch { position: relative; display: inline-block; width: 36px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155; transition: .3s; border-radius: 18px;
}
.slider:before {
    position: absolute; content: ""; height: 14px; width: 14px;
    left: 2px; bottom: 2px; background-color: white;
    transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: #CC00FF; }
input:checked + .slider:before { transform: translateX(18px); }

/* Engine Lines */
.engine-lines-container { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

.engine-line {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px;
    background: rgba(0, 229, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.06);
}
.engine-eval {
    font-size: 13px; font-weight: 800; min-width: 44px;
    text-align: center; padding: 2px 6px; border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
}
.engine-eval.positive { color: #00E5FF; background: rgba(0, 229, 255, 0.1); }
.engine-eval.negative { color: #CC00FF; background: rgba(204, 0, 255, 0.1); }
.engine-eval.even { color: #94a3b8; background: rgba(255, 255, 255, 0.05); }

.engine-moves {
    font-size: 12px; color: #8a95a6;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* ════════════════════════════════════════════
   ANALYSIS TAB — Engine Status Card
   ════════════════════════════════════════════ */
.engine-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #151B22;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.esc-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.esc-depth {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #00F2FF;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
}

.esc-depth i {
    font-size: 13px;
    opacity: 0.9;
}

.esc-depth strong {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: #00F2FF;
}

.esc-engine-name {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.esc-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.esc-eval-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    direction: ltr;
}

.esc-eval-number sup {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    vertical-align: super;
    margin-inline-start: 1px;
}

/* ── Toggle Switch (Magenta Neon) ── */
.esc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.esc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.esc-toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #334155;
    border-radius: 24px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.esc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.esc-toggle input:checked + .esc-toggle-slider {
    background: #D500F9;
    box-shadow: 0 0 16px rgba(213, 0, 249, 0.4);
}

.esc-toggle input:checked + .esc-toggle-slider::before {
    transform: translateX(20px);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ════════════════════════════════════════════
/* ── Engine Controls Toolbar ── */
.engine-controls-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(21, 27, 34, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    flex-shrink: 0;
    margin-top: -6px;
    margin-bottom: 2px;
}

.ect-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ect-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ect-depth-btns {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ect-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: 'Cairo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ect-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.ect-btn.active {
    background: rgba(0, 242, 255, 0.15);
    color: #00F2FF;
}

.ect-icon-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.ect-icon-btn i { font-size: 12px; }

.ect-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.ect-icon-btn.active {
    background: rgba(204, 0, 255, 0.15);
    border-color: rgba(204, 0, 255, 0.3);
    color: #CC00FF;
    text-shadow: 0 0 8px rgba(204, 0, 255, 0.4);
}

.ect-icon-btn#multiPvToggle.active {
    background: rgba(0, 242, 255, 0.15);
    border-color: rgba(0, 242, 255, 0.3);
    color: #00F2FF;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.4);
}

.ect-icon-btn#threatToggle.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ════════════════════════════════════════════
   ANALYSIS TAB — Lines List
   ════════════════════════════════════════════ */
.analysis-lines-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}



.al-secondary {
    background: rgba(13, 17, 23, 0.6);
    opacity: 0; 
    height: 0; 
    padding: 0; 
    margin: 0; 
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.al-secondary.show {
    opacity: 1;
    height: auto;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.al-rank {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #4a5568;
    background: rgba(255, 255, 255, 0.05);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.analysis-line-row:first-child .al-rank {
    color: #e2e8f0;
    background: rgba(0, 242, 255, 0.15);
}

.analysis-line-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #0D1117;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    transition: all 0.25s ease;
    cursor: pointer;
    gap: 10px;
}

.analysis-line-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.al-moves {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #ABB1BA;
    letter-spacing: 0.5px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    direction: ltr;
    text-align: right;
}

.al-eval-pill {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.2px;
    direction: ltr;
}

.al-pill-negative {
    background: #4A148C;
    color: #F3E5F5;
    box-shadow: 0 0 10px rgba(74, 20, 140, 0.3);
}

.al-pill-positive {
    background: #006064;
    color: #E0F7FA;
    box-shadow: 0 0 10px rgba(0, 96, 100, 0.3);
}

.al-pill-even {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

/* ════════════════════════════════════════════
   ANALYSIS TAB — Move Annotation Card
   ════════════════════════════════════════════ */
.move-annotation-card {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    flex-shrink: 0;
    animation: macSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.move-annotation-card.mac-visible {
    display: flex;
}

@keyframes macSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Icon Wrapper (Colored Circle) ── */
.mac-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.mac-icon-wrapper img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

/* ── Content Area ── */
.mac-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.mac-title {
    font-family: 'Cairo', 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Description (Explanation Text) ── */
.mac-description {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: 2px;
    display: none;
}
.mac-description.mac-desc-visible {
    display: block;
}

/* ── Best Move Hint ── */
.mac-best-hint {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4ade80;
    line-height: 1.3;
    margin-top: 4px;
    flex-wrap: wrap;
}
.mac-best-hint.mac-hint-visible {
    display: flex;
}
.mac-hint-icon {
    font-size: 12px;
    color: #fbbf24;
    opacity: 0.9;
    flex-shrink: 0;
}
.mac-best-text {
    color: #4ade80;
    opacity: 0.85;
}
.mac-eval-delta {
    font-family: 'Montserrat', monospace;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-left: 4px;
    white-space: nowrap;
    display: none;
}
.mac-eval-delta.mac-delta-visible {
    display: inline-block;
}
.mac-best-link {
    color: #4ade80;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(74, 222, 128, 0.4);
    text-underline-offset: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', 'Consolas', monospace;
    letter-spacing: 0.5px;
}
.mac-best-link:hover {
    color: #86efac;
    text-decoration-color: #86efac;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

/* ──────────────────────────────────────────
   Per-Classification Theme Colors
   ────────────────────────────────────────── */
/* Book / Theory */
.mac-type-book {
    border-color: rgba(217, 119, 6, 0.35);
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.1);
}
.mac-type-book .mac-icon-wrapper {
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.4);
}
.mac-type-book .mac-title { color: #fbbf24; }

/* Brilliant */
.mac-type-brilliant {
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15), 0 4px 20px rgba(0, 0, 0, 0.4);
}
.mac-type-brilliant .mac-icon-wrapper {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}
.mac-type-brilliant .mac-title { color: #00E5FF; text-shadow: 0 0 10px rgba(0, 229, 255, 0.4); }

/* Aura */
.mac-type-aura {
    border-color: rgba(204, 0, 255, 0.4);
    box-shadow: 0 0 24px rgba(204, 0, 255, 0.15), 0 0 14px rgba(0, 229, 255, 0.1);
}
.mac-type-aura .mac-icon-wrapper {
    background: rgba(204, 0, 255, 0.12);
    border-color: rgba(204, 0, 255, 0.5);
    box-shadow: 0 0 14px rgba(204, 0, 255, 0.3);
}
.mac-type-aura .mac-title {
    color: #CC00FF;
    text-shadow: 0 0 12px rgba(204, 0, 255, 0.5), 0 0 24px rgba(0, 229, 255, 0.3);
}

/* Critical */
.mac-type-critical {
    border-color: rgba(113, 151, 186, 0.35);
    box-shadow: 0 0 14px rgba(113, 151, 186, 0.1);
}
.mac-type-critical .mac-icon-wrapper {
   background: rgba(113, 151, 186, 0.1);
    border-color: rgba(113, 151, 186, 0.4);
}
.mac-type-critical .mac-title { color: #7197ba;  }

/* Best */
.mac-type-best {
    border-color: rgba(92, 184, 92, 0.4);
    box-shadow: 0 0 16px rgba(92, 184, 92, 0.12);
}
.mac-type-best .mac-icon-wrapper {
    background: rgba(92, 184, 92, 0.12);
    border-color: rgba(92, 184, 92, 0.45);
}
.mac-type-best .mac-title { color: #5cb85c; }

/* Excellent */
.mac-type-excellent {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.1);
}
.mac-type-excellent .mac-icon-wrapper {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}
.mac-type-excellent .mac-title { color: #7db149; }

/* Good / Okay */
.mac-type-good {
    border-color: rgba(74, 222, 128, 0.3);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.08);
}
.mac-type-good .mac-icon-wrapper {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.35);
}
.mac-type-good .mac-title { color: #4ade80; }

/* Forced */
.mac-type-forced {
    border-color: rgba(0, 229, 255, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.mac-type-forced .mac-icon-wrapper {
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.3);
}
.mac-type-forced .mac-title { color: #67e8f9; }

/* Inaccuracy */
.mac-type-inaccuracy {
    border-color: rgba(250, 204, 21, 0.35);
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.1);
}
.mac-type-inaccuracy .mac-icon-wrapper {
    background: rgba(250, 204, 21, 0.1);
    border-color: rgba(250, 204, 21, 0.4);
}
.mac-type-inaccuracy .mac-title { color: #facc15; }

/* Mistake */
.mac-type-mistake {
    border-color: rgba(249, 115, 22, 0.35);
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.1);
}
.mac-type-mistake .mac-icon-wrapper {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.4);
}
.mac-type-mistake .mac-title { color: #fb923c; }

/* Miss */
.mac-type-miss {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.1);
}
.mac-type-miss .mac-icon-wrapper {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
}
.mac-type-miss .mac-title { color: #f87171; }

/* Blunder */
.mac-type-blunder {
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.15);
}
.mac-type-blunder .mac-icon-wrapper {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}
.mac-type-blunder .mac-title { color: #ef4444; text-shadow: 0 0 6px rgba(239, 68, 68, 0.3); }

/* ── Mobile responsiveness for annotation card ── */
@media (max-width: 768px) {
    .move-annotation-card {
        padding: 10px 12px;
        gap: 10px;
        border-radius: 10px;
    }
    .mac-icon-wrapper {
        width: 32px;
        height: 32px;
    }
    .mac-icon-wrapper img {
        width: 18px;
        height: 18px;
    }
    .mac-title {
        font-size: 13px;
    }
    .mac-best-hint {
        font-size: 11px;
    }
}

/* ════════════════════════════════════════════
   ANALYSIS TAB — Quick Eval Cards
   ════════════════════════════════════════════ */
.quick-eval-section {
    flex-shrink: 0;
    position: relative;
}

.quick-eval-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 4px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    scroll-snap-type: x mandatory;
    direction: ltr;
}

.quick-eval-scroll::-webkit-scrollbar {
    height: 3px;
}
.quick-eval-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.quick-eval-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

.qe-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    scroll-snap-align: center;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.qe-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Best Move Highlight — Green Neon Glow */
.qe-card.qe-best {
    border: 1.5px solid #00FF88;
    background: rgba(0, 255, 136, 0.05);
    box-shadow:
        0 0 12px rgba(0, 255, 136, 0.2),
        0 0 30px rgba(0, 255, 136, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.qe-card.qe-best:hover {
    box-shadow:
        0 0 18px rgba(0, 255, 136, 0.35),
        0 0 40px rgba(0, 255, 136, 0.12),
        0 6px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

/* Active card (current move) */
.qe-card.qe-active {
    border-color: #00E5FF;
    background: rgba(0, 229, 255, 0.08);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
    transform: scale(1.05);
}

.qe-card.qe-active.qe-best {
    border-color: #00FF88;
    box-shadow:
        0 0 16px rgba(0, 255, 136, 0.3),
        0 0 30px rgba(0, 255, 136, 0.1);
}

.qe-eval {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #e2e8f0;
    min-width: 36px;
    direction: ltr;
}

.qe-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}

.qe-icon-check {
    color: #00FF88;
    background: rgba(0, 255, 136, 0.15);
}

.qe-icon-thumb {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.qe-move {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.qe-sub-eval {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    opacity: 0.7;
}

/* Scroll Indicators */
.qe-scroll-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 4px 0 2px;
}

.qe-dot {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.qe-dot.active {
    width: 28px;
    background: rgba(255, 255, 255, 0.5);
}

/* ── Move List ── */
/* ── Move List (Aura Horizontal) ── */
.moves-container {
    flex: 1;
    min-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.moves-container::-webkit-scrollbar {
    width: 6px;
    height: 4px;
}
.moves-container::-webkit-scrollbar-track {
    background: transparent;
}
.moves-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.moves-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.4);
}

.moves-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    direction: ltr !important; /* Force LTR for chess move notation regardless of site direction */
    width: 100%;
    align-items: stretch;
}

.move-row {
    display: grid;
    grid-template-columns: 45px 1fr 1fr;
    align-items: center;
    gap: 8px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s ease;
    direction: ltr !important;
}

.move-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.variation-block {
    grid-column: 1 / -1;
    margin: 4px 0 4px 20px !important;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 12px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 0 8px 8px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

[dir="rtl"] .moves-list {
    direction: ltr !important;
}

.move-aura * {
    pointer-events: none; /* Ensure the click always registers on the main card */
}

/* ── Move Card Aura (Glassmorphism) ── */
.move-aura {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    min-width: 0;
}

.move-aura:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Auto-Play visibility and hover states */
.nav-btn-bottom.btn-auto {
    color: #00E5FF;
    border-color: rgba(0, 229, 255, 0.2);
}

.nav-btn-bottom.btn-auto:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.nav-btn-bottom.btn-auto.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: #00E5FF;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.move-aura.active {
    background: rgba(0, 229, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

/* Card Components */
.mc-num {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    font-family: 'Montserrat', sans-serif;
    min-width: 25px;
}

.mc-san {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.5px;
}

.mc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.mc-eval {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
}

/* Classification states */
.mc-cyan { border-color: rgba(0, 229, 255, 0.4); }
.mc-purple { border-color: rgba(204, 0, 255, 0.4); }
.mc-green { border-color: rgba(92, 184, 92, 0.4); }
.mc-blue { border-color: rgba(59, 130, 246, 0.4); }
.mc-yellow { border-color: rgba(250, 204, 21, 0.4); }
.mc-orange { border-color: rgba(249, 115, 22, 0.4); }
.mc-red { border-color: rgba(239, 68, 68, 0.4); }

/* Glow on active according to class */
.mc-cyan.active { box-shadow: 0 0 20px rgba(0, 229, 255, 0.4); border-color: #00E5FF; }
.mc-purple.active { box-shadow: 0 0 20px rgba(204, 0, 255, 0.4); border-color: #CC00FF; }
.mc-green.active { box-shadow: 0 0 20px rgba(92, 184, 92, 0.4); border-color: #5cb85c; }
.mc-red.active { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); border-color: #ef4444; }
.mc-red .mc-eval { color: #f87171; }
.mc-green .mc-eval { color: #4ade80; }

/* ════════════════════════════════════════════
   BOTTOM NAVIGATION CONTROLS (Pinned)
   ════════════════════════════════════════════ */
.panel-nav-buttons {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    background: rgba(10, 14, 20, 0.95);
    border-radius: 0 0 16px 16px;
}
.nav-btn-bottom {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #cbd5e1; /* Brighter for better visibility */
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}
.nav-btn-bottom:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}
.nav-btn-bottom:disabled { opacity: 0.25; cursor: not-allowed; }

.nav-btn-bottom.main-action {
    background: rgba(204, 0, 255, 0.15);
    border: 1px solid rgba(204, 0, 255, 0.4);
    color: #CC00FF; width: 52px; font-size: 16px;
    box-shadow: 0 0 10px rgba(204, 0, 255, 0.2);
}
.nav-btn-bottom.main-action:hover {
    background: rgba(204, 0, 255, 0.3);
    box-shadow: 0 0 20px rgba(204, 0, 255, 0.5);
    transform: scale(1.05);
}

/* ════════════════════════════════════════════
   PGN TEXTAREA ANIMATION
   ════════════════════════════════════════════ */
@keyframes cyanPulse {
    0%, 100% { border-color: rgba(0, 229, 255, 0.25); }
    50% { border-color: rgba(0, 229, 255, 0.5); }
}
.pgn-textarea:not(:focus) { animation: cyanPulse 3s ease-in-out infinite; }

/* Empty state */
.moves-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 40px 20px;
    color: #4a5568; text-align: center; gap: 10px;
}
.moves-empty i { font-size: 32px; color: #2d3748; }
.moves-empty p { font-size: 13px; color: #4a5568; line-height: 1.6; }

/* ════════════════════════════════════════════
   RESPONSIVE DESIGN
   ════════════════════════════════════════════ */

/* ── Tablet (≤1100px): 2-column, eval bar + board side-by-side ── */
@media (max-width: 1100px) {
    .analyzer-layout {
        grid-template-columns: 36px 1fr;
        grid-template-rows: auto auto;
        gap: 16px;
        padding-top: 80px;
        height: auto;
    }
    .eval-bar-container {
        grid-row: 1 / 3;
        align-self: start;
        height: min(600px, calc(100vh - 120px));
    }
    .analyzer-board-wrapper {
        max-width: 100%;
        width: auto;
    }
    .data-panel {
        min-height: auto;
        height: auto;
        max-height: calc(100vh - 82px);
        overflow-y: auto;
    }
}

/* ─────────────────────────────────────────────────────────
   DESKTOP: Wrapper elements are invisible (display:contents)
   so the existing CSS Grid layout is completely untouched.
   ───────────────────────────────────────────────────────── */
.mobile-board-row  { display: contents; }
.data-panel-inner  { display: contents; }

/* ═══════════════════════════════════════════════════════════
   MOBILE (≤768px): Eval bar vertical on right, board left,
   nav buttons directly under board, report content below.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Main vertical stack ── */
    .analyzer-layout {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 62px 6px 0 6px;
        height: auto;
        max-width: 100%;
    }

    /* ── Board + Eval Bar side-by-side row ── */
    .mobile-board-row {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 6px;
        width: 100%;
        order: 1;
        direction: ltr; /* Lock eval-bar to LEFT visually */
    }

    /* ── Vertical Slim Eval Bar (7-10% width, on the RIGHT) ── */
    .eval-bar-container {
        flex-direction: column-reverse; /* White fills from bottom by default */
        display: flex;
        width: 7%;
        min-width: 22px;
        max-width: 30px;
        height: auto;
        order: 2;  /* RIGHT of board */
        position: relative;
        align-self: stretch;
        border-radius: 4px;
        border: 1px solid rgba(0, 204, 255, 0.25);
        box-shadow: 0 0 8px rgba(0, 204, 255, 0.08);
        background: #0a0e14;
        overflow: hidden;
        margin: 0;
        padding: 0;
        gap: 0;
    }
    .eval-bar-container.is-flipped {
        flex-direction: column; /* White fills from top when flipped */
    }
    .eval-bar-fill {
        transition: height 0.4s ease;
    }
    .eval-bar-score {
        position: absolute;
        width: 100%;
        text-align: center;
        font-size: 9px;
        font-weight: 800;
        z-index: 2;
        color: #000;
        bottom: 6px;
        top: auto;
        pointer-events: none;
        line-height: 1;
    }

    /* ── Board takes remaining space (90-93%) ── */
    .analyzer-board-wrapper {
        flex: 1;
        min-width: 0;
        order: 1;  /* LEFT of eval bar */
        max-width: calc(100% - 30px);
        width: auto !important;
    }
    .analyzer-board-container {
        width: 100%;
        max-width: 100%;
    }

    /* ── Compact Player Bars ── */
    .board-player-bar {
        padding: 5px 8px;
        gap: 8px;
    }
    .board-player-bar.top-bar {
        border-radius: 8px 8px 0 0;
    }
    .board-player-bar.bottom-bar {
        border-radius: 0 0 8px 8px;
    }
    .bp-avatar {
        width: 24px; height: 24px;
    }
    .bp-avatar::after { inset: -1px; }
    .bp-avatar-fallback { font-size: 12px; }
    .bp-name {
        font-size: 11px;
        max-width: 120px;
    }
    .bp-elo {
        font-size: 10px;
        padding: 1px 6px;
    }

    /* ──────────────────────────────────────────────────────
       Data Panel: use display:contents so its children
       (.data-panel-inner & .panel-nav-buttons) can participate
       directly in the parent flex ordering.
       ────────────────────────────────────────────────────── */
    .data-panel {
        display: contents;
    }

    /* ── Navigation Buttons: directly under board ── */
    .panel-nav-buttons {
        order: 2;
        display: flex;
        width: 100%;
        padding: 8px 10px;
        gap: 6px;
        justify-content: space-between;
        background: rgba(10, 14, 20, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 229, 255, 0.08);
        border-radius: 10px;
        z-index: 10;
        position: relative;
    }
    .nav-btn-bottom {
        flex: 1;
        height: 44px;
        font-size: 16px;
        border-radius: 10px;
        min-width: 0;
    }
    .nav-btn-bottom.main-action {
        flex: 1.5;
        font-size: 18px;
    }

    /* ── Data Panel Inner: report/PGN content below nav ── */
    .data-panel-inner {
        display: flex;
        flex-direction: column;
        order: 3;
        width: 100%;
        border-radius: 12px;
        background: rgba(10, 14, 20, 0.92);
        border: 1px solid rgba(255, 255, 255, 0.05);
        overflow: visible;
        padding: 0;
    }

    /* ── PGN Input (compact) ── */
    .pgn-input-section {
        padding: 10px;
    }
    .pgn-input-label {
        font-size: 11px;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
    }
    .pgn-textarea {
        min-height: 100px;
        font-size: 12px;
        padding: 10px;
        border-radius: 10px;
    }
    .pgn-actions {
        gap: 8px;
        margin-top: 8px;
    }
    .pgn-btn {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* ── Analysis Section ── */
    .analysis-section {
        overflow: visible;
        width: 100%;
    }
    .analysis-tabs {
        padding: 0 10px;
        justify-content: space-between;
    }
    .tab-btn {
        font-size: 13px;
        padding: 10px 8px;
        flex: 1;
        text-align: center;
    }
    .tab-btn i { font-size: 14px; }
    .tab-content {
        overflow-y: visible;
        max-height: none;
        padding: 0 10px;
        width: 100%;
    }
    .tab-pane {
        gap: 12px;
        padding-top: 10px;
        width: 100%;
    }

    /* ── Report Tab (compact & full width) ── */
    .accuracy-row { gap: 8px; width: 100%; }
    .acc-val { font-size: 24px; }
    .acc-card { padding: 10px 8px; border-radius: 8px; }
    .acc-center { font-size: 11px; }
    .acc-center i { font-size: 16px; margin-bottom: 4px; }

    .elo-row { gap: 8px; width: 100%; }
    .elo-box { font-size: 14px; padding: 6px 10px; border-radius: 6px; flex: 1; text-align: center; justify-content: center; }
    .elo-label { font-size: 11px; }

    .eval-graph-container { width: 100%; }
    .eval-graph-container canvas { height: 80px; width: 100%; }

    .classification-feed { width: 100%; }
    .cf-row { padding: 8px 12px; grid-template-columns: 40px 40px 1fr 40px; }
    .cf-w, .cf-b { font-size: 14px; }
    .cf-icon { font-size: 15px; }
    .cf-name { font-size: 13px; }
    .aura-glow { font-size: 14px; }

    /* ── Move List ── */
    .moves-container { max-height: 180px; }
    .move-cell { font-size: 12px; padding: 3px 6px; min-width: 42px; }
    .move-number { font-size: 11px; width: 28px; }

    /* ── On-board icon sizing ── */
    .onboard-move-icon {
        width: 22px; height: 22px;
        font-size: 11px;
    }
}

/* ── Extra Small Mobile (≤480px) ── */
@media (max-width: 480px) {
    .analyzer-layout {
        padding: 90px 4px 0 4px;
        gap: 6px;
    }

    .board-player-bar { padding: 4px 6px; gap: 6px; }
    .bp-avatar { width: 20px; height: 20px; }
    .bp-name { font-size: 10px; max-width: 90px; }
    .bp-elo { font-size: 9px; padding: 1px 4px; }
    .bp-avatar-fallback { font-size: 10px; }

    .pgn-textarea { min-height: 80px; font-size: 11px; padding: 8px; }
    .pgn-btn { font-size: 12px; padding: 7px 10px; }

    .nav-btn-bottom { height: 38px; font-size: 13px; }
    .nav-btn-bottom.main-action { font-size: 15px; }

    .acc-val { font-size: 20px; }
    .elo-box { font-size: 12px; }
    .cf-row { padding: 4px 6px; }
    .cf-w, .cf-b { font-size: 11px; }
    .cf-name { font-size: 10px; }

    .tab-btn { font-size: 11px; padding: 8px 4px; }
    .eval-graph-container canvas { height: 60px; }

    .onboard-move-icon {
        width: 18px; height: 18px;
        font-size: 9px;
        border-width: 1px;
    }
}

/* --- Themed Arrows & Markers (Synchronized with Course Creator) --- */
.cm-chessboard .arrow-head {
    fill-rule: nonzero;
}

.cm-chessboard .arrow-line {
    stroke-linecap: round;
    stroke-width: 15px; /* Significant increase to match global sites */
}

/* Success/Best Move (Neon Blue) */
.cm-chessboard .arrow-success .arrow-head { fill: #00C8FF; transform: scale(3); transform-origin: center; }
.cm-chessboard .arrow-success .arrow-line { stroke: #00C8FF; opacity: 0.6; stroke-width: 14px; }

/* User Arrows - Green */
.cm-chessboard .arrow.arrow-user-green .arrow-head { fill: #81b64c; }
.cm-chessboard .arrow.arrow-user-green .arrow-line { stroke: #81b64c; opacity: 0.65; stroke-width: 14px; }

/* User Arrows - Red */
.cm-chessboard .arrow.arrow-user-red .arrow-head { fill: #f44336; }
.cm-chessboard .arrow.arrow-user-red .arrow-line { stroke: #f44336; opacity: 0.65; stroke-width: 14px; }

/* User Arrows - Blue */
.cm-chessboard .arrow.arrow-user-blue .arrow-head { fill: #2196f3; }
.cm-chessboard .arrow.arrow-user-blue .arrow-line { stroke: #2196f3; opacity: 0.65; stroke-width: 14px; }

/* User Arrows - Orange */
.cm-chessboard .arrow.arrow-user-orange .arrow-head { fill: #ff9800; }
.cm-chessboard .arrow.arrow-user-orange .arrow-line { stroke: #ff9800; opacity: 0.65; stroke-width: 14px; }

/* User Arrows - Purple */
.cm-chessboard .arrow.arrow-user-purple .arrow-head { fill: #9c27b0; }
.cm-chessboard .arrow.arrow-user-purple .arrow-line { stroke: #9c27b0; opacity: 0.65; stroke-width: 14px; }

/* User Arrows - Cyan */
.cm-chessboard .arrow.arrow-user-cyan .arrow-head { fill: #00bcd4; }
.cm-chessboard .arrow.arrow-user-cyan .arrow-line { stroke: #00bcd4; opacity: 0.65; stroke-width: 14px; }

/* Circles (Markers) */
.cm-chessboard .markers .marker.marker-circle-success {
    stroke: #00C8FF;
    stroke-width: 3px;
    opacity: 0.7;
}
.cm-chessboard .markers .marker.marker-circle-success-filled {
    stroke: #00C8FF;
    fill: #00C8FF;
    stroke-width: 3px;
    opacity: 0.4;
}

/* User Circles & Squares */
.cm-chessboard .markers .marker[class*="arrow-user-"] {
    stroke-width: 2px;
    opacity: 0.5; /* Natural translucent look for square highlights */
}
.cm-chessboard .markers .marker.arrow-user-green { stroke: #81b64c; fill: #81b64c; }
.cm-chessboard .markers .marker.arrow-user-red { stroke: #f44336; fill: #f44336; }
.cm-chessboard .markers .marker.arrow-user-blue { stroke: #2196f3; fill: #2196f3; }
.cm-chessboard .markers .marker.arrow-user-orange { stroke: #ff9800; fill: #ff9800; }
.cm-chessboard .markers .marker.arrow-user-purple { stroke: #9c27b0; fill: #9c27b0; }
.cm-chessboard .markers .marker.arrow-user-cyan { stroke: #00bcd4; fill: #00bcd4; }

/* ════════════════════════════════════════════
   IMPORT OVERLAY MODAL
   ════════════════════════════════════════════ */
.import-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.import-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.import-overlay-content {
    background: rgba(15, 23, 35, 0.95);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.import-overlay.active .import-overlay-content {
    transform: translateY(0) scale(1);
}

.import-overlay-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

[dir="rtl"] .import-overlay-close {
    right: auto;
    left: 14px;
}

.import-overlay-close:hover {
    color: #ef4444;
}

.import-overlay-title {
    font-family: 'Cairo', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #e2e8f0;
    margin: 0 0 20px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.import-overlay-title i {
    color: #00E5FF;
}

.import-input-group {
    margin-bottom: 16px;
}

.import-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.import-input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

.import-input-group input:focus {
    border-color: #00E5FF;
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.15);
}

.import-fetch-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #00E5FF, #00b8cc);
    color: #000;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.import-fetch-btn:hover {
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
    transform: translateY(-1px);
}

.import-fetch-btn:active {
    transform: translateY(1px);
}

.import-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 10px;
}

.import-results-header h3 {
    margin: 0;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    color: #e2e8f0;
}

.back-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
}

.back-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.import-games-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
    flex-grow: 1;
}

.import-games-list::-webkit-scrollbar { width: 4px; }
.import-games-list::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.3); border-radius: 2px; }

.import-game-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.import-game-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.import-game-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.import-game-result {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.import-game-result.win { background: rgba(92, 184, 92, 0.2); color: #5cb85c; }
.import-game-result.loss { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.import-game-result.draw { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.import-game-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.import-game-opponent {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.import-game-opponent i {
    font-size: 10px;
}

.import-game-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 8px;
}

.import-btn-analyze {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: #00E5FF;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
}

.import-btn-analyze:hover {
    background: #00E5FF;
    color: #000;
}
