:root {
    --bg-gradient-top: #ff5f6d;
    --bg-gradient-bottom: #8c2a55;
    --text-color: #ffffff;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #000;
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    color: var(--text-color);
}

#game-container {
    position: relative;
    width: 100vw;
    height: calc(100vw * 9 / 16);
    /* Improved for cinematic feel, logic still 12:8 */
    max-width: 100%;
    max-height: 100%;
    background: #000;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* In-Game UI */
#ingame-ui {
    position: absolute;
    top: 30px;
    left: 40px;
    text-align: left;
    display: none;
    /* Hidden on start screen */
}

#ingame-ui.active {
    display: block;
}

#stats div {
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#score-display,
#speed-display {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

#controls-hint {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 10px;
    font-weight: 400;
}

/* Overlay Screens */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
    opacity: 0;
    visibility: hidden;
    pointer-events: auto;
}

.overlay-screen.active {
    opacity: 1;
    visibility: visible;
}

/* Start Screen Specific */
.start-content {
    text-align: center;
}

h1 {
    font-size: 6rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: 0.1em;
}

.cn-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    letter-spacing: 0.5em;
    font-weight: 400;
}

.instruction-box {
    margin-top: 2rem;
}

.instruction-box p {
    font-size: 1.2rem;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.start-hint {
    margin-top: 30px;
    opacity: 0.8;
}

/* Game Over Screen */
#gameover-screen {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

#final-score {
    font-size: 1.5rem;
    margin-bottom: 3rem;
}

button {
    background: #fff;
    color: #000;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 5px;
}

button:hover {
    transform: scale(1.05);
    background: #eee;
}

@media (max-width: 768px) {
    h1 {
        font-size: 3.5rem;
    }

    .cn-title {
        font-size: 1.4rem;
    }
}