/* WintrChess Original Theme Replication */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --ui-blue: #8b7d6b; /* Warm grey/brown */
    --ui-blue-hover: #a39581;
    --ui-lavender: #a89f91;
    --ui-shade-1: #1c1917; /* Stone 900 */
    --ui-shade-2: #292524; /* Stone 800 */
    --ui-shade-3: rgba(41, 37, 36, 0.7);
    --ui-shade-4: rgba(68, 64, 60, 0.6);
    --ui-shade-5: #57534e; /* Stone 600 */
    --ui-shade-6: #78716c; /* Stone 500 */
    --ui-shade-7: #a8a29e; /* Stone 400 */
    --glass-border: rgba(255, 255, 255, 0.08);

    --board-light: #f0d9b5;
    --board-dark: #b58863;
    --highlight-color: rgba(139, 125, 107, 0.4);

    --color-brilliant: #1baaa6;
    --color-great: #78a1bc;
    --color-best: #81b64c;
    --color-excellent: #95b848;
    --color-theory: #a88764;
    --color-okay: #7ba55e;
    --color-forced: #81b64c;
    --color-inaccuracy: #f5bb41;
    --color-mistake: #f59239;
    --color-miss: #f15b51;
    --color-blunder: #fa412d;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: radial-gradient(circle at top right, #44403c, #1c1917 40%, #0c0a09 100%);
    background-attachment: fixed;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background-color: #424242;
}

::-webkit-scrollbar-thumb {
    background-color: white;
}

::-webkit-scrollbar-corner {
    background-color: #919191;
}

/* Base App Layout */
.dashboard-app {
    width: 100%;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
}

/* Original App Layout */
.review-dashboard {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.landing-dashboard {
    display: flex;
    gap: 24px;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
}

.landing-board-area {
    flex: 1 1 560px;
    max-width: 560px;
}

.landing-panel {
    flex: 0 0 390px;
    max-height: none;
}

.landing-title {
    margin: 8px 0 24px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #e2e8f0;
    text-shadow: 0 4px 20px rgba(139, 125, 107, 0.3);
}

.landing-eval-bar {
    opacity: 0.95;
}

/* Board Area */
.board-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 560px;
}

.player-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 18px;
    box-sizing: border-box;
    min-width: 130px;
    min-height: 55px;
    background: var(--ui-shade-3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.top-profile {
    border-radius: 7px 7px 0 0;
}

.player-profile span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
}

.bottom-profile {
    border-radius: 0 0 7px 7px;
}

.player-clock {
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    color: inherit;
}

.board-container {
    display: flex;
    width: 100%;
}

.eval-bar-wrapper {
    width: 30px;
    flex-shrink: 0;
    background: #1e293b;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    min-height: 200px;
}

.eval-bar-fill {
    background: white;
    width: 100%;
    transition: height 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.eval-text {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    z-index: 10;
}

.chessboard-wrapper {
    flex: 1 1 auto;
    max-width: 500px;
    aspect-ratio: 1;
    min-width: 0;
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    user-select: none;
}

.square.light {
    background-color: var(--board-light);
}

.square.dark {
    background-color: var(--board-dark);
}

.square.move-highlight::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--highlight-color);
    z-index: 1;
}

.square.selected-square::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(20, 85, 30, 0.5); /* A greenish highlight for selection */
    z-index: 2;
}

.move-classification-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 26%;
    height: 26%;
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
    z-index: 30;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.piece {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    z-index: 10;
}

.piece-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.coordinate {
    position: absolute;
    font-size: 0.75rem;
    font-weight: 700;
    user-select: none;
    pointer-events: none;
    font-family: 'Nunito', sans-serif;
    line-height: 1;
}

.rank-coordinate {
    top: 3px;
    left: 4px;
}

.file-coordinate {
    bottom: 3px;
    right: 4px;
}

/* Alternate coordinate text color based on light/dark square */
.square.light .coordinate {
    color: var(--board-dark);
}

.square.dark .coordinate {
    color: var(--board-light);
}

/* Analysis Panel */
.analysis-panel {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-radius: 16px;
    background: var(--ui-shade-3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    width: min(380px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px;
    gap: 16px;
}

.move-list-panel {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-radius: 16px;
    background: var(--ui-shade-3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    flex: 1 1 280px;
    max-width: 380px;
    max-height: calc(100vh - 40px);
    padding: 24px;
    gap: 16px;
}

.analysis-panel.selection-panel {
    width: min(600px, 100%);
    max-height: none;
    margin: 0 auto;
}

.analysis-panel.selection-panel .selector-tabs {
    flex-wrap: wrap;
}

/* Graph */
.graph-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    border-radius: 10px;
    background-color: var(--ui-shade-4);
}

.chart {
    border-radius: 10px;
    background-color: #1f1f1f;
    cursor: pointer;
    overflow: hidden;
    height: 120px;
}

/* Accuracies */
.accuracies-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-bottom: 10px;
    border-radius: 10px;
    background-color: var(--ui-shade-4);
}

.accuracies-title {
    padding: 5px 5px 0 5px;
    text-align: center;
    font-size: 1.4rem;
    font-family: "Noto Sans", sans-serif;
}

.accuracies-bars {
    display: flex;
    align-items: center;
}

.accuracy {
    padding: 5px;
    width: 50%;
    text-align: center;
    font-size: 1.5rem;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
}

.white-accuracy {
    background-color: whitesmoke;
    color: #0a0a0a;
}

.black-accuracy {
    background-color: #0a0a0a;
    color: whitesmoke;
}

/* Classifications */
.classifications-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border-radius: 10px;
    background-color: var(--ui-shade-4);
}

.classification-table {
    text-align: center;
    table-layout: auto;
    border-collapse: collapse;
    width: 100%;
}

.classification-table td {
    padding: 2px 0;
}

.classification-name-cell {
    width: 100px;
    text-align: left;
    font-family: "Noto Sans", sans-serif;
}

.classification-count-cell {
    width: 60px;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
}

.classification-icon-cell {
    width: 30px;
}

.class-badge-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Review move list */
.review-move-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-radius: 8px;
    background-color: #242424;
    flex: 1 1 200px; /* Allow it to grow, take up available space */
}

.move-list-toggle {
    flex: 0 0 auto;
}

.review-move-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr);
    min-height: 34px;
    align-items: stretch;
}

.review-move-row:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

.review-move-number {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
}

.review-move-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    font-family: "Nunito", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
}

.review-move-cell:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.review-move-cell.active {
    background-color: rgba(80, 87, 95, 0.75);
}

.review-move-cell.empty {
    cursor: default;
}

.review-move-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    object-fit: contain;
}

.review-move-cell span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Move controls */
.traverser {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 10px;
    background-color: #1b1c1e;
    border-radius: 10px;
    margin-top: auto;
}

.mobile-board-traverser {
    display: flex;
    width: 100%;
    margin-top: 8px;
}

.traverser-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 12px 24px;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    border-radius: 8px;
}

.traverser-btn:hover {
    color: #38bdf8;
}

.panel-traverser {
    display: none;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #333;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ui-blue), var(--ui-blue-hover));
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(139, 125, 107, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 125, 107, 0.4);
    background: linear-gradient(135deg, #a39581, var(--ui-blue));
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    background: var(--ui-shade-5);
    color: white;
    border: 1px solid var(--ui-shade-6);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
}

.btn-secondary:hover {
    background: var(--ui-shade-6);
}

.text-color-brilliant { color: var(--color-brilliant); }
.text-color-great { color: var(--color-great); }
.text-color-best { color: var(--color-best); }
.text-color-excellent { color: var(--color-excellent); }
.text-color-theory,
.text-color-book { color: var(--color-theory); }
.text-color-okay { color: var(--color-okay); }
.text-color-forced { color: var(--color-forced); }
.text-color-inaccuracy { color: var(--color-inaccuracy); }
.text-color-mistake { color: var(--color-mistake); }
.text-color-miss { color: var(--color-miss); }
.text-color-blunder { color: var(--color-blunder); }

/* Import forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: #a8a29e;
    opacity: 1;
}

.form-control:focus {
    outline: none;
    border-color: var(--ui-blue);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(139, 125, 107, 0.2);
    color: #f8fafc;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* Selection tabs */
.selector-tabs {
    display: flex;
    border-bottom: 2px solid var(--ui-shade-5);
    margin-bottom: 15px;
    width: 100%;
}

.compact-tabs {
    margin-bottom: 12px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

.tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    background: rgba(139, 125, 107, 0.15);
    box-shadow: inset 0 0 0 1px rgba(139, 125, 107, 0.3);
}

.pgn-secondary {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--ui-shade-5);
    color: #cbd5e1;
}

.pgn-secondary summary {
    cursor: pointer;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    color: #a0a0a0;
}

.pgn-secondary summary:hover {
    color: white;
}

.pgn-secondary-body {
    margin: 10px 0;
}

/* Month Selector */
.month-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    background: var(--ui-shade-4);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
}

.month-display {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    min-width: 150px;
    text-align: center;
    color: #e2e8f0;
}

.selector-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.selector-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.selector-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Game Listing */
.game-listing-container {
    max-height: 500px;
    min-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    padding-right: 5px;
}

.game-listing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ui-shade-4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--ui-shade-6);
}

.game-listing-item:hover {
    background: rgba(71, 85, 105, 0.8);
    border-left-color: var(--ui-blue);
    transform: translateX(4px) scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.game-listing-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.game-listing-speed {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #a0a0a0;
    background: var(--ui-shade-5);
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.game-listing-speed.blitz { color: #f97316; }
.game-listing-speed.bullet { color: #ef4444; }
.game-listing-speed.rapid { color: #10b981; }
.game-listing-speed.classical { color: #3b82f6; }

.game-listing-players {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.95rem;
}

.game-listing-player {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.game-listing-player span:nth-child(2) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.player-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.player-color-dot.white {
    background: #f8fafc;
    border: 1px solid #94a3b8;
}
.player-color-dot.black {
    background: #0f172a;
    border: 1px solid #475569;
}

.player-rating {
    color: #888;
    font-size: 0.8rem;
}

.game-listing-date {
    font-size: 0.8rem;
    color: #888;
    align-self: flex-end;
}

/* ── Live analysis progress banner ── */
.analysis-progress-banner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(70, 125, 232, 0.12), rgba(70, 125, 232, 0.06));
    border: 1px solid rgba(70, 125, 232, 0.3);
    border-radius: 8px;
    flex-shrink: 0;
}

.analysis-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.analysis-progress-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Nunito", sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #cbd5e1;
    min-width: 0;
    flex: 1;
}

.analysis-progress-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Animated pulsing dot — signals live engine activity */
.analysis-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ui-blue);
    flex-shrink: 0;
    animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.35; transform: scale(0.7); }
}

.analysis-progress-track {
    width: 100%;
    height: 6px;
    background: var(--ui-shade-4);
    border-radius: 3px;
    overflow: hidden;
}

.analysis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ui-blue), #d6d3d1);
    border-radius: 3px;
    transition: width 0.35s ease;
    min-width: 4px;
}

.analysis-progress-sub {
    font-size: 0.75rem;
    color: #64748b;
    font-family: "Nunito", sans-serif;
    text-align: right;
}

.btn-cancel-small {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 3px 9px;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Nunito", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.btn-cancel-small:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
}

/* Pending (not-yet-analysed) move cells in the move list */
.review-move-cell.pending {
    opacity: 0.45;
}

.review-move-cell.pending span {
    color: #64748b;
}

/* Placeholder that reserves the icon slot width so text doesn't jump */
.review-move-icon-placeholder {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* Accuracy "—" placeholder during analysis */
.accuracy-pending {
    color: #475569;
    font-size: 1.2rem;
}

/* Spinner */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 10px;
    color: #a0a0a0;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--ui-shade-5);
    border-top: 3px solid var(--ui-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 820px) {
    .dashboard-app {
        margin: 0.5rem auto;
        padding: 0 0.5rem;
    }

    .review-dashboard {
        flex-direction: column;
        align-items: center;
        flex-wrap: wrap;
    }

    .landing-dashboard {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .board-area {
        width: 100%;
        max-width: none;
    }

    .landing-board-area {
        max-width: min(560px, 100%);
    }

    .landing-panel {
        flex: 1 1 auto;
        width: 100%;
    }

    .chessboard-wrapper {
        max-width: min(500px, calc(100vw - 46px));
    }

    .eval-bar-wrapper {
        min-height: 150px;
    }

    .analysis-panel {
        width: 100%;
        max-height: none;
    }

    .move-list-panel {
        width: 100%;
        max-height: none;
    }

    .mobile-board-traverser {
        display: flex;
        margin-top: 8px;
    }

    .panel-traverser {
        display: none;
    }

    .chart {
        height: 80px;
    }

    .accuracies-title {
        font-size: 1.1rem;
    }

    .accuracy {
        font-size: 1.2rem;
    }

    .classification-count-cell {
        font-size: 0.95rem;
    }

    .review-move-list {
        max-height: 190px;
    }

    .traverser-btn {
        font-size: 1.2rem;
    }

    .move-classification-badge {
        max-width: 26px;
        max-height: 26px;
    }

    .player-profile {
        min-height: 45px;
        font-size: 0.9rem;
    }

    .month-display {
        font-size: 0.95rem;
        min-width: 120px;
    }

    .tab-btn {
        font-size: 0.95rem;
        padding: 10px 6px;
    }
}

@media (max-width: 480px) {
    .chessboard-wrapper {
        max-width: calc(100vw - 46px);
    }

    .eval-bar-wrapper {
        width: 24px;
        min-height: 120px;
    }

    .analysis-panel, .move-list-panel {
        padding: 6px;
        gap: 6px;
    }

    .header-controls {
        flex-direction: column;
        gap: 6px;
    }

    .header-controls .btn-primary {
        width: 100%;
    }

    .traverser {
        padding: 6px;
    }

    .classification-table td {
        font-size: 0.85rem;
    }

    .classification-name-cell {
        width: 70px;
    }

    .classification-count-cell {
        width: 40px;
        font-size: 0.85rem;
    }

    .classification-icon-cell {
        width: 22px;
    }

    .class-badge-img {
        width: 16px;
        height: 16px;
    }

    .review-move-row {
        grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr);
        min-height: 30px;
    }

    .review-move-cell {
        padding: 3px 5px;
        font-size: 0.82rem;
    }

    .review-move-icon {
        width: 15px;
        height: 15px;
    }

    .move-classification-badge {
        top: 2px;
        right: 2px;
        max-width: 22px;
        max-height: 22px;
    }

    .game-listing-item {
        padding: 8px;
    }

    .game-listing-players {
        font-size: 0.85rem;
    }

    .selector-tabs {
        overflow-x: auto;
    }
}

.eval-bar-wrapper.flipped {
    flex-direction: column;
}
.eval-bar-wrapper.flipped .eval-text {
    bottom: auto;
    top: 5px;
}

/* Auto Analysis Toggle */
.auto-analysis-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.auto-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auto-analysis-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #e2e8f0;
}

.auto-analysis-desc {
    font-size: 0.8rem;
    color: #a8a29e;
    line-height: 1.4;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ui-shade-5);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Coach Card */
.coach-card {
    background-color: var(--ui-shade-4);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.coach-speech {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.coach-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ui-shade-6);
}

.coach-bubble {
    background: white;
    color: #1c1917;
    padding: 12px 16px;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    flex: 1;
}

.coach-text {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.coach-move-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.coach-eval {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: auto;
}

.coach-actions {
    display: flex;
    gap: 8px;
}

.coach-btn {
    background: var(--ui-shade-5);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.coach-btn:hover {
    background: var(--ui-shade-6);
    transform: translateY(-1px);
}

.coach-btn-primary {
    background: var(--color-best);
    margin-left: auto;
}

.coach-btn-primary:hover {
    background: #6a963e;
}
