* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-body);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    touch-action: none;
    position: fixed;
    width: 100%;
    height: 100%;
    transition: background-color 0.3s ease;
}

#game-container {
    position: relative;
    max-width: 100vw;
    max-height: 100vh;
    max-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#score-display {
    background: var(--bg-score);
    padding: 12px 24px;
    border-radius: 50px;
    margin-bottom: 20px;
    display: flex;
    gap: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--bg-score-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.score-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.score-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.score-item span:last-child {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

#game-canvas {
    background: var(--bg-canvas);
    box-shadow: var(--shadow-main);
    cursor: crosshair;
    touch-action: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-gameover);
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-gameover);
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#game-over.hidden {
    display: none;
}

#game-over h2 {
    color: var(--text-gameover-accent);
    font-size: 36px;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

#game-over p {
    font-size: 20px;
    color: var(--text-gameover);
    margin: 10px 0;
    transition: color 0.3s ease;
}

#game-over span {
    font-weight: bold;
    color: var(--text-gameover-accent);
    transition: color 0.3s ease;
}

#restart-btn {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: var(--bg-button);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s ease;
    box-shadow: var(--shadow-button);
}

#restart-btn:hover {
    transform: translateY(-2px);
    background: var(--bg-button-hover);
    box-shadow: var(--shadow-button-hover);
}

#restart-btn:active {
    transform: translateY(0);
}

#fast-forward-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--bg-fastforward);
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-button);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-fastforward);
    user-select: none;
}

#fast-forward-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover);
}

#fast-forward-btn.active {
    background: var(--bg-fastforward-active);
    color: var(--text-fastforward-active);
    animation: pulse 0.8s infinite;
}

#fast-forward-btn.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    #score-display {
        padding: 10px 20px;
        gap: 16px;
        margin-bottom: 10px;
    }

    .score-label {
        font-size: 10px;
    }

    .score-item span:last-child {
        font-size: 18px;
    }

    #game-over {
        padding: 30px 40px;
    }

    #game-over h2 {
        font-size: 28px;
    }

    #game-over p {
        font-size: 16px;
    }

    #restart-btn {
        padding: 12px 30px;
        font-size: 16px;
    }

    #fast-forward-btn {
        bottom: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 12px;
    }

    #fast-forward-btn span {
        display: none;
    }
}

/* Theme Switcher Select */
#theme-switcher {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--bg-fastforward);
    padding: 10px 14px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-button);
    transition: all 0.3s ease;
    z-index: 100;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-fastforward);
    user-select: none;
}

#theme-switcher:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover);
}

#theme-switcher > svg:first-child {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    pointer-events: none;
}

#theme-switcher .dropdown-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: currentColor;
    pointer-events: none;
    transition: transform 0.2s ease;
}

#theme-select {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 140px;
}

#theme-select::-ms-expand {
    display: none;
}

#theme-select option {
    background: var(--bg-body);
    color: var(--text-primary);
    padding: 8px 12px;
    font-weight: 500;
}

/* Theme switcher for mobile */
@media (max-width: 768px) {
    #theme-switcher {
        bottom: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }

    #theme-switcher > svg:first-child {
        width: 18px;
        height: 18px;
    }

    #theme-switcher .dropdown-arrow {
        width: 14px;
        height: 14px;
    }

    #theme-select {
        min-width: 100px;
        font-size: 12px;
    }
}
