:root {
  --paper: #f7fcfa;
  --paper-strong: #ffffff;
  --ink: #173547;
  --ink-soft: #496978;
  --sky: #68d5ea;
  --sky-soft: #dff6f8;
  --sea: #1484ae;
  --sea-deep: #0a668c;
  --citrus: #ffc75a;
  --coral: #ff7b72;
  --coral-soft: #fff0ed;
  --error: #e94f64;
  --line: rgba(23, 53, 71, 0.14);
  --shadow: 0 22px 70px rgba(24, 91, 113, 0.2);
  --app-height: 100svh;
  --app-vh: 1svh;
  --viewport-top: 0px;
  color-scheme: light;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
}

body {
  color: var(--ink);
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  background: var(--citrus);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

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

#main,
.screen {
  width: 100%;
  height: var(--app-height);
  min-height: 0;
}

.screen {
  position: fixed;
  z-index: 0;
  top: var(--viewport-top);
  right: 0;
  bottom: auto;
  left: 0;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms ease, visibility 420ms;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
}

/* Intro: a bright travel-editorial cover, not a terminal. */

.intro-background,
.intro-shade,
.signal-grid {
  position: absolute;
  inset: 0;
}

.intro-background {
  z-index: -4;
  inset: -2%;
  background: url("./assets/vn/bg/office-daydream.jpg") 55% center / cover no-repeat;
  animation: intro-camera 18s ease-in-out infinite alternate;
}

.intro-shade {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(247, 252, 250, 0.97) 0%, rgba(247, 252, 250, 0.9) 31%, rgba(247, 252, 250, 0.38) 52%, transparent 72%),
    linear-gradient(0deg, rgba(247, 252, 250, 0.88), transparent 27%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 22%);
}

.signal-grid {
  z-index: -2;
  width: 48%;
  opacity: 0.42;
  background-image: radial-gradient(circle, rgba(20, 132, 174, 0.22) 1px, transparent 1.5px);
  background-size: 17px 17px;
  mask-image: linear-gradient(90deg, #000, transparent 88%);
}

.signal-grid::after {
  content: "";
  position: absolute;
  top: 22%;
  left: 9%;
  width: 82px;
  height: 10px;
  border-top: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  transform: rotate(-5deg);
  opacity: 0.7;
}

.intro-header,
.intro-footer,
.result-header,
.result-footer {
  position: absolute;
  z-index: 20;
  right: clamp(24px, 4.3vw, 72px);
  left: clamp(24px, 4.3vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.intro-header {
  top: max(22px, env(safe-area-inset-top));
}

.wordmark {
  display: grid;
  grid-template-columns: 42px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
}

.wordmark > span {
  grid-row: 1 / 3;
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 50% 12%;
  color: var(--paper-strong);
  background: var(--coral);
  box-shadow: 4px 4px 0 var(--citrus);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  transform: rotate(-5deg);
}

.wordmark strong {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.18em;
}

.wordmark small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.intro-header > p {
  display: flex;
  gap: 13px;
  margin: 0;
  color: var(--ink-soft);
}

.intro-header > p b {
  position: relative;
  color: var(--sea);
}

.intro-header > p b::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse 1.7s ease-in-out infinite;
}

.intro-copy {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: clamp(28px, 7.8vw, 128px);
  width: min(650px, 52vw);
  transform: translateY(-47%);
}

.protocol-label,
.result-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 20px;
  color: var(--sea);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.protocol-label::before,
.result-kicker::before {
  content: "";
  width: 34px;
  height: 2px;
  background: currentColor;
}

.protocol-label b {
  padding: 5px 8px;
  border: 1px solid rgba(255, 123, 114, 0.54);
  border-radius: 9px 9px 3px 9px;
  color: #b53f42;
  background: rgba(255, 240, 237, 0.8);
  font-weight: inherit;
  transform: rotate(-1deg);
}

.intro-copy h1,
.result-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(51px, 5.8vw, 94px);
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.intro-copy h1 em,
.result-copy h2 em {
  position: relative;
  color: var(--sea);
  font-style: normal;
}

.intro-copy h1 em::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 3%;
  height: 8px;
  border-radius: 50%;
  background: var(--citrus);
  opacity: 0.68;
  transform: rotate(-1.3deg) skewX(-18deg);
  z-index: -1;
}

.intro-description {
  margin: 30px 0 0 45px;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.05vw, 17px);
  font-weight: 550;
  line-height: 1.72;
}

.connect-button {
  display: flex;
  width: min(318px, calc(100vw - 48px));
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 0 45px;
  padding: 0 8px 0 21px;
  border: 2px solid var(--ink);
  border-radius: 17px 17px 5px 17px;
  color: var(--paper-strong);
  background: var(--ink);
  box-shadow: 6px 6px 0 var(--sky);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.connect-button span {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.connect-button i {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  border-radius: 12px 12px 3px 12px;
  color: var(--ink);
  background: var(--citrus);
  font-size: 20px;
  font-style: normal;
  transition: transform 180ms ease;
}

.connect-button:hover,
.connect-button:focus-visible {
  background: var(--sea-deep);
  box-shadow: 3px 3px 0 var(--coral);
  outline: 3px solid rgba(104, 213, 234, 0.42);
  outline-offset: 4px;
  transform: translate(3px, 3px);
}

.connect-button:hover i,
.connect-button:focus-visible i {
  transform: translateX(3px) rotate(-4deg);
}

.any-key {
  margin: 14px 0 0 45px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.any-key kbd {
  padding: 3px 6px;
  border: 1px solid rgba(23, 53, 71, 0.26);
  border-radius: 5px;
  color: var(--sea-deep);
  background: rgba(255, 255, 255, 0.62);
  font: inherit;
  font-weight: 800;
}

.intro-character {
  position: absolute;
  z-index: 5;
  right: -1.5vw;
  bottom: max(0px, env(safe-area-inset-bottom));
  width: min(47vw, 720px);
  height: 88vh;
  margin: 0;
  pointer-events: none;
}

.intro-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.96))
    drop-shadow(-14px 23px 32px rgba(20, 102, 134, 0.22));
  animation: character-breathe 5.2s ease-in-out infinite;
}

.intro-character figcaption {
  position: absolute;
  right: clamp(26px, 4vw, 68px);
  bottom: 13vh;
  display: grid;
  padding: 12px 15px;
  border: 1px solid rgba(23, 53, 71, 0.12);
  border-radius: 16px 16px 4px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 13px 34px rgba(20, 102, 134, 0.14);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  backdrop-filter: blur(12px);
}

.intro-character figcaption span {
  color: var(--coral);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.intro-character figcaption strong {
  margin-top: 4px;
  font-size: 14px;
  letter-spacing: 0.07em;
}

.intro-character figcaption small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 9px;
}

.intro-footer,
.result-footer {
  bottom: max(20px, env(safe-area-inset-bottom));
  color: rgba(23, 53, 71, 0.62);
}

.intro-footer > span i {
  display: inline-block;
  width: 42px;
  height: 2px;
  margin: 0 8px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--sky), var(--coral));
}

.intro-footer nav,
.result-footer nav {
  display: flex;
  gap: 20px;
}

.intro-footer a:hover,
.intro-footer a:focus-visible,
.result-footer a:hover,
.result-footer a:focus-visible {
  color: var(--sea-deep);
  outline: 2px solid var(--sky);
  outline-offset: 4px;
}

/* Story */

.scene-stage,
.scene-bg,
.scene-vignette,
.scan-layer,
.signal-noise,
.completion-flash {
  position: absolute;
  inset: 0;
}

.scene-stage {
  --sync: 0;
  overflow: hidden;
  background: var(--sky-soft);
}

.scene-bg {
  inset: 0;
  background-position: center;
  background-size: cover;
  transform-origin: var(--scene-focal, 50% 50%);
  will-change: opacity, transform, filter;
}

.scene-bg-current {
  z-index: 0;
  opacity: 1;
  filter: saturate(calc(88% + var(--sync) * 12%)) brightness(calc(101% + var(--sync) * 3%));
  transform: scale(calc(1.026 - var(--sync) * 0.011));
  transition: filter 240ms ease, transform 420ms ease, opacity 800ms ease;
  animation: scene-camera 18s ease-in-out infinite alternate;
}

.scene-bg-next {
  z-index: 1;
  opacity: 0;
  filter: saturate(0.86) brightness(1.04);
  transform: scale(1.035);
  transition: opacity 800ms ease, transform 800ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.is-scene-transitioning .scene-bg-current {
  opacity: 0;
  transform: scale(1.04);
}

.is-scene-transitioning .scene-bg-next {
  opacity: 1;
  transform: scale(1.005);
}

.ambient-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-layer i {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50% 50% 45% 55%;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 16px rgba(104, 213, 234, 0.52);
  opacity: calc(0.12 + var(--sync) * 0.38);
  animation: travel-glint 9s ease-in-out infinite;
}

.ambient-layer i:nth-child(1) { top: 18%; left: 14%; animation-delay: -1.4s; }
.ambient-layer i:nth-child(2) { top: 32%; left: 72%; width: 4px; height: 4px; animation-delay: -5.1s; }
.ambient-layer i:nth-child(3) { top: 58%; left: 84%; width: 10px; height: 10px; animation-delay: -3.7s; }
.ambient-layer i:nth-child(4) { top: 44%; left: 31%; width: 5px; height: 5px; animation-delay: -7.4s; }
.ambient-layer i:nth-child(5) { top: 72%; left: 57%; width: 6px; height: 6px; animation-delay: -2.2s; }

.scene-vignette {
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent 43%, rgba(255, 255, 255, 0.1)),
    linear-gradient(0deg, rgba(232, 250, 249, 0.96) 0%, rgba(241, 252, 250, 0.62) 20%, transparent 53%),
    linear-gradient(180deg, rgba(23, 53, 71, 0.13), transparent 24%);
}

.scan-layer,
.signal-noise {
  display: none;
}

.completion-flash {
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: rgba(255, 255, 255, 0.82);
}

.session-strip {
  position: absolute;
  z-index: 22;
  top: max(22px, env(safe-area-inset-top));
  right: clamp(24px, 4.3vw, 72px);
  left: clamp(24px, 4.3vw, 72px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-shadow: 0 1px 9px rgba(255, 255, 255, 0.9);
}

.session-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.session-brand b {
  padding: 5px 8px;
  border: 1px solid rgba(23, 53, 71, 0.18);
  border-radius: 9px 9px 3px 9px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
}

.session-brand span {
  color: var(--sea-deep);
}

.session-location {
  margin: 0;
  padding: 8px 14px;
  border: 1px solid rgba(23, 53, 71, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.desk-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.desk-status span {
  color: var(--ink-soft);
}

.desk-status b {
  padding: 6px 9px;
  border-radius: 10px 10px 3px 10px;
  color: #92353c;
  background: rgba(255, 240, 237, 0.9);
  box-shadow: 3px 3px 0 rgba(255, 199, 90, 0.72);
}

.session-progress {
  position: absolute;
  z-index: 22;
  top: 50%;
  left: clamp(20px, 3.1vw, 52px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(23, 53, 71, 0.68);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left top;
}

#progress-dots {
  display: flex;
  gap: 5px;
}

#progress-dots span {
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: rgba(23, 53, 71, 0.2);
}

#progress-dots span.is-past {
  background: rgba(20, 132, 174, 0.56);
}

#progress-dots span.is-current {
  width: 30px;
  background: var(--coral);
}

.character-layer {
  position: absolute;
  z-index: 5;
  right: clamp(18px, 3.5vw, 72px);
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(42vw, 650px);
  height: min(78vh, 780px);
  margin: 0;
  opacity: calc(0.86 + var(--sync) * 0.14);
  transform: translateY(calc(4px - var(--sync) * 4px));
  transition: opacity 250ms ease, transform 300ms ease, filter 180ms ease;
  pointer-events: none;
}

.character-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.96))
    drop-shadow(-14px 22px 33px rgba(20, 102, 134, 0.24));
  animation: character-breathe 5.2s ease-in-out infinite;
}

.character-layer.is-changing {
  filter: brightness(1.06) drop-shadow(0 0 16px rgba(255, 199, 90, 0.36));
}

.character-layer.is-key-pulse {
  animation: character-key-pulse 150ms cubic-bezier(0.2, 0.82, 0.24, 1);
}

.scene-stage.is-character-hidden .character-layer,
.scene-stage.is-cutin-character-hidden .character-layer {
  opacity: 0;
}

.cinematic-cutin {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  background: rgba(222, 246, 248, 0.7);
  opacity: 0;
  transform: scale(1.018);
  transition: opacity 420ms ease, transform 820ms cubic-bezier(0.2, 0.78, 0.2, 1);
  pointer-events: none;
}

.cinematic-cutin.is-visible {
  opacity: 1;
  transform: scale(1);
}

.cinematic-cutin::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.13), transparent 52%),
    linear-gradient(0deg, rgba(235, 250, 249, 0.96) 0%, rgba(246, 252, 250, 0.32) 28%, transparent 57%);
  pointer-events: none;
}

.cutin-backdrop {
  position: absolute;
  z-index: 0;
  inset: -3%;
  overflow: hidden;
  background: var(--sky-soft);
}

.cutin-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px) saturate(0.82) brightness(1.09);
  transform: scale(1.09);
}

.cutin-art {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 50%;
  filter: saturate(1.01) brightness(1.025);
  transition: transform 820ms cubic-bezier(0.2, 0.78, 0.2, 1), filter 280ms ease;
}

.scene-stage[data-cutin="wide"] .cutin-backdrop {
  opacity: 0;
}

.scene-stage[data-cutin="panel"] .cutin-art,
.scene-stage[data-cutin="postcard"] .cutin-art,
.scene-stage[data-cutin="pov"] .cutin-art,
.scene-stage[data-cutin="detail"] .cutin-art,
.scene-stage[data-cutin="portrait"] .cutin-art {
  top: clamp(82px, 9vh, 112px);
  right: clamp(26px, 4vw, 72px);
  bottom: auto;
  left: auto;
  width: min(52vw, 730px);
  height: min(72vh, 760px);
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px 28px 8px 28px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 22px 60px rgba(21, 76, 97, 0.24), 7px 7px 0 rgba(104, 213, 234, 0.24);
  object-fit: contain;
  object-position: center;
}

.scene-stage[data-camera="high"] .cutin-art {
  transform-origin: 52% 28%;
}

.scene-stage[data-camera="detail"] .cutin-art,
.scene-stage[data-camera="food"] .cutin-art,
.scene-stage[data-camera="macro"] .cutin-art {
  transform-origin: 70% 50%;
}

.scene-stage.is-typing .cutin-art {
  transform: scale(calc(1 + var(--sync) * 0.012));
}

.scene-stage.is-shot-switching .ambient-layer,
.scene-stage.is-shot-switching .travel-objects,
.scene-stage.is-shot-switching .character-bubble {
  opacity: 0;
}

.cinematic-cutin figcaption {
  position: absolute;
  z-index: 3;
  top: max(64px, calc(env(safe-area-inset-top) + 48px));
  right: clamp(24px, 4.3vw, 72px);
  padding: 7px 9px;
  border: 1px solid rgba(23, 53, 71, 0.16);
  border-radius: 9px 9px 3px 9px;
  color: var(--sea-deep);
  background: rgba(255, 255, 255, 0.76);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  backdrop-filter: blur(10px);
}

.travel-objects {
  position: absolute;
  z-index: 12;
  top: clamp(96px, 13vh, 154px);
  left: clamp(28px, 4.7vw, 82px);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  max-width: min(50vw, 690px);
  transition: opacity 220ms ease;
  pointer-events: none;
}

.travel-object {
  --object-progress: 0;
  --object-y: 20px;
  --object-scale: 0.9;
  --object-tilt: -2deg;
  position: relative;
  flex: 0 0 clamp(126px, 11vw, 174px);
  aspect-ratio: 4 / 5;
  margin: 0;
  padding: 7px 7px 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px 18px 5px 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 38px rgba(20, 88, 111, 0.2), 5px 5px 0 rgba(255, 199, 90, 0.42);
  opacity: 0;
  transform: translate3d(0, var(--object-y), 0) rotate(var(--object-tilt)) scale(var(--object-scale));
  transition: opacity 320ms ease, transform 520ms cubic-bezier(0.18, 0.84, 0.2, 1), filter 200ms ease;
}

.travel-objects.is-many .travel-object {
  flex-basis: clamp(96px, 8vw, 126px);
}

.travel-object.is-visible {
  opacity: 1;
}

.travel-object.is-collected {
  filter: saturate(1.12) brightness(1.04);
  animation: object-collected 560ms cubic-bezier(0.2, 0.84, 0.22, 1) both;
}

.travel-object img {
  width: 100%;
  height: calc(100% - 45px);
  border-radius: 12px 12px 3px 12px;
  object-fit: cover;
}

.travel-object figcaption {
  display: grid;
  gap: 2px;
  padding: 8px 4px 0;
}

.travel-object small {
  color: var(--coral);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.travel-object strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-bubble {
  --bubble-progress: 0;
  position: absolute;
  z-index: 14;
  top: clamp(120px, 17vh, 190px);
  right: clamp(28px, 5.4vw, 96px);
  width: min(330px, 31vw);
  min-height: 82px;
  padding: 15px 18px 17px;
  border: 1px solid rgba(23, 53, 71, 0.16);
  border-radius: 24px 24px 5px 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(21, 76, 97, 0.2), 5px 5px 0 rgba(104, 213, 234, 0.4);
  opacity: 0;
  transform: translateY(9px) scale(0.92) rotate(1deg);
  transform-origin: 88% 100%;
  transition: opacity 180ms ease, transform 280ms cubic-bezier(0.2, 0.86, 0.2, 1), box-shadow 180ms ease;
  backdrop-filter: blur(14px) saturate(1.1);
  pointer-events: none;
}

.character-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(1deg);
}

.character-bubble > span {
  display: block;
  margin-bottom: 7px;
  color: var(--coral);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.character-bubble p {
  min-height: 1.35em;
  margin: 0;
  font-size: clamp(18px, 1.7vw, 25px);
  font-weight: 850;
  line-height: 1.36;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.character-bubble p span {
  display: inline-block;
}

.character-bubble p span.is-composing {
  background: linear-gradient(transparent 75%, rgba(104, 213, 234, 0.62) 75%);
}

.character-bubble p span.is-error {
  color: var(--error);
  background: #ffdce0;
  animation: error-shake 180ms ease-out 2;
}

.character-bubble > i {
  position: absolute;
  right: 26px;
  bottom: -16px;
  width: 28px;
  height: 25px;
  overflow: hidden;
}

.character-bubble > i::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 2px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(23, 53, 71, 0.14);
  background: rgba(255, 255, 255, 0.94);
  transform: rotate(45deg);
}

.character-bubble.is-error {
  box-shadow: 0 18px 46px rgba(233, 79, 100, 0.18), 5px 5px 0 rgba(255, 123, 114, 0.34);
}

.character-bubble.is-complete {
  animation: bubble-complete 520ms cubic-bezier(0.18, 0.84, 0.22, 1);
}

.scene-stage[data-cutin="wide"] .character-bubble {
  right: auto;
  left: clamp(300px, 40vw, 620px);
}

.scene-stage[data-cutin="panel"] .character-bubble,
.scene-stage[data-cutin="postcard"] .character-bubble,
.scene-stage[data-cutin="detail"] .character-bubble,
.scene-stage[data-cutin="portrait"] .character-bubble,
.scene-stage[data-cutin="pov"] .character-bubble {
  right: auto;
  left: clamp(260px, 30vw, 460px);
}

.scene-stage[data-camera="portal"] .character-bubble {
  right: clamp(28px, 5.4vw, 96px);
  left: auto;
}

.dialogue-panel {
  position: absolute;
  z-index: 30;
  bottom: max(4.5vh, 38px);
  left: clamp(42px, 8vw, 128px);
  width: min(720px, 54vw);
  min-height: 174px;
  padding: 20px 24px 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px 26px 7px 26px;
  color: var(--ink);
  background: rgba(250, 255, 253, 0.9);
  box-shadow: var(--shadow), 7px 7px 0 rgba(104, 213, 234, 0.28);
  backdrop-filter: blur(18px) saturate(1.18);
}

.dialogue-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  border-radius: 26px 0 0 26px;
  background: linear-gradient(180deg, var(--coral), var(--citrus) 48%, var(--sky));
}

.dialogue-panel::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 12px;
  left: 24px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sea) calc(var(--sync) * 100%), rgba(23, 53, 71, 0.1) 0);
  transition: background 120ms ease;
}

.dialogue-meta {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dialogue-source {
  display: grid;
  min-width: 0;
  gap: 4px;
}

#speaker-name {
  color: var(--coral);
  letter-spacing: 0.12em;
}

#signal-status {
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-pace {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: end;
  column-gap: 5px;
  min-width: 116px;
  padding: 7px 11px 6px;
  border: 1px solid rgba(20, 132, 174, 0.16);
  border-radius: 14px 14px 4px 14px;
  background: var(--sky-soft);
  box-shadow: 3px 3px 0 rgba(255, 199, 90, 0.46);
  transition: background 160ms ease, transform 160ms ease;
}

.session-pace span {
  grid-column: 1 / 3;
  color: var(--ink-soft);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.session-pace b {
  min-width: 52px;
  color: var(--sea-deep);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
  text-align: right;
}

.session-pace small {
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0;
}

.session-pace.is-live {
  background: #d6f7f3;
}

.session-pace.is-pulse {
  animation: pace-pop 190ms ease-out;
}

.dialogue-line {
  max-width: 680px;
  margin: 0 0 17px;
  color: var(--ink);
  font-size: clamp(29px, 3.1vw, 49px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.05em;
  text-wrap: balance;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.dialogue-line span,
.choice-text span {
  display: inline;
  transition: color 80ms ease, opacity 80ms ease, background 100ms ease;
}

.dialogue-line .is-synced,
.choice-text .is-synced {
  color: var(--ink);
  opacity: 1;
}

.dialogue-line .is-newly-synced,
.choice-text .is-newly-synced {
  display: inline-block;
  animation: character-fill 170ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dialogue-line .is-current,
.choice-text .is-current {
  display: inline-block;
  color: var(--sea-deep);
  background: linear-gradient(transparent 72%, rgba(255, 199, 90, 0.78) 72%);
  opacity: 1;
  animation: current-breathe 1.1s ease-in-out infinite;
}

.dialogue-line .is-future,
.choice-text .is-future {
  color: rgba(23, 53, 71, 0.2);
}

.dialogue-line .is-error-target,
.choice-text .is-error-target {
  position: relative;
  display: inline-block;
  min-width: 0.7em;
  padding: 0 0.08em;
  border-radius: 5px;
  color: var(--error);
  background: #ffd8dc;
  box-shadow: 0 0 0 2px rgba(233, 79, 100, 0.22);
  animation: error-shake 180ms ease-out 2;
}

.dialogue-line .is-error-target::before,
.choice-text .is-error-target::before {
  content: "입력 " attr(data-received);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 2;
  padding: 4px 6px;
  border-radius: 6px;
  color: #fff;
  background: var(--error);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transform: translateX(-50%);
}

.typing-error {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(233, 79, 100, 0.24);
  border-radius: 11px 11px 3px 11px;
  color: #8f3340;
  background: var(--coral-soft);
  font-size: 12px;
  line-height: 1.35;
}

.typing-error span {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 6px;
  color: #fff;
  background: var(--error);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.typing-error b {
  font-weight: 750;
}

.dialogue-hint {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.choice-panel > p {
  margin: 0 0 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.choice-panel ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 13px;
  padding: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  list-style: none;
}

.choice-panel li {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  min-height: 61px;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.34);
  opacity: 0.78;
  transition: opacity 160ms ease, background 160ms ease;
}

.choice-panel li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.choice-panel li.is-compatible {
  background: rgba(223, 246, 248, 0.62);
  opacity: 1;
}

.choice-panel li.is-muted {
  opacity: 0.25;
}

.choice-panel li.is-complete {
  background: rgba(255, 199, 90, 0.35);
  opacity: 1;
}

.choice-number {
  color: var(--coral);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.choice-text {
  color: var(--ink);
  font-size: clamp(18px, 1.7vw, 25px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.04em;
  white-space: pre-wrap;
}

.typing-composer {
  position: relative;
  z-index: 2;
  margin: 4px 0 0;
  padding: 8px 11px 9px;
  overflow: hidden;
  border: 1px solid rgba(20, 132, 174, 0.2);
  border-radius: 15px 15px 5px 15px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 3px 0 0 rgba(104, 213, 234, 0.65), 0 5px 18px rgba(24, 91, 113, 0.08);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.typing-composer:focus-within,
.typing-composer.is-composing {
  border-color: rgba(20, 132, 174, 0.5);
  background: #fff;
  box-shadow: inset 4px 0 0 var(--sky), 0 7px 22px rgba(24, 91, 113, 0.13);
}

.typing-composer.is-composing {
  transform: translateY(-1px);
}

.typing-composer.is-error {
  border-color: rgba(233, 79, 100, 0.52);
  background: #fff7f7;
  box-shadow: inset 4px 0 0 var(--error), 0 7px 22px rgba(233, 79, 100, 0.1);
}

.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.2;
}

.composer-meta span {
  color: var(--coral);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.composer-meta b {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typing-composer.is-error .composer-meta b {
  color: var(--error);
}

.story-input {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-width: 0;
  height: 31px;
  padding: 0;
  border: 0;
  outline: 0;
  opacity: 1;
  color: var(--ink);
  background: transparent;
  caret-color: var(--coral);
  font-size: 20px;
  font-weight: 800;
  line-height: 31px;
  letter-spacing: -0.035em;
}

.story-input::placeholder {
  color: rgba(73, 105, 120, 0.38);
  font-weight: 650;
}

.story-input[aria-invalid="true"] {
  color: var(--error);
  text-decoration-color: rgba(233, 79, 100, 0.42);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-underline-offset: 5px;
}

.memory-synced {
  position: absolute;
  z-index: 50;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 270px;
  padding: 18px 30px 19px;
  border: 2px solid var(--ink);
  border-radius: 22px 22px 6px 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 8px 8px 0 var(--citrus), var(--shadow);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -44%) rotate(-2deg) scale(0.92);
  backdrop-filter: blur(14px);
  transition: opacity 180ms ease, transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.memory-synced.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-2deg) scale(1);
}

.memory-synced span {
  color: var(--coral);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.memory-synced strong {
  margin-top: 7px;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.memory-synced i {
  width: 0;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky), var(--coral));
  transition: width 500ms ease 80ms;
}

.memory-synced.is-visible i {
  width: 100%;
}

.scene-stage.is-line-complete .completion-flash {
  animation: completion-flash 620ms ease both;
}

.scene-stage.is-signal-lost .typing-error {
  animation: error-shake 180ms ease-out 2;
}

/* Result */

.result-background,
.result-shade {
  position: absolute;
  inset: 0;
}

.result-background {
  z-index: -4;
  inset: -3%;
  background: url("./assets/vn/cg/finale-souvenirs.jpg") 58% center / cover no-repeat;
  animation: result-camera 18s ease-in-out infinite alternate;
}

.result-shade {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(247, 252, 250, 0.97) 0%, rgba(247, 252, 250, 0.86) 39%, rgba(247, 252, 250, 0.25) 66%, transparent 78%),
    linear-gradient(0deg, rgba(247, 252, 250, 0.92), transparent 33%);
}

.result-character {
  position: absolute;
  z-index: 1;
  right: -1vw;
  bottom: max(0px, env(safe-area-inset-bottom));
  width: min(45vw, 700px);
  height: 88vh;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.96))
    drop-shadow(-16px 22px 36px rgba(20, 102, 134, 0.22));
  animation: character-breathe 5.2s ease-in-out infinite;
}

.result-header {
  top: max(22px, env(safe-area-inset-top));
  justify-content: flex-start;
  gap: 12px;
}

.result-header b {
  padding: 6px 9px;
  border-radius: 10px 10px 3px 10px;
  color: #fff;
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--citrus);
}

.result-header span {
  color: var(--sea-deep);
  font-weight: 800;
}

.result-copy {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: clamp(28px, 7.8vw, 128px);
  width: min(690px, 58vw);
  transform: translateY(-48%);
}

.result-copy h2 {
  font-size: clamp(43px, 4.75vw, 74px);
}

.result-copy blockquote {
  margin: 21px 0 0 45px;
  color: var(--ink);
  font-size: clamp(16px, 1.35vw, 21px);
  font-weight: 800;
  line-height: 1.5;
}

#result-summary {
  max-width: 580px;
  margin: 11px 0 0 45px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.session-log {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 630px;
  margin: 22px 0 0 45px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 5px 17px;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(10px);
}

.session-log div {
  min-width: 0;
  padding: 13px 16px 12px;
}

.session-log div + div {
  border-left: 1px solid var(--line);
}

.session-log dt {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-log dd {
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--sea-deep);
  font-size: clamp(17px, 1.45vw, 23px);
  font-weight: 850;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-film {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  max-width: 630px;
  margin: 15px 0 0 45px;
}

.memory-film figure {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 9px 9px 3px 9px;
  background: var(--sky-soft);
  box-shadow: 0 5px 14px rgba(20, 102, 134, 0.12);
}

.memory-film img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) brightness(1.03);
  transition: filter 180ms ease, transform 240ms ease;
}

.memory-film figcaption {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  overflow: hidden;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(23, 53, 71, 0.7);
  white-space: nowrap;
}

.memory-film figure:hover img {
  filter: saturate(1.08) brightness(1.04);
  transform: scale(1.05);
}

.result-actions {
  display: flex;
  gap: 10px;
  margin: 17px 0 0 45px;
}

.result-actions button {
  display: flex;
  min-width: 174px;
  height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border: 2px solid var(--ink);
  border-radius: 14px 14px 4px 14px;
  color: #fff;
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--sky);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.result-actions button + button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.result-actions button:hover,
.result-actions button:focus-visible {
  background: var(--sea-deep);
  box-shadow: 2px 2px 0 var(--coral);
  outline: 3px solid rgba(104, 213, 234, 0.4);
  outline-offset: 3px;
  transform: translate(2px, 2px);
}

.result-actions button + button:hover,
.result-actions button + button:focus-visible {
  color: #fff;
}

/* Utilities */

.sound-toggle {
  position: fixed;
  z-index: 100;
  right: max(19px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(23, 53, 71, 0.16);
  border-radius: 12px 12px 4px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 3px 3px 0 rgba(104, 213, 234, 0.52);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.sound-toggle span {
  color: var(--coral);
}

.sound-toggle b {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.sound-toggle:focus-visible {
  outline: 3px solid rgba(104, 213, 234, 0.48);
  outline-offset: 3px;
}

body[data-screen="intro"] .sound-toggle,
body[data-screen="result"] .sound-toggle {
  bottom: max(54px, calc(env(safe-area-inset-bottom) + 32px));
}

.toast {
  position: fixed;
  z-index: 200;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  padding: 11px 15px;
  border: 1px solid rgba(23, 53, 71, 0.16);
  border-radius: 12px 12px 4px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 4px 4px 0 var(--citrus), 0 12px 30px rgba(20, 102, 134, 0.17);
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  transform: translate(-50%, -10px);
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes intro-camera {
  from { transform: scale(1.02) translate3d(-0.35%, 0, 0); }
  to { transform: scale(1.065) translate3d(0.45%, -0.3%, 0); }
}

@keyframes result-camera {
  from { transform: scale(1.02); }
  to { transform: scale(1.065) translate3d(-0.5%, -0.25%, 0); }
}

@keyframes scene-camera {
  from { translate: -0.2% 0; }
  to { translate: 0.3% -0.2%; }
}

@keyframes travel-glint {
  0%, 100% { translate: 0 8px; rotate: -10deg; opacity: 0.12; }
  45% { translate: 9px -12px; rotate: 20deg; opacity: 0.52; }
  70% { translate: -4px -22px; rotate: 36deg; opacity: 0.18; }
}

@keyframes character-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes character-key-pulse {
  0% { transform: translateY(calc(4px - var(--sync) * 4px)) scale(1); }
  52% { transform: translateY(calc(1px - var(--sync) * 4px)) scale(1.008); }
  100% { transform: translateY(calc(4px - var(--sync) * 4px)) scale(1); }
}

@keyframes object-collected {
  0% { translate: 0 0; rotate: 0deg; }
  42% { translate: 0 -8px; rotate: -2deg; }
  68% { translate: 0 2px; rotate: 1deg; }
  100% { translate: 0 0; rotate: 0deg; }
}

@keyframes bubble-complete {
  0%, 100% { scale: 1; }
  42% { scale: 1.035; }
  68% { scale: 0.99; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes character-fill {
  0% { color: var(--sea); opacity: 0.2; transform: translateY(5px) scale(0.94); }
  58% { color: var(--sea-deep); opacity: 1; transform: translateY(-1px) scale(1.06); }
  100% { color: var(--ink); opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes current-breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@keyframes pace-pop {
  0% { transform: scale(0.96); }
  75% { transform: scale(1.035) rotate(-0.5deg); }
  100% { transform: scale(1); }
}

@keyframes completion-flash {
  0% { opacity: 0; }
  14% { opacity: 0.55; }
  100% { opacity: 0; }
}

@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

@media (max-width: 980px) {
  .intro-copy {
    left: 30px;
    width: 58vw;
  }

  .intro-character {
    right: -10vw;
    width: 62vw;
  }

  .intro-character figcaption {
    display: none;
  }

  .session-strip {
    right: 24px;
    left: 24px;
    grid-template-columns: 1fr auto;
  }

  .session-location,
  .session-progress {
    display: none;
  }

  .dialogue-panel {
    left: 30px;
    width: min(710px, 76vw);
  }

  .character-layer {
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(50vw, 560px);
    height: min(76vh, 700px);
  }

  .result-copy {
    left: 30px;
    width: 68vw;
  }

  .result-character {
    right: -12vw;
    width: 62vw;
  }
}

@media (max-width: 600px) {
  .intro-header,
  .intro-footer,
  .result-header,
  .result-footer {
    right: 19px;
    left: 19px;
  }

  .intro-header {
    top: max(16px, env(safe-area-inset-top));
  }

  .wordmark {
    grid-template-columns: 34px auto;
    column-gap: 9px;
  }

  .wordmark > span {
    width: 34px;
    border-width: 1.5px;
    box-shadow: 3px 3px 0 var(--citrus);
    font-size: 8px;
  }

  .wordmark small,
  .intro-header > p span,
  .intro-footer > span,
  .result-footer > span {
    display: none;
  }

  .intro-header > p {
    font-size: 8px;
  }

  .intro-background {
    background-position: 57% center;
  }

  .intro-shade {
    background:
      linear-gradient(0deg, rgba(247, 252, 250, 0.98) 0%, rgba(247, 252, 250, 0.92) 41%, rgba(247, 252, 250, 0.2) 74%),
      linear-gradient(90deg, rgba(255, 255, 255, 0.48), transparent 76%);
  }

  .signal-grid {
    width: 100%;
    opacity: 0.22;
  }

  .intro-copy {
    top: auto;
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 70px));
    left: 20px;
    width: calc(100vw - 40px);
    transform: none;
  }

  .protocol-label {
    margin-bottom: 12px;
    font-size: 8px;
  }

  .protocol-label::before {
    width: 18px;
  }

  .protocol-label b {
    padding: 4px 6px;
  }

  .intro-copy h1 {
    font-size: clamp(40px, 12vw, 52px);
    line-height: 1.01;
  }

  .intro-copy h1 em::after {
    bottom: -4px;
    height: 6px;
  }

  .intro-description {
    margin: 17px 0 0;
    font-size: 12px;
    line-height: 1.62;
  }

  .connect-button {
    width: 100%;
    min-height: 52px;
    margin: 18px 0 0;
    box-shadow: 4px 4px 0 var(--sky);
  }

  .any-key {
    display: none;
  }

  .intro-character {
    top: calc(var(--app-vh) * 7);
    right: -20vw;
    bottom: auto;
    width: 100vw;
    height: calc(var(--app-vh) * 54);
    opacity: 0.74;
  }

  .intro-footer {
    bottom: max(14px, env(safe-area-inset-bottom));
    justify-content: flex-start;
  }

  .intro-footer nav,
  .result-footer nav {
    gap: 13px;
    font-size: 8px;
  }

  .session-strip {
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    left: 14px;
  }

  .session-brand b {
    padding: 5px 7px;
    font-size: 8px;
  }

  .session-brand span,
  .desk-status span {
    display: none;
  }

  .desk-status b {
    padding: 5px 7px;
    font-size: 8px;
  }

  .scene-vignette {
    background:
      linear-gradient(0deg, rgba(239, 251, 249, 0.98) 0%, rgba(244, 252, 250, 0.7) 30%, transparent 62%),
      linear-gradient(180deg, rgba(23, 53, 71, 0.15), transparent 22%);
  }

  .character-layer {
    top: calc(var(--app-vh) * 6);
    right: -2vw;
    bottom: auto;
    width: 98vw;
    height: calc(var(--app-vh) * 54);
    opacity: calc(0.76 + var(--sync) * 0.2);
  }

  .cinematic-cutin figcaption {
    top: max(52px, calc(env(safe-area-inset-top) + 39px));
    right: 14px;
    font-size: 6px;
  }

  .cutin-art {
    object-position: 58% 46%;
  }

  .scene-stage[data-cutin="wide"] .cutin-art {
    object-position: 68% 46%;
  }

  .scene-stage[data-cutin="panel"] .cutin-art,
  .scene-stage[data-cutin="postcard"] .cutin-art,
  .scene-stage[data-cutin="pov"] .cutin-art,
  .scene-stage[data-cutin="detail"] .cutin-art,
  .scene-stage[data-cutin="portrait"] .cutin-art {
    top: max(58px, calc(env(safe-area-inset-top) + 48px));
    right: 14px;
    width: calc(100vw - 28px);
    height: calc(var(--app-vh) * 51);
    padding: 6px;
    border-radius: 20px 20px 6px 20px;
  }

  .travel-objects {
    top: max(62px, calc(env(safe-area-inset-top) + 52px));
    left: 14px;
    gap: 7px;
    max-width: calc(100vw - 28px);
  }

  .travel-object,
  .travel-objects.is-many .travel-object {
    flex-basis: clamp(76px, 22vw, 102px);
    padding: 4px 4px 7px;
    border-radius: 13px 13px 4px 13px;
    box-shadow: 0 10px 26px rgba(20, 88, 111, 0.16), 3px 3px 0 rgba(255, 199, 90, 0.38);
  }

  .travel-object img {
    height: calc(100% - 35px);
    border-radius: 9px 9px 3px 9px;
  }

  .travel-object figcaption {
    padding: 5px 2px 0;
  }

  .travel-object small {
    display: none;
  }

  .travel-object strong {
    font-size: 8px;
  }

  .character-bubble {
    top: max(94px, calc(env(safe-area-inset-top) + 80px));
    right: auto;
    left: 14px;
    width: min(76vw, 330px);
    min-height: 67px;
    padding: 12px 14px 14px;
    border-radius: 19px 19px 5px 19px;
  }

  .scene-stage[data-cutin="wide"] .character-bubble,
  .scene-stage[data-cutin="panel"] .character-bubble,
  .scene-stage[data-cutin="postcard"] .character-bubble,
  .scene-stage[data-cutin="detail"] .character-bubble,
  .scene-stage[data-cutin="portrait"] .character-bubble,
  .scene-stage[data-cutin="pov"] .character-bubble,
  .scene-stage[data-camera="portal"] .character-bubble {
    right: auto;
    left: 14px;
  }

  .character-bubble p {
    font-size: 18px;
  }

  .scene-stage.is-typing .travel-objects {
    top: max(172px, calc(env(safe-area-inset-top) + 158px));
    opacity: 0.62;
  }

  .dialogue-panel,
  .dialogue-panel.is-choice {
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
    left: 14px;
    width: calc(100vw - 28px);
    min-height: 0;
    padding: 15px 15px 15px 18px;
    border-radius: 21px 21px 6px 21px;
    box-shadow: 0 16px 45px rgba(24, 91, 113, 0.18), 4px 4px 0 rgba(104, 213, 234, 0.3);
  }

  .dialogue-panel::before {
    width: 4px;
    border-radius: 21px 0 0 21px;
  }

  .dialogue-panel::after {
    right: 16px;
    bottom: 8px;
    left: 18px;
  }

  .dialogue-meta {
    min-height: 35px;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 8px;
  }

  .session-pace {
    min-width: 105px;
    padding: 6px 9px 5px;
  }

  .session-pace b {
    min-width: 45px;
    font-size: 21px;
  }

  .dialogue-line {
    margin-bottom: 12px;
    font-size: clamp(23px, 6.5vw, 28px);
    line-height: 1.34;
  }

  .dialogue-line .is-error-target::before,
  .choice-text .is-error-target::before {
    bottom: calc(100% + 5px);
    font-size: 10px;
  }

  .typing-error {
    align-items: flex-start;
    gap: 7px;
    margin-top: 7px;
    padding: 8px;
    font-size: 11px;
  }

  .typing-error span {
    font-size: 8px;
  }

  .dialogue-hint {
    margin-top: 7px;
    font-size: 10px;
  }

  .choice-panel > p {
    margin-bottom: 7px;
    font-size: 10px;
  }

  .choice-panel ol {
    margin-bottom: 9px;
  }

  .choice-panel li {
    grid-template-columns: 25px 1fr;
    min-height: 50px;
    padding: 5px 7px;
  }

  .choice-number {
    font-size: 7px;
  }

  .choice-text {
    font-size: clamp(16px, 4.3vw, 19px);
    line-height: 1.23;
  }

  .typing-composer {
    padding: 7px 9px 8px;
    border-radius: 13px 13px 4px 13px;
  }

  .composer-meta {
    margin-bottom: 2px;
  }

  .story-input {
    height: 29px;
    font-size: 18px;
    line-height: 29px;
  }

  .memory-synced {
    min-width: 240px;
    padding: 15px 22px 16px;
  }

  .memory-synced strong {
    font-size: 21px;
  }

  .result-background {
    background-position: 59% center;
  }

  .result-shade {
    background:
      linear-gradient(0deg, rgba(247, 252, 250, 0.98) 0%, rgba(247, 252, 250, 0.94) 59%, rgba(247, 252, 250, 0.2) 83%),
      linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent);
  }

  .result-header {
    top: max(15px, env(safe-area-inset-top));
  }

  .result-copy {
    top: auto;
    bottom: max(54px, calc(env(safe-area-inset-bottom) + 44px));
    left: 19px;
    width: calc(100vw - 38px);
    transform: none;
  }

  .result-copy .result-kicker {
    margin-bottom: 9px;
    font-size: 8px;
  }

  .result-kicker::before {
    width: 18px;
  }

  .result-copy h2 {
    font-size: clamp(37px, 10vw, 47px);
  }

  .result-copy blockquote {
    margin: 13px 0 0;
    font-size: 14px;
  }

  #result-summary {
    display: none;
  }

  .session-log {
    margin: 14px 0 0;
    border-radius: 13px 13px 4px 13px;
  }

  .session-log div {
    padding: 9px 7px 8px;
  }

  .session-log dt {
    font-size: 6px;
  }

  .session-log dd {
    margin-top: 4px;
    font-size: 14px;
  }

  .memory-film {
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin: 10px 0 0;
  }

  .memory-film figure {
    border-width: 1px;
    border-radius: 5px 5px 2px 5px;
  }

  .memory-film figcaption {
    display: none;
  }

  .result-actions {
    gap: 7px;
    margin: 12px 0 0;
  }

  .result-actions button {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 10px;
    border-width: 1.5px;
    font-size: 11px;
  }

  .result-character {
    top: calc(var(--app-vh) * 5);
    right: -22vw;
    bottom: auto;
    width: 108vw;
    height: calc(var(--app-vh) * 52);
    opacity: 0.7;
  }

  .result-footer {
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  body[data-screen="intro"] .sound-toggle,
  body[data-screen="result"] .sound-toggle,
  .sound-toggle {
    top: max(56px, calc(env(safe-area-inset-top) + 43px));
    right: 15px;
    bottom: auto;
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .sound-toggle b {
    display: none;
  }
}

/* The mobile keyboard stays open for the whole trip. Treat the remaining
   visualViewport as a compact cinema, rather than dimming the journey away. */
@media (max-width: 600px) {
  html[data-keyboard="open"] #main,
  html[data-keyboard="open"] .screen {
    min-height: 0;
  }

  html[data-keyboard="open"] .scene-stage {
    --keyboard-panel-height: clamp(116px, calc(var(--app-vh) * 33), 128px);
    --keyboard-stage-bottom: calc(var(--keyboard-panel-height) + 7px);
  }

  html[data-keyboard="open"] .scene-stage.is-choice-node {
    --keyboard-panel-height: clamp(180px, calc(var(--app-vh) * 52), 208px);
  }

  html[data-keyboard="open"] .scene-stage:has(#typing-error:not([hidden])) {
    --keyboard-panel-height: clamp(144px, calc(var(--app-vh) * 41), 160px);
  }

  html[data-keyboard="open"] .scene-stage.is-choice-node:has(#typing-error:not([hidden])) {
    --keyboard-panel-height: clamp(204px, calc(var(--app-vh) * 60), 232px);
  }

  html[data-keyboard="open"] .session-strip {
    top: 8px;
    right: 8px;
    left: 8px;
    display: block;
    pointer-events: none;
  }

  html[data-keyboard="open"] .session-brand,
  html[data-keyboard="open"] .desk-status,
  html[data-keyboard="open"] .cinematic-cutin figcaption,
  html[data-keyboard="open"] .sound-toggle {
    display: none;
  }

  html[data-keyboard="open"] .session-location {
    display: inline-flex;
    max-width: calc(100vw - 116px);
    min-height: 25px;
    align-items: center;
    padding: 5px 8px;
    overflow: hidden;
    border-radius: 9px 9px 3px 9px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 2px 2px 0 rgba(104, 213, 234, 0.38);
    font-size: 7px;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html[data-keyboard="open"] .session-progress {
    top: 8px;
    right: 8px;
    left: auto;
    display: block;
    padding: 6px 8px;
    border: 1px solid rgba(23, 53, 71, 0.14);
    border-radius: 9px 9px 3px 9px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 2px 2px 0 rgba(255, 199, 90, 0.45);
    font-size: 7px;
    transform: none;
    backdrop-filter: blur(8px);
  }

  html[data-keyboard="open"] #progress-dots {
    display: none;
  }

  html[data-keyboard="open"] .ambient-layer,
  html[data-keyboard="open"] .scene-vignette {
    bottom: var(--keyboard-stage-bottom);
  }

  html[data-keyboard="open"] .scene-vignette {
    background:
      linear-gradient(0deg, rgba(235, 250, 249, 0.56) 0%, rgba(244, 252, 250, 0.12) 30%, transparent 52%),
      linear-gradient(180deg, rgba(23, 53, 71, 0.13), transparent 24%);
  }

  html[data-keyboard="open"] .cinematic-cutin {
    inset: 0 0 var(--keyboard-stage-bottom);
    width: auto;
    height: auto;
    border-radius: 0 0 24px 0;
    opacity: 0;
    transform: translate3d(10px, 0, 0) scale(1.025);
    transition: opacity 260ms ease, transform 620ms cubic-bezier(0.2, 0.78, 0.2, 1);
  }

  html[data-keyboard="open"] .cinematic-cutin.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  html[data-keyboard="open"] .cinematic-cutin::after {
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 55%),
      linear-gradient(0deg, rgba(235, 250, 249, 0.48) 0%, transparent 34%);
  }

  html[data-keyboard="open"] .scene-stage.is-scene-transitioning .cinematic-cutin,
  html[data-keyboard="open"] .scene-stage.is-shot-switching .cinematic-cutin {
    opacity: 0;
    transform: translate3d(-10px, 0, 0) scale(1.035);
  }

  html[data-keyboard="open"] .scene-stage.has-cutin .scene-bg-current {
    opacity: 0;
  }

  html[data-keyboard="open"] .character-layer {
    top: 27px;
    right: -3vw;
    bottom: auto;
    width: 96vw;
    height: max(108px, calc(var(--app-height) - var(--keyboard-stage-bottom) - 25px));
    opacity: calc(0.86 + var(--sync) * 0.12);
  }

  html[data-keyboard="open"] .scene-stage.is-character-hidden .character-layer,
  html[data-keyboard="open"] .scene-stage.is-cutin-character-hidden .character-layer {
    opacity: 0;
  }

  html[data-keyboard="open"] .scene-stage[data-cutin="wide"] .cutin-art {
    object-position: 68% 42%;
  }

  html[data-keyboard="open"] .scene-stage[data-cutin="panel"] .cutin-art,
  html[data-keyboard="open"] .scene-stage[data-cutin="postcard"] .cutin-art,
  html[data-keyboard="open"] .scene-stage[data-cutin="pov"] .cutin-art,
  html[data-keyboard="open"] .scene-stage[data-cutin="detail"] .cutin-art,
  html[data-keyboard="open"] .scene-stage[data-cutin="portrait"] .cutin-art {
    top: 31px;
    right: 8px;
    width: calc(100vw - 16px);
    height: max(88px, calc(var(--app-height) - var(--keyboard-stage-bottom) - 38px));
    padding: 4px;
    border-radius: 17px 17px 5px 17px;
    box-shadow: 0 12px 30px rgba(21, 76, 97, 0.18), 3px 3px 0 rgba(104, 213, 234, 0.22);
  }

  html[data-keyboard="open"] .scene-stage[data-camera="portrait"] .cutin-art {
    object-position: 70% 42%;
  }

  html[data-keyboard="open"] .scene-stage[data-camera="food"] .cutin-art,
  html[data-keyboard="open"] .scene-stage[data-camera="macro"] .cutin-art {
    object-position: 64% 48%;
  }

  html[data-keyboard="open"] .scene-stage.is-typing .cutin-art {
    filter: saturate(calc(0.96 + var(--sync) * 0.1)) brightness(calc(1.01 + var(--sync) * 0.025));
    transform: scale(calc(1 + var(--sync) * 0.02));
  }

  html[data-keyboard="open"] .travel-objects {
    top: 39px;
    right: 8px;
    left: auto;
    display: flex;
    max-width: min(43vw, 164px);
    gap: 4px;
    opacity: 0.94;
  }

  html[data-keyboard="open"] .scene-stage.is-typing .travel-objects {
    top: 39px;
    opacity: 0.98;
  }

  html[data-keyboard="open"] .travel-object,
  html[data-keyboard="open"] .travel-objects.is-many .travel-object {
    flex-basis: 54px;
    padding: 3px 3px 5px;
    border-radius: 11px 11px 3px 11px;
    box-shadow: 0 7px 18px rgba(20, 88, 111, 0.17), 2px 2px 0 rgba(255, 199, 90, 0.42);
  }

  html[data-keyboard="open"] .travel-objects.is-many .travel-object {
    flex-basis: 47px;
  }

  html[data-keyboard="open"] .travel-object img {
    height: calc(100% - 19px);
    border-radius: 8px 8px 2px 8px;
  }

  html[data-keyboard="open"] .travel-object figcaption {
    padding: 3px 1px 0;
  }

  html[data-keyboard="open"] .travel-object small {
    display: none;
  }

  html[data-keyboard="open"] .travel-object strong {
    font-size: 6px;
  }

  html[data-keyboard="open"] .character-bubble,
  html[data-keyboard="open"] .scene-stage .character-bubble {
    top: auto;
    right: 64px;
    bottom: calc(var(--keyboard-stage-bottom) + 9px);
    left: 8px;
    width: auto;
    min-height: 43px;
    max-height: 58px;
    padding: 7px 10px 9px;
    border-radius: 15px 15px 4px 15px;
    box-shadow: 0 8px 24px rgba(21, 76, 97, 0.17), 3px 3px 0 rgba(104, 213, 234, 0.37);
    transform-origin: 16% 100%;
  }

  html[data-keyboard="open"] .character-bubble > span {
    margin-bottom: 2px;
    font-size: 6px;
  }

  html[data-keyboard="open"] .character-bubble p {
    display: -webkit-box;
    min-height: 1.15em;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.16;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  html[data-keyboard="open"] .character-bubble > i {
    right: 19px;
    bottom: -12px;
    display: block;
    width: 22px;
    height: 19px;
  }

  html[data-keyboard="open"] .scene-stage.is-choice-node .character-bubble {
    min-height: 37px;
    max-height: 42px;
    padding: 6px 9px 7px;
  }

  html[data-keyboard="open"] .scene-stage.is-choice-node .character-bubble > span {
    display: none;
  }

  html[data-keyboard="open"] .scene-stage.is-choice-node .character-bubble p {
    font-size: 14px;
    line-height: 1.16;
    -webkit-line-clamp: 1;
  }

  html[data-keyboard="open"] .dialogue-panel,
  html[data-keyboard="open"] .dialogue-panel.is-choice {
    top: auto;
    right: 7px;
    bottom: 7px;
    left: 7px;
    width: auto;
    height: var(--keyboard-panel-height);
    min-height: var(--keyboard-panel-height);
    max-height: var(--keyboard-panel-height);
    padding: 10px 11px 10px 14px;
    overflow: hidden;
    border-radius: 18px 18px 5px 18px;
    background: rgba(250, 255, 253, 0.96);
    box-shadow: 0 9px 30px rgba(24, 91, 113, 0.17), 3px 3px 0 rgba(104, 213, 234, 0.28);
  }

  html[data-keyboard="open"] .dialogue-panel::before {
    width: 4px;
    border-radius: 18px 0 0 18px;
  }

  html[data-keyboard="open"] .dialogue-panel::after {
    right: 13px;
    bottom: 6px;
    left: 15px;
  }

  html[data-keyboard="open"] .dialogue-meta {
    position: absolute;
    z-index: 4;
    top: 8px;
    right: 10px;
    min-height: 0;
    margin: 0;
  }

  html[data-keyboard="open"] .dialogue-source {
    display: none;
  }

  html[data-keyboard="open"] .session-pace {
    grid-template-rows: auto;
    min-width: 76px;
    padding: 5px 7px 4px;
    border-radius: 11px 11px 3px 11px;
  }

  html[data-keyboard="open"] .session-pace span {
    display: none;
  }

  html[data-keyboard="open"] .session-pace b {
    min-width: 41px;
    font-size: 20px;
  }

  html[data-keyboard="open"] .session-pace small {
    font-size: 7px;
  }

  html[data-keyboard="open"] .dialogue-line {
    min-height: 28px;
    margin: 1px 84px 7px 0;
    font-size: 21px;
    line-height: 1.22;
    text-wrap: pretty;
  }

  html[data-keyboard="open"] .dialogue-line .is-error-target::before,
  html[data-keyboard="open"] .choice-text .is-error-target::before {
    bottom: calc(100% + 3px);
    padding: 3px 4px;
    font-size: 8px;
  }

  html[data-keyboard="open"] .dialogue-hint {
    display: none;
  }

  html[data-keyboard="open"] .typing-error {
    gap: 5px;
    min-height: 24px;
    margin-top: 4px;
    padding: 4px 6px;
    overflow: hidden;
    font-size: 9px;
    white-space: nowrap;
  }

  html[data-keyboard="open"] .typing-error span {
    padding: 3px 4px;
    font-size: 7px;
  }

  html[data-keyboard="open"] .typing-error b {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[data-keyboard="open"] .choice-panel > p {
    min-height: 14px;
    margin: 0 83px 5px 0;
    font-size: 9px;
    line-height: 1.4;
  }

  html[data-keyboard="open"] .choice-panel ol {
    margin-bottom: 5px;
  }

  html[data-keyboard="open"] .choice-panel li {
    grid-template-columns: 18px 1fr;
    min-height: 34px;
    padding: 3px 5px;
  }

  html[data-keyboard="open"] .choice-number {
    font-size: 6px;
  }

  html[data-keyboard="open"] .choice-text {
    font-size: 13px;
    line-height: 1.16;
  }

  html[data-keyboard="open"] .typing-composer {
    min-height: 43px;
    margin-top: 0;
    padding: 4px 8px 5px;
    border-radius: 12px 12px 4px 12px;
  }

  html[data-keyboard="open"] .dialogue-panel:not(.is-choice) .typing-composer {
    position: absolute;
    right: 11px;
    bottom: 13px;
    left: 14px;
  }

  html[data-keyboard="open"] .composer-meta {
    margin-bottom: 0;
  }

  html[data-keyboard="open"] .composer-meta span,
  html[data-keyboard="open"] .composer-meta b {
    font-size: 7px;
  }

  html[data-keyboard="open"] .story-input {
    height: 25px;
    font-size: 17px;
    line-height: 25px;
  }

  html[data-keyboard="open"] .memory-synced {
    top: calc((var(--app-height) - var(--keyboard-panel-height)) / 2);
    min-width: 210px;
    padding: 12px 18px 13px;
    border-width: 1.5px;
    border-radius: 17px 17px 5px 17px;
    box-shadow: 5px 5px 0 var(--citrus), 0 16px 40px rgba(24, 91, 113, 0.2);
  }

  html[data-keyboard="open"] .memory-synced span {
    font-size: 7px;
  }

  html[data-keyboard="open"] .memory-synced strong {
    margin-top: 4px;
    font-size: 18px;
  }

  html[data-keyboard="open"] .memory-synced i {
    margin-top: 8px;
  }
}

@media (max-height: 680px) and (min-width: 601px) {
  .intro-copy {
    transform: translateY(-44%) scale(0.9);
    transform-origin: left center;
  }

  .dialogue-panel {
    bottom: 24px;
    transform: scale(0.91);
    transform-origin: left bottom;
  }

  .result-copy {
    transform: translateY(-46%) scale(0.88);
    transform-origin: left center;
  }
}

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

  .scene-bg,
  .intro-background,
  .result-background,
  .character-layer,
  .cutin-art,
  .cutin-backdrop img,
  .travel-object,
  .character-bubble,
  .ambient-layer i,
  .intro-character img,
  .result-character {
    transform: none !important;
    translate: none !important;
    rotate: 0deg !important;
    scale: 1 !important;
  }

  .ambient-layer {
    display: none;
  }
}
