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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #060a1e;
    font-family: 'Outfit', sans-serif;
    color: #e0e8ff;
}

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

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    width: 100%;
    position: relative;
}

#title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ff6bdf, #6bfff0, #ffe66b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(107, 255, 240, 0.3));
}

.accent {
    font-weight: 700;
    font-size: 12px;
    opacity: 0.8;
}

#berry-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.5;
    font-weight: 300;
}

#score-area {
    text-align: center;
    padding: 2px 0;
}

#current-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 36px;
    line-height: 1;
    background: linear-gradient(180deg, #fff, #a0b4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(100, 140, 255, 0.4));
    transition: transform 0.15s ease;
}

#best-score-label {
    font-size: 11px;
    font-weight: 300;
    opacity: 0.5;
    letter-spacing: 2px;
}

#combo-display {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 28px;
    color: #ffcc00;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.8), 0 0 40px rgba(255, 100, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 4px;
}

/* Game Over */
#game-over-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(4, 6, 20, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

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

#game-over-content {
    text-align: center;
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#game-over-msg {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ff6bdf;
}

#final-score-label {
    font-size: 12px;
    letter-spacing: 4px;
    opacity: 0.5;
    font-weight: 300;
}

#final-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 64px;
    background: linear-gradient(180deg, #fff, #ff6bdf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

#final-best {
    font-size: 14px;
    opacity: 0.5;
    margin-bottom: 12px;
    font-weight: 300;
}

#game-over-stats {
    font-size: 12px;
    opacity: 0.6;
    margin-bottom: 24px;
    line-height: 1.8;
    font-weight: 300;
}

#play-again-btn {
    pointer-events: all;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 18px;
    padding: 14px 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6bdf, #6b8bff);
    color: #fff;
    cursor: pointer;
    letter-spacing: 2px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 24px rgba(255, 107, 223, 0.4);
    animation: btnPulse 2s ease-in-out infinite;
}

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

#play-again-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(255, 107, 223, 0.6);
}

footer {
    position: fixed;
    bottom: 4px;
    width: 100%;
    text-align: center;
    z-index: 50;
    pointer-events: all;
}

footer a {
    color: rgba(160, 180, 255, 0.3);
    text-decoration: none;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    transition: color 0.2s;
}

footer a:hover {
    color: rgba(160, 180, 255, 0.6);
}