/* ============================================================
   METEOR SHOWER — stylesheet
   Same design tokens as the Xilios site for brand consistency.
   ============================================================ */
:root{
  --ink:    #050208;   /* deep space background     */
  --star:   #efe9ff;   /* primary text              */
  --dim:    #9d92c4;   /* secondary text            */
  --amber:  #ffb45c;   /* core accent               */
  --violet: #7a63ff;   /* outer accent              */
  --danger: #ff3b3b;   /* miss flash                */
  --line:   rgba(154, 134, 255, .18);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body:    'Space Grotesk', system-ui, sans-serif;
}

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

html, body{
  height:100%;
  overflow:hidden;          /* the game fills the screen; no scroll */
  background:var(--ink);
  color:var(--star);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  touch-action:none;        /* taps are game input, not gestures */
  user-select:none;
  -webkit-user-select:none;
}

/* ==========================================================
   Canvas — crosshair cursor sells the "gunner" feel
   ========================================================== */
#game-canvas{
  position:fixed;
  inset:0;
  display:block;
  cursor:crosshair;
}

/* ==========================================================
   Miss flash — red vignette, toggled from JS
   ========================================================== */
#flash{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:5;
  opacity:0;
  transition:opacity .12s ease-out;
  background:radial-gradient(ellipse at center,
              transparent 40%, rgba(255,59,59,.55) 100%);
}
#flash.active{ opacity:1; }

/* ==========================================================
   Floating score pops (+N at the click position)
   ========================================================== */
#pops{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:8;
  overflow:hidden;
}
.pop{
  position:absolute;
  font-family:var(--font-display);
  font-weight:500;
  font-size:1rem;
  color:var(--amber);
  text-shadow:0 0 12px rgba(255,180,92,.8);
  transform:translate(-50%, -50%);
  animation:pop-rise .8s ease-out forwards;
}
@keyframes pop-rise{
  0%  { opacity:1; translate:0 0;    scale:.7; }
  20% {            scale:1.15; }
  100%{ opacity:0; translate:0 -46px; scale:1; }
}
@media (prefers-reduced-motion: reduce){
  .pop{ animation:pop-fade .6s ease-out forwards; }
  @keyframes pop-fade{
    0%  { opacity:1; }
    100%{ opacity:0; }
  }
}

/* ==========================================================
   HUD
   ========================================================== */
#hud{
  position:fixed;
  top:0; left:0; right:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  padding:20px 26px;
  pointer-events:none;
}
.hud-box{ display:flex; flex-direction:column; gap:2px; }
#lives-box{ text-align:right; }
.hud-label{
  font-size:.6rem;
  letter-spacing:.4em;
  text-transform:uppercase;
  color:var(--dim);
}
#score{
  font-family:var(--font-display);
  font-weight:500;
  font-size:1.5rem;
  color:var(--star);
}
#lives{
  font-size:1.2rem;
  letter-spacing:.2em;
  color:var(--amber);
}
#lives .lost{ color:rgba(157,146,196,.3); }

/* ==========================================================
   Overlays (start / game over)
   ========================================================== */
.overlay{
  position:fixed;
  inset:0;
  z-index:20;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:0 8vw;
  background:rgba(5,2,8,.55);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
}
.overlay.hidden{ display:none; }

.sector-tag{
  font-size:.68rem;
  letter-spacing:.5em;
  text-transform:uppercase;
  color:var(--amber);
  margin-bottom:1.2rem;
}

.overlay h1{
  font-family:var(--font-display);
  font-weight:700;
  font-size:clamp(2rem, 6.5vw, 4.6rem);
  letter-spacing:.12em;
  line-height:1.1;
  margin-bottom:1.4rem;
  background:linear-gradient(100deg, var(--amber) 0%, var(--star) 45%, var(--violet) 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.overlay-copy{
  color:var(--dim);
  font-size:clamp(.9rem, 1.5vw, 1.05rem);
  line-height:1.7;
  max-width:46ch;
}
.overlay-copy.dim{ font-size:.85rem; margin-top:.6rem; }

.big-score{
  font-family:var(--font-display);
  font-weight:700;
  font-size:clamp(2.5rem, 8vw, 5rem);
  color:var(--amber);
  line-height:1.2;
}

#controls-help{
  list-style:none;
  margin:1.6rem 0 0;
  color:var(--dim);
  font-size:.85rem;
  line-height:2;
}
#controls-help b{ color:var(--star); font-weight:500; }

.btn{
  margin-top:2.2rem;
  padding:.9rem 3.2rem;
  font-family:var(--font-display);
  font-weight:500;
  font-size:.9rem;
  letter-spacing:.25em;
  text-transform:uppercase;
  color:var(--star);
  background:transparent;
  border:1px solid var(--amber);
  border-radius:4px;
  cursor:pointer;
  transition:background .25s, box-shadow .25s, transform .15s;
}
.btn:hover{
  background:rgba(255,180,92,.12);
  box-shadow:0 0 24px rgba(255,180,92,.35);
}
.btn:active{ transform:scale(.97); }

@media (prefers-reduced-motion: reduce){
  .btn:active{ transform:none; }
  #flash{ transition:none; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 600px){
  #hud{ padding:14px 16px; }
  #score{ font-size:1.2rem; }
  #controls-help{ font-size:.78rem; }
  .btn{ padding:.8rem 2.4rem; }
}
