:root {
    --primary-color: #10b981;
    --secondary-color: #6366f1;
    --bg-dark: #0f172a;
    --board-bg: #064e3b;
    /* Dark green felt */
    --board-grid: #065f46;
    --card-bg: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.game-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
}

.score-pill {
    padding: 10px 20px;
    background: var(--card-bg);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex: 1;
    justify-content: center;
}

.score-pill .dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.score-pill.black .dot {
    background: #000;
    border: 1px solid #333;
}

.score-pill.white .dot {
    background: #fff;
    border: 1px solid #ddd;
}

.turn-indicator {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.active-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.game-board-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--board-bg);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    width: 100%;
    height: 100%;
    background: var(--board-grid);
}

.cell {
    touch-action: manipulation;
    background: var(--board-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cell.valid-move::after {
    content: '';
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.piece {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    transition: transform 0.5s ease-in-out, background 0.5s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #444, #000);
}

.piece.white {
    background: radial-gradient(circle at 30% 30%, #fff, #bbb);
}

.piece.flip {
    transform: rotateY(180deg);
}

/* Overlay & Modals */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    z-index: var(--z-modal);
    border-radius: 12px;
}

.overlay-content {
    text-align: center;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group {
    margin: 25px 0;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

button:hover {
    background: #059669;
    transform: translateY(-2px);
}

.ia-credits {
    margin-top: 15px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

.bottom-ad {
    margin-top: auto;
    padding-top: 20px;
}

@media (max-width: 768px) {
    .turn-indicator,
    .ia-credits {
        font-size: 0.75rem;
    }

    .input-group input,
    button {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .score-pill {
        padding: 8px 12px;
        font-size: 1rem;
    }

    .game-container {
        padding: 15px;
    }
}