/* ============================================================
   ROGUE VOID — style.css
   Neon sci-fi shell for the canvas game + overlay screens.
   ============================================================ */

:root {
  --cyan: #8ef7ff;
  --pink: #ff5f8f;
  --green: #7cffc4;
  --amber: #ffd66b;
  --ink: #03050c;
  --panel: rgba(6, 12, 26, 0.86);
  --line: rgba(142, 247, 255, 0.28);
  --text: #dceaf7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app { position: fixed; inset: 0; }

/* faint CRT scanlines */
#app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.5;
  z-index: 4;
}

canvas#game { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---------------- HUD buttons ---------------- */
#hud-ui {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 6;
}

.hud-btn {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(6, 12, 26, 0.75);
  color: var(--cyan);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.hud-btn:hover { border-color: var(--cyan); transform: translateY(-2px); }
.hud-btn.on { background: rgba(142, 247, 255, 0.22); border-color: var(--cyan); box-shadow: 0 0 14px rgba(142, 247, 255, .35); }

/* ---------------- overlay screens ---------------- */
#overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  z-index: 8;
  pointer-events: none;
}
#overlay.active { pointer-events: auto; }

.screen {
  width: min(940px, 100%);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: clamp(18px, 3vw, 34px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(0, 0, 0, .7), inset 0 0 40px rgba(142, 247, 255, .05);
  backdrop-filter: blur(8px);
  text-align: center;
  animation: pop .22s ease-out;
}
.screen.hidden { display: none; }

@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.logo {
  margin: 4px 0 2px;
  font-size: clamp(38px, 8vw, 76px);
  letter-spacing: .14em;
  font-weight: 800;
  line-height: 1;
}
.logo span { color: #eaf7ff; text-shadow: 0 0 22px rgba(142, 247, 255, .55); }
.logo em {
  font-style: normal;
  margin-left: .18em;
  background: linear-gradient(90deg, var(--pink), #b98bff, var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.tagline { margin: 6px 0 18px; letter-spacing: .22em; font-size: clamp(9px, 1.5vw, 12px); color: rgba(220, 234, 247, .6); }

.brief { max-width: 640px; margin: 0 auto 20px; font-size: 14px; line-height: 1.55; color: rgba(220, 234, 247, .82); }
.brief p { margin: 0; }

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  text-align: left;
}
.ctrl-col {
  border: 1px solid rgba(142, 247, 255, .16);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(10, 18, 34, .55);
}
.ctrl-col h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .16em; color: var(--cyan); }
.ctrl-col ul { margin: 0; padding-left: 16px; }
.ctrl-col li { font-size: 12.5px; line-height: 1.75; color: rgba(220, 234, 247, .8); }
.ctrl-col b { color: #fff; }

.salvage { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.chip {
  font-size: 11.5px; letter-spacing: .06em;
  padding: 7px 11px; border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, .04);
}
.chip.rail { color: #8ef7ff; } .chip.laser { color: #ff9df2; }
.chip.fuel { color: #ffd66b; } .chip.shield { color: #7cffc4; }

button.primary, button.ghost {
  font: inherit;
  font-weight: 800;
  letter-spacing: .18em;
  padding: 14px 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease;
}
button.primary {
  color: #04121a;
  background: linear-gradient(100deg, var(--cyan), #b8fff0);
  border: none;
  box-shadow: 0 0 26px rgba(142, 247, 255, .35);
}
button.primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 40px rgba(142, 247, 255, .6); }
button.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(255, 95, 143, .5);
}
button.ghost:hover { background: rgba(255, 95, 143, .12); transform: translateY(-2px); }

.best { margin: 16px 0 0; font-size: 11px; letter-spacing: .2em; color: rgba(220, 234, 247, .5); }
.best b { color: var(--amber); }

.panel-title { margin: 0 0 6px; font-size: clamp(20px, 4vw, 30px); letter-spacing: .18em; color: #eaf7ff; }
.panel-title .sub { display: block; margin-top: 8px; font-size: 11.5px; letter-spacing: .16em; color: rgba(220, 234, 247, .55); font-weight: 600; }
.panel-title b { color: var(--green); }
.panel-title.win { color: var(--green); text-shadow: 0 0 26px rgba(124, 255, 196, .5); }
.panel-title.lose { color: var(--pink); text-shadow: 0 0 26px rgba(255, 95, 143, .45); }

.sub-center { margin: 0 0 18px; font-size: 13.5px; color: rgba(220, 234, 247, .78); }
.hint { margin: 16px 0 0; font-size: 11px; letter-spacing: .18em; color: rgba(220, 234, 247, .45); }

.row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------------- upgrade cards ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(206px, 1fr));
  gap: 14px;
  margin: 20px 0 14px;
}
.card {
  position: relative;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 18px 16px 16px;
  border-radius: 14px;
  border: 1px solid rgba(142, 247, 255, .22);
  background: linear-gradient(160deg, rgba(16, 30, 52, .9), rgba(8, 14, 28, .9));
  color: var(--text);
  transition: transform .14s ease, border-color .14s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 26px rgba(142, 247, 255, .22);
}
.card .key {
  position: absolute; top: 10px; right: 12px;
  font-size: 11px; letter-spacing: .1em;
  color: rgba(220, 234, 247, .5);
  border: 1px solid rgba(220, 234, 247, .25);
  border-radius: 6px; padding: 1px 6px;
}
.card .icon { display: block; font-size: 30px; line-height: 1; color: var(--cyan); margin-bottom: 10px; }
.card .name { display: block; font-weight: 800; letter-spacing: .1em; font-size: 13.5px; color: #eaf7ff; }
.card .desc { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: rgba(220, 234, 247, .72); }
.card .stack { display: inline-block; margin-top: 10px; font-size: 10.5px; letter-spacing: .12em; color: var(--green); }

.taken { min-height: 26px; font-size: 18px; letter-spacing: .3em; color: rgba(142, 247, 255, .85); }
.taken .lbl { display: block; font-size: 10px; letter-spacing: .22em; color: rgba(220, 234, 247, .45); margin-bottom: 6px; }

/* ---------------- end stats ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 18px;
  max-width: 720px;
  margin: 4px auto 6px;
}
.stat {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(142, 247, 255, .12);
  font-size: 12.5px;
}
.stat span { letter-spacing: .1em; color: rgba(220, 234, 247, .6); font-size: 10.5px; }
.stat b { color: #eaf7ff; font-size: 14px; }

.loadout { grid-column: 1 / -1; margin-top: 12px; text-align: left; }
.loadout span { display: block; font-size: 10px; letter-spacing: .22em; color: rgba(220, 234, 247, .45); margin-bottom: 8px; }
.loadout i {
  display: inline-block; font-style: normal;
  margin: 0 6px 6px 0; padding: 5px 10px;
  border: 1px solid rgba(142, 247, 255, .3); border-radius: 999px;
  font-size: 11.5px; letter-spacing: .06em; color: #cfe8ff;
}

/* ---------------- small screens ---------------- */
@media (max-width: 640px) {
  .brief { display: none; }
  .screen { padding: 16px 14px; border-radius: 12px; }
  .controls-grid { gap: 8px; }
  .ctrl-col li { font-size: 11.5px; line-height: 1.6; }
  button.primary, button.ghost { padding: 13px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
