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

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 32px;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #e0e0e0;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.4);
}

/* Score Board */
.score-board {
    display: flex;
    gap: 24px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 24px;
    min-width: 110px;
}

.score-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
}

.x-color .score-value { color: #ff6b6b; }
.o-color .score-value { color: #4ecdc4; }
.draw-color .score-value { color: #ffe66d; }

/* Status */
.status {
    font-size: 1.2rem;
    letter-spacing: 1px;
    height: 32px;
    transition: all 0.3s ease;
}

.status.x-turn { color: #ff6b6b; }
.status.o-turn { color: #4ecdc4; }
.status.winner { color: #ffe66d; font-weight: bold; font-size: 1.4rem; }
.status.draw { color: #aaa; }

/* Board */
.board {
    display: grid;
    grid-template-columns: repeat(3, min(120px, calc((100vw - 100px) / 3)));
    grid-template-rows: repeat(3, min(120px, calc((100vw - 100px) / 3)));
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px;
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.8rem, 7vw, 3rem);
    font-weight: bold;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease, transform 0.1s ease;
    user-select: none;
}

.cell:hover:not(.taken) {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.03);
}

.cell.taken {
    cursor: default;
}

.cell.x {
    color: #ff6b6b;
    animation: pop 0.2s ease;
}

.cell.o {
    color: #4ecdc4;
    animation: pop 0.2s ease;
}

.cell.winning {
    background: rgba(255, 230, 109, 0.15);
    border-color: #ffe66d;
    animation: pulse 0.6s ease infinite alternate;
}

@keyframes pop {
    0% { transform: scale(0.6); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    from { background: rgba(255, 230, 109, 0.1); }
    to   { background: rgba(255, 230, 109, 0.3); }
}

/* Countdown */
.countdown {
    font-size: 1rem;
    color: #ffe66d;
    letter-spacing: 1px;
    transition: opacity 0.3s ease;
}

.countdown.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Reset Button */
.reset-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.04);
}

.reset-btn:active {
    transform: scale(0.97);
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    gap: 8px;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.55);
    padding: 7px 22px;
    border-radius: 20px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 16px;
        gap: 16px;
    }

    h1 {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }

    .score-board {
        gap: 8px;
        width: 100%;
    }

    .score-item {
        min-width: 0;
        flex: 1;
        padding: 8px 10px;
    }

    .score-value {
        font-size: 1.5rem;
    }

    .status.winner {
        font-size: 1.2rem;
    }

    .reset-btn {
        padding: 10px 20px;
        touch-action: manipulation;
    }

    .cell {
        touch-action: manipulation;
    }
}

/* Feuerwerk Canvas */
#fireworks-canvas {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}
