:root {
  --ink: #111827;
  --muted: #5c667a;
  --line: #111827;
  --paper: #fffaf0;
  --yellow: #ffe05c;
  --cyan: #77e8ff;
  --pink: #ff8fb8;
  --green: #53d982;
  --red: #ef4e4e;
  --blue: #496eff;
  --shadow: 0 8px 0 var(--line);
  color-scheme: light;
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(17,24,39,.08) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, #8eeaff 0%, #fff1a8 48%, #ffbfd4 100%);
}

button { cursor: pointer; }
button, select { font: inherit; }
button:disabled { cursor: default; opacity: .78; }
h1, h2, h3, p, strong, span { overflow-wrap: anywhere; }

.shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.panel,
.mission-card,
.arcade,
.board,
.side-card,
.choice,
.result-card,
.device,
.final-card,
.answer,
.hud,
.hazard-card {
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(255,250,240,.97);
  box-shadow: var(--shadow);
}

.hero {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 24px;
  align-items: center;
}

.hero-copy,
.arcade,
.final-card { padding: clamp(22px, 4vw, 46px); }

.badge {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--yellow);
  font-size: .8rem;
  font-weight: 1000;
}

h1 {
  margin: 16px 0 0;
  font-size: clamp(2.1rem, 5.4vw, 5.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.22rem, 2.2vw, 1.9rem);
  line-height: 1.22;
}

h3 { margin: 0; font-size: 1.18rem; }

.lead {
  margin: 18px 0 0;
  color: #bd2740;
  font-size: clamp(1.12rem, 2.2vw, 1.75rem);
  font-weight: 1000;
  line-height: 1.45;
}

.text {
  color: #37445a;
  line-height: 1.78;
}

.progress-strip {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.progress-strip div,
.stat-chip {
  min-height: 68px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.progress-strip b,
.stat-chip b { font-size: 1.55rem; }
.progress-strip span,
.stat-chip span { font-size: .78rem; font-weight: 1000; color: var(--muted); }

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.mission-card {
  min-height: 232px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.24)),
    var(--card);
  color: var(--ink);
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease;
}

.mission-card.done {
  background: #dfffe9;
}

.mission-card span,
.mission-card small,
.mission-card em { font-style: normal; font-weight: 900; }
.mission-card strong { font-size: 1.28rem; line-height: 1.35; }
.mission-card small { color: #334155; line-height: 1.55; }
.mission-card em {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255,255,255,.78);
}

.mission-card:hover,
.choice:hover,
.primary:hover,
.ghost:hover { transform: translateY(-2px); }

.arcade {
  display: grid;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(17,24,39,.93), rgba(17,24,39,.86)),
    #111827;
  color: #fff;
}

.mini-map {
  display: grid;
  grid-template-columns: 70px 1fr 70px 1fr 70px;
  align-items: center;
}

.map-node {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 1000;
}

.map-node.done { background: var(--green); }
.map-road { height: 8px; border-block: 3px solid #fff; background: var(--cyan); }

.rule-list {
  display: grid;
  gap: 12px;
}

.rule-list div {
  border: 2px solid rgba(255,255,255,.26);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
  background: rgba(255,255,255,.08);
}

.rule-list b { color: var(--yellow); }
.rule-list span { color: rgba(255,255,255,.78); line-height: 1.5; }

.map-shell {
  width: min(1440px, calc(100% - 20px));
  margin: 0 auto;
  padding: 10px 0;
}

.map-stage {
  position: relative;
  min-height: calc(100vh - 20px);
  overflow: hidden;
  border: 4px solid #5b3a1e;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 14% 10%, #b5e97d 0 16%, transparent 17%),
    radial-gradient(ellipse at 84% 13%, #a8df66 0 18%, transparent 19%),
    linear-gradient(#f7ffdc 0 17%, #9be266 17% 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.72), 0 10px 0 #754d22;
}

.map-stage::before {
  content: "";
  position: absolute;
  inset: 16% -8% auto -8%;
  height: 70%;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255,255,255,.22) 18% 19%, transparent 19% 100%),
    radial-gradient(circle at 76% 78%, rgba(255,255,166,.86) 0 8%, transparent 9%);
  pointer-events: none;
}

.sky-dot {
  position: absolute;
  top: 22px;
  width: 32px;
  aspect-ratio: 1;
  border: 3px solid #5b3a1e;
  border-radius: 50%;
  box-shadow: inset -5px -4px 0 rgba(0,0,0,.12);
  z-index: 3;
}

.sky-dot.one { left: 30px; background: #ff7f7f; }
.sky-dot.two { left: 72px; background: #ffca55; }
.sky-dot.three { left: 114px; background: #7de6ff; }

.tree {
  position: absolute;
  width: 92px;
  height: 124px;
  z-index: 1;
}

.tree::before,
.tree::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #54b948;
}

.tree::before {
  width: 72px;
  height: 92px;
  left: 10px;
  top: 0;
}

.tree::after {
  width: 92px;
  height: 82px;
  left: 0;
  top: 28px;
  background: rgba(84,185,72,.78);
}

.tree {
  border-bottom: 48px solid #a96a24;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
}

.tree-a { left: 18%; top: 48px; }
.tree-b { right: 16%; top: 68px; }
.tree-c { right: 4%; top: 82px; }

.road {
  position: absolute;
  z-index: 1;
  height: 88px;
  border: 7px solid #9a6a27;
  border-radius: 999px;
  background: #f7d68c;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.22);
}

.main-road {
  left: 8%;
  right: 13%;
  top: 24%;
  transform: rotate(-1deg);
}

.branch-road.one {
  width: 45%;
  left: 45%;
  top: 37%;
  transform: rotate(24deg);
}

.branch-road.two {
  width: 44%;
  left: 35%;
  top: 59%;
  transform: rotate(-4deg);
}

.start-sign {
  position: absolute;
  left: 28px;
  top: 13%;
  z-index: 5;
  width: 232px;
  min-height: 168px;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 5px solid #6a4522;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffe9ad, #f1c875);
  box-shadow: 8px 10px 0 #6b431c;
  transform: rotate(-3deg);
}

.start-sign::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 110px;
  left: 94px;
  top: 156px;
  background: #bd7b31;
  border-inline: 4px solid #6a4522;
  z-index: -1;
}

.start-sign span {
  font-size: clamp(2.3rem, 4.2vw, 3.8rem);
  font-weight: 1000;
  line-height: .9;
}

.start-sign button,
.goal-card em,
.map-card em {
  border: 3px solid #5b3a1e;
  border-radius: 999px;
  background: #fffdf5;
  color: #2b2017;
  font-weight: 1000;
}

.start-sign button {
  min-width: 118px;
  min-height: 48px;
  box-shadow: 0 5px 0 rgba(91,58,30,.45);
}

.map-title-panel {
  position: absolute;
  left: 34px;
  bottom: 38px;
  z-index: 6;
  width: min(520px, calc(100% - 60px));
  padding: 24px;
  border: 4px solid #5b3a1e;
  border-radius: 14px;
  background: rgba(255,253,232,.94);
  box-shadow: 0 8px 0 rgba(91,58,30,.55);
}

.map-title-panel h1 {
  margin-top: 14px;
  font-size: clamp(2.5rem, 5.8vw, 5.2rem);
}

.map-title-panel p {
  margin: 18px 0 0;
  line-height: 1.75;
  font-weight: 900;
}

.map-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.map-stats div {
  min-height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid #5b3a1e;
  border-radius: 12px;
  background: #fff;
}

.map-stats b { font-size: 1.05rem; }
.map-stats span {
  color: #69523c;
  font-size: .74rem;
  font-weight: 1000;
}

.map-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 4;
  width: 174px;
  min-height: 146px;
  padding: 16px 14px 12px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 4px solid #5b3a1e;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.18)), var(--card);
  color: #2b2017;
  text-align: left;
  box-shadow: 6px 7px 0 rgba(91,58,30,.28);
  transform: translate(-50%, -50%) rotate(var(--rot));
  transition: transform .16s ease, box-shadow .16s ease;
}

.map-card:hover {
  transform: translate(-50%, -54%) rotate(var(--rot));
  box-shadow: 8px 10px 0 rgba(91,58,30,.32);
}

.map-card.done {
  background: linear-gradient(180deg, #f0fff3, #c9f4d2);
}

.map-card.locked {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.76), rgba(232,232,232,.68)),
    #e7e7e7;
  color: #777;
  filter: grayscale(1);
  opacity: .95;
}

.map-card.locked:hover {
  transform: translate(-50%, -50%) rotate(var(--rot));
}

.map-no {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 4px solid #5b3a1e;
  border-radius: 50%;
  background: #fffdf5;
  font-size: 1.55rem;
  font-weight: 1000;
}

.map-card strong {
  font-size: 1.2rem;
  line-height: 1.2;
}

.map-card small {
  color: #755f45;
  font-weight: 1000;
}

.map-card em {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: .82rem;
  font-style: normal;
}

.map-card.done em {
  background: #ffe05c;
}

.map-card.locked em {
  min-height: 34px;
  border-color: #d7d7d7;
  background: #8d8d8d;
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}

.goal-card {
  position: absolute;
  right: 34px;
  bottom: 52px;
  z-index: 5;
  width: 210px;
  min-height: 156px;
  padding: 18px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 5px solid #8b5b13;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffe889, #ffc33b);
  color: #6b3d05;
  box-shadow: 0 10px 0 rgba(91,58,30,.42);
}

.goal-card strong {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: .9;
}

.goal-card span {
  font-weight: 1000;
}

.goal-card.locked {
  filter: grayscale(.25);
  opacity: .82;
}

.goal-card.open {
  animation: goalPulse 1.25s ease-in-out infinite alternate;
}

.goal-hint {
  position: absolute;
  left: min(35%, 520px);
  right: 300px;
  bottom: 36px;
  z-index: 4;
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 4px solid #7b5021;
  border-radius: 16px;
  padding: 14px 18px;
  background: rgba(255,233,173,.92);
  box-shadow: 0 8px 0 #7b5021;
  font-weight: 950;
}

.goal-hint span {
  color: #4b3724;
  line-height: 1.45;
}

@keyframes goalPulse {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.game-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.game-head h1 {
  margin-top: 10px;
  font-size: clamp(1.95rem, 4.6vw, 4.2rem);
}

.hud {
  margin-bottom: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  background: rgba(17,24,39,.94);
  color: #fff;
}

.hud-meter {
  display: grid;
  gap: 7px;
}

.hud-meter div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 1000;
  font-size: .86rem;
}

.hud-meter i {
  height: 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
}

.hud-meter i span {
  display: block;
  height: 100%;
  transition: width .22s ease;
}

.hud-meter.hp i span { background: linear-gradient(90deg, var(--red), var(--yellow), var(--green)); }
.hud-meter.score i span { background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.hud-meter.buzz i span { background: linear-gradient(90deg, var(--yellow), var(--red)); }
.hud-meter.account i span { background: linear-gradient(90deg, var(--red), var(--green)); }
.hud-meter.timer i span { background: linear-gradient(90deg, var(--green), var(--yellow)); }
.hud-meter.timer.warn i span { background: var(--yellow); }
.hud-meter.timer.danger i span { background: var(--red); }
.hud-meter.timer.danger b { color: var(--yellow); }
.hud-meter.timer.idle i span { background: #7c8799; }
.hud-meter.timer.idle b { color: var(--cyan); }

.stat-chip {
  min-height: 62px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.board {
  padding: 18px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,224,92,.44), transparent 27%),
    radial-gradient(circle at 85% 12%, rgba(119,232,255,.48), transparent 24%),
    radial-gradient(circle at 72% 80%, rgba(255,143,184,.36), transparent 28%),
    rgba(255,250,240,.97);
}

.scenario-intro {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 16px;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--accent);
}

.scenario-icon {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 1.45rem;
  font-weight: 1000;
}

.scenario-intro p {
  margin: 0;
  line-height: 1.75;
  font-weight: 760;
}

.hazard-card {
  margin-top: 16px;
  min-height: 70px;
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
}

.hazard-card span {
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--yellow);
  font-size: .8rem;
  font-weight: 1000;
  text-align: center;
}

.device {
  margin-top: 18px;
  min-height: 280px;
  padding: 18px;
  background: #111827;
  color: #fff;
  box-shadow: 0 8px 0 var(--line), inset 0 0 0 7px #2f3a50;
}

.device-top {
  width: 76px;
  height: 10px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: #5d6a83;
}

.device-lines {
  display: grid;
  gap: 12px;
}

.device-lines div {
  border: 2px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,.09);
  line-height: 1.6;
  font-weight: 850;
}

.device.dm,
.device.login { background: #f8fbff; color: var(--ink); }
.device.dm .device-lines div,
.device.login .device-lines div {
  border-color: #c8d6ed;
  background: #fff;
}
.device.video,
.device.viral { background: #21131a; }

.viral-meter {
  height: 34px;
  border: 3px solid #fff;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
  background: rgba(255,255,255,.12);
}

.viral-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--red));
  transition: width .25s ease;
}

.prompt-row {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 8px;
  color: #bd2740;
  font-weight: 1000;
}

.turn-pill {
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  font-weight: 1000;
  white-space: nowrap;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.choices.locked {
  opacity: .58;
  filter: grayscale(.18);
}

.choice {
  min-height: 80px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px;
  background: #fff;
  text-align: left;
  font-weight: 920;
  box-shadow: 0 6px 0 var(--line);
  transition: transform .16s ease, box-shadow .16s ease;
}

.choice span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.answer-gate {
  margin-top: 18px;
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 6px 0 var(--line);
}

.answer-gate span {
  font-weight: 1000;
  line-height: 1.5;
}

.answer-gate.reading span::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 1.1em;
  margin-left: 6px;
  vertical-align: -.18em;
  background: var(--line);
  animation: blink .8s steps(2, start) infinite;
}

.answer-gate.ready {
  background: var(--yellow);
}

.answer-gate.live {
  background: #111827;
  color: #fff;
}

.answer-gate.timeout {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 0 var(--red);
}

.answer-gate.timeout span {
  color: #bd2740;
}

@keyframes blink {
  50% { opacity: 0; }
}

.primary,
.ghost {
  min-height: 48px;
  border: 3px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 0 var(--line);
  padding: 0 16px;
  font-weight: 1000;
}

.primary { background: var(--red); color: #fff; }
.ghost { background: #fff; color: var(--ink); }

.primary:active,
.ghost:active,
.choice:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--line);
}

.result-card {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.result-card span {
  width: fit-content;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  font-weight: 1000;
}

.result-card.safe { background: #dfffe9; }
.result-card.watch { background: #fff7ce; }
.result-card.trap,
.result-card.fail { background: #ffe3ed; }
.result-card p { margin: 0; line-height: 1.75; font-weight: 800; }
.delta {
  width: fit-content;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 1000;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.side-card {
  padding: 16px;
}

.log-list {
  display: grid;
  gap: 10px;
}

.log-list div {
  border-top: 2px solid rgba(17,24,39,.18);
  padding-top: 10px;
  display: grid;
  gap: 4px;
}

.log-list span,
.side-card p { color: #4f5b70; line-height: 1.7; }

.reward {
  margin: 12px 0;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--yellow);
  font-weight: 1000;
}

.reveal-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.final-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.94)),
    var(--accent);
}

.result-score {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-score div,
.badge-unlocked {
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  gap: 4px;
}

.result-score span,
.badge-unlocked span { font-size: .78rem; font-weight: 1000; color: var(--muted); }
.result-score b,
.badge-unlocked strong { font-size: 1.5rem; text-align: center; }

.badge-unlocked {
  margin-top: 22px;
  background: var(--yellow);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.answer {
  min-height: 82px;
  padding: 12px;
  background: #fff;
  font-weight: 1000;
}

.habit-box {
  margin-top: 22px;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #111827;
  color: #fff;
}

.habit-box p {
  line-height: 1.8;
  font-weight: 850;
}

.habit-box strong {
  display: block;
  margin-top: 12px;
  color: var(--yellow);
}

.source-box {
  margin-top: 18px;
  border: 3px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff7ce;
}

.source-box p { margin: 8px 0 0; line-height: 1.7; }

.final-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 1040px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .mission-grid,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .map-shell {
    width: 100%;
    overflow-x: auto;
    padding: 8px;
  }

  .map-stage {
    width: 1120px;
    min-height: 760px;
  }
}

@media (max-width: 760px) {
  .hud,
  .progress-strip,
  .result-score {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 18px, 1240px);
    padding-top: 12px;
  }

  .hero { min-height: auto; }

  .hero-copy,
  .arcade,
  .final-card,
  .board,
  .side-card {
    padding: 14px;
  }

  .game-head,
  .prompt-row,
  .hazard-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scenario-intro {
    grid-template-columns: 1fr;
  }

  .scenario-icon {
    width: 78px;
  }

  .choices,
  .side-stack,
  .hud,
  .progress-strip,
  .result-score {
    grid-template-columns: 1fr;
  }

  .answer-gate {
    display: grid;
  }

  .device { min-height: 220px; }
  .mini-map { grid-template-columns: 56px 1fr 56px 1fr 56px; }

  .map-shell {
    padding: 6px;
  }

  .map-stage {
    width: 980px;
    min-height: 720px;
    border-radius: 18px;
  }

  .start-sign {
    left: 22px;
    width: 190px;
    min-height: 140px;
  }

  .start-sign span {
    font-size: 2.4rem;
  }

  .start-sign::after {
    left: 76px;
    top: 132px;
  }

  .map-card {
    width: 154px;
    min-height: 132px;
  }

  .map-title-panel {
    width: 430px;
    padding: 18px;
  }

  .map-title-panel h1 {
    font-size: 3rem;
  }

  .map-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goal-hint {
    left: 430px;
    right: 260px;
  }

  .goal-card {
    width: 180px;
    min-height: 138px;
  }
}

.map-stage.image-map {
  aspect-ratio: 3 / 2;
  min-height: 0;
  height: auto;
  width: min(1536px, calc(100vw - 24px));
  margin-inline: auto;
  border: 0;
  border-radius: 0;
  background: url("/ai-lifegame14/assets/start-map-pc.jpeg") center / cover no-repeat;
  box-shadow: 0 18px 50px rgba(21,86,62,.22);
}

.map-stage.image-map::before {
  inset: 0;
  height: auto;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.04));
}

.image-status {
  position: absolute;
  left: 52%;
  top: 2.3%;
  z-index: 8;
  width: 45.8%;
  height: 13.8%;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr 1fr;
  align-items: center;
  gap: 1.1%;
  padding: 1.1% 1.6% 1.2% 5.5%;
  border: 2px solid #f0a21b;
  border-radius: 20px;
  background: rgba(255,251,238,.96);
  box-shadow: 0 4px 0 rgba(190,133,30,.34);
  color: #2f2b2a;
  text-align: center;
  font-weight: 1000;
}

.image-status div {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .35rem;
  min-width: 0;
}

.image-status span {
  font-size: clamp(.58rem, 1.05vw, 1.02rem);
  line-height: 1;
}

.image-status b {
  font-size: clamp(.82rem, 1.7vw, 1.72rem);
  line-height: 1;
  white-space: nowrap;
}

.image-status i {
  width: min(88px, 72%);
  height: clamp(8px, 1.25vw, 16px);
  display: block;
  overflow: hidden;
  border: 2px solid rgba(71,68,62,.5);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.18);
}

.image-status i span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #42e6c0, #009c72);
}

.start-hotspot {
  position: absolute;
  left: 2.5%;
  top: 31.2%;
  z-index: 9;
  width: 12.5%;
  height: 12.5%;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
}

.start-hotspot:hover,
.image-card:not(.locked):hover,
.image-goal.open:hover {
  outline: 4px solid rgba(255,255,255,.75);
  outline-offset: 3px;
}

.image-map .map-card {
  width: 13.2%;
  min-height: 20.6%;
  padding: 1.55% 1.35% 1.15%;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) rotate(var(--rot));
}

.image-map .map-card:not(.locked) {
  border: 3px solid #24b57e;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(242,255,249,.92));
  color: #1f1b18;
  box-shadow: 0 5px 0 rgba(30,108,79,.28);
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}

.image-map .map-card.stage-2:not(.locked) {
  border-color: #f36d87;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,245,248,.92));
  box-shadow: 0 5px 0 rgba(190,78,105,.24);
}

.image-map .map-card.stage-3:not(.locked) {
  border-color: #f39b00;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,248,224,.93));
  box-shadow: 0 5px 0 rgba(183,104,0,.25);
}

.image-map .map-card:not(.locked):hover {
  transform: translate(-50%, -53%) rotate(var(--rot));
}

.image-map .map-no {
  width: clamp(26px, 3.2vw, 52px);
  height: clamp(26px, 3.2vw, 52px);
  border: 0;
  background: linear-gradient(180deg, #40d49b, #009a63);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
}

.image-map .stage-2 .map-no {
  background: linear-gradient(180deg, #ff7d8f, #e7375b);
}

.image-map .stage-3 .map-no {
  background: linear-gradient(180deg, #ffb928, #f08200);
}

.image-map .map-card strong {
  margin-top: .2rem;
  font-size: clamp(.68rem, 1.45vw, 1.35rem);
  line-height: 1.34;
}

.image-map .map-card small {
  color: #332822;
  font-size: clamp(.5rem, .95vw, .9rem);
  line-height: 1.25;
}

.image-map .map-card em,
.image-map .map-card.done em {
  min-height: clamp(22px, 2.4vw, 36px);
  padding: 3px 10px;
  border: 0;
  background: linear-gradient(180deg, #22bd73, #008d53);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.16);
}

.image-map .stage-2 em {
  background: linear-gradient(180deg, #ff7489, #e93459);
}

.image-map .stage-3 em {
  background: linear-gradient(180deg, #ffa719, #f07800);
}

.image-map .map-card.locked {
  width: 12.6%;
  min-height: 20%;
  padding: 0;
  background: transparent;
  filter: none;
  opacity: 1;
}

.image-map .map-card.locked em {
  color: transparent;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.image-map .goal-card {
  right: 3.2%;
  bottom: 8.3%;
  z-index: 9;
  width: 17%;
  min-height: 20%;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  box-shadow: none;
}

.image-map .goal-card strong,
.image-map .goal-card em {
  color: transparent;
  background: transparent;
  border: 0;
  box-shadow: none;
}

@media (max-width: 760px) {
  .map-shell {
    width: 100%;
    padding: 0;
    overflow-x: hidden;
  }

  .map-stage.image-map {
    width: 100%;
    aspect-ratio: 941 / 1672;
    border-radius: 0;
    background-image: url("/ai-lifegame14/assets/start-map-mobile.jpeg");
    box-shadow: none;
  }

  .image-status {
    left: 8.6%;
    top: 20.8%;
    width: 82.6%;
    height: 8.2%;
    padding: 1.4% 2.2%;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .image-status span {
    font-size: clamp(.42rem, 2vw, .74rem);
  }

  .image-status b {
    font-size: clamp(.58rem, 3.2vw, 1.12rem);
  }

  .image-status i {
    height: clamp(5px, 1.8vw, 10px);
  }

  .start-hotspot {
    left: 4.8%;
    top: 31.8%;
    width: 21%;
    height: 8.8%;
  }

  .image-map .map-card {
    width: 20.5%;
    min-height: 13.8%;
    padding: 1.8% 2% 1.4%;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .image-map .stage-1 { left: 35% !important; top: 39% !important; }
  .image-map .stage-2 { left: 58.5% !important; top: 39% !important; }
  .image-map .stage-3 { left: 82% !important; top: 39% !important; }
  .image-map .stage-4 { left: 24% !important; top: 54.2% !important; }
  .image-map .stage-5 { left: 49% !important; top: 54.2% !important; }
  .image-map .stage-6 { left: 75% !important; top: 54.2% !important; }
  .image-map .stage-7 { left: 14% !important; top: 68.6% !important; }
  .image-map .stage-8 { left: 38.5% !important; top: 68.6% !important; }
  .image-map .stage-9 { left: 63.2% !important; top: 68.6% !important; }
  .image-map .stage-10 { left: 86.5% !important; top: 68.6% !important; }

  .image-map .map-card:not(.locked),
  .image-map .map-card.stage-2:not(.locked),
  .image-map .map-card.stage-3:not(.locked) {
    border-color: transparent;
    background: transparent;
    color: transparent;
    text-shadow: none;
  }

  .image-map .map-no,
  .image-map .stage-2 .map-no,
  .image-map .stage-3 .map-no,
  .image-map .map-card strong,
  .image-map .map-card small,
  .image-map .map-card em,
  .image-map .map-card.done em {
    color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .image-map .map-card.locked {
    width: 20.5%;
    min-height: 13.6%;
  }

  .image-map .goal-card {
    right: 4%;
    bottom: 3.4%;
    width: 43%;
    min-height: 18%;
  }
}

/* AI Life Game 14: scene-led quest presentation */
.board {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .72), transparent 48%),
    #fff7df;
}

.scene-visual {
  position: relative;
  margin: 0 0 18px;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 8px 0 var(--line);
}

.scene-visual img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  object-position: center;
}

.scene-visual figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: calc(100% - 28px);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(17, 24, 39, .9);
  color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .28);
}

.scene-visual figcaption span,
.side-kicker {
  color: var(--yellow);
  font-size: .74rem;
  font-weight: 1000;
}

.scene-visual figcaption strong {
  overflow-wrap: anywhere;
}

.device,
.device.dm,
.device.login,
.device.video,
.device.viral {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.phone-mock {
  width: min(100%, 520px);
  min-height: 390px;
  margin-inline: auto;
  border: 10px solid #111827;
  border-radius: 42px;
  padding: 18px 18px 24px;
  background: #f7fbff;
  color: var(--ink);
  box-shadow:
    0 12px 0 #313b50,
    0 22px 35px rgba(17, 24, 39, .2);
}

.device.call .phone-mock,
.device.payment .phone-mock {
  background:
    linear-gradient(180deg, #152035, #0c1322);
  color: #fff;
}

.phone-speaker {
  width: 82px;
  height: 9px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #66738a;
}

.screen-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid currentColor;
  padding: 8px 4px 12px;
  font-size: .78rem;
  font-weight: 1000;
  opacity: .72;
}

.phone-home {
  width: 90px;
  height: 7px;
  margin: 22px auto 0;
  border-radius: 999px;
  background: #748197;
}

.desktop-mock {
  min-height: 330px;
  overflow: hidden;
  border: 9px solid #2f3a50;
  border-radius: 8px;
  padding: 0 18px 22px;
  background: #101827;
  color: #fff;
  box-shadow:
    0 10px 0 #111827,
    0 20px 34px rgba(17, 24, 39, .18);
}

.desktop-mock.builder,
.desktop-mock.publish {
  background: #f3fbff;
  color: var(--ink);
}

.desktop-mock.ransom {
  background: #2c0e17;
}

.desktop-mock.recovery {
  background: #162238;
}

.desktop-bar {
  min-height: 46px;
  margin: 0 -18px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid rgba(255, 255, 255, .24);
  padding: 0 14px;
  background: rgba(255, 255, 255, .1);
}

.desktop-mock.builder .desktop-bar,
.desktop-mock.publish .desktop-bar {
  border-bottom-color: #b8cae1;
  background: #dcecff;
}

.desktop-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff6f75;
}

.desktop-bar i:nth-child(2) {
  background: #ffd05b;
}

.desktop-bar i:nth-child(3) {
  background: #45c982;
}

.desktop-bar strong {
  margin-left: auto;
  font-size: .75rem;
  opacity: .72;
}

.phone-mock .device-lines,
.desktop-mock .device-lines {
  display: grid;
  gap: 12px;
}

.phone-mock .device-lines div,
.desktop-mock .device-lines div {
  border: 2px solid rgba(84, 104, 139, .32);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .1);
  color: inherit;
  line-height: 1.55;
  font-weight: 900;
}

.device.dm .phone-mock .device-lines div,
.device.login .phone-mock .device-lines div,
.desktop-mock.builder .device-lines div,
.desktop-mock.publish .device-lines div {
  border-color: #bed0e5;
  background: #fff;
}

.desktop-mock.ransom .device-lines div:first-child {
  border-color: #ff7078;
  background: rgba(255, 70, 80, .16);
}

.viral-meter {
  margin-top: 18px;
}

.data-trail,
.data-audit {
  margin-top: 18px;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #effff5;
}

.data-trail > strong,
.data-audit > span {
  display: block;
  margin-bottom: 10px;
  color: #087451;
  font-size: .78rem;
  font-weight: 1000;
}

.data-trail > div,
.data-audit > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-trail span,
.data-audit b {
  border: 2px solid #168b65;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: #075b43;
  font-size: .84rem;
}

.data-trail em,
.data-audit em {
  color: var(--muted);
}

.data-audit h2 {
  margin: 0 0 12px;
}

.data-audit p {
  margin: 12px 0 0;
  line-height: 1.7;
}

.choice-zone {
  position: relative;
}

.more-choice {
  width: 54px;
  height: 54px;
  margin: 14px auto 0;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 0 var(--line);
  font-size: 1.6rem;
  font-weight: 1000;
}

.more-choice:hover:not(:disabled) {
  transform: translateY(-1px);
}

.more-choice:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--line);
}

.choice.discovered {
  background: #fff;
}

.mission-card {
  border-top: 7px solid var(--cyan);
}

.mission-card h2 {
  margin: 8px 0;
}

.reveal-visual {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.reveal-visual img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  border-radius: 6px;
}

.reveal-visual span {
  color: #087451;
  font-size: .8rem;
  font-weight: 1000;
}

.reveal-visual h2 {
  margin: 8px 0 12px;
}

.reveal-visual .lead {
  margin: 0;
}

.image-map .map-card.stage-4:not(.locked) {
  border-color: #4879eb;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(239, 246, 255, .94));
  box-shadow: 0 5px 0 rgba(44, 85, 179, .25);
}

.image-map .map-card.stage-5:not(.locked) {
  border-color: #df5b49;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 242, 232, .94));
  box-shadow: 0 5px 0 rgba(181, 63, 48, .24);
}

.image-map .stage-4 .map-no {
  background: linear-gradient(180deg, #6a98ff, #335ed0);
}

.image-map .stage-5 .map-no {
  background: linear-gradient(180deg, #ff8b6b, #d84738);
}

.image-map .stage-4 em {
  background: linear-gradient(180deg, #6a98ff, #335ed0);
}

.image-map .stage-5 em {
  background: linear-gradient(180deg, #ff8b6b, #d84738);
}

@media (max-width: 920px) {
  .reveal-visual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .scene-visual {
    margin-bottom: 14px;
  }

  .scene-visual figcaption {
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 6px 9px;
  }

  .scene-visual figcaption span {
    display: none;
  }

  .phone-mock {
    min-height: 320px;
    border-width: 7px;
    border-radius: 30px;
    padding: 14px 12px 20px;
  }

  .desktop-mock {
    min-height: 280px;
    border-width: 6px;
    padding-inline: 12px;
  }

  .desktop-bar {
    margin-inline: -12px;
  }

  .phone-mock .device-lines div,
  .desktop-mock .device-lines div {
    padding: 11px;
  }

  .choice {
    min-height: 68px;
  }
}

@media (max-width: 760px) {
  .image-map .map-card:not(.locked),
  .image-map .map-card.stage-2:not(.locked),
  .image-map .map-card.stage-3:not(.locked),
  .image-map .map-card.stage-4:not(.locked),
  .image-map .map-card.stage-5:not(.locked) {
    width: 21.5%;
    min-height: 13.8%;
    border: 2px solid #fff;
    background: rgba(255, 253, 247, .96);
    color: #231f1b;
    box-shadow: 0 5px 0 rgba(49, 42, 35, .28);
    text-shadow: none;
  }

  .image-map .map-no,
  .image-map .stage-2 .map-no,
  .image-map .stage-3 .map-no,
  .image-map .stage-4 .map-no,
  .image-map .stage-5 .map-no {
    color: #fff;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
  }

  .image-map .map-no {
    background: linear-gradient(180deg, #40d49b, #009a63);
  }

  .image-map .stage-2 .map-no {
    background: linear-gradient(180deg, #ff7d8f, #e7375b);
  }

  .image-map .stage-3 .map-no {
    background: linear-gradient(180deg, #ffb928, #f08200);
  }

  .image-map .stage-4 .map-no {
    background: linear-gradient(180deg, #6a98ff, #335ed0);
  }

  .image-map .stage-5 .map-no {
    background: linear-gradient(180deg, #ff8b6b, #d84738);
  }

  .image-map .map-card strong {
    color: #231f1b;
    font-size: clamp(.6rem, 2.5vw, .92rem);
    line-height: 1.18;
  }

  .image-map .map-card small {
    color: #554b41;
    font-size: clamp(.46rem, 1.8vw, .7rem);
  }

  .image-map .map-card em,
  .image-map .map-card.done em {
    color: #fff;
    background: #0a9a60;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
    font-size: clamp(.46rem, 1.8vw, .68rem);
  }
}
