/* Ledger, battle, title, creation, modal and ending screens. Tone steps, no outlines. */

/* Ledger: the duty meters are the game's data, so they carry the gold. */
.ledger { position: relative; background: var(--surface) url("torana.svg") 0 0 / 28px 16px repeat-x; border-radius: var(--r-card); padding: 32px 20px 20px; display: grid; gap: 18px; min-width: 0; }
.ledger h2 { margin: 0; font-family: var(--display); font-size: 23px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.ledger .sub { font-size: 14px; color: var(--muted); margin: -10px 0 0; }
.meter { display: grid; gap: 5px; }
.meter.with-face { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
.meter.with-face .thumb.face { grid-row: span 2; width: 38px; height: 38px; }
.meter .row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.meter .row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.pips i { height: 7px; border-radius: 2px; background: var(--track); transition: background-color 0.4s; }
.pips i.on { background: var(--data); } .pips i.flash { background: var(--accent); } .pips i.lost { background: var(--negative); }
.d-up { color: var(--positive); } .d-down { color: var(--negative); }
.vowcard { background: var(--raised); border-radius: var(--r-card); padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: center; }
.vowcard .thumb.emblem { grid-row: span 2; width: 44px; height: 44px; }
.vowcard.broken .thumb { opacity: 0.4; filter: grayscale(1); }
.vowcard b { font-family: var(--display); font-size: 20px; line-height: 1.15; }
.vowcard small { font-size: 14px; color: var(--muted); }
.vowcard.broken { background: transparent; } .vowcard.broken b { text-decoration: line-through; color: var(--faint); }
.empty { font-size: 14px; color: var(--faint); font-style: italic; margin: 0; }
.mems { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.mems li em { color: var(--faint); font-style: normal; font-size: 13px; display: block; }
/* Secrets: each sealed with a dot of red wax. */
.secrets { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.secrets li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start; }
.secrets li::before { content: ""; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: #b8342a; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.22); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; border-radius: var(--r-control); padding: 3px 10px; background: var(--raised); color: var(--ink); }
.chip.bad { background: #5c2a22; color: #ffb4a0; }
.chip.good { background: #24402f; color: #a9e3c6; }

/* Battle */
.battle { display: grid; gap: 16px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .sides { grid-template-columns: 1fr; } }
.side { display: grid; gap: 8px; align-content: start; }
.unit { text-align: left; background: var(--raised); border: 0; border-radius: var(--r-card); padding: 11px 13px; display: grid; gap: 6px; cursor: default; width: 100%; transition: background-color 0.15s; }
.unit.enemy { cursor: pointer; }
.unit.enemy:hover:not(:disabled) { background: var(--hover); }
.unit.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.unit.down { opacity: 0.45; }
.unit .nm { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.unit .nm em { font-style: normal; flex: 1; min-width: 0; }
.unit .nm .thumb.face { width: 30px; height: 30px; }
.unit .nm span { font-weight: 500; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hpbar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.hpbar i { display: block; height: 100%; background: var(--positive); transition: width 0.35s cubic-bezier(.2, .7, .2, 1); }
.unit.enemy .hpbar i { background: var(--negative); }
.unit .st { display: flex; flex-wrap: wrap; gap: 4px; }
.unit .st span { font-size: 13px; border-radius: 4px; padding: 0 7px; background: var(--surface); color: var(--muted); }
.unit .note { font-size: 13px; color: var(--accent); }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); gap: 8px; }
.act { text-align: left; background: var(--raised); border: 0; border-radius: var(--r-card); padding: 11px 13px; cursor: pointer; display: grid; gap: 2px; min-height: 58px; transition: background-color 0.15s, transform 0.12s; }
.act:hover:not(:disabled) { background: var(--hover); }
.act:active:not(:disabled) { transform: translateY(1px); }
.act b { font-size: 16px; } .act small { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.act.special b { color: var(--accent); }
.act:disabled { cursor: not-allowed; background: transparent; }
.act:disabled b { color: var(--faint); }
.blog { margin: 0; padding: 12px 14px; list-style: none; border-radius: var(--r-card); background: var(--ground); display: grid; gap: 3px; font-size: 15px; color: var(--muted); max-height: 200px; overflow-y: auto; }
.blog li:last-child { color: var(--ink); }
.idle-moves { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }
.battle-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.battle-tools .cta small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
/* The enemy's next move, read off its stance. Heavy blows aimed at you are marked. */
.unit .intent { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.unit .intent::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.unit .intent.danger { color: var(--negative); font-weight: 700; }
.unit .intent.danger::before { background: var(--negative); }
/* Something happening on the field: set apart from the blow-by-blow. */
.blog li.ev { color: var(--data); font-style: italic; border-left: 2px solid var(--data); padding-left: 8px; margin-block: 3px; }

/* Title: a full-bleed hero that cross-fades through the story's paintings, then the seven acts. */
body.titling header.top { display: none; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: min(86svh, 780px); display: grid; align-content: end; background: var(--ground); }
.slides { position: absolute; inset: 0; z-index: -2; }
.slide { position: absolute; inset: 0; background: var(--img, none) center 42% / cover no-repeat; opacity: 0; transition: opacity 1.8s ease; }
.slide.on { opacity: 1; }
.slide.mirror { scale: -1 1; } /* flipped left to right; composes with the settle zoom */
:where(html:not(.calm)) .slide.on { animation: settle 12s ease-out both; }
@keyframes settle { from { transform: scale(1.08); } to { transform: scale(1.01); } }
/* The caption scrim: the one allowed blend, under text on a painting. */
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(var(--ground-rgb), 0.96) 4%, rgba(var(--ground-rgb), 0.62) 36%, rgba(var(--ground-rgb), 0) 68%); } /* taste-skill-ignore: neutral scrim under text on a picture */
.hero-bar { position: absolute; z-index: 2; top: 16px; right: 16px; display: flex; gap: 8px; }
.hero-copy { padding: 0 clamp(20px, 5vw, 60px) clamp(28px, 6vh, 60px); display: grid; gap: 16px; max-width: 780px; }
.title { margin: 0; line-height: 0; }
.title .logo { display: block; width: min(560px, 100%); height: auto; }
.title .logo.hi { width: auto; height: clamp(150px, 22vw, 250px); max-width: 100%; }
.tagline { font-family: var(--display); font-style: italic; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; color: var(--ink); max-width: 36ch; margin: 0; } /* a line a sentence (ui/screens.js); 32ch left the second one 4% to spare */
.hero .btnrow { margin-top: 6px; }
.slide-cap { position: absolute; right: clamp(20px, 5vw, 60px); bottom: clamp(28px, 6vh, 60px); margin: 0; max-width: 28ch; text-align: right; font-size: 14px; color: var(--muted); }
/* Portrait screens (phones, upright tablets): a tall hero would crop the 3:1 painting to its middle
   fifth. Instead the painting sits as a 2:1 band on top, and the caption, title and buttons follow
   below it on the page ground. */
@media (max-aspect-ratio: 5/4) {
  .hero { min-height: 0; display: flex; flex-direction: column; }
  .hero::before { display: none; }
  .slides { position: relative; inset: auto; z-index: 0; order: 1; aspect-ratio: 2 / 1; overflow: hidden; }
  .slides::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--ground) 0%, rgba(var(--ground-rgb), 0) 38%); } /* taste-skill-ignore: neutral scrim, the painting fading into the page */
  .slide { background-position: center 42%; }
  .slide.mirror { background-position: 6% 42%; } /* keep the survivor (left of the unflipped painting) in the band */
  .slide-cap { position: static; order: 2; max-width: none; text-align: left; padding: 10px clamp(20px, 5vw, 60px) 0; }
  .hero-copy { order: 3; padding-top: 6px; gap: 14px; }
  .title .logo { width: min(420px, 92%); } .title .logo.hi { height: clamp(110px, 32vw, 170px); width: auto; }
}
/* Short landscape screens (a phone on its side): size the title by height so it clears the switch. */
@media (min-aspect-ratio: 5/4) and (max-height: 540px) {
  .title .logo { width: min(380px, 60vw); } .title .logo.hi { height: 120px; width: auto; }
  .tagline { font-size: 19px; }
  .hero-copy { gap: 10px; padding-bottom: 22px; }
  .hero { min-height: max(86svh, 320px); }
}
html[lang="hi"] .tagline { font-style: normal; line-height: 1.5; }

/* The title on one screen (owner, 7 November): the painting, the name, one line, the buttons, and the seven acts
   drifting slowly left to right along the foot (still under Calm motion; held while a pointer rests on them). */
.hero.one { position: fixed; inset: 0; z-index: 40; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.hero.one .hero-copy { position: relative; z-index: 1; padding-bottom: clamp(14px, 3vh, 26px); gap: clamp(8px, 1.6vh, 14px); }
.hero.one .btnrow { margin-top: 2px; }
.acts-run { position: relative; z-index: 1; flex: none; overflow: hidden; padding: 0 0 6px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
.acts.drift { display: flex; gap: 10px; width: max-content; margin: 0; padding: 0 10px 0 0; list-style: none; grid-template-columns: none; overflow: visible; animation: acts-drift 96s linear infinite; }
.acts-run:hover .acts.drift { animation-play-state: paused; }
@keyframes acts-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } } /* right to left (owner, 7 November, 02:05) */
.acts.drift li { position: relative; display: block; width: clamp(196px, 22vw, 340px); aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden; background: var(--raised); scroll-snap-align: none; }
.acts.drift i { position: absolute; inset: 0; aspect-ratio: auto; background: var(--img) center / cover no-repeat; }
.acts.drift li::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--ground-rgb), .95), rgba(var(--ground-rgb), .35) 55%, rgba(var(--ground-rgb), 0) 80%); } /* taste-skill-ignore: scrim under the act's name */
.acts.drift div { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 6px 10px 8px; display: grid; gap: 0; }
.acts.drift span { font-size: clamp(11.5px, 0.9vw, 13.5px); letter-spacing: .06em; color: var(--data); text-transform: lowercase; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); }
.acts.drift b { text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.acts.drift b { font-family: var(--display); font-size: clamp(18px, 1.6vw, 24px); line-height: 1.1; }
.hero-note { position: relative; z-index: 1; margin: 0; padding: 4px clamp(20px, 5vw, 60px) calc(max(8px, var(--sab, 0px)) + 2px); font-size: 12px; line-height: 1.35; color: var(--faint); }
@media (max-aspect-ratio: 5/4) {
  .hero.one .slides { flex: 1 1 auto; aspect-ratio: auto; min-height: 96px; }
  .hero.one .acts-run { order: 4; } .hero.one .hero-note { order: 5; }
  .hero.one .hero-copy { padding-top: 0; }
}
@media (max-height: 620px) {
  .hero.one .title .logo { width: min(320px, 80%); } .hero.one .title .logo.hi { height: 96px; }
  .hero.one .tagline { font-size: 19px; }
  .acts.drift li { width: 168px; }
  .hero-note { display: none; }
}

.langs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-control); background: var(--raised); }
.hero .langs { background: rgba(var(--ground-rgb), 0.78); }
.lang { border: 0; background: transparent; color: var(--muted); font-size: 15px; padding: 6px 14px; min-height: 36px; border-radius: 4px; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.lang:hover { color: var(--ink); }
.lang[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.life { padding: clamp(40px, 5vw, 60px) clamp(20px, 5vw, 60px) 32px; display: grid; gap: 22px; background: url("torana.svg") 0 0 / 28px 16px repeat-x; }
.life-head { display: grid; gap: 10px; max-width: 72ch; }
.life-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.05; }
.life-head p { margin: 0; color: var(--muted); }
html[lang="hi"] .life-head h2 { line-height: 1.3; }
.acts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.acts li { background: var(--raised); border-radius: var(--r-card); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.acts i { display: block; aspect-ratio: 4 / 5; background: var(--img) center / cover no-repeat; }
.acts div { padding: 10px 12px 14px; display: grid; gap: 4px; align-content: start; }
.acts span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acts b { font-family: var(--display); font-size: 19px; line-height: 1.12; }
.acts small { font-size: 14px; color: var(--muted); line-height: 1.4; }
html[lang="hi"] .acts b { line-height: 1.35; }
@media (max-width: 1080px) {
  .acts { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(190px, 40%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; overscroll-behavior-x: contain; }
  .acts li { scroll-snap-align: start; }
}
@media (max-width: 560px) { .acts { grid-auto-columns: 78%; } .acts i { aspect-ratio: 2 / 1; } }

/* Creation, step one: the homelands as pictures, then a page about the chosen land. */
.lands { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.origin.land { text-align: left; }
.origin.land i { aspect-ratio: 2 / 1; background: var(--img) center / cover no-repeat; }
.origin.land div { padding: 12px 14px 14px; gap: 4px; }
.origin.land b { font-size: 24px; }
.origin.land span { font-size: 14px; color: var(--data); }
.origin.land small { font-size: 15px; }
.origin.land:hover i { transform: scale(1.03); }
.origin.land i { transition: transform 0.5s ease; }
.land-hero { position: relative; aspect-ratio: 5 / 2; max-height: 460px; width: 100%; background: var(--img) center / cover no-repeat, var(--raised); display: flex; align-items: flex-end; }
.land-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--surface-rgb), 0.97), rgba(var(--surface-rgb), 0) 60%); } /* taste-skill-ignore: neutral scrim under text on a picture */
.land-hero .cap { position: relative; z-index: 1; padding: 0 26px 18px; display: grid; gap: 4px; }
.land-hero .cap b { font-family: var(--display); font-size: clamp(34px, 5vw, 56px); line-height: 1; }
.land-hero .cap small { font-size: 16px; color: var(--data); }
.land-hero .cap .kind { font-size: 14px; color: var(--muted); }
.land-hero.staged { opacity: 1; transform: none; clip-path: inset(0 50% 0 50%); }
.land-hero.staged.shown { clip-path: inset(0); transition: clip-path 1s cubic-bezier(.65, 0, .35, 1); }
.land-hero.staged .cap { opacity: 0; transform: translateY(10px); }
.land-hero.staged.shown .cap { opacity: 1; transform: none; transition: opacity 0.6s ease 0.7s, transform 0.6s ease 0.7s; }
@media (max-width: 520px) { .land-hero .cap { padding: 0 16px 14px; } }

/* Creation */
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field { display: grid; gap: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { font-size: 16px; font-weight: 500; background: var(--raised); border: 0; border-radius: var(--r-control); padding: 8px 16px; cursor: pointer; transition: background-color 0.15s; }
.opt:hover { background: var(--hover); }
.opt[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.opt small { color: inherit; opacity: 0.8; font-size: 13px; margin-left: 4px; }
.origins { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.origin { text-align: left; background: var(--raised); border: 0; border-radius: var(--r-card); padding: 0; overflow: hidden; cursor: pointer; display: grid; transition: background-color 0.15s, transform 0.15s; }
.origin:hover { background: var(--hover); transform: translateY(-2px); }
.origin i { display: block; aspect-ratio: 4 / 3; max-width: 100%; background-size: cover; background-position: center; }
.origin div { padding: 10px 12px 12px; display: grid; gap: 2px; }
.origin b { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.12; }
.origin small { font-size: 14px; color: var(--muted); line-height: 1.35; }
.origin[aria-pressed="true"], .pick[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--hover); }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); gap: 10px; }
.pick { text-align: center; background: var(--raised); border: 0; border-radius: var(--r-card); padding: 10px 10px 12px; cursor: pointer; display: grid; gap: 4px; justify-items: center; transition: background-color 0.15s, transform 0.15s; }
.pick:hover { background: var(--hover); transform: translateY(-2px); }
.pick i { display: block; width: 100%; aspect-ratio: 1; max-width: 100%; background-size: cover; background-position: center; border-radius: var(--r-control); }
.pick.round i { width: 78%; border-radius: 50%; }
.pick b { font-family: var(--display); font-size: 20px; line-height: 1.1; }
.pick small { font-size: 13.5px; color: var(--muted); }
.sheet-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sheet-head i { width: 64px; height: 64px; background-size: cover; background-position: center; border-radius: var(--r-control); flex: none; }
.sheet-head i.round { border-radius: 50%; }
.sheet-head .thumb.card { width: 86px; height: 64px; }
.sheet-head .thumb.emblem { background-size: contain; }
.sheet-head span { font-size: 15px; color: var(--muted); }
input[type="text"], textarea { font: inherit; color: var(--ink); background: var(--raised); border: 1px solid var(--track); border-radius: var(--r-control); padding: 10px 12px; width: min(100%, 360px); }
textarea { width: 100%; min-height: 110px; font-size: 13px; word-break: break-all; }
input[type="text"]:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; cursor: pointer; }
.toggle input { margin-top: 5px; accent-color: var(--accent); width: 18px; height: 18px; }
.toggle small { display: block; color: var(--muted); font-size: 14px; }
.range { display: grid; gap: 4px; font-size: 16px; padding-left: 28px; }
.range input { width: 100%; accent-color: var(--accent); }
.note { font-size: 15px; color: var(--muted); }
.err { color: var(--negative); font-size: 15px; }

/* Dialog: the one surface that truly floats, so it may cast a shadow. */
.scrim { position: fixed; inset: 0; background: rgba(20, 8, 6, 0.8); display: grid; place-items: center; z-index: 50;
  padding: max(16px, var(--sat)) max(16px, var(--sar)) max(16px, var(--sab)) max(16px, var(--sal)); }
.modal { background: var(--surface) url("torana.svg") 0 0 / 28px 16px repeat-x; border-radius: var(--r-card); width: min(720px, 100%); max-height: 100%; overflow-y: auto; padding: 34px 24px 24px; display: grid; gap: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); } /* taste-skill-ignore: dialog floats */
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* The window's title and Close stay in reach while its contents scroll. */
.modal > header { position: sticky; top: -34px; z-index: 2; margin: -34px -24px 0; padding: 34px 24px 10px; background: var(--surface) url("torana.svg") 0 0 / 28px 16px repeat-x; }
@media (max-width: 720px), (max-height: 520px) { .modal { padding: 26px 16px 18px; gap: 12px; } .modal > header { top: -26px; margin: -26px -16px 0; padding: 26px 16px 8px; } .modal h2 { font-size: 26px; } }
.modal h2 { margin: 0; font-family: var(--display); font-size: 32px; line-height: 1.05; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; }
.stat { display: flex; justify-content: space-between; padding: 5px 0; font-size: 16px; }
.stat span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }
.journal { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.journal li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; font-size: 16px; }
.journal li span { color: var(--data); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.gloss dt { font-family: var(--display); font-weight: 700; font-size: 21px; }
.gloss dd { margin: 0 0 10px; color: var(--muted); font-size: 16px; }

/* Ending */
.telling { font-family: var(--display); font-size: clamp(21px, 2.2vw, 24px); line-height: 1.42; display: grid; gap: 12px; }
.telling p { max-width: 60ch; margin: 0; }
.fates { display: grid; gap: 8px; font-size: 16px; background: var(--raised); border-radius: var(--r-card); padding: 16px 18px; }
.fates p { margin: 0; }

/* The lamp: at a few moments the story will not wait. The flame shrinks as the oil runs down. */
.lamp { --oil: 1; display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 6px 14px; padding: 10px 14px; margin-bottom: 10px; border-radius: var(--r-card); background: rgba(0, 0, 0, 0.18); border: 1px solid var(--gold-line); }
.lamp .diya { grid-row: 1 / span 2; position: relative; width: 70px; aspect-ratio: 330 / 264; }
.lamp .diya img, .lamp .diya svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The flame shrinks toward its wick (86% across, 55% down the trimmed lamp) as the oil runs out. */
.lamp .flame { transform-origin: 86.4% 55.3%; transform: scale(calc(0.3 + var(--oil) * 0.7)); transition: transform 0.2s linear, opacity 0.4s; }
.lamp .smoke { opacity: 0; transition: opacity 0.8s; overflow: visible; }
.lamp .oil { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; align-self: end; }
.lamp .oil i { display: block; height: 100%; width: calc(var(--oil) * 100%); background: var(--data); }
.lamp-note { font-size: 15px; color: var(--muted); align-self: start; }
.lamp.low .oil i { background: var(--negative); }
.lamp.low .lamp-note { color: var(--ink); }
.lamp.out .flame { opacity: 0; animation: none; }
.lamp.out .smoke { opacity: 0.8; }
:where(html:not(.calm)) .lamp .flame { animation: flicker 0.9s ease-in-out infinite alternate; }
:where(html:not(.calm)) .lamp.low .flame { animation: flicker 0.9s ease-in-out infinite alternate, gutter 0.5s steps(2) infinite; }
@keyframes flicker { to { opacity: 0.86; translate: 0 -1px; } }
@keyframes gutter { 50% { opacity: 0.55; } }

/* Dice games: long pasha dice, ivory with dark pips. */
.dicegame { display: grid; gap: 12px; padding: 14px 16px; border-radius: var(--r-card); background: rgba(0, 0, 0, 0.16); border: 1px solid var(--gold-line); }
.game-rules, .game-note { margin: 0; font-size: 15px; color: var(--muted); }
.game-note { color: var(--ink); }
.dicegame .score { margin: 0; font-family: var(--display); font-weight: 700; font-size: 21px; }
.dicegame .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dicegame .row .who { min-width: 84px; color: var(--muted); font-size: 15px; }
.dicegame .row .sum { font-family: var(--display); font-size: 24px; color: var(--data); font-variant-numeric: tabular-nums; }
.dice { display: flex; gap: 8px; }
.die { width: 72px; height: 26px; border: 0; border-radius: 6px; background: #efe2c4; box-shadow: inset 0 -3px 0 rgba(58, 26, 18, 0.28); display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; }
.die i { width: 6px; height: 6px; border-radius: 50%; background: #3a1a12; }
.die:disabled { cursor: default; opacity: 1; }
.die.live { cursor: pointer; outline: 1px dashed var(--accent); outline-offset: 3px; }
.die.live:hover { background: #fff4da; }
.dice.rolled .die { animation: tumble 0.5s cubic-bezier(.2, .8, .3, 1) both; }
.dice.rolled .die:nth-child(2) { animation-delay: 0.07s; }
.dice.rolled .die:nth-child(3) { animation-delay: 0.14s; }
@keyframes tumble { from { opacity: 0; transform: translateY(-16px) rotate(-28deg); } 60% { opacity: 1; transform: translateY(2px) rotate(6deg); } to { transform: none; } }
.throws { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.throws li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.throws li span { min-width: 76px; color: var(--muted); font-size: 15px; }
.dicegame .btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* Rebirth: a past life to remember, on the creation page. */
.pick.past i { aspect-ratio: 4 / 3; }
.pick.past i.none { background: var(--surface); border: 1px dashed var(--faint); }
.pick.past small.karma { color: var(--data); }

/* The Book of Lives: the endings gallery, then a shelf of every life lived in this browser. */
.endings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.ending { margin: 0; background: var(--raised); border-radius: var(--r-card); overflow: hidden; display: grid; grid-template-rows: auto 1fr; align-content: start; }
.ending i { display: block; aspect-ratio: 16 / 9; background: var(--img, none) center / cover no-repeat, var(--ground); }
.ending:not(.found) i { background: var(--ground) url("buti.svg") 0 0 / 44px 44px repeat; opacity: 0.6; }
.ending figcaption { padding: 8px 10px 10px; display: grid; gap: 2px; }
.ending b { font-family: var(--display); font-size: 18px; line-height: 1.15; }
.ending:not(.found) b { color: var(--faint); font-family: var(--text); font-size: 14px; font-weight: 700; }
.ending small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.shelf { display: grid; gap: 8px; }
.lifecard { background: var(--raised); border-radius: var(--r-card); }
.lifecard summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; }
.lifecard summary::-webkit-details-marker { display: none; }
.lifecard summary .thumb.card { width: 72px; flex: none; }
.lifecard summary span { display: grid; gap: 1px; min-width: 0; }
.lifecard summary b { font-family: var(--display); font-size: 20px; line-height: 1.15; }
.lifecard summary small { font-size: 13.5px; color: var(--muted); }
.lifecard[open] summary { border-bottom: 1px solid var(--gold-line); }
.lifecard .telling { padding: 4px 14px 12px; font-size: 15.5px; }
.lifecard .telling p { margin: 8px 0 0; }

/* The record: what your past still does for you. */
.merits { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.merits li small { display: block; font-size: 13px; color: var(--positive); }
.merits li.down small { color: var(--negative); }
.record-line { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* The map: the subcontinent on cloth, the road in saffron. */
.bmap { display: block; width: 100%; height: auto; border-radius: var(--r-card); background: #a9c0bb; font-family: var(--display); }
.bmap .m-sea { fill: #a9c0bb; }
.bmap .m-land { fill: #ecdcb6; stroke: #7a5634; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bmap .m-hills { fill: none; stroke: #8b6a46; stroke-width: 1.3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bmap .m-hills.low { stroke: #a8885f; }
.bmap .m-river { fill: none; stroke: #4f7f93; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.bmap .m-river.minor { stroke-width: 1.2; opacity: .7; }
.bmap .m-river.dry { stroke-dasharray: 3 4; opacity: .7; }
.bmap text { fill: #3b2414; paint-order: stroke; stroke: #ecdcb6; stroke-width: 3px; stroke-linejoin: round; }
.bmap .m-water { fill: #2f5f73; stroke: none; font-style: italic; letter-spacing: .04em; }
.bmap .m-region { fill: #7a5634; stroke: none; letter-spacing: .3em; text-transform: uppercase; }
.bmap .m-place circle { fill: #ecdcb6; stroke: #5a3a22; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.bmap .m-place line { stroke: #5a3a22; stroke-width: .8; vector-effect: non-scaling-stroke; opacity: .6; }
.bmap .m-place.been circle { fill: #c8471f; }
.bmap .m-place.small text { font-style: italic; }
.bmap .m-place.here text { font-weight: 700; }
.bmap .m-ring { fill: none !important; stroke: #c8471f !important; stroke-width: 2 !important; animation: m-pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes m-pulse { 50% { transform: scale(1.35); opacity: .45; } }
.bmap .m-road { fill: none; stroke: #c8471f; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-dasharray: 6 5; stroke-linecap: round; opacity: .75; }
.bmap .m-road.new { vector-effect: none; opacity: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: m-draw 2.2s cubic-bezier(.4,0,.2,1) forwards; }
.bmap .m-road.new.still { stroke-dashoffset: 0; animation: none; }
@keyframes m-draw { to { stroke-dashoffset: 0; } }
.bmap .m-lamp { fill: #ffcf6b; stroke: #c8471f; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bmap .m-inset > rect { fill: #a9c0bb; stroke: #5a3a22; stroke-width: 1; vector-effect: non-scaling-stroke; }
.bmap .m-box { fill: rgba(200, 71, 31, .18); stroke: #c8471f; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.journey { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(var(--ground-rgb), .72); animation: j-in .3s ease-out; cursor: pointer; }
.journey.out { opacity: 0; transition: opacity .3s; }
@keyframes j-in { from { opacity: 0; } }
.journey-card { width: min(760px, 100%); background: var(--surface); border: 1px solid var(--gold-line); border-radius: var(--r-card); padding: 14px; display: grid; gap: 10px; }
.journey-card .lbl { margin: 0; }
.journey-card button { justify-self: end; }
.map-road { font-size: 15px; color: var(--muted); }
.end-map { margin: 18px 0 6px; }
.end-map .lbl { display: block; margin-bottom: 6px; }
html.calm .bmap .m-ring, html.calm .journey { animation: none; }
:lang(hi) .bmap .m-region, :lang(hi) .bmap .m-water { letter-spacing: 0; text-transform: none; }

/* Action tests: stakes first, then a single big action. */
.trial { display: grid; gap: 16px; padding: 20px; background: var(--raised); border: 1px solid var(--gold-line); border-radius: var(--r-card); }
.trial .game-rules { margin: 0; font-size: 18px; line-height: 1.5; }
.trial-practice { margin: 0; font-size: 14px; color: var(--data); letter-spacing: .02em; }
.stakes { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 15px; }
.stakes b { display: inline-block; min-width: 7.5em; font-weight: 600; }
.stakes .win b { color: var(--positive); }
.stakes .lose b { color: var(--negative); }
.trial-stats { margin: 0; font-size: 14px; color: var(--muted); }
.trial-twist { margin: 0; padding: 8px 12px; border-left: 3px solid var(--data); border-radius: 6px; background: rgba(226, 181, 90, 0.1); font-size: 15px; line-height: 1.4; } /* the lamp game's twist for this place */
/* A how-to card (trial.howto, trials.js): a small picture of the game beside its numbered steps (owner, 5 November). */
.trial .howto { display: grid; grid-template-columns: 92px 1fr; gap: 6px 14px; align-items: start; margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--gold-line); }
.trial .howto-h { grid-column: 1 / -1; margin: 0; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--data); }
.trial .howto-pic svg { display: block; width: 92px; height: auto; }
.trial .howto ol { margin: 0; padding-left: 1.15em; display: grid; gap: 4px; font-size: 14.5px; line-height: 1.38; }
@media (max-width: 400px) { .trial .howto { grid-template-columns: 64px 1fr; gap: 4px 10px; } .trial .howto-pic svg { width: 64px; } .trial .howto ol { font-size: 13.5px; } }
.trial .score { margin: 0; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trial .game-note { margin: 0; min-height: 1.4em; font-size: 16px; color: var(--ink); }
.trial-press { min-height: 68px; min-width: min(280px, 100%); font-size: 21px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.trial .btnrow { justify-content: center; }

/* Aim: the target swings across a range; your line is the centre. */
.range { position: relative; height: clamp(220px, 34vw, 300px); border-radius: var(--r-control); overflow: hidden; background: linear-gradient(#3a2a1c, #2a1d14); }
.range.dark { background: radial-gradient(ellipse at 50% 40%, #241a2c, #0c0a10); }
.range .zone { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); background: rgba(240, 148, 63, .12); border-left: 1px dashed rgba(240, 148, 63, .35); border-right: 1px dashed rgba(240, 148, 63, .35); }
.range .line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: var(--accent); opacity: .8; }
.range .target { position: absolute; top: 34px; width: 0; height: 0; }
.range .target::before { content: ""; position: absolute; left: 0; top: -34px; width: 1px; height: 62px; background: rgba(247, 234, 211, .35); }
.range .target i { position: absolute; left: -26px; top: 28px; width: 52px; height: 64px; }
.range .t-lamp { background: radial-gradient(circle at 50% 30%, #fff3c2 0 12%, #ffb648 22%, rgba(255, 120, 40, .55) 40%, transparent 62%); border-radius: 50%; animation: flicker .18s infinite alternate; }
.range .t-lamp::after { content: ""; position: absolute; left: 16px; bottom: 2px; width: 20px; height: 13px; border-radius: 0 0 8px 8px; background: #b5793a; }
.range .t-fruit { background: radial-gradient(circle at 40% 35%, #ffe08a, #f0a030 45%, #c86a1c 75%); border-radius: 50% 50% 46% 54%; height: 52px !important; }
@keyframes flicker { from { opacity: .82; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
.range .arrow { position: absolute; left: 50%; bottom: 0; width: 4px; height: 46px; margin-left: -1.5px; background: #e9d2a6; opacity: 0; }
.range.hit .arrow, .range.miss .arrow { animation: loose .35s ease-out forwards; }
@keyframes loose { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-200px); } }
.range.hit { box-shadow: inset 0 0 0 3px var(--positive); }
.range.miss { box-shadow: inset 0 0 0 3px var(--negative); }

/* Push: a ring closes on the mark; a balance bar shows who is winning. */
.pushpit { display: grid; gap: 12px; }
.balance { position: relative; height: 14px; border-radius: 5px; background: linear-gradient(90deg, var(--negative), var(--track) 50%, var(--positive)); }
.balance i { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--ink); transition: left .3s; left: 50%; }
.ringbox { position: relative; height: clamp(240px, 38vw, 320px); border-radius: var(--r-control); background: radial-gradient(circle, #4a2a20, #2a1612); overflow: hidden; }
.ringbox .mark, .ringbox .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.ringbox .mark { width: 84px; height: 84px; background: rgba(240, 148, 63, .25); border: 3px solid var(--accent); }
.ringbox .ring { width: 270px; height: 270px; border: 5px solid var(--ink); }
.ringbox .who { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 16px; color: var(--muted); }
.pushpit.good .ringbox { box-shadow: inset 0 0 0 3px var(--positive); }
.pushpit.bad .ringbox { box-shadow: inset 0 0 0 3px var(--negative); }

/* Steady: keep your hand over the horse's mood. */
.steady { position: relative; height: 130px; border-radius: var(--r-control); background: linear-gradient(90deg, #2c1a14, #3e241b, #2c1a14); }
.steady .mood { position: absolute; top: 8px; bottom: 8px; border-radius: 8px; background: rgba(240, 148, 63, .22); border: 2px solid rgba(240, 148, 63, .5); transition: background .2s; }
.steady .mood.on { background: rgba(127, 207, 166, .35); border-color: var(--positive); }
.steady .hand { position: absolute; top: 6px; bottom: 6px; width: 8px; margin-left: -4px; border-radius: 3px; background: var(--ink); box-shadow: 0 0 8px rgba(247, 234, 211, .6); }
/* (calmbar, not "calm": the html element carries "calm" under Calm motion, and ".calm i" caught every <i> on the
   page then: no width, no picture size; found 7 November) */
.calmbar { height: 14px; border-radius: 5px; background: var(--track); overflow: hidden; }
.calmbar i { display: block; height: 100%; width: 0; background: var(--positive); }

/* Retort: the taunt, a burning lamp, three replies. */
.taunt { margin: 0; padding: 12px 16px; border-left: 3px solid var(--accent); font-family: var(--display); font-size: 25px; line-height: 1.35; }
/* The clock of a timed test (U.countdown, ui/trials.js): the seconds left, large, beside a bar that
   drains; at the top of the stage, above the play. Red in the last seconds; the number beats only
   with motion on. Shown only while the test plays. */
.t-clock { display: flex; align-items: center; gap: 10px; justify-self: center; align-self: center; width: min(100%, 440px); padding: 4px 14px 4px 12px; border-radius: 999px;
  background: rgba(var(--surface-rgb), 0.82); border: 1px solid var(--gold-line); color: var(--ink); }
.t-clock[hidden], .trial:not(.playing) .t-clock { display: none; }
.t-clock .t-secs { min-width: 2ch; font-family: var(--text); font-size: 32px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.t-clock .t-unit { margin-left: -6px; font-size: 13px; color: var(--muted); align-self: flex-end; padding-bottom: 4px; }
.t-clock .t-bar { flex: 1 1 auto; height: 12px; border-radius: 6px; background: var(--track); overflow: hidden; }
.t-clock .t-bar i { display: block; height: 100%; width: 100%; transform-origin: left center; background: var(--data); }
.t-clock.warn { border-color: var(--negative); }
.t-clock.warn .t-secs { color: var(--negative); }
.t-clock.warn .t-bar i { background: var(--negative); }
:where(html:not(.calm)) .t-clock.warn .t-secs { animation: t-beat 1s ease-in-out infinite; }
@keyframes t-beat { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.14); } }
.replies { display: grid !important; gap: 8px; }
.replies button { text-align: left; white-space: normal; }
html.calm .range .t-lamp { animation: none; }
.replies button { background: var(--surface); border: 1px solid var(--gold-line); color: var(--ink); padding: 12px 14px; border-radius: var(--r-control); font-weight: 500; }
.replies button:hover:not(:disabled) { background: var(--hover); border-color: var(--accent); }
.trial .replies { justify-content: stretch; justify-items: stretch; } .trial .replies button { width: 100%; }

/* More targets for the aim test. */
.range .t-bird { background: radial-gradient(circle at 70% 38%, #1a120c 0 5%, transparent 6%), radial-gradient(ellipse at 50% 55%, #b98a52 0 46%, transparent 48%), linear-gradient(160deg, transparent 58%, #8a6236 58% 70%, transparent 70%); height: 40px !important; }
.range .t-bell { background: radial-gradient(circle at 50% 92%, #6b4a1c 0 9%, transparent 10%), radial-gradient(ellipse at 50% 70%, #e2b55a 0 52%, transparent 54%); }
.range .t-leaf { background: radial-gradient(ellipse 34% 48% at 50% 50%, #7fae5a 0 96%, transparent 100%); transform: rotate(18deg); }
.range .t-calf { background: radial-gradient(circle at 78% 30%, #5a3a22 0 14%, transparent 15%), radial-gradient(ellipse 46% 30% at 46% 52%, #c99a68 0 96%, transparent 100%), linear-gradient(90deg, transparent 22%, #8a6236 22% 28%, transparent 28% 64%, #8a6236 64% 70%, transparent 70%) 0 100% / 100% 36% no-repeat; }
.range.field { background: linear-gradient(#5a6b3a, #3a4a24); }

/* Draw: the bow bends as you hold; let go in the bright band. */
.drawpit { display: grid; gap: 12px; padding: 12px; border-radius: var(--r-control); background: radial-gradient(ellipse at 40% 50%, #4a2a20, #2a1612); }
.drawpit .bow { width: min(100%, 380px); height: auto; justify-self: center; }
.drawpit .limb { fill: none; stroke: #c99a5b; stroke-width: 9; stroke-linecap: round; }
.drawpit .string { fill: none; stroke: #f2e3c4; stroke-width: 2; }
.drawpit .meter { position: relative; height: 26px; border-radius: 13px; background: var(--track); overflow: hidden; }
.drawpit .band { position: absolute; top: 0; bottom: 0; background: rgba(127, 207, 166, .45); border-left: 2px solid var(--positive); border-right: 2px solid var(--positive); }
.drawpit .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #8a6236, var(--accent)); opacity: .85; }
.drawpit .fill.in { background: linear-gradient(90deg, #8a6236, var(--positive)); }
.drawpit.good { box-shadow: inset 0 0 0 3px var(--positive); }
.drawpit.bad { box-shadow: inset 0 0 0 3px var(--negative); }

/* Sneak: a dark wall, a guard's torch, you. */
.sneakway { position: relative; height: clamp(170px, 26vw, 220px); border-radius: var(--r-control); overflow: hidden; background: linear-gradient(#120d0b, #241812 70%, #3a2a1c); }
.sneakway .beam { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; mix-blend-mode: screen; filter: blur(3px); }
.sneakway .beam .pool { fill: rgba(255, 214, 140, 0.55); }
.sneakway.caught .beam polygon { fill: rgba(255, 150, 110, 0.7); }
/* The guard on the far side, with his torch. Without the painting he is a dark shape on the back wall. */
.sneakway .guard { position: absolute; bottom: 46%; width: 0; height: 0; z-index: 1; transition: left 0.05s linear; }
.sneakway .guard::before { content: ""; position: absolute; left: -9px; bottom: 0; width: 18px; height: 44px; border-radius: 9px 9px 3px 3px; background: #0a0806; box-shadow: 0 0 0 2px rgba(255, 196, 110, .25); }
/* On the painting the guard is a puppet; under him, his shadow on the ground. His torch carries its own flame. */
.sneakway.painted .guard::before { left: calc(clamp(80px, 14vh, 130px) * -0.17); bottom: -3px; width: calc(clamp(80px, 14vh, 130px) * 0.34); height: 8px; border-radius: 50%; background: radial-gradient(closest-side, rgba(4, 2, 6, 0.75), rgba(4, 2, 6, 0)); box-shadow: none; z-index: -1; }
.sneakway.painted:not(.daylight) .guard .flame { display: none; }
.sneakway .guard .flame { position: absolute; left: 10px; bottom: 34px; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: radial-gradient(circle, #fff3c4, #ffb347 45%, rgba(255, 140, 50, 0) 72%); box-shadow: 0 0 18px 6px rgba(255, 170, 80, 0.55); animation: flick 0.35s ease-in-out infinite alternate; } /* taste-skill-ignore: a torch flame */
.sneakway .guard.left .flame { left: -10px; }
/* Daylight (a game of tag): no torch; the cone is only where the watcher is looking. */
.sneakway.daylight .guard .flame { opacity: 0; box-shadow: none; animation: none; }
.sneakway.daylight .beam { opacity: 0.45; mix-blend-mode: screen; }
.sneakway .guard.tell .flame { bottom: 52px; }
@keyframes flick { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.12); opacity: 1; } }
.sneakway .goal { position: absolute; right: 0; top: 0; bottom: 0; width: 6%; background: linear-gradient(90deg, transparent, rgba(127, 207, 166, .35)); }
.sneakway .me { position: absolute; bottom: 18px; width: 26px; height: 58px; margin-left: -13px; border-radius: 13px 13px 4px 4px; background: #0a0806; box-shadow: 0 0 0 2px rgba(247, 234, 211, .35); }
.sneakway .me.lit { box-shadow: 0 0 0 3px var(--negative), 0 0 18px rgba(255, 138, 110, .7); }
.sus { height: 12px; border-radius: 6px; background: var(--track); overflow: hidden; }
.sus i { display: block; height: 100%; width: 0; background: var(--negative); }

/* Notice: what was on the table. */
.table { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.table li { padding: 14px 12px; border: 1px solid var(--gold-line); border-radius: var(--r-control); background: var(--surface); font-size: 17px; text-align: center; }
.range.field .target::before { display: none; } .range.field .target { top: 60%; }

/* ---------- The shadow puppet ----------
   Joints turn about fixed points in the figure's own coordinates; a pose is a set of angles. */
.pp { overflow: visible; filter: drop-shadow(0 0 6px rgba(255, 196, 110, 0.35)) drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.45)); } /* taste-skill-ignore: a lamp behind the puppet's screen */
.pp .j, .pp .pp-body { transform-box: view-box; transition: transform 0.5s cubic-bezier(.3, .7, .3, 1); }
.pp .pp-body { transform-origin: 60px 116px; }
.pp .legB, .pp .legF { transform-origin: 60px 117px; }
.pp .shinB, .pp .shinF { transform-origin: 60px 152px; }
.pp .armB, .pp .armF { transform-origin: 58px 73px; }
.pp .foreB, .pp .foreF { transform-origin: 58px 98px; }
.pp .head { transform-origin: 60px 65px; }
.pp.flip { transform: scaleX(-1); }
/* A weapon rests up along a hanging arm; with the arm raised or reaching it carries on past the fist. */
.pp .it-w { transform-box: view-box; transform-origin: 58px 126px; transition: transform 0.3s ease; }
.pp:not(.pose-stand):not(.pose-walk):not(.pose-slump):not(.pose-tremble):not(.pose-side):not(.pose-dead):not(.pose-fall) .it-w,
.pp.pose-stand.t-thoughtful .it-w, .pp.pose-stand.t-devoted .it-w, .pp.pose-stand.chained .it-w, .pp.sling:not(.fighting) .it-w { transform: rotate(180deg); }
.pp.dead { filter: grayscale(0.85) brightness(0.8) drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.45)); }
/* Standing, breathing; bearing from temperament and age. */
.pose-stand .armF { transform: rotate(8deg); } .pose-stand .foreF { transform: rotate(-16deg); } .pose-stand .armB { transform: rotate(-6deg); }
.pose-stand .pp-body { animation: pp-breathe 3.6s ease-in-out infinite; }
@keyframes pp-breathe { 50% { transform: translateY(-1.2px); } }
.pose-stand.st-elder .pp-body { transform: rotate(7deg); animation: none; }
.pose-stand.t-bold .legF { transform: rotate(-9deg); } .pose-stand.t-bold .legB { transform: rotate(9deg); } .pose-stand.t-bold .head { transform: rotate(-4deg); }
.pose-stand.t-thoughtful .head { transform: rotate(10deg); } .pose-stand.t-thoughtful .armF { transform: rotate(-26deg); } .pose-stand.t-thoughtful .foreF { transform: rotate(-120deg); }
.pose-stand.t-devoted .armF { transform: rotate(-36deg); } .pose-stand.t-devoted .foreF { transform: rotate(-84deg); }
.pose-stand.t-cunning .pp-body { transform: rotate(6deg) translateY(2px); animation: none; }
.pose-stand.limp .legB { transform: rotate(10deg); } .pose-stand.limp .shinB { transform: rotate(14deg); }
.pose-stand.chained .armF, .pose-stand.chained .armB { transform: rotate(-28deg); } .pose-stand.chained .foreF, .pose-stand.chained .foreB { transform: rotate(-44deg); }
/* How each kind of figure stands at rest (spec.stance, puppet.js; the same shapes as the live poses in
   puppet-anim.js): a bandit stooped over his club, a guard square behind his spear, a horseman with his
   sword raised, a champion holding his mace out, the great ones each in their own bearing. */
.pp.pose-stand.sx .pp-body, .pp.pose-stand.sx .foreB, .pp.pose-stand.sx .shinB { animation: none; }
.pp.pose-stand.sx-stoop .pp-body { transform: translateY(4px) rotate(12deg); } .pp.pose-stand.sx-stoop .head { transform: rotate(-14deg); } .pp.pose-stand.sx-stoop .armF { transform: rotate(-30deg); } .pp.pose-stand.sx-stoop .foreF { transform: rotate(-62deg); } .pp.pose-stand.sx-stoop .armB { transform: rotate(10deg); } .pp.pose-stand.sx-stoop .foreB { transform: rotate(-30deg); } .pp.pose-stand.sx-stoop .legF { transform: rotate(-12deg); } .pp.pose-stand.sx-stoop .shinF { transform: rotate(10deg); } .pp.pose-stand.sx-stoop .legB { transform: rotate(10deg); } .pp.pose-stand.sx-stoop .shinB { transform: rotate(10deg); } .pp.pose-stand.sx-stoop .it-w { transform: rotate(180deg); }
.pp.pose-stand.sx-square .pp-body { transform: rotate(-2deg); } .pp.pose-stand.sx-square .armF { transform: rotate(-4deg); } .pp.pose-stand.sx-square .foreF { transform: rotate(-22deg); } .pp.pose-stand.sx-square .armB { transform: rotate(-44deg); } .pp.pose-stand.sx-square .foreB { transform: rotate(-50deg); } .pp.pose-stand.sx-square .legF { transform: rotate(-12deg); } .pp.pose-stand.sx-square .legB { transform: rotate(12deg); }
.pp.pose-stand.sx-archer .pp-body { transform: rotate(-2deg); } .pp.pose-stand.sx-archer .armF { transform: rotate(-14deg); } .pp.pose-stand.sx-archer .foreF { transform: rotate(-10deg); } .pp.pose-stand.sx-archer .armB { transform: rotate(-8deg); } .pp.pose-stand.sx-archer .foreB { transform: rotate(-24deg); } .pp.pose-stand.sx-archer .legF { transform: rotate(-10deg); } .pp.pose-stand.sx-archer .legB { transform: rotate(10deg); }
.pp.pose-stand.sx-raised .pp-body { transform: rotate(-4deg); } .pp.pose-stand.sx-raised .armF { transform: rotate(-150deg); } .pp.pose-stand.sx-raised .foreF { transform: rotate(-20deg); } .pp.pose-stand.sx-raised .armB { transform: rotate(-40deg); } .pp.pose-stand.sx-raised .foreB { transform: rotate(-56deg); } .pp.pose-stand.sx-raised .legF { transform: rotate(-16deg); } .pp.pose-stand.sx-raised .shinF { transform: rotate(4deg); } .pp.pose-stand.sx-raised .legB { transform: rotate(16deg); } .pp.pose-stand.sx-raised .shinB { transform: rotate(8deg); } .pp.pose-stand.sx-raised .it-w { transform: rotate(180deg); }
.pp.pose-stand.sx-proud .pp-body { transform: rotate(-4deg); } .pp.pose-stand.sx-proud .head { transform: rotate(-6deg); } .pp.pose-stand.sx-proud .armF { transform: rotate(-62deg); } .pp.pose-stand.sx-proud .foreF { transform: rotate(-48deg); } .pp.pose-stand.sx-proud .armB { transform: rotate(-10deg); } .pp.pose-stand.sx-proud .foreB { transform: rotate(-30deg); } .pp.pose-stand.sx-proud .legF { transform: rotate(-14deg); } .pp.pose-stand.sx-proud .legB { transform: rotate(14deg); }
.pp.pose-stand.sx-hero .pp-body { transform: rotate(-3deg); } .pp.pose-stand.sx-hero .head { transform: rotate(-4deg); } .pp.pose-stand.sx-hero .armF { transform: rotate(-16deg); } .pp.pose-stand.sx-hero .foreF { transform: rotate(-14deg); } .pp.pose-stand.sx-hero .armB { transform: rotate(-10deg); } .pp.pose-stand.sx-hero .foreB { transform: rotate(-28deg); } .pp.pose-stand.sx-hero .legF { transform: rotate(-14deg); } .pp.pose-stand.sx-hero .legB { transform: rotate(14deg); }
.pp.pose-stand.sx-haughty .pp-body { transform: rotate(-7deg); } .pp.pose-stand.sx-haughty .head { transform: rotate(-12deg); } .pp.pose-stand.sx-haughty .armF { transform: rotate(-58deg); } .pp.pose-stand.sx-haughty .foreF { transform: rotate(-46deg); } .pp.pose-stand.sx-haughty .armB { transform: rotate(-60deg); } .pp.pose-stand.sx-haughty .foreB { transform: rotate(-120deg); } .pp.pose-stand.sx-haughty .legF { transform: rotate(-18deg); } .pp.pose-stand.sx-haughty .legB { transform: rotate(16deg); }
.pp.pose-stand.sx-broad .pp-body { transform: rotate(-2deg); } .pp.pose-stand.sx-broad .head { transform: rotate(-4deg); } .pp.pose-stand.sx-broad .armF { transform: rotate(-6deg); } .pp.pose-stand.sx-broad .foreF { transform: rotate(-4deg); } .pp.pose-stand.sx-broad .armB { transform: rotate(-36deg); } .pp.pose-stand.sx-broad .foreB { transform: rotate(-40deg); } .pp.pose-stand.sx-broad .legF { transform: rotate(-22deg); } .pp.pose-stand.sx-broad .legB { transform: rotate(22deg); } .pp.pose-stand.sx-broad .shinB { transform: rotate(4deg); } .pp.pose-stand.sx-broad .it-w { transform: rotate(180deg); }
.pp.pose-stand.sx-sage .pp-body { transform: rotate(3deg); } .pp.pose-stand.sx-sage .head { transform: rotate(4deg); } .pp.pose-stand.sx-sage .armF { transform: rotate(-14deg); } .pp.pose-stand.sx-sage .foreF { transform: rotate(-12deg); } .pp.pose-stand.sx-sage .armB { transform: rotate(-8deg); } .pp.pose-stand.sx-sage .foreB { transform: rotate(-30deg); } .pp.pose-stand.sx-sage .legF { transform: rotate(-8deg); } .pp.pose-stand.sx-sage .legB { transform: rotate(8deg); }
/* An arm in a sling, bound; in a fight (.fighting: ui/puppet-anim.js U.rig) it comes out of the sling to strike. */
.sling:not(.fighting) .armF { transform: rotate(-24deg) !important; animation: none !important; } .sling:not(.fighting) .foreF { transform: rotate(-96deg) !important; animation: none !important; }
/* Walking: legs and arms swing against each other. */
.pose-walk .legF { animation: pp-legF 0.7s ease-in-out infinite alternate; } .pose-walk .legB { animation: pp-legB 0.7s ease-in-out infinite alternate; }
.pose-walk .shinB { animation: pp-shin 0.7s ease-in-out infinite alternate; }
.pose-walk .armF { animation: pp-legB 0.7s ease-in-out infinite alternate; } .pose-walk .armB { animation: pp-legF 0.7s ease-in-out infinite alternate; }
.pose-walk .pp-body { animation: pp-bob 0.35s ease-in-out infinite alternate; }
@keyframes pp-legF { from { transform: rotate(-24deg); } to { transform: rotate(18deg); } }
@keyframes pp-legB { from { transform: rotate(18deg); } to { transform: rotate(-24deg); } }
@keyframes pp-shin { from { transform: rotate(0deg); } to { transform: rotate(28deg); } }
@keyframes pp-bob { to { transform: translateY(-2px); } }
/* Actions. */
.pose-aim .armF { transform: rotate(-84deg); } .pose-aim .foreF { transform: rotate(-6deg); } .pose-aim .armB { transform: rotate(-86deg); } .pose-aim .foreB { transform: rotate(150deg); } .pose-aim .pp-body { transform: rotate(-2deg); }
.pose-loose .armF { transform: rotate(-84deg); } .pose-loose .foreF { transform: rotate(-6deg); } .pose-loose .armB { transform: rotate(-60deg); } .pose-loose .foreB { transform: rotate(-10deg); }
.pose-throw .armF { animation: pp-throw 0.45s ease-out forwards; }
@keyframes pp-throw { from { transform: rotate(-160deg); } to { transform: rotate(-50deg); } }
.pose-push .pp-body { transform: rotate(14deg); } .pose-push .armF { transform: rotate(-72deg); } .pose-push .foreF { transform: rotate(-18deg); } .pose-push .armB { transform: rotate(-66deg); } .pose-push .foreB { transform: rotate(-22deg); }
.pose-push .legF { transform: rotate(-26deg); } .pose-push .shinF { transform: rotate(18deg); } .pose-push .legB { transform: rotate(20deg); } .pose-push .shinB { transform: rotate(6deg); }
.pose-brace .pp-body { transform: rotate(-8deg); } .pose-brace .armF { transform: rotate(-96deg); } .pose-brace .foreF { transform: rotate(-60deg); } .pose-brace .legF { transform: rotate(-16deg); } .pose-brace .legB { transform: rotate(16deg); }
.pose-strike .armF { animation: pp-strike 0.5s cubic-bezier(.6, 0, .4, 1) forwards; } .pose-strike .pp-body { transform: rotate(8deg); }
@keyframes pp-strike { 0% { transform: rotate(-170deg); } 100% { transform: rotate(-40deg); } }
.pose-block .armF { transform: rotate(-112deg); } .pose-block .foreF { transform: rotate(-70deg); } .pose-block .pp-body { transform: rotate(-6deg); }
.pose-hold .pp-body { transform: rotate(6deg); } .pose-hold .armF { transform: rotate(-66deg); } .pose-hold .foreF { transform: rotate(-24deg); } .pose-hold .armB { transform: rotate(-58deg); } .pose-hold .foreB { transform: rotate(-30deg); }
.pose-sneak .pp-body { transform: translateY(12px) rotate(6deg); } .pose-sneak .legF { transform: rotate(-48deg); } .pose-sneak .shinF { transform: rotate(58deg); } .pose-sneak .legB { transform: rotate(28deg); } .pose-sneak .shinB { transform: rotate(50deg); } .pose-sneak .armF { transform: rotate(-40deg); } .pose-sneak .foreF { transform: rotate(-40deg); }
.pose-think .armF { transform: rotate(-28deg); } .pose-think .foreF { transform: rotate(-140deg); } .pose-think .head { transform: rotate(10deg); }
.pose-speak .armF { transform: rotate(-58deg); } .pose-speak .foreF { transform: rotate(-30deg); } .pose-speak .head { transform: rotate(-4deg); }
/* Reactions. */
.pose-cheer .armF { transform: rotate(-166deg); } .pose-cheer .foreF { transform: rotate(-10deg); } .pose-cheer .armB { transform: rotate(-150deg); } .pose-cheer .pp-body { transform: rotate(-4deg); animation: pp-hop 0.5s ease 2; }
@keyframes pp-hop { 50% { transform: translateY(-7px) rotate(-4deg); } }
.pose-slump .pp-body { transform: rotate(11deg) translateY(3px); } .pose-slump .head { transform: rotate(26deg); } .pose-slump .armF { transform: rotate(4deg); } .pose-slump .armB { transform: rotate(2deg); }
.pose-kneel .pp-body { transform: translateY(26px); } .pose-kneel .legF { transform: rotate(-84deg); } .pose-kneel .shinF { transform: rotate(96deg); } .pose-kneel .legB { transform: rotate(8deg); } .pose-kneel .shinB { transform: rotate(98deg); }
.pose-kneel .armF { transform: rotate(-36deg); } .pose-kneel .foreF { transform: rotate(-84deg); } .pose-kneel .head { transform: rotate(14deg); }
/* Sitting on the floor to eat: back on the heels, the front knee up, the back leg tucked under. */
.pose-sit .pp-body { transform: translateY(36px); } .pose-sit .legF { transform: rotate(-88deg); } .pose-sit .shinF { transform: rotate(110deg); } .pose-sit .legB { transform: rotate(-70deg); } .pose-sit .shinB { transform: rotate(160deg); }
.pose-sit .armF { transform: rotate(-36deg); } .pose-sit .foreF { transform: rotate(-84deg); } .pose-sit .head { transform: rotate(10deg); }
.pose-hit .pp-body { animation: pp-hit 0.4s ease; }
@keyframes pp-hit { 30% { transform: translateX(-6px) rotate(-8deg); } 60% { transform: translateX(3px) rotate(3deg); } }
.pose-dead .pp-body { transform-origin: 60px 190px; transform: rotate(-86deg) translateX(-8px); }
.pose-fall .pp-body { transform-origin: 60px 190px; animation: pp-fall 0.8s ease-in forwards; }
@keyframes pp-fall { to { transform: rotate(-86deg) translateX(-8px); } }
/* In a fight the fallen fall forward, toward the middle of the stage, so no one lies past its edge. */
.arena .pose-dead .pp-body { transform: rotate(86deg) translateX(-8px); } /* (turned, the shift lifts it: it lies on the ground, not in it) */
.arena .pose-fall .pp-body { animation-name: pp-fall-fwd; }
@keyframes pp-fall-fwd { to { transform: rotate(86deg) translateX(-8px); } }
/* The figure: in the page header beside the title, and in cards. */
.ppbadge { display: inline-flex; align-items: flex-end; justify-content: center; flex: none; pointer-events: none; }
.pp .rod { opacity: 0.4; }
.pp:not(.pose-stand):not(.pose-walk) .rod { display: none; }
.sheet-figure { display: flex; justify-content: center; padding: 4px 0 0; }
.sheet-figure svg { height: 180px; width: auto; }
.lifecard summary .lifefig { margin-right: -6px; }
.pagehead { position: relative; display: flex; align-items: flex-end; gap: 12px; padding: 14px 18px 8px 26px; }
.pagehead .ph-text { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.pagehead .ph-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.pagehead h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3vw, 34px); line-height: 1.08; margin: 2px 0 0; text-wrap: balance; }
.pagehead .ppbadge { margin-bottom: -6px; }
.pagehead .ppbadge svg { height: 104px; width: auto; }
.pagehead.big .ppbadge svg { height: 150px; }
.pagehead .ppbadge svg.pose-dead { height: 62px; } .pagehead.big .ppbadge svg.pose-dead { height: 80px; }
html[lang="hi"] .pagehead h1 { line-height: 1.3; }
@media (max-width: 720px), (max-height: 520px) { .pagehead { padding: 8px 12px 4px 16px; } .pagehead h1 { font-size: 20px; } .pagehead .ppbadge svg { height: 64px; } .pagehead.big .ppbadge svg { height: 96px; } }
/* The road you have walked, stronger than the map's own lines. */
.bmap .m-road { stroke: #b3341a; stroke-width: 2.8; stroke-dasharray: 7 4; opacity: .95; }
.bmap .m-road.new { stroke: #c8471f; }
.bmap .m-steps ellipse { fill: #4a2412; opacity: .8; }
.bmap .m-emb, .emb .m-emb { fill: #6b3a1c; stroke: none; }
.bmap .m-emb .e-line, .emb .m-emb .e-line { fill: none; stroke: #6b3a1c; stroke-width: 1.8; stroke-linecap: round; vector-effect: none; }
.bmap .m-emb .e-eye, .bmap .m-emb .e-in, .emb .m-emb .e-eye, .emb .m-emb .e-in { fill: #ecdcb6; }
.bmap .m-place.been .m-emb { fill: #a8321a; }
.bmap .m-walker .pp { overflow: visible; }
/* The journey page: map, then From X → Y and why. */
.leaf.journeying .text { display: grid; gap: 10px; padding-bottom: 16px; }
.jmap .bmap { max-height: min(56svh, 520px); width: 100%; }
body.inscene .jmap .bmap { max-height: min(520px, max(180px, calc(var(--vh) - 340px))); }
.j-route { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--display); font-size: 21px; font-weight: 700; }
.j-route .emb, .emb { width: 1.1em; height: 1.1em; flex: none; }
.j-arrow { color: var(--gold); padding: 0 4px; }
.j-why { margin: 0; color: var(--muted); font-style: italic; }
.leaf.journeying .btnrow { margin-top: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Choosing a homeland on the map. */
.bmap.homes .m-home { cursor: pointer; outline: none; }
.bmap.homes .m-home .hit { fill: transparent; stroke: none; }
.bmap.homes .m-home circle:not(.hit) { fill: #ecdcb6; stroke: #5a3a22; stroke-width: 1.6; vector-effect: non-scaling-stroke; transition: fill .2s; }
.bmap.homes .m-home text { font-weight: 700; transition: fill .2s; }
.bmap.homes .m-home:hover circle:not(.hit), .bmap.homes .m-home:focus-visible circle:not(.hit), .bmap.homes .m-home.on circle:not(.hit) { fill: #c8471f; }
.bmap.homes .m-home:hover text, .bmap.homes .m-home:focus-visible text { fill: #a8321a; }
.bmap.homes .m-home:focus-visible .hit { stroke: #c8471f; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; }
.homes-wrap { display: grid; gap: 10px; margin-top: 8px; }
.homes-wrap .ghost { justify-self: start; }
.homes-wrap .bmap { height: min(60svh, 560px); width: auto; max-width: 100%; margin: 0 auto; }
/* Phones upright see the map too, full width, with the lands listed as pictures under it. */
@media (max-width: 720px) { .homes-wrap .bmap { height: auto; width: 100%; } .homes-wrap #as-list { display: none; } }
@media (min-width: 721px) { .lands.under-map { display: none; } .lands.under-map.shown { display: grid; } }

/* ---------- Test stages: a strip of the painting with the figures on it ---------- */
.trial-body { display: grid; gap: 16px; min-width: 0; }
.cast { position: relative; height: 158px; margin: -20px -20px 0; border-radius: var(--r-card) var(--r-card) 0 0; overflow: hidden;
  background: #1a0f0b var(--stage) center 74% / cover no-repeat; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 9% 2px; }
.cast::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 90% at 50% 100%, rgba(255, 196, 120, .22), transparent 70%), linear-gradient(transparent 55%, rgba(var(--surface-rgb), .55)); pointer-events: none; }
.cast.side { background-position: 35% 60%; }
.cast.top { background-position: center; background-size: cover; }
.cast .actor { position: relative; z-index: 1; display: flex; gap: 0; align-items: flex-end; }
.cast .actor svg { height: 138px; width: auto; overflow: visible; filter: drop-shadow(0 0 6px rgba(255, 200, 120, .35)) drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); }
.cast .actor.foe ~ .actor.foe { margin-left: -28px; }
.cast .actor.foe.f1 svg, .cast .actor.foe.f2 svg { height: 124px; }
.dicegame.hands.trial { padding: 20px; }
@media (max-width: 720px) { .cast { height: 112px; padding: 0 6% 2px; } .cast .actor svg { height: 100px; } .cast .actor.foe.f1 svg, .cast .actor.foe.f2 svg { height: 90px; } }

/* Drill */
.drill { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.drill .tile { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; min-height: 120px; border-radius: var(--r-control); border: 1px solid var(--gold-line);
  background: radial-gradient(ellipse at 50% 40%, #5a3426, #3a1f17); color: var(--ink); cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s; }
.drill .tile:disabled { cursor: default; }
.drill .tile .n { position: absolute; left: 7px; top: 4px; font-size: 13px; color: var(--faint); }
.drill .tile .nm { font-size: 13px; line-height: 1.2; color: var(--muted); text-align: center; }
.drill .tile .sign { width: 64px; height: 64px; fill: #e9c58d; stroke: #3a1f12; stroke-width: 2.5; stroke-linejoin: round; }
.drill .tile .sign .ln { fill: none; stroke: #3a1f12; stroke-width: 2.5; }
.drill .tile .sign .ln.w { stroke: #e9c58d; stroke-width: 6; stroke-linecap: round; }
.drill .tile .sign .fl { fill: #ffb648; }
.drill.verse .tile { min-height: 96px; align-content: center; }
.drill .verse { font-family: var(--display); font-size: 20px; line-height: 1.25; text-align: center; padding: 6px 4px; }
.drill .tile.lit { background: radial-gradient(ellipse at 50% 40%, #f5c66b, #b86a22); box-shadow: 0 0 0 3px var(--data), 0 0 26px rgba(255, 190, 90, .55); transform: scale(1.04); color: #2a120f; }
.drill .tile.lit .nm, .drill .tile.lit .n { color: #2a120f; }
.drill .tile.ok { box-shadow: 0 0 0 3px var(--positive); }
.drill .tile.bad { box-shadow: 0 0 0 3px var(--negative); }
@media (max-width: 560px) { .drill { grid-template-columns: repeat(2, minmax(0, 1fr)); } .drill .tile { min-height: 104px; } }

/* Rhythm */
.beatlane { position: relative; height: 96px; border-radius: var(--r-control); overflow: hidden; background: linear-gradient(90deg, rgba(240, 148, 63, .12), transparent 30%), repeating-linear-gradient(90deg, #2c1914 0 38px, #331d17 38px 76px); }
.beatlane .mark { position: absolute; left: 14%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; border: 3px solid var(--data); box-shadow: 0 0 14px rgba(226, 181, 90, .45); }
.beatlane .beat { position: absolute; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe3a8, #e08a30 60%, #8a4a18); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.beatlane .beat.off { width: 28px; height: 28px; margin: -14px 0 0 -14px; background: radial-gradient(circle at 40% 35%, #f6e7c8, #c9a679 60%, #6b4a2a); }
.beatlane .beat.hit { animation: beat-hit .3s ease-out forwards; }
.beatlane .beat.miss { background: #7a2f22; opacity: .5 !important; }
@keyframes beat-hit { to { transform: scale(1.8); opacity: 0; } }
.beatlane.good .mark { animation: mark-good .25s ease-out; } .beatlane.bad .mark { animation: mark-bad .25s ease-out; }
@keyframes mark-good { 50% { border-color: var(--positive); transform: scale(1.18); } }
@keyframes mark-bad { 50% { border-color: var(--negative); transform: scale(.9); } }

/* Race */
.track { position: relative; height: 222px; border-radius: var(--r-control); overflow: hidden; background: #2a1d14; }
.track .bgstrip { position: absolute; top: 0; bottom: 0; left: 0; display: flex; will-change: transform; }
.track .bgstrip i { flex: none; height: 100%; background: center / cover no-repeat; }
.track .bgstrip i.flip { transform: scaleX(-1); }
.track::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(20, 10, 6, .45), rgba(20, 10, 6, .35) 40%, rgba(20, 10, 6, .55)); }
.track .lanes, .track .obs { position: absolute; inset: 0; z-index: 1; }
.track .lanes { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(3, 1fr); }
.track .lanes i { border-bottom: 2px dashed rgba(247, 234, 211, .38); }
.track .lanes i:last-child { border-bottom: 0; }
.track .me, .track .ob { position: absolute; transition: top .14s ease-out; }
.track .me { left: 9%; width: 120px; height: 74px; z-index: 2; }
.track .me .veh { width: 100%; height: 100%; overflow: visible; }
.track .ob { width: 64px; height: 44px; margin-left: -32px; }
.track .ob svg { width: 100%; height: 100%; }
.track .lane0 { top: calc(16.66% - 37px); } .track .lane1 { top: calc(50% - 37px); } .track .lane2 { top: calc(83.33% - 37px); }
.track .ob.lane0 { top: calc(16.66% - 18px); } .track .ob.lane1 { top: calc(50% - 18px); } .track .ob.lane2 { top: calc(83.33% - 18px); }
.track .ob.hit { opacity: .45; }
.track .wheel { transform-box: fill-box; transform-origin: center; animation: spin .5s linear infinite; }
.track.bump { animation: bump .35s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bump { 25% { transform: translateX(-6px); } 60% { transform: translateX(4px); } }
.progress { position: relative; height: 14px; border-radius: 7px; background: var(--track); }
.progress .pm, .progress .pr { position: absolute; top: -4px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; border: 2px solid #1a0f0b; }
.progress .pm { background: var(--accent); z-index: 1; } .progress .pr { background: #d8a536; opacity: .85; }
.race-btns .trial-press { min-width: 140px; }
/* The leather chariots, yours and a rival's (quality review 23): drawn from above facing up the
   course; on the course seen from the side they are turned to face along it. The race's clock moves
   them, so they have no transitions. */
.track .chariot.me, .track .chariot.rivalcar { position: absolute; z-index: 2; width: calc(var(--cw) * 1.72); height: var(--cw); margin-top: calc(var(--cw) / -2); transition: none; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .55)); }
.track .chariot.me { --cw: clamp(36px, calc(var(--H, 480px) * .19), 76px); left: 9%; }
.track .chariot.rivalcar { --cw: clamp(32px, calc(var(--H, 480px) * .172), 69px); }
.trial.immersive.trial-race .game-note:empty { visibility: hidden; }
.track .chariot .rc { position: absolute; left: 50%; top: 50%; width: var(--cw); height: calc(var(--cw) * 1.72); margin: calc(var(--cw) * -.86) 0 0 calc(var(--cw) / -2); transform: rotate(90deg); }
.track .chariot svg { display: block; width: 100%; height: 100%; overflow: visible; transform: scale(1.32); transform-origin: 50% 78%; }
/* His warning before he cuts across you: a pulsing "!" over his car. */
.track .rivalcar .warnmark { position: absolute; left: 50%; top: -30px; z-index: 5; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 18px/1 var(--text); color: var(--accent-ink); background: #ffd27a; box-shadow: 0 0 0 3px rgba(42, 18, 15, .7), 0 0 14px rgba(255, 210, 122, .9); opacity: 0; transition: opacity .1s; } /* taste-skill-ignore: the warning glows */
.track .rivalcar.warn .warnmark { opacity: 1; animation: warnpulse .35s ease-in-out infinite alternate; }
@keyframes warnpulse { to { transform: translateX(-50%) scale(1.2); } }
/* Dust from the wheels; sparks where wheels clash. */
.track .rdust { position: absolute; z-index: 1; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: radial-gradient(rgba(214, 178, 120, .75), rgba(214, 178, 120, 0)); pointer-events: none; }
.track .rspark { position: absolute; z-index: 4; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff1c2; box-shadow: 0 0 6px 2px rgba(255, 196, 110, .85); pointer-events: none; }
/* The whip: ×2 in the corner while it lasts; its button drains as it runs out and fills as it recharges. */
.track .speedx { position: absolute; right: 10px; top: 10px; z-index: 6; font: 700 13px/1 var(--text); letter-spacing: .08em; padding: 5px 9px; border-radius: 999px; background: #ffd27a; color: var(--accent-ink); }
.track .speedx[hidden] { display: none; }
.race-btns .whip { position: relative; overflow: hidden; isolation: isolate; background: var(--raised); color: var(--ink); border: 1px solid var(--gold-line); white-space: nowrap; }
.race-btns .whip:hover { background: var(--hover); }
.race-btns .whip::before { content: ""; position: absolute; inset: 0; z-index: -1; transform-origin: 0 50%; transform: scaleX(var(--c, 1)); background: var(--data); }
.race-btns .whip { text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.race-btns .whip.ready, .race-btns .whip.on { color: var(--accent-ink); text-shadow: none; }
.race-btns .whip.on::before { background: #ffd27a; }
.race-btns .whip[aria-disabled="true"] { cursor: default; }
.race-btns .whip kbd { display: none; }
@media (hover: hover) and (pointer: fine) { .race-btns .whip kbd { display: inline-block; margin-left: 8px; padding: 3px 6px; border: 1px solid currentColor; border-radius: 4px; font: 600 12px/1 var(--text); vertical-align: middle; opacity: .75; } }
@media (max-width: 560px) { .track { height: 186px; } .track .me { width: 96px; height: 60px; } .track .lane0 { top: calc(16.66% - 30px); } .track .lane1 { top: calc(50% - 30px); } .track .lane2 { top: calc(83.33% - 30px); } }

/* Herd */
.herdfield { border-radius: var(--r-control); overflow: hidden; background: #2a1d14 var(--stage) center / cover no-repeat; }
.herdfield canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; touch-action: none; }
.dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 52px); gap: 6px; justify-content: center; }
.dpad button { min-height: 0; padding: 0; font-size: 22px; touch-action: manipulation; }
.dpad [data-d="up"] { grid-column: 2; grid-row: 1; } .dpad [data-d="left"] { grid-column: 1; grid-row: 2; } .dpad [data-d="down"] { grid-column: 2; grid-row: 2; } .dpad [data-d="right"] { grid-column: 3; grid-row: 2; }

/* Rings */
/* The formation test: the field from above, the marks, your units, the enemy's probe. */
.formfield { display: grid; justify-items: center; padding: 6px; border-radius: var(--r-control); background: radial-gradient(circle, #5a3a22, #2a1a10); }
.formfield svg { width: min(100%, 360px); height: auto; touch-action: manipulation; overflow: visible; }
.formfield .enemy-line { stroke: #c0472f; stroke-width: 3; stroke-dasharray: 6 5; opacity: .8; }
.formfield .mark circle { fill: rgba(20, 10, 6, .45); stroke: #f3d9a4; stroke-width: 2; stroke-dasharray: 3 3; cursor: pointer; }
.formfield .mark text { font: 700 10px var(--sans); fill: #f3d9a4; paint-order: stroke; stroke: rgba(0, 0, 0, .7); stroke-width: 2.5px; pointer-events: none; }
.formfield .mark.full circle { stroke-dasharray: none; fill: rgba(60, 110, 70, .55); }
.formfield .mark.bad circle { fill: rgba(150, 50, 30, .55); }
.formfield .unit { color: #fff1cf; pointer-events: none; }
.formfield .unit.shown { color: #ffd680; filter: drop-shadow(0 0 4px rgba(255, 200, 100, .8)); }
.formfield .unit.bad { color: #ffb4a0; }
.formfield .probe path { fill: none; stroke: #ff6a4a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.formfield .probe.coming { animation: probe-in 1.2s linear both; }
.formfield .probe.held path { stroke: var(--positive); } .formfield .probe.broke path { stroke: #ff3b1f; }
@keyframes probe-in { from { transform: translateY(-30px); opacity: .3; } to { transform: translateY(14px); opacity: 1; } }
.form-btns { gap: 8px; }
.ringfield { display: grid; justify-items: center; padding: 6px; border-radius: var(--r-control); background: radial-gradient(circle, #4a2a1c, #241510); }
.ringfield svg { width: min(100%, 340px); height: auto; touch-action: manipulation; }
.ringfield .seg { fill: none; stroke: #b9874f; stroke-width: 15; stroke-linecap: butt; transition: stroke .15s; }
.ringfield .seg.sel { stroke: var(--accent); }
.ringfield.maze .seg { stroke: #4f7d3a; } .ringfield.maze .seg.sel { stroke: #9ccf6a; }
.ringfield .gapdot { fill: #f7ead3; opacity: .5; } .ringfield .gapdot.sel { opacity: 1; fill: var(--accent); }
.ringfield .hitring { fill: none; stroke: transparent; stroke-width: 26; cursor: pointer; pointer-events: stroke; }
.ringfield .core { fill: #6b2a1c; stroke: var(--data); stroke-width: 2; }
.ringfield .core.open { fill: var(--data); }
.ringfield.maze .core { fill: #2c4a22; }
/* The wheel dash (ui/play.js, U.games.dash): the Chakravyuha from above, seven turning rings of shields
   and chariots. Driving in, the view rides with you; keeping it shut, your ring is the bright outer one. */
.dashfield { position: relative; min-height: 260px; overflow: hidden; border-radius: var(--r-control); background: radial-gradient(circle, #5a3420, #2a170e); touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.dashfield svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trial.playing > .trial-body > .dashfield { flex: 1 1 0; min-height: 200px; }
.trial.immersive .dashfield { border-radius: 0; background: none; margin: 0 -12px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(transparent, #000 5%, #000 95%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(transparent, #000 5%, #000 95%, transparent); mask-composite: intersect; }
.dashfield .heart { fill: rgba(255, 210, 122, .16); stroke: #ffd27a; stroke-width: 1; stroke-dasharray: 2 2; }
.dashfield .band-u { fill: none; stroke: #24110a; opacity: .75; }
.dashfield .band { fill: none; stroke: #9b3a26; stroke-dasharray: 3.2 1.1; }
.dashfield .ring:is(.r1, .r3, .r5) .band { stroke: #b9874f; }
.dashfield .tok { fill: #3a2412; stroke: #e2b55a; stroke-width: .5; }
.dashfield .tokw { stroke: #1d0f08; stroke-width: 1.2; }
.dashfield .post { stroke: #24110a; stroke-width: 1.4; stroke-linecap: round; }
.dashfield .flag { fill: #e2b55a; stroke: #24110a; stroke-width: .4; }
.dashfield .glow { fill: none; stroke: #ffd27a; opacity: 0; transition: opacity .2s; }
.dashfield .ring.next .glow { opacity: .55; }
:where(html:not(.calm)) .dashfield .ring.next .glow { animation: dashglow .8s ease-in-out infinite alternate; }
@keyframes dashglow { from { opacity: .3; } to { opacity: .75; } }
.dashfield .ring.done { opacity: .45; }
.dashfield .ring.sealed .glow { opacity: 1; stroke: #5a1a10; stroke-dasharray: 3.2 1.1; animation: none; }
.dashfield .ring.deco { opacity: .6; }
.dashfield .ring.mine .band { stroke: #c9472c; }
.dashfield .ring.mine .tok { stroke: #ffd27a; }
.dashfield .ring.mine .glow { opacity: .9; stroke: #ff8a5c; stroke-dasharray: 3 2.4; }
.dashfield .car.abhi .banner path { fill: none; stroke: #24110a; stroke-width: .8; }
.dashfield .car.abhi .banner .bf { fill: #3b6fb0; stroke-width: .4; }
.dashfield .car.foe { transition: opacity .8s; }
.dashfield .car.foe.out { opacity: .55; }
.dashfield .dfx circle, .dashfield .dfx path { transform-box: fill-box; transform-origin: center; }
.dashfield .dfx.through circle { fill: none; stroke: #ffd27a; stroke-width: 1.6; animation: dashring .6s ease-out forwards; }
.dashfield .dfx.spark circle { fill: #ffe39a; }
.dashfield .dfx.spark path { stroke: #ffe9a8; stroke-width: 1.2; stroke-linecap: round; }
.dashfield .dfx.spark { animation: dashspark .5s ease-out forwards; }
@keyframes dashring { from { transform: scale(.5); opacity: 1; } to { transform: scale(2.8); opacity: 0; } }
@keyframes dashspark { from { opacity: 1; } to { opacity: 0; } }
.dashfield.bump { animation: dashbump .3s; }
@keyframes dashbump { 25% { transform: translate(-4px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, 1px); } }
.dashfield.fast { box-shadow: inset 0 0 48px rgba(255, 210, 122, .28); }
.trial.trial-dash .btnrow.dash-btns { flex-wrap: nowrap; gap: 10px; width: min(100%, 520px); align-self: center; }
.trial.trial-dash .btnrow.dash-btns > .trial-press { min-width: 0; flex: 1 1 0; padding-left: 6px; padding-right: 6px; }
.trial.trial-dash .btnrow.dash-btns > .trial-press.steer { font-size: 1.5em; line-height: 1; }
.trial.trial-dash .btnrow.dash-btns > .whip { flex: 1.5 1 0; }
.dashfield .hint { fill: #ffd27a; stroke: #24110a; stroke-width: .8; opacity: 0; transition: opacity .25s; }
.dashfield .hint.on { opacity: .9; }
.ring-btns .trial-press { min-width: 96px; min-height: 56px; font-size: 18px; }

/* Board games on the painted table */
.boardtable { display: grid; justify-items: center; padding: 14px; border-radius: var(--r-control); background: #2a1d14 var(--stage) center / cover no-repeat; }
.boardtable svg { width: min(100%, 380px); height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.chaupar .sq { fill: #b8432a; stroke: #3a1208; stroke-width: 1.2; }
.chaupar .sq.mid { fill: #d79a2b; } .chaupar .sq.safe { fill: #2f7d55; } .chaupar .home { fill: #8a2a1a; stroke: #3a1208; stroke-width: 1.5; }
.chaupar .x { stroke: #f7ead3; stroke-width: 2; }
.chaupar .pc path, .chaupar .pc circle { stroke: #1a0f0b; stroke-width: 1.4; }
.chaupar .pc.me path, .chaupar .pc.me circle { fill: #f2e3c4; } .chaupar .pc.them path, .chaupar .pc.them circle { fill: #2a2a32; }
.chaupar .pc text { font: 700 10px var(--text); text-anchor: middle; fill: #2a120f; }
.chaupar .pc.can { cursor: pointer; } .chaupar .pc.can path { fill: var(--accent); animation: pc-pulse 1s ease-in-out infinite; }
.chaupar .pc.can:focus-visible { outline: none; } .chaupar .pc.can:focus-visible path { stroke: #fff; stroke-width: 2.5; }
@keyframes pc-pulse { 50% { transform: translateY(-3px); } }
.cowries { display: flex; justify-content: center; align-items: center; gap: 8px; }
.cowries b { margin-left: 10px; font-family: var(--display); font-size: 28px; color: var(--data); }
.cowrie { width: 22px; height: 30px; border-radius: 50%; background: radial-gradient(ellipse at 40% 35%, #fffaf0, #e7d6b4 60%, #b9a07a); box-shadow: 0 2px 3px rgba(0, 0, 0, .5); position: relative; }
.cowrie.up::after { content: ""; position: absolute; left: 50%; top: 18%; bottom: 18%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #6b4a2a; box-shadow: -3px 0 0 -1px #a88a62, 3px 0 0 -1px #a88a62; }
.cowries.empty .cowrie { opacity: .35; }
.bagh .lines path { stroke: #3a1f12; stroke-width: 2; fill: none; }
.bagh { background: #d9bf8c; border-radius: 6px; }
.bagh .pt { cursor: pointer; } .bagh .hit { fill: transparent; }
.bagh .dot { fill: #5a3418; } .bagh .pt.dest .dot { fill: var(--accent); }
.bagh .pt.cur .hit { stroke: #2a120f; stroke-width: 2; stroke-dasharray: 3 3; }
.bagh .tiger circle { fill: #e5872e; stroke: #2a120f; stroke-width: 2; } .bagh .tiger path { stroke: #2a120f; stroke-width: 2; fill: none; stroke-linecap: round; }
.bagh .pt.sel .tiger circle { fill: #ffb648; stroke-width: 3; }
.bagh .goat circle { fill: #f7f2e6; stroke: #2a120f; stroke-width: 2; } .bagh .goat path { stroke: #2a120f; stroke-width: 1.6; fill: none; }
.moksha .sq { fill: #ecdcb6; stroke: #7a5634; stroke-width: .8; } .moksha .sq.alt { fill: #d9c094; }
.moksha .num { font: 9px var(--text); fill: #7a5634; }
.moksha .ladder path { stroke: #7a4a1c; stroke-width: 2.4; fill: none; stroke-linecap: round; }
.moksha .snake path { stroke: #2f7d55; stroke-width: 5; fill: none; stroke-linecap: round; } .moksha .snake circle { fill: #1f5a3a; }
.moksha text:not(.num) { font: italic 9px var(--display); fill: #2a120f; paint-order: stroke; stroke: #ecdcb6; stroke-width: 2.5px; }
.moksha .sq.karma { fill: #b9c9a0; } .moksha .sq.goal { fill: #e9b949; }
.moksha .tag { text-anchor: middle; font-size: 8px !important; }
.moksha .aim { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 4 3; }
.trial .game-note .remark { display: block; font-style: italic; color: var(--muted); }
.moksha .tok circle { stroke: #1a0f0b; stroke-width: 2; } .moksha .tok.me circle { fill: var(--accent); } .moksha .tok.them circle { fill: #3b6fb0; }
.pickdice { display: flex; gap: 10px; justify-content: center; }
.pickdice .cta { min-width: 120px; }
.trial .cta.secondary { background: var(--hover); border: 1px solid var(--gold-line); }
.trial .cta.secondary:hover:not(:disabled) { background: #6a3a2e; }

/* ---------- The fight, played by puppets ---------- */
.arena { position: relative; height: 196px; margin: 0 0 4px; overflow: hidden; background: #1a0f0b var(--stage) center 70% / cover no-repeat;
  display: flex; justify-content: space-between; align-items: flex-end; padding: 0 6% 4px; border-top: 1px solid var(--gold-line); border-bottom: 1px solid var(--gold-line); }
.arena::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 90% at 50% 100%, rgba(255, 196, 120, .2), transparent 70%), linear-gradient(rgba(20, 10, 6, .15), rgba(20, 10, 6, .5)); pointer-events: none; }
.arena .team { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 0; }
.arena .team.left .actor + .actor { margin-left: -34px; }
.arena .team.right .actor + .actor { margin-left: -30px; }
.arena .actor { position: relative; display: block; }
.arena .actor svg { height: 160px; width: auto; overflow: visible; filter: drop-shadow(0 0 6px rgba(255, 200, 120, .35)) drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); }
.arena .actor.ally svg { height: 136px; }
.arena .actor.ally.champ svg { height: 160px; opacity: 1; }
.arena .actor.enemy + .actor.enemy svg { height: 146px; }
.arena .actor.down svg { filter: grayscale(.6) brightness(.62) drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); }
.arena .actor.lunge-r { animation: lunge-r .52s cubic-bezier(.3, .7, .3, 1); }
.arena .actor.lunge-l { animation: lunge-l .52s cubic-bezier(.3, .7, .3, 1); }
@keyframes lunge-r { 35% { transform: translateX(46px); } }
@keyframes lunge-l { 35% { transform: translateX(-46px); } }
/* A streak behind the lunge: the trail of the swing. */
.arena .actor.lunge-r::after, .arena .actor.lunge-l::after { content: ""; position: absolute; top: 38%; height: 5px; width: 90px; border-radius: 3px; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 230, 170, .85)); animation: trail .52s ease-out; }
.arena .actor.lunge-r::after { left: 40%; } .arena .actor.lunge-l::after { right: 40%; transform: scaleX(-1); }
@keyframes trail { 30% { opacity: 1; } 100% { opacity: 0; } }
.arena .actor.struck { animation: struck .42s ease-out; }
@keyframes struck { 0% { transform: translateX(0); filter: brightness(2.2); } 20% { transform: translateX(-9px) rotate(-2deg); } 45% { transform: translateX(7px); } 70% { transform: translateX(-3px); } 100% { transform: none; filter: none; } }
.arena .actor.dodge { animation: dodge .5s ease-out; }
@keyframes dodge { 40% { transform: translateX(-34px) translateY(-6px); } }
.arena .pops { position: absolute; left: 50%; top: 10px; width: 0; }
.arena .pop { position: absolute; left: -30px; width: 60px; text-align: center; font: 700 24px var(--display); color: #ffd36b; text-shadow: 0 2px 3px #000, 0 0 8px rgba(0, 0, 0, .7); animation: pop-up 1.2s ease-out forwards; }
.arena .pop.down { color: #ff8a6e; } .arena .pop.up { color: var(--positive); }
@keyframes pop-up { 0% { transform: translateY(14px) scale(.6); opacity: 0; } 15% { transform: translateY(0) scale(1.15); opacity: 1; } 100% { transform: translateY(-46px) scale(1); opacity: 0; } }
/* The last blow of a fight you win falls slowly. */
.arena.slowmo .pp .j, .arena.slowmo .pp .pp-body { transition-duration: 1.6s !important; }
.arena.slowmo { animation: slowmo-zoom 1.8s ease-out forwards; }
@keyframes slowmo-zoom { 0% { background-size: cover; } 100% { background-size: 112%; } }
.foe-turn { margin: 0; color: var(--muted); font-style: italic; }
/* Meeting a blow */
.qte { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-card); background: var(--raised); border: 1px solid var(--gold-line); }
.qte-who { margin: 0; font-size: 17px; }
.qte-ring { position: relative; height: 120px; border-radius: var(--r-control); background: radial-gradient(circle, #3e241b, #23140f); overflow: hidden; }
.qte-ring .mark, .qte-ring .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; }
.qte-ring .mark { width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 3px solid var(--data); box-shadow: 0 0 14px rgba(226, 181, 90, .5); }
.qte-ring .ring { width: 180px; height: 180px; border: 4px solid var(--negative); transform: translate(-50%, -50%) scale(1); }
.qte-note { margin: 0; min-height: 1.4em; }
.qte.good .qte-ring { box-shadow: inset 0 0 0 3px var(--positive); } .qte.bad .qte-ring { box-shadow: inset 0 0 0 3px var(--negative); }
.qte-btns .trial-press { min-width: 150px; }
@media (max-width: 720px) { .arena { height: 150px; padding: 0 3% 3px; } .arena .actor svg { height: 122px; } .arena .actor.ally svg { height: 104px; } }
html.calm .arena .actor, html.calm .arena .actor::after, html.calm .arena.slowmo { animation: none !important; }
.battle .holdline { margin: 0 0 -10px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: #f3c46a; text-align: center; }
/* Things in a fight that are not people (puppet.js THING): the Narayana weapon is a light in the sky, a cart that is lost tips over. */
#arena .team.right .actor.beast + .actor { margin-left: -28vw; } /* the riders come on at the elephant's heels */
@media (min-width: 721px) { .arena .actor .thing-elephant { scale: 1.4; transform-origin: 50% 100%; } #arena .team.right .actor.beast + .actor { margin-left: -2vw; } } /* room to tower on a wide screen */
.arena .actor .thing-light { translate: 0 -18%; filter: drop-shadow(0 0 16px rgba(255, 190, 90, .9)); animation: thing-glow 1.8s ease-in-out infinite; }
@keyframes thing-glow { 50% { opacity: .78; scale: 1.06; } }
.arena .actor.down .thing-cart { rotate: 14deg; transform-origin: 30% 100%; }
html.calm .arena .actor .thing-light { animation: none; }
.qte .cta.secondary { background: var(--hover); border: 1px solid var(--gold-line); }
@media (max-width: 720px), (max-height: 520px) {
  .trial { padding: 14px; gap: 12px; }
  .cast { height: 86px; margin: -14px -14px 0; }
  .cast .actor svg { height: 78px; } .cast .actor.foe.f1 svg, .cast .actor.foe.f2 svg { height: 70px; }
  .trial .game-rules { font-size: 16px; }
  .trial .game-note { font-size: 15px; }
}

/* ---------- Beats: the act card and the scene's title card ----------
   They lie over the whole screen. The painting is the backdrop behind them: dimmed for an act,
   veiled for a full title, clear for the moment the painting shows alone, shaded at the foot for
   the short title. A tap moves on. */
body.beating .leaf { display: none; }
body.beating header.top { opacity: 0.35; transition: opacity 0.4s ease; }
#beat { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  padding: max(28px, var(--sat)) max(22px, var(--sar)) max(28px, var(--sab)) max(22px, var(--sal)); }
#beat::before { content: ""; position: absolute; inset: 0; z-index: -1; transition: background 0.5s ease; background: transparent; }
#beat.dim::before { background: rgba(16, 6, 4, 0.8); } /* taste-skill-ignore: dims the painting under the act card */
#beat.veil::before { background: radial-gradient(ellipse at 50% 50%, rgba(16, 6, 4, 0.74), rgba(16, 6, 4, 0.42) 75%); } /* taste-skill-ignore: veil under the title card */
#beat.low { place-items: end start; }
#beat.low::before { background: linear-gradient(to top, rgba(16, 6, 4, 0.82), rgba(16, 6, 4, 0) 46%); } /* taste-skill-ignore: shade under the short title */
#beat.gone::before { background: transparent; }
.beat-in { opacity: 0; transform: translateY(12px) scale(0.99); transition: opacity 0.5s ease, transform 0.7s cubic-bezier(.2, .7, .2, 1); }
.beat-in.in { opacity: 1; transform: none; }
.beat-in.out { opacity: 0; transform: translateY(-8px); transition-duration: 0.24s; }
.beat-act { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 30ch; }
.beat-act .b-num { font-family: var(--display); font-weight: 700; font-size: clamp(17px, 2.4vw, 22px); letter-spacing: 0.32em; text-transform: uppercase; color: var(--data); padding-left: 0.32em; }
.beat-act b { font-family: var(--display); font-weight: 700; font-size: clamp(40px, min(10vw, 14vh), 92px); line-height: 1; color: var(--ink); text-wrap: balance; }
.beat-act .b-orn { display: block; width: 168px; height: 16px; background: url("torana.svg") 0 0 / 28px 16px repeat-x; opacity: 0.9; }
.beat-act p { margin: 2px 0 0; font-size: clamp(16px, 2.3vw, 21px); line-height: 1.5; color: var(--muted); text-wrap: balance; }
.beat-title { display: grid; justify-items: center; gap: 6px; text-align: center; max-width: 26ch; }
.beat-title .ppbadge svg { height: clamp(96px, 18vh, 150px); width: auto; }
.beat-title .kind, .beat-short .kind { font-size: 12.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding-left: 0.2em; }
.beat-title .kind.canon, .beat-short .kind.canon { color: var(--data); }
.beat-title .kind.war, .beat-short .kind.war { color: var(--negative); }
.beat-title b { font-family: var(--display); font-weight: 700; font-size: clamp(28px, min(6.4vw, 8vh), 58px); line-height: 1.05; color: var(--ink); text-wrap: balance; }
.beat-title small { font-size: clamp(14px, 1.8vw, 17px); color: var(--muted); }
.beat-short { display: grid; gap: 2px; max-width: min(36ch, 100%); padding: 0 0 4vh; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); } /* taste-skill-ignore: title over a painting */
.beat-short b { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 6vw, 52px); line-height: 1.05; color: var(--ink); text-wrap: balance; }
html[lang="hi"] .beat-act b, html[lang="hi"] .beat-title b, html[lang="hi"] .beat-short b { line-height: 1.3; font-size: clamp(38px, 8vw, 74px); }
html[lang="hi"] .beat-title b, html[lang="hi"] .beat-short b { font-size: clamp(30px, 5.4vw, 50px); }
html[lang="hi"] .beat-act .b-num, html[lang="hi"] .beat-title .kind, html[lang="hi"] .beat-short .kind { letter-spacing: 0.04em; text-transform: none; }
html[lang="hi"] .beat-act p { line-height: 1.7; }
html[lang="hi"] .pagehead .kind { letter-spacing: 0.02em; text-transform: none; font-size: 13.5px; } /* letter-spacing breaks Devanagari conjuncts apart */

/* ---- Moments: a friend for life, a divine weapon, a teacher, a marriage, a vow, a company ---- */
.moment { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: 1fr auto; overflow: hidden; background: #0d0a08; cursor: pointer; opacity: 0; transition: opacity .6s ease; }
.moment.in { opacity: 1; } .moment.out { opacity: 0; transition-duration: .4s; }
/* The moment covers the page at once (its dark ground), while its painting loads; the painting and words then come in (owner, 5 November: the story was seen moving on underneath first) */
.moment.wait { opacity: 1; transition: none; } .moment.wait > * { opacity: 0; } .moment.in > * { transition: opacity .6s ease; }
.moment .mo-art { position: absolute; inset: -4%; background: var(--img) center / cover no-repeat; transform: scale(1.0); }
.moment.in .mo-art { animation: mo-zoom 9s ease-out forwards; }
.moment.framed .mo-art { filter: brightness(.55) saturate(.8) blur(1.5px); }
.moment.grey .mo-art { filter: grayscale(.85) brightness(.6); }
.moment::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(10, 7, 5, .62) 0%, rgba(10, 7, 5, 0) 26%, rgba(10, 7, 5, 0) 58%, rgba(10, 7, 5, .82) 100%); }
@keyframes mo-zoom { from { transform: scale(1.0); } to { transform: scale(1.08); } }
.mo-frame { position: absolute; z-index: 1; left: 50%; top: 13%; width: min(34vw, 30vh); aspect-ratio: 3 / 4; transform: translateX(-50%); background: var(--img) center / cover; border-radius: 6px;
  box-shadow: 0 0 0 3px #d9a53a, 0 0 0 7px rgba(20, 12, 6, .85), 0 0 0 9px #b8862e, 0 18px 40px rgba(0, 0, 0, .6); opacity: 0; }
.moment.in .mo-frame { animation: mo-rise 1.2s .3s ease-out forwards; }
.moment.grey .mo-frame { filter: grayscale(.9); }
@keyframes mo-rise { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translate(-50%, 0); } }
.mo-figs { position: absolute; z-index: 2; left: 0; right: 0; bottom: 30%; height: 230px; pointer-events: none; }
.mo-figs .mo-l, .mo-figs .mo-r { position: absolute; bottom: 0; transition: left 1.4s cubic-bezier(.3, .1, .3, 1), right 1.4s cubic-bezier(.3, .1, .3, 1); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); }
.mo-figs .mo-l { left: -30%; } .mo-figs .mo-r { right: -30%; }
.moment.in .mo-l { left: calc(50% - 150px); } .moment.in .mo-r { right: calc(50% - 150px); }
/* Over a painting of the two of you, the figures keep to the clear side edges and reach toward each other. */
.moment.painted.k-friend.in .mo-l { left: 8%; } .moment.painted.k-friend.in .mo-r { right: 8%; }
.moment.painted.k-friend.met .mo-l { left: 11%; } .moment.painted.k-friend.met .mo-r { right: 11%; }
.moment.k-astra.in .mo-l { left: calc(50% - 60px); }
.moment.k-friend.met .mo-l { left: calc(50% - 118px); } .moment.k-friend.met .mo-r { right: calc(50% - 118px); }
.mo-figs svg { display: block; }
.mo-emblem { position: absolute; left: 50%; bottom: 220px; width: 108px; height: 108px; margin-left: -54px; background: var(--img) center / contain no-repeat; opacity: 0; filter: drop-shadow(0 0 18px rgba(255, 214, 128, .8)); }
.moment > .mo-emblem { z-index: 2; bottom: auto; top: 16%; width: min(34vw, 26vh); height: min(34vw, 26vh); margin-left: calc(min(34vw, 26vh) / -2); }
.moment.in .mo-emblem:not(.astra) { animation: mo-fade 1.2s .4s ease-out forwards; }
.mo-emblem.astra { bottom: -40px; transition: bottom 1.4s cubic-bezier(.3, 0, .2, 1), opacity .8s, transform .8s; } /* it rises from the weapon laid on the ground */
.mo-emblem.astra svg { width: 100%; height: 100%; }
.moment.risen .mo-emblem.astra { opacity: 1; bottom: 200px; }
.moment.taken .mo-emblem.astra { transform: scale(.55); opacity: .9; transition: left .8s ease, bottom .8s ease, transform .8s ease, opacity .6s; }
@keyframes mo-fade { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.mo-dark { position: absolute; inset: 0; z-index: 1; background: #050308; opacity: 0; transition: opacity 1.2s; pointer-events: none; }
.moment.k-astra.in .mo-dark { opacity: .5; } .moment.k-astra.taken .mo-dark { opacity: .2; }
.mo-mantra { position: absolute; z-index: 2; left: 8%; right: 8%; top: 46%; height: 2px; pointer-events: none; }
.mo-mantra i { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: linear-gradient(90deg, rgba(255, 230, 160, 0), #fff3c8 40%, #ffd680 70%, rgba(255, 214, 128, 0)); box-shadow: 0 0 14px 3px rgba(255, 214, 128, .7); }
.moment.k-astra.in .mo-mantra i { animation: mo-mantra 2.2s .5s ease-in-out forwards; }
@keyframes mo-mantra { 0% { width: 0; opacity: 1; } 70% { width: 100%; opacity: 1; } 100% { width: 100%; opacity: 0; } }
.mo-text { position: relative; z-index: 3; grid-row: 2; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 0 16px max(46px, calc(env(safe-area-inset-bottom) + 40px)); opacity: 0; transform: translateY(10px); transition: opacity 1s .9s, transform 1s .9s; }
.moment.in .mo-text { opacity: 1; transform: none; }
.mo-orn { display: block; width: 168px; height: 16px; background: url("torana.svg") 0 0 / 28px 16px repeat-x; }
.mo-title { font-family: var(--display); font-weight: 700; font-size: clamp(32px, min(7vw, 9vh), 64px); line-height: 1.05; color: #f3d27a; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); text-wrap: balance; max-width: 22ch; }
.moment.grey .mo-title { color: #d8cfc0; }
.mo-line { margin: 0; max-width: 46ch; font-family: var(--display); font-style: italic; font-size: clamp(18px, 2.4vw, 24px); line-height: 1.4; color: #f4ead6; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); text-wrap: balance; }
.mo-sub { margin: 0; max-width: 52ch; font-size: clamp(14px, 1.8vw, 17px); line-height: 1.45; color: #e2d6bd; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.mo-sub.down { color: #f0b8a2; }
.mo-tap { position: absolute; z-index: 3; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); font-size: 13px; color: rgba(244, 234, 214, .7); }
html[lang="hi"] .mo-title { line-height: 1.3; } html[lang="hi"] .mo-line { font-style: normal; line-height: 1.6; }
.moment.still, .moment.still * { animation: none !important; transition: none !important; }
.moment.still .mo-text, .moment.still .mo-frame, .moment.still .mo-emblem:not(.astra) { opacity: 1; transform: none; }
.moment.still .mo-frame { transform: translateX(-50%); }
.moment.still .mo-figs { display: none; }
@media (max-width: 560px) { .mo-figs { bottom: 30%; height: 170px; } .mo-figs svg { height: 160px; width: auto; } .moment.in .mo-l { left: calc(50% - 120px); } .moment.in .mo-r { right: calc(50% - 120px); }
  .moment.k-friend.met .mo-l { left: calc(50% - 96px); } .moment.k-friend.met .mo-r { right: calc(50% - 96px); }
  .moment.painted.k-friend.in .mo-l { left: 0; } .moment.painted.k-friend.in .mo-r { right: 0; } .moment.painted.k-friend.met .mo-l { left: 2%; } .moment.painted.k-friend.met .mo-r { right: 2%; }
  .moment.painted.k-friend .mo-figs { bottom: 34%; } .moment.k-astra.in .mo-l { left: calc(50% - 60px); } }
/* Two new poses: hands reaching to clasp a friend's; an arm raised to take what is given. */
.pose-clasp .armF { transform: rotate(-64deg); } .pose-clasp .foreF { transform: rotate(-12deg); } .pose-clasp .armB { transform: rotate(-8deg); } .pose-clasp .pp-body { transform: rotate(4deg); }
.pose-lift .armF { transform: rotate(-150deg); } .pose-lift .foreF { transform: rotate(-10deg); } .pose-lift .armB { transform: rotate(-20deg); } .pose-lift .head { transform: rotate(-8deg); }
.pose-clasp .armF, .pose-clasp .foreF, .pose-lift .armF, .pose-lift .foreF { transition: transform .6s ease; }
/* Moments kept in the character sheet. */
.momentlist { display: grid; gap: 8px; }
.momentcard { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--r-card); background: var(--raised); }
.momentcard .thumb { width: 54px; height: 40px; border-radius: 6px; }
.momentcard b { font-family: var(--display); font-size: 18px; line-height: 1.15; display: block; }
.momentcard small { color: var(--muted); font-size: 13px; }
.momentcard.grey { opacity: .7; }
.lifemoments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
@media (max-height: 520px) { .beat-title { max-width: 40ch; } .beat-title .ppbadge svg { height: 72px; } .beat-act { gap: 6px; max-width: 44ch; } .beat-short { max-width: 52ch; } }
html.calm .beat-in { transition: none; }
/* The menu's two-way switch (Scene titles: Full / Short). */
.seg-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; font-size: 16px; }
.seg-row > span { flex: 1 1 220px; }
.seg-row small { display: block; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--raised); border: 1px solid var(--gold-line); }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 15px; padding: 6px 16px; min-height: 36px; border-radius: 999px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
/* Phones on their side: tests, fights and the journey shrink to the screen's height, so nothing
   needs scrolling. The figures' strip gets slimmer and the play areas take what height is left. */
@media (orientation: landscape) and (max-height: 520px) {
  .leaf.testing .choices > .choice.picked { display: none; }
  .leaf.split.testing .actions { padding: 6px 8px max(6px, var(--sab)); }
  .trial { padding: 10px 12px; gap: 8px; }
  .trial-body { gap: 8px; }
  .cast { height: 60px; margin: -10px -12px 0; }
  .cast .actor svg { height: 54px; } .cast .actor.foe.f1 svg, .cast .actor.foe.f2 svg { height: 48px; }
  .trial .game-rules { font-size: 15px; line-height: 1.4; } .trial .game-note { font-size: 14px; min-height: 1.2em; } .trial .score { font-size: 13.5px; }
  .steady { height: 84px; }
  .drill { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .drill .tile { min-height: 0; padding: 6px 4px; } .drill .tile .sign { width: 38px; height: 38px; } .drill.verse .tile { min-height: 0; } .drill .verse { font-size: 15px; }
  .trial-press { min-height: 46px; font-size: 17px; }
  .ring-btns .trial-press { min-height: 44px; min-width: 80px; font-size: 16px; }
  .arena { height: calc(var(--vh) * 0.36); } .arena .actor svg { height: calc(var(--vh) * 0.31); } .arena .actor.ally svg { height: calc(var(--vh) * 0.27); }
  /* The journey: the map on the left, where you go and why on the right. */
  .leaf.journeying .text { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-content: start; align-items: start; column-gap: 18px; row-gap: 8px; padding: 14px 16px 10px; }
  .leaf.journeying .text > .jmap { grid-row: 1 / span 4; grid-column: 1; }
  .leaf.journeying .text > :not(.jmap):not(.quill) { grid-column: 2; }
  .jmap .bmap { max-height: calc(var(--vh) - 150px); }
  .j-route { font-size: 17px; }
}

/* ---------- The fight fits the screen ----------
   The painted stage and figures on top; under them the two sides (scrolling if there are many),
   the last few lines of the fight, and your moves, always at the foot. */
body.inscene .leaf.fighting { display: flex; flex-direction: column; overflow: hidden; max-height: min(100%, 1000px); }
.leaf.fighting > .pagehead, .leaf.fighting > .arena { flex: none; }
.leaf.fighting > #battle-body { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 22px 16px; overflow: hidden; }
#battle-body > .sides { flex: 0 1 auto; min-height: 64px; overflow-y: auto; overscroll-behavior: contain; order: 1; }
#battle-body > .blog { flex: none; order: 2; max-height: 112px; }
#battle-body > #battle-actions { flex: none; order: 3; }
@media (max-width: 720px), (max-height: 520px) {
  .leaf.fighting > #battle-body { padding: 8px 10px max(10px, var(--sab)); gap: 6px; }
  #battle-body .sides { grid-template-columns: 1fr 1fr; gap: 8px; }
  #battle-body .side { gap: 5px; }
  #battle-body .side .lbl { font-size: 14px; }
  .unit { padding: 6px 8px; gap: 3px; }
  .unit .nm { font-size: 13.5px; } .unit .nm span { font-size: 12px; } .unit .nm .thumb.face { width: 22px; height: 22px; }
  .unit .st span, .unit .intent, .unit .note { font-size: 11.5px; }
  #battle-body > .blog { max-height: 58px; padding: 6px 10px; font-size: 13px; }
  #battle-actions, #battle-actions .actions { gap: 6px; }
  #battle-actions .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .act { min-height: 44px; padding: 7px 10px; } .act b { font-size: 14.5px; } .act small { font-size: 11.5px; line-height: 1.25; }
}
/* Phones on their side: the stage and its figures on the left, the two sides and your moves on the right. */
@media (orientation: landscape) and (max-height: 520px) {
  body.inscene .leaf.fighting { display: grid; height: 100%; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .leaf.fighting > .pagehead { grid-column: 1; grid-row: 1; }
  .leaf.fighting > .arena { grid-column: 1; grid-row: 2; height: auto; align-self: stretch; margin: 0; }
  .leaf.fighting > #battle-body { grid-column: 2; grid-row: 1 / span 2; background-image: none; border-left: 1px solid var(--gold-line); }
  #battle-body .sides { grid-template-columns: 1fr; }
}

/* ---------- A test in play fills the page ----------
   The page takes the screen's height, and the test's play area (the range, the track, the board,
   the field) takes whatever height is left after the score, the note and the buttons, so a test
   never needs scrolling, on a small phone, on its side, or on a desktop. */
body.inscene .leaf.split.testing { height: auto; }
body.inscene .leaf.split.testing.playing { height: 100%; }
.leaf.split.testing.playing .text, .leaf.split.testing.playing .actions, .leaf.split.testing.playing .choices { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.leaf.split.testing.playing .actions { gap: 8px; }
.leaf.split.testing.playing .choices { gap: 8px; }
.leaf.split.testing.playing .choices > *, .leaf.split.testing.playing .actions > .hint { flex: none; }
.leaf.split.testing.playing .choices > .trial { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.trial.playing > .cast { flex: none; }
.trial.playing > .trial-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.trial.playing > .trial-body > * { flex: none; }
.trial.playing > .trial-body > :is(.range, .pushpit, .sneakway, .track, .herdfield, .ringfield, .formfield, .boardtable, .steady, .beatlane, .table, .drill) { flex: 1 1 0; min-height: 0; }
.trial.playing .range { height: auto; min-height: 120px; max-height: 340px; }
.trial.playing .sneakway { height: auto; min-height: 110px; max-height: 260px; }
.trial.playing .track { height: auto; min-height: 130px; max-height: 260px; }
.trial.playing .steady { height: auto; min-height: 76px; max-height: 150px; }
.trial.playing .beatlane { min-height: 70px; max-height: 120px; }
.trial.playing .pushpit { display: flex; flex-direction: column; } .trial.playing .pushpit > .balance { flex: none; }
.trial.playing .ringbox { flex: 1 1 0; height: auto; min-height: 110px; max-height: 320px; }
.trial.playing .table, .trial.playing .drill { align-content: center; overflow: auto; }
.trial.playing .boardtable, .trial.playing .ringfield, .trial.playing .herdfield { display: flex; justify-content: center; align-items: center; overflow: hidden; }
.trial.playing .boardtable svg, .trial.playing .ringfield svg { width: auto; height: 100%; max-width: 100%; max-height: 380px; }
.trial.playing .herdfield canvas { width: auto; height: 100%; max-width: 100%; max-height: 420px; }
.trial.playing > .trial-body > .boardtable { min-height: 150px; }
.trial.playing > .trial-body > .ringfield, .trial.playing > .trial-body > .herdfield { min-height: 120px; }

/* ---------- Your puppet stands on the page ----------
   Large, on the page's top edge at the right, rising above the page in front of the painting,
   with a warm glow so it reads over any picture. It steps up as the page rises. */
body.inscene .leaf.split { overflow: visible; }
body.inscene .leaf.split > .text { border-radius: 0 0 14px 14px; overflow: hidden; }
body.inscene .leaf.split > .pagehead { position: relative; padding-right: 128px; }
body.inscene .leaf.split > .pagehead .ppbadge { position: absolute; right: 22px; bottom: 4px; margin: 0; z-index: 3; }
body.inscene .leaf.split > .pagehead .ppbadge svg { height: min(250px, var(--pupmax, 250px)); filter: drop-shadow(0 0 10px rgba(255, 196, 110, 0.55)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6)); } /* taste-skill-ignore: the puppet lit from behind, as on a shadow-puppet screen */
body.inscene .leaf.split > .pagehead .ppbadge svg.pose-dead { height: 70px; }
:where(html:not(.calm)) body.inscene .leaf.split > .pagehead .ppbadge { animation: pupup 0.7s cubic-bezier(.2, .8, .25, 1.15) 0.35s both; transform-origin: 50% 100%; }
@keyframes pupup { from { opacity: 0; transform: translateY(40px) scale(0.85); } }
@media (max-width: 720px), (max-height: 520px) {
  body.inscene .leaf.split > .pagehead { padding-right: 92px; }
  body.inscene .leaf.split > .pagehead .ppbadge { right: 14px; }
  body.inscene .leaf.split > .pagehead .ppbadge svg { height: min(150px, var(--pupmax, 150px)); }
}
/* Phones on their side: no room above the page, so the puppet stands beside it, in front of the painting. */
@media (orientation: landscape) and (max-height: 520px) {
  body.inscene .leaf.split > .pagehead { position: static; padding-right: 16px; }
  body.inscene .leaf.split > .pagehead .ppbadge { right: calc(100% + 18px); bottom: 0; }
  body.inscene .leaf.split > .pagehead .ppbadge svg { height: min(230px, calc(var(--vh) * 0.62)); }
}
/* While a test is played the puppet is already on its stage strip. */
body.inscene .leaf.split.testing > .pagehead .ppbadge { display: none; }
/* The title card's puppet, larger too. */
.beat-title .ppbadge svg { height: clamp(150px, 26vh, 240px); filter: drop-shadow(0 0 12px rgba(255, 196, 110, 0.5)); }
@media (max-height: 520px) { .beat-title .ppbadge svg { height: 96px; } }

/* ---------- The story page reads a size smaller ----------
   The scene's own text and its choices. Act cards, the opening dream and full-screen moments keep
   their sizes (they are not in .story). */
.leaf .story { font-size: 15.5px; }
.leaf .story .speech { font-size: 21px; }
.leaf .story .memory, .leaf .story .aside, .leaf .story .curse { font-size: 14.5px; }
.leaf .story .witness .lbl, .leaf .story .lbl { font-size: 18px; }
.leaf .choices .choice .t { font-size: 16.5px; }
.leaf .choices .choice .fx { font-size: 13.5px; }
html[lang="hi"] .leaf .story .speech { font-size: 19px; }
body.big-text .leaf .story { font-size: 17.5px; }
body.big-text .leaf .choices .choice .t { font-size: 18px; }

/* After a choice the scene's own lines step aside; only the choice and its outcome stay. */
.leaf .story > .past { display: none; }

/* ---------- The page comes up whole, then is written ----------
   Lines, the choices and the key hint not shown yet keep their room (owner, 2 Nov): the box opens at
   its full size over the painting, the story is written into it, and then the painting moves once. */
body.inscene .leaf.split .story > .staged:not(.shown),
body.inscene .leaf.split .witness > .staged:not(.shown),
body.inscene .leaf.split .actions.staged:not(.shown),
body.inscene .leaf.split .choices > .staged:not(.shown),
body.inscene .leaf.split .actions > .hint.staged:not(.shown) { visibility: hidden; }
body.inscene .leaf.split .actions.staged.shown { animation: growin 0.35s ease both; transform: none; opacity: 1; }
body.inscene .leaf.split .choices > .staged.shown:not(.now) { animation: risein 0.5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes growin { from { opacity: 0; } }
@keyframes risein { from { opacity: 0; transform: translateX(-14px); } }
body.inscene .leaf.split { transition: none; }

/* ---------- Phones play upright ---------- */
.turn { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(20px, var(--sat)) max(24px, var(--sar)) max(20px, var(--sab)) max(24px, var(--sal));
  background: var(--ground) url("buti.svg") 0 0 / 88px 88px repeat; text-align: center; }
.turn-in { display: grid; justify-items: center; gap: 10px; max-width: 34ch; }
.turn-ico { width: 64px; height: 64px; color: var(--data); }
:where(html:not(.calm)) .turn-ico { animation: turnit 2.4s ease-in-out infinite; } @keyframes turnit { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
.turn b { font-family: var(--display); font-size: 26px; line-height: 1.15; color: var(--ink); }
.turn p { margin: 0; font-size: 15px; color: var(--muted); }
html[lang="hi"] .turn b { font-size: 23px; line-height: 1.4; }
body.turned #beat, body.turned .view-full, body.turned .view-back { visibility: hidden; }

/* ---------- Immersive tests: the stage painting is the playing field ----------
   Everything but the game and its painting falls away: no top bar, no page. The figures stand big
   on the painting's ground; the test's name and score sit at the top, its controls at the foot,
   and the play itself happens on the painting. Before it starts, the rules and stakes are a card
   over the scene; at the end the outcome is written large over it while the figures react. */
body.intest header.top, body.intest .view-full, body.intest .ledger, body.intest .floats { display: none !important; }
body.intest .leaf { background: none !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  animation: none !important; transform: none !important; transition: none !important; filter: none !important; } /* nothing around the test may hold it in: it fills the screen */
body.intest .leaf *:has(> .trial.immersive), body.intest .leaf .text, body.intest .leaf .actions, body.intest .leaf .choices { transform: none !important; animation: none !important; filter: none !important; backdrop-filter: none !important; contain: none !important; }
body.intest .leaf .choices > .choice.picked, body.intest .leaf .pagehead { display: none !important; }
body.intest .backdrop::after { background: linear-gradient(to bottom, rgba(16, 6, 4, 0.55), rgba(16, 6, 4, 0) 22%, rgba(16, 6, 4, 0) 58%, rgba(16, 6, 4, 0.7)); } /* taste-skill-ignore: keeps the score and controls legible over the painting */
.trial.immersive { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0; margin: 0; padding: max(10px, var(--sat)) max(14px, var(--sar)) max(12px, var(--sab)) max(14px, var(--sal));
  background: none; border: 0; border-radius: 0; animation: pagein 0.4s ease both; }
.trial.immersive > .t-head { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 0 8px; }
.trial.immersive > .t-head .t-clock { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } /* taste-skill-ignore: the clock floats over the painting */
.trial.immersive .t-name { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); text-align: center; } /* taste-skill-ignore: text over a painting */
/* The figures: big, on the painting's ground, at the two sides. */
.trial.immersive > .cast { position: absolute; inset: auto 0 0 0; height: 100%; margin: 0; padding: 0 4% max(76px, calc(var(--sab) + 70px)); border-radius: 0; background: none; pointer-events: none; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; }
.trial.immersive > .cast::before { display: none; }
.trial.immersive > .cast .actor svg { height: clamp(150px, 30vh, 300px); filter: drop-shadow(0 0 10px rgba(255, 196, 110, 0.5)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6)); }
.trial.immersive > .cast .actor.foe.f1 svg, .trial.immersive > .cast .actor.foe.f2 svg { height: clamp(130px, 26vh, 260px); }
/* A shadow on the ground under each figure, so they stand on the painting instead of floating over it. */
.trial.immersive > .cast .actor::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: -7px; height: 16px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 70%); pointer-events: none; z-index: -1; }
/* While a test plays, the figures stand above the line of help, not behind it. */
.trial.immersive.playing > .cast { padding-bottom: max(128px, calc(var(--sab) + 120px)); }
.trial.immersive.trial-aim.playing > .cast { --ab: max(128px, calc(var(--sab) + 120px)); }
/* The test itself, over the painting. */
.trial.immersive > .trial-body { position: relative; z-index: 2; min-height: 0; display: flex; flex-direction: column; gap: 10px; width: min(760px, 100%); margin: 0 auto; }
.trial.immersive > .trial-body > * { flex: none; }
.trial.immersive .score, .trial.immersive .game-note { align-self: center; text-align: center; margin: 0; padding: 5px 14px; border-radius: 999px; background: rgba(var(--surface-rgb), 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid var(--gold-line); color: var(--ink); font-size: 14px; }
.trial.immersive .game-note:empty { visibility: hidden; }
.trial.immersive .btnrow { margin-top: auto; justify-content: center; }
.trial.immersive .trial-press, .trial.immersive .btnrow .cta { min-height: 54px; min-width: min(260px, 70vw); font-size: 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); } /* taste-skill-ignore: the button floats over the painting */
/* Before it starts: the rules and stakes, a card over the scene. */
.trial.immersive:not(.playing):not(.done) > .trial-body { margin: auto; width: min(460px, 100%); padding: 20px 20px 18px; border-radius: 16px; background: rgba(var(--surface-rgb), 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--gold-line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); align-self: center; } /* taste-skill-ignore: the card floats over the scene */
.trial.immersive:not(.playing):not(.done) > .trial-body .btnrow { margin-top: 4px; }
.trial.immersive:not(.playing):not(.done) > .trial-body { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; } /* a tall card scrolls on a small phone; Begin is never out of reach */
.trial.immersive:not(.playing):not(.done) > .cast { padding-bottom: max(16px, var(--sab)); }
/* The outcome, large over the scene. */
.t-result { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; }
.t-result b { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 11vw, 96px); color: var(--ink); text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8); animation: verdict 1.6s cubic-bezier(.2, .8, .25, 1) both; } /* taste-skill-ignore: the verdict over the painting */
.t-result.win b { color: #ffe3a3; } .t-result.lose b { color: #ffb4a0; }
@keyframes verdict { 0% { opacity: 0; transform: scale(0.7); } 25% { opacity: 1; transform: scale(1.04); } 40% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0.9; } }
html[lang="hi"] .t-result b { line-height: 1.3; }

/* Archery: the range is the painting itself; the target swings over it. */
.trial.immersive .range { flex: 1 1 0; height: auto; min-height: 160px; max-height: none; background: none; box-shadow: none !important; overflow: visible; }
.trial.immersive .range .zone { background: rgba(255, 210, 120, 0.12); border-left: 1px dashed rgba(255, 220, 150, 0.55); border-right: 1px dashed rgba(255, 220, 150, 0.55); }
.trial.immersive .range .line { opacity: 0.9; box-shadow: 0 0 8px rgba(240, 148, 63, 0.8); } /* taste-skill-ignore: your line glows over the painting */
.trial.immersive .range .target { top: 12%; }
.trial.immersive .range .target i { transform: scale(1.5); transform-origin: 50% 0; filter: drop-shadow(0 0 10px rgba(255, 190, 90, 0.6)); }
.trial.immersive .range .target::before { background: rgba(247, 234, 211, 0.6); }
.trial.immersive .range .arrow { width: 5px; height: 64px; background: linear-gradient(#fff3d0, #c9a46a); box-shadow: 0 0 8px rgba(255, 220, 150, 0.7); }
@keyframes loose { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-46vh); } }
.trial.immersive .range.hit .zone { background: rgba(127, 207, 166, 0.25); } .trial.immersive .range.miss .zone { background: rgba(255, 138, 110, 0.22); }

/* Board games: the board lies on the painted table, big, between the two players. */
.trial.immersive .boardtable { flex: 1 1 0; min-height: 0; padding: 0; background: none; display: flex; align-items: center; justify-content: center; }
.trial.immersive .boardtable svg { width: auto; height: 100%; max-width: min(100%, 560px); max-height: 560px; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.6)); }
.trial.immersive.trial-board > .cast { padding-bottom: max(90px, calc(var(--sab) + 84px)); padding-left: 1%; padding-right: 1%; }
.trial.immersive.trial-board > .cast .actor svg { height: clamp(120px, 22vh, 230px); }
.trial.immersive .cowries { padding: 6px 14px; border-radius: 999px; background: rgba(var(--surface-rgb), 0.6); align-self: center; }

.trial.immersive.done .btnrow { visibility: hidden; }
body.intest .leaf .text { background: none !important; }
/* Archery on the painting: the target on its rope, your line, the arrow. */
.trial.immersive .range.painted > .zone, .trial.immersive .range.painted > .line, .trial.immersive .range.painted > .target, .trial.immersive .range.painted > .arrow { display: none; }
.range .aimsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.aimsvg .rope { stroke: #3a2614; stroke-width: 2; }
.aimsvg .path { stroke: rgba(255, 232, 175, 0.9); stroke-width: 3; stroke-dasharray: 1 9; stroke-linecap: round; }
.aimsvg .aimpt { fill: none; stroke: rgba(255, 226, 160, 0.9); stroke-width: 2; }
.aimsvg .tgt { filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); }
.aimsvg .flying { opacity: 0; }
.aimsvg .flying.stone .shaft { stroke: #8f8676; stroke-width: 9; stroke-linecap: round; }
.aimsvg .pop { fill: none; stroke: #fff1c4; stroke-width: 3; animation: aim-pop .45s ease-out forwards; }
@keyframes aim-pop { from { r: 6; opacity: 1; } to { r: 26; opacity: 0; } }
.aimsvg .tgt-mark { fill: rgba(255, 214, 128, 0.35); stroke: #ffd680; stroke-width: 2; filter: drop-shadow(0 0 4px rgba(255, 214, 128, 0.9)); }
.aimsvg .shaft { stroke: #efe0bc; stroke-width: 3; }
.aimsvg .cane, .aimsvg .held { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.aimsvg .bits path { stroke-width: 2; stroke-linecap: round; } /* straw shed by a hit */
.range.painted.hit .aimpt { stroke: var(--positive); } .range.painted.miss .aimpt { stroke: var(--negative); }
/* Archery: you stand in the lower left third, facing the target up and to the right; the teacher
   watches from the left edge, smaller and further back; another student from the right, smaller.
   The figures never overlap (trials.js moves them apart if a screen is too narrow). */
.trial.immersive.trial-aim > .cast { --ab: max(76px, calc(var(--sab) + 70px)); --aw: clamp(150px, 30vh, 300px); }
.trial.immersive.trial-aim > .cast .actor { position: absolute; bottom: var(--ab); }
.trial.immersive.trial-aim > .cast .actor.me { left: 24%; z-index: 2; }
.trial.immersive.trial-aim > .cast .actor.foe { right: 3%; bottom: calc(var(--ab) + 2.5vh); z-index: 1; }
.trial.immersive.trial-aim > .cast .actor.foe svg { height: calc(var(--aw) * 0.74); }
.trial.immersive.trial-aim > .cast .actor.foe.f1 { right: 16%; bottom: calc(var(--ab) + 4vh); }
.trial.immersive.trial-aim > .cast .actor.foe.f1 svg { height: calc(var(--aw) * 0.64); }
.trial.immersive.trial-aim > .cast .actor.foe.elder { right: auto; left: 1.5%; bottom: calc(var(--ab) + 5vh); }
.trial.immersive.trial-aim > .cast .actor.foe.elder svg { height: calc(var(--aw) * 0.62); filter: drop-shadow(0 0 6px rgba(255, 196, 110, 0.3)) drop-shadow(0 5px 5px rgba(0, 0, 0, 0.55)); }
.trial.immersive.trial-aim > .cast .actor.foe.elder .pp.flip { transform: none; } /* the teacher faces the archer and the target */
.trial-aim .actor.me .pp .armF, .trial-aim .actor.me .pp .armB, .trial-aim .actor.me .pp .head { transition-duration: 0.14s; }
/* The bow arm follows the aim (--aim: the angle above level, set as the target moves). */
.trial-aim .actor.me .pp.pose-aim .armF, .trial-aim .actor.me .pp.pose-loose .armF { transform: rotate(calc(-90deg - var(--aim, 30deg))); }
.trial-aim .actor.me .pp.pose-aim .foreF, .trial-aim .actor.me .pp.pose-loose .foreF { transform: rotate(0deg); }
.trial-aim .actor.me .pp.pose-aim .armB { transform: rotate(calc(-92deg - var(--aim, 30deg))); }
.trial-aim .actor.me .pp.pose-loose .armB { transform: rotate(calc(-70deg - var(--aim, 30deg) * 0.6)); }
.trial-aim .actor.me .pp.pose-aim .head, .trial-aim .actor.me .pp.pose-loose .head { transform: rotate(calc(var(--aim, 30deg) * -0.35)); }
.trial-aim .actor.me .pp.pose-aim .pp-body, .trial-aim .actor.me .pp.pose-loose .pp-body { transform: rotate(calc(var(--aim, 30deg) * -0.08)); }
/* Without motion (no live rig) the bow still stands square to the shot, not flat along the arm. */
.trial-aim .actor.me .pp.pose-aim .it:not(.it-w), .trial-aim .actor.me .pp.pose-loose .it:not(.it-w) { transform-box: view-box; transform-origin: 60.5px 126px; transform: rotate(calc(90deg + var(--aim, 30deg) * 0.08)); }
.trial-draw .actor.me .pp.pose-aim .it:not(.it-w), .trial-draw .actor.me .pp.pose-loose .it:not(.it-w) { transform-box: view-box; transform-origin: 60.5px 126px; transform: rotate(91deg); }
/* Wrestling on the painting: the two close in the middle; the ring closes on the sand at their feet;
   good pushes drive the other back. */
.trial.immersive.trial-push > .cast { justify-content: center; gap: 0; }
.trial.immersive.trial-push > .cast .actor { transform: translateX(var(--shove, 0)); transition: transform 0.45s cubic-bezier(.2, .8, .25, 1.2); }
.trial.immersive.trial-push > .cast .actor.foe { margin-left: -4vw; }
.trial.immersive .pushpit { flex: 1 1 0; position: relative; display: block; }
.trial.immersive .pushpit > .balance { display: none; }
.trial.immersive .pushpit .ringbox { position: absolute; left: 0; right: 0; bottom: max(-2vh, -16px); height: min(46vh, 380px); max-height: none; min-height: 0; background: none; box-shadow: none !important; overflow: visible; transform: scaleY(0.38); transform-origin: 50% 100%; }
.trial.immersive .pushpit .ringbox .who { display: none; }
.trial.immersive .pushpit .ringbox .mark { width: 120px; height: 120px; background: rgba(255, 210, 120, 0.22); border: 4px solid rgba(255, 210, 120, 0.85); box-shadow: 0 0 20px rgba(255, 190, 90, 0.6); } /* taste-skill-ignore: the mark glows on the sand */
.trial.immersive .pushpit .ringbox .ring { width: 400px; height: 400px; border: 6px solid rgba(247, 234, 211, 0.9); }
.trial.immersive .pushpit.good .ringbox .mark { border-color: var(--positive); } .trial.immersive .pushpit.bad .ringbox .mark { border-color: var(--negative); }
/* The faces of the timing test (trials.js pushFace): Kripa's sword drill, the practice post, the
   village gate. Figures and props are placed by the figure height (--F); the ground given and taken
   is moved by script on a spring, so no transition. The ring stays at the pair's feet. */
.trial.immersive.trial-push { --F: clamp(150px, 30vh, 300px); }
.trial.immersive.trial-push:has(> .cast.face-gate) { --F: min(clamp(150px, 30vh, 300px), 46vw); }
.trial.immersive.trial-push > .cast.face .actor { transition: none; z-index: 3; }
.trial.immersive.trial-push > .cast.face .actor.prop { z-index: 2; }
.trial.immersive.trial-push > .cast.face .actor svg { height: var(--F); }
.cast .actor.prop svg { overflow: visible; transform-origin: 50% 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55)); }
.trial.immersive > .cast .actor.prop svg { filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55)); }
/* The drill: a sword's length apart. The post: in reach of your mace. */
.trial.immersive.trial-push > .cast.face-drill .actor.foe { margin-left: calc(var(--F) * 0.21); }
.trial.immersive.trial-push > .cast.face-post .actor.prop { margin-left: calc(var(--F) * 0.02); }
/* The post in the beat test (Kripa's way of breaking it): sized and placed as in the timing test; it rocks at a clean
   blow and splits at a win (play.js). */
.trial.immersive.trial-rhythm:has(> .cast.face-post) { --F: clamp(150px, 30vh, 300px); }
.trial.immersive.trial-rhythm > .cast.face-post { justify-content: center; gap: 0; } /* in reach of your mace, as in the timing test */
.trial.immersive.trial-rhythm > .cast.face-post .actor svg { height: var(--F); }
.trial.immersive.trial-rhythm > .cast.face-post .actor.prop { margin-left: calc(var(--F) * 0.02); z-index: 2; }
.cast .actor.prop.post svg.struck { animation: post-struck .32s ease-out; }
@keyframes post-struck { 30% { transform: rotate(2.4deg); } 65% { transform: rotate(-1.2deg); } 100% { transform: none; } }
.cast .actor.prop.post svg .pl, .cast .actor.prop.post svg .pr { transition: transform .9s cubic-bezier(.55, 0, .9, .4); }
.cast .actor.prop.post svg.split .pl { transform: rotate(-14deg); transform-origin: 16px 200px; }
.cast .actor.prop.post svg.split .pr { transform: rotate(16deg); transform-origin: 46px 200px; }
.cast .actor.prop.post svg.split .ropes, .cast .actor.prop.post svg.split .cracks { opacity: 0; transition: opacity .3s; }
html.calm .cast .actor.prop.post svg.struck { animation: none; } html.calm .cast .actor.prop.post svg .pl, html.calm .cast .actor.prop.post svg .pr { transition: none; } /* the game's own calm setting */
/* The gate: your shoulder to the leaf, the raiders beyond it and a little smaller. */
.trial.immersive.trial-push > .cast.face-gate .actor.prop { margin-left: calc(var(--F) * -0.18); }
.trial.immersive.trial-push > .cast.face-gate .actor.prop svg { height: calc(var(--F) * 0.88); }
.trial.immersive.trial-push > .cast.face-gate .actor.raider { z-index: 1; } /* on the far side of it */
.trial.immersive.trial-push > .cast.face-gate .actor.raider svg { height: calc(var(--F) * 0.86); }
.trial.immersive.trial-push > .cast.face-gate .actor.raider.f0 { margin-left: calc(var(--F) * 0.03); }
.trial.immersive.trial-push > .cast.face-gate .actor.raider.f1 { margin-left: calc(var(--F) * -0.19); }
.trial.immersive.trial-push:has(> .cast.face-gate) .pushpit .ringbox { translate: calc(var(--F) * -0.41) 0; }
/* A heavy blow jolts the scene. */
.trial.jolt > .cast.face { animation: pf-jolt 0.22s linear; }
@keyframes pf-jolt { 20% { translate: -3px 1px; } 40% { translate: 3px -1px; } 60% { translate: -2px 0; } 80% { translate: 2px 1px; } }
html.calm .trial.jolt > .cast.face { animation: none; }

/* ---------- Every test on its painting ----------
   Shared: the play pieces lose their dark boxes and sit on the painting on soft glass where they
   need to be read; the figures stand on the ground; top-down games hide the standing figures. */
.trial.immersive .game-note, .trial.immersive .score { max-width: min(92%, 520px); }
.trial.immersive .calmbar, .trial.immersive .sus { align-self: center; width: min(78%, 420px); height: 6px; background: rgba(var(--surface-rgb), 0.55); border: 1px solid var(--gold-line); }
.trial.immersive .glass, .trial.immersive .taunt, .trial.immersive .table li, .trial.immersive .replies .cta, .trial.immersive .drill .tile {
  background: rgba(var(--surface-rgb), 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid var(--gold-line); color: var(--ink); }
.trial.immersive.trial-race > .cast, .trial.immersive.trial-herd > .cast, .trial.immersive.trial-rings > .cast, .trial.immersive.trial-dash > .cast, .trial.immersive.trial-sneak > .cast, .trial.immersive.trial-formation > .cast { display: none; }
.trial.immersive .formfield { flex: 1 1 0; min-height: 0; background: none; display: flex; align-items: center; justify-content: center; }
.trial.immersive .formfield svg { width: auto; height: 100%; max-width: 100%; max-height: 520px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }

/* Steady hands: an open hand drifts across the scene toward a warm glow. */
.trial.immersive .steady { flex: 1 1 0; height: auto; min-height: 120px; max-height: none; background: none; position: relative; }
.trial.immersive .steady .mood { top: 18%; bottom: 18%; height: auto; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(255, 214, 140, 0.55), rgba(255, 190, 90, 0.15) 60%, transparent 72%); border: 0; }
.trial.immersive .steady .mood.on { background: radial-gradient(ellipse at center, rgba(160, 230, 180, 0.6), rgba(120, 200, 150, 0.15) 60%, transparent 72%); }
.trial.immersive .steady .hand { top: 50%; width: 64px; height: 84px; margin-left: -32px; transform: translateY(-50%); background: none; border: 0; box-shadow: none; }
.trial.immersive .steady .hand svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }

/* Retorts and riddles: the line is spoken from the scene, the answers are cards to tap. */
.trial.immersive .taunt { margin: 6px auto 0; padding: 14px 18px; border-radius: 16px 16px 16px 4px; max-width: min(92%, 520px); font-family: var(--display); font-size: 20px; line-height: 1.35; }
.trial.immersive .replies { margin-top: auto; display: grid; gap: 8px; width: min(100%, 520px); align-self: center; }
.trial.immersive .replies .cta { min-height: 52px; font-weight: 600; text-align: left; justify-content: flex-start; }

/* Drawing the bow: the bow itself, large, over the scene. */
.trial.immersive .drawpit { flex: 1 1 0; background: none; display: grid; align-content: center; gap: 12px; }
.trial.immersive .drawpit .bow { width: min(100%, 420px); height: auto; justify-self: center; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); }
.trial.immersive .drawpit .meter { width: min(86%, 420px); justify-self: center; background: rgba(var(--surface-rgb), 0.6); border: 1px solid var(--gold-line); }

/* Stealth: your puppet creeps along the ground; the torchlight sweeps across the painting. */
.trial.immersive .sneakway { flex: 1 1 0; height: auto; min-height: 160px; max-height: none; background: none; overflow: visible; }
.trial.immersive .sneakway .guard { bottom: 28%; }
.trial.immersive .sneakway .guard .pp { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); height: clamp(80px, 14vh, 130px); width: auto; filter: drop-shadow(0 0 6px rgba(255, 190, 110, 0.35)); }
.trial.immersive .sneakway .guard .pp.flip { transform: translateX(-50%) scaleX(-1); }
.trial.immersive .sneakway .guard .flame { left: clamp(14px, 2.6vh, 24px); bottom: clamp(48px, 8.6vh, 80px); width: 18px; height: 18px; margin: -9px; }
.trial.immersive .sneakway .guard.left .flame { left: calc(-1 * clamp(14px, 2.6vh, 24px)); }
.trial.immersive .sneakway .guard.tell .flame { bottom: clamp(66px, 11.5vh, 106px); }
/* The way out: a soft green glow on the ground at the right, fading out inside its own box (no strip or hard edge on the painting). */
.trial.immersive .sneakway .goal { top: auto; bottom: -3%; height: 30%; width: 24%; background: radial-gradient(closest-side, rgba(150, 220, 170, 0.4), rgba(150, 220, 170, 0)); }
.trial.immersive .sneakway .me { bottom: 0; width: auto; height: auto; margin-left: -40px; background: none; box-shadow: none; border-radius: 0; }
.trial.immersive .sneakway .me .pp { height: clamp(110px, 20vh, 170px); width: auto; filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6)); }
.trial.immersive .sneakway .me.lit .pp { filter: drop-shadow(0 0 12px rgba(255, 210, 120, 0.95)); }
.trial.immersive .sneakway .me::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: -4px; height: 12px; border-radius: 50%; background: radial-gradient(closest-side, rgba(4, 2, 6, 0.75), rgba(4, 2, 6, 0)); z-index: -1; pointer-events: none; }

/* Noticing: the things lie in the scene as small cards; the question is asked from it. */
.trial.immersive .table { margin: auto 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trial.immersive .table li { border-radius: 10px; min-height: 48px; display: grid; place-items: center; text-align: center; padding: 8px; }

/* Drills: the four signs float as glass cards over the scene. */
.trial.immersive .drill { margin: auto 0; gap: 8px; }
.trial.immersive .drill .tile.lit { background: rgba(240, 148, 63, 0.75); }
.trial.immersive .drill .tile.ok { background: rgba(127, 207, 166, 0.6); } .trial.immersive .drill .tile.bad { background: rgba(255, 138, 110, 0.6); }

/* Rhythm: the beats roll along the ground to a glowing ring by your feet. */
.trial.immersive .beatlane { margin-top: auto; height: 84px; min-height: 0; background: linear-gradient(90deg, transparent, rgba(var(--surface-rgb), 0.45) 14%, rgba(var(--surface-rgb), 0.45) 86%, transparent); border: 0; }
.trial.immersive .beatlane .mark { box-shadow: 0 0 16px rgba(255, 200, 110, 0.8); } /* taste-skill-ignore: the ring glows */
.trial.immersive.trial-rhythm .btnrow { margin-top: 10px; }

/* The race, upright: the tall course painting scrolls down past you; you steer between lanes. */
.trial.immersive .track { flex: 1 1 0; height: auto; max-height: none; background-color: transparent; }
.trial.immersive .track.vertical { position: fixed; inset: 0; z-index: 0; border-radius: 0; background-size: 100% auto; background-repeat: repeat-y; overflow: hidden; }
.trial.immersive .track.vertical .bgstrip, .trial.immersive .track.vertical .lanes { display: none; }
.trial.immersive .track.vertical .me, .trial.immersive .track.vertical .ob, .trial.immersive .track.vertical .rivalcar { position: absolute; transition: left 0.18s ease; }
.trial.immersive .track.vertical .me { top: auto; bottom: calc(max(150px, var(--sab) + 140px)); width: 64px; height: 110px; margin-left: -32px; }
.trial.immersive .track.vertical .rivalcar { width: 58px; height: 100px; margin-left: -29px; transition: top 0.3s linear, left 0.18s ease; }
.trial.immersive .track.vertical .ob { width: 64px; height: 44px; margin-left: -32px; }
.trial.immersive .track.vertical .lane0 { left: 32%; } .trial.immersive .track.vertical .lane1 { left: 50%; } .trial.immersive .track.vertical .lane2 { left: 68%; }
.trial.immersive .track.vertical .veh { width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55)); }
.trial.immersive .track.vertical .chariot { margin-top: 0; transition: none; }
.trial.immersive .track.vertical .chariot.me { --cw: 64px; width: 64px; height: 110px; }
.trial.immersive .track.vertical .chariot.rivalcar { --cw: 58px; width: 58px; height: 100px; }
.trial.immersive .track.vertical .chariot .rc { transform: none; }
.trial.immersive .track.vertical .rivalcar .warnmark { top: -34%; }
.trial.immersive .track.vertical .speedx { top: calc(max(8px, var(--sat)) + 6px); right: max(12px, var(--sar)); }
.trial.immersive.trial-race .trial-body > :not(.track) { position: relative; z-index: 1; }
.trial.immersive.trial-race .progress { width: min(80%, 420px); align-self: center; }
.trial.immersive.trial-race .btnrow { margin-top: auto; }

/* Herding and the rings: the top-down painting is the field. */
.trial.immersive .herdfield { flex: 1 1 0; background: none; display: flex; align-items: center; justify-content: center; }
.trial.immersive .herdfield canvas { aspect-ratio: auto; width: auto; height: 100%; max-width: 100%; max-height: 640px; border-radius: 12px; }
.trial.immersive .dpad { align-self: center; }
.trial.immersive .ringfield { flex: 1 1 0; background: none; padding: 0; }
.trial.immersive .ringfield svg { max-height: 460px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }

/* The dice: rolled on the painted gaming cloth. */
.trial.immersive.dicegame { padding: max(10px, var(--sat)) max(14px, var(--sar)) max(12px, var(--sab)) max(14px, var(--sal)); border: 0; border-radius: 0; background: none; }
.trial.immersive.dicegame .trial-body { justify-content: center; gap: 14px; }
.trial.immersive.dicegame .game-rules { margin: 0; padding: 12px 16px; border-radius: 14px; background: rgba(var(--surface-rgb), 0.7); border: 1px solid var(--gold-line); font-size: 15px; }
.trial.immersive.dicegame .row { justify-content: center; padding: 8px 12px; border-radius: 12px; background: rgba(var(--surface-rgb), 0.45); }
.trial.immersive.dicegame .btnrow { margin-top: auto; justify-content: center; }
.trial.immersive.dicegame .throws { background: rgba(var(--surface-rgb), 0.6); border-radius: 12px; padding: 8px 12px; }

.trial.immersive .steady { margin: 0 8%; }
.trial.immersive .beatlane .beat { width: 30px; height: 30px; margin: -15px 0 0 -15px; box-shadow: 0 0 12px rgba(255, 190, 90, 0.75); } /* taste-skill-ignore: each beat glows */
.trial.immersive .beatlane .beat.off { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.trial.immersive .beatlane { flex: none; height: 84px; max-height: 84px; }

/* ---------- Fights on their painting ----------
   Full screen: the fight's name and round at the top; the two sides stand big on the painted
   ground in the middle; the sides' strength, the last lines of the fight and your moves sit on
   glass across the foot. */
body.intest .leaf.fighting.immersive { position: fixed; inset: 0; z-index: 20; width: auto; max-width: none; height: auto; max-height: none; margin: 0; border-radius: 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  padding: max(8px, var(--sat)) max(12px, var(--sar)) 0 max(12px, var(--sal)); }
body.intest .leaf.fighting.immersive > .pagehead { display: flex !important; grid-row: 1; grid-column: 1; justify-content: center; text-align: center; padding: 4px 8px 0; }
.leaf.fighting.immersive > .pagehead .ppbadge, .leaf.fighting.immersive > .pagehead small { display: none; }
.leaf.fighting.immersive > .pagehead .ph-line { justify-content: center; }
.leaf.fighting.immersive > .pagehead h1 { font-size: 22px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); } /* taste-skill-ignore: a title over the painting */
.leaf.fighting.immersive > .pagehead .kind { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.leaf.fighting.immersive > .arena { grid-row: 2; grid-column: 1; height: auto; margin: 0; background: none; overflow: visible; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 2% 2vh; }
.leaf.fighting.immersive > .arena::before { display: none; }
/* The figures are as tall as the screen allows, and never so tall that two to a side run off its edges. */
.leaf.fighting.immersive > .arena { --ah: clamp(140px, min(31vh, 53vw), 310px); }
.leaf.fighting.immersive > .arena .actor svg { height: var(--ah); filter: drop-shadow(0 0 10px rgba(255, 196, 110, 0.45)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6)); }
.leaf.fighting.immersive > .arena .actor.ally svg { height: calc(var(--ah) * 0.82); }
.leaf.fighting.immersive > .arena .actor.ally.champ svg { height: var(--ah); opacity: 1; }
/* A soft shadow on the ground under each fighter. */
.leaf.fighting.immersive > .arena .actor::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 14px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 70%); pointer-events: none; }
.leaf.fighting.immersive > .arena .actor.enemy + .actor.enemy svg { height: calc(var(--ah) * 0.89); }
.leaf.fighting.immersive > #battle-body { grid-row: 3; grid-column: 1; margin: 0 calc(-1 * max(12px, var(--sar))) 0 calc(-1 * max(12px, var(--sal))); max-height: 54vh;
  padding: 6px max(12px, var(--sar)) max(12px, var(--sab)) max(12px, var(--sal)); }
/* Over the painting: labels lit like the score in a test, each side's cards kept to their lines, no empty log before the first blow. */
.leaf.fighting.immersive #battle-body .side .lbl { color: #f6e7c8; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.6); }
.leaf.fighting.immersive .unit { background: rgba(var(--surface-rgb), 0.86); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.leaf.fighting.immersive .unit .nm em, .leaf.fighting.immersive .unit .intent { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaf.fighting.immersive .unit .intent { display: block; }
.leaf.fighting.immersive .unit .intent::before { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.leaf.fighting.immersive #battle-body > .blog { background: rgba(var(--surface-rgb), 0.8); }
#battle-body > .blog:empty { display: none; }
.leaf.fighting.immersive .act { background: rgba(var(--surface-rgb), 0.9); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
@media (min-width: 721px) and (min-height: 521px) { .leaf.fighting.immersive > #battle-body { width: min(820px, 100%); margin: 0 auto; } }
/* Wide screens: the fight stands on the painting at the left, big; the sides and your moves run down
   a shaded band at the right, so the figures are not squeezed into a strip above the cards. */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  body.intest .leaf.fighting.immersive { grid-template-columns: minmax(0, 1fr) clamp(360px, 34vw, 500px); grid-template-rows: auto minmax(0, 1fr); }
  body.intest .leaf.fighting.immersive > .pagehead { grid-column: 1; grid-row: 1; }
  .leaf.fighting.immersive > .arena { grid-column: 1; grid-row: 2; padding: 0 5% 7vh; --ah: clamp(180px, min(52vh, 24vw), 430px); }
  body.intest .leaf.fighting.immersive > #battle-body { grid-column: 2; grid-row: 1 / span 2; width: auto; max-height: none; align-self: stretch; overflow-y: auto; justify-content: center;
    margin: calc(-1 * max(8px, var(--sat))) calc(-1 * max(12px, var(--sar))) 0 0; padding: max(18px, var(--sat)) max(18px, var(--sar)) max(18px, var(--sab)) 28px;
    background: linear-gradient(to right, rgba(16, 6, 4, 0), rgba(16, 6, 4, 0.72) 16%, rgba(16, 6, 4, 0.82)) !important; } /* taste-skill-ignore: a shaded band over the painting */
  body.intest .leaf.fighting.immersive #battle-body .sides { grid-template-columns: minmax(0, 1fr); }
  body.intest .leaf.fighting.immersive #battle-body > .sides { flex: none; max-height: none; overflow: visible; }
  body.intest .leaf.fighting.immersive > .arena .team .actor + .actor { margin-left: -4vw; }
}
/* During a test or a fight the painting is shown sharp, even an older narrow one. */
body.intest .backdrop:not(.fitted) .bdl[data-flat="1"] .pic { opacity: 1; }
.leaf.fighting.immersive > .arena .team.left .actor + .actor, .leaf.fighting.immersive > .arena .team.right .actor + .actor { margin-left: -9vw; }
.leaf.fighting.immersive .act:hover:not(:disabled), .leaf.fighting.immersive .unit.enemy:hover:not(:disabled) { background: var(--hover); }
/* Two buttons side by side under the thumbs: steer left, steer right. */
.trial.immersive.trial-race .btnrow { flex-wrap: nowrap; gap: 12px; }
.trial.immersive.trial-race .btnrow .trial-press { min-width: 0; flex: 1 1 0; max-width: 220px; }
/* The rings: choose a ring and turn it, four buttons in two rows. */
.trial.immersive.trial-rings .btnrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(100%, 440px); align-self: center; }
.trial.immersive.trial-rings .btnrow .trial-press, .trial.immersive.trial-rings .btnrow .cta { min-width: 0; width: 100%; }
/* A fight's cards keep to their half: a long name gives way to its strength. */
.leaf.fighting.immersive #battle-body .sides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.leaf.fighting.immersive .unit { grid-template-columns: minmax(0, 1fr); min-width: 0; }
/* Herding's arrows: big square keys under the thumb. */
.trial.immersive .dpad { grid-template-columns: repeat(3, 68px); grid-template-rows: repeat(2, 56px); gap: 8px; }
.trial.immersive .dpad button { width: 100%; height: 100%; min-width: 0; background: rgba(var(--surface-rgb), 0.88); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
/* The flash layer covers the stage and takes no room among the figures (so the two sides stand at the two edges). */
.arena-flash { position: absolute; inset: 0; pointer-events: none; }

/* ---------- Divine weapons (ui/fx.js) ---------- */
.astra-fx { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.astra-fx > i, .astra-fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.astra-fx .ax-dark { background: rgba(8, 3, 2, 0.6); animation: ax-in 0.35s ease-out both; }
.astra-fx .ax-tint { opacity: 0; mix-blend-mode: screen; }
.astra-fx.flash .ax-tint { animation: ax-tint 1.1s ease-out both; }
.astra-fx .ax-mantra { inset: auto 10% 58% 10%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #fff3c8, #ffd680, #fff3c8, transparent); box-shadow: 0 0 18px 4px rgba(255, 214, 128, 0.7); transform: scaleX(0); animation: ax-mantra 0.6s ease-out 0.1s both; } /* taste-skill-ignore: the mantra as a line of light */
.astra-fx.flash::after { content: ""; position: absolute; inset: 0; background: #fffaf0; animation: ax-flash 0.45s ease-out both; }
.astra-fx.out { opacity: 0; transition: opacity 0.4s; }
.astra-fx.still::after { content: ""; position: absolute; inset: 0; background: #fffaf0; animation: ax-soft 0.7s ease-out both; }
@keyframes ax-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ax-tint { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0.5; } }
@keyframes ax-mantra { 0% { transform: scaleX(0); opacity: 0; } 50% { opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes ax-flash { from { opacity: 0.85; } to { opacity: 0; } }
@keyframes ax-soft { 0% { opacity: 0; } 40% { opacity: 0.35; } 100% { opacity: 0; } }
body.ax-shake #leaf { animation: ax-shake 0.38s ease-out; }
@keyframes ax-shake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-6px, 3px); } 45% { transform: translate(5px, -3px); } 70% { transform: translate(-3px, 2px); } }
.arena .actor.ax-pushed { transform: translateX(40px); transition: transform 0.5s ease-out; }
.arena .actor.ax-slump svg { filter: grayscale(0.4) brightness(0.8); }
html.calm body.ax-shake #leaf { animation: none; }

/* ---------- Meeting a blow: jump, duck, sidestep, block ---------- */
.qte-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qte-btns .trial-press, .qte-btns > * { min-width: 0; width: 100%; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
/* In a fight's narrow side panel on a wide screen, four buttons in a row: keep every label whole. */
.qte { container-type: inline-size; }
@media (min-width: 561px) { @container (max-width: 520px) { .qte-btns { gap: 6px; } .qte-btns .trial-press, .qte-btns > * { font-size: 14.5px; padding-left: 4px; padding-right: 4px; } } }
@media (max-width: 560px) { .qte-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.arena .incoming { position: absolute; z-index: 3; width: 74px; height: 22px; margin: -11px 0 0 -37px; color: #2a160c; pointer-events: none; transform: translateX(0); opacity: 0; filter: drop-shadow(0 0 6px rgba(255, 200, 120, .7)) drop-shadow(0 3px 2px rgba(0, 0, 0, .5)); }
.arena .incoming svg { width: 100%; height: 100%; fill: #6b3a1c; stroke: #e9c98a; stroke-width: 1.4; }
.arena .incoming.blade { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
.arena .incoming.blade svg .arc { fill: #e0553a; stroke: #ffe0b0; stroke-width: 1.6; }
.arena .incoming.blade svg .streak { stroke: rgba(255, 196, 140, 0.8); stroke-width: 2.2; stroke-linecap: round; }
.arena .incoming.charge { width: 70px; height: 44px; margin: -22px 0 0 -35px; }
.arena .incoming.go { opacity: 1; transform: translateX(var(--to)); transition: transform var(--dur) linear, opacity .15s; }
.arena .incoming.gone { opacity: 0; transition: opacity .25s; }
.arena .actor.act-jump { animation: act-jump .76s cubic-bezier(.3, .7, .4, 1); }
.arena .actor.act-duck { animation: act-duck .76s ease-out; }
.arena .actor.act-side { animation: act-side .76s ease-out; }
/* While in the air the shadow stays on the ground, smaller. */
.arena .actor.act-jump::before { animation: act-shadow .76s ease-out; }
@keyframes act-shadow { 0%, 100% { transform: translateY(0) scale(1); opacity: 1; } 35%, 60% { transform: translateY(calc(var(--ah, 160px) * 0.5)) scale(.6); opacity: .5; } }
/* The evasive poses: knees tucked in the air, a deep crouch, a step back leaning away. */
.pose-jump .legF { transform: rotate(-78deg); } .pose-jump .shinF { transform: rotate(104deg); } .pose-jump .legB { transform: rotate(-48deg); } .pose-jump .shinB { transform: rotate(96deg); } .pose-jump .armF { transform: rotate(-150deg); } .pose-jump .armB { transform: rotate(-130deg); }
.pose-duck .pp-body { transform: translateY(40px) rotate(14deg); } .pose-duck .legF { transform: rotate(-100deg); } .pose-duck .shinF { transform: rotate(124deg); } .pose-duck .legB { transform: rotate(18deg); } .pose-duck .shinB { transform: rotate(120deg); } .pose-duck .head { transform: rotate(18deg); } .pose-duck .armF { transform: rotate(-60deg); } .pose-duck .foreF { transform: rotate(-90deg); }
.pose-side .pp-body { transform: rotate(-16deg); } .pose-side .legF { transform: rotate(26deg); } .pose-side .legB { transform: rotate(-30deg); } .pose-side .armF { transform: rotate(40deg); } .pose-side .head { transform: rotate(-10deg); }
.arena .incoming.past { transform: translateX(calc(var(--to) - 220px)); opacity: 0; transition: transform .45s linear, opacity .45s ease-in; }
@keyframes act-jump { 0% { transform: translateY(0); } 35% { transform: translateY(-48%); } 60% { transform: translateY(-50%); } 100% { transform: translateY(0); } } /* a hop with a little hang at the top */
@keyframes act-duck { 0%, 100% { transform: translateY(0); } 25%, 75% { transform: translateY(6%); } }
@keyframes act-side { 0%, 100% { transform: translateX(0); } 30%, 70% { transform: translateX(-60%); } }
html.calm .arena .incoming, html.calm .arena .actor.act-jump, html.calm .arena .actor.act-duck svg, html.calm .arena .actor.act-side { animation: none !important; transition: none !important; }

/* ---------- The puppet, closer to the craft ---------- */
.pp .main-rod { pointer-events: none; }
.pp.glow .pp-all { filter: drop-shadow(0 0 3px rgba(255, 214, 128, 0.95)) drop-shadow(0 0 1px rgba(255, 240, 200, 0.9)); }
/* Dangling limbs sway a little when the figure stands. */
:where(html:not(.calm)) .pose-stand .foreB { animation: pp-sway 3.2s ease-in-out infinite; }
:where(html:not(.calm)) .pose-stand .shinB { animation: pp-sway 4.1s ease-in-out infinite reverse; }
:where(html:not(.calm)) .pose-tremble .pp-all { animation: pp-tremble 0.18s linear infinite; }
@keyframes pp-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg); } }
@keyframes pp-tremble { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-0.6px, 0.3px); } 75% { transform: translate(0.6px, -0.3px); } }
/* Hands folded (namaskara), a bow, shame (the face turned down and away), trembling. */
.pose-fold .armF { transform: rotate(-38deg); } .pose-fold .foreF { transform: rotate(-118deg); } .pose-fold .armB { transform: rotate(-30deg); } .pose-fold .foreB { transform: rotate(-120deg); }
.pose-bow .head { transform: rotate(24deg); } .pose-bow .pp-body { transform: rotate(6deg); } .pose-bow .armF { transform: rotate(-38deg); } .pose-bow .foreF { transform: rotate(-118deg); } .pose-bow .armB { transform: rotate(-30deg); } .pose-bow .foreB { transform: rotate(-120deg); }
.pose-shame .head { transform: rotate(32deg); } .pose-shame .pp-body { transform: rotate(8deg) translateY(2px); } .pose-shame .armF { transform: rotate(-120deg); } .pose-shame .foreF { transform: rotate(-110deg); } .pose-shame .armB { transform: rotate(10deg); }
.pose-tremble .armF { transform: rotate(4deg); } .pose-tremble .foreF { transform: rotate(-30deg); } .pose-tremble .head { transform: rotate(8deg); }
/* The sutradhara opens each act, bowing, beside its name. */
.beat-act .b-sutra { display: block; margin: 0 auto 8px; height: clamp(90px, 16vh, 150px); width: auto; }
.beat-act .b-sutra svg { height: 100%; width: auto; filter: drop-shadow(0 0 10px rgba(255, 196, 110, 0.5)); }
.track .me > * { transition: transform 0.25s ease-out; }
.track .me.lean-u > * { transform: rotate(-7deg); } .track .me.lean-d > * { transform: rotate(6deg); }
/* Wrestlers lock: in the push test the two figures close and lean into each other. */
.trial.immersive.trial-push > .cast .actor.me .pp { transform-origin: 50% 100%; }
.trial.immersive.trial-push > .cast .actor.foe { margin-left: -7vw; }
/* The frightened horse in Karna's test: a leather puppet in place of the glow. */
.steady.with-horse .mood { opacity: 0; }
.steady.with-horse { --hw: clamp(150px, 34vw, 240px); }
.steady .horse { position: absolute; bottom: 0; width: var(--hw); margin-left: calc(var(--hw) * -0.2); transition: left 0.08s linear; z-index: 1; }
.steady .horse svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 8px rgba(255, 196, 110, 0.45)) drop-shadow(0 5px 4px rgba(0, 0, 0, 0.55)); }
.steady .horse.left svg { transform: scaleX(-1); transform-origin: 20% 50%; }
.steady .horse .h-all, .steady .horse .h-neck, .steady .horse .h-legF, .steady .horse .h-legB, .steady .horse .h-tail { transform-box: view-box; transition: transform 0.35s cubic-bezier(.3, .7, .3, 1); }
.steady .horse .h-all { transform-origin: 90px 14px; }
.steady .horse .h-neck { transform-origin: 20px -32px; }
.steady .horse .h-legF { transform-origin: 20px -16px; }
.steady .horse.rear .h-all { transform: rotate(18deg); } .steady .horse.rear .h-legF { transform: rotate(-34deg); }
.steady .horse.toss .h-neck { animation: h-toss 0.7s ease-in-out infinite; }
.steady .horse.calm .h-neck { transform: rotate(-22deg); }
.steady .horse.touched svg { filter: drop-shadow(0 0 12px rgba(160, 230, 180, 0.8)) drop-shadow(0 5px 4px rgba(0, 0, 0, 0.55)); }
@keyframes h-toss { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(14deg); } }
.trial.immersive .steady.with-horse .hand { top: auto; bottom: calc(var(--hw) * 0.42); transform: none; z-index: 2; }
.trial.immersive.trial-steady:has(.with-horse) > .cast .actor.me { display: none; } /* you are the hand on the horse's head */
html.calm .steady .horse .h-neck { animation: none !important; }

/* ---- Practice ground ---- */
/* The ground (ui/practice.js): the teacher with a tip, how the last try went, the speed, and a tile
   for every kind of test, the ones not met yet locked. Sparring and reading the blow sit at the foot. */
.pr-coach { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 4px 14px; }
.pr-coach .pr-teach { display: block; line-height: 0; }
.pr-coach .pr-teach svg { height: 112px; width: auto; overflow: visible; filter: drop-shadow(0 0 8px rgba(255, 196, 110, 0.4)) drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5)); } /* taste-skill-ignore: the puppet lit from behind, as on a shadow-puppet screen */
.pr-coach.small .pr-teach svg { height: 84px; }
.pr-coach .pr-say { display: grid; gap: 2px; min-width: 0; padding-bottom: 8px; }
.pr-coach .pr-who { font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--data); }
.pr-coach .pr-line { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.28; color: var(--ink); max-width: 46ch; }
.pr-coach.small .pr-line { font-size: 18px; }
.pr-coach .pr-line.step { color: #ffe3a3; }
:where(html:not(.calm)) .pr-coach .pr-line.step { animation: risein 0.4s ease both; }
.pr-coach .pr-show { justify-self: start; margin-top: 4px; }
.pr-show:disabled { opacity: 0.55; cursor: default; }
html[lang="hi"] .pr-coach .pr-line { line-height: 1.55; font-size: 19px; }
.pr-result { gap: 6px; }
.pr-result p { margin: 0; }
.pr-result .pr-what { font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pr-result .pr-res-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.pr-result b { font-family: var(--display); font-size: 22px; margin-right: 6px; }
.pr-result.win b { color: #ffe3a3; } .pr-result.lose b { color: #ffb4a0; }
.pr-result .pr-again { min-height: 40px; padding: 8px 20px; font-size: 15.5px; background: var(--hover); border: 1px solid var(--gold-line); }
/* The ground's two big things side by side on a wide page, the way out under them. */
@media (min-width: 721px) and (min-height: 521px) {
  .leaf.pr-lobby .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaf.pr-lobby .choices > .pr-leave { grid-column: 1 / -1; }
}
.modal #m-practice-f { margin: 6px 0 14px; }
.pr-lbl { font-size: 19px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 8px; }
.pr-tile { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 54px; padding: 8px 12px; border: 0; border-radius: var(--r-card);
  background: var(--raised); color: var(--ink); text-align: left; cursor: pointer; font-size: 15.5px; font-weight: 700; line-height: 1.25; transition: background-color 0.15s, transform 0.15s; }
.pr-tile svg { grid-row: span 2; width: 24px; height: 24px; fill: none; stroke: var(--data); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pr-tile small { font-size: 12.5px; font-weight: 400; line-height: 1.3; color: var(--muted); }
.pr-tile small:empty { display: none; }
.pr-tile:hover:not(:disabled) { background: var(--hover); transform: translateY(-1px); }
.pr-tile:disabled { cursor: default; background: transparent; box-shadow: inset 0 0 0 1px rgba(226, 181, 90, 0.24); color: var(--faint); }
.pr-tile:disabled svg { stroke: var(--faint); opacity: 0.55; }
.pr-tile:disabled small { color: var(--faint); }
.pr-speed { font-size: 15px; }
.pr-row { justify-content: flex-start; }
.pr-fig { line-height: 0; }
.pr-fig svg { height: 72px; width: auto; overflow: visible; filter: drop-shadow(0 0 5px rgba(255, 196, 110, 0.35)); }
.leaf.pr-page .actions .pr-leave { justify-self: start; }
/* On the card of rules before a test: the teacher, the speed, and "Show me" beside "Begin". */
.trial .pr-coach { margin-top: 2px; }
.trial .pr-coach .pr-line { font-size: 17px; }
.trial .pr-speed { font-size: 14.5px; }
.trial .pr-speed small { font-size: 13px; }
/* The dice games have no card of rules: the teacher stands on glass above the game. */
.trial.immersive > .pr-coach { position: relative; z-index: 3; align-self: start; justify-self: center; width: min(620px, 100%); margin: 0 0 8px; padding: 6px 14px 4px;
  border-radius: 14px; background: rgba(var(--surface-rgb), 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid var(--gold-line); }
.trial.immersive > .pr-coach .pr-teach svg { height: 64px; }
.trial.immersive > .pr-coach .pr-say { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.trial.immersive > .pr-coach .pr-who { grid-column: 1 / -1; font-size: 15px; }
.trial.immersive > .pr-coach .pr-line { font-size: 16px; }
/* Reading the blow: the fight's own screen, with a card of its own and a tally. */
.pr-drill #battle-actions { display: grid; gap: 8px; }
.leaf.pr-drill > #battle-body { justify-content: flex-end; } /* a shorter card sits by the thumbs, where the blows were met */
.pr-drill .pr-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; }
.pr-drill .pr-score { margin: 0; text-align: center; padding: 5px 14px; border-radius: 999px; background: rgba(var(--surface-rgb), 0.78); border: 1px solid var(--gold-line); font-size: 14px; }
.pr-drill .pr-score:empty { display: none; }
.pr-drill .pr-stop { min-height: 36px; padding: 4px 14px; font-size: 14px; background: rgba(var(--surface-rgb), 0.78); border: 1px solid var(--gold-line); border-radius: 999px; color: var(--ink); }
.pr-drill .qte-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pr-drill .pr-card .game-rules { margin: 0; font-size: 15.5px; color: var(--muted); }
.pr-drill .qte-btns button:disabled:not(.pr-hint) { opacity: 0.45; }
.qte-btns .pr-hint { background: var(--accent) !important; color: var(--accent-ink) !important; box-shadow: 0 0 0 2px #ffe3a3, 0 0 18px rgba(255, 214, 128, 0.6); } /* taste-skill-ignore: the move the teacher shows, lit */
/* A practice bout: stopped from beside its name (the fight's own row of ways out is not needed). */
body.pr-bout .battle-tools { display: none; }
.leaf.fighting > .pagehead .pr-bout-stop { min-height: 34px; padding: 3px 14px; font-size: 14px; border-radius: 999px; color: var(--ink); background: rgba(var(--surface-rgb), 0.78); border: 1px solid var(--gold-line); }
/* Slow and normal speed: what flies at you flies as slowly as the clock now runs. */
body.pr-slow .arena .incoming.go { transition-duration: calc(var(--dur) / var(--pr-f, 1)), 0.15s; }
/* The ways in: beside a second chance, and after a lost fight. */
.practice-offer { width: 100%; display: grid; gap: 1px; justify-items: start; text-align: left; min-height: 48px; padding: 10px 16px; border-radius: var(--r-card);
  border: 1px dashed var(--gold-line); background: transparent; color: var(--ink); cursor: pointer; transition: background-color 0.15s; }
.practice-offer .t { font-weight: 700; font-size: 16px; line-height: 1.3; }
.practice-offer small { font-size: 13.5px; color: var(--muted); }
.practice-offer:hover { background: var(--raised); }
.practice-after { display: grid; justify-items: start; gap: 1px; text-align: left; justify-self: start; padding: 8px 12px; }
.practice-after .t { color: var(--ink); font-weight: 700; }
.practice-after small { font-size: 13px; color: var(--faint); }
@media (max-width: 720px), (max-height: 520px) {
  .pr-coach { column-gap: 10px; }
  .pr-coach .pr-teach svg { height: 78px; }
  .pr-coach.small .pr-teach svg { height: 64px; }
  .pr-coach .pr-who { font-size: 15px; }
  .pr-coach .pr-line, .pr-coach.small .pr-line, .trial .pr-coach .pr-line { font-size: 16px; }
  .pr-result b { font-size: 19px; }
  .pr-lbl { font-size: 17px; }
  .pr-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 6px; }
  .pr-tile { min-height: 46px; padding: 6px 10px; font-size: 14px; column-gap: 8px; grid-template-columns: 22px minmax(0, 1fr); }
  .pr-tile svg { width: 21px; height: 21px; }
  .pr-tile small { font-size: 11.5px; }
  .pr-speed, .trial .pr-speed { font-size: 14px; } .pr-speed small, .trial .pr-speed small { font-size: 12.5px; }
  .pr-fig svg { height: 52px; }
  .pr-result .pr-again { min-height: 38px; padding: 6px 16px; font-size: 14.5px; }
  .practice-offer { min-height: 44px; padding: 8px 12px; } .practice-offer .t { font-size: 14.5px; } .practice-offer small { font-size: 12.5px; }
  .pr-drill .pr-card .game-rules { font-size: 14px; }
  .pr-drill .qte { gap: 8px; padding: 10px 12px; }
  .pr-drill .qte-ring { height: 84px; }
  .pr-drill .qte-note { font-size: 14px; min-height: 1.3em; }
}

/* ---- The army battle (ui/army.js) ---- */
.linebar { height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .35); border: 1px solid var(--gold-line); overflow: hidden; }
.linebar i { display: block; height: 100%; width: 100%; background: var(--positive); transition: width .5s ease, background .5s; }
.linebar i.mid { background: var(--data); } .linebar i.low { background: var(--negative); }
.army-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.army-btns .trial-press { min-width: 0; width: 100%; padding-left: 6px; padding-right: 6px; white-space: nowrap; font-size: 15px; }
@media (max-width: 560px) { .army-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.armyfield .mark.reserve circle { stroke: #9ad0ff; stroke-dasharray: 2 3; }
.armyfield .unit.placed { color: #fff1cf; }
/* ---- The breath test (the Varunastra's quest, ui/breath.js) ---- */
.lake { position: relative; flex: 1 1 0; min-height: 220px; border-radius: var(--r-card); overflow: hidden; background: linear-gradient(to bottom, rgba(40, 90, 120, 0.25), rgba(6, 18, 34, 0.85)); }
.trial.immersive .lake { margin: 0 4%; border-radius: var(--r-card); }
.lake .depth { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 10%, #06101c 100%); opacity: 0.2; pointer-events: none; }
.lake .vessel { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; transition: left 0.3s linear, top 0.3s linear; filter: drop-shadow(0 0 14px rgba(255, 210, 120, 0.9)); }
.lake .vessel svg { width: 100%; height: 100%; }
.lake .vessel.held { filter: drop-shadow(0 0 20px rgba(160, 230, 180, 0.95)); }
.lake .diver { position: absolute; width: 70px; height: 130px; margin: -20px 0 0 -35px; transition: left 0.25s linear, top 0.25s linear; transform: rotate(14deg); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.lake .diver.rising { transform: rotate(-6deg); }
.lake .diver svg { width: 100%; height: 100%; }
.lake.got { box-shadow: inset 0 0 0 3px var(--positive); } .lake.lost { box-shadow: inset 0 0 0 3px var(--negative); }
.breath { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-control); background: rgba(0, 0, 0, 0.3); font-size: 14px; color: var(--muted); }
.breath i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #8ad0e0, #cfeefc); width: 100%; transition: width 0.1s linear; }
.breath.low i { background: var(--negative); }
.trial.immersive .breath { margin: 0 4%; }
/* On the painting the dive is played in the water: score, note and breath above the surface, the lake
   box from the painting's waterline (--wl, set in breath.js) down to the button, clear so the
   underwater painting shows through. */
.trial.immersive.trial-breath.underwater .score { order: 0; } .trial.immersive.trial-breath.underwater .game-note { order: 1; } .trial.immersive.trial-breath.underwater .breath { order: 2; }
.trial.immersive.trial-breath.underwater .lake { position: fixed; top: var(--wl, 46vh); bottom: max(86px, calc(var(--sab) + 80px)); left: max(4%, var(--sal)); right: max(4%, var(--sar)); margin: 0; min-height: 0; flex: none; background: linear-gradient(to bottom, rgba(10, 40, 60, 0) 0%, rgba(6, 18, 34, 0.35) 100%); border: 1px solid rgba(160, 220, 240, 0.25); }
.trial.immersive.trial-breath.underwater .btnrow { order: 4; margin-top: auto; }
/* ---- The puppet speaks, turns, and keeps its distance (PRD §18.9) ---- */
.pp .jaw { transform-origin: 56px 60px; }
.pp.talk .jaw { animation: pp-talk .26s ease-in-out infinite alternate; }
@keyframes pp-talk { from { transform: rotate(0deg); } to { transform: rotate(7deg) translateY(.6px); } }
/* The turn: the figure flips to face the other way; the rods stay where the puppeteer holds them. */
.pp.pose-turn .pp-body { transform: scaleX(-1); transform-origin: 60px 120px; transition: transform .35s ease-in; }
.pp.pose-turn .legF { animation: pp-legF 0.7s ease-in-out infinite alternate; } .pp.pose-turn .legB { animation: pp-legB 0.7s ease-in-out infinite alternate; }
/* Light and distance: an enemy far from you is a little larger and a shade darker; leather on the screen stays solid. */
#arena .actor.enemy.far .pp { filter: brightness(.95); transform: scale(1.06); transform-origin: 50% 100%; transition: filter .35s, opacity .35s, transform .35s; }
/* A flipped enemy (they all face you) keeps facing you when far: the scale must carry the mirror too. */
#arena .actor.enemy.far .pp.flip { transform: scale(-1.06, 1.06); }
#arena .actor.enemy .pp { transition: filter .25s, opacity .25s, transform .25s; }
/* Age: elders stoop a little more, and their hair and beard have gone grey. */
.pose-stand.st-elder .pp-body { transform: rotate(7deg) translateY(1px); }
.call-help small.call-note { display: inline; font-size: 12px; opacity: .8; margin-left: 6px; }
.call-help small.call-note::before { content: "· "; }
html.calm .pp.talk .jaw, html.calm .pp.pose-turn .legF, html.calm .pp.pose-turn .legB { animation: none; }
.said.with-fig .said-fig { width: 48px; height: 72px; display: grid; place-items: end center; overflow: visible; }
.said.with-fig .said-fig svg { height: 72px; width: auto; }
/* The teacher's hint in a board game at the practice ground. */
.pr-hint { outline: 3px solid #ffd680; outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 14px rgba(255, 214, 128, .7); }
svg .pr-hint { outline: none; filter: drop-shadow(0 0 6px #ffd680) drop-shadow(0 0 2px #ffd680); }
.pr-hintrow { margin: 6px 0 0; text-align: center; font-size: 14px; color: #f3d27a; }
.lifemet { display: block; color: var(--muted); font-size: 13px; margin: 0 0 8px; }
/* A full-screen test sits inside the page's actions box: the box's own dark background must not show as a band behind the test's name. */
.leaf.testing .actions { background: transparent; box-shadow: none; }
/* The menu's columns size to their content; the Saving field does not stretch to the Settings column's height. */
.grid2 > .field { align-content: start; }
/* Meeting a blow in a fight on a short screen: the ring, the note and the four moves must all fit above the home bar. */
@media (max-height: 760px), (max-width: 560px) {
  #battle-actions .qte { gap: 8px; padding: 10px 12px; }
  #battle-actions .qte-who { font-size: 15px; }
  #battle-actions .qte-ring { height: 76px; }
  #battle-actions .qte-ring .ring { width: 130px; height: 130px; }
  #battle-actions .qte-note { font-size: 13.5px; line-height: 1.35; }
  #battle-actions .qte-btns .trial-press, #battle-actions .qte-btns > * { min-height: 48px; padding-top: 6px; padding-bottom: 6px; font-size: 15px; }
}
@media (max-width: 560px) and (max-height: 760px) { #battle-actions .qte-btns { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } #battle-actions .qte-btns .trial-press, #battle-actions .qte-btns > * { font-size: 13px; padding-left: 2px; padding-right: 2px; } }
/* Wide screens: when a friend's card makes the band too tall, the sides scroll and your moves stay at the foot (none cut off top or bottom). */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  body.intest .leaf.fighting.immersive > #battle-body { justify-content: safe center; overflow-y: hidden; }
  body.intest .leaf.fighting.immersive #battle-body > .sides { flex: 0 1 auto; min-height: 64px; overflow-y: auto; overscroll-behavior: contain; }
}
/* Short phones held upright: the moves and the call for help get a little more of the screen; the painting gives it up. */
@media (max-width: 560px) and (max-height: 700px) { .leaf.fighting.immersive > #battle-body { max-height: 60vh; } }
/* ---- The night the lac house burns: the plan of the house, and the cellar ---- */
.lacplan, .laccellar { display: grid; justify-items: center; padding: 6px; border-radius: var(--r-control); background: radial-gradient(circle, #4a2a1a, #221209); }
.lacplan svg, .laccellar svg { width: min(100%, 380px); height: auto; touch-action: none; overflow: visible; }
.trial.immersive.trial-escape > .cast, .trial.immersive.trial-fuse > .cast { display: none; }
.trial.immersive .lacplan, .trial.immersive .laccellar { flex: 1 1 0; min-height: 0; background: none; display: flex; align-items: center; justify-content: center; }
.trial.immersive .lacplan svg, .trial.immersive .laccellar svg { width: auto; height: 100%; max-width: 100%; max-height: 520px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.lacplan rect.room { fill: rgba(30, 18, 10, .38); stroke: #c9a06a; stroke-width: .6; cursor: pointer; }
.lacplan rect.smoke { fill: rgba(70, 62, 58, .72); stroke: #c9a06a; stroke-width: .6; cursor: pointer; animation: lac-smoke 1.6s ease-in-out infinite alternate; }
.lacplan rect.fire { fill: #c0472f; stroke: #ffb04a; stroke-width: .8; animation: lac-fire .5s steps(2) infinite alternate; }
@keyframes lac-smoke { from { fill: rgba(70, 62, 58, .6); } to { fill: rgba(96, 88, 84, .82); } }
@keyframes lac-fire { from { fill: #c0472f; } to { fill: #e06a2a; } }
.lacplan .wall { stroke: #f3d9a4; stroke-width: 1.6; stroke-linecap: square; }
.lacplan .door.stuck { stroke: #8a5a2a; stroke-width: 2.4; stroke-dasharray: 2 1.2; }
.lacplan .tunnel ellipse { fill: #120a06; stroke: #f3d9a4; stroke-width: 1; }
.lacplan .tunnel path { fill: none; stroke: #f3d9a4; stroke-width: .8; }
.lacplan .sleeper ellipse { fill: #d9c9a6; stroke: #3a2614; stroke-width: .6; }
.lacplan .sleeper circle { fill: #c9813f; stroke: #3a2614; stroke-width: .6; }
.lacplan .flames path { fill: #ffd27a; opacity: .9; animation: lac-flame .4s ease-in-out infinite alternate; transform-origin: 0 5px; }
@keyframes lac-flame { from { transform: scaleY(1); } to { transform: scaleY(1.25) scaleX(.9); } }
.lacplan .me circle { fill: #3b6fb0; stroke: #fff1cf; stroke-width: 1; }
.lacplan .me .carried { fill: #d9c9a6; }
.lacplan .hold { fill: none; stroke: #ffd680; stroke-width: 1.6; transform: rotate(-90deg); transform-box: fill-box; transform-origin: center; }
.lac-btns, .fuse-btns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fuse-btns { grid-template-columns: 1fr; }
.trial.immersive .btnrow.lac-btns { width: min(100%, 560px); align-self: center; }
.trial.immersive .lac-btns .trial-press { min-width: 0; width: 100%; padding-left: 4px; padding-right: 4px; white-space: nowrap; font-size: 17px; }
.trial.immersive .fuse-btns .trial-press { width: min(100%, 420px); justify-self: center; }
.laccellar .floor { fill: rgba(20, 12, 6, .5); stroke: #c9a06a; stroke-width: .6; }
.laccellar .lamp { fill: #ffd680; filter: drop-shadow(0 0 6px rgba(255, 214, 128, .9)); }
.laccellar .light { fill: rgba(255, 200, 120, .07); transition: fill .15s; }
.laccellar .light.soon { fill: rgba(255, 200, 120, .16); }
.laccellar .light.on { fill: rgba(255, 214, 140, .36); } /* the light is on the lines: Cut is seen (owner, 5 November) */
.fuse-btns .trial-press { transition: background-color .15s, box-shadow .15s; }
.fuse-btns .trial-press.dark { box-shadow: 0 0 0 3px rgba(120, 200, 120, .55); }
.fuse-btns .trial-press.soon { box-shadow: 0 0 0 3px rgba(255, 196, 80, .9); }
.fuse-btns .trial-press.lit { background-color: #8a4a30; box-shadow: 0 0 0 3px rgba(230, 90, 60, .8); }
.laccellar .oil { fill: none; stroke: #6b4a2a; stroke-width: 2.2; stroke-linecap: round; cursor: pointer; }
.laccellar .oil.chosen { stroke: #ffb04a; filter: drop-shadow(0 0 3px rgba(255, 176, 74, .8)); }
.laccellar .oil.cut { stroke: #5a4a3a; stroke-dasharray: 3 3; opacity: .6; }
.laccellar .room rect { fill: rgba(60, 40, 24, .9); stroke: #c9a06a; stroke-width: .6; }
.laccellar .cutpt { fill: #fff1cf; stroke: #ffb04a; stroke-width: .8; }
.laccellar .snip { stroke: #fff1cf; stroke-width: 1.2; }
.laccellar .firept circle { fill: #c0472f; } .laccellar .firept path { fill: #ffd27a; }
@media (max-width: 560px) { .trial.immersive .lac-btns .trial-press { font-size: 14px; min-height: 48px; } }
/* Short phones with seven or more moves (a divine weapon adds one): the cards drop their one-line description so the tools below stay on screen. */
@media (max-width: 560px) and (max-height: 700px) {
  #battle-actions .actions:has(> .act:nth-child(7)) .act small { display: none; }
  #battle-actions .actions:has(> .act:nth-child(7)) .act { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
}
/* Phones: the moves are a compact strip of three across, names only, so the puppets keep the screen.
   A move that is not ready still says why, small; the full description is the card's tooltip. */
@media (max-width: 560px) {
  .leaf.fighting.immersive #battle-actions .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .leaf.fighting.immersive #battle-actions .act { min-height: 44px; padding: 6px 7px; align-content: center; }
  .leaf.fighting.immersive #battle-actions .act b { font-size: 13.5px; line-height: 1.2; }
  .leaf.fighting.immersive #battle-actions .act small { display: none; }
  .leaf.fighting.immersive #battle-actions .act:disabled small { display: block; font-size: 10.5px; }
  .leaf.fighting.immersive #battle-actions .astra-pick { grid-template-columns: 1fr; }
  .leaf.fighting.immersive #battle-actions .astra-pick .act small { display: block; }
}
/* The dive: the diver in the lake is you, so no second figure stands on the lake bed below. */
.trial.trial-breath > .cast { display: none; }

/* A leader's mark: a pennant over the marked enemy, and a line on its card. */
#arena .actor.marked { position: relative; }
#arena .actor > .mark-flag { position: absolute; left: 50%; top: -6px; width: 26px; height: 32px; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); pointer-events: none; }
.unit.enemy.marked { box-shadow: inset 0 0 0 2px #d9822b; }
.unit .markline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #f0b26a; }
.unit .markline .mark-flag { width: 14px; height: 17px; flex: none; }
:where(html:not(.calm)) #arena .actor > .mark-flag { animation: mark-in .35s ease-out; }
@keyframes mark-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Waking from the prologue's dream: the field goes white, one line, then the childhood. */
.wake { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: max(24px, var(--sat, 0px)) 28px max(24px, var(--sab, 0px)); background: #f6efe0; color: #2a1a10; opacity: 0; transition: opacity 0.9s ease; cursor: pointer; }
.wake.in { opacity: 1; }
.wake.out { opacity: 0; transition-duration: 0.6s; }
.wake p { max-width: 30ch; margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(22px, 5.4vw, 34px); line-height: 1.4; text-align: center; opacity: 0; transform: translateY(6px); transition: opacity 1.2s ease 0.7s, transform 1.2s ease 0.7s; }
.wake.in p { opacity: 1; transform: none; }
.wake .mo-tap { position: absolute; right: 22px; bottom: max(18px, var(--sab, 0px)); color: #7a6450; font-size: 14px; }
html.calm .wake, html.calm .wake p { transition: none; }

/* Your target: named on its card, and a ring of light at the figure's feet, so it is always clear who your moves will hit. */
.unit .tgt-chip { justify-self: start; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #1a110a; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
#arena .actor.enemy:not(.down) { cursor: pointer; }
#arena .actor.enemy.targeted::after { content: ""; position: absolute; left: 50%; bottom: 9%; width: 78%; height: 14px; transform: translateX(-50%); border-radius: 50%; border: 2px solid rgba(233, 194, 122, 0.95); box-shadow: 0 0 10px rgba(233, 194, 122, 0.7); pointer-events: none; z-index: 0; }
:where(html:not(.calm)) #arena .actor.enemy.targeted::after { animation: tgt-pulse 1.6s ease-in-out infinite; }
@keyframes tgt-pulse { 50% { opacity: 0.55; } }

/* Falling asleep into the prologue's dream: supper at home, the rope bed, the lamp, the dream bubble. */
.sleepin { position: fixed; inset: 0; z-index: 90; overflow: hidden; background: #120b07; opacity: 0; transition: opacity 0.7s ease; cursor: pointer; }
.sleepin.in { opacity: 1; } .sleepin.out { opacity: 0; transition-duration: 0.5s; }
.sleepin .si-night { position: absolute; inset: 0; background: rgba(10, 6, 4, 0); transition: background 1.6s ease; }
.sleepin.night .si-night { background: rgba(10, 6, 4, 0.35); }
.sleepin.dark .si-night { background: rgba(5, 4, 10, 0.9); }
/* First your homeland, full screen, with you walking home across it; then the room fades in. */
.sleepin .si-region { position: absolute; inset: 0; z-index: 2; background: #120b07 var(--img) center / cover no-repeat; transition: opacity 0.9s ease; }
.sleepin .si-region::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20, 12, 30, 0.1), rgba(30, 14, 6, 0.35)); }
.sleepin .si-walker { position: absolute; z-index: 1; bottom: max(2vh, var(--sab)); left: -18%; transition: left 3.4s linear; }
.sleepin .si-intro { position: absolute; z-index: 2; left: 0; right: 0; top: 0; padding: max(9vh, calc(var(--sat) + 56px)) 28px 70px; text-align: center; color: #f2e8d5; background: linear-gradient(to bottom, rgba(18, 10, 6, 0.82), rgba(18, 10, 6, 0.55) 70%, rgba(18, 10, 6, 0)); opacity: 0; transform: translateY(8px); transition: opacity 0.9s ease 0.3s, transform 0.9s ease 0.3s; }
.sleepin.in .si-intro { opacity: 1; transform: none; }
.sleepin .si-intro .si-where { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.sleepin .si-intro b { display: block; margin: 6px 0 10px; font-family: var(--display); font-size: clamp(38px, 9vw, 60px); font-weight: 700; line-height: 1.05; }
.sleepin .si-intro p { max-width: 34ch; margin: 0 auto; font-size: clamp(16px, 4vw, 20px); line-height: 1.45; color: #ece1cb; }
.sleepin .si-walker .pp { height: min(200px, 24vh); width: auto; overflow: visible; filter: drop-shadow(0 0 8px rgba(255, 196, 110, 0.45)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.5)); }
.sleepin .si-door { position: absolute; z-index: 1; right: 5%; bottom: max(2vh, var(--sab)); width: min(150px, 34vw); height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)); }
.sleepin .si-walker { transition: left 3.2s linear, opacity 0.6s ease, transform 0.6s ease; }
.sleepin.entered .si-walker { opacity: 0; transform: scale(0.9); }
.sleepin.inside .si-region { opacity: 0; pointer-events: none; }
.sleepin .si-wall { position: absolute; inset: 0; width: 100%; height: 100%; transition: filter 1.6s ease; }
.sleepin.night .si-wall { filter: brightness(0.62); } .sleepin.dark .si-wall { filter: brightness(0.3); }
.sleepin .si-glow { position: absolute; right: calc(16% - 120px); bottom: calc(18vh - 100px); width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 180, 90, 0.32), rgba(255, 150, 60, 0) 65%); opacity: 0; transition: opacity 1s ease; pointer-events: none; }
.sleepin.night .si-glow { opacity: 1; } .sleepin.dark .si-glow { opacity: 0; }
.sleepin .si-room { position: absolute; left: 0; right: 0; bottom: 18vh; height: 46vh; display: flex; align-items: flex-end; justify-content: center; }
.sleepin .si-eat, .sleepin .si-sleep { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); transition: opacity 0.9s ease; display: flex; align-items: flex-end; }
.sleepin .si-eat { gap: 0; } .sleepin .si-eat .pp { height: min(240px, 30vh); width: auto; overflow: visible; filter: drop-shadow(0 0 8px rgba(255, 196, 110, 0.4)); }
.sleepin .si-plate { width: min(150px, 19vh); margin-left: -18px; margin-bottom: 2px; }
.sleepin .si-kid .armF { animation: si-eat 1.1s ease-in-out infinite alternate; transform-origin: 58px 73px; }
@keyframes si-eat { from { transform: rotate(-30deg); } to { transform: rotate(-58deg); } }
.sleepin .si-sleep { opacity: 0; width: min(360px, 84vw); flex-direction: column; align-items: center; }
.sleepin .si-bed { width: 100%; display: block; }
.sleepin .si-sleeper { position: absolute; left: 50%; bottom: 58%; transform: translateX(-46%); }
.sleepin .si-sleeper .pp { height: auto; width: min(280px, 64vw); filter: drop-shadow(0 0 6px rgba(255, 196, 110, 0.25)); }
.sleepin.night .si-eat { opacity: 0; } .sleepin.night .si-sleep { opacity: 1; }
.sleepin .si-lamp { position: absolute; right: 16%; bottom: 0; width: 46px; height: 46px; opacity: 0; transition: opacity 0.8s ease; }
.sleepin .si-lamp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sleepin .si-lamp .flame { transform-origin: 50% 70%; animation: si-flick 0.4s ease-in-out infinite alternate; transition: opacity 0.8s ease, transform 0.8s ease; }
@keyframes si-flick { to { transform: scale(0.9, 1.06); } }
.sleepin.night .si-lamp { opacity: 1; } .sleepin.dark .si-lamp .flame { opacity: 0; transform: scale(0.2); }
/* The bubble: three small rings rise from the sleeper's head, then the dream opens from the last one. */
.sleepin .si-dots { position: absolute; left: calc(50% - min(70px, 17vw)); bottom: calc(min(70px, 9vh) + 36px); width: 90px; height: 120px; pointer-events: none; }
.sleepin .si-dots i { position: absolute; border-radius: 50%; border: 2px solid rgba(242, 232, 213, 0.85); background: rgba(242, 232, 213, 0.12); opacity: 0; transform: scale(0.4); transition: opacity 0.35s ease, transform 0.35s ease; }
.sleepin .si-dots i:nth-child(1) { width: 12px; height: 12px; left: 6px; bottom: 0; transition-delay: 0s; }
.sleepin .si-dots i:nth-child(2) { width: 20px; height: 20px; left: 24px; bottom: 26px; transition-delay: 0.3s; }
.sleepin .si-dots i:nth-child(3) { width: 30px; height: 30px; left: 48px; bottom: 60px; transition-delay: 0.6s; }
.sleepin.dream .si-dots i { opacity: 1; transform: none; }
.sleepin .si-bubble { position: absolute; z-index: 2; inset: 0; background: var(--img) center / cover no-repeat; clip-path: circle(0 at 50% 50%); --bx: calc(50% - min(70px, 17vw) + 63px); --by: calc(82% - min(70px, 9vh) - 111px); transition: clip-path 1.6s cubic-bezier(.5, 0, .2, 1); }
.sleepin.dream .si-bubble { clip-path: circle(0px at var(--bx) var(--by)); }
.sleepin.open .si-bubble { clip-path: circle(150% at var(--bx) var(--by)); }
.sleepin .si-cap { position: absolute; z-index: 3; left: 24px; right: 24px; top: max(7vh, calc(var(--sat) + 44px)); margin: 0; text-align: center; color: #f2e8d5; font-family: var(--display); font-style: italic; font-size: clamp(22px, 5vw, 34px); line-height: 1.3; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); opacity: 0; transform: translateY(6px); transition: opacity 0.8s ease, transform 0.8s ease; }
.sleepin .si-cap.in { opacity: 1; transform: none; }
.sleepin .si-cap small { display: block; max-width: 30ch; margin: 10px auto 0; font-size: 0.62em; line-height: 1.4; color: #e6d6b8; }
.sleepin.open .si-cap { opacity: 0; }
.sleepin .mo-tap { position: absolute; z-index: 3; left: 20px; bottom: max(18px, var(--sab)); color: rgba(242, 232, 213, 0.75); font-size: 14px; }
html.calm .sleepin, html.calm .sleepin * { transition-duration: 0.01s !important; animation: none !important; }

/* The family at supper: four kneeling figures in two facing pairs, a mat with leaf plates in front. */
.sleepin .si-family { gap: 0; align-items: flex-end; padding-bottom: 10px; }
.sleepin .si-family .fm { display: block; margin: 0 -8px; }
.sleepin .si-family .fm .pp { height: min(170px, 21vh); width: auto; overflow: visible; filter: drop-shadow(0 0 7px rgba(255, 196, 110, 0.35)); }
.sleepin .si-family .mo { margin-left: 10px; }
.sleepin .si-mat { position: absolute; left: -6%; right: -6%; bottom: -10px; height: 30px; display: flex; justify-content: space-around; align-items: center; border-radius: 6px; background: repeating-linear-gradient(90deg, #a8803e 0 6px, #8d6a30 6px 12px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45); }
.sleepin .si-mat .si-plate { width: min(64px, 15vw); margin: 0; }

/* Waking from the dream: the white, then the dark room; mother with a lamp, father in the doorway. */
.sleepin.wakeup .si-night { background: rgba(4, 3, 8, 0.82); transition: background 1.2s ease; }
.sleepin.wakeup.lit .si-night { background: rgba(10, 6, 4, 0.45); }
.sleepin.wakeup .wk-mglow { position: absolute; left: -170px; bottom: -130px; width: 420px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 180, 90, 0.34), rgba(255, 150, 60, 0) 65%); opacity: 0; transition: opacity 1s ease; pointer-events: none; }
.sleepin.wakeup.lit .wk-mglow { opacity: 1; }
.sleepin.wakeup .wk-white { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 0 28px; background: #f6efe0; color: #2a1a10; transition: opacity 1s ease; }
.sleepin.wakeup .wk-white p { max-width: 30ch; margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(21px, 5vw, 32px); line-height: 1.4; text-align: center; }
.sleepin.wakeup.woken .wk-white { opacity: 0; pointer-events: none; }
.sleepin.wakeup .wk-bed { position: absolute; z-index: 1; bottom: 0; left: 50%; transform: translateX(-50%); width: min(300px, 56vw); }
.sleepin.wakeup .wk-bed .si-bed { width: 100%; display: block; }
.sleepin.wakeup .wk-kid { position: absolute; left: 2%; bottom: 46%; }
.sleepin.wakeup .wk-kid .pp { height: min(200px, 25vh); width: auto; overflow: visible; filter: drop-shadow(0 0 6px rgba(255, 196, 110, 0.3)); }
.sleepin.wakeup.woken:not(.lit) .wk-kid .pp { animation: wk-shake 0.12s linear infinite alternate; }
@keyframes wk-shake { from { transform: scaleX(-1) translateX(-1px); } to { transform: scaleX(-1) translateX(1.5px); } }
.sleepin.wakeup .wk-mom { position: absolute; z-index: 2; bottom: -4px; left: -40%; transition: left 2s ease-out; }
/* She kneels by the bed, her hand out to the child; the lamp she brought is set down on the floor behind her. */
.sleepin.wakeup .wk-mom .pp.pose-kneel .armF { transform: rotate(-74deg); } .sleepin.wakeup .wk-mom .pp.pose-kneel .foreF { transform: rotate(-18deg); } .sleepin.wakeup .wk-mom .pp.pose-kneel .head { transform: rotate(8deg); }
.sleepin.wakeup.mom-in .wk-mom { left: max(12%, calc(50% - min(150px, 28vw) - 80px)); }
.sleepin.wakeup .wk-mom .pp { height: min(170px, 22vh); width: auto; overflow: visible; filter: drop-shadow(0 0 7px rgba(255, 196, 110, 0.35)); }
.sleepin.wakeup .wk-lamp { position: absolute; right: -14px; bottom: 32%; width: 34px; height: 34px; opacity: 1; }
.sleepin.wakeup.lit .wk-lamp { bottom: -2px; right: auto; left: -32px; }
.sleepin.wakeup .wk-dad { position: absolute; z-index: 0; bottom: -4px; right: max(1%, calc(50% - min(150px, 28vw) - 96px)); opacity: 0; transform: translateX(30px); transition: opacity 1s ease, transform 1.2s ease; }
.sleepin.wakeup.dad-in .wk-dad { opacity: 1; transform: none; }
.sleepin.wakeup .wk-dad .pp { height: min(220px, 28vh); width: auto; overflow: visible; filter: drop-shadow(0 0 7px rgba(255, 196, 110, 0.3)); }
.sleepin.wakeup .wk-say { position: absolute; z-index: 3; left: 24px; right: 24px; top: max(8vh, calc(var(--sat) + 44px)); text-align: center; color: #f2e8d5; opacity: 0; transform: translateY(6px); transition: opacity 0.7s ease, transform 0.7s ease; }
.sleepin.wakeup .wk-say.in { opacity: 1; transform: none; }
.sleepin.wakeup .wk-who { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.sleepin.wakeup .wk-who:empty { display: none; }
.sleepin.wakeup .wk-say p { max-width: 32ch; margin: 0 auto; font-family: var(--display); font-style: italic; font-size: clamp(20px, 4.8vw, 30px); line-height: 1.35; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
html.calm .sleepin.wakeup .wk-kid .pp { animation: none !important; }

/* A dream fight ends in white, straight into the waking scene. */
.dream-white { position: fixed; inset: 0; z-index: 95; background: #f6efe0; opacity: 0; transition: opacity 1.1s ease; pointer-events: none; }
.dream-white.on { opacity: 1; }
.sleepin.now { transition: none; opacity: 1; }
.sleepin.now.out { transition: opacity 0.5s ease; opacity: 0; }
.sleepin.out { pointer-events: none; }

/* ---------- Puppets with weight (js/ui/puppet-anim.js) ----------
   A live figure is moved joint by joint from script; its CSS poses and transitions stand aside. */
.pp.pose-live .j, .pp.pose-live .pp-body, .pp.pose-live .it-w, .pp.pose-live .it { transition: none !important; animation: none !important; }
.pp.pose-live .rod { display: inline; }
.actor.flash .pp { filter: brightness(1.6) drop-shadow(0 0 10px rgba(255, 196, 110, 0.45)) !important; }
.actor.mending .pp { filter: drop-shadow(0 0 14px rgba(127, 207, 166, 0.85)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6)) !important; }
.fly-arrow { position: absolute; left: 0; top: 0; width: clamp(34px, 7vh, 64px); height: clamp(6px, 1.2vh, 11px); transform-origin: 100% 50%; pointer-events: none; z-index: 5; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.fly-arrow svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bit { position: absolute; pointer-events: none; z-index: 5; }
.bit.flake { width: 7px; height: 5px; border-radius: 1px 3px; }
.bit.spark { width: 4px; height: 4px; border-radius: 50%; background: #fff1c2; box-shadow: 0 0 6px 2px rgba(255, 196, 110, .8); }
.bit.mote { width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(#e9ffe9, #7fcfa6 60%, rgba(127, 207, 166, 0)); }
.bit.chip { width: 6px; height: 4px; border-radius: 1px; background: #c9a066; }
/* A figure bracing for the next blow: a bright rim and glint on the shield, or a glow on the raised forearm (U.guardFlash). */
.pp .gf-on { animation: gflash 1.3s ease-out both; }
.pp .gf-calm { filter: drop-shadow(0 0 2.5px #fff1b8) brightness(1.25); }
@keyframes gflash { 0% { filter: none; } 15% { filter: drop-shadow(0 0 5px #fff6d0) drop-shadow(0 0 2px #ffffff) brightness(1.55); } 70% { filter: drop-shadow(0 0 3px #ffe9a8) brightness(1.25); } 100% { filter: none; } }

/* Fights of another kind (content/war_fights.js, ui/fightmodes.js): the bow in a chariot duel, arrows
   to catch, a feint in a mace duel, an arrow coming back in an archery duel, and the beat of the fight. */
.race-btns .bow { white-space: nowrap; background: var(--raised); color: var(--ink); border: 1px solid var(--gold-line); opacity: .7; }
.race-btns .bow.ready { opacity: 1; background: var(--accent); color: var(--accent-ink); }
.race-btns .bow kbd { display: none; }
@media (hover: hover) and (pointer: fine) { .race-btns .bow kbd { display: inline-block; margin-left: 8px; padding: 3px 6px; border: 1px solid currentColor; border-radius: 4px; font: 600 12px/1 var(--text); vertical-align: middle; opacity: .75; } }
.track.vertical .ob-arrow svg { transform: rotate(-90deg); }
.ringbox .ring.feint { border-color: #e0553a !important; box-shadow: 0 0 18px rgba(224, 85, 58, 0.7); }
.range.incoming { box-shadow: inset 0 0 0 4px #e0553a; }
.fm-beat { position: fixed; left: 50%; top: max(12px, var(--sat, 0px)); transform: translateX(-50%); z-index: 40; width: min(92vw, 560px); margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(var(--surface-rgb), 0.92); color: var(--ink); font: 500 15px/1.4 var(--text); text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.fm-beat.on { opacity: 1; }
.race-btns:has(> .bow) > .trial-press { padding-left: 6px; padding-right: 6px; min-width: 0; }

/* Before a fight (ui/battle.js): how it is won, and what you can do; one Fight button. A card over
   the field on every screen; a fight met before gets one line across the top of the field instead. */
.fbrief-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: max(16px, var(--sat)) 16px max(16px, var(--sab)); background: rgba(16, 6, 4, 0.55); overflow-y: auto; } /* taste-skill-ignore: dims the field behind the card */
.fbrief { width: min(440px, 100%); padding: 18px 18px 16px; border-radius: 16px; background: rgba(var(--surface-rgb), 0.94); border: 1px solid var(--gold-line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); color: var(--ink); } /* taste-skill-ignore: the card floats over the fight */
.fbrief h2 { margin: 2px 0 0; font-family: var(--display); font-size: 24px; line-height: 1.15; }
.fbrief .fb-tag { margin: 0; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.fbrief .fb-mode { margin: 4px 0 0; font-weight: 700; color: var(--data); font-size: 15px; }
.fbrief .fb-goal { margin: 6px 0 0; font-size: 16px; line-height: 1.4; }
.fbrief .fb-lbl { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.fb-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fb-acts li { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center; }
.fb-acts .fb-ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--gold-line); }
.fb-acts svg { width: 20px; height: 20px; fill: none; stroke: var(--data); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fb-acts b { font-size: 15px; line-height: 1.2; }
.fb-acts small { font-size: 13px; line-height: 1.25; color: var(--muted); }
.fbrief .btnrow { margin-top: 14px; justify-content: center; }
.fbrief .fb-go { min-width: min(240px, 70vw); min-height: 50px; font-size: 18px; }
.fbrief.inline { width: auto; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; }
.fbrief.inline .fb-mode { margin: 0 0 6px; }
.fb-line { position: absolute; z-index: 6; top: 8px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 6px 14px; border-radius: 999px; text-align: center;
  background: rgba(var(--surface-rgb), 0.86); border: 1px solid var(--gold-line); color: var(--ink); font-size: 14px; pointer-events: none; } /* taste-skill-ignore: over the painted field */
.fb-line b { color: var(--data); }
:where(html:not(.calm)) .fbrief-wrap:not(.still) .fbrief { animation: fb-in 0.3s ease both; }
:where(html:not(.calm)) .fb-line:not(.still) { animation: fb-line 4.2s ease both; }
@keyframes fb-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fb-line { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* The first fight of a life: each part of the screen lit in turn, with its line beside it. */
.ftour { position: fixed; inset: 0; z-index: 41; cursor: pointer; }
.ftour .ft-hole { position: fixed; border-radius: 12px; border: 2px solid var(--data); box-shadow: 0 0 0 200vmax rgba(16, 6, 4, 0.66); pointer-events: none; } /* taste-skill-ignore: the dimmed screen around the lit part */
.ftour .ft-cap { position: fixed; padding: 10px 14px; border-radius: 12px; background: rgba(var(--surface-rgb), 0.97); border: 1px solid var(--gold-line); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.ftour .ft-cap p { margin: 2px 0 4px; font-size: 16px; line-height: 1.35; }
.ftour .ft-n, .ftour .ft-tap { font-size: 12px; color: var(--faint); }
.ftour .ft-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ftour .ft-skip { min-height: 44px; min-width: 88px; }
:where(html:not(.calm)) .ftour:not(.still) .ft-hole, :where(html:not(.calm)) .ftour:not(.still) .ft-cap { transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease; }
/* The ending, full-screen (ui/ending.js): the painting drifts, the title in gold, the lines one by one,
   then the record, the fates and the way back to an act. .all: everything at once (tap, Skip, calm, shown again). */
.endscreen { position: fixed; inset: 0; z-index: 45; overflow: hidden; background: #0d0a08; color: #f4ead6; opacity: 0; transition: opacity .9s ease; }
.endscreen.in, .endscreen.all { opacity: 1; }
.es-art { position: absolute; inset: -5%; }
.es-art i, .es-art video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: var(--img) center / cover no-repeat; object-fit: cover; }
.es-art video { opacity: 0; transition: opacity 1.2s; } .es-art video.on { opacity: 1; }
.endscreen.in .es-art { animation: es-drift 46s ease-in-out infinite alternate; }
@keyframes es-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-2.2%, -1.6%); } }
.es-light, .es-smoke, .es-parts, .es-shade { position: absolute; inset: 0; pointer-events: none; }
.es-parts { width: 100%; height: 100%; }
.es-light { opacity: 0; transition: opacity 9s ease; }
.endscreen.in .es-light, .endscreen.all .es-light { opacity: 1; }
.l-dusk .es-light { background: linear-gradient(to bottom, rgba(34, 26, 74, .62), rgba(110, 44, 52, .38) 55%, rgba(16, 8, 24, .55)); mix-blend-mode: multiply; transition-duration: 14s; }
.l-sunset .es-light { background: linear-gradient(to top, rgba(255, 112, 36, .5), rgba(255, 150, 60, .2) 42%, rgba(120, 40, 20, 0) 72%), radial-gradient(ellipse at 50% 100%, rgba(255, 170, 80, .35), transparent 60%); mix-blend-mode: soft-light; }
.l-morning .es-light { background: radial-gradient(ellipse at 18% 4%, rgba(255, 238, 196, .6), rgba(255, 226, 170, .18) 38%, transparent 64%), linear-gradient(to bottom, rgba(255, 236, 200, .16), transparent 50%); mix-blend-mode: screen; transition-duration: 7s; }
.l-ash .es-light { background: linear-gradient(to top, rgba(255, 96, 30, .32), rgba(120, 60, 40, .12) 45%, rgba(40, 30, 30, .3)); mix-blend-mode: soft-light; }
.es-smoke i { position: absolute; left: -20%; right: -20%; height: 70%; bottom: 0; background: radial-gradient(ellipse at 30% 70%, rgba(150, 140, 132, .32), transparent 55%), radial-gradient(ellipse at 75% 60%, rgba(120, 112, 106, .26), transparent 50%); filter: blur(8px); opacity: .9; }
.es-smoke i:nth-child(2) { bottom: 18%; opacity: .6; transform: scaleX(-1); }
.es-smoke i:nth-child(3) { bottom: 34%; opacity: .4; }
.endscreen.in .es-smoke i { animation: es-smoke 18s linear infinite; } .endscreen.in .es-smoke i:nth-child(2) { animation-duration: 24s; animation-delay: -8s; } .endscreen.in .es-smoke i:nth-child(3) { animation-duration: 30s; animation-delay: -15s; }
@keyframes es-smoke { 0% { transform: translate(0, 10%); opacity: 0; } 20% { opacity: .8; } 100% { transform: translate(8%, -40%); opacity: 0; } }
/* Karna's wheel, sinking into the ground line. */
.es-wheelbox { --ww: min(30vw, 20vh); position: absolute; left: 50%; top: calc(max(12px, var(--sat)) + 7vh); width: var(--ww); height: calc(var(--ww) * .9); transform: translateX(-50%); overflow: hidden; pointer-events: none; }
.es-wheel { position: absolute; left: 0; right: 0; bottom: 0; height: var(--ww); opacity: .94; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.es-wheel svg { width: 100%; height: 100%; display: block; }
.endscreen.in .es-wheel { animation: es-sink 11s 1.6s cubic-bezier(.45, 0, .7, 1) forwards; }
.endscreen.still .es-wheel { transform: translateY(42%) rotate(-9deg); }
@keyframes es-sink { from { transform: translateY(0) rotate(0); } to { transform: translateY(42%) rotate(-9deg); } }
.es-earth { position: absolute; left: 50%; top: calc(max(12px, var(--sat)) + 7vh + min(30vw, 20vh) * .9); width: min(56vw, 36vh); height: 2px; transform: translateX(-50%); background: linear-gradient(to right, rgba(226, 181, 90, 0), rgba(226, 181, 90, .95) 30%, rgba(226, 181, 90, .95) 70%, rgba(226, 181, 90, 0)); box-shadow: 0 0 10px rgba(0, 0, 0, .8); pointer-events: none; }
/* The garland or the oath's emblem, over a death at dusk. */
.es-emblem { position: absolute; left: 50%; top: calc(max(12px, var(--sat)) + 8vh); width: min(36vw, 24vh); height: min(36vw, 24vh); margin-left: calc(min(36vw, 24vh) / -2); background: var(--img) center / contain no-repeat; opacity: 0; transform: scale(.9); transition: opacity 2.4s 2.6s, transform 2.4s 2.6s; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .7)); pointer-events: none; }
.es-emblem svg { width: 100%; height: 100%; display: block; }
.endscreen.in .es-emblem, .endscreen.all .es-emblem { opacity: .95; transform: none; }
.es-shade { background: linear-gradient(to bottom, rgba(10, 7, 5, .5) 0%, rgba(10, 7, 5, 0) 18%, rgba(10, 7, 5, 0) 32%, rgba(10, 7, 5, .42) 50%, rgba(10, 7, 5, .78) 74%, rgba(10, 7, 5, .9) 100%); }
.es-skip { position: absolute; z-index: 3; top: max(12px, var(--sat)); right: max(14px, var(--sar)); min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(244, 234, 214, .35); background: rgba(13, 10, 8, .45); color: #f4ead6; font: 600 14px/1 var(--text); cursor: pointer; }
.endscreen.all .es-skip, .endscreen.rested .es-skip { display: none; }
.es-tap { position: absolute; z-index: 3; left: 0; right: 0; bottom: max(10px, var(--sab)); text-align: center; font-size: 13px; color: rgba(244, 234, 214, .65); pointer-events: none; opacity: 0; transition: opacity 1s 3s; }
.endscreen.titled .es-tap { opacity: 1; } .endscreen.all .es-tap, .endscreen.rested .es-tap { display: none; }
.es-scroll { position: absolute; inset: 0; z-index: 2; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.es-col { box-sizing: border-box; max-width: 760px; margin: 0 auto; padding: calc(var(--vh) * .44) max(20px, var(--sar)) calc(max(28px, var(--sab)) + 34px) max(20px, var(--sal)); display: grid; gap: 14px; }
.endscreen.all .es-col { padding-bottom: calc(max(24px, var(--sab)) + 12px); }
.es-head { display: grid; justify-items: center; gap: 6px; text-align: center; opacity: 0; transform: translateY(12px); transition: opacity 1.4s, transform 1.4s; }
.endscreen.titled .es-head, .endscreen.all .es-head { opacity: 1; transform: none; }
.es-head .kind { font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #f0dcbc; text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 12px rgba(0, 0, 0, .8); }
.es-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(36px, min(9vw, 9vh), 68px); line-height: 1.04; color: #f3d27a; text-shadow: 0 2px 16px rgba(0, 0, 0, .85); text-wrap: balance; }
.endscreen.fell .es-title { color: #ecc66e; }
.es-cap { margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(17px, 2.2vw, 21px); color: #ecdfc6; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.es-lines { display: grid; gap: 10px; padding-top: 8px; }
.es-line { display: none; margin: 0; font-family: var(--display); font-size: clamp(19px, 2.3vw, 23px); line-height: 1.42; color: #f4ead6; text-shadow: 0 1px 8px rgba(0, 0, 0, .95); text-align: center; text-wrap: pretty; }
.es-line.on { display: block; animation: es-in 1.4s ease-out both; }
.endscreen.all .es-line.on { animation: none; }
@keyframes es-in { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.es-rest { display: none; gap: 16px; margin-top: 10px; padding: 18px 18px 6px; border-radius: 14px; background: rgba(var(--surface-rgb), .9); border: 1px solid var(--gold-line); }
.endscreen.rested .es-rest, .endscreen.all .es-rest { display: grid; }
.endscreen.rested:not(.all) .es-rest { animation: es-in 1.2s ease-out both; }
.es-rest .lbl { display: block; margin-bottom: 6px; color: var(--data); font-size: 20px; }
.es-rest p { margin: 0 0 6px; line-height: 1.5; color: var(--ink); }
.es-record { font-size: 14.5px; color: var(--muted) !important; }
.es-note { font-size: 14.5px; color: var(--muted) !important; }
.es-map svg { max-width: 100%; height: auto; }
.es-rest .btnrow { margin: 0 0 10px; }
.actlist { display: grid; gap: 8px; }
.actback { display: grid; gap: 2px; justify-items: start; text-align: left; min-height: 48px; padding: 9px 16px; border-radius: var(--r-control); }
.actback.ghost { background: var(--raised); color: var(--ink); }
.actback b { font-weight: 700; font-size: 16px; } .actback small { font-size: 13.5px; opacity: .85; font-weight: 400; }
.actback.armed { outline: 2px solid var(--accent); }
html[lang="hi"] .es-title { line-height: 1.3; } html[lang="hi"] .es-line, html[lang="hi"] .es-cap { font-style: normal; line-height: 1.65; }
.endscreen.still *, html.calm .endscreen * { animation: none !important; transition: none !important; }
html.calm .endscreen, .endscreen.still { transition: none; }
@media (max-height: 600px) { .es-col { padding-top: calc(var(--vh) * .34); } .es-title { font-size: clamp(30px, 8vh, 52px); } .es-line { font-size: 18px; } }
@media (min-width: 900px) { .es-col { padding-top: calc(var(--vh) * .4); } .actlist { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
body.ending-on .ledger { display: none; }
.result .retrynote { color: var(--negative); font-weight: 700; }

/* At rest nothing held covers the face (owner, 4 November): standing (in any stance), walking, slumped or turned aside, a
   mace, a club or a hammer hangs with its head on the ground and a blade points down; a bow is held upright at the side,
   the arm hanging; a spear or a staff stands upright beside the body (puppet-anim.js REST does the same for live figures). */
.pp:is(.pose-stand, .pose-walk, .pose-slump, .pose-side, .pose-tremble) .it-w:is([data-k="mace"], [data-k="club"], [data-k="hammer"], [data-k="sword"], [data-k="woodsword"], [data-k="dagger"]) { transform: rotate(180deg); }
.pp.hold-bow:is(.pose-stand, .pose-walk) .armF { transform: rotate(8deg); }
.pp.hold-bow:is(.pose-stand, .pose-walk) .foreF { transform: rotate(-16deg); }
.pp.hold-bow:is(.pose-stand, .pose-walk, .pose-slump, .pose-side) .it:not(.it-w) { transform-box: view-box; transform-origin: 60.5px 126px; transform: rotate(-18deg); } /* its top leaning back, clear of the face */
.pp.hold-bow.pose-slump .it:not(.it-w) { transform: rotate(-33deg); }
.pp.hold-bow.pose-side .it:not(.it-w) { transform: rotate(-42deg); }
/* A spear or a staff leans back past the head as the body bows (slumped) or turns aside, and as the arm swings in a walk. */
.pp:is(.hold-spear, .hold-staff, .hold-plough).pose-walk .it-w { transform: rotate(-16deg); }
.pp:is(.hold-spear, .hold-staff, .hold-plough).pose-slump .it-w { transform: rotate(-24deg); }
.pp:is(.hold-spear, .hold-staff, .hold-plough).pose-side .it-w { transform: rotate(-34deg); }

/* The burning house: only the rooms take taps; the tunnel mouth, sleepers, you and the doors drawn over them let a tap through to the room (playtest, 5 November: a tap on the storeroom's tunnel mouth did nothing, and the fire caught you a room from safety) */
.lacplan svg :not(rect) { pointer-events: none; }
/* The wheel on day 9 as a living painting (war_bhishma.js): the clip fills the moment; its own camera moves, so no zoom */
.moment.clip .mo-art { animation: none; inset: 0; }
.moment .mo-art video.mo-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.moment .mo-art video.mo-clip.on { opacity: 1; }
.moment.clip .mo-text { opacity: 0; transition: opacity .8s ease; }
.moment.clip.ended .mo-text { opacity: 1; }

/* ---------- Less of the screen under words on a phone (owner, 5 November: 52 pages over half the screen) ----------
   The choice cards were most of it: tighter cards, smaller portraits, the story a touch smaller. Act cards, the dream,
   moments and endings are not .story and keep their sizes. */
@media (max-width: 560px) {
  .leaf .choices .choice { padding: 9px 12px; min-height: 44px; gap: 2px 10px; }
  .leaf .choices .choice .t { font-size: 15.5px; line-height: 1.28; }
  .leaf .choices .choice.has-img .thumb.face { width: 40px; height: 40px; }
  .leaf .choices .choice .thumb.face { width: 40px; height: 40px; }
  .leaf .choices .choice .thumb.emblem { width: 44px; height: 44px; }
  .leaf .choices .choice .thumb.card { width: 72px; }
  .leaf .story { font-size: 15px; line-height: 1.5; }
  /* "As it is written": its label runs into its one sentence, in a slim box */
  .leaf .story .witness { display: block; padding: 7px 11px; outline: 0; }
  .leaf .story .witness .lbl { display: inline; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; margin-right: 6px; }
  .leaf .story .witness p { display: inline; font-size: 14px; line-height: 1.45; margin: 0; }
  .leaf .story .witness p + p::before { content: " "; }
  html[lang="hi"] .leaf .choices .choice .t { font-size: 15px; line-height: 1.4; }
  /* A choice you cannot take: its name only, muted (the reason folds into the card's label); a way closed by failing stays struck through with its line */
  .leaf .choices .choice:disabled:not(.crossed) { min-height: 38px; padding-block: 7px; }
  .leaf .choices .choice:disabled:not(.crossed) .fx { display: none; }
  .leaf .choices .choice:disabled:not(.crossed) .thumb.face { width: 30px; height: 30px; }
}
@media (max-width: 560px) {
  .leaf .choices.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .leaf .choices.two .choice { min-height: 44px; align-items: center; }
  .leaf .choices.two .choice .k { display: none; }
  .leaf .choices.two .choice { grid-template-columns: minmax(0, 1fr); }
  .leaf .choices.two .choice.has-img { grid-template-columns: auto minmax(0, 1fr); }
}
@media (max-width: 560px) {
  /* The weapon grid three to a row on a phone, smaller pictures (seven weapons took two thirds of the screen) */
  .leaf .choices.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .leaf .choices.grid .choice.tile { padding: 7px 5px 6px; }
  .leaf .choices.grid .choice.tile .thumb.emblem { width: 44px; height: 44px; }
  .leaf .choices.grid .choice.tile .t { font-size: 13.5px; line-height: 1.2; }
  .leaf .choices.grid .choice.tile .sub { font-size: 11.5px; }
  /* Vows and other emblem choices: a smaller emblem */
  .leaf .choices .choice.has-img .thumb.emblem { width: 36px; height: 36px; }
}
/* Fighter mode (ui/practice.js, feedback item 21): the choice on waking, the weapon, the end of a run. */
.fmode { position: fixed; inset: 0; z-index: 92; display: grid; place-items: center; padding: max(20px, var(--sat, 0px)) 16px max(20px, var(--sab, 0px)); background: radial-gradient(ellipse at 50% 40%, rgba(58, 30, 18, .94), rgba(14, 8, 5, .97)); opacity: 0; transition: opacity .45s ease; overflow-y: auto; }
.fmode.in { opacity: 1; }
.fmode.out { opacity: 0; pointer-events: none; }
html.calm .fmode { transition: none; }
.fm-in { width: min(100%, 560px); display: grid; gap: 16px; text-align: center; }
.fmode h2 { margin: 0; font: 600 clamp(28px, 7vw, 40px)/1.1 var(--display); color: var(--ink); }
.fm-pick { display: grid; gap: 12px; }
.fm-card, .fm-w { display: grid; gap: 4px; text-align: left; padding: 16px 18px; border-radius: var(--r-control); border: 1px solid var(--gold-line); background: rgba(var(--surface-rgb), .72); color: var(--ink); cursor: pointer; font: inherit; }
.fm-card b { font: 600 24px/1.2 var(--display); }
.fm-w b { font: 600 19px/1.2 var(--display); }
.fm-card small, .fm-w small { color: var(--muted); font-size: 15px; line-height: 1.35; }
.fm-card:hover, .fm-w:hover, .fm-card:focus-visible, .fm-w:focus-visible { border-color: var(--accent); background: var(--hover); }
.fm-weapons { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fm-best { margin: 0; color: var(--muted); }
.fm-best.new { color: var(--accent); font-weight: 600; }
.fm-score { margin: 0; font-size: 20px; }
.fmode .btnrow { justify-content: center; }
/* A champion takes the field on the older fight screen (battle.js champArrive, item 22): his name in gold over the arena,
   the edges darkened, for about two seconds. */
.b-champ { position: fixed; inset: 0; z-index: 60; display: grid; align-content: start; justify-items: center; gap: 4px; padding: 13vh 16px 0; text-align: center; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, transparent 40%, rgba(10, 6, 3, 0.72) 100%); animation: b-champ 2.2s ease both; }
.b-champ.off { opacity: 0; transition: opacity .4s ease; }
.b-champ b { font: 700 clamp(28px, 7.5vw, 50px)/1.15 var(--display); color: #fff3d6; text-shadow: 0 3px 12px rgba(0, 0, 0, 0.9), 0 0 22px rgba(255, 170, 80, 0.55); }
html[lang="hi"] .b-champ b { line-height: 1.35; }
.b-champ small { font: 600 clamp(13px, 3.4vw, 16px)/1.3 var(--text); color: #f3d48d; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); letter-spacing: .04em; }
.b-champ em { display: block; margin-top: 4px; font: italic 500 clamp(12px, 3.1vw, 15px)/1.3 var(--text); color: #ffe7b8; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95); } /* his trait (stage 2) */
@keyframes b-champ { 0% { opacity: 0; } 12% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 1; } }
.b-champ b { animation: b-champ-name 2.2s ease both; } @keyframes b-champ-name { 0% { transform: translateY(8px) scale(0.96); } 15% { transform: none; } }
.arena .actor.champ-in svg { animation: champ-in 0.9s ease-out; } @keyframes champ-in { 0% { filter: drop-shadow(0 0 0 rgba(255, 190, 90, 0)); } 30% { filter: drop-shadow(0 0 18px rgba(255, 190, 90, 0.95)); } 100% { filter: none; } }
html.calm .b-champ, html.calm .b-champ b, html.calm .arena .actor.champ-in svg { animation: none; }
/* The lamp game's twists (trials.js trial.twist, owner 5 November): a second lamp on the wall, the moon, the dog. */
.sneakway .beam .pool2 { fill: rgba(255, 214, 140, 0); transition: fill .2s; }
.sneakway .beam .pool2.warn { fill: rgba(255, 214, 140, 0.18); animation: pool-flicker .18s steps(2) infinite; }
.sneakway .beam .pool2.on { fill: rgba(255, 214, 140, 0.6); }
@keyframes pool-flicker { 50% { fill: rgba(255, 214, 140, 0.05); } }
.sneakway .walllamp { position: absolute; top: 38%; width: 16px; height: 22px; margin-left: -8px; z-index: 1; border-radius: 50% 50% 40% 40%; background: #6b4220; box-shadow: 0 0 0 2px #24120a, 0 0 10px 3px rgba(255, 190, 100, 0.3); }
.sneakway .walllamp::after { content: ""; position: absolute; left: 50%; top: 100%; width: 3px; height: 20px; margin-left: -1.5px; background: #24120a; } /* its bracket */
.sneakway .walllamp.on::before { content: ""; position: absolute; left: 50%; top: 100%; width: 90px; height: 260px; margin-left: -45px; pointer-events: none; background: linear-gradient(rgba(255, 214, 140, 0.45), rgba(255, 214, 140, 0)); clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%); mix-blend-mode: screen; } /* its light, down to the ground */
.sneakway .walllamp.warn { background: #c98a3a; animation: lamp-flicker .18s steps(2) infinite; }
.sneakway .walllamp.on { background: #ffd27a; box-shadow: 0 0 0 2px #24120a, 0 0 18px 6px rgba(255, 200, 110, 0.75); }
@keyframes lamp-flicker { 50% { background: #5a3418; } }
.sneakway .moonwash { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: rgba(180, 200, 235, 0); transition: background .6s; }
.sneakway.moonsoon .moonwash { background: rgba(180, 200, 235, 0.08); }
.sneakway.moonlit .moonwash { background: rgba(190, 210, 245, 0.26); }
.sneakway .moonball { position: absolute; top: 6%; right: 8%; width: 26px; height: 26px; border-radius: 50%; z-index: 0; background: #e8ecf5; opacity: .25; box-shadow: 0 0 0 0 rgba(220, 230, 255, 0); transition: opacity .6s, box-shadow .6s; }
.sneakway.moonsoon .moonball { opacity: .55; }
.sneakway.moonlit .moonball { opacity: 1; box-shadow: 0 0 26px 10px rgba(220, 230, 255, 0.55); }
.noise { display: flex; align-items: center; gap: 8px; align-self: center; width: min(78%, 420px); font-size: 13px; color: var(--muted); }
.noise b { font-weight: 600; white-space: nowrap; }
.noise span { flex: 1; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.noise i { display: block; height: 100%; width: 0; background: #d9a53a; }
.noise.bark b { color: var(--negative); }
.trial.immersive .noise { padding: 3px 10px; border-radius: 999px; background: rgba(var(--surface-rgb), 0.6); border: 1px solid var(--gold-line); color: var(--ink); }
html.calm .sneakway .beam .pool2.warn, html.calm .sneakway .walllamp.warn { animation: none; }
/* Orders for the day (ui/orders.js; owner, 6 November): the commander's orders over the whole screen, a dark card on the
   day's painting: who gives them, what happened, the army's aim, your orders, and "To your place" */
.moment.orders { display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--sat, 0px)) 16px calc(16px + var(--sab, 0px)); cursor: default; }
.moment.orders .mo-art { filter: brightness(.42) saturate(.75) blur(2px); }
.moment.orders.in .mo-art { animation: mo-zoom 14s ease-out forwards; }
.ord { position: relative; z-index: 2; width: min(600px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 18px; border-radius: 14px; background: rgba(24, 15, 10, .9); border: 1px solid var(--gold-line); outline: 1px solid rgba(226, 181, 90, .18); outline-offset: -7px; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); color: #efe2cc; font-family: var(--text); }
.ord:focus { outline: 1px solid rgba(226, 181, 90, .18); }
.ord-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ord-face { flex: none; width: 74px; height: 74px; border-radius: 50%; background: var(--img) center 20% / cover; box-shadow: 0 0 0 2px #d9a53a, 0 0 0 5px rgba(20, 12, 6, .85), 0 6px 16px rgba(0, 0, 0, .5); }
.ord-who small { display: block; font: 700 13px/1.2 var(--text); letter-spacing: .08em; text-transform: uppercase; color: #e2b55a; }
.ord-who b { display: block; font: 700 clamp(26px, 6vw, 34px)/1.08 var(--display); color: #f3d27a; }
.ord-who span { display: block; font: 500 15px/1.3 var(--text); color: #d8c9b0; }
.ord section { border-top: 1px solid rgba(226, 181, 90, .25); padding: 11px 0 3px; }
.ord h3 { margin: 0 0 5px; font: 700 13px/1.2 var(--text); letter-spacing: .08em; text-transform: uppercase; color: #c9a86a; }
.ord ul { margin: 0; padding-left: 18px; } .ord li { margin: 0 0 5px; font: 400 16px/1.45 var(--text); }
.ord p { margin: 0 0 6px; font: 400 16px/1.45 var(--text); }
.ord .ord-mine { margin-top: 6px; color: #d9cdb7; font-style: italic; } .ord .ord-mine b { font-style: normal; color: #e2b55a; margin-right: 4px; }
.ord .ord-today p { font: 600 19px/1.35 var(--display); color: #f1e4cc; }
.ord .ord-you { margin-top: 2px; padding: 11px 14px 7px; border: 1px solid rgba(226, 181, 90, .55); border-radius: 10px; background: rgba(226, 181, 90, .1); }
.ord .ord-you p { font: 700 20px/1.35 var(--display); color: #f3d27a; }
.ord .btnrow { display: flex; justify-content: flex-end; margin-top: 14px; }
.ord .ord-go { min-height: 48px; padding: 0 22px; }
html[lang="hi"] .ord-who b, html[lang="hi"] .ord .ord-today p, html[lang="hi"] .ord .ord-you p { line-height: 1.5; }
html[lang="hi"] .ord h3, html[lang="hi"] .ord-who small { letter-spacing: 0; text-transform: none; font-size: 14px; }
@media (max-width: 420px) { .ord { padding: 18px 16px 14px; } .ord-face { width: 60px; height: 60px; } .ord li, .ord p { font-size: 15px; } .ord .ord-today p { font-size: 17px; } .ord .ord-you p { font-size: 18px; } }

/* ---------- Character creation: one page, never a scroll (owner, 6 November) ----------
   The map fills the screen; a land's card rises over it; then one question at a time over the land's painting.
   From the owner's reference: a big picture, quiet lowercase heads, em-dash labels ("the land — Panchala"). */
.cr { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; background: var(--ground); color: var(--ink); overflow: hidden; }
.cr-top { position: relative; z-index: 3; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "home kick dots" "home title title"; align-items: end; gap: 2px 12px;
  padding: calc(max(10px, var(--sat, 0px)) + 4px) max(16px, var(--sar, 0px)) 12px max(10px, var(--sal, 0px)); background: var(--ground); }
.cr-home { grid-area: home; align-self: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.cr-home:hover { background: var(--raised); color: var(--ink); }
.cr-head { display: contents; }
.cr-kick { grid-area: kick; margin: 0; font-size: 13px; letter-spacing: .06em; color: var(--faint); text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-kick::after { content: "\00a0\2014"; }
.cr-title { grid-area: title; min-width: 0; margin: 2px 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(30px, 7.4vw, 50px); line-height: 1.02; text-transform: lowercase; letter-spacing: -.005em; }
.cr[data-step="land"] .cr-title::after { content: none; }
.cr.asking .cr-title::after { content: "."; }
:lang(hi) .cr.asking .cr-title::after, :lang(hi) .cr-name::after { content: none; }
.cr-dots { grid-area: dots; display: flex; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; align-self: end; }
.cr-dots li { width: 10px; height: 2px; border-radius: 1px; background: var(--track); transition: background-color .3s, width .3s; }
.cr-dots li.done { background: var(--gold-line); }
.cr-dots li.on { width: 18px; background: var(--data); }
.cr-mid { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #c0975d; } /* the painted map's paper edge */
.cr-map { position: absolute; inset: 0; transition: opacity .5s ease; }
.cr-map .bmap { width: 100%; height: 170%; border-radius: 0; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.cr-map .m-home { cursor: pointer; }
.cr-map .m-home.on circle:not(.hit) { fill: #c8471f; }
.cr-map .m-home.on text { font-weight: 700; }
.cr-map .m-home:focus-visible { outline: none; }
.cr-map .m-home:focus-visible text { text-decoration: underline; }
.cr-art { position: absolute; inset: 0; pointer-events: none; background: var(--img, none) center 40% / cover no-repeat, var(--surface); opacity: 0; transform: scale(1.04); transition: opacity .7s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1); }
.cr-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(var(--ground-rgb), .82), rgba(var(--ground-rgb), .15) 46%, rgba(var(--ground-rgb), 0) 70%); } /* taste-skill-ignore: scrim under the answers on a picture */
.cr.asking .cr-art { opacity: 1; transform: none; }
.cr.asking .cr-map { opacity: 0; pointer-events: none; }
.cr-sum { position: absolute; z-index: 2; top: 6px; left: max(10px, var(--sal, 0px)); right: 12px; display: grid; justify-items: start; gap: 0; }
.cr-row { display: inline-flex; align-items: baseline; gap: 8px; border: 0; background: transparent; color: var(--ink); padding: 3px 6px; border-radius: var(--r-control); cursor: pointer; text-align: left; animation: cr-in .4s ease both; }
.cr-row:hover { background: rgba(var(--ground-rgb), .55); }
.cr-row .k { font-size: clamp(12.5px, 1.3vw, 15px); letter-spacing: .05em; color: var(--muted); text-transform: lowercase; white-space: nowrap; }
.cr-row .k::after { content: "\00a0\2014"; }
.cr-row b { font-family: var(--display); font-size: clamp(17px, 2.2vw, 24px); font-weight: 600; text-transform: lowercase; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.cr-hint { position: absolute; z-index: 2; left: 50%; bottom: max(16px, var(--sab, 0px)); transform: translateX(-50%); margin: 0; padding: 7px 14px; border-radius: 999px; background: rgba(var(--ground-rgb), .86); color: var(--ink);
  font-size: 14px; letter-spacing: .04em; text-transform: lowercase; white-space: nowrap; transition: opacity .3s; pointer-events: none; }
.cr-hint::after { content: "\00a0\2014"; }
.cr.looking .cr-hint, .cr.asking .cr-hint { opacity: 0; }
.cr .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The homeland map, dressed (owner, 7 November): mountains, forests, dunes, waves, a drawing at each land, boats,
   birds, the rivers' light, a compass rose and a cartouche; an old map's double rule round the box. */
.cr-map::after { content: ""; position: absolute; inset: 7px; border: 3px double rgba(90, 58, 34, .55); border-radius: 3px; pointer-events: none; }
.bmap.dressed .m-land { fill: #ead9b0; }
.bmap.dressed .m-hills { opacity: .35; }
.bmap .dress .mt-l { fill: #e6d3a8; stroke: #7a5634; stroke-width: .8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bmap .dress .mt-r { fill: #b99a6a; stroke: #7a5634; stroke-width: .8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bmap .dress .mt-snow { fill: #fbf6ea; }
.bmap .dress .mt.far { opacity: .7; }
.bmap .dress .tr .tr-c { fill: #6d8a52; stroke: #3f5a2c; stroke-width: .8; vector-effect: non-scaling-stroke; }
.bmap .dress .tr .tr-t { stroke: #5a3a22; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.bmap .dress .dn path { fill: none; stroke: #b98d4e; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.bmap .dress .wv path { fill: none; stroke: #6f9493; stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.bmap .dress .lm .lm-f { fill: #8a5a32; stroke: #3b2414; stroke-width: .9; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bmap .dress .lm .lm-l { fill: none; stroke: #3b2414; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.bmap .dress .lm-palace .lm-f { fill: #efdcb0; }
.bmap .dress .lm .lm-roof { fill: #a87a40; stroke: #3b2414; stroke-width: .9; vector-effect: non-scaling-stroke; }
.bmap .dress .lm .lm-cloth { fill: #b2432a; stroke: #3b2414; stroke-width: .8; vector-effect: non-scaling-stroke; }
.bmap .dress .lm .lm-fire { fill: #e2742a; } .bmap .dress .lm .lm-fire2 { fill: #f6c64e; }
.bmap .dress .lm .lm-sail { fill: #f3e7c6; stroke: #3b2414; stroke-width: .8; vector-effect: non-scaling-stroke; }
.bmap .dress .bd path { fill: none; stroke: #3b2414; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.bmap .dress .m-shine { fill: none; stroke: #e9f4f2; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 3 26; opacity: .8; animation: m-shine 9s linear infinite; }
@keyframes m-shine { to { stroke-dashoffset: -116; } }
.bmap .dress .m-boat { animation: m-boat 16s ease-in-out infinite alternate; }
@keyframes m-boat { from { transform: translate(-6px, 0); } to { transform: translate(8px, 1px); } }
.bmap .dress .m-bird { animation: m-bird 34s linear infinite; }
@keyframes m-bird { 0% { transform: translate(-60px, 6px); opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(140px, -10px); opacity: 0; } }
.bmap .dress .m-water.dry { fill: #8a7a5a; }
.bmap .dress .cp .cp-r { fill: rgba(236, 220, 182, .85); stroke: #7a5634; stroke-width: 1; vector-effect: non-scaling-stroke; }
.bmap .dress .cp .cp-r2 { fill: none; stroke: #7a5634; stroke-width: .6; vector-effect: non-scaling-stroke; }
.bmap .dress .cp .cp-s { fill: #b2432a; } .bmap .dress .cp .cp-d { fill: #3b2414; }
.bmap .dress .cp .cp-n { font-size: 9px; font-weight: 700; fill: #3b2414; stroke: none; }
.bmap .dress .ct .ct-b { fill: rgba(239, 226, 192, .92); stroke: #7a5634; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.bmap .dress .ct .ct-i { fill: none; stroke: #b2432a; stroke-width: .6; vector-effect: non-scaling-stroke; }
/* The painted map (7 November): its own aged-paper edge round it, and a light halo so the small names read on the
   painted paper. */
.bmap.painted { background: #c0975d; }
.bmap.painted .m-water, .bmap.painted .m-region { paint-order: stroke; stroke: rgba(240, 226, 190, .72); stroke-width: 2.6px; stroke-linejoin: round; }
.bmap .dress .ct .ct-t { font-size: 13px; font-weight: 700; letter-spacing: .06em; fill: #3b2414; stroke: none; }
.bmap .dress .ct .ct-s { font-size: 7.5px; font-style: italic; fill: #7a5634; stroke: none; }
.bmap .dress text { paint-order: stroke; }

/* The card: over the map when a land is looked at, and under each question after. */
.cr-card { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: calc(100% - 64px); overflow: auto; overscroll-behavior: contain;
  display: grid; gap: 10px; padding: 16px max(18px, var(--sar, 0px)) calc(max(14px, var(--sab, 0px)) + 4px) max(18px, var(--sal, 0px));
  background: var(--surface); border-top: 1px solid var(--gold-line); border-radius: 16px 16px 0 0; box-shadow: 0 -18px 40px rgba(0, 0, 0, .35);
  transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .5s cubic-bezier(.2, .8, .2, 1), visibility 0s .5s; }
.cr.looking .cr-card, .cr.asking .cr-card { transform: none; visibility: visible; transition: transform .5s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
@media (min-width: 700px) and (min-height: 560px) { .cr-card { bottom: 22px; border-radius: 16px; border: 1px solid var(--gold-line); } }
.cr-panel { display: grid; gap: 10px; align-content: start; animation: cr-in .45s ease both; }
.cr-panel[hidden] { display: none; }
@keyframes cr-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cr-n { margin: 0; font-family: var(--display); font-size: 15px; color: var(--data); letter-spacing: .08em; }
.cr-n::after { content: "\00a0\2014"; }
.cr-q { margin: -4px 0 2px; font-family: var(--display); font-weight: 600; font-size: clamp(25px, 6.4vw, 32px); line-height: 1.08; text-transform: lowercase; }
.cr-q:focus { outline: none; }
.cr-lbl { font-size: 13px; letter-spacing: .05em; color: var(--muted); text-transform: lowercase; }
.cr-lbl::after { content: "\00a0\2014"; }
.cr-go { justify-self: stretch; text-transform: lowercase; letter-spacing: .02em; }
.cr-go::after { content: "\00a0\00a0\2192"; }
.cr-back { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: var(--muted); font-size: 14px; text-transform: lowercase; padding: 6px 8px; cursor: pointer; border-radius: var(--r-control); }
.cr-back::before { content: "\2039\00a0"; }
.cr-back:hover { color: var(--ink); background: var(--raised); }
.cr-back[hidden] { display: none; }
.cr .err { margin: 0; }
.cr .err:empty { display: none; }

/* The questions (owner, 7 November): the land's painting in half the page with you in it as the child of six, the
   questions in the other half; on a phone top and bottom, on a wide screen left and right. */
.cr-kid { position: absolute; z-index: 1; left: 70%; bottom: 3%; transform: translateX(-50%); display: grid; justify-items: center; opacity: 0; pointer-events: none; transition: opacity .5s ease, left .5s ease; }
.cr.asking .cr-kid { opacity: 1; }
.cr-kid svg { display: block; overflow: visible; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }
.cr-kid .cr-shadow { display: block; width: 70%; height: 12px; margin-top: -10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); }
.cr-kid.pop svg { animation: cr-pop .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes cr-pop { from { transform: translateY(8px) scale(.95); opacity: .5; } to { transform: none; opacity: 1; } }
.cr.asking .cr-mid { flex: 0 1 50%; min-height: 26%; }
.cr.asking .cr-card { position: relative; bottom: auto; flex: 1 0 auto; max-height: none; margin: -14px auto 0; align-content: start; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .cr.asking { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .cr.asking .cr-top { grid-column: 1 / -1; }
  .cr.asking .cr-mid { grid-column: 1; grid-row: 2; min-height: 0; }
  .cr.asking .cr-card { grid-column: 2; grid-row: 2; width: auto; max-width: none; margin: 0; border: 0; border-left: 1px solid var(--gold-line); border-radius: 0; box-shadow: none;
    align-content: center; justify-items: center; padding: clamp(28px, 4vw, 64px); }
  .cr.asking .cr-card > .cr-panel, .cr.asking .cr-card > .err { width: min(100%, 520px); }
  .cr.asking .cr-kid { left: 56%; }
  .cr.asking .cr-q { font-size: clamp(30px, 2.6vw, 40px); }
}

/* A land, looked at */
.cr-plate { position: relative; margin: -16px -18px 2px; aspect-ratio: 16 / 7; max-height: min(24vh, 210px); width: calc(100% + 36px); border-radius: 16px 16px 0 0; background: var(--img) center / cover no-repeat, var(--raised); }
@media (min-width: 700px) and (min-height: 560px) { .cr-plate { border-radius: 15px 15px 0 0; } }
.cr-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(var(--ground-rgb), .78); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.cr-name { margin: -6px 0 0; font-size: clamp(32px, 8vw, 44px); line-height: 1; }
.cr-name::after { content: "."; }
.cr-region { margin: -6px 0 0; font-size: 14px; color: var(--data); }
.cr-text { margin: 0; font-size: 15.5px; line-height: 1.45; }
.cr-gives { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.cr-gives .chip { font-size: 13px; padding: 2px 8px; }

/* The questions */
.cr-namerow { display: grid; gap: 12px; }
.cr #pname { width: 100%; font-family: var(--display); font-size: 30px; font-weight: 600; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--gold-line); border-radius: 0; padding: 4px 2px 6px; }
.cr #pname::placeholder { color: var(--faint); opacity: .7; }
.cr #pname:focus { outline: none; border-bottom-color: var(--accent); }
.cr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cr-two .opt { min-height: 64px; font-family: var(--display); font-size: 24px; font-weight: 600; text-transform: lowercase; border-radius: var(--r-card); }
.cr-picks { grid-template-columns: 1fr 1fr; gap: 8px; }
.cr-picks .pick { grid-template-columns: 52px 1fr; grid-template-rows: auto auto; justify-items: start; align-items: center; text-align: left; gap: 0 10px; padding: 8px 10px; }
.cr-picks .pick i { grid-row: span 2; width: 52px; height: 52px; border-radius: var(--r-control); }
.cr-picks .pick.round i { width: 52px; border-radius: 50%; }
.cr-picks .pick b { font-size: 19px; align-self: end; text-transform: lowercase; }
.cr-picks .pick small { font-size: 13px; align-self: start; line-height: 1.25; }
.cr-picks .pick:hover { transform: none; }
.cr .toggle { font-size: 16px; }
.cr-past { display: grid; gap: 6px; }
.cr .pasts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; }
.cr .pasts .pick { grid-template-columns: 34px 1fr; justify-items: start; text-align: left; gap: 0 8px; padding: 6px 8px; }
.cr .pasts .pick i { grid-row: span 2; width: 34px; height: 34px; aspect-ratio: 1; border-radius: 50%; }
.cr .pasts .pick b { font-size: 16px; }
.cr .pasts .pick small { font-size: 12px; }
@media (max-width: 400px) {
  .cr-picks { gap: 6px; }
  .cr-picks .pick { grid-template-columns: 38px 1fr; padding: 6px 8px; gap: 0 8px; }
  .cr-picks .pick i, .cr-picks .pick.round i { width: 38px; height: 38px; }
  .cr-picks .pick b { font-size: 16.5px; line-height: 1.1; }
  .cr-picks .pick small { font-size: 12px; }
}
@media (max-height: 700px) { .cr-plate { max-height: 17vh; } .cr-row { padding: 1px 6px; } .cr-row b { font-size: 16.5px; } }
@media (max-height: 640px) {
  .cr-title { font-size: clamp(26px, 7vw, 40px); }
  .cr-q { font-size: 24px; }
  .cr-text { font-size: 14.5px; line-height: 1.4; }
  .cr-plate { max-height: 15vh; }
  .cr-card { gap: 8px; padding-top: 14px; }
  .cr-picks .pick { padding: 6px 8px; }
  .cr-picks .pick i { width: 44px; height: 44px; }
  .cr-picks .pick.round i { width: 44px; }
}
/* (Calm motion, html.calm in base.css, stills the card, the map and the steps like everything else) */

/* The creation page's opening (owner, 7 November): the two lines alone on the dark ground, large, in the middle; they move
   up to their places in the header, then the map, the controls and the rest come in (.intro-out). Calm motion: no move. */
.cr-intro { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; background: var(--ground); pointer-events: none; text-align: center; transition: background-color .9s ease; }
.cr-intro .cr-kick, .cr-intro .cr-title { margin: 0; max-width: none; white-space: nowrap; overflow: visible; opacity: 0; transform-origin: 0 0; transition: opacity .8s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
.cr-intro .cr-kick { font-size: clamp(15px, 2.2vw, 22px); }
.cr-intro .cr-title { font-size: clamp(34px, 9vw, 96px); transition-delay: .45s, 0s; }
.cr-intro.on .cr-kick, .cr-intro.on .cr-title { opacity: 1; }
.cr-intro.moving { background-color: transparent; }
.cr-intro.moving .cr-title { transition-delay: 0s; }
.cr.intro .cr-top .cr-kick, .cr.intro .cr-top .cr-title, .cr.intro .cr-home, .cr.intro .cr-dots, .cr.intro .cr-mid, .cr.intro .cr-card { opacity: 0; }
.cr.intro-out .cr-home, .cr.intro-out .cr-dots, .cr.intro-out .cr-mid { animation: cr-in-after .7s ease both; }
@keyframes cr-in-after { from { opacity: 0; } }
html.calm .cr-intro, html.calm .cr-intro .cr-kick, html.calm .cr-intro .cr-title { transition: none; }
html.calm .cr.intro-out .cr-home, html.calm .cr.intro-out .cr-dots, html.calm .cr.intro-out .cr-mid { animation: none; }
