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

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #e0e0e0;
}

.game-container {
    text-align: center;
    padding: 20px;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #e0e0e0;
    letter-spacing: 2px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.disc {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.disc.black {
    background: radial-gradient(circle at 35% 35%, #555, #111);
    border: 2px solid #333;
}

.disc.white {
    background: radial-gradient(circle at 35% 35%, #fff, #ccc);
    border: 2px solid #aaa;
}

.turn-indicator {
    font-size: 0.95rem;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s;
}

.turn-indicator.black-turn {
    background: rgba(50, 50, 50, 0.8);
    color: #fff;
}

.turn-indicator.white-turn {
    background: rgba(240, 240, 240, 0.9);
    color: #111;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    background: #1a472a;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
    width: min(90vw, 480px);
    height: min(90vw, 480px);
    margin: 0 auto;
}

.cell {
    background: #2d6a4f;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    aspect-ratio: 1;
}

.cell:hover {
    background: #40916c;
}

.cell.valid-move::after {
    content: '';
    width: 28%;
    height: 28%;
    border-radius: 50%;
    background: rgba(255, 255, 0, 0.35);
    position: absolute;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.cell .piece {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    position: absolute;
    transition: transform 0.3s ease, background 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cell .piece.black {
    background: radial-gradient(circle at 35% 35%, #444, #000);
}

.cell .piece.white {
    background: radial-gradient(circle at 35% 35%, #fff, #bbb);
}

.cell .piece.flipping {
    animation: flip 0.4s ease-in-out;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg) scale(0.8); }
    100% { transform: rotateY(0deg); }
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

button {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #40916c;
    color: #fff;
}

button:hover:not(:disabled) {
    background: #52b788;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

#passBtn { background: #d97706; }
#passBtn:hover:not(:disabled) { background: #f59e0b; }

#undoBtn { background: #6366f1; }
#undoBtn:hover:not(:disabled) { background: #818cf8; }

.ai-status {
    font-size: 0.85rem;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    display: flex;
    align-items: center;
}

.ai-status.thinking {
    color: #fbbf24;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

.difficulty {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #aaa;
}

.difficulty select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
}

.game-over-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-box {
    background: #1e293b;
    padding: 36px 48px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.game-over-box h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.game-over-box .result {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 24px;
}