:root {
    --bg: #121111;
    --panel: #1e1e1e;
    --accent: #81b64c; /* Chess.com Green */
    --accent-hover: #a3d160;
    --text: #ffffff;
    --gold: #FFD700;
}

body {
    margin: 0; padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* BRANDING */
.brand { text-align: center; padding: 20px 0; }
.brand-logo { width: 50px; vertical-align: middle; }
.brand-text { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; vertical-align: middle; margin-left: 10px; }
.highlight { color: var(--gold); }

/* BOT GRID */
.bot-section { padding: 10px 20px; }
.bot-category { color: #888; font-size: 0.9rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.bot-grid { 
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; 
}

.bot-card {
    background: var(--panel); border-radius: 12px; padding: 15px;
    text-align: center; border: 2px solid transparent; cursor: pointer;
    transition: 0.2s; position: relative;
}
.bot-card:hover, .bot-card.selected { border-color: var(--accent); background: #2a2a2a; }
.bot-card.premium { border-color: var(--gold); background: linear-gradient(145deg, #1e1e1e, #292400); }

.bot-card img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; margin-bottom: 5px; }
.bot-info h4 { margin: 0; font-size: 0.95rem; }
.bot-info span { color: #aaa; font-size: 0.8rem; }

/* SETTINGS */
.quick-settings { display: flex; gap: 15px; padding: 20px; }
.setting-box { flex: 1; }
.setting-box label { display: block; color: #888; font-size: 0.8rem; margin-bottom: 5px; }
select { width: 100%; padding: 10px; background: var(--panel); color: white; border: 1px solid #333; border-radius: 6px; }

.side-toggles { display: flex; background: var(--panel); border-radius: 6px; padding: 2px; }
.side-btn { flex: 1; background: transparent; border: none; color: #888; padding: 8px; border-radius: 4px; font-weight: bold; }
.side-btn.active { background: #333; color: white; }

.play-big-btn {
    display: block; width: 90%; margin: 10px auto;
    background: var(--accent); color: white; border: none;
    padding: 15px; font-size: 1.2rem; font-weight: 800;
    border-radius: 10px; box-shadow: 0 4px 0 #5a8235;
    cursor: pointer;
}
.play-big-btn:active { transform: translateY(4px); box-shadow: none; }

/* PLAYERS LIST */
.info-section { padding: 20px; margin-top: 20px; border-top: 1px solid #333; }
.info-section h2 { font-size: 1.1rem; color: #ccc; margin-bottom: 15px; }

.player-row {
    display: flex; align-items: center; gap: 10px;
    background: var(--panel); padding: 10px; border-radius: 8px; margin-bottom: 10px;
}
.p-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.p-info h3 { margin: 0; font-size: 0.9rem; }
.p-info p { margin: 0; font-size: 0.7rem; color: #aaa; }
.spouse-info { margin-left: auto; text-align: center; }
.s-img { width: 30px; height: 30px; border-radius: 50%; display: block; margin: 0 auto; }
.spouse-info span { font-size: 0.6rem; color: #666; }

/* GAME AREA */
#gameContainer { height: 100vh; display: flex; flex-direction: column; background: #262421; }
.game-header { padding: 10px; display: flex; justify-content: space-between; background: #1e1e1e; }

.player-bar { 
    display: flex; align-items: center; padding: 5px 10px; 
    gap: 10px; margin: 5px 0;
}
.avatar-img { width: 45px; height: 45px; border-radius: 4px; }
.user-av { width: 45px; height: 45px; background: #333; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: #888; font-size: 1.2rem; }
.info-box { flex: 1; }
.p-name { display: block; font-weight: bold; font-size: 0.9rem; }
.p-status { font-size: 0.75rem; color: #aaa; }
.timer-box {
    background: #111; color: #eee; font-family: monospace;
    font-size: 1.3rem; padding: 5px 10px; border-radius: 4px;
}

#boardWrapper { width: 100%; aspect-ratio: 1/1; }
#myBoard { width: 100%; height: 100%; }

/* LEGAL MOVES (Grey Dots) */
.highlight-move { box-shadow: inset 0 0 3px 3px rgba(155, 199, 0, 0.4); }
.legal-dot {
    width: 22px; height: 22px;
    background: rgba(0, 0, 0, 0.2); /* Grey semi-transparent */
    border-radius: 50%;
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
/* Make dot visible on dark squares */
.black-3c85d .legal-dot { background: rgba(0, 0, 0, 0.35); }

/* GAME REVIEW MODAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
}
.review-card {
    background: #2b2b2b; width: 85%; padding: 20px; border-radius: 10px;
    text-align: center;
}
.review-header { display: flex; justify-content: space-between; margin-bottom: 15px; }
.result-banner {
    background: #333; color: white; padding: 15px; font-size: 1.5rem; font-weight: bold;
    border-radius: 8px; margin-bottom: 20px;
}
.review-btn {
    width: 100%; padding: 12px; border: none; border-radius: 6px;
    font-weight: bold; font-size: 1rem; margin-bottom: 10px; cursor: pointer;
}
.review-btn.primary { background: var(--accent); color: white; }
.review-btn.secondary { background: #333; color: #ccc; }

.game-controls { display: flex; gap: 10px; padding: 10px; }
.game-controls button { flex: 1; padding: 12px; background: #333; border: none; color: #ccc; border-radius: 5px; }
