/* ============================================================
   HERMANIFY  --  8-Bit NES Arcade Hub & Custom Retro Games
   ============================================================ */

@font-face {
  font-family: 'Press Start 2P';
  src: url('fonts/PressStart2P.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'VT323';
  src: url('fonts/VT323.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: block;
}

:root {
  --fy:          #ffd000;
  --fy-dark:     #c8a000;
  --fy-glow:     rgba(255, 208, 0, 0.35);
  --carbon:      #0c0e14;
  --carbon-card: #141720;
  --carbon-border:#262a36;
  --cyan:        #00e5ff;
  --emerald:     #00e676;
  --cream:       #f5f5f5;
  --paper:       #181c26;
  --ink:         #f0f3f8;
  --shadow:      #000000;

  --px: 4px;

  /* ── legacy aliases ──────────────────────────────────────────
     The arcade reskin replaced :root wholesale but left ~35 rules
     still calling the old pink names, so those declarations were
     invalid and silently dropped -- which is why the cartridge
     title rendered unstyled. Mapped onto the gold/carbon palette
     rather than chased through every rule.
     ─────────────────────────────────────────────────────────── */
  --pink-deep:  #ffd000;   /* was the accent  -> Fitway gold      */
  --pink:       #ffd000;
  --pink-soft:  #6b5200;   /* was a tint      -> dark gold        */
  --pink-ink:   #8a94a6;   /* used as BOTH muted text and border  */
  --uiMuted:    #8a94a6;
  --gold:       #ffd000;
  --mario-red:  #d82800;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--carbon);
  color: var(--ink);
  font-family: 'VT323', ui-monospace, monospace;
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  image-rendering: pixelated;
  background-image:
    linear-gradient(45deg, #12151e 25%, transparent 25%, transparent 75%, #12151e 75%, #12151e),
    linear-gradient(45deg, #12151e 25%, transparent 25%, transparent 75%, #12151e 75%, #12151e);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  background-attachment: fixed;
}

body.playing { overflow: hidden; }

a, button, .pxbtn, .sfx-btn, .cart-btn, .crt-btn, [role='button'] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'><path d='M6 4h4v2h4V4h4v4h2v6h-2v2h-2v2h-2v2h-4v-2H8v-2H6v-2H4V8h2z' fill='%23d3216b'/><path d='M8 6h2v2h4V6h2v2h2v4h-2v2h-2v2h-4v-2H8v-2H6V8h2z' fill='%23fff'/></svg>") 0 0, pointer;
}

/* global scanline veil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: linear-gradient(rgba(255,255,255,0) 50%, rgba(255,120,180,0.06) 50%);
  background-size: 100% 4px;
}

/* ══ MARQUEE TICKER ══════════════════════════════════════ */
.marquee-bar {
  background: var(--fy);
  border-bottom: var(--px) solid var(--carbon-border);
  color: #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 60;
}
.marquee-track {
  display: inline-flex;
  gap: 3rem;
  animation: marquee 38s linear infinite;
  will-change: transform;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ══ LAYOUT ═══════════════════════════════════════════════ */
.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 14px 40px;
}

/* ══ ARCADE MASTHEAD & CRT MODE CONTROLS ══════════════════ */
.arcade-masthead {
  background: linear-gradient(180deg, #1c202c 0%, var(--carbon-card) 100%);
  border: var(--px) solid var(--carbon-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), var(--px) var(--px) 0 var(--fy);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.masthead-brand { text-align: left; }
.brand-badge {
  display: inline-block;
  background: var(--fy);
  color: #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  font-weight: bold;
  padding: 4px 8px;
  border: 2px solid #000;
  margin-bottom: 6px;
  letter-spacing: .1em;
}
.brand-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(20px, 5vw, 34px);
  color: var(--fy);
  margin: 0;
  text-shadow: 2px 2px 0 #000, 4px 4px 0 rgba(255,208,0,0.3);
  letter-spacing: .05em;
}
.brand-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.8vw, 10px);
  color: var(--cyan);
  margin: 8px 0 0;
  letter-spacing: .12em;
}

.crt-controls-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.crt-label-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--fy);
  margin-right: 4px;
}
.crt-btn {
  background: #1e222e;
  border: 2px solid var(--carbon-border);
  color: #c8d2dc;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 6px 8px;
  box-shadow: 2px 2px 0 #000;
}
.crt-btn:hover { background: #2a3040; color: #fff; }
.crt-btn.active {
  background: var(--fy);
  color: #000;
  font-weight: bold;
  border-color: #000;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3);
}

/* CRT Modes */
body[data-crt="amber"] .crt-monitor {
  filter: sepia(1) saturate(5) hue-rotate(-25deg) contrast(1.3) brightness(0.9);
}
body[data-crt="gameboy"] .crt-monitor {
  filter: sepia(1) hue-rotate(50deg) saturate(3) contrast(1.4) brightness(0.85);
}
body[data-crt="scanlines"] .crt-scan {
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.5) 50%);
  background-size: 100% 2px;
}

/* ══ CARTRIDGE LABEL ══════════════════════════════════════ */
.cart-label {
  position: relative;
  background: linear-gradient(180deg, #1e222e 0%, var(--carbon-card) 100%);
  border: var(--px) solid var(--carbon-border);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5), var(--px) var(--px) 0 var(--fy);
  padding: 14px 18px 12px;
  margin-bottom: 20px;
  text-align: center;
}
.cart-holes {
  display: flex; justify-content: center; gap: 10px; margin-bottom: 8px;
}
.cart-holes i {
  width: 26px; height: 8px; background: #000; opacity: .6; display: block;
}
.cart-title h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(13px, 3.4vw, 24px);
  line-height: 1.55;
  color: var(--fy);
  margin: 0;
  text-shadow: 2px 2px 0 #000, 4px 4px 0 rgba(255,208,0,0.25);
  display: flex; flex-direction: column; align-items: center; gap: .35em;
}
.cart-amp {
  font-size: .52em;
  color: var(--pink-ink);
  text-shadow: 2px 2px 0 #fff;
  letter-spacing: .1em;
}
.cart-sub {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.8vw, 11px);
  color: var(--cyan);
  margin: 12px 0 0;
  letter-spacing: .14em;
}

/* ══ CONSOLE SHELL ════════════════════════════════════════ */
.console-shell {
  background: var(--carbon-card);
  border: var(--px) solid var(--carbon-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.7), var(--px) var(--px) 0 var(--fy);
  padding: 16px;
  margin-bottom: 28px;
}

.crt-monitor {
  background: #181c26;
  border: calc(var(--px)*2) solid #222634;
  outline: var(--px) solid var(--carbon-border);
  padding: 8px 8px 6px;
  position: relative;
}
.crt-inner {
  position: relative;
  background: #000;
  border: var(--px) solid var(--carbon-border);
  line-height: 0;
  overflow: hidden;
}
#screen {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  background: #000;
}
.crt-scan {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.3) 50%);
  background-size: 100% 3px;
}
.crt-glow {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  box-shadow: inset 0 0 30px rgba(0,229,255,0.08), inset 0 0 80px rgba(0,0,0,0.6);
}
.crt-brand {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--uiMuted);
  text-align: center;
  padding-top: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.crt-brand .led {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* ══ HUD ══════════════════════════════════════════════════ */
.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 2fr;
  gap: 8px;
  margin-top: 12px;
}
.hud-cell {
  background: #161922;
  border: 1px solid var(--carbon-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  padding: 7px 9px;
  min-width: 0;
}
.hud-cell--wide { display: flex; flex-direction: column; }
.hud-label {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--fy);
  letter-spacing: .1em;
  margin-bottom: 5px;
}
.hud-count {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--cyan);
  margin-top: 5px;
}
.hud-quest {
  font-size: 17px;
  line-height: 1.1;
  margin: 0;
  color: var(--ink);
  flex: 1;
}
.hud-place {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--fy);
  margin-top: 4px;
  letter-spacing: .08em;
}

/* ══ IN-SCREEN VIRTUAL ARCADE CONTROLS (SAFARI / ANDROID / FULLSCREEN) ═════ */
/* ══ ARCADE CONTROL DECK ══════════════════════════════════
   Below the screen, never over it. The old build absolutely
   positioned these across the canvas, which buried the status
   bar and covered the play area.
   ════════════════════════════════════════════════════════ */
.control-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #1a1e2a 0%, #12151d 100%);
  border: var(--px) solid var(--carbon-border);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.04), 0 6px 18px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* the moulded plate between the pad and the buttons */
.deck-plate {
  flex: 1;
  text-align: center;
  min-width: 0;
  padding: 0 8px;
}
.deck-brand {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, 2.4vw, 16px);
  color: var(--fy);
  text-shadow: 2px 2px 0 #000;
  letter-spacing: .12em;
}
.deck-model {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #5d6577;
  margin-top: 7px;
  letter-spacing: .18em;
  white-space: nowrap;
}
.deck-brand { white-space: nowrap; }
/* on a narrow phone the plate is the first thing that can go */
@media (max-width: 430px) {
  .deck-model { display: none; }
  .deck-plate { padding: 0 2px; }
}

/* ---- D-pad: one continuous touch surface ---- */
.dpad {
  position: relative;
  width: 150px; height: 150px;
  flex: none;
  touch-action: none;
}
.dbtn { pointer-events: none; }

.dbtn, .rbtn {
  position: absolute;
  background: #262b38;
  border: 3px solid #0a0c12;
  color: var(--fy);
  font-size: 19px;
  line-height: 1;
  box-shadow: 0 3px 0 #0a0c12, inset 0 2px 0 rgba(255,255,255,0.07);
  touch-action: none;
  padding: 0;
}
.dbtn { width: 50px; height: 50px; }
.dbtn--up    { left: 50px; top: 0; }
.dbtn--down  { left: 50px; top: 100px; }
.dbtn--left  { left: 0;    top: 50px; }
.dbtn--right { left: 100px; top: 50px; }
.dpad-center {
  position: absolute; left: 50px; top: 50px; width: 50px; height: 50px;
  background: #323847;
  border: 3px solid #0a0c12;
  pointer-events: none;
  will-change: transform;
}
.dbtn.held, .rbtn.held {
  background: var(--fy);
  color: #000;
  box-shadow: inset 0 3px 0 rgba(0,0,0,0.25);
  transform: translateY(2px);
}

.abuttons { position: relative; width: 152px; height: 116px; flex: none; }
.rbtn {
  width: 66px; height: 66px;
  border-radius: 50%;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
}
.rbtn--a { right: 0;   top: 6px;  border-color: #00838f; color: var(--cyan); }
.rbtn--b { right: 76px; top: 40px; border-color: #7a5a00; }
.rbtn--a.held { background: var(--cyan); color: #000; }
.rbtn::after {
  content: attr(data-caption);
  position: absolute; left: 50%; transform: translateX(-50%); bottom: -14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #6d7689;
  letter-spacing: .06em;
}

/* ══ CONSOLE FOOT CONTROLS ════════════════════════════════ */
.console-feet {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--carbon-border);
}
.pxbtn {
  background: #1a1d26;
  border: 2px solid var(--carbon-border);
  color: var(--fy);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 9px 12px;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.05s ease;
}
.pxbtn:hover { background: #262c3a; color: #fff; }
.pxbtn:active { transform: translate(2px, 2px); box-shadow: none; }

.pxbtn--eject {
  background: var(--fy);
  color: #000;
  border-color: #000;
  font-weight: bold;
}
.pxbtn--eject:hover { background: #ffe666; }

.pxbtn--go {
  background: var(--cyan);
  color: #000;
  border-color: #000;
  font-weight: bold;
}
.pxbtn--go:hover { background: #80f0ff; }
.pxbtn--warn { background: var(--fy); color: #000; }
.hint {
  font-size: 17px; color: var(--uiMuted); opacity: .8; margin-left: auto;
}

/* ══ CARTRIDGE SELECTION RACK ("CHOOSE A GAME") ═══════════ */
.section-cart-rack {
  margin: 32px 0;
}
.section-head {
  text-align: center;
  margin-bottom: 22px;
}
.section-head h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, 3.2vw, 20px);
  color: var(--pink-deep);
  margin: 0 0 8px;
  text-shadow: 2px 2px 0 #fff;
}
.section-head p {
  font-size: 20px;
  color: var(--pink-ink);
  margin: 0;
  opacity: .85;
}

.cart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.cart-card {
  background: var(--paper);
  border: var(--px) solid var(--pink-ink);
  box-shadow: var(--px) var(--px) 0 var(--pink-deep), calc(var(--px)*2) calc(var(--px)*2) 0 var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.cart-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--px) calc(var(--px)*2) 0 var(--pink-deep), calc(var(--px)*2) calc(var(--px)*3) 0 var(--shadow);
}
.cart-card.active {
  outline: 3px solid var(--pink);
  border-color: var(--pink-deep);
}
.cart-card-top {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* "CART 01 - FEATURED" plus the "16-BIT GYM RPG" badge measure
     ~254px of pixel type inside a ~230px card. With no wrapping the
     two simply printed on top of each other. */
  flex-wrap: wrap;
  gap: 6px 8px;
  color: #fff;
  border-bottom: var(--px) solid var(--pink-ink);
}
.cart-num, .cart-badge { min-width: 0; overflow-wrap: anywhere; }
.cart-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: .08em;
}
.cart-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 3px 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.4);
}

.cart-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.cart-card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--pink-deep);
  margin: 0 0 6px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.cart-card-sub {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--pink-ink);
  opacity: .75;
  margin: 0 0 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.cart-card-desc {
  font-size: 17px;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 14px;
  flex: 1;
}
.cart-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--pink-ink);
  border-top: 1px dashed var(--pink-soft);
  padding-top: 8px;
  margin-bottom: 12px;
}
.pxbtn--play {
  width: 100%;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  padding: 10px;
  text-align: center;
}
.pxbtn--play:hover { background: var(--pink-deep); }

/* ══ 8-BIT MARIO SOUNDBOARD JUKEBOX ═══════════════════════ */
.section-soundboard {
  margin: 32px 0;
}
.panel--soundboard {
  background: var(--cream);
}
.soundboard-intro {
  font-size: 19px;
  color: var(--pink-ink);
  text-align: center;
  margin: -6px 0 16px;
}
.sfx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.sfx-btn {
  /* was #fff with near-white text -- completely unreadable */
  background: #1e222e;
  border: var(--px) solid var(--pink-ink);
  box-shadow: var(--px) var(--px) 0 var(--pink-soft);
  padding: 10px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--fy);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: transform 0.05s ease;
}
.sfx-btn span { font-size: 18px; line-height: 1; }
.sfx-btn:hover { background: #2c3240; color: #fff; }
.sfx-btn:active, .sfx-btn.pop {
  transform: translate(var(--px), var(--px));
  box-shadow: none;
  background: var(--gold);
}
.sfx-mario { border-color: var(--mario-red); }

/* ══ MANUAL / INSTRUCTION BOOKLET ═════════════════════════ */
.manual { margin-top: 26px; }
.panel {
  background: var(--paper);
  border: var(--px) solid var(--pink-ink);
  box-shadow: var(--px) var(--px) 0 var(--pink-deep), calc(var(--px)*2) calc(var(--px)*2) 0 var(--shadow);
  padding: 18px;
}
.panel-head {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #fff;
  background: var(--pink-deep);
  border: var(--px) solid var(--pink-ink);
  padding: 10px;
  margin: -6px 0 18px;
  text-align: center;
  letter-spacing: .06em;
}
.manual-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.manual-cols h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--pink-deep);
  margin: 0 0 10px;
  border-bottom: var(--px) solid var(--pink-soft);
  padding-bottom: 7px;
  letter-spacing: .08em;
}
.manual-cols p { margin: 0 0 10px; line-height: 1.15; }
.manual-cols b { color: var(--pink-deep); }
.manual-list { margin: 0; padding-left: 18px; line-height: 1.2; }
.manual-list li { margin-bottom: 7px; }
.manual-tiny { font-size: 15px; opacity: .65; }

/* ══ FOOTER ═══════════════════════════════════════════════ */
.site-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 24px; flex-wrap: wrap;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--pink-ink);
  opacity: .8;
}
.foot-hearts { color: var(--pink-deep); font-size: 12px; letter-spacing: .3em; }

/* ══ FULLSCREEN STYLES ════════════════════════════════════ */
.console-shell:fullscreen {
  width: 100vw; height: 100vh;
  background: #2a0f1f;
  border: none; box-shadow: none;
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 8px;
}
.console-shell:fullscreen > * { width: 100%; max-width: 860px; }
.console-shell:fullscreen .crt-monitor {
  max-width: min(100%, calc((100vh - 300px) * 1.143));
  border-width: 8px;
}
.console-shell:fullscreen .hint { display: none; }

body.fs-on { overflow: hidden; }
body.fs-on .marquee-bar,
body.fs-on .arcade-masthead,
body.fs-on .section-cart-rack,
body.fs-on .section-soundboard,
body.fs-on .manual,
body.fs-on .site-foot { display: none; }
body.fs-on .page { padding: 6px; max-width: none; }

/* ══ RESPONSIVE ═══════════════════════════════════════════ */
@media (max-width: 720px) {
  .page { padding: 8px 8px 24px; }
  .arcade-masthead { padding: 12px; }
  .console-shell { padding: 10px; }
  .hint { display: none; }

  .cart-holes { display: none; }
  .cart-label { padding: 9px 12px 9px; margin-bottom: 10px; }
  .cart-title h1 { gap: .25em; }
  .cart-sub { margin-top: 9px; }
  .cart-scrawl { font-size: 16px; right: 8px; bottom: 2px; }

  .hud { grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
  .hud-cell { padding: 5px 8px; }
  .hud-cell:first-child { grid-column: 1 / -1; }
  .hud-cell--wide { grid-column: 1 / -1; }
  .hud-row { flex-wrap: wrap; }
  .hud-quest { font-size: 17px; }
  .hud-count { margin-top: 3px; }

  .crt-monitor { border-width: 8px; padding: 6px 6px 4px; }
  .crt-brand { display: none; }

  .touch { margin-top: 8px; }
  .console-feet { margin-top: 10px; padding-top: 10px; }
  .manual { margin-top: 18px; }
}

@media (max-width: 420px) {
  .dpad { width: 132px; height: 132px; }
  .dbtn { width: 44px; height: 44px; }
  .dbtn--up { left: 44px; top: 0; }
  .dbtn--down { left: 44px; top: 88px; }
  .dbtn--left { left: 0; top: 44px; }
  .dbtn--right { left: 88px; top: 44px; }
  .dpad-center { left: 44px; top: 44px; width: 44px; height: 44px; }
  .abuttons { width: 120px; height: 100px; }
  .rbtn { width: 54px; height: 54px; font-size: 13px; }
  .rbtn--b { right: 62px; top: 34px; }
}

@media (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .console-shell:fullscreen { display: grid; padding: 8px; grid-template-rows: 1fr auto; }
  .console-shell:fullscreen > * { max-width: none; }
  .marquee-bar, .arcade-masthead, .cart-label, .section-cart-rack, .section-soundboard, .manual, .site-foot, .console-feet { display: none; }
  .page { padding: 6px 8px; max-width: none; }
  .console-shell, .console-shell:fullscreen {
    padding: 8px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1fr auto;
    align-items: center;
    column-gap: 10px;
  }
  .crt-monitor, .console-shell:fullscreen .crt-monitor {
    grid-column: 2; grid-row: 1;
    border-width: 6px; padding: 4px;
    width: 100%;
    max-width: calc((100vh - 92px) * 1.143);
    justify-self: center;
  }
  .crt-brand { display: none; }

  body.touch-on .touch { display: contents; }
  .dpad {
    grid-column: 1; grid-row: 1 / 3;
    width: 126px; height: 126px;
  }
  .dbtn { width: 42px; height: 42px; }
  .dbtn--up { left: 42px; top: 0; }
  .dbtn--down { left: 42px; top: 84px; }
  .dbtn--left { left: 0; top: 42px; }
  .dbtn--right { left: 84px; top: 42px; }
  .dpad-center { left: 42px; top: 42px; width: 42px; height: 42px; }

  .abuttons { grid-column: 3; grid-row: 1 / 3; width: 116px; height: 104px; }
  .rbtn { width: 52px; height: 52px; font-size: 13px; }
  .rbtn--a { right: 0; top: 8px; }
  .rbtn--b { right: 58px; top: 34px; }

  .hud {
    grid-column: 2; grid-row: 2;
    grid-template-columns: max-content max-content max-content 1fr;
    gap: 6px; margin-top: 6px;
  }
  .hud-cell:first-child { grid-column: auto; }
  .hud-cell--wide { grid-column: auto; }
  .hud-cell { padding: 3px 6px; box-shadow: none; }
  .hud-label { font-size: 6px; margin-bottom: 3px; }
  .hud-count { display: none; }
  .hud-quest { font-size: 15px; }
  .hud-place { display: none; }
  .hud-row canvas { width: 12px; height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .crt-brand .led, .hud-row canvas.pop { animation: none !important; }
}
