/* Checkers WebApp Styles */
:root {
    --bg: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --text: #eaeaea;
    --text-secondary: #a0a0b0;
    --board-light: #c4a35a;
    --board-dark: #6b4226;
    --board-highlight: rgba(233, 69, 96, 0.5);
    --board-legal: rgba(0, 255, 128, 0.4);
    --white-piece: #f0e6d3;
    --white-piece-border: #c8b88a;
    --black-piece: #2d2d2d;
    --black-piece-border: #1a1a1a;
    --king-crown: #ffd700;
    --success: #2ecc71;
    --danger: #e74c3c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ Layout ============ */
.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.header h1 {
    font-size: 18px;
    font-weight: 700;
}

/* ============ Screens ============ */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; gap: 12px; }

/* ============ Menu ============ */
.menu-btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.menu-btn.primary {
    background: var(--accent);
    color: white;
}

.menu-btn.primary:hover { background: var(--accent-hover); }

.menu-btn.secondary {
    background: var(--bg-card);
    color: var(--text);
}

.menu-btn.secondary:hover { background: #1a4a7a; }

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ============ Player Info ============ */
.players-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    flex: 1;
}

.player-info.active {
    border: 2px solid var(--accent);
}

.player-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.player-time {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

.vs-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 700;
}

/* ============ Board ============ */
.board-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 1;
}

#checkers-board {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
    cursor: pointer;
}

/* ============ Game Controls ============ */
.game-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.ctrl-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text);
    transition: 0.2s;
}

.ctrl-btn:hover { background: #1a4a7a; }
.ctrl-btn.danger { background: var(--danger); color: white; }
.ctrl-btn.danger:hover { opacity: 0.8; }

/* ============ Moves List ============ */
.moves-panel {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 8px;
    max-height: 100px;
    overflow-y: auto;
    font-size: 12px;
    font-family: monospace;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============ Status Bar ============ */
.status-bar {
    text-align: center;
    padding: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    min-height: 30px;
}

/* ============ Modal ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    max-width: 320px;
    width: 90%;
}

.modal h2 {
    margin-bottom: 12px;
    font-size: 20px;
}

.modal p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* ============ Bot Level Select ============ */
.level-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-btn {
    padding: 12px;
    border: 2px solid var(--bg-card);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.level-btn:hover, .level-btn.selected {
    border-color: var(--accent);
    background: var(--bg-card);
}

.level-icon { font-size: 20px; }
