/* Suchka UI (client/ui): the medieval kit and the interaction rules - ported from the prototype (tools/character-panel/web) */
@import url("/fonts/fonts.css"); /* self-hosted (tools/release/fonts.py) */
/* shared look for the gameplay prototypes (portrait, first person) */
:root {
  --bg: #07080f;
  --ink: #ece8f2;
  --dim: #8a87a0;
  --acc: #e8b878;
  --red: #ff3b3b;
  --ok: #5be37d;
  --blue: #7ab8ff;
  --paper: #efe6d2;
  --cork: #8a6a44;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 -apple-system, "PingFang SC", sans-serif;
  overflow: hidden;
}
/* no iOS rubber-band anywhere: the page never scrolls; panels that do scroll (a letter, a long list) scroll only up and down
   and never pass the scroll on to the page */
html,
body {
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  touch-action: manipulation;
} /* no double-tap zoom either */
.game * {
  overscroll-behavior: contain;
}
.scrolly,
#letter,
.panel,
.sheet-modal .pp,
#book .pg,
#notes {
  overflow-x: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-y;
}
.layer-open > .prompt {
  display: none !important;
} /* a layer (letter, map) is the one focus: no scene prompt over it */
#wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game {
  position: relative;
  aspect-ratio: 9 / 16;
  height: min(100vh, 177.78vw);
  overflow: hidden;
  background: #0b0c14;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hud {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  padding: 10px 12px;
}
.top {
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: var(--dim);
  background: linear-gradient(#000c, transparent);
}
.top a {
  pointer-events: auto;
  color: var(--acc);
  text-decoration: none;
}
.top .gear-btn + a {
  margin-left: 0;
}
.toast {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 64px;
  text-align: center;
  font-size: 16px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #000c;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  z-index: 50;
}
.toast.on {
  opacity: 1;
}
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #000d;
  text-align: center;
  padding: 24px;
  z-index: 60;
}
.panel.hidden {
  display: none;
}
.panel h2 {
  margin: 0;
  font-size: 26px;
}
.panel p {
  margin: 0;
  color: var(--dim);
  max-width: 340px;
  font-size: 16px;
  line-height: 1.55;
}
.btn {
  pointer-events: auto;
  font: inherit;
  font-size: 17px;
  padding: 11px 22px;
  border-radius: 20px;
  border: 0;
  background: var(--ink);
  color: #111;
  cursor: pointer;
}
.btn.ghost {
  background: #ffffff1c;
  color: var(--ink);
}
.help {
  bottom: 0;
  font-size: 13px;
  color: var(--dim);
  text-align: center;
  background: linear-gradient(transparent, #000b);
}
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  background-image: radial-gradient(#fff 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}

/* ---- medieval UI (Suchka): parchment, wax seals, old oak and rusty iron - Grok-made pieces, 9-slice (make_9slice.py),
   icons cut from Grok sheets (cut_icons.py) under /world/ui/medieval/. Prefer pictures to words: an icon + a number. ---- */
:root {
  --ui: /world/ui/medieval;
}
.btn,
.btn.ghost,
#panel button,
#items button,
#diffs button,
#speeds button,
#startbtn,
.study {
  background: none;
  color: #2a1a0c;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 18px;
  padding: 2px 6px;
  min-height: 0;
  line-height: 22px;
  font-weight: 700;
  border-image: url(/world/ui/medieval/9s/btn-strip.png) 40 64 fill / 10px 18px stretch;
  text-shadow: 0 1px 0 #f3e2b866;
  letter-spacing: .06em;
  border-radius: 0;
  font-family: "LXGW WenKai Screen", "LXGW WenKai TC", "Noto Serif SC", serif;
  filter: drop-shadow(0 3px 4px #000a);
  transition: transform .14s ease, filter .14s ease;
}
/* ONE button look everywhere (2026-10-16): a torn parchment strip with dark ink words (Grok, btn-strip.png). Two or more
   choices are ink lines on a sheet (PICK.ink); icon controls (arrows, zoom, turn) are small forged-iron knobs (.knob) */
.btn:hover,
.btn.sel,
#panel button:hover,
#items button:hover,
#diffs button:hover,
#diffs button.sel,
#speeds button:hover,
#speeds button.sel,
#startbtn:hover,
.study:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 6px 6px #000b) drop-shadow(0 0 10px #ffc87a88) brightness(1.06);
}
.btn:active {
  filter: drop-shadow(0 2px 2px #000a) brightness(.88);
  transform: translateY(2px) scale(.98);
  transition-duration: .05s;
}
.btn:focus-visible {
  outline: 2px solid #f0dfbf;
  outline-offset: 2px;
}
#items button:disabled,
#diffs button:not(.sel),
#speeds button:not(.sel) {
  opacity: .75;
}
#items button:disabled {
  opacity: .35;
}
.btn:disabled {
  filter: grayscale(.6) brightness(.7);
}
.knob,
.edge,
#ccw,
#cw,
#zoomBox button,
#zoomui button,
#pad button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: url(/world/ui/medieval/9s/knob.png) center / contain no-repeat;
  color: #e8cf8a;
  font: 700 20px/44px Georgia, serif;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  filter: drop-shadow(0 3px 4px #000b);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .14s, filter .14s;
}
.knob:hover,
.edge:hover,
#zoomBox button:hover,
#zoomui button:hover,
#pad button:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 3px 4px #000b) drop-shadow(0 0 8px #ffc87a99);
}
.knob:active,
.edge:active,
#zoomBox button:active,
#zoomui button:active,
#pad button:active {
  transform: scale(.94);
  filter: brightness(.85);
}
/* result / end panels: a sheet of old parchment in the middle, the scene darkened around it */
.panel {
  inset: auto 5% auto 5%;
  top: 50%;
  transform: translateY(-50%);
  max-height: 92%;
  overflow: auto;
  background: none;
  color: #2a1a0c;
  border: 34px solid transparent;
  padding: 0 6px;
  background: url(/world/ui/medieval/9s/panel-parchment-full.png) center / 100% 100% no-repeat;
  background-origin: border-box;
  box-shadow: 0 0 0 200vmax #000000c4;
}
.panel h2 {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-weight: 400;
  font-size: 30px;
  letter-spacing: .04em;
  color: #3a1608;
}
.panel p {
  color: #4a3420;
}
/* one-way result cards (see proto-data.js): no button, a faint breathing line instead */
.panel.ack .btn,
.panel.ack button,
.panel.ack a[href] {
  display: none;
}
.ack-hint {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: .2em;
  color: #6a4a2a;
  animation: ack-breathe 2.4s ease-in-out infinite;
}
@keyframes ack-breathe {
  0%,
  100% {
    opacity: .35;
  }
  50% {
    opacity: .85;
  }
}
/* icons: <img class="ico" src="/world/ui/medieval/icons/coin.png"> next to a number */
.ico {
  width: 22px;
  height: 22px;
  vertical-align: -6px;
  filter: drop-shadow(0 1px 2px #000c);
}
.ico.l {
  width: 34px;
  height: 34px;
  vertical-align: -10px;
}

/* shared interaction rules (proto-data.js PICK): the prompt that hides the choices, the blurred picture behind them */
.prompt {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 2px 2px;
  max-width: 86%;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 18px;
  border-image: url(/world/ui/medieval/9s/btn-strip.png) 40 64 fill / 10px 18px stretch;
  background: none;
  color: #2a1a0c;
  font: 700 15px "LXGW WenKai Screen", "Noto Serif SC", serif;
  letter-spacing: .12em;
  white-space: nowrap;
  cursor: pointer;
  filter: drop-shadow(0 3px 4px #000a);
  animation: prompt-in .35s ease-out, prompt-glow 2.4s ease-in-out .35s infinite;
}
.prompt span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.prompt kbd {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 4px;
  font: 700 14px Georgia, serif;
  letter-spacing: 0;
  color: #e8cf8a;
  background: radial-gradient(circle at 40% 35%, #4a3a2a, #1a120a);
  box-shadow: inset 0 0 0 1px #b8954a88, 0 1px 2px #000;
}
background: url(/world/ui/medieval/9s/panel-parchment-full.png) center / cover;
box-shadow: inset 0 -2px 0 #0004, 0 1px 2px #000;
}
.prompt:hover {
  filter: drop-shadow(0 3px 4px #000a) drop-shadow(0 0 10px #ffc87a99);
}
@media (pointer: coarse) {
  .prompt kbd {
    display: none;
  }
  .prompt {
    padding: 4px 10px;
  }
}
@keyframes prompt-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}
@keyframes prompt-glow {
  50% {
    filter: drop-shadow(0 3px 4px #000a) drop-shadow(0 0 9px #ffc87a77);
  }
}
.pick-shut {
  display: none !important;
}
.pick-bg {
  transition: filter .35s, transform .35s;
}
.menu-open .pick-bg {
  filter: blur(4px) brightness(.5);
  transform: scale(1.04);
}

/* rule 2: every choice is a line of ink (PICK.ink). A sheet of parchment holds the lines (or the result card itself does);
   a red drop marks the line under the pointer / keyboard focus; confirming smears it under the words */
.ink-sheet {
  animation: sheet-in .4s cubic-bezier(.16, .84, .3, 1);
  color: #2a1a0c;
  border: 26px solid transparent;
  padding: 4px 8px 4px 40px;
  background: url(/world/ui/medieval/9s/panel-parchment-full.png) center / 100% 100% no-repeat;
  background-origin: border-box;
  filter: drop-shadow(0 10px 18px #000c);
}
.ink-opt {
  position: relative;
  z-index: 0;
  display: block;
  width: auto;
  margin: 0;
  padding: 7px 4px;
  border: 0;
  background: none;
  box-shadow: none;
  text-decoration: none;
  text-align: left;
  font: 18px/1.45 "LXGW WenKai Screen", "LXGW WenKai TC", "Noto Serif SC", serif;
  color: #2a1a0c;
  text-shadow: none;
  cursor: pointer;
  transition: opacity .3s;
  animation: none;
  filter: none;
  transform: none;
  white-space: normal;
  min-height: 0;
}
.ink-opt:hover,
.ink-opt:active {
  transform: none;
  filter: none;
}
.ink-opt:focus-visible {
  outline: none;
}
.ink-opt::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 8px;
  bottom: 4px;
  height: 2px;
  background: #3a2410;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
  border-radius: 2px;
  opacity: .6;
}
.ink-opt.on::after {
  transform: scaleX(1);
}
.ink-opt:disabled {
  opacity: .4;
  cursor: default;
}
.ink-opt .drop {
  position: absolute;
  left: -30px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  background: center / contain no-repeat;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: scale(.4);
  transition: transform .5s cubic-bezier(.3, .7, .2, 1), opacity .2s;
}
.ink-opt.on .drop {
  opacity: 1;
  transform: scale(1);
  transition: transform .28s cubic-bezier(.4, 1.8, .5, 1), opacity .12s;
}
.ink-opt .smear {
  position: absolute;
  left: -32px;
  top: 50%;
  height: 30px;
  margin-top: -14px;
  width: var(--to, 80%);
  z-index: -1;
  pointer-events: none;
  opacity: .75;
  mix-blend-mode: multiply;
  background: url(/world/ui/medieval/icons/smear.png) left center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .5s cubic-bezier(.3, .7, .2, 1);
}
.ink-opt.smeared .smear {
  clip-path: inset(0 0 0 0);
}
.ink-opt.smeared .drop {
  transform: translateX(28px) scale(1.4, .6);
  opacity: 0;
  transition: transform .5s cubic-bezier(.3, .7, .2, 1), opacity .35s .3s;
}
.ink-list.chosen .ink-opt:not(.smeared) {
  opacity: .3;
}
.ink-sheet:not(:has(button)) {
  display: none;
} /* an emptied choice list leaves no blank sheet */
#panel button,
#diffs button,
#speeds button,
#startbtn {
  font-size: 16px;
  padding: 4px 10px;
}
#diffs,
#speeds {
  gap: 10px !important;
}
.panel.ink-list .ink-opt {
  align-self: center;
  margin: 0 0 0 30px;
} /* a result card's lines stay centred, the drop to their left */
/* one clear focus per screen: while a note is open it is the focus (prompt, arrows and corner tips step back, the picture
   dims); while the choices are up, they are */
.prompt,
.edge,
.tip {
  transition: opacity .3s;
}
.note-open .prompt,
.note-open .edge,
.note-open .tip,
.menu-open .edge,
.menu-open .tip {
  opacity: 0 !important;
  pointer-events: none;
}
.note-open .pick-bg {
  filter: brightness(.6);
}
@keyframes sheet-in {
  from {
    opacity: 0;
    scale: .94;
  }
}
/* rule 7: the way back out of a close-up, top left */
.back-btn {
  position: absolute;
  left: 10px;
  top: 54px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid #d8b56a44;
  border-radius: 4px;
  background: #0d0906c4;
  color: #f0dfbf;
  font: 14px "LXGW WenKai Screen", "Noto Serif SC", serif;
  letter-spacing: .12em;
  cursor: pointer;
  box-shadow: 0 3px 10px #000a;
  transition: opacity .3s, border-color .2s;
}
.back-btn i {
  width: 34px;
  height: 24px;
  background: url(/world/ui/medieval/icons/back.png) center / 150% auto no-repeat;
  filter: drop-shadow(0 1px 1px #000);
}
.back-btn kbd {
  font: 11px Georgia, serif;
  letter-spacing: 0;
  color: #c8b48a;
  border: 1px solid #c8b48a66;
  border-radius: 3px;
  padding: 0 4px;
}
.back-btn:hover {
  border-color: #ffd28aaa;
  color: #fff3d8;
}
.back-btn:hover i {
  filter: drop-shadow(0 0 6px #ffc87a);
}
@media (pointer: coarse) {
  .back-btn kbd {
    display: none;
  }
}
.note-open .back-btn,
.menu-open .back-btn {
  opacity: 0;
  pointer-events: none;
}
/* the icon knobs are whole Grok pictures (symbol cast in the iron, always centred); the button's own text stays for screen readers only */
#toL,
#toR,
.edge.cl,
.edge.cr,
#zIn,
#zOut,
#zin,
#zout,
#fw,
#bk,
#tl,
#tr,
#ccw,
#cw {
  color: transparent !important;
  text-shadow: none !important;
  font-size: 0 !important;
  background-size: contain !important;
}
#toL,
.edge.cl {
  background-image: url(/world/ui/medieval/icons/knob-left.png) !important;
}
#toR,
.edge.cr {
  background-image: url(/world/ui/medieval/icons/knob-right.png) !important;
}
#zIn,
#zin {
  background-image: url(/world/ui/medieval/icons/knob-plus.png) !important;
}
#zOut,
#zout {
  background-image: url(/world/ui/medieval/icons/knob-minus.png) !important;
}
#fw {
  background-image: url(/world/ui/medieval/icons/knob-up.png) !important;
}
#bk {
  background-image: url(/world/ui/medieval/icons/knob-turn.png) !important;
}
#tl,
#ccw {
  background-image: url(/world/ui/medieval/icons/knob-tl.png) !important;
}
#tr,
#cw {
  background-image: url(/world/ui/medieval/icons/knob-tr.png) !important;
}
#pad button {
  width: 50px;
  height: 50px;
}
#pad button:disabled {
  opacity: .3;
}
/* no line with a single orphan character: short centred texts (notes, cards, prompts, panels) balance their lines; long text
   avoids a lonely last word (iOS 17.5+ / Chrome; older browsers just wrap as before) */
p,
li,
h1,
h2,
h3,
h4,
.note,
.txt,
.det,
.sub,
.who,
.meta,
.cap,
.tap,
.toast,
#say,
#sub,
#me,
.hintline {
  text-wrap: pretty;
}
.sheet-modal p,
.sheet-modal h3,
.panel p,
.panel h2,
#card p,
#card h3,
.toast,
.ack-hint,
#sheetView .cap,
.lbl {
  text-wrap: balance;
}
.prompt,
.prompt span,
.lbl,
.btn,
.ink-opt,
.back-btn {
  text-wrap: nowrap;
} /* one-line labels stay one line (text-wrap would undo white-space: nowrap) */
.map-btn {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  margin: 2px 0 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: url(/world/ui/medieval/icons/map.png) center / contain no-repeat;
  filter: drop-shadow(0 2px 3px #000c);
  transition: transform .15s, filter .15s;
}
.map-btn:hover {
  transform: scale(1.1) rotate(-4deg);
  filter: drop-shadow(0 2px 3px #000c) drop-shadow(0 0 8px #ffc87a99);
}

/* ---- HUD pieces (was hud.js) ---- */

/* one forged piece per gauge (emblem + riveted frame + ticks, Grok); the fill is the gauge's own material. The "ghost" is the
   same material, lit up and semi-transparent: on a loss it lingers at the old level then drains; on a gain it runs ahead */
.gauge {
  --v: 1;
  --g: 1;
  position: relative;
  width: 260px;
  background: center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 3px #000c);
}
/* both gauges share one forged frame (the suspicion one is the health frame with the wax seal swapped for a bronze bell) */
.gauge {
  aspect-ratio: 565 / 120;
}
.gauge.health {
  background-image: url(/world/ui/medieval/icons/gauge-health.png);
}
.gauge.suspicion {
  background-image: url(/world/ui/medieval/icons/gauge-suspicion.png);
}
.gauge .ch {
  position: absolute;
  overflow: hidden;
  border-radius: 3px;
}
.gauge .ch {
  left: 20.9%;
  top: 30%;
  width: 75.4%;
  height: 40.8%;
} /* the black slot measured on the frame */
.gauge .emb {
  position: absolute;
  left: -1%;
  top: -3%;
  height: 106%;
  aspect-ratio: 1;
  background: center / contain no-repeat;
  filter: drop-shadow(1px 2px 2px #000c);
} /* an alternative emblem over the cast one */
/* the fill is liquid light rather than a tube texture: a slim rounded column inset in the channel, its colour set by the value
   (health: green when full -> amber -> red when low; suspicion: a dim ember that burns brighter and hotter as it rises), a soft
   feathered leading edge, a highlight along the top, a sheen that drifts along it, and a slow breathing glow that quickens as
   things get worse. The ghost is the same liquid, paler, lingering at the old level. */
.gauge .ch {
  background: #050403;
  box-shadow: inset 0 2px 4px #000;
}
.gauge .ghost,
.gauge .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 0 4px 4px 0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 14px), transparent);
}
.gauge .fill {
  width: calc(var(--v) * 100%);
  transition: width .22s ease-out, background-color .4s;
  background: linear-gradient(180deg, #ffffff55 0, #ffffff14 30%, #00000000 55%, #00000055 100%), linear-gradient(90deg, var(--c2),
    var(--c1));
  box-shadow: 0 0 10px var(--c1);
  animation: g-breathe var(--bp, 3s) ease-in-out infinite;
}
.gauge .fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0, #ffffff40 8%, transparent 16%) 0 0 / 220% 100% no-repeat;
  animation: g-sheen 4.5s linear infinite;
}
.gauge .ghost {
  width: calc(var(--g) * 100%);
  background: linear-gradient(90deg, var(--c2), var(--c1));
  filter: brightness(1.7) saturate(.7);
  opacity: .45;
  transition: width .7s ease-in .5s;
}
.gauge.gain .ghost {
  transition: width .2s ease-out;
}
.gauge.gain .fill {
  transition: width .7s ease-in .4s, background-color .4s;
}
@keyframes g-breathe {
  0%,
  100% {
    filter: brightness(.9);
    box-shadow: 0 0 6px var(--c1);
  }
  50% {
    filter: brightness(1.15);
    box-shadow: 0 0 14px var(--c1);
  }
}
@keyframes g-sheen {
  from {
    background-position: 160% 0;
  }
  to {
    background-position: -60% 0;
  }
}
.gauge.hurt {
  animation: g-hurt .7s ease-out;
}
.gauge.heal {
  animation: g-heal .7s ease-out;
}
@keyframes g-hurt {
  0% {
    filter: drop-shadow(0 2px 3px #000c) drop-shadow(0 0 16px #ff3a2aee) brightness(1.35);
    transform: translateX(-2px);
  }
  15% {
    transform: translateX(2px);
  }
  30% {
    transform: none;
  }
}
@keyframes g-heal {
  0% {
    filter: drop-shadow(0 2px 3px #000c) drop-shadow(0 0 16px #ffd28aee) brightness(1.3);
  }
}
.money {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 16px Georgia, "Times New Roman", serif;
  color: #f0d9a0;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.money img {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 2px #000c);
  transition: filter .2s;
}
.money.roll img {
  filter: drop-shadow(0 0 8px #ffd27acc) brightness(1.3);
}
.money.up b {
  color: #ffe9a8;
  text-shadow: 0 0 8px #ffd27a99;
}
.money.down b {
  color: #ff9a80;
  text-shadow: 0 0 8px #ff4a3a88;
}

.watch {
  position: relative;
  width: 60px;
  aspect-ratio: 332 / 360;
  background: url(/world/ui/medieval/icons/pocketwatch.png) center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 3px #000c);
  flex: none;
}
.watch svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.watch .h,
.watch .m {
  transform-box: view-box;
  transform-origin: 49.7px 53.1px;
  transition: transform 1.6s cubic-bezier(.45, 0, .2, 1);
}
.watch.tick {
  animation: w-tick 1.6s ease-in-out;
}
@keyframes w-tick {
  30% {
    filter: drop-shadow(0 2px 3px #000c) drop-shadow(0 0 10px #ffd27acc) brightness(1.15);
  }
}
@media (prefers-reduced-motion: reduce) {
  .watch .h,
  .watch .m,
  .gauge,
  .gauge .fill,
  .gauge .ghost {
    animation: none !important;
    transition: none !important;
  }
}
/* ---- sheets, tips, settings (was proto-data.js TIPS) ---- */
.gear-btn {
  pointer-events: auto;
  width: 30px;
  height: 30px;
  border: 0;
  padding: 0;
  margin: 0 10px 0 auto;
  background: url(/world/ui/medieval/icons/gear.png) center / contain no-repeat;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px #000);
  transition: transform .4s, filter .2s;
  flex: none;
}
.gear-btn:hover {
  transform: rotate(45deg);
  filter: drop-shadow(0 1px 2px #000) drop-shadow(0 0 6px #ffc87a);
}
.gear-btn.float {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  z-index: 70;
  margin: 0;
} /* pages without a top bar: bottom right, clear of their own HUD */
.sheet-modal {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  background: #000a;
  animation: sm-in .3s ease-out;
}
@keyframes sm-in {
  from {
    opacity: 0;
  }
}
.sheet-modal .ppw {
  position: relative;
  width: 86%;
  translate: 0 -12%;
}
.sheet-modal .pp {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  max-height: calc(min(100vh, 177.78vw) * .72);
  overflow: auto;
  border: 30px solid transparent;
  padding: 4px 14px;
  color: #2a1a0c;
  background: url(/world/ui/medieval/9s/panel-parchment-full.png) center / 100% 100% no-repeat;
  background-origin: border-box;
  filter: drop-shadow(0 12px 22px #000c);
  font: 15px/1.65 "LXGW WenKai Screen", "LXGW WenKai TC", "Noto Serif SC", serif;
  animation: pp-in .45s cubic-bezier(.16, .84, .3, 1);
}
@keyframes pp-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.97);
  }
}
.sheet-modal h3 {
  margin: 0 0 8px;
  font: 400 22px "ZCOOL XiaoWei", serif;
  color: #3a1608;
  text-align: center;
  letter-spacing: .1em;
}
.sheet-modal ul {
  margin: 0;
  padding: 0 0 0 18px;
}
.sheet-modal li {
  margin: 4px 0;
}
.sheet-modal .tap {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .2em;
  color: #6a4a2a;
  animation: ack-breathe 2.4s ease-in-out infinite;
}
.sheet-modal label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.sheet-modal label span {
  width: 4.5em;
  flex: none;
}
.sheet-modal input[type=range] {
  flex: 1;
  accent-color: #8a2a1a;
}
.sheet-modal input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: #8a2a1a;
}
.sheet-modal .row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sheet-modal .row button {
  font: 14px "LXGW WenKai Screen", serif;
  color: #2a1a0c;
  background: #e8d6ae;
  border: 1px solid #6a4a2a88;
  border-radius: 3px;
  padding: 6px 12px;
  cursor: pointer;
}
.sheet-modal .row button:hover {
  background: #f4e6c4;
  box-shadow: 0 0 10px #ffc87a88;
}
.sheet-modal .row button.ink-opt,
.sheet-modal .row button.ink-opt:hover {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 7px 4px;
  font-size: 17px;
}
.sheet-modal .x {
  position: absolute;
  right: -8px;
  top: -12px;
  z-index: 1;
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 3px #000a);
  border: 0;
  background: url(/world/ui/medieval/icons/close.png) center / contain no-repeat;
  cursor: pointer;
}
/* ---- client/ui additions ---- */
.sheet-modal p.c {
  margin: 0 0 8px;
  text-align: center;
}
.sheet-modal .ink-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}
.sheet-modal .ink-row.side {
  flex-direction: row;
  justify-content: center;
  gap: 44px;
}
.sheet-modal .ink-row .ink-opt {
  font-size: 17px;
  padding: 6px 4px;
}
.wallet {
  position: absolute;
  right: 12px;
  top: 38px;
  z-index: 30;
  pointer-events: none;
  font: 700 14px Georgia, serif;
  color: #f0d9a0;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-shadow: 0 1px 3px #000, 0 0 8px #000;
}
.wallet .slots {
  display: flex;
  margin-right: 2px;
}
.wallet .watch {
  width: 36px;
  pointer-events: auto;
  cursor: pointer;
}
