/* =========================================================
   HANPAN AI — story games
   ========================================================= */

.nav-arcade { color: var(--mute); }

/* ---------- home ---------- */

.ai-hero {
  padding: clamp(52px, 7vw, 90px) 0 clamp(44px, 5.5vw, 68px);
  border-bottom: 1px solid var(--ink);
}
.ai-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
  gap: clamp(44px, 6vw, 100px);
  align-items: end;
}
.ai-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(64px, 8.7vw, 122px);
  line-height: 1.06;
  letter-spacing: -.055em;
  margin: 22px 0 28px;
  word-break: keep-all;
}
.ai-title span { display: block; }
.ai-title .accent { color: var(--accent); }
.ai-lede {
  max-width: 46ch;
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--ink-2);
  word-break: keep-all;
}
.ai-lede strong { font-weight: 600; color: var(--ink); }
.ai-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 26px;
  margin-top: 32px;
}
.ai-engine {
  border-top: 1px solid var(--ink);
  padding-top: 14px;
}
.engine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font: 500 9px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mute);
  padding-bottom: 12px;
}
.engine-live { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.engine-live::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(215,67,37,.12);
}
.engine-model {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.035em;
  padding-bottom: 2px;
  word-break: keep-all;
}
.engine-sub {
  font: 400 10.5px var(--mono);
  letter-spacing: .02em;
  color: var(--mute);
  padding-bottom: 12px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  word-break: keep-all;
}
.engine-sub span { color: var(--ink-2); }
.engine-rows { margin: 0; padding: 0; }
.engine-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.engine-row dt { font-size: 12px; color: var(--mute); }
.engine-row dd {
  font: 500 13px var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.engine-row dd small { font-size: 9px; color: var(--mute); }
.engine-continue {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: none;
  font: 500 11px var(--mono);
  letter-spacing: .04em;
  text-align: left;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.engine-continue:hover { color: var(--accent); border-color: var(--accent); }
.engine-continue .arrow { font-size: 15px; }
.engine-cost {
  margin-top: 14px;
  font: 400 9.5px var(--mono);
  letter-spacing: .03em;
  color: var(--mute);
  text-align: right;
  line-height: 1.7;
}
.engine-stamp {
  margin-top: 16px;
  width: fit-content;
  margin-left: auto;
  border: 1px solid var(--accent);
  color: var(--accent);
  font: 500 8.5px var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 7px 10px 6px;
  transform: rotate(-3deg);
  opacity: .85;
}

.only-mobile { display: none; }

.ai-alert {
  border: 1px solid var(--accent);
  border-left-width: 3px;
  padding: 12px 16px;
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent-deep);
  background: rgba(215,67,37,.04);
}

.ai-games { padding: clamp(46px, 6vw, 76px) 0 clamp(56px, 7vw, 90px); }

.ai-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(250px, auto);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.ai-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  padding: 26px 28px 22px;
  overflow: hidden;
  transition: background .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.ai-card:hover,
.ai-card:focus-visible {
  background: var(--ink);
  color: var(--bg);
  outline: none;
}
.ai-card.is-rpg { grid-column: span 7; grid-row: span 2; padding: 30px 34px 24px; }
.ai-card.is-q20 { grid-column: span 5; }
.ai-card.is-ded { grid-column: span 5; }

.ai-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 500 9px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}
.ai-card:hover .ai-card-top { color: #a99f8d; }
.ai-card-top .live { color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.ai-card-top .live::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.ai-card:hover .live { color: var(--accent); }

.ai-card-main { margin: auto 0; padding: 26px 0 22px; }
.ai-card-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.08;
  letter-spacing: -.045em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.is-rpg .ai-card-title { font-size: clamp(42px, 4.8vw, 62px); }
.ai-card-sub {
  font: 500 8.5px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mute);
}
.ai-card:hover .ai-card-sub { color: #a99f8d; }
.ai-card-desc {
  font-size: 13px;
  line-height: 1.68;
  color: var(--mute);
  margin-top: 9px;
  max-width: 44ch;
  word-break: keep-all;
  transition: color .18s;
}
.ai-card:hover .ai-card-desc { color: #bdb3a0; }
.is-rpg .ai-card-desc { font-size: 14px; max-width: 46ch; }
.ai-card-icon {
  position: absolute;
  right: 26px;
  top: 58px;
  width: 42px;
  height: 42px;
  color: var(--ink);
  opacity: .9;
  transition: color .18s, opacity .18s;
}
.is-rpg .ai-card-icon { width: 78px; height: 78px; top: 64px; right: 32px; }
.ai-card-icon svg { width: 100%; height: 100%; }
.ai-card:hover .ai-card-icon { color: var(--accent); }

.ai-quote {
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 44ch;
  word-break: keep-all;
}
.ai-card:hover .ai-quote { color: #d9d0bd; }
.ai-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font: 400 9px var(--mono);
  letter-spacing: .05em;
  color: var(--mute);
  transition: border-color .18s, color .18s;
}
.ai-card:hover .ai-card-foot { border-color: #3a352c; color: #a99f8d; }
.ai-card-foot .state { color: var(--ink-2); }
.ai-card:hover .ai-card-foot .state { color: var(--bg); }
.ai-card-go {
  font: 500 9px var(--mono);
  letter-spacing: .1em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ai-card:hover .ai-card-go { color: var(--accent); }

.ai-how {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: clamp(36px, 4vw, 54px) 0;
}
.ai-how-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 34px;
  align-items: start;
}
.ai-how h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -.04em;
  line-height: 1.15;
  word-break: keep-all;
}
.ai-how h2 span { display: block; color: var(--mute); font-size: .55em; letter-spacing: .04em; margin-top: 8px; }
.ai-step { border-top: 1px solid var(--ink); padding-top: 14px; }
.ai-step-no {
  font: 500 9px var(--mono);
  letter-spacing: .16em;
  color: var(--accent);
}
.ai-step strong {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -.03em;
  margin: 9px 0 6px;
  font-weight: 700;
}
.ai-step p { font-size: 12px; line-height: 1.7; color: var(--mute); word-break: keep-all; }

.arcade-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 26px;
  font: 500 10px var(--mono);
  letter-spacing: .06em;
  color: var(--mute);
  transition: color .15s;
}
.arcade-strip b { font-weight: 500; color: var(--ink); }
.arcade-strip:hover, .arcade-strip:hover b { color: var(--accent); }

/* ---------- game page ---------- */

.ai-game-page { padding-top: 32px; }
.ai-game-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  padding: 24px 0 30px;
  border-bottom: 1px solid var(--ink);
}
.ai-game-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(46px, 6vw, 78px);
  letter-spacing: -.055em;
  line-height: .98;
  margin: 12px 0 12px;
}
.ai-game-desc {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--mute);
  max-width: 58ch;
  word-break: keep-all;
}
.ai-game-meta { display: flex; flex-wrap: wrap; gap: 12px 34px; padding-bottom: 3px; }
.ai-game-meta .head-stat strong { font-size: 13px; }
.ai-root { padding: 30px 0 60px; }
.ai-game-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 60px;
  border-top: 1px solid var(--line);
  font: 500 10px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ai-game-foot a { color: var(--mute); }
.ai-game-foot a:hover { color: var(--accent); }

/* ---------- shared bits ---------- */

.ai-panel {
  background: var(--panel);
  border: 1px solid var(--ink);
}
.ai-label {
  font: 500 8.5px var(--mono);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--mute);
}
.ai-rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.ai-muted { color: var(--mute); }
.ai-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.ai-field {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 12px 14px;
  font: 400 13px var(--sans);
  min-height: 44px;
  transition: border-color .15s, background .15s;
}
.ai-field::placeholder { color: #a49b88; }
.ai-field:focus { outline: none; border-color: var(--ink); background: #fffdf7; }

.ai-chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font: 500 10px var(--mono);
  letter-spacing: .02em;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
  transition: background .14s, color .14s, border-color .14s;
  word-break: keep-all;
}
.ai-chip:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ai-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff8f0; }

.ai-loading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--mute);
  font: 400 11px var(--mono);
  letter-spacing: .04em;
}
.ai-dots { display: inline-flex; gap: 3px; }
.ai-dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  animation: ai-blink 1.1s infinite ease-in-out;
}
.ai-dots i:nth-child(2) { animation-delay: .15s; }
.ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-blink { 0%, 70%, 100% { opacity: .2; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }

.ai-error {
  border: 1px solid var(--accent);
  border-left-width: 3px;
  background: rgba(215,67,37,.05);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--accent-deep);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.ai-error .btn { flex: 0 0 auto; border-color: var(--accent); color: var(--accent-deep); }
.ai-error .btn:hover { background: var(--accent); color: #fff8f0; }

.ai-cost {
  font: 400 9px var(--mono);
  letter-spacing: .04em;
  color: var(--mute);
}
.ai-model-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 400 9px var(--mono);
  letter-spacing: .04em;
  color: var(--mute);
}
.ai-model-note::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(23,20,15,.45);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: overlay-in .18s ease both;
}
.ai-modal-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 30px;
}
.ai-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.ai-modal-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.ai-modal-close {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  font: 500 18px var(--mono);
  color: var(--mute);
  padding: 2px 4px;
}
.ai-modal-close:hover { color: var(--accent); }

/* ---------- RPG ---------- */

.rpg-start {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(30px, 5vw, 70px);
  border-top: 1px solid var(--ink);
  padding-top: 30px;
}
.rpg-prologue { padding-top: 6px; }
.rpg-prologue h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 4.4vw, 54px);
  line-height: 1.15;
  letter-spacing: -.05em;
  margin: 16px 0 20px;
  word-break: keep-all;
}
.rpg-prologue h2 em { font-style: normal; color: var(--accent); }
.rpg-prologue p {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 48ch;
  word-break: keep-all;
}
.rpg-prologue .prologue-quote {
  margin-top: 26px;
  padding: 16px 0 0 16px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--mute);
}
.rpg-archetypes { border-top: 1px solid var(--ink); align-self: start; }
.rpg-arch {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  padding: 16px 4px;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  transition: background .15s, color .15s, padding .15s;
}
.rpg-arch:hover { background: var(--ink); color: var(--bg); padding-left: 12px; padding-right: 12px; }
.rpg-arch.is-active { background: var(--ink); color: var(--bg); padding-left: 12px; padding-right: 12px; }
.rpg-arch-no { font: 500 9px var(--mono); color: var(--accent); padding-top: 3px; }
.rpg-arch strong {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.035em;
  line-height: 1.2;
}
.rpg-arch p { font-size: 11.5px; line-height: 1.65; color: var(--mute); margin-top: 4px; word-break: keep-all; }
.rpg-arch:hover p, .rpg-arch.is-active p { color: #bdb3a0; }
.rpg-arch-stats { font: 400 9px var(--mono); letter-spacing: .02em; color: var(--mute); text-align: right; white-space: nowrap; padding-top: 4px; }
.rpg-arch:hover .rpg-arch-stats, .rpg-arch.is-active .rpg-arch-stats { color: var(--bg); }
.rpg-start-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}
.rpg-start-actions .note { font: 400 9.5px var(--mono); color: var(--mute); }
.rpg-resume {
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rpg-resume p { font-size: 12px; color: var(--ink-2); }
.rpg-resume .mini { font: 400 9px var(--mono); color: var(--mute); display: block; margin-bottom: 3px; }
.rpg-resume-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.rpg-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: clamp(26px, 4vw, 50px);
  align-items: start;
}
.rpg-main { min-width: 0; }
.rpg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--ink);
  font: 500 9px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
}
.rpg-topbar .loc { color: var(--ink-2); letter-spacing: .02em; text-transform: none; font-family: var(--sans); font-size: 12px; }
.rpg-topbar .ai-model-note { text-transform: none; letter-spacing: .03em; }

.rpg-log {
  max-height: 52vh;
  overflow-y: auto;
  padding: 26px 14px 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.rpg-log::-webkit-scrollbar { width: 8px; }
.rpg-log::-webkit-scrollbar-thumb { background: var(--line-strong); }
.story-gm { padding: 0 0 26px; }
.story-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 8.5px var(--mono);
  letter-spacing: .16em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.story-gm p {
  font-family: var(--serif);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.85;
  color: var(--ink);
  word-break: keep-all;
}
.story-player {
  margin: 0 0 26px 26px;
  padding: 12px 16px;
  border-left: 2px solid var(--line-strong);
  background: var(--panel-2);
}
.story-player .who {
  font: 500 8px var(--mono);
  letter-spacing: .14em;
  color: var(--mute);
  display: block;
  margin-bottom: 5px;
}
.story-player p { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); word-break: keep-all; }
.story-roll {
  margin-top: 8px;
  font: 500 9px var(--mono);
  letter-spacing: .03em;
  color: var(--mute);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.story-roll .ok { color: var(--green); }
.story-roll .fail { color: var(--accent-deep); }
.story-roll .dice {
  border: 1px solid var(--line-strong);
  padding: 2px 5px;
  color: var(--ink);
}
.story-ending {
  border-top: 1px solid var(--ink);
  margin-top: 4px;
  padding: 22px 0 10px;
}
.story-ending .kicker { font: 500 8.5px var(--mono); letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
.story-ending h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -.04em;
  margin: 7px 0 10px;
}
.story-ending p { font-family: var(--serif); font-size: 16px; line-height: 1.8; color: var(--ink-2); word-break: keep-all; }

.rpg-current { border-top: 1px solid var(--ink); padding-top: 18px; }
.rpg-choices { display: flex; flex-direction: column; }
.rpg-choice {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 4px;
  transition: background .14s, color .14s, padding .14s;
}
.rpg-choice:hover { background: var(--ink); color: var(--bg); padding-left: 12px; padding-right: 12px; }
.rpg-choice:disabled { opacity: .4; cursor: default; }
.rpg-choice-no { font: 500 9px var(--mono); color: var(--accent); }
.rpg-choice-text { font-size: 13.5px; line-height: 1.55; word-break: keep-all; }
.rpg-choice-tags { display: flex; gap: 8px; align-items: center; font: 400 8.5px var(--mono); letter-spacing: .03em; color: var(--mute); white-space: nowrap; }
.rpg-choice:hover .rpg-choice-tags { color: #a99f8d; }
.rpg-choice-tags em { font-style: normal; color: var(--accent); }
.rpg-choice:hover .rpg-choice-tags em { color: var(--accent); }

.rpg-custom {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.rpg-custom .ai-field { flex: 1; min-width: 0; }
.rpg-custom .btn { flex: 0 0 auto; }
.rpg-main-note {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font: 400 9px var(--mono);
  color: var(--mute);
  letter-spacing: .02em;
}
.rpg-loading-box {
  padding: 28px 4px;
  border-top: 1px solid var(--line);
}
.rpg-error-slot { margin-top: 12px; }

.rpg-sheet {
  border-top: 1px solid var(--ink);
  position: sticky;
  top: 96px;
}
.rpg-sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.rpg-sheet-head strong { font-family: var(--serif); font-size: 21px; letter-spacing: -.03em; }
.rpg-sheet-head span { font: 400 8.5px var(--mono); color: var(--mute); letter-spacing: .06em; }
.sheet-hp { padding: 14px 0; border-bottom: 1px solid var(--line); }
.sheet-hp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.sheet-hp-top span:first-child { font: 500 8.5px var(--mono); letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.sheet-hp-top strong { font: 500 11px var(--mono); font-variant-numeric: tabular-nums; }
.hp-track { height: 5px; background: var(--line); }
.hp-fill { height: 100%; background: var(--accent); transition: width .3s ease; }
.sheet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.sheet-stat { padding: 12px 0; border-right: 1px solid var(--line); text-align: center; }
.sheet-stat:last-child { border-right: 0; }
.sheet-stat span { display: block; font: 500 8px var(--mono); letter-spacing: .1em; color: var(--mute); text-transform: uppercase; }
.sheet-stat strong { display: block; font: 500 18px var(--mono); margin-top: 3px; font-variant-numeric: tabular-nums; }
.sheet-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.sheet-section h3 {
  font: 500 8px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.sheet-section h3 span { color: var(--line-strong); }
.sheet-list li {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-2);
  padding: 4px 0 4px 12px;
  position: relative;
  word-break: keep-all;
}
.sheet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 1px;
  background: var(--line-strong);
}
.sheet-list .none { padding-left: 0; color: var(--line-strong); font: 400 10px var(--mono); }
.sheet-list .none::before { display: none; }
.sheet-gold { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; font: 400 9px var(--mono); color: var(--mute); }
.sheet-gold strong { color: var(--ink); font-weight: 500; font-size: 12px; }
.sheet-actions { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.sheet-actions .btn { width: 100%; justify-content: space-between; }
.sheet-meta { margin-top: 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.rpg-end {
  border: 1px solid var(--ink);
  background: var(--panel);
  padding: clamp(26px, 4vw, 44px);
  margin-top: 10px;
}
.rpg-end .kicker { font: 500 9px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.rpg-end h2 { font-family: var(--serif); font-size: clamp(34px, 4vw, 48px); letter-spacing: -.045em; margin: 10px 0 14px; line-height: 1.1; }
.rpg-end p { font-family: var(--serif); font-size: 16.5px; line-height: 1.85; color: var(--ink-2); max-width: 62ch; word-break: keep-all; }
.rpg-end-stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 22px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.rpg-end-stats div { display: flex; flex-direction: column; gap: 3px; }
.rpg-end-stats span { font: 500 8px var(--mono); letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.rpg-end-stats strong { font: 500 16px var(--mono); }
.rpg-end-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 20 questions ---------- */

.q20 { max-width: 860px; margin: 0 auto; }
.q20-start {
  border: 1px solid var(--ink);
  background: var(--panel);
  padding: clamp(28px, 4vw, 48px);
}
.q20-start .lead {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.2;
  margin: 12px 0 14px;
  word-break: keep-all;
}
.q20-start .lead em { font-style: normal; color: var(--accent); }
.q20-start p { font-size: 13px; line-height: 1.75; color: var(--mute); max-width: 54ch; word-break: keep-all; }
.q20-cats { display: flex; flex-wrap: wrap; gap: 5px; margin: 24px 0; }
.q20-start-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.q20-record { font: 400 9px var(--mono); color: var(--mute); letter-spacing: .03em; }

.q20-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--ink);
  font: 500 9px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
}
.q20-bar .progress { color: var(--ink); }
.q20-bar .progress b { color: var(--accent); font-weight: 500; }
.q20-bar .record { text-transform: none; letter-spacing: .02em; }
.q20-card {
  border: 1px solid var(--ink);
  background: var(--panel);
  padding: clamp(30px, 5vw, 54px);
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-top: 18px;
  position: relative;
  transition: background .2s, color .2s;
}
.q20-card.is-guess { background: #f6e7df; }
.q20-card.is-ready { background: var(--accent); color: #fff8f0; border-color: var(--accent); }
.q20-card .q-no {
  font: 500 9px var(--mono);
  letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: 16px;
}
.q20-card.is-ready .q-no { color: rgba(255,248,240,.7); }
.q20-question {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.3;
  letter-spacing: -.035em;
  max-width: 24ch;
  word-break: keep-all;
}
.q20-note { margin-top: 14px; font-size: 11.5px; color: var(--mute); line-height: 1.6; }
.q20-card.is-ready .q20-note { color: rgba(255,248,240,.75); }
.q20-answers { width: 100%; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.q20-answers .btn { min-width: 112px; min-height: 48px; font-size: 11px; white-space: nowrap; }
.q20-answers .yes { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.q20-answers .yes:hover { background: var(--accent); border-color: var(--accent); color: #fff8f0; }
.q20-loading { margin-top: 20px; display: flex; justify-content: center; }
.q20-error { margin-top: 16px; }

.q20-log {
  margin-top: 26px;
  border-top: 1px solid var(--ink);
}
.q20-log-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0 8px;
  font: 500 8.5px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}
.q20-log-list { max-height: 38vh; overflow-y: auto; border-top: 1px solid var(--line); }
.q20-log-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.q20-log-row .n { font: 500 9px var(--mono); color: var(--line-strong); }
.q20-log-row .q { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); word-break: keep-all; }
.q20-log-row .a { font: 500 9px var(--mono); letter-spacing: .04em; border: 1px solid var(--line-strong); padding: 2px 6px; color: var(--mute); white-space: nowrap; }
.q20-log-row .a.yes { color: var(--accent-deep); border-color: var(--accent); }
.q20-log-row .a.no { color: var(--ink); }
.q20-log-empty { padding: 14px 0; font-size: 11px; color: var(--line-strong); font-family: var(--mono); }

.q20-result { text-align: center; padding: 20px 0 8px; }
.q20-result .kicker { font: 500 9px var(--mono); letter-spacing: .18em; color: var(--accent); text-transform: uppercase; }
.q20-result h2 { font-family: var(--serif); font-size: clamp(34px, 5vw, 54px); letter-spacing: -.05em; line-height: 1.15; margin: 10px 0 12px; }
.q20-result p { font-size: 13px; color: var(--mute); line-height: 1.7; }
.q20-result-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* ---------- deduction ---------- */

.ded-start {
  border: 1px solid var(--ink);
  background: var(--panel);
  padding: clamp(28px, 4vw, 46px);
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(26px, 4vw, 50px);
}
.ded-start .lead {
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1.12;
  margin: 12px 0 16px;
  word-break: keep-all;
}
.ded-start .lead em { font-style: normal; color: var(--accent); }
.ded-start p { font-size: 13px; line-height: 1.78; color: var(--mute); max-width: 50ch; word-break: keep-all; }
.ded-start-side { border-top: 1px solid var(--ink); align-self: start; }
.ded-start-side .row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--mute);
}
.ded-start-side .row strong { font: 500 12px var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.ded-start-actions { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--ink); padding-top: 18px; }
.ded-start-actions .note { font: 400 9px var(--mono); color: var(--mute); }

.ded-loading {
  border: 1px solid var(--ink);
  background: var(--panel);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 40px;
}
.ded-loading h2 { font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.04em; }
.ded-loading p { font-size: 12px; color: var(--mute); max-width: 48ch; word-break: keep-all; }

.ded-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.ded-case-no { font: 500 9px var(--mono); letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.ded-title { font-family: var(--serif); font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.045em; line-height: 1.15; margin-top: 4px; }
.ded-top-meta { display: flex; gap: 26px; font: 400 9px var(--mono); color: var(--mute); text-align: right; }
.ded-top-meta strong { display: block; font-size: 12px; color: var(--ink); font-weight: 500; margin-top: 3px; }

.ded-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr);
  gap: 30px;
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--line);
}
.ded-brief p { font-family: var(--serif); font-size: 15.5px; line-height: 1.8; color: var(--ink-2); word-break: keep-all; }
.ded-brief .missing { border-left: 1px solid var(--line-strong); padding-left: 16px; }
.ded-brief .missing span { display: block; font: 500 8px var(--mono); letter-spacing: .14em; color: var(--mute); text-transform: uppercase; margin-bottom: 5px; }
.ded-brief .missing strong { font-size: 12.5px; line-height: 1.7; font-weight: 500; color: var(--ink); }

.ded-suspects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 26px;
}
.ded-suspect {
  appearance: none;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  padding: 16px 18px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  transition: background .15s, color .15s;
}
.ded-suspect:hover { background: var(--panel-2); }
.ded-suspect.is-active { background: var(--ink); color: var(--bg); }
.ded-initial {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  width: 38px;
  height: 38px;
  border: 1px solid currentColor;
  display: grid;
  place-items: center;
  line-height: 1;
}
.ded-suspect-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.ded-suspect-role { font: 400 9px var(--mono); color: var(--mute); letter-spacing: .03em; margin-top: 2px; }
.ded-suspect.is-active .ded-suspect-role { color: #a99f8d; }
.ded-suspect-alibi {
  grid-column: 1 / -1;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--mute);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}
.ded-suspect.is-active .ded-suspect-alibi { color: #bdb3a0; }

.ded-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: clamp(24px, 3.5vw, 40px);
  align-items: start;
}
.ded-chat { border: 1px solid var(--ink); background: var(--panel); display: flex; flex-direction: column; min-height: 460px; }
.ded-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.ded-chat-head strong { font-family: var(--serif); font-size: 20px; letter-spacing: -.03em; }
.ded-chat-head .meta { font: 400 8.5px var(--mono); color: var(--mute); display: flex; gap: 10px; align-items: center; }
.ded-log {
  flex: 1;
  max-height: 430px;
  overflow-y: auto;
  padding: 18px 18px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.ded-log::-webkit-scrollbar { width: 8px; }
.ded-log::-webkit-scrollbar-thumb { background: var(--line-strong); }
.ded-turn { margin-bottom: 20px; }
.ded-q {
  font: 500 10.5px var(--mono);
  line-height: 1.6;
  color: var(--mute);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  margin-bottom: 9px;
  word-break: keep-all;
}
.ded-a { font-family: var(--serif); font-size: 15.5px; line-height: 1.8; color: var(--ink-2); word-break: keep-all; }
.ded-a-label { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.ded-a-label span:first-child { font: 500 8px var(--mono); letter-spacing: .12em; color: var(--ink); }
.mood {
  font: 500 8px var(--mono);
  letter-spacing: .04em;
  border: 1px solid var(--line-strong);
  color: var(--mute);
  padding: 1px 5px;
  text-transform: uppercase;
}
.mood.nervous { color: var(--accent-deep); border-color: rgba(215,67,37,.5); }
.mood.angry { color: var(--accent-deep); border-color: var(--accent); }
.mood.sad { color: #4b3f86; }
.model-tag {
  font: 500 8px var(--mono);
  letter-spacing: .04em;
  border: 1px solid var(--line);
  color: var(--line-strong);
  padding: 1px 4px;
  margin-left: auto;
  text-transform: uppercase;
}
.model-tag.reason { color: var(--ink); border-color: var(--line-strong); }
.model-tag.cheap { color: var(--mute); }
.ded-empty { color: var(--line-strong); font: 400 10px var(--mono); line-height: 1.7; padding: 8px 0; }
.ded-compose { border-top: 1px solid var(--line); padding: 12px 14px; }
.ded-suggest { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ded-suggest .ai-chip { font-size: 9px; padding: 5px 8px; }
.ded-input-row { display: flex; gap: 6px; }
.ded-input-row .ai-field { flex: 1; min-width: 0; }
.ded-input-row .btn { flex: 0 0 auto; }
.ded-compose .count { margin-top: 7px; font: 400 8.5px var(--mono); color: var(--mute); display: flex; justify-content: space-between; gap: 10px; }
.ded-compose .count b { color: var(--accent); font-weight: 500; }

.ded-side { position: sticky; top: 96px; }
.ded-side-block { border-top: 1px solid var(--ink); padding: 13px 0 16px; }
.ded-side-block h3 {
  font: 500 8px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.ded-side-block h3 span { color: var(--line-strong); }
.evidence-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.evidence-item:last-child { border-bottom: 0; }
.evidence-item .ev-head { display: flex; gap: 8px; align-items: baseline; }
.evidence-item .ev-no { font: 500 8px var(--mono); color: var(--accent); }
.evidence-item strong { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.evidence-item p { font-size: 10px; line-height: 1.6; color: var(--mute); margin-top: 3px; word-break: keep-all; }
.ded-accuse {
  width: 100%;
  justify-content: space-between;
  border-color: var(--accent);
  color: var(--accent-deep);
  margin-top: 4px;
}
.ded-accuse:hover { background: var(--accent); border-color: var(--accent); color: #fff8f0; }
.ded-side-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ded-side-actions .btn { width: 100%; justify-content: space-between; }
.ded-cost { margin-top: 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.ded-verdict { text-align: center; }
.ded-verdict .kicker { font: 500 9px var(--mono); letter-spacing: .18em; color: var(--accent); text-transform: uppercase; }
.ded-verdict h2 { font-family: var(--serif); font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -.05em; line-height: 1.15; margin: 9px 0 8px; }
.ded-verdict .lead { font-size: 13px; line-height: 1.7; color: var(--mute); }
.ded-verdict .solution {
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-2);
  text-align: left;
  word-break: keep-all;
}
.ded-verdict .clues { display: flex; flex-direction: column; gap: 4px; text-align: left; margin-bottom: 20px; }
.ded-verdict .clues span { font-size: 11px; line-height: 1.6; color: var(--mute); padding-left: 12px; position: relative; }
.ded-verdict .clues span::before { content: ""; position: absolute; left: 0; top: 8px; width: 4px; height: 1px; background: var(--accent); }
.ded-verdict-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ded-suspect-pick { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ded-pick {
  appearance: none;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.ded-pick:hover { background: var(--ink); color: var(--bg); }
.ded-pick strong { font-family: var(--serif); font-size: 17px; }
.ded-pick span { font: 400 9px var(--mono); color: var(--mute); }
.ded-pick:hover span { color: #a99f8d; }

/* ---------- deduction series ---------- */

.ded-hub {
  border: 1px solid var(--ink);
  background: var(--panel);
  padding: clamp(26px, 4vw, 46px);
}
.ded-season-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.ded-season-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.14;
  letter-spacing: -.055em;
  margin: 12px 0 16px;
  word-break: keep-all;
}
.ded-season-title em { font-style: normal; color: var(--accent); }
.ded-season-lede { font-size: 15px; line-height: 1.8; color: var(--ink-2); max-width: 54ch; word-break: keep-all; }
.ded-season-side { border-top: 1px solid var(--ink); padding-top: 14px; align-self: start; }
.season-count { display: flex; align-items: baseline; gap: 10px; }
.season-count strong { font-family: var(--serif); font-weight: 700; font-size: 46px; line-height: 1; letter-spacing: -.05em; }
.season-count span { font: 500 11px var(--mono); letter-spacing: .04em; color: var(--mute); }
.season-bar { display: flex; gap: 3px; margin: 14px 0 10px; }
.season-bar i { flex: 1; height: 6px; background: var(--line); }
.season-bar i.is-done { background: var(--ink); }
.season-bar i.is-current { background: var(--accent); }
.season-note { font-size: 13.5px; line-height: 1.7; color: var(--mute); word-break: keep-all; }
.season-record { margin-top: 10px; font: 400 10.5px var(--mono); letter-spacing: .02em; color: var(--mute); }
.ded-resume {
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ded-resume .mini { font: 500 10px var(--mono); letter-spacing: .05em; color: var(--accent); display: block; margin-bottom: 4px; }
.ded-resume p { font-size: 13.5px; color: var(--ink-2); }
.ded-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  margin-top: 22px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.ded-episodes { border-right: 1px solid var(--line); }
.ded-ep {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  text-align: left;
  padding: 17px 18px;
  cursor: pointer;
  align-items: start;
  transition: background .14s, color .14s;
}
.ded-ep:last-child { border-bottom: 0; }
.ded-ep:hover { background: var(--panel-2); }
.ded-ep.is-selected { background: var(--ink); color: var(--bg); }
.ded-ep.is-custom { background: #f6e7df; }
.ded-ep.is-custom:hover { background: #f0dcd1; }
.ded-ep.is-custom.is-selected { background: var(--ink); color: var(--bg); }
.ded-ep.is-custom .ded-ep-no { color: var(--accent); }
.ded-ep.is-custom.is-selected .ded-ep-place,
.ded-ep.is-custom.is-selected .ded-ep-meta { color: #bdb3a0; }
.ded-ep.is-locked { opacity: .55; cursor: not-allowed; }
.ded-ep.is-locked:hover { background: transparent; }
.ded-ep-no { font: 500 10px var(--mono); letter-spacing: .1em; color: var(--accent); padding-top: 4px; }
.ded-ep.is-cleared .ded-ep-no { color: var(--green); }
.ded-ep-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.25; letter-spacing: -.03em; }
.ded-ep-place { display: block; font-size: 13.5px; line-height: 1.55; color: var(--mute); margin-top: 3px; word-break: keep-all; }
.ded-ep-meta { display: block; font: 400 10.5px var(--mono); letter-spacing: .03em; color: var(--mute); margin-top: 5px; }
.ded-ep.is-selected .ded-ep-place,
.ded-ep.is-selected .ded-ep-meta { color: #bdb3a0; }
.ded-ep-detail { padding: 22px 24px; }
.ded-ep-detail-top { display: flex; justify-content: space-between; gap: 12px; font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.ded-ep-detail h3 { font-family: var(--serif); font-weight: 700; font-size: 32px; letter-spacing: -.04em; margin: 10px 0; }
.ded-ep-desc { font-size: 15px; line-height: 1.75; color: var(--ink-2); word-break: keep-all; }
.ded-ep-facts { margin: 16px 0 18px; border-top: 1px solid var(--line); }
.ded-ep-facts div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.ded-ep-facts dt { flex: 0 0 38px; font: 500 10px var(--mono); letter-spacing: .04em; color: var(--mute); }
.ded-ep-facts dd { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); text-align: right; }
.ded-ep-detail .btn { width: 100%; }
.ded-ep-note { margin-top: 10px; font: 400 10px var(--mono); color: var(--mute); }
.ded-ep-question { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--mute); word-break: keep-all; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .ai-hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 48px; }
  .ai-how-grid { grid-template-columns: 1fr 1fr; }
  .ai-how h2 { grid-column: 1 / -1; }
  .rpg-shell { grid-template-columns: minmax(0, 1fr) 260px; gap: 30px; }
  .ded-body { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 860px) {
  .ai-hero-grid { grid-template-columns: 1fr; gap: 38px; }
  .ai-hero-side { max-width: 460px; }
  .ai-grid { grid-template-columns: 1fr 1fr; }
  .ai-card.is-rpg { grid-column: span 2; grid-row: auto; min-height: 400px; }
  .ai-card.is-q20, .ai-card.is-ded { grid-column: span 1; min-height: 300px; }
  .ai-card.is-q20 .ai-card-icon, .ai-card.is-ded .ai-card-icon { position: static; margin-bottom: 18px; }
  .ai-how-grid { grid-template-columns: 1fr; gap: 22px; }
  .ded-season-head { grid-template-columns: 1fr; gap: 22px; }
  .ded-hub-grid { grid-template-columns: 1fr; }
  .ded-episodes { border-right: 0; border-bottom: 1px solid var(--ink); }
  .rpg-start { grid-template-columns: 1fr; }
  .rpg-shell { grid-template-columns: 1fr; }
  .rpg-sheet { position: static; }
  .rpg-log { max-height: 55vh; }
  .ded-start { grid-template-columns: 1fr; }
  .ded-body { grid-template-columns: 1fr; }
  .ded-side { position: static; }
  .ded-log { max-height: 48vh; }
  .ai-game-meta { gap: 12px 24px; }
}

@media (max-width: 640px) {
  .ai-title { font-size: clamp(54px, 17vw, 82px); }
  .ai-lede { font-size: 15px; }
  .ai-hero-actions .btn { width: 100%; }
  .ai-grid { grid-template-columns: 1fr; }
  .ai-card, .ai-card.is-rpg, .ai-card.is-q20, .ai-card.is-ded { grid-column: span 1; grid-row: auto; min-height: 0; padding: 20px 18px; }
  .ai-card.is-rpg { min-height: 380px; padding: 24px 20px 20px; }
  .ai-card-icon, .is-rpg .ai-card-icon { position: static; width: 40px; height: 40px; margin-bottom: 18px; }
  .is-rpg .ai-card-icon { width: 54px; height: 54px; }
  .ai-card-main { padding: 20px 0; }
  .is-rpg .ai-card-title { font-size: 38px; }
  .ai-card-title { font-size: 28px; }
  .ai-quote { font-size: 14.5px; }
  .ai-card-desc { max-width: none; }
  .ai-how-grid { gap: 18px; }
  .arcade-strip { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-nav { gap: 13px; }
  .nav-arcade { display: none; }
  .ai-game-page { padding-top: 22px; }
  .ai-game-head { grid-template-columns: 1fr; gap: 18px; }
  .ai-game-title { font-size: clamp(40px, 13vw, 58px); }
  .ai-game-meta { gap: 10px 22px; }
  .ai-root { padding-top: 20px; }
  .rpg-prologue h2 { font-size: clamp(34px, 10vw, 44px); }
  .rpg-arch { grid-template-columns: 28px minmax(0, 1fr); }
  .rpg-arch-stats { grid-column: 2; text-align: left; padding-top: 0; }
  .rpg-log { max-height: 48vh; padding-top: 18px; }
  .story-gm p { font-size: 15.5px; }
  .story-player { margin-left: 10px; }
  .rpg-choice { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; }
  .rpg-choice-tags { grid-column: 2; justify-content: flex-start; }
  .rpg-custom { flex-direction: column; }
  .rpg-custom .btn { width: 100%; }
  .rpg-start-actions .btn { width: 100%; }
  .rpg-start-actions .note { width: 100%; }
  .rpg-sheet-head strong { font-size: 19px; }
  .q20-start { padding: 24px 20px; }
  .q20-card { padding: 28px 20px; min-height: 250px; }
  .q20-question { font-size: clamp(26px, 8.4vw, 36px); }
  .q20-answers .btn { flex: 1 1 0; min-width: 0; font-size: 10px; padding-left: 6px; padding-right: 6px; }
  .only-mobile { display: inline; }
  .q20-log-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; }
  .ded-start { padding: 24px 20px; }
  .ded-hub { padding: 22px 18px; }
  .ded-season-title { font-size: clamp(32px, 10vw, 42px); }
  .ded-ep { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 14px 8px; }
  .ded-ep-title { font-size: 20px; }
  .ded-ep-detail { padding: 20px 8px; }
  .ded-ep-detail h3 { font-size: 28px; }
  .ded-season-side { padding-top: 12px; }
  .ded-suspects { grid-template-columns: 1fr; }
  .ded-suspect-alibi { -webkit-line-clamp: 2; }
  .ded-brief { grid-template-columns: 1fr; gap: 16px; }
  .ded-brief .missing { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 12px; }
  .ded-log { max-height: 42vh; }
  .ded-input-row { flex-direction: column; }
  .ded-input-row .btn { width: 100%; }
  .ded-top-meta { width: 100%; justify-content: space-between; text-align: left; }
  .ai-modal-card { padding: 22px 18px; }
  .ai-modal-head h2 { font-size: 27px; }
  .ded-verdict-actions, .rpg-end-actions, .q20-result-actions { flex-direction: column; align-items: stretch; }
  .ded-verdict-actions .btn, .rpg-end-actions .btn, .q20-result-actions .btn { width: 100%; }
  .rpg-end { padding: 24px 18px; }
  .rpg-end-actions .btn { flex: 1; }
  .ai-game-foot { font-size: 9px; }
}

/* ---------- readability: larger UI + prose ---------- */

body { font-size: 17px; }
.eyebrow { font-size: 11px; letter-spacing: .15em; }
.btn { font-size: 12px; letter-spacing: .07em; min-height: 42px; padding: 12px 17px; }
.btn--sm { font-size: 10.5px; min-height: 34px; padding: 8px 12px; }
.kbd { font-size: 10.5px; min-width: 25px; height: 24px; }
.nav-link { font-size: 12px; }
.sound-toggle { font-size: 12px; }
.ticker-inner { font-size: 10.5px; }
.game-crumb { font-size: 10.5px; }
.head-stat span { font-size: 9.5px; }
.head-stat strong { font-size: 16px; }
.game-desc { font-size: 15.5px; }
.game-note { font-size: 11px; }
.overlay-text { font-size: 13.5px; }
.toast { font-size: 11.5px; }
.footer-note { font-size: 13px; }
.footer-copy { font-size: 10px; }
.footer-key { font-size: 10.5px; }

.ai-lede { font-size: 18.5px; }
.engine-head { font-size: 10.5px; }
.engine-model { font-size: 32px; }
.engine-sub { font-size: 11px; }
.engine-row dt { font-size: 13.5px; }
.engine-row dd { font-size: 15.5px; }
.engine-row dd small { font-size: 10.5px; }
.engine-continue { font-size: 12.5px; }
.engine-cost { font-size: 11px; line-height: 1.75; }
.engine-stamp { font-size: 9.5px; }
.section-count { font-size: 11px; }
.ai-card-top { font-size: 10.5px; }
.ai-card-sub { font-size: 10px; }
.ai-card-desc { font-size: 15px; line-height: 1.7; }
.is-rpg .ai-card-desc { font-size: 16px; }
.ai-quote { font-size: 18px; }
.ai-card-foot { font-size: 10.5px; }
.ai-card-go { font-size: 10.5px; }
.ai-step-no { font-size: 10.5px; }
.ai-step strong { font-size: 22px; }
.ai-step p { font-size: 14px; }
.arcade-strip { font-size: 12px; }
.ai-game-desc { font-size: 16px; }
.ai-game-meta .head-stat span { font-size: 9.5px; }
.ai-game-meta .head-stat strong { font-size: 14.5px; }
.ai-label { font-size: 10px; }
.ai-field { font-size: 15px; }
.ai-chip { font-size: 11.5px; padding: 8px 11px; }
.ai-error { font-size: 13px; }
.ai-cost { font-size: 10.5px; }
.ai-model-note { font-size: 10px; }

.rpg-prologue p { font-size: 15.5px; }
.rpg-prologue .prologue-quote { font-size: 18px; }
.rpg-arch strong { font-size: 24px; }
.rpg-arch p { font-size: 13px; }
.rpg-arch-stats { font-size: 10.5px; }
.rpg-start-actions .note { font-size: 11px; }
.rpg-resume .mini { font-size: 10px; }
.rpg-resume p { font-size: 14px; }
.rpg-topbar { font-size: 10.5px; flex-wrap: wrap; row-gap: 4px; }
.rpg-topbar .loc { font-size: 14px; }
.story-label { font-size: 10px; }
.story-gm p { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.85; }
.story-player .who { font-size: 9.5px; }
.story-player p { font-size: 14.5px; }
.story-roll { font-size: 10.5px; }
.rpg-choice-no { font-size: 10px; }
.rpg-choice-text { font-size: 15.5px; }
.rpg-choice-tags { font-size: 10px; }
.rpg-main-note { font-size: 10.5px; }
.rpg-sheet-head strong { font-size: 23px; }
.rpg-sheet-head span { font-size: 10px; }
.sheet-hp-top span:first-child { font-size: 10px; }
.sheet-hp-top strong { font-size: 12.5px; }
.sheet-stat span { font-size: 9.5px; }
.sheet-stat strong { font-size: 20px; }
.sheet-section h3 { font-size: 10px; }
.sheet-list li { font-size: 13px; }
.sheet-list .none { font-size: 11.5px; }
.sheet-gold { font-size: 11px; }
.sheet-gold strong { font-size: 13.5px; }
.rpg-end h2 { font-size: clamp(38px, 4.4vw, 52px); }
.rpg-end p { font-size: 18px; }
.rpg-end-stats span { font-size: 9.5px; }
.rpg-end-stats strong { font-size: 18px; }

.q20-start p { font-size: 15px; }
.q20-record { font-size: 10.5px; }
.q20-bar { font-size: 10.5px; flex-wrap: wrap; row-gap: 5px; }
.q20-card .q-no { font-size: 10.5px; }
.q20-note { font-size: 13.5px; }
.q20-answers .btn { font-size: 12.5px; min-height: 50px; }
.q20-log-head { font-size: 10px; }
.q20-log-row { padding: 12px 2px; }
.q20-log-row .n { font-size: 10px; }
.q20-log-row .q { font-size: 14px; }
.q20-log-row .a { font-size: 10.5px; }
.q20-log-empty { font-size: 12px; }
.q20-result p { font-size: 15px; }

.ded-start p { font-size: 15px; }
.ded-start-side .row { font-size: 13px; }
.ded-start-side .row strong { font-size: 14px; }
.ded-start-actions .note { font-size: 10.5px; }
.ded-loading p { font-size: 14px; }
.ded-case-no { font-size: 10.5px; }
.ded-top { gap: 15px; }
.ded-top-meta { font-size: 10.5px; flex-wrap: wrap; row-gap: 6px; }
.ded-top-meta strong { font-size: 14px; }
.ded-brief p { font-size: 17px; }
.ded-brief .missing span { font-size: 9.5px; }
.ded-brief .missing strong { font-size: 14px; }
.ded-suspect-name { display: block; font-size: 21px; }
.ded-suspect-role { display: block; font-size: 10.5px; }
.ded-suspect-alibi { font-size: 12.5px; }
.ded-chat-head strong { font-size: 22px; }
.ded-chat-head .meta { font-size: 10px; }
.ded-q { font-size: 12.5px; }
.ded-a { font-size: 17px; }
.ded-a-label span:first-child { font-size: 9.5px; }
.mood { font-size: 9.5px; }
.ded-empty { font-size: 12px; }
.ded-suggest .ai-chip { font-size: 10.5px; }
.ded-compose .count { font-size: 10px; }
.ded-side-block h3 { font-size: 10px; }
.evidence-item strong { font-size: 13.5px; }
.evidence-item p { font-size: 12.5px; line-height: 1.65; }
.ded-verdict .lead { font-size: 15px; }
.ded-verdict .solution { font-size: 17px; }
.ded-verdict .clues span { font-size: 12.5px; }
.ded-suspect-pick .ded-pick strong { font-size: 19px; }
.ded-pick span { font-size: 10.5px; }

@media (max-width: 640px) {
  .q20-log-row .q { font-size: 13.5px; }
  .ded-suspect-alibi { font-size: 12.5px; }
  .engine-model { font-size: 30px; }
  .engine-sub { font-size: 10.5px; }
}
