:root {
  --paper: #e9dfc7;
  --paper-light: #f4ecd9;
  --paper-deep: #d8c9a8;
  --ink: #1d211f;
  --ink-soft: #55574e;
  --red: #c53e2d;
  --red-dark: #8e281e;
  --green: #4b6250;
  --rule: rgba(29, 33, 31, 0.21);
  --shadow: 0 22px 70px rgba(56, 43, 25, 0.14);
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  color: var(--ink);
  background: #b8ad96;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 248, 226, 0.7), transparent 28rem),
    linear-gradient(120deg, #b4a891, #d0c4aa 46%, #ada18a);
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(197, 62, 45, 0.38);
  outline-offset: 3px;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.74' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  z-index: 20;
}

.game-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  padding: 25px clamp(20px, 4vw, 58px) 38px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 49.86%, rgba(47, 38, 25, 0.04) 50%, transparent 50.14%),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(60, 51, 36, 0.025) 35px 36px),
    var(--paper);
  border: 1px solid rgba(61, 48, 29, 0.36);
  box-shadow: var(--shadow);
}

.game-shell::before,
.game-shell::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 34px;
  background: rgba(239, 222, 181, 0.74);
  border: 1px solid rgba(94, 74, 43, 0.16);
  transform: rotate(-3deg);
  z-index: 2;
}

.game-shell::before { top: -12px; left: 12%; }
.game-shell::after { bottom: -15px; right: 10%; transform: rotate(2deg); }

.masthead,
.progress-rail,
.briefing,
.editor,
.action-bar {
  display: flex;
  align-items: center;
}

.masthead {
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  font-family: "FZKai-Z03S", "KaiTi", cursive;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.13em;
}

.brand-error {
  color: var(--red);
  transform: translateY(4px) rotate(-5deg);
  text-decoration: line-through 2px;
}

.proof-mark {
  margin-left: 13px;
  color: var(--ink-soft);
  font: 600 9px/1.1 ui-monospace, monospace;
  letter-spacing: 0.12em;
}

.shift-note {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(197, 62, 45, 0.11);
  animation: pulse 1.7s ease-out infinite;
}

.sound-toggle {
  display: flex;
  gap: 7px;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.sound-toggle.is-muted { opacity: 0.48; }

.progress-rail {
  min-height: 52px;
  gap: 24px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.chapter-label { white-space: nowrap; }
.folio { margin-left: auto; font-family: ui-monospace, monospace; }

.progress-dots {
  width: min(260px, 34vw);
  display: flex;
  align-items: center;
}

.progress-dot {
  flex: 1;
  height: 1px;
  background: var(--rule);
  position: relative;
}

.progress-dot::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--ink-soft);
  border-radius: 50%;
  background: var(--paper);
}

.progress-dot.is-complete::before { background: var(--green); border-color: var(--green); }
.progress-dot.is-current::before { width: 11px; height: 11px; background: var(--red); border-color: var(--red); }

.briefing {
  justify-content: space-between;
  padding: clamp(22px, 4vw, 38px) 0 20px;
}

.eyebrow,
.result-kicker {
  margin: 0 0 7px;
  color: var(--red);
  font: 700 10px/1.2 ui-monospace, monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.briefing h1 {
  margin: 0;
  font-family: "FZKai-Z03S", "KaiTi", cursive;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1;
}

.ink-meter {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ink-copy {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-soft);
}

.ink-copy strong { color: var(--ink); font: 700 24px/1 ui-monospace, monospace; }
.ink-drops { display: flex; gap: 6px; }
.ink-drop {
  width: 13px;
  height: 16px;
  background: var(--ink);
  border-radius: 55% 45% 58% 42% / 68% 50% 50% 32%;
  transform: rotate(18deg);
  transition: opacity 0.25s, transform 0.25s;
}
.ink-drop.is-spent { opacity: 0.15; transform: scale(0.68) rotate(18deg); }

.stage-card {
  min-height: 375px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(30, 34, 31, 0.54);
  background:
    linear-gradient(90deg, transparent 7.5%, rgba(197, 62, 45, 0.11) 7.6%, transparent 7.75%),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(35, 39, 35, 0.065) 38px 39px),
    rgba(246, 238, 218, 0.72);
  box-shadow: inset 0 0 80px rgba(61, 49, 28, 0.05);
}

.stage-card::after {
  content: "校样";
  position: absolute;
  right: 20px;
  bottom: 15px;
  padding: 6px 8px;
  border: 2px solid rgba(197, 62, 45, 0.23);
  color: rgba(197, 62, 45, 0.25);
  font: 800 18px/1 "KaiTi", cursive;
  transform: rotate(-8deg);
}

.stage-meta {
  position: absolute;
  inset: 14px 18px auto;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font: 600 8px/1 ui-monospace, monospace;
  letter-spacing: 0.15em;
}

.world {
  position: absolute;
  inset: 42px 5% 116px;
}

.manuscript-wrap {
  position: absolute;
  inset: auto 8% 45px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
}

.line-number { color: var(--red); font-size: 22px; }

.manuscript {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex: 1;
  min-height: 62px;
  gap: 0.18em;
  font-size: clamp(24px, 4.5vw, 45px);
  line-height: 1.35;
  white-space: nowrap;
}

.word-token {
  position: relative;
  display: inline-block;
  padding: 0.05em 0.07em;
  border: 0;
  background: transparent;
  font: inherit;
  transition: font-size 0.25s, letter-spacing 0.25s, color 0.2s, background 0.2s;
}

button.word-token { cursor: pointer; border-bottom: 1px dashed rgba(29, 33, 31, 0.46); }
button.word-token::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid transparent;
  pointer-events: none;
}
button.word-token:hover { background: rgba(197, 62, 45, 0.07); }
button.word-token.is-selected { color: var(--red-dark); background: rgba(197, 62, 45, 0.1); }
button.word-token.is-selected::after { border-color: var(--red); }
.word-token.fmt-bold { font-weight: 900; text-shadow: 0 1px 0 currentColor; }
.word-token.fmt-italic { font-style: italic; }
.word-token.fmt-underline { text-decoration: underline 0.12em; text-underline-offset: 0.15em; }
.word-token.fmt-strike { text-decoration: line-through 0.11em var(--red); opacity: 0.58; }
.word-token.fmt-small { font-size: 0.58em; }
.word-token.fmt-large { font-size: 1.48em; }

.selection-help {
  position: absolute;
  right: 0;
  bottom: -26px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* Stage objects */
.world-object { position: absolute; transition: transform 0.9s cubic-bezier(.21,.83,.32,1), opacity 0.45s; }
.object-label { display: block; font: 700 11px/1 "KaiTi", cursive; letter-spacing: 0.12em; text-align: center; }
.leaf {
  left: 24%;
  top: 24%;
  width: 62px;
  height: 32px;
  border: 2px solid var(--green);
  border-radius: 100% 0 100% 0;
  background: rgba(75, 98, 80, 0.17);
  transform: rotate(-12deg);
}
.leaf::after { content: ""; position: absolute; left: 8px; top: 15px; width: 50px; border-top: 1px solid var(--green); transform: rotate(-4deg); }
.leaf .object-label { transform: translateY(-20px) rotate(12deg); }
.button-object { left: 65%; bottom: 2%; width: 88px; height: 22px; border: 2px solid var(--ink); background: var(--red); box-shadow: 0 9px 0 var(--ink); }
.button-object::before { content: ""; position: absolute; left: -14px; right: -14px; bottom: -13px; border-top: 2px solid var(--ink); }
.button-object .object-label { transform: translateY(-20px); }
.exit-object { right: 7%; bottom: -1px; width: 52px; height: 108px; border: 3px solid var(--ink); border-bottom: 0; background: rgba(75,98,80,.08); }
.exit-object::after { content: "·"; position: absolute; right: 8px; top: 44%; font-size: 22px; }
.exit-object .object-label { transform: translateY(-20px); }
.boulder { left: 56%; bottom: 0; width: 118px; height: 100px; border: 3px solid var(--ink); border-radius: 47% 53% 45% 55%; background: rgba(29,33,31,.13); transform: rotate(-3deg); }
.boulder::before { content: ""; position: absolute; inset: 17px 23px 38px 19px; border-top: 1px solid var(--ink-soft); transform: rotate(12deg); }
.boulder .object-label { transform: translateY(-22px) rotate(3deg); }
.traveler { left: 15%; bottom: 0; width: 28px; height: 62px; border-left: 3px solid var(--ink); }
.traveler::before { content: ""; position: absolute; width: 20px; height: 20px; left: -11px; top: -17px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-light); }
.traveler::after { content: ""; position: absolute; left: -12px; top: 20px; width: 26px; height: 30px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: skew(-14deg); }
.traveler .object-label { transform: translate(-18px, -33px); width: 55px; }
.house { right: 8%; bottom: 0; width: 104px; height: 78px; border: 3px solid var(--ink); background: rgba(197,62,45,.08); }
.house::before { content: ""; position: absolute; width: 74px; height: 74px; left: 12px; top: -40px; border-left: 3px solid var(--ink); border-top: 3px solid var(--ink); transform: rotate(45deg); }
.house .object-label { transform: translateY(-44px); }
.shield { left: 43%; bottom: 0; width: 50px; height: 68px; border: 3px solid var(--green); border-radius: 50% 50% 45% 45%; background: rgba(75,98,80,.13); }
.shield::after { content: ""; position: absolute; left: 50%; top: 7px; bottom: 7px; border-left: 1px solid var(--green); }
.shield .object-label { transform: translateY(-22px); }
.fireball { left: 5%; top: 31%; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--red); background: rgba(197,62,45,.23); box-shadow: -17px 0 0 -10px var(--red), -34px 0 0 -15px var(--red); }
.fireball .object-label { transform: translateY(-19px); }
.motion-line { position: absolute; left: 7%; right: 16%; top: 51%; border-top: 1px dashed rgba(197,62,45,.34); }

.stage-card.is-running .manuscript-wrap,
.stage-card.has-result .manuscript-wrap { opacity: 0.19; transition: opacity 0.3s; }
.stage-card.is-running .selection-help { display: none; }
.stage-card.outcome-l1-success .leaf { transform: translate(425%, 250%) rotate(18deg) scale(1.12); animation: heavyLand 1s .25s both; }
.stage-card.outcome-l1-success .button-object { animation: pressButton .5s 1s both; }
.stage-card.outcome-l1-slide .leaf { transform: translate(750%, 60%) rotate(18deg); }
.stage-card.outcome-l1-platform .leaf { transform: translate(230%, 100%) rotate(-5deg); box-shadow: 0 11px 0 -8px var(--ink); }
.stage-card.outcome-l1-vanish .leaf { opacity: 0; transform: scale(.2) rotate(45deg); }
.stage-card.outcome-l1-big .leaf { transform: translate(380%, 100%) scale(2.3) rotate(-6deg); }
.stage-card.outcome-l1-small .leaf { transform: translate(520%, 230%) scale(.42) rotate(-6deg); }
.stage-card.outcome-l2-small .boulder { transform: translate(10%, 20%) scale(.24); }
.stage-card.outcome-l2-small .traveler,
.stage-card.outcome-l2-strike .traveler { transform: translateX(1600%); transition-delay: .6s; }
.stage-card.outcome-l2-strike .boulder { opacity: 0; transform: scale(.8); }
.stage-card.outcome-l2-heavy .boulder { animation: heavyShake .32s .5s 2; }
.stage-card.outcome-l2-slide .boulder { transform: translateX(-225%) rotate(-35deg); }
.stage-card.outcome-l3-shield .shield { transform: translate(-235%, -2%) scale(1.78) skewX(-8deg); }
.stage-card.outcome-l3-strike .fireball { opacity: 0; transform: translateX(360%) scale(.05); }
.stage-card.outcome-l3-house .fireball { transform: translate(1320%, 115%) scale(1.25); }
.stage-card.outcome-l3-house .house { animation: houseHit .48s .7s both; }
.stage-card.outcome-l3-partial .shield { transform: scale(1.7); }
.stage-card.outcome-l3-slide-only .shield { transform: translate(-235%, 0) skewX(-8deg); }
.stage-card.outcome-l3-heavy-fire .fireball { transform: translate(1320%, 115%) scale(2); }

.result-card {
  position: absolute;
  z-index: 10;
  width: min(430px, calc(100% - 36px));
  right: 30px;
  top: 50%;
  transform: translateY(-50%) rotate(-1deg);
  padding: 24px 27px 22px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 10px 12px 0 rgba(29, 33, 31, 0.12);
  animation: resultIn .38s cubic-bezier(.2,.8,.2,1) both;
}
.result-card[hidden] { display: none; }
.result-card.is-success { border-color: var(--green); }
.result-card.is-success .result-kicker { color: var(--green); }
.result-card h2 { margin: 3px 0 7px; font: 800 28px/1.15 "KaiTi", cursive; }
.result-card p:not(.result-kicker) { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.result-actions { display: flex; align-items: center; gap: 16px; margin-top: 17px; }

.editor { display: block; padding-top: 20px; }
.selected-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.cursor-icon { color: var(--red); font-size: 18px; }

.toolbar { display: grid; grid-template-columns: repeat(4, 1fr) 1.45fr; border: 1px solid var(--ink); }
.tool {
  min-height: 72px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 2px 8px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--rule);
  background: rgba(245, 236, 214, 0.45);
  cursor: pointer;
  transition: color .2s, background .2s, transform .15s;
}
.tool:hover:not(:disabled) { background: var(--paper-light); }
.tool:active:not(:disabled) { transform: translateY(2px); }
.tool:disabled { opacity: .34; cursor: not-allowed; }
.tool[aria-pressed="true"] { color: var(--paper-light); background: var(--ink); }
.tool-glyph { grid-row: 1 / span 2; font-family: Georgia, serif; font-size: 29px; }
.tool-name { align-self: end; font-size: 12px; }
.tool-cost { align-self: start; color: var(--ink-soft); font: 600 8px/1 ui-monospace, monospace; letter-spacing: .08em; }
.tool[aria-pressed="true"] .tool-cost { color: rgba(244,236,217,.6); }
.size-tool { grid-template-columns: auto 1fr 1fr auto; grid-template-rows: 1fr; border-right: 0; cursor: default; }
.size-label { font-size: 11px; writing-mode: vertical-rl; letter-spacing: .15em; }
.size-tool button { height: 44px; border: 1px solid var(--rule); background: transparent; cursor: pointer; font: 700 16px/1 Georgia, serif; }
.size-tool button:hover:not(:disabled), .size-tool button[aria-pressed="true"] { background: var(--ink); color: var(--paper-light); }

.action-bar { justify-content: space-between; padding-top: 14px; }
.utility-actions { display: flex; align-items: center; gap: 21px; }
.text-button { padding: 4px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-soft); font-size: 11px; }
.text-button:hover:not(:disabled) { color: var(--red); border-bottom-color: currentColor; }
.text-button:disabled { opacity: .34; cursor: not-allowed; }
.hint-button span { font-family: ui-monospace, monospace; }
.execute-button,
.button {
  border: 0;
  cursor: pointer;
  letter-spacing: .08em;
}
.execute-button {
  width: min(250px, 34vw);
  min-height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px 0 22px;
  color: var(--paper-light);
  background: var(--red);
  box-shadow: 5px 5px 0 var(--red-dark);
  font-weight: 800;
}
.execute-button:hover:not(:disabled) { background: #d84936; }
.execute-button:active:not(:disabled) { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--red-dark); }
.execute-button:disabled { background: #8e8a7e; box-shadow: 5px 5px 0 #68665e; cursor: not-allowed; }
.execute-arrow { font-size: 21px; transition: transform .2s; }
.execute-button:hover .execute-arrow { transform: translateX(4px); }
.button { padding: 11px 16px; font-size: 11px; }
.button-dark { color: var(--paper-light); background: var(--ink); }
.button-vermillion { color: #fff7e6; background: var(--red); box-shadow: 5px 5px 0 var(--red-dark); }

.hint-note {
  margin: 14px 0 0;
  padding: 11px 15px 11px 42px;
  position: relative;
  border-left: 3px solid var(--red);
  color: var(--ink-soft);
  background: rgba(244,236,217,.55);
  font-size: 12px;
  line-height: 1.6;
  animation: noteIn .25s both;
}
.hint-note::before { content: "※"; position: absolute; left: 16px; color: var(--red); }
.hint-note[hidden] { display: none; }

.intro-dialog {
  width: min(640px, calc(100% - 32px));
  padding: clamp(28px, 5vw, 58px);
  position: fixed;
  overflow: visible;
  border: 1px solid var(--ink);
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 12%, rgba(197,62,45,.12) 12.2%, transparent 12.4%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(29,33,31,.05) 31px 32px),
    var(--paper-light);
  box-shadow: 18px 22px 0 rgba(29,33,31,.18);
}
.intro-dialog::backdrop { background: rgba(28, 29, 25, .78); backdrop-filter: blur(7px); }
.intro-dialog[open] { animation: dialogIn .55s cubic-bezier(.16,.8,.24,1) both; }
.dialog-proof { color: var(--red); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .2em; }
.dialog-number { position: absolute; top: 6px; right: 28px; margin: 0; color: rgba(197,62,45,.12); font: 900 120px/1 Georgia, serif; }
.intro-dialog h2 { margin: 35px 0 18px; font: 900 clamp(33px, 7vw, 58px)/1.12 "KaiTi", cursive; letter-spacing: -.05em; }
.intro-dialog h2 em { color: var(--red); font-style: normal; }
.intro-dialog > p:not(.dialog-number) { max-width: 480px; color: var(--ink-soft); font-size: 14px; line-height: 1.9; }
.rule-strip { display: flex; gap: 8px; margin: 25px 0; }
.rule-strip span { flex: 1; padding: 10px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); text-align: center; font-size: 11px; }
.rule-strip b, .rule-strip i, .rule-strip u { margin-right: 6px; font: 700 20px Georgia, serif; }
.intro-dialog small { display: block; margin-top: 15px; color: var(--ink-soft); font-size: 9px; letter-spacing: .1em; }

@keyframes pulse { 70%, 100% { box-shadow: 0 0 0 10px rgba(197,62,45,0); } }
@keyframes heavyLand { 0% { transform: translate(0,0) rotate(-12deg); } 65% { transform: translate(425%,250%) rotate(18deg) scale(1.12); } 80% { transform: translate(425%,220%) rotate(18deg) scale(1.12); } 100% { transform: translate(425%,250%) rotate(18deg) scale(1.12); } }
@keyframes pressButton { to { transform: translateY(9px); box-shadow: 0 0 0 var(--ink); background: var(--green); } }
@keyframes heavyShake {
  0%, 100% { transform: translate(0, 14px) scale(1.12); }
  35% { transform: translate(-7px, 14px) scale(1.12); }
  70% { transform: translate(7px, 14px) scale(1.12); }
}
@keyframes houseHit { 0% { transform: rotate(0); } 35% { transform: rotate(5deg); } 70% { transform: rotate(-4deg); opacity: 1; } 100% { transform: rotate(8deg) translateY(16px); opacity: .35; } }
@keyframes resultIn { from { opacity: 0; transform: translate(25px,-46%) rotate(2deg); } }
@keyframes noteIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(22px) rotate(1deg) scale(.97); } }

@media (max-width: 720px) {
  :root { background: var(--paper); }
  body { background: var(--paper); }
  .paper-grain { display: none; }
  .game-shell {
    width: 100%;
    min-height: 100svh;
    margin: 0;
    padding: 10px 12px max(14px, env(safe-area-inset-bottom));
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: var(--paper);
  }
  .game-shell::before,
  .game-shell::after { display: none; }
  .masthead { min-height: 36px; padding-bottom: 7px; border-bottom-width: 1px; }
  .brand { font-size: 24px; }
  .proof-mark { display: none; }
  .shift-note { display: none; }
  .sound-label { display: none; }
  .sound-toggle { min-width: 40px; min-height: 36px; justify-content: flex-end; }
  .progress-rail { min-height: 34px; gap: 10px; border-bottom: 0; }
  .chapter-label { font-size: 9px; letter-spacing: .08em; }
  .progress-dots { flex: 1; width: auto; }
  .progress-dot::before { width: 5px; height: 5px; }
  .progress-dot.is-current::before { width: 8px; height: 8px; }
  .folio { font-size: 9px; }
  .briefing { min-height: 58px; align-items: center; padding: 8px 0 9px; }
  .eyebrow { margin-bottom: 4px; font-size: 8px; }
  .briefing h1 { font-size: 27px; }
  .ink-meter { gap: 8px; }
  .ink-copy { display: none; }
  .ink-drop { width: 8px; height: 11px; }
  .stage-card {
    min-height: 306px;
    contain: layout paint;
    box-shadow: none;
    background:
      linear-gradient(90deg, transparent 7.5%, rgba(197, 62, 45, 0.1) 7.7%, transparent 7.9%),
      var(--paper-light);
  }
  .stage-card::after { display: none; }
  .stage-meta { inset: 10px 12px auto; }
  .stage-meta span:first-child { display: none; }
  .stage-meta span:last-child { margin-left: auto; }
  .world {
    inset: 29px 2% 92px;
    transform: scale(.78);
    transform-origin: center bottom;
    contain: layout paint;
  }
  .world-object {
    will-change: transform, opacity;
    transition-duration: .52s, .28s;
  }
  .manuscript-wrap { inset: auto 4% 26px; gap: 4px; }
  .line-number { font-size: 17px; }
  .manuscript {
    justify-content: center;
    overflow: hidden;
    font-size: clamp(21px, 6.8vw, 30px);
    min-height: 48px;
  }
  .word-token { transition-duration: .16s; }
  .selection-help { display: none; }
  .editor { padding-top: 10px; }
  .selected-readout {
    min-height: 28px;
    margin: 0;
    padding: 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }
  .cursor-icon { font-size: 15px; }
  .toolbar { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tool {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px;
  }
  .tool-glyph { font-size: 22px; line-height: 1; }
  .tool-name { align-self: auto; font-size: 9px; }
  .tool-cost { display: none; }
  .size-tool { display: contents; }
  .size-label,
  .size-tool .tool-cost { display: none; }
  .size-tool button {
    height: auto;
    min-width: 0;
    border: 0;
    border-right: 1px solid var(--rule);
    font-size: 16px;
  }
  .size-tool button:last-of-type { border-right: 0; }
  .action-bar {
    display: grid;
    grid-template-columns: auto minmax(145px, 1fr);
    gap: 10px;
    padding-top: 10px;
  }
  .execute-button { width: 100%; min-height: 48px; box-shadow: 3px 3px 0 var(--red-dark); }
  .utility-actions { gap: 0; }
  .utility-actions .text-button {
    min-width: 42px;
    min-height: 44px;
    padding: 4px 7px;
    border-right: 1px solid var(--rule);
    font-size: 0;
  }
  .utility-actions .text-button:last-child { border-right: 0; }
  .utility-actions .text-button::first-letter { font-size: 15px; }
  .utility-actions #resetButton::before { content: "↺"; font-size: 17px; }
  .utility-actions #hintButton::before { content: "※"; font-size: 17px; }
  .utility-actions #hintButton span { display: none; }
  .hint-note { margin-top: 8px; padding: 8px 10px 8px 34px; font-size: 11px; }
  .hint-note::before { left: 12px; }
  .result-card { inset: 50% auto auto 50%; right: auto; transform: translate(-50%,-50%) rotate(-1deg); }
  .result-card h2 { font-size: 24px; }
  .result-card {
    padding: 20px;
    box-shadow: 5px 6px 0 rgba(29,33,31,.14);
    transform: translate(-50%,-50%);
  }
  .result-card p:not(.result-kicker) { line-height: 1.55; }
  .intro-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 2px solid var(--ink);
    box-shadow: none;
    background: var(--paper-light);
  }
  .intro-dialog::backdrop { background: rgba(28,29,25,.64); backdrop-filter: none; }
  .dialog-number { display: none; }
  .intro-dialog h2 { margin: 18px 0 10px; font-size: 36px; }
  .intro-dialog > p:not(.dialog-number) { margin: 0; font-size: 13px; line-height: 1.7; }
  .rule-strip { margin: 18px 0; gap: 5px; }
  .rule-strip span { padding: 8px 2px; font-size: 9px; }
  .rule-strip b,
  .rule-strip i,
  .rule-strip u { display: block; margin: 0 0 2px; font-size: 17px; }
  .intro-dialog .button { width: 100%; min-height: 48px; }
  .intro-dialog small { text-align: center; }

  .stage-card.outcome-l1-success .leaf { animation-duration: .6s; animation-delay: .06s; }
  .stage-card.outcome-l1-success .button-object { animation-duration: .28s; animation-delay: .56s; }
  .stage-card.outcome-l2-heavy .boulder { animation-delay: .3s; }
  .stage-card.outcome-l3-house .house { animation-delay: .4s; }
}

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