/* Souls Type. Quiet and dark: pale serif text floating over the world, a few SHADOW ornaments
   recolored to bone, and nothing boxed in that doesn't need to be. */
:root {
  /* The whole UI is drawn for a 1280 x 720 window and zoomed to fit the real one (--ui, set by
     fitUI in play.js), so words and buttons keep their size beside the pixel art at any size.
     Inside the zoom, --dvw / --dvh are the design window's 1vw / 1vh. */
  --ui: 1; --dvw: calc(1vw / var(--ui)); --dvh: calc(1vh / var(--ui));
  --void: #050607; --bone: #e6e1d6; --ash: #a8a296; --faint: #6b665e;
  --attack: #f2a07b; --heal: #9fe0b0; --shield: #a9d4f0; --hurt: #ff8a7e;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --glow: 0 0 18px #cfe3e855, 0 0 2px #000, 0 2px 6px #000;
  /* The DARK UI's frame 3, as drawn (12 px corners): every frame and button but the five fight buttons. */
  --dark-frame: url("assets/ui/dark-frame3.png") 12 fill / 12px stretch;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; background: var(--void); color: var(--bone); font: 18px/1.5 var(--serif); }
/* The game's own pointer (tools/build_assets.py draws it): bone, and gold over what you can click. */
:root { --arrow: url(assets/ui/cursor.png) 1 1, auto; --hand: url(assets/ui/cursor-hover.png) 1 1, pointer;
  --text: url(assets/ui/cursor-text.png) 9 16, text; --no: url(assets/ui/cursor-no.png) 15 15, not-allowed; }
html { cursor: var(--arrow); }
input, textarea { cursor: var(--text); }
/* Anything you can't click right now: the red "can't" ring. */
button:disabled, input:disabled { cursor: var(--no) !important; }
a[href] { cursor: var(--hand); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: var(--hand); }
:focus-visible { outline: 1px solid #cfe3e8aa; outline-offset: 4px; }
img { image-rendering: pixelated; }

/* ---------- the world behind everything ---------- */
#arena { position: fixed; inset: 0; }
/* Everything made of words: zoomed. The world's canvases and the map stay at whole pixels. */
#home, #lobby, #camp, #fight, #results, #settings, #gear, #toast, #tags, #bossInfo,
#mapLabels, #chapter, #journey .bars, #introCard, #skipHint { zoom: var(--ui); }
#arena canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene { image-rendering: pixelated; }
#overlay, #tags, #bossInfo { pointer-events: none; }
#tags { position: absolute; inset: 0; }
/* Menus darken the world so the words stand out; the fight lifts it. */
#veil { position: fixed; inset: 0; pointer-events: none; transition: opacity 1.2s;
  background: radial-gradient(ellipse at 50% 45%, #05060799 0%, #050607ee 70%); }
body[data-screen="fight"] #veil { opacity: 0; }
body[data-screen="lobby"] #veil { opacity: 1; background: linear-gradient(180deg, #050607e8 0%, #050607cc 38%, #05060755 62%, transparent 78%); }
/* In the fight the world sits above a dark strip, so the words never cover anyone. */
body[data-screen="fight"] #arena { bottom: calc(var(--ui) * clamp(150px, 25 * var(--dvh), 210px)); }
body[data-screen="fight"] #scene { filter: brightness(.86); }
body[data-screen="fight"] #arena::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 50%, #050607aa 100%), linear-gradient(transparent 88%, #050607 100%); }

.screen { display: none; position: fixed; inset: 0; z-index: 2; }
body[data-screen="home"] #home, body[data-screen="lobby"] #lobby { display: flex; flex-direction: column; align-items: center; justify-content: center; }
body[data-screen="fight"] #fight { display: block; pointer-events: none; }
#fight > * { pointer-events: auto; }

/* ---------- type ---------- */
.title { font-weight: 400; font-size: clamp(44px, calc(8 * var(--dvw)), 92px); letter-spacing: .22em; text-transform: uppercase;
  text-indent: .22em; text-shadow: var(--glow); }
.byline { margin-top: 8px; font-size: 15px; letter-spacing: .4em; text-indent: .4em; text-transform: uppercase; color: var(--ash); text-shadow: 0 1px 4px #000, 0 0 12px #000; }
.code { font-weight: 400; font-size: clamp(48px, calc(7 * var(--dvw)), 80px); letter-spacing: .4em; text-indent: .4em; text-shadow: var(--glow); }
.eyebrow { font-size: 13px; letter-spacing: .4em; text-transform: uppercase; color: var(--faint); }
.whisper { color: var(--ash); font-style: italic; font-size: 16px; text-align: center; text-shadow: 0 1px 4px #000; }
.quiet { color: var(--faint); font-size: 14px; letter-spacing: .14em; text-transform: uppercase; margin: 4px 0 24px; }
.quiet:hover { color: var(--bone); }
/* Section dividers: the DARK UI's ornament 6 (see .orn below for its size). */
.orn.flourish { margin: 18px auto 34px; }

/* A menu is plain words. The chosen one glows between two SHADOW diamonds. */
.menu { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.menu button { position: relative; padding: 6px 44px; font-size: 22px; letter-spacing: .12em; color: var(--ash);
  text-shadow: 0 1px 4px #000; transition: color .25s, text-shadow .25s, filter .25s; }
/* Main menu, lobby and results use the DARK UI's frame 3. */
#home .menu button, #lobbyMenu button, #resultMenu button, #settings .menu button {
  min-width: 300px; padding: 7px 52px; border: 12px solid transparent; border-image: var(--dark-frame);
  image-rendering: pixelated; filter: brightness(.8); }
#home .menu button:hover, #lobbyMenu button:hover, #resultMenu button:hover, #settings .menu button:hover,
#home .menu button:focus-visible, #lobbyMenu button:focus-visible, #resultMenu button:focus-visible { filter: brightness(1.1) drop-shadow(0 0 10px #cfe3e855); }
#home .menu, #lobbyMenu, #resultMenu { gap: 12px; }
.menu button:hover, .menu button.on, .menu button:focus-visible { color: var(--bone); text-shadow: var(--glow); outline: none; }
.menu button::before, .menu button::after { content: ""; position: absolute; top: 50%; width: 15px; height: 15px; margin-top: -7px;
  background: url("assets/ui/pale-diamond.png") center / contain no-repeat; opacity: 0; transition: opacity .25s, transform .25s; image-rendering: pixelated; }
.menu button::before { left: 12px; transform: translateX(6px); }
.menu button::after { right: 12px; transform: translateX(-6px); }
.menu button:hover::before, .menu button:hover::after, .menu button.on::before, .menu button.on::after,
.menu button:focus-visible::before, .menu button:focus-visible::after { opacity: 1; transform: none; }
.menu button:disabled { opacity: .35; cursor: var(--arrow); }
.menu .key { color: var(--faint); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; margin-right: 10px; }

.ask { display: grid; gap: 14px; justify-items: center; }
.ask label { display: grid; justify-items: center; gap: 6px; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); }
.ask input { width: 280px; padding: 8px 4px; background: none; border: 0; border-bottom: 1px solid #e6e1d655; color: var(--bone);
  font: 26px var(--serif); text-align: center; letter-spacing: .06em; }
.ask input:focus { outline: none; border-bottom-color: var(--bone); }
#code { text-transform: uppercase; letter-spacing: .4em; }

/* ---------- lobby ---------- */
#lobby { justify-content: flex-start !important; padding-top: calc(7 * var(--dvh)); }
#lobbyMenu button { font-size: 20px; }
/* The WPM test is the fight's typing box (.typing), in bone: three lines, the words held still. */
#speedTest { --k: var(--bone); width: min(760px, calc(90 * var(--dvw))); margin-top: 18px; }
#speedTest .page { height: calc(3 * 1.45em); overflow: hidden; text-align: left; image-rendering: auto; }
#speedTest .head { color: var(--ash); }
#speedTest #speedLeft { font-size: 18px; letter-spacing: .05em; color: var(--bone); font-variant-numeric: tabular-nums; }
#speedTest .whisper { margin-top: 6px; font-size: 14px; }

/* ---------- above the heroes and the boss ---------- */
.tag { position: absolute; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; pointer-events: auto; cursor: var(--hand); }
.tag b { display: block; font-weight: 400; font-size: 14px; letter-spacing: .06em; color: var(--c); text-shadow: 0 1px 3px #000, 0 0 10px #000; }
.tag .hp { display: block; width: 40px; height: 4px; margin: 3px auto 0; background: #00000099; box-shadow: 0 0 0 1px #e6e1d633; }
.tag .hp i { display: block; height: 100%; background: var(--c); width: calc(100% * var(--hp)); transition: width .3s; }
.tag .mark { display: none; width: 15px; height: 15px; margin: 0 auto 4px; animation: bob 1.2s ease-in-out infinite; }
.tag.picked .mark { display: block; }
.tag .aim { display: none; align-items: center; justify-content: center; gap: 4px; margin-bottom: 4px; font-size: 15px; color: #ff9e92;
  text-shadow: 0 1px 3px #000; animation: bob 1.2s ease-in-out infinite; }
.tag .aim img { width: 14px; height: 15px; }
.tag.aimed .aim { display: flex; }
.tag.down b { opacity: .4; }
.tag .role { display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ash); text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.tag .role:empty { display: none; }
/* The lobby's host: big, bright gold letters over their name. */
.tag .hostmark { display: block; margin-bottom: 2px; font-size: 20px; line-height: 22px; letter-spacing: .3em; text-indent: .3em;
  text-transform: uppercase; color: #ffe08a; text-shadow: 0 0 10px #ffc94d, 0 0 22px #ffb02e99, 0 1px 3px #000; }
/* The host's Kick under everyone else's name. */
.tag .kick { display: block; margin: 6px auto 0; padding: 3px 14px; font: inherit; font-size: 13px; line-height: 18px; letter-spacing: .18em;
  text-transform: uppercase; color: #c9a39d; background: #0009; border: 1px solid #c9a39d55; cursor: var(--hand); }
.tag .kick:hover, .tag .kick[data-sure] { color: #ffb3a8; border-color: #ff8a7a; }
body[data-screen="lobby"] .tag { cursor: var(--arrow); }
body[data-screen="lobby"] .tag .who { font-size: 16px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
body[data-screen="lobby"] .tag.me .who { text-shadow: 0 0 12px var(--c), 0 1px 3px #000; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.bubble { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 15px;
  padding: 0 2px; border: 12px solid transparent; border-image: var(--dark-frame); image-rendering: pixelated;
  pointer-events: none; text-shadow: 0 1px 2px #000; }
.bubble .ok { color: var(--bone); }
.bubble .bad { color: var(--hurt); }
.bubble .extra { color: #8a2f2a; }
.bubble .rest { color: #77726a; }
.bubble.shake { animation: shake .18s; }
@keyframes shake { 25% { margin-left: -2px; } 75% { margin-left: 2px; } }

/* The boss: its next attack as an icon and a number, a tall framed bar, the name underneath. */
#bossInfo { position: absolute; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; display: none; }
body[data-screen="fight"] #bossInfo { display: block; }
#bossInfo .intent { display: inline-flex; align-items: center; gap: 10px; font-size: 34px; color: #ffd9d0; text-shadow: var(--glow); }
#bossInfo .intent img { width: 30px; height: 31px; filter: drop-shadow(0 0 8px #ff6b5e88); }
#bossInfo .intent small { font-size: 16px; color: var(--bone); letter-spacing: .12em; text-transform: uppercase; }
#bossInfo .life { display: flex; align-items: center; margin: 8px auto 4px; width: clamp(300px, calc(38 * var(--dvw)), 480px); }
/* The DARK UI's segmented bar at twice its size: its end caps, and red segments 3 pixels wide. */
#bossInfo .line { position: relative; flex: 1; height: 24px; border-style: solid; border-color: transparent; border-width: 4px 16px;
  border-image: url("assets/ui/dark-segbar.png") 2 8 / 4px 16px stretch; background: #000b; background-clip: padding-box; image-rendering: pixelated; }
#bossInfo .line .track { position: absolute; inset: 2px; }
#bossInfo .line i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .2s; }
#bossInfo .line .lag { background: repeating-linear-gradient(90deg, #fff3e8 0 6px, transparent 6px 8px); transition: width .7s .45s ease-out; }
#bossInfo .line .fill { background: repeating-linear-gradient(90deg, #ab3131 0 6px, transparent 6px 8px); }
#bossInfo .line .num { position: absolute; right: 4px; top: 50%; translate: 0 -50%; font-size: 13px; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; font-variant-numeric: tabular-nums; }
/* The DARK UI's ornaments, at twice their size: each boss has its own under its name. */
.orn { display: block; margin: 6px auto; height: 24px; image-rendering: pixelated; opacity: .85; filter: drop-shadow(0 1px 2px #000); }
#bossInfo .orn { margin: 4px auto 0; }
#tally .orn { margin: 2px 0 4px auto; }
#bossInfo .named { font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: var(--ash); text-shadow: 0 0 6px #000, 0 1px 3px #000; }
body.bossturn #bossInfo .intent { color: #ff9e92; }

/* ---------- the fight: a dark strip under the world ---------- */
#strip { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(150px, calc(25 * var(--dvh)), 210px);
  display: grid; grid-template-columns: minmax(180px, 22%) 1fr minmax(160px, 18%); gap: calc(2 * var(--dvw)); align-items: center; padding: 0 calc(2.2 * var(--dvw)); }
#vitals .label { display: flex; justify-content: space-between; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
#vitals .label b { font-weight: 400; font-size: 20px; letter-spacing: .02em; color: var(--bone); font-variant-numeric: tabular-nums; }
/* Segmented like the boss's bar: the DARK UI's segmented bar at twice its size, end caps and all,
   filled with segments 6 px wide (3 art pixels) and a 2 px gap. */
#vitals .bar { position: relative; height: 24px; margin: 2px 0 10px; border-style: solid; border-color: transparent; border-width: 4px 16px;
  border-image: url("assets/ui/dark-segbar.png") 2 8 / 4px 16px stretch; background: #000b; background-clip: padding-box; image-rendering: pixelated; }
#vitals .bar i { position: absolute; left: 0; top: 2px; bottom: 2px; transition: width .3s;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px); mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px); }
#vitals .hp i { background: linear-gradient(180deg, #d6f4dc, #7fcf96 50%, #3d7a52); transition: width .3s, background .3s; }
#vitals[data-health="mid"] .hp i { background: linear-gradient(180deg, #fbe7b4, #f0c45c 50%, #8a6420); }
#vitals[data-health="low"] .hp i { background: linear-gradient(180deg, #ffd0ca, #ff6b5e 50%, #8a2a22); }
#vitals .bar em { position: absolute; left: 0; top: 2px; bottom: 2px; background: linear-gradient(90deg, transparent var(--from), #ff5a4c var(--from));
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px); mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px);
  animation: hit-warn 1.2s ease-in-out infinite; }
@keyframes hit-warn { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { #vitals .bar em { animation: none; } }
/* The shield bar is as thick as the health bar (user, 2026-12-02). */
#vitals .sh i { background: linear-gradient(180deg, #eef8ff, #8fb9d6); }
#vitals .sh.over i { box-shadow: 0 0 12px #cfe8ff; }
#hitNote { font-size: 14px; font-style: italic; color: var(--hurt); }
#hitNote:empty { display: none; }
#tally { text-align: right; }
#turnName { white-space: nowrap; font-size: clamp(15px, calc(1.7 * var(--dvw)), 22px); letter-spacing: .16em; text-transform: uppercase; text-shadow: var(--glow); }
body.bossturn #turnName { color: #ff9e92; }
#pips { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 6px 0; font-size: 14px; color: var(--ash); min-height: 24px; }
#pips img { width: 20px; height: 20px; filter: drop-shadow(0 0 6px #f0e6c8aa); }
#pips img.used { opacity: .2; filter: none; }
#myStats { font-size: 14px; color: var(--faint); letter-spacing: .06em; }
#myStats b { font-weight: 400; color: var(--ash); font-size: 18px; }
/* The boss's turn: the world's edges darken to red. */
body.bossturn #arena::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 140px 20px #7a1712aa; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .6; } }

#panel { text-align: center; display: grid; gap: 10px; justify-items: center; text-shadow: 0 1px 4px #000; min-width: 0; }
.choices { display: flex; gap: clamp(10px, calc(2 * var(--dvw)), 26px); }
.choices button { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 12px; padding: 10px 26px 10px 18px;
  font-size: 26px; letter-spacing: .06em; color: var(--k); border: 9px solid transparent;
  border-image: var(--frame) 6 fill / 9px stretch; image-rendering: pixelated; filter: brightness(.78); transition: filter .2s, transform .2s; }
.choices button img { grid-row: span 2; width: auto; height: 30px; }
.choices button small { font-size: 12px; letter-spacing: .24em; color: var(--faint); text-align: left; }
.choices button:hover:not(:disabled), .choices button.on { filter: brightness(1.15) drop-shadow(0 0 12px color-mix(in srgb, var(--k) 50%, transparent)); transform: translateY(-2px); }
.choices button:disabled { opacity: .3; cursor: var(--arrow); }
.choices .k-attack { --frame: url("assets/ui/btn-attack.png"); }
.choices .k-heal { --frame: url("assets/ui/btn-heal.png"); }
.choices .k-shield { --frame: url("assets/ui/btn-shield.png"); }
.targets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; }
.targets button { padding: 1px 14px; font-size: 18px; color: var(--c); border: 12px solid transparent;
  border-image: var(--dark-frame); image-rendering: pixelated; filter: brightness(.75); }
.targets button:hover, .targets button.on { filter: brightness(1.2) drop-shadow(0 0 10px color-mix(in srgb, var(--k) 45%, transparent)); }
.targets button small { color: var(--ash); font-size: 13px; margin-left: 6px; }
.minor { display: flex; gap: 10px; justify-content: center; }
.minor button { padding: 3px 16px; font-size: 15px; letter-spacing: .06em; color: var(--ash); border: 6px solid transparent;
  border-image: url("assets/ui/pale-button.png") 6 fill / 6px stretch; image-rendering: pixelated; filter: brightness(.75); }
/* Only Team Up and End turn keep the SHADOW frame; Back takes the DARK one like the rest. */
.minor.back button { padding: 0 12px; border-width: 12px; border-image: var(--dark-frame); }
.minor button:hover, .minor button.on { filter: brightness(1.15); color: var(--bone); }
.minor b { font-weight: 400; color: var(--faint); margin-right: 6px; font-size: 13px; }
.k-attack { --k: var(--attack); } .k-heal { --k: var(--heal); } .k-shield { --k: var(--shield); } .k-defend { --k: var(--bone); }
.small { font-size: 15px; color: var(--faint); letter-spacing: .06em; }
.small b { font-weight: 400; color: var(--ash); }
.small button { color: var(--ash); text-decoration: underline; text-underline-offset: 3px; font-size: 15px; padding: 0 4px; }
.small button:hover { color: var(--bone); }
.status { font-size: 22px; font-style: italic; color: var(--ash); }

/* Typing: the words stay still. Only colors change until the page is done. */
.typing { position: relative; width: min(880px, 100%); padding: 0 24px 3px; border: 12px solid transparent;
  border-image: var(--dark-frame); image-rendering: pixelated; transition: filter .4s; }
.typing .head { display: flex; justify-content: center; align-items: center; gap: 16px; font-size: 13px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--k); margin-bottom: 2px; }
/* The streak: five diamonds fill with clean, quick words. Five in a row lights the frame gold. */
.typing .run { display: inline-flex; gap: 5px; }
.typing .run img { width: 11px; height: 11px; opacity: .22; transition: opacity .2s, filter .2s; }
.typing .run img.on { opacity: 1; filter: sepia(1) saturate(5) hue-rotate(-12deg) brightness(1.35) drop-shadow(0 0 5px #ffc94dcc); animation: lit .3s ease-out; }
@keyframes lit { 0% { transform: scale(1.8); } 100% { transform: none; } }
.typing .corner { position: absolute; width: 17px; height: 17px; opacity: 0; transition: opacity .4s; pointer-events: none;
  filter: sepia(1) saturate(5) hue-rotate(-12deg) brightness(1.35) drop-shadow(0 0 6px #ffc94d); }
.typing .tl { left: -17px; top: -17px; } .typing .tr { right: -17px; top: -17px; }
.typing .bl { left: -17px; bottom: -17px; } .typing .br { right: -17px; bottom: -17px; }
.typing .sweep { position: absolute; inset: -9px; padding: 3px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: linear-gradient(100deg, transparent 42%, #ffe9a8 50%, transparent 58%) 0 0 / 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: sweep 2.4s linear infinite; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
.typing[data-lvl="1"] { filter: drop-shadow(0 0 8px #ffc94d55); }
.typing[data-lvl="2"] { filter: drop-shadow(0 0 12px #ffc94d88); }
.typing[data-lvl="3"] { filter: drop-shadow(0 0 18px #ffc94dbb); }
.typing:not([data-lvl="0"]) .corner { opacity: 1; animation: bob 1.2s ease-in-out infinite; }
.typing .tr, .typing .br { animation-delay: .3s !important; }
.typing[data-lvl="2"] .sweep { opacity: .55; }
.typing[data-lvl="3"] .sweep { opacity: .9; animation-duration: 1.3s; }
.page { font-size: clamp(24px, calc(2.6 * var(--dvw)), 34px); line-height: 1.45; color: #8c877e; max-width: 820px; margin: 0 auto; word-spacing: .3em; }
.page .w { white-space: nowrap; }
.page .done, .page .miss { color: #6f6a62; }
.page .done .ok, .page .miss .ok { color: #cfc9bd; }
.page .miss { text-decoration: underline 2px #c2453a; text-underline-offset: 6px; }
.page .ok { color: var(--bone); }
.page .now .ok { text-shadow: 0 0 12px color-mix(in srgb, var(--k) 60%, transparent); }
.page .bad { color: var(--hurt); }
.page .extra { color: #8a2f2a; }
.typing .caret { position: absolute; left: 0; top: 0; width: 2px; border-radius: 1px; background: var(--k); box-shadow: 0 0 6px var(--k);
  pointer-events: none; transition: transform .09s ease-out; animation: caret-blink 1s step-end infinite; animation-delay: .5s; }
@keyframes caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .typing .caret { transition: none; animation: none; } }
.page em { font-style: normal; }
.clock { width: min(520px, 80%); height: 1px; margin: 12px auto 0; background: #ffffff14; }
.clock i { display: block; height: 100%; background: var(--k); transform-origin: left; box-shadow: 0 0 8px var(--k); }

#banner { position: absolute; left: 0; right: 0; top: 6%; text-align: center; font-size: clamp(30px, calc(4.5 * var(--dvw)), 52px);
  letter-spacing: .3em; text-transform: uppercase; text-shadow: var(--glow); opacity: 0; transition: opacity .6s; pointer-events: none; }
#banner.show { opacity: 1; }
#banner small { display: block; font-size: 16px; letter-spacing: .1em; text-transform: none; font-style: italic; color: var(--ash); margin-top: 6px; }

/* ---------- results, settings ---------- */
.screen-over { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, #050607b3, #050607f2 70%); }
.screen-over h1 { font-weight: 400; font-size: clamp(44px, calc(7 * var(--dvw)), 80px); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; text-shadow: var(--glow); }
#myResult { display: flex; gap: clamp(24px, calc(5 * var(--dvw)), 60px); margin: 18px 0 6px; }
#myResult div { display: grid; justify-items: center; }
#myResult b { font-weight: 400; font-size: clamp(34px, calc(5 * var(--dvw)), 54px); text-shadow: var(--glow); font-variant-numeric: tabular-nums; }
#myResult span { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--faint); }
#resultTable { margin: 14px 0 20px; border-collapse: collapse; font-size: 16px; }
#results { overflow-y: auto; justify-content: safe center; padding: 24px 0; }
#results .flourish { margin: 10px auto 18px; }
#resultTable th { font-weight: 400; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); padding: 4px 18px; }
#resultTable td { padding: 4px 18px; text-align: center; color: var(--ash); font-variant-numeric: tabular-nums; }
#resultTable td:first-child { text-align: right; color: var(--c); }

#gear { position: fixed; right: 18px; top: 16px; z-index: 6; opacity: .55; transition: opacity .2s; }
#gear:hover { opacity: 1; }
#gear img { width: 22px; height: 23px; }
#settings { position: fixed; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #050607ee; }
#settings h2 { font-weight: 400; font-size: 34px; letter-spacing: .3em; text-transform: uppercase; }
#settings label { display: flex; align-items: center; gap: 12px; font-size: 18px; letter-spacing: .1em; color: var(--ash); }
#settings label img { width: 18px; height: 16px; }
#settings input { width: 220px; accent-color: var(--bone); }

#toast { position: fixed; left: 50%; top: 22px; translate: -50% 0; z-index: 9; font-size: 16px; font-style: italic; color: var(--bone);
  text-shadow: 0 1px 4px #000; opacity: 0; transition: opacity .4s; pointer-events: none; }
#toast.show { opacity: 1; }
/* The game's own hover box (for a locked hero: how to unlock it), in the DARK frame. */
#tip { position: fixed; z-index: 10; max-width: 260px; padding: 2px 6px; border: 12px solid transparent; border-image: var(--dark-frame);
  image-rendering: pixelated; font-size: 14px; line-height: 1.35; color: var(--bone); text-align: center; white-space: normal;
  text-shadow: 0 1px 3px #000; pointer-events: none; translate: -50% 0; }
#tip b { display: block; font-weight: 400; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #ffd666; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* The results screen sits alone over the world. */
body:has(#results:not([hidden])) :is(#bossInfo, #tags, #strip, #banner) { visibility: hidden; }
#home .menu button, #lobbyMenu button, #resultMenu button, #settings .menu button { width: min(340px, calc(80 * var(--dvw))); }

/* Lobby testing tools: smaller, set apart. */
#testMenu { position: fixed; left: 22px; top: 22px; margin: 0; gap: 10px; align-items: flex-start; }
#testMenu .eyebrow { margin-bottom: 4px; }
#testMenu button { font-size: 15px; padding: 0 14px; min-width: 0; width: 270px; white-space: nowrap; }
/* Narrower windows: the hero row reaches the top-left corner, so the testing buttons shrink and move
   down to mid-height (clear of the row above and the party below); the narrowest drop under the menu. */
body.dw1300 #testMenu { left: 12px; top: 50%; translate: 0 -50%; gap: 5px; }
body.dw1300 #testMenu .eyebrow { display: none; }
body.dw1300 #testMenu button { width: 210px; font-size: 13px; padding: 1px 12px; white-space: nowrap; }
body.dw900 #testMenu { position: static; translate: none; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; margin: 6px auto 0; }
body.dw900 #testMenu button { width: auto; padding: 1px 14px; }
#home .menu button, #lobbyMenu button, #resultMenu button, #settings .menu button, #testMenu button {
  border: 12px solid transparent; border-image: var(--dark-frame); image-rendering: pixelated; }
#lobbyMenu button { width: min(420px, calc(86 * var(--dvw))); white-space: nowrap; }
body[data-screen="home"] #veil { opacity: .8; }
/* The campfire menu is already black; the veil would only put the fire out. */
body.camp[data-screen="home"] #veil { opacity: 0; }
#lobby { overflow-y: auto; scrollbar-width: none; padding-bottom: 20px; bottom: calc(36 * var(--dvh)); }

/* The boss's name is a title. */
#bossInfo .named .title { font-size: clamp(32px, calc(4 * var(--dvw)), 54px); letter-spacing: .26em; text-indent: .26em; text-transform: uppercase;
  color: #f4efe4; text-shadow: 0 0 28px #cfe3e88c, 0 0 3px #000, 0 3px 10px #000; line-height: 1.05; margin-top: 4px; }
#bossInfo .named .epithet { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 4px;
  font-size: clamp(18px, calc(1.8 * var(--dvw)), 24px); font-style: italic; letter-spacing: .14em; text-transform: none; color: #d9d1c2;
  text-shadow: 0 0 14px #cfe3e855, 0 0 6px #000, 0 1px 3px #000; }
/* The boss's next attack, in gold. */
#bossInfo .intent { color: #ffd666; font-size: 38px; }
#bossInfo .intent img { width: 34px; height: 35px; filter: drop-shadow(0 0 10px #ff6b5ecc) drop-shadow(0 0 2px #000); }
#bossInfo .intent small { color: #f3e3b3; font-size: 17px; }
body.bossturn #bossInfo .intent { color: #ffd666; animation: pulse 1s ease-in-out infinite; }
.tag .aim { font-size: 16px; }
.tag .aim img { width: 16px; height: 17px; }
/* Health above heroes: bigger, with numbers, colored by how hurt they are. */
.tag .life { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.tag .life[hidden] { display: none; }
.tag .hp { position: relative; width: 60px; height: 10px; margin: 0; background: #000000aa; background-clip: padding-box; box-shadow: none;
  border: 2px solid transparent; border-image: url("assets/ui/dark-bar.png") 2 / 2px stretch; image-rendering: pixelated; filter: drop-shadow(0 0 3px #000); }
.tag .hp i { position: absolute; left: 0; top: 0; bottom: 0; background: #9fe0b0; transition: width .3s, background .3s; }
.tag .hp s { position: absolute; left: 0; top: -3px; height: 2px; background: #cfe8ff; box-shadow: 0 0 4px #cfe8ff; }
.tag .num { font-size: 13px; color: var(--bone); text-shadow: 0 1px 3px #000; font-variant-numeric: tabular-nums; }
.tag[data-health="mid"] .hp i { background: #f0c45c; }
.tag[data-health="low"] .hp i { background: #ff6b5e; }
.tag[data-health="low"] .num { color: #ff9e92; }
.tag[data-health="down"] .num { color: var(--faint); font-style: italic; }
.targets kbd { font: 12px var(--serif); color: var(--faint); margin-right: 8px; letter-spacing: .1em; }

/* Menu background option "ink": black, with drifting ink and pale motes. */
#ink { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
body.ink[data-screen="home"] #ink, body.ink[data-screen="lobby"] #ink { display: block; }
body.ink[data-screen="home"] #arena, body.ink[data-screen="lobby"] #scene { visibility: hidden; }
body.ink[data-screen="lobby"] #arena { visibility: visible; }

#lobby .code { font-size: clamp(40px, calc(5 * var(--dvw)), 64px); line-height: 1.1; }

/* ---------- clearer numbers and states ---------- */
#hpNum { color: #bfe8c6 !important; }
#vitals[data-health="mid"] #hpNum { color: #f0c45c !important; }
#vitals[data-health="low"] #hpNum, #vitals[data-health="down"] #hpNum { color: #ff9e92 !important; }
#shNum { color: #bfe0ff !important; text-shadow: 0 0 10px #8fc4ff66; }
#shNum small { font-size: 13px; color: #8fc4ff; margin-left: 2px; }
#vitals .sh.some { filter: drop-shadow(0 0 6px #8fc4ff88); }
#vitals .sh.over { background: repeating-linear-gradient(90deg, #5f86a3 0 6px, transparent 6px 8px) padding-box; background-origin: padding-box; }
#vitals .sh.over i { box-shadow: 0 0 14px #e6f4ff; }
#pips { gap: 10px; }
#pips .gems { display: flex; gap: 6px; }
#pips img { width: 30px; height: 30px; }
#pips img.on { filter: sepia(1) saturate(5) hue-rotate(-12deg) brightness(1.35) drop-shadow(0 0 8px #ffc94dcc); }
#pips img.used { opacity: .18; filter: none; }
#pips .left { font-size: 19px; color: #ffd666; letter-spacing: .04em; text-shadow: 0 0 10px #ffc94d55; }
.tag .aim { color: #ff8a7e; }
.tag .aim img { filter: drop-shadow(0 0 4px #ff6b5e99); }
.tag .num .h { color: #bfe8c6; }
.tag[data-health="mid"] .num .h { color: #f0c45c; }
.tag[data-health="low"] .num .h { color: #ff9e92; }
.tag .num .s { color: #bfe0ff; margin-left: 3px; }
.tag .acts { display: flex; justify-content: center; gap: 4px; margin-top: 5px; min-height: 8px; }
/* This fight's speed and accuracy under the health bar, all in white; the gaps above and below it
   match (the diamonds are turned squares, so they sit a little lower). */
.tag .stat { display: block; margin-top: 4px; font-size: 12px; line-height: 12px; letter-spacing: .06em; color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 6px #000; font-variant-numeric: tabular-nums; }
.tag .stat:empty { display: none; }
.tag .stat b { display: inline; font-size: 12px; letter-spacing: .02em; color: #fff; text-shadow: inherit; }
/* Live speed while typing: a chip at the top of the tag, whiter when slow, gold from 100 WPM. Kept
   10px clear of the damage mark below it, which bobs up 3px. */
.tag .live { display: inline-block; margin-bottom: 10px; padding: 1px 7px; font-size: 12px; letter-spacing: .08em; color: #15110a;
  transition: background .4s, box-shadow .4s; }
.tag .live:empty { display: none; }
/* Typing stopped: the chip holds its last speed, then fades over the last half second. */
.tag .live.held { animation: chip-out 2.5s linear forwards; }
@keyframes chip-out { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* A perfect box: one bright gold pulse. */
.tag .live.pulse { animation: chip-pulse .9s ease-out; }
.tag .live.held.pulse { animation: chip-pulse .9s ease-out, chip-out 2.5s linear forwards; }
@keyframes chip-pulse {
  0% { background: #fff6c8; box-shadow: 0 0 22px 6px #ffd23a, 0 0 4px #fff; transform: scale(1.3); }
  40% { background: #ffd23a; box-shadow: 0 0 16px 3px #ffc21a; transform: scale(1.12); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .tag .live.pulse, .tag .live.held.pulse { animation: none; } }
/* A title under the name, in a thin frame of its own color. */
.tag .ttl { display: block; font-size: 0; line-height: 0; }
.tag .ttl:empty { display: none; }
/* Half a pixel low in the fight, so the gaps to the name above and the health bar below match. */
.tag .ttl span { position: relative; top: 0.5px; }
/* In the lobby the name is larger and "you" sits below: there it rises, to sit midway between them. */
body[data-screen="lobby"] .tag .ttl span { top: -1.5px; }
.tag .ttl span, #titleName span { display: inline-block; margin-top: 2px; padding: 0 6px; font-size: 11px; line-height: 15px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--t); border: 1px solid color-mix(in srgb, var(--t) 55%, transparent); background: #0008;
  text-shadow: 0 0 6px color-mix(in srgb, var(--t) 70%, transparent); }
.tag .acts i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid #e6e1d655; }
.tag .acts i.on { background: #ffd666; border-color: #ffd666; box-shadow: 0 0 6px #ffc94d; }
#resultTable td.best b { font-weight: 700; color: #ffd666; text-shadow: 0 0 10px #ffc94d88; font-size: 18px; }
/* Rewards for clean, fast typing. */
#reward { position: absolute; left: 50%; bottom: calc(100% + 10px); translate: -50% 0; pointer-events: none; opacity: 0;
  font-size: 22px; letter-spacing: .2em; text-transform: uppercase; color: #ffd666; text-shadow: 0 0 16px #ffc94d99, 0 2px 4px #000; white-space: nowrap; }
#reward b { font-weight: 400; margin-left: 12px; color: #fff3c4; }
#reward.show { animation: rise 1.1s ease-out forwards; }
#reward.flawless { font-size: 34px; letter-spacing: .3em; }
#reward.flawless.show { animation: rise 1.6s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.typing.flash { animation: flawless 1s ease-out; }
@keyframes flawless { 0% { filter: brightness(2.2) drop-shadow(0 0 24px #ffd666); } 100% { filter: none; } }
#strip { position: absolute; }
#pips .left { white-space: nowrap; }
#strip { grid-template-columns: minmax(180px, 22%) 1fr minmax(190px, 20%); }

/* ---------- the boss's afflictions ---------- */
/* Icons are SHADOW-style pixel glyphs, shown at whole-pixel sizes. */
.fxs { display: inline-flex; gap: 4px; align-items: center; }
.fxs img, #bossInfo .intent .afx { zoom: 2; image-rendering: pixelated; }
.fxs:empty { display: none; }
.tag .fxs { display: flex; justify-content: center; margin-top: 3px; gap: 3px; }
.tag .fxs:empty { display: none; }
/* Heal words toward a cure, beside the debuff icons and on the Heal target buttons. */
.tag .fxs .cure { align-self: center; margin-left: 2px; font-size: 11px; color: var(--heal); text-shadow: 0 0 3px #000, 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.targets button small.cure { color: var(--heal); }
#bossInfo .intent .afx[hidden] { display: none; }
/* A boss acting twice this turn: its second move on a line under the first. */
#bossInfo .intent.also { display: flex; justify-content: center; font-size: 24px; gap: 8px; margin-top: 2px; opacity: .92; }
#bossInfo .intent.also[hidden] { display: none; }
#bossInfo .intent.also > b { font-weight: 400; color: var(--bone); }
#bossInfo .intent.also img:not(.afx) { width: 22px; height: 23px; }
#bossInfo .intent img.afx { width: auto; height: auto; filter: drop-shadow(0 0 1px #000); margin-left: -4px; }
#hitNote.fx { color: #c9b8e8; }
/* Drawn in the world's pixels over the box: ink blots, fog, ice, glints and falling bits. */
.typing canvas.boxfx { position: absolute; left: -29px; top: -29px; pointer-events: none; image-rendering: pixelated; z-index: 3; }
.typing .page .w { transition: filter .35s, opacity .35s, color .35s; }

/* Fen Fog: only the word you're on and the next one show through. */
.typing.fx-fog .page .w:not(.now):not(.next) { filter: blur(7px); opacity: .2; }
.typing.fx-fog .page .next { color: #a9b3b6; }

/* Mirror: every word reads backwards, like ice-glass. */
.typing.fx-mirror .page .w { unicode-bidi: isolate-override; direction: rtl; }
.typing.fx-mirror .page { color: #8aa9b6; }
.typing.fx-mirror .page .now { color: #d8eef6; }

/* Frost: the first letter is frozen over until you type it (each word starts with it twice). */
.page .ice { color: #9fd6f4; text-shadow: 0 0 6px #8fd0f0aa, 0 2px 0 #0c1620; }
.page .now .thawed { color: #e4f6ff; text-shadow: 0 0 10px #8fd0f0; }

/* Darkness: only the words near you are lit, and the arena goes dark. */
.typing.fx-dark .page {
  -webkit-mask-image: radial-gradient(ellipse 170px 64px at var(--lx, 50%) var(--ly, 50%), #000 0 55%, #0009 70%, #0003 85%, transparent 100%);
  mask-image: radial-gradient(ellipse 170px 64px at var(--lx, 50%) var(--ly, 50%), #000 0 55%, #0009 70%, #0003 85%, transparent 100%);
}
.typing.fx-dark .page .now { text-shadow: 0 0 14px #ffd66655; }
body[data-screen="fight"] #arena canvas { transition: filter .8s; }
body.dark[data-screen="fight"] #arena canvas { filter: brightness(.38) saturate(.55); }

/* Chain: links run along the box; a typo snaps them and the box starts over. */
.typing .chains { display: none; position: absolute; left: 14px; right: 14px; height: 15px; pointer-events: none; z-index: 2;
  background: url("assets/ui/chain-link.png") repeat-x; background-size: 24px 15px; image-rendering: pixelated; }
.typing .chains.top { top: -16px; }
.typing .chains.bottom { bottom: -16px; }
.typing.fx-chain .chains { display: block; }
.typing.snap .chains { animation: snap .7s steps(5); }
.typing .held { color: #c9b48a; }
.typing .head .what { white-space: nowrap; }
@keyframes snap { 0% { opacity: 0; } 30% { opacity: .15; transform: translateY(5px); } 100% { opacity: 1; transform: none; } }

/* Chill: a colder, shorter clock. */
.typing.fx-chill .clock i { background: #9fd8ff; box-shadow: 0 0 8px #9fd8ff; }

/* Heavy Hands: time lost to typos breaks off the end of the clock. */
.clock { position: relative; }
.clock .lost { position: absolute; right: 0; top: -1px; height: 3px; width: 0; background: repeating-linear-gradient(90deg, #d68c6a 0 6px, #5a3324 6px 8px);
  box-shadow: 0 0 6px #d68c6a88; transition: width .2s steps(3); }
.typing.thud { animation: thud .22s steps(3); }
@keyframes thud { 0% { translate: 0 3px; } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .typing.thud, .typing.snap .chains { animation: none; } }

/* ---------- story mode: the map, then the boss's entrance ---------- */
body[data-screen="journey"] #journey { display: block; }
body[data-screen="journey"] :is(#tags, #veil) { display: none; }
/* The arena keeps the fight's shape, so the entrance flows straight into the battle. */
body[data-screen="journey"] #arena { bottom: calc(var(--ui) * clamp(150px, 25 * var(--dvh), 210px)); }
#journey { background: #000; transition: background .6s; }
#journey.intro { background: transparent; }
#mapView { position: absolute; inset: 0; display: none; }
#journey.map #mapView { display: block; }
#mapCanvas { position: absolute; left: 50%; top: 50%; translate: -50% -50%; image-rendering: pixelated; }
#mapLabels span { position: absolute; translate: -50% 0; font-size: 13px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ash); text-shadow: 0 1px 3px #000, 0 0 8px #000; white-space: nowrap; margin-top: 14px; }
#mapLabels .fallen { color: #7d6f66; text-decoration: line-through; text-decoration-color: #b3262e; }
#mapLabels .next { color: #ffd666; }
#chapter { position: absolute; left: 0; right: 0; bottom: 0; padding: calc(8 * var(--dvh)) 0 calc(5 * var(--dvh)); background: linear-gradient(180deg, transparent, #000000d8 45%);
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; transition: opacity 1.2s; text-align: center; pointer-events: none; }
#chapter.shown { opacity: 1; }
#chapter h1 { font-weight: 400; font-size: clamp(30px, calc(4.4 * var(--dvw)), 54px); letter-spacing: .22em; text-indent: .22em; text-transform: uppercase;
  text-shadow: var(--glow), 0 2px 12px #000; margin: 4px 0 8px; }
#chapterStory { max-width: 600px; margin: 0; }
#blackout { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .5s; }
#journey.dim #blackout { opacity: 1; }
/* Letterbox bars for the entrance; the bottom one covers where the fight's controls will be. */
#journey .bars { display: none; }
#journey.intro .bars { display: block; }
#journey .bars i { position: absolute; left: 0; right: 0; background: #000; }
#journey .bars i:first-child { top: 0; height: calc(9 * var(--dvh)); animation: barTop .8s ease-out both; }
#journey .bars i:last-child { bottom: 0; height: clamp(150px, calc(25 * var(--dvh)), 210px); animation: barBottom .8s ease-out both; }
@keyframes barTop { from { translate: 0 -100%; } }
@keyframes barBottom { from { translate: 0 100%; } }
#introCard { position: absolute; left: 0; right: 0; bottom: clamp(150px, calc(25 * var(--dvh)), 210px); padding-bottom: calc(3 * var(--dvh)); display: flex; flex-direction: column;
  align-items: center; opacity: 0; transition: opacity 1.4s; pointer-events: none; text-align: center; }
#journey.intro #introCard { bottom: 0; height: clamp(150px, calc(25 * var(--dvh)), 210px); justify-content: center; padding: 0; }
#introCard.shown { opacity: 1; }
#introName { font-weight: 400; font-size: clamp(40px, calc(6 * var(--dvw)), 76px); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase;
  margin: 0; text-shadow: var(--glow), 0 0 30px #000; line-height: 1; white-space: nowrap; }
#introCard .orn { margin: 8px auto 4px; height: 36px; } /* three times: the big title above it */
#introEpithet { font-style: italic; color: var(--ash); font-size: 19px; letter-spacing: .08em; margin: 0 0 10px; }
#introEpithet:empty { display: none; }
#foeFacts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 0; font-size: 15px; color: var(--ash); text-shadow: 0 1px 3px #000; }
#foeFacts li { display: flex; align-items: center; gap: 5px; padding: 0 14px; }
#foeFacts li + li { border-left: 1px solid #e6e1d633; }
#foeFacts b { font-weight: 400; color: var(--bone); }
#foeFacts em { font-style: normal; color: #ff9e92; }
#foeFacts .tricks { gap: 12px; }
#foeFacts .tricks i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; color: var(--bone); }
#foeFacts .tricks img { zoom: 2; image-rendering: pixelated; }
/* The host can click the story on, a step at a time. */
#journey.hurry { cursor: var(--hand); }
#skipHint { position: absolute; right: 28px; bottom: 24px; z-index: 6; display: flex; align-items: center; gap: 12px; margin: 0;
  padding: 4px 18px; font: inherit; font-size: 19px; letter-spacing: .3em; text-transform: uppercase; color: var(--bone);
  border: 12px solid transparent; border-image: var(--dark-frame);
  image-rendering: pixelated; cursor: var(--hand); text-shadow: 0 1px 3px #000; filter: brightness(.8); transition: filter .2s; }
#skipHint:hover, #skipHint:focus-visible { filter: brightness(1.1); outline: none; }
#skipHint.voted { filter: brightness(.55); cursor: var(--arrow); }
#skipHint img { width: 30px; image-rendering: pixelated; }
#skipVotes { color: var(--ash); letter-spacing: .1em; }
#skipHint[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { #journey .bars i { animation: none; } }

/* The trail: a framed portrait per boss, joined by a road of pale diamonds. */
.trail { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0 0 16px; }
.trail[hidden] { display: none; }
.trail .node { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trail .frame { display: block; padding: 0; border: 12px solid transparent; border-image: var(--dark-frame);
  image-rendering: pixelated; transition: filter .6s, box-shadow .6s; }
.trail .frame canvas { display: block; width: 126px; height: 96px; image-rendering: pixelated; transition: filter .8s; }
.trail small { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); white-space: nowrap; transition: color .6s; }
.trail .node[data-state="ahead"] canvas { filter: brightness(0) drop-shadow(0 0 1px #e6e1d655); }
.trail .node[data-state="ahead"] .frame { filter: brightness(.6); }
.trail .node[data-state="fallen"] canvas { filter: grayscale(1) brightness(.5); }
.trail .node[data-state="fallen"] small { color: #7d6f66; text-decoration: line-through; text-decoration-color: #ff6b5e88; }
.trail .node[data-state="current"] .frame { filter: drop-shadow(0 0 10px #ffc94d66); }
.trail .node[data-state="current"] small { color: #ffd666; }
.trail .node.reveal canvas { animation: reveal 1.1s steps(6); }
.trail .node.falling .frame { animation: fall .5s steps(4); }
@keyframes reveal { 0% { filter: brightness(0); } 100% { filter: none; } }
@keyframes fall { 0% { transform: translateY(0); } 40% { transform: translateY(4px); } 100% { transform: none; } }
.trail .road { display: flex; gap: 6px; margin: 0 4px 22px; }
.trail .road img { width: 11px; height: 11px; opacity: .2; transition: opacity .25s, filter .25s; }
.trail .road.lit img, .trail .road img.on { opacity: 1; filter: sepia(1) saturate(5) hue-rotate(-12deg) brightness(1.3) drop-shadow(0 0 4px #ffc94daa); }
#resultTrail { margin: 0 0 18px; }
#resultTrail canvas { width: 84px; height: 64px; }
body.dh700 .trail .frame canvas { width: 84px; height: 64px; }
body.dh700 .trail { margin-bottom: 8px; }
body.dh700 #chapter h1 { font-size: 34px; }
body.dh700 #chapter .flourish { margin: 6px auto 8px; }
body.dh700 #journeyMenu button { padding: 4px 40px; }
@media (prefers-reduced-motion: reduce) { #chapter { transition: none; } .trail .node.reveal canvas, .trail .node.falling .frame { animation: none; } }

/* ---------- your Frost Fiend's color ---------- */
#colorName { color: var(--c); text-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }
#swatches { display: grid; grid-template-columns: repeat(6, 26px); gap: 0 4px; }
#swatches .swatch { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; background: none; border: 0; cursor: var(--hand); }
#swatches .swatch i { width: 11px; height: 11px; rotate: 45deg; background: var(--c); box-shadow: 0 0 0 2px #0c0a10, 0 0 0 3px #e6e1d655; transition: scale .12s, box-shadow .12s; }
#swatches .swatch:hover i, #swatches .swatch:focus-visible i { scale: 1.25; box-shadow: 0 0 0 2px #0c0a10, 0 0 0 3px #e6e1d6cc; }
#swatches .swatch:focus-visible { outline: none; }
#swatches .swatch.mine i { scale: 1.35; box-shadow: 0 0 0 2px #0c0a10, 0 0 0 3px #e6e1d6, 0 0 12px var(--c); }
#swatches .swatch.taken { cursor: var(--arrow); }
#swatches .swatch.taken i { opacity: .25; box-shadow: 0 0 0 2px #0c0a10; }

/* ---------- combos, over each hero ---------- */
.tag .combo { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--c);
  text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.tag .combo:empty { display: none; }
.tag .combo b { display: inline; font-size: 17px; letter-spacing: .04em; text-shadow: 0 1px 3px #000, 0 0 10px var(--c); }
.tag .combo[data-level="2"] b { font-size: 20px; }
.tag .combo[data-level="3"] b { font-size: 24px; color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px var(--c), 0 0 18px var(--c); }
.tag .combo.pop { animation: combo-pop .28s ease-out; }
@keyframes combo-pop { 0% { transform: scale(1.45); } 100% { transform: scale(1); } }
.tag.flawless .who { animation: flawless-name 1.4s ease-out; }
@keyframes flawless-name { 0%, 30% { color: #fff; text-shadow: 0 0 6px #fff, 0 0 18px var(--c), 0 0 30px var(--c); } 100% { } }
@media (prefers-reduced-motion: reduce) { .tag .combo.pop, .tag.flawless .who { animation: none; } }
#lobbyMenu #swatches .swatch { padding: 0; min-width: 0; border: 0; border-image: none; background: none; filter: none; }
#lobbyMenu #swatches .swatch::before, #lobbyMenu #swatches .swatch::after { content: none; }

/* ---------- the hero picker: yours lit, the rest locked for now ---------- */
#heroRow, #colorRow { display: flex; align-items: center; justify-content: center; gap: 12px; }
#heroRow .key, #heroName, #colorRow .key, #colorName { font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); width: 110px; }
#heroRow .key, #colorRow .key { text-align: right; }
#heroName { color: var(--ash); }
/* Eleven heroes: one row on a wide screen, two on a narrow one (the labels either side keep their room). */
#heroPick { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: calc(calc(100 * var(--dvw)) - 300px); }
#lobbyMenu #heroPick .hero-card { position: relative; width: 58px; height: 68px; padding: 0; min-width: 0; display: grid; place-items: end center;
  border: 12px solid transparent; border-image: var(--dark-frame); image-rendering: pixelated;
  background: none; filter: brightness(.75); }
#lobbyMenu #heroPick .hero-card::before, #lobbyMenu #heroPick .hero-card::after { content: none; }
#heroPick .hero-card canvas { width: 36px; height: 45px; image-rendering: pixelated; }
#lobbyMenu #heroPick .hero-card.mine { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 55%, transparent)); }
#lobbyMenu #heroPick .hero-card.locked { cursor: var(--no); opacity: .85; }
#lobbyMenu #heroPick .hero-card:not(.locked):hover, #lobbyMenu #heroPick .hero-card:focus-visible { filter: brightness(1.1) drop-shadow(0 0 8px #cfe3e855); outline: none; }

body.dh760 #lobby .eyebrow:first-child { display: none; }
body.dh760 #lobby .code { font-size: 46px; }
body.dh760 #lobby .quiet { margin: 0 0 10px; }
body.dh760 #lobbyMenu { gap: 8px; }
#colorRow #colorName { color: var(--c); }
body.crowded[data-screen="lobby"] .tag .role { display: none; }
/* Short windows: a tighter lobby, so the whole menu fits above a full party. */
body.dh680 #lobby { padding-top: calc(2 * var(--dvh)); }
body.dh680 #lobby .code { font-size: 34px; margin: 0; }
body.dh680 #lobby .quiet { margin: 0 0 6px; }
body.dh680 #lobbyMenu { gap: 4px; }
body.dh680 #lobbyMenu button { font-size: 17px; padding-top: 0; padding-bottom: 0; }
body.dh680 #lobbyMenu #heroPick .hero-card { width: 40px; height: 48px; }
body.dh680 #heroPick .hero-card canvas { width: 30px; height: 38px; }
body.dh680 #lobbyNote { margin: 4px 0 0; font-size: 13px; }

/* ---------- bottom left, under your shield: what's on you, and what's coming for you ---------- */
/* Sits on the strip's floor and grows upward as more notes come, so nothing drops off the screen. */
#strip { grid-template-rows: minmax(0, 1fr); }
#vitals { position: relative; align-self: unsafe end; padding-bottom: 12px; }
#myFx { margin: -2px -2vw 4px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
#myFx:empty { display: none; }
#myFx li { display: flex; align-items: center; gap: 9px; font-size: 16px; line-height: 1.25; color: var(--ash); text-shadow: 0 1px 3px #000, 0 0 8px #000; }
#myFx li img { width: 24px; height: 24px; flex: none; image-rendering: pixelated; }
#myFx li b { font-weight: 400; color: #d9c8f2; letter-spacing: .04em; }
#myFx li.next b { color: #ff9e92; }
#myFx li small { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }

/* ---------- late in a fight: the frenzy, and its killing blow ---------- */
#diffName small { margin-left: 8px; font-size: 13px; letter-spacing: .08em; color: var(--faint); }
#bossInfo.lethal .intent span { color: #ff5a4e; text-shadow: 0 0 10px #ff3b2f; }
#bossInfo.lethal .intent small { color: #ff9e92; }
#bossInfo.frenzy .named .title { color: #ffb3a8; text-shadow: 0 0 14px #b3262e, 0 0 28px #b3262e88; }

/* ---------- the camp between acts ---------- */
body[data-screen="camp"] #camp { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: clamp(24px, calc(7 * var(--dvh)), 70px); }
body[data-screen="camp"] #veil { opacity: 1; background: linear-gradient(180deg, #050607e0 0%, #050607aa 34%, transparent 60%); }
#camp .flourish { margin: 10px auto 14px; }
#campShops { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin: 18px 0 20px; max-width: min(820px, calc(94 * var(--dvw))); }
#campShops button { display: grid; justify-items: center; padding: 3px 12px; border: 12px solid transparent;
  border-image: var(--dark-frame); image-rendering: pixelated; filter: brightness(.75); color: var(--ash); }
#campShops button:hover, #campShops button:focus-visible { filter: brightness(1.05); color: var(--bone); outline: none; }
#campShops b { font-weight: 400; font-size: 16px; letter-spacing: .08em; }
#campShops small { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--faint); }
#campMenu { gap: 10px; }
#campMenu button { min-width: 300px; width: min(340px, calc(80 * var(--dvw))); padding: 7px 52px; border: 12px solid transparent;
  border-image: var(--dark-frame); image-rendering: pixelated; filter: brightness(.8); }
#campMenu button:hover, #campMenu button:focus-visible { filter: brightness(1.1) drop-shadow(0 0 10px #cfe3e855); }
#campWait { margin-top: 10px; }
/* Ready, once you've clicked it; and the host's way on without the rest. */
#campMenu button.on, #resultMenu button.on { color: var(--heal); }
#campMenu button.force, #resultMenu button.force { font-size: .85em; opacity: .85; }

/* ---------- reward cards after a win ---------- */
#rewardCards { display: grid; justify-items: center; gap: 10px; margin: 0 0 22px; }
#rewardCards .cards { display: flex; gap: clamp(12px, calc(3 * var(--dvw)), 28px); }
#rewardCards button { width: clamp(86px, calc(11 * var(--dvw)), 124px); aspect-ratio: 106 / 138; transition: transform .25s, filter .25s; filter: brightness(.7) saturate(.8); }
#rewardCards button img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
#rewardCards button:hover, #rewardCards button:focus-visible { transform: translateY(-6px); filter: brightness(1); outline: none; }
#rewardCards button.chosen { transform: translateY(-10px); filter: brightness(1.15) drop-shadow(0 0 14px #f0c45c88); }
#rewardCards.picked button:not(.chosen) { filter: brightness(.35) saturate(.4); }
#rewardNote { font-size: 14px; }
#mapLabels .camp { font-size: 11px; color: #e0a56a; translate: -50% -100%; margin-top: -2px; }
/* Every other label sits above its stop, so close stops never overlap. */
#mapLabels .up { translate: -50% -100%; margin-top: -10px; }
#mapLabels .camp.fallen { text-decoration: none; color: #7d6f66; }
#mapLabels .camp.up { margin-top: -2px; }
#bossInfo .named .title.long { font-size: clamp(26px, calc(3 * var(--dvw)), 42px); letter-spacing: .2em; text-indent: .2em; }
/* Keep the camp's words in the top half, so the fire and the party below stay in view. */
#camp .title { font-size: clamp(34px, calc(5 * var(--dvw)), 64px); }
#camp .flourish { margin: 6px auto 8px; }
#campShops { margin: 12px 0 14px; gap: 6px 8px; }
#campShops button { padding: 2px 10px; }
#campShops b { font-size: 14px; }
#campShops small { font-size: 10px; }
#campMenu { flex-direction: row; flex-wrap: wrap; justify-content: center; }
#campMenu button { min-width: 0; width: auto; padding: 8px 34px; font-size: 19px; }

/* A narrow window: the three action buttons a size smaller, so Shield never runs into "Your turn". */
body.dw1000 .choices button { font-size: 20px; padding: 6px 14px 6px 10px; gap: 2px 8px; }
body.dw1000 .choices button img { height: 24px; }
body.dw1000 .choices { gap: 8px; }
body.dw1000 #pips { flex-wrap: wrap; row-gap: 2px; } /* the gems drop above "actions left" when there's no room */
body.dw1000 #strip { grid-template-columns: minmax(150px, 20%) 1fr minmax(170px, 18%); gap: 14px; padding: 0 14px; }

/* The lobby's settings share one row (each its name over its value), so Begin the fight always
   shows without scrolling. */
#setRow { display: flex; justify-content: center; gap: 10px; }
#lobbyMenu #setRow button { width: auto; min-width: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2px 30px 4px; font-size: 19px; line-height: 1.3; }
#lobbyMenu #setRow .key { margin: 0; font-size: 12px; }
#setRow #diffName small { display: block; margin: 0; font-size: 11px; line-height: 1.2; }
#lobbyMenu #setRow button::before { left: 8px; }
#lobbyMenu #setRow button::after { right: 8px; }
