* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    touch-action: none;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100%;
    max-height: 900px;
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* Subtle tile pattern on background */
#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    z-index: 10;
}

.header {
    display: flex;
    justify-content: space-between;
}

.stat-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 12px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    color: #546e7a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 80px;
}

.stat-box span {
    display: block;
    font-size: 26px;
    color: #263238;
    margin-top: 4px;
}

#combo-container.pop span {
    color: #f57c00;
    animation: popScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.6); }
    100% { transform: scale(1); }
}

#strikes {
    align-self: center;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.strike-icon {
    font-size: 28px;
    transition: all 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.strike-icon.hit {
    animation: strikePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes strikePop {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.8) rotate(15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 20;
    text-align: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

#game-over-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#game-over-screen h1 {
    font-size: 48px;
    margin: 0 0 20px 0;
    color: #ff5252;
    text-shadow: 0 4px 10px rgba(255,82,82,0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.final-score-box {
    background: rgba(255,255,255,0.1);
    padding: 20px 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.2);
}

.final-score-box p {
    font-size: 24px;
    margin: 10px 0;
    font-weight: bold;
}

.final-score-box span {
    color: #4fc3f7;
}

.blink {
    animation: blinkAnim 1.5s infinite;
    font-size: 18px;
    opacity: 0.8;
}

@keyframes blinkAnim {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
