/* ================================================================
   GEOMETRY RUSH — style.css
   Theme: Cyberpunk Neon — Deep Space Arcade
   Fonts: Orbitron (display) + Share Tech Mono (UI text)
   ================================================================ */
 
/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
    /* Core palette */
    --cyan:         #00f5ff;
    --pink:         #ff006e;
    --purple:       #7b2fff;
    --orange:       #ff8c00;
    --yellow:       #ffbe0b;
    --white:        #ffffff;
 
    /* Background tones */
    --bg-void:      #02020f;
    --bg-dark:      #05051a;
    --bg-mid:       #0a0a2e;
    --bg-surface:   #0d0d3a;
 
    /* Glow effects */
    --glow-cyan:    0 0 8px rgba(0,245,255,0.8), 0 0 24px rgba(0,245,255,0.35);
    --glow-pink:    0 0 8px rgba(255,0,110,0.8), 0 0 24px rgba(255,0,110,0.35);
    --glow-subtle:  0 0 12px rgba(0,245,255,0.2);
 
    /* Typography */
    --font-display: 'Orbitron', 'Courier New', monospace;
    --font-mono:    'Share Tech Mono', 'Courier New', monospace;
 
    /* Transitions */
    --ease-snap:    cubic-bezier(0.23, 1, 0.32, 1);
}
 
/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
 
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-void);
    font-family: var(--font-mono);
    color: var(--white);
    -webkit-tap-highlight-color: transparent;
}
 
/* ── Game Wrapper ───────────────────────────────────────────── */
#game-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Dark vignette at edges */
    background: radial-gradient(ellipse at center, #070718 0%, #02020a 100%);
    overflow: hidden;
}
 
/* ── Canvas ─────────────────────────────────────────────────── */
#gameCanvas {
    display: block;
    /* Crisp pixel rendering — canvas is drawn at C.WIDTH × C.HEIGHT
       and CSS-scaled up. This prevents blurriness. */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* Disable touch panning/zooming on canvas for zero-lag input */
    touch-action: none;
    cursor: crosshair;
    /* Subtle border glow around canvas */
    box-shadow:
        0 0 0 1px rgba(0,245,255,0.08),
        0 0 40px rgba(0,245,255,0.04),
        0 0 80px rgba(0,0,60,0.5);
}
 
/* ── Screens (Menu / Game Over) ─────────────────────────────── */
/*
   Screens are full-size overlays that sit above the canvas.
   They fade in/out via the .active class toggled by JS.
*/
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Glass-morphism over the canvas */
    background: rgba(2, 2, 15, 0.78);
    backdrop-filter: blur(6px) saturate(1.4);
    -webkit-backdrop-filter: blur(6px) saturate(1.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 20;
}
 
.screen.active {
    opacity: 1;
    pointer-events: all;
}
 
/* Screen panel — the actual card in the center */
.screen-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 44px 40px;
    width: min(420px, 90vw);
    /* Frosted dark panel */
    background: linear-gradient(160deg, rgba(10,10,40,0.9) 0%, rgba(5,5,25,0.95) 100%);
    border: 1px solid rgba(0,245,255,0.14);
    outline: 1px solid rgba(0,245,255,0.04);
    outline-offset: -4px;
}
 
/* Corner bracket decoration using pseudo-elements */
.screen-content::before,
.screen-content::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--cyan);
    border-style: solid;
    opacity: 0.7;
}
.screen-content::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.screen-content::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
 
/* ── Title Block ────────────────────────────────────────────── */
.title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
 
.pre-title {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(0,245,255,0.35);
    text-transform: uppercase;
}
 
.game-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(34px, 7vw, 58px);
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--white);
    text-shadow:
        var(--glow-subtle),
        0 2px 0 rgba(0,0,0,0.6);
}
 
.game-title .accent {
    display: block;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
}
 
.title-rule {
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 8px var(--cyan);
    opacity: 0.6;
}
 
.tagline {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.25);
    text-align: center;
    text-transform: uppercase;
    line-height: 1.6;
}
 
/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    position: relative;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bg-void);
    background: var(--cyan);
    border: none;
    padding: 14px 52px;
    cursor: pointer;
    /* Parallelogram clip */
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
    transition: background 0.15s ease, transform 0.1s var(--ease-snap), box-shadow 0.15s ease;
    outline: none;
    user-select: none;
}
 
.btn-primary:hover {
    background: #80faff;
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}
 
.btn-primary:active {
    transform: translateY(1px);
    background: var(--cyan);
}
 
.btn-primary .btn-text {
    position: relative;
    z-index: 1;
}
 
/* Ghost / secondary button */
.btn-ghost {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(0,245,255,0.4);
    background: transparent;
    border: 1px solid rgba(0,245,255,0.15);
    padding: 9px 28px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    user-select: none;
}
 
.btn-ghost:hover {
    color: var(--cyan);
    border-color: rgba(0,245,255,0.5);
    box-shadow: var(--glow-subtle);
}
 
/* ── Controls Hint ──────────────────────────────────────────── */
.controls-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
 
.hint-label {
    font-size: 9px;
    letter-spacing: 0.35em;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
}
 
.hint-keys {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
 
.hint-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    margin-left: 4px;
}
 
.hint-sep {
    color: rgba(255,255,255,0.15);
}
 
kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(0,245,255,0.7);
    background: rgba(0,245,255,0.05);
    border: 1px solid rgba(0,245,255,0.2);
    border-bottom-width: 2px;
}
 
/* ── HUD ────────────────────────────────────────────────────── */
#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    /* Allow children to be positioned within the HUD container */
}
 
#hud.hidden { display: none; }
 
.hud-group {
    position: absolute;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
 
.hud-left  { left: 18px; align-items: flex-start; }
.hud-right { right: 18px; align-items: flex-end; }
.hud-center {
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    align-items: center;
    width: 200px;
}
 
.hud-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.3em;
    color: rgba(0,245,255,0.35);
    text-transform: uppercase;
}
 
.hud-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    text-shadow: var(--glow-cyan);
    letter-spacing: 0.05em;
    line-height: 1;
}
 
/* Progress bar */
#progress-bar-track {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(0,245,255,0.08);
    border: 1px solid rgba(0,245,255,0.1);
    overflow: visible;
}
 
#progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--cyan);
    box-shadow: var(--glow-cyan);
    transition: width 0.1s linear;
}
 
#progress-bar-pulse {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: var(--glow-cyan);
}
 
/* Attempt badge — floats in top-center */
#attempt-badge {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 22px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.15em;
    white-space: nowrap;
}
 
#attempt-badge::before {
    content: 'ATTEMPT #';
}
 
/* ── Game Over Screen ───────────────────────────────────────── */
.gameover-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
 
.gameover-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(30px, 6vw, 48px);
    letter-spacing: 0.1em;
    color: var(--pink);
    text-shadow: var(--glow-pink);
    /* Flicker on entry */
    animation: crashed-flicker 0.4s ease forwards;
}
 
@keyframes crashed-flicker {
    0%   { opacity: 0; transform: scale(1.1); }
    20%  { opacity: 1; }
    35%  { opacity: 0.2; }
    50%  { opacity: 1; }
    65%  { opacity: 0.4; }
    80%  { opacity: 1; }
    100% { opacity: 1; transform: scale(1); }
}
 
/* Only animate when screen becomes active */
.screen:not(.active) .gameover-title {
    animation: none;
}
 
.gameover-rule {
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pink), transparent);
    box-shadow: 0 0 8px var(--pink);
    opacity: 0.5;
}
 
.stats-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 280px;
}
 
.stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(0,245,255,0.1);
}
 
.stat-divider {
    width: 1px;
    background: rgba(0,245,255,0.1);
    flex-shrink: 0;
}
 
.stat-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.35em;
    color: rgba(0,245,255,0.4);
    text-transform: uppercase;
}
 
.stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 32px;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    letter-spacing: 0.02em;
}
 
/* ── Responsive Scaling ─────────────────────────────────────── */
@media (max-width: 600px) {
    .screen-content {
        padding: 32px 22px;
        gap: 22px;
    }
 
    .hud-value { font-size: 18px; }
 
    .hud-group { top: 10px; }
    .hud-left  { left: 12px; }
    .hud-right { right: 12px; }
 
    .hud-center { width: 140px; top: 14px; }
 
    .btn-primary { padding: 13px 38px; font-size: 12px; }
 
    .stat-value { font-size: 26px; }
}
 
@media (max-height: 500px) {
    .screen-content { gap: 16px; padding: 24px 32px; }
    .game-title { font-size: 30px; }
}
 