:root {
  --ink: #1b140c;
  --panel: #2c2218;
  --wood: #6b3f24;
  --plank: #8a5530;
  --rust: #c45c26;
  --olive: #6a7d3a;
  --cream: #f3e2b3;
  --amber: #e8b84a;
  --sky: #3d5a6c;
  --hp: #c0392b;
  --en: #3d9be9;
  --hap: #e8b84a;
  --ok: #6aa84f;
  --bad: #c44536;
  --glow: #4cc3ff;
  --shop-y: #ffcc00;
  --shop-k: #111111;
}

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

html, body {
  height: 100%;
  background: #0d0a07;
  color: var(--cream);
  font-family: "VT323", monospace;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button {
  font-family: "Press Start 2P", monospace;
  cursor: pointer;
  border: none;
  image-rendering: pixelated;
}

.hidden, [hidden] { display: none !important; }

#device {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 12px;
}

#bezel {
  width: min(420px, 100vw);
  height: min(860px, 100dvh);
  background: linear-gradient(#3a2a1c, #24180f);
  border: 6px solid #120d08;
  border-radius: 28px;
  box-shadow: 0 0 0 4px #5a3d24, 0 18px 0 #0a0704;
  padding: 18px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#brand {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--amber);
  text-align: center;
}
#brand span { color: var(--glow); }

#screen {
  position: relative;
  flex: 1;
  background: var(--ink);
  border: 4px solid #0a0704;
  box-shadow: inset 0 0 0 3px #4a3724;
  overflow: hidden;
  image-rendering: pixelated;
}

#crt {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgb(0 0 0 / 0.08) 0 2px,
    transparent 2px 4px
  );
  mix-blend-mode: multiply;
}

#speaker {
  height: 18px;
  margin: 0 40px;
  background: repeating-linear-gradient(#1a120c 0 3px, #3a2a1c 3px 6px);
  border-radius: 8px;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active { display: flex; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgb(10 6 3 / 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}

/* TITLE */
#screen-title {
  background: #1a2430;
}
.title-sky {
  position: absolute;
  inset: 0 0 40% 0;
  background:
    radial-gradient(circle at 20% 20%, #f3e2b3 2px, transparent 3px),
    linear-gradient(#2a4054, #1a2430);
}
.title-garage-art {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  background:
    linear-gradient(#0000 0 20%, #3d2918 20% 22%, #6b3f24 22% 70%, #2a1b10 70%);
  box-shadow: inset 0 12px 0 #c45c26;
}
.title-garage-art::after {
  content: "";
  position: absolute;
  left: 18%;
  bottom: 18%;
  width: 64%;
  height: 28%;
  background: #1b140c;
  box-shadow: 8px 0 0 #8a5530, inset 10px 8px 0 #3d5a6c;
}
.title-card {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 18px 16px 22px;
  background: rgb(27 20 12 / 0.88);
  text-align: center;
}
.title-kicker {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: var(--amber);
  margin-bottom: 10px;
}
#screen-title h1 {
  font-family: "Press Start 2P", monospace;
  font-size: 28px;
  line-height: 1.25;
  color: var(--rust);
  text-shadow: 3px 3px 0 #3a1608;
}
.title-sub {
  margin: 12px 0 18px;
  font-size: 20px;
  color: var(--cream);
}
.title-actions { display: grid; gap: 8px; }
.title-hint { margin-top: 14px; font-size: 16px; color: var(--amber); }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* HUD */
.hud {
  background: #120d08;
  border-bottom: 3px solid #4a3724;
  padding: 8px 8px 6px;
}
.hud-meters { display: grid; gap: 5px; }
.meter { display: grid; grid-template-columns: 18px 36px 1fr 22px; align-items: center; gap: 6px; }
.meter-icon { display: grid; place-items: center; }
.meter-name {
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
  letter-spacing: 0.5px;
}
.meter[data-stat="health"] .meter-name { color: var(--hp); }
.meter[data-stat="energy"] .meter-name { color: #7ec8ff; }
.meter[data-stat="happiness"] .meter-name { color: var(--hap); }
.meter[data-stat="energy"].low .meter-track { box-shadow: 0 0 0 1px #3d9be9; }
.meter-track {
  height: 10px;
  background: #2a1b10;
  border: 2px solid #f3e2b3;
  image-rendering: pixelated;
}
.meter-fill { height: 100%; width: 80%; transition: width 180ms linear; }
.meter-fill.health { background: var(--hp); }
.meter-fill.energy { background: linear-gradient(90deg, #1a5fa8, var(--en)); }
.meter-fill.happiness { background: linear-gradient(90deg, #c7922a, var(--hap)); }
.meter-val { font-family: "Press Start 2P", monospace; font-size: 8px; }
.hud-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  gap: 6px;
  color: var(--amber);
}
.ico {
  width: 14px;
  height: 14px;
  display: block;
  image-rendering: pixelated;
}
.wallet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--hap);
}
.shop-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip-ico { display: inline-flex; }
.chip-ico .ico { width: 12px; height: 12px; }
.chip.energy { border-color: var(--en); color: #9fd4ff; }
.chip.happiness { border-color: var(--hap); color: #f3e2b3; }
.chip.health { border-color: var(--hp); color: #f5c4be; }
.chip.bolts { border-color: var(--hap); color: #f3e2b3; }
#btn-endday.must-sleep {
  background: var(--en);
  color: #081018;
  animation: blink 1.1s steps(1) infinite;
}
.fade-overlay {
  z-index: 90;
  background: #000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.fade-overlay.in { opacity: 1; }
#sleep-line {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: var(--hap);
  text-align: center;
  line-height: 1.6;
  white-space: pre-line;
  padding: 16px;
}

/* GARAGE */
#garage-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #4a3a2a;
}
#garage-world {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 240%;
  transition: transform 160ms linear;
}
.garage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  image-rendering: pixelated;
  pointer-events: none;
}

.prop {
  position: absolute;
  bottom: 14%;
  transform: translateX(-50%);
  width: 86px;
  min-height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.prop-label {
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
  background: #120d08;
  color: var(--cream);
  padding: 4px 5px;
  border: 2px solid var(--cream);
}
.prop.active .prop-label { border-color: var(--amber); color: var(--amber); }
.prop-art {
  position: relative;
  width: 96px;
  height: 64px;
  display: grid;
  place-items: end center;
  image-rendering: pixelated;
}
.prop-img {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}
.computer-img {
  width: 64px;
  height: 64px;
  filter: drop-shadow(5px 5px 0 #1b140c);
}
.prop.fire .computer-fire,
.prop.glow .computer-glow { display: block; }
.computer-fire, .computer-glow {
  display: none;
  position: absolute;
  z-index: 2;
  inset: -4px 10px auto;
  height: 30px;
  pointer-events: none;
}
.computer-fire {
  background: radial-gradient(circle at 40% 80%, #ffdd55, #c45c26 50%, transparent 70%);
  animation: flicker 0.2s infinite;
}
.computer-glow {
  background: radial-gradient(circle, var(--glow), transparent 70%);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes flicker { 50% { opacity: 0.55; transform: scaleX(1.08); } }
@keyframes pulse { 50% { opacity: 0.45; } }

.bench-img {
  width: 96px;
  height: 64px;
  filter: drop-shadow(4px 4px 0 #1b140c);
}
.kiosk-img {
  width: 68px;
  height: 68px;
  filter: drop-shadow(4px 4px 0 #1b140c);
}
.kiosk-logo {
  position: absolute;
  left: 50%;
  top: 30px;
  font-family: "Press Start 2P", monospace;
  font-size: 5px;
  color: var(--ink);
  text-align: center;
  transform: translateX(-50%) rotate(-6deg);
  text-shadow: 1px 1px 0 var(--shop-y);
}

.car-sprite { place-items: end center; }
.car-img {
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 96px;
  height: 48px;
  filter: drop-shadow(0 6px 0 #1b140c);
}
.car-damaged { display: none; }
.prop.broken .car-normal { display: none; }
.prop.broken .car-damaged { display: block; }

.zack-sprite {
  position: absolute;
  bottom: 11%;
  width: 48px;
  height: 64px;
  left: 40%;
  z-index: 4;
  pointer-events: none;
  background: url("../assets/sprites/zack-walk.png") 0 0 / 144px 64px no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(3px 3px 0 rgb(27 20 12 / 0.55));
}
.zack-sprite.walking { animation: zack-walk 0.28s steps(1) infinite; }
.zack-sprite.facing-left { transform: scaleX(-1); }
@keyframes zack-walk {
  0%, 32% { background-position: -48px 0; }
  33%, 65% { background-position: 0 0; }
  66%, 100% { background-position: -96px 0; }
}

.garage-clutter {
  position: absolute;
  z-index: 1;
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  filter: sepia(0.18) drop-shadow(3px 3px 0 rgb(27 20 12 / 0.5));
}
.garage-clutter.floor { bottom: 14%; }
.garage-clutter.drum { width: 32px; height: 48px; }
.garage-clutter.crate { width: 42px; height: 42px; }
.garage-clutter.post { width: 34px; height: 44px; }
.garage-clutter.puddle { width: 58px; height: 20px; bottom: 11%; }

.garage-controls, .garage-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 6px;
  padding: 8px;
  background: #120d08;
}
.garage-actions { grid-template-columns: 1fr 1fr; padding-top: 0; }

/* BUTTONS */
.btn {
  min-height: 44px;
  padding: 8px 10px;
  background: var(--rust);
  color: var(--cream);
  border: 3px solid var(--cream);
  box-shadow: 3px 3px 0 #3a1608;
  font-size: 10px;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #3a1608; }
.btn-primary { background: var(--rust); }
.btn-ghost { background: #2c2218; font-size: 8px; }
.btn-dpad { background: #3d2918; font-size: 16px; }
.btn-tiny {
  min-height: 28px;
  font-size: 10px;
  margin-left: auto;
  display: block;
}
.icon-btn {
  background: transparent;
  color: var(--cream);
  min-width: 44px;
  min-height: 44px;
  font-size: 14px;
}
.icon-btn.light { color: #111; }

/* DIALOGUE */
.dialogue-box {
  width: 100%;
  background: #120d08;
  border: 3px solid var(--cream);
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 8px;
}
#portrait {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  background: #2c2218;
  border: 2px solid var(--amber);
}
.nameplate {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: var(--amber);
  margin-bottom: 4px;
}
#dlg-text {
  font-size: 20px;
  line-height: 1.15;
  min-height: 48px;
}
.event-chips { margin-top: 6px; }
.choices { display: grid; gap: 6px; margin-top: 8px; }
.choices .btn { font-size: 8px; text-align: left; line-height: 1.4; }

/* MENUS */
.menu-panel, .shop-panel, .mini-frame, .ending-panel {
  width: 100%;
  max-height: 92%;
  overflow: auto;
  background: #120d08;
  border: 3px solid var(--cream);
  padding: 12px;
}
.menu-head, .shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
h2, .ending-title {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--amber);
}
.menu-hint, .shop-tag, .shop-note, .mini-help, .mini-status, .ending-blurb {
  font-size: 18px;
  margin-bottom: 8px;
}
.menu-list, .shop-list, .score-list {
  list-style: none;
  display: grid;
  gap: 6px;
}
.menu-list li, .shop-item {
  background: #2c2218;
  border: 2px solid var(--cream);
  padding: 8px;
  font-size: 18px;
}
.menu-list li button, .shop-item button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--cream);
  font-family: "VT323", monospace;
  font-size: 18px;
  min-height: 44px;
}
.menu-list .tag { color: var(--amber); font-family: "Press Start 2P", monospace; font-size: 7px; }
.menu-list .bad { border-color: var(--bad); }
.menu-list .good { border-color: var(--ok); }
.menu-list .done { opacity: 0.45; }

.overlay.blankout {
  z-index: 90;
  background: #0a0704;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
}
.blankout .static {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background: repeating-linear-gradient(#fff 0 1px, #000 1px 3px);
  animation: static 0.08s infinite;
}
@keyframes static { 50% { transform: translateY(3px); } }
#blankout-line {
  position: relative;
  font-size: 22px;
  animation: shake 0.12s infinite;
}
@keyframes shake { 50% { transform: translateX(3px); } }

/* SHOP */
#overlay-shop {
  align-items: stretch;
  padding: 6px;
}
#shop-panel.shop-panel {
  flex: 1;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 10px;
  background: var(--shop-k);
  border-color: var(--shop-y);
  color: var(--shop-y);
}
.shop-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.amazong-logo {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  transform: rotate(-4deg);
  color: var(--shop-y);
}
.amazong-logo .arrow { color: #48f; }
.shop-prime {
  flex-shrink: 0;
  height: 4px;
  margin: 2px 0 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--shop-y) 0 10px,
    #111 10px 14px,
    #48f 14px 18px,
    #111 18px 22px
  );
}
.shop-tag, .shop-note { flex-shrink: 0; }
.shop-tag { font-size: 16px; margin-bottom: 4px; }
.shop-note { font-size: 15px; margin-bottom: 6px; opacity: 0.85; }
.btn-shop-close {
  background: var(--shop-y);
  color: #111;
  border-color: #111;
  min-height: 36px;
  font-size: 8px;
  box-shadow: 3px 3px 0 #664;
}
#btn-shop-back { width: 100%; margin-top: 8px; flex-shrink: 0; }
.btn-shop-tolist { width: auto; min-height: 32px; margin-bottom: 6px; align-self: flex-start; }
.shop-wallet {
  flex-shrink: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  margin: 4px 0 6px;
}
.shop-browse, .shop-detail {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.shop-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  border-top: 2px solid var(--shop-y);
}
.shop-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #2a2a2a;
  padding: 0;
  color: #f3e2b3;
}
.shop-item button {
  width: 100%;
  min-height: 40px;
  text-align: left;
  background: transparent;
  color: #f3e2b3;
  font-family: "VT323", monospace;
  font-size: 17px;
  padding: 4px 2px;
  box-shadow: none;
  border: 0;
}
.shop-item-main {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.shop-item-copy { min-width: 0; }
.shop-item-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.1;
}
.shop-item-icon-wrap {
  position: relative;
  width: 32px;
  height: 32px;
}
.shop-item-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  background: transparent;
  border: 0;
  padding: 0;
}
.shop-item .price {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--shop-y);
  margin-top: 2px;
}
.shop-item.cant-afford { color: #7a7a7a; }
.shop-item.cant-afford button { color: #8a8a8a; }
.shop-item.cant-afford .shop-item-name { color: #8a8a8a; }
.shop-item.cant-afford .price { color: #6a6a6a; }
.shop-item.cant-afford .shop-item-icon {
  filter: grayscale(1) brightness(0.55);
}
.shop-item.cant-afford .shop-item-icon-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(17 17 17 / 0.35);
}
.shop-empty {
  padding: 12px 4px;
  font-size: 18px;
  color: #888;
  border: 0;
  background: transparent;
}
.shop-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.shop-detail-icon {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  margin: 0 auto 6px;
  border: 0;
  background: transparent;
}
.shop-detail-name {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.35;
  color: var(--shop-y);
  margin-bottom: 4px;
}
.shop-detail-kind {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: #48f;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-detail-blurb {
  font-size: 17px;
  color: #f3e2b3;
  margin-bottom: 4px;
}
.shop-detail-review {
  font-size: 15px;
  color: #c4b48a;
  margin-bottom: 8px;
}
.shop-perks-lbl {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: var(--shop-y);
  margin-bottom: 4px;
}
.shop-perks ul {
  list-style: none;
  display: grid;
  gap: 3px;
}
.shop-perks li {
  font-size: 16px;
  color: #f3e2b3;
  padding: 2px 0 2px 10px;
  position: relative;
}
.shop-perks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  background: var(--shop-y);
}
.shop-buy-reason {
  flex-shrink: 0;
  min-height: 16px;
  font-size: 15px;
  color: #c44536;
  margin: 6px 0 4px;
}
.btn-shop-buy {
  flex-shrink: 0;
  width: 100%;
  background: var(--shop-y);
  color: #111;
  border: 2px solid #111;
  min-height: 40px;
  font-size: 10px;
  box-shadow: 3px 3px 0 #664;
}
.btn-shop-buy:disabled {
  background: #3a3a3a;
  color: #777;
  border-color: #222;
  box-shadow: none;
}

.chips, .event-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.chip {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  padding: 4px 5px;
  border: 2px solid var(--cream);
  background: #2c2218;
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip.cost { border-color: var(--bad); color: #f5c4be; }
.chip.gain { border-color: var(--ok); color: #c8e6b0; }
.chip.energy { border-color: var(--en); color: #9fd4ff; }
.chip.happiness { border-color: var(--hap); color: #f3e2b3; }
.chip.health { border-color: var(--hp); color: #f5c4be; }
.chip.bolts { border-color: var(--hap); color: #f3e2b3; }
.chip.perk { border-color: var(--glow); }
.chip-row { margin-top: 4px; }
.chip-row .lbl {
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
  color: var(--amber);
  display: block;
  margin-bottom: 2px;
}

.morning-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.morning-card {
  background: #2c2218;
  border: 2px solid var(--cream);
  padding: 8px;
  text-align: left;
}
.morning-card.bad { border-color: var(--bad); }
.morning-card.good { border-color: var(--ok); }
.morning-card.done { opacity: 0.45; }
.morning-card .who {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: var(--amber);
}
.morning-card .title { font-size: 20px; }
.morning-card .where {
  font-size: 16px;
  color: var(--amber);
}
.morning-card button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--cream);
  font-family: "VT323", monospace;
  font-size: 18px;
  min-height: 44px;
  border: 0;
  box-shadow: none;
}

/* MINIGAMES */
.mini-frame { align-self: stretch; margin: auto 0; }
.mini-hud {
  display: flex;
  justify-content: space-between;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  margin-bottom: 8px;
  color: var(--amber);
}
.whack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, 70px);
  gap: 6px;
  height: 298px;
}
.hole {
  appearance: none;
  width: 100%;
  height: 70px;
  min-height: 68px;
  max-height: 70px;
  background: #2c2218;
  border: 3px solid #5a3d24;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  overflow: hidden;
  font-family: "VT323", monospace;
  font-size: 14px;
  line-height: 1;
  color: var(--cream);
  transform: none;
}
.hole:active, .hole:focus { transform: none; outline: none; }
.hole-face {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  line-height: 36px;
  font-size: 28px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  text-align: center;
}
.hole:not(.pop) .hole-face::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a120c;
}
.hole.pop .hole-face {
  animation: hole-show 280ms ease-out;
}
@keyframes hole-show {
  from { opacity: 0; }
  to { opacity: 1; }
}
.hole-who {
  display: block;
  width: 100%;
  height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.hole.pop.good { background: #1f3d2a; border-color: var(--ok); }
.hole.pop.bad { background: #3d1a16; border-color: var(--bad); }
#whack-status {
  min-height: 40px;
  overflow: hidden;
}

#road-canvas {
  width: 100%;
  height: auto;
  background: #2a2a2a;
  image-rendering: pixelated;
  border: 3px solid var(--cream);
}

.battle-stage { display: grid; gap: 10px; margin-bottom: 8px; }
.hp-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 6px; font-size: 16px; }
.foe-art, .hero-art {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px;
  background: #2c2218;
  border: 2px solid var(--cream);
  margin-bottom: 4px;
  text-align: center;
}
.battle-ail {
  min-height: 22px;
  font-size: 18px;
  color: var(--amber);
  margin: 0 0 6px;
}
.battle-log {
  min-height: 84px;
  font-size: 18px;
  background: #0a0704;
  border: 2px solid var(--cream);
  padding: 6px;
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.battle-moves { display: grid; gap: 6px; }
.battle-move {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  min-height: 52px;
}
.battle-move .move-name {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
}
.battle-move .move-hint {
  font-family: "VT323", monospace;
  font-size: 16px;
  line-height: 1.15;
  opacity: 0.88;
  font-weight: normal;
  text-transform: none;
}
.battle-move.suggested {
  border-color: var(--amber);
}

.timing-track {
  position: relative;
  height: 32px;
  margin: 10px 0 12px;
  background: #2c2218;
  border: 3px solid var(--cream);
  overflow: hidden;
}
.timing-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--ok);
  opacity: 0.85;
}
.timing-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--cream);
  box-shadow: 0 0 0 1px #1b140c;
  transform: translateX(-50%);
}
#meter-tap { width: 100%; }
#pick-prompt { min-height: 64px; margin-bottom: 8px; }

.ending-cast {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.ending-cast span {
  border: 2px solid var(--cream);
  padding: 4px 6px;
  font-size: 16px;
}
.score-list li { font-size: 18px; }
.grim { text-align: center; }
.grim .ending-title { color: var(--bad); margin: 10px 0; }

@media (max-width: 520px) {
  #device { padding: 0; }
  #bezel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding: 8px 6px 10px;
  }
  #brand, #speaker { display: none; }
}
