@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    /* Premium dark gradient background */
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    touch-action: none;
    color: #f8fafc;
    overflow: hidden;
}

/* Add some ambient glowing orbs behind the game */
body::before, body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 10s infinite alternate ease-in-out;
}
body::before {
    background: rgba(56, 189, 248, 0.3);
    top: 10%;
    left: 20%;
}
body::after {
    background: rgba(236, 72, 153, 0.3);
    bottom: 10%;
    right: 20%;
    animation-delay: -5s;
}
@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    z-index: 1;
}

.score-board {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: calc(15px + env(safe-area-inset-top)) calc(25px + env(safe-area-inset-right)) 15px calc(25px + env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}
.score-board span {
    color: #38bdf8;
}

canvas {
    /* Using a white/light gradient background for the canvas so Multiply blend works perfectly */
    background: linear-gradient(to bottom, #e0f2fe 0%, #fff 60%);
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    height: auto;
    aspect-ratio: 800 / 300;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

canvas:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#game-over h2 {
    font-size: 3rem;
    font-weight: 900;
    color: transparent;
    background: linear-gradient(90deg, #f43f5e, #fb923c);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#game-over p {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 25px;
}

.hidden {
    display: none !important;
}

.controls-hint {
    margin-top: 25px;
    font-size: 0.9rem;
    color: #64748b;
    text-align: center;
    font-weight: 500;
    letter-spacing: 1px;
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 800px) {
    .score-board { font-size: 1rem; padding: 10px 15px; }
    #game-over h2 { font-size: 2rem; }
}
