:root {
  --bg: #05060a;
  --ink: #c9f9d6;
  --ink-dim: #6aa680;
  --accent: #ff2e88;
  --accent-2: #00ffd0;
  --warn: #ffcc00;
  --panel: rgba(5, 12, 8, 0.78);
  --panel-edge: #1f3b2a;
  --mono: 'VT323', 'Courier New', monospace;
  --display: 'Major Mono Display', 'Courier New', monospace;
}

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

html, body {
  height: 100%;
  background: #000;
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  /* faint static grain on page background */
  background-image:
    radial-gradient(ellipse at center, #08110b 0%, #000 70%);
}

#frame {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

#stage {
  position: relative;
  width: min(100%, 1280px);
  aspect-ratio: 1280 / 720;
  background: #000;
  border: 1px solid #112;
  box-shadow:
    0 0 0 2px #050a06,
    0 0 60px rgba(0, 255, 208, 0.06),
    inset 0 0 80px rgba(0, 0, 0, 0.9);
  border-radius: 6px;
  overflow: hidden;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Scanlines + vignette overlays */
#scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.18) 3px
  );
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 5;
}
#vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 6;
}

/* HUD ------------------------------------------------------------------ */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 10px 16px;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65), rgba(0,0,0,0));
}

#hud .stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 26px;
  margin-right: 16px;
  letter-spacing: 0.05em;
}
#hud .label {
  color: var(--ink-dim);
  font-size: 16px;
  letter-spacing: 0.2em;
}
#hud-left, #hud-center, #hud-right {
  display: flex;
  align-items: center;
}
#hud-left { gap: 18px; }
#hud-right .stat { margin-right: 0; margin-left: 16px; }

.player-name {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.15em;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  text-shadow: 0 0 8px currentColor;
}
#hud-wind-arrow { font-size: 28px; }

/* Overlays ------------------------------------------------------------- */
.overlay {
  position: absolute; inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.7), rgba(0,0,0,0.92));
  backdrop-filter: blur(2px);
}
.hidden { display: none !important; }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: 36px 44px;
  min-width: 420px;
  max-width: 560px;
  box-shadow:
    0 0 0 1px rgba(0,255,208,0.08) inset,
    0 0 40px rgba(0,255,208,0.08);
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px dashed rgba(0,255,208,0.18);
  pointer-events: none;
}

.card h1 {
  font-family: var(--display);
  font-size: 44px;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  text-shadow: 0 0 12px rgba(0,255,208,0.45);
  margin-bottom: 4px;
}
.card h1 .ampersand { color: var(--accent); }
.card .tag {
  font-size: 20px;
  color: var(--ink-dim);
  margin-bottom: 24px;
  letter-spacing: 0.1em;
}

.form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
  color: var(--ink-dim);
  letter-spacing: 0.2em;
}
.form select {
  background: #04110a;
  color: var(--ink);
  border: 1px solid var(--panel-edge);
  font-family: var(--mono);
  font-size: 22px;
  padding: 6px 10px;
  outline: none;
}
.form select:focus { border-color: var(--accent-2); }

button {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  padding: 10px 24px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.15s ease;
  text-shadow: 0 0 6px rgba(0,255,208,0.5);
}
button:hover {
  background: var(--accent-2);
  color: #001a14;
  box-shadow: 0 0 24px rgba(0,255,208,0.45);
}

.controls {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--panel-edge);
  font-size: 18px;
  color: var(--ink-dim);
}
.controls h3 {
  font-size: 14px;
  letter-spacing: 0.3em;
  margin-bottom: 8px;
  color: var(--accent);
}
.controls ul { list-style: none; line-height: 1.6; }
kbd {
  display: inline-block;
  padding: 1px 6px;
  background: #0a1a12;
  border: 1px solid var(--panel-edge);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--ink);
}

.card.mini {
  min-width: 0;
  padding: 24px 36px;
  text-align: center;
}
.handoff-name {
  font-family: var(--display);
  font-size: 36px;
  letter-spacing: 0.2em;
  margin-bottom: 6px;
  text-shadow: 0 0 10px currentColor;
}
.handoff-sub {
  font-size: 20px;
  color: var(--ink-dim);
}

#gameover h2 {
  font-family: var(--display);
  font-size: 56px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(255,46,136,0.6);
  margin-bottom: 6px;
}
#gameover-detail {
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 24px;
}
