/* 大肥鱼 · 深夜食堂 — page chrome and responsive cabinet */
:root {
  --ink: #070b1c;
  --ink-2: #10183b;
  --paper: #fff8ea;
  --paper-dim: #dbe5ff;
  --gold: #f6c453;
  --gold-hot: #ffe39a;
  --gold-deep: #b26a18;
  --coral: #ff9fb2;
  --mint: #9ee7e0;
  --sky: #8fb8ff;
  --line: rgba(205, 222, 255, 0.18);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei",
    ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  color: var(--paper);
  font-family: var(--font);
  background:
    radial-gradient(1100px 740px at 16% -8%, rgba(110, 145, 255, 0.26), transparent 58%),
    radial-gradient(900px 700px at 92% 18%, rgba(255, 159, 178, 0.11), transparent 60%),
    radial-gradient(800px 700px at 50% 112%, rgba(246, 196, 83, 0.1), transparent 62%),
    linear-gradient(158deg, #171e45 0%, #0c1230 42%, #050814 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* drifting ambient bubbles behind the cabinet */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.32) 0 1.5px, transparent 2.6px),
    radial-gradient(circle at 23% 72%, rgba(255, 255, 255, 0.2) 0 2px, transparent 3.2px),
    radial-gradient(circle at 78% 14%, rgba(255, 255, 255, 0.28) 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 91% 64%, rgba(255, 255, 255, 0.22) 0 2.4px, transparent 3.6px),
    radial-gradient(circle at 66% 88%, rgba(255, 255, 255, 0.16) 0 1.4px, transparent 2.4px);
  animation: ambient-drift 18s ease-in-out infinite alternate;
}
body::after {
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(143, 184, 255, 0.06) 34% 42%, transparent 42% 100%),
    linear-gradient(74deg, transparent 0 60%, rgba(143, 184, 255, 0.045) 60% 70%, transparent 70% 100%);
  mix-blend-mode: screen;
}
@keyframes ambient-drift {
  from { transform: translate3d(0, -8px, 0) scale(1); }
  to { transform: translate3d(10px, 12px, 0) scale(1.02); }
}

button { font: inherit; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 14px;
}

.global-actions {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  gap: 8px;
}
.icon-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 248, 234, 0.18);
  background: rgba(6, 10, 24, 0.55);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.icon-btn:hover { background: rgba(23, 30, 69, 0.82); border-color: rgba(246, 196, 83, 0.45); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 2px; }

.cabinet {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

/* ------------------------------------------------------------------ *
 * Poster / intro column
 * ------------------------------------------------------------------ */
.intro {
  min-width: 0;
  padding-left: clamp(0px, 2vw, 22px);
}
.brandline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: clamp(18px, 3vh, 30px);
  color: rgba(255, 248, 234, 0.58);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.brandline .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(158, 231, 224, 0.12), 0 0 16px rgba(158, 231, 224, 0.7);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}
.brandline .tag {
  margin-left: 2px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 248, 234, 0.14);
  border-radius: 999px;
  letter-spacing: 0.08em;
  font-size: 9px;
  color: rgba(255, 248, 234, 0.4);
}

.hero-title {
  margin: 0;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
.hero-title .line-1 {
  display: block;
  font-size: clamp(56px, 7.4vw, 92px);
  color: #f7fbfc;
  text-shadow: 0 2px 0 rgba(4, 28, 44, 0.35), 0 16px 50px rgba(0, 0, 0, 0.28);
}
.hero-title .line-2 {
  display: block;
  margin-top: 8px;
  font-size: clamp(48px, 6.4vw, 80px);
  color: var(--gold);
  background: linear-gradient(178deg, #fff3c4 4%, #f7bd4b 42%, #e08a26 96%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 10px 30px rgba(232, 150, 37, 0.18));
}

.tagline {
  max-width: 34ch;
  margin: 22px 0 0;
  color: rgba(219, 229, 255, 0.76);
  font-size: clamp(13px, 1.25vw, 15px);
  line-height: 1.72;
  letter-spacing: 0.01em;
}
.tagline strong { color: var(--gold-hot); font-weight: 700; }

.features {
  display: grid;
  gap: 11px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  max-width: 420px;
}
.features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(219, 229, 255, 0.72);
  font-size: 12.5px;
  line-height: 1.5;
}
.features .fi {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: -2px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(246, 196, 83, 0.12);
  border: 1px solid rgba(246, 196, 83, 0.22);
  color: var(--gold-hot);
  font-size: 11px;
  font-weight: 900;
}
.features b { margin-right: 6px; color: #f4fbfd; font-weight: 700; }

.control-card {
  margin-top: 26px;
  max-width: 420px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 248, 234, 0.11);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(9, 52, 77, 0.52), rgba(4, 28, 44, 0.28));
  backdrop-filter: blur(8px);
}
.control-card h3 {
  margin: 0 0 9px;
  color: rgba(255, 248, 234, 0.45);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: rgba(211, 225, 255, 0.7);
  font-size: 11.5px;
}
.control-row span { display: inline-flex; align-items: center; gap: 6px; }
kbd {
  min-width: 23px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 248, 234, 0.2);
  border-bottom-color: rgba(255, 248, 234, 0.1);
  background: rgba(255, 248, 234, 0.07);
  color: #f4fbfd;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.best-card {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 22px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(246, 196, 83, 0.2);
  background: rgba(246, 196, 83, 0.075);
}
.best-card .label {
  color: rgba(255, 248, 234, 0.48);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.best-card b {
  color: var(--gold-hot);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.best-card .unit { color: rgba(255, 248, 234, 0.45); font-size: 9.5px; }

/* ------------------------------------------------------------------ *
 * Game screen
 * ------------------------------------------------------------------ */
.screen {
  --screen-w: min(420px, calc((100svh - 155px) * 0.75));
  position: relative;
  width: var(--screen-w);
  flex: none;
  padding: 8px;
  border-radius: 28px;
  border: 1px solid rgba(190, 210, 255, 0.26);
  background:
    linear-gradient(160deg, rgba(255, 240, 202, 0.14), transparent 18%),
    linear-gradient(180deg, #232b5e 0%, #121a3c 46%, #080d20 100%);
  box-shadow:
    var(--shadow),
    0 0 0 6px rgba(4, 8, 20, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}
.screen::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 25px;
  border: 1px solid rgba(255, 248, 234, 0.06);
  pointer-events: none;
}

.hud {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 8px 7px;
  color: var(--paper);
}
.level-pill {
  flex: none;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(246, 196, 83, 0.14);
  border: 1px solid rgba(246, 196, 83, 0.28);
  color: var(--gold-hot);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.goal {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.goal b { font-size: 17px; font-weight: 900; letter-spacing: -0.01em; }
.goal span { color: rgba(219, 229, 255, 0.46); font-size: 10px; white-space: nowrap; }
.hud-spacer { flex: 1; }
.combo {
  display: none;
  align-items: baseline;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 159, 178, 0.16);
  color: #ffb3bf;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.combo.on { display: inline-flex; }
.combo em { font-style: normal; font-size: 12px; }
.time {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: rgba(219, 229, 255, 0.8);
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.time.low { color: #ff8b96; animation: time-pulse 0.85s ease-in-out infinite; }
@keyframes time-pulse { 50% { opacity: 0.55; } }
.pause-btn {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.08);
  color: rgba(255, 248, 234, 0.74);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}
.pause-btn:hover { background: rgba(255, 248, 234, 0.16); color: #fff; }
.pause-btn:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 1px; }

.viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 420 / 560;
  border-radius: 19px;
  overflow: hidden;
  background: #041a2b;
  isolation: isolate;
}
#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  outline: none;
}
#game:focus-visible { box-shadow: inset 0 0 0 3px rgba(246, 196, 83, 0.7); }
body[data-mode="menu"] #game { cursor: default; }
body[data-mode="clear"] #game,
body[data-mode="fail"] #game,
body[data-mode="victory"] #game,
body[data-mode="paused"] #game { cursor: default; }

/* HUD progress sits between the HUD and the canvas. */
.progress {
  position: relative;
  z-index: 3;
  height: 3px;
  margin: -3px 9px 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 234, 0.09);
}
.progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8a72f, #ffe08b);
  box-shadow: 0 0 10px rgba(246, 196, 83, 0.7);
  transition: width 0.25s ease-out;
}

/* ------------------------------------------------------------------ *
 * Overlay / cards
 * ------------------------------------------------------------------ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  overflow: hidden auto;
  background:
    linear-gradient(180deg, rgba(3, 20, 32, 0) 0%, rgba(3, 20, 32, 0.08) 26%,
      rgba(3, 20, 32, 0.72) 54%, rgba(3, 20, 32, 0.94) 78%, rgba(3, 20, 32, 0.97) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  scrollbar-width: thin;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay.center { align-items: center; }
.overlay.soft {
  background: rgba(3, 20, 32, 0.74);
  backdrop-filter: blur(5px);
}

.ov-card {
  width: 100%;
  max-width: 368px;
  margin-top: auto;
  text-align: center;
  color: var(--paper);
}
.overlay.center .ov-card { margin: auto; }
.ov-eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.ov-title {
  margin: 0;
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.4);
}
.ov-title .gold { color: var(--gold-hot); }
.ov-sub {
  margin: 8px auto 0;
  max-width: 29ch;
  color: rgba(219, 229, 255, 0.64);
  font-size: 11px;
  line-height: 1.6;
}
.ov-sub strong { color: var(--gold-hot); }

.level-picker {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
}
.level-chip {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 248, 234, 0.14);
  background: rgba(255, 248, 234, 0.055);
  color: rgba(255, 248, 234, 0.55);
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.level-chip:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(246, 196, 83, 0.5); }
.level-chip.active {
  background: var(--gold);
  border-color: var(--gold-hot);
  color: #3a2206;
  box-shadow: 0 4px 14px rgba(246, 196, 83, 0.3);
}
.level-chip:disabled { opacity: 0.28; cursor: not-allowed; }
.level-chip:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 2px; }

.btn {
  appearance: none;
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn.primary {
  background: linear-gradient(180deg, #ffe39a 0%, #f7bd4b 52%, #e19a2d 100%);
  color: #3a2206;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 -2px 0 rgba(113, 61, 5, 0.18) inset,
    0 10px 26px rgba(224, 138, 38, 0.28);
}
.btn.primary:hover { filter: brightness(1.04) saturate(1.04); }
.btn.ghost {
  margin-top: 8px;
  min-height: 38px;
  background: rgba(255, 248, 234, 0.06);
  border: 1px solid rgba(255, 248, 234, 0.14);
  color: rgba(255, 248, 234, 0.78);
  font-size: 11.5px;
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(255, 248, 234, 0.1); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.menu-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: rgba(219, 229, 255, 0.44);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.menu-meta b { color: var(--gold-hot); font-size: 11px; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 248, 234, 0.22); }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(219, 229, 255, 0.55);
  font-size: 9.5px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(219, 229, 255, 0.22);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--gold-hot); }

/* stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 13px 0 0;
}
.stat-box {
  padding: 8px 4px 7px;
  border-radius: 10px;
  border: 1px solid rgba(255, 248, 234, 0.1);
  background: rgba(255, 248, 234, 0.045);
}
.stat-box span {
  display: block;
  color: rgba(219, 229, 255, 0.42);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.stat-box b {
  display: block;
  margin-top: 3px;
  color: var(--paper);
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.stat-box b.gold { color: var(--gold-hot); }
.stat-box b.mint { color: var(--mint); }

/* upgrade cards */
.upgrade-label {
  margin: 13px 0 7px;
  color: rgba(255, 248, 234, 0.42);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.upgrade-list { display: grid; gap: 6px; }
.upgrade {
  width: 100%;
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(255, 248, 234, 0.12);
  background: rgba(255, 248, 234, 0.045);
  text-align: left;
  cursor: pointer;
  color: var(--paper);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.upgrade:hover { transform: translateY(-1px); border-color: rgba(246, 196, 83, 0.38); background: rgba(246, 196, 83, 0.07); }
.upgrade.picked {
  border-color: rgba(246, 196, 83, 0.72);
  background: rgba(246, 196, 83, 0.13);
  box-shadow: 0 0 0 1px rgba(246, 196, 83, 0.2) inset;
}
.upgrade .u-icon {
  flex: none;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(246, 196, 83, 0.14);
  color: var(--gold-hot);
  font-size: 15px;
  font-weight: 900;
}
.upgrade .u-copy { min-width: 0; }
.upgrade .u-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f7fbfc;
  font-size: 11.5px;
  font-weight: 800;
}
.upgrade .u-name em {
  font-style: normal;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 248, 234, 0.09);
  color: rgba(255, 248, 234, 0.45);
  font-size: 8px;
  letter-spacing: 0.04em;
}
.upgrade .u-desc {
  margin-top: 2px;
  color: rgba(219, 229, 255, 0.48);
  font-size: 9.5px;
  line-height: 1.4;
}
.upgrade:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 2px; }

/* how-to */
.howto-card { max-width: 360px; }
.howto-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 4px;
  text-align: left;
}
.howto-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 248, 234, 0.09);
  background: rgba(255, 248, 234, 0.035);
}
.howto-item .hi {
  flex: none;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(246, 196, 83, 0.13);
  color: var(--gold-hot);
  font-size: 12px;
  font-weight: 900;
}
.howto-item b { display: block; color: #f7fbfc; font-size: 10.5px; }
.howto-item p { margin: 2px 0 0; color: rgba(219, 229, 255, 0.5); font-size: 9.5px; line-height: 1.45; }

/* in-canvas toast */
.toast {
  position: absolute;
  z-index: 6;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -8px);
  max-width: 84%;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(246, 196, 83, 0.32);
  background: rgba(4, 28, 44, 0.88);
  color: var(--gold-hot);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* footer */
.legal {
  width: min(1060px, 100%);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(219, 229, 255, 0.26);
  font-size: 9px;
  letter-spacing: 0.03em;
}
.legal a { color: inherit; text-underline-offset: 2px; }
.legal .made { white-space: nowrap; }

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 880px) {
  .page { justify-content: flex-start; padding: 16px 14px 12px; gap: 12px; }
  .cabinet {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
    width: min(440px, 100%);
  }
  .intro {
    width: 100%;
    padding: 0 4px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    column-gap: 12px;
  }
  .brandline { grid-column: 1 / -1; margin-bottom: 8px; padding-right: 112px; }
  .brandline .tag { display: none; }
  .hero-title .line-1 { font-size: clamp(40px, 11vw, 54px); }
  .hero-title .line-2 { font-size: clamp(36px, 10vw, 49px); margin-top: 4px; }
  .tagline { grid-column: 1 / -1; margin-top: 10px; font-size: 11.5px; line-height: 1.55; max-width: 46ch; }
  .features, .control-card { display: none; }
  .best-card { margin-top: 0; padding: 6px 10px; justify-self: end; }
  .best-card .label { display: none; }
  .best-card b { font-size: 14px; }
  .screen { --screen-w: min(420px, 100%); }
  .legal { margin-top: 2px; font-size: 8px; }
  .legal .made { display: none; }
}

@media (max-width: 380px) {
  .goal b { font-size: 15px; }
  .goal span { font-size: 9px; }
  .time { font-size: 10.5px; }
  .combo { font-size: 9px; }
  .hud { gap: 6px; }
  .ov-card { max-width: 100%; }
  .stat-box b { font-size: 14px; }
}

@media (max-height: 720px) and (min-width: 881px) {
  .brandline { margin-bottom: 12px; }
  .tagline { margin-top: 14px; }
  .features { margin-top: 16px; gap: 7px; }
  .control-card { margin-top: 16px; }
  .best-card { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* collection summary on clear / victory cards */
.collection-line {
  margin: 9px 0 0;
  color: rgba(255, 248, 234, 0.48);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Hidden video element used as the animated idle sprite. It must stay
   rendered (not display:none) so the browser keeps decoding frames. */
.pet-video {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ *
 * Tip jar ($2.99 voluntary IAP)
 * ------------------------------------------------------------------ */
.tip-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 7, 17, 0.76);
  backdrop-filter: blur(10px);
}
.tip-modal[hidden] { display: none; }
.tip-card {
  position: relative;
  width: min(360px, 100%);
  padding: 22px 20px 18px;
  border-radius: 22px;
  border: 1px solid rgba(246, 196, 83, 0.3);
  background:
    radial-gradient(300px 180px at 50% 0%, rgba(246, 196, 83, 0.12), transparent 70%),
    linear-gradient(180deg, #1a224b 0%, #0b1129 64%, #070b18 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  color: var(--paper);
  text-align: center;
}
.tip-close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 248, 234, 0.06);
  color: rgba(255, 248, 234, 0.6);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.tip-close:hover { background: rgba(255, 248, 234, 0.12); color: #fff; }
.tip-close:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 2px; }
.tip-eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.22em;
}
.tip-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fffdf7;
}
.tip-sub {
  margin: 9px auto 0;
  max-width: 26ch;
  color: rgba(226, 242, 255, 0.62);
  font-size: 11px;
  line-height: 1.6;
}
.tip-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 2px;
}
.tip-price {
  color: var(--gold-hot);
  font-size: 26px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.tip-price-note { color: rgba(226, 242, 255, 0.42); font-size: 9px; }
.tip-buy { margin-top: 10px; }
.tip-later { min-height: 34px; font-size: 10.5px; }
.tip-status {
  min-height: 16px;
  margin: 9px 0 0;
  color: var(--mint);
  font-size: 9.5px;
  line-height: 1.45;
}
.tip-status.error { color: #ffb3bc; }
.tip-cta {
  margin-top: 8px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: rgba(255, 226, 154, 0.7);
  font-size: 9.5px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(255, 226, 154, 0.25);
  text-underline-offset: 3px;
  cursor: pointer;
}
.tip-cta:hover { color: var(--gold-hot); }
.tip-cta:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 2px; border-radius: 4px; }
.tip-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--gold-hot);
  font-size: 9px;
}
