/* src/css/tokens.css */
:root {
  --navy: #13203A;
  --atk: #C2412D;
  --def: #1D7A55;
  --con: #2756C5;
  --warn: #9A5B00;
  --atk-bg: #FDF2EF;
  --def-bg: #DFF1E8;
  --con-bg: #E4EBFA;
  --bg: #EEF1F6;
  --surface: #FFFFFF;
  --surface-2: #F4F6FA;
  --fg: #13203A;
  --muted: #4A5670;
  --line: #CBD3E1;
  --grid: rgba(19, 32, 58, .055);
  --shadow: 0 1px 2px rgba(19, 32, 58, .06), 0 12px 32px rgba(19, 32, 58, .10);
  --scrim: rgba(13, 22, 40, .55);
  --p1: #2756C5;
  --p2: #6A4BB5;
  --p3: #A2561A;
  --part: var(--con);
  --s-ink: #13203A;
  --s-fill: #FFFFFF;
  --s-fill2: #EEF2F8;
  --s-line: #5B6884;
  --s-mute: #56627C;
  --s-board: #DDE4F0;
  --pill-atk: #B23A28;
  --pill-def: #1A6E4C;
  --pill-con: #2756C5;
  --pill-mute: #4A5670;
  --pill-warn: #8A5200;
  --spot: rgba(13, 22, 40, .26);
  --f-head:
    "Space Grotesk",
    "Segoe UI",
    system-ui,
    sans-serif;
  --f-body:
    "Inter",
    "Segoe UI",
    system-ui,
    sans-serif;
  --f-mono:
    "JetBrains Mono",
    ui-monospace,
    Consolas,
    monospace;
  --bar-top: 48px;
  --bar-bot: 56px;
  --r: 10px;
  color-scheme: light;
}
:root[data-theme=dark] {
  --atk: #EE7A62;
  --def: #45BD8C;
  --con: #7FA2F2;
  --warn: #E9A84C;
  --atk-bg: #3A1F22;
  --def-bg: #12352A;
  --con-bg: #1A2A4C;
  --bg: #0B1324;
  --surface: #131E34;
  --surface-2: #1A2741;
  --fg: #E8EDF6;
  --muted: #A6B1C6;
  --line: #2D3C5A;
  --grid: rgba(232, 237, 246, .045);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --scrim: rgba(3, 7, 16, .7);
  --p1: #7FA2F2;
  --p2: #AE95EE;
  --p3: #E2A061;
  --s-ink: #E8EDF6;
  --s-fill: #172440;
  --s-fill2: #1F2E4E;
  --s-line: #8D9BB8;
  --s-mute: #A6B1C6;
  --s-board: #0E1830;
  --spot: rgba(0, 0, 0, .38);
  color-scheme: dark;
}
.part-1,
[data-part="1"] {
  --part: var(--p1);
}
.part-2,
[data-part="2"] {
  --part: var(--p2);
}
.part-3,
[data-part="3"] {
  --part: var(--p3);
}

/* src/css/base.css */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1,
h2,
h3 {
  font-family: var(--f-head);
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
  font-weight: 700;
  letter-spacing: -.01em;
}
p,
ul,
ol {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
a {
  color: var(--con);
}
:focus-visible {
  outline: 3px solid var(--con);
  outline-offset: 2px;
}
.mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
.is-hidden {
  visibility: hidden;
}
.kbd {
  font: 600 .75em var(--f-mono);
  padding: .1em .4em;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
html.rm *,
html.rm *::before,
html.rm *::after {
  animation: none !important;
  transition: none !important;
}

/* src/css/layout.css */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--bar-top) minmax(0, 1fr) var(--bar-bot);
}
.topbar,
.bottombar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface);
  border: 0 solid var(--line);
}
.topbar {
  border-bottom-width: 1px;
}
.bottombar {
  border-top-width: 1px;
}
.topbar__where {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
  border: 0;
  background: none;
  padding: 6px 4px;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
}
.topbar__where:hover .topbar__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.topbar__part {
  font-weight: 600;
  font-size: 15px;
  color: var(--part);
}
.topbar__title {
  font: 600 16px var(--f-head);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__dots {
  display: flex;
  gap: 2px;
}
.topbar__dots button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 10px 6px;
  cursor: pointer;
  border-radius: 6px;
}
.topbar__dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
}
.topbar__dots .is-past .dot {
  background: var(--line);
}
.topbar__dots .is-now .dot {
  background: var(--part);
  border-color: var(--part);
}
.topbar__dots .dot__label {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--part);
}
.topbar__dots .is-now .dot__label {
  display: inline;
}
.stagewrap {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
}
.stage {
  position: relative;
  flex: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  touch-action: pan-y;
}
.panel {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.bottombar__pos {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.beatline {
  flex: 1;
  min-width: 60px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.beatline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background:
    linear-gradient(
      90deg,
      var(--part) calc(var(--fill, 0) * 100%),
      var(--line) 0);
}
.beatline .notch {
  position: relative;
  flex: 1;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
.beatline .notch::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px -6px 0 0;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
}
.beatline .notch.is-played::after {
  background: var(--part);
  border-color: var(--part);
}
.beatline[hidden] + .bottombar__pos {
  margin-left: auto;
}
.notes {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bar-bot) + env(safe-area-inset-bottom, 0px));
  height: 30vh;
  z-index: 20;
  padding: 14px max(20px, env(safe-area-inset-right, 0px)) 14px max(20px, env(safe-area-inset-left, 0px));
  background: var(--surface-2);
  border-top: 2px solid var(--part);
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}
.notes__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 15px;
  color: var(--muted);
}
.notes__meta b {
  color: var(--fg);
}
.notes__speaker {
  font-weight: 700;
  color: var(--part);
}
.notes__meta .is-over,
.notes__meta .is-over b {
  color: var(--warn);
  font-weight: 700;
}
.notes__hand {
  font-weight: 600;
  color: var(--warn);
}
.notes__text {
  font-size: clamp(16px, 1.4vw + 4px, 26px);
  max-width: 80ch;
  line-height: 1.45;
}
@media (max-width: 759px) {
  body {
    overflow: auto;
  }
  .app {
    height: auto;
    min-height: 100%;
    grid-template-rows: var(--bar-top) auto;
    padding-bottom: calc(var(--bar-bot) + env(safe-area-inset-bottom, 0px));
  }
  .topbar {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 15;
  }
  .topbar__dots .is-now .dot__label {
    display: none;
  }
  .stagewrap {
    display: block;
    padding-block: 12px;
  }
  .stage {
    width: 100%;
  }
  .stagewrap[data-mode=text] .stage,
  .stagewrap[data-mode=card] .stage {
    aspect-ratio: auto;
    min-height: 60vh;
  }
  .panel {
    margin-top: 12px;
    max-height: none;
    overflow: visible;
  }
  .bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    gap: 6px;
    height: calc(var(--bar-bot) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottombar__pos {
    display: none;
  }
  .notes {
    height: 45vh;
  }
}
@media (max-width: 759px) {
  .stagewrap[data-layout=html] .stage {
    aspect-ratio: auto;
    min-height: 420px;
  }
  .stagewrap[data-layout=html] .step {
    position: relative;
  }
  .stagewrap[data-layout=html] .step.step--stage > .scene-host {
    position: relative;
  }
  .mailapp {
    --u: 5px;
    padding: 44px 8px 8px;
    font-size: 14px;
  }
  .mail {
    grid-template-columns: 1fr;
  }
}

/* src/css/components.css */
.iconbtn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}
.iconbtn:hover:not(:disabled) {
  border-color: var(--con);
}
.iconbtn:disabled {
  opacity: .4;
  cursor: default;
}
.iconbtn[aria-pressed=true] {
  background: var(--con);
  border-color: var(--con);
  color: var(--surface);
}
.iconbtn--next {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
:root[data-theme=dark] .iconbtn--next {
  background: var(--con);
  border-color: var(--con);
  color: var(--bg);
}
.iconbtn i {
  font-style: normal;
  font-size: 12px;
}
.iconbtn .only-phone {
  display: none;
  font-size: 15px;
  font-weight: 700;
}
@media (max-width: 759px) {
  .iconbtn--text span {
    display: none;
  }
  .iconbtn .only-phone {
    display: inline;
  }
}
.btn {
  min-height: 44px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
}
.btn:hover {
  border-color: var(--muted);
}
.btn--primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
:root[data-theme=dark] .btn--primary {
  background: var(--con);
  border-color: var(--con);
  color: var(--bg);
}
.btn--big {
  min-height: 56px;
  padding: 12px 28px;
  font-size: 1.1em;
}
.btn--danger {
  border-color: var(--atk);
  color: var(--atk);
  background: transparent;
}
.btn--danger.is-armed {
  background: var(--atk);
  color: var(--surface);
}
.linkbtn {
  border: 0;
  background: none;
  color: var(--con);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
  min-height: 32px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .2em .75em;
  border-radius: 999px;
  font-weight: 700;
  font-size: .8em;
  border: 2px solid currentColor;
  white-space: nowrap;
}
.pill--atk {
  color: var(--atk);
  background: var(--atk-bg);
}
.pill--def {
  color: var(--def);
  background: var(--def-bg);
}
.pill--con {
  color: var(--con);
  background: var(--con-bg);
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  min-height: 40px;
  padding: 4px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.seg button:last-child {
  border-right: 0;
}
.seg button[aria-pressed=true] {
  background: var(--con);
  color: var(--surface);
}
.toggle {
  min-width: 84px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
}
.toggle[aria-pressed=true] {
  background: var(--def);
  border-color: var(--def);
  color: var(--surface);
}
.term {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: help;
  text-decoration: underline dotted;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: .18em;
  text-decoration-thickness: .06em;
}
.termpop {
  position: fixed;
  z-index: 40;
  max-width: min(360px, calc(100vw - 16px));
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 15px;
}
.termpop b {
  font-family: var(--f-head);
}
.namebox {
  display: grid;
  gap: 8px;
  font-size: 15px;
}
.namebox__hint {
  font-weight: 600;
}
.namebox__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.namebox input {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.namebox__err {
  color: var(--atk);
  font-size: 14px;
  min-height: 1.2em;
}
.namebox__err:empty {
  display: none;
}
.namebox__saved {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.namebox__saved .mark {
  color: var(--def);
  font-weight: 700;
}
.tasks {
  padding: 14px 16px;
  display: grid;
  gap: 9px;
  align-content: start;
  font-size: clamp(14px, .75vw + 6px, 21px);
}
.tasks__title {
  font-size: 1.12em;
}
.tasks__list {
  display: grid;
  gap: 8px;
}
.task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 10px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.task.is-active {
  border-color: var(--con);
  box-shadow: 0 0 0 3px var(--con-bg);
}
.task.is-later {
  opacity: .62;
}
.task.is-done {
  border-color: var(--def);
}
.task__no {
  position: relative;
  width: 1.7em;
  height: 1.7em;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: .85em;
}
.task__no .ck {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.task__no .ck circle {
  fill: var(--surface-2);
  stroke: var(--line);
  stroke-width: 1.5;
}
.task__no .ck path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.task.is-done .task__no .ck circle {
  fill: var(--def);
  stroke: var(--def);
}
.task.is-done .task__no .mono {
  visibility: hidden;
}
.task__no .mono {
  position: relative;
}
.task__state {
  color: var(--def);
  font-weight: 700;
}
.task__where {
  grid-column: 2 / -1;
  margin: 0;
  font-size: .88em;
  color: var(--con);
  font-weight: 600;
}
.where {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--fg);
  border-radius: 999px;
  padding: 4px 10px;
  min-height: 32px;
  font: 600 .78em var(--f-body);
  cursor: pointer;
  white-space: nowrap;
}
.where:hover {
  border-color: var(--con);
}
.tasks__card {
  justify-self: stretch;
}
.tasks__ctl {
  display: grid;
  gap: 10px;
}
.tasks.is-complete .tasks__ctl {
  display: none;
}
.tasks.is-complete .task {
  padding: 6px 10px;
}
.tasks__more {
  justify-self: start;
  font-size: .85em;
}
.ctls {
  display: grid;
  gap: 8px;
}
.btn.ctl {
  min-height: 46px;
  justify-self: stretch;
  font-weight: 700;
}
.btn--atk {
  background: var(--pill-atk);
  border-color: var(--pill-atk);
  color: #fff;
}
.btn--atk[aria-pressed=true] {
  background: var(--surface);
  color: var(--atk);
  border-color: var(--atk);
}
.btn--def {
  background: var(--pill-def);
  border-color: var(--pill-def);
  color: #fff;
}
.btn--con {
  background: var(--pill-con);
  border-color: var(--pill-con);
  color: #fff;
}
.btn.is-off {
  opacity: .45;
  cursor: default;
}
.toggle.ctl {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: 10px;
  text-align: left;
  font-weight: 600;
  color: var(--fg);
}
.toggle__track {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--line);
  transition: background .2s;
}
.toggle__dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: transform .2s;
}
.toggle.ctl[aria-checked=true] {
  border-color: var(--def);
}
.toggle.ctl[aria-checked=true] .toggle__track {
  background: var(--def);
}
.toggle.ctl[aria-checked=true] .toggle__dot {
  transform: translateX(20px);
}
.toggle__label {
  flex: 1;
}
.toggle__state {
  font-size: .85em;
  color: var(--muted);
}
.toggle.ctl[aria-checked=true] .toggle__state {
  color: var(--def);
  font-weight: 700;
}
.segctl {
  display: grid;
  gap: 4px;
}
.segctl__label,
.rng__label {
  font-size: .85em;
  color: var(--muted);
  font-weight: 600;
}
.segctl .seg button {
  min-height: 44px;
  flex: 1;
}
.segctl .seg {
  display: flex;
}
.rng {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: center;
}
.rng input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 32px;
  accent-color: var(--con);
}
.ctls__more {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
}
.ctls__more summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.ctls__more[open] summary {
  margin-bottom: 8px;
}
.quiz {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.quiz__h {
  font-size: .85em;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.quiz__q {
  font-weight: 600;
}
.quiz__o {
  display: grid;
  gap: 6px;
}
.quiz__opt {
  display: flex;
  gap: 8px;
  align-items: center;
  text-align: left;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.quiz__opt:hover {
  border-color: var(--con);
}
.quiz__opt.is-right {
  border-color: var(--def);
  background: var(--def-bg);
}
.quiz__opt.is-wrong {
  border-color: var(--atk);
  background: var(--atk-bg);
}
.quiz__mark {
  width: 1.1em;
  font-weight: 700;
}
.quiz__opt.is-right .quiz__mark {
  color: var(--def);
}
.quiz__opt.is-wrong .quiz__mark {
  color: var(--atk);
}
.quiz__fb {
  margin: 0;
  min-height: 1.3em;
}
.quiz__fb.is-ok b {
  color: var(--def);
}
.quiz__fb.is-bad b {
  color: var(--atk);
}
.step.step--stage > .lab__badge {
  position: absolute;
  left: calc(var(--u) * 2);
  top: calc(var(--u) * 2);
  z-index: 5;
}
.step.step--stage > .lab__step {
  position: absolute;
  right: calc(var(--u) * 2);
  bottom: calc(var(--u) * 2);
  z-index: 5;
  min-height: 44px;
}
.scene-host.is-target {
  animation: host-pulse 1.6s ease-in-out infinite;
}
.scene-host.is-where {
  outline: 0;
  animation: host-where .5s ease-in-out 3;
}
@keyframes host-pulse {
  50% {
    box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--con) 45%, transparent);
  }
}
@keyframes host-where {
  50% {
    box-shadow: inset 0 0 0 9px var(--con);
  }
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--scrim);
  display: grid;
  place-items: center;
  padding: 16px;
}
.ov {
  width: min(1200px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.ov__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ov__head h2 {
  font-size: 24px;
}
.ov__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 16px;
}
.ov__col h3 {
  font: 600 13px/1.3 var(--f-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--part);
  margin-bottom: 8px;
}
.ov__col ol {
  display: grid;
  gap: 6px;
}
.ov__part {
  border: 0;
  background: none;
  padding: 4px 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-align: left;
  min-height: 32px;
}
.ov__item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--part);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}
.ov__item:hover {
  background: var(--surface-2);
}
.ov__item.is-here {
  background: var(--con-bg);
  border-color: var(--con);
}
.ov__no {
  min-width: 1.6em;
  color: var(--part);
}
.ov__name {
  flex: 1;
}
.ov__done {
  font-size: 13px;
  color: var(--def);
  font-weight: 700;
}
.popover {
  position: fixed;
  z-index: 35;
  top: calc(var(--bar-top) + env(safe-area-inset-top, 0px) + 6px);
  right: max(12px, env(safe-area-inset-right, 0px));
  width: min(380px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
  font-size: 15px;
}
.settings__title {
  font-size: 18px;
}
.settings__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.settings__row--reset {
  justify-content: flex-start;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.settings__note {
  font-size: 13px;
  color: var(--muted);
}
.mailapp {
  display: grid;
  padding: calc(var(--u) * 5.6) calc(var(--u) * 1.6) calc(var(--u) * 1.4);
  font-size: calc(var(--u) * 2.2);
}
.mail {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: calc(var(--u) * 1.6);
  min-height: 0;
}
.mail__list {
  display: grid;
  gap: calc(var(--u) * 1);
  align-content: start;
  border-radius: 10px;
}
.mail__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  padding: calc(var(--u) * .7) calc(var(--u) * 1.1);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.mail__row.is-open {
  border-color: var(--con);
  box-shadow: 0 0 0 2px var(--con-bg);
}
.mail__row.is-bounced {
  opacity: .6;
}
.mail__open {
  display: grid;
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.mail__subj {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail__from,
.mail__rtlout,
.mail__real {
  grid-column: 1 / -1;
}
.mail__from {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .9em;
}
.mail__rtl,
.mail__marks button {
  min-height: 32px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--fg);
  font: 600 .85em var(--f-body);
  cursor: pointer;
}
.mail__marks {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mail__marks .mail__verdict {
  flex-basis: 100%;
  text-align: right;
}
.mail__marks button[aria-pressed=true][data-mark=phish] {
  background: var(--pill-atk);
  border-color: var(--pill-atk);
  color: #fff;
}
.mail__marks button[aria-pressed=true][data-mark=real] {
  background: var(--pill-def);
  border-color: var(--pill-def);
  color: #fff;
}
.mail__verdict {
  font-weight: 700;
  font-size: .9em;
}
.mail__verdict.is-ok {
  color: var(--def);
}
.mail__verdict.is-bad {
  color: var(--atk);
}
.mail__rtlout,
.mail__real {
  margin: 0;
  font-size: .9em;
  color: var(--fg);
  background: var(--con-bg);
  border-radius: 6px;
  padding: 3px 8px;
}
.mail__bounce {
  margin: 0;
  font-weight: 700;
  color: var(--atk);
}
.mail__read {
  display: grid;
  gap: calc(var(--u) * .9);
  align-content: start;
  padding: calc(var(--u) * 1.4);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-width: 0;
}
.mail__h,
.mail__meta,
.mail__subjb {
  margin: 0;
  word-break: break-word;
}
.mail__meta {
  font-size: .9em;
  color: var(--muted);
}
.mail__subjb {
  font-weight: 700;
}
.mail__link {
  justify-self: start;
  border: 0;
  background: none;
  padding: 4px 0;
  min-height: 32px;
  color: var(--con);
  text-decoration: underline;
  font: 600 1em var(--f-mono);
  cursor: pointer;
  word-break: break-all;
  text-align: left;
}
.auth {
  display: inline-block;
  margin: 0 4px 2px 0;
  padding: 0 6px;
  border-radius: 6px;
  font: 600 .85em var(--f-mono);
}
.auth--pass {
  background: var(--def-bg);
  color: var(--def);
}
.auth--fail,
.auth--none {
  background: var(--atk-bg);
  color: var(--atk);
}
.mail__toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 2);
  transform: translateX(-50%);
  max-width: 70%;
  margin: 0;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 2px solid var(--def);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.mail__list.is-target {
  border-radius: 10px;
}
.chain__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.chain__hint,
.chain__msg {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .85em;
  color: var(--muted);
}
.chain__msg {
  color: var(--atk);
  font-weight: 600;
  min-height: 1.2em;
}
.dcard {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 7px 9px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: .82em;
  cursor: pointer;
}
.dcard span {
  color: var(--muted);
  font-size: .9em;
}
.dcard[aria-pressed=true] {
  border-color: var(--def);
  background: var(--def-bg);
  box-shadow: 0 0 0 2px var(--def);
}
.inrow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.inrow input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font: 600 1em var(--f-mono);
}
.inrow__msg {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .85em;
  color: var(--warn);
  min-height: 0;
}
.stagewrap[data-mode=narr] .panel {
  order: -1;
  overflow: hidden;
}
.narr {
  --nf: 1;
  display: grid;
  gap: .55em;
  align-content: start;
  padding: 16px 18px;
  font-size: calc(clamp(14px, 1.34vw, 28px) * var(--nf));
  line-height: 1.38;
}
.narr .eyebrow {
  margin: 0;
  font: 600 .72em/1.2 var(--f-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--part);
}
.narr__title {
  margin: 0;
  font: 700 1.25em/1.15 var(--f-head);
}
.narr__goal {
  margin: 0;
  padding: .35em .6em;
  border-left: 4px solid var(--atk);
  font-weight: 700;
  background: var(--surface-2);
  border-radius: 0 6px 6px 0;
}
.narr.is-defense .narr__goal {
  border-color: var(--def);
}
.narr__list {
  display: grid;
  gap: .5em;
  margin: 0;
  padding: 0;
  list-style: none;
}
.narr__list li {
  display: grid;
  grid-template-columns: 1.6em 1fr;
  gap: .5em;
  align-items: start;
  transition: opacity .3s;
}
.narr__no {
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--line);
  font-weight: 700;
  font-size: .85em;
}
.narr__list li.is-now {
  opacity: 1;
  font-weight: 600;
}
.narr__list li.is-now .narr__no {
  background: var(--part);
  border-color: var(--part);
  color: #fff;
}
.narr.is-attack .narr__list li.is-now .narr__no {
  background: var(--pill-atk);
  border-color: var(--pill-atk);
}
.narr.is-defense .narr__list li.is-now .narr__no {
  background: var(--pill-def);
  border-color: var(--pill-def);
}
.narr__list li.is-past {
  opacity: .6;
}
.narr__list li.is-later {
  visibility: hidden;
}
.narr.is-tight {
  line-height: 1.25;
}
.narr.is-tight .narr__list li.is-past {
  line-height: 1.18;
}
.narr__why {
  padding: .5em .7em;
  border-radius: 8px;
  background: var(--def-bg);
  border: 2px solid var(--def);
  visibility: hidden;
}
.narr__why b {
  color: var(--def);
}
.narr__why.is-on {
  visibility: visible;
}
.balloon.balloon--num {
  max-width: none;
  width: 1.8em;
  height: 1.8em;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 700 calc(var(--u) * 3.4) var(--f-mono);
  background: var(--part);
  color: #fff;
  border: 3px solid var(--surface);
}
.step--scene.is-attack .balloon--num {
  background: var(--pill-atk);
}
.step--scene.is-defense .balloon--num {
  background: var(--pill-def);
}
.step--lab .balloon {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.step--define {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: calc(var(--u) * 3) calc(var(--u) * 4);
}
.define__head {
  display: grid;
  gap: calc(var(--u) * 2);
}
.define__def {
  font-size: calc(var(--u) * 3.3);
  max-width: 36em;
  line-height: 1.4;
}
.define__icon {
  width: calc(var(--u) * 26);
  height: calc(var(--u) * 22);
  align-self: start;
}
.facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--u) * 1.6);
  margin: 0;
}
.fact {
  padding: calc(var(--u) * 1.4) calc(var(--u) * 2);
  border-radius: 12px;
  background: var(--surface-2);
  border: 2px solid var(--line);
}
.fact dt {
  font: 600 var(--fs-label)/1.2 var(--f-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact dd {
  margin: calc(var(--u) * .5) 0 0;
  font-weight: 600;
}
.fact--atk {
  border-color: var(--atk);
  background: var(--atk-bg);
}
.fact--atk dt {
  color: var(--atk);
}
.fact--con {
  border-color: var(--con);
  background: var(--con-bg);
}
.fact--con dt {
  color: var(--con);
}
.concept__lead {
  font-size: calc(var(--u) * 2.8);
  color: var(--muted);
  margin: calc(var(--u) * -1) 0 0;
}
.tasks__eye {
  margin: 0;
  font: 600 .72em/1.2 var(--f-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--part);
}
@media (max-width: 759px) {
  .stagewrap[data-mode=narr] .panel {
    order: 0;
    overflow: visible;
  }
  .narr {
    font-size: 15px;
  }
  .step--define {
    grid-template-columns: 1fr;
  }
  .define__icon {
    display: none;
  }
  .facts {
    grid-template-columns: 1fr;
  }
}

/* src/css/stage.css */
.step {
  --u: var(--su, .9vh);
  --fs-display: calc(var(--u) * 7.4);
  --fs-title: calc(var(--u) * 5.9);
  --fs-body: calc(var(--u) * 3);
  --fs-label: calc(var(--u) * 2.2);
  position: absolute;
  inset: 0;
  padding: calc(var(--u) * 6) calc(var(--u) * 7);
  font-size: var(--fs-body);
  line-height: 1.4;
  display: grid;
  align-content: center;
  gap: calc(var(--u) * 3);
}
.step .display {
  font-size: var(--fs-display);
}
.step .title {
  font-size: var(--fs-title);
}
.step .eyebrow {
  font: 600 var(--fs-label)/1.2 var(--f-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--part);
}
.step .source {
  position: absolute;
  right: calc(var(--u) * 3);
  bottom: calc(var(--u) * 2.4);
  font-size: calc(var(--u) * 1.9);
  color: var(--muted);
}
.todo {
  border: 2px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  padding: calc(var(--u) * 1.4) calc(var(--u) * 2);
  font-size: var(--fs-label);
  display: grid;
  place-items: center;
  text-align: center;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--u) * 1.2);
}
.chips li {
  padding: calc(var(--u) * .8) calc(var(--u) * 1.8);
  border-radius: 999px;
  background: var(--con-bg);
  color: var(--con);
  font: 600 var(--fs-label) var(--f-mono);
}
.scene__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(
      90deg,
      var(--grid) 1px,
      transparent 1px),
    radial-gradient(
      ellipse at 50% 40%,
      var(--surface) 0%,
      var(--surface-2) 100%);
  background-size:
    40px 40px,
    40px 40px,
    100% 100%;
}
.step.step--stage {
  padding: 0;
}
.step.step--stage > .scene-host {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.scene__layers {
  position: absolute;
  inset: 0;
}
.scene__flood,
.scene__flood canvas,
.scene__pk {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scene__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  color: var(--s-ink);
}
.scene__over {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.scene__over > * {
  pointer-events: auto;
}
.step.step--stage > .scene__head {
  position: absolute;
  left: calc(var(--u) * 2.4);
  top: calc(var(--u) * 2.2);
  z-index: 5;
  pointer-events: none;
  padding: calc(var(--u) * .5) calc(var(--u) * 1.8) calc(var(--u) * .5) calc(var(--u) * .6);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 1px 3px rgba(19, 32, 58, .08);
}
.scene text {
  font-family: var(--f-body);
  fill: var(--s-ink);
}
.scene .t-m {
  font-family: var(--f-mono);
}
.scene .t-mute {
  fill: var(--s-mute);
}
.scene .t-atk {
  fill: var(--atk);
}
.scene .t-def {
  fill: var(--def);
}
.scene .t-con {
  fill: var(--con);
}
.scene .t-warn {
  fill: var(--warn);
}
.ic-b {
  fill: var(--s-fill);
  stroke: var(--s-line);
  stroke-width: 2;
}
.ic-b2 {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 2;
}
.ic-l {
  fill: none;
  stroke: var(--s-line);
  stroke-width: 2;
  stroke-linecap: round;
}
.ic-scr {
  fill: var(--s-board);
  stroke: none;
}
.bot-sq {
  fill: var(--atk);
}
.ic-cloud {
  stroke: var(--atk);
}
.led {
  fill: var(--s-line);
}
.led.on {
  fill: var(--def);
}
.led.bad {
  fill: var(--atk);
}
.led.con {
  fill: var(--con);
}
.shield-ic {
  fill: var(--def-bg);
  stroke: var(--def);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.shield-ck {
  fill: none;
  stroke: var(--def);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wire {
  fill: none;
  stroke: var(--s-line);
  stroke-width: 3.2;
  stroke-linecap: round;
  opacity: .85;
}
.wire--atk.is-hot {
  stroke: var(--atk);
  opacity: 1;
  stroke-dasharray: 9 8;
}
.wire--ok {
  stroke: var(--def);
  stroke-width: 5;
  opacity: 1;
}
.pill-bg {
  stroke: none;
}
.pill-atk {
  fill: var(--pill-atk);
}
.pill-def {
  fill: var(--pill-def);
}
.pill-con {
  fill: var(--pill-con);
}
.pill-mute {
  fill: var(--pill-mute);
}
.pill-warn {
  fill: var(--pill-warn);
}
.scene .pill-tx {
  fill: #fff;
}
.sock {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 2;
  transition: fill .15s;
}
.sock.legit {
  fill: var(--warn);
  stroke: var(--warn);
}
.sock.fake {
  fill: var(--atk);
  stroke: var(--atk);
}
.sock.off {
  fill: var(--s-fill2);
  stroke: var(--s-mute);
  opacity: .45;
}
.sock.gone {
  display: none;
}
.void-el {
  fill: none;
  stroke: var(--s-mute);
  stroke-width: 2;
  stroke-dasharray: 6 7;
}
.okbar__bg {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.okbar__v {
  fill: var(--def);
}
.okbar__v.is-bad {
  fill: var(--atk);
}
.spot {
  position: absolute;
  inset: 0;
  pointer-events: none !important;
}
.balloon {
  position: absolute;
  max-width: min(44%, calc(var(--u) * 70));
  margin: 0;
  padding: calc(var(--u) * 1.6) calc(var(--u) * 2.2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--fg);
  border: 2px solid var(--part);
  box-shadow: var(--shadow);
  font-size: calc(var(--u) * 2.9);
  line-height: 1.35;
  font-weight: 500;
}
.step--scene.is-attack .balloon {
  border-color: var(--atk);
}
.step--scene.is-defense .balloon {
  border-color: var(--def);
}
.mag {
  position: absolute;
  z-index: 6;
  min-width: 220px;
  max-width: min(340px, 90%);
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: clamp(12px, calc(var(--u) * 1.9), 18px);
  padding: 10px 12px;
}
.mag h4 {
  font: 700 1.05em/1.2 var(--f-head);
  margin: 0 0 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.mag table {
  border-collapse: collapse;
  width: 100%;
}
.mag td {
  padding: 3px 4px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.mag td:first-child {
  color: var(--muted);
  white-space: nowrap;
}
.mag td:last-child {
  font-family: var(--f-mono);
  word-break: break-all;
}
.mag .is-bad {
  color: var(--atk);
  font-weight: 700;
}
.mag__note {
  margin: 6px 0 0;
  color: var(--muted);
}
.mag__x {
  border: 0;
  background: var(--surface-2);
  color: var(--fg);
  border-radius: 8px;
  min-width: 32px;
  min-height: 32px;
  cursor: pointer;
}
.step--scene,
.step--chain,
.step--lab {
  align-content: start;
}
.step--scene > :not(.scene__bg),
.step--chain > :not(.scene__bg),
.step--lab > :not(.scene__bg) {
  position: relative;
  z-index: 1;
}
.scene__head {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 2);
  font-size: var(--fs-label);
}
.scene__title {
  font: 700 calc(var(--u) * 4) var(--f-head);
}
.step--scene .todo,
.step--lab .todo,
.step--chain .todo {
  min-height: calc(var(--u) * 30);
}
.lab__badge {
  justify-self: start;
  padding: calc(var(--u) * .8) calc(var(--u) * 1.8);
  border-radius: 999px;
  background: var(--con);
  color: var(--surface);
  font-weight: 600;
  font-size: var(--fs-label);
}
.step--intro {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.intro__world {
  position: relative;
  height: calc(var(--u) * 74);
  transition: transform .8s cubic-bezier(.4, 0, .2, 1);
  transform-origin: 30% 50%;
}
.step--intro.is-parts .intro__world {
  transform: scale(.72) translateX(-14%);
}
.globe-host {
  position: absolute;
  inset: 0;
}
.globe-host canvas,
.map2d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.map2d {
  object-fit: contain;
}
.map2d__d {
  fill: var(--s-ink);
  opacity: .5;
}
.map2d__atk {
  opacity: 0;
  transition: opacity .4s;
}
.map2d.is-on .map2d__atk {
  opacity: 1;
}
.map2d__arc {
  fill: none;
  stroke: var(--atk);
  stroke-width: 1.4;
  opacity: .55;
  stroke-dasharray: 6 5;
  animation: arc-flow 1.2s linear infinite;
}
.map2d__bot {
  fill: var(--atk);
}
.map2d__ring {
  fill: none;
  stroke: var(--atk);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: ring-grow 1.6s ease-out infinite;
}
@keyframes arc-flow {
  to {
    stroke-dashoffset: -22;
  }
}
@keyframes ring-grow {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}
html.rm .map2d__arc,
html.rm .map2d__ring {
  animation: none;
}
html.rm .intro__world {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .map2d__arc,
  .map2d__ring {
    animation: none;
  }
  .intro__world {
    transition: none;
  }
}
.intro__text {
  display: grid;
  gap: calc(var(--u) * 2.4);
  align-content: center;
}
.intro__counter {
  display: grid;
  gap: calc(var(--u) * .6);
}
.intro__num {
  font-size: calc(var(--u) * 8);
  font-weight: 600;
  color: var(--atk);
  line-height: 1;
}
.intro__sub {
  font-size: var(--fs-label);
  color: var(--muted);
  max-width: 34em;
}
.intro__parts {
  display: grid;
  gap: calc(var(--u) * 1);
  font-weight: 600;
}
.intro__parts li {
  padding-left: calc(var(--u) * 2);
  border-left: calc(var(--u) * .5) solid var(--line);
}
.intro__parts li:nth-child(1) {
  border-color: var(--p1);
}
.intro__parts li:nth-child(2) {
  border-color: var(--p2);
}
.intro__parts li:nth-child(3) {
  border-color: var(--p3);
}
.intro__name {
  position: absolute;
  right: calc(var(--u) * 3);
  bottom: calc(var(--u) * 6);
  width: min(46%, 520px);
  font-size: 15px;
}
.intro__name .namebox {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.agenda__boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--u) * 2.4);
}
.agenda__boxes li {
  display: grid;
  gap: calc(var(--u) * 1.4);
  padding: calc(var(--u) * 3);
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font: 700 calc(var(--u) * 3.6)/1.2 var(--f-head);
}
.agenda__no {
  font-size: calc(var(--u) * 5);
  color: var(--con);
}
.agenda__foot {
  font-size: calc(var(--u) * 3.2);
}
.underline {
  text-decoration: underline;
  text-decoration-color: var(--atk);
  text-decoration-thickness: .12em;
  text-underline-offset: .18em;
  font-weight: 700;
}
.step--section {
  border-top: calc(var(--u) * 1.2) solid var(--part);
}
.section__no {
  font-size: calc(var(--u) * 14);
  font-weight: 600;
  color: var(--part);
  line-height: 1;
}
.section__topics {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--u) * 1.6);
}
.section__topics li {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.2);
  padding: calc(var(--u) * 1.2) calc(var(--u) * 2.2);
  border-radius: 10px;
  border: 2px solid var(--part);
  font-weight: 600;
}
.topic-no {
  color: var(--part);
}
.step--concept {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: calc(var(--u) * 5);
}
.concept__text {
  display: grid;
  gap: calc(var(--u) * 3);
}
.bullets {
  display: grid;
  gap: calc(var(--u) * 2);
}
.bullets li {
  padding-left: calc(var(--u) * 3);
  position: relative;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: calc(var(--u) * 1.2);
  height: calc(var(--u) * 1.2);
  border-radius: 50%;
  background: var(--part);
}
.concept__visual {
  position: relative;
  height: calc(var(--u) * 80);
  display: grid;
}
.concept__visual > .scene-host {
  position: absolute;
  inset: 0;
}
.concept__visual .scene {
  border-radius: 12px;
}
.step--incident {
  align-content: stretch;
}
.incident {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: calc(var(--u) * 4);
  align-items: center;
}
.incident__text {
  display: grid;
  gap: calc(var(--u) * 1.8);
}
.incident__stat {
  font-size: calc(var(--u) * 9);
  font-weight: 600;
  line-height: 1;
  color: var(--atk);
}
.incident__line {
  max-width: 34em;
}
.incident__k {
  display: block;
  font: 600 var(--fs-label)/1.3 var(--f-body);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.incident__visual {
  display: grid;
  place-items: center;
}
.mini {
  width: 100%;
  max-height: calc(var(--u) * 58);
}
.recap__rows {
  display: grid;
  gap: calc(var(--u) * 2);
}
.recap__rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: calc(var(--u) * 2);
  align-items: center;
  padding: calc(var(--u) * 1.6) calc(var(--u) * 2.4);
  border-radius: 10px;
  background: var(--surface-2);
  border-left: calc(var(--u) * .6) solid var(--part);
}
.recap__atk {
  font-weight: 600;
}
.recap__arrow {
  color: var(--muted);
}
.recap__def {
  color: var(--def);
  font-weight: 600;
}
.chain__links {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: calc(var(--u) * 1.6);
}
.chain__links li {
  padding: calc(var(--u) * 2);
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  font-weight: 600;
  font-size: var(--fs-label);
}
.step--matrix {
  gap: calc(var(--u) * 2);
  padding-block: calc(var(--u) * 4);
}
.matrix__wrap {
  overflow: auto;
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(var(--u) * 2.3);
}
.matrix th,
.matrix td {
  text-align: left;
  padding: calc(var(--u) * .8) calc(var(--u) * 1.4);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.matrix thead th {
  font-size: calc(var(--u) * 1.9);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.matrix tbody th {
  font-family: var(--f-head);
}
.matrix tbody td:last-child {
  color: var(--def);
  font-weight: 600;
}
.matrix__foot {
  font: 700 calc(var(--u) * 3) var(--f-head);
}
.activity__link {
  font-size: calc(var(--u) * 6);
  font-weight: 600;
}
.step--quiz {
  justify-items: start;
}
.quiz__pending {
  font-size: calc(var(--u) * 3.4);
  font-weight: 600;
  color: var(--muted);
}
.quiz__foot {
  color: var(--muted);
}
.step--card,
.step--summary {
  justify-items: center;
  align-content: center;
  gap: calc(var(--u) * 2.4);
  padding-block: calc(var(--u) * 4);
}
.card {
  width: min(100%, calc(var(--u) * 120));
  display: grid;
  gap: calc(var(--u) * 1.6);
  padding: calc(var(--u) * 3.4) calc(var(--u) * 4);
  border-radius: 14px;
  background: var(--surface);
  border: 2px solid var(--part);
  box-shadow: var(--shadow);
  font-size: calc(var(--u) * 2.6);
}
.card__topic {
  font: 700 var(--fs-label) var(--f-body);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--part);
}
.card__name {
  font: 700 calc(var(--u) * 5.4)/1.1 var(--f-head);
}
.card__placeholder {
  color: var(--muted);
  font-weight: 500;
}
.card__no {
  color: var(--muted);
}
.card__tasks,
.card__rows {
  display: grid;
  gap: calc(var(--u) * .7);
}
.card__rows {
  grid-template-columns: 1fr 1fr;
  column-gap: calc(var(--u) * 3);
  font-size: calc(var(--u) * 2.2);
}
.card__tasks li,
.card__rows li {
  display: flex;
  gap: calc(var(--u) * 1);
  align-items: baseline;
}
.card__rows b,
.card__tasks b {
  margin-left: auto;
  padding-left: calc(var(--u) * 1.5);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.card .mark {
  width: 1.2em;
  font-weight: 700;
  color: var(--muted);
}
.card .is-done .mark,
.card .is-done b {
  color: var(--def);
}
.card__learned {
  padding-top: calc(var(--u) * 1.4);
  border-top: 1px solid var(--line);
}
.card__total {
  font-size: calc(var(--u) * 3.2);
}
.card__form {
  width: min(100%, calc(var(--u) * 120));
  font-size: 15px;
}
.card__tip {
  color: var(--muted);
  font-size: calc(var(--u) * 2);
}
@media (max-width: 759px) {
  .stagewrap[data-mode=text] .step,
  .stagewrap[data-mode=card] .step {
    --u: 5.4px;
    position: relative;
    padding: 20px 18px;
  }
  .stagewrap[data-mode=scene] .step,
  .stagewrap[data-mode=lab] .step {
    padding: 10px 12px;
  }
  .step--intro,
  .step--concept {
    grid-template-columns: 1fr;
  }
  .intro__world {
    height: 220px;
  }
  .step--intro.is-parts .intro__world {
    transform: none;
  }
  .intro__name {
    position: static;
    width: auto;
  }
  .agenda__boxes {
    grid-template-columns: 1fr;
  }
  .recap__rows li {
    grid-template-columns: 1fr;
  }
  .recap__arrow {
    display: none;
  }
  .card__rows {
    grid-template-columns: 1fr;
  }
  .step--matrix .matrix {
    font-size: 13px;
  }
}
.bar__bg {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 2;
}
.bar__v {
  fill: var(--def);
}
.bar__v.is-warm {
  fill: var(--warn);
}
.bar__v.is-full {
  fill: var(--atk);
}
.bot-dot {
  fill: var(--atk);
  transition: opacity .2s;
}
.cmd-line {
  stroke: var(--atk);
  stroke-width: 1.4;
  stroke-dasharray: 3 5;
  fill: none;
}
.hdr-card {
  fill: var(--s-fill);
  stroke: var(--s-line);
  stroke-width: 2.5;
}
.hdr-row {
  fill: var(--s-fill2);
  stroke: none;
}
.hdr-row.is-bad {
  fill: var(--atk-bg);
  stroke: var(--atk);
  stroke-width: 2;
}
.cbox__r {
  fill: var(--s-fill);
  stroke: var(--s-line);
  stroke-width: 2.5;
}
.cbox__r--now {
  stroke: var(--con);
  stroke-width: 3;
}
.cbox__r.is-hi {
  fill: var(--con-bg);
  stroke: var(--con);
  stroke-width: 4;
}
.tube {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 3;
}
.tube__v {
  fill: var(--def);
}
.tube__v.is-warm {
  fill: var(--warn);
}
.tube__v.is-full {
  fill: var(--atk);
}
.tube__max {
  stroke: var(--atk);
  stroke-width: 3;
  stroke-dasharray: 6 5;
}
.axis {
  stroke: var(--s-line);
  stroke-width: 3;
  fill: none;
}
.axis__mk {
  fill: var(--con);
}
.crt {
  fill: #0E1830;
  stroke: var(--s-line);
  stroke-width: 2;
}
.scene .crt__t,
.mini .crt__t {
  fill: #7FE0B0;
}
.lock__s {
  fill: none;
  stroke: var(--s-line);
  stroke-width: 9;
  stroke-linecap: round;
  transform-box: fill-box;
}
.lock__b {
  fill: var(--def);
}
.lock__ck {
  fill: none;
  stroke: #fff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mini text {
  font-family: var(--f-body);
  fill: var(--fg);
}
.mini .t-mute {
  fill: var(--muted);
}
.mini .t-m {
  font-family: var(--f-mono);
}
.wire--thin {
  stroke-width: 2;
  stroke-dasharray: 5 6;
}
.panel-svg {
  fill: var(--s-fill);
  stroke: var(--s-line);
  stroke-width: 2.5;
}
.mrow {
  fill: var(--s-fill2);
  stroke: none;
}
.mrow.is-rej {
  opacity: .45;
}
.strike {
  stroke: var(--atk);
  stroke-width: 3;
}
.env {
  fill: var(--s-fill);
  stroke: var(--atk);
  stroke-width: 2.5;
}
.env__flap {
  fill: none;
  stroke: var(--atk);
  stroke-width: 2;
}
.scene .link-svg {
  fill: var(--con);
  text-decoration: underline;
}
.dom-part {
  transition: fill .2s;
}
.scene .dom-part.is-con {
  fill: var(--con);
}
.scene .dom-part.is-atk {
  fill: var(--atk);
  text-decoration: underline;
}
.seal {
  fill: var(--atk-bg);
  stroke: var(--atk);
  stroke-width: 2.5;
}
.seal__x {
  stroke: var(--atk);
  stroke-width: 3;
  stroke-linecap: round;
}
.crow {
  fill: var(--s-fill2);
  stroke: none;
}
.crow.is-ok {
  fill: var(--def-bg);
}
.crow.is-bad {
  fill: var(--atk-bg);
  stroke: var(--atk);
  stroke-width: 2;
}
.crow.is-warn {
  fill: color-mix(in srgb, var(--warn) 22%, var(--s-fill));
  stroke: var(--warn);
  stroke-width: 2;
}
.addr {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.page {
  fill: var(--s-fill2);
  stroke: none;
}
.page.is-ok {
  fill: var(--def-bg);
}
.page.is-bad {
  fill: var(--atk-bg);
  stroke: var(--atk);
  stroke-width: 4;
}
.field {
  fill: var(--s-fill);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.tunnel {
  fill: none;
  stroke: var(--def);
  stroke-width: 22;
  stroke-linecap: round;
  opacity: .3;
}
.is-same text {
  fill: #FF9C85 !important;
  font-weight: 700;
}
.scene .salt {
  fill: var(--con);
  font-weight: 700;
}
.tick {
  stroke: var(--s-line);
  stroke-width: 2;
}
.tbar {
  fill: var(--atk);
}
.tbar.is-ok {
  fill: var(--def);
}
.hbox {
  fill: var(--con-bg);
  stroke: var(--con);
  stroke-width: 3;
}
.warn-tri {
  fill: var(--atk);
}
.stuff--ok {
  fill: var(--def-bg);
  stroke: var(--def);
  stroke-width: 2;
}
.stuff--no {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 2;
}
.ticket {
  fill: var(--def-bg);
  stroke: var(--def);
  stroke-width: 3;
}
.otp__bg {
  fill: var(--s-fill);
  stroke: var(--s-fill2);
  stroke-width: 10;
}
.otp__ring {
  fill: none;
  stroke: var(--con);
  stroke-width: 10;
  stroke-linecap: round;
}
.fan {
  transform-box: fill-box;
  transform-origin: center;
}
.fan.is-on {
  animation: spin .6s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
html.rm .fan.is-on {
  animation: none;
}
.gpu-bar {
  fill: var(--atk);
}
.cell {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.cell--buf {
  fill: var(--con-bg);
}
.cell--ebp {
  fill: var(--s-fill2);
}
.cell--ret {
  fill: color-mix(in srgb, var(--warn) 22%, var(--s-fill));
}
.cell--can {
  fill: var(--def-bg);
  stroke: var(--def);
}
.cell.is-hit {
  fill: var(--atk-bg);
  stroke: var(--atk);
  stroke-width: 2.5;
}
.cell.is-ok {
  fill: var(--def-bg);
  stroke: var(--def);
}
.mblk__r {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.mblk__r.is-admin {
  stroke: var(--atk);
  stroke-width: 2.5;
}
.mblk {
  transition: transform .5s ease;
}
.jump {
  fill: none;
  stroke: var(--atk);
  stroke-width: 4;
  stroke-dasharray: 10 7;
}
.jump.is-ok {
  stroke: var(--def);
}
.nx {
  fill: var(--def-bg);
  stroke: var(--def);
  stroke-width: 3;
}
.pc__b {
  fill: var(--s-fill);
  stroke: var(--s-line);
  stroke-width: 2;
}
.pc__s {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.pc.is-bad .pc__b {
  fill: var(--atk-bg);
  stroke: var(--atk);
}
.pc.is-bad text {
  fill: var(--atk);
}
.pc.is-ok .pc__b {
  fill: var(--def-bg);
  stroke: var(--def);
}
.pc.is-ok text {
  fill: var(--def);
}
.pc text {
  fill: var(--con);
}
.secbox {
  fill: none;
  stroke: var(--s-line);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
  opacity: .6;
}
.segbox {
  fill: none;
  stroke: var(--def);
  stroke-width: 3;
  stroke-dasharray: 10 6;
}
.winbar {
  fill: var(--atk);
}
.ndbar {
  fill: var(--warn);
}
.pulse {
  fill: var(--atk);
}
.land {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.arrow-ok {
  fill: none;
  stroke: var(--def);
  stroke-width: 3;
}
.arrow-bad {
  fill: none;
  stroke: var(--atk);
  stroke-width: 3;
}
.chain__line {
  stroke: var(--s-line);
  stroke-width: 6;
  stroke-dasharray: 2 14;
  stroke-linecap: round;
}
.ring__c {
  fill: var(--s-fill);
  stroke: var(--s-line);
  stroke-width: 6;
}
.ring__crack {
  fill: none;
  stroke: var(--atk);
  stroke-width: 5;
  opacity: 0;
}
.ring.is-hit .ring__c {
  stroke: var(--atk);
  fill: var(--atk-bg);
}
.ring.is-cut .ring__c {
  stroke: var(--def);
  fill: var(--def-bg);
}
.ring.is-broken .ring__c {
  stroke: var(--def);
  stroke-dasharray: 30 14;
  fill: var(--def-bg);
}
.ring.is-broken .ring__crack {
  opacity: 1;
  stroke: var(--def);
}
.atk-dot {
  fill: var(--pill-atk);
}
.lossb__r {
  fill: var(--s-fill2);
  stroke: var(--s-line);
  stroke-width: 1.5;
}
.lossb.is-on .lossb__r {
  fill: var(--atk-bg);
  stroke: var(--atk);
  stroke-width: 2.5;
}
.lossb text {
  fill: var(--s-mute);
}
.lossb.is-on text {
  fill: var(--atk);
}
.step--activity {
  gap: calc(var(--u) * 2);
}
.activity__steps {
  display: grid;
  gap: calc(var(--u) * 1.2);
}
.activity__steps li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: calc(var(--u) * 1.6);
  align-items: center;
  padding: calc(var(--u) * 1) calc(var(--u) * 1.6);
  border-radius: 10px;
  background: var(--surface-2);
}
.activity__no {
  font-weight: 700;
  color: var(--part);
}
.activity__ss {
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--con-bg);
  color: var(--con);
}
.activity__foot {
  color: var(--muted);
  font-size: var(--fs-label);
}
.timer {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 2);
}
.timer__t {
  font-size: calc(var(--u) * 7);
  font-weight: 700;
}
.timer__t.is-done {
  color: var(--atk);
}
.quiz__privacy {
  font-size: var(--fs-label);
  color: var(--muted);
}

/* src/css/effects.css */
.nd {
  --hit: 0;
}
.nd .ic-b,
.nd .ic-b2 {
  stroke: color-mix(in srgb, var(--atk) calc(var(--hit) * 100%), var(--s-line));
}
.node-atk .ic-b,
.node-atk .ic-b2 {
  stroke: var(--atk);
}
.node-def .ic-b {
  stroke: var(--def);
}
.shk {
  transform-box: fill-box;
  transform-origin: center;
}
.shk.glitch {
  animation: glitch .35s steps(3) 1;
  filter: url(#fx-rgb);
}
@keyframes glitch {
  0% {
    transform: translate(-4px, 1px);
  }
  33% {
    transform: translate(4px, -1px);
  }
  66% {
    transform: translate(-2px, 0);
  }
  100% {
    transform: none;
  }
}
.fx-halo--atk {
  fill: url(#fx-halo-atk);
}
.fx-halo--def {
  fill: url(#fx-halo-def);
}
.fx-hex {
  fill: var(--def-bg);
  fill-opacity: .35;
  stroke: var(--def);
  stroke-width: 4;
  stroke-linejoin: round;
}
.fx-wave {
  fill: none;
  stroke: var(--def);
  stroke-width: 3;
}
.scene__edge {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 calc(var(--u, 8px) * 6) calc(var(--u, 8px) * 1.2) rgba(194, 65, 45, .55);
}
.scene__flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}
.scene__flash--atk {
  background: var(--atk);
}
.scene__flash--def {
  background: var(--def);
}
.curtain {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: var(--part);
  pointer-events: none;
  visibility: hidden;
}
.step.is-leaving {
  pointer-events: none;
  z-index: 0;
}
.is-target {
  position: relative;
  animation: target-pulse 1.6s ease-in-out infinite;
}
@keyframes target-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--con) 55%, transparent);
  }
  50% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--con) 0%, transparent);
  }
}
.is-where {
  animation: where-blink .5s ease-in-out 3;
  outline: 3px solid var(--con);
  outline-offset: 3px;
}
@keyframes where-blink {
  50% {
    outline-color: transparent;
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--con) 35%, transparent);
  }
}
.ck path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.is-done .ck path {
  animation: ck-draw .4s ease-out forwards;
}
@keyframes ck-draw {
  to {
    stroke-dashoffset: 0;
  }
}
html.rm .shk.glitch,
html.rm .is-target,
html.rm .is-where {
  animation: none;
  filter: none;
}
@media (prefers-reduced-motion: reduce) {
  .shk.glitch,
  .is-target,
  .is-where {
    animation: none;
    filter: none;
  }
  .is-done .ck path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* src/css/app.css */
