/*
 * Horror game — [tgv_horror_game] (includes/mini-games/horror-game.php,
 * components/horror-game.php, document/modules/horror-game.md).
 * A handheld console in the spirit of an old green-screen handheld: the
 * screen uses only four greens and the pictures are 160 × 144 pixel art,
 * scaled up with hard pixel edges. Frightening, never gory; light effects only
 * darken (at most two dips a second); everything stops for reduced motion.
 * Sizes inside the screen are in cqw (1cqw = 1/100 of the screen's width).
 */

/* GLOBAL */
.hg-root {
  --hg-0: #0f380f; /* darkest */
  --hg-1: #306230;
  --hg-2: #8bac0f;
  --hg-3: #9bbc0f; /* lightest */
  --hg-shell: #c8c4bc;
  --hg-shell-dark: #a9a49a;
  --hg-bezel: #5b5d6b;
  --hg-btn: #9b2257;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 8px 0 16px;
  text-align: left;
}
/* the site's own #gameWrapper rule caps it at 1300px and leaves it on the
   left of a wide screen: the console is centred on any width */
#gameWrapper.hg-root {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}
/* hoh.css puts Poppins on every element of a Halls of Horror page with
   !important (body:has(.hoh-scream-dialog) *); the id out-ranks it, so the
   game keeps its pixel font everywhere it is placed. */
#gameWrapper.hg-root,
#gameWrapper.hg-root * {
  font-family: 'Press Start 2P', ui-monospace, monospace !important;
  box-sizing: border-box;
}
.hg-root [hidden] {
  display: none !important;
}
.hg-root button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hg-root p {
  margin: 0 !important;
}
.hg-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
/* GLOBAL END */


/* CONSOLE */
.hg-console {
  position: relative;
  width: min(390px, 100%);
  padding: 18px 18px 26px;
  border-radius: 14px 14px 64px 14px;
  background: linear-gradient(160deg, #d6d2ca, var(--hg-shell) 45%, var(--hg-shell-dark));
  box-shadow: inset -4px -6px 0 rgba(0, 0, 0, 0.12), inset 3px 3px 0 rgba(255, 255, 255, 0.45), 0 24px 50px rgba(0, 0, 0, 0.55);
  user-select: none;
  -webkit-user-select: none;
}
.hg-quit {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25) !important;
  color: #fff !important;
  font-size: 16px !important;
  line-height: 34px !important;
  text-align: center;
}
.hg-bezel {
  padding: 10px 14px 16px;
  border-radius: 8px 8px 36px 8px;
  background: var(--hg-bezel);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12);
}
.hg-bezel-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #b9bccb;
  font-size: 6px;
  letter-spacing: 0.08em;
}
.hg-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a1a1a;
  transition: background 0.3s, box-shadow 0.3s;
}
.hg-root.is-on .hg-led {
  background: #ff2a2a;
  box-shadow: 0 0 6px #ff2a2a;
}
.hg-brand {
  margin: 12px 4px 0 !important;
  color: #2b2f7a;
  font-size: 8px !important;
  font-style: italic;
  letter-spacing: 0.06em;
}
.hg-brand b {
  font-size: 10px;
}
/* CONSOLE END */


/* SCREEN WEAR */
/* the screen: uneven corners and a dead pixel column (the drawn crack was removed, JY 2026-11-25) */
.hg-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 46%, transparent 62%, rgba(15, 56, 15, 0.32) 100%);
}
.hg-dead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 31.5%;
  z-index: 4;
  width: 0.5cqw;
  background: rgba(15, 56, 15, 0.5);
  pointer-events: none;
}
/* a loose cable: now and then the screen jolts and dips (darker only) */
.hg-root.is-on .hg-screen {
  animation: hgLoose 11s steps(1) infinite;
}
.hg-root.is-on .hg-led {
  animation: hgLed 7s steps(1) infinite;
}
/* SCREEN WEAR END */


/* SCREEN — 160 × 208 virtual pixels: a 160 × 144 picture and a text box */
.hg-screen {
  position: relative;
  container-type: inline-size;
  overflow: hidden;
  aspect-ratio: 160 / 208;
  background: var(--hg-3);
  color: var(--hg-0);
  box-shadow: inset 0 0 0 2px rgba(15, 56, 15, 0.35);
}
.hg-view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 160 / 144;
  background: var(--hg-0);
}
.hg-art {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transform-origin: 50% 60%;
  -webkit-user-drag: none;
}
/* the LCD: faint pixel grid and scanlines over the picture */
.hg-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(15, 56, 15, 0.16) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(15, 56, 15, 0.08) 0 1px, transparent 1px 3px);
}
/* weather over the picture: rain/flood streaks, chemical haze (fx classes below) */
.hg-weather {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

/* status bar: decision, heartbeat, threat */
.hg-hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 2cqw;
  row-gap: 0.6cqw;
  padding: 1.4cqw 2.4cqw 1.2cqw;
  background: rgba(15, 56, 15, 0.86);
  color: var(--hg-3);
  font-size: 3.1cqw;
  line-height: 1;
}
.hg-ecg {
  width: 100%;
  height: 4.6cqw;
  image-rendering: pixelated;
}
.hg-hud-bpm {
  color: var(--hg-3);
}
.hg-hud-threat {
  grid-column: 1 / -1;
  color: var(--hg-2);
  font-size: 2.6cqw;
  letter-spacing: 0.08em;
}
.hg-hud-threat::before {
  content: 'THREAT LEVEL: ';
}

/* the text box */
.hg-box {
  position: absolute;
  left: 2.5cqw;
  right: 2.5cqw;
  bottom: 2.5cqw;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2cqw;
  height: auto;
  min-height: 44cqw;
  max-height: calc(100% - 12cqw);
  padding: 3cqw 3.6cqw;
  border: 1.3cqw solid var(--hg-0);
  border-radius: 1.6cqw;
  background: var(--hg-3);
  box-shadow: inset 0 0 0 0.8cqw var(--hg-2);
  transition: height 0.18s steps(3);
}
.hg-box.is-tall {
  height: auto;
  min-height: 44cqw;
  max-height: calc(100% - 12cqw);
}
.hg-label {
  align-self: flex-start;
  padding: 0.8cqw 1.6cqw;
  background: var(--hg-0);
  color: var(--hg-3) !important;
  font-size: 3.1cqw !important;
  line-height: 1.3 !important;
}
.hg-text {
  font-size: 3.9cqw !important;
  line-height: 1.6 !important;
  color: var(--hg-0) !important;
  overflow-wrap: break-word;
}
.hg-list,
.hg-menu-list {
  display: flex;
  flex-direction: column;
  gap: 1.5cqw;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.hg-item {
  display: flex;
  align-items: flex-start;
  gap: 2cqw;
  width: 100%;
  padding: 0.6cqw 0.8cqw !important;
  border-radius: 1cqw;
  font-size: 3.8cqw !important;
  line-height: 1.4 !important;
  color: var(--hg-0) !important;
  text-align: left;
}
.hg-item-key {
  flex: none;
  min-width: 5.6cqw;
  padding: 0.5cqw 0.8cqw;
  border-radius: 0.8cqw;
  background: var(--hg-1);
  color: var(--hg-3);
  text-align: center;
}
.hg-item.is-on {
  background: var(--hg-2);
}
.hg-item.is-on .hg-item-key {
  background: var(--hg-0);
}
.hg-item.is-on .hg-item-label::before {
  content: '\25B8 ';
  animation: hgBlink 0.8s steps(1) infinite;
}
.hg-more {
  position: absolute;
  right: 3cqw;
  bottom: 1.4cqw;
  font-size: 3.2cqw;
  animation: hgBob 0.7s steps(2) infinite;
}
/* SCREEN END */


/* PANELS — title, broadcast, bag, ending, review, collection */
.hg-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2.6cqw;
  padding: 5cqw 5cqw 6cqw;
  overflow: hidden;
  background: var(--hg-0);
  color: var(--hg-3);
  text-align: center;
}
.hg-panel p {
  color: inherit !important;
}
.hg-panel .hg-item {
  justify-content: center;
  color: var(--hg-3) !important;
  font-size: 3.8cqw !important;
}
.hg-panel .hg-item.is-on {
  background: var(--hg-1);
}
/* title: the name over the sky at the top, the rest at the bottom, the
   picture showing between (darkened only behind the words) */
.hg-panel.is-title,
.hg-panel:not([class*=' is-']) {
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(15, 56, 15, 0.55) 0, transparent 26%, transparent 58%, rgba(15, 56, 15, 0.82) 70%, var(--hg-0) 84%);
}
.hg-title--bottom {
  gap: 2cqw;
}
.hg-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4cqw;
}
.hg-title-name {
  /* 10.4, not 11: an 8-letter one-word title (DOOMSDAY) was 5px wider than
     the screen at 11 (2026-12-02) */
  font-size: 10.4cqw !important;
  line-height: 1.1 !important;
  letter-spacing: 0.04em;
  text-shadow: 0.9cqw 0.9cqw 0 var(--hg-1);
  animation: hgTitle 4s steps(1) infinite;
}
.hg-title-sub {
  font-size: 3.6cqw !important;
  color: var(--hg-2) !important;
}
.hg-title-stat {
  font-size: 2.4cqw !important;
  line-height: 1.5 !important;
}
.hg-title-tag,
.hg-title-found,
.hg-title-hint {
  font-size: 2.6cqw !important;
  color: var(--hg-2) !important;
}
.hg-title-press {
  margin-top: 2cqw !important;
  font-size: 4.2cqw !important;
  animation: hgBlink 1s steps(1) infinite;
}
/* emergency broadcast */
.hg-panel.is-broadcast {
  justify-content: center;
  text-align: left;
  animation: hgStatic 0.5s steps(2) 3;
}
.hg-cast-tag {
  align-self: flex-start;
  padding: 1cqw 2cqw;
  background: var(--hg-3);
  color: var(--hg-0) !important;
  font-size: 3cqw !important;
  animation: hgBlink 0.9s steps(1) infinite;
}
.hg-cast-lines {
  display: flex;
  flex-direction: column;
  gap: 2.4cqw;
  margin-top: 3cqw;
}
.hg-cast-line {
  font-size: 4.1cqw !important;
  line-height: 1.4 !important;
}
.hg-cast-line::before {
  content: '> ';
  color: var(--hg-2);
}
.hg-cast-more {
  margin-top: auto !important;
  font-size: 3cqw !important;
  text-align: center;
  animation: hgBlink 1s steps(1) infinite;
}
/* ending menu, review, bag, collection */
.hg-panel.is-end,
.hg-panel.is-review,
.hg-panel.is-bag {
  justify-content: center;
}
/* A safety net: a bag with more lines than the screen scrolls inside it
   instead of spilling past its top and bottom. Centred while it fits (the
   auto margins), top-aligned once it doesn't, so the first line is never cut
   off. Doomsday's fullest real bag fits without it (2026-12-02). */
.hg-panel.is-bag {
  justify-content: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--hg-2) var(--hg-0);
}
.hg-panel.is-bag > :first-child { margin-top: auto; }
.hg-panel.is-bag > :last-child { margin-bottom: auto; }
.hg-end-kicker {
  font-size: 3.3cqw !important;
  color: var(--hg-2) !important;
  letter-spacing: 0.06em;
}
.hg-end-name {
  font-size: 7cqw !important;
  line-height: 1.25 !important;
  text-shadow: 0.8cqw 0.8cqw 0 var(--hg-1);
}
.hg-panel.is-die .hg-end-kicker {
  color: var(--hg-3) !important;
}
.hg-end-cause,
.hg-end-stat {
  font-size: 3.3cqw !important;
  line-height: 1.5 !important;
}
.hg-end-hint {
  margin-top: auto !important;
  font-size: 3.1cqw !important;
  color: var(--hg-2) !important;
}
.hg-review-q {
  font-size: 4.2cqw !important;
}
.hg-review-a {
  font-size: 3.9cqw !important;
  line-height: 1.6 !important;
}
.hg-review-say {
  font-size: 3.5cqw !important;
  line-height: 1.7 !important;
  color: var(--hg-2) !important;
}
.hg-bag-line {
  font-size: 3.5cqw !important;
  line-height: 1.7 !important;
}
.hg-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2cqw;
}
.hg-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 0.8cqw solid var(--hg-1) !important;
  border-radius: 1cqw;
  color: var(--hg-1) !important;
}
.hg-slot.is-found {
  background: var(--hg-1) !important;
  color: var(--hg-3) !important;
}
.hg-slot.is-on {
  border-color: var(--hg-3) !important;
}
.hg-slot-n {
  position: absolute;
  top: 0.6cqw;
  left: 0.8cqw;
  font-size: 2cqw;
}
.hg-slot-icon {
  font-size: 5cqw;
}
.hg-slot-info {
  min-height: 9cqw;
  font-size: 3.2cqw !important;
  line-height: 1.6 !important;
}
.hg-ach {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6cqw;
  font-size: 2.6cqw;
  color: var(--hg-1);
}
.hg-ach .is-on {
  color: var(--hg-3);
}
.hg-panel.is-collection {
  justify-content: flex-start;
}
/* PANELS END */


/* SCENE EFFECTS (a question's or an ending's "fx" in the story file) */
.hg-screen.is-flicker .hg-art,
.hg-screen.is-dim .hg-art {
  animation: hgFlicker 3.2s steps(1) infinite;
}
.hg-screen.is-drift .hg-art {
  animation: hgDrift 9s ease-in-out infinite alternate;
}
.hg-screen.is-scare .hg-view,
.hg-screen.is-quake .hg-view {
  animation: hgShake 0.45s steps(6) 2;
}
.hg-screen.is-scare .hg-art {
  animation: hgScare 1.6s steps(1) 1, hgDrift 9s 1.6s ease-in-out infinite alternate;
}
.hg-screen.is-quake .hg-art {
  animation: hgDrift 9s 0.9s ease-in-out infinite alternate;
}
.hg-screen.is-static .hg-fx {
  animation: hgNoise 0.24s steps(2) infinite;
}
.hg-screen.is-static .hg-art {
  animation: hgStatic 2.8s steps(1) infinite;
}
.hg-screen.is-chem .hg-weather {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 70%, rgba(155, 188, 15, 0.35), rgba(139, 172, 15, 0.12) 60%, transparent 85%);
  animation: hgHaze 4s ease-in-out infinite alternate;
}
.hg-screen.is-flood .hg-weather {
  opacity: 1;
  background: repeating-linear-gradient(105deg, transparent 0 6cqw, rgba(155, 188, 15, 0.35) 6cqw 6.6cqw);
  background-size: 100% 200%;
  animation: hgRain 0.6s linear infinite;
}
.hg-screen.is-spark .hg-art {
  animation: hgSpark 2.4s steps(1) infinite;
}
.hg-screen.is-blackout .hg-view,
.hg-screen.is-collapse .hg-view {
  animation: hgShake 0.45s steps(6) 2;
}
.hg-screen.is-blackout .hg-art {
  animation: hgBlackout 2.2s steps(4) 1 both, hgFlicker 3.2s 2.2s steps(1) infinite;
}
.hg-screen.is-collapse .hg-art {
  animation: hgBlackout 2.6s steps(4) 1 both;
}
.hg-screen.is-bright .hg-art {
  animation: hgBright 2.4s steps(4) 1 both;
}
.hg-screen.is-calm .hg-art {
  animation: hgBright 3s steps(5) 1 both, hgDrift 9s 3s ease-in-out infinite alternate;
}
.hg-screen.is-die .hg-art {
  animation: hgDie 2.4s steps(5) 1 both;
}
/* the cinema ending: the whole screen warms up from green to gold */
.hg-screen.is-tgv .hg-view {
  animation: hgWarm 2.4s steps(6) 1 both;
}
/* a Game Boy style fade between scenes: four steps down to dark, then back */
.hg-screen.is-fading .hg-art {
  animation: hgFade 0.38s steps(4) 1 both;
}
.hg-screen.is-fading-in .hg-art {
  animation: hgFade 0.38s steps(4) 1 reverse both;
}
/* SCENE EFFECTS END */


/* CONTROLS */
.hg-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 4px 0;
}
.hg-dpad {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(3, 30px);
}
.hg-dpad button,
.hg-dpad-mid {
  background: #22232b !important;
}
.hg-dpad-up { grid-area: 1 / 2; border-radius: 4px 4px 0 0 !important; }
.hg-dpad-left { grid-area: 2 / 1; border-radius: 4px 0 0 4px !important; }
.hg-dpad-mid { grid-area: 2 / 2; }
.hg-dpad-right { grid-area: 2 / 3; border-radius: 0 4px 4px 0 !important; }
.hg-dpad-down { grid-area: 3 / 2; border-radius: 0 0 4px 4px !important; }
.hg-dpad button:active,
.hg-dpad button.is-down {
  background: #111 !important;
}
.hg-ab {
  display: flex;
  gap: 16px;
  transform: rotate(-24deg);
}
.hg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hg-btn::before {
  content: '';
  display: block;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c4447b, var(--hg-btn) 55%, #6e1239);
  box-shadow: 0 4px 0 #5a0f2f, 0 6px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.06s, box-shadow 0.06s;
}
.hg-btn--b {
  margin-top: 22px;
}
.hg-btn span {
  color: #2b2f7a;
  font-size: 9px !important;
}
.hg-btn:active::before,
.hg-btn.is-down::before {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #5a0f2f, 0 2px 4px rgba(0, 0, 0, 0.35);
}
.hg-menu {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 18px;
}
.hg-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: rotate(-24deg);
}
.hg-pill::before {
  content: '';
  display: block;
  width: 40px;
  height: 11px;
  border-radius: 6px;
  background: #8b8a93;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.hg-pill:active::before,
.hg-pill.is-down::before {
  background: #6d6c74;
}
.hg-pill span {
  color: #2b2f7a;
  font-size: 7px !important;
  letter-spacing: 0.06em;
}
.hg-root button:focus-visible {
  outline: 2px solid #2b2f7a;
  outline-offset: 3px;
}
/* CONTROLS END */


/* CONSOLE ART — the handheld is a picture (console-worn.webp in S3 at
   assets/halls-of-horror/003/ — the url()s below climb from this file's folder
   to the theme's assets/; JY 2026-11-30. Made with
   ChatGPT 2026-11-24 and prepared by document/tools/horror-game-console.py):
   an old, battered brick handheld, chipped, cracked, taped and stained. The
   game screen sits exactly in its screen window, and the drawn D-pad, A, B,
   SELECT and START get invisible buttons of the same size on top. All the
   positions are % of the picture (780 x 1362), from that script's report.
   The game screen fills the WHOLE grey screen surround (the script's `fill`,
   a thin grey rim left — JY 2026-11-25), not ChatGPT's smaller window; the
   tape over its lower right corner is a second picture
   (003/console-worn-front.webp) laid on top of the game. */
.hg-console {
  width: min(400px, 100%);
  aspect-ratio: 780 / 1362;
  padding: 0;
  border-radius: 0;
  background: url('../../../assets/halls-of-horror/003/console-worn.webp') center / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.6));
}
.hg-console::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: url('../../../assets/halls-of-horror/003/console-worn-front.webp') center / 100% 100% no-repeat;
  pointer-events: none;
}
.hg-bezel {
  position: absolute;
  left: 9.36%;
  top: 6.46%;
  width: 80.9%;
  height: 47.58%;
  padding: 0;
  border-radius: 0;
  background: var(--hg-0);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}
.hg-screen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
/* the screen is almost square: the picture fills all of it (a little of
   its sides cropped) and the text box sits over its lower part */
.hg-view {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}
.hg-art {
  object-fit: cover;
}
.hg-bezel-top,
.hg-brand,
.hg-chip,
.hg-tape {
  display: none !important;
}
/* answers and menus can't be picked in their first half second (an A meant for the
   page before must not choose A): they fade in while locked */
.hg-root .is-locked {
  animation: hgReady 0.5s ease-out both;
}
/* the controls: invisible, exactly over the drawn ones; a press darkens them */
.hg-controls,
.hg-menu {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}
.hg-controls button,
.hg-menu button {
  position: absolute;
  pointer-events: auto;
  border-radius: 50%;
  transform: none;
}
.hg-controls button span,
.hg-menu button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.hg-btn::before,
.hg-pill::before {
  display: none;
}
.hg-controls button:active,
.hg-controls button.is-down,
.hg-menu button:active,
.hg-menu button.is-down {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.32) 0 55%, transparent 72%) !important;
}
.hg-dpad {
  position: absolute;
  left: 9.3%;
  top: 60.19%;
  width: 27.56%;
  height: 16.38%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: auto;
}
.hg-dpad button,
.hg-dpad-mid {
  position: static;
  border-radius: 0 !important;
  background: none !important;
}
.hg-ab {
  position: absolute;
  inset: 0;
  transform: none;
}
/* centre and size of the WHOLE drawn button (red cap + dark rim), from
   document/tools/horror-game-console.py (btn_b / btn_a). `.hg-ab` in the
   selector out-ranks `.hg-controls button { transform: none }` above — without
   it the areas sat half a button right and down of the drawn ones; and the
   script once measured only the lit top of the cap, so they also sat ~3% too
   high (both found 2026-11-25, JY: taps on A missed). */
.hg-ab .hg-btn--b,
.hg-ab .hg-btn--a {
  width: 14.5%;
  aspect-ratio: 1;
  margin: 0;
  transform: translate(-50%, -50%);
}
.hg-btn--b {
  left: 66.45%;
  top: 71.54%;
}
.hg-btn--a {
  left: 81.86%;
  top: 65.51%;
}
.hg-pill {
  width: 15%;
  height: 6%;
  border-radius: 40% !important;
  transform: translate(-50%, -50%) rotate(-24deg) !important;
}
/* pill centres measured from the picture (the grey blobs under the screen) */
.hg-pill:first-child {
  left: 39.92%;
  top: 88.5%;
}
.hg-pill:last-child {
  left: 55.94%;
  top: 88.25%;
}
/* the button names printed on the case, as on a real Game Boy: navy italic
   capitals under A and B, and under the two pills (slanted with them) —
   players didn't know which button was which (JY 2026-11-25). Sized in cqw
   of the console, so they scale with it; the id out-ranks the pixel-font rule.
   Only the console's own buttons (.hg-controls, .hg-menu): the screen is inside
   .hg-console too, and a rule on every ".hg-console button span" also turned
   the answers' A/B/C/D and text navy, italic and Poppins (fixed 2026-12-01). */
.hg-console {
  container-type: inline-size;
}
#gameWrapper.hg-root .hg-controls button span,
#gameWrapper.hg-root .hg-menu button span {
  top: 100%;
  left: 50%;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  transform: translateX(-50%);
  color: #2b2f7a;
  font-family: 'Poppins', sans-serif !important;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0.92;
  mix-blend-mode: multiply;
  pointer-events: none;
}
/* the A/B areas are exactly the drawn button, so the letter starts just past its rim */
#gameWrapper.hg-root .hg-ab button span {
  top: 106%;
  font-size: 5.2cqw !important;
}
#gameWrapper.hg-root .hg-menu button span {
  top: 108%;
  font-size: 3.2cqw !important;
}
.hg-quit {
  top: 1.5%;
  right: 3%;
  z-index: 4;
}
/* CONSOLE ART END */


/* FULL SCREEN (GameUtils adds body.game-active once START is pressed) */
body.game-active #gameWrapper.hg-root {
  align-items: center;
  padding: 0;
  background: radial-gradient(ellipse at 50% 40%, #1a2a1a, #050805 70%);
}
body.game-active .hg-root .hg-stage {
  height: 100%;
  padding: 12px;
}
body.game-active .hg-root .hg-console {
  width: min(420px, 100%, calc((100dvh - 24px) * 0.5727));
}
/* FULL SCREEN END */


/* DEBUG (?debug=1 only) */
.hg-debug {
  max-width: 760px;
  margin: 12px auto;
  padding: 10px;
  border: 1px dashed #8bac0f;
  background: #050805;
  color: #9bbc0f;
  font: 12px/1.4 ui-monospace, monospace;
  text-align: left;
}
.hg-debug pre {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
}
/* DEBUG END */


/* KEYFRAMES */
@keyframes hgBlink {
  50% { opacity: 0; }
}
@keyframes hgBob {
  50% { transform: translateY(0.8cqw); }
}
@keyframes hgTitle {
  0%, 86%, 92%, 100% { opacity: 1; }
  88% { opacity: 0.55; }
}
@keyframes hgFlicker {
  0%, 40%, 44%, 72%, 100% { filter: none; }
  41% { filter: brightness(0.55); }
  73% { filter: brightness(0.7); }
}
@keyframes hgSpark {
  0%, 30%, 33%, 36%, 100% { filter: none; }
  31% { filter: brightness(0.45) contrast(1.4); }
  34% { filter: brightness(0.6); }
}
@keyframes hgStatic {
  0%, 60%, 64%, 100% { transform: none; }
  61% { transform: translateX(-1.5cqw) skewX(-4deg); }
}
@keyframes hgNoise {
  0% { background-position: 0 0, 0 0; opacity: 1; }
  100% { background-position: 0 3px, 2px 0; opacity: 0.6; }
}
@keyframes hgHaze {
  from { transform: translateY(2%); opacity: 0.7; }
  to { transform: translateY(-2%); opacity: 1; }
}
@keyframes hgRain {
  from { background-position: 0 0; }
  to { background-position: -12cqw 24cqw; }
}
@keyframes hgDrift {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.08) translate(-1.5%, -1%); }
}
@keyframes hgShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2cqw, 1cqw); }
  40% { transform: translate(2cqw, -1cqw); }
  60% { transform: translate(-1.5cqw, -0.5cqw); }
  80% { transform: translate(1cqw, 1cqw); }
}
@keyframes hgScare {
  0% { filter: brightness(0.35) contrast(1.3); }
  30%, 100% { filter: none; }
}
@keyframes hgBlackout {
  0% { filter: none; }
  30% { filter: brightness(0.1); }
  100% { filter: brightness(0.8); }
}
@keyframes hgBright {
  from { filter: brightness(0.6); }
  to { filter: brightness(1.12) saturate(1.1); }
}
@keyframes hgDie {
  from { filter: none; }
  to { filter: brightness(0.35) grayscale(0.4); }
}
@keyframes hgWarm {
  from { filter: none; }
  to { filter: sepia(0.85) saturate(1.6) hue-rotate(-28deg) brightness(1.08); }
}
@keyframes hgFade {
  from { filter: none; }
  to { filter: brightness(0.15); }
}
@keyframes hgLoose {
  0%, 91%, 91.6%, 93%, 93.4%, 100% { transform: none; filter: none; }
  91.2% { transform: translateX(0.8cqw); filter: brightness(0.75); }
  93.2% { transform: translateY(-0.6cqw); filter: brightness(0.85); }
}
@keyframes hgLed {
  0%, 60%, 63%, 100% { opacity: 1; }
  61% { opacity: 0.35; }
}
/* the answers fade in while they can't be picked yet (the first second) */
@keyframes hgReady {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
/* KEYFRAMES END */


/* SURVIVOR REWARD POPUP */
/* Outside #gameWrapper (on <body>), so it keeps its own copy of the greens and
   of the pixel font; "html body" out-ranks hoh.css's Poppins rule. */
.hg-reward {
  --hg-0: #0f380f;
  --hg-1: #306230;
  --hg-3: #9bbc0f;
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
  padding-right: 16px;
  background: rgba(15, 56, 15, 0.85);
}
.hg-reward[hidden] { display: none; }
html body .hg-reward,
html body .hg-reward * {
  font-family: 'Press Start 2P', ui-monospace, monospace !important;
  box-sizing: border-box;
}
.hg-reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(100%, 380px);
  padding: 14px 18px 24px;
  background: var(--hg-3);
  color: var(--hg-0);
  text-align: center;
  box-shadow: 0 0 0 4px var(--hg-0), 0 0 0 8px var(--hg-1), 10px 12px 0 8px rgba(0, 0, 0, 0.45);
}
.hg-reward .tgv-modal-close { background: var(--hg-0); color: var(--hg-3); }
/* The prize picture (a ghost holding the ticket, 780 x 390, transparent PNG). */
.hg-reward-art { display: block; width: 100%; max-width: 300px; height: auto; margin: -4px auto -6px; }
.hg-reward-kicker { margin: 0; font-size: 10px; color: var(--hg-1); animation: hgLed 1.6s steps(1) infinite; }
.hg-reward-title { margin: 0; font-size: 17px; line-height: 1.5; }
.hg-reward-text { margin: 0; font-size: 10px; line-height: 1.9; }
.hg-reward-pick {
  width: 100%;
  padding: 12px 10px;
  font-size: 10px;
  color: var(--hg-0);
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 0 3px var(--hg-0);
}
.hg-reward-error[hidden], .hg-reward-pick[hidden] { display: none; }
.hg-reward-error { margin: 0; font-size: 9px; line-height: 1.7; color: #ffffff; background: var(--hg-0); padding: 6px 10px; }
.hg-reward-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hg-reward-btn {
  display: inline-block;
  padding: 14px 20px;
  font-size: 12px;
  color: var(--hg-3);
  background: var(--hg-0);
  border: 0;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--hg-1);
}
.hg-reward-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--hg-1); }
/* SURVIVOR REWARD POPUP END */


/* Desktop ONLY hover */
@media (hover: hover) and (pointer: fine) {
  .hg-item:hover .hg-item-label {
    text-decoration: underline;
  }
  .hg-reward-btn:hover { background: var(--hg-1); }
}

@media (prefers-reduced-motion: reduce) {
  .hg-root *,
  .hg-root *::before,
  .hg-reward * {
    animation: none !important;
    transition: none !important;
  }
}

/* BADGE TOAST — "BADGE UNLOCKED · ASMODAY", over the top of the screen for a
   few seconds when finding endings earns a Tier badge (Badges in the engine). */
.hg-badge-toast {
  position: absolute;
  top: 4cqw;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6cqw;
  width: max-content;
  max-width: 88%;
  padding: 2.6cqw 4cqw;
  background: var(--hg-0);
  color: var(--hg-3);
  border: 0.8cqw solid var(--hg-2);
  box-shadow: 0 0 0 0.8cqw var(--hg-0);
  text-align: center;
  pointer-events: none;
  animation: hg-badge-in 0.35s steps(4) both;
  transition: opacity 0.4s steps(4);
}
.hg-badge-toast.is-out { opacity: 0; }
.hg-badge-toast-kicker { font-size: 3.6cqw; color: var(--hg-2); }
.hg-badge-toast-name { font-size: 4.6cqw; line-height: 1.3; }
@keyframes hg-badge-in { from { transform: translate(-50%, -140%); } to { transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) {
  .hg-badge-toast { animation: none; transition: none; }
}
/* BADGE TOAST END */
