/* Layout: full-bleed 3D arena; WoW-style frames pinned to the corners; vendor, level-up and summary
   windows float centered over the world. One committed dark look (it's a game screen). */
:root {
  color-scheme: dark;
  --ink: #f1e4c3;
  --dim: #b9a987;
  --gold: #ffd100;
  --trim: #c08f36;
  --trim-dark: #5a3b12;
  --panel: #1f170f;
  --panel-2: #2d2217;
  --tip: rgba(8, 10, 28, 0.96);
  --display: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --head: 'Cinzel', Georgia, 'Times New Roman', serif;
  --body: 'Alegreya Sans', 'Trebuchet MS', Verdana, sans-serif;
  --r1: #1eff00;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #0c0906; color: var(--ink); font-family: var(--body); font-size: 15px; }
/* a game, not a page: dragging the mouse to look around must never select (and blue-highlight) the HUD text */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
/* the screen's edges glow red: a flash on each hit (.hit, brighter for a bigger one: --hk), a heartbeat under 30% (.low)
   (Nick: "maybe the bar shakes or highlights and the edges of the screen glow red") */
#hurtfx { position: fixed; inset: 0; pointer-events: none; z-index: 9; opacity: 0; transition: opacity 0.35s; background: radial-gradient(ellipse at center, transparent 42%, rgba(210, 0, 0, 0.62)); box-shadow: inset 0 0 90px 18px rgba(255, 24, 0, 0.6); }
#hurtfx.hit { opacity: var(--hk, 1); transition-duration: 0.04s; }
#hurtfx.low { animation: lowhp 0.95s ease-in-out infinite; }
body.held #hurtfx, body.held .qmark { animation-play-state: paused; }   /* paused alone, or under a tutorial card */
@keyframes lowhp { 0%, 100% { opacity: 0.4; } 14% { opacity: 0.95; } 30% { opacity: 0.5; } 44% { opacity: 0.85; } 70% { opacity: 0.45; } }   /* lub-dub */
#flashfx { position: fixed; inset: 0; pointer-events: none; z-index: 9; opacity: 0; transition: opacity 0.6s; }
svg.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.12em; flex: none; }
.dim { color: var(--dim); }
.white { color: #fff; }
.eq { color: var(--r1); }
.neg { color: #ff4b3a; }
.gold { color: var(--gold); }
.xp { color: #c78af5; }
.coin { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a8, #e0a91b 55%, #8a5a00); box-shadow: 0 0 0 1px #3a2500; vertical-align: -0.05em; margin-right: 0.3em; }

/* ---------- shared frame pieces ---------- */
.frame { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 3px solid var(--trim); border-radius: 7px;
  box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #000, inset 0 0 40px rgba(0, 0, 0, 0.7), 0 14px 40px rgba(0, 0, 0, 0.65); }
.frame-title { font-family: var(--head); font-weight: 900; color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.8); letter-spacing: 0.04em; margin: 0; text-wrap: balance; font-size: clamp(22px, 3vw, 32px); }
.btn { background: linear-gradient(180deg, #c3301f, #6b0f08); border: 2px solid #d9aa45; border-radius: 5px; color: var(--gold);
  font-family: var(--head); font-weight: 700; letter-spacing: 0.05em; padding: 0.55em 1.3em; cursor: pointer; text-shadow: 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 0 #000; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { filter: grayscale(1) brightness(0.65); cursor: not-allowed; }
.btn.small { font-size: 12px; padding: 0.38em 0.85em; }
.btn.dark { background: linear-gradient(180deg, #3a2e22, #1d1610); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; z-index: 20;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8)); }
.panel { padding: 18px 20px; display: grid; gap: 14px; width: min(1100px, 100%); }
.sect { font-family: var(--head); color: var(--gold); font-size: 15px; margin: 0; letter-spacing: 0.06em; }
.foot-row { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; align-items: center; }
.sub { margin: -6px 0 0; }

/* loading */
#loading { background: radial-gradient(ellipse at 50% 40%, #2a1d10, #0c0906 70%); grid-template-columns: minmax(0, 1fr); }
/* on the way to the next zone: its own sky, and the journey (src/ui.js showJourney) */
#loading.journey { background: linear-gradient(180deg, var(--sky-top), color-mix(in srgb, var(--sky-bottom) 70%, #0c0906) 70%, #0c0906); }
#loading.journey .loadbox { width: min(900px, calc(100vw - 32px)); gap: 10px; }
/* (the map is the screen now: the game's name steps aside, and the loading bar is a thin line over the map) */
#loading.journey .logo { display: none; }
#loading.journey .loadbar { width: min(100%, 700px); height: 5px; border-width: 1px; box-shadow: none; background: rgba(10, 8, 6, 0.6); }
#journeyCard { display: grid; gap: 12px; width: 100%; }
#journeyCard .wmap { max-height: 50vh; }
/* the world map (src/ui-world.js): an old map of the six lands, the roads between them, and where your hero is */
.jmap { width: 100%; }
.wmap { display: block; width: auto; max-width: 100%; max-height: 52vh; margin: 0 auto; height: auto; border-radius: 8px; border: 2px solid #5a3b12; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(26, 14, 4, 0.5); }
.wm-road { fill: none; stroke: #7a5226; stroke-width: 1.05; stroke-dasharray: 2 1.6; stroke-linecap: round; opacity: 0.8; }
.wm-road.done { stroke: #a8752a; stroke-dasharray: none; stroke-width: 1.3; opacity: 0.95; }
.wm-road.now { stroke: #c0451a; stroke-width: 1.6; stroke-dasharray: 2.4 1.4; opacity: 1; }   /* the road you're on, or about to be */
.wm-land text { text-anchor: middle; paint-order: stroke fill; stroke: #f1e2bb; stroke-width: 0.9px; stroke-linejoin: round; }
.wm-name { font: 700 4.2px var(--head); fill: #3a240c; }
.wm-sub { font: italic 600 2.8px var(--head); fill: #6a4314; }
.wm-land.ahead { opacity: 0.78; }
.wm-ring { fill: none; }
.wm-land.here .wm-ring { stroke: #ffc21a; stroke-width: 1.1; animation: wmpulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes wmpulse { 50% { transform: scale(1.18); opacity: 0.4; } }
.wm-title { font: 900 6.2px var(--display); fill: #5a3b12; opacity: 0.85; }
.wm-n { font: 700 3px var(--head); fill: #5a3b12; text-anchor: middle; }
.wm-hero { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.wm-inn .wm-win { filter: drop-shadow(0 0 1px #ffb020); }

.endmap { margin: 0 auto 10px; }
.linkbtn { background: none; border: 0; padding: 2px 0; color: var(--gold); font: 700 13px var(--head); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover, .linkbtn:focus-visible { color: #fff2a0; }
.linkbtn .ico { width: 15px; height: 15px; }
.endmap .wmap { max-height: 28vh; }
.jto em { display: block; font: italic 600 18px var(--head); color: var(--ink); margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .wm-land.here .wm-ring { animation: none; } }
.jroad { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; position: relative; }
.jroad::before { content: ''; position: absolute; left: 8%; right: 8%; top: 17px; height: 3px; background: repeating-linear-gradient(90deg, #c08f36 0 10px, transparent 10px 18px); opacity: 0.6; }
.jstop { display: grid; justify-items: center; gap: 3px; position: relative; opacity: 0.55; min-width: 0; }
.jstop b { font: 700 13px var(--head); color: var(--ink); overflow-wrap: anywhere; line-height: 1.15; }
.jstop small { font-size: 11px; color: var(--dim); line-height: 1.2; overflow-wrap: anywhere; }
.jdot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 800 15px var(--head); color: #1a1206;
  background: var(--zc); border: 2px solid #000; box-shadow: 0 0 0 2px #5a3b12; }
.jstop.done { opacity: 0.85; } .jstop.done .jdot { background: #3a2e22; color: var(--gold); }
.jstop.here { opacity: 1; } .jstop.here .jdot { box-shadow: 0 0 0 2px var(--gold), 0 0 18px var(--gold); animation: jpulse 1.4s ease-in-out infinite; }
.jstop.here b { color: var(--gold); }
@keyframes jpulse { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .jstop.here .jdot { animation: none; } }
.jto small { font: 700 12px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.jto h2 { margin: 2px 0 4px; font: 900 clamp(28px, 5vw, 46px) var(--head); color: var(--gold); text-shadow: 0 3px 0 #000, 0 0 20px rgba(0, 0, 0, 0.8); }
.jto p { margin: 0 auto; max-width: 56ch; font-size: 16px; text-shadow: 0 1px 3px #000; }
/* what waits there: its waves, its boss (in its color), its inn */
.jfacts { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin: 10px 0 0; padding: 0; }
.jfacts li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 9px; border-radius: 99px; font: 700 13px var(--head); color: var(--ink);
  background: rgba(12, 8, 4, 0.62); border: 1px solid #8a6a2e; text-shadow: 0 1px 2px #000; }
.jfacts .ico { width: 15px; height: 15px; color: #e8c98a; }
.jfacts .jboss { color: color-mix(in srgb, var(--bc) 55%, #fff); border-color: color-mix(in srgb, var(--bc) 70%, #000); }
.jfacts .jboss .ico { color: var(--bc); }
.jfacts .jinn { color: #ffd98a; }
/* your hero on the road: emblem, name and level; the run so far; the two attacks */
.jhero { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; align-items: center; padding: 8px 16px; background: rgba(12, 8, 4, 0.62); border: 1px solid #5a3b12; border-radius: 8px; justify-self: center; }
.jhero .emb { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--hc); background: #1a1206; box-shadow: 0 0 0 2px var(--hc), 0 0 12px color-mix(in srgb, var(--hc) 45%, transparent); }
.jhero .emb .ico { width: 19px; height: 19px; }
.jh-who { display: grid; text-align: left; line-height: 1.15; }
.jh-who b { font: 700 16px var(--head); }
.jh-who small { color: var(--dim); font-size: 13px; }
.jh-run { display: flex; gap: 12px; color: var(--ink); font-weight: 700; }
.jweps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.jw { font-weight: 700; font-size: 14px; } .jw svg { width: 14px; height: 14px; vertical-align: -2px; }
@media (max-width: 640px) { .jroad { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; } .jroad::before { display: none; } }
.loadbox { display: grid; gap: 14px; justify-items: center; width: min(520px, 100%); text-align: center; }
.loadbar { width: 100%; height: 14px; border: 2px solid var(--trim); border-radius: 3px; background: #0a0806; box-shadow: 0 0 0 2px #000; overflow: hidden; }
.loadbar i { display: block; height: 100%; background: linear-gradient(180deg, #ffe07a, #c07a12); transform-origin: left; transform: scaleX(0); transition: transform 0.2s; }
#loadLabel { color: var(--dim); font-size: 14px; }
.loadtip { color: var(--ink); font-style: italic; margin: 8px 0 0; max-width: 42ch; }

/* ---------- menu ---------- */
.logo { font-family: var(--display); font-weight: 900; font-size: clamp(34px, min(5vw, 8vh), 66px); white-space: nowrap; line-height: 0.9; margin: 0;
  background: linear-gradient(180deg, #fff6c9 0%, #ffd24a 38%, #c07a12 62%, #7a4508 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #2a1402) drop-shadow(0 0 22px rgba(255, 170, 40, 0.35)); letter-spacing: 0.02em; }
.menu { place-items: center start; background: linear-gradient(90deg, rgba(8, 5, 2, 0.88) 0%, rgba(8, 5, 2, 0.65) 45%, rgba(0, 0, 0, 0) 70%); padding-inline: max(16px, 4vw); }
.menu-col { display: grid; align-content: start; gap: 12px; width: min(760px, calc(100vw / var(--menu-scale, 1) - 32px)); max-height: calc(100vh / var(--menu-scale, 1)); padding-block: 16px; box-sizing: border-box; zoom: var(--menu-scale, 1); container-type: inline-size; }
.menu-col.scrolls { overflow-y: auto; }   /* only when it can't fit: a scroll box would clip the logo's glow */
/* a tall or narrow window (ui-menu.js fitMenu): the hero above, the menu along the bottom (scrolling if it must) */
.menu.stacked { place-items: end center; padding-inline: 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) calc(var(--col-top, 30vh) - 90px), rgba(8, 5, 2, 0.9) calc(var(--col-top, 30vh) + 20px)); }
.menu.stacked .menu-col { max-height: calc(76vh / var(--menu-scale, 1)); }
.tag { font-family: var(--head); color: var(--ink); margin: 6px 0 0; font-size: clamp(12px, 1.6vw, 15px); letter-spacing: 0.18em; text-transform: uppercase; text-shadow: 0 2px 4px #000; }
/* a run kept to come back to (src/ui-menu.js renderSavedRun) */
.contrun { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-color: var(--gold); box-shadow: 0 0 0 2px #000, 0 0 16px rgba(255, 209, 0, 0.25); }
.contrun .cr-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; }
.contrun .cr-ico .ico { width: 32px; height: 32px; }
.contrun .cr-text { flex: 1; min-width: 0; font: 600 14px/1.3 var(--body); color: var(--ink); }
.contrun .cr-text b { display: block; font: 900 16px/1.2 var(--head); color: var(--gold); letter-spacing: 0.04em; }
.contrun .cr-text small { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); }
.contrun .btn { flex: none; }
.village-line { margin: 4px 0 0; font: 700 14px var(--head); color: #7fd8ff; letter-spacing: 0.06em; text-shadow: 0 2px 4px #000; }
.menu-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.field { display: grid; gap: 4px; font-family: var(--head); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.field input { font: 600 17px var(--body); color: var(--ink); background: #0f0b07; border: 2px solid #6d5226; border-radius: 4px; padding: 0.45em 0.7em; width: 11em; box-shadow: inset 0 2px 6px #000; }
#enterBtn { font-size: 18px; padding: 0.6em 1.6em; }
.menuhint { color: #ff9a5a; font-weight: 700; min-height: 1.2em; opacity: 0; transition: opacity 0.3s; }
.menuhint.on { opacity: 1; }
.controls { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 14.5px; color: var(--dim); }
.controls kbd { font: 700 11px var(--body); color: var(--ink); background: #2a2018; border: 1px solid #6d5226; border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; }
.credit { font-family: var(--head); font-size: 12px; color: var(--dim); letter-spacing: 0.2em; text-transform: uppercase; }
.credit.sounds { font-family: var(--body); font-size: 11px; letter-spacing: 0.04em; text-transform: none; opacity: 0.75; margin-top: -4px; }
.settings .controls { font-size: 13.5px; margin-top: 4px; }
/* the village stall (src/ui-stall.js): the button under the village line, and its goods */
.stallbtn { margin-top: 2px; font-size: 14px; text-shadow: 0 2px 4px #000; }
.stallp { width: min(520px, 100%); display: grid; gap: 10px; }
.stall-gold, .stall-note { margin: 0; color: var(--ink); font-size: 15px; }
.stall-note { color: var(--dim); font-size: 13.5px; }
.stall-coin { display: inline-flex; align-items: center; gap: 3px; color: #ffd100; font-weight: 700; font-variant-numeric: tabular-nums; }
.stall-coin svg { width: 14px; height: 14px; }
.stall-list { display: grid; gap: 6px; }
.stall-good { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 112px; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid #5a4630; border-radius: 5px; background: rgba(0, 0, 0, 0.3); }
.stall-good .emb { color: #ffd100; display: grid; place-items: center; } .stall-good .emb svg { width: 22px; height: 22px; }
.stall-what { display: grid; min-width: 0; } .stall-what b { font: 700 16px var(--head); color: var(--ink); } .stall-what small { color: #cbbfa8; font-size: 13.5px; }
.stall-pips { display: flex; gap: 3px; } .stall-pips i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #8a7a5a; background: #1d150c; }
.stall-pips i.on { background: #ffd100; border-color: #ffd100; box-shadow: 0 0 5px #ffd10088; }
.stall-good .btn { justify-self: stretch; } .stall-good .btn[disabled] { opacity: 0.55; cursor: default; }
.stall-done { justify-self: center; color: #7fd86a; font: 700 13px var(--head); }
@media (max-width: 460px) { .stall-good { grid-template-columns: 26px minmax(0, 1fr) 96px; } .stall-pips { grid-column: 2; grid-row: 2; } .stall-good .btn, .stall-done { grid-column: 3; grid-row: 1 / 3; } }
@media (hover: none) and (pointer: coarse) { .settings .controls { display: none; } }   /* touch screens have no keyboard to explain */

/* ---------- tooltips & tooltip-style cards ---------- */
.tip { background: var(--tip); border: 1px solid #9aa0bf; border-radius: 6px; box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 10px 12px; text-align: left; color: #fff; display: grid; gap: 6px; align-content: start; font-size: 14px; line-height: 1.3; }
.tipfloat { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; width: max-content; max-width: min(360px, calc(100vw - 16px)); }
.tip-head { display: flex; gap: 10px; align-items: center; }
.tip-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 24px; border-radius: 5px; background: radial-gradient(circle at 40% 35%, #3b3f55, #0d0f1c);
  border: 2px solid var(--rc, #fff); box-shadow: 0 0 0 1px #000, 0 0 10px color-mix(in srgb, var(--rc, #fff) 40%, transparent); color: var(--rc, #fff); }
.tip-name { font-weight: 800; font-size: 16px; line-height: 1.15; }
.tip-type { font-size: 12.5px; color: #d8d8d8; }
.tip-lines { display: grid; gap: 1px; }
.wline b { color: #fff; }
.legend { color: #ff8000; }
.flavor { color: var(--gold); font-style: italic; font-size: 13px; }
.hint-gold { color: var(--gold); font-weight: 700; }
.big { font-size: 16px; font-weight: 800; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#unitframe { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; display: flex; align-items: center; }
.portrait { width: 74px; height: 74px; border-radius: 50%; background: #2a1d10 center/cover no-repeat; border: 3px solid var(--trim); box-shadow: 0 0 0 2px #000, inset 0 0 10px rgba(0,0,0,.6); position: relative; z-index: 2; }
.lvlbadge { position: absolute; bottom: -6px; left: -4px; width: 26px; height: 26px; border-radius: 50%; background: #1a120a; border: 2px solid var(--trim); display: grid; place-items: center; font: 800 12px var(--body); color: var(--gold); box-shadow: 0 0 0 1px #000; }
.uf-body { margin-left: -14px; padding: 6px 10px 6px 22px; min-width: 230px; background: linear-gradient(180deg, rgba(28, 21, 14, 0.92), rgba(14, 10, 6, 0.92)); border: 2px solid var(--trim); border-left: none; border-radius: 0 6px 6px 0; box-shadow: 0 0 0 1px #000; display: grid; gap: 4px; }
.uf-name { font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.uf-name small { font-weight: 600; }
.bar { position: relative; height: 17px; background: #0a0a0a; border: 1px solid #000; box-shadow: inset 0 1px 3px #000; overflow: hidden; border-radius: 2px; }
.bar i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(180deg, #5cf25c, #1a9a1a 55%, #0d6a0d); will-change: transform; }
.bar span { position: relative; display: block; text-align: center; font: 800 11.5px/17px var(--body); color: #fff; text-shadow: 0 1px 1px #000, 0 0 3px #000; font-variant-numeric: tabular-nums; }
.buffs { display: flex; gap: 4px; min-height: 0; }
.buff { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 3px; background: rgba(0, 0, 0, 0.6); font-size: 14px; }
.buff.proc { animation: procPop 0.55s ease-out; box-shadow: 0 0 10px currentColor; }   /* a trinket going off (Heart of Flame's meteor) */
@keyframes procPop { 0% { transform: scale(1.9); background: color-mix(in srgb, currentColor 45%, #000); } 100% { transform: scale(1); } }
#mmWrap { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; display: grid; justify-items: center; gap: 4px; }
#minimap { width: 170px; height: 170px; border-radius: 50%; border: 4px solid var(--trim); box-shadow: 0 0 0 2px #000, 0 4px 14px rgba(0, 0, 0, 0.6); background: #1e2a14; }
.zone { font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--gold); text-shadow: 0 1px 2px #000, 0 0 6px #000; background: rgba(0, 0, 0, 0.45); padding: 1px 10px; border-radius: 10px; }
#tracker { position: absolute; right: 14px; top: calc(232px + env(safe-area-inset-top, 0px)); width: 230px; text-align: right; display: grid; gap: 3px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#tracker h3 { margin: 0; font-family: var(--head); font-size: 17px; color: var(--gold); }
#tracker div { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
#tracker .obj { font-size: 15px; color: #fff; }
#tracker .lvls { color: #d9a8ff; }
/* the zone's treasure (src/treasure.js): its light, flashing while monsters drain it */
#tracker .tlight { display: grid; gap: 3px; justify-items: end; margin: 2px 0 3px; }
#tracker .tlight b { font-size: 13.5px; color: var(--tc, #9ff0ff); }
#tracker .tlight i { display: block; width: 150px; height: 10px; border: 1px solid #000; outline: 1px solid color-mix(in srgb, var(--tc, #9ff0ff) 55%, #000); background: #0b0f16; }
#tracker .tlight em { display: block; height: 100%; background: linear-gradient(color-mix(in srgb, var(--tc, #9ff0ff) 85%, #fff), var(--tc, #9ff0ff)); transform-origin: left; transform: scaleX(var(--p, 1)); }
#tracker .tlight.hit i { animation: tlhit 0.5s ease-in-out infinite; }
@keyframes tlhit { 50% { outline-color: #ff3a2a; box-shadow: 0 0 10px #ff3a2a; } }
#tracker .tlight.dark b { color: #888; }
#tracker .tlight.full i { animation: tlfull 1.3s ease-out 2; }   /* a new wave: its light full again */
@keyframes tlfull { 40% { box-shadow: 0 0 14px var(--tc, #9ff0ff); outline-color: var(--tc, #9ff0ff); } }
@media (prefers-reduced-motion: reduce) { #tracker .tlight.full i { animation: none; } }
#bossFrame { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(480px, 50vw); display: grid; gap: 3px; text-align: center; }
#bossFrame .bn { font-family: var(--head); font-weight: 900; text-shadow: 0 2px 2px #000, 0 0 8px #000; font-size: 17px; }
#bossFrame .bar { height: 22px; border: 2px solid var(--trim); box-shadow: 0 0 0 1px #000; }
#bossFrame .bar i { background: linear-gradient(180deg, #ff6a4a, #b0140a 60%, #6a0804); }
#bossFrame .bar span { line-height: 20px; }
/* the boss's phase lines (src/bosses.js PHASE: it transforms at 2/3 and 1/3 of its bar), and its phase's name */
#bossFrame .bar .notch { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ffe7a0; box-shadow: 0 0 0 1px #000, 0 0 6px #ffd84a; }
#bossFrame .bp { font: 800 12px var(--body); color: #ffe7a0; text-shadow: 0 1px 1px #000, 0 0 4px #000; letter-spacing: 0.04em; min-height: 15px; }
#bossFrame .bp:empty { visibility: hidden; }
/* Emperor Frostbeak's blizzard: fills while you are away from the fires; full = frozen solid */
#frostBar { margin-top: 4px; }
#frostBar b { display: block; font: 700 14px var(--head, serif); color: #bfeaff; text-shadow: 0 1px 2px #000, 0 0 8px #2a8aff; margin-bottom: 3px; }
#frostBar i { display: block; height: 12px; border: 1px solid #000; outline: 1px solid #6ab8ff; background: #0a1a2a; }
#frostBar em { display: block; height: 100%; background: linear-gradient(#e8f8ff, #5ab8ff); transform-origin: left; transform: scaleX(var(--p, 0)); }
#bottom { position: absolute; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 5px; justify-items: center; }
/* the hero's health, over the XP bar (Nick: "let's move the hero healthy down near the xp bar"; it was in the unit frame
   top left, far from where the eyes are): a white flash on each hit (.hit), a red pulse under 30% (.low) */
#hpbar { width: min(600px, 92vw); height: 18px; outline: 1px solid var(--trim); background: #160606; }
#hpbar span { line-height: 18px; font-size: 12.5px; }
/* each hit: the bar shakes and flashes, a red glow round it; under 30% it glows red with the heartbeat */
#hpbar.hit { animation: hpshake 0.42s ease-out; }
@keyframes hpshake {
  0% { transform: translateX(0); box-shadow: 0 0 16px 5px rgba(255, 40, 20, 0.95); }
  12% { transform: translateX(-8px) rotate(-0.7deg); } 26% { transform: translateX(7px) rotate(0.6deg); }
  40% { transform: translateX(-5px); } 56% { transform: translateX(3px); } 74% { transform: translateX(-1px); }
  100% { transform: translateX(0); box-shadow: 0 0 0 0 rgba(255, 40, 20, 0); }
}
#hpbar.hit i { animation: hphit 0.42s ease-out; }
@keyframes hphit { from { filter: brightness(2.4) saturate(0.4); } }
#hpbar.low i { background: linear-gradient(180deg, #ff6a4a, #c0200e 55%, #7a0c04); animation: hplow 0.95s ease-in-out infinite; }
#hpbar.low { outline-color: #ff3a2a; }
#hpbar.low::after { content: ''; position: absolute; inset: -2px; pointer-events: none; animation: hpglow 0.95s ease-in-out infinite; }
@keyframes hplow { 14%, 44% { filter: brightness(1.6); } }
@keyframes hpglow { 0%, 100% { box-shadow: 0 0 6px 1px rgba(255, 40, 20, 0.5); } 14%, 44% { box-shadow: 0 0 18px 5px rgba(255, 50, 20, 0.95); } }
#xpbar { width: min(600px, 92vw); height: 12px; outline: 1px solid var(--trim); background: #150c1c; }
#xpbar i { background: linear-gradient(180deg, #c78af5, #7a2fc2 60%, #4a1580); }
#xpbar span { font-size: 10px; line-height: 12px; }
/* a short screen (a phone on its side): the two bars keep clear of the tracker and the touch buttons on the right */
@media (max-height: 500px) { #hpbar, #xpbar { width: max(280px, min(600px, 92vw, 100vw - 512px)); } }
#actionbar { display: flex; gap: 4px; padding: 6px; background: linear-gradient(180deg, rgba(40, 30, 20, 0.92), rgba(16, 11, 6, 0.92)); border: 2px solid var(--trim); border-radius: 6px; box-shadow: 0 0 0 2px #000; pointer-events: auto; }
.slot { position: relative; width: 50px; height: 50px; border-radius: 4px; background: radial-gradient(circle at 40% 35%, #3a3a4a, #0c0c14); border: 2px solid var(--rc, #2a2218); box-shadow: inset 0 0 8px #000; display: grid; place-items: center; font-size: 28px; color: var(--rc, #fff); overflow: hidden; }
.slot.empty { background: #0e0b08; }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.72) calc(var(--p, 0) * 360deg), transparent 0); }
.slot b { position: absolute; top: 1px; right: 3px; font: 800 10.5px var(--body); color: #fff; text-shadow: 0 1px 1px #000; }
.slot .leg { position: absolute; inset: 0; box-shadow: inset 0 0 12px #ff8000; animation: legpulse 1.6s ease-in-out infinite; }
@keyframes legpulse { 50% { box-shadow: inset 0 0 4px #ff8000; } }
.slot.dash { margin-left: 8px; --rc: #c8b28a; }
/* the two attacks: bigger than the rest, a mouse button drawn in the corner; a weapon that works on its own glows
   while it's Overcharged */
.slot.atk { width: 58px; height: 58px; font-size: 32px; }
.slot.atk .mb { position: absolute; top: 2px; right: 2px; width: 15px; height: 15px; color: #fff; filter: drop-shadow(0 1px 1px #000); }
.slot.atk .mb svg { width: 100%; height: 100%; display: block; }
.slot.atk.hot { box-shadow: inset 0 0 14px var(--rc), 0 0 12px color-mix(in srgb, var(--rc) 70%, transparent); animation: legpulse 0.6s ease-in-out infinite; }
.swapbtn { display: inline-flex; align-items: center; gap: 3px; padding-inline: 8px; }
.swapbtn svg { width: 13px; height: 13px; }
/* a new weapon against the attack it replaces (src/ui-between.js compare) */
.swapbtn .was { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #120d08; border: 1px solid currentColor; }
.swapbtn .was svg { width: 11px; height: 11px; }
.swapbtn .cmp { font-size: 15px; line-height: 1; } .cmp.up { color: #4dff5e; } .cmp.down { color: #ff5a4a; } .cmp.same { color: #c8c0b0; }
.wslot .wk { display: inline-flex; align-items: center; gap: 3px; color: #d8c8a8; font-size: 11px; }
.wslot .wk svg { width: 12px; height: 12px; }
.slot.ability { margin-left: 4px; box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 45%, transparent); }
/* ready again (src/ui-hud.js popSlot): a bounce and a ring in its color */
.slot.ready { animation: slotReady 0.6s ease-out; }
@keyframes slotReady { 0% { transform: scale(1); } 35% { transform: scale(1.28); box-shadow: 0 0 0 3px var(--rc), 0 0 22px var(--rc); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .slot.ready { animation: none; } }
#dashPips { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
#dashPips i { width: 7px; height: 7px; border-radius: 50%; background: #333; border: 1px solid #000; }
#dashPips i.on { background: #ffe07a; }
#banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; opacity: 0; transition: opacity 0.35s; }
#banner.on { opacity: 1; }
#banner h2 { font-family: var(--display); font-weight: 900; font-size: clamp(34px, 6vw, 64px); margin: 0; color: var(--gold); text-shadow: 0 3px 0 #3a1c00, 0 0 24px rgba(0, 0, 0, 0.9); }
#banner.freeze h2 { color: #bff0ff; text-shadow: 0 3px 0 #0a2a4a, 0 0 24px rgba(0, 0, 0, 0.9); }   /* the Emperor's FREEZE! */
#banner.beat h2 { animation: bannerBeat 0.45s ease-out; }   /* each beat of his count down */
@keyframes bannerBeat { from { transform: scale(1.4); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #banner.beat h2 { animation: none; } }
/* the Emperor's order: the screen's edge frosted over (gold for MARCH), its brightness set by src/ui-hud.js */
#decreeEdge { position: absolute; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 120px 40px rgba(70, 170, 255, 0.75), inset 0 0 0 8px rgba(150, 220, 255, 0.95); }   /* (a deep blue: a pale one was white on the Throne's snow) */
#decreeEdge.march { box-shadow: inset 0 0 110px 34px rgba(255, 196, 60, 0.8), inset 0 0 0 7px rgba(255, 228, 140, 0.95); }
#banner p { margin: 4px 0 0; font-family: var(--head); font-size: clamp(14px, 2vw, 19px); color: #fff; text-shadow: 0 2px 3px #000; }
#raidwarn { position: absolute; left: 0; right: 0; top: 15%; text-align: center; font-family: var(--head); font-weight: 900; font-size: clamp(17px, 2.4vw, 26px); color: #ff8a1a; text-shadow: 0 2px 2px #000, 0 0 10px #000; opacity: 0; transition: opacity 0.3s; padding: 0 16px; }
#raidwarn.on { opacity: 1; }
#raidwarn.gold { color: var(--gold); }
#hint { position: absolute; left: 50%; bottom: calc(156px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); font-size: 14px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; text-align: center; width: min(640px, 90vw); opacity: 0; transition: opacity 0.6s; }
#hint.on { opacity: 1; }
.qmark { display: block; font: 900 40px var(--head); color: #ffd100; -webkit-text-stroke: 1.5px #3a2400; text-shadow: 0 3px 0 #3a2400, 0 0 14px #ffb400; line-height: 1; animation: qbob 1.1s ease-in-out infinite; }
@keyframes qbob { 50% { transform: translateY(-6px); } }
.qtrack { margin-top: 6px; font: 700 14px var(--body); color: #ffd100; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.qtrack.done { color: #7dff6a; }
#story { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); width: min(560px, 86vw); padding: 12px 20px; text-align: center;
  font: italic 600 17px var(--body); color: #3a2410; background: linear-gradient(#f4e6c4, #e6d2a4); border: 2px solid #8a6a3a; border-radius: 6px;
  box-shadow: 0 6px 18px #0009, inset 0 0 18px #c9a86a; pointer-events: none; animation: storyin 0.5s ease-out;
  text-wrap: balance; }   /* (a long line splits evenly: no lone word on a line of its own) */
#story.out { opacity: 0; transition: opacity 0.8s; }
#story b { display: block; margin-top: 4px; font-style: normal; font-weight: 800; color: #6a1a08; }   /* what to do this wave */
/* the wave's briefing (src/briefing.js): a strip at the top: the wave, its goal, and the countdown */
#brief { position: absolute; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: flex; gap: 10px; align-items: baseline;
  padding: 7px 18px; background: linear-gradient(rgba(34, 22, 10, 0.92), rgba(20, 13, 6, 0.92)); border: 2px solid var(--trim); border-radius: 6px; box-shadow: 0 0 0 2px #000, 0 6px 16px #0008;
  pointer-events: none; white-space: nowrap; animation: storyin 0.35s ease-out; text-shadow: 0 1px 2px #000; }
#brief.out { opacity: 0; transition: opacity 0.4s; }
#brief small { font: 700 12px var(--head); letter-spacing: 0.12em; text-transform: uppercase; color: #c9a86a; }
#brief .bf-title { font: 900 18px var(--head); color: var(--gold); }
#brief .bf-state { font: 800 16px var(--head); color: #fff; }
#brief .bf-state:empty { display: none; }
#brief .bf-state b { display: inline-block; min-width: 1ch; color: #ff7a4a; font-size: 22px; animation: jpulse 1s ease-in-out infinite; }
/* the wave summary's stars (src/ui-between.js) */
.sumstars { grid-column: 1 / -1; }
.sumstars .stars { font-size: 34px; letter-spacing: 4px; color: var(--gold); text-shadow: 0 2px 0 #3a1c00, 0 0 14px #ffb020; }
.sumstars .stars i { font-style: normal; display: inline-block; animation: starpop 0.45s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.sumstars .stars i:nth-child(2) { animation-delay: 0.25s; } .sumstars .stars i:nth-child(3) { animation-delay: 0.5s; }
.sumstars .stars i.off { color: #4a3a28; text-shadow: none; }
.sumstars em { font-style: normal; color: var(--gold); }
.sumstats .sumstars > span { font-size: 15px; color: #f2e4c8; }   /* what the stars mean, readable at a glance */
@keyframes starpop { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
/* the last three seconds of the countdown, and GO! (src/briefing.js) */
#bigCount { position: absolute; left: 50%; top: 30%; translate: -50% -50%; font: 900 clamp(70px, 12vw, 140px) var(--display, var(--head)); color: #ffb03a;
  -webkit-text-stroke: 3px #2a1406; paint-order: stroke fill; text-shadow: 0 6px 0 #2a1406, 0 0 30px rgba(255, 140, 40, 0.8); pointer-events: none; opacity: 0; }
#bigCount.on { animation: bigcount 0.7s ease-out forwards; }
#bigCount.go { color: var(--gold); text-shadow: 0 6px 0 #6a2a00, 0 0 40px #ff9a2a; }
#bigCount.go.on { animation: bigcount 0.9s ease-out forwards; }
@keyframes bigcount { 0% { opacity: 0; transform: scale(2.2); } 18% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(0.9); } }
/* a land's name across the screen as you arrive, like a chapter heading (src/ui-hud.js), and a boss's as it comes */
#landTitle, #bossTitle { position: absolute; left: 50%; top: 22%; translate: -50% -50%; text-align: center; pointer-events: none; opacity: 0; width: min(92vw, 900px); }
#landTitle small, #bossTitle small { display: block; font: 700 clamp(13px, 1.6vw, 18px) var(--head); letter-spacing: 0.35em; text-transform: uppercase; color: var(--lc, var(--gold)); text-shadow: 0 2px 6px #000; }
#landTitle h1, #bossTitle h1 { margin: 4px 0 2px; font: 900 clamp(38px, 6.4vw, 84px) var(--display); color: #fff4d6; -webkit-text-stroke: 2px #1a0e04; paint-order: stroke fill;
  text-shadow: 0 5px 0 #1a0e04, 0 0 34px var(--lc, #ffb03a); line-height: 1.05; }
#landTitle em, #bossTitle em { display: block; font: italic 600 clamp(16px, 2.2vw, 26px) var(--head); color: var(--ink); text-shadow: 0 2px 8px #000, 0 0 2px #000; }
#landTitle::before, #landTitle::after { content: ''; display: block; height: 2px; margin: 10px auto; width: 60%; background: linear-gradient(90deg, transparent, var(--lc, var(--gold)), transparent); }
#landTitle.on { animation: landtitle 5.2s ease-out forwards; }
#bossTitle { top: 30%; }
#bossTitle h1 { color: #ffe1d0; }
#bossTitle.on { animation: landtitle 4.2s ease-out forwards; }
@keyframes landtitle { 0% { opacity: 0; transform: scale(1.08); letter-spacing: 0.06em; } 12% { opacity: 1; transform: scale(1); letter-spacing: 0; } 78% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #landTitle.on, #bossTitle.on { animation: fadeonly 5s linear forwards; } }
@keyframes fadeonly { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* big pop text over a place: SEALED!, FREE!, SAVED! (src/markers.js popText) */
.wpop { position: absolute; left: 0; top: 0; font: 900 30px var(--display, var(--head)); color: var(--pc); white-space: nowrap; pointer-events: none;
  text-shadow: 0 3px 0 #000, 0 0 14px #000, 0 0 22px var(--pc); -webkit-text-stroke: 1px #2a1406; }
.wpop.big { font-size: 46px; }
@media (prefers-reduced-motion: reduce) { #bigCount.on, #bigCount.go.on { animation: none; opacity: 1; } }
/* tutorial cards (src/tutorial.js): the first time a mechanic comes up; the game waits behind a soft dim */
#lesson { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: auto; z-index: 30;   /* (over the screens too: the summary's Stars card) */
  background: radial-gradient(ellipse at center, rgba(10, 6, 2, 0.35), rgba(10, 6, 2, 0.75)); animation: lsfade 0.25s ease-out; }
#lesson .ls-card { position: relative; width: min(440px, 100%); display: grid; gap: 10px; justify-items: center; text-align: center; padding: 22px 26px 16px;
  color: #3a2410; background: linear-gradient(#f8ecd0, #ead5a8); border: 3px solid #8a6a3a; border-radius: 10px;
  box-shadow: 0 0 0 3px #2a1a08, 0 18px 40px #000c, inset 0 0 22px #c9a86a; animation: lsdrop 0.4s cubic-bezier(.2, 1.4, .4, 1); }
#lesson .ls-new { position: absolute; top: -13px; left: 50%; translate: -50% 0; padding: 2px 14px; font: 900 13px var(--head); letter-spacing: 0.14em; text-transform: uppercase;
  color: #2a1a08; background: var(--lc, var(--gold)); border: 2px solid #2a1a08; border-radius: 99px; }
#lesson .ls-pic { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 64px; padding: 4px 0; }
#lesson .ls-ico { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #2a1a08; box-shadow: 0 0 0 3px var(--ic), 0 0 18px color-mix(in srgb, var(--ic) 60%, transparent);
  color: var(--ic); animation: lsbob 2s ease-in-out infinite; }
#lesson .ls-ico:nth-child(3) { animation-delay: 0.5s; } #lesson .ls-ico:nth-child(5) { animation-delay: 1s; }
#lesson .ls-ico .ico { width: 30px; height: 30px; }
#lesson .ls-go { display: flex; gap: 5px; }
#lesson .ls-go i { width: 8px; height: 8px; border-radius: 50%; background: #8a5a20; animation: lsdot 1s ease-in-out infinite; }
#lesson .ls-go i:nth-child(2) { animation-delay: 0.15s; } #lesson .ls-go i:nth-child(3) { animation-delay: 0.3s; }
#lesson h2 { margin: 0; font: 900 clamp(24px, 4vw, 30px) var(--head); color: #4a1e06; text-wrap: balance; line-height: 1.05; }
#lesson .ls-hook { margin: -4px 0 2px; font: italic 700 16px var(--body); color: color-mix(in srgb, var(--lc) 35%, #6a2a08); }
#lesson ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; justify-items: start; text-align: left; width: 100%; }
#lesson li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: center; font: 700 16.5px/1.25 var(--body);
  opacity: 0; animation: lsstep 0.35s ease-out var(--d) forwards; }
#lesson li .ico { width: 22px; height: 22px; color: #8a3a10; }
#lesson .ls-foot { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed #a88a5a; }
#lesson .ls-keys { font: 700 12px var(--body); color: #7a5a30; display: flex; gap: 4px; }
#lesson kbd { font: 800 12px var(--head); background: #3a2410; color: var(--gold); border-radius: 4px; padding: 3px 7px; box-shadow: 0 2px 0 #1a0e04; }
@keyframes lsfade { from { opacity: 0; } }
@keyframes lsdrop { from { transform: translateY(-24px) scale(0.92); opacity: 0; } }
@keyframes lsbob { 50% { transform: translateY(-5px); } }
@keyframes lsdot { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes lsstep { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #lesson .ls-card, #lesson .ls-ico, #lesson .ls-go i { animation: none; } #lesson li { animation: none; opacity: 1; } }
/* markers over places in the world (src/markers.js): where to go (gold), where monsters come out (purple burrows,
   red war camps), with a label; off the screen they sit at its edge with an arrow pointing the way */
#markers { position: absolute; inset: 0; pointer-events: none; }
.wmark { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 2px; translate: -50% -100%; filter: drop-shadow(0 2px 3px #000); --mc: var(--gold); --mi: #3a2410; }
.wmark.burrow { --mc: #c07aff; --mi: #2a0a3a; }
.wmark.camp { --mc: #ff5a3a; --mi: #3a0a06; }
.wmark.cage { --mc: #7fd8ff; --mi: #06283a; }
.wmark.cage.jailer .wm-bar i { background: linear-gradient(#fff6, transparent 60%), #ff4a3a; }   /* the Jailer's health */
.wmark.home { --mc: #ffd27a; --mi: #3a2410; }
.wmark.home.loud { --mc: #ff6a2a; --mi: #3a1006; }
.wmark .wm-bar { width: 72px; height: 7px; border-radius: 4px; background: #000a; box-shadow: 0 0 0 1.5px var(--mi), 0 0 0 3px color-mix(in srgb, var(--mc) 70%, #000); overflow: hidden; }
.wmark .wm-bar i { display: block; height: 100%; width: 0; background: linear-gradient(#fff6, transparent 60%), var(--mc); transition: width 0.15s linear; }
.wmark.edge .wm-bar { display: none; }
.wmark.seal .wm-label, .wmark.cage .wm-label { font-size: 14.5px; color: #fff; }
.wmark.seal.loud, .wmark.cage.loud { --mc: var(--gold); --mi: #3a2410; }
.wmark.cage.hurry { --mc: #ff6a5a; --mi: #3a0a06; }   /* the last monsters are about: free it or it's carried off */
.wmark.cage.hurry .wm-mark { animation-duration: 0.5s; }
.wmark.seal .wm-mark, .wmark.cage .wm-mark { animation: gpbob 1.1s ease-in-out infinite; }
.wmark .wm-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--mc); box-shadow: 0 0 0 2px var(--mi), 0 0 14px var(--mc); }
.wmark.goal .wm-mark { width: 34px; height: 34px; animation: gpbob 1.1s ease-in-out infinite; }
.wmark .wm-mark .ico { rotate: 45deg; width: 17px; height: 17px; color: var(--mi); }
.wmark .wm-label { font: 800 13px var(--head); color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px #000; white-space: nowrap; }
.wmark:not(.goal) .wm-label { color: color-mix(in srgb, var(--mc) 45%, #fff); }
.wmark .wm-arrow { display: none; color: var(--mc); font-size: 22px; line-height: 1; text-shadow: 0 0 6px #000; }
.wmark.edge { translate: -50% -50%; }
.wmark.edge .wm-mark { animation: none; }
.wmark.edge .wm-arrow { display: block; }
.wmark.goal.loud { --mc: #ff6a2a; --mi: #3a1006; }
/* the boss's crest (src/markers.js bossMark): its icon in its color on black, a heartbeat while it comes in */
.wmark.boss { --mi: #120404; }
.wmark.boss .wm-mark { width: 58px; height: 58px; border-radius: 50%; rotate: 0deg; background: radial-gradient(circle at 50% 38%, #3a0c0c, var(--mi) 72%);
  box-shadow: 0 0 0 3px var(--mc), 0 0 0 6px #000c, 0 0 28px 6px color-mix(in srgb, var(--mc) 65%, transparent), inset 0 0 14px #000; }
.wmark.boss .wm-mark .ico { rotate: 0deg; width: 34px; height: 34px; color: var(--mc); filter: drop-shadow(0 0 6px var(--mc)); }
.wmark.boss .wm-label { font: 900 16px var(--head); letter-spacing: 0.06em; text-transform: uppercase; color: color-mix(in srgb, var(--mc) 35%, #fff); }
.wmark.boss.edge .wm-mark { width: 44px; height: 44px; } .wmark.boss.edge .wm-mark .ico { width: 26px; height: 26px; }
.wmark.boss.edge .wm-arrow { font-size: 30px; }
.wmark.boss.coming .wm-mark { animation: bossbeat 1.1s ease-in-out infinite; }
@keyframes bossbeat { 0%, 100% { scale: 1; } 10% { scale: 1.2; } 22% { scale: 1.02; } 34% { scale: 1.13; } 50% { scale: 1; } }
@keyframes gpbob { 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .wmark .wm-mark, .wmark.boss.coming .wm-mark, #brief .bf-state b { animation: none; } }
#story:not([hidden]):not(.out) ~ #raidwarn { top: 30%; }   /* a warning while the zone's story shows: below it */
@keyframes storyin { from { opacity: 0; transform: translate(-50%, -10px); } }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* health over a monster that took a hit and is still standing (src/hpbars.js) */
.hpb { position: absolute; left: 0; top: 0; width: 38px; height: 6px; border-radius: 3px; background: #1a0d0dcc; box-shadow: 0 0 0 1px #000a; overflow: hidden; will-change: transform; }
.hpb[hidden] { display: none; }
.hpb i { display: block; height: 100%; background: linear-gradient(#ff7a62, #d02c22); transform-origin: left; }
.hpb.big { width: 56px; height: 7px; }
.hpb.elite { box-shadow: 0 0 0 1px #ffd23a, 0 0 4px #ffd23a88; }
.hpb.elite i { background: linear-gradient(#ffb04a, #e0461e); }
.mtag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; will-change: transform; }
.mname { text-align: center; font: 700 14px var(--head); text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; }
.mname i { display: block; font: italic 700 12px var(--body); color: #ffd8a0; }
.bubble { max-width: 230px; background: #fffdf2; color: #2a1a0a; border: 2px solid #3a2a1a; border-radius: 12px; padding: 4px 10px; font: 700 14px var(--body); text-align: center; position: relative; box-shadow: 0 2px 6px #0008; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -6px; border: 6px solid transparent; border-top-color: #3a2a1a; }
.bubble.pop { animation: bpop 0.25s ease-out; }
.bubble.alert { background: #e8352a; color: #fff; border-color: #6a0d08; font: 900 22px var(--body); padding: 0 10px; line-height: 1.15; }
.bubble.alert::after { border-top-color: #6a0d08; }
.bubble.alert.bite { font-size: 16px; padding: 1px 8px; letter-spacing: 0.04em; }   /* a monster biting what you guard: "CHOMP!" */
@keyframes bpop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#secretBar { position: absolute; left: 50%; bottom: calc(170px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(320px, 70vw); text-align: center; pointer-events: none; }
#secretBar b { display: block; font: 700 14px var(--head, serif); color: #d8c4ff; text-shadow: 0 1px 2px #000, 0 0 8px #6a2aff; margin-bottom: 5px; }
#secretBar i { display: block; height: 12px; border: 1px solid #000; outline: 1px solid #8a6ad0; background: #140a22; }
#secretBar em { display: block; height: 100%; background: linear-gradient(#c7a4ff, #7a3aff); transform-origin: left; transform: scaleX(var(--p, 0)); }
#toasts { position: absolute; right: 14px; bottom: calc(146px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 6px; justify-items: end; pointer-events: auto; }
.toast { background: var(--tip); border: 1px solid #9aa0bf; border-radius: 5px; padding: 6px 10px; font-size: 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); animation: toastIn 0.25s ease-out; max-width: 300px; transition: opacity 0.4s, transform 0.4s; }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast .lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.toast .tn { font-weight: 800; }
.toast .tl { font-size: 12.5px; }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } }
#perf { position: absolute; left: 12px; bottom: 12px; margin: 0; font: 600 11px/1.35 ui-monospace, Menlo, monospace; color: #cfe8ff; background: rgba(0, 0, 0, 0.55); padding: 4px 8px; border-radius: 4px; white-space: pre; }

/* ---------- summary / level-up ---------- */
.summary { width: min(760px, 100%); }
.sumstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.sumstats > div { background: rgba(0, 0, 0, 0.35); border: 1px solid #4a3818; border-radius: 5px; padding: 10px; display: grid; gap: 2px; text-align: center; }
.sumstats b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sumstats span { font-size: 13px; color: var(--dim); }
.dmglist, .enddmg { display: grid; gap: 5px; }
.dmgrow { display: grid; grid-template-columns: 22px minmax(0, 12em) minmax(80px, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; }
.dmgrow .di { font-size: 18px; }
.dmgrow .dn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbar { height: 10px; background: #0a0806; border: 1px solid #3a2c18; border-radius: 2px; overflow: hidden; }
.dbar i { display: block; height: 100%; background: linear-gradient(90deg, #c07a12, #ffd24a); transform-origin: left; }
.dmgrow .dv { font-variant-numeric: tabular-nums; font-weight: 800; }
.lvl { width: min(1000px, 100%); }
.lootp { width: min(980px, 100%); }
.loot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; max-height: 62vh; overflow-y: auto; padding: 2px; }
.loot-card { position: static; max-width: none; display: grid; gap: 6px; align-content: start; border-color: var(--rc, #9aa0bf); box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 28%, transparent); }
.loot-card .loot-btns { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.loot-confirm { justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; font-weight: 700; color: var(--gold); }
/* Sell all is on the left (.loot-all): its question stays there, Yes where Sell all was (Nick: "when you hit sell the ui
   switches sides."); Keep all's stays on the right, Yes where Keep all was */
.loot-confirm.sell { justify-content: flex-start; }
.loot-confirm.sell #lootYes { order: -2; }
.loot-confirm.sell #lootNo { order: -1; }
.maps { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.mapbtn { flex: 1 1 220px; text-align: left; padding: 8px 12px; cursor: pointer; background: rgba(20, 14, 8, 0.82); border: 2px solid #5a4630; border-radius: 6px; color: var(--ink); font: 14px var(--body); }
.mapbtn b { display: block; font: 700 15px var(--head); color: #ffd100; }
.mapbtn span { color: #cbbfa8; font-size: 13px; }
.mapbtn[aria-pressed="true"] { border-color: #ffd100; box-shadow: 0 0 12px rgba(255, 209, 0, 0.35); }
.mapbtn:hover { border-color: #c8a860; }
.diffs { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.diffbtn { flex: 1 1 160px; text-align: left; padding: 6px 12px; cursor: pointer; background: rgba(20, 14, 8, 0.82); border: 2px solid #5a4630; border-radius: 6px; color: var(--ink); font: 13px var(--body); }
.diffbtn b { display: block; font: 700 15px var(--head); color: var(--dc); }
.diffbtn span { color: #cbbfa8; }
.diffbtn[aria-pressed="true"] { border-color: var(--dc); box-shadow: 0 0 12px color-mix(in srgb, var(--dc) 40%, transparent); }
.diffbtn.locked { opacity: 0.6; } .diffbtn.locked b { color: #8a8a8a; } .diffbtn.locked b svg { width: 13px; height: 13px; vertical-align: -1px; }
.crown { color: #4a4338; font-size: 18px; vertical-align: -2px; } .crown.got { color: var(--dc); text-shadow: 0 0 6px var(--dc); }
.newrec { margin: 0 0 10px; padding: 8px 10px; border: 1px solid #ffd100; border-radius: 6px; color: #ffe27a; background: rgba(255, 209, 0, 0.08); } .newrec.dim { border-color: #5a4630; color: #cbbfa8; background: none; }
/* what the run brought home (src/ui.js broughtHome): freed penguins, a new hero, a new difficulty */
.brought { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; }
.brought .bh-t { font: 600 12px var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: #cbbfa8; }
.brought .bh { --bc: #7fd8ff; padding: 4px 10px; border: 1px solid var(--bc); border-radius: 999px; color: var(--bc); background: color-mix(in srgb, var(--bc) 12%, transparent); font: 600 14px var(--body); }
.brought .bh small { color: #cbbfa8; font-weight: 400; } .brought .bh svg { width: 14px; height: 14px; vertical-align: -2px; }

.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.choice { cursor: pointer; min-height: 150px; transition: transform 0.12s; border-color: var(--rc, #9aa0bf); }
.choice:hover, .choice:focus-visible { transform: translateY(-3px); box-shadow: 0 0 0 1px #000, 0 0 18px color-mix(in srgb, var(--rc) 45%, transparent); }
.choice .key { font: 700 11px var(--body); color: var(--dim); justify-self: end; align-self: end; }

/* ---------- shop / inventory ---------- */
/* Gizzlefix's cart (2026-10-05 report from the shop: "this ui right now is really fugly. We need to fix the Gizzlefix's
   ui."). His wares were the tooltips' navy cards beside a brown pane of your gear, each a different height, a new
   weapon's Replace buttons cut to "QUICK S…", and the gold and Power floating off beside the wave's ribbon. Now one
   warm material for both sides: his name and your purses on one line, the ribbon across under them, and each ware a
   card of the same size, its rarity along its top, its price on a paper tag and its one way to buy along the bottom. */
.shop { width: min(1180px, calc(100% / var(--shop-zoom, 1))); zoom: var(--shop-zoom, 1); }   /* (zoomed down to fit a small window: src/ui-between.js fitShop) */
.shop-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.shop .who { color: var(--dim); font-size: 14px; margin-top: -4px; }
.shop .who .ribbon { margin: 0 0 6px; }
@media (min-width: 761px) {   /* its stars and gold beside what the wave came to (a phone's: above it) */
  .shop .who .ribbon { grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: center; }
  .shop .who .ribbon > * { grid-column: 2; }
  .shop .who .ribbon > .rb-top { grid-column: 1; grid-row: 1 / span 6; }
}
.purse { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; background: #0f0b07; border: 2px solid #6d5226; border-radius: 5px; padding: 0.2em 0.7em; }
/* Power beside the gold while shopping; it counts up when a buy helps */
.purses { display: flex; gap: 8px; align-items: center; }
.purse.power { position: relative; display: flex; align-items: center; gap: 6px; color: #ffd27a; border-color: #8a5a20; }
.purse.power svg { width: 18px; height: 18px; }
#shopPowerUp { position: absolute; right: 4px; top: -18px; font: 800 14px var(--body); font-style: normal; color: #4dff5e; opacity: 0; pointer-events: none; }
#shopPowerUp.on { animation: powerUp 1.4s ease-out; }
@keyframes powerUp { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; transform: translateY(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.forgenews { margin-top: 3px; color: #ffe27a; font-weight: 700; animation: forgeNews 1.2s ease-out 2; }
@keyframes forgeNews { 50% { text-shadow: 0 0 12px rgba(255, 210, 80, 0.9); } }
@media (prefers-reduced-motion: reduce) { #shopPowerUp.on, .forgenews { animation: none; } #shopPowerUp.on { opacity: 1; } }
.shop-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
/* your gear, then what Gizzlefix has for the boss under it (it was over his wares, and eight wares didn't fit a laptop) */
.shop-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.shop-right #shopChar { flex: 1; }
.shop-boss .supplies { margin-bottom: 0; }
.wares-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pane .wares-head h3 { margin: 0; }
.offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding-top: 4px; }
.offer { position: relative; min-height: 0; display: flex; flex-direction: column; gap: 7px; padding: 10px 11px 11px; color: var(--ink);
  background: linear-gradient(180deg, #2e2318, #1b140d 75%); border: 1px solid color-mix(in srgb, var(--rc, #9aa0bf) 40%, #3a2c18);
  border-top: 3px solid color-mix(in srgb, var(--rc, #9aa0bf) 80%, #000); box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.06), 0 2px 0 #000; }
.offer .tip-head { align-items: flex-start; }
.offer .oname { flex: 1; min-width: 0; padding-top: 2px; }
.offer .tip-ico { width: 44px; height: 44px; font-size: 26px; background: radial-gradient(circle at 40% 35%, #43331f, #120d08); box-shadow: 0 0 0 1px #000; }
.offer .tip-ico svg { width: 27px; height: 27px; }
.offer .tip-name { font-size: 17px; }
.offer .tip-type { color: var(--dim); }
.offer .what { font-size: 13.5px; line-height: 1.35; color: #e8dcc0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }   /* (all of it on hover) */
.offer .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.offer .chip { font: 700 13px var(--body); color: #b9f5a8; background: rgba(30, 255, 0, 0.07); border: 1px solid rgba(30, 255, 0, 0.25); border-radius: 10px; padding: 1px 9px; }
.offer .chip.neg { color: #ffb49a; background: rgba(255, 90, 74, 0.07); border-color: rgba(255, 90, 74, 0.3); }
.offer .calltag { color: #ffd100; }
.offer .fit { margin-top: 0; background: rgba(0, 0, 0, 0.22); }
.offer .foot { display: flex; align-items: flex-end; margin-top: auto; gap: 8px; padding-top: 2px; }
.offer .foot > .buy { flex: 1; min-height: 32px; font-size: 13px; }
.offer.sold { opacity: 0.4; }
/* its price: a paper tag on a string, tied on at its point (red when there isn't the gold for it yet) */
.offer .price { flex: none; position: relative; display: inline-flex; align-items: center; margin: 1px -3px 0 0; padding: 3px 9px 3px 15px; font: 900 15px/1.1 var(--body);
  font-variant-numeric: tabular-nums; color: #3a2408; background: linear-gradient(180deg, #f6ead0, #dcc79e); clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
  filter: drop-shadow(0 1px 0 #000); }
.offer .price::before { content: ''; position: absolute; left: 7px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: #1b140d; }
.offer .price .coin { margin-right: 0.25em; }
.offer .price.cant { color: #b3200e; }
.price { font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; font-size: 16px; }
.price.cant { color: #ff4b3a; }
.lockbtn { flex: none; width: 32px; height: 32px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.25); border: 1px solid #4a3818; border-radius: 4px; color: #8a7a5e; cursor: pointer; font-size: 15px; }
.lockbtn:hover { color: var(--ink); border-color: #6d5226; }
.lockbtn.on { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px rgba(255, 209, 0, 0.4); }
.pane { background: rgba(0, 0, 0, 0.35); border: 1px solid #4a3818; border-radius: 5px; padding: 10px 12px; display: grid; gap: 8px; align-content: start; }
.pane h3 { font-family: var(--head); color: var(--gold); font-size: 14px; margin: 4px 0 0; letter-spacing: 0.06em; }
.pane h3 .dim { font-family: var(--body); font-weight: 600; }
.bag { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.wslot { position: relative; background: linear-gradient(180deg, #2a2016, #18120c 75%); border: 2px solid var(--rc, #3a2c18); border-radius: 5px; padding: 6px 4px; display: grid; gap: 2px; justify-items: center; text-align: center; min-height: 84px; font-size: 12px; cursor: pointer; }
.wslot:hover { background: linear-gradient(180deg, #33281c, #1d160e 75%); }
.wslot.sel { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(255, 209, 0, 0.4); }
.wslot.comb { animation: combpulse 1.4s ease-in-out infinite; }
@keyframes combpulse { 50% { box-shadow: 0 0 12px rgba(255, 209, 0, 0.55); } }
.wslot.empty { border-style: dashed; color: #5a4a33; place-content: center; cursor: default; }
.wslot .wi { font-size: 24px; color: var(--rc); }
.wslot .wn { font-weight: 700; line-height: 1.1; color: var(--rc); font-size: 11.5px; }
.wslot .wt { color: #aaa; font-size: 10.5px; }
.combadge { position: absolute; top: 2px; right: 4px; font-weight: 900; color: var(--gold); font-size: 11px; }
.wactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; min-height: 30px; }
.wactions .btn.up.can { animation: combpulse 1.4s ease-in-out infinite; border-color: var(--gold); }
.calling-line { margin: 2px 0 4px; }
.calling-line .calltag { color: #ffd100; }
.trinkets { display: flex; gap: 5px; flex-wrap: wrap; }
.trink { position: relative; width: 36px; height: 36px; display: grid; place-items: center; font-size: 20px; color: var(--rc); border: 2px solid var(--rc); border-radius: 4px; background: radial-gradient(circle at 40% 35%, #43331f, #120d08); cursor: help; }
.trink b { position: absolute; right: 1px; bottom: -1px; font-size: 11px; color: #fff; text-shadow: 0 0 2px #000, 0 1px 1px #000; }
button.trink { cursor: pointer; padding: 0; font: inherit; }
button.trink:hover { filter: brightness(1.25); }
.trink.empty { border: 2px dashed #3a2c18; background: none; cursor: default; }
.trink.sel { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(255, 209, 0, 0.4); }
.swaprow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.trink.swap:hover { box-shadow: 0 0 0 2px #ff6a4a, 0 0 10px rgba(255, 106, 74, 0.5); }
.statcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.statcol h4 { margin: 0 0 3px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.stat { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; padding: 1px 0; cursor: help; font-variant-numeric: tabular-nums; }
.stat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b.up { color: var(--r1); }
.stat b.down { color: #ff4b3a; }

/* ---------- pause / settings / end ---------- */
.pausep { width: min(1000px, 100%); grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: start; }
.pause-side { display: grid; gap: 14px; }
.btns { display: grid; gap: 8px; }
.btns.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.dialog-layer { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); padding: 16px; }
.settings { width: min(420px, 100%); }
/* Report a Bug: the picture of the moment you paused, and a big box for what went wrong. It always fits the window, so
   Send can't drop off the bottom: on a short one the picture and the box shrink, and on a tiny one the panel scrolls. */
.bugp { width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
#bugShot { justify-self: center; width: auto; height: auto; max-width: 100%; max-height: 34vh; border: 2px solid #6d5226; border-radius: 4px; }
.bug-note { display: grid; gap: 6px; font: 700 18px var(--body); color: var(--gold); }
.bug-note textarea { font: 500 17px/1.35 var(--body); color: var(--ink); background: #0f0b07; border: 2px solid #6d5226; border-radius: 4px; padding: 0.5em 0.7em;
  box-shadow: inset 0 2px 6px #000; resize: vertical; min-height: 7em; }
.bug-note textarea:focus { outline: none; border-color: var(--gold); }
.bug-msg { margin: 0; min-height: 1.3em; font-weight: 800; text-align: center; }
.bug-msg.ok { color: var(--r1); font-size: 20px; }
.bug-msg.err { color: #ff8a6a; }
@media (max-height: 640px) { .bugp { gap: 8px; padding-block: 12px; } #bugShot { max-height: 22vh; } .bug-note textarea { height: 4.6em; min-height: 3em; } }
.opt { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; font-weight: 700; }
.opt.check { display: flex; }
.opt input[type='range'] { accent-color: #d9aa45; width: 100%; }
.opt select { font: inherit; background: #0f0b07; color: var(--ink); border: 1px solid #6d5226; border-radius: 4px; padding: 4px 6px; }
.endp { width: min(640px, 100%); text-align: center; justify-items: center; }
.endp p { margin: 0; }
.deadt { color: #d7d7d7; font-family: var(--display); }
.runstats { display: grid; grid-template-columns: auto auto; gap: 3px 18px; font-variant-numeric: tabular-nums; text-align: left; justify-content: center; }
.runstats b { color: #fff; }
.enddmg { width: min(560px, 100%); margin: 10px auto 0; text-align: left; }
.recap { width: min(560px, 100%); margin: 0 auto; text-align: left; background: rgba(60, 0, 0, 0.35); border: 1px solid #6a1a12; border-radius: 5px; padding: 8px 12px; font-size: 14px; }
.recap h4 { margin: 0 0 4px; font-family: var(--head); color: #ff7a5a; font-size: 13px; letter-spacing: 0.08em; }
.recap div { display: flex; justify-content: space-between; gap: 10px; }

/* ---------- touch ---------- */
#touch { position: fixed; inset: 0; z-index: 11; touch-action: none; display: none; }
#touch.on { display: block; }
.joy { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid rgba(255, 209, 0, 0.5); background: rgba(0, 0, 0, 0.25); display: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(255, 209, 0, 0.55); }
.tbtn { position: absolute; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--trim); background: rgba(20, 14, 8, 0.75); color: var(--gold); font: 800 12px var(--head); display: grid; place-items: center; }
#tJump { right: 24px; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
#tDash { right: 100px; bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
#tPause { right: 24px; top: calc(230px + env(safe-area-inset-top, 0px)); width: 46px; height: 46px; }
/* the two attack buttons: hold to keep attacking; they show the weapon's icon */
.tbtn.atk { width: 70px; height: 70px; border-color: var(--rc, var(--trim)); }
.tbtn.atk svg { width: 32px; height: 32px; }
#tAtk0 { right: 22px; bottom: calc(232px + env(safe-area-inset-bottom, 0px)); }
#tAtk1 { right: 106px; bottom: calc(202px + env(safe-area-inset-bottom, 0px)); }
#tPower { right: 186px; bottom: calc(140px + env(safe-area-inset-bottom, 0px)); border-color: var(--rc, var(--trim)); }   /* the hero power (R) */
#tPower svg { width: 28px; height: 28px; }
#tPower.wait { opacity: 0.45; }

@media (max-width: 900px) {
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-grid { grid-template-columns: 1fr; }
  .pausep { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .offers { grid-template-columns: 1fr; }
  .sumstats { grid-template-columns: 1fr; }
  .statcols { grid-template-columns: 1fr 1fr; }
  #minimap { width: 110px; height: 110px; }
  #tracker { top: calc(150px + env(safe-area-inset-top, 0px)); width: 170px; }
  .uf-body { min-width: 150px; }
  .slot { width: 40px; height: 40px; font-size: 22px; }
  .slot.atk { width: 46px; height: 46px; font-size: 26px; }
  }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .choice { transition: none; } .wslot.comb, .slot .leg { animation: none; } }

/* ---- power: the build's strength on the unit frame, and the hero's power tier */
.uf-power { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; font: 700 12px var(--body); color: #e8d7a8; }
#ufPower { display: inline-flex; align-items: center; gap: 4px; }
#ufPower svg { width: 13px; height: 13px; color: #ffd100; }
#ufPower b { color: #fff; font-size: 13px; }
#ufPower.up { animation: powerUp 0.9s ease-out; }
@keyframes powerUp { 0% { color: #fff; text-shadow: 0 0 12px #ffd100; transform: scale(1.15); } 100% { text-shadow: none; transform: scale(1); } }
#ufTier { pointer-events: auto; cursor: help; padding: 0 6px; border-radius: 8px; border: 1px solid #ffd100; color: #ffd100; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; box-shadow: 0 0 8px rgba(255, 209, 0, 0.4); }
/* ---- a weapon became Legendary */
#legendSplash { position: fixed; left: 50%; top: 42%; z-index: 60; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  padding: 22px 40px 20px; border: 2px solid #ff8000; border-radius: 10px; background: radial-gradient(ellipse at center, rgba(90, 40, 0, 0.95), rgba(20, 10, 4, 0.95)); box-shadow: 0 0 60px rgba(255, 128, 0, 0.6), inset 0 0 30px rgba(255, 160, 0, 0.25); }
#legendSplash.go { animation: legendIn 3.2s ease-out forwards; }
@keyframes legendIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 10% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 16% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -54%) scale(1); } }
#legendSplash .ls-k { font: 700 14px var(--head); letter-spacing: 0.2em; text-transform: uppercase; color: #ffb040; }
#legendSplash .ls-ico svg { width: 56px; height: 56px; color: #ff8000; filter: drop-shadow(0 0 12px #ff8000); margin: 8px 0 2px; }
#legendSplash .ls-n { font: 900 34px var(--display); color: #ff8000; text-shadow: 0 2px 0 #3a1c00, 0 0 18px rgba(255, 128, 0, 0.7); }
#legendSplash .ls-t { margin-top: 6px; color: #ffe2b0; font-size: 15px; max-width: 420px; }
/* ---- a boss's Legendary: the loot box drops in, shakes as its light rises, bursts open, and the card comes up out of
   it (src/ui-legend.js: the stages are classes on .lb: drop, shake, burst, card) */
#legendBox { background: radial-gradient(circle at 50% 46%, rgba(60, 24, 0, 0.5), rgba(0, 0, 0, 0.86) 70%); overflow: hidden; cursor: pointer; }
#legendBox .lb { position: fixed; inset: 0; overflow: hidden; }
#legendBox .lb > * { position: absolute; left: 50%; top: 46%; translate: -50% -50%; }
#legendBox .lb > .lb-card { top: 50%; }
#legendBox .lb > .lb-flash { inset: 0; translate: none; }
.lb-rays { width: 170vmax; height: 170vmax; border-radius: 50%; opacity: 0; transform: scale(0.2);
  background: repeating-conic-gradient(from 0deg, rgba(255, 150, 30, 0.42) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 55%); mask: radial-gradient(circle, #000 8%, transparent 55%); }
.lb-flash { background: radial-gradient(circle at 50% 46%, #fff8e0, rgba(255, 170, 60, 0.85) 30%, rgba(255, 128, 0, 0) 70%); opacity: 0; pointer-events: none; }
.lb-box { position: relative; width: 210px; height: 172px; display: grid; place-items: center; }
.lb-chest { position: relative; width: 210px; height: 172px; overflow: visible; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6)); }
.lb-glow { position: absolute; inset: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 90, 0.95), rgba(255, 128, 0, 0.5) 35%, transparent 68%); opacity: 0; transform: scale(0.5); }
.lb-seam { opacity: 0; filter: drop-shadow(0 0 6px #ffb040) drop-shadow(0 0 14px #ff8000); }
.lb-lid { transform-box: fill-box; transform-origin: 50% 100%; }
.lb-sparks { width: 0; height: 0; }
.lb-sparks i { position: absolute; left: 0; top: 0; width: var(--z); height: var(--z); margin: calc(var(--z) / -2); border-radius: 50%; opacity: 0;
  background: #fff3c4; box-shadow: 0 0 8px 2px #ff9a1a; }
.lb-card { width: min(440px, 92vw); max-height: 92vh; overflow: auto; display: grid; gap: 6px; justify-items: center; text-align: center; padding: 20px 24px 16px; opacity: 0; cursor: default;
  border: 2px solid #ff8000; border-radius: 12px; background: radial-gradient(ellipse at 50% 0%, rgba(110, 50, 0, 0.97), rgba(24, 12, 4, 0.97) 70%);
  box-shadow: 0 0 0 1px #3a1c00, 0 0 70px rgba(255, 128, 0, 0.55), inset 0 0 34px rgba(255, 160, 0, 0.22); }
.lb-kicker { font: 800 13px var(--head); letter-spacing: 0.24em; text-transform: uppercase; color: #ffb040; }
/* a boss's rewards, one after another in the one box: Legendary (when it dropped), Pick a trinket, Surprise */
.lb-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; font: 800 11px var(--head); letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255, 226, 176, 0.45); }
.lb-steps span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(255, 210, 122, 0.25); white-space: nowrap; }
.lb-steps span.on { color: #2a1400; background: #ffd23a; border-color: #ffd23a; box-shadow: 0 0 12px rgba(255, 210, 58, 0.6); }
.lb-steps span.done { color: #ffd27a; }
.lb-steps .ico { width: 12px; height: 12px; }
.lb-steps i { width: 10px; height: 2px; background: rgba(255, 210, 122, 0.3); }
/* a boss's treasure isn't a Legendary: gold, not Legendary orange */
.lb-card.gold { border-color: #ffd23a; box-shadow: 0 0 0 1px #3a2c00, 0 0 70px rgba(255, 210, 58, 0.45), inset 0 0 34px rgba(255, 210, 58, 0.18);
  background: radial-gradient(ellipse at 50% 0%, rgba(96, 70, 10, 0.97), rgba(22, 16, 4, 0.97) 70%); }
.lb-card.gold h2 { color: #ffe27a; text-shadow: 0 2px 0 #3a2c00, 0 0 20px rgba(255, 210, 58, 0.6); }
.lb-card.gold .lb-kicker { color: #ffd23a; }
.lb-card.gold .lb-ico { color: #ffd23a; box-shadow: 0 0 0 3px #ffd23a, 0 0 30px rgba(255, 210, 58, 0.7); }
.lb-ico { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; color: #ff8000;
  background: radial-gradient(circle, rgba(255, 150, 40, 0.45), rgba(40, 18, 2, 0.95) 70%); box-shadow: 0 0 0 3px #ff8000, 0 0 30px rgba(255, 128, 0, 0.8); }
.lb-ico .ico { width: 54px; height: 54px; filter: drop-shadow(0 0 8px #ff8000); }
.lb-card h2 { margin: 2px 0 0; font: 900 clamp(26px, 4.4vw, 36px) var(--display); color: #ff8000; line-height: 1.05; text-shadow: 0 2px 0 #3a1c00, 0 0 20px rgba(255, 128, 0, 0.75); }
.lb-from { font: 600 14px var(--body); color: var(--ink); }
.lb-lines { display: grid; gap: 2px; font-size: 15px; color: #ffe2b0; }
.lb-lines .eq { color: #8cff70; }
.lb-flavor { font: italic 14px var(--body); color: #c9a46a; }
.lb-stamp { margin-top: 4px; padding: 4px 16px; font: 900 22px var(--display); color: #fff3c4; background: #ff8000; border-radius: 6px; rotate: -4deg;
  box-shadow: 0 3px 0 #6a3000, 0 0 24px rgba(255, 128, 0, 0.9); text-shadow: 0 2px 0 #8a3c00; }
.lb-sub { font-size: 13px; color: var(--dim); }
.lb-where { font: 600 14px var(--body); color: #ffd27a; }
.lb-set { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.lb-set .lg-slot { width: 62px; }
.lb-foot { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.lb-take { font-size: 17px; padding: 0.5em 1.6em; }
/* a boss's treasure (src/ui-legend.js treasureMarkup): three trinkets to pick from, side by side (stacked on a phone) */
.lb-card.wide { width: min(780px, 94vw); }
.lb-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; margin-top: 8px; }
@media (max-width: 620px) { .lb-picks { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.lb-pick { position: relative; display: grid; gap: 4px; justify-items: center; align-content: start; padding: 16px 10px 12px; font: inherit; color: var(--ink); text-align: center; cursor: pointer;
  border: 2px solid var(--rc); border-radius: 10px; background: linear-gradient(color-mix(in srgb, var(--rc) 16%, rgba(20, 10, 2, 0.9)), rgba(14, 8, 2, 0.95));
  box-shadow: 0 0 14px color-mix(in srgb, var(--rc) 35%, transparent); transition: transform 0.12s, box-shadow 0.12s; }
.lb-pick:hover, .lb-pick:focus-visible { transform: translateY(-4px) scale(1.03); box-shadow: 0 0 0 2px #fff3c4, 0 0 30px var(--rc); outline: none; }
.lb-pick .lp-ico { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: var(--rc);
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 40%, transparent), rgba(10, 5, 0, 0.9) 72%); box-shadow: 0 0 0 2px var(--rc), 0 0 18px color-mix(in srgb, var(--rc) 60%, transparent); }
.lb-pick .lp-ico .ico { width: 36px; height: 36px; }
.lb-pick .lp-name { font: 800 17px var(--head); color: var(--rc); line-height: 1.15; }
.lb-pick .lp-type { font-size: 12px; color: var(--dim); }
.lb-pick .lp-lines { display: grid; gap: 1px; font-size: 13px; color: #ffe2b0; }
.lb-pick .lp-lines .eq { color: #8cff70; }
.lb-pick .lp-lines .neg { color: #ff8a7a; }
.lb-pick > .sugtag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); }
.lb-pick > kbd { position: absolute; top: 6px; left: 6px; }
@media (max-width: 620px) { .lb-pick { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; column-gap: 12px; padding: 12px; }
  .lb-pick .lp-ico { grid-row: span 3; width: 46px; height: 46px; } .lb-pick > kbd { display: none; } }
#legendBox kbd { font: 800 12px var(--head); background: #3a2410; color: var(--gold); border-radius: 4px; padding: 3px 7px; box-shadow: 0 2px 0 #1a0e04; }
/* the stages */
.lb.drop .lb-box { animation: lbDrop 0.55s cubic-bezier(0.5, 0, 0.75, 0) both, lbLand 0.25s 0.5s ease-out; }
@keyframes lbDrop { from { transform: translateY(-110vh) rotate(-8deg); } to { transform: translateY(0) rotate(0); } }
@keyframes lbLand { 0% { transform: scale(1.18, 0.82); } 60% { transform: scale(0.95, 1.06); } 100% { transform: none; } }
.lb.shake .lb-box { animation: lbShake 1.7s linear both; }
@keyframes lbShake { 0% { transform: none; } 8% { transform: rotate(-1.5deg); } 16% { transform: rotate(1.5deg); } 26% { transform: rotate(-2.5deg) translateY(-2px); } 36% { transform: rotate(3deg); }
  46% { transform: rotate(-4deg) translateY(-5px); } 55% { transform: rotate(4.5deg); } 63% { transform: rotate(-6deg) translateY(-8px) scale(1.03); } 70% { transform: rotate(6deg) scale(1.04); }
  77% { transform: rotate(-8deg) translateY(-12px) scale(1.06); } 83% { transform: rotate(8deg) scale(1.08); } 89% { transform: rotate(-10deg) translateY(-14px) scale(1.1); }
  94% { transform: rotate(10deg) scale(1.12); } 100% { transform: translateY(-16px) scale(1.16); } }
.lb.shake .lb-glow { animation: lbGlow 1.7s ease-in both; }
@keyframes lbGlow { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1.4); } }
.lb.shake .lb-seam { animation: lbSeam 1.7s ease-in both; }
@keyframes lbSeam { 0% { opacity: 0; } 30% { opacity: 0.4; } 100% { opacity: 1; } }
.lb.shake .lb-lid { animation: lbRattle 1.7s linear both; }
@keyframes lbRattle { 0%, 40% { transform: none; } 50% { transform: translateY(-3px) rotate(-2deg); } 60% { transform: none; } 70% { transform: translateY(-5px) rotate(2deg); } 78% { transform: none; } 86% { transform: translateY(-8px) rotate(-3deg); } 93% { transform: translateY(-2px); } 100% { transform: translateY(-10px) rotate(3deg); } }
.lb.burst .lb-box { transform: translateY(-16px) scale(1.16); }
.lb.burst .lb-lid { animation: lbLid 0.8s cubic-bezier(0.15, 0.8, 0.3, 1) forwards; }
@keyframes lbLid { from { transform: translateY(-10px) rotate(3deg); opacity: 1; } to { transform: translate(60px, -260px) rotate(130deg); opacity: 0; } }
.lb.burst .lb-glow { opacity: 1; transform: scale(2.4); transition: transform 0.4s, opacity 0.6s; }
.lb.burst .lb-seam { opacity: 1; }
.lb.burst .lb-flash { animation: lbFlash 0.9s ease-out forwards; }
@keyframes lbFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.lb.burst .lb-rays { animation: lbRaysIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) forwards, lbSpin 26s linear infinite; }
@keyframes lbRaysIn { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: scale(1); } }
@keyframes lbSpin { from { rotate: 0deg; } to { rotate: 360deg; } }
.lb.burst .lb-sparks i { animation: lbSpark 1.1s cubic-bezier(0.1, 0.8, 0.3, 1) var(--s) forwards; }
@keyframes lbSpark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(10px); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) translateY(40px) scale(0.4); } }
.lb.card .lb-box { opacity: 0; transform: translateY(40px) scale(0.8); transition: opacity 0.35s, transform 0.35s; }
.lb.card .lb-card { animation: lbCard 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) forwards; }
@keyframes lbCard { from { opacity: 0; transform: translateY(70px) scale(0.3); } to { opacity: 1; transform: none; } }
.lb.card .lb-stamp { animation: lbStamp 0.45s 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) both; }
@keyframes lbStamp { from { opacity: 0; transform: scale(2.6) rotate(-10deg); } to { opacity: 1; transform: none; } }
.lb.card .lb-ico { animation: lbPulse 2.4s 0.6s ease-in-out infinite; }
@keyframes lbPulse { 50% { box-shadow: 0 0 0 3px #ff8000, 0 0 50px rgba(255, 160, 40, 1); } }
@media (prefers-reduced-motion: reduce) {
  #legendBox .lb *, #legendBox .lb.card .lb-card { animation: none !important; transition: none !important; }
  #legendBox .lb.card .lb-card { opacity: 1; }
  #legendBox .lb.burst .lb-rays { opacity: 0.6; transform: none; }
  #legendBox .lb.card .lb-box, #legendBox .lb-sparks, #legendBox .lb-flash { display: none; }
}
/* the collection: six Legendaries, one per boss (the hero screen, and the reveal's row): earned ones lit, the rest dark */
.legends { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.legends .lg-t { font: 700 11px var(--head); letter-spacing: 0.12em; text-transform: uppercase; color: #ffb040; text-align: center; line-height: 1.3; width: 78px; }
.legends .lg-t b { display: block; font-size: 15px; color: #ff8000; letter-spacing: 0; }
.lg-row { display: flex; gap: 4px; }
.lg-slot { display: grid; justify-items: center; align-content: start; gap: 3px; width: 76px; outline: none; }
.lg-slot .lg-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; color: #ff8000; border: 2px solid #ff8000;
  background: radial-gradient(circle, rgba(255, 128, 0, 0.35), rgba(30, 14, 2, 0.92)); box-shadow: 0 0 12px rgba(255, 128, 0, 0.55); }
.lg-slot .lg-ico .ico { width: 24px; height: 24px; filter: drop-shadow(0 0 4px #ff8000); }
.lg-slot small { font: 600 10.5px/1.15 var(--body); color: #ffcf8a; text-align: center; }
.lg-slot.off .lg-ico { color: #060403; border-color: #3a2c1c; background: rgba(12, 9, 6, 0.9); box-shadow: inset 0 0 8px #000; }
.lg-slot.off .lg-ico .ico { filter: drop-shadow(0 0 1px rgba(255, 170, 80, 0.45)); }
.lg-slot.off small { color: #8a7a64; }
.lg-slot:focus-visible .lg-ico { outline: 2px solid var(--gold); outline-offset: 2px; }
.lg-slot.fresh .lg-ico { animation: lbPulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .lg-slot.fresh .lg-ico { animation: none; } }
/* ---- while a menu is open, the in-fight notes step back */
body.modal .toast:not(.out) { opacity: 0.25; }
/* ---- shop: how an offer fits YOUR build */
.fit { margin-top: 6px; padding: 5px 8px; border-radius: 4px; font-size: 12.5px; line-height: 1.35; background: rgba(255, 255, 255, 0.04); border-left: 3px solid #6a6a6a; color: #cfc6b0; }
.fit.good { border-left-color: #1eff00; color: #b9f5a8; }
.fit.gold { border-left-color: #ffd100; color: #ffe27a; }
.fit.warn { border-left-color: #ff6a3a; color: #ffb49a; }
.fit b { color: #fff; }
/* a Reroll button: how many of the land's three are left (src/ui-between.js rerollButton) */
.rr-left { margin-left: 4px; padding: 0 6px; border-radius: 8px; font-size: 0.85em; background: rgba(255, 255, 255, 0.1); color: var(--ink); }

/* ---- hero select: a row of hero tiles, a detail card, compact zone/difficulty pickers */
.classes { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
.htile { display: grid; justify-items: center; gap: 4px; padding: 8px 2px 6px; cursor: pointer; background: rgba(18, 13, 8, 0.88); border: 2px solid #5a4630; border-radius: 6px; color: var(--ink); font: 600 13px var(--body); transition: transform 0.12s, border-color 0.12s; }
.htile .emb { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #120d08; border: 2px solid var(--trim); color: var(--hc); font-size: 20px; }
.htile .emb svg { width: 22px; height: 22px; }
.htile .hn { max-width: 100%; text-align: center; line-height: 1.05; min-height: 2.1em; display: flex; align-items: center; hyphens: auto; overflow-wrap: anywhere; }   /* "Animal Tamer" wraps; a name too long for its tile breaks rather than being cut off */
.htile .lk { position: absolute; right: -6px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: #2a2018; border: 1px solid #8a7a5a; display: grid; place-items: center; color: #d8c8a0; }
.htile .lk svg { width: 11px; height: 11px; }
.htile.locked .emb { filter: grayscale(0.85) brightness(0.7); } .htile.locked .hn { color: #8f8574; }
.htile:hover { transform: translateY(-2px); border-color: #c8a860; }
/* NEW!: earned since you last clicked it (src/ui-menu.js) */
.htile, .seg { position: relative; }
.newtag { position: absolute; top: -8px; right: -6px; padding: 1px 5px; border-radius: 4px; background: #ffd100; color: #2a1a00; font: 800 10px/1.3 var(--body); font-style: normal; letter-spacing: 0.04em; box-shadow: 0 0 10px rgba(255, 209, 0, 0.7); animation: newtag 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes newtag { 50% { transform: scale(1.12); box-shadow: 0 0 16px rgba(255, 209, 0, 0.95); } }
.htile.new { border-color: #ffd100; } .seg.new { border-color: #ffd100; }
@media (prefers-reduced-motion: reduce) { .newtag { animation: none; } }
.htile[aria-pressed='true'] { border-color: var(--hc); box-shadow: 0 0 0 1px #000, 0 0 16px color-mix(in srgb, var(--hc) 55%, transparent); transform: translateY(-2px); }
.htile[aria-pressed='true'] .hn { color: var(--hc); }
.hero-detail { padding: 12px 14px; display: grid; gap: 8px; min-height: 0; }
.hd-top { display: flex; gap: 10px; align-items: center; }
.hd-top .emb { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #120d08; border: 2px solid var(--trim); flex: none; font-size: 22px; }
.hd-top h3 { font-family: var(--head); margin: 0; font-size: 26px; }
.hd-top .sub { font-size: 13px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.hd-lock { margin-left: auto; color: #d8c8a0; font: 700 13px var(--head); display: flex; gap: 4px; align-items: center; } .hd-lock svg { width: 14px; height: 14px; }
.hd-unlock { padding: 6px 10px; border: 1px dashed #8a7a5a; border-radius: 5px; color: #e8d8b0; font-size: 15.5px; background: rgba(255, 209, 0, 0.05); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
/* where a locked hero waits: the land, the road out with a sparkle on it, the land it goes to (src/ui-menu.js unlockHint) */
.uw { display: inline-flex; align-items: center; flex: none; }
.uw-land { padding: 1px 8px; border: 1px solid #c8a860; border-radius: 4px; background: rgba(20, 14, 8, 0.85); color: #ffd100; font: 700 13px var(--head); white-space: nowrap; }
.uw-land.dim { border-color: #4a3a28; color: #8f8574; }
.uw-road { position: relative; width: 52px; text-align: center; line-height: 1; }
.uw-road::before { content: ''; position: absolute; left: 2px; right: 2px; top: 50%; border-top: 2px dashed #c8a860; }
.uw-road::after { content: '✦'; position: relative; display: inline-block; padding: 0 3px; background: #1d150c; color: var(--hc); font-size: 21px; text-shadow: 0 0 8px var(--hc); animation: uwTwinkle 1.4s ease-in-out infinite; }
.uw-road.here { width: 30px; } .uw-road.here::before { display: none; } .uw-road.here::after { background: none; }
@keyframes uwTwinkle { 0%, 100% { opacity: 0.7; transform: scale(0.85) rotate(0deg); } 50% { opacity: 1; transform: scale(1.2) rotate(20deg); } }
.hd-blurb { margin: 0; font-size: 16px; line-height: 1.35; }
.hd-power { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: 5px; border: 1px solid color-mix(in srgb, var(--hc) 60%, #000); background: color-mix(in srgb, var(--hc) 10%, rgba(0, 0, 0, 0.4)); font-size: 15.5px; line-height: 1.3; }
.hd-power .emb { color: var(--hc); flex: none; width: 26px; height: 26px; display: grid; place-items: center; } .hd-power .emb svg { width: 22px; height: 22px; }
.hd-power b { color: var(--hc); font: 700 17px var(--head); }
.hd-power kbd { font: 700 10px var(--body); background: #2a2018; border: 1px solid #6d5226; border-radius: 3px; padding: 0 4px; }
.hd-rec { font-size: 14.5px; color: #ffd100; } .hd-rec.dim { color: #8f8574; }
/* the hero's two starting attacks (src/ui-attacks.js): Left click, Right click and a die; a slot opens the hero's five
   in its place, the same height, so nothing else on the screen moves */
.atk-pick { display: flex; align-items: stretch; gap: 6px; min-height: 50px; }
.atk-l { flex: none; width: 96px; align-self: center; display: flex; align-items: center; gap: 4px; font: 700 13px/1.15 var(--head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.atk-l svg { width: 15px; height: 15px; flex: none; color: var(--hc); }
.atk-slot { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; background: rgba(15, 11, 7, 0.9); border: 2px solid #6d5226; border-radius: 6px; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.12s, transform 0.12s; }
.atk-slot:hover, .atk-slot:focus-visible, .atk-roll:hover, .atk-roll:focus-visible, .atk-close:hover, .atk-close:focus-visible { border-color: var(--hc); box-shadow: 0 0 10px color-mix(in srgb, var(--hc) 40%, transparent); outline: none; }
.atk-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #120d08; border: 2px solid var(--hc); color: var(--hc); }
.atk-ico svg { width: 19px; height: 19px; }
.atk-t { display: grid; min-width: 0; line-height: 1.12; }
.atk-t small { display: flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--dim); }
.atk-t small svg { width: 12px; height: 12px; }
.atk-t b { font-size: 16.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atk-caret { margin-left: auto; color: var(--dim); font-size: 13px; }
.atk-roll, .atk-close { flex: none; width: 50px; display: grid; place-items: center; background: rgba(15, 11, 7, 0.9); border: 2px solid #6d5226; border-radius: 6px; color: var(--gold); cursor: pointer; }
.atk-roll svg { width: 26px; height: 26px; } .atk-close svg { width: 18px; height: 18px; color: var(--dim); }
/* a designer's "Pick your weapons" mission landing here (src/ui-menu.js showAttacks): the two slots pulse a few times */
.atk-pick.look .atk-slot { animation: atkLook 1.1s ease-in-out 3; }
@keyframes atkLook { 50% { border-color: var(--hc); box-shadow: 0 0 0 2px var(--hc), 0 0 22px color-mix(in srgb, var(--hc) 70%, transparent); } }
.atk-pick.rolled .atk-slot { animation: atkRoll 0.45s ease-out; } .atk-pick.rolled .atk-roll svg { animation: atkDie 0.45s ease-out; }
@keyframes atkRoll { 30% { transform: translateY(-4px) scale(1.04); border-color: var(--hc); } }
@keyframes atkDie { 100% { transform: rotate(360deg); } }
.atk-choices { flex: 1; min-width: 0; display: flex; gap: 5px; overflow-x: auto; }
.atk-choice { position: relative; flex: 1 1 0; min-width: 70px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 4px 3px; background: rgba(15, 11, 7, 0.9); border: 2px solid #5a4630; border-radius: 6px; color: var(--ink); font: 600 13px/1.05 var(--body); text-align: center; cursor: pointer; }
.atk-choice svg { width: 20px; height: 20px; color: var(--hc); }
.atk-choice:hover, .atk-choice:focus-visible { border-color: #c8a860; outline: none; transform: translateY(-1px); }
.atk-choice[aria-pressed='true'] { border-color: var(--hc); color: var(--hc); box-shadow: 0 0 0 1px #000, 0 0 12px color-mix(in srgb, var(--hc) 50%, transparent); }
.atk-choice.no { opacity: 0.4; cursor: not-allowed; }
.atk-other { position: absolute; top: 2px; right: 3px; } .atk-other svg { width: 12px; height: 12px; color: var(--dim); }
.atk-call { position: absolute; top: 2px; left: 3px; font: 800 9.5px var(--body); font-style: normal; color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .atk-pick.rolled .atk-slot, .atk-pick.rolled .atk-roll svg { animation: none; } .atk-pick.look .atk-slot { animation: none; border-color: var(--hc); } }
.menu-opts { display: grid; gap: 6px; }
.opt { display: grid; grid-template-columns: 100px 1fr; gap: 2px 10px; align-items: center; }
.opt-l { font: 700 14px var(--head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.opt small { grid-column: 2; color: #cbbfa8; font-size: 14px; min-height: 1em; }
.segs { display: flex; flex-wrap: wrap; gap: 4px; }
.seg { padding: 5px 12px; cursor: pointer; background: rgba(20, 14, 8, 0.85); border: 1px solid #5a4630; border-radius: 4px; color: var(--ink); font: 600 15px var(--body); --dc: #ffd100; }
.seg:hover { border-color: #c8a860; }
.seg[aria-pressed='true'] { border-color: var(--dc); color: var(--dc); box-shadow: 0 0 10px color-mix(in srgb, var(--dc) 35%, transparent); background: rgba(40, 30, 14, 0.95); }
.seg.locked { opacity: 0.75; color: #a89c84; background: linear-gradient(90deg, color-mix(in srgb, var(--dc) 30%, rgba(20, 14, 8, 0.85)) var(--fill, 0%), rgba(20, 14, 8, 0.85) var(--fill, 0%)); }   /* fills with rescued penguins */
.seg .vc { font-size: 11px; font-weight: 600; color: #e8dcc0; } .seg svg { width: 11px; height: 11px; vertical-align: -1px; }
@media (max-height: 760px) { .menu .tag { display: none; } .hd-blurb { display: none; } }

.slot.trait { margin-left: 4px; box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 40%, transparent); }
.slot.trait .tstate { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font: 700 11px var(--body); color: #fff; text-shadow: 0 1px 2px #000; }
.opt small:empty { display: none; }
/* a narrow column: heroes in two rows of four, the journey in pairs, labels above their choices */
@container (max-width: 620px) {
  .classes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .opt { grid-template-columns: 1fr; } .opt small { grid-column: 1; }
  .hd-blurb { display: none; }
  .atk-pick { flex-wrap: wrap; } .atk-l { width: 100%; }
}

.loot-all { margin-top: 6px; justify-content: space-between; opacity: 0.9; }

/* collecting gold and crystals: the counter pops, the XP bar flashes */
@keyframes goldPop { 0% { transform: scale(1); } 35% { transform: scale(1.22); color: #fff3a8; } 100% { transform: scale(1); } }
@keyframes goldPopBig { 0% { transform: scale(1); } 30% { transform: scale(1.45); color: #fff3a8; text-shadow: 0 0 12px #ffd100; } 100% { transform: scale(1); } }
.pop { animation: goldPop 0.28s ease-out; transform-origin: right center; }
.pop-big { animation: goldPopBig 0.5s ease-out; transform-origin: right center; }
@keyframes xpFlash { 0% { box-shadow: 0 0 0 rgba(180, 120, 255, 0); } 30% { box-shadow: 0 0 14px rgba(180, 120, 255, 0.9); filter: brightness(1.35); } 100% { box-shadow: 0 0 0 rgba(180, 120, 255, 0); } }
.flash { animation: xpFlash 0.3s ease-out; }
.flash-big { animation: xpFlash 0.6s ease-out; }
/* the level badge on a level-up (src/ui-hud.js levelUp) */
.lvlbadge.lvpop { animation: lvpop 0.8s ease-out; }
@keyframes lvpop { 25% { transform: scale(1.55); color: #fff; box-shadow: 0 0 0 1px #000, 0 0 16px #ffd100; } }
@media (prefers-reduced-motion: reduce) { .pop, .pop-big, .flash, .flash-big, .lvlbadge.lvpop { animation: none; } }

/* ---------- playing with friends (src/ui-mp.js) ---------- */
.mp { width: min(560px, 100%); }
.mp-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mp-way { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid #6d5226; border-radius: 6px; background: rgba(0, 0, 0, 0.25); }
.mp-way b { font-family: var(--head); color: var(--gold); letter-spacing: 0.04em; }
.mp-way small { color: var(--dim); }
.mp-codein { display: flex; gap: 8px; }
.mp-codein input { width: 5.2em; font: 800 22px var(--head); letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); background: #0f0b07; border: 2px solid #6d5226; border-radius: 4px; padding: 0.2em 0.4em; box-shadow: inset 0 2px 6px #000; }
.mp-code { display: grid; justify-items: center; gap: 2px; padding: 8px; }
.mp-code small { color: var(--dim); font-family: var(--head); letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.mp-code strong { font: 900 clamp(40px, 9vw, 64px) var(--head); color: var(--gold); letter-spacing: 0.22em; padding-left: 0.22em; text-shadow: 0 3px 0 #000, 0 0 18px rgba(255, 209, 0, 0.35); }
.mp-roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mp-roster li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-left: 4px solid var(--hc, #6d5226); background: rgba(0, 0, 0, 0.28); border-radius: 4px; min-width: 0; }
.mp-roster li b { color: var(--hc); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-roster li small { color: var(--dim); }
.mp-roster li em { margin-left: auto; font: 700 11px var(--head); letter-spacing: 0.12em; text-transform: uppercase; color: #1a1206; background: var(--gold); border-radius: 3px; padding: 1px 6px; font-style: normal; }
.mp-roster li i { font-size: 12px; color: var(--dim); }
.mp-roster li.empty { border-left-color: #4a3a26; opacity: 0.6; }
.mp-roster .emb { color: var(--hc); width: 22px; height: 22px; display: inline-grid; place-items: center; }
.mp-heroes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mp-hero { font: 700 13px var(--body); color: var(--hc); background: #0f0b07; border: 1px solid #6d5226; border-radius: 14px; padding: 3px 10px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.mp-hero.on { border-color: var(--hc); box-shadow: 0 0 0 1px var(--hc), 0 0 10px color-mix(in srgb, var(--hc) 45%, transparent); }
.mp-hero svg { width: 14px; height: 14px; }
.mp-err { color: #ff8a6a; margin: 0; min-height: 1.2em; font-weight: 700; }
.mp-err:empty { display: none; }
@media (max-width: 520px) { .mp-ways { grid-template-columns: 1fr; } }
/* friends' frames under your own, and the banner between waves */
#party { position: absolute; top: calc(118px + env(safe-area-inset-top, 0px)); left: 14px; display: grid; gap: 6px; width: 210px; pointer-events: none; }
.pf { display: flex; gap: 8px; align-items: center; background: rgba(12, 8, 4, 0.72); border: 1px solid #5a3b12; border-left: 3px solid var(--hc); border-radius: 4px; padding: 4px 8px; }
.pf .emb { color: var(--hc); width: 18px; height: 18px; display: inline-grid; place-items: center; }
.pf > div { flex: 1; min-width: 0; }
.pf b { color: var(--hc); font-size: 14px; }
.pf small { color: var(--dim); font-size: 12px; }
.pf .bar { height: 7px; margin-top: 3px; }
.pf .bar i { display: block; height: 100%; }
/* down: red, saying how to help (it was greyed out, "down: back next wave"); away: in the pause menu (src/net.js away) */
.pf.down { border-color: #ff3a3a; background: rgba(60, 6, 6, 0.85); animation: pfdown 1s ease-in-out infinite; }
.pf.down .emb, .pf.down .bar { filter: grayscale(1); opacity: 0.6; }
.pf small.dn { display: block; color: #ffb0a0; font-weight: 800; }
@keyframes pfdown { 50% { box-shadow: 0 0 12px #ff3a3a; } }
.pf.away { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .pf.down, #hpbar.low i, #hpbar.low::after, #mpBanner.down { animation: none; } #hpbar.hit { animation: none; } }
#mpBanner { position: absolute; top: calc(70px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); text-align: center; font: 700 17px var(--head); color: var(--gold);
  background: rgba(12, 8, 4, 0.78); border: 1px solid var(--trim); border-radius: 6px; padding: 8px 16px; max-width: min(560px, 90vw); text-shadow: 0 1px 2px #000; pointer-events: none; }
#mpBanner small { display: block; font: 600 14px var(--body); color: var(--ink); margin-top: 2px; }
/* a new land with friends: "Ready for wave 11?" and its button (src/ui-mp.js; Enter says it too) */
#mpBanner #mpReady { pointer-events: auto; margin: 6px auto 2px; display: block; font-size: 16px; }
/* a friend down: red and pulsing until they're up */
#mpBanner.down { color: #ff6a5a; border-color: #ff3a3a; background: rgba(50, 6, 6, 0.85); font-size: 20px; animation: pfdown 1s ease-in-out infinite; }
/* every friend has gone (src/ui-mp.js checkAlone) */
.alonep { width: min(460px, 100%); display: grid; gap: 12px; }
.alonep p { margin: 0; font-size: 15px; line-height: 1.45; }
/* the names over friends' penguins */
.ptag { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 2px; will-change: transform; pointer-events: none; }
.ptag b { font: 700 14px var(--head); text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; }
.ptag i { display: block; width: 48px; height: 5px; background: #200; border: 1px solid #000; border-radius: 2px; overflow: hidden; }
.ptag em { display: block; height: 100%; background: #3ad84a; transform-origin: left; }
.ptag small { font: 700 12px var(--body); color: #c8c8c8; text-shadow: 0 1px 2px #000; }   /* away: in the pause menu */
.ptag small.shopping { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); }   /* between waves */
.ptag small.shopping svg { width: 12px; height: 12px; }

/* ---------- the designer's desk (src/designer.js): ?designer=jacob, missions on the right ---------- */
:root { --desk-w: min(380px, 100vw); --ice: #7fd8ff; }
#deskTab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 31; writing-mode: vertical-rl; display: flex; align-items: center; gap: 8px;
  padding: 14px 7px; background: linear-gradient(90deg, var(--panel-2), var(--panel)); border: 3px solid var(--trim); border-right: 0; border-radius: 8px 0 0 8px;
  color: var(--gold); font: 900 14px var(--head); letter-spacing: 0.1em; cursor: pointer; box-shadow: 0 0 0 2px #000, -6px 6px 18px rgba(0, 0, 0, 0.6); }
#deskTab:hover { filter: brightness(1.2); }
#deskTab.on { visibility: hidden; }
#deskTab .n { writing-mode: horizontal-tb; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center; background: #c3301f; color: #fff; font: 800 13px var(--body); box-shadow: 0 0 0 2px #000; }
#deskTab kbd, #trMission kbd { writing-mode: horizontal-tb; font: 800 11px var(--head); background: #3a2410; color: var(--gold); border-radius: 3px; padding: 1px 5px; box-shadow: 0 2px 0 #1a0e04; }
#trMission { color: var(--ice); font-size: 13px; font-weight: 800; margin-bottom: 3px; }
#desk { position: fixed; top: 0; right: 0; bottom: 0; width: var(--desk-w); z-index: 32; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); border-radius: 7px 0 0 7px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px)); animation: deskIn 0.22s ease-out; }
@keyframes deskIn { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #desk { animation: none; } }
body.desk-open .screen:not(#menu):not(#loading) { padding-right: calc(16px + var(--desk-w)); }
.desk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.desk-head h2 { margin: 0; font: 900 22px var(--head); color: var(--gold); text-shadow: 0 2px 0 #000; text-wrap: balance; }
.desk-close { background: none; border: 0; color: var(--dim); font-size: 22px; padding: 4px; cursor: pointer; border-radius: 4px; }
.desk-close:hover { color: #fff; }
.desk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 8px; }
.desk-tabs button { background: #1a130c; border: 2px solid #5a3b12; border-radius: 6px; padding: 7px 4px; color: var(--dim); font: 700 14px var(--head); letter-spacing: 0.04em; cursor: pointer; }
.desk-tabs button[aria-selected="true"] { border-color: var(--trim); color: var(--gold); background: #2d2217; }
.desk-tabs b { font: 800 12px var(--body); background: #4a3418; color: #fff; border-radius: 9px; padding: 0 6px; margin-left: 3px; }
.desk-body { overflow-y: auto; display: grid; align-content: start; gap: 8px; padding-right: 4px; -webkit-user-select: text; user-select: text; }
.desk-cheer { margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(92, 230, 92, 0.12); border: 1px solid #3f8f3f; color: #b8ffb0; font-weight: 800; }
.desk-empty { margin: 4px 0; color: var(--dim); line-height: 1.45; }
.desk-empty b { color: var(--gold); display: block; font: 900 18px var(--head); margin-bottom: 2px; }
.desk-sub { margin: 10px 0 0; font: 700 13px var(--head); color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; }
.mis { display: grid; gap: 9px; padding: 12px; border-radius: 8px; background: linear-gradient(180deg, #16222b, #121a20); border: 2px solid #3f7f9f; box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5); }
.mis-n { font: 800 12px var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ice); }
.mis h3 { margin: -4px 0 0; font: 900 20px var(--head); color: #fff; text-wrap: balance; }
.mis-ask { margin: 0; font-size: 16px; line-height: 1.4; }
.mis-look { margin: 0; padding-left: 20px; display: grid; gap: 3px; font-size: 15px; color: #d8ecf5; }
.mis-look li::marker { color: var(--ice); }
.mis-setup { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.45); border: 1px solid color-mix(in srgb, var(--c, #b9a987) 60%, #000); color: var(--c, var(--ink)); font-size: 13px; font-weight: 700; }
.mis-go { font-size: 18px; padding: 0.6em 1em; background: linear-gradient(180deg, #2b8fc4, #0f4a72); border-color: #9fe3ff; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 18px rgba(127, 216, 255, 0.35), 0 2px 0 #000; }
.mis-go.sure { background: linear-gradient(180deg, #c3301f, #6b0f08); border-color: #d9aa45; color: var(--gold); box-shadow: none; }
.mis-note-small { margin: 0; color: var(--dim); font-size: 14px; }
.mis-faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.face { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 8px; background: #1a130c; border: 2px solid #5a3b12; color: var(--ink); font: 700 13.5px var(--body); cursor: pointer; line-height: 1.15; }
.face .emo { font-size: 28px; line-height: 1.1; }
.face:hover { border-color: var(--trim); }
.face[aria-pressed="true"] { border-color: var(--gold); background: #3a2a10; color: var(--gold); box-shadow: 0 0 12px rgba(255, 209, 0, 0.35); }
.mis textarea, .idea-new textarea { width: 100%; resize: vertical; min-height: 60px; background: #0f0b07; color: var(--ink); border: 2px solid #5a3b12; border-radius: 6px; padding: 8px; font: 500 15px var(--body); }
.mis textarea:focus, .idea-new textarea:focus { border-color: var(--trim); outline: none; }
.mis-msg { margin: 0; min-height: 1.2em; color: var(--gold); font-weight: 700; font-size: 14px; }
.mis-row { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 7px; background: #1a130c; border: 2px solid #3a2a14; color: var(--ink); font: 700 15px var(--body); cursor: pointer; }
.mis-row:hover { border-color: var(--trim); }
.mis-row span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #16222b; border: 1px solid #3f7f9f; color: var(--ice); font-size: 13px; }
.mis-done { display: flex; gap: 8px; align-items: start; padding: 6px 4px; color: var(--dim); font-size: 14px; }
.mis-done svg { color: #5ce65c; margin-top: 3px; }
.mis-done b { color: var(--ink); }
.mis-done small { display: block; }
.idea-count { margin: 2px 0; font: 700 16px var(--head); color: var(--ink); }
.idea-count b { font: 900 30px var(--display); color: var(--gold); text-shadow: 0 2px 0 #000; margin-right: 4px; vertical-align: -3px; }
.idea-new { display: grid; gap: 6px; padding: 10px; border-radius: 8px; border: 2px dashed #5a3b12; }
.idea-new label { font-weight: 800; }
.idea-new .btn { justify-self: start; }
.ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.idea { display: grid; gap: 4px; padding: 9px 10px; border-radius: 7px; background: #1a130c; border: 1px solid #3a2a14; }
.idea q { font: 800 14px var(--body); color: #fff; quotes: '\201C' '\201D'; overflow-wrap: anywhere; }
.idea .st { justify-self: start; font: 800 12px var(--body); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, #000); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 10px; padding: 1px 8px; }
.idea p { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.35; }
.idea small { color: var(--dim); }
/* frozen moments: Freeze, and the newest three, each a little picture to go back to */
.desk-time { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 6px 8px; margin-top: 10px; padding: 8px; border-radius: 8px; background: linear-gradient(180deg, #13202a, #0d151b); border: 2px solid #2f6580; }
.desk-time .freeze { grid-row: span 2; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 4px; border-radius: 7px; cursor: pointer;
  background: linear-gradient(180deg, #2b8fc4, #0f4a72); border: 2px solid #9fe3ff; color: #fff; font: 900 14px var(--head); letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 14px rgba(127, 216, 255, 0.3); }
.desk-time .freeze .ico { width: 26px; height: 26px; }
.desk-time .freeze:hover:not(:disabled) { filter: brightness(1.15); }
.desk-time .freeze:disabled { background: #1a2329; border-color: #34505e; color: #6f8a96; box-shadow: none; cursor: default; }
.desk-time kbd { font: 800 11px var(--head); background: #0b2433; color: var(--ice); border-radius: 3px; padding: 1px 5px; box-shadow: 0 2px 0 #04121a; }
.crystals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.crystal { position: relative; aspect-ratio: 16 / 10; max-width: 100%; padding: 0; border-radius: 6px; overflow: hidden; cursor: pointer; background: #0b1419; border: 2px solid #4f9fc4; color: #fff; }
.crystal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.75) brightness(0.95); }
.crystal i { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ice); }
.crystal span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 4px; background: linear-gradient(0deg, rgba(4, 18, 26, 0.92), rgba(4, 18, 26, 0)); font: 800 12px var(--body); text-align: left; text-shadow: 0 1px 2px #000; }
.crystal kbd { position: absolute; top: 3px; right: 3px; }
.crystal:hover, .crystal:focus-visible { border-color: #c9f1ff; box-shadow: 0 0 12px rgba(127, 216, 255, 0.5); }
.crystal:hover img { filter: none; }
.crystal.sure { border-color: var(--gold); box-shadow: 0 0 12px rgba(255, 209, 0, 0.45); }
.crystal.sure span { color: var(--gold); }
.crystal.empty { cursor: default; border: 2px dashed #2a4a5a; background: transparent; }
.time-say { margin: 0; font-size: 13px; line-height: 1.3; color: #a9cfdf; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; }
.back-btn kbd { font: 800 11px var(--head); background: #0b2433; color: var(--ice); border-radius: 3px; padding: 1px 5px; }
/* voice notes: Say it out loud, a red Stop while it listens, then the recording to play back */
.voice { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.voice small { color: #ff9a8a; font-weight: 700; font-size: 13px; }
.voice audio { flex: 1 1 180px; min-width: 0; height: 36px; }
.mic { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 18px; cursor: pointer; background: #16222b; border: 2px solid #3f7f9f; color: var(--ice); font: 800 14px var(--body); }
.mic .ico { width: 18px; height: 18px; }
.mic:hover { border-color: #9fe3ff; color: #fff; }
.mic.again { padding: 7px; }
.mic.rec { background: #4a0f0a; border-color: #ff5a45; color: #fff; }
.mic.rec i { width: 11px; height: 11px; border-radius: 50%; background: #ff3b2a; box-shadow: 0 0 8px #ff3b2a; animation: micPulse 1s ease-in-out infinite; }
.mic-t { font-variant-numeric: tabular-nums; color: #ffd0c8; }
.mic-lv { width: 64px; height: 8px; border-radius: 4px; background: #2a1310; overflow: hidden; }
.mic-lv b { display: block; height: 100%; width: calc(var(--lv, 0) * 100%); background: linear-gradient(90deg, #5ce65c, #ffd100 70%, #ff5a45) 0 0 / 64px 100%; transition: width 0.22s linear; }
@keyframes micPulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .mic.rec i { animation: none; } .mic-lv b { transition: none; } }
.mic-x { background: none; border: 0; color: var(--dim); font-size: 18px; padding: 4px; cursor: pointer; border-radius: 4px; }
.mic-x:hover { color: #fff; }

/* ---------- the wave just won, on top of the screens after it (src/ui-between.js ribbon) ---------- */
.ribbon { display: grid; gap: 3px; margin: 0 0 10px; padding: 8px 12px; border-radius: 6px; background: rgba(255, 209, 0, 0.07); border: 1px solid #6d5226; }
.rb-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rb-top .stars { font-size: 24px; letter-spacing: 2px; color: var(--gold); text-shadow: 0 2px 0 #3a1c00, 0 0 12px #ffb020; }
.rb-top .stars i { font-style: normal; display: inline-block; animation: starpop 0.45s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.rb-top .stars i:nth-child(2) { animation-delay: 0.2s; } .rb-top .stars i:nth-child(3) { animation-delay: 0.4s; }
.rb-top .stars i.off { color: #4a3a28; text-shadow: none; }
.rb-title { font: 700 19px var(--head); color: var(--gold); }
.rb-gold { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.rb-line { font-size: 14px; color: #f2e4c8; }
.rb-line em { font-style: normal; color: var(--gold); }
.rb-line .up { color: #4dff5e; }
.rb-line.rb-lost { color: #ffb0a0; }   /* penguins carried off, a camp overrun */
.rb-item svg { width: 14px; height: 14px; vertical-align: -2px; }
.rb-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.rb-lbl { font: 700 12px var(--head); letter-spacing: 0.06em; color: var(--dim); }
.rb-tile { display: grid; grid-template-columns: auto auto; column-gap: 7px; align-items: center; padding: 3px 9px 3px 3px; border: 1px solid var(--rc); border-radius: 6px;
  background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 10px color-mix(in srgb, var(--rc) 22%, transparent); }
.rb-tile .rb-ico { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; color: var(--rc); background: rgba(255, 255, 255, 0.06); }
.rb-tile .rb-ico .ico { width: 20px; height: 20px; }
.rb-tile .rb-tn { font: 700 13px/1.15 var(--body); color: var(--rc); white-space: nowrap; }
.rb-tile .up, .rb-tile .dim, .rb-new { font: 800 11px/1.2 var(--body); justify-self: start; }
.rb-tile .up { color: #4dff5e; }
.rb-new { padding: 0 5px; border-radius: 3px; background: #7fe6ff; color: #1a1206; letter-spacing: 0.06em; }
.rb-tile.sold { opacity: 0.55; }
.rb-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rb-chip { padding: 1px 8px; border-radius: 10px; background: rgba(127, 216, 255, 0.12); border: 1px solid rgba(127, 216, 255, 0.35); color: #cdeeff; font-size: 13px; }
.rb-dot { font-style: normal; font-size: 0; }
.rb-next { color: var(--dim); font-size: 13.5px; margin-top: 2px; }
.newtag { font: 800 10px var(--body); letter-spacing: 0.06em; color: #1a1206; background: #7fe6ff; border-radius: 3px; padding: 0 4px; }
@media (prefers-reduced-motion: reduce) { .rb-top .stars i { animation: none; } }

/* ---------- your gear: each piece with its own upgrade; a gold ▲ means you can make it better now ---------- */
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid #4a3818; margin: -2px 0 2px; }
.ptab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font: 700 13px var(--body); padding: 4px 10px 6px; cursor: pointer; }
.ptab:hover { color: var(--ink); }
.ptab.on { color: var(--gold); border-bottom-color: var(--gold); }
.ptab:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.attacks2 { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: stretch; }
.attacks2 .wslot { cursor: default; padding: 8px 6px; gap: 3px; min-height: 0; }
.attacks2 .wslot[data-tip] { cursor: help; } .attacks2 .wslot .wi { font-size: 30px; } .attacks2 .wslot .wi svg { width: 30px; height: 30px; }
.attacks2 .wslot .wn { font-size: 14px; }
.attacks2 .wslot .wt { font-size: 12px; }
.attacks2 .wslot .btn.up { margin-top: 4px; width: 100%; justify-content: center; }
.forgelock { margin-top: 6px; font: 700 12px/1.25 var(--body); color: #b8ab92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }   /* a rarity the forge can't make yet (src/ui-between.js upgradeButton) */
.forgelock .ico { width: 12px; height: 12px; vertical-align: -1px; }
.attacks2 .wslot.can { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 209, 0, 0.35); }
.upgain { color: #1eff00; font-size: 11.5px; font-weight: 700; }   /* what an upgrade gives (src/ui-between.js upgradeGain) */
.wslot .btn.up.can, .wactions .btn.up.can { animation: combpulse 1.4s ease-in-out infinite; border-color: var(--gold); }
.swapsides { align-self: center; width: 30px; height: 30px; border-radius: 50%; background: #1a1510; border: 1px solid #6d5226; color: #d8c8a8; font-size: 16px; cursor: pointer; }
.swapsides:hover { color: var(--gold); border-color: var(--gold); }
.upmark { position: absolute; top: 2px; right: 4px; color: var(--gold); font-size: 14px; line-height: 1; text-shadow: 0 0 6px rgba(255, 190, 0, 0.9); }
.tbag .trink { width: 48px; height: 52px; padding-bottom: 12px; font-size: 22px; }
.tbag .trink svg { width: 24px; height: 24px; }
.trink .lv { position: absolute; left: 0; right: 0; bottom: 1px; font: 700 10.5px var(--body); color: #e8dcc0; text-align: center; }
.trink.can { box-shadow: 0 0 10px rgba(255, 209, 0, 0.45); }
.trink.sel.can { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(255, 209, 0, 0.55); }
.trink .upmark { top: 1px; right: 2px; font-size: 12px; }
.trink .newtag { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); }
.tbag .trink.empty { width: 48px; height: 52px; }
@media (prefers-reduced-motion: reduce) { .wslot .btn.up.can { animation: none; } }

/* ---------- what's for sale: an upgrade for you glows, what isn't for you is dimmed ---------- */
.offer.is-up { box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.06), 0 0 0 1px #000, 0 0 16px rgba(255, 209, 0, 0.35); }
.offer.is-no { opacity: 0.62; }
.offer.is-no:hover { opacity: 0.9; }
.fit.up { border-left-color: #ffd100; color: #ffe27a; font-weight: 700; }
.fit.no { border-left-color: #6a5a48; color: #b8ab96; }
/* a new weapon: the attack each button replaces, by name (in the body face: the buttons' capitals cut them short) */
.offer .swaps { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.offer .swaps .swapbtn { display: flex; align-items: center; gap: 5px; justify-content: center; min-width: 0; min-height: 32px; padding: 0.25em 0.45em; font: 800 13.5px var(--body); letter-spacing: 0; color: #fff3d6; }
.offer .swaps .swapbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 0 #000; }

/* ---------- a full bag: which trinket to give up (src/ui-between.js openSwap) ---------- */
.swapp { width: min(900px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; gap: 10px; }
.swapnew { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--rc); background: color-mix(in srgb, var(--rc) 10%, #120e0a); box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 30%, transparent); }
.swapnew > div, .swapopt .so-main { display: grid; gap: 4px; min-width: 0; }
.swapp .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.swapp .chip { font: 700 12.5px var(--body); color: #b9f5a8; background: rgba(30, 255, 0, 0.07); border: 1px solid rgba(30, 255, 0, 0.25); border-radius: 10px; padding: 1px 8px; }
.swapp .chip.neg { color: #ffb49a; background: rgba(255, 90, 40, 0.08); border-color: rgba(255, 90, 40, 0.3); }
.swapp .what { font-size: 13px; color: #e8dcc0; }
.swapp .fit { margin-top: 0; }
.swaplist { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
.swapopt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 6px; border: 1px solid #4a3a28; background: #15110c; color: var(--ink); font: inherit; cursor: pointer; }
.swapopt:hover:not([disabled]), .swapopt:focus-visible { border-color: #ff8a5a; background: #22150f; outline: none; box-shadow: 0 0 0 1px #000, 0 0 12px rgba(255, 110, 60, 0.35); }
.swapopt[disabled] { opacity: 0.5; cursor: not-allowed; }
.swapopt.sug { border-color: #8a6a3a; }
.so-act { display: grid; justify-items: end; gap: 4px; font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.so-act b { font: 800 13px var(--head); color: #ffb49a; padding: 3px 10px; border-radius: 4px; border: 1px solid #7a3a22; background: #2a140c; }
.swapopt:hover:not([disabled]) .so-act b, .swapopt:focus-visible .so-act b { color: #fff; background: #8a3418; border-color: #ff8a5a; }
.sugtag { display: inline-block; font: 800 10.5px var(--body); letter-spacing: 0.05em; text-transform: uppercase; color: #1a1206; background: var(--gold); border-radius: 3px; padding: 1px 5px; vertical-align: 1px; }
@media (max-width: 520px) { .swapopt { grid-template-columns: auto minmax(0, 1fr); } .so-act { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; } }

/* ---------- the level-up the autopilot would take, Shop for me, Report a Bug between waves ---------- */
.choice { position: relative; }
.choice.sug { box-shadow: 0 0 0 1px #000, 0 0 16px rgba(255, 209, 0, 0.35); }
.choice > .sugtag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); }
/* the shop's one Suggested buy (src/ui-between.js sug): an offer, an attack's upgrade, a trinket's level */
.offer.sug, .attacks2 .wslot.sug, .tbag .trink.sug { box-shadow: 0 0 0 1px #000, 0 0 16px rgba(255, 209, 0, 0.45); border-color: var(--gold); }
.offer.sug { position: relative; }
.offer > .sugtag, .wslot > .sugtag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 1; }
.rb-did { margin-top: 4px; padding: 5px 9px; border-radius: 4px; border-left: 3px solid #1eff00; background: rgba(30, 255, 0, 0.06); color: #b9f5a8; font-size: 13.5px; }
.foot-row .bugbtn { margin-right: auto; }
.foot-row .bugbtn, .btns .bugbtn { opacity: 0.75; }
.bugbtn:hover, .bugbtn:focus-visible { opacity: 1; }
.rb-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }

/* ---------- friends: at the screen's edge when out of sight, red when down (src/markers.js friends) ---------- */
.wmark.friend { --mi: #10141c; }
.wmark.friend .wm-label { color: #fff; }
.wmark.friend.down { --mc: #ff3a3a; --mi: #3a0606; }
.wmark.friend.down .wm-mark { animation: gpbob 0.6s ease-in-out infinite; }
.wmark.friend.down .wm-label { font-size: 15px; color: #ffd0c8; }
.wmark.friend.down.edge .wm-arrow { font-size: 40px; animation: fdarrow 0.6s ease-in-out infinite; }   /* off screen: a big arrow their way */
@keyframes fdarrow { 50% { opacity: 0.45; } }
/* the treasure with monsters at it, the hero away: red and loud wherever it is, its light under it (src/markers.js treasureMark) */
/* the inn's smith while there's an upgrade to buy (src/inn.js forgeMark) */
.wmark.smith { --mc: #ffa040; --mi: #2a1404; }
.wmark.smith .wm-mark { animation: gpbob 1.1s ease-in-out infinite; }
.wmark.thanks { --mc: #ffd100; --mi: #2a2204; }
.wmark.thanks .wm-mark { animation: gpbob 0.9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .wmark.smith .wm-mark, .wmark.thanks .wm-mark { animation: none; } }
.wmark.guard { --mc: #ff4a2a; --mi: #3a0806; z-index: 2; }
.wmark.guard .wm-mark { width: 46px; height: 46px; animation: gpbob 0.5s ease-in-out infinite; box-shadow: 0 0 0 3px var(--mi), 0 0 22px 4px var(--mc); }
.wmark.guard .wm-mark .ico { width: 26px; height: 26px; }
.wmark.guard .wm-label { font: 900 21px var(--head); color: #fff; text-shadow: 0 0 3px #a00, 0 1px 2px #000, 0 0 10px #f20; letter-spacing: 0.02em; }
.wmark.guard .wm-bar, .wmark.guard.edge .wm-bar { display: block; width: 140px; height: 11px; }
.wmark.guard.edge .wm-arrow { font-size: 56px; animation: fdarrow 0.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .wmark.guard .wm-mark, .wmark.guard.edge .wm-arrow { animation: none; } }
#raidwarn.red { color: #ff5a4a; font-size: clamp(19px, 2.8vw, 30px); }

/* the fallen wave again (src/main.js waveAgain): its price under it */
#againBtn small { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 700; opacity: 0.9; text-transform: none; letter-spacing: 0; }
#againBtn small svg { width: 13px; height: 13px; color: var(--gold); }
/* a stat's one-line meaning on its level-up card (src/data.js STATS short) */
.choice .short { font-size: 12.5px; margin: 2px 0 4px; }

/* ---------- Gizzlefix before the boss: his line, and his supplies for the fight (src/ui-between.js supplyCard) ---------- */
.rb-merchant { color: #ffe9b0; font-style: italic; font-size: 14px; }
.pane .sup-head { margin: 0 0 6px; }
.supplies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.supply-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 6px; align-items: start; padding: 8px 10px;
  background: linear-gradient(180deg, #24301f, #141b10 80%); border: 1px solid color-mix(in srgb, var(--rc) 45%, #2a3a1c); border-left: 3px solid var(--rc); border-radius: 4px; }
.supply-card .tip-ico { width: 38px; height: 38px; grid-row: 1 / 3; color: var(--rc); background: radial-gradient(circle at 40% 35%, #34402a, #0e1309); box-shadow: 0 0 0 1px #000; }
.supply-card .tip-ico svg { width: 24px; height: 24px; }
.supply-card .sc-main { min-width: 0; font-size: 14px; }
.supply-card .what { font-size: 13px; line-height: 1.3; color: #e2e8cf; margin-top: 2px; }
.supply-card .buy { grid-column: 2; justify-self: start; }
.supply-card.full { opacity: 0.75; }

/* the action bar's supplies: a Fish Snack (H) with how many are left, Bonk Oil on for the boss */
.slot.supply { margin-left: 4px; box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 40%, transparent); color: var(--rc); }
.slot.supply .sn { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font: 800 11px var(--body); color: #fff; text-shadow: 0 1px 2px #000; }

/* ---------- the breather between two waves with no shop: the wave's ribbon over the world (src/ui-hud.js) ---------- */
#waveDone { position: absolute; left: 50%; top: 92px; translate: -50% 0; width: min(560px, calc(100vw - 32px)); padding: 10px 12px 8px; border-radius: 8px;
  background: rgba(20, 13, 6, 0.86); border: 1px solid #8a6a2e; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); pointer-events: none; animation: wdIn 0.35s ease-out; }
#waveDone .ribbon { margin: 0; background: none; border: 0; padding: 0; }
#waveDone .wd-next { margin-top: 6px; text-align: center; font: 700 15px var(--head); color: #ffd84a; letter-spacing: 0.02em; }
#waveDone.out { opacity: 0; transition: opacity 0.6s ease 1.8s; }
@keyframes wdIn { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { #waveDone { animation: none; } #waveDone.out { transition: none; } }

/* ---------- the inn on the road into a land (src/inn.js): its sign hung over the top of the screen, and its kitchen ---------- */
#innBar { position: absolute; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); translate: -50% 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 12px; width: max-content; max-width: min(640px, calc(100vw - 636px)); padding: 6px 8px 6px 14px; border-radius: 8px;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0) 0 9px, rgba(0, 0, 0, 0.12) 9px 10px), linear-gradient(180deg, #6a4422, #3e2612);
  border: 2px solid #d9aa45; box-shadow: 0 0 0 2px #000, 0 8px 22px #000a, inset 0 1px 0 #a87a44; text-shadow: 0 1px 2px #000; pointer-events: none; animation: ibSwing 0.9s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 50% -16px; }
/* the two chains it hangs from */
#innBar::before, #innBar::after { content: ''; position: absolute; top: -18px; width: 3px; height: 18px; background: repeating-linear-gradient(#d9c08a 0 4px, #6a5430 4px 6px); }
#innBar::before { left: 18%; } #innBar::after { right: 18%; }
#innBar .ib-sign { display: grid; line-height: 1.05; text-align: center; }
#innBar .ib-sign small { font: 700 10px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: #e8c98a; }
#innBar .ib-sign b { font: 900 19px var(--head); color: var(--gold); white-space: nowrap; }
#innBar .ib-do { display: grid; gap: 1px; font: 600 13.5px var(--body); color: var(--ink); min-width: 0; }
#innBar .ib-do .ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }
#innBar .ib-do i { font-style: normal; font-weight: 800; }
#innBar .ib-do em { font-style: normal; font-weight: 800; color: #bfe8ff; margin-left: 4px; }
#innMenu kbd { font: 700 11px var(--body); color: var(--ink); background: #2a2018; border: 1px solid #6d5226; border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
#innBar .ib-wait { font: 700 14px var(--head); color: #ffd84a; }
#innBar:not([hidden]) ~ #mpBanner { top: calc(104px + env(safe-area-inset-top, 0px)); }
#innBar:not([hidden]) ~ #landTitle { top: calc(22% + 96px); }   /* (the land's name under the inn's sign, not behind it) */
/* (between the hero's frame and the map at the top, where there's room; on a narrower screen, low in the middle) */
@media (max-width: 1000px) {
  #innBar { top: auto; bottom: calc(190px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 32px); }
  #innBar::before, #innBar::after { display: none; }
  #innBar:not([hidden]) ~ #mpBanner { top: calc(70px + env(safe-area-inset-top, 0px)); }
  #innBar:not([hidden]) ~ #landTitle { top: 22%; }
}
@keyframes ibSwing { 0% { opacity: 0; rotate: -7deg; } 40% { opacity: 1; rotate: 4deg; } 70% { rotate: -2deg; } 100% { rotate: 0deg; } }
#innMenu { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: auto; z-index: 29;
  background: radial-gradient(ellipse at center, rgba(10, 6, 2, 0.3), rgba(10, 6, 2, 0.7)); animation: lsfade 0.25s ease-out; }
#innMenu .im-card { width: min(620px, 100%); display: grid; gap: 10px; justify-items: center; text-align: center; padding: 18px 22px 16px;
  color: #3a2410; background: linear-gradient(#f8ecd0, #ead5a8); border: 3px solid #8a6a3a; border-radius: 10px;
  box-shadow: 0 0 0 3px #2a1a08, 0 18px 40px #000c, inset 0 0 22px #c9a86a; animation: lsdrop 0.4s cubic-bezier(.2, 1.4, .4, 1); }
#innMenu .im-inn { font: 700 12px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: #8a5a20; }
#innMenu h2 { margin: 0; font: 900 clamp(22px, 4vw, 28px) var(--head); color: #4a1e06; text-wrap: balance; line-height: 1.05; }
#innMenu .im-sub { margin: 0; font-size: 15px; color: #5a3a1a; max-width: 46ch; }
#innMenu .im-meals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
#innMenu .im-meal { position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; padding: 12px 8px 10px; cursor: pointer; font: inherit; color: #3a2410;
  background: #fff8e6; border: 2px solid #c9a86a; border-radius: 8px; box-shadow: 0 2px 0 #a8875a; transition: translate 0.12s, box-shadow 0.12s, border-color 0.12s; }
#innMenu .im-meal:hover, #innMenu .im-meal:focus-visible { translate: 0 -2px; border-color: var(--mc); box-shadow: 0 4px 0 #a8875a, 0 0 0 3px color-mix(in srgb, var(--mc) 35%, transparent); }
#innMenu .im-meal.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, #fff8e6); }
#innMenu .im-meal.on::after { content: 'Eating'; position: absolute; top: -10px; right: 8px; padding: 1px 8px; font: 800 11px var(--head); letter-spacing: 0.08em; color: #2a1a08; background: var(--mc); border: 2px solid #2a1a08; border-radius: 99px; }
#innMenu .im-ico { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: #2a1a08; color: var(--mc); box-shadow: 0 0 0 3px var(--mc), 0 0 14px color-mix(in srgb, var(--mc) 55%, transparent); }
#innMenu .im-ico .ico { width: 26px; height: 26px; }
#innMenu .im-meal b { font: 800 16px var(--head); line-height: 1.1; color: #4a1e06; text-wrap: balance; }
#innMenu .im-text { font-size: 14px; line-height: 1.25; color: #4a3218; }
#innMenu .im-meal kbd { position: absolute; top: 6px; left: 6px; margin: 0; }
#innMenu .im-no { font-size: 15px; }
/* the smith's forge (src/inn.js renderForge): one row a weapon, its rarity now and next, what it gives, its price */
#innMenu .im-ups { display: grid; gap: 8px; width: 100%; }
#innMenu .im-up { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; cursor: pointer;
  font: inherit; color: #3a2410; text-align: left; background: #fff8e6; border: 2px solid #c9a86a; border-radius: 9px; box-shadow: 0 3px 0 #a8875a; transition: translate 0.12s, box-shadow 0.12s, border-color 0.12s; }
#innMenu .im-up .im-ico { width: 44px; height: 44px; background: #2a1a08; color: var(--rc); box-shadow: 0 0 0 3px var(--rc), 0 0 12px color-mix(in srgb, var(--rc) 50%, transparent); }
#innMenu .im-up .im-ico .ico { width: 22px; height: 22px; }
#innMenu .im-w { display: grid; gap: 1px; min-width: 0; }
#innMenu .im-w b { font: 800 16px var(--head); color: #4a1e06; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#innMenu .im-to { font: 700 13.5px var(--body); color: #5a3a1a; }
#innMenu .im-to i { font-style: normal; color: color-mix(in srgb, var(--rc) 55%, #3a2410); }
#innMenu .im-to em { font-style: normal; font-weight: 900; color: color-mix(in srgb, var(--rn) 45%, #2a1408); }
#innMenu .im-why { font-size: 13px; color: #7a5a3a; }
#innMenu .im-why .ico { width: 13px; height: 13px; vertical-align: -2px; }
#innMenu .im-up.can .im-why { font-weight: 800; color: #2e7a1e; }
#innMenu .im-price { font: 900 17px var(--head); color: #6a4a10; white-space: nowrap; }
#innMenu .im-up:not(.can) { opacity: 0.72; cursor: default; box-shadow: 0 2px 0 #a8875a; }
#innMenu .im-up.can:hover, #innMenu .im-up.can:focus-visible { translate: 0 -2px; border-color: var(--rn); box-shadow: 0 5px 0 #a8875a, 0 0 0 3px color-mix(in srgb, var(--rn) 40%, transparent); }
#innMenu .im-up kbd { position: absolute; top: 6px; left: 6px; margin: 0; }
#innMenu .im-gold { margin: 0; font: 800 15px var(--head); color: #6a4a10; }
#innBar .ib-do .ib-can { color: #ffd84a; }
@media (max-width: 520px) { #innMenu .im-up { grid-template-columns: auto minmax(0, 1fr); } #innMenu .im-price { grid-column: 2; } #innMenu .im-meals { grid-template-columns: 1fr; } #innMenu .im-meal { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 10px; } #innMenu .im-ico { grid-row: 1 / 3; } }
@media (prefers-reduced-motion: reduce) { #innBar, #innMenu, #innMenu .im-card { animation: none; } #innMenu .im-meal, #innMenu .im-up { transition: none; } }
