/* Skippers — retro shell. The whole stage is one fixed-size block that gets
   integer-scaled by main.js, so DOM HUD text scales in lockstep with the canvas. */

:root {
  /* Display face is deliberately wide and blocky, so it is used at small sizes
     and never for a sentence. Everything meant to be read uses the body face. */
  --font-display: "Press Start 2P", "Courier New", Consolas, monospace;
  --font-body: "IBM Plex Mono", "Courier New", Consolas, monospace;
}

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

html, body {
  height: 100%;
  background: #05060a;
  color: #d7e7cf;
  font-family: var(--font-body);
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage {
  width: 448px;
  height: 570px;              /* 26 top HUD + 512 canvas + 32 bottom HUD */
  transform-origin: center center;
  background: #05060a;
  position: relative;
  user-select: none;
}

/* ---- HUD strips --------------------------------------------------- */

#hud-top, #hud-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  background: #05060a;
}

#hud-top { height: 26px; }
#hud-bottom { height: 32px; }

.lbl { color: #7f8f78; }
.val { color: #ffd94a; }
.spacer { flex: 1 1 auto; }

#hud-top .val { text-shadow: 0 0 6px rgba(255, 217, 74, .35); }

/* lives pips */
.lives { display: inline-flex; gap: 4px; align-items: center; min-width: 60px; }
.life {
  width: 12px; height: 12px;
  display: inline-block;
  background: var(--life, #6ad04a);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .45);
}

#hud-level { flex: 0 0 auto; margin-left: 4px; }

.meter { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.bar {
  position: relative;
  display: inline-block;
  width: 150px; height: 14px;
  background: #14181c;
  box-shadow: inset 0 0 0 2px #46514a;
}
.bar i {
  position: absolute; inset: 2px auto 2px 2px;
  display: block;
  width: 100%;
  background: #4ad06a;
  transition: background .2s linear;
}
.bar.low i { background: #e2483d; }
.bar.low { animation: pulse .5s steps(2, end) infinite; }

/* Battery meter: same bar, segmented, with a nub on the right */
.bar.battery { box-shadow: inset 0 0 0 2px #9aa6b2; }
.bar.battery::after {
  content: ""; position: absolute; right: -5px; top: 3px;
  width: 4px; height: 8px; background: #9aa6b2;
}
.bar.battery i {
  background: #ffd94a;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 12px, transparent 12px 15px);
  mask-image: repeating-linear-gradient(90deg, #000 0 12px, transparent 12px 15px);
}
.bar.battery.low i { background: #e2483d; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }

/* ---- playfield ---------------------------------------------------- */

#field { position: relative; width: 448px; height: 512px; }

#game {
  display: block;
  width: 448px; height: 512px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.screen {
  width: 100%;
  padding: 24px 20px;
  text-align: center;
  background: rgba(4, 8, 12, .93);
  border-top: 2px solid #2e3a33;
  border-bottom: 2px solid #2e3a33;
}
.screen[hidden] { display: none; }

.screen h1 {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 2px;
  color: #6ad04a;
  text-shadow: 3px 3px 0 #1d4a17, 0 0 18px rgba(106, 208, 74, .4);
}
.screen h2 {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 2px;
  color: #ffd94a;
  margin-bottom: 14px;
}
.screen .sub { color: #7f8f78; letter-spacing: 2px; margin: 10px 0 24px; font-size: 10px; }
.screen .foot { color: #66735f; font-size: 10px; letter-spacing: .5px; margin-top: 18px; line-height: 1.8; }
.screen .hi { font-family: var(--font-display); font-size: 9px; color: #ffd94a; margin-top: 10px; }
#over-score { font-family: var(--font-display); color: #d7e7cf; font-size: 11px; }

.blink { font-family: var(--font-display); font-size: 11px; color: #d7e7cf; letter-spacing: 1px; margin-top: 18px; animation: blink 1s steps(2, end) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---- accounts ----------------------------------------------------- */

/* #overlay is pointer-events: none so clicks fall through to the canvas.
   These blocks are the exception -- they are the only DOM you can press. */
.auth {
  margin-top: 16px;
  pointer-events: auto;
}
.auth[hidden] { display: none; }

.auth-who {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 1px;
  color: #6ad04a;
  margin-bottom: 10px;
}
.auth-note {
  color: #7f8f78;
  font-size: 10px;
  letter-spacing: .5px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.auth-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.auth-btn {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 1px;
  color: #d7e7cf;
  background: #14181c;
  border: 2px solid #46514a;
  padding: 9px 11px;
  cursor: pointer;
}
.auth-btn:hover, .auth-btn:focus-visible {
  color: #6ad04a;
  border-color: #6ad04a;
  outline: none;
}
.auth-btn:active { transform: translateY(1px); }
.auth-btn.ghost { color: #7f8f78; border-color: #2e3a33; }
.auth-btn.ghost:hover, .auth-btn.ghost:focus-visible { color: #d7e7cf; border-color: #46514a; }

.auth-status { font-size: 10px; letter-spacing: .5px; color: #7f8f78; margin-top: 12px; }
.auth-status.ok { color: #6ad04a; }
.auth-status.bad { color: #e2483d; }

@media (prefers-reduced-motion: reduce) {
  .blink, .bar.low { animation: none; }
  .auth-btn:active { transform: none; }
}
