﻿
:root {
    --accent: #10b981;
    --accent-hover: #059669;

    --bg: #0b0d11;
    --surface: #11151c;
    --surface-hover: #191f28;
    --surface-active: #202833;

    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: #252d38;

    --board-light: #eeeed2;
    --board-dark: #769656;

    --danger: #ef4444;
    --success: #10b981;

    --sidebar-width: 250px;
}

[data-theme="light"] {
    --bg: #f5f7f6;
    --surface: #ffffff;
    --surface-hover: #f0f4f2;
    --surface-active: #e7eeea;

    --text: #17211d;
    --text-secondary: #64756c;
    --text-muted: #94a39b;

    --border: #e2e9e5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", sans-serif;
    transition: background 0.2s, color 0.2s;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

/* APP LAYOUT */

.app {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 28px 18px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.brand-icon {
    width: 40px !important;
    height: 40px !important;
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
    flex: 0 0 22px;
    display: block;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 45px;
}

.nav-item {
    padding: 13px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 550;
    transition: 0.2s;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--surface-active);
    color: var(--accent);
}

.sidebar-bottom {
    margin-top: auto;
}

#theme-toggle {
    width: 100%;
    padding: 12px;
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    transition: 0.2s;
}

#theme-toggle:hover {
    border-color: var(--accent);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0 42px 60px;
}

.topbar {
    height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
}

.user-section {
    padding: 8px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
}

/* DASHBOARD */

.welcome {
    padding: 55px 0 32px;
}

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 1.5px;
    margin-bottom: 13px;
}

.welcome h1,
.page-heading h1 {
    font-size: clamp(27px, 4vw, 38px);
    letter-spacing: -1.5px;
    line-height: 1.2;
}

.welcome > p:last-child,
.page-heading > p:last-child {
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.7;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
    margin-top: 20px;
}

.dashboard-card {
    min-height: 175px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    transition: 0.2s;
}

.dashboard-card[data-dashboard-link] {
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.dashboard-card > span {
    color: var(--accent);
    font-size: 25px;
}

.dashboard-card h2 {
    font-size: 17px;
    margin-top: 18px;
}

.dashboard-card p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 8px;
}

/* GENERAL PAGES */

.view-section {
    padding-top: 36px;
}

.page-heading {
    margin-bottom: 30px;
}

.page-heading h1 {
    margin-top: 5px;
}

/* ANALYSIS BOARD */

.analysis-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 25px;
    align-items: start;
}

.board-container {
    width: 100%;
    max-width: 650px;
    margin: auto;
}

.chessboard,
.static-chessboard {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border);
    user-select: none;
}

.chess-square {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
    cursor: pointer;
}

.chess-square.light {
    background: var(--board-light);
}

.chess-square.dark {
    background: var(--board-dark);
}

.chess-square.selected {
    box-shadow: inset 0 0 0 4px rgba(16, 185, 129, 0.9);
}

.chess-square.legal-move::after {
    content: "";
    position: absolute;
    width: 24%;
    height: 24%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.22);
}

.chess-square img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
}

.game-panel,
.quiz-info {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.game-status {
    padding: 12px;
    margin-bottom: 22px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 650;
}

.game-panel h2,
.quiz-info h3 {
    font-size: 15px;
    margin-bottom: 14px;
}

.move-history {
    min-height: 100px;
    max-height: 260px;
    overflow-y: auto;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 2;
}

.empty-history {
    color: var(--text-muted);
    font-size: 12px;
}

.board-controls {
    display: flex;
    gap: 9px;
    margin-top: 20px;
}

.board-controls button,
.quiz-controls button,
#placeholder-library-button {
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-hover);
    color: var(--text);
    font-size: 12px;
    transition: 0.2s;
}

.board-controls button:hover,
.quiz-controls button:hover,
#placeholder-library-button:hover {
    border-color: var(--accent);
}


/* STOCKFISH ANALYSIS */

.analysis-board-area {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 680px;
    margin: 0 auto;
}

.analysis-board-area .board-container {
    flex: 1;
    min-width: 0;
}

.evaluation-bar {
    position: relative;
    flex: 0 0 22px;
    min-height: 100px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #17191f;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.evaluation-black {
    flex: 1;
    background: #20242c;
}

.evaluation-white {
    height: 50%;
    flex: 0 0 auto;
    background: #f1f5f9;
    transition: height 0.3s ease;
}

.evaluation-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    writing-mode: vertical-rl;
    color: #10b981;
    font-size: 10px;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.engine-panel {
    margin: 18px 0 22px;
    padding: 15px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.engine-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 17px;
}

.engine-panel-heading h2 {
    margin: 0;
    font-size: 14px;
}

.engine-status {
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
}

.engine-status.ready {
    color: var(--success);
}

.engine-status.error {
    color: var(--danger);
}

.engine-evaluation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.engine-label {
    color: var(--text-secondary);
    font-size: 11px;
}

#engine-evaluation {
    color: var(--accent);
    font-size: 23px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.engine-detail {
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 11px;
}

.engine-detail strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.engine-suggestion,
.engine-line {
    padding-top: 13px;
    margin-top: 11px;
    border-top: 1px solid var(--border);
}

.engine-suggestion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

#engine-best-move {
    color: var(--accent);
    font-size: 14px;
    font-weight: 750;
}

.engine-line p {
    margin-top: 8px;
    color: var(--text);
    font-family: monospace;
    font-size: 11px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* ANALYSIS RESPONSIVE */

@media (max-width: 850px) {
    .analysis-board-area {
        max-width: 650px;
    }
}

@media (max-width: 600px) {
    .analysis-board-area {
        gap: 7px;
    }

    .evaluation-bar {
        flex-basis: 18px;
    }

    .engine-panel {
        padding: 13px;
    }
}


/* OPENING LIBRARY */

.library-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

#opening-search {
    flex: 1;
    min-width: 0;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    outline: none;
}

#opening-search:focus {
    border-color: var(--accent);
}

#opening-search::placeholder {
    color: var(--text-muted);
}

.library-filters {
    display: flex;
    gap: 10px;
}

.library-filters select {
    min-width: 135px;
    padding: 12px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.library-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.library-heading h2 {
    font-size: 19px;
}

.library-heading p {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

.opening-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.opening-card {
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.opening-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.opening-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 19px;
}

.opening-number {
    color: var(--text-muted);
    font-size: 11px;
}

.opening-difficulty {
    padding: 5px 8px;
    background: var(--surface-hover);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: capitalize;
}

.opening-card h3 {
    font-size: 16px;
    margin-bottom: 9px;
}

.opening-card p {
    min-height: 58px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.opening-category {
    display: inline-block;
    margin-top: 16px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.opening-empty {
    grid-column: 1 / -1;
    padding: 35px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}



/* OPENING DETAIL */

.back-button {
    margin-bottom: 28px;
    padding: 10px 13px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 12px;
    transition: 0.2s;
}

.back-button:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 22px;
    align-items: start;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.detail-card,
.detail-board-panel {
    padding: 23px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.detail-card h2,
.detail-board-panel h2 {
    font-size: 16px;
    margin-bottom: 13px;
}

.detail-card p,
.detail-board-panel p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.detail-subtitle {
    color: var(--text-muted) !important;
    font-size: 11px !important;
    margin-top: -5px;
    margin-bottom: 13px;
}

.notation {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.notation-move {
    padding: 8px 10px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: monospace;
    font-size: 12px;
}

.notation-move .move-number {
    color: var(--text-muted);
    margin-right: 5px;
}

.theory-block {
    margin-top: 17px;
}

.theory-block:first-child {
    margin-top: 0;
}

.theory-block h3 {
    margin-bottom: 7px;
    font-size: 14px;
}

.variation-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.variation-item:first-child {
    padding-top: 0;
}

.variation-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.variation-item h3 {
    font-size: 13px;
    margin-bottom: 6px;
}

.variation-item p {
    font-size: 12px;
}

.detail-board-panel {
    position: sticky;
    top: 20px;
}

.detail-board-panel > p {
    margin-bottom: 14px;
}

.static-chessboard {
    margin-top: 15px;
}

.board-note {
    margin-top: 12px;
    color: var(--text-muted) !important;
    font-size: 11px !important;
}

/* OPENING QUIZ */

.quiz-section {
    margin-top: 35px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.quiz-heading {
    margin-bottom: 22px;
}

.quiz-heading h2 {
    font-size: 25px;
    letter-spacing: -0.7px;
}

.quiz-heading > p:last-child {
    max-width: 650px;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.quiz-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}

.quiz-board-panel {
    min-width: 0;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.quiz-board {
    max-width: 600px;
    margin: auto;
}

.quiz-controls {
    display: flex;
    gap: 9px;
    margin-top: 17px;
}

#quiz-reset {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

#quiz-reset:hover {
    background: var(--accent-hover);
}

#quiz-hint {
    color: var(--text-secondary);
}

.quiz-info {
    min-width: 0;
}

.quiz-info > p {
    margin-top: -5px;
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.quiz-progress {
    margin-bottom: 25px;
}

.quiz-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 9px;
    color: var(--text-secondary);
    font-size: 11px;
}

#quiz-progress-text {
    color: var(--accent);
    font-weight: 700;
}

.quiz-progress-track {
    height: 7px;
    overflow: hidden;
    background: var(--surface-hover);
    border-radius: 20px;
}

#quiz-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transition: width 0.25s;
}

.quiz-feedback {
    min-height: 48px;
    margin-top: 20px;
    padding: 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.quiz-feedback.success {
    color: var(--success);
    border-color: var(--success);
}

.quiz-feedback.error {
    color: var(--danger);
    border-color: var(--danger);
}

/* PLACEHOLDER */

#simple-placeholder-view .detail-card {
    max-width: 650px;
}

#placeholder-library-button {
    margin-top: 17px;
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}


/* PRACTICE BOT SELECTION */

.practice-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.practice-bot-section {
    min-width: 0;
}

.bot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bot-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 175px;
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    text-align: left;
    transition: 0.2s;
}

.bot-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.bot-card.selected {
    border-color: var(--accent);
    background: var(--surface-active);
}

.bot-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    background: var(--surface-hover);
    border-radius: 10px;
    color: var(--accent);
    font-size: 23px;
}

.bot-name {
    font-size: 15px;
    font-weight: 750;
}

.bot-description {
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
}

.bot-rating {
    margin-top: auto;
    padding-top: 15px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.practice-settings {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.practice-settings h2 {
    margin-bottom: 5px;
}

.practice-settings label {
    color: var(--text-secondary);
    font-size: 12px;
}

#practice-color {
    width: 100%;
    padding: 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
}

.selected-bot-info {
    margin-top: 12px;
    padding: 16px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.selected-bot-info .eyebrow {
    font-size: 9px;
    margin-bottom: 10px;
}

.selected-bot-info h3 {
    font-size: 19px;
}

.selected-bot-info p {
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

#start-practice-game {
    width: 100%;
    padding: 13px;
    margin-top: 5px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 9px;
    color: white;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s;
}

#start-practice-game:hover {
    background: var(--accent-hover);
}

@media (max-width: 1100px) {
    .practice-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
    }
}

@media (max-width: 850px) {
    .practice-layout {
        grid-template-columns: 1fr;
    }

    .practice-settings {
        max-width: 500px;
    }
}

@media (max-width: 600px) {
    .bot-grid {
        grid-template-columns: 1fr;
    }

    .bot-card {
        min-height: 150px;
    }
}


/* RESPONSIVE */

@media (max-width: 1100px) {
    .opening-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-layout {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

    .analysis-layout,
    .quiz-layout {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
}

@media (max-width: 850px) {
    .sidebar {
        width: 72px;
        padding: 25px 9px;
    }

    .brand {
        justify-content: center;
        padding: 0;
    }

    .brand > span:last-child {
        display: none;
    }

    .navigation {
        margin-top: 40px;
    }

    .nav-item {
        overflow: hidden;
        padding: 13px 5px;
        text-align: center;
        font-size: 0;
    }

    .nav-item::first-letter {
        font-size: 16px;
    }

    .sidebar-bottom button {
        padding: 10px 3px;
        font-size: 10px;
    }

    .main-content {
        margin-left: 72px;
        padding: 0 25px 45px;
    }

    .detail-layout,
    .analysis-layout,
    .quiz-layout {
        grid-template-columns: 1fr;
    }

    .detail-board-panel {
        position: static;
        max-width: 500px;
    }

    .game-panel,
    .quiz-info {
        width: 100%;
    }

    .board-container {
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 0 15px 35px;
    }

    .topbar {
        height: 65px;
    }

    .welcome {
        padding-top: 38px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .library-toolbar {
        flex-direction: column;
    }

    .library-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .library-filters select {
        min-width: 0;
        width: 100%;
    }

    .opening-grid {
        grid-template-columns: 1fr;
    }

    .opening-card p {
        min-height: 0;
    }

    .detail-card,
    .detail-board-panel,
    .quiz-board-panel {
        padding: 16px;
    }

    .quiz-heading h2 {
        font-size: 22px;
    }

    .chess-square img {
        width: 94%;
        height: 94%;
    }

    .board-controls,
    .quiz-controls {
        flex-wrap: wrap;
    }
}

@media (max-width: 380px) {
    .sidebar {
        width: 58px;
    }

    .main-content {
        margin-left: 58px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .library-filters {
        grid-template-columns: 1fr;
    }
}

/* CHESSBOARD COORDINATES */

.board-with-coordinates {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 22px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.board-ranks {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-rows: repeat(8, 1fr);
    align-items: center;
    justify-items: center;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.board-files {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: center;
    justify-items: center;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.board-with-coordinates .chessboard,
.board-with-coordinates .static-chessboard {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    aspect-ratio: 1;
}

/* ============================= */
/* PRACTICE BOT SELECTION */
/* ============================= */

.practice-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.practice-bot-section {
    min-width: 0;
}

.bot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bot-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 175px;
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
}

.bot-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.bot-card.selected {
    border-color: var(--accent);
    background: var(--surface-active);
}

.bot-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    background: var(--surface-hover);
    border-radius: 10px;
    color: var(--accent);
    font-size: 25px;
}

.bot-name {
    font-size: 16px;
    font-weight: 700;
}

.bot-description {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.bot-rating {
    margin-top: auto;
    padding-top: 15px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

/* GAME SETTINGS */

.practice-settings {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.practice-settings h2 {
    margin-bottom: 5px;
}

.practice-settings label {
    color: var(--text-secondary);
    font-size: 13px;
}

#practice-color {
    width: 100%;
    padding: 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    outline: none;
}

#practice-color:focus {
    border-color: var(--accent);
}

.selected-bot-info {
    margin-top: 12px;
    padding: 16px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.selected-bot-info .eyebrow {
    margin-bottom: 10px;
    font-size: 10px;
}

.selected-bot-info h3 {
    font-size: 19px;
}

.selected-bot-info p {
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

#start-practice-game {
    width: 100%;
    padding: 13px;
    margin-top: 5px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 9px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s ease;
}

#start-practice-game:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ============================= */
/* PRACTICE GAME SCREEN */
/* ============================= */

.practice-game-heading {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 25px;
}

.practice-game-heading h2 {
    margin-top: 5px;
    font-size: 24px;
}

.practice-game-layout {
    display: grid;
    grid-template-columns: minmax(0, 650px) minmax(230px, 1fr);
    gap: 25px;
    align-items: start;
}

.practice-board-area {
    min-width: 0;
}

#practice-board {
    width: 100%;
}

.practice-player {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 18px 0;
    padding: 14px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.practice-player strong {
    color: var(--text);
    font-size: 16px;
}

.practice-controls {
    margin-top: 20px;
}

#practice-resign {
    color: var(--danger);
}

/* ============================= */
/* ACCESSIBILITY */
/* ============================= */

.bot-card:focus-visible,
#start-practice-game:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.bot-card:active {
    transform: scale(0.99);
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 1100px) {
    .practice-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
    }
}

@media (max-width: 850px) {
    .practice-layout {
        grid-template-columns: 1fr;
    }

    .practice-settings {
        position: static;
        max-width: 500px;
    }

    .practice-game-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .bot-grid {
        grid-template-columns: 1fr;
    }

    .bot-card {
        min-height: 150px;
    }

    .practice-game-heading h2 {
        font-size: 20px;
    }
}

/* PRACTICE BOARD ANIMATIONS */

#practice-board .chess-square {
    transition: background-color 160ms ease;
}

#practice-board .chess-square img {
    transition: transform 160ms ease, opacity 160ms ease;
}

#practice-board .chess-square.selected img {
    transform: scale(1.12);
}

#practice-board .chess-square.legal-move::after {
    transition: transform 160ms ease, opacity 160ms ease;
}

#practice-board .chess-square:active img {
    transform: scale(0.92);
}

#practice-game-status {
    transition: opacity 180ms ease;
}

#practice-move-history > div {
    animation: practice-move-in 180ms ease both;
}

@keyframes practice-move-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #practice-board *,
    #practice-game-status,
    #practice-move-history > div {
        animation: none !important;
        transition: none !important;
    }
}
