/* Interface of the fight and the growth system. Same language as style.css: serif type with wide tracking, thin warm-gold
   hairlines, smoked-glass panels. Ornament is engraved (hairlines, lozenges, corner ticks) — nothing glows. */
#ui { position: fixed; inset: 0; pointer-events: none; overflow: hidden; color: #e9e2d2; user-select: none; -webkit-user-select: none;
  --gold: #d8c597; --gold-b: #f0e2b8; --hair: rgba(216, 197, 151, 0.42); --hair-f: rgba(216, 197, 151, 0.17); --paper: #f3ebd9; --muted: #bdb4a0; --dim: #8b8373;
  --blood: #ad3f2c; --steel: #a9b8c6; --wrath: #d9a84a; --mana: #97addc; --warn: #d8623f; --good: #b7d489;
  --shade: 0 1px 9px rgba(0, 0, 0, 0.92), 0 0 2px rgba(0, 0, 0, 0.7); }
#ui * { box-sizing: border-box; }
#ui .num { font-family: "Baskerville", "Hoefler Text", "Songti SC", Georgia, serif; font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; letter-spacing: 0.03em; font-weight: 400; }
#ui .sc { font-family: "Hoefler Text", "Baskerville", Georgia, serif; font-size: 10px; letter-spacing: 0.44em; color: var(--gold); text-transform: uppercase; white-space: nowrap; }
#ui svg.g { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; overflow: visible; flex: none; }
#ui svg.g * { vector-effect: non-scaling-stroke; }
#ui svg.g .f { fill: currentColor; stroke: none; }
#ui .kc { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--hair); background: rgba(12, 10, 8, 0.5);
  font-family: "Hoefler Text", "Baskerville", Georgia, serif; font-size: 11px; font-style: normal; letter-spacing: 0.06em; color: var(--paper); line-height: 1; }
#ui .kc.zh { font-family: inherit; font-size: 10px; letter-spacing: 0.2em; padding: 0 5px 0 7px; }
#ui .kc.lit { background: rgba(216, 197, 151, 0.32); border-color: var(--gold-b); color: #fff; transition: none !important; }
/* a game controller in use (#ui[data-input="pad"]; gamepad.js, ui.js keycaps): a key cap shows the button that does the same
   there — data-pad: what that kind of controller prints on it · data-pb: its shape · data-pd: the arm of the d-pad. Drawn, not
   pictured: a round face button, a shoulder's tab, a trigger's, a stick's ring, the d-pad's cross with the arm meant in full
   light, ☰ and ⧉ in hairlines. A cap a controller has no use for (A S D: one stick walks every way) steps aside. */
#ui[data-input="pad"] .kc[data-pb][data-pad] { display: inline-flex; align-items: center; justify-content: center; min-width: 0; padding: 0 5px; font-size: 0; letter-spacing: 0; }
#ui[data-input="pad"] .kc[data-pb][data-pad]::after { content: attr(data-pad); font-size: 10px; letter-spacing: 0.02em; line-height: 1; }
#ui[data-input="pad"] .kc[data-pb="none"][data-pad] { display: none; }
#ui[data-input="pad"] .kc[data-pb="face"][data-pad], #ui[data-input="pad"] .kc[data-pb="stick"][data-pad], #ui[data-input="pad"] .kc[data-pb="dpad"][data-pad] { padding: 0; aspect-ratio: 1; }
#ui[data-input="pad"] .kc[data-pb="face"][data-pad], #ui[data-input="pad"] .kc[data-pb="stick"][data-pad] { border-radius: 50%; }
#ui[data-input="pad"] .kc[data-pb="stick"][data-pad] { box-shadow: inset 0 0 0 2px rgba(12, 10, 8, 0.6), inset 0 0 0 3px var(--hair-f); }
#ui[data-input="pad"] .kc[data-pb="stick"][data-pad]::after { font-size: 7.5px; }
#ui[data-input="pad"] .kc[data-pb="bump"][data-pad] { border-radius: 8px 8px 2px 2px; padding: 0 6px; }
#ui[data-input="pad"] .kc[data-pb="trig"][data-pad] { border-radius: 2px 2px 8px 8px; padding: 0 6px; }
#ui[data-input="pad"] .kc[data-pb="bump"][data-pad]::after, #ui[data-input="pad"] .kc[data-pb="trig"][data-pad]::after { font-size: 9px; }
#ui[data-input="pad"] .kc[data-pb="dpad"][data-pad]::after { content: ""; width: 11px; height: 11px; --arm: rgba(243, 235, 217, 0.3);
  background: linear-gradient(currentColor, currentColor) var(--at, 50% 0) / var(--as, 3px 5px) no-repeat, linear-gradient(var(--arm), var(--arm)) center / 11px 3px no-repeat, linear-gradient(var(--arm), var(--arm)) center / 3px 11px no-repeat; }
#ui[data-input="pad"] .kc[data-pd="down"]::after { --at: 50% 100%; } #ui[data-input="pad"] .kc[data-pd="left"]::after { --at: 0 50%; --as: 5px 3px; } #ui[data-input="pad"] .kc[data-pd="right"]::after { --at: 100% 50%; --as: 5px 3px; }
#ui[data-input="pad"] .kc[data-pb="menu"][data-pad]::after { content: ""; width: 9px; height: 7px;
  background: linear-gradient(currentColor, currentColor) 0 0 / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) 0 50% / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
#ui[data-input="pad"] .kc[data-pb="view"][data-pad]::after { content: ""; width: 10px; height: 9px;
  background: linear-gradient(currentColor, currentColor) 3px 0 / 7px 1px no-repeat, linear-gradient(currentColor, currentColor) 9px 0 / 1px 6px no-repeat, linear-gradient(currentColor, currentColor) 3px 0 / 1px 3px no-repeat, linear-gradient(currentColor, currentColor) 7px 5px / 3px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 0 3px / 7px 1px no-repeat, linear-gradient(currentColor, currentColor) 0 3px / 1px 6px no-repeat, linear-gradient(currentColor, currentColor) 6px 3px / 1px 6px no-repeat, linear-gradient(currentColor, currentColor) 0 8px / 7px 1px no-repeat; }
#ui:not([data-input="pad"]) .u-sys .klist .padonly { display: none; }      /* (a line of the controls page only a controller has) */

/* level lozenge */
#ui .u-loz { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; }
#ui .u-loz::before { content: ""; position: absolute; inset: 4.5px; border: 1px solid var(--gold); background: rgba(12, 10, 8, 0.6); transform: rotate(45deg); }
#ui .u-loz b { position: relative; font-size: 12px; color: var(--paper); }
#ui .u-loz.big { width: 44px; height: 44px; } #ui .u-loz.big::before { inset: 6.5px; } #ui .u-loz.big b { font-size: 17px; }
#ui .u-loz.huge { width: 78px; height: 78px; } #ui .u-loz.huge::before { inset: 11.5px; } #ui .u-loz.huge::after { content: ""; position: absolute; inset: 17px; border: 1px solid var(--hair-f); transform: rotate(45deg); } #ui .u-loz.huge b { font-size: 30px; }

/* bars: a hairline frame, lozenge terminals */
#ui .u-bar { position: relative; height: 7px; background: rgba(8, 7, 6, 0.66); box-shadow: 0 0 0 1px var(--hair), 0 1px 10px rgba(0, 0, 0, 0.5); }
#ui .u-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; display: block; }
#ui .u-bar .ghost { background: rgba(243, 235, 217, 0.62); }
#ui .u-bar .fill { background: var(--blood); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.25); }
#ui .u-bar::before, #ui .u-bar::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border: 1px solid var(--gold); background: #15120e; transform: translate(-50%, -50%) rotate(45deg); z-index: 1; }
#ui .u-bar::before { left: -1px; } #ui .u-bar::after { left: calc(100% + 1px); }
#ui .u-bar.thin { height: 4px; } #ui .u-bar.thin::before, #ui .u-bar.thin::after { width: 5px; height: 5px; }
#ui .u-bar.gold .fill { background: var(--gold); }
#ui .u-bar.plain::before, #ui .u-bar.plain::after { display: none; }

/* ───────────────────────────────── walking about: one small mark, a prompt, notices */
#ui .u-corner { position: absolute; right: 22px; top: 18px; display: flex; align-items: center; gap: 12px; opacity: 0; transition: opacity 1.2s ease; text-shadow: var(--shade); }
#ui .u-corner.on { opacity: 0.92; }
#ui .u-corner .coin { font-size: 15px; color: var(--gold); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
#ui .u-corner .purse { display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--paper); }
#ui .u-corner .sep { width: 1px; height: 14px; background: var(--hair); }
#ui .u-corner .pts { display: none; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0.3em; color: var(--gold-b); }
#ui .u-corner .pts.on { display: flex; }
#ui .u-corner .pts::before { content: ""; width: 5px; height: 5px; background: var(--gold-b); transform: rotate(45deg); animation: u-breathe 2.6s ease-in-out infinite; }
@keyframes u-breathe { 50% { opacity: 0.35; } }

#ui .u-prompt { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); min-width: 300px; padding: 8px 40px; display: flex; justify-content: center; align-items: center; gap: 12px; opacity: 0; transition: opacity 0.5s ease; font-size: 13px; letter-spacing: 0.3em; color: var(--paper); text-shadow: var(--shade); white-space: nowrap;
  background: linear-gradient(90deg, rgba(8, 7, 6, 0), rgba(8, 7, 6, 0.5) 28%, rgba(8, 7, 6, 0.5) 72%, rgba(8, 7, 6, 0)); }
#ui .u-prompt.on { opacity: 1; }
#ui.duel .u-prompt { bottom: 124px; }

#ui .u-toasts { position: absolute; right: 22px; top: 62px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#ui .u-toast { position: relative; min-width: 190px; padding: 11px 18px 11px 22px; background: rgba(12, 10, 8, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-left: 1px solid var(--gold);
  animation: u-toast 4.6s ease forwards; }
#ui .u-toast::before { content: ""; position: absolute; left: -3.5px; top: 50%; width: 6px; height: 6px; background: var(--gold); transform: translateY(-50%) rotate(45deg); }
#ui .u-toast b { display: block; font-weight: 400; font-size: 14px; letter-spacing: 0.32em; color: var(--paper); }
#ui .u-toast em { display: block; margin-top: 5px; font-style: normal; font-size: 10.5px; letter-spacing: 0.28em; color: var(--gold); }
@keyframes u-toast { 0% { opacity: 0; transform: translateX(14px); } 8% { opacity: 1; transform: none; } 86% { opacity: 1; } 100% { opacity: 0; } }
#ui.duel .u-toasts { top: 176px; }
/* notices that arrive during a fight sit low on the left, clear of the foe, the word and the numbers; long ones wrap */
#ui .u-tips { position: absolute; left: 24px; bottom: 86px; max-width: min(430px, calc(100vw - 48px)); display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
#ui .u-tips .u-toast { animation-name: u-toast-l; animation-duration: 6.5s; }
#ui .u-tips .u-toast b { font-size: 13px; line-height: 1.55; } #ui .u-tips .u-toast em { line-height: 1.65; }
@keyframes u-toast-l { 0% { opacity: 0; transform: translateX(-14px); } 6% { opacity: 1; transform: none; } 90% { opacity: 1; } 100% { opacity: 0; } }

/* ───────────────────────────────── the duel
   Bare on purpose: the foe's own motion is the tell. The pilgrim's life top-left with the strike of wrath under it; the foe's
   life top-right with the magic meter under it; the shield bottom-centre; numbers over the foe; one heavy word at a time. */
#ui .u-duel { position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s ease; isolation: isolate; }
#ui .u-duel.on { opacity: 1; }
#ui .u-duel::before, #ui .u-duel::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; z-index: -1; }   /* shades sit behind everything of the HUD */
#ui .u-duel::before { top: 0; height: 168px; background: linear-gradient(rgba(8, 7, 6, 0.54), rgba(8, 7, 6, 0.3) 46%, rgba(8, 7, 6, 0)); }
#ui .u-duel::after { bottom: 0; height: 150px; background: linear-gradient(rgba(8, 7, 6, 0), rgba(8, 7, 6, 0.34) 55%, rgba(8, 7, 6, 0.6)); }

#ui .u-plate { position: absolute; top: 20px; width: clamp(214px, 31vw, 410px); text-shadow: var(--shade); z-index: 1; }
#ui .u-plate.self { left: 24px; } #ui .u-plate.foe { right: 24px; }
#ui .u-plate .who { display: flex; align-items: center; gap: 12px; min-height: 44px; }
#ui .u-plate.foe .who { flex-direction: row-reverse; text-align: right; }
#ui .u-plate .who .t { min-width: 0; }
#ui .u-plate .who .nm { font-size: clamp(16px, 1.75vw, 22px); letter-spacing: 0.46em; color: var(--paper); white-space: nowrap; }
#ui .u-plate.foe .who .nm { margin-right: -0.46em; }
#ui .u-plate .who .sc { margin-top: 5px; font-size: 9px; letter-spacing: 0.36em; overflow: hidden; text-overflow: ellipsis; }
#ui .u-plate.foe .who .sc { margin-right: -0.36em; }
#ui .u-plate .u-bar { margin: 9px 4px 0; }
#ui .u-plate.foe .u-bar i { left: auto; right: 0; }                 /* the foe's life drains toward its own edge */
#ui .u-plate .under { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#ui .u-plate.foe .under { flex-direction: row-reverse; }
#ui .u-plate .hpn { font-size: 14px; color: var(--paper); white-space: nowrap; } #ui .u-plate .hpn s { text-decoration: none; color: var(--muted); font-size: 12px; }
#ui .u-plate.self.low .u-bar { animation: u-low 0.9s ease-in-out infinite; } #ui .u-plate.self.low .u-bar .fill { background: #c9402b; } #ui .u-plate.self.low .hpn { color: #ff9d85; }
@keyframes u-low { 0%, 100% { box-shadow: 0 0 0 1px rgba(216, 98, 63, 0.85), 0 0 0 1px rgba(216, 98, 63, 0); } 50% { box-shadow: 0 0 0 1px rgba(216, 98, 63, 0.95), 0 0 0 6px rgba(216, 98, 63, 0.3); } }
#ui .u-plate.self.struck .u-bar { animation: u-struck 0.36s ease-out; } #ui .u-plate.self.low.struck .u-bar { animation: u-struck 0.36s ease-out, u-low 0.9s ease-in-out 0.36s infinite; }
@keyframes u-struck { 0% { transform: translateX(7px); } 25% { transform: translateX(-5px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } 100% { transform: none; } }

/* wrath and magic: lozenge gauges with their keys */
#ui .u-gauge { display: flex; align-items: center; gap: 9px; }
#ui .u-plate.foe .u-gauge { flex-direction: row-reverse; }
#ui .u-gauge svg { width: 40px; height: 40px; overflow: visible; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7)); }
#ui .u-gauge .bg { fill: rgba(10, 9, 8, 0.66); stroke: var(--hair); stroke-width: 1; }
#ui .u-gauge .fl { stroke: none; }
#ui .u-gauge .rim { fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0.35; }
#ui .u-gauge .in { fill: none; stroke: var(--hair-f); stroke-width: 1; }
#ui .u-gauge.wrath .fl { fill: var(--wrath); } #ui .u-gauge.mana .fl { fill: var(--mana); }
#ui .u-gauge.full .rim { opacity: 1; stroke: var(--gold-b); }
#ui .u-gauge.full .kc { border-color: var(--gold-b); color: var(--gold-b); animation: u-breathe 1.8s ease-in-out infinite; }
#ui .u-gauge .lab { display: flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: 0.3em; color: #ddd4c0; white-space: nowrap; }
#ui .u-plate.foe .u-gauge .lab { flex-direction: row-reverse; }

/* the shield and what is left of it, bottom-centre */
#ui .u-shield { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; text-shadow: var(--shade); white-space: nowrap; }
#ui .u-shield svg.sh { width: 46px; height: 46px; overflow: visible; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7)); stroke-linejoin: round; stroke-linecap: round; transition: transform 0.1s ease; }
#ui .u-shield svg.sh * { vector-effect: non-scaling-stroke; }
#ui .u-shield .bg { fill: rgba(10, 9, 8, 0.7); stroke: var(--hair); stroke-width: 1; }
#ui .u-shield .fl { fill: var(--steel); stroke: none; opacity: 0.92; }
#ui .u-shield .rim { fill: none; stroke: var(--gold); stroke-width: 1.1; }
#ui .u-shield .eng { fill: none; stroke: rgba(12, 10, 8, 0.55); stroke-width: 1; }
#ui .u-shield .crack { fill: none; stroke: var(--warn); stroke-width: 1.4; display: none; }
#ui .u-shield .n { font-size: 18px; color: var(--paper); line-height: 1; } #ui .u-shield .n s { text-decoration: none; font-size: 13px; color: #ddd4c0; }
#ui .u-shield.up svg.sh { transform: scale(1.14); } #ui .u-shield.up .rim { stroke: var(--gold-b); stroke-width: 1.9; }
#ui .u-shield.broken .rim { stroke: var(--warn); } #ui .u-shield.broken .crack { display: block; } #ui .u-shield.broken .n { color: var(--warn); letter-spacing: 0.3em; margin-right: -0.3em; }

/* the legend of the keys: there while walking and for the first seconds of a fight, then gone */
#ui .u-legend { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; text-shadow: var(--shade); }
#ui .u-legend.on { opacity: 0.74; transition: opacity 0.6s ease; }
#ui .u-legend em, #ui .u-legend .cap { font-style: normal; font-size: 10px; letter-spacing: 0.3em; color: #ddd4c0; white-space: nowrap; }
#ui .u-legend .kc { height: 18px; min-width: 18px; font-size: 10px; padding: 0 4px; transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease; }
#ui .u-move { position: absolute; left: 24px; bottom: 20px; display: flex; flex-direction: column; gap: 6px; }
#ui .u-move span.r { display: flex; align-items: center; gap: 3px; } #ui .u-move em { margin-left: 8px; }
#ui .u-block { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; }
#ui .u-keys { position: absolute; right: 24px; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#ui .u-keys .dia { display: grid; grid-template-columns: repeat(3, 20px); grid-template-rows: repeat(3, 20px); gap: 1px; }
#ui .u-keys .dia .kc { min-width: 0; width: 20px; height: 20px; padding: 0; font-size: 10.5px; }
#ui .u-keys .dia .kc[data-k="I"] { grid-area: 1 / 2; } #ui .u-keys .dia .kc[data-k="J"] { grid-area: 2 / 1; } #ui .u-keys .dia .kc[data-k="L"] { grid-area: 2 / 3; } #ui .u-keys .dia .kc[data-k="K"] { grid-area: 3 / 2; }
#ui .u-keys .dia .mid { grid-area: 2 / 2; display: grid; place-items: center; font-size: 12px; color: var(--gold); opacity: 0.75; }
#ui .u-keys .cap { margin-right: -0.3em; }

/* one heavy word at a time, set in the band between the two plates so that it never covers the foe (whose motion is the tell);
   numbers over the foe. They arrive hard and leave quickly. */
#ui .u-float { position: absolute; inset: 0; }
#ui .u-float .w { position: absolute; left: 50%; top: calc(60px - 0.5em); line-height: 1; font-size: clamp(32px, 3.9vw, 48px); letter-spacing: 0.36em; margin-right: -0.36em; color: var(--paper);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.85); white-space: nowrap; transform-origin: 50% 55%; animation: u-word 0.78s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
#ui .u-float .w.gold { color: var(--gold-b); } #ui .u-float .w.steel { color: #d6e1ea; } #ui .u-float .w.warn { color: #ff7a5c; }
#ui .u-float .w.strong { font-size: clamp(36px, 4.4vw, 54px); }
#ui .u-float .w.big { font-size: clamp(42px, 5.2vw, 64px); animation-duration: 0.95s; }
@keyframes u-word { 0% { opacity: 0; transform: translate(-50%, 0) scale(1.6); } 13% { opacity: 1; transform: translate(-50%, 0) scale(0.97); } 20% { transform: translate(-50%, 0) scale(1); } 64% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -12px) scale(1); } }
#ui .u-float .n { position: absolute; left: calc(50% + var(--dx, 0px)); top: calc(max(35%, 250px) + var(--dy, 0px)); font-size: clamp(27px, 3.1vw, 37px); color: var(--paper);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.85); white-space: nowrap; line-height: 1; animation: u-num 0.95s ease-out forwards; }
#ui .u-float .n.crit { font-size: clamp(34px, 4vw, 48px); color: var(--gold-b); }
#ui .u-float .n.big { font-size: clamp(48px, 5.800vw, 72px); color: var(--gold-b); animation: u-num-big 1.3s ease-out forwards; }
#ui .u-float .n.weak { font-size: clamp(15px, 1.8vw, 19px); color: var(--muted); }
#ui .u-float .n.hurt { left: clamp(120px, 16vw, 230px); top: 134px; color: #ff7a5c; font-size: clamp(28px, 3.2vw, 38px); animation: u-num-hurt 1.1s ease-out forwards; }
@keyframes u-num { 0% { opacity: 0; transform: translate(-50%, 4px) scale(1.75); } 11% { opacity: 1; transform: translate(-50%, 0) scale(0.96); } 18% { transform: translate(-50%, 0) scale(1); } 68% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30px) scale(1); } }
@keyframes u-num-big { 0% { opacity: 0; transform: translate(-50%, 0) scale(2.2); } 9% { opacity: 1; transform: translate(-50%, 0) scale(0.95); } 14% { transform: translate(-50%, 0) scale(1); } 76% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -24px) scale(1); } }
@keyframes u-num-hurt { 0% { opacity: 0; transform: translate(-50%, 0) scale(1.9); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 22px) scale(1); } }
/* the edge of the view reddens when the pilgrim is wounded */
#ui .u-hurt { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 120px 16px rgba(132, 16, 8, 0.62); background: radial-gradient(ellipse at 50% 50%, rgba(150, 20, 8, 0) 58%, rgba(150, 20, 8, 0.3) 100%); }
#ui .u-hurt.go { animation: u-hurt 0.75s ease-out; } #ui .u-hurt.soft.go { animation: u-hurt-soft 0.45s ease-out; } #ui .u-hurt.hard.go { animation: u-hurt-hard 1s ease-out; }
@keyframes u-hurt { 0% { opacity: 1; background-color: rgba(160, 20, 8, 0.12); } 16% { opacity: 0.95; background-color: rgba(160, 20, 8, 0); } 100% { opacity: 0; } }
@keyframes u-hurt-hard { 0% { opacity: 1; background-color: rgba(170, 20, 8, 0.24); } 20% { opacity: 1; background-color: rgba(170, 20, 8, 0); } 100% { opacity: 0; } }
@keyframes u-hurt-soft { 0% { opacity: 0.42; } 100% { opacity: 0; } }

/* casting: the runes the ring carries, and the strokes drawn so far */
#ui .u-cast { position: absolute; left: 50%; bottom: 136px; transform: translateX(-50%); padding: 10px 22px; background: rgba(12, 10, 8, 0.68); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); opacity: 0; transition: opacity 0.25s ease; }
#ui .u-cast.on { opacity: 1; }
#ui .u-cast .sp { display: grid; grid-template-columns: 96px auto; align-items: center; gap: 18px; padding: 6px 0; transition: opacity 0.2s ease; }
#ui .u-cast .sp + .sp { border-top: 1px solid var(--hair-f); }
#ui .u-cast .sp.off { opacity: 0.26; }
#ui .u-cast .sp > b { font-weight: 400; font-size: 14px; letter-spacing: 0.3em; color: var(--paper); white-space: nowrap; } #ui .u-cast .sp > b i { font-style: normal; margin-left: 7px; font-family: "Hoefler Text", "Baskerville", Georgia, serif; font-size: 11px; letter-spacing: 0.08em; color: var(--gold); }
#ui .u-cast .sp .rune { display: flex; gap: 6px; font-size: 16px; color: var(--dim); }
#ui .u-cast .sp .rune .hit { color: var(--mana); }

/* ───────────────────────────────── the pack: equipment, store, attributes */
#ui .u-menu { position: absolute; inset: 0; display: none; pointer-events: auto; cursor: default;
  background: radial-gradient(ellipse 80% 70% at 50% 42%, rgba(18, 15, 12, 0.78), rgba(8, 7, 6, 0.93)); -webkit-backdrop-filter: blur(9px) saturate(0.72); backdrop-filter: blur(9px) saturate(0.72); }
#ui .u-menu.on { display: flex; animation: u-fade 0.32s ease; }
@keyframes u-fade { from { opacity: 0; } }
#ui .u-sheet { position: relative; width: min(1120px, calc(100vw - 56px)); height: min(640px, calc(100vh - 44px)); margin: auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
#ui .u-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding-bottom: 15px; border-bottom: 1px solid var(--hair); position: relative; }
#ui .u-head::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 7px; height: 7px; border: 1px solid var(--gold); background: #100e0b; transform: translateX(-50%) rotate(45deg); }
#ui .u-head .ttl { display: flex; align-items: baseline; gap: 16px; }
#ui .u-head .ttl b { font-weight: 400; font-size: 22px; letter-spacing: 0.5em; color: var(--paper); }
#ui .u-tabs { display: flex; align-items: center; gap: 12px; }
#ui .u-tabs .tab { position: relative; padding: 4px 16px 6px 22px; font-size: 16px; letter-spacing: 0.5em; color: var(--dim); cursor: pointer; transition: color 0.2s ease; }
#ui .u-tabs .tab:hover { color: var(--muted); }
#ui .u-tabs .tab.on { color: var(--paper); }
#ui .u-tabs .tab.on::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: -3px; height: 1px; background: var(--gold); }
#ui .u-tabs .tab .dot { position: absolute; right: 4px; top: 2px; width: 5px; height: 5px; background: var(--gold-b); transform: rotate(45deg); }
#ui .u-tabs .kc { opacity: 0.6; }
#ui .u-head .purse { justify-self: end; display: flex; align-items: center; gap: 14px; font-size: 17px; color: var(--paper); }
#ui .u-head .purse .coin { font-size: 16px; color: var(--gold); margin-right: -6px; }
#ui .u-head .purse .sep { width: 1px; height: 15px; background: var(--hair); }

#ui .u-body { min-height: 0; padding: 20px 0 14px; display: grid; grid-template-columns: 204px minmax(0, 1fr) minmax(0, 1.12fr); gap: 26px; }
#ui .u-body.stats { grid-template-columns: minmax(0, 0.56fr) minmax(0, 1.5fr); gap: 36px; }
#ui .u-foot { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-top: 11px; border-top: 1px solid var(--hair-f); font-size: 10.5px; letter-spacing: 0.26em; color: var(--dim); }
#ui .u-foot .ks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
#ui .u-foot .ks span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
#ui .u-foot .kc { height: 17px; min-width: 17px; font-size: 10px; padding: 0 4px; }
#ui .u-foot .close { cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
#ui .u-foot .close:hover { color: var(--paper); }

/* five slots */
#ui .u-slots { display: flex; flex-direction: column; gap: 5px; min-height: 0; }
#ui .u-slot { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 13px; padding: 11px 12px 11px 14px; border-left: 1px solid var(--hair-f); cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
#ui .u-slot:hover { background: rgba(216, 197, 151, 0.045); }
#ui .u-slot.on { border-left-color: var(--gold); background: linear-gradient(90deg, rgba(216, 197, 151, 0.13), rgba(216, 197, 151, 0)); }
#ui .u-slot.on::before { content: ""; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px; background: var(--gold); transform: translateY(-50%) rotate(45deg); }
#ui .u-slot svg.g { font-size: 26px; color: var(--gold); opacity: 0.8; }
#ui .u-slot.on svg.g { opacity: 1; }
#ui .u-slot .sl { font-size: 10.5px; letter-spacing: 0.4em; color: var(--dim); }
#ui .u-slot .it { margin-top: 5px; font-size: 14px; letter-spacing: 0.2em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .u-slot.on .it { color: var(--paper); }
#ui .u-slot .n { position: absolute; right: 8px; top: 7px; font-size: 10px; color: var(--dim); opacity: 0.7; }

/* the list of a slot */
#ui .u-mid2 { min-height: 0; display: flex; flex-direction: column; }
#ui .u-cap { flex: none; display: flex; align-items: baseline; gap: 14px; padding: 0 2px 9px 2px; margin-bottom: 8px; border-bottom: 1px solid var(--hair-f); font-size: 11.5px; letter-spacing: 0.4em; color: var(--muted); white-space: nowrap; }
#ui .u-cap .sc { font-size: 9px; color: var(--dim); }
#ui .u-cap .cnt { margin-left: auto; letter-spacing: 0.1em; color: var(--dim); } #ui .u-cap .cnt b { font-weight: 400; font-size: 13px; color: var(--muted); }
#ui .u-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 3px; padding: 1px; }
#ui .u-list::-webkit-scrollbar { display: none; }
#ui .u-list .none { margin: auto; text-align: center; font-size: 13px; letter-spacing: 0.3em; color: var(--dim); line-height: 2.1; }
#ui .u-row { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 8px 14px 8px 9px; cursor: pointer; border: 1px solid transparent; transition: background 0.15s ease; flex: none; }
#ui .u-row:hover { background: rgba(216, 197, 151, 0.04); }
#ui .u-row.on { background: rgba(216, 197, 151, 0.085); border-color: var(--hair-f); }
#ui .u-row.on::before, #ui .u-row.on::after { content: ""; position: absolute; width: 7px; height: 7px; border: solid var(--gold); }
#ui .u-row.on::before { left: -1px; top: -1px; border-width: 1px 0 0 1px; } #ui .u-row.on::after { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
#ui .u-row .nm { font-size: 15px; letter-spacing: 0.24em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .u-row.on .nm, #ui .u-row.worn .nm { color: var(--paper); }
#ui .u-row .sc { margin-top: 5px; font-size: 9px; letter-spacing: 0.34em; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
#ui .u-row .xp { margin-top: 7px; height: 2px; width: 100%; max-width: 150px; background: rgba(216, 197, 151, 0.14); }
#ui .u-row .xp i { display: block; height: 100%; background: var(--gold); }
#ui .u-row .st { text-align: right; font-size: 10.5px; letter-spacing: 0.28em; color: var(--dim); white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
#ui .u-row .st .worn { color: var(--gold-b); } #ui .u-row .st .mast { color: var(--gold); display: flex; align-items: center; gap: 6px; }
#ui .u-row .st .mast::before { content: ""; width: 5px; height: 5px; border: 1px solid var(--gold); transform: rotate(45deg); }
#ui .u-row .st .price { display: flex; align-items: center; gap: 6px; font-size: 15px; letter-spacing: 0.03em; color: var(--paper); }
#ui .u-row .st .price .coin { font-size: 13px; color: var(--gold); }
#ui .u-row .st .price.no { color: #b98d7c; }
#ui .u-row.lack .nm { color: var(--dim); }

/* pictures: the engraved stand-in, replaced when a render arrives */
#ui .u-ico { position: relative; display: grid; place-items: center; width: 42px; height: 42px; background: rgba(8, 7, 6, 0.5) center / contain no-repeat; box-shadow: inset 0 0 0 1px var(--hair-f); color: var(--gold); }
#ui .u-ico svg.g { font-size: 27px; opacity: 0.85; }
#ui .u-ico.img svg.g { display: none; }

/* the detail card */
#ui .u-detail { min-height: 0; overflow-y: auto; scrollbar-width: none; padding-left: 26px; border-left: 1px solid var(--hair-f); display: flex; flex-direction: column; }
#ui .u-detail::-webkit-scrollbar { display: none; }
#ui .u-pic { position: relative; flex: none; overflow: hidden; height: clamp(110px, 24vh, 176px); background: radial-gradient(ellipse 60% 70% at 50% 46%, rgba(216, 197, 151, 0.085), rgba(8, 7, 6, 0.55) 78%); }
#ui .u-pic::before, #ui .u-pic::after, #ui .u-pic .c::before, #ui .u-pic .c::after { content: ""; position: absolute; width: 11px; height: 11px; border: solid var(--gold); opacity: 0.8; z-index: 1; }
#ui .u-pic::before { left: 0; top: 0; border-width: 1px 0 0 1px; } #ui .u-pic::after { right: 0; top: 0; border-width: 1px 1px 0 0; }
#ui .u-pic .c::before { left: 0; bottom: 0; border-width: 0 0 1px 1px; } #ui .u-pic .c::after { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
#ui .u-pic .cart { position: absolute; left: 50%; top: 50%; height: 124%; aspect-ratio: 1; transform: translate(-50%, -50%); fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0.2; overflow: visible; }
#ui .u-pic .cart * { vector-effect: non-scaling-stroke; }
#ui .u-pic .u-ico { position: absolute; inset: 10px; width: auto; height: auto; background-color: transparent; box-shadow: none; }
#ui .u-pic .u-ico svg.g { font-size: clamp(70px, 14vh, 106px); opacity: 0.78; stroke-width: 1; }
#ui .u-pic .pips { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); display: flex; gap: 6px; }
#ui .u-pic .pips i { width: 5px; height: 5px; border: 1px solid var(--gold); transform: rotate(45deg); opacity: 0.5; }
#ui .u-pic .pips i.on { background: var(--gold); opacity: 0.95; }
#ui .u-pic .seal { position: absolute; right: 13px; top: 12px; }
#ui .u-seal { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px 4px 11px; border: 1px solid var(--gold); font-size: 10.5px; letter-spacing: 0.34em; color: var(--gold-b); background: rgba(12, 10, 8, 0.55); }
#ui .u-seal::before { content: ""; width: 5px; height: 5px; background: var(--gold-b); transform: rotate(45deg); }
#ui .u-seal.worn { border-color: var(--hair); color: var(--paper); } #ui .u-seal.worn::before { background: none; border: 1px solid var(--paper); }
#ui .u-detail h3 { margin: 14px 0 0; font-weight: 400; font-size: 23px; letter-spacing: 0.34em; color: var(--paper); }
#ui .u-detail .sub { margin-top: 7px; }
#ui .u-detail .desc { margin: 10px 0 0; font-size: 13px; line-height: 1.8; letter-spacing: 0.1em; color: var(--muted); }
#ui .u-rule { position: relative; height: 1px; margin: 12px 0 10px; background: linear-gradient(90deg, var(--hair), var(--hair-f) 70%, transparent); flex: none; }
#ui .u-lines { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 7px 14px; font-size: 14px; }
#ui .u-lines .k { display: flex; align-items: center; gap: 9px; letter-spacing: 0.3em; color: var(--muted); }
#ui .u-lines .k svg.g { font-size: 15px; color: var(--gold); }
#ui .u-lines .v { font-size: 16px; color: var(--paper); }
#ui .u-lines .d { justify-self: end; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); white-space: nowrap; }
#ui .u-lines .d b { font-weight: 400; } #ui .u-lines .d .up { color: var(--good); } #ui .u-lines .d .dn { color: var(--warn); }
#ui .u-lines .d .ar { font-size: 8px; } #ui .u-lines .d i { font-style: normal; font-size: 10.5px; letter-spacing: 0.24em; }
#ui .u-lines .d .dl { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; min-width: 30px; }
#ui .u-lines .el { grid-column: 2 / 4; display: flex; align-items: baseline; gap: 8px; color: var(--paper); letter-spacing: 0.2em; }
#ui .u-lines .el b { font-weight: 400; font-size: 16px; letter-spacing: 0.03em; } #ui .u-lines .el i { font-style: normal; margin-left: auto; font-size: 11px; letter-spacing: 0.16em; color: var(--dim); }
#ui .u-spells { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
#ui .u-spell { display: grid; grid-template-columns: 78px 66px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; }
#ui .u-spell > b { font-weight: 400; letter-spacing: 0.26em; color: var(--paper); white-space: nowrap; } #ui .u-spell > b i { font-style: normal; margin-left: 6px; font-family: "Hoefler Text", "Baskerville", Georgia, serif; font-size: 10.5px; letter-spacing: 0.08em; color: var(--gold); }
#ui .u-spell .rune { display: flex; gap: 4px; font-size: 14px; color: var(--mana); }
#ui .u-spell span.ds { font-size: 11.5px; letter-spacing: 0.08em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .u-spell .wo { font-size: 10.5px; letter-spacing: 0.2em; color: var(--muted); white-space: nowrap; } #ui .u-spell .wo b { font-weight: 400; font-size: 14px; letter-spacing: 0.03em; margin-left: 5px; color: var(--paper); }
#ui .u-xp { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; font-size: 11px; letter-spacing: 0.3em; color: var(--muted); }
#ui .u-xp .num { font-size: 13px; color: var(--paper); letter-spacing: 0.03em; }
#ui .u-acts { margin-top: auto; padding-top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px 12px; }
#ui .u-btn { display: inline-flex; align-items: center; gap: 11px; height: 34px; padding: 0 16px 0 12px; border: 1px solid var(--gold); background: rgba(216, 197, 151, 0.08); color: var(--paper); font: inherit; font-size: 14px; letter-spacing: 0.4em; cursor: pointer; transition: background 0.15s ease; white-space: nowrap; }
#ui .u-btn:hover { background: rgba(216, 197, 151, 0.2); }
#ui .u-btn.second { border-color: var(--hair); background: none; color: var(--muted); }
#ui .u-btn.off { border-color: var(--hair-f); background: none; color: var(--dim); cursor: default; }
#ui .u-btn.off .kc { opacity: 0.4; }
#ui .u-btn .kc { height: 18px; min-width: 18px; font-size: 10px; }
#ui .u-acts .why { font-size: 11.5px; letter-spacing: 0.24em; color: #c69a86; }
#ui .u-acts .cost { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0.3em; color: var(--muted); white-space: nowrap; }
#ui .u-acts .cost .num { font-size: 17px; color: var(--paper); letter-spacing: 0.03em; } #ui .u-acts .cost .coin { font-size: 14px; color: var(--gold); }
#ui .u-fine { margin-top: 8px; font-size: 10.5px; letter-spacing: 0.16em; line-height: 1.6; color: var(--dim); }
#ui .u-note { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); padding: 7px 18px 7px 22px; background: rgba(12, 10, 8, 0.82); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font-size: 12.5px; letter-spacing: 0.36em; color: var(--gold-b); opacity: 0; pointer-events: none; white-space: nowrap; }
#ui .u-note.go { animation: u-note 1.7s ease forwards; }
@keyframes u-note { 0% { opacity: 0; } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

/* attributes: a ledger — own + gear = total, and what the total comes to */
#ui .u-me { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; border-right: 1px solid var(--hair-f); padding-right: 36px; min-height: 0; }
#ui .u-me .col { width: 100%; max-width: 250px; display: flex; flex-direction: column; align-items: center; }
#ui .u-me .lv { margin-top: 10px; font-size: 20px; letter-spacing: 0.5em; padding-left: 0.5em; color: var(--paper); }
#ui .u-me .u-bar { width: 100%; max-width: 250px; margin-top: 16px; }
#ui .u-me .xpn { margin-top: 9px; font-size: 13px; color: var(--muted); }
#ui .u-me .pts { margin-top: 20px; padding: 12px 0; width: 100%; max-width: 250px; border-top: 1px solid var(--hair-f); border-bottom: 1px solid var(--hair-f); font-size: 12px; letter-spacing: 0.34em; color: var(--muted); }
#ui .u-me .pts b { display: block; margin-top: 5px; font-weight: 400; font-size: 30px; letter-spacing: 0.03em; color: var(--dim); }
#ui .u-me .pts.has b { color: var(--gold-b); }
#ui .u-me .pts small { display: block; margin-top: 7px; font-size: 10px; letter-spacing: 0.16em; line-height: 1.7; color: var(--dim); }
#ui .u-me .rec { margin-top: 16px; display: flex; gap: 26px; font-size: 11px; letter-spacing: 0.34em; color: var(--dim); }
#ui .u-me .rec b { font-weight: 400; font-size: 15px; color: var(--muted); letter-spacing: 0.03em; margin-left: 8px; }
#ui .u-attrs { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 0; }
#ui .u-attrs .hd, #ui .u-attr { display: grid; grid-template-columns: 34px minmax(0, 1fr) 216px 112px 36px; gap: 14px; }
#ui .u-attrs .hd { padding: 0 14px 7px 12px; border-bottom: 1px solid var(--hair-f); font-size: 10px; letter-spacing: 0.34em; color: var(--dim); }
#ui .u-attrs .hd .lg { display: grid; grid-template-columns: 1fr 14px 1fr 14px 1fr; text-align: center; } #ui .u-attrs .hd .de { text-align: right; }
#ui .u-attr { position: relative; align-items: center; padding: 12px 14px 12px 12px; border: 1px solid transparent; cursor: pointer; }
#ui .u-attr.on { background: rgba(216, 197, 151, 0.075); border-color: var(--hair-f); }
#ui .u-attr.on::before, #ui .u-attr.on::after { content: ""; position: absolute; width: 7px; height: 7px; border: solid var(--gold); }
#ui .u-attr.on::before { left: -1px; top: -1px; border-width: 1px 0 0 1px; } #ui .u-attr.on::after { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
#ui .u-attr > svg.g { font-size: 28px; color: var(--gold); justify-self: center; }
#ui .u-attr .nm { display: flex; align-items: baseline; gap: 14px; font-size: 17px; letter-spacing: 0.44em; color: var(--paper); }
#ui .u-attr .hp { margin-top: 7px; font-size: 11.5px; letter-spacing: 0.06em; line-height: 1.65; color: #a39a88; }
#ui .u-attr .lg { display: grid; grid-template-columns: 1fr 14px 1fr 14px 1fr; align-items: center; text-align: center; }
#ui .u-attr .lg b { font-weight: 400; font-size: 21px; color: var(--muted); } #ui .u-attr .lg b.own { color: var(--paper); } #ui .u-attr .lg b.tot { font-size: 30px; color: var(--paper); }
#ui .u-attr .lg i { font-style: normal; font-size: 13px; color: var(--dim); }
#ui .u-attr .de { text-align: right; white-space: nowrap; } #ui .u-attr .de b { display: block; font-weight: 400; font-size: 19px; color: var(--gold-b); } #ui .u-attr .de i { display: block; margin-top: 4px; font-style: normal; font-size: 10px; letter-spacing: 0.3em; color: var(--dim); }
#ui .u-attr .de small { font-family: "Songti SC", serif; font-size: 11.5px; letter-spacing: 0.1em; margin-left: 5px; }
#ui .u-plus { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--gold); background: rgba(216, 197, 151, 0.08); color: var(--gold-b); cursor: pointer; font-size: 13px; transition: background 0.15s ease; }
#ui .u-plus:hover { background: rgba(216, 197, 151, 0.22); }
#ui .u-me .pts .respec { margin-top: 10px; height: 28px; font-size: 11px; letter-spacing: 0.24em; }
#ui .u-plus.off { border-color: var(--hair-f); background: none; color: var(--dim); opacity: 0.5; cursor: default; }

/* ───────────────────────────────── after the fight */
#ui .u-result, #ui .u-fallen { position: absolute; inset: 0; display: none; pointer-events: auto; cursor: default; }
#ui .u-result.on { display: flex; background: radial-gradient(ellipse 70% 80% at 50% 45%, rgba(14, 12, 10, 0.88), rgba(8, 7, 6, 0.74)); -webkit-backdrop-filter: blur(5px) saturate(0.8); backdrop-filter: blur(5px) saturate(0.8); animation: u-fade 0.7s ease; }
#ui .u-tally { width: min(560px, calc(100vw - 44px)); max-height: calc(100vh - 20px); margin: auto; display: flex; flex-direction: column; align-items: stretch; overflow-y: auto; scrollbar-width: none; }
#ui .u-tally .bon.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 30px; }      /* (a boss's many bonuses in two columns: the whole tally stays on screen) */
#ui .u-tally .top { text-align: center; }
#ui .u-tally .top h2 { margin: 6px 0 0; font-weight: 400; font-size: clamp(30px, 5.4vh, 48px); letter-spacing: 0.6em; padding-left: 0.6em; color: var(--paper); }
#ui .u-tally .top .who { margin-top: 8px; font-size: 13px; letter-spacing: 0.44em; padding-left: 0.44em; color: var(--muted); }
#ui .u-tally .rl { position: relative; height: 1px; margin: 13px 0 10px; background: linear-gradient(90deg, transparent, var(--hair) 25%, var(--hair) 75%, transparent); flex: none; }
#ui .u-tally .rl::after { content: ""; position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; border: 1px solid var(--gold); background: #100e0b; transform: translateX(-50%) rotate(45deg); }
#ui .u-tally .ln { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px; font-size: 13px; letter-spacing: 0.34em; color: var(--muted); opacity: 0; transform: translateY(5px); transition: opacity 0.4s ease, transform 0.4s ease; }
#ui .u-tally .ln.in { opacity: 1; transform: none; }
#ui .u-tally .ln .num { font-size: 16px; color: var(--paper); letter-spacing: 0.03em; }
#ui .u-tally .ln.sum { margin-top: 4px; padding-top: 7px; border-top: 1px solid var(--hair-f); color: var(--paper); }
#ui .u-tally .ln.sum .num { font-size: 21px; color: var(--gold-b); }
/* the fight's worth parted into five shares, one for each worn item */
#ui .u-tally .part { margin-top: 9px; display: flex; align-items: center; gap: 14px; font-size: 11px; letter-spacing: 0.34em; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity 0.4s ease; }
#ui .u-tally .part.in { opacity: 1; }
#ui .u-tally .part::before, #ui .u-tally .part::after { content: ""; flex: 1; height: 1px; background: var(--hair-f); }
#ui .u-tally .part b { font-weight: 400; font-size: 15px; color: var(--gold-b); letter-spacing: 0.03em; margin: 0 4px; }
#ui .u-tally .its { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
#ui .u-tally .itm { display: grid; grid-template-columns: 34px 104px minmax(0, 1fr) 176px; align-items: center; gap: 13px; opacity: 0; transition: opacity 0.4s ease; }
#ui .u-tally .itm.in { opacity: 1; }
#ui .u-tally .itm .u-ico { width: 34px; height: 34px; } #ui .u-tally .itm .u-ico svg.g { font-size: 22px; }
#ui .u-tally .itm .nm { font-size: 13.5px; letter-spacing: 0.2em; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .u-tally .itm .u-bar .fill { transition: width 1.1s cubic-bezier(0.3, 0.6, 0.2, 1); }
#ui .u-tally .itm .u-bar .ghost { background: rgba(216, 197, 151, 0.32); }
#ui .u-tally .itm .r { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 13.5px; color: var(--paper); white-space: nowrap; }
#ui .u-tally .itm .r .u-seal { padding: 2px 7px 2px 9px; font-size: 10px; opacity: 0; transform: scale(1.5); transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
#ui .u-tally .itm .r .u-seal.in { opacity: 1; transform: none; }
#ui .u-tally .itm.waste .nm, #ui .u-tally .itm.waste .u-ico { opacity: 0.55; }
#ui .u-tally .itm .r .was { font-size: 10.5px; letter-spacing: 0.26em; color: var(--dim); }
#ui .u-tally .itm .r s { color: #a97f6e; text-decoration-thickness: 1px; }
#ui .u-tally .net { margin-top: 8px; display: flex; justify-content: flex-end; gap: 20px; font-size: 11px; letter-spacing: 0.3em; color: var(--muted); opacity: 0; transition: opacity 0.4s ease; }
#ui .u-tally .net.in { opacity: 1; }
#ui .u-tally .net b { font-weight: 400; font-size: 14px; letter-spacing: 0.03em; color: var(--paper); margin-left: 6px; } #ui .u-tally .net .lo, #ui .u-tally .net .lo b { color: #a97f6e; }
#ui .u-tally .lvl { margin-top: 11px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; opacity: 0; transition: opacity 0.4s ease; }
#ui .u-tally .lvl.in { opacity: 1; }
#ui .u-tally .lvl .t { font-size: 12px; letter-spacing: 0.34em; color: var(--muted); white-space: nowrap; }
#ui .u-tally .gains { margin-top: 11px; display: flex; justify-content: center; gap: 44px; opacity: 0; transition: opacity 0.5s ease; }
#ui .u-tally .gains.in { opacity: 1; }
#ui .u-tally .gains div { display: flex; align-items: baseline; gap: 10px; font-size: 12px; letter-spacing: 0.36em; color: var(--muted); }
#ui .u-tally .gains .num { font-size: 24px; color: var(--gold-b); letter-spacing: 0.03em; }
#ui .u-tally .gains .coin { font-size: 15px; color: var(--gold); align-self: center; }
#ui .u-go { margin-top: 14px; display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 12.5px; letter-spacing: 0.44em; color: var(--paper); opacity: 0; transition: opacity 0.6s ease; cursor: pointer; }
#ui .u-go.in { opacity: 1; }
#ui .u-go.in > .kc { animation: u-breathe 2.8s ease-in-out 0.6s infinite; }
#ui .u-go small { font-size: 10.5px; letter-spacing: 0.3em; color: var(--muted); margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--hair-f); }
#ui .u-fallen.on { display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(10, 6, 5, 0.86), rgba(5, 3, 3, 0.95)); animation: u-fade 1.8s ease; text-align: center; }
#ui .u-fallen .rule { width: 1px; height: 54px; background: linear-gradient(#0000, #a9836b); margin-bottom: 24px; }
#ui .u-fallen h2 { margin: 0; font-weight: 400; font-size: clamp(34px, 5.4vw, 60px); letter-spacing: 0.56em; padding-left: 0.56em; color: #e6d9cf; }
#ui .u-fallen .sc { margin-top: 18px; padding-left: 0.44em; color: #b08d76; font-size: 11px; letter-spacing: 0.6em; }
#ui .u-fallen p { margin: 30px 0 0; font-size: 13px; letter-spacing: 0.36em; color: #9d9184; }
#ui .u-fallen .u-go { margin-top: 44px; }

/* frozen frames for the test views */
#ui.fz .u-float .w, #ui.fz .u-float .n { animation-play-state: paused; animation-delay: -0.32s; }
#ui.fz .u-toast { animation-play-state: paused; animation-delay: -1s; }
#ui.fz .u-hurt.go { animation-play-state: paused; animation-delay: -0.07s; }
#ui.fz .u-tally *, #ui.fz .u-result, #ui.fz .u-fallen, #ui.fz .u-menu, #ui.fz .u-go { transition: none !important; animation: none !important; }
#ui.fz .u-go.in { opacity: 1; }

/* ───────────────────────────────── the narrow pane */
@media (max-width: 860px) {
  #ui .u-sheet { width: calc(100vw - 30px); height: calc(100vh - 26px); }
  #ui .u-head { grid-template-columns: auto 1fr; padding-bottom: 12px; }
  #ui .u-head .ttl { display: none; }
  #ui .u-head::after { display: none; }
  #ui .u-tabs { gap: 2px; } #ui .u-tabs .tab { font-size: 15px; padding: 4px 9px 6px 14px; letter-spacing: 0.4em; } #ui .u-tabs .tab.on::after { left: 12px; right: 12px; }
  #ui .u-head .purse { font-size: 15px; gap: 11px; }
  #ui .u-body { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px 16px; padding: 12px 0 10px; }
  #ui .u-slots { grid-column: 1 / 3; flex-direction: row; gap: 4px; }
  #ui .u-slot { flex: 1 1 0; min-width: 0; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 5px; padding: 8px 4px 7px; border-left: none; border-bottom: 1px solid var(--hair-f); }
  #ui .u-slot.on { border-bottom-color: var(--gold); background: linear-gradient(0deg, rgba(216, 197, 151, 0.14), rgba(216, 197, 151, 0)); }
  #ui .u-slot.on::before { left: 50%; top: auto; bottom: -4px; transform: translateX(-50%) rotate(45deg); }
  #ui .u-slot svg.g { font-size: 21px; } #ui .u-slot .sl { letter-spacing: 0.3em; padding-left: 0.3em; } #ui .u-slot .it { margin-top: 3px; font-size: 11px; letter-spacing: 0.06em; } #ui .u-slot .n { right: 4px; top: 3px; }
  #ui .u-cap { padding-bottom: 7px; margin-bottom: 6px; font-size: 10.5px; letter-spacing: 0.26em; gap: 8px; } #ui .u-cap .sc { display: none; }
  #ui .u-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; padding: 7px 8px 7px 6px; }
  #ui .u-row .nm { font-size: 13.5px; letter-spacing: 0.12em; } #ui .u-row .sc { display: none; } #ui .u-row .st { font-size: 10px; letter-spacing: 0.16em; } #ui .u-row .st .price { font-size: 13.5px; }
  #ui .u-ico { width: 34px; height: 34px; } #ui .u-ico svg.g { font-size: 22px; }
  #ui .u-detail { padding-left: 16px; }
  #ui .u-pic { height: clamp(92px, 16vh, 140px); } #ui .u-pic .u-ico svg.g { font-size: clamp(58px, 10.5vh, 88px); }
  #ui .u-detail h3 { font-size: 19px; margin-top: 11px; letter-spacing: 0.26em; } #ui .u-detail .desc { font-size: 12px; line-height: 1.7; letter-spacing: 0.05em; margin-top: 7px; }
  #ui .u-detail .sub { font-size: 9px; letter-spacing: 0.3em; white-space: normal; line-height: 1.5; }
  #ui .u-rule { margin: 9px 0 8px; }
  #ui .u-lines { gap: 6px 9px; font-size: 13px; } #ui .u-lines .k { letter-spacing: 0.18em; gap: 6px; } #ui .u-lines .v { font-size: 15px; } #ui .u-lines .d { font-size: 12px; gap: 5px; } #ui .u-lines .d i { display: none; } #ui .u-lines .el i { display: none; }
  #ui .u-spell { grid-template-columns: 64px 58px minmax(0, 1fr); gap: 8px; } #ui .u-spell span.ds { display: none; } #ui .u-spell > b { letter-spacing: 0.14em; } #ui .u-spell .wo { justify-self: end; }
  #ui .u-xp { gap: 9px; letter-spacing: 0.18em; }
  #ui .u-btn { height: 31px; padding: 0 11px 0 9px; font-size: 13px; letter-spacing: 0.26em; gap: 8px; }
  #ui .u-acts .cost { letter-spacing: 0.16em; } #ui .u-acts .cost .num { font-size: 15px; }
  #ui .u-fine { font-size: 10px; letter-spacing: 0.08em; }
  #ui .u-foot { font-size: 10px; letter-spacing: 0.14em; } #ui .u-foot .ks { gap: 5px 11px; }
  #ui .u-body.stats { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
  #ui .u-me { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 18px; border-right: none; padding: 0 0 12px; border-bottom: 1px solid var(--hair-f); text-align: left; }
  #ui .u-me .u-loz.huge { width: 60px; height: 60px; } #ui .u-me .u-loz.huge::before { inset: 9px; } #ui .u-me .u-loz.huge::after { inset: 13px; } #ui .u-me .u-loz.huge b { font-size: 23px; }
  #ui .u-me .col { width: auto; min-width: 190px; align-items: stretch; } #ui .u-me .lv { margin: 0; font-size: 16px; padding-left: 0; } #ui .u-me .u-bar { margin-top: 10px; } #ui .u-me .xpn { margin-top: 6px; font-size: 12px; }
  #ui .u-me .pts { width: auto; max-width: none; margin: 0; padding: 0 0 0 18px; border: none; border-left: 1px solid var(--hair-f); letter-spacing: 0.2em; font-size: 11px; } #ui .u-me .pts b { font-size: 24px; margin-top: 2px; } #ui .u-me .pts small { display: none; }
  #ui .u-me .rec { width: 100%; justify-content: center; margin-top: 8px; }
  #ui .u-attrs { justify-content: flex-start; gap: 2px; overflow-y: auto; scrollbar-width: none; }
  #ui .u-attrs .hd { display: none; }
  #ui .u-attr { grid-template-columns: 26px minmax(0, 1fr) 84px 32px; grid-template-rows: auto auto; gap: 7px 10px; padding: 9px 9px 9px 8px; }
  #ui .u-attr > svg.g { font-size: 22px; grid-row: 1 / 3; } #ui .u-attr .nm { font-size: 15px; letter-spacing: 0.34em; gap: 9px; } #ui .u-attr .hp { font-size: 10.5px; margin-top: 4px; }
  #ui .u-attr .lg { grid-column: 2; grid-row: 2; justify-self: start; grid-template-columns: auto 16px auto 16px auto; } #ui .u-attr .lg b { font-size: 16px; } #ui .u-attr .lg b.tot { font-size: 21px; }
  #ui .u-attr .lg b::after { content: attr(data-l); margin-left: 4px; font-family: "Songti SC", serif; font-size: 9.5px; letter-spacing: 0.1em; color: var(--dim); }
  #ui .u-attr .de { grid-column: 3; grid-row: 1 / 3; } #ui .u-attr .de b { font-size: 16px; } #ui .u-attr .de i { letter-spacing: 0.14em; }
  #ui .u-plus { width: 30px; height: 30px; grid-column: 4; grid-row: 1 / 3; }

  #ui .u-plate { top: 14px; width: calc(50vw - 22px); } #ui .u-plate.self { left: 14px; } #ui .u-plate.foe { right: 14px; }
  #ui .u-plate .who { gap: 8px; min-height: 36px; } #ui .u-plate .who .nm { font-size: 15px; letter-spacing: 0.34em; } #ui .u-plate.foe .who .nm { margin-right: -0.34em; }
  #ui .u-plate .who .sc { font-size: 8px; letter-spacing: 0.22em; } #ui .u-plate.foe .who .sc { margin-right: -0.22em; }
  #ui .u-plate .u-loz.big { width: 36px; height: 36px; } #ui .u-plate .u-loz.big::before { inset: 5.5px; } #ui .u-plate .u-loz.big b { font-size: 14px; }
  #ui .u-plate .under { margin-top: 10px; gap: 6px; } #ui .u-plate .hpn { font-size: 12.5px; } #ui .u-plate .hpn s { font-size: 11px; }
  #ui .u-gauge { gap: 6px; } #ui .u-gauge svg { width: 34px; height: 34px; }
  #ui .u-float .w { top: 124px; }   /* no band between the plates here: just under them */
  #ui .u-float .n { top: calc(max(41%, 290px) + var(--dy, 0px)); } #ui .u-float .n.hurt { left: 84px; top: 132px; }
  #ui .u-move { left: 14px; bottom: 14px; } #ui .u-move em { margin-left: 6px; letter-spacing: 0.18em; } #ui .u-keys { right: 14px; bottom: 12px; } #ui .u-block { bottom: 14px; }
  #ui .u-shield { bottom: 40px; } #ui .u-shield svg.sh { width: 40px; height: 40px; }
  #ui .u-cast { bottom: 124px; padding: 8px 16px; }
  #ui .u-corner { right: 14px; top: 13px; gap: 9px; } #ui .u-toasts { right: 14px; top: 54px; } #ui.duel .u-toasts { top: 150px; }
  #ui .u-tips { left: 14px; bottom: 122px; max-width: calc(100vw - 28px); }
  #ui .u-tally .itm { grid-template-columns: 30px 82px minmax(0, 1fr) 168px; gap: 9px; } #ui .u-tally .itm .u-ico { width: 30px; height: 30px; } #ui .u-tally .itm .nm { font-size: 12.5px; letter-spacing: 0.1em; }
  #ui .u-tally .ln { font-size: 12px; letter-spacing: 0.24em; } #ui .u-tally .gains { gap: 26px; } #ui .u-tally .part { letter-spacing: 0.2em; gap: 9px; }
}
@media (max-height: 720px) {
  #ui .u-tally .top h2 { font-size: 28px; } #ui .u-tally .rl { margin: 9px 0 7px; } #ui .u-tally .its { gap: 4px; margin-top: 7px; } #ui .u-tally .lvl { margin-top: 8px; } #ui .u-tally .gains { margin-top: 8px; } #ui .u-go { margin-top: 10px; }
}
/* the red at the edge of sight when the pilgrim is struck is drawn by the renderer itself now (post.js uHurt): the page adds none */
#ui .u-hurt { display: none; }
/* the strike of wrath: unmistakable when it is ready, and an answer when Q is pressed too soon */
#ui .u-gauge.wrath.full svg { filter: drop-shadow(0 0 6px rgba(255, 196, 96, 0.95)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7)); animation: u-wrath-full 1.1s ease-in-out infinite; }
#ui .u-gauge.wrath.full .lab { color: var(--gold-b); }
@keyframes u-wrath-full { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
#ui .u-gauge.deny { animation: u-deny 0.3s ease-out; }
@keyframes u-deny { 0% { transform: translateX(0); } 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } 100% { transform: none; } }
#ui .u-gauge.ready svg { animation: u-wrath-ready 0.6s ease-out; }
@keyframes u-wrath-ready { 0% { transform: scale(1.7); filter: brightness(2.4); } 100% { transform: scale(1); } }
/* the second choice on the fallen screen (walk the run again): quieter than the first */
#ui .u-fallen .u-go.alt { margin-top: 10px; opacity: 0.62; font-size: 0.86em; }
#ui .u-fallen .u-go.alt:hover { opacity: 1; }
/* which run of the citadel this is, beside the purse */
#ui .u-corner .blood { font-size: 10.5px; letter-spacing: 0.28em; color: #b9b0a0; white-space: nowrap; } #ui .u-corner .blood .num { color: #e8dfcc; letter-spacing: 0.04em; margin-left: 4px; font-size: 13px; }

/* between two runs: years pass under a dark card, which lifts by itself */
#ui .u-blood { position: absolute; inset: 0; display: none; pointer-events: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #050303; }
#ui .u-blood.go { display: flex; animation: u-blood 6.4s ease forwards; }
#ui .u-blood > * { opacity: 0; }
#ui .u-blood.go > * { animation: u-blood-in 1.5s ease forwards; }
#ui .u-blood .yr { font-size: 13px; letter-spacing: 0.7em; padding-left: 0.7em; color: #9d9184; animation-delay: 0.35s !important; }
#ui .u-blood .rule { width: 1px; height: 46px; margin: 26px 0 24px; background: linear-gradient(#0000, #a9836b, #0000); animation-delay: 1.0s !important; }
#ui .u-blood h2 { margin: 0; font-weight: 400; font-size: clamp(34px, 5.4vw, 60px); letter-spacing: 0.56em; padding-left: 0.56em; color: #e6d9cf; animation-delay: 1.3s !important; }
#ui .u-blood .sc { margin-top: 18px; padding-left: 0.6em; color: #b08d76; font-size: 11px; letter-spacing: 0.6em; text-transform: uppercase; animation-delay: 1.7s !important; }
#ui .u-blood p { margin: 30px 0 0; font-size: 13px; letter-spacing: 0.36em; padding-left: 0.36em; color: #9d9184; animation-delay: 2.2s !important; }
@keyframes u-blood { 0% { opacity: 1; background-color: #050303; } 62% { opacity: 1; background-color: #050303; } 80% { opacity: 1; background-color: rgba(5, 3, 3, 0); } 100% { opacity: 0; background-color: rgba(5, 3, 3, 0); visibility: hidden; } }
@keyframes u-blood-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#ui.fz .u-blood.go, #ui.fz .u-blood.go > * { animation-play-state: paused; animation-delay: -3s !important; }

/* walking wounded: the pilgrim's life, top-left, only while it is not whole; the draughts carried, in the corner */
#ui .u-life { position: absolute; left: 30px; top: 26px; display: flex; align-items: center; gap: 16px; opacity: 0; transition: opacity 0.9s ease; text-shadow: var(--shade); pointer-events: none; }
#ui .u-life.on { opacity: 0.95; }
#ui .u-life .u-bar { width: 232px; }
#ui .u-life .hpn { font-size: 13px; color: var(--paper); white-space: nowrap; } #ui .u-life .hpn s { text-decoration: none; color: var(--muted); font-size: 11.5px; }
#ui .u-life.low .u-bar .fill { background: #c9402b; } #ui .u-life.low .hpn { color: #ff9d85; }
#ui .u-life .pot { display: none; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.3em; color: var(--muted); }
#ui .u-life .pot.on { display: flex; } #ui .u-life .pot em { font-style: normal; }
#ui .u-corner .flask { display: none; align-items: center; gap: 6px; font-size: 15px; color: var(--paper); } #ui .u-corner .flask.on { display: flex; }
#ui .u-corner .flask .fl { font-size: 15px; color: #c7b48a; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
#ui .u-corner .sep[data-e="cPotSep"] { display: none; } #ui .u-corner .sep[data-e="cPotSep"].on { display: block; }

/* the road leaf of the pack: the run's number, who has fallen in it, and what can be done about the road */
#ui .u-road { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: none; }      /* (four acts and the fine print: on a short window it scrolls, rather than running under the foot) */
#ui .u-road .u-racts .u-attr { padding-top: 9px; padding-bottom: 9px; }
#ui .u-way { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 30px; margin-bottom: 12px; }
#ui .u-way .st { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 4px; }
#ui .u-way .st .nm { font-size: 14px; letter-spacing: 0.32em; color: var(--paper); white-space: nowrap; } #ui .u-way .st .sc { margin-top: 3px; font-size: 8.5px; letter-spacing: 0.28em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .u-way .st .s { font-size: 10.5px; letter-spacing: 0.3em; color: var(--gold); }
#ui .u-way .st.down .nm { color: var(--muted); } #ui .u-way .st.down .u-loz::before { background: rgba(216, 197, 151, 0.26); }
#ui .u-way .st.unk .nm { color: var(--dim); } #ui .u-way .st.unk .u-loz { opacity: 0.55; }
#ui .u-racts { display: flex; flex-direction: column; gap: 5px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--hair-f); }
#ui .u-attr.ract { grid-template-columns: minmax(0, 1fr) auto; }
#ui .u-attr.ract .nm { font-size: 15px; letter-spacing: 0.36em; color: var(--paper); } #ui .u-attr.ract .hp { margin-top: 6px; font-size: 11px; letter-spacing: 0.14em; line-height: 1.6; color: var(--muted); }
#ui .u-attr.ract.danger .nm { color: #e2a08f; }
#ui .u-attr.ract.armed .u-btn { border-color: var(--gold-b); background: rgba(216, 197, 151, 0.2); } #ui .u-attr.ract.danger.armed .u-btn { border-color: #c9402b; background: rgba(201, 64, 43, 0.16); color: #ffc3b3; }
#ui .u-body.road .u-me .pts b small { font-size: 13px; color: var(--dim); letter-spacing: 0.1em; } #ui .u-body.road .u-me .pts b { color: var(--paper); }
#ui .u-body.road .u-me .xpn.sc { font-size: 10px; letter-spacing: 0.5em; text-transform: uppercase; color: #b08d76; }

/* the system menu (Esc): the game waits behind it */
#ui .u-sys { position: absolute; inset: 0; display: none; pointer-events: auto; cursor: default; align-items: center; justify-content: center; background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(10, 7, 6, 0.8), rgba(5, 3, 3, 0.93)); }
#ui .u-sys.on { display: flex; animation: u-fade 0.3s ease; }
#ui .u-sys .panel { width: min(640px, 88vw); display: flex; flex-direction: column; max-height: 92vh; }
#ui .u-sys .ttl { text-align: center; margin-bottom: 26px; display: flex; flex-direction: column; align-items: center; }
#ui .u-sys .ttl .rule { width: 1px; height: 34px; background: linear-gradient(#0000, #a9836b); margin-bottom: 16px; }
#ui .u-sys .ttl h2 { margin: 0; font-weight: 400; font-size: 30px; letter-spacing: 0.6em; padding-left: 0.6em; color: #e6d9cf; }
#ui .u-sys .ttl .sc { margin-top: 10px; padding-left: 0.6em; font-size: 10px; letter-spacing: 0.6em; text-transform: uppercase; color: #b08d76; }
#ui .u-sys .rows { display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow-y: auto; }
#ui .u-sys .row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 250px 62px; align-items: center; gap: 16px; padding: 9px 18px; border: 1px solid transparent; cursor: pointer; color: var(--muted); }
#ui .u-sys .row.main { grid-template-columns: minmax(0, 1fr) auto; padding: 13px 22px; }
#ui .u-sys .row .nm { font-size: 14.5px; letter-spacing: 0.42em; white-space: nowrap; } #ui .u-sys .row.main .nm { font-size: 17px; letter-spacing: 0.5em; }
#ui .u-sys .row .nm small { display: block; margin-top: 5px; font-size: 10px; letter-spacing: 0.16em; color: var(--dim); white-space: normal; }
#ui .u-sys .row .sc { font-size: 10px; letter-spacing: 0.34em; color: var(--dim); white-space: nowrap; }
#ui .u-sys .row.on { color: var(--paper); background: rgba(216, 197, 151, 0.075); border-color: var(--hair-f); }
#ui .u-sys .row.on::before, #ui .u-sys .row.on::after { content: ""; position: absolute; width: 7px; height: 7px; border: solid var(--gold); }
#ui .u-sys .row.on::before { left: -1px; top: -1px; border-width: 1px 0 0 1px; } #ui .u-sys .row.on::after { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
#ui .u-sys .row.off { opacity: 0.4; cursor: default; }
#ui .u-sys .ctl { display: flex; align-items: center; gap: 12px; } #ui .u-sys .ctl .u-bar { flex: 1; height: 5px; cursor: pointer; } #ui .u-sys .ctl .u-bar .fill { background: var(--gold); }
#ui .u-sys .ctl .u-bar::before, #ui .u-sys .ctl .u-bar::after { display: none; }
#ui .u-sys .ar { font-style: normal; font-size: 20px; line-height: 1; color: var(--muted); padding: 0 4px; cursor: pointer; } #ui .u-sys .ar:hover { color: var(--paper); }
#ui .u-sys .opts { display: flex; gap: 6px; justify-content: flex-end; } #ui .u-sys .opts b { font-weight: 400; font-size: 12.5px; letter-spacing: 0.3em; padding: 5px 9px 5px 12px; border: 1px solid var(--hair-f); color: var(--dim); cursor: pointer; white-space: nowrap; }
#ui .u-sys .opts b.on { border-color: var(--gold); color: var(--paper); background: rgba(216, 197, 151, 0.1); }
#ui .u-sys .val { text-align: right; font-size: 13px; color: var(--paper); white-space: nowrap; } #ui .u-sys .row.act .nm { color: #c9b993; }
#ui .u-sys .panel.settings .row { grid-template-columns: minmax(0, 1fr) 270px 58px; }
#ui .u-sys .klist { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 30px; padding: 4px 4px; font-size: 12.5px; letter-spacing: 0.26em; color: var(--muted); }
#ui .u-sys .klist > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 12px; } #ui .u-sys .klist .ks { display: flex; gap: 4px; justify-content: flex-end; align-items: center; white-space: nowrap; } #ui .u-sys .klist .ks i { font-style: normal; color: var(--dim); }
#ui .u-sys .panel.keys { width: min(760px, 92vw); }
#ui .u-sys .fine { margin: 22px 8px 0; padding-top: 16px; border-top: 1px solid var(--hair-f); font-size: 12px; letter-spacing: 0.22em; line-height: 1.9; color: var(--muted); }
#ui .u-sys .foot { margin-top: 24px; display: flex; justify-content: center; gap: 30px; font-size: 11px; letter-spacing: 0.34em; color: var(--muted); } #ui .u-sys .foot span { display: inline-flex; align-items: center; gap: 7px; } #ui .u-sys .foot [data-back] { cursor: pointer; }
#ui.fz .u-sys { animation: none !important; }

#ui .u-body.road .u-me .pts b small { display: inline; margin: 0; }
#ui .u-sys .panel.settings .ttl, #ui .u-sys .panel.keys .ttl { margin-bottom: 16px; } #ui .u-sys .panel.settings .ttl .rule, #ui .u-sys .panel.keys .ttl .rule { display: none; }
#ui .u-sys .panel.settings .ttl h2, #ui .u-sys .panel.keys .ttl h2 { font-size: 24px; }
#ui .u-sys .panel.settings .row { padding: 6px 18px; } #ui .u-sys .panel.settings .foot { margin-top: 14px; }
#ui .u-sys .panel.settings .opts b { padding: 4px 8px 4px 11px; font-size: 12px; }

/* gear with a property of its own: a small gold lozenge by its name, and what it does in its description */
#ui .u-row .nm .pk { display: inline-block; width: 5px; height: 5px; margin-left: 9px; vertical-align: middle; background: var(--gold-b); transform: rotate(45deg) translateY(-1px); }
#ui .u-lines .k.perk { color: var(--gold-b); } #ui .u-lines .el.perk { grid-column: 2 / -1; } #ui .u-lines .el.perk i { font-style: normal; color: var(--paper); letter-spacing: 0.12em; line-height: 1.6; white-space: normal; }

/* ───────────────────────────────────────────────────────────── English (and any language written in Latin letters)
   The interface was drawn for Chinese: large characters set wide apart. Latin letters want another hand: capitals with a
   little air for titles and labels, plain upper-and-lower with almost none for anything that is a sentence.
   `data-lang` is written on <html> and on #ui by lang.js / ui.js; Chinese is untouched by everything below. */
html[data-script="latin"] body { font-family: "Iowan Old Style", "Hoefler Text", "UI Serif", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; }
#ui[data-script="latin"] .sc:empty { display: none; }
#ui[data-script="latin"] .kc.zh { font-family: "Hoefler Text", "Baskerville", Georgia, serif; font-size: 10.5px; letter-spacing: 0.06em; padding: 0 5px; }

/* the page itself */
html[data-script="latin"] #title h1 { text-transform: uppercase; font-size: clamp(28px, 4.3vw, 56px); letter-spacing: 0.3em; padding-left: 0.3em; }
html[data-script="latin"] #title .sub:empty { display: none; }
html[data-script="latin"] #status { text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.22em; padding-left: 0.22em; }
html[data-script="latin"] #run, html[data-script="latin"] #title .tip { text-transform: uppercase; letter-spacing: 0.2em; padding-left: 0.2em; }
html[data-script="latin"] #hint { letter-spacing: 0.08em; font-size: 12.5px; }
html[data-script="latin"] #areaName { text-transform: uppercase; font-size: clamp(19px, 2.5vw, 32px); letter-spacing: 0.3em; padding-left: 0.3em; }
#area.one i, #area.one em { display: none; }

/* the fight */
#ui[data-script="latin"] .u-plate .who .nm { text-transform: uppercase; font-size: clamp(11.5px, 1.12vw, 14px); letter-spacing: 0.16em; white-space: normal; line-height: 1.3; }
#ui[data-script="latin"] .u-plate.foe .who .nm { margin-right: -0.16em; }
#ui[data-script="latin"] .u-gauge .lab, #ui[data-script="latin"] .u-legend em, #ui[data-script="latin"] .u-legend .cap, #ui[data-script="latin"] .u-life .pot { text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.16em; }
#ui[data-script="latin"] .u-float .w { text-transform: uppercase; font-size: clamp(19px, 2.2vw, 27px); letter-spacing: 0.22em; margin-right: -0.22em; white-space: nowrap; }
#ui[data-script="latin"] .u-float .w.strong { font-size: clamp(21px, 2.5vw, 31px); }
#ui[data-script="latin"] .u-float .w.big { font-size: clamp(25px, 3vw, 38px); }
#ui[data-script="latin"] .u-corner .blood, #ui[data-script="latin"] .u-corner .pts { text-transform: uppercase; letter-spacing: 0.14em; }
#ui[data-script="latin"] .u-prompt { letter-spacing: 0.1em; }
#ui[data-script="latin"] .u-toast b { letter-spacing: 0.06em; } #ui[data-script="latin"] .u-toast em { letter-spacing: 0.03em; }
#ui[data-script="latin"] .u-cast .sp > b, #ui[data-script="latin"] .u-spell > b { letter-spacing: 0.04em; }

/* the pack */
#ui[data-script="latin"] .u-head .ttl b { text-transform: uppercase; font-size: 17px; letter-spacing: 0.28em; white-space: nowrap; }
#ui[data-script="latin"] .u-tabs .tab { text-transform: uppercase; font-size: 12.5px; letter-spacing: 0.2em; padding: 4px 13px 6px 15px; }
#ui[data-script="latin"] .u-tabs .tab.on::after { left: 13px; right: 13px; }
#ui[data-script="latin"] .u-foot, #ui[data-script="latin"] .u-cap, #ui[data-script="latin"] .u-xp, #ui[data-script="latin"] .u-acts .cost { text-transform: uppercase; font-size: 10px; letter-spacing: 0.16em; }
#ui[data-script="latin"] .u-slot .sl { text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.2em; }
#ui[data-script="latin"] .u-slot .it { letter-spacing: 0.02em; font-size: 14px; }
#ui[data-script="latin"] .u-row .nm { letter-spacing: 0.03em; font-size: 15.5px; }
#ui[data-script="latin"] .u-row .st { text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.16em; } #ui[data-script="latin"] .u-row .st .price { font-size: 15px; letter-spacing: 0.03em; }
#ui[data-script="latin"] .u-list .none { letter-spacing: 0.03em; }
#ui[data-script="latin"] .u-seal { text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.16em; }
#ui[data-script="latin"] .u-detail h3 { font-size: 25px; letter-spacing: 0.04em; }
#ui[data-script="latin"] .u-detail .desc { font-size: 14px; line-height: 1.55; letter-spacing: 0.01em; }
#ui[data-script="latin"] .u-lines .k { text-transform: uppercase; font-size: 11px; letter-spacing: 0.15em; }
#ui[data-script="latin"] .u-lines .d { letter-spacing: 0.06em; } #ui[data-script="latin"] .u-lines .d i { text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.15em; }
#ui[data-script="latin"] .u-lines .el { letter-spacing: 0.04em; } #ui[data-script="latin"] .u-lines .el i { letter-spacing: 0.01em; font-size: 12.5px; }
#ui[data-script="latin"] .u-lines .el.perk i { font-size: 13.5px; letter-spacing: 0.01em; line-height: 1.5; }
#ui[data-script="latin"] .u-spell .ds { letter-spacing: 0.01em; }
#ui[data-script="latin"] .u-btn { text-transform: uppercase; font-size: 12px; letter-spacing: 0.2em; }
#ui[data-script="latin"] .u-acts .why { letter-spacing: 0.03em; }
#ui[data-script="latin"] .u-fine { font-size: 11.5px; line-height: 1.5; letter-spacing: 0.01em; }
#ui[data-script="latin"] .u-note { letter-spacing: 0.08em; }

/* attributes, and the road */
#ui[data-script="latin"] .u-me .lv { text-transform: uppercase; font-size: 16px; letter-spacing: 0.26em; padding-left: 0.26em; }
#ui[data-script="latin"] .u-me .pts, #ui[data-script="latin"] .u-me .rec, #ui[data-script="latin"] .u-attrs .hd { text-transform: uppercase; font-size: 10px; letter-spacing: 0.16em; }
#ui[data-script="latin"] .u-me .pts small { text-transform: none; font-size: 11px; letter-spacing: 0.01em; line-height: 1.45; }
#ui[data-script="latin"] .u-attr .nm { text-transform: uppercase; font-size: 14px; letter-spacing: 0.22em; }
#ui[data-script="latin"] .u-attr .hp { letter-spacing: 0.01em; font-size: 12px; line-height: 1.45; }
#ui[data-script="latin"] .u-attr .de i { text-transform: uppercase; font-size: 9px; letter-spacing: 0.14em; }
#ui[data-script="latin"] .u-way .st .nm { letter-spacing: 0.02em; font-size: 13.5px; white-space: normal; line-height: 1.25; }
#ui[data-script="latin"] .u-way .st .s { text-transform: uppercase; font-size: 9px; letter-spacing: 0.16em; }
#ui[data-script="latin"] .u-attr.ract .nm { text-transform: uppercase; font-size: 13px; letter-spacing: 0.18em; }
#ui[data-script="latin"] .u-attr.ract .hp { letter-spacing: 0.01em; font-size: 12px; line-height: 1.5; }

/* after a fight, and between lives */
#ui[data-script="latin"] .u-tally .top h2 { text-transform: uppercase; letter-spacing: 0.34em; padding-left: 0.34em; }
#ui[data-script="latin"] .u-tally .top .who { letter-spacing: 0.06em; }
#ui[data-script="latin"] .u-tally .ln, #ui[data-script="latin"] .u-tally .part { letter-spacing: 0.05em; }
#ui[data-script="latin"] .u-tally .itm { grid-template-columns: 34px 172px minmax(0, 1fr) 144px; }
#ui[data-script="latin"] .u-tally .itm .nm { letter-spacing: 0.02em; font-size: 14px; }
#ui[data-script="latin"] .u-tally .itm .r .was { text-transform: uppercase; font-size: 9px; letter-spacing: 0.14em; }
#ui[data-script="latin"] .u-tally .net, #ui[data-script="latin"] .u-tally .lvl .t, #ui[data-script="latin"] .u-tally .gains div { text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.16em; }
#ui[data-script="latin"] .u-go { text-transform: uppercase; letter-spacing: 0.22em; } #ui[data-script="latin"] .u-go small { text-transform: none; letter-spacing: 0.03em; }
#ui[data-script="latin"] .u-fallen h2, #ui[data-script="latin"] .u-blood h2 { text-transform: uppercase; font-size: clamp(26px, 3.9vw, 46px); letter-spacing: 0.32em; padding-left: 0.32em; }
#ui[data-script="latin"] .u-fallen .sc, #ui[data-script="latin"] .u-blood .sc { letter-spacing: 0.44em; padding-left: 0.44em; }
#ui[data-script="latin"] .u-fallen p, #ui[data-script="latin"] .u-blood p { font-size: 15px; letter-spacing: 0.03em; padding-left: 0; }
#ui[data-script="latin"] .u-blood .yr { text-transform: uppercase; font-size: 11px; letter-spacing: 0.4em; padding-left: 0.4em; }

/* the system menu */
#ui[data-script="latin"] .u-sys .ttl h2 { text-transform: uppercase; font-size: 23px; letter-spacing: 0.4em; padding-left: 0.4em; }
#ui[data-script="latin"] .u-sys .row .nm { text-transform: uppercase; font-size: 12px; letter-spacing: 0.17em; }
#ui[data-script="latin"] .u-sys .row.main .nm { font-size: 15px; letter-spacing: 0.26em; }
#ui[data-script="latin"] .u-sys .row .nm small { text-transform: none; font-size: 11px; letter-spacing: 0.01em; }
#ui[data-script="latin"] .u-sys .row .sc { letter-spacing: 0.16em; }
#ui[data-script="latin"] .u-sys .opts b { text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.12em; padding: 5px 9px; }
#ui[data-script="latin"] .u-sys .klist { font-size: 13px; letter-spacing: 0.02em; }
#ui[data-script="latin"] .u-sys .fine { font-size: 12.5px; line-height: 1.6; letter-spacing: 0.01em; }
#ui[data-script="latin"] .u-sys .foot { text-transform: uppercase; font-size: 10px; letter-spacing: 0.16em; }
#ui .u-lines .el.perk.kw { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: -2px; }
#ui .u-lines .el.perk.kw i { margin-left: 0; font-size: 11.5px; line-height: 1.55; letter-spacing: 0.06em; color: var(--dim); }

/* ───────────────────────────────── type, in each language
   Figures are lining everywhere: old-style digits sit low in running text and look small beside the numbers in the tables.
   Key caps are always capitals. English is set in Iowan Old Style — sturdier, and taller in the x, than Hoefler Text at the
   small sizes of the interface on a dark ground — with Hoefler kept for the big display capitals (Palatino Linotype, Book
   Antiqua or Georgia where those are missing: Windows, Linux). In Chinese the Latin letters and figures inside a line take the
   same Latin serif and the characters Songti (Noto / Source Han Serif, STSong or SimSun where Songti is missing): style.css. */
#ui { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1, "kern" 1; font-kerning: normal; text-rendering: optimizeLegibility; }
#ui .kc, #ui[data-script="latin"] .kc.zh { text-transform: uppercase; }
#ui .u-attrs { justify-content: safe center; overflow-y: auto; scrollbar-width: none; }      /* (taller than the leaf: it starts at the top and scrolls, rather than spilling under the tabs) */
#ui[data-script="latin"] .num, #ui[data-script="latin"] .sc, #ui[data-script="latin"] .kc, #ui[data-script="latin"] .kc.zh { font-family: "Iowan Old Style", "UI Serif", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; }
html[data-script="latin"] #title h1, html[data-script="latin"] #areaName, #ui[data-script="latin"] .u-head .ttl b, #ui[data-script="latin"] .u-tally .top h2, #ui[data-script="latin"] .u-sys .ttl h2,
#ui[data-script="latin"] .u-fallen h2, #ui[data-script="latin"] .u-blood h2, #ui[data-script="latin"] .u-float .w, #ui[data-script="latin"] .u-detail h3 { font-family: "Hoefler Text", "Iowan Old Style", "UI Serif", "Palatino Linotype", Georgia, serif; }
#ui[data-script="latin"] .u-slot .sl, #ui[data-script="latin"] .u-row .st, #ui[data-script="latin"] .u-seal, #ui[data-script="latin"] .u-lines .d i, #ui[data-script="latin"] .u-tally .itm .r .was, #ui[data-script="latin"] .u-way .st .s,
#ui[data-script="latin"] .u-attr .de i, #ui[data-script="latin"] .u-gauge .lab, #ui[data-script="latin"] .u-legend em, #ui[data-script="latin"] .u-legend .cap, #ui[data-script="latin"] .u-life .pot { font-size: 10.5px; letter-spacing: 0.13em; }
#ui[data-script="latin"] .u-foot, #ui[data-script="latin"] .u-cap, #ui[data-script="latin"] .u-xp, #ui[data-script="latin"] .u-acts .cost, #ui[data-script="latin"] .u-me .pts, #ui[data-script="latin"] .u-me .rec, #ui[data-script="latin"] .u-attrs .hd { font-size: 10.5px; letter-spacing: 0.13em; }
#ui[data-script="latin"] .u-lines .k { font-size: 11.5px; letter-spacing: 0.12em; }
#ui[data-script="latin"] .u-attr .hp, #ui[data-script="latin"] .u-attr.ract .hp { font-size: 13px; line-height: 1.45; }
#ui[data-script="latin"] .u-detail .desc { font-size: 14.5px; line-height: 1.5; }
#ui[data-script="latin"] .u-lines .el.perk i { font-size: 14px; line-height: 1.45; }
#ui[data-script="latin"] .u-lines .el.perk.kw i { font-size: 12.5px; }
#ui[data-script="latin"] .u-fine { font-size: 12px; }
#ui[data-script="latin"] .u-sys .row .nm small { font-size: 11.5px; line-height: 1.35; }
#ui[data-script="latin"] .u-me .pts small { font-size: 11.5px; }
/* the language picker: one at a time, ‹ › */
#ui .u-sys .ctl.pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#ui .u-sys .ctl.pick b { flex: 1; text-align: center; font-weight: 400; letter-spacing: 0.12em; color: var(--paper); border: 1px solid var(--hair); padding: 3px 10px; white-space: nowrap; }
#ui .u-sys .ctl.pick .ar { cursor: pointer; padding: 0 6px; color: var(--gold); font-style: normal; }
/* each language's own type: its characters in a serif made for them, its Latin letters and figures in the interface's Latin serif */
html[data-lang="zh-Hant"] body { font-family: "Iowan Old Style", "UI Serif", "Palatino Linotype", "Songti TC", "UI Serif TC", "Noto Serif CJK TC", "Noto Serif TC", "Source Han Serif TC", "PMingLiU", "MingLiU", serif; }
html[data-lang="ja"] body { font-family: "Iowan Old Style", "UI Serif", "Palatino Linotype", "Hiragino Mincho ProN", "UI Serif JP", "Yu Mincho", "YuMincho", "Noto Serif CJK JP", "Noto Serif JP", "MS PMincho", serif; }
html[data-lang="ko"] body { font-family: "Iowan Old Style", "UI Serif", "Palatino Linotype", "AppleMyungjo", "UI Serif KR", "Nanum Myeongjo", "Noto Serif CJK KR", "Noto Serif KR", "Batang", serif; }
html[data-lang="ru"] body { font-family: "Iowan Old Style", "UI Serif", "PT Serif", "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif; }
/* long names — Japanese katakana, Korean, German, Spanish, Russian — run onto a second line rather than ending in an
   ellipsis: in the slots, the list of a slot, and the rows after a fight. Korean breaks only between words, Japanese at its
   phrases where the browser can find them. */
#ui .u-slot .it, #ui .u-row .nm, #ui .u-tally .itm .nm { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-overflow: clip; line-height: 1.3; overflow-wrap: anywhere; }
#ui[data-script="latin"] .u-slot .it, #ui[data-script="latin"] .u-row .nm, #ui[data-script="latin"] .u-tally .itm .nm { -webkit-hyphens: auto; hyphens: auto; }
#ui[data-lang="ko"] .u-slot .it, #ui[data-lang="ko"] .u-row .nm, #ui[data-lang="ko"] .u-tally .itm .nm { word-break: keep-all; overflow-wrap: anywhere; }
#ui[data-lang="ja"] .u-slot .it, #ui[data-lang="ja"] .u-row .nm, #ui[data-lang="ja"] .u-tally .itm .nm { word-break: auto-phrase; }
#ui[data-lang="ja"] .u-slot .it, #ui[data-lang="ko"] .u-slot .it, #ui[data-lang="ja"] .u-tally .itm .nm, #ui[data-lang="ko"] .u-tally .itm .nm { letter-spacing: 0.08em; }
#ui[data-lang="ja"] .u-row .nm, #ui[data-lang="ko"] .u-row .nm { letter-spacing: 0.1em; }
#ui[data-lang="ja"] .u-tally .itm, #ui[data-lang="ko"] .u-tally .itm, #ui[data-lang="zh-Hant"] .u-tally .itm { grid-template-columns: 34px 148px minmax(0, 1fr) 176px; }

/* the small English line under a Chinese name is ornament: where it is longer than its row it fades out at the edge rather
   than ending in an ellipsis */
#ui .u-row .sc, #ui .u-way .st .sc { white-space: nowrap; text-overflow: clip; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
/* in the Latin and Cyrillic languages a longer label wraps inside its own column instead of running out of it: what an
   attribute comes to in a fight, and the names of the settings */
#ui[data-script="latin"] .u-attr .de i { white-space: normal; line-height: 1.35; }
#ui[data-script="latin"] .u-sys .row .nm { white-space: normal; line-height: 1.3; }
