:root {
    --bg-color: #1a1a2e;
    --text-color: #ffffff;
    --primary-color: #e94560;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --highlight: #4effef;
    --font-main: 'Poppins', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

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

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

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px; /* Mobile-first but constrained on desktop */
    margin: 0 auto;
    background: radial-gradient(circle at center, #16213e 0%, #1a1a2e 100%);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

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

#hidden-input {
    position: absolute;
    top: -1000px;
    opacity: 0;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas if needed, but screens will block */
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none !important;
}

.title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ff00cc, #3333ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    animation: float 3s ease-in-out infinite;
}

.subtitle {
    font-size: 1.2rem;
    color: #a0a0a0;
    margin-bottom: 2rem;
}

.instructions {
    margin-bottom: 3rem;
    font-size: 1rem;
    line-height: 1.5;
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary {
    background: linear-gradient(90deg, #ff00cc, #3333ff);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(51, 51, 255, 0.4);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(51, 51, 255, 0.6);
}

.btn-primary:active {
    transform: scale(0.95);
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

.score-box, .chain-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

#score-display, #chain-display {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--highlight);
}

.timer-box {
    flex-grow: 1;
    margin: 0 2rem;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    top: 10px;
}

#timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00ccff);
    transition: width 0.1s linear;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-red {
    0% { background: linear-gradient(90deg, #ff4444, #ff0000); }
    100% { background: linear-gradient(90deg, #ff0000, #cc0000); }
}
