:root {
  color-scheme: light;
  --color-primary: #17663a;
  --color-primary-strong: #104b2a;
  --color-on-primary: #ffffff;
  --color-secondary: #0f766e;
  --color-accent: #b85d00;
  --color-accent-soft: #fff0cf;
  --color-background: #fffaf0;
  --color-surface: #ffffff;
  --color-foreground: #0f172a;
  --color-muted-text: #526057;
  --color-muted: #edf6ef;
  --color-border: #cfe2d4;
  --color-danger: #b42318;
  --color-laugh: #765106;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --duration-fast: 160ms;
  --duration-normal: 220ms;
  font-family: "Nunito", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--color-background);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--color-foreground);
  background-color: var(--color-background);
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; }

button, [role="button"] {
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--color-foreground);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-bottom: 12px;
}

.brand-bar > div:nth-child(2) { min-width: 0; }

.sound-control {
  position: relative;
  margin-left: auto;
  z-index: 30;
}

.sound-toggle {
  display: inline-flex;
  min-width: 76px;
  min-height: 44px;
  margin-left: 0;
  padding: 8px 10px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px solid var(--color-border);
  border-radius: 13px;
  color: var(--color-primary-strong);
  background: var(--color-surface);
  font-size: 11px;
  font-weight: 900;
  transition: color var(--duration-fast) ease, background-color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.sound-toggle:hover { border-color: var(--color-primary); background: var(--color-muted); }
.sound-toggle.is-muted { color: var(--color-muted-text); background: #f7f5ef; }
.sound-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound-icon-on { display: block; }
.sound-icon-off { display: none; }
.sound-toggle.is-muted .sound-icon-on { display: none; }
.sound-toggle.is-muted .sound-icon-off { display: block; }
.sound-chevron {
  display: inline-block;
  margin-left: 1px;
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform var(--duration-fast) ease;
}
.sound-toggle[aria-expanded="true"] .sound-chevron { transform: rotate(180deg) translateY(1px); }

.sound-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: min(310px, calc(100vw - 40px));
  padding: 15px;
  overflow: hidden;
  border: 2px solid var(--color-primary);
  border-radius: 20px;
  background: rgb(255 253 247 / 98%);
  box-shadow: 0 12px 32px rgb(20 46 31 / 20%), 0 5px 0 rgb(23 102 58 / 10%);
  animation: sound-panel-pop 180ms cubic-bezier(.34, 1.56, .64, 1) both;
}

.sound-panel::before {
  position: absolute;
  top: -34px;
  left: -18px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #e8f5ec;
  content: "";
  opacity: .72;
  pointer-events: none;
}

.sound-panel-head,
.sound-setting-row,
.volume-setting,
.voice-preview { position: relative; z-index: 1; }

.sound-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.sound-panel-head strong,
.sound-panel-head small { display: block; }
.sound-panel-head strong { font-size: 16px; }
.sound-panel-head small { margin-top: 2px; color: var(--color-muted-text); font-size: 11px; }

.sound-panel-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  place-items: center;
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-primary-strong);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.sound-setting-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-top: 1px solid #dce9df;
}

.sound-setting-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #8a4a00;
  background: #fff0c9;
  font-size: 20px;
  font-weight: 1000;
}

.sound-setting-icon.is-voice { color: #075c35; background: #e3f3e8; font-size: 15px; }
.sound-setting-copy strong,
.sound-setting-copy small { display: block; }
.sound-setting-copy strong { font-size: 13px; }
.sound-setting-copy small { margin-top: 2px; color: var(--color-muted-text); font-size: 10px; }

.voice-picker {
  min-width: 0;
  margin: 0;
  padding: 9px 0 10px;
  border: 0;
  border-top: 1px solid #dce9df;
}

.voice-picker legend {
  float: left;
  width: 100%;
  margin: 0 0 7px;
  padding: 0;
  color: var(--color-muted-text);
  font-size: 10px;
  font-weight: 800;
}

.mini-switch {
  display: grid;
  min-width: 66px;
  min-height: 36px;
  padding: 4px 7px;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 5px;
  border: 1.5px solid #7eae90;
  border-radius: 999px;
  color: #fff;
  background: var(--color-primary);
  font-size: 10px;
  font-weight: 900;
}

.mini-switch span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 16%);
}

.mini-switch[aria-checked="false"] {
  grid-template-columns: 1fr 22px;
  color: #68736c;
  border-color: #d6ddd8;
  background: #eef1ef;
}
.mini-switch[aria-checked="false"] span { grid-column: 2; }
.mini-switch[aria-checked="false"] b { grid-column: 1; grid-row: 1; }

.volume-setting {
  padding: 11px 0 5px;
  border-top: 1px solid #dce9df;
}
.volume-setting label,
.volume-scale { display: flex; align-items: center; justify-content: space-between; }
.volume-setting label { margin-bottom: 8px; font-size: 13px; font-weight: 900; }
.volume-setting output { color: var(--color-accent); font-size: 14px; }
.volume-setting input {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.volume-scale { color: var(--color-muted-text); font-size: 9px; }

.voice-preview {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #ef8e24, #c45e05);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 0 rgb(128 68 12 / 20%);
}
.voice-preview:active { transform: translateY(2px); box-shadow: 0 2px 0 rgb(128 68 12 / 20%); }

@keyframes sound-panel-pop {
  from { opacity: 0; transform: translateY(-7px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: var(--color-primary);
  border: 2px solid var(--color-foreground);
  border-radius: 12px;
  font-weight: 900;
}

.brand-name, .build-tag, .eyebrow, .hero-copy, .privacy-note,
.mode-heading p, .scene-line p, .thinking-hint, .reaction-line,
.reaction-comment, .result-summary { margin: 0; }

.brand-name { font-size: 15px; font-weight: 900; }
.build-tag { margin-top: 1px; color: var(--color-muted-text); font-size: 12px; }

.screen {
  animation: screen-in var(--duration-normal) ease-out both;
}

/* Private-creation flow: one focused, touch-friendly step at a time. */
.creator-screen { width: 100%; max-width: 520px; margin: 0 auto; }
.creator-topbar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 2px 0 14px;
}
.creator-topbar > div { min-width: 0; }
.creator-topbar .eyebrow { margin: 0 0 2px; font-size: 11px; text-align: left; }
.creator-topbar h1 { margin: 0; font-size: clamp(26px, 7vw, 34px); line-height: 1.08; text-align: left; }
.creator-limit { padding: 7px 9px; border: 1.5px solid var(--color-border); border-radius: 999px; color: var(--color-primary-strong); background: var(--color-muted); font-size: 11px; font-weight: 900; white-space: nowrap; }
.creator-progress { display: grid; margin: 0 0 14px; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 5px; }
.creator-progress span { display: grid; width: 32px; height: 32px; place-items: center; border: 1.5px solid #c7ddd0; border-radius: 999px; color: #6d7a72; background: #fff; font-size: 13px; font-weight: 1000; }
.creator-progress span.is-active { border-color: var(--color-primary); color: #fff; background: var(--color-primary); box-shadow: 0 3px 0 rgb(23 102 58 / 16%); }
.creator-progress small { display: none; }
.creator-progress i { height: 2px; background: #d7e8dc; }
.creator-form { padding: 16px; border: 1.5px solid var(--color-border); border-radius: 20px; background: #fffefa; box-shadow: 0 5px 0 rgb(23 102 58 / 7%); }
.creator-step-kicker { margin: 0 0 5px; color: var(--color-primary); font-size: 12px; font-weight: 1000; }
.creator-step h2 { margin: 0 0 16px; font-size: clamp(22px, 6.2vw, 29px); line-height: 1.2; letter-spacing: -.03em; }
.creator-field { display: grid; gap: 7px; }
.creator-field > span { color: var(--color-foreground); font-size: 14px; font-weight: 900; }
.creator-field input { width: 100%; min-height: 52px; padding: 10px 12px; border: 1.5px solid #a8b9ad; border-radius: 12px; color: var(--color-foreground); background: #fff; font: inherit; font-size: 18px; font-weight: 800; outline: none; }
.creator-field input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgb(23 102 58 / 14%); }
.creator-field-help, .creator-live-check, .creator-private-note, .creator-privacy-warning { margin: 9px 0 0; color: var(--color-muted-text); font-size: 12px; line-height: 1.45; }
.creator-live-check { padding: 9px 10px; border-radius: 10px; color: #416151; background: #edf7ef; font-weight: 800; }
.creator-form-actions { display: grid; margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.creator-form-actions .btn:only-child { grid-column: 1 / -1; }
.creator-form-actions #creator-previous[hidden] + #creator-next { grid-column: 1 / -1; }
.creator-form-error { margin: 12px 0 0; padding: 9px 10px; border-radius: 10px; color: #8f251d; background: #fff0ec; font-size: 12px; font-weight: 800; }
.creator-scenes { margin: 0; padding: 0; border: 0; }
#creator-scene-options { display: flex; flex-wrap: wrap; gap: 7px; }
#creator-scene-options button { min-height: 38px; padding: 6px 10px; border: 1.5px solid #c7ddd0; border-radius: 999px; color: #355446; background: #fff; font: inherit; font-size: 12px; font-weight: 850; }
#creator-scene-options button.is-selected { border-color: var(--color-primary); color: #fff; background: var(--color-primary); }
.creator-validation { display: grid; margin: 12px 0 0; padding: 0; gap: 6px; list-style: none; }
.creator-validation li { padding: 7px 9px; border-radius: 9px; color: #66756d; background: #f4f6f3; font-size: 12px; font-weight: 800; }
.creator-validation li.is-valid { color: #0c663b; background: #e8f7ed; }
.creator-polyphone { display: flex; margin-top: 10px; align-items: flex-start; gap: 7px; color: #54675f; font-size: 12px; line-height: 1.35; }
.creator-preview-card { display: grid; padding: 16px; gap: 6px; border: 2px solid #17663a; border-radius: 18px; color: #0d4930; background: #eaf7ee; text-align: center; }
.creator-preview-card > span, .creator-preview-card small, .creator-preview-card em { color: #557064; font-size: 11px; font-style: normal; font-weight: 800; }
.creator-preview-card strong { font-size: clamp(38px, 12vw, 58px); letter-spacing: .06em; }
.creator-preview-card p { margin: 3px 0; color: #38594a; font-size: 14px; font-weight: 900; line-height: 1.4; }
.creator-drafts { display: grid; margin-top: 16px; padding: 14px 2px 4px; gap: 9px; }
.creator-drafts h2 { margin: 0; font-size: 20px; }
.creator-drafts small, #creator-draft-list { color: var(--color-muted-text); font-size: 12px; }
#creator-draft-list { display: grid; gap: 7px; }
.creator-draft-item { width: 100%; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--color-border); border-radius: 11px; color: var(--color-primary-strong); background: #fff; font: inherit; font-size: 13px; font-weight: 850; text-align: left; }

.hero-demo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  width: min(100%, 430px);
  min-height: 172px;
  margin: 20px auto 22px;
  padding: 30px 18px;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  border: 2px solid var(--color-border);
  border-radius: 26px;
  background:
    radial-gradient(circle at 16% 18%, rgba(184, 93, 0, .12) 0 6px, transparent 7px),
    radial-gradient(circle at 83% 79%, rgba(23, 102, 58, .12) 0 8px, transparent 9px),
    linear-gradient(145deg, #fff4db, #eef7f0);
}

.hero-demo::before,
.hero-demo::after {
  position: absolute;
  width: 44px;
  height: 10px;
  content: "";
  border-top: 3px solid rgba(15, 23, 42, .16);
  border-bottom: 3px solid rgba(15, 23, 42, .16);
  transform: rotate(-12deg);
}

.hero-demo::before { top: 18px; left: 28px; }
.hero-demo::after { right: 23px; bottom: 15px; transform: rotate(14deg); }

.demo-card {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 104px;
  padding: 15px 9px 13px;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 2px solid var(--color-foreground);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 0 rgba(15, 23, 42, .1);
}

.demo-card span { color: var(--color-muted-text); font-size: 11px; font-weight: 900; }
.demo-card strong { white-space: nowrap; font-size: clamp(20px, 6vw, 28px); line-height: 1; letter-spacing: -.03em; }
.demo-card svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.demo-suspicious { color: #713f12; background: #fff0cf; animation: suspicious-wiggle 2.8s ease-in-out infinite; }
.demo-suspicious strong { color: var(--color-accent); }
.demo-serious { color: var(--color-primary-strong); background: #e6f3e9; animation: serious-pop 2.8s ease-out infinite; }

.demo-arrow {
  position: relative;
  z-index: 1;
  width: 42px;
  fill: none;
  stroke: var(--color-foreground);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: arrow-nudge 2.8s ease-in-out infinite;
}

.live-hero {
  position: relative;
  width: min(100%, 470px);
  height: 250px;
  margin: 18px auto 20px;
  overflow: hidden;
  border: 2px solid var(--color-border);
  border-radius: 26px;
  background: #dcecdf;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .1);
  isolation: isolate;
}

.live-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 55%;
  overflow: hidden;
}

.live-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(15, 23, 42, .02) 36%, rgba(15, 23, 42, .72) 100%);
}

.live-panel-office {
  left: 0;
  z-index: 1;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}

.live-panel-classroom {
  right: 0;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
}

.live-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.live-panel-office img { object-position: 57% center; animation: live-camera-left 8s ease-in-out infinite alternate; }
.live-panel-classroom img { object-position: 42% center; animation: live-camera-right 8s ease-in-out infinite alternate; }

.live-bubble,
.live-answer {
  position: absolute;
  z-index: 2;
}

.live-bubble {
  top: 43px;
  min-width: 74px;
  padding: 7px 10px;
  border: 2px solid var(--color-foreground);
  border-radius: 14px;
  color: var(--color-foreground);
  background: #fff;
  box-shadow: 0 4px 0 rgba(15, 23, 42, .12);
  font-size: 11px;
  font-weight: 1000;
  text-align: center;
  animation: live-bubble-pop 3.2s var(--ease-out, ease-out) infinite;
}

.live-bubble::after {
  position: absolute;
  bottom: -8px;
  width: 12px;
  height: 12px;
  content: "";
  border-right: 2px solid var(--color-foreground);
  border-bottom: 2px solid var(--color-foreground);
  background: #fff;
  transform: rotate(45deg);
}

.bubble-office { left: 13px; }
.bubble-office::after { right: 14px; }
.bubble-classroom { right: 13px; animation-delay: 1.1s; }
.bubble-classroom::after { left: 14px; }

.live-answer {
  bottom: 14px;
  color: #fff;
  font-size: clamp(21px, 6.6vw, 34px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -.04em;
  text-shadow: 0 3px 0 rgba(15, 23, 42, .78), 0 0 8px rgba(15, 23, 42, .45);
}

.live-abbr { left: 14px; color: #ffd182; }
.live-serious { right: 13px; color: #d8ffe4; }

.live-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 50%;
  color: rgba(126, 99, 63, .72);
  background: rgba(255, 246, 224, .58);
  box-shadow: 0 1px 3px rgba(94, 67, 33, .08);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  opacity: .78;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.eyebrow {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
}

h1 {
  margin: 10px 0 14px;
  font-size: clamp(30px, 9vw, 46px);
  line-height: 1.12;
  letter-spacing: -.04em;
  text-align: center;
}

h1 span { color: var(--color-accent); }

#home-title { max-width: 440px; margin: 0 auto 12px; font-size: clamp(30px, 7.7vw, 40px); line-height: 1.12; }

.hero-copy {
  max-width: 380px;
  margin-inline: auto;
  color: var(--color-muted-text);
  font-size: 16px;
  line-height: 1.65;
  text-align: center;
}

.returning-home-content { display: contents; }

.app-shell[data-screen="home"][data-home-entry="first"] {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  background:
    radial-gradient(circle at 11% 18%, rgb(239 142 36 / 13%) 0 8px, transparent 9px),
    radial-gradient(circle at 89% 76%, rgb(23 102 58 / 11%) 0 11px, transparent 12px),
    var(--color-background);
}

.app-shell[data-screen="home"][data-home-entry="first"] #main { display: flex; flex: 1 1 auto; min-height: 0; }
.app-shell[data-screen="home"][data-home-entry="first"] #home-screen.is-active { display: flex; width: 100%; min-height: 0; flex: 1 1 auto; }

.first-visit-home {
  position: relative;
  display: grid;
  width: min(100%, 470px);
  min-height: 0;
  margin: auto;
  padding: 4px 0 max(16px, env(safe-area-inset-bottom));
  place-items: center;
  align-content: center;
  grid-template-rows: auto auto auto auto auto auto;
  gap: clamp(8px, 1.7vh, 15px);
  text-align: center;
}

.first-visit-live-hero {
  width: 100%;
  height: clamp(230px, 34dvh, 310px);
  margin: 0 auto 4px;
}

.first-visit-headline {
  max-width: 440px;
  margin: 0 auto;
  font-size: clamp(34px, 9vw, 48px);
  line-height: 1.04;
}

.first-visit-copy { margin: 0; color: var(--color-muted-text); font-size: 15px; line-height: 1.3; }

.first-visit-hook {
  margin: 0;
  color: var(--color-foreground);
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 900;
  line-height: 1.25;
}

.first-visit-start {
  width: min(100%, 360px);
  min-height: 64px;
  border-radius: 18px;
  font-size: clamp(19px, 5.4vw, 23px);
  box-shadow: 0 6px 0 rgb(10 74 42 / 18%);
}

.first-visit-start:active { transform: translateY(3px); box-shadow: 0 3px 0 rgb(10 74 42 / 18%); }
.first-visit-note { margin: -5px 0 0; color: var(--color-muted-text); font-size: 12px; line-height: 1.2; }

.story-path-sheet { max-width: 470px; max-height: min(88vh, 760px); overflow-y: auto; text-align: center; }
.story-path-sheet > img { width: min(112px, 30vw); height: auto; margin: -8px auto -2px; }
.story-path-sheet > p:not(.eyebrow) { margin: 7px auto 14px; color: var(--color-muted-text); font-size: 14px; line-height: 1.5; }
.story-path-actions { display: grid; gap: 8px; text-align: left; }
.story-chapter-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 2px 9px; min-height: 66px; padding: 9px 11px; border: 2px solid #b9d6c3; border-radius: 15px; color: var(--color-foreground); background: #fff; text-align: left; box-shadow: 0 3px 0 rgb(15 98 56 / 8%); }
.story-chapter-card:hover, .story-chapter-card:focus-visible { border-color: var(--color-primary); background: #f4fcf6; transform: translateY(-1px); }
.story-chapter-card.is-featured { border-color: var(--color-primary); background: linear-gradient(135deg, #e5f8eb, #fffdf5); }
.story-chapter-card b { grid-row: span 2; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--color-primary-strong); background: #dff3e5; font-size: 11px; }
.story-chapter-card strong { font-size: 16px; line-height: 1.1; }
.story-chapter-card small { grid-column: 2 / 4; color: var(--color-muted-text); font-size: 11px; font-weight: 750; line-height: 1.25; }
.story-chapter-card i { padding: 3px 5px; border-radius: 6px; color: var(--color-primary-strong); background: #e4f5e9; font-size: 10px; font-style: normal; font-weight: 900; }
.special-event-strip { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; margin: 12px 0 0; padding: 10px; border: 1px dashed #c9a96e; border-radius: 12px; color: #6e5221; background: #fff9e9; text-align: left; }
.special-event-strip strong { font-size: 12px; }
.special-event-strip span { font-size: 11px; font-weight: 750; line-height: 1.35; }
.special-event-strip small { grid-column: 2; color: #987744; font-size: 10px; }
.story-path-sheet > .text-button { margin-top: 11px; }

.creator-home-entry {
  display: grid;
  width: min(100%, 470px);
  min-height: 68px;
  margin: 12px auto 0;
  padding: 10px 14px;
  grid-template-columns: 27px max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  border: 2px solid #2b754b;
  border-radius: 16px;
  color: #155b35;
  background: linear-gradient(105deg, #e1f4e7 0%, #f8fff9 100%);
  box-shadow: 0 4px 0 rgb(22 102 58 / 14%);
  text-align: left;
}

.creator-home-entry > span { font-size: 21px; line-height: 1; }
.creator-home-entry strong { font-size: 18px; line-height: 1.15; }
.creator-home-entry small { color: #537564; font-size: 12px; line-height: 1.3; text-align: right; }
.creator-home-entry:hover { transform: translateY(-2px); box-shadow: 0 6px 10px rgb(22 102 58 / 18%); }
.creator-home-entry:active { transform: translateY(1px); box-shadow: 0 2px 0 rgb(22 102 58 / 14%); }

.mode-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.secondary-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.secondary-mode-row:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
.secondary-mode-row:has(> #creator-home-entry[hidden]):has(> [data-story-launch][hidden]) { display: none; }

.secondary-mode-row .creator-home-entry {
  width: 100%;
  min-height: 72px;
  margin: 0;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 14px;
  text-align: center;
}

.secondary-mode-row .creator-home-entry strong { font-size: 17px; }

.secondary-mode-row .btn.mode-card {
  min-height: 72px;
  padding-right: 30px;
  grid-template-columns: 74px minmax(0, 1fr);
  column-gap: 10px;
}

.secondary-mode-row .mode-photo { min-height: 70px; }
.secondary-mode-row .mode-icon,
.secondary-mode-row .mode-speech { display: none; }
.secondary-mode-row .mode-title { font-size: 17px; }
.secondary-mode-row .mode-hook,
.secondary-mode-row .btn-meta { display: none; }

.story-home-entry, .first-visit-story-entry { display: none; }

.btn.mode-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(138px, 42%) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  min-width: 0;
  min-height: 126px;
  padding: 0 42px 0 0;
  align-items: center;
  column-gap: 16px;
  row-gap: 3px;
  overflow: hidden;
  border-radius: 16px;
  text-align: left;
  line-height: 1.25;
  box-shadow: 0 5px 0 rgba(15, 23, 42, .07);
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.mode-card::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 14px;
  translate: 0 -50%;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  opacity: .72;
  transition: translate var(--duration-fast) ease;
}

.mode-card:hover::after,
.mode-card:focus-visible::after { translate: 4px -50%; }

#start-defuse {
  color: #6f3900;
  border-color: #d17412;
  background: linear-gradient(105deg, #ffe7aa 0%, #fff4d3 58%, #fffaf0 100%);
  box-shadow: 0 5px 0 rgba(186, 91, 0, .18);
}

#start-defuse {
  display: block;
  min-height: clamp(188px, 26vw, 244px);
  padding: 0;
  isolation: isolate;
  color: #fffaf0;
  border-width: 3px;
  border-color: #d77d16;
  background: #6b3600;
}

#start-defuse::after { display: none; }

#start-defuse .mode-photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  min-height: 0;
  border: 0;
}

#start-defuse .mode-photo::after {
  inset: 38% 0 0;
  background: linear-gradient(180deg, transparent 0%, rgb(45 20 0 / 22%) 30%, rgb(45 20 0 / 88%) 100%);
}

#start-defuse .mode-photo img { object-position: 50% 42%; }
#start-defuse .mode-icon,
#start-defuse .mode-speech { display: none; }

#start-defuse .mode-title,
#start-defuse .mode-hook,
#start-defuse .btn-meta,
#start-defuse .mode-cta { position: absolute; z-index: 1; }

#start-defuse .mode-title {
  bottom: 72px;
  left: 18px;
  color: #fffaf0;
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: .03em;
}

#start-defuse .mode-hook { bottom: 47px; left: 19px; color: rgb(255 250 240 / 92%); font-size: 14px; }
#start-defuse .btn-meta { bottom: 22px; left: 19px; color: rgb(255 250 240 / 88%); font-size: 12px; }

#start-defuse .mode-cta {
  right: 16px;
  bottom: 17px;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 18px;
  border: 2px solid rgb(219 255 230 / 76%);
  border-radius: 999px;
  background: #147242;
  box-shadow: 0 3px 0 rgb(5 67 35 / 48%);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

#start-defuse .mode-cta b { font-size: 26px; font-weight: 500; line-height: .6; }

/* Homepage primary action: one clear, quiet green entry with a small brand cue. */
#start-defuse {
  display: grid;
  min-height: 88px;
  padding: 12px 22px 12px 70px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 2px solid #097344;
  border-radius: 20px;
  background: linear-gradient(108deg, #087548 0%, #0a8a55 52%, #087044 100%);
  box-shadow: 0 5px 0 rgb(6 81 46 / 21%);
  color: #fff;
}

#start-defuse .mode-photo,
#start-defuse .mode-hook,
#start-defuse .btn-meta { display: none; }

#start-defuse .defuse-cta-mascot {
  position: absolute;
  top: 7px;
  left: 15px;
  z-index: 1;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  pointer-events: none;
}

#start-defuse .defuse-cta-mascot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#start-defuse .mode-title {
  position: static;
  z-index: auto;
  grid-column: 1;
  justify-self: start;
  align-self: center;
  color: #fff;
  width: auto;
  font-size: clamp(22px, 3.3vw, 28px);
  font-weight: 900;
  letter-spacing: .025em;
}

#start-defuse .mode-cta {
  position: static;
  z-index: auto;
  display: inline-flex;
  min-height: 0;
  padding: 0;
  align-items: center;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 900;
  grid-column: 2;
  justify-self: end;
}

#start-defuse .mode-cta b { display: none; }

[data-story-launch].mode-card {
  color: #0f5932;
  border-color: #187044;
  background: linear-gradient(105deg, #ccebd8 0%, #e9f7ee 58%, #f8fffa 100%);
  box-shadow: 0 5px 0 rgba(16, 101, 57, .17);
}

.mode-card:hover { transform: translateY(-3px); box-shadow: 0 9px 18px rgba(15, 23, 42, .12); }
.mode-card:active { transform: translateY(1px) scale(.985); box-shadow: 0 2px 0 rgba(15, 23, 42, .08); opacity: 1; }

.mode-photo {
  position: relative;
  display: block;
  grid-column: 1;
  grid-row: 1 / 4;
  width: 100%;
  height: 100%;
  min-height: 122px;
  margin: 0;
  overflow: hidden;
  border-right: 2px solid currentColor;
}

.mode-photo::after {
  position: absolute;
  inset: 45% 0 0;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, .36));
}

.mode-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 420ms ease; }
#start-defuse .mode-photo img { object-position: 58% 36%; }
[data-story-launch].mode-card .mode-photo img { object-position: 44% 35%; }
.mode-card:hover .mode-photo img { transform: scale(1.045); }

.mode-icon {
  position: absolute;
  bottom: 7px;
  left: 7px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 11px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 3px 8px rgba(15, 23, 42, .18);
}

.mode-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-speech {
  position: absolute;
  top: 7px;
  right: 6px;
  z-index: 2;
  max-width: calc(100% - 16px);
  padding: 5px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--color-foreground);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .16);
  font-size: 9px;
  font-weight: 1000;
  white-space: nowrap;
}

.mode-title {
  grid-column: 2;
  align-self: end;
  width: 100%;
  margin: 0;
  font-size: 21px;
  font-weight: 1000;
  white-space: nowrap;
}

.mode-hook,
.mode-card .btn-meta {
  grid-column: 2;
  width: 100%;
  text-align: left;
}

.mode-hook { align-self: center; font-size: 14px; font-weight: 900; line-height: 1.3; }
.mode-card .btn-meta { align-self: start; margin-top: 1px; font-size: 11px; line-height: 1.35; white-space: nowrap; }

.btn {
  width: 100%;
  min-height: 56px;
  padding: 13px 18px;
  border: 2px solid transparent;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 900;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

.btn:active { opacity: .78; }
.btn:disabled { cursor: not-allowed; opacity: .48; }

.btn-primary {
  color: var(--color-on-primary);
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-primary:hover { background: var(--color-primary-strong); border-color: var(--color-primary-strong); }

.btn-secondary {
  color: var(--color-primary-strong);
  background: var(--color-surface);
  border-color: var(--color-primary);
}

.btn-secondary:hover { background: var(--color-muted); }

.btn-tertiary {
  color: #5e3308;
  background: var(--color-accent-soft);
  border-color: #c97820;
}

.btn-tertiary:hover { background: #ffe3aa; }

.btn-meta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  opacity: .78;
}

.local-stats, .result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.local-stats div, .result-grid div {
  display: grid;
  gap: 3px;
  min-height: 74px;
  padding: 13px;
  place-content: center;
  text-align: center;
}

.local-stats div + div, .result-grid div + div { border-left: 1px solid var(--color-border); }
.local-stats strong, .result-grid strong { font-size: 22px; }
.local-stats span, .result-grid span { color: var(--color-muted-text); font-size: 12px; }
#home-title-record { max-width: 170px; font-size: 16px; line-height: 1.15; }

.privacy-note {
  margin-top: 14px;
  color: var(--color-muted-text);
  font-size: 12px;
  text-align: center;
}

.resume-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  padding: 14px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-muted);
  animation: panel-in var(--duration-normal) ease-out both;
}

.resume-card > div:first-child { display: grid; gap: 4px; }
.resume-kicker { color: var(--color-primary); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
#resume-title { font-size: 15px; line-height: 1.35; }
.resume-actions { display: grid; justify-items: stretch; gap: 4px; }
.resume-actions .btn { min-height: 42px; padding: 8px 12px; font-size: 13px; }
.resume-actions .small-text-button { min-height: 30px; }

.game-topbar {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 2px solid var(--color-border);
  border-radius: 14px;
  color: var(--color-foreground);
  background: var(--color-surface);
  transition: background-color var(--duration-fast) ease;
}

.icon-button:hover { background: var(--color-muted); }
.icon-button svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.home-action {
  width: 52px;
  height: 52px;
  grid-template-rows: 25px 11px;
  align-content: center;
  gap: 1px;
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
}

.home-action svg { width: 23px; height: 23px; }
.home-action span { font-size: 10px; font-weight: 900; line-height: 1; }

.mode-heading { text-align: center; }
.mode-heading p:first-child { font-size: 16px; font-weight: 900; }
.mode-heading p:last-child { margin-top: 2px; color: var(--color-muted-text); font-size: 12px; }
.life-hearts {
  display: inline-flex;
  margin-left: 7px;
  color: #e24b44;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 #fff;
}
.life-hearts.is-critical { animation: life-heart-pulse .7s ease-in-out infinite alternate; }

@keyframes life-heart-pulse { to { color: #b42318; transform: scale(1.12); } }

.score-chip {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--color-primary-strong);
  background: var(--color-muted);
  border: 2px solid var(--color-border);
  border-radius: 50%;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  margin: 16px 0 18px;
  overflow: hidden;
  background: #dfe9e1;
  border-radius: 8px;
}

.progress-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  transition: transform var(--duration-normal) ease-out;
  transform: scaleX(0);
  transform-origin: left;
}

#defuse-progress {
  height: 12px;
  border: 2px solid #c4d9cc;
  background: #edf3ef;
  box-shadow: inset 0 2px 4px rgb(15 98 56 / 12%), 0 2px 0 rgb(15 98 56 / 7%);
}

#defuse-progress-fill {
  border-radius: inherit;
  background: linear-gradient(90deg, #f4a340 0%, #e9a43c 22%, #16875b 100%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 28%) inset, 0 0 8px rgb(22 135 91 / 22%);
}

#game-screen > .progress-track {
  height: 12px;
  border: 2px solid #c7d8d2;
  background: #edf2f0;
  box-shadow: inset 0 2px 4px rgb(36 118 211 / 10%), 0 2px 0 rgb(15 98 56 / 6%);
}

#progress-fill {
  border-radius: inherit;
  background: linear-gradient(90deg, #2476d3 0%, #2f92b9 46%, #16875b 100%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 28%) inset, 0 0 8px rgb(36 118 211 / 20%);
}

.meter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.meter { padding: 10px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.meter > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.meter span { color: var(--color-muted-text); font-size: 10px; }
.meter strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.meter-track { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 6px; background: #e5e7eb; }
.meter-track span { display: block; width: 0; height: 100%; transition: transform var(--duration-normal) ease-out; transform: scaleX(0); transform-origin: left; }
#suspicion-fill { background: var(--color-danger); }
#laughter-fill { background: #a16b00; }
#calm-fill { background: var(--color-secondary); }

.scene-visual {
  position: relative;
  margin: 0 0 14px;
  overflow: hidden;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.scene-art {
  position: relative;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #17221c;
  border-bottom: 2px solid var(--color-border);
}

.scene-art svg { display: block; width: 100%; height: 100%; }

.story-mascot {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  display: grid;
  width: 72px;
  justify-items: center;
  pointer-events: none;
  filter: drop-shadow(0 4px 5px rgb(15 23 42 / 18%));
}

.story-mascot img { display: block; width: 64px; height: 58px; object-fit: contain; }
.story-mascot span {
  margin-top: -5px;
  padding: 2px 6px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 999px;
  color: #fff;
  background: rgb(15 23 42 / 76%);
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: .04em;
}
.story-mascot[data-state="thinking"] img { animation: mascot-mind-race 560ms ease-in-out infinite alternate; }
.story-mascot[data-state="hero"] img { filter: drop-shadow(0 0 10px rgb(255 174 25 / 58%)); transform: translateY(-2px) scale(1.05); }
.story-mascot[data-state="steady"] img { transform: rotate(-1deg); }
.story-mascot[data-state="smoky"] img { filter: grayscale(.58) saturate(.65) drop-shadow(0 4px 5px rgb(15 23 42 / 28%)); transform: rotate(5deg) translateY(2px); }

.scene-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  animation: photo-in 420ms ease-out both;
}

.scene-photo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, .78);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.scene-visual figcaption {
  display: grid;
  gap: 4px;
  padding: 12px 14px 14px;
}

.scene-visual figcaption strong { font-size: 16px; line-height: 1.4; }
.scene-visual figcaption span { color: var(--color-muted-text); font-size: 13px; line-height: 1.55; }

.question-card {
  padding: 18px 18px 22px;
  border: 2px solid var(--color-foreground);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.scene-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #34443a;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}
.speaker-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); }

.initials {
  display: grid;
  min-height: 112px;
  margin: 15px 0 12px;
  place-items: center;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border: 2px dashed #d79541;
  border-radius: 18px;
  font-size: clamp(52px, 18vw, 80px);
  font-weight: 1000;
  letter-spacing: .06em;
  line-height: 1;
}

.question-card h2 { margin: 0; font-size: 20px; line-height: 1.45; text-align: center; }
.thinking-hint { margin-top: 8px; color: var(--color-muted-text); font-size: 13px; line-height: 1.5; text-align: center; }

.dialogue-stage {
  margin-top: 14px;
  padding: 12px 10px 14px;
  overflow: hidden;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #edf3ee;
}

.dialogue-stage-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 10px;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(184, 93, 0, .12);
}

.answer-lead {
  margin: 0;
  color: #3d4d43;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
}

.answer-list { display: grid; gap: 8px; }

.answer-button {
  position: relative;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: end;
  min-height: 96px;
  padding: 0 4px;
  border: 0;
  border-radius: 16px;
  color: var(--color-foreground);
  background: transparent;
  text-align: left;
  animation: dialogue-in 360ms ease-out both;
  animation-delay: calc(var(--entrance-order) * 60ms);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.answer-button.is-right { grid-template-columns: minmax(0, 1fr) 78px; }
.answer-button:not(:disabled):active { opacity: .72; }
.answer-button:disabled { cursor: not-allowed; pointer-events: none; }
.answer-list.has-selection .answer-button:not(.is-selected) { opacity: .28; filter: grayscale(.62); }
.answer-button.is-selected { opacity: 1; }
.answer-button.is-selected .speech-bubble { border-color: #89978e; background: #e7ebe8; box-shadow: 0 4px 0 rgba(75, 85, 78, .12); transform: none; }
.answer-button.is-selected .person-portrait { border-color: #89978e; box-shadow: 0 0 0 4px rgba(75, 85, 78, .12); filter: grayscale(.28); }
.answer-button.is-selected .option-key { color: #fff; border-color: #78867d; background: #78867d; }
.answer-button.is-selected .voice-cue { color: #626d66; }

@media (hover: hover) and (pointer: fine) {
  .answer-button:not(:disabled):hover .speech-bubble { border-color: var(--color-primary); background: #fffdf7; transform: translateY(-2px); }
  .answer-button:not(:disabled):hover .person-portrait { border-color: var(--color-primary); }
}

.dialogue-person {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  align-self: stretch;
}

.person-portrait {
  width: 72px;
  height: 82px;
  object-fit: cover;
  object-position: center 22%;
  border: 3px solid #fff;
  border-radius: 24px 24px 14px 14px;
  background: #27352c;
  box-shadow: 0 3px 0 rgba(15, 23, 42, .12);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.person-identity {
  position: absolute;
  bottom: 4px;
  left: 50%;
  min-width: 48px;
  padding: 2px 6px;
  border-radius: 7px;
  color: #fff;
  background: rgba(15, 23, 42, .82);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.speech-bubble {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  align-self: center;
  min-height: 72px;
  margin-left: 6px;
  padding: 11px 13px;
  border: 2px solid #aec5b6;
  border-radius: 18px 18px 18px 7px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(15, 23, 42, .08);
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.speech-bubble::before {
  position: absolute;
  left: -10px;
  top: 20px;
  width: 17px;
  height: 17px;
  content: "";
  background: inherit;
  border-bottom: 2px solid #aec5b6;
  border-left: 2px solid #aec5b6;
  transform: rotate(45deg);
}

.is-right .speech-bubble {
  margin-right: 6px;
  margin-left: 0;
  border-radius: 18px 18px 7px 18px;
}

.is-right .speech-bubble::before {
  right: -10px;
  left: auto;
  border: 0;
  border-top: 2px solid #aec5b6;
  border-right: 2px solid #aec5b6;
}

.answer-button.is-selected .speech-bubble::before { border-color: #89978e; }

@media (hover: hover) and (pointer: fine) {
  .answer-button:not(:disabled):hover .speech-bubble::before { border-color: var(--color-primary); }
}

.option-key {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-primary-strong);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.bubble-copy { display: grid; gap: 3px; padding-left: 7px; }
.speaker-style { color: var(--color-muted-text); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.option-text { font-size: 17px; font-weight: 900; line-height: 1.35; }

.voice-cue {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 3px;
  color: #637168;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.voice-cue svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.answer-button.is-speaking .voice-cue { color: var(--color-accent); }
.answer-button.is-speaking .person-portrait { animation: voice-pulse 360ms ease-out 2; }

.reaction-panel {
  margin-top: 14px;
  padding: 18px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-muted);
  animation: panel-in var(--duration-normal) ease-out both;
}

.reaction-badge {
  display: inline-flex;
  min-height: 28px;
  padding: 5px 9px;
  align-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--color-primary);
  font-size: 12px;
  font-weight: 900;
}

.reaction-line { margin-top: 10px; font-size: 17px; font-weight: 900; line-height: 1.55; }
.reaction-comment { margin-top: 6px; color: var(--color-muted-text); font-size: 13px; line-height: 1.55; }
.next-button { margin-top: 14px; min-height: 50px; }

.mission-brief {
  display: grid;
  min-width: 0;
  margin-bottom: 14px;
  padding: 14px 16px 14px 14px;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  column-gap: 12px;
  border: 2px solid #e9bd6f;
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 20%, rgb(244 163 64 / 12%) 0 7px, transparent 8px),
    linear-gradient(135deg, #fff9ea, #f7fbf7 70%);
  box-shadow: 0 5px 0 rgb(188 128 41 / 9%);
}

.mission-voice-mark {
  display: grid;
  width: 40px;
  height: 40px;
  grid-column: 1;
  place-items: center;
  border: 2px solid #f0bd62;
  border-radius: 14px;
  color: #8a4b00;
  background: #fff0c7;
  box-shadow: 0 3px 0 rgb(188 128 41 / 12%);
}

.mission-voice-mark svg {
  width: 23px;
  height: 23px;
  fill: currentcolor;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mission-brief.is-announcing {
  border-color: #dc921e;
  box-shadow: 0 5px 0 rgb(188 128 41 / 13%), 0 0 0 3px rgb(244 163 64 / 8%);
}

.mission-brief.is-announcing .mission-voice-mark {
  animation: mission-voice-bounce .62s ease-in-out 2;
}

@keyframes mission-voice-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-2px) rotate(-5deg); }
  70% { transform: translateY(0) rotate(4deg); }
}

.mission-index {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 7px;
  color: #663700;
  background: var(--color-accent-soft);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.mission-copy {
  display: flex;
  min-width: 0;
  grid-column: 2;
  justify-self: center;
  align-items: center;
  margin: 0;
  color: var(--color-muted-text);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mission-scene-line { display: inline-flex; align-items: center; justify-content: center; }
.mission-scene-label { color: #663700; font-weight: 900; }

.mission-separator {
  margin: 0 3px;
  color: #663700;
  font-weight: 900;
}

.mission-balance {
  width: 40px;
  height: 1px;
  grid-column: 3;
}

.bomb-rack-card {
  margin: 14px 0;
  padding: 12px 10px 10px;
  border: 2px solid #efc983;
  border-radius: 20px;
  background:
    radial-gradient(circle at 8% 18%, rgb(244 163 64 / 16%) 0 5px, transparent 6px),
    radial-gradient(circle at 93% 76%, rgb(23 102 58 / 13%) 0 6px, transparent 7px),
    linear-gradient(135deg, #fff8e8, #f4fbf6);
  box-shadow: 0 5px 0 rgb(188 128 41 / 10%);
}

.rack-heading {
  display: flex;
  min-height: 26px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rack-heading strong {
  color: #713f12;
  font-size: 13px;
  font-weight: 1000;
}

.rack-heading strong::before { margin-right: 5px; content: "✦"; color: #e58a16; }
.rack-heading span { color: #66756b; font-size: 10px; font-weight: 900; }

.bomb-rack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 6px;
  margin: 9px 0 0;
}

.rack-item {
  display: grid;
  min-width: 0;
  min-height: 76px;
  padding: 12px 2px 7px;
  place-items: center;
  align-content: center;
  border: 2px solid #d8e3db;
  border-radius: 18px;
  color: var(--color-muted-text);
  background: #fff;
  box-shadow: 0 3px 0 rgb(15 23 42 / 8%);
  transition: transform 220ms ease-out, border-color 220ms ease-out, background-color 220ms ease-out, box-shadow 220ms ease-out;
}

.rack-item:nth-child(1) { background: #fff0ed; }
.rack-item:nth-child(2) { background: #fff7d9; }
.rack-item:nth-child(3) { background: #eaf8ee; }
.rack-item:nth-child(4) { background: #eaf5ff; }
.rack-item:nth-child(5) { background: #f4efff; }

.rack-bomb {
  position: relative;
  display: grid;
  width: 44px;
  height: 37px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50% 50% 46% 46%;
  color: #69786e;
  background: #f7fbf8;
  box-shadow: 0 4px 0 rgb(15 23 42 / 10%);
  font-size: 0;
  font-weight: 1000;
  transform-origin: 50% 100%;
}

.rack-bomb::before {
  position: absolute;
  top: -9px;
  right: 3px;
  width: 13px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  content: "";
  transform: rotate(-24deg);
}

.rack-bomb::after {
  content: "•ᴗ•";
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: -1px;
  line-height: 1;
}

.rack-number {
  position: absolute;
  top: -8px;
  left: -7px;
  z-index: 2;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
  line-height: 1;
}

.rack-bomb svg {
  position: absolute;
  top: -8px;
  left: -7px;
  z-index: 2;
  display: none;
  width: 19px;
  height: 19px;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rack-label { margin-top: 7px; overflow: hidden; font-size: 10px; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.rack-item.is-current { border-color: #f1a343; color: #8a4b00; background: #fff2cc; box-shadow: 0 4px 0 rgb(209 116 18 / 20%); transform: translateY(-3px) rotate(-1deg); }
.rack-item.is-current .rack-bomb { color: #8a4b00; background: #ffd470; animation: rack-bob 1.05s ease-in-out infinite; }
.rack-item.is-current .rack-bomb::after { content: "•◡•"; }
.rack-item.is-success { border-color: #77bd92; color: #146b3b; background: #ddf6e6; }
.rack-item.is-success .rack-bomb { color: #fff; background: #2e9a61; animation: rack-celebrate 620ms cubic-bezier(.2,.9,.25,1.35) both; }
.rack-item.is-success .rack-bomb::after { content: "^▽^"; }
.rack-item.is-failed { border-color: #eb948b; color: #a8271d; background: #ffe4df; }
.rack-item.is-failed .rack-bomb { color: #fff; background: #d95a4e; animation: rack-dizzy 1.6s ease-in-out infinite; }
.rack-item.is-failed .rack-bomb::after { content: "×﹏×"; font-size: 10px; }
.rack-item.is-success .rack-number, .rack-item.is-failed .rack-number { display: none; }
.rack-item.is-success .rack-success-icon, .rack-item.is-failed .rack-fail-icon { display: block; }

.bomb-panel {
  --timer-color: #087f82;
  --focus-ink: #075f62;
  --focus-border: #315d62;
  --focus-surface-start: #fffef8;
  --focus-surface-end: #eaf8f4;
  --focus-shadow: rgb(49 93 98 / 16%);
  position: relative;
  display: grid;
  padding: 14px 14px 18px;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "fuse fuse fuse" "timer visual ." "instruction instruction instruction";
  align-items: center;
  gap: 10px 18px;
  overflow: hidden;
  border: 3px solid #5d493a;
  border-radius: 30px;
  background:
    radial-gradient(circle at 8% 14%, rgb(244 163 64 / 20%) 0 6px, transparent 7px),
    radial-gradient(circle at 92% 22%, rgb(77 160 145 / 18%) 0 8px, transparent 9px),
    radial-gradient(circle at 12% 78%, rgb(135 91 199 / 12%) 0 7px, transparent 8px),
    linear-gradient(145deg, #fff9e9 0%, #ffedc5 100%);
  box-shadow: 0 8px 0 rgb(93 73 58 / 13%), inset 0 -7px 0 rgb(205 142 45 / 7%);
}

.ready-overlay {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 12;
  display: grid;
  min-height: 76px;
  padding: 10px 12px 10px 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 1px 12px;
  border: 2px solid #d58216;
  border-radius: 18px;
  color: #57320c;
  background: rgb(255 249 231 / 94%);
  box-shadow: 0 7px 0 rgb(128 75 10 / 16%), 0 0 0 999px rgb(255 248 226 / 8%);
  backdrop-filter: blur(5px);
}

.ready-overlay[hidden] { display: none; }
.ready-overlay .ready-eyebrow { color: #a65300; font-size: 11px; font-weight: 1000; }
.ready-overlay strong { font-size: 16px; line-height: 1.2; }
.ready-overlay > span:last-of-type { color: #6b665e; font-size: 11px; font-weight: 700; }
.ready-overlay .btn { min-width: 150px; min-height: 48px; grid-column: 2; grid-row: 1 / 4; padding: 9px 13px; }

.fuse-line {
  grid-area: fuse;
  height: 15px;
  overflow: hidden;
  padding: 2px;
  border: 2px solid rgb(93 73 58 / 22%);
  border-radius: 999px;
  background: #ead6af;
  box-shadow: inset 0 2px 0 rgb(93 73 58 / 8%), 0 3px 0 rgb(93 73 58 / 8%);
}
.fuse-line span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--timer-color);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 26%);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 1s linear, background-color 220ms ease-out;
}

.bomb-visual { position: relative; z-index: 2; width: min(100%, 420px); margin: 7px auto 0; grid-area: visual; justify-self: center; }
.bomb-visual::before, .bomb-visual::after { position: absolute; z-index: 3; color: #d9a347; font-weight: 1000; opacity: .72; pointer-events: none; }
.bomb-visual::before { top: 54px; left: 17%; content: "✦"; font-size: 18px; animation: tiny-star-pop 1.8s ease-in-out infinite; }
.bomb-visual::after { right: 11%; bottom: 28px; content: "◌"; color: #79b9ae; font-size: 22px; animation: tiny-star-pop 1.8s .7s ease-in-out infinite; }
.bomb-visual svg { display: block; width: 100%; height: auto; animation: bomb-breathe 2s ease-in-out infinite; transform-origin: 50% 72%; }

.alien-brain-core {
  position: absolute;
  top: 19%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 58px;
  height: 34px;
  place-items: center;
  border: 2px solid rgb(84 205 190 / 72%);
  border-radius: 50% 50% 43% 43%;
  background: linear-gradient(180deg, rgb(228 255 247 / 92%), rgb(113 220 204 / 48%));
  box-shadow: 0 0 13px rgb(89 220 201 / 44%), inset 0 2px 0 rgb(255 255 255 / 78%);
  transform: translateX(-50%);
}

.alien-brain-core::before,
.alien-brain-core::after {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 8px;
  border: 2px solid #263747;
  border-radius: 50%;
  content: "";
  background: #ffb220;
  box-shadow: 0 0 7px rgb(255 174 25 / 66%);
}
.alien-brain-core::before { left: 7px; }
.alien-brain-core::after { right: 7px; }
.alien-brain-core i {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 30%, #fff8ba 0 12%, #ffd13f 13% 37%, #f19a0d 38% 100%);
  box-shadow: 0 0 11px rgb(255 174 25 / 82%);
  animation: alien-core-think 1.15s ease-in-out infinite alternate;
}
.bomb-body { fill: url(#bomb-body-gradient); stroke: #263747; stroke-width: 6; filter: drop-shadow(0 7px 0 rgb(15 23 42 / 14%)); transition: fill 220ms ease-out; }
.bomb-cap { fill: url(#bomb-cap-gradient); stroke: #263747; stroke-width: 6; }
.bomb-fuse { fill: none; stroke: #0f172a; stroke-width: 8; stroke-linecap: round; }
.fuse-spark { fill: #ff9f1c; stroke: #0f172a; stroke-width: 4; stroke-linejoin: round; animation: spark-flicker 520ms ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.bomb-arm, .bomb-leg, .bomb-foot { fill: none; stroke: #0f172a; stroke-width: 6; stroke-linecap: round; }
.bomb-eye { fill: #fff; }
.bomb-pupil { fill: #263747; }
.bomb-cheek { fill: #ff9d85; opacity: .92; }
.bomb-shine { fill: none; stroke: rgb(255 255 255 / 52%); stroke-width: 7; stroke-linecap: round; }
.bomb-mouth { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; }
.bomb-mouth-success, .bomb-mouth-fail, .bomb-sweat { display: none; }
.bomb-sweat { fill: #8edce3; stroke: #0f172a; stroke-width: 4; }

.bomb-code {
  position: absolute;
  z-index: 4;
  top: 42%;
  left: 50%;
  display: grid;
  min-width: clamp(126px, 40vw, 174px);
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 14px 8px;
  border: 2px solid var(--focus-border);
  border-radius: 21px;
  color: var(--focus-ink);
  background: linear-gradient(180deg, var(--focus-surface-start), var(--focus-surface-end));
  box-shadow: 0 6px 0 var(--focus-shadow), inset 0 2px 0 rgb(255 255 255 / 78%);
  text-align: center;
  transform: translate(-50%, -50%);
  transition: color 180ms ease-out, background 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.bomb-code::after {
  position: absolute;
  bottom: -15px;
  left: 50%;
  width: 13px;
  height: 17px;
  border: 2px solid #263747;
  border-radius: 3px 3px 7px 7px;
  content: "";
  background: linear-gradient(145deg, #38a56e, #12633c);
  box-shadow: 0 2px 0 rgb(15 23 42 / 16%);
  transform: translateX(-50%) rotate(45deg);
}

.bomb-code-label {
  color: currentColor;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1.1;
  opacity: .72;
}

.bomb-code strong {
  color: currentColor;
  font-size: clamp(30px, 10vw, 47px);
  font-weight: 1000;
  letter-spacing: .06em;
  line-height: .94;
  text-shadow: 0 2px 0 rgb(255 255 255 / 88%);
  white-space: nowrap;
}

.bomb-mood-bubble {
  position: absolute;
  top: 22px;
  right: 9px;
  z-index: 4;
  max-width: 114px;
  padding: 6px 9px;
  border: 2px solid #8fa7a0;
  border-radius: 13px 13px 4px 13px;
  color: #617069;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 3px 0 rgb(72 95 87 / 9%);
  font-size: 9px;
  font-weight: 1000;
  line-height: 1.35;
  text-align: center;
  animation: mood-bubble-bob 2.4s ease-in-out infinite;
}

.timer-dial {
  --time-angle: 360deg;
  --alert-color: #d47409;
  --alert-ink: #733900;
  --alert-surface: #fff2cf;
  --alert-shadow: rgb(133 72 8 / 20%);
  position: relative;
  top: auto;
  left: auto;
  z-index: 6;
  display: grid;
  width: 120px;
  min-height: 104px;
  margin: 0;
  padding: 9px 10px 8px 13px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  grid-area: timer;
  justify-self: start;
  align-items: center;
  column-gap: 4px;
  border: 3px solid var(--alert-color);
  border-radius: 19px;
  color: var(--alert-ink);
  background:
    radial-gradient(circle at 82% 15%, rgb(255 255 255 / 80%) 0 4px, transparent 5px),
    linear-gradient(145deg, #fffdf6, var(--alert-surface));
  box-shadow: 0 6px 0 var(--alert-shadow), inset 0 2px 0 rgb(255 255 255 / 82%);
  font-variant-numeric: tabular-nums;
  transition: color 180ms ease-out, background 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.timer-dial::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 7px;
  width: 4px;
  border-radius: 999px;
  background: var(--alert-color);
  content: "";
}

.timer-dial::after {
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 2;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  content: "!";
  color: #fff;
  background: var(--alert-color);
  box-shadow: 0 3px 0 var(--alert-shadow);
  font-size: 16px;
  font-weight: 1000;
  animation: timer-spark-pop 760ms ease-in-out infinite alternate;
}

.timer-dial > * { position: relative; z-index: 1; }
.timer-caption {
  grid-column: 1 / -1;
  color: var(--alert-ink);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .02em;
  line-height: 1.15;
}
.timer-label {
  grid-column: 1 / -1;
  justify-self: stretch;
  margin-top: 2px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--alert-color);
  font-size: 12px;
  font-weight: 1000;
  line-height: 1.2;
  text-align: center;
}
.timer-dial strong {
  display: flex;
  width: auto;
  height: auto;
  grid-column: 1;
  grid-row: 2;
  align-items: center;
  justify-content: flex-start;
  color: var(--alert-color);
  background: none;
  box-shadow: none;
  font-size: 44px;
  font-weight: 1000;
  line-height: 1;
}
.timer-unit {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 1000;
}
.timer-feet { display: none; }
.timer-dial.is-warning {
  --alert-color: #d84f20;
  --alert-ink: #7d2910;
  --alert-surface: #ffe2bc;
  --alert-shadow: rgb(172 55 20 / 22%);
  animation: timer-nudge 680ms ease-in-out infinite;
}
.timer-dial.is-urgent {
  --alert-color: #ca211b;
  --alert-ink: #74100c;
  --alert-surface: #ffd8cf;
  --alert-shadow: rgb(154 22 17 / 26%);
  animation: timer-urgent 320ms ease-in-out infinite alternate;
}
.bomb-panel.is-warning {
  --timer-color: #d89a25;
  --focus-ink: #83550d;
  --focus-border: #a76c16;
  --focus-surface-start: #fffdf3;
  --focus-surface-end: #ffe7a3;
  --focus-shadow: rgb(167 108 22 / 18%);
}
.bomb-panel.is-urgent, .bomb-panel.is-miswired {
  --timer-color: #cf4a3d;
  --focus-ink: #9c3028;
  --focus-border: #ae4036;
  --focus-surface-start: #fffaf7;
  --focus-surface-end: #ffe1da;
  --focus-shadow: rgb(174 64 54 / 18%);
}

.bomb-instruction { margin: 0 auto; grid-area: instruction; color: #4a4132; font-size: 13px; font-weight: 800; line-height: 1.55; text-align: center; }

.bomb-fx { position: absolute; z-index: 5; inset: 8px; overflow: hidden; border-radius: calc(var(--radius-lg) - 8px); pointer-events: none; }
.fx-confetti { position: absolute; top: 44%; left: 50%; width: 9px; height: 16px; border-radius: 3px; background: var(--fx-color); opacity: 0; animation: confetti-pop 620ms ease-out forwards; animation-delay: var(--fx-delay); transform: translate(-50%, -50%) rotate(var(--fx-rotate)); }
.fx-smoke { position: absolute; top: 39%; left: 50%; width: var(--fx-size); height: var(--fx-size); border-radius: 50%; background: #3f4a51; opacity: 0; animation: smoke-pop 700ms ease-out forwards; animation-delay: var(--fx-delay); }

.bomb-panel.is-success { border-color: #17804a; background: linear-gradient(145deg, #effbf3, #d8f2e2); }
.bomb-panel.is-success .bomb-body { fill: #18804a; }
.bomb-panel.is-success {
  --timer-color: #278653;
  --focus-ink: #126b3c;
  --focus-border: #247246;
  --focus-surface-start: #fff;
  --focus-surface-end: #dff7e8;
  --focus-shadow: rgb(18 95 57 / 18%);
}
.bomb-panel.is-success .bomb-mouth-default { display: none; }
.bomb-panel.is-success .bomb-mouth-success { display: block; }
.bomb-panel.is-success .alien-brain-core i { animation: none; transform: scale(1.08); box-shadow: 0 0 16px rgb(255 174 25 / 95%); }
.bomb-panel.is-success .fuse-spark { opacity: 0; animation: none; }
.bomb-panel.is-success .bomb-visual svg { animation: bomb-celebrate 440ms cubic-bezier(.2,.9,.25,1.35) both; }
.bomb-panel.is-first-win { animation: first-win-panel-pop 720ms cubic-bezier(.18,.9,.24,1.2) both; }
.bomb-panel.is-first-win .bomb-visual svg { animation: first-win-bomb-pop 780ms cubic-bezier(.18,.9,.24,1.25) both; }
.bomb-panel.is-first-win .bomb-mood-bubble { color: #7d2910; border-color: #f09a18; background: #fff3c8; font-size: 12px; }
.fx-confetti.is-first-win-piece { width: 11px; height: 20px; animation-duration: 880ms; }
.bomb-panel[data-onboarding-stage="instant"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "visual" "instruction";
}
.bomb-panel[data-onboarding-stage="instant"] .fuse-line { display: none; }
.bomb-panel[data-onboarding-stage="instant"] .bomb-visual { width: min(100%, 470px); }
.bomb-panel[data-onboarding-stage="instant"] .bomb-instruction::before { content: "直接点字 · 选满自动判定"; font-weight: 1000; }
.bomb-panel[data-onboarding-stage="instant"] .bomb-instruction { font-size: 0; }
.bomb-panel[data-onboarding-stage="instant"] .bomb-instruction::before { font-size: 14px; }
.bomb-panel.is-miswired { animation: panel-shake 280ms ease-in-out; }
.bomb-panel.is-miswired .fuse-spark { fill: #ef2f24; transform: scale(1.22); }

.bomb-panel.is-exploded { border-color: #a8271d; background: linear-gradient(145deg, #fff0eb, #ffd2c7); }
.bomb-panel.is-exploded .bomb-body { fill: #8c3c34; }
.bomb-panel.is-exploded {
  --timer-color: #b83d32;
  --focus-ink: #8d231c;
  --focus-border: #7c211a;
  --focus-surface-start: #fff;
  --focus-surface-end: #ffe0d8;
  --focus-shadow: rgb(124 33 26 / 20%);
}
.bomb-panel.is-exploded .bomb-mouth-default { display: none; }
.bomb-panel.is-exploded .bomb-mouth-fail, .bomb-panel.is-urgent .bomb-sweat { display: block; }
.bomb-panel.is-urgent .alien-brain-core i { animation-duration: 180ms; }
.bomb-panel.is-exploded .alien-brain-core { opacity: .3; filter: grayscale(1); transform: translateX(-50%) rotate(-7deg); }
.bomb-panel.is-exploded { animation: explosion-panel-shake 760ms cubic-bezier(.2,.8,.25,1) both; }
.bomb-panel.is-exploded .bomb-visual svg { animation: bomb-burst-body 720ms cubic-bezier(.18,.82,.2,1) both; }
.bomb-panel.is-exploded .bomb-code { animation: bomb-code-pop 620ms ease-out both; }
.bomb-panel.is-exploded .fuse-spark { fill: #ef2f24; transform: scale(1.45); }
.app-shell.is-blast-shake { animation: blast-screen-shake 780ms cubic-bezier(.22,.78,.2,1) both; }

@keyframes first-win-panel-pop {
  0% { transform: scale(1); }
  24% { transform: scale(1.025) rotate(-.5deg); }
  48% { transform: scale(.99) rotate(.35deg); }
  100% { transform: scale(1); }
}

@keyframes first-win-bomb-pop {
  0% { transform: scale(.92) rotate(-2deg); }
  38% { transform: scale(1.12) rotate(2deg); }
  68% { transform: scale(.98) rotate(-.5deg); }
  100% { transform: scale(1); }
}

.fx-blast-flash {
  position: absolute;
  z-index: 8;
  inset: -18%;
  background: radial-gradient(circle at 50% 38%, #fff 0 5%, #fff49a 6% 12%, #ff8b24 18% 27%, rgb(225 38 26 / 84%) 34%, transparent 58%);
  opacity: 0;
  animation: blast-flash 620ms ease-out both;
}
.fx-shockwave {
  position: absolute;
  z-index: 9;
  top: 38%;
  left: 50%;
  width: 44px;
  height: 44px;
  border: 12px solid #fff4a6;
  border-radius: 50%;
  opacity: 0;
  animation: blast-shockwave 720ms ease-out both;
}
.fx-bomb-half {
  position: absolute;
  z-index: 11;
  top: 27%;
  left: 50%;
  width: 86px;
  height: 112px;
  border: 6px solid #162338;
  background: linear-gradient(145deg, #b94d3f, #722821);
  box-shadow: inset 0 10px 0 rgb(255 255 255 / 12%), 0 10px 0 rgb(80 29 22 / 18%);
}
.fx-bomb-half.is-left {
  margin-left: -86px;
  border-right: 3px dashed #ffe4b5;
  border-radius: 58px 12px 18px 58px;
  animation: bomb-half-left 820ms cubic-bezier(.14,.76,.24,1) both;
}
.fx-bomb-half.is-right {
  border-left: 3px dashed #ffe4b5;
  border-radius: 12px 58px 58px 18px;
  animation: bomb-half-right 820ms cubic-bezier(.14,.76,.24,1) both;
}
.fx-wreck-label {
  position: absolute;
  z-index: 13;
  top: 42%;
  left: 50%;
  display: grid;
  min-width: 120px;
  padding: 5px 13px 7px;
  border: 3px solid #79261f;
  border-radius: 16px;
  color: #8f2820;
  background: #fff8ef;
  box-shadow: 0 5px 0 rgb(86 28 22 / 22%);
  text-align: center;
  opacity: 0;
  animation: wreck-label-settle 820ms cubic-bezier(.18,.82,.2,1) both;
}
.fx-wreck-label small {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}
.fx-wreck-label strong {
  font-size: clamp(30px, 10vw, 44px);
  font-weight: 1000;
  letter-spacing: .06em;
  line-height: .96;
}
.fx-debris {
  position: absolute;
  z-index: 12;
  top: 38%;
  left: 50%;
  width: 12px;
  height: 8px;
  border: 3px solid #162338;
  border-radius: 3px;
  background: #a94135;
  opacity: 0;
  animation: blast-debris 760ms cubic-bezier(.16,.82,.25,1) forwards;
  animation-delay: var(--fx-delay);
}

@keyframes rack-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes rack-celebrate { 45% { transform: translateY(-7px) rotate(5deg) scale(1.08); } }
@keyframes rack-dizzy { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes timer-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1deg); } }
@keyframes timer-spark-pop { to { transform: rotate(16deg) scale(1.18); opacity: .72; } }
@keyframes mood-bubble-bob { 0%, 100% { transform: translateY(0) rotate(1deg); } 50% { transform: translateY(-3px) rotate(-1deg); } }
@keyframes tiny-star-pop { 0%, 100% { transform: scale(.8) rotate(-8deg); opacity: .55; } 50% { transform: scale(1.14) rotate(8deg); opacity: 1; } }
@keyframes bomb-breathe { 50% { transform: translateY(-3px) rotate(-.5deg); } }
@keyframes spark-flicker { to { opacity: .72; transform: scale(.84) rotate(8deg); } }
@keyframes timer-nudge { 50% { transform: scale(1.035); } }
@keyframes timer-urgent { to { transform: scale(1.055); box-shadow: 0 6px 0 var(--alert-shadow), 0 0 0 8px rgb(207 46 35 / 18%); } }
@keyframes panel-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes bomb-celebrate { 35% { transform: translateY(-10px) scale(1.035); } 70% { transform: translateY(2px) scale(.99); } }
@keyframes bomb-burst-body { 0%, 12% { opacity: 1; transform: scale(1); } 20% { opacity: 1; transform: scale(1.12); filter: brightness(2.4); } 32%, 100% { opacity: 0; transform: scale(1.28); } }
@keyframes bomb-code-pop { 0%, 18% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 36% { opacity: 1; transform: translate(-50%, -68%) rotate(-4deg) scale(1.18); } 100% { opacity: 0; transform: translate(-50%, -150%) rotate(16deg) scale(.72); } }
@keyframes explosion-panel-shake { 0% { transform: none; } 10% { transform: translate(-8px, 3px) rotate(-1deg); } 20% { transform: translate(9px, -5px) rotate(1.2deg) scale(1.012); } 34% { transform: translate(-7px, 5px) rotate(-.8deg); } 48% { transform: translate(6px, -3px) rotate(.6deg); } 64% { transform: translate(-3px, 2px); } 100% { transform: none; } }
@keyframes blast-screen-shake { 0% { transform: none; } 12% { transform: translate(5px, -3px); } 24% { transform: translate(-6px, 4px); } 38% { transform: translate(4px, 2px); } 54% { transform: translate(-3px, -2px); } 72% { transform: translate(2px, 1px); } 100% { transform: none; } }
@keyframes blast-flash { 0% { opacity: 0; transform: scale(.28); } 8% { opacity: 1; } 28% { opacity: .92; transform: scale(1); } 100% { opacity: 0; transform: scale(1.46); } }
@keyframes blast-shockwave { 0% { opacity: .95; transform: translate(-50%, -50%) scale(.25); } 65% { opacity: .5; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(8); } }
@keyframes bomb-half-left { 0%, 18% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.9); } 24% { opacity: 1; transform: translate(-94px, -62px) rotate(-38deg) scale(.8); } 72% { transform: translate(-56px, 15px) rotate(-17deg) scale(.88); } 100% { opacity: 1; transform: translate(-52px, 20px) rotate(-14deg) scale(.88); } }
@keyframes bomb-half-right { 0%, 18% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.9); } 24% { opacity: 1; transform: translate(94px, -56px) rotate(42deg) scale(.8); } 72% { transform: translate(56px, 17px) rotate(18deg) scale(.88); } 100% { opacity: 1; transform: translate(52px, 22px) rotate(15deg) scale(.88); } }
@keyframes wreck-label-settle { 0%, 24% { opacity: 0; transform: translate(-50%, -120%) rotate(13deg) scale(1.18); } 48% { opacity: 1; transform: translate(-50%, -38%) rotate(-6deg) scale(.94); } 72% { transform: translate(-50%, -52%) rotate(2deg) scale(1.03); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(-1deg) scale(1); } }
@keyframes blast-debris { 0%, 18% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 26% { opacity: 1; } 76% { opacity: .9; } 100% { opacity: .82; transform: translate(calc(-50% + var(--fx-x)), calc(-50% + var(--fx-y))) rotate(calc(var(--fx-rotate) + 260deg)) scale(.68); } }
@keyframes confetti-pop { 18% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--fx-x)), calc(-50% + var(--fx-y))) rotate(calc(var(--fx-rotate) + 240deg)); } }
@keyframes result-avatar-pop { 0% { opacity: 0; transform: translateY(14px) rotate(-8deg) scale(.72); } 70% { transform: translateY(-4px) rotate(3deg) scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes result-avatar-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes result-spark-wink { 0%, 100% { opacity: .45; transform: rotate(-10deg) scale(.78); } 50% { opacity: 1; transform: rotate(9deg) scale(1.18); } }
@keyframes smoke-pop { 12% { opacity: .92; transform: translate(-50%, -50%) scale(.42); } 38% { opacity: .82; } 100% { opacity: 0; transform: translate(calc(-50% + var(--fx-x)), calc(-50% + var(--fx-y))) scale(2.15); } }

.wire-section, .tile-section { margin-top: 16px; }
.section-label-row { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; }
.section-label-row strong { font-size: 15px; }
.section-label-row > span { color: var(--color-muted-text); font-size: 12px; }
.wire-undo-actions { display: flex; align-items: center; gap: 8px; }
.single-undo-hint { color: var(--color-muted-text); font-size: 11px; font-weight: 700; white-space: nowrap; }

.small-text-button {
  min-width: 72px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  color: var(--color-primary);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.small-text-button:hover { text-decoration: underline; }

.word-slots {
  display: grid;
  grid-template-columns: repeat(var(--slot-count, 4), minmax(0, 1fr));
  gap: 8px;
}

.wire-slot {
  display: grid;
  min-width: 0;
  min-height: 60px;
  padding: 4px;
  place-items: center;
  border: 2px dashed #9eaf9f;
  border-radius: 12px;
  color: var(--color-foreground);
  background: var(--color-surface);
  font-size: 25px;
  font-weight: 1000;
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}

.wire-slot.has-char { border-style: solid; border-color: var(--color-primary); background: var(--color-muted); }

.slot-letter { color: var(--color-muted-text); font-size: 10px; font-weight: 900; line-height: 1; }
.slot-char { min-height: 30px; font-size: 25px; line-height: 1.1; }

.char-pool {
  display: grid;
  grid-template-columns: repeat(var(--tile-columns, 4), minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.char-tile {
  min-width: 0;
  min-height: 54px;
  padding: 6px;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-foreground);
  background: var(--color-surface);
  font-size: 21px;
  font-weight: 1000;
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

.char-tile:hover { border-color: var(--color-primary); background: var(--color-muted); }
.char-tile:disabled { cursor: default; opacity: .34; }

.defuse-feedback {
  display: grid;
  margin-top: 14px;
  padding: 18px;
  justify-items: center;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-muted);
  text-align: center;
}

.defuse-feedback.is-error { border-color: #c97820; background: var(--color-accent-soft); }
.defuse-feedback > p { margin: 8px 0 0; line-height: 1.45; }
.defuse-feedback .bomb-rack-card { margin: 12px 0 0; }
.defuse-feedback .feedback-cue {
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 17px;
  letter-spacing: .08em;
}
.defuse-reward {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #704000;
  background: #ffe4a5;
  font-size: 12px;
  font-weight: 1000;
}
.defuse-feedback.is-error .defuse-reward { color: #8e241c; background: #ffd6d1; }
.defuse-feedback.is-life-earned {
  border-color: #e58a16;
  box-shadow: 0 0 0 4px rgb(229 138 22 / 13%), 0 7px 0 rgb(188 128 41 / 12%);
  animation: life-reward-pop 540ms cubic-bezier(.2, .9, .25, 1.25) both;
}
.defuse-feedback.is-life-earned .reaction-badge { background: #f29a18; }
.defuse-feedback.is-life-earned .defuse-reward { color: #8a3e00; background: #fff0b8; }
.defuse-feedback.is-shield-used .defuse-reward { color: #075985; background: #dff5ff; }
@keyframes life-reward-pop {
  0% { transform: scale(.97); }
  55% { transform: scale(1.015); }
  100% { transform: scale(1); }
}
#defuse-feedback-title {
  margin-top: 8px;
  color: var(--color-foreground);
  font-size: clamp(25px, 6.8vw, 34px);
  font-weight: 1000;
  line-height: 1.15;
}
#defuse-feedback-copy { max-width: 520px; color: var(--color-muted-text); font-size: 15px; font-weight: 800; }
.defuse-reaction-quote {
  width: 100%;
  margin: 10px 0 0;
  padding: 10px 13px;
  border-left: 4px solid var(--color-accent);
  border-radius: 0 12px 12px 0;
  color: #733d00;
  background: #fff3d0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
  text-align: left;
}
.defuse-answer-proof { color: var(--color-muted-text); font-size: 12px; font-weight: 800; }
.defuse-feedback.is-cinematic .feedback-cue { animation: reaction-cue-pop 280ms 120ms cubic-bezier(.2,.9,.25,1.35) both; }
.defuse-feedback.is-cinematic #defuse-feedback-title { animation: reaction-title-pop 330ms 330ms cubic-bezier(.18,.88,.24,1.22) both; }
.defuse-feedback.is-cinematic #defuse-feedback-copy,
.defuse-feedback.is-cinematic .defuse-reaction-quote,
.defuse-feedback.is-cinematic .defuse-answer-proof { animation: reaction-line-in 280ms 570ms ease-out both; }
.defuse-feedback.is-cinematic .defuse-reaction-quote { animation-delay: 710ms; }
.defuse-feedback.is-cinematic .defuse-answer-proof { animation-delay: 850ms; }
.defuse-feedback.is-cinematic .defuse-reward,
.defuse-feedback.is-cinematic .score-life-meter { animation: reaction-score-in 260ms 1050ms ease-out both; }
@keyframes reaction-cue-pop {
  0% { opacity: 0; transform: scale(.72) rotate(-4deg); }
  70% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes reaction-title-pop {
  0% { opacity: 0; transform: translateY(7px) scale(.92); }
  70% { opacity: 1; transform: translateY(0) scale(1.035); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes reaction-line-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes reaction-score-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.score-life-meter {
  display: grid;
  margin-top: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px 10px;
  color: #66756b;
  font-size: 11px;
  font-weight: 900;
}
.score-life-meter > strong { justify-self: end; color: #9a5300; font-size: 12px; }
.score-life-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e9e3;
}
.score-life-track > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0a126, #e24b44);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 360ms ease-out;
}
#next-bomb { margin-top: 14px; min-height: 50px; }

.result-avatar {
  position: relative;
  width: 118px;
  height: 106px;
  margin: 27px auto 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: result-avatar-pop 620ms cubic-bezier(.2, .9, .25, 1.35) both, result-avatar-float 2.8s 620ms ease-in-out infinite;
}

.result-avatar::before { display: none; }
.result-avatar img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 7px 6px rgb(15 23 42 / 18%)); }

.result-avatar-eye { position: absolute; top: 25px; width: 7px; height: 9px; border-radius: 50%; background: #273747; }
.result-avatar .eye-left { left: 22px; }
.result-avatar .eye-right { right: 22px; }
.result-avatar-cheek { position: absolute; top: 38px; width: 11px; height: 6px; border-radius: 50%; background: rgb(255 137 117 / 78%); }
.result-avatar .cheek-left { left: 11px; }
.result-avatar .cheek-right { right: 11px; }
.result-avatar-mouth { position: absolute; bottom: 14px; left: 50%; width: 25px; height: 11px; border-bottom: 4px solid #273747; border-radius: 0 0 50% 50%; transform: translateX(-50%); }
.result-avatar-spark { position: absolute; top: -26px; right: -10px; color: #f3a632; font-size: 23px; font-weight: 1000; text-shadow: 0 2px 0 #fff; animation: result-spark-wink 1.15s ease-in-out infinite; }

.result-avatar[data-mood="chaos"] img { animation: mascot-mind-race 500ms ease-in-out infinite alternate; }
.result-avatar[data-mood="chaos"] .eye-left { height: 4px; border-radius: 5px; transform: rotate(20deg); }
.result-avatar[data-mood="chaos"] .eye-right { height: 4px; border-radius: 5px; transform: rotate(-20deg); }
.result-avatar[data-mood="smoky"] img { filter: grayscale(.45) saturate(.7) drop-shadow(0 7px 7px rgb(76 72 86 / 28%)); }
.result-avatar[data-mood="smoky"] .result-avatar-eye { width: 10px; height: 3px; border-radius: 3px; }
.result-avatar[data-mood="smoky"] .eye-left { transform: rotate(42deg); }
.result-avatar[data-mood="smoky"] .eye-right { transform: rotate(-42deg); }
.result-avatar[data-mood="smoky"] .result-avatar-mouth { border-top: 4px solid #273747; border-bottom: 0; border-radius: 50% 50% 0 0; }
.result-avatar[data-mood="lucky"] img { filter: hue-rotate(8deg) drop-shadow(0 7px 7px rgb(88 61 151 / 20%)); }
.result-avatar[data-mood="lucky"] .eye-left { height: 4px; border-radius: 4px; transform: rotate(-12deg); }
.result-avatar[data-mood="hero"] img { filter: drop-shadow(0 0 12px rgb(43 174 104 / 34%)) drop-shadow(0 7px 6px rgb(15 23 42 / 18%)); }
.result-avatar[data-mood="hero"] .result-avatar-mouth { width: 31px; height: 14px; }
.result-summary { max-width: 360px; margin-inline: auto; color: var(--color-muted-text); font-size: 16px; line-height: 1.6; text-align: center; }

.result-score { display: grid; margin: 24px 0 18px; text-align: center; }
.result-score strong { color: var(--color-accent); font-size: 70px; font-weight: 1000; line-height: 1; font-variant-numeric: tabular-nums; }
.result-score span { margin-top: 6px; color: var(--color-muted-text); font-size: 13px; }
.result-grid { grid-template-columns: repeat(3, 1fr); }

#result-screen.is-relationship {
  background:
    radial-gradient(circle at 85% 7%, rgb(255 215 176 / 52%), transparent 24%),
    radial-gradient(circle at 7% 88%, rgb(183 231 203 / 58%), transparent 29%),
    #fffdf8;
}
#result-screen.is-relationship .result-score strong { color: #bd5a3f; }
#result-screen.is-relationship blockquote { border-left-color: #e68b5c; background: #fff1e8; }
#result-screen.is-relationship .story-route { border-color: #e7b18e; color: #9b4c36; background: #fff8f1; }

.story-route {
  margin: 12px 0;
  padding: 12px 14px;
  border: 2px dashed #9fc7b0;
  border-radius: 16px;
  color: var(--color-primary-strong);
  background: rgb(231 244 235 / 78%);
  text-align: center;
}
.story-route > span { display: block; margin-bottom: 5px; color: var(--color-muted-text); font-size: 11px; font-weight: 900; }
.story-route > p { margin: 0; font-size: 13px; font-weight: 1000; line-height: 1.45; }

blockquote {
  margin: 18px 0;
  padding: 16px;
  border-left: 5px solid var(--color-accent);
  border-radius: 0 12px 12px 0;
  color: var(--color-foreground);
  background: var(--color-accent-soft);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.review-section {
  margin: 22px 0;
  padding-top: 20px;
  border-top: 2px solid var(--color-border);
}

.review-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.review-kicker {
  margin: 0 0 3px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.review-heading h2 { margin: 0; font-size: 24px; line-height: 1.25; }

.review-heading > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-muted-text);
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 800;
}

.run-summary {
  margin: 0 0 12px;
  padding: 14px;
  border-left: 5px solid var(--color-primary);
  border-radius: 0 12px 12px 0;
  color: #27352c;
  background: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.answer-review { display: grid; gap: 10px; }

.review-card {
  padding: 14px;
  border: 2px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}

.review-card.is-flip { border-color: #d9a25e; background: #fffaf0; }

.review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.review-initials { font-size: 20px; font-weight: 1000; letter-spacing: .04em; }

.review-grade {
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--color-primary-strong);
  background: var(--color-muted);
  font-size: 12px;
  font-weight: 900;
}

.review-card.is-flip .review-grade { color: #6e3b00; background: var(--color-accent-soft); }

.review-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding-block: 5px;
  font-size: 14px;
  line-height: 1.55;
}

.review-label { color: var(--color-muted-text); font-size: 12px; font-weight: 700; }
.review-value { color: var(--color-foreground); font-weight: 800; }

.flip-reason {
  margin: 9px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--color-accent);
  color: #55320e;
  background: var(--color-accent-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.friend-challenge {
  position: relative;
  display: grid;
  margin: 0 0 18px;
  padding: 17px;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px 14px;
  overflow: hidden;
  border: 2px solid #d07a19;
  border-radius: 22px;
  background:
    radial-gradient(circle at 94% 14%, rgb(255 255 255 / 68%) 0 24px, transparent 25px),
    linear-gradient(135deg, #fff0c8, #fff9ea 58%, #e5f5eb);
  box-shadow: 0 7px 0 rgb(141 86 24 / 12%);
  animation: challenge-drop 420ms cubic-bezier(.34, 1.56, .64, 1) both;
}

.challenge-sticker {
  position: absolute;
  top: 9px;
  right: -29px;
  padding: 5px 35px;
  color: #fff;
  background: #c76507;
  font-size: 10px;
  font-weight: 1000;
  transform: rotate(12deg);
}

.challenge-face {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 3px solid var(--color-foreground);
  border-radius: 18px 18px 21px 17px;
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 4px 0 rgb(15 23 42 / 13%);
  font-size: 21px;
  font-weight: 1000;
  transform: rotate(-4deg);
}

.challenge-message { min-width: 0; padding-right: 30px; }
.challenge-kicker { margin: 0 0 3px; color: #9a4e08; font-size: 11px; font-weight: 1000; }
.challenge-message h2 { margin: 0; font-size: 20px; line-height: 1.22; }
.challenge-message p:last-child { margin: 6px 0 0; color: var(--color-muted-text); font-size: 13px; line-height: 1.5; }
.friend-challenge .btn { grid-column: 1 / -1; }

.result-actions { display: grid; gap: 10px; }
.share-launch { display: flex; align-items: center; justify-content: center; gap: 9px; }
.share-launch > span { display: grid; width: 25px; height: 25px; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-size: 16px; }
.text-button { min-height: 48px; border: 0; color: var(--color-muted-text); background: transparent; font-weight: 800; }
.text-button:hover { color: var(--color-foreground); text-decoration: underline; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 40;
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border: 2px solid var(--color-foreground);
  border-radius: 12px;
  color: #fff;
  background: var(--color-foreground);
  font-size: 14px;
  font-weight: 800;
  animation: toast-in var(--duration-normal) ease-out both;
  transform: translateX(-50%);
}

.session-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
  justify-items: center;
}

.session-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, .58);
}

.session-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 12px 20px max(22px, env(safe-area-inset-bottom));
  border: 2px solid var(--color-foreground);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: var(--color-background);
  box-shadow: 0 -10px 32px rgba(15, 23, 42, .18);
  animation: sheet-in 240ms ease-out both;
}

.session-handle {
  display: block;
  width: 42px;
  height: 5px;
  margin: 0 auto 16px;
  border-radius: 8px;
  background: var(--color-border);
}

.session-sheet .eyebrow { margin: 0 0 5px; text-align: left; }
.session-sheet h2 { margin: 0; font-size: 26px; line-height: 1.25; }
.session-sheet > p:not(.eyebrow) { margin: 9px 0 18px; color: var(--color-muted-text); font-size: 14px; line-height: 1.6; }
.session-actions { display: grid; gap: 9px; }

.danger-text-button {
  min-height: 46px;
  padding: 8px 12px;
  border: 0;
  color: var(--color-danger);
  background: transparent;
  font-size: 14px;
  font-weight: 900;
}

.danger-text-button:hover { text-decoration: underline; }

body.has-session-menu { overflow: hidden; }

.progression-menu {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  padding: 18px;
}

.progression-menu[hidden] { display: none; }
.progression-backdrop { position: absolute; z-index: 0; inset: 0; background: rgb(15 23 42 / 68%); backdrop-filter: blur(3px); }
.progression-sheet {
  position: relative;
  z-index: 3;
  width: min(100%, 440px);
  padding: 24px;
  border: 3px solid #183e2b;
  border-radius: 28px;
  background:
    radial-gradient(circle at 10% 12%, rgb(244 163 64 / 18%) 0 8px, transparent 9px),
    radial-gradient(circle at 92% 18%, rgb(62 174 112 / 15%) 0 10px, transparent 11px),
    #fffaf0;
  box-shadow: 0 14px 0 rgb(15 23 42 / 18%), 0 24px 52px rgb(15 23 42 / 26%);
  text-align: center;
  animation: progression-pop 320ms cubic-bezier(.18, .88, .28, 1.2) both;
}

.progression-sheet .eyebrow { margin: 0 0 6px; }
.progression-sheet h2 { margin: 0; font-size: clamp(25px, 7vw, 34px); line-height: 1.2; }
.progression-sheet > p:not(.eyebrow) { margin: 9px auto 17px; color: var(--color-muted-text); font-size: 14px; line-height: 1.5; }
.progression-sheet > .btn { width: 100%; min-height: 50px; margin-top: 9px; }
.progression-sheet > .text-button { min-height: 46px; margin-top: 8px; }
.creator-unlock-sheet { width: min(100%, 400px); }
.creator-unlock-sheet > img {
  display: block;
  width: 118px;
  height: 108px;
  margin: 0 auto 4px;
  object-fit: contain;
  filter: drop-shadow(0 6px 5px rgb(15 23 42 / 16%));
}
.level-celebration, .revive-avatar { font-size: 52px; line-height: 1; animation: celebration-bob 1s ease-in-out infinite alternate; }
.level-celebration { display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: #9a4e08; }
.level-celebration b { font-size: 18px; font-weight: 1000; letter-spacing: .06em; }
.level-complete-sheet { width: min(100%, 480px); padding: 20px 22px 18px; }
.level-complete-sheet .level-celebration { margin-bottom: 2px; }
.level-score-hero { display: grid; margin: 2px auto 0; place-items: center; }
.level-score-hero span { color: var(--color-muted-text); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.level-score-hero strong { color: #c35f00; font-size: clamp(58px, 14vw, 78px); font-weight: 1000; line-height: .92; }
.level-complete-sheet h2 { font-size: clamp(24px, 6.6vw, 32px); }
.level-complete-sheet > #level-complete-copy { margin: 5px auto 10px; }
.level-highlight {
  margin: 8px auto 3px !important;
  padding: 9px 12px;
  border-radius: 12px;
  color: #774000 !important;
  background: #fff0c8;
  font-size: 13px !important;
  font-weight: 900;
  line-height: 1.35 !important;
}
.level-voice-line {
  display: block;
  width: 100%;
  margin: 6px auto 2px !important;
  padding: 7px 10px;
  border: 1px solid #b8dfc4;
  border-radius: 10px;
  color: #0b6239 !important;
  background: #eff9f1;
  font-family: inherit;
  font-size: 12px !important;
  font-weight: 850;
  line-height: 1.35 !important;
  text-align: center;
  cursor: pointer;
}
.level-voice-line:active { transform: translateY(1px); background: #e0f4e5; }
.level-voice-line:focus-visible { outline: 3px solid #f1b73e; outline-offset: 2px; }
.level-reward-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 2px solid var(--color-border);
  border-radius: 17px;
  background: #fff;
}
.level-reward-grid div { display: grid; gap: 2px; padding: 11px 5px; }
.level-reward-grid div + div { border-left: 1px solid var(--color-border); }
.level-reward-grid strong { color: var(--color-primary-strong); font-size: 19px; }
.level-reward-grid span { color: var(--color-muted-text); font-size: 10px; font-weight: 800; }
.level-share-prompt { margin: 11px auto 3px !important; color: #8e4f08 !important; font-size: 12px !important; font-weight: 1000; }
.level-share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.level-share-actions .btn { min-height: 50px; padding: 9px 8px; font-size: 14px; }
.level-share-actions .share-launch > span, .btn-scorecard > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}
.btn-scorecard { display: flex; align-items: center; justify-content: center; gap: 7px; color: #fff; border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 5px 0 rgb(22 107 61 / 16%); }
.btn-scorecard:hover { background: var(--color-primary-strong); }
.level-complete-sheet > #next-level { min-height: 46px; margin-top: 8px; }
.level-life-note { margin: 5px auto 0 !important; color: var(--color-muted-text) !important; font-size: 11px !important; font-weight: 850; line-height: 1.2 !important; }
.defuse-feedback-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.defuse-feedback-actions .btn { min-height: 50px; margin-top: 0; }
.feedback-share-button,
.feedback-next-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.feedback-share-button > span:last-child,
.feedback-next-button > span:first-child { display: grid; gap: 1px; text-align: left; }
.feedback-share-button small,
.feedback-next-button small { color: currentColor; font-size: 9px; font-weight: 800; line-height: 1; opacity: .72; }
.feedback-action-icon { display: grid; width: 23px; height: 23px; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 1000; }
.feedback-next-button { justify-content: space-between; padding-inline: 14px; }
.feedback-next-button > span:last-child { font-size: 20px; font-weight: 900; line-height: 1; }
.defuse-feedback.is-error #share-single-quote,
.defuse-feedback.is-error #share-single-challenge { display: none; }
.defuse-feedback.is-error .defuse-feedback-actions { grid-template-columns: 1fr; }
.celebration-fireworks { position: fixed; z-index: 4; inset: 0; overflow: hidden; pointer-events: none; }
.celebration-piece {
  position: absolute;
  top: -7vh;
  left: var(--celebration-left);
  width: 9px;
  height: 22px;
  border-radius: 3px;
  background: var(--celebration-color);
  box-shadow: 0 0 10px rgb(255 255 255 / 48%);
  opacity: 0;
  transform: rotate(var(--celebration-rotate));
  animation: celebration-rain var(--celebration-duration) cubic-bezier(.18, .64, .38, 1) var(--celebration-delay) forwards;
}
.celebration-piece.is-spark { width: 16px; height: 16px; background: transparent; box-shadow: none; }
.celebration-piece.is-spark::before { color: var(--celebration-color); content: "✦"; font-size: 20px; font-weight: 1000; }
.revive-sheet { border-color: #a9362d; background: linear-gradient(145deg, #fffaf0, #ffe8e1); }

body.has-progression-menu { overflow: hidden; }

@keyframes progression-pop { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes celebration-bob { to { transform: translateY(-5px) rotate(4deg); } }
@keyframes celebration-rain {
  0% { opacity: 0; transform: translate3d(0, -8vh, 0) rotate(var(--celebration-rotate)) scale(.8); }
  8% { opacity: 1; }
  88% { opacity: .95; }
  100% { opacity: 0; transform: translate3d(var(--celebration-drift), 112vh, 0) rotate(calc(var(--celebration-rotate) + 580deg)) scale(1.08); }
}

.share-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  align-items: end;
  justify-items: center;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, .64);
}

.share-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: calc(100dvh - max(14px, env(safe-area-inset-top)));
  overflow-y: auto;
  padding: 10px 18px max(18px, env(safe-area-inset-bottom));
  border: 2px solid var(--color-foreground);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: var(--color-background);
  box-shadow: 0 -12px 38px rgba(15, 23, 42, .22);
  animation: sheet-in 260ms cubic-bezier(.16, 1, .3, 1) both;
}

.share-dialog-head { display: flex; min-height: 50px; margin: 0 0 9px; align-items: center; justify-content: space-between; }
.share-dialog-head .eyebrow { margin: 0 0 1px; font-size: 10px; }
.share-dialog-head h2 { margin: 0; font-size: 21px; }
.share-close { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 1.5px solid var(--color-border); border-radius: 50%; color: var(--color-muted-text); background: #fff; font-size: 25px; line-height: 1; }
.share-template-tabs { display: grid; margin-bottom: 10px; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-template-tab {
  position: relative;
  min-height: 59px;
  padding: 8px 9px 8px 42px;
  text-align: left;
  border: 1.5px solid var(--color-border);
  border-radius: 15px;
  color: var(--color-foreground);
  background: #fff;
}
.share-template-tab > b { position: absolute; left: 10px; top: 11px; display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: #fff; background: #77857f; font-size: 12px; }
.share-template-tab span, .share-template-tab small { display: block; }
.share-template-tab span { font-size: 12px; font-weight: 1000; line-height: 1.25; }
.share-template-tab small { margin-top: 3px; color: var(--color-muted-text); font-size: 9px; font-weight: 750; }
.share-template-tab.is-active { border-color: #d07a19; background: #fff7df; box-shadow: 0 3px 0 rgb(141 86 24 / 10%); }
.share-template-tab.is-active > b { background: #c35f00; }
.share-template-tab[data-template="relay"].is-active { border-color: var(--color-primary); background: #e7f6ed; }
.share-template-tab[data-template="relay"].is-active > b { background: var(--color-primary); }

.share-preview {
  position: relative;
  min-height: 245px;
  margin-bottom: 10px;
  padding: 13px;
  overflow: hidden;
  border: 2px solid #ef615a;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 18%, rgb(255 255 255 / 76%) 0 29px, transparent 30px),
    linear-gradient(145deg, #e8faf2, #fffdf6 58%, #fff0d5);
  box-shadow: 0 5px 0 rgb(141 86 24 / 9%);
}

.share-preview::after {
  position: absolute;
  right: 14px;
  bottom: 8px;
  color: #ef615a;
  content: "✦";
  font-size: 24px;
  animation: timer-spark-pop 820ms ease-in-out infinite alternate;
}

.share-preview-topline { display: flex; align-items: center; gap: 9px; color: var(--color-primary-strong); font-size: 12px; font-weight: 1000; }
.share-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid var(--color-foreground); border-radius: 14px; color: #fff; background: var(--color-primary); font-size: 13px; transform: rotate(-4deg); }
.share-avatar img { width: 46px; height: 44px; max-width: none; object-fit: contain; filter: drop-shadow(0 3px 3px rgb(15 23 42 / 18%)); }
.share-preview-kicker { margin: 9px 0 6px; color: #c2443d; font-size: 10px; font-weight: 1000; letter-spacing: .06em; }
.share-chat-bubble { width: 87%; margin: 5px 0; padding: 8px 11px; border: 1.5px solid #c9d8d1; border-radius: 12px; background: #fff; box-shadow: 0 3px 0 rgb(15 23 42 / 7%); }
.share-chat-bubble small, .share-chat-bubble strong { display: block; }
.share-chat-bubble small { color: var(--color-muted-text); font-size: 8px; font-weight: 850; }
.share-chat-bubble strong { margin-top: 2px; font-size: 13px; line-height: 1.28; }
.share-chat-bubble.is-answer { margin-left: auto; border-color: #48aa76; background: #dff7e7; }
.share-preview h2 { max-width: 92%; margin: 10px 0 0; font-size: clamp(21px, 6vw, 27px); line-height: 1.12; }
.share-preview > p:not(.share-preview-kicker) { max-width: 90%; margin: 4px 0 8px; color: var(--color-muted-text); font-size: 10px; line-height: 1.4; }
.share-link-chip { display: inline-flex; min-height: 32px; padding: 7px 11px; align-items: center; border: 1px solid #b8d9c8; border-radius: 999px; color: var(--color-primary-strong); background: rgb(255 255 255 / 76%); font-size: 11px; font-weight: 900; }
.share-relay-blank { display: grid; margin: 8px 0 10px; padding: 9px 11px; border: 2px dashed #d9a536; border-radius: 13px; background: #fff9df; }
.share-relay-blank b { color: #ad5a00; font-size: 9px; }
.share-relay-blank span { margin: 2px 0; color: var(--color-primary-strong); font-size: 21px; font-weight: 1000; }
.share-relay-blank small { color: var(--color-muted-text); font-size: 9px; }
.share-preview[data-template="relay"] { border-color: var(--color-primary); background: linear-gradient(145deg, #e1f4e9, #fff9e7); }
.share-preview[data-template="relay"]::after { color: #e4a328; }
.share-preview[data-template="certificate"] { border-color: #b58b29; background: linear-gradient(145deg, #fff7da, #fffdf8 55%, #e8f5ec); }
.share-preview[data-template="certificate"] .share-chat-bubble { display: none; }
.share-preview[data-template="certificate"] .share-preview-kicker { color: #8b6817; text-align: center; }
.share-preview[data-template="certificate"] h2 { max-width: 100%; margin-top: 24px; text-align: center; color: #77511a; font-size: 29px; }
.share-preview[data-template="certificate"] > p { max-width: 100% !important; text-align: center; }
.share-preview[data-template="certificate"] .share-link-chip { display: flex; width: fit-content; margin: 22px auto 0; border-color: #d7bc70; color: #76571b; background: #fff4c8; }
.share-certificate-row { display: flex; min-height: 48px; margin: 3px 0 7px; padding: 7px 9px; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #dbc587; border-radius: 13px; background: #fff9e5; }
.share-certificate-row > span { min-width: 0; }
.share-certificate-row b, .share-certificate-row small { display: block; }
.share-certificate-row b { color: #76571b; font-size: 11px; }
.share-certificate-row small { margin-top: 2px; color: #806f4a; font-size: 8px; }
.share-certificate-row button { min-height: 36px; flex: 0 0 auto; padding: 7px 10px; border: 1px solid #b58b29; border-radius: 10px; color: #76571b; background: #fff; font-size: 10px; font-weight: 900; }
.share-privacy { display: flex; min-height: 36px; margin-bottom: 7px; align-items: center; gap: 7px; color: var(--color-muted-text); font-size: 9px; font-weight: 750; }
.share-privacy input { width: 18px; height: 18px; accent-color: var(--color-primary); }

.share-actions { display: grid; gap: 7px; }
.share-channel {
  display: grid;
  min-height: 56px;
  padding: 8px 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  text-align: left;
}
.share-channel-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 2px solid currentColor; border-radius: 15px; font-size: 15px; font-weight: 1000; }
.share-channel strong, .share-channel small { display: block; }
.share-channel strong { font-size: 14px; line-height: 1.25; }
.share-channel small { margin-top: 3px; font-size: 10px; font-weight: 700; opacity: .78; }

body.has-share-sheet { overflow: hidden; }

/* v0.53 · 好友挑战：隐藏答案、直达题目、同题公平比较。 */
.app-shell[data-screen="challenge"] { padding: 0; }
.app-shell[data-screen="challenge"] > .brand-bar { display: none; }
.challenge-screen {
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 13% 16%, rgb(244 163 64 / 23%) 0 10px, transparent 11px),
    radial-gradient(circle at 89% 20%, rgb(63 174 111 / 17%) 0 14px, transparent 15px),
    linear-gradient(155deg, #fffaf0, #eff9f2 60%, #fff1ce);
}
.challenge-entry-view,
.challenge-result-view {
  display: flex;
  width: min(100%, 470px);
  min-height: calc(100dvh - max(36px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  margin: 0 auto;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.challenge-entry-view[hidden], .challenge-result-view[hidden] { display: none; }
.challenge-route-kicker {
  margin: 0 0 7px;
  color: #a75a09;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .12em;
}
.challenge-mascot,
.challenge-result-mascot { position: relative; width: 150px; height: 126px; margin-bottom: 4px; }
.challenge-mascot img,
.challenge-result-mascot img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 0 rgb(15 23 42 / 11%)); }
.challenge-mascot span,
.challenge-result-mascot span {
  position: absolute;
  right: -24px;
  bottom: 9px;
  padding: 5px 8px;
  border: 1.5px solid #aac9ba;
  border-radius: 10px;
  color: #4e655b;
  background: rgb(255 255 255 / 92%);
  font-size: 9px;
  font-weight: 900;
}
.challenge-entry-view h1,
.challenge-result-view h1 { margin: 7px auto 5px; font-size: clamp(28px, 8vw, 39px); line-height: 1.12; }
.challenge-entry-record,
.challenge-result-copy { margin: 3px auto 15px; color: var(--color-muted-text); font-size: 15px; font-weight: 750; line-height: 1.5; }
.challenge-secret-card {
  display: grid;
  width: 100%;
  margin: 4px 0 15px;
  padding: 17px;
  border: 3px solid #183e2b;
  border-radius: 24px;
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 8px 0 rgb(15 23 42 / 10%);
}
.challenge-secret-card small { color: #a55b0a; font-size: 11px; font-weight: 950; letter-spacing: .08em; }
.challenge-secret-card strong { margin: 2px 0; color: #0e6b43; font-size: clamp(58px, 19vw, 88px); font-weight: 1000; line-height: 1; letter-spacing: .06em; }
.challenge-secret-card span { color: var(--color-foreground); font-size: 18px; font-weight: 950; }
.challenge-entry-view > .btn { width: 100%; min-height: 60px; font-size: 19px; }
.challenge-entry-note { margin: 10px 0 0; color: var(--color-muted-text); font-size: 11px; }
.challenge-result-mascot[data-result="loss"] img { filter: grayscale(.15) drop-shadow(0 8px 0 rgb(15 23 42 / 11%)); transform: rotate(-3deg); }
.challenge-result-mascot[data-result="tie"] img { animation: suspicious-wiggle 1.8s ease-in-out infinite; }
.challenge-versus {
  display: grid;
  width: 100%;
  margin: 4px 0 10px;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
  overflow: hidden;
  border: 2px solid #bad7c8;
  border-radius: 22px;
  background: #fff;
}
.challenge-versus > div { display: grid; min-height: 112px; padding: 13px 7px; place-content: center; gap: 2px; }
.challenge-versus > div.is-me { background: #e7f6ed; }
.challenge-versus > b { color: #d26c13; font-size: 15px; }
.challenge-versus span { color: var(--color-muted-text); font-size: 10px; font-weight: 900; }
.challenge-versus strong { color: var(--color-foreground); font-size: 25px; font-weight: 1000; }
.challenge-versus small { color: #54675f; font-size: 11px; font-weight: 850; }
.challenge-chain-score { margin: 0 0 12px; color: #8b520d; font-size: 13px; font-weight: 1000; }
.challenge-result-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 8px; }
.challenge-result-actions .btn { min-height: 54px; padding-inline: 8px; font-size: 15px; }
.challenge-result-actions .text-button { min-height: 44px; font-size: 12px; }

.challenge-inbox-button {
  position: absolute;
  z-index: 6;
  top: 58px;
  right: 14px;
  display: flex;
  min-height: 44px;
  padding: 7px 9px;
  align-items: center;
  gap: 5px;
  border: 1.5px solid #b6d3c4;
  border-radius: 14px;
  color: #145d3b;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 4px 0 rgb(15 23 42 / 8%);
  font-size: 10px;
}
.challenge-inbox-button b { display: grid; min-width: 21px; height: 21px; padding: 0 5px; place-items: center; border-radius: 999px; color: #fff; background: #df5e43; }
.challenge-inbox-menu { position: fixed; z-index: 75; inset: 0; display: grid; align-items: end; justify-items: center; }
.challenge-inbox-menu[hidden] { display: none; }
.challenge-inbox-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(15 23 42 / 64%); }
.challenge-inbox-sheet { position: relative; z-index: 1; width: min(100%, 520px); max-height: 75dvh; overflow-y: auto; padding: 18px 18px max(20px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: #fffaf0; }
.challenge-inbox-sheet > header { display: flex; align-items: center; justify-content: space-between; }
.challenge-inbox-sheet h2 { margin: 2px 0 12px; font-size: 23px; }
.challenge-inbox-list { display: grid; gap: 8px; }
.challenge-inbox-item { display: grid; min-height: 60px; padding: 10px 12px; align-content: center; border: 1.5px solid #c7ddd2; border-radius: 15px; color: var(--color-foreground); background: #fff; text-decoration: none; }
.challenge-inbox-item strong, .challenge-inbox-item span { display: block; }
.challenge-inbox-item strong { font-size: 14px; }
.challenge-inbox-item span { margin-top: 3px; color: var(--color-muted-text); font-size: 11px; }
.challenge-inbox-note { margin: 12px 0 0; color: var(--color-muted-text); font-size: 10px; text-align: center; }
body.has-challenge-inbox { overflow: hidden; }

.app-shell[data-challenge-active="true"] #defuse-screen .score-chip,
.app-shell[data-challenge-active="true"] #defuse-screen .home-action { visibility: hidden; }
.app-shell[data-challenge-active="true"] #defuse-screen .mode-heading { grid-column: 2; }
.app-shell[data-challenge-active="true"] #defuse-screen .bomb-panel[data-onboarding-stage="challenge"] .timer-dial:not(.is-warning):not(.is-urgent) { border-color: #17704a; background: #eefaf3; }
.app-shell[data-challenge-active="true"] #defuse-screen .bomb-panel[data-onboarding-stage="challenge"] .timer-label { background: #17704a; }
.share-preview[data-template="relay"] .share-chat-bubble.is-question { width: 100%; text-align: center; }
.share-preview[data-template="relay"] .share-relay-blank small::after { content: " 同一道题、同一字池、同一时限。"; }

@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes photo-in { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: scale(1); } }
@keyframes dialogue-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes challenge-drop { from { opacity: 0; transform: translateY(-10px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes voice-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes suspicious-wiggle { 0%, 14%, 100% { transform: rotate(0); } 4% { transform: rotate(-2deg); } 8% { transform: rotate(2deg); } }
@keyframes serious-pop { 0%, 22%, 100% { transform: scale(1); } 12% { transform: scale(1.045); } }
@keyframes arrow-nudge { 0%, 100% { transform: translateX(0); opacity: .65; } 14% { transform: translateX(4px); opacity: 1; } }
@keyframes live-camera-left { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.085) translate3d(-1.5%, -1%, 0); } }
@keyframes live-camera-right { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.08) translate3d(1.5%, -1%, 0); } }
@keyframes live-bubble-pop { 0%, 14%, 100% { transform: translateY(0) scale(1); } 6% { transform: translateY(-3px) scale(1.035); } }
@keyframes live-arrow-bounce { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-47%, -50%) scale(1.02); } }
@keyframes mascot-composed-float { 0%, 100% { transform: translate(-50%, -46%) rotate(-1deg); } 50% { transform: translate(-50%, -51%) rotate(1deg); } }
@keyframes mascot-mind-race { from { transform: rotate(-2deg) scale(.98); } to { transform: rotate(2deg) scale(1.025); } }
@keyframes alien-core-think { from { transform: scale(.86) rotate(-8deg); filter: brightness(.95); } to { transform: scale(1.08) rotate(10deg); filter: brightness(1.18); } }
@media (max-width: 374px) {
  .app-shell { padding-inline: 14px; }
  .hero-demo { min-height: 150px; margin-top: 12px; padding: 24px 10px; grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); }
  .live-hero { height: 218px; margin-top: 12px; }
  .live-bubble { top: 17px; min-width: 64px; padding: 6px 7px; font-size: 10px; }
  .live-answer { bottom: 12px; font-size: 20px; }
  .live-abbr { left: 9px; }
  .live-serious { right: 8px; }
  .live-arrow { width: 32px; height: 32px; font-size: 25px; }
  .demo-arrow { width: 32px; }
  .demo-card { min-height: 96px; padding-inline: 5px; }
  .demo-card strong { font-size: 19px; }
  h1 { font-size: 29px; }
  .initials { min-height: 96px; font-size: 52px; }
  .meter { padding: 8px 6px; }
  .mode-card {
    grid-template-columns: minmax(112px, 40%) minmax(0, 1fr);
    min-height: 116px;
    padding: 0 32px 0 0;
    column-gap: 10px;
  }
  .mode-card::after { right: 10px; font-size: 28px; }
  .mode-photo { width: 100%; height: 100%; min-height: 112px; margin: 0; }
  .mode-icon { width: 34px; height: 34px; }
  .mode-speech { right: 4px; padding: 4px 6px; font-size: 8px; }
  .mode-title { font-size: 17px; }
  .mode-hook { font-size: 12px; }
  .mode-card .btn-meta { font-size: 10px; }
  .answer-button { grid-template-columns: 68px minmax(0, 1fr); min-height: 88px; }
  .answer-button.is-right { grid-template-columns: minmax(0, 1fr) 68px; }
  .person-portrait { width: 62px; height: 74px; }
  .speech-bubble { min-height: 66px; padding: 9px 10px; }
  .option-text { font-size: 15px; }
  .resume-card { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100dvh - 48px); border: 2px solid var(--color-border); border-radius: 28px; background: var(--color-background); }
  .scene-line { font-size: 17px; }
  .scene-visual figcaption strong { font-size: 17px; }
  .scene-visual figcaption span { font-size: 14px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hero-demo { min-height: 126px; margin: 0 auto 12px; padding-block: 16px; }
  .live-hero { height: 180px; margin: 0 auto 12px; }
  .live-bubble { top: 32px; }
  .demo-card { min-height: 90px; }
  h1 { font-size: 34px; }
  .mode-stack { margin-block: 16px; }
  .question-card { display: grid; grid-template-columns: 130px 1fr; column-gap: 16px; align-items: center; }
  .scene-line { grid-column: 1 / -1; }
  .initials { grid-row: 2 / 4; min-height: 110px; margin-bottom: 0; }
  .question-card h2, .thinking-hint { text-align: left; }
}

/* Phone gameplay uses the visible viewport as a fixed game canvas. */
@media (max-width: 767px) {
  .progression-menu { align-items: center; padding: 8px; }
  .progression-sheet {
    width: 100%;
    max-height: calc(100dvh - 10px);
    overflow-y: auto;
    padding: 16px 14px max(14px, env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 28px rgb(15 23 42 / 22%);
  }
  .level-celebration, .revive-avatar { font-size: 40px; }
  .progression-sheet h2 { font-size: 25px; }
  .progression-sheet > p:not(.eyebrow) { margin: 6px auto 10px; font-size: 12px; }
  .level-reward-grid div { padding: 8px 4px; }
  .progression-sheet > .btn { min-height: 46px; margin-top: 7px; }
  .progression-sheet > .text-button { min-height: 44px; margin-top: 3px; }
  .creator-unlock-sheet {
    width: min(calc(100% - 20px), 390px);
    max-height: calc(100dvh - 24px);
    padding: 16px 16px 12px;
    overflow: hidden;
    border: 2px solid #183e2b;
    border-radius: 22px;
    box-shadow: 0 10px 28px rgb(15 23 42 / 24%);
  }
  .creator-unlock-sheet > img { width: 86px; height: 79px; margin-bottom: 2px; }
  .creator-unlock-sheet .eyebrow { margin-bottom: 3px; font-size: 11px; }
  .creator-unlock-sheet h2 { font-size: clamp(23px, 6.8vw, 27px); line-height: 1.18; }
  .creator-unlock-sheet > p:not(.eyebrow) { margin: 5px auto 8px; font-size: 12px; line-height: 1.35; }
  .creator-unlock-sheet > .btn { min-height: 50px; margin-top: 4px; }
  .creator-unlock-sheet > .text-button { min-height: 36px; margin-top: 1px; }
  .level-complete-sheet {
    display: flex;
    max-height: calc(100dvh - 8px);
    padding: 10px 12px max(9px, env(safe-area-inset-bottom));
    flex-direction: column;
    overflow: hidden;
  }
  .level-complete-sheet .level-celebration { font-size: 30px; }
  .level-complete-sheet .level-celebration b { font-size: 15px; }
  .level-complete-sheet .eyebrow { margin-bottom: 2px; font-size: 11px; }
  .level-score-hero strong { font-size: clamp(48px, 16vw, 65px); }
  .level-complete-sheet h2 { font-size: clamp(21px, 6.4vw, 27px); }
  .level-complete-sheet > #level-complete-copy { margin: 3px auto 7px; font-size: 10px; line-height: 1.25; }
  .level-complete-sheet .level-voice-line { margin: 4px auto 1px !important; padding: 5px 8px; font-size: 10px !important; }
  .level-reward-grid div { padding: 6px 3px; }
  .level-reward-grid strong { font-size: 16px; }
  .level-reward-grid span { font-size: 9px; }
  .level-share-prompt { margin: 7px auto 3px !important; font-size: 10px !important; }
  .level-share-actions { flex: 0 0 auto; gap: 6px; }
  .level-share-actions .btn { min-height: 50px; padding: 7px 5px; flex-shrink: 0; font-size: 12px; }
  .level-share-actions .share-launch > span, .btn-scorecard > span { width: 23px; height: 23px; font-size: 10px; }
  .level-complete-sheet > #next-level { min-height: 50px; margin-top: 6px; padding-block: 7px; flex-shrink: 0; font-size: 12px; }
  .level-life-note { margin-top: 4px !important; font-size: 9px !important; }

  .app-shell[data-screen="creator"] {
    width: 100%;
    min-height: 100dvh;
    padding: max(7px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  }
  .app-shell[data-screen="creator"] .brand-bar { min-height: 46px; margin-bottom: 7px; }
  .app-shell[data-screen="creator"] .brand-mark { width: 42px; height: 42px; }
  .app-shell[data-screen="creator"] .brand-name { font-size: 14px; }
  .app-shell[data-screen="creator"] .build-tag { font-size: 10px; }
  .app-shell[data-screen="creator"] .sound-toggle { min-height: 42px; padding: 6px 9px; }
  #creator-screen .creator-topbar { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; margin: 0 0 10px; }
  #creator-screen .creator-back { width: 42px; height: 42px; font-size: 26px; }
  #creator-screen .creator-topbar h1 { font-size: clamp(24px, 7vw, 29px); }
  #creator-screen .creator-limit { padding: 6px 8px; font-size: 10px; }
  #creator-screen .creator-progress { margin-bottom: 10px; }
  #creator-screen .creator-progress span { width: 29px; height: 29px; font-size: 12px; }
  #creator-screen .creator-form { padding: 13px; border-radius: 16px; }
  #creator-screen .creator-step h2 { margin-bottom: 12px; font-size: clamp(20px, 6vw, 25px); }
  #creator-screen .creator-field input { min-height: 48px; font-size: 16px; }
  #creator-screen .creator-field-help, #creator-screen .creator-live-check { margin-top: 7px; font-size: 11px; }
  #creator-screen .creator-live-check { padding: 7px 8px; }
  #creator-screen .creator-form-actions { margin-top: 12px; }
  #creator-screen .creator-form-actions .btn { min-height: 50px; }
  #creator-screen .creator-drafts { margin-top: 10px; padding-top: 10px; }
  #creator-screen .creator-drafts h2 { font-size: 18px; }

  .app-shell[data-screen="home"] {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    min-height: 100svh;
    padding: max(6px, env(safe-area-inset-top)) 10px max(7px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  /* 常规首页内容会随版本增加；使用自然页面流，不能再用固定六行网格压叠到底部。 */
  .app-shell[data-screen="home"][data-home-entry="returning"] {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .app-shell[data-screen="home"][data-home-entry="returning"] #main {
    display: block;
    flex: 0 0 auto;
    min-height: auto;
  }

  .app-shell[data-screen="home"][data-home-entry="returning"] #home-screen.is-active {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto auto auto auto auto;
    gap: 9px;
    align-content: start;
    padding-bottom: 4px;
  }

  .app-shell[data-screen="home"][data-home-entry="returning"] #home-screen .live-hero {
    height: clamp(168px, 48vw, 220px);
  }

  .app-shell[data-screen="home"][data-home-entry="returning"] #home-screen .mode-stack {
    height: auto;
    grid-template-rows: 86px 46px;
  }

  .app-shell[data-screen="result"] {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    min-height: 100svh;
    padding: max(6px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .app-shell[data-screen="result"] .brand-bar {
    flex: 0 0 46px;
    min-height: 46px;
    margin-bottom: 5px;
    gap: 8px;
  }

  .app-shell[data-screen="result"] .brand-mark { width: 40px; height: 40px; }
  .app-shell[data-screen="result"] .brand-name { font-size: 14px; }
  .app-shell[data-screen="result"] .build-tag { font-size: 10px; }
  .app-shell[data-screen="result"] .sound-toggle { min-width: 72px; min-height: 44px; padding: 6px 8px; }
  .app-shell[data-screen="result"] .sound-panel { width: min(310px, calc(100vw - 20px)); }
  .app-shell[data-screen="result"] #main { display: flex; flex: 1 1 auto; min-height: 0; }

  #result-screen.is-active {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-rows: 48px auto auto auto 66px auto auto minmax(140px, 1fr);
    align-items: center;
    gap: 4px;
    overflow: hidden;
  }

  #result-screen .result-avatar {
    width: 66px;
    height: 58px;
    margin: 0 auto;
    border: 0;
    box-shadow: none;
  }
  #result-screen .result-avatar::before { top: -12px; right: 8px; width: 17px; height: 12px; border-top-width: 3px; }
  #result-screen .result-avatar-eye { top: 16px; width: 5px; height: 7px; }
  #result-screen .result-avatar .eye-left { left: 15px; }
  #result-screen .result-avatar .eye-right { right: 15px; }
  #result-screen .result-avatar-cheek { top: 25px; width: 8px; height: 4px; }
  #result-screen .result-avatar .cheek-left { left: 8px; }
  #result-screen .result-avatar .cheek-right { right: 8px; }
  #result-screen .result-avatar-mouth { bottom: 8px; width: 18px; height: 8px; border-bottom-width: 3px; }
  #result-screen .result-avatar-spark { top: -16px; right: -7px; font-size: 16px; }
  #result-screen .eyebrow { font-size: 11px; text-align: center; }
  #result-screen #result-title { margin: 0; font-size: clamp(28px, 9vw, 38px); line-height: 1.04; text-align: center; }
  #result-screen .result-summary {
    display: -webkit-box;
    max-width: 340px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  #result-screen .result-score { height: 66px; margin: 0; align-content: center; }
  #result-screen .result-score strong { font-size: 48px; }
  #result-screen .result-score span { margin-top: 1px; font-size: 10px; }
  #result-screen blockquote {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 46px;
    margin: 0;
    padding: 8px 10px;
    align-items: center;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
  }
  #result-screen .story-route { width: 100%; margin: 0; padding: 7px 8px; border-radius: 12px; }
  #result-screen .story-route > span { margin-bottom: 2px; font-size: 9px; }
  #result-screen .story-route > p { font-size: 9px; line-height: 1.25; }
  #result-screen .result-actions { width: 100%; align-self: end; gap: 4px; }
  #result-screen .result-actions .btn,
  #result-screen .result-actions .text-button { min-height: 44px; padding-block: 8px; font-size: 12px; }
  #result-screen .share-launch > span { width: 22px; height: 22px; font-size: 13px; }

  .app-shell[data-screen="home"] .brand-bar {
    flex: 0 0 46px;
    min-height: 46px;
    margin-bottom: 5px;
    gap: 8px;
  }

  .app-shell[data-screen="home"] .brand-mark {
    width: 40px;
    height: 40px;
  }

  .app-shell[data-screen="home"] .brand-name { font-size: 14px; }
  .app-shell[data-screen="home"] .build-tag { font-size: 10px; }

  .app-shell[data-screen="home"] .sound-toggle {
    min-width: 72px;
    min-height: 44px;
    padding: 6px 8px;
  }

  .app-shell[data-screen="home"] .sound-panel {
    width: min(310px, calc(100vw - 20px));
  }

  .app-shell[data-screen="home"] #main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }

  #home-screen.is-active {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(126px, .78fr) auto auto 140px 48px auto;
    gap: 5px;
  }

  #home-screen .live-hero {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    border-radius: 18px;
  }

  #home-screen .live-bubble {
    top: 34px;
    min-width: 64px;
    padding: 5px 8px;
    font-size: 9px;
  }

  #home-screen .live-answer {
    bottom: 9px;
    font-size: clamp(19px, 7vw, 28px);
  }

  #home-screen .live-arrow {
    width: 32px;
    height: 32px;
    font-size: 25px;
  }

  #home-title {
    min-height: 70px;
    margin: 0 auto;
    display: grid;
    align-content: center;
    font-size: clamp(23px, 6.8vw, 30px);
    line-height: 1.12;
  }

  #home-screen .hero-copy {
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.25;
  }

  #home-screen .mode-stack {
    height: 100%;
    min-height: 0;
    margin: 0;
    grid-template-rows: 86px 46px;
    gap: 8px;
  }

  .app-shell[data-screen="home"][data-home-entry="first"] {
    height: 100dvh;
    min-height: 100svh;
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  }

  .app-shell[data-screen="home"][data-home-entry="first"] #home-screen.is-active {
    display: flex;
    height: 100%;
  }

  .first-visit-home {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0 0 max(4px, env(safe-area-inset-bottom));
    gap: clamp(7px, 1.45dvh, 12px);
  }

  #home-screen .first-visit-live-hero { height: clamp(205px, 34dvh, 286px); margin-bottom: 1px; }
  .first-visit-headline { font-size: clamp(28px, 8vw, 34px); line-height: 1.17; letter-spacing: .015em; }
  .first-visit-copy { font-size: 12px; }
  .first-visit-hook { margin-top: 2px; font-size: clamp(16px, 4.7vw, 19px); }
  .first-visit-start { min-height: 60px; }
  .first-visit-note { margin-top: 12px; font-size: 11px; transform: translateY(5px); }

  #home-screen .btn.mode-card {
    height: 100%;
    min-height: 0;
    padding-right: 31px;
    grid-template-columns: minmax(120px, 43%) minmax(0, 1fr);
    column-gap: 9px;
    row-gap: 1px;
    border-radius: 14px;
    box-shadow: 0 3px 0 rgba(15, 23, 42, .07);
  }

  #home-screen .mode-card::after {
    right: 9px;
    font-size: 27px;
  }

  #home-screen .mode-photo { min-height: 0; }
  #home-screen .mode-icon { bottom: 5px; left: 5px; width: 31px; height: 31px; border-radius: 9px; }
  #home-screen .mode-icon svg { width: 19px; height: 19px; }
  #home-screen .mode-speech { top: 5px; right: 4px; padding: 3px 5px; font-size: 7px; }
  #home-screen .mode-title { font-size: 20px; }
  #home-screen .mode-hook { font-size: 12px; }
  #home-screen .mode-card .btn-meta { font-size: 10px; }

  #home-screen #start-defuse {
    display: grid;
    min-height: 86px;
    padding: 10px 16px 10px 58px;
    border-radius: 17px;
  }
  #home-screen #start-defuse .defuse-cta-mascot { top: 7px; left: 11px; width: 39px; height: 39px; }
  #home-screen #start-defuse .mode-title { grid-column: 1; justify-self: start; font-size: clamp(20px, 6.3vw, 25px); text-align: left; }
  #home-screen #start-defuse .mode-cta {
    min-height: 0;
    padding: 0;
    font-size: clamp(19px, 5.7vw, 23px);
  }

  #home-screen .secondary-mode-row {
    display: grid;
    min-height: 46px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #home-screen .secondary-mode-row .creator-home-entry {
    min-height: 46px;
    padding: 4px 10px;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    border-radius: 12px;
    box-shadow: 0 2px 0 rgb(22 102 58 / 14%);
  }
  #home-screen .secondary-mode-row .creator-home-entry strong { font-size: 15px; line-height: 1; }
  #home-screen .secondary-mode-row .btn.mode-card {
    min-height: 46px;
    padding: 4px 10px;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 12px;
    box-shadow: 0 2px 0 rgba(15, 23, 42, .07);
  }
  #home-screen .secondary-mode-row .mode-photo,
  #home-screen .secondary-mode-row .mode-hook,
  #home-screen .secondary-mode-row .btn-meta { display: none; }
  #home-screen .secondary-mode-row .mode-title { grid-column: 1; justify-self: center; font-size: 15px; text-align: center; }
  #home-screen .secondary-mode-row .mode-card::after { display: none; }
  #home-screen .first-visit-story-entry { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; margin: -7px auto -5px; border: 0; color: #176a3d; background: transparent; font-size: 11px; font-weight: 850; }
  #home-screen .first-visit-story-entry b { font-size: 18px; line-height: 1; }

  #home-screen .local-stats { min-height: 48px; }
  #home-screen .local-stats div { min-height: 44px; padding: 3px; gap: 0; }
  #home-screen .local-stats strong { font-size: 18px; }
  #home-screen .local-stats span { font-size: 9px; }
  #home-screen #home-title-record { max-width: 150px; font-size: 12px; }

  #home-screen .privacy-note {
    margin: 0;
    font-size: 9px;
    line-height: 1.1;
  }

  .app-shell[data-screen="game"],
  .app-shell[data-screen="defuse"] {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    min-height: 100svh;
    padding: max(6px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .app-shell[data-screen="game"] .brand-bar,
  .app-shell[data-screen="defuse"] .brand-bar {
    position: absolute;
    top: max(6px, env(safe-area-inset-top));
    right: 60px;
    z-index: 50;
    display: block;
    width: 44px;
    min-height: 44px;
    margin: 0;
  }

  .app-shell[data-screen="game"] .brand-mark,
  .app-shell[data-screen="defuse"] .brand-mark,
  .app-shell[data-screen="game"] .brand-bar > div:nth-child(2),
  .app-shell[data-screen="defuse"] .brand-bar > div:nth-child(2) { display: none; }

  .app-shell[data-screen="game"] .sound-control,
  .app-shell[data-screen="defuse"] .sound-control { margin: 0; }

  .app-shell[data-screen="game"] .sound-toggle,
  .app-shell[data-screen="defuse"] .sound-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    gap: 0;
    border-radius: 15px;
  }

  .app-shell[data-screen="game"] .sound-toggle #sound-label,
  .app-shell[data-screen="defuse"] .sound-toggle #sound-label,
  .app-shell[data-screen="game"] .sound-chevron,
  .app-shell[data-screen="defuse"] .sound-chevron { display: none; }

  .app-shell[data-screen="game"] .sound-panel,
  .app-shell[data-screen="defuse"] .sound-panel {
    right: -54px;
    width: min(310px, calc(100vw - 20px));
  }

  .app-shell[data-screen="game"] #main,
  .app-shell[data-screen="defuse"] #main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }

  .app-shell[data-screen="game"] .game-topbar,
  .app-shell[data-screen="defuse"] .game-topbar {
    min-height: 44px;
    margin: 0;
    grid-template-columns: 44px 1fr 44px;
    gap: 6px;
  }

  .app-shell[data-screen="game"] .score-chip,
  .app-shell[data-screen="defuse"] .score-chip,
  .app-shell[data-screen="game"] .home-action,
  .app-shell[data-screen="defuse"] .home-action {
    width: 44px;
    height: 44px;
  }

  .app-shell[data-screen="game"] .home-action,
  .app-shell[data-screen="defuse"] .home-action { grid-template-rows: 21px 10px; }
  .app-shell[data-screen="game"] .home-action svg,
  .app-shell[data-screen="defuse"] .home-action svg { width: 20px; height: 20px; }
  .app-shell[data-screen="game"] .mode-heading p:first-child,
  .app-shell[data-screen="defuse"] .mode-heading p:first-child { font-size: 15px; }
  .app-shell[data-screen="game"] .mode-heading p:last-child,
  .app-shell[data-screen="defuse"] .mode-heading p:last-child { font-size: 11px; }

  #defuse-screen .mode-heading {
    display: grid;
    justify-items: center;
    gap: 2px;
  }
  #defuse-screen #defuse-round-label {
    display: inline-flex;
    width: min(100%, 228px);
    min-height: 24px;
    margin-top: 0;
    padding: 3px 10px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(16 75 42 / 10%);
    border-radius: 999px;
    color: #53645b;
    background: rgb(236 247 240 / 76%);
    font-size: clamp(13px, 3.7vw, 14px);
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
  }
  #defuse-screen #defuse-lives { margin-left: 8px; font-size: 15px; }

  .app-shell[data-screen="game"] .progress-track,
  .app-shell[data-screen="defuse"] .progress-track {
    height: 10px;
    margin: 0;
    border: 1px solid rgb(16 75 42 / 12%);
  }

  #game-screen.is-active {
    display: grid;
    flex: 1 1 auto;
    height: calc(100dvh - max(6px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
    min-height: 0;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto minmax(132px, .9fr) minmax(0, 1.35fr);
    gap: 6px 8px;
    align-content: stretch;
  }

  #game-screen .game-topbar,
  #game-screen > .progress-track,
  #game-screen .meter-grid,
  #game-screen .dialogue-stage,
  #game-screen .reaction-panel { grid-column: 1 / -1; }


  #game-screen .scene-visual {
    min-height: 0;
    height: 100%;
    margin: 0;
    border-width: 1.5px;
    border-radius: 16px;
  }
  #game-screen .scene-art { height: 62%; aspect-ratio: auto; border-bottom-width: 1.5px; }
  #game-screen .scene-photo-badge { top: 6px; left: 6px; min-height: 22px; padding: 3px 6px; font-size: 8px; }
  #game-screen .story-mascot { top: 5px; right: 4px; width: 48px; }
  #game-screen .story-mascot img { width: 45px; height: 41px; }
  #game-screen .story-mascot span { margin-top: -5px; padding: 1px 4px; font-size: 6px; }
  #game-screen .scene-visual figcaption { gap: 1px; padding: 6px 8px; }
  #game-screen .scene-visual figcaption strong { font-size: 12px; line-height: 1.2; }
  #game-screen .scene-visual figcaption span {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #game-screen .question-card {
    display: grid;
    min-height: 0;
    height: 100%;
    padding: 8px;
    align-content: center;
    border-width: 1.5px;
    border-radius: 16px;
  }
  #game-screen .scene-line { gap: 5px; font-size: 10px; line-height: 1.2; }
  #game-screen .speaker-dot { width: 7px; height: 7px; }
  #game-screen .initials {
    min-height: 56px;
    margin: 5px 0;
    border-width: 1.5px;
    border-radius: 12px;
    font-size: clamp(32px, 11vw, 44px);
  }
  #game-screen .question-card h2 { font-size: 12px; line-height: 1.25; }
  #game-screen .thinking-hint { margin-top: 3px; font-size: 9px; line-height: 1.2; }

  #game-screen .dialogue-stage {
    min-height: 0;
    margin: 0;
    padding: 6px;
    overflow: hidden;
    border-width: 1.5px;
    border-radius: 16px;
  }
  #game-screen .dialogue-stage-heading { min-height: 22px; padding: 0 3px 4px; }
  #game-screen .answer-lead { font-size: 10px; }
  #game-screen .answer-list {
    height: calc(100% - 22px);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  #game-screen .answer-button,
  #game-screen .answer-button.is-right {
    min-height: 0;
    height: 100%;
    padding: 0 2px;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
  }
  #game-screen .answer-button.is-right { grid-template-columns: minmax(0, 1fr) 54px; }
  #game-screen .person-portrait { width: 48px; height: 54px; border-width: 2px; border-radius: 16px 16px 9px 9px; }
  #game-screen .person-identity { bottom: 1px; min-width: 38px; padding: 1px 4px; font-size: 8px; }
  #game-screen .speech-bubble {
    min-height: 50px;
    margin-left: 3px;
    padding: 6px 8px;
    grid-template-columns: 24px minmax(0, 1fr);
    border-width: 1.5px;
    border-radius: 13px 13px 13px 6px;
  }
  #game-screen .is-right .speech-bubble { margin-right: 3px; border-radius: 13px 13px 6px 13px; }
  #game-screen .speech-bubble::before { left: -7px; top: 16px; width: 12px; height: 12px; border-width: 1.5px; }
  #game-screen .is-right .speech-bubble::before { right: -7px; left: auto; border-width: 1.5px; }
  #game-screen .option-key { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
  #game-screen .bubble-copy { gap: 1px; padding-left: 4px; }
  #game-screen .speaker-style { font-size: 8px; }
  #game-screen .option-text { font-size: 13px; line-height: 1.18; }
  #game-screen .voice-cue { font-size: 7px; }
  #game-screen .voice-cue svg { width: 10px; height: 10px; }

  #game-screen:has(#reaction-panel:not([hidden])) .dialogue-stage { display: none; }
  #game-screen .reaction-panel { min-height: 0; margin: 0; padding: 12px; align-self: stretch; }
  #game-screen .reaction-line { margin-top: 7px; font-size: 15px; line-height: 1.4; }
  #game-screen .reaction-comment { margin-top: 4px; font-size: 11px; line-height: 1.35; }
  #game-screen .next-button { min-height: 44px; margin-top: 8px; }

  #defuse-screen.is-active {
    display: grid;
    flex: 1 1 auto;
    width: 100%;
    height: calc(100dvh - max(6px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
    min-height: 0;
    grid-template-rows: auto auto auto clamp(300px, 36dvh, 310px) auto auto auto;
    gap: 5px;
    align-content: start;
  }

  #defuse-screen .mission-brief {
    min-width: 0;
    min-height: 60px;
    margin: 0 0 4px;
    padding: 7px 8px 7px 6px;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
    column-gap: 7px;
    border-width: 2px;
    border-radius: 13px;
    box-shadow: 0 3px 0 rgb(188 128 41 / 10%);
  }
  #defuse-screen .mission-voice-mark {
    width: 30px;
    height: 30px;
    border-width: 1.5px;
    border-radius: 10px;
    box-shadow: 0 2px 0 rgb(188 128 41 / 10%);
  }
  #defuse-screen .mission-voice-mark svg { width: 17px; height: 17px; }
  #defuse-screen .mission-index { padding: 3px 7px; font-size: clamp(16px, 4.4vw, 18px); line-height: 1.05; }
  #defuse-screen .mission-copy {
    display: grid;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    justify-self: stretch;
    justify-items: start;
    gap: 4px;
    font-size: clamp(16px, 4.4vw, 18px);
    line-height: 1.15;
    text-align: left;
    white-space: normal;
  }
  #defuse-screen .mission-scene-line { min-height: 24px; justify-content: flex-start; }
  #defuse-screen .mission-scene-label { font-size: clamp(16px, 4.4vw, 18px); }
  #defuse-screen #defuse-briefing { display: block; color: #5f6b65; font-size: clamp(16px, 4.4vw, 18px); line-height: 1.2; overflow-wrap: anywhere; }

  #defuse-screen .mission-balance { display: none; }

  #defuse-screen .bomb-rack-card {
    margin: 0;
    padding: 3px 5px 4px;
    border-width: 1.5px;
    border-radius: 13px;
    box-shadow: 0 2px 0 rgb(188 128 41 / 9%);
  }
  #defuse-screen .rack-heading { min-height: 14px; }
  #defuse-screen .rack-heading strong { font-size: 9px; }
  #defuse-screen .rack-heading span { font-size: 7px; }
  #defuse-screen .bomb-rack { gap: 3px; margin-top: 2px; }
  #defuse-screen .rack-item { min-height: 32px; padding: 2px 1px 1px; border-width: 1.5px; border-radius: 8px; box-shadow: none; }
  #defuse-screen .rack-bomb { width: 21px; height: 18px; border-width: 1.5px; box-shadow: 0 2px 0 rgb(15 23 42 / 8%); }
  #defuse-screen .rack-bomb::before { top: -6px; width: 8px; height: 6px; border-top-width: 1.5px; }
  #defuse-screen .rack-bomb::after { font-size: 8px; }
  #defuse-screen .rack-number { top: -5px; left: -5px; width: 13px; height: 13px; border-width: 1.5px; font-size: 7px; }
  #defuse-screen .rack-label { margin-top: 1px; font-size: 7px; line-height: 1; }

  #defuse-screen .bomb-panel {
    display: grid;
    min-height: 0;
    height: 100%;
    padding: 6px 7px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "fuse" "timer" "visual" "instruction";
    align-items: start;
    gap: 3px 4px;
    border-width: 2px;
    border-radius: 19px;
    box-shadow: 0 4px 0 rgb(93 73 58 / 12%), inset 0 -3px 0 rgb(205 142 45 / 7%);
  }
  #defuse-screen .bomb-panel[data-onboarding-stage="instant"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "visual" "instruction";
  }
  #defuse-screen .bomb-panel[data-onboarding-stage="instant"] .bomb-visual {
    width: clamp(305px, 88vw, 340px);
  }
  #defuse-screen .bomb-panel[data-onboarding-stage="instant"] .bomb-instruction { font-size: 0; }
  #defuse-screen .bomb-panel[data-onboarding-stage="instant"] .bomb-instruction::before { font-size: 11px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) {
    grid-template-columns: 66px minmax(0, 1fr) 66px;
    grid-template-rows: auto auto minmax(10px, 1fr) auto auto;
    grid-template-areas: "fuse fuse fuse" "timer visual ." ". . ." "instruction instruction instruction" "ready ready ready";
    align-items: start;
  }
  #defuse-screen .ready-overlay {
    right: 7px;
    bottom: 7px;
    left: 7px;
    min-height: 66px;
    padding: 7px 8px 7px 10px;
    gap: 0 7px;
    border-width: 1.5px;
    border-radius: 14px;
    box-shadow: 0 4px 0 rgb(128 75 10 / 14%);
  }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .ready-overlay {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 78px;
    padding: 9px 10px 9px 12px;
    grid-area: ready;
    grid-template-columns: minmax(0, 1fr) minmax(132px, 42%);
    gap: 1px 9px;
    align-self: end;
  }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .ready-eyebrow { font-size: 9px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .ready-overlay strong { font-size: 13px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .ready-overlay > span:last-of-type { font-size: 8.5px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .ready-overlay .btn {
    min-width: 132px;
    min-height: 50px;
    padding: 9px 10px;
    border-radius: 14px;
    font-size: 12.5px;
  }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .bomb-instruction {
    display: block;
    margin-bottom: 2px;
    align-self: end;
    opacity: .76;
  }
  #defuse-screen .ready-overlay .ready-eyebrow { font-size: 8px; }
  #defuse-screen .ready-overlay strong { font-size: 12px; }
  #defuse-screen .ready-overlay > span:last-of-type { font-size: 8px; }
  #defuse-screen .ready-overlay .btn { min-width: 118px; min-height: 44px; padding: 7px 9px; font-size: 11px; }
  #defuse-screen .fuse-line { height: 14px; padding: 1px; grid-area: fuse; border-width: 1.5px; box-shadow: none; }
  #defuse-screen .bomb-visual { width: clamp(285px, 82vw, 315px); max-width: none; min-height: 0; margin: 0; grid-area: visual; justify-self: center; align-self: center; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .bomb-visual { width: clamp(188px, 52vw, 196px); margin-top: 9px; align-self: start; }
  #defuse-screen .bomb-code { min-width: 122px; gap: 0; padding: 4px 9px 7px; border-width: 1.5px; border-radius: 16px; box-shadow: 0 3px 0 var(--focus-shadow); }
  #defuse-screen .bomb-code-label { font-size: 8px; }
  #defuse-screen .bomb-code strong { font-size: clamp(34px, 10.5vw, 44px); }
  #defuse-screen .alien-brain-core { top: 17%; width: 48px; height: 28px; border-width: 1.5px; }
  #defuse-screen .alien-brain-core::before,
  #defuse-screen .alien-brain-core::after { top: -8px; width: 6px; height: 6px; border-width: 1.5px; }
  #defuse-screen .alien-brain-core i { width: 17px; height: 17px; }
  #defuse-screen .bomb-mood-bubble {
    top: auto;
    right: 3px;
    bottom: 5px;
    max-width: 84px;
    padding: 4px 6px;
    border-width: 1.5px;
    border-radius: 9px 9px 3px 9px;
    font-size: 7.5px;
  }
  #defuse-screen .timer-dial {
    position: relative;
    top: auto;
    left: auto;
    width: 132px;
    min-height: 64px;
    margin: 0;
    padding: 6px 7px 6px 10px;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-rows: auto minmax(30px, 1fr);
    column-gap: 3px;
    border-width: 2px;
    border-radius: 14px;
    box-shadow: 0 4px 0 var(--alert-shadow);
  }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .timer-dial {
    width: 62px;
    min-height: 78px;
    margin-top: 14px;
    padding: 6px 5px 5px 9px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-self: start;
  }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .timer-label {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 1px;
    padding: 2px 3px;
  }
  #defuse-screen .timer-dial::before { top: 6px; bottom: 6px; left: 4px; width: 2px; }
  #defuse-screen .timer-dial::after { top: -6px; right: -5px; width: 17px; height: 17px; border-width: 1.5px; font-size: 10px; }
  #defuse-screen .timer-caption { font-size: 9px; letter-spacing: -.02em; white-space: nowrap; }
  #defuse-screen .timer-label { grid-column: 3; grid-row: 2; margin: 0; padding: 3px 4px; align-self: center; font-size: 8px; white-space: nowrap; }
  #defuse-screen .timer-dial strong { width: auto; height: auto; font-size: 34px; }
  #defuse-screen .timer-unit { grid-column: 2; grid-row: 2; margin-bottom: 3px; font-size: 8.5px; }
  #defuse-screen .bomb-instruction { grid-area: instruction; font-size: 10px; line-height: 1.2; }

  #defuse-screen .wire-section,
  #defuse-screen .tile-section { position: relative; margin: 0; }
  #defuse-screen .section-label-row { min-height: 25px; }
  #defuse-screen .section-label-row strong { font-size: 12.5px; }
  #defuse-screen .section-label-row > span { font-size: 10px; }
  #defuse-screen .wire-undo-actions { position: absolute; top: -11px; right: -4px; gap: 5px; }
  #defuse-screen .single-undo-hint { font-size: 8.5px; }
  #defuse-screen .small-text-button { position: static; min-width: 66px; min-height: 44px; padding: 10px 4px; font-size: 10px; }
  #defuse-screen .word-slots { gap: 5px; }
  #defuse-screen .wire-slot { min-height: 50px; padding: 3px; border-width: 1.5px; border-radius: 10px; font-size: 22px; }
  #defuse-screen .slot-letter { font-size: 9px; }
  #defuse-screen .slot-char { min-height: 25px; font-size: 22px; }
  #defuse-screen .char-pool { gap: 5px; margin: 0; }
  #defuse-screen .char-tile { min-height: 50px; padding: 4px; border-width: 1.5px; border-radius: 10px; font-size: 21px; }
  #defuse-screen #submit-defuse {
    width: min(72%, 250px);
    min-height: 48px;
    margin-top: 8px;
    padding: 10px 14px;
    justify-self: center;
  }

  #defuse-screen:has(#defuse-feedback:not([hidden])) .wire-section,
  #defuse-screen:has(#defuse-feedback:not([hidden])) .tile-section,
  #defuse-screen:has(#defuse-feedback:not([hidden])) #submit-defuse { display: none; }
  #defuse-screen:has(#defuse-feedback:not([hidden])) {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-instruction { display: none; }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-visual { width: min(100%, 190px); }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-panel[data-onboarding-stage="instant"] .bomb-visual {
    width: min(100%, 300px);
  }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .timer-dial { min-height: 72px; }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .timer-dial strong { font-size: 30px; }
  #defuse-screen .defuse-feedback {
    min-height: 0;
    margin: 0;
    padding: 7px 8px;
    align-content: center;
    gap: 2px;
  }
  #defuse-screen .defuse-feedback > p { margin: 0; line-height: 1.2; }
  #defuse-screen .defuse-feedback .feedback-cue { min-height: 24px; padding: 3px 8px; font-size: 11px; }
  #defuse-screen .defuse-feedback .defuse-reaction-quote { margin: 3px 0 0; padding: 4px 7px; font-size: 10px; line-height: 1.2; }
  #defuse-screen .defuse-feedback .defuse-answer-proof { font-size: 8.5px; }
  #defuse-screen .defuse-feedback .defuse-reward { margin-top: 2px; padding: 3px 6px; font-size: 8.5px; }
  #defuse-screen .defuse-feedback .score-life-meter { margin-top: 1px; gap: 2px 7px; font-size: 8.5px; }
  #defuse-screen .defuse-feedback .score-life-meter > strong { font-size: 9.5px; }
  #defuse-screen .defuse-feedback .score-life-track { height: 4px; }
  #defuse-screen .defuse-feedback .bomb-rack-card { margin-top: 2px; }
  #defuse-screen #defuse-feedback-title { margin-top: 1px; font-size: clamp(18px, 5.3vw, 23px); line-height: 1.08; }
  #defuse-screen #defuse-feedback-copy { font-size: 10px; }
  #defuse-screen #next-bomb { min-height: 44px; margin-top: 2px; padding-block: 8px; }
}

@media (max-width: 767px) and (max-height: 680px) {
  #game-screen.is-active { grid-template-rows: auto auto minmax(112px, .8fr) minmax(0, 1.45fr); gap: 4px 6px; }
  #game-screen .scene-art { height: 58%; }
  #game-screen .scene-visual figcaption span,
  #game-screen .thinking-hint,
  #game-screen .speaker-style,
  #game-screen .voice-cue { display: none; }
  #game-screen .person-portrait { width: 44px; height: 48px; }
  #game-screen .answer-button,
  #game-screen .answer-button.is-right { grid-template-columns: 48px minmax(0, 1fr); }
  #game-screen .answer-button.is-right { grid-template-columns: minmax(0, 1fr) 48px; }

  #defuse-screen.is-active {
    grid-template-rows: auto auto auto clamp(285px, 43dvh, 300px) auto auto auto;
    gap: 3px;
    align-content: start;
  }
  #defuse-screen .mission-brief { min-height: 60px; margin-bottom: 6px; padding-block: 3px; }
  #defuse-screen .mission-index { font-size: clamp(15.5px, 4.35vw, 17px); }
  #defuse-screen .mission-copy { font-size: clamp(15.5px, 4.35vw, 17px); }
  #defuse-screen .rack-heading { display: none; }
  #defuse-screen .defuse-feedback .rack-heading { display: flex; }
  #defuse-screen .bomb-rack { margin: 0; }
  #defuse-screen .bomb-panel { grid-template-columns: minmax(0, 1fr); padding-block: 4px; }
  #defuse-screen .bomb-visual { width: clamp(285px, 82vw, 305px); max-width: none; }
  #defuse-screen .timer-dial { top: auto; width: 126px; min-height: 64px; }
  #defuse-screen .timer-dial strong { font-size: 32px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) { grid-template-columns: 64px minmax(0, 1fr) 64px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .bomb-visual { width: 188px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .timer-dial { width: 60px; min-height: 72px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .ready-overlay { min-height: 72px; padding-block: 7px; }
  #defuse-screen .bomb-panel:has(.ready-overlay:not([hidden])) .ready-overlay .btn { min-height: 48px; }
  #defuse-screen .section-label-row { min-height: 21px; }
  #defuse-screen .char-pool {
    grid-template-columns: repeat(var(--tile-columns-short, var(--tile-columns, 4)), minmax(0, 1fr));
  }
  #defuse-screen .char-tile,
  #defuse-screen .wire-slot { min-height: 44px; }
  #defuse-screen #submit-defuse { min-height: 44px; margin-top: 4px; }

  #defuse-screen:has(.char-pool[data-pool-size="8"]) {
    grid-template-rows: auto auto auto clamp(248px, 39dvh, 258px) auto auto auto;
  }
  #defuse-screen:has(.char-pool[data-pool-size="8"]) .bomb-visual {
    width: clamp(238px, 68vw, 255px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .demo-suspicious, .demo-serious, .demo-arrow,
  .live-panel img, .live-bubble, .live-arrow { animation: none !important; }

  .mode-card:hover { transform: none; }
  .mode-card:hover .mode-photo img { transform: none; }
}
#nl-badge-frame {
  display: none !important;
  pointer-events: none !important;
}

@media (max-width: 767px) {
  .app-shell[data-screen="challenge"] { min-height: 100dvh; border: 0; border-radius: 0; }
  .challenge-screen { height: 100dvh; min-height: 0; overflow: hidden; }
  .challenge-entry-view,
  .challenge-result-view { min-height: 100%; }
  .challenge-result-view { justify-content: center; }
  .defuse-feedback-actions .btn { padding-inline: 4px; font-size: clamp(10px, 2.8vw, 12px); }
}

@media (max-width: 767px) and (max-height: 700px) {
  .challenge-screen { padding-block: 10px; }
  .challenge-mascot, .challenge-result-mascot { width: 112px; height: 90px; }
  .challenge-entry-view h1, .challenge-result-view h1 { font-size: 25px; }
  .challenge-entry-record, .challenge-result-copy { margin-bottom: 8px; font-size: 12px; }
  .challenge-secret-card { margin-bottom: 10px; padding: 10px; }
  .challenge-secret-card strong { font-size: 54px; }
  .challenge-versus > div { min-height: 88px; padding-block: 8px; }
  .challenge-result-actions .btn { min-height: 48px; }
  .challenge-chain-score { margin-bottom: 7px; }
}

/* 结果页不是答题页：将暗号保留为锚点，把空间还给玩家最关心的反馈。 */
@media (max-width: 767px) {
  #defuse-screen:has(#defuse-feedback:not([hidden])) {
    grid-template-rows: auto auto auto clamp(128px, 19dvh, 158px) minmax(0, 1fr);
    gap: 5px;
    align-content: start;
  }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-panel {
    min-height: 0;
    height: clamp(128px, 19dvh, 158px);
    padding: 4px 8px 6px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "visual";
    border-radius: 18px;
  }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .fuse-line,
  #defuse-screen:has(#defuse-feedback:not([hidden])) .timer-dial,
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-mood-bubble,
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-instruction { display: none; }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-visual,
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-panel[data-onboarding-stage="instant"] .bomb-visual {
    width: min(100%, 156px);
    margin: 0;
  }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-code { min-width: 102px; padding: 3px 8px 5px; }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-code-label { font-size: 7px; }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-code strong { font-size: clamp(30px, 9vw, 38px); }

  #defuse-screen .defuse-feedback {
    padding: 11px 10px 9px;
    align-content: start;
    gap: 5px;
    border-width: 2px;
    border-radius: 19px;
  }
  #defuse-screen .defuse-feedback .feedback-cue { min-height: 25px; padding: 4px 10px; font-size: 11px; }
  #defuse-screen #defuse-feedback-title { margin: 0; font-size: clamp(25px, 7.3vw, 31px); line-height: 1.08; letter-spacing: -.025em; }
  #defuse-screen #defuse-feedback-copy { font-size: clamp(12px, 3.55vw, 14px); line-height: 1.3; }
  #defuse-screen .defuse-feedback .defuse-reaction-quote { margin: 1px 0 0; padding: 7px 9px; font-size: clamp(12px, 3.5vw, 14px); line-height: 1.25; }
  #defuse-screen .defuse-feedback .defuse-answer-proof { font-size: 11px; line-height: 1.25; }
  #defuse-screen .defuse-feedback .defuse-reward { margin-top: 0; padding: 4px 8px; font-size: 11px; }
  #defuse-screen .defuse-feedback .score-life-meter { margin-top: 0; gap: 2px 7px; font-size: 9px; }
  #defuse-screen .defuse-feedback .score-life-meter > strong { font-size: 10px; }
  #defuse-screen .defuse-feedback .score-life-track { height: 4px; }

  #defuse-screen .defuse-feedback .bomb-rack-card { margin: 0; padding: 4px 6px 5px; border-width: 1px; border-radius: 11px; box-shadow: none; }
  #defuse-screen .defuse-feedback .rack-heading { display: flex; min-height: 14px; gap: 5px; }
  #defuse-screen .defuse-feedback .rack-heading strong { font-size: 8px; line-height: 1; }
  #defuse-screen .defuse-feedback .rack-heading strong::before { margin-right: 2px; }
  #defuse-screen .defuse-feedback .rack-heading span { font-size: 8px; line-height: 1; }
  #defuse-screen .defuse-feedback .bomb-rack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: 3px 0 0; }
  #defuse-screen .defuse-feedback .rack-item { min-height: 28px; padding: 2px 1px; border-radius: 7px; }
  #defuse-screen .defuse-feedback .rack-bomb { width: 15px; height: 15px; }
  #defuse-screen .defuse-feedback .rack-number { width: 11px; height: 11px; font-size: 6px; }
  #defuse-screen .defuse-feedback .rack-label { margin-top: 0; font-size: 7px; line-height: 1; white-space: nowrap; }

  #defuse-screen .defuse-feedback-actions { gap: 6px; }
  #defuse-screen .defuse-feedback-actions .btn { min-height: 47px; padding: 5px 6px; border-radius: 12px; font-size: clamp(10px, 2.9vw, 12px); line-height: 1.05; }
  #defuse-screen .defuse-feedback-actions .feedback-action-icon { width: 20px; height: 20px; border-width: 1px; font-size: 11px; }
  #defuse-screen .defuse-feedback-actions small { font-size: 7px; }
  #defuse-screen .defuse-feedback-actions .feedback-next-button { padding-inline: 9px; }
  #defuse-screen .defuse-feedback-actions .feedback-next-button > span:last-child { font-size: 17px; }
}

@media (max-width: 767px) and (max-height: 700px) {
  #defuse-screen:has(#defuse-feedback:not([hidden])) {
    grid-template-rows: auto auto auto 112px minmax(0, 1fr);
    gap: 3px;
  }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-panel { height: 112px; }
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-visual,
  #defuse-screen:has(#defuse-feedback:not([hidden])) .bomb-panel[data-onboarding-stage="instant"] .bomb-visual { width: 126px; }
  #defuse-screen .defuse-feedback { padding: 7px 8px; gap: 3px; }
  #defuse-screen #defuse-feedback-title { font-size: clamp(22px, 6.5vw, 26px); }
  #defuse-screen #defuse-feedback-copy { font-size: 11px; }
  #defuse-screen .defuse-feedback .defuse-reaction-quote { padding: 4px 7px; font-size: 11px; }
  #defuse-screen .defuse-feedback .defuse-answer-proof,
  #defuse-screen .defuse-feedback .defuse-reward { font-size: 9px; }
  #defuse-screen .defuse-feedback .bomb-rack-card { padding-block: 3px; }
  #defuse-screen .defuse-feedback-actions .btn { min-height: 41px; }
}
