/* Brinelight — styles */
:root {
  /* Wren's pictures share a 400x600 canvas whose top 40 px are empty (room for the diving helmet). Each box that
     shows her is sized for the 560 px below that, and the picture overflows it upward (tools/wren-art.py). */
  --wren-tall: 1.0714;
  --ink: #050f18;
  --deep: #0a1d2b;
  --sea: #123548;
  --teal: #2b8090;
  --foam: #d4ece8;
  --brass: #c9a24a;
  --brass-dim: #8a6d2c;
  --amber: #ffb84d;
  --coral: #e2694c;
  --kelp: #3fae8a;
  --violet: #9a7ad8;
  --hp: #d8455a;
  --ward: #5fb6ea;
  --text: #e9f2ef;
  --muted: #93b2b6;
  --good: #8fe3a8;
  --bad: #ff8a7a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cw: 140px;
  --ch: calc(var(--cw) * 1.4);
  --hud-h: 50px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--sans); }
body { overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }
#app { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#screen { position: absolute; inset: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- generic UI ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 44px; padding: .55em 1.2em; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(201, 162, 74, .55);
  background: linear-gradient(180deg, #1d4256, #10283a);
  color: var(--text); font-weight: 650; letter-spacing: .02em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .12s, filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.primary {
  background: linear-gradient(180deg, #f2b34b, #b8741c); color: #2a1504; border-color: #ffe0a0;
  box-shadow: 0 2px 0 #5a3408, 0 0 18px rgba(255, 184, 77, .25);
}
.btn.ghost { background: rgba(10, 29, 43, .6); }
.btn.small { min-height: 36px; padding: .35em .8em; font-size: .9em; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
  background: rgba(10, 29, 43, .7); border: 1px solid rgba(201, 162, 74, .35);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { filter: brightness(1.25); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.kw { color: var(--amber); font-weight: 700; }
.kw.k-surge { color: #7fd9ff; }
.kw.k-ebb { color: #9fc4ff; }
.kw.k-crest, .kw.k-strand { color: #b9f0ff; }
.calc { color: var(--good); font-weight: 700; }
.num-up { color: var(--good); }
.num-down { color: var(--bad); }

/* ---------- HUD ---------- */
.hud {
  position: relative; z-index: 20; height: var(--hud-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 0 10px;
  padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right));
  background: linear-gradient(180deg, rgba(4, 12, 19, .95), rgba(6, 18, 28, .85));
  border-bottom: 1px solid rgba(201, 162, 74, .35);
}
.hud .stat { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.hud .stat svg { width: 20px; height: 20px; flex: 0 0 auto; }
.hud .stat.hp { color: #ffb3bd; }
.hud .stat.hp { font-size: 16px; }
.hud .stat.pearls { color: #e6dcc6; font-weight: 600; font-size: 14px; }
.hud .stat.pearls svg, .hud .stat.floor svg { width: 17px; height: 17px; }
.hud .stat.floor { color: var(--muted); font-weight: 600; font-size: 14px; }
.hud.in-combat .stat.hp { display: none; }
.hud .medal.empty { opacity: .45; border-width: 1px; }
.hud .keepsakes { display: flex; gap: 3px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.hud .keepsakes::-webkit-scrollbar { display: none; }
.hud .tonics { display: flex; gap: 3px; }
.hud .spacer { flex: 1; }
.medal {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; cursor: pointer; padding: 0; position: relative;
  background: radial-gradient(circle at 50% 40%, #1f4a5e, #0b1f2c 70%); border: 2px solid var(--brass-dim);
  overflow: hidden; display: grid; place-items: center;
}
.medal img { width: 100%; height: 100%; object-fit: cover; }
.medal.empty { border-style: dashed; border-color: rgba(201, 162, 74, .3); background: rgba(10, 29, 43, .5); cursor: default; }
.medal.flash { animation: medalFlash .9s ease; }
@keyframes medalFlash { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 3px var(--amber), 0 0 16px var(--amber); } }
.tonic-slot.selected { border-color: var(--amber); box-shadow: 0 0 10px var(--amber); }

/* ---------- Title ---------- */
/* auto margins on the logo and the foot centre the content when it fits and let it scroll from the top when it doesn't */
.title-screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; overflow-y: auto;
  background: #06121c url(img/bg/bg_title.webp) center/cover no-repeat; text-align: center; padding: 24px 24px 12px;
}
.title-screen.lit { background-image: url(img/bg/bg_title_lit.webp); }
/* on a tall screen the picture is cropped to a strip; show the lighthouse and the keeper, not the middle of the sea */
@media (max-aspect-ratio: 1/1) { .title-screen { background-position: 22% center; } }
.title-screen .logo { margin-top: auto; }
.title-screen::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(5, 15, 24, .15), rgba(5, 15, 24, .85) 75%); }
.title-screen > * { position: relative; }
.logo {
  font-family: var(--serif); font-size: clamp(44px, 10vw, 104px); letter-spacing: .08em; line-height: 1;
  color: #ffe9bd; text-shadow: 0 0 24px rgba(255, 184, 77, .55), 0 3px 0 #5b3a0d, 0 6px 22px rgba(0, 0, 0, .7);
}
.tagline { margin: 14px auto 30px; max-width: 34em; font-family: var(--serif); font-size: clamp(15px, 2.1vw, 19px); color: #cfe4e2; line-height: 1.5; text-shadow: 0 2px 8px #000; }
.title-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(360px, 86vw); }
.title-buttons .btn { font-size: 18px; min-height: 52px; }
.title-buttons .btn:not(.ghost) { grid-column: 1 / -1; }
.title-buttons .btn.ghost { font-size: 17px; padding-left: .5em; padding-right: .5em; }
/* three levels: Continue and New Descent first, the Workshop and the Lazaret second, reading and help third */
.title-buttons .btn.second { min-height: 46px; font-size: 16px; }
.title-buttons .btn.third { min-height: 40px; font-size: 15px; font-weight: 600; color: #c4dad8; background: transparent; border-color: transparent; box-shadow: none; text-shadow: 0 1px 6px #000; }
.title-buttons .btn.third:hover, .title-buttons .btn.third:focus-visible { color: #ffe9bd; border-color: rgba(212, 236, 232, .35); background: rgba(5, 15, 24, .45); filter: none; }
@media (pointer: coarse) { .title-buttons .btn.third { min-height: 44px; } }
.title-foot { margin-top: auto; padding-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; font-size: 13px; color: rgba(212, 236, 232, .65); }
.title-foot > span { text-wrap: balance; }
.title-version { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px; border-radius: 18px; border: 1px solid rgba(212, 236, 232, .25);
  background: rgba(5, 15, 24, .55); color: #d4ece8; font: inherit; font-size: 13px; cursor: pointer; }
.title-version:hover, .title-version:focus-visible { border-color: rgba(255, 184, 77, .7); color: #ffe9bd; }
.tab.on .new-pill { background: #2a1504; color: #f2c46b; }
.new-pill { padding: 1px 7px; border-radius: 9px; background: #f2c46b; color: #2a1504; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.title-buttons .btn.span { grid-column: 1 / -1; }
/* the third level flows in centred rows, so five fit in two rows on a phone */
.title-third { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.title-third .btn { flex: 0 1 auto; }
/* the smaller buttons sit two to a row at every size, so seven buttons fit; narrow phones get tighter ones */
@media (max-width: 480px) {
  .title-screen .tagline { margin-bottom: 20px; }
  .title-buttons { gap: 10px; width: min(340px, 100%); }
  .title-buttons .btn.second { font-size: 16px; min-height: 48px; }
}
/* landscape phones: a smaller logo and lower buttons */
@media (max-height: 500px) {
  .title-screen { padding-top: 12px; }
  .title-screen .logo { font-size: clamp(36px, 7vw, 60px); }
  .title-screen .tagline { margin: 8px auto 14px; font-size: 15px; }
  .title-buttons { gap: 8px; width: min(460px, 86vw); }
  .title-buttons .btn, .title-buttons .btn.second { min-height: 44px; font-size: 16px; }
  .title-buttons .btn.third, .title-buttons { row-gap: 4px; }
  .title-buttons .btn.third { min-height: 40px; }
  /* Continue and New Descent share a row here; New Descent alone still spans */
  .title-buttons .btn:not(.ghost) { grid-column: auto; }
  .title-buttons .btn.solo { grid-column: 1 / -1; }
  .title-best { margin-top: 10px; }
  .title-foot { padding-top: 10px; }
}
/* What's new */
.changelog h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-size: 18px; color: #f3dfb2; }
.changelog h3 small { font-size: 13px; font-weight: 500; color: var(--muted); }
.changelog section + section { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(201, 162, 74, .18); }
.menu-version { margin: 12px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.title-foot > .title-pills { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* Credits */
.credits section + section { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(201, 162, 74, .18); }
.credits h3 { margin: 0 0 6px; font-size: 18px; color: #f3dfb2; }
.credits p { margin: 6px 0; font-size: 16px; line-height: 1.5; color: #d6e3e0; }
.credits a { color: #8fd3e6; text-decoration: underline; text-underline-offset: 2px; }
.credits a:hover, .credits a:focus-visible { color: #ffe9bd; }
.title-corner { position: absolute; top: 12px; right: 12px; }
/* the song playing, opposite the menu (drawNow); it opens the Jukebox */
.title-now { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 92px); display: flex; }
.title-now .now-btn { max-width: 100%; gap: 7px; padding-left: 10px; }
.title-now .now-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-now .now-btn svg { flex: none; width: 16px; height: 16px; color: #f2c46b; }
/* landscape phones have the logo at the top: the song's name stops short of it (the logo is about 6.8em wide) */
@media (max-height: 500px) { .title-now { max-width: calc(50% - 3.5 * clamp(36px, 7vw, 60px) - 20px); } }

/* ---------- Layout for run screens ---------- */
.run-screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--ink); }
.run-body { position: relative; flex: 1; min-height: 0; }

/* ---------- Map ---------- */
.map-screen .run-body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(43, 128, 144, .25), transparent 60%),
    repeating-linear-gradient(0deg, rgba(212, 236, 232, .035) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(212, 236, 232, .035) 0 1px, transparent 1px 48px),
    linear-gradient(180deg, #0a2232, #071722 70%, #06121c);
}
/* the level's picture behind the map (v0.40.0): fixed while the map scrolls, dimmed so the paths and stops stay first */
.map-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.map-bg::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse 70% 60% at 50% 45%, rgba(4, 16, 24, .58), rgba(4, 14, 22, .74)),
  linear-gradient(180deg, rgba(4, 14, 22, .25), rgba(4, 14, 22, 0) 30%, rgba(4, 14, 22, 0) 80%, rgba(4, 14, 22, .3)); }
.map-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
/* sticky over the scrolling map: solid behind the text, fading out only below it, so nodes never show through the words */
.map-header { position: sticky; top: 0; z-index: 3; text-align: center; padding: 10px 12px 22px; background: linear-gradient(180deg, rgba(8, 32, 46, .94), rgba(7, 28, 41, .88) calc(100% - 20px), rgba(7, 28, 41, 0)); pointer-events: none; }.map-header h2 { font-size: 20px; color: #f1dfb6; }
.map-header p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.map { position: relative; margin: 0 auto; width: min(560px, 100%); }
.map svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.map .lines path { fill: none; stroke: rgba(212, 236, 232, .28); stroke-width: 2.5; stroke-dasharray: 5 7; vector-effect: non-scaling-stroke; }
.map .lines path.walked { stroke: var(--amber); stroke-dasharray: none; stroke-width: 3; opacity: .85; }
.map .lines path.open { stroke: rgba(255, 220, 160, .7); }
.node {
  position: absolute; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: default; border: 2px solid rgba(212, 236, 232, .35);
  background: radial-gradient(circle at 50% 35%, #1b4458, #0b1e2b); color: #cfe3e0;
  transition: transform .15s, box-shadow .15s;
}
.node svg { width: 26px; height: 26px; }
.node.t-elite { border-color: #e26a5a; color: #ffb0a2; width: 52px; height: 52px; }
.node.t-rest { color: #ffcf7a; }
.node.t-pocket { color: #9fe3e0; }
.node.t-shop { color: #f3e2b5; }
.node.t-event { color: #b5e6ff; }
.node.t-treasure { color: #ffd76a; }
.node.t-boss { width: 86px; height: 86px; border: 3px solid #e2b04a; background: radial-gradient(circle, #3b2a10, #120b03); color: #ffd98a; }
.node.t-boss svg { width: 48px; height: 48px; }
.node.visited { opacity: .55; background: #0b1820; }
.node.current { opacity: 1; box-shadow: 0 0 0 4px rgba(255, 184, 77, .55); }
.node.avail { cursor: pointer; border-color: var(--amber); animation: nodePulse 1.6s ease-in-out infinite; }
.node.avail:hover, .node.avail:focus-visible { transform: translate(-50%, -50%) scale(1.15); }
.node.avail.kbd { outline: 3px solid #fff; outline-offset: 3px; }
.node.locked { opacity: .5; }
@keyframes nodePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 184, 77, .55); } 50% { box-shadow: 0 0 0 8px rgba(255, 184, 77, 0); } }
.map-legend {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted);
  background: linear-gradient(0deg, rgba(5, 15, 24, .95), rgba(5, 15, 24, .7) 70%, transparent);
}
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-legend svg { width: 16px; height: 16px; }
.map-boss-label { position: absolute; transform: translate(-50%, 0); font-family: var(--serif); color: #f1d08a; font-size: 14px; white-space: nowrap; text-shadow: 0 2px 6px #000; pointer-events: none; }
.map-boss-label.avail { color: #ffe2a8; font-size: 16px; font-weight: 700; }

/* ---------- Combat ---------- */
.combat-screen .run-body { display: flex; flex-direction: column; }
.field {
  position: relative; flex: 1; min-height: 0; overflow: hidden; container-type: size; container-name: field;
  background: #0a2030 url(img/bg/bg_battle.webp) center 65%/cover no-repeat;
}
.field.boss { background-image: url(img/bg/bg_shallows_boss.webp); }
/* Dark Water has its own chamber and its own lock for the pin */
.field.band-dark { background-image: url(img/bg/bg_dark.webp); }
.field.band-dark.boss { background-image: url(img/bg/bg_dark_boss.webp); }
/* the Shallows are open air on the foreshore and the Hermit holds its basin full above the tide; the Belfry is under the sea, and its boss hangs over the Heart's glow */
.field.band-shallows.boss { background-image: url(img/bg/bg_shallows_boss.webp); }
.field.band-belfry { background-image: url(img/bg/bg_belfry.webp); }
.field.band-belfry.boss { background-image: url(img/bg/bg_belfry_boss.webp); }
.field::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(5, 15, 24, .25), transparent 30%, transparent 70%, rgba(5, 15, 24, .55)); }
.sea {
  position: absolute; left: -5%; right: -5%; bottom: 0; z-index: 1; pointer-events: none;
  height: calc(8% + var(--tide, 3) * 6.5%); transition: height .7s cubic-bezier(.3, 1.4, .5, 1);
  background: linear-gradient(180deg, rgba(64, 170, 190, .30), rgba(10, 50, 70, .55));
  border-top: 2px solid rgba(190, 240, 250, .35);
}
.sea::before {
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 14px;
  background: radial-gradient(14px 8px at 14px 12px, rgba(64, 170, 190, .30) 98%, transparent) 0 0/28px 14px repeat-x;
  animation: waveDrift 5s linear infinite;
}
@keyframes waveDrift { to { background-position: 28px 0; } }
.field.tide-high .sea { background: linear-gradient(180deg, rgba(110, 210, 230, .38), rgba(10, 60, 80, .55)); }
.units { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; padding: 0 2cqw 7cqh; gap: 2cqw; }
.player-zone { flex: 0 0 30cqw; display: flex; justify-content: center; align-items: flex-end; }
.enemy-zone { flex: 1; min-width: 0; display: flex; justify-content: space-evenly; align-items: flex-end; gap: 1cqw; }
@container field (max-aspect-ratio: 1/1) {
  .units { flex-direction: column-reverse; align-items: stretch; padding: 4cqh 2cqw 4cqh; gap: 1cqh; }
  .player-zone { flex: 0 0 auto; justify-content: flex-start; padding-left: 4cqw; }
  .enemy-zone { flex: 1; align-items: flex-end; }
}
.unit { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 0 1 auto; }
.unit .sprite { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.unit .sprite img { display: block; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6)); }
.enemy .sprite { width: min(calc(46cqh * var(--scale, 1)), 100%); height: calc(46cqh * var(--scale, 1)); max-height: 62cqh; }
.enemy { flex: 0 1 calc(44cqh * var(--scale, 1)); max-width: 40cqw; }
.enemy .sprite img { width: 100%; height: 100%; animation: bob 3.4s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.enemy.flying .sprite { margin-bottom: 10cqh; }
.player .sprite { height: 50cqh; width: min(30cqw, 38cqh); }
.player .sprite img { width: 100%; height: calc(100% * var(--wren-tall)); pointer-events: none; animation: breathe 4s ease-in-out infinite; }
@container field (max-aspect-ratio: 1/1) {
  .enemy .sprite { height: calc(30cqh * var(--scale, 1)); max-height: 42cqh; width: min(calc(30cqh * var(--scale, 1)), 100%); }
  .enemy { flex: 0 1 calc(30cqh * var(--scale, 1)); max-width: 48cqw; }
  .player { flex-direction: row; align-items: flex-end; gap: 2cqw; }
  .player .sprite { height: 30cqh; width: 22cqh; }
  .enemy.flying .sprite { margin-bottom: 4cqh; }
}
/* a small phone (360x640, 375x667): the field is narrow but wider than tall. The big creatures' boxes were taller than
   the art in them, and pushed their intent up under the top bar. */
@container field (min-aspect-ratio: 1/1) and (max-width: 600px) {
  .enemy .sprite { max-height: 52cqh; }
  .unit.enemy .info { min-width: 0; } /* three creatures get about 80px each: their HP bars overlapped at 96px */
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5%); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012, .992); } }
.unit .info { display: flex; flex-direction: column; align-items: center; gap: 4px; width: min(170px, 100%); min-width: 96px; margin-top: 2px; }
.unit .uname { font-size: 13px; font-weight: 650; color: rgba(233, 226, 207, .82); text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.player .uname { display: none; }
.hpbar { position: relative; width: 100%; height: 20px; border-radius: 10px; background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .25); overflow: visible; }
.hpbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; background: linear-gradient(180deg, #ff6f81, #b52a40); transition: width .4s ease; }
.hpbar .ghost { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; background: rgba(255, 220, 220, .55); transition: width .9s ease .25s; }
.hpbar.warded { border-color: var(--ward); box-shadow: 0 0 0 2px rgba(95, 182, 234, .5); }
.hpbar.warded .fill { background: linear-gradient(180deg, #8fd0f5, #3b7fb4); }
.hpbar .txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.ward-badge {
  position: absolute; left: -18px; top: 50%; transform: translateY(-50%); width: 34px; height: 37px; display: grid; place-items: center;
  font-size: 15px; font-weight: 900; color: #fff; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 26'%3E%3Cpath d='M12 1 22 5v7c0 7-5 11-10 13C7 23 2 19 2 12V5z' fill='%232f7fb8' stroke='%23bfe6ff' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
  text-shadow: 0 1px 2px #000;
}
.statuses { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 24px; }
.st {
  display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 6px 0 3px; border-radius: 7px; font-size: 13px; font-weight: 800;
  background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .2);
}
.st svg { width: 16px; height: 16px; }
.st.buff { color: #ffd479; border-color: rgba(255, 212, 121, .4); }
.st.debuff { color: #ff9c8c; border-color: rgba(255, 156, 140, .4); }
.st.rite { color: #c9b2ff; border-color: rgba(201, 178, 255, .45); }
.intent {
  position: absolute; top: -6px; left: 50%; transform: translate(-50%, -100%); z-index: 3;
  display: flex; align-items: center; gap: 3px; padding: 3px 11px 3px 6px; border-radius: 18px;
  background: rgba(5, 15, 24, .88); border: 2px solid rgba(255, 255, 255, .25); font-weight: 900; font-size: 22px; line-height: 1; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45);
  animation: intentFloat 2.4s ease-in-out infinite;
}
.intent svg { width: 24px; height: 24px; }
.intent svg + svg, .intent span + svg, .intent i + svg { width: 18px; height: 18px; opacity: .85; }
.intent span + svg, .intent i + svg { margin-left: 3px; }
.intent .i-ward { display: inline-flex; align-items: center; gap: 2px; font-style: normal; color: #a9dcff; }
.intent span + .i-ward { margin-left: 7px; }
.intent .i-ward svg { width: 1em; height: 1em; }
.intent.attack { color: #ffc2b4; border-color: rgba(255, 110, 90, .85); background: rgba(48, 10, 8, .9); }
.intent.defend { color: #a9dcff; }
.intent.buff { color: #ffd479; }
.intent.debuff { color: #d0a8ff; }
.intent.summon { color: #9ff0c7; }
@keyframes intentFloat { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, calc(-100% - 4px)); } }
.enemy.targetable .sprite::after {
  content: ""; position: absolute; inset: 6% 6% 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 184, 77, .22), transparent 65%);
}
.enemy.targetable { cursor: crosshair; }
.enemy.targeted .sprite img { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 14px var(--amber)); }
.enemy.targeted .info::before { content: ""; position: absolute; }
.target-reticle { position: absolute; left: 50%; bottom: 30%; width: 64px; height: 64px; transform: translate(-50%, 50%); pointer-events: none; opacity: 0; transition: opacity .15s; }
.enemy.targeted .target-reticle { opacity: 1; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: translate(-50%, 50%) rotate(360deg); } }
/* .unit.enemy so it beats .unit.summoned's rise animation: a summoned enemy (the boss's minnows) has to fade out too */
.unit.enemy.dead { animation: die .7s ease forwards; pointer-events: none; }
@keyframes die { 0% { opacity: 1; filter: none; } 30% { filter: brightness(2) saturate(0); } 100% { opacity: 0; transform: translateY(16px) scale(.92); visibility: hidden; } }
.enemy.gone { visibility: hidden; display: none; }
.unit.hit .sprite { animation: shake .35s ease; }
.unit.lunge-left .sprite { animation: lungeL .4s ease; }
.unit.lunge-right .sprite { animation: lungeR .35s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes lungeL { 0%, 100% { transform: translateX(0); } 35% { transform: translateX(-36px) scale(1.04); } }
@keyframes lungeR { 0%, 100% { transform: translateX(0); } 35% { transform: translateX(30px); } }
.unit.flash-red .sprite img { animation: redFlash .35s ease; }
@keyframes redFlash { 50% { filter: drop-shadow(0 0 0 #000) brightness(1.6) sepia(1) hue-rotate(-40deg) saturate(4); } }
.unit.summoned { animation: rise .6s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }
/* a boss's second form comes out of the first */
.unit.reborn .sprite img { animation: reborn 1s ease; }
@keyframes reborn { 0% { opacity: 0; transform: scale(.55); filter: brightness(3) saturate(0); } 55% { opacity: 1; filter: brightness(1.8); } 100% { transform: scale(1); filter: none; } }
/* Submerged (the Murk Ray): sunk into the water, dim, and not a target */
.unit.enemy .sprite img { transition: translate .4s ease, opacity .4s ease; }
.unit.enemy.submerged .sprite img { translate: 0 22%; opacity: .45; filter: saturate(.5) brightness(.75) drop-shadow(0 0 10px rgba(80, 200, 220, .45)); }
.unit.enemy.submerged { cursor: not-allowed; }
.light-orb.doused { animation: orbDoused .9s ease; }
@keyframes orbDoused { 30% { filter: brightness(.45) saturate(.4); transform: scale(.9); } }

/* turn banner & crest wave */
.banner {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 30; pointer-events: none;
  font-family: var(--serif); font-size: clamp(22px, 5vw, 46px); color: #ffe7b5; letter-spacing: .04em; text-align: center; width: max-content; max-width: 96%;
  text-shadow: 0 0 18px rgba(255, 184, 77, .6), 0 3px 10px #000; padding: 8px 40px;
  background: linear-gradient(90deg, transparent, rgba(5, 15, 24, .75) 20%, rgba(5, 15, 24, .75) 80%, transparent);
  animation: banner 1.1s ease forwards;
}
.banner.enemy { color: #ffb6a8; text-shadow: 0 0 18px rgba(255, 90, 70, .5), 0 3px 10px #000; }
.banner.stacked { top: 56%; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scaleY(.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scaleY(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.crest-wave { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.crest-wave::before {
  content: ""; position: absolute; top: -10%; bottom: -10%; width: 70%; left: -75%;
  background:
    radial-gradient(ellipse 30% 55% at 85% 50%, rgba(240, 255, 255, .85), transparent 70%),
    linear-gradient(90deg, transparent, rgba(80, 200, 225, .55) 40%, rgba(200, 245, 255, .85) 85%, transparent);
  filter: blur(2px); animation: crestSweep .9s cubic-bezier(.4, 0, .3, 1) forwards;
}
@keyframes crestSweep { to { left: 115%; } }
.crest-text {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  font-family: var(--serif); font-size: clamp(28px, 6vw, 54px); color: #e7fbff; text-shadow: 0 0 20px #5fd3ee, 0 3px 8px #000; letter-spacing: .1em;
  animation: banner 1.2s ease forwards;
}
.crest-text.low { color: #cfe3ff; text-shadow: 0 0 20px #4f7fdd, 0 3px 8px #000; }
.field.drain .sea { transition-duration: .3s; }
.field.shake { animation: fieldShake .4s ease; }
@keyframes fieldShake { 0%, 100% { transform: none; } 25% { transform: translate(-4px, 2px); } 50% { transform: translate(4px, -2px); } 75% { transform: translate(-2px, 1px); } }
.beam-fx { position: absolute; z-index: 5; height: 10px; transform-origin: 0 50%; pointer-events: none; border-radius: 6px; background: linear-gradient(90deg, rgba(255, 230, 160, .9), rgba(255, 184, 77, .2)); box-shadow: 0 0 20px var(--amber); animation: beamFade .6s ease forwards; }
@keyframes beamFade { from { opacity: 1; } to { opacity: 0; } }

/* tide bar */
.tidebar {
  position: relative; z-index: 6; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 5px 12px;
  background: linear-gradient(180deg, #0b2535, #081b27); border-top: 1px solid rgba(120, 210, 230, .25); border-bottom: 1px solid rgba(0, 0, 0, .5);
}
.tb-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #8fd9bd; white-space: nowrap; cursor: help; }
.tb-label.crest { color: #c8fbe6; }
.tb-track { position: relative; flex: 1; max-width: 560px; height: 20px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.tb-seg { border-radius: 5px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(150, 230, 200, .18); position: relative; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, .3); transition: background .3s, box-shadow .3s; }
.tb-seg.end-low { border-color: rgba(120, 220, 180, .55); }
.tb-seg.end-crest { border-color: rgba(190, 255, 225, .7); }
/* the Swell is sea-green, so it can't be read as Ward (blue, var(--ward)); v0.40.0, the user: "can be confused" */
.tb-seg.filled { background: linear-gradient(180deg, #4fd4a4, #156b52); color: #fff; border-color: rgba(190, 255, 225, .6); }
.tb-seg.now { box-shadow: 0 0 0 2px #eafff6, 0 0 12px #4fe0aa; }
.tb-seg.preview { outline: 2px dashed #ffe0a0; outline-offset: 1px; }
.tb-value { font-family: var(--serif); font-size: 15px; color: #e6f7fa; white-space: nowrap; min-width: 4.6em; text-align: center; }
.tb-hint { position: absolute; left: 50%; top: -28px; transform: translateX(-50%); font-size: 14px; font-weight: 800; color: #ffe0a0; background: rgba(5, 15, 24, .85); padding: 1px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; }

/* dock & hand */
.dock { position: relative; z-index: 10; flex: 0 0 auto; height: calc(var(--ch) + 30px); background: linear-gradient(180deg, #081b27, #050f18); }
.dock-left, .dock-right { position: absolute; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2; }
.dock-left { left: 12px; }
.dock-right { right: 12px; }
.hand { position: absolute; left: 150px; right: 150px; bottom: 18px; height: var(--ch); }
.light-orb {
  width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: baseline; justify-content: center; padding-top: 16px; position: relative;
  background: radial-gradient(circle at 45% 38%, #fff1c9, #ffb84d 40%, #a3570d 75%, #4a2405);
  box-shadow: 0 0 22px rgba(255, 184, 77, .55), inset 0 -4px 10px rgba(0, 0, 0, .35); border: 2px solid #ffe5a8;
  font-family: var(--serif); font-weight: 800; font-size: 22px; color: #2b1402; cursor: help;
}
.light-orb.empty { background: radial-gradient(circle at 45% 38%, #6f5a3d, #3a2a17 60%, #1d140a); box-shadow: none; color: #d8c49f; border-color: #6a5636; }
.light-orb small { font-size: 13px; opacity: .8; }
.light-orb.pulse { animation: orbPulse .5s ease; }
@keyframes orbPulse { 50% { transform: scale(1.18); } }
.pile {
  display: flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 700;
  background: rgba(16, 40, 58, .9); border: 1px solid rgba(201, 162, 74, .4); color: #e6dcc3;
}
.pile svg { width: 18px; height: 18px; }
.end-turn { min-width: 112px; min-height: 52px; font-size: 16px; }
.end-turn:not(.primary) { color: #f1e6cf; border-color: rgba(241, 230, 207, .45); }
.end-turn.nudge { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 2px 0 #5a3408, 0 0 0 0 rgba(255, 184, 77, .6); } 50% { box-shadow: 0 2px 0 #5a3408, 0 0 0 8px rgba(255, 184, 77, 0); } }
.hand-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 40; font-size: 15px; font-weight: 700; color: #ffe8bf; background: rgba(5, 15, 24, .88); border: 1px solid rgba(255, 184, 77, .5); padding: 4px 12px; border-radius: 12px; pointer-events: none; white-space: nowrap; }

@media (max-width: 760px) {
  .dock { height: calc(var(--ch) + 74px); }
  .dock-left, .dock-right { top: 6px; bottom: auto; flex-direction: row; gap: 8px; }
  .dock-left { left: 8px; }
  .dock-right { right: 8px; }
  .hand { left: 6px; right: 6px; bottom: 12px; }
  .light-orb { width: 50px; height: 50px; font-size: 18px; padding-top: 12px; }
  .end-turn { min-width: 96px; min-height: 46px; font-size: 15px; order: 2; }
  .pile { padding: 3px 8px; font-size: 12px; min-height: 34px; }
  .hud .stat { font-size: 14px; }
  .hud .stat.floor .lbl { display: none; }
  .tb-label { font-size: 12px; }
  .hpbar { height: 18px; }
  .hpbar .txt { font-size: 13px; }
  .intent { font-size: 20px; }
}
@media (max-width: 420px) {
  .hud { gap: 6px; padding: 0 6px; }
  .medal { width: 30px; height: 30px; }
  .tb-label .long { display: none; }
}

/* ---------- Cards ---------- */
.card {
  position: absolute; left: 0; top: 0; width: var(--cw); height: calc(var(--cw) * 1.4); font-size: calc(var(--cw) / 10);
  transform-origin: 50% 100%; transition: transform .22s cubic-bezier(.2, .8, .3, 1), opacity .2s; cursor: pointer; touch-action: none;
  will-change: transform;
  /* the cost coin's font size; the name starts just right of the coin, whatever size it is drawn at */
  --coin: calc(var(--cw) * .12);
}
.card.static { position: relative; cursor: default; }
.card .frame {
  position: absolute; inset: 0; border-radius: .75em; overflow: hidden;
  background: linear-gradient(180deg, #1b3446, #0d1b27 60%, #0a1520);
  border: .2em solid var(--tc, #555); box-shadow: 0 .3em .8em rgba(0, 0, 0, .55), inset 0 0 0 .08em rgba(255, 255, 255, .1);
}
.card.t-attack { --tc: #d1664a; }
.card.t-skill { --tc: #3c9f82; }
.card.t-rite { --tc: #8d6fd0; }
.card.t-status { --tc: #6c7b84; }
.card.t-curse { --tc: #6a3d6e; }
.c-art { position: absolute; top: 1.95em; left: .4em; right: .4em; height: 4.9em; border-radius: .35em; background: #0a1a26 center/cover no-repeat; box-shadow: inset 0 0 0 .08em rgba(0, 0, 0, .5); }
.card.r-uncommon .c-art { box-shadow: 0 0 0 .14em #5cc0dd; }
.card.r-rare .c-art { box-shadow: 0 0 0 .14em #f0c050, 0 0 .6em rgba(240, 192, 80, .5); }
.c-name {
  position: absolute; top: .42em; left: calc(var(--coin) * 2.25 + 1px); right: .35em; height: 1.4em; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: .95em; color: #f4ead2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em;
}
.c-name span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.c-name.long { font-size: .8em; }
.card:has(.c-cost.none) .c-name { left: .35em; }
.card.up .c-name { color: var(--good); }
.card.r-rare .c-name { color: #ffd77a; }
.card.r-rare.up .c-name { color: #b8f5a2; }
.c-cost {
  position: absolute; left: .15em; top: .15em; width: 2.1em; height: 2.1em; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  background: radial-gradient(circle at 40% 35%, #fff0c8, #f3a432 55%, #8a4d0a); border: .12em solid #fff1cf;
  color: #2a1503; font-weight: 900; font-size: var(--coin); font-family: var(--serif); box-shadow: 0 .1em .3em rgba(0, 0, 0, .6);
}
.c-cost.changed { color: #0d4a1b; }
.c-cost.none { display: none; }
.c-type {
  position: absolute; top: 10.4em; left: 50%; transform: translateX(-50%); z-index: 1; font-size: .62em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .8); background: var(--tc); padding: .1em .8em; border-radius: .6em; white-space: nowrap;
}
.c-text {
  position: absolute; top: 7.4em; bottom: .45em; left: .45em; right: .45em; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: var(--card-text, 1.02em); line-height: 1.22; color: #eef4f2; overflow: hidden;
  /* text that doesn't fit starts at the top, so its first words show and only the end is cut (v0.36.0: centred, it was
     cut at both ends, "turn, deal 2 amag", in a phone's crowded hand) */
  align-items: safe center;
}
/* in a hand where cards overlap, the text of a covered card has only the strip that shows: break long words there, and
   fade what doesn't fit instead of cutting it off mid-line */
.small-cards .hand .card:not(.selected) .c-text, .hand.crowded .card:not(.selected):not(.lifted) .c-text {
  hyphens: auto; -webkit-hyphens: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.3em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 1.3em), transparent);
}
.c-text.long { font-size: var(--card-text-long, .92em); line-height: 1.13; }
.c-text > div { min-inline-size: 0; max-inline-size: 100%; overflow-wrap: anywhere; }
.c-text .kw { color: #ffd27a; }
.c-text .kw.k-surge { color: #8be0ff; }
.c-text .kw.k-ebb { color: #a9c8ff; }
.card.playable .frame { box-shadow: 0 0 0 .1em rgba(255, 220, 140, .9), 0 0 .9em .2em rgba(255, 184, 77, .55), 0 .3em .8em rgba(0, 0, 0, .55); }
.card.cant .frame { filter: brightness(.72) saturate(.7); }
.card.selected .frame { box-shadow: 0 0 0 .14em #fff3d0, 0 0 1.4em .4em rgba(255, 184, 77, .75); }
.card.dragging { transition: none; z-index: 200 !important; }
.card.drawn { opacity: 0; }
.card-fly { position: fixed; z-index: 300; pointer-events: none; transform-origin: 50% 50%; }
.card.static.choice { cursor: pointer; transition: transform .15s, filter .15s; }
.card.static.choice:hover, .card.static.choice:focus-visible { transform: translateY(-6px) scale(1.04); }
.card.static.chosen .frame { box-shadow: 0 0 0 .16em var(--amber), 0 0 1.4em .3em rgba(255, 184, 77, .7); }
.card.static.dim { opacity: .4; }
/* the pick on a reward or a card choice (v0.36.0): marked, not taken until the button below takes it */
.card.static.picked { transform: translateY(-8px) scale(1.05); z-index: 2; }
.card.static.picked .frame { box-shadow: 0 0 0 .18em #9ff0d8, 0 0 1.4em .4em rgba(111, 211, 184, .65); }
.card.static.picked::before { content: 'Your pick'; position: absolute; left: 50%; top: -11px; transform: translateX(-50%); z-index: 3; padding: 1px 10px; border-radius: 10px; font: 700 12px/18px var(--sans, system-ui), sans-serif; letter-spacing: .03em; color: #06221b; background: #9ff0d8; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.shop-tile.ks-pick.picked { transform: translateY(-4px); border-color: #9ff0d8; box-shadow: 0 0 0 2px #9ff0d8, 0 0 18px rgba(111, 211, 184, .5); }
.pick-legend { width: 100%; display: flex; flex-direction: column; align-items: center; }
.kw-hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

/* keyword glossary next to a selected card */
.glossary {
  position: absolute; z-index: 45; width: 230px; display: flex; flex-direction: column; gap: 5px; pointer-events: none;
}
.glossary div { background: rgba(5, 15, 24, .95); border: 1px solid rgba(201, 162, 74, .45); border-radius: 9px; padding: 7px 10px; font-size: 14px; line-height: 1.4; color: #d9e6e3; }
.glossary b { color: var(--amber); display: block; font-size: 14px; }

/* keyword legend under cards to choose from (reward, shop, event picks) */
.kw-legend {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 18px; width: 100%; max-width: 780px; margin: 14px auto 0;
  padding: 10px 14px; text-align: left; background: rgba(5, 15, 24, .82); border: 1px solid rgba(201, 162, 74, .3); border-radius: 12px;
}
.kw-legend > div { font-size: 14px; line-height: 1.4; color: #d9e6e3; transition: opacity .15s; }
.kw-legend dt { display: inline; font-weight: 800; margin-right: 6px; }
.kw-legend dd { display: inline; margin: 0; }
.kw-legend.focus > div:not(.on) { opacity: .38; }
.modal .kw-legend { margin-top: 12px; }

/* targeting arrow */
#arrow { position: fixed; inset: 0; z-index: 250; pointer-events: none; width: 100%; height: 100%; }
#arrow path { fill: none; stroke: var(--amber); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 12; filter: drop-shadow(0 0 6px rgba(255, 184, 77, .8)); }
#arrow circle { fill: var(--amber); }

/* floating numbers */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.float {
  position: absolute; transform: translate(-50%, -50%); font-family: var(--serif); font-weight: 900; font-size: 30px; color: #ffefe8;
  text-shadow: 0 0 6px #c2203a, 0 2px 0 #5a0d18, 0 3px 10px #000; animation: floatUp 1.1s ease-out forwards; white-space: nowrap;
}
.float.ward { color: #dff3ff; text-shadow: 0 0 6px #2f7fb8, 0 2px 0 #0f3350, 0 3px 10px #000; font-size: 22px; }
.float.heal { color: #dfffe6; text-shadow: 0 0 6px #2e9a52, 0 2px 0 #0f4020, 0 3px 10px #000; font-size: 24px; }
.float.status { font-family: var(--sans); font-size: 15px; font-weight: 800; color: #ffe0a0; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.float.status.debuff { color: #ffb3a5; }
.float.blocked { font-size: 18px; color: #bfe6ff; text-shadow: 0 0 6px #2f7fb8, 0 2px 6px #000; }
.float.big { font-size: 40px; }
.float.move { font-family: var(--serif); font-size: 18px; color: #fff; text-shadow: 0 2px 6px #000; animation: floatName 1s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 30% { transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%); } }
@keyframes floatName { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%); } }
.slash-fx { position: absolute; width: 120px; height: 120px; transform: translate(-50%, -50%) rotate(-30deg); pointer-events: none; }
.slash-fx::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #fff, #ffd38a, transparent); box-shadow: 0 0 14px #ffb84d; animation: slash .3s ease-out forwards; transform-origin: 0 50%; }
@keyframes slash { from { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }

/* ---------- Tooltip ---------- */
#tip {
  position: fixed; z-index: 600; max-width: min(300px, 92vw); padding: 8px 10px; border-radius: 9px; pointer-events: none;
  background: rgba(4, 12, 19, .96); border: 1px solid rgba(201, 162, 74, .55); font-size: 13.5px; line-height: 1.4; color: #e3ecea;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
}
#tip b { color: #ffd98a; }
#tip .tip-row + .tip-row { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 700; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#toast.low { top: auto; bottom: calc(64px + env(safe-area-inset-bottom)); }
body:has(#overlay:not([hidden]) .opening) #toast { visibility: hidden; }
.toast-msg { background: rgba(5, 15, 24, .94); border: 1px solid rgba(255, 184, 77, .5); color: #ffe8c2; padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; animation: toast 2.2s ease forwards; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Overlay / modal ---------- */
#overlay { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(2, 8, 13, .78); backdrop-filter: blur(3px); }
#overlay[hidden] { display: none; }
.modal {
  position: relative; width: min(980px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #0d2433, #08161f); border: 1px solid rgba(201, 162, 74, .5); box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
}
.modal.narrow { width: min(560px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(201, 162, 74, .25); }
.modal-head h2 { flex: 1; font-size: 21px; color: #f3dfb2; }
.modal-body { padding: 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 16px; border-top: 1px solid rgba(201, 162, 74, .2); flex-wrap: wrap; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--gcw, 130px), 1fr)); gap: 14px 10px; justify-items: center; }
.card-grid .card.static { --cw: var(--gcw, 130px); }
.card-grid .card.static.choice:hover { transform: translateY(-4px) scale(1.03); }
.compare { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; padding: 8px 0; }
.compare .arrow { font-size: 30px; color: var(--amber); }
.compare .card.static { --cw: min(170px, 38vw); }
.refit-current { margin: 0 0 12px; text-align: center; color: #d6e3e0; line-height: 1.5; }
.refit-options { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
.refit-options .card.static { --cw: min(170px, calc((100vw - 68px) / 2)); }
.refit-option { display: flex; flex-direction: column; gap: 10px; }
.refit-option .btn { min-height: 44px; padding-inline: 8px; }
@media (max-height: 500px) {
  .refit-current { margin-bottom: 4px; font-size: 14px; }
  .refit-options { padding: 4px 0; }
  .refit-option { gap: 6px; }
  .refit-options .card.static { --card-text: 14px; --card-text-long: 13px; height: 100px; touch-action: pan-y; }
  .refit-options .c-art, .refit-options .c-type { display: none; }
  .refit-options .c-text { top: 2.65em; }
}
.help h3 { color: #f3dfb2; font-size: 17px; margin: 16px 0 6px; }
.help h3:first-child { margin-top: 0; }
.help p, .help li { line-height: 1.5; color: #d6e3e0; font-size: 14.5px; margin: 4px 0; }
.help ul { padding-left: 1.2em; margin: 4px 0; }
.kbd { display: inline-block; min-width: 1.6em; padding: 0 .4em; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); font-size: 12.5px; text-align: center; font-family: var(--sans); }
.pile-tabs { display: flex; gap: 6px; }

/* ---------- Scene screens (reward, rest, shop, event, treasure, end) ---------- */
.scene { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #071722 center/cover no-repeat; }
.scene::before { content: ""; position: fixed; inset: var(--hud-h) 0 0 0; background: radial-gradient(ellipse at 50% 30%, rgba(5, 15, 24, .35), rgba(5, 15, 24, .88) 75%); pointer-events: none; }
.scene-inner { position: relative; max-width: 960px; margin: 0 auto; padding: 22px 16px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.scene h1 { font-size: clamp(28px, 5vw, 44px); color: #ffe6b0; text-shadow: 0 0 18px rgba(255, 184, 77, .4), 0 3px 8px #000; }
.scene .lead { font-family: var(--serif); font-size: clamp(15px, 2.2vw, 18px); line-height: 1.55; color: #d8e8e5; max-width: 36em; text-shadow: 0 2px 6px #000; margin: 0; }
.panel { width: 100%; background: rgba(6, 20, 30, .82); border: 1px solid rgba(201, 162, 74, .35); border-radius: 14px; padding: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.panel h3 { font-size: 18px; color: #f3dfb2; margin-bottom: 10px; }
.reward-list { display: flex; flex-direction: column; gap: 8px; width: min(460px, 100%); }
.reward-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(6, 20, 30, .85); border: 1px solid rgba(201, 162, 74, .3); text-align: left; }
.reward-item .medal { width: 44px; height: 44px; cursor: default; }
.reward-item .grow { flex: 1; }
.reward-item b { color: #f3dfb2; }
.reward-item small { display: block; color: var(--muted); font-size: 13px; }
.reward-item.done { opacity: .65; }
.tonic-reward:not(.done) { background: #132f30; border-color: #7db79b; }
.card-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.card-row .card.static { --cw: clamp(118px, 26vw, 168px); }
.choice-list { display: flex; flex-direction: column; gap: 10px; width: min(560px, 100%); }
/* event and rest choices; cards you can pick also carry .choice, so these leave cards alone */
.choice:not(.card) {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 16px; border-radius: 12px; cursor: pointer; min-height: 56px;
  background: linear-gradient(180deg, rgba(25, 62, 82, .95), rgba(12, 34, 48, .95)); border: 1px solid rgba(201, 162, 74, .5); color: var(--text);
  transition: transform .12s, filter .12s;
}
.choice:not(.card):hover { filter: brightness(1.15); transform: translateX(3px); }
.choice:not(.card) b { font-size: 16px; color: #ffe2a8; }
.choice:not(.card) span { font-size: 14px; color: #cfe0dc; }
.choice:not(.card)[disabled] { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.choice:not(.card) .reason { color: var(--bad); font-size: 12.5px; }
.choice.pin-choice:not(.card) { position: relative; padding-left: 54px; }
.pin-choice > svg { position: absolute; width: 24px; height: 24px; left: 16px; top: 13px; }
.choice.pin-deeper:not(.card) { border-color: #75b3c7; background: linear-gradient(160deg, #193e56, #102333); color: #9bdff0; }
.choice.pin-home:not(.card) { border-color: #c9a24a; background: linear-gradient(160deg, #48341f, #211e20); color: #ffca74; }
.event-art { width: min(640px, 100%); aspect-ratio: 3/2; border-radius: 14px; background: center/cover no-repeat; border: 1px solid rgba(201, 162, 74, .45); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
.shop-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 12px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shop-item .card.static { --cw: clamp(112px, 24vw, 150px); }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #f1e6cf; font-size: 15px; }
.price svg { width: 16px; height: 16px; }
.price.cant { color: var(--bad); }
.price .was { text-decoration: line-through; color: var(--muted); font-weight: 600; font-size: 12px; }
.sale-tag { font-size: 11px; font-weight: 800; color: #2a1504; background: var(--amber); border-radius: 6px; padding: 0 6px; }
.shop-item.sold { opacity: .35; pointer-events: none; }
.shop-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.shop-tile { width: 150px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 12px; background: rgba(6, 20, 30, .8); border: 1px solid rgba(201, 162, 74, .35); cursor: pointer; }
.shop-tile .medal { width: 64px; height: 64px; cursor: pointer; }
.shop-tile b { font-size: 14px; color: #f3dfb2; }
.shop-tile small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.shop-tile.sold { opacity: .35; pointer-events: none; }
.shop-tile.chosen { cursor: default; border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber), 0 0 18px rgba(255, 184, 77, .45); }
.shop-tile.chosen .medal, .shop-tile.dim .medal { cursor: default; }
.shop-tile.dim { cursor: default; opacity: .4; }
.reward-summary .incl { align-self: center; font-size: 14px; color: var(--muted); }
.scene .lead.outcome { font-family: var(--sans); font-size: 16px; font-weight: 700; color: #ffe2a8; }
/* the pin screen on a debug-cheated run: nothing found comes home */
.scene .lead.dbg-note { font-family: var(--sans); font-size: 15px; color: #f5c2a8; background: rgba(60, 20, 10, .55); border: 1px dashed rgba(245, 160, 120, .6); border-radius: 10px; padding: 8px 12px; }
/* shop: what you are about to buy */
.buy-item { display: flex; align-items: center; gap: 14px; text-align: left; }
.buy-item .medal { width: 64px; height: 64px; flex: 0 0 auto; cursor: default; }
.buy-item b { font-size: 17px; color: #f3dfb2; }
.buy-item p { margin: 4px 0 0; font-size: 15px; color: #d6e3e0; line-height: 1.4; }
.buy-left { margin: 12px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
/* scene screens that still scroll say so */
.scroll-cue {
  position: absolute; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 10px 4px 14px; border-radius: 18px; cursor: pointer;
  background: rgba(5, 15, 24, .94); border: 1px solid rgba(255, 184, 77, .65); color: #ffe2a8; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6); animation: cueBob 1.6s ease-in-out infinite;
}
.scroll-cue[hidden] { display: none; }
.scroll-cue svg { width: 18px; height: 18px; }
@keyframes cueBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 3px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { animation: none; } }
.trader { display: flex; align-items: flex-end; gap: 12px; text-align: left; width: 100%; }
.trader img { width: clamp(110px, 22vw, 200px); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); }
.speech { position: relative; flex: 1; background: rgba(240, 228, 200, .95); color: #2c2214; border-radius: 14px; padding: 10px 14px; font-family: var(--serif); font-size: 15.5px; line-height: 1.45; margin-bottom: 20px; }
.speech::before { content: ""; position: absolute; left: -10px; bottom: 16px; border: 10px solid transparent; border-right-color: rgba(240, 228, 200, .95); border-left: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; width: min(620px, 100%); }
.stats div { background: rgba(6, 20, 30, .85); border: 1px solid rgba(201, 162, 74, .3); border-radius: 10px; padding: 8px; }
.stats b { display: block; font-family: var(--serif); font-size: 22px; color: #ffe2a8; }
.stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chest { width: min(520px, 100%); aspect-ratio: 3/2; border-radius: 14px; background: center/cover no-repeat; border: 1px solid rgba(201, 162, 74, .45); }
.row-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .05ms !important; }
}

/* narrow screens: keepsakes and tonics get their own HUD row */
.hud-break { display: none; }
@media (max-width: 600px) {
  :root { --hud-h: 84px; }
  .hud { flex-wrap: wrap; align-content: center; row-gap: 3px; column-gap: 8px; padding-top: 3px; padding-bottom: 3px; }
  .hud .stat.floor { margin-right: auto; }
  .hud-break { display: block; order: 9; flex: 0 0 100%; height: 0; }
  .hud .keepsakes { order: 10; flex: 1 1 0; height: 32px; }
  .hud .keepsakes .medal, .hud .tonics .medal { width: 30px; height: 30px; }
  .hud .tonics { order: 11; }
  .hud .icon-btn { width: 38px; height: 38px; }
}
/* short landscape screens */
@media (max-height: 500px) and (min-width: 601px) {
  :root { --hud-h: 42px; }
  .hud .medal { width: 30px; height: 30px; }
  .hud .icon-btn { width: 34px; height: 34px; }
  .tidebar { padding: 3px 10px; }
  .tb-track { height: 18px; }
  .light-orb { width: 50px; height: 50px; font-size: 18px; padding-top: 12px; }
  .end-turn { min-height: 42px; min-width: 96px; font-size: 14px; }
  .dock-left, .dock-right { gap: 6px; bottom: 6px; }
  .hand { left: 110px; right: 130px; bottom: 8px; }
  .dock { height: calc(var(--ch) + 14px); }
  .unit .info { min-width: 84px; }
  .hpbar { height: 17px; }
  .hpbar .txt { font-size: 12px; }
  .intent { font-size: 18px; padding: 2px 9px 2px 5px; }
  .intent svg { width: 20px; height: 20px; }
  .uname { display: none; }
}

/* ===================== Fun pass: feedback & juice ===================== */
/* predictive badges on hand cards */
.c-badges { position: absolute; top: -.95em; left: 50%; transform: translateX(-50%); display: flex; gap: .25em; z-index: 4; pointer-events: none; white-space: nowrap; }
.c-badge { font-size: .7em; font-weight: 900; letter-spacing: .07em; padding: .18em .6em; border-radius: .7em; box-shadow: 0 .15em .5em rgba(0, 0, 0, .6); border: .08em solid rgba(255, 255, 255, .6); }
.c-badge.crest { background: linear-gradient(180deg, #d8fbff, #39b3d3); color: #032b37; animation: badgePulse 1.3s ease-in-out infinite; }
.c-badge.low { background: linear-gradient(180deg, #dfe6ff, #5b7fd6); color: #0a1640; }
.c-badge.lethal { background: linear-gradient(180deg, #ffc2b3, #d63f2b); color: #2b0500; animation: badgePulse 1s ease-in-out infinite; }
.c-badge.victory { background: linear-gradient(180deg, #fff1c4, #f0a72b); color: #3a1d00; animation: badgePulse .8s ease-in-out infinite; }
.c-badge.echo { background: linear-gradient(180deg, #f7e2ff, #a77be0); color: #22063d; }
@keyframes badgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.card.cant .c-badges { display: none; }

/* crest chains */
.crest-text { display: flex; flex-direction: column; align-items: center; white-space: nowrap; }
.crest-text b { color: #fff6c9; text-shadow: 0 0 18px #ffb84d, 0 3px 8px #000; }
.crest-text small { font-family: var(--sans); font-size: max(13px, .32em); letter-spacing: .12em; font-weight: 800; color: #d8f6ff; margin-top: .2em; }
.crest-text.chain-2 { font-size: clamp(36px, 7.5vw, 68px); }
.crest-text.chain-3 { font-size: clamp(42px, 9vw, 84px); color: #fff8dc; text-shadow: 0 0 26px #ffcf6e, 0 0 50px #5fd3ee, 0 3px 8px #000; }
.crest-text.chain-4 { font-size: clamp(48px, 10.5vw, 100px); color: #fffbe8; text-shadow: 0 0 30px #ff9d5c, 0 0 60px #ffd36e, 0 0 90px #5fd3ee, 0 3px 8px #000; }
.crest-wave.chain-2::before { filter: blur(2px) brightness(1.15); }
.crest-wave.chain-3::before, .crest-wave.chain-4::before { filter: blur(2px) brightness(1.35) hue-rotate(-15deg); width: 90%; }

/* chain bonuses (Tidal Fury, Deep Ebb) and Low Water's strand, shown the moment they happen */
.crest-text.fury { animation-duration: 2s; }
.chain-ribbon {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; margin-top: .4em; padding: 7px 26px;
  font-family: var(--sans); font-size: 18px; letter-spacing: .06em; white-space: nowrap;
  background: linear-gradient(90deg, rgba(58, 34, 4, 0), rgba(58, 34, 4, .94) 14%, rgba(58, 34, 4, .94) 86%, rgba(58, 34, 4, 0));
  animation: ribbonIn .5s cubic-bezier(.2, 1.4, .4, 1) .15s both;
}
.chain-ribbon b { color: #ffe08a; font-weight: 900; text-transform: uppercase; text-shadow: 0 0 12px rgba(255, 190, 70, .9), 0 2px 4px #000; }
.chain-ribbon em { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-weight: 800; color: #fff3d6; letter-spacing: .02em; text-shadow: 0 1px 3px #000; }
.chain-ribbon em svg { width: 17px; height: 17px; }
.chain-ribbon::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; left: -45%; background: linear-gradient(100deg, transparent, rgba(255, 240, 200, .5), transparent); animation: ribbonGlint .9s ease .5s forwards; }
.crest-text.low .chain-ribbon { background: linear-gradient(90deg, rgba(8, 22, 62, 0), rgba(8, 22, 62, .94) 14%, rgba(8, 22, 62, .94) 86%, rgba(8, 22, 62, 0)); }
.crest-text.low .chain-ribbon b { color: #dbe7ff; text-shadow: 0 0 12px rgba(110, 150, 255, .9), 0 2px 4px #000; }
@keyframes ribbonIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes ribbonGlint { to { left: 120%; } }
.field.fury-flash::before { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at 50% 32%, rgba(255, 214, 130, .38), transparent 62%); animation: furyFlash .9s ease forwards; }
@keyframes furyFlash { from { opacity: 1; } to { opacity: 0; } }
.float.ward-lost { font-family: var(--sans); font-size: 21px; font-weight: 900; color: #e6efff; text-shadow: 0 0 8px #2f63c4, 0 0 3px #000, 0 2px 4px #000, 0 0 14px #000; }
.float.light-gain { font-family: var(--sans); font-size: 17px; font-weight: 900; color: #fff1c9; text-shadow: 0 0 10px #ffb84d, 0 2px 4px #000; }
.ward-badge.shatter { animation: wardShatter .55s ease-in forwards; }
@keyframes wardShatter { 0% { transform: translateY(-50%); } 30% { transform: translateY(-50%) scale(1.25) rotate(-8deg); filter: brightness(1.7); } 100% { transform: translateY(10%) scale(.5) rotate(20deg); opacity: 0; } }
.light-orb.gain { animation: orbGain .7s ease; }
@keyframes orbGain { 35% { transform: scale(1.25); box-shadow: 0 0 42px rgba(255, 224, 150, 1), inset 0 -4px 10px rgba(0, 0, 0, .35); } }
@media (prefers-reduced-motion: reduce) { .chain-ribbon, .chain-ribbon::after, .ward-badge.shatter { animation: none; } .ward-badge.shatter { opacity: 0; } }
.echo-text {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  font-family: var(--serif); font-size: clamp(26px, 5vw, 46px); letter-spacing: .2em; color: #f3e3ff; text-shadow: 0 0 18px #a77be0, 0 3px 8px #000;
  animation: echoPulse 1s ease forwards;
}
@keyframes echoPulse { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); letter-spacing: 0; } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); letter-spacing: .5em; } }
.banner.big { font-size: clamp(30px, 6.5vw, 62px); color: #ffd0c4; text-shadow: 0 0 30px rgba(255, 70, 50, .8), 0 3px 10px #000; animation-duration: 1.8s; }

/* the last landing's pin (v0.36.0): its name card, the bronze cracking, the last blow going to light */
.boss-card {
  position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); z-index: 31; pointer-events: none; width: max-content; max-width: 94%;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 48px 18px; text-align: center;
  background: radial-gradient(ellipse at center, rgba(5, 15, 24, .9) 0%, rgba(5, 15, 24, .72) 55%, transparent 76%);
  animation: bossCard 2.9s ease forwards;
}
.boss-card small { font-size: 13px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: #e9c27a; text-shadow: 0 2px 6px #000; }
.boss-card b { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 7vw, 64px); line-height: 1.05; color: #ffe3c8; letter-spacing: .03em; text-shadow: 0 0 28px rgba(255, 110, 60, .75), 0 3px 12px #000; }
.boss-card i { display: block; width: min(320px, 60vw); height: 2px; margin: 6px 0 2px; background: linear-gradient(90deg, transparent, #e9c27a, transparent); transform-origin: center; animation: bossRule 2.9s ease forwards; }
.boss-card span { font-family: var(--serif); font-style: italic; font-size: clamp(15px, 2.4vw, 20px); line-height: 1.3; color: #dfe9e6; text-shadow: 0 2px 6px #000; max-width: 26em; }
@keyframes bossCard { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.98); } }
@keyframes bossRule { 0% { transform: scaleX(0); } 35% { transform: scaleX(1); } }
.field.toll-in { animation: tollIn 1.4s ease; }
@keyframes tollIn { 0%, 10% { filter: brightness(.3); transform: scale(1.02); } 100% { filter: none; transform: none; } }
.field.quake { animation: quake .7s ease; }
@keyframes quake { 0%, 100% { transform: none; } 15% { transform: translate(-7px, 3px); } 30% { transform: translate(6px, -4px); } 45% { transform: translate(-5px, 4px); } 60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); } }
.unit.cracking .sprite img { animation: cracking 1.1s ease-in forwards; }
/* "The Bell Cracks!" at two thirds of its health: the picture changes to the cracked bell with a flash of the Heart's light (v0.40.0) */
.unit.crack-flash .sprite img { animation: crackFlash .9s ease-out; }
@keyframes crackFlash { 0% { filter: brightness(2.6) drop-shadow(0 0 26px rgba(255, 200, 110, 1)); transform: translateX(-4px); } 20% { transform: translateX(4px); } 40% { transform: translateX(-2px); } 100% { filter: none; transform: none; } }
@keyframes cracking {
  0% { filter: none; } 15% { transform: translateX(-3px); } 30% { transform: translateX(3px); }
  55% { transform: translateX(-2px); filter: brightness(1.4) drop-shadow(0 0 12px rgba(255, 200, 110, .8)); } 70% { transform: translateX(3px); }
  100% { transform: scale(1.03); filter: brightness(2.4) drop-shadow(0 0 30px rgba(255, 220, 150, 1)); }
}
/* cracks of light across the bronze, drawn in from the top */
.unit.cracking .sprite::after {
  content: ''; position: absolute; inset: 8% 14% 10%; pointer-events: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23fff3c8' stroke-width='1.6' stroke-linejoin='bevel'%3E%3Cpath d='M48 0 L44 14 L52 24 L41 38 L50 49 L38 63 L47 74 L35 100'/%3E%3Cpath d='M52 24 L66 31 L71 46 L84 55'/%3E%3Cpath d='M41 38 L27 44 L20 58'/%3E%3Cpath d='M50 49 L61 60 L58 77 L69 92'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 4px #ffd27a) drop-shadow(0 0 10px #ffb84d);
  animation: cracksIn 1.1s steps(6, end) forwards;
}
@keyframes cracksIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.light-bloom {
  position: fixed; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none; z-index: 260;
  background: radial-gradient(circle, #fffdf2 0%, rgba(255, 238, 190, .95) 30%, rgba(255, 200, 110, .6) 55%, rgba(255, 184, 77, 0) 72%);
  animation: lightBloom 2.4s cubic-bezier(.2, .7, .3, 1) forwards;
}
.light-bloom.heart { animation-duration: 1.7s; }
@keyframes lightBloom { 0% { transform: scale(.2); opacity: 0; } 12% { opacity: 1; } 42% { transform: scale(42); opacity: .96; } 100% { transform: scale(60); opacity: 0; } }
body.final-blow #field { transform: scale(1.035); filter: saturate(.45) contrast(1.08); transition: transform 1s ease-out, filter .8s; }
body.final-blow .float { animation-duration: 2.4s; }
.unit.last-blow .sprite img { animation: lastBlow 1s ease-in forwards; }
@keyframes lastBlow {
  0% { filter: none; } 10% { transform: translate(-4px, 0); } 20% { transform: translate(4px, 1px); } 35% { transform: translate(-3px, -1px); }
  50% { transform: translate(2px, 0); filter: brightness(1.5) drop-shadow(0 0 14px rgba(255, 210, 130, .9)); }
  100% { transform: scale(1.04); filter: brightness(3) saturate(.3) drop-shadow(0 0 40px #fff3c8); }
}
.unit.enemy.to-light { pointer-events: none; }
.unit.to-light .sprite img { animation: toLight 1s ease-out forwards; }
.unit.to-light .info { opacity: 0; transition: opacity .4s; }
@keyframes toLight { 0% { filter: brightness(3) saturate(0); opacity: 1; } 100% { filter: brightness(4) saturate(0) blur(6px); opacity: 0; transform: scale(1.15) translateY(-10px); } }
@media (prefers-reduced-motion: reduce) {
  .field.toll-in, .field.quake, .unit.cracking .sprite img, .unit.last-blow .sprite img, .unit.crack-flash .sprite img { animation: none; }
  .light-bloom { animation-duration: 1s; }
  body.final-blow #field { transform: none; }
}

/* impacts, kills */
.field.impact { animation: impact .3s ease; }
@keyframes impact { 0% { transform: scale(1); } 30% { transform: scale(1.025) translate(-3px, 2px); } 60% { transform: scale(1.01) translate(3px, -2px); } 100% { transform: none; } }
.float.huge { font-size: 52px; color: #fff4c9; text-shadow: 0 0 10px #ff7a2f, 0 2px 0 #5a1d08, 0 4px 14px #000; }
.float.pearl { font-family: var(--sans); font-size: 17px; font-weight: 800; color: #fff3d6; text-shadow: 0 0 8px #c9a24a, 0 2px 4px #000; }
.particle { position: absolute; width: var(--sz, 8px); height: var(--sz, 8px); margin: calc(var(--sz, 8px) / -2) 0 0 calc(var(--sz, 8px) / -2); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #9fe6ff 55%, rgba(95, 211, 238, 0)); animation: burst .85s cubic-bezier(.2, .7, .3, 1) forwards; }
.particle.gold { background: radial-gradient(circle at 35% 35%, #fff, #ffd27a 55%, rgba(255, 184, 77, 0)); }
@keyframes burst { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.burst-ring { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid rgba(220, 250, 255, .9); box-shadow: 0 0 20px #5fd3ee; animation: ring .6s ease-out forwards; }
@keyframes ring { to { transform: scale(9); opacity: 0; } }
.slash-fx.spray::before { background: linear-gradient(90deg, transparent, #e8fbff, #5fd3ee, transparent); box-shadow: 0 0 14px #5fd3ee; }

/* incoming damage chip + danger vignette */
.incoming { display: none; align-items: center; gap: 4px; padding: 2px 10px 2px 6px; border-radius: 12px; font-size: 16px; font-weight: 900; background: rgba(5, 15, 24, .88); }
.incoming svg { width: 17px; height: 17px; }
.incoming.hurt { display: inline-flex; color: #ffb0a0; border: 1px solid rgba(255, 120, 100, .6); }
.incoming.safe { display: inline-flex; color: #a9dcff; border: 1px solid rgba(120, 190, 255, .5); }
.vignette { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .4s; box-shadow: inset 0 0 120px 46px rgba(220, 20, 30, .75); }
.vignette::after { content: "Lethal damage incoming"; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-weight: 900; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #ffd6cf; background: rgba(110, 8, 14, .88); padding: 4px 12px; border-radius: 10px; white-space: nowrap; }
.field.danger .vignette { opacity: 1; animation: dangerPulse 1.4s ease-in-out infinite; }
.field.danger .incoming.hurt { animation: badgePulse .8s ease-in-out infinite; background: rgba(120, 10, 15, .9); color: #fff; }
@keyframes dangerPulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* ambient bubbles */
.bubbles { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bubbles span { position: absolute; bottom: -20px; width: var(--s); height: var(--s); border-radius: 50%; border: 1px solid rgba(210, 245, 255, .45);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .45), rgba(255, 255, 255, .05) 60%); animation: bubbleRise linear infinite; }
@keyframes bubbleRise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translate(12px, -55cqh); } 100% { transform: translate(-6px, -115cqh); opacity: 0; } }

/* boss phase 2 */
.field.phase2 { background-color: #200a10; }
.field.phase2::after { background: radial-gradient(ellipse at 60% 40%, rgba(255, 60, 40, .16), transparent 60%), linear-gradient(180deg, rgba(60, 5, 10, .35), transparent 35%, transparent 70%, rgba(20, 0, 5, .6)); }

/* echo status chip */
.st.echo-chip { color: #e7d0ff; border-color: rgba(200, 160, 255, .6); }

/* rewards */
.reward-item.bonus b { color: #ffd27a; }
.bonus-medal { display: grid; place-items: center; color: #ffd27a; font-size: 22px; }
.ks-pick { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.ks-pick:hover, .ks-pick:focus-visible { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--amber), 0 0 18px rgba(255, 184, 77, .45); }
.card.static.reveal { animation: reveal .45s cubic-bezier(.2, .8, .3, 1.2) backwards; }
@keyframes reveal { from { opacity: 0; transform: translateY(30px) rotateY(80deg) scale(.8); } to { opacity: 1; transform: none; } }
.card.static.shine .frame::after, .card.static.shine-up .frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 240, 200, .45) 45%, transparent 60%) -150% 0 / 250% 100% no-repeat;
  animation: shine 2.6s ease-in-out infinite;
}
.card.static.shine-up .frame::after { background-image: linear-gradient(115deg, transparent 30%, rgba(190, 255, 200, .4) 45%, transparent 60%); }
@keyframes shine { 0%, 40% { background-position: -150% 0; } 100% { background-position: 150% 0; } }
.card.static.shine .frame { box-shadow: 0 0 0 .1em #f0c050, 0 0 1.2em .2em rgba(240, 192, 80, .55); }

/* end screen score */
.score-box { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 26px; border-radius: 14px; background: rgba(6, 20, 30, .85); border: 1px solid rgba(255, 184, 77, .55); }
.score-box span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.score-box b { font-family: var(--serif); font-size: 44px; color: #ffe2a8; text-shadow: 0 0 18px rgba(255, 184, 77, .45); line-height: 1.1; }
.score-box em { font-style: normal; font-weight: 800; color: #9ff0b5; animation: badgePulse 1s infinite; }
.score-box small { color: var(--muted); }
button.unlock-box { font: inherit; cursor: pointer; text-align: center; }
button.unlock-box:hover, button.unlock-box:focus-visible { border-color: #e9d5ff; }
.unlock-box { padding: 8px 14px; border-radius: 10px; background: rgba(60, 30, 80, .7); border: 1px solid rgba(200, 160, 255, .55); color: #eadcff; }
/* kit found on an expedition (the diving dress): its picture beside the words */
.found-kit { display: flex; align-items: center; gap: 12px; text-align: left; }
.found-kit .medal { flex: 0 0 auto; width: 56px; height: 56px; cursor: default; }
.title-best { position: relative; margin-top: 18px; font-size: 14px; color: #f3dfb2; text-shadow: 0 2px 6px #000; }

.pile.pulse { animation: orbPulse .5s ease; }

/* first-fight coaching tip */
.coach { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 35; width: min(560px, 92%); padding: 10px 14px; border-radius: 12px;
  background: rgba(5, 15, 24, .94); border: 1px solid rgba(255, 184, 77, .6); color: #e3ecea; font-size: 14px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.coach b { color: #ffd98a; }
.coach .c-badge { font-size: 12px; display: inline-block; }
.coach .btn { margin-left: 6px; min-height: 30px; padding: 2px 10px; }

.hud .stat.bump { animation: statBump .45s ease; }
@keyframes statBump { 40% { transform: scale(1.25); } }

/* ===================== Teaching: tutorial coachmarks and first-time hints ===================== */
.coachmark {
  position: fixed; z-index: 460; left: 0; top: 0; width: 340px; padding: 12px 14px 10px; border-radius: 14px;
  background: #f4e9cf; color: #23190b; font-size: 16px; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 0 2px #ffd68a;
}
.coachmark[hidden] { display: none; }
.coachmark b { color: #6a3a00; }
.coachmark .cm-arrow { position: absolute; width: 16px; height: 16px; background: inherit; transform: translateX(-50%) rotate(45deg); box-shadow: 2px 2px 0 0 #ffd68a; }
.coachmark[data-side="above"] .cm-arrow { bottom: -8px; }
.coachmark[data-side="below"] .cm-arrow { top: -8px; box-shadow: -2px -2px 0 0 #ffd68a; }
.coachmark .cm-arrow[hidden], .coachmark[data-side="none"] .cm-arrow { display: none; }
.cm-body { position: relative; }
.cm-aside { display: block; margin-top: 6px; font-size: 15px; color: #4d3d22; }
.cm-note { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: #fbe1b0; border: 1px solid #e0a64a; color: #5a2c00; font-size: 15px; font-weight: 700; }
.coachmark.nudge { animation: cmNudge .35s ease; }
@keyframes cmNudge { 20% { translate: -6px 0; } 50% { translate: 6px 0; } 80% { translate: -3px 0; } }
@media (prefers-reduced-motion: reduce) { .coachmark.nudge { animation: none; } }
.cm-keys { display: block; margin-top: 4px; font-size: 14px; color: #6b5a3c; }
.cm-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cm-step { font-size: 13px; font-weight: 700; color: #7c6a48; }
.cm-skip { margin-left: auto; padding: 8px 4px; min-height: 36px; border: 0; background: none; color: #6b5a3c; font-size: 14px; text-decoration: underline; cursor: pointer; }
.cm-foot .btn { min-height: 40px; padding: .35em 1.1em; font-size: 15px; }
.cm-foot .btn:only-child { margin-left: auto; }
.coachmark[data-kind="hint"] { background: #0d2433; color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 2px rgba(255, 184, 77, .75); font-size: 15px; }
.coachmark[data-kind="hint"] b { color: #ffd98a; }
.coachmark[data-kind="hint"] .cm-arrow { box-shadow: 2px 2px 0 0 rgba(255, 184, 77, .75); }
.coachmark[data-kind="hint"][data-side="below"] .cm-arrow { box-shadow: -2px -2px 0 0 rgba(255, 184, 77, .75); }
.cm-ring {
  position: fixed; z-index: 455; pointer-events: none; border-radius: 14px; border: 3px solid #ffd68a;
  box-shadow: 0 0 0 4px rgba(255, 184, 77, .35), 0 0 0 100vmax rgba(2, 8, 13, .45);
  animation: cmPulse 1.6s ease-in-out infinite;
}
.cm-ring[hidden] { display: none; }
.cm-ring.hint { box-shadow: 0 0 0 4px rgba(255, 184, 77, .35); }
@keyframes cmPulse { 0%, 100% { border-color: #ffd68a; } 50% { border-color: #fff4d6; } }
.lead-sm { font-size: 16px; line-height: 1.5; margin: 0; color: #d6e3e0; }
.tut-done p, .tut-done li { font-size: 16px; line-height: 1.5; color: #d6e3e0; }
.tut-done ul { padding-left: 1.2em; margin: 8px 0; }
.tut-done li { margin: 6px 0; }

/* How to Play: tabs */
.help-modal { width: min(640px, 100%); }
/* The Jukebox: playable tracks only, with All / Songs / Music box filters. Playback controls live in the player. */
.jukebox-modal { width: min(580px, 100%); }
.juke-filters { display: flex; gap: 6px; margin: 0 0 12px; }
.juke-filters .btn { flex: 1; min-height: 40px; padding-inline: .5em; white-space: nowrap; }
.juke-filters .btn[aria-pressed="true"] { color: var(--ink); background: var(--brass); border-color: var(--brass); }
.juke-more { margin: 14px 0 4px; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }
.juke-more b, .juke-more span { display: block; }
.juke-more b { margin-bottom: 3px; color: var(--foam); }
.juke-depth { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.juke-depth > span { margin-right: 4px; font-size: 14px; color: var(--muted); }
.juke-depth select { min-height: 36px; max-width: 100%; padding: 4px 8px; font: inherit; font-size: 14px; color: var(--text); background: #153448; border: 1px solid rgba(201, 162, 74, .55); border-radius: 8px; cursor: pointer; }
.juke-item { margin: 0 0 6px; background: rgba(10, 29, 43, .6); border: 1px solid rgba(212, 236, 232, .14); border-radius: 10px; }
.juke-item.cur { background: rgba(201, 162, 74, .13); border-color: var(--brass); }
.juke-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 12px 8px 10px; font: inherit; text-align: left; color: var(--text); background: none; border: 0; border-radius: 9px; cursor: pointer; }
.juke-row:not(:disabled):hover, .juke-row:focus-visible { background: rgba(18, 53, 72, .75); outline: 2px solid rgba(212, 236, 232, .45); outline-offset: -2px; }
.juke-item.cur .juke-row:hover { background: rgba(201, 162, 74, .1); }
.juke-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--foam); background: rgba(212, 236, 232, .1); }
.juke-ic svg { width: 16px; height: 16px; }
.juke-item.cur .juke-ic { color: var(--ink); background: var(--brass); }
.juke-txt { min-width: 0; }
.juke-txt b { display: block; font-size: 16px; line-height: 1.25; }
.juke-txt small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.juke-time { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.juke-t { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.juke-item.cur .juke-t { color: #f3dfb2; }
.juke-tag { padding: 1px 7px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; border-radius: 9px; }
.juke-tag.rec { color: #f3dfb2; border: 1px solid rgba(201, 162, 74, .55); }
.juke-tag.box { color: #9fdcd0; border: 1px solid rgba(63, 174, 138, .55); }
.juke-seek { flex: 1 1 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.juke-seek .btn { min-height: 36px; padding: .25em .6em; font-variant-numeric: tabular-nums; }
.juke-pos { width: 100%; min-width: 0; height: 28px; margin: 0; accent-color: var(--brass); cursor: pointer; }
/* the Jukebox's player (v0.32.0): what plays, previous, play or pause, next, shuffle and the music's volume. It stays at
   the top while the list scrolls under it (the body has no top padding, so it sticks flush) */
.jukebox-modal .modal-body { padding-top: 0; }
.juke-player { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 -16px 12px; padding: 12px 16px 10px; background: #0c2230; border-bottom: 1px solid rgba(201, 162, 74, .25); box-shadow: 0 6px 12px rgba(0, 0, 0, .3); }
.jp-top { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.jp-bottom { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.jp-links:empty { display: none; }
.juke-words { min-height: 36px; }
.btn.juke-score { min-height: 42px; color: #c3f5e9; background: rgba(63, 174, 138, .22); border-color: #68c6af; font-size: 14px; text-decoration: none; }
.juke-score:hover, .juke-score:focus-visible { background: rgba(63, 174, 138, .36); border-color: #9fdcd0; filter: none; }
.juke-score:focus-visible { outline: 2px solid #9fdcd0; outline-offset: 3px; }
.jp-now { flex: 1 1 200px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px; }
.jp-now small { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.jp-kind { color: #f3dfb2; }
.jp-now b { font-size: 17px; line-height: 1.3; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jp-t { font-size: 13px; color: #f3dfb2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jp-ctl { display: flex; align-items: center; gap: 8px; }
.jp-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%; color: var(--foam); background: rgba(212, 236, 232, .08); border: 1px solid rgba(212, 236, 232, .25); cursor: pointer; }
.jp-btn svg { width: 18px; height: 18px; }
.jp-btn:hover, .jp-btn:focus-visible { background: rgba(212, 236, 232, .16); outline: 2px solid rgba(212, 236, 232, .45); outline-offset: 1px; }
.jp-main { width: 48px; height: 48px; color: var(--ink); background: var(--brass); border-color: var(--brass); }
.jp-main svg { width: 20px; height: 20px; }
.jp-main:hover, .jp-main:focus-visible { background: #e0bb63; }
.jp-shuffle[aria-pressed="true"] { color: var(--brass); background: rgba(201, 162, 74, .2); border-color: var(--brass); }
/* the music's volume (v0.36.0): a short wedge that rises to the right, in teal, with a speaker and a label, so it can't
   be taken for a song's position bar (a long brass line) */
.jp-vol { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 4px 12px 4px 10px; border-radius: 999px; background: rgba(63, 174, 138, .12); border: 1px solid rgba(63, 174, 138, .45); color: #9fdcd0; }
.jp-vol-ic { display: grid; place-items: center; color: #9fdcd0; }
.jp-vol-ic svg { width: 20px; height: 20px; }
.jp-vol-lbl { font-size: 13px; font-weight: 650; letter-spacing: .04em; }
.jp-vol output { min-width: 2.8em; text-align: right; font-size: 13px; color: #cfe0dc; font-variant-numeric: tabular-nums; }
.jp-vol-track { position: relative; display: block; width: 112px; height: 28px; }
/* the wedge is drawn behind the slider (a clip on the slider's own track would clip its thumb too) */
.jp-vol-track::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; bottom: 5px; background: linear-gradient(to right, #6fd3b8 var(--v, 80%), rgba(159, 220, 208, .22) var(--v, 80%)); clip-path: polygon(0 100%, 100% 0, 100% 100%); pointer-events: none; }
.jp-vol-range { -webkit-appearance: none; appearance: none; position: relative; display: block; width: 100%; height: 100%; margin: 0; background: transparent; cursor: pointer; }
.jp-vol-range:focus-visible { outline: 2px solid rgba(159, 220, 208, .7); outline-offset: 2px; border-radius: 4px; }
.jp-vol-range::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.jp-vol-range::-moz-range-track { height: 28px; background: transparent; }
.jp-vol-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 6px; height: 24px; margin-top: 2px; border-radius: 3px; background: #e9fbf5; border: 1px solid #2f8f73; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.jp-vol-range::-moz-range-thumb { width: 6px; height: 24px; border-radius: 3px; background: #e9fbf5; border: 1px solid #2f8f73; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
@media (max-width: 420px) { .jp-vol { gap: 6px; padding-inline: 8px; } .jp-vol-track { width: 72px; } .juke-words { padding-inline: 8px; } }
@media (max-height: 520px) { .juke-player { position: static; } }
/* a song's words (js/lyrics.js), one page a song */
.lyrics-modal { width: min(520px, 100%); }
.lyrics section { margin: 0 0 18px; }
.lyrics section:last-child { margin-bottom: 4px; }
.lyrics h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lyrics p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--text); }
/* a line too long for the screen wraps with an indent, so the wrap doesn't read as a new line */
.lyrics p span { display: block; padding-left: 1em; text-indent: -1em; }
.help .tabs, .story .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(201, 162, 74, .4); background: rgba(10, 29, 43, .7); color: #cfe0dc; font-size: 15px; font-weight: 650; cursor: pointer; }
.tab.on { background: #f2c46b; color: #2a1504; border-color: #ffe0a0; }
.help-list { padding-left: 1.2em; margin: 0 0 10px; }
.help-list li { font-size: 16px; line-height: 1.5; color: #d6e3e0; margin: 6px 0; }
.help-list .c-badge { font-size: 12px; display: inline-block; margin: 2px 0; }
.help-dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; margin: 0 0 12px; font-size: 16px; line-height: 1.45; }
.help-dl dt { color: var(--amber); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.help-dl dt svg { width: 20px; height: 20px; }
.help-sub { margin: 14px 0 8px; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #9fb6c2); }
.help-dl dd { margin: 0; color: #d6e3e0; }
@media (max-width: 480px) { .help-dl { grid-template-columns: 1fr; gap: 2px; } .help-dl dd { margin-bottom: 8px; } }

/* small hand cards (phones, short landscape): fixed readable text instead of scaling down */
.small-cards .hand .card .c-name { font-size: 12px; }
.small-cards .hand .card { --card-text: 12px; --card-text-long: 11px; }
.small-cards .hand .card .c-type { display: none; }
.small-cards .hand .card .c-art { height: 4.4em; }
.small-cards .hand .card .c-text { top: 6.6em; }
.small-cards .hand .card:not(:last-child):not(.selected) .c-text { right: calc(var(--cover, 0px) + .3em); }
/* larger cards in a crowded hand: the same, so the next card never sits on top of the rules text */
.hand.crowded .card:not(:last-child):not(.selected):not(.lifted) .c-text { right: calc(var(--cover, 0px) + .3em); }
.small-cards .hand .card:not(:last-child):not(.selected) .c-name { right: calc(var(--cover, 0px) + .1em); justify-content: flex-start; }

/* short fields (landscape phones): smaller sprites so intents, HP and statuses all fit */
@container field (max-height: 280px) and (min-aspect-ratio: 1/1) {
  .units { padding-bottom: 3cqh; }
  .enemy .sprite { height: calc(34cqh * var(--scale, 1)); max-height: 44cqh; width: min(calc(40cqh * var(--scale, 1)), 100%); }
  .enemy { flex: 0 1 calc(40cqh * var(--scale, 1)); }
  .player .sprite { height: 42cqh; width: min(24cqw, 32cqh); }
  .enemy.flying .sprite { margin-bottom: 4cqh; }
  .unit .info { gap: 2px; }
  .statuses { min-height: 0; }
}
/* predictive badges never go below 12px. On small cards the next card covers the right of each one, so the badges sit
   on the strip that shows, at the left, one above the other (centred, they were cut to "LETHAI") */
.hand .card .c-badge { font-size: max(12px, .7em); }
.small-cards .hand .card .c-badge { font-size: 12px; letter-spacing: 0; padding: .1em .35em; }
/* 4px over the left edge, onto the card underneath, so LETHAL×2 fits the 66px that shows on a 360px phone */
.small-cards .hand .card .c-badges { top: -10px; left: -4px; transform: none; flex-direction: column; align-items: flex-start; gap: 2px; }
.small-cards .hand .card:first-child .c-badges { left: 2px; }

/* ===================== Interface pass: screens ===================== */
/* map: the reachable stops say what they are */
.map-header h2 { font-size: 22px; }
.map-header p { font-size: 15px; color: #cfe0dc; }
.node .node-label { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 800; color: #ffe2a8; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; }
.node-note { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 8px; color: #182831; background: #f5d39a; font: 700 12px/1.25 var(--sans); pointer-events: none; }
.map-header :is(#hester-job, #bosun-clue, #strange-dread) { max-width: 36em; margin: 4px auto 0; }
.map-header b, .choice:not(.card) .pin-job { color: #ffe2a8; }
.map-clue svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; color: #ffe2a8; }
.node.avail:hover .node-label, .node.avail:focus-visible .node-label { transform: translateX(-50%) scale(.87); }
.map-legend { font-size: 13px; gap: 6px 16px; color: #b9d0d2; }
.map-legend svg { width: 18px; height: 18px; }
.node.visited:not(.current) { opacity: .4; }

/* reward: the card choice first; Pearls and bonuses as one line */
.reward-screen { gap: 14px; }
.reward-screen h1 { font-size: clamp(26px, 4vw, 38px); }
.reward-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 16px; font-size: 15px; color: #e6dcc6; background: rgba(6, 20, 30, .85); border: 1px solid rgba(201, 162, 74, .35); }
.chip svg { width: 18px; height: 18px; }
.chip b { color: #ffe2a8; }
.chip.bonus { color: #ffd98a; }
.reward-main { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 8px 16px; border-radius: 16px; background: rgba(6, 20, 30, .75); border: 1px solid rgba(255, 184, 77, .45); }
.reward-main h2 { font-size: 22px; color: #ffe6b0; }
.reward-main .card-row .card.static { --cw: clamp(128px, 28vw, 172px); }
.reward-main .card-row { padding-top: 8px; } /* room for a focused or chosen card's lift below the heading */
.opening-option { display: grid; justify-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #d6e3e0; }
.reward-item b { font-size: 16px; }
.reward-item small { font-size: 14px; }
.btn.wide { min-width: min(280px, 100%); }

/* shop: bigger cards and prices on phones */
.price { font-size: 17px; }
.price svg { width: 18px; height: 18px; }
.shop-tile b { font-size: 15px; }
.shop-tile small { font-size: 14px; color: #b9cfd0; }
.shop-tile { width: 164px; }
.speech { font-size: 16px; }
.panel h3 { font-size: 20px; }
@media (max-width: 600px) {
  .shop-item .card.static { --cw: clamp(136px, 40vw, 160px); }
  .shop-tile { width: calc(50% - 6px); }
  .card-row .card.static { --cw: clamp(104px, 29vw, 150px); }
  .reward-main .card-row .card.static { --cw: clamp(136px, 41vw, 160px); }
  .reward-main .card-row { gap: 10px; }
  .opening-draft .card-row { display: grid; width: 100%; }
  .opening-draft .opening-option { justify-items: stretch; text-align: left; gap: 3px; }
  .opening-draft .opening-option > span { padding-left: 4px; }
  .reward-main.opening-draft .card-row .card.static { --cw: 100%; --coin: 13px; height: auto; font-size: 14px; touch-action: pan-y; }
  .opening-draft .card .frame { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 10px; padding: 6px; }
  .opening-draft .c-art { position: static; grid-row: span 2; align-self: stretch; min-height: 48px; height: auto; }
  .opening-draft .c-name, .opening-draft .c-text { position: static; justify-content: flex-start; height: auto; text-align: left; }
  .opening-draft .c-name { align-self: end; font-size: 15px; white-space: normal; }
  .opening-draft .c-text, .opening-draft .c-text.long { align-self: start; font-size: 14px; }
  .opening-draft .c-type { display: none; }
  .opening-draft .card.static:is(.picked, :hover, :focus-visible) { transform: none; }
}

/* rest, events, end */
.choice:not(.card) b { font-size: 17px; }
.choice:not(.card) span { font-size: 15px; }
.stats span { font-size: 13px; }
.reward-item small, .choice:not(.card) .reason { font-size: 14px; }
.node.lbl-l .node-label { left: 0; transform: none; }
.node.lbl-r .node-label { left: auto; right: 0; transform: none; }
/* readable minimums: the type pill repeats the border colour, so hand cards drop it; elsewhere it gets a floor */
.hand .card .c-type { display: none; }
.card.static .c-type { font-size: max(12px, .62em); padding: .05em .7em; }
.small-cards .hand .card { --coin: 15px; }
.sale-tag { font-size: 12px; }
/* the raised card is scaled up 1.6x on phones, so smaller CSS text still reads at 15-17px and long rules fit */
.small-cards .hand .card.selected { --card-text: 11px; --card-text-long: 9.5px; }
.small-cards .hand .card.selected .c-art { height: 3.8em; }
.small-cards .hand .card.selected .c-text { top: 6em; }
@media (max-height: 500px) and (min-width: 601px) {
  .hand .card { --coin: 14px; --card-text: 12px; --card-text-long: 12px; }
}
.card.static .c-type { top: calc(var(--cw) * .685 - 14px); }
.map-header h2, .map-header p { text-shadow: 0 2px 6px #000, 0 0 12px #06121c; }
@media (max-height: 500px) and (min-width: 601px) {
  /* landscape raises cards 1.35x, so this still renders at about 12-13.5px */
  .small-cards .hand .card.selected { --card-text: 10px; --card-text-long: 9px; }
}

/* ---------- Workshop (permanent kit) ---------- */
.workshop-modal { width: min(760px, 100%); }
/* a picture of the room above the Workshop's and the Lazaret's lists */
.ws-art { width: 100%; height: clamp(96px, 24vw, 190px); margin: 0 0 12px; border-radius: 10px; background: #0a1d2b center/cover no-repeat; border: 1px solid rgba(201, 162, 74, .35); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.ws-lead { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: #d6e3e0; }
.keeper-pick, .outfit-pick { margin-bottom: 16px; }
.keeper-pick .ws-place, .outfit-pick .ws-place { margin-top: 0; }
/* the keeper cards and the outfit pictures look and choose like the kit's (.kit-opt): amber ring and a word */
.keeper-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.keeper-option { display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto 1fr; align-items: baseline; gap: 2px 12px; padding: 8px 12px 8px 8px; text-align: left; color: var(--text); background: rgba(6, 20, 30, .88); border: 1px solid rgba(201, 162, 74, .35); border-radius: 12px; cursor: pointer; }
.keeper-option img { grid-row: span 2; align-self: center; width: 56px; height: 84px; object-fit: contain; object-position: 50% 100%; }
.keeper-option b { color: #f3dfb2; font: 700 18px var(--serif); }
.keeper-option small { grid-column: 2 / span 2; align-self: start; color: #d6e3e0; font-size: 14px; line-height: 1.35; }
.keeper-option .opt-state, .outfit-opt .opt-state, .outfit-tile .opt-state { font-size: 13px; font-weight: 700; color: var(--muted); }
.keeper-option:hover, .outfit-opt:hover { border-color: rgba(255, 184, 77, .7); }
.keeper-option[aria-pressed="true"], .outfit-opt[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber), 0 0 16px rgba(255, 184, 77, .35); background: #10293a; }
.keeper-option[aria-pressed="true"] .opt-state, .outfit-opt[aria-pressed="true"] .opt-state { color: var(--amber); }
/* the padding leaves room for the chosen picture's ring inside the scrolling row */
.outfit-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px; padding: 4px; }
.outfit-opt, .outfit-tile { flex: 0 0 108px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 8px; text-align: center; color: var(--text); background: rgba(6, 20, 30, .88); border: 1px solid rgba(201, 162, 74, .35); border-radius: 12px; cursor: pointer; }
.outfit-opt img, .outfit-tile img { width: 72px; height: 108px; object-fit: contain; object-position: 50% 100%; pointer-events: none; }
.outfit-opt b, .outfit-tile b { margin-top: 2px; font-size: 14px; line-height: 1.25; color: #f3dfb2; }
.outfit-opt .opt-state, .outfit-tile .opt-state { margin-top: auto; }
/* not a choice: the keeper as they go under the sea (with a dress packed), or a keeper with no outfits to choose */
.outfit-tile { border-style: dashed; background: rgba(6, 20, 30, .5); }
.outfit-tile .opt-state { color: #9fc4c6; }
/* a dress owned but not packed: the tile keeps its place, dimmed like locked kit */
.outfit-dive.off img { filter: grayscale(1) brightness(.55); }
.outfit-dive.off b, .outfit-dive.off .opt-state { color: var(--muted); }
/* seven (six outfits and the diving tile) still stand in one row of the wide window; the longest name keeps one tile wider */
@media (min-width: 601px) { .outfit-strip.many > * { flex-basis: 92px; } }
/* before there is kit to choose, Pack is only her picture and her outfits: one centred column */
.pack-first { width: min(540px, 100%); }
.pack-first .outfit-pick { margin-bottom: 4px; }
.pack-first .outfit-pick .ws-place { text-align: center; }
.pack-first .outfit-strip { justify-content: center; }
.outfit-preview { display: flex; justify-content: center; margin-bottom: 14px; }
.outfit-preview img { height: clamp(145px, 34dvh, 270px); max-width: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); }
@media (max-width: 600px) {
  /* one row that scrolls sideways: the cut-off picture at the edge says there are more */
  .outfit-strip { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding: 0 4px; scrollbar-width: none; }
  .outfit-strip::-webkit-scrollbar { display: none; }
  .outfit-opt, .outfit-tile { flex-basis: 100px; scroll-snap-align: start; }
  /* centred with margins, not justify-content, so a row too long for the screen still scrolls from its start */
  .pack-first .outfit-strip { justify-content: flex-start; }
  .pack-first .outfit-opt:first-child, .pack-first .outfit-tile:first-child { margin-left: auto; }
  .pack-first .outfit-opt:last-child, .pack-first .outfit-tile:last-child { margin-right: auto; }
  .outfit-opt img, .outfit-tile img { width: 60px; height: 90px; }
}
/* a phone on its side: her picture beside her outfits, so the choice needs no scrolling */
@media (max-height: 480px) and (orientation: landscape) {
  .pack-look { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 16px; }
  .pack-first .outfit-preview, .pack-first .outfit-pick { margin-bottom: 0; }
  .pack-first .outfit-preview img { height: clamp(145px, 46dvh, 200px); }
  .outfit-opt img, .outfit-tile img { width: 60px; height: 90px; }
}
@media (max-width: 480px) {
  .keeper-options { grid-template-columns: 1fr; gap: 8px; }
  .keeper-option { grid-template-columns: 44px 1fr auto; gap: 2px 10px; padding: 6px 10px 6px 6px; }
  .keeper-option img { width: 44px; height: 66px; }
}
.ws-bal { display: flex; justify-content: center; margin: 0 0 14px; }
/* kit is square with a brass corner, so it never reads as a (round) keepsake */
.medal.gear { border-radius: 10px; border-color: #b8893a; background: radial-gradient(circle at 50% 40%, #3a3322, #14120c 75%); }
.gear-tile .medal.gear { width: 64px; height: 64px; }
.gear-tile.locked { cursor: default; }
.gear-tile.locked .medal img { filter: grayscale(1) brightness(.55); }
.g-state { font-size: 13px; font-weight: 700; color: #9ff0b5; }
.g-lock { display: flex; gap: 6px; align-items: flex-start; text-align: left; font-size: 13px; line-height: 1.35; color: #cbbfa8; }
.g-lock svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; color: #a8987a; }
.g-lock b { color: #e6d3a8; }
/* The kit view (Workshop and Pack): Wren with a slot for each place around her, lines to where each piece sits,
   and a tray with every piece for the chosen slot. On a phone the slots stand in one column beside her, no lines. */
.doll { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: 'left wren right'; align-items: center; gap: 0 22px; margin: 2px 0 12px; }
.doll-wren { grid-area: wren; width: clamp(150px, 26vw, 220px); height: clamp(220px, 40vh, 320px); display: flex; align-items: flex-end; }
.doll-wren img { width: 100%; height: calc(100% * var(--wren-tall)); pointer-events: none; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); }
.doll-side { display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 2; }
.doll-side.left { grid-area: left; align-items: flex-end; }
.doll-side.right { grid-area: right; align-items: flex-start; }
/* over Wren (her drop-shadow filter would otherwise paint her on top), under the slots */
.doll-lines { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; overflow: visible; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .9)); }
.doll-lines path { fill: none; stroke: rgba(201, 162, 74, .45); stroke-width: 1.4; }
.doll-lines circle { fill: rgba(201, 162, 74, .7); }
.doll-lines .on path { stroke: var(--amber); stroke-width: 2; }
.doll-lines .on circle { fill: var(--amber); }
.kit-slot { position: relative; display: flex; align-items: center; gap: 10px; width: min(100%, 220px); min-height: 60px; padding: 6px 12px 6px 6px; border-radius: 12px; background: rgba(6, 20, 30, .88); border: 1px solid rgba(201, 162, 74, .35); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.doll-side.left .kit-slot { flex-direction: row-reverse; text-align: right; padding: 6px 6px 6px 12px; }
.kit-slot:hover { border-color: rgba(255, 184, 77, .7); }
.kit-slot[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber), 0 0 16px rgba(255, 184, 77, .4); }
.kit-slot .medal { width: 48px; height: 48px; cursor: pointer; }
.kit-slot .medal.empty { color: rgba(201, 162, 74, .5); }
.kit-slot .medal.empty svg { width: 60%; height: 60%; }
.ks-txt { display: flex; flex-direction: column; min-width: 0; }
.ks-txt small { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ks-txt b { font-size: 15px; line-height: 1.25; color: #f3dfb2; }
.kit-slot.empty .ks-txt b { font-weight: 600; color: #9fb4b4; }
/* something in this place can be bought now */
.ks-new { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #14120c; border: 1px solid var(--amber); }
.doll-side.left .ks-new { right: auto; left: -7px; }
.ks-new .salv { width: 15px; height: 15px; }
.kit-tray { padding: 12px; border-radius: 12px; background: rgba(4, 14, 22, .6); border: 1px solid rgba(201, 162, 74, .25); }
.kit-tray .ws-place { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 0 0 10px; scroll-margin: 12px; }
.kit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.kit-opt { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; align-content: start; gap: 2px 12px; padding: 8px 12px 8px 8px; border-radius: 12px; background: rgba(6, 20, 30, .88); border: 1px solid rgba(201, 162, 74, .35); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.kit-opt:hover { border-color: rgba(255, 184, 77, .7); }
.kit-opt .medal.gear { width: 52px; height: 52px; grid-row: span 2; align-self: start; cursor: inherit; }
.kit-opt b { font-size: 15px; color: #f3dfb2; }
.kit-opt small { grid-column: 2 / span 2; font-size: 14px; line-height: 1.35; color: #b9cfd0; }
.kit-opt .opt-state, .kit-opt .price { justify-self: end; }
.kit-opt .opt-state { font-size: 13px; font-weight: 700; color: var(--muted); }
.kit-opt.worn { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber), 0 0 16px rgba(255, 184, 77, .35); }
.kit-opt.worn .opt-state { color: var(--amber); }
.kit-opt.locked { cursor: default; background: rgba(6, 20, 30, .55); }
.kit-opt.locked:hover { border-color: rgba(201, 162, 74, .35); }
.kit-opt.locked .medal img { filter: grayscale(1) brightness(.55); }
.kit-opt.locked b { color: #c9bfa9; }
.kit-opt .g-lock { grid-column: 2 / span 2; margin-top: 4px; }
@media (max-width: 600px) {
  .doll { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); grid-template-areas: none; gap: 8px 10px; }
  .doll-side { display: contents; }
  .doll-wren { grid-column: 1; grid-row: 1 / span 5; width: 100%; height: 100%; min-height: 230px; }
  .doll-wren img { object-position: 50% 50%; }
  /* one column in BL.KIT_PLACES order */
  .kit-slot, .doll-side.left .kit-slot { order: var(--o); grid-column: 2; width: 100%; min-height: 54px; flex-direction: row; text-align: left; padding: 5px 10px 5px 5px; }
  .kit-slot .medal { width: 42px; height: 42px; }
  .doll-side.left .ks-new { left: auto; right: -7px; }
  .doll-lines { display: none; }
  .kit-tray { padding: 10px 8px; }
}
/* a phone on its side: a shorter Wren and tighter slots, so she and the tray fit the short view */
@media (max-height: 500px) and (min-width: 601px) {
  .doll-wren { height: 200px; width: 140px; }
  .doll-side { gap: 8px; }
  .kit-slot { min-height: 50px; padding-top: 4px; padding-bottom: 4px; }
  .kit-slot .medal { width: 40px; height: 40px; }
}
.ws-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ws-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.ws-btn small { font-size: 14px; font-weight: 700; color: #e6d3a8; white-space: nowrap; }
.salvage-box { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 10px; background: rgba(40, 32, 14, .75); border: 1px solid rgba(201, 162, 74, .55); color: #f1e6cf; font-size: 15px; text-align: left; }
.salvage-box svg { width: 24px; height: 24px; flex: 0 0 auto; }
.salvage-box b { color: #ffe2a8; }
.hud .gear-pack { border-radius: 9px; border-color: #b8893a; background: radial-gradient(circle at 50% 40%, #3a3322, #14120c 75%); color: #e8c77e; overflow: visible; }
.hud .gear-pack svg { width: 20px; height: 20px; }
.hud .gear-pack .n { position: absolute; right: -5px; bottom: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #f2c46b; color: #2a1504; font-size: 12px; font-weight: 800; line-height: 18px; }
img.salv { width: 20px; height: 20px; object-fit: contain; flex: 0 0 auto; }
.price img.salv { width: 20px; height: 20px; }
.chip img.salv { width: 24px; height: 24px; }
.ws-btn img.salv { width: 24px; height: 24px; }
.salvage-box img.salv { width: 40px; height: 40px; }

/* ---------- Debug mode (js/debug.js, on with ?debug) ---------- */
.dbg-tab { position: fixed; left: 0; top: 28%; z-index: 450; padding: 10px 5px; border: 1px solid rgba(255, 120, 120, .6); border-left: 0; border-radius: 0 8px 8px 0;
  background: rgba(60, 10, 14, .85); color: #ffc9c9; font: 800 12px/1 var(--sans); letter-spacing: .12em; writing-mode: vertical-rl; cursor: pointer; opacity: .75; }
.dbg-tab:hover, .dbg-tab:focus-visible { opacity: 1; }
.dbg-modal { width: min(720px, 100%); }
.dbg-modal .scroll-cue { top: 14px; right: 64px; bottom: auto; left: auto; transform: none; animation: none; }
.dbg { display: grid; gap: 12px; align-items: start; }
.dbg-sec { min-width: 0; padding: 12px; border: 1px solid rgba(201, 162, 74, .25); border-radius: 12px; background: rgba(5, 15, 24, .42); }
.dbg-sec h3 { margin: 0 0 8px; font-size: 17px; color: #f3dfb2; }
.dbg-info { margin: -2px 0 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.dbg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dbg .btn.small { min-height: 44px; max-width: 100%; }
.dbg .btn[aria-pressed="true"] { border-color: var(--kelp); background: rgba(63, 174, 138, .22); }
.dbg-unlock-actions, .dbg-pair, .dbg-swell { width: 100%; min-width: 0; display: grid; gap: 6px; }
.dbg-pair { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.dbg-sel { min-width: 0; min-height: 44px; padding: 0 8px; border-radius: 8px; border: 1px solid rgba(201, 162, 74, .45); background: #0b1f2c; color: #e6dcc6; font: 14px var(--sans); }
.dbg-swell { font-size: 14px; }
.dbg-steps { width: min(100%, 380px); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.dbg-steps .btn { padding-inline: 4px; }
@media (min-width: 660px) {
  .dbg, .dbg-unlock-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dbg-wide { grid-column: 1 / -1; }
}
.dbg-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Kit places and keepsake Charge (v0.10.0) ---------- */
.ws-place { margin: 14px 0 8px; font-size: 16px; color: #f3dfb2; text-align: left; }
.ws-place small { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.kit-tile .g-state { color: var(--muted); }
.kit-tile.chosen .g-state { color: var(--amber); }
.k-charge { display: inline-block; padding: 1px 7px; border-radius: 8px; border: 1px solid rgba(140, 220, 205, .45); background: rgba(120, 200, 190, .14); color: #bff3e6; font-size: 12px; font-weight: 700; white-space: nowrap; }
.k-after { font-size: 13px; font-weight: 700; color: #9ff0b5; }
.k-after.over { color: #ffb3bd; }
.leave-ks { display: block; margin: 10px auto 0; }
.ks-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.ks-actions .leave-ks { margin: 0; }
.hud .charge { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; height: 30px; padding: 0 8px 0 5px; border-radius: 15px; border: 1px solid rgba(140, 220, 205, .5); background: rgba(10, 40, 44, .8); color: #bff3e6; font: 700 13px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.hud .charge svg { width: 18px; height: 18px; }
.hud .charge.over { border-color: rgba(255, 140, 150, .7); background: rgba(60, 14, 20, .8); color: #ffc9cf; }
@media (max-width: 600px) {
  /* on phones the bell, kit and Charge sit in the second row with the keepsakes */
  .hud .medal.bell, .hud .gear-pack, .hud .charge { order: 10; }
  .hud .medal.bell, .hud .gear-pack { width: 30px; height: 30px; }
}

/* ---------- Story so far ---------- */
.st-ch + .st-ch, .st-ch + .st-lock, .st-lock + .st-ch { margin-top: 16px; }
.st-ch h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 21px; line-height: 1.25; color: #f3dfb2; }
.st-ch h3 small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st-ch p, .st-note p { margin: 0 0 10px; font-family: var(--serif); font-size: 17px; line-height: 1.55; color: #d8e8e5; max-width: 38em; }
.st-ch .new-pill, .st-note .new-pill { font-family: var(--sans); vertical-align: middle; }
.st-lock { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed rgba(201, 162, 74, .3); font-size: 15px; line-height: 1.4; color: #a9bcb9; }
.st-lock svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; color: #a8987a; }
.st-lock b { color: #cfd9d6; font-weight: 650; }
.st-group { margin: 16px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st-group:first-child { margin-top: 0; }
.story .help-dl dt { align-items: flex-start; }
.st-count { margin: 0 0 12px; font-size: 15px; color: #cfe0dc; }
.st-count b { color: #f3dfb2; }
.st-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(10, 29, 43, .6); border: 1px solid rgba(201, 162, 74, .22); }
.st-note img { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 8px; object-fit: cover; background: #0a1d2b; }
.st-note h3 { margin: 0 0 4px; font-size: 17px; color: #f3dfb2; }
.st-note p { margin: 0; font-size: 16px; }
@media (max-width: 480px) { .st-note img { width: 56px; height: 56px; } }

/* ---------- The opening ---------- */
.opening { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; overflow: hidden; background: #040c13; }
.op-art { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; background-position: var(--pos); transform-origin: var(--pos); transform: scale(var(--z, 1)); animation: opDrift 14s ease-out both; }
@media (min-aspect-ratio: 1/1) { .op-art { --z: var(--wz, 1); background-position: var(--wpos); transform-origin: var(--wpos); } }
.op-fig { position: relative; height: calc(min(46vh, 400px) * var(--wren-tall)); margin-bottom: -18px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .7)); animation: opIn .7s ease both; }
.op-inner { position: relative; width: 100%; padding: 64px 20px 18px; background: linear-gradient(180deg, rgba(4, 12, 19, 0), rgba(4, 12, 19, .9) 42%, rgba(4, 12, 19, .97)); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.op-text { margin: 0; max-width: 34em; font-family: var(--serif); font-size: clamp(17px, 2.3vw, 22px); line-height: 1.55; color: #eef6f3; text-align: center; text-shadow: 0 2px 8px #000; animation: opIn .7s ease both; }
.opening-night .op-art { filter: brightness(.16); animation: opNight .85s ease-out; }
@keyframes opNight { from { filter: brightness(.8); } to { filter: brightness(.16); } }
.opening-framed { justify-content: center; overflow-y: auto; }
.opening-framed .op-art { position: relative; inset: auto; width: 100%; min-height: 0; aspect-ratio: 3/2; background-size: contain; animation: none; }
.opening-framed .op-inner { flex: none; padding: 16px; background: none; }
.cask-note { max-width: 34em; margin: 0 auto; padding: 12px 18px; background: #e6cc9a; color: #302418; border: 1px solid #a77d4a; border-radius: 4px; font: italic 17px/1.45 var(--serif); }
.quest-modal .ws-art { background-position: center 20%; margin-bottom: 12px; }
.quest-modal h3, .quest-modal b { color: #ffe2a8; }
.quest-found { display: grid; gap: 5px; width: min(560px, 100%); padding: 12px 16px; border: 1px solid #bf9957; border-radius: 10px; background: #201d17; color: #f9e4b9; text-align: center; }
.quest-found .btn { justify-self: center; margin-top: 4px; }
.title-buttons .story-lead { border-color: #ffe1a4; box-shadow: 0 0 16px #e9ab4966; animation: storyGlow 2s ease-in-out 3; }
@keyframes storyGlow { 50% { box-shadow: 0 0 24px #ffbf5899; } }
.op-foot { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; width: min(34em, 100%); }
.op-foot .btn { min-height: 48px; min-width: 110px; font-size: 17px; }
.op-foot .btn.ghost { min-width: 0; padding-left: 14px; padding-right: 14px; }
.op-dots { display: flex; gap: 7px; margin-right: auto; }
.op-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(212, 236, 232, .3); }
.op-dots i.on { background: #f2c46b; }
@media (max-aspect-ratio: 4/5) {
  .opening-together { justify-content: center; overflow-y: auto; }
  .opening-together .op-art { position: relative; inset: auto; flex: none; width: 100%; aspect-ratio: 3/2; background-position: center; animation: none; }
  .opening-together .op-inner { padding: 16px 16px 12px; background: none; }
}
@keyframes opIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes opDrift { from { transform: scale(calc(var(--z, 1) * 1.08)); } to { transform: scale(var(--z, 1)); } }
@media (max-height: 500px) {
  .op-fig { height: calc(50vh * var(--wren-tall)); margin-bottom: -14px; }
  .op-inner { padding: 36px 20px 10px; gap: 8px; }
  .op-text { font-size: 16px; line-height: 1.45; max-width: 44em; }
  .op-foot { width: min(44em, 100%); }
  .op-foot .btn { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) { .op-art, .op-fig, .op-text { animation: none; } }

/* ---------- The Lazaret ---------- */
.btn-count { font-size: 14px; font-weight: 700; color: #e6d3a8; white-space: nowrap; }
.lz-roil { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 6px; }
.lz-roil ul { margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; color: #d6e3e0; text-align: center; }
.lz-line { margin: 0 0 10px; font-size: 15px; line-height: 1.5; color: #d6e3e0; text-align: left; }
.lz-line b, .lz-roil li b { color: #ffe2a8; }
.lz-line b.calm, .lz-roil li b.calm { color: #9ff0b5; }
.lz-line b.roiled, .lz-roil li b.roiled { color: #ffb0a0; }
/* the Lazaret as a stock (v0.36.0): copies kept, and a spare broken down */
.lz-row { align-items: flex-start; }
.lz-cell { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.lz-cell .shop-tile { position: relative; }
.lz-count { position: absolute; top: 6px; right: 8px; padding: 0 7px; border-radius: 9px; font-size: 13px; font-weight: 800; line-height: 20px; color: #2a1504; background: #f2c46b; }
.lz-break { width: 100%; white-space: normal; line-height: 1.25; }
/* the lantern in the Workshop (v0.36.0): the Hold, bought in steps */
.lantern-panel { margin-top: 8px; padding: 2px 14px 14px; border-radius: 12px; background: rgba(6, 20, 30, .6); border: 1px solid rgba(201, 162, 74, .3); text-align: left; }
.lantern-panel .ws-place b { color: #ffe2a8; }
.lt-lead { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: #d6e3e0; }
.lt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.lt-pips { display: flex; gap: 6px; }
.lt-pips i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 210, 122, .6); background: transparent; }
.lt-pips i.on { background: radial-gradient(circle at 40% 35%, #fff4cf, #ffb84d 60%, #a8620b); border-color: #ffd27a; box-shadow: 0 0 8px rgba(255, 184, 77, .7); }
.lt-buy[aria-disabled="true"] { opacity: .6; }
.lt-done { margin: 0; font-size: 15px; color: #9ff0b5; }
.lz-empty { padding: 12px 14px; border-radius: 10px; border: 1px dashed rgba(201, 162, 74, .45); text-align: center; }
.lz-missing { opacity: .7; }
.lz-missing b { color: #a9b9b8; }
.kit-tile .k-charge { font-size: 13px; }
.k-deep { display: inline-block; padding: 1px 7px; border-radius: 8px; border: 1px solid rgba(232, 190, 110, .5); background: rgba(232, 190, 110, .14); color: #ffe2a8; font-size: 12px; font-weight: 700; white-space: nowrap; }
/* every unlock on the end screen is the same purple box; only a loss gets its own colour */
.unlock-box, button.unlock-box { font-size: 15px; line-height: 1.45; }
.unlock-box b { color: #ffe2a8; }
.lz-box.lost { background: rgba(50, 22, 22, .78); border-color: rgba(255, 160, 140, .5); color: #f6dcd6; }
/* a fall (v0.36.0): hold on to one keepsake */
.lz-keep { text-align: left; }
.lz-keep p { margin: 0 0 12px; line-height: 1.45; }
.lz-keep .shop-row { margin-top: 4px; }
.lz-keep .shop-tile { color: var(--text); }
/* how the score adds up */
.score-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 12px 16px; width: 100%; }
.score-row .score-box { align-self: center; }
.end-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.score-parts { width: min(460px, 100%); background: rgba(6, 20, 30, .85); border: 1px solid rgba(201, 162, 74, .3); border-radius: 10px; padding: 6px 14px 8px; text-align: left; }
.score-parts summary { cursor: pointer; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.score-parts dl { margin: 4px 0 0; }
.score-parts dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border-top: 1px solid rgba(201, 162, 74, .14); font-size: 15px; }
.score-parts dt { color: #e3eeec; }
.score-parts dt small { color: var(--muted); font-size: 13px; margin-left: 4px; white-space: nowrap; }
.score-parts dd { margin: 0; font-variant-numeric: tabular-nums; color: #ffe2a8; white-space: nowrap; }
.score-parts .mult dt, .score-parts .mult dd { color: #c9b8ff; }
.score-parts .sum { border-top: 1px solid rgba(201, 162, 74, .5); font-weight: 800; }
.score-parts .sum dd { font-family: var(--serif); font-size: 18px; }
.ws-head { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(201, 162, 74, .25); }

/* ---------- The logbook ---------- */
.logbook { margin: 0; display: flex; flex-direction: column; }
.logbook > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 2px; border-bottom: 1px solid rgba(201, 162, 74, .2); }
.logbook > div:last-child { border-bottom: 0; }
.logbook dt { font-size: 15px; color: #c4dad8; }
.logbook dd { margin: 0; font-size: 16px; font-weight: 700; color: #ffe2a8; text-align: right; }
.logbook dd small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.log-note { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* the menu's Reset progress, and the button that confirms it */
.choice.danger b { color: var(--bad); }
.btn.danger { background: rgba(120, 24, 24, .9); border-color: rgba(255, 138, 122, .7); color: #ffe9e4; }
.btn.danger:hover, .btn.danger:focus-visible { background: rgba(150, 30, 30, .95); }
.reset-list { text-align: left; margin: 6px 0 10px; padding-left: 1.2em; line-height: 1.5; }

/* Rites stay in play, so in the hand they wear their type: a pill on the lower left of the picture, where the next
   card in a crowded hand never covers it (the other types show theirs only outside the hand) */
.hand .card.t-rite .c-type, .small-cards .hand .card.t-rite .c-type {
  display: block; left: .55em; transform: none; font-size: max(12px, .62em); padding: .05em .6em; letter-spacing: .1em;
  top: calc(var(--cw) * .685 - 1.45em); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.small-cards .hand .card.t-rite .c-type { top: calc(var(--cw) * .635 - 1.45em); }
.small-cards .hand .card.t-rite.selected .c-type { top: calc(var(--cw) * .575 - 1.45em); }

/* Bail and Stir, at the two ends of the Swell bar: once a turn, 1 Light for one step without a card */
.tb-act {
  display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; height: 26px; padding: 0 7px; border-radius: 13px; cursor: pointer;
  font: inherit; font-size: 12px; letter-spacing: .03em; color: #e6f7fa; background: rgba(12, 44, 62, .95); border: 1px solid rgba(150, 220, 240, .55);
}
.tb-act b { font-weight: 800; }
.tb-act i { font-style: normal; font-weight: 900; font-size: 12px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: #2a1503;
  background: radial-gradient(circle at 40% 35%, #fff0c8, #f3a432 55%, #8a4d0a); }
.tb-act .tb-arrow { font-size: 12px; opacity: .85; }
.tb-act.bail { border-color: rgba(120, 220, 180, .7); }
.tb-act.stir { border-color: rgba(190, 255, 225, .75); }
.tb-act:hover:not([aria-disabled]), .tb-act:focus-visible { background: rgba(24, 74, 100, .98); box-shadow: 0 0 10px rgba(95, 211, 238, .5); }
.tb-act[aria-disabled] { opacity: .45; cursor: default; }
.tb-act.used { opacity: .3; }
@media (max-width: 480px) {
  .tidebar { gap: 5px; padding-left: 6px; padding-right: 6px; }
  .tb-act { padding: 0 5px; gap: 2px; }
  .tb-act .tb-arrow { display: none; }
  .tidebar.has-bash { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 1px 5px; }
  .has-bash .tb-label { grid-column: 2; grid-row: 1; justify-self: start; }
  .has-bash .tb-label.crest { justify-self: end; }
  .has-bash .tb-track { grid-column: 2; grid-row: 2; }
  .has-bash .tb-act { grid-row: 1 / span 2; }
  .has-bash .tb-act.bail { grid-column: 1; }
  .has-bash .tb-act.stir { grid-column: 3; }
  .has-bash .tb-act.bash { grid-column: 4; }
}

/* the menu's Sound effects and Music rows: a switch with a volume slider beside it, or under it when narrow */
.choice.vol-row { cursor: default; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 18px; }
.choice.vol-row:hover { filter: none; transform: none; }
.vol-switch { all: unset; box-sizing: border-box; flex: 0 0 auto; min-width: 172px; min-height: 32px; display: flex; align-items: center; cursor: pointer; border-radius: 6px; }
.vol-switch:hover b { text-decoration: underline; text-underline-offset: 3px; }
.vol-switch:focus-visible { outline: 2px solid #ffe2a8; outline-offset: 4px; }
.vol-line { flex: 1 1 200px; display: flex; align-items: center; gap: 12px; }
.vol-line input { flex: 1; min-width: 0; height: 32px; margin: 0; accent-color: #c9a24a; cursor: pointer; }
.vol-line output { min-width: 3.2em; text-align: right; font-size: 14px; color: #cfe0dc; font-variant-numeric: tabular-nums; }
.vol-row.off .vol-line { opacity: .45; }

/* ---------- Rests: the Cove and the stair down (v0.31.0) ---------- */
/* the lantern in rest.webp stands right of centre: keep it in a phone's crop */
.rest-scene, .stair-scene { background-position: 64% center; }
/* the stairs' own pictures have their lamp further right (about 74%): keep it on a phone's screen */
.stair-scene { background-position: 72% center; }
/* its light flickers, and motes drift up from it */
.rest-glow { position: fixed; inset: var(--hud-h) 0 0 0; pointer-events: none; overflow: hidden; }
.rest-glow::before {
  content: ""; position: absolute; left: 70%; top: 40%; width: 70vmax; height: 70vmax; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 184, 77, .26), rgba(255, 140, 50, .1) 30%, transparent 62%);
  mix-blend-mode: screen; animation: lampFlicker 5.2s ease-in-out infinite;
}
.rest-glow i {
  position: absolute; bottom: 8%; left: 70%; width: 4px; height: 4px; border-radius: 50%; opacity: 0;
  background: #ffd98a; box-shadow: 0 0 6px 2px rgba(255, 184, 77, .7); animation: moteRise 9s linear infinite;
}
.rest-glow i:nth-child(2) { left: 62%; animation-delay: -2.5s; animation-duration: 11s; }
.rest-glow i:nth-child(3) { left: 77%; animation-delay: -5s; width: 3px; height: 3px; }
.rest-glow i:nth-child(4) { left: 55%; animation-delay: -7s; animation-duration: 12s; }
.rest-glow i:nth-child(5) { left: 84%; animation-delay: -3.6s; animation-duration: 10s; width: 3px; height: 3px; }
.rest-glow i:nth-child(6) { left: 68%; animation-delay: -8.4s; animation-duration: 13s; }
@keyframes lampFlicker { 0%, 100% { opacity: .85; } 18% { opacity: .7; } 22% { opacity: .95; } 47% { opacity: .78; } 63% { opacity: 1; } 81% { opacity: .74; } }
@keyframes moteRise {
  0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; }
  50% { transform: translate(-18px, -42vh); } 85% { opacity: .5; } 100% { transform: translate(10px, -84vh); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .rest-glow::before { animation: none; } .rest-glow i { display: none; } }

/* the Cove's two choices carry an icon, and the rest shows the HP it brings */
.choice.with-ic { flex-direction: row; align-items: center; gap: 14px; }
.ch-ic, .so-ic {
  flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--amber);
  background: radial-gradient(circle at 50% 40%, rgba(255, 184, 77, .3), rgba(5, 15, 24, .7) 70%); border: 1px solid rgba(255, 184, 77, .55);
  box-shadow: 0 0 14px rgba(255, 184, 77, .3);
}
.ch-ic svg, .so-ic svg { width: 26px; height: 26px; }
.choice:not(.card) .ch-ic { color: var(--amber); }
.choice.with-ic .ch-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hp-gain { position: relative; display: block; width: 100%; height: 8px; margin-top: 6px; border-radius: 4px; background: rgba(0, 0, 0, .5); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.hp-gain i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--hp); }
.hp-gain i.add { background: var(--good); animation: hpGain 1.6s ease-in-out infinite; }
@keyframes hpGain { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* the stair down: the way down so far, the level ahead, and five choices as cards */
.stair-track { display: flex; align-items: flex-start; list-style: none; margin: 0; padding: 0; width: min(440px, 100%); }
.stair-track li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.stair-track li + li::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: rgba(147, 178, 182, .35); }
.stair-track li.past + li::before { background: linear-gradient(90deg, var(--brass), var(--amber)); }
.stair-track .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #0a1d2b; border: 2px solid rgba(147, 178, 182, .5); }
.stair-track .dot svg { width: 14px; height: 14px; }
.stair-track li.past { color: #e8d6a8; }
.stair-track li.past .dot { background: var(--brass); border-color: var(--brass); color: #1c1306; }
.stair-track li.here { color: #ffe6b0; }
/* a level not found yet: a dashed dot and a "?" for its name */
.stair-track li.unknown .dot { border-style: dashed; }
.stair-track li.unknown b { opacity: .75; letter-spacing: .1em; }
.stair-track li.here b { text-shadow: 0 0 10px rgba(255, 184, 77, .7); }
.stair-track li.here .dot { border-color: var(--amber); background: radial-gradient(circle, #ffe2a8 0 30%, #0a1d2b 34%); box-shadow: 0 0 0 4px rgba(255, 184, 77, .2), 0 0 16px rgba(255, 184, 77, .8); animation: stairHere 2.4s ease-in-out infinite; }
@keyframes stairHere { 50% { box-shadow: 0 0 0 7px rgba(255, 184, 77, .08), 0 0 22px rgba(255, 184, 77, .95); } }
.scene h1.stair-title { margin: 0; line-height: 1.1; }
.stair-title small { display: block; margin-bottom: 4px; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--brass); text-shadow: 0 2px 6px #000; }
.stair-count { margin: 0; font-size: 16px; color: #e3eeea; text-shadow: 0 2px 6px #000; }
.stair-count b { color: var(--amber); }
.stair-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.stair-opt {
  position: relative; flex: 1 1 150px; max-width: 184px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 12px 14px; border-radius: 14px; cursor: pointer; text-align: center; color: var(--text);
  background: linear-gradient(180deg, rgba(30, 70, 90, .95), rgba(10, 28, 40, .96)); border: 1px solid rgba(201, 162, 74, .55);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 226, 168, .15);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.stair-grid.fresh .stair-opt { animation: stairIn .45s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes stairIn { from { opacity: 0; transform: translateY(18px); } }
.stair-opt:not([disabled]):hover, .stair-opt:not([disabled]):focus-visible { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(0, 0, 0, .55), 0 0 22px rgba(255, 184, 77, .35); border-color: var(--amber); }
.stair-opt .so-ic { width: 54px; height: 54px; }
.stair-opt .so-ic svg { width: 30px; height: 30px; }
.stair-opt b { font-size: 16px; color: #ffe2a8; }
.stair-opt .so-desc { font-size: 14px; line-height: 1.35; color: #cfe0dc; }
.stair-opt .hp-gain { margin-top: 2px; }
.stair-opt em { font-style: normal; font-size: 13px; font-weight: 700; }
.stair-opt .reason { color: var(--bad); }
.stair-opt[disabled] { cursor: not-allowed; opacity: .42; filter: saturate(.5); }
.stair-opt.done { opacity: 1; filter: none; cursor: default; border-color: var(--kelp); background: linear-gradient(180deg, rgba(28, 82, 70, .95), rgba(8, 32, 30, .96)); }
.stair-opt.done .so-ic { color: var(--good); border-color: var(--kelp); background: radial-gradient(circle at 50% 40%, rgba(143, 227, 168, .3), rgba(5, 15, 24, .7) 70%); box-shadow: 0 0 14px rgba(63, 174, 138, .45); }
.stair-opt .st-done { color: var(--good); text-transform: uppercase; letter-spacing: .12em; }
.stair-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: 36em; }
.stair-log li { font-size: 15px; font-weight: 700; color: #ffe2a8; text-shadow: 0 2px 6px #000; }
.stair-go small { font-weight: 600; opacity: .8; }
/* a phone lists them, icon on the left */
@media (max-width: 600px) {
  .stair-grid { flex-direction: column; gap: 8px; width: min(560px, 100%); }
  .stair-opt { flex: none; max-width: none; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; padding: 10px 14px; text-align: left; align-items: center; }
  .stair-opt .so-ic { grid-row: span 4; width: 44px; height: 44px; }
  .stair-opt .so-ic svg { width: 24px; height: 24px; }
  .stair-opt:not([disabled]):hover, .stair-opt:not([disabled]):focus-visible { transform: translateX(3px); }
  .stair-track li { font-size: 12px; }
}

/* what was taken at the start of this turn (Doused, Breathless): it is over already, so its chip is dashed */
.st.spent { border-style: dashed; }

/* "New at the lighthouse": what just opened, in a window that has to be acknowledged (v0.33.0) */
.news-modal { border-color: rgba(200, 160, 255, .6); box-shadow: 0 0 0 1px rgba(200, 160, 255, .25), 0 18px 60px rgba(0, 0, 0, .7), 0 0 60px rgba(150, 100, 220, .25); }
.news-modal .modal-head h2 { color: #eadcff; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.news-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(60, 30, 80, .55); border: 1px solid rgba(200, 160, 255, .4); }
.news-item .medal { flex: 0 0 auto; width: 52px; height: 52px; }
.news-item .medal svg { width: 28px; height: 28px; }
.news-item .outfit-news-art { flex: 0 0 52px; width: 52px; height: 68px; object-fit: contain; }
.news-item b { display: block; font-family: var(--serif); font-size: 20px; line-height: 1.25; color: #ffe2a8; }
.news-item p { margin: 4px 0 6px; font-size: 16px; line-height: 1.45; color: #eadcff; }
.news-item p b { display: inline; font-family: inherit; font-size: inherit; color: #fff; }
.news-item small { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #1c1306; background: var(--brass); }

/* an attack that follows the Swell (the Tolling Buoy's Rocking Toll and Wild Peal): a bell for its intent, the step of
   the Swell bar where it is weakest, and a line above the bar that says what it would hit for there (v0.33.0) */
.intent.swell { border-color: rgba(255, 196, 110, .95); box-shadow: 0 0 0 2px rgba(255, 184, 77, .25), 0 0 14px rgba(255, 184, 77, .45); }
.intent .i-swell { display: inline-flex; margin-left: 3px; color: #8fe3f5; }
.intent .i-swell svg { width: 16px; height: 16px; }
.intent.swell-ends .i-swell { color: #ffcb8c; }
.tb-seg.calm { border-color: #ffc46e; box-shadow: inset 0 0 0 1px rgba(255, 196, 110, .7); color: #ffe0a0; }
.tb-seg.calm.now { box-shadow: 0 0 0 2px #eafff6, 0 0 12px #4fe0aa, inset 0 0 0 1px rgba(255, 196, 110, .7); }
.tb-hint.note { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 650; color: #ffe6c0; border: 1px solid rgba(255, 196, 110, .5); }
.tb-hint.note svg { width: 14px; height: 14px; color: #ffc46e; }
.tb-hint.note b { color: #fff; }

/* v0.34.0: the Listener's Pounce says what each card played adds */
.intent .i-heard { display: inline-flex; align-items: center; gap: 1px; margin-left: 4px; font-style: normal; font-size: 12px; font-weight: 800; color: #ffd27a; }
.intent .i-heard svg { width: 12px; height: 12px; }

/* v0.35.0: give one to the sea (the keepsake picker), and what a Roiled aether pays */
.sea-row { justify-content: center; margin-top: 16px; }
/* the stair has six since v0.35.0: one row on a wide screen, three and three between that and a phone's list */
.stair-scene .scene-inner { max-width: 1100px; }
@media (min-width: 601px) and (max-width: 1040px) { .stair-grid { max-width: 600px; } }
.sea-pick .sea-pay { color: #9be7c4; font-weight: 700; }
.chip.bonus.roil { display: inline-flex; align-items: center; gap: 4px; border-color: rgba(190, 150, 255, .6); color: #e3d2ff; }
.chip.bonus.roil svg { width: 13px; height: 13px; }
/* a Dread's one pick (v0.40.0): three cards or its keepsake. Side by side on a wide screen, stacked on a phone */
.dread-pick { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.dread-or h3 { text-align: center; color: #ffe6b0; }
.dread-or .shop-row { justify-content: center; }
.dread-or .shop-tile b { font-family: var(--serif); font-size: 16px; } /* the keepsake's name like the cards' beside it (v0.45.1) */
@media (min-width: 900px) {
  .dread-pick { flex-direction: row; align-items: stretch; }
  .dread-pick .reward-main { flex: 3 1 0; }
  /* the keepsake's panel is the cards' twin (v0.45.1, the user: "fonts/layout look a bit inconsistent"): the same box,
     its heading in the same serif and size on the same line, the keepsake level with the cards */
  .dread-pick .dread-or { flex: 1 1 0; width: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px;
    padding: 14px 8px 16px; border-radius: 16px; background: rgba(6, 20, 30, .75); border-color: rgba(255, 184, 77, .45); box-shadow: none; }
  .dread-pick .dread-or h3 { font-size: 22px; margin: 0; }
  .dread-pick .dread-or .shop-row { padding-top: 8px; }
}

/* ---------- v0.65.0: Mateo's Shield Bash and its hoops, and Wren's Opening Bell ---------- */
/* The Bash button: a shield, the Ward it costs (blue), the damage it deals (red), and a ring for each hoop on his lid */
.tb-act.bash { position: relative; min-height: 34px; height: auto; padding: 3px 9px 3px 7px; gap: 5px; border-radius: 12px; border-color: #8acaff;
  background: linear-gradient(180deg, #17425c, #0c2a3d); box-shadow: inset 0 1px 0 rgba(190, 230, 255, .25); }
.tb-act.bash .bash-ic { display: grid; place-items: center; width: 18px; height: 18px; color: #9dd6ff; }
.tb-act.bash .bash-ic svg { width: 18px; height: 18px; }
.tb-act.bash b { font-size: 13px; letter-spacing: .04em; }
.tb-act.bash .bash-nums { display: inline-flex; align-items: center; gap: 3px; }
.tb-act.bash i { color: #071b30; background: radial-gradient(circle at 40% 35%, #e8f6ff, #9dd6ff 55%, #3f86bd); }
.tb-act.bash .bash-to { font-size: 12px; opacity: .7; }
.tb-act.bash em { font-style: normal; font-weight: 900; font-size: 13px; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center;
  color: #fff3ea; background: linear-gradient(180deg, #c8463a, #7d1c1c); border: 1px solid rgba(255, 190, 170, .55); }
.tb-act.bash[aria-pressed="true"] { background: #23506a; outline: 2px solid #a8ddff; outline-offset: 1px; }
.tb-act.bash.free i { color: #2a1503; background: radial-gradient(circle at 40% 35%, #fff6d8, #ffd24a 55%, #a56a08); box-shadow: 0 0 8px #ffd24a; }
.tb-act.bash.finisher { border-color: #ffe08a; animation: bashReady 1.3s ease-in-out infinite; }
.tb-act.bash.finisher em { color: #2a1503; background: linear-gradient(180deg, #ffe9a8, #f0a52c); border-color: #fff3c8; }
@keyframes bashReady { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 208, 106, 0), inset 0 1px 0 rgba(190, 230, 255, .25); } 50% { box-shadow: 0 0 0 2px rgba(255, 208, 106, .75), 0 0 14px rgba(255, 190, 80, .7), inset 0 1px 0 rgba(190, 230, 255, .25); } }
.bash-hoops { position: absolute; top: -6px; right: 6px; display: flex; gap: 2px; }
.hoop-pip { width: 11px; height: 11px; border-radius: 50%; border: 3px solid #c9a24a; background: #06141e; box-shadow: 0 1px 2px #000; }
.hoop-pip.h-iron { border-color: #93a0ad; }
.hoop-pip.h-truss { border-color: #e6bd7a; }
.hoop-pip.h-chime { border-color: #ffd24a; }
.hoop-pip.h-bilge { border-color: #58c2a2; }
.hoop-pip.h-herring { border-color: #d98a6a; }
.hoop-pip.h-withy { border-color: #a9743d; }
.hoop-pip.flash { animation: pipFlash .9s ease; }
@keyframes pipFlash { 0%, 100% { transform: none; box-shadow: 0 1px 2px #000; } 35% { transform: scale(1.9); box-shadow: 0 0 10px #fff3c8; } }
@media (max-width: 480px) {
  /* on a phone the button stands two rows tall beside the Swell: the name over the numbers, so the Swell keeps its width */
  .tb-act.bash { flex-direction: column; gap: 1px; padding: 3px 5px; min-width: 46px; }
  .tb-act.bash .bash-ic { display: none; }
  .tb-act.bash .bash-nums { gap: 2px; }
  .bash-hoops { right: 3px; }
}
/* the blow: Mateo steps in behind his lid, and its rim lands on the enemy */
.unit.player.bash-lunge .sprite { animation: bashLunge .46s cubic-bezier(.3, .6, .3, 1); }
@keyframes bashLunge { 0%, 100% { transform: none; } 18% { transform: translateX(-12px) rotate(-2deg); } 42% { transform: translateX(64px) scale(1.07); } 60% { transform: translateX(52px) scale(1.05); } }
.bash-fx { position: absolute; width: 0; height: 0; pointer-events: none; }
.bash-fx i { position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 9px solid #eaf6ff; box-shadow: 0 0 22px #6fc1ff, inset 0 0 18px rgba(255, 220, 150, .8); animation: bashRim .42s ease-out forwards; }
.bash-fx b { position: absolute; left: -3px; top: -3px; width: 6px; height: 30px; border-radius: 3px; background: linear-gradient(180deg, #fff, #ffd38a 60%, transparent); transform-origin: 50% 0; transform: rotate(var(--a)) translateY(18px); animation: bashStave .42s ease-out forwards; }
@keyframes bashRim { 0% { transform: scale(.25); opacity: 1; } 55% { opacity: 1; } 100% { transform: scale(1.5); opacity: 0; border-width: 2px; } }
@keyframes bashStave { 0% { transform: rotate(var(--a)) translateY(10px) scaleY(.4); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(74px) scaleY(1); opacity: 0; } }
/* while he aims, an enemy the Bash would finish says so */
.unit.enemy.bash-lethal .target-reticle circle { stroke: #ffe58a; }
.unit.enemy.bash-lethal .sprite::before { content: "Finishes it"; position: absolute; z-index: 3; left: 50%; top: 4px; transform: translateX(-50%); padding: 2px 8px; border-radius: 9px; white-space: nowrap; pointer-events: none;
  font: 800 12px/1.3 var(--sans); letter-spacing: .04em; color: #2a1503; background: linear-gradient(180deg, #ffe9a8, #f0a52c); box-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
/* the hoops on the HUD, and the two to choose from on the stair */
.hud .medal.hoops { overflow: visible; }
.hud .medal.hoops img { object-fit: contain; }
.hud .medal.hoops .n { position: absolute; right: -5px; bottom: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #f2c46b; color: #2a1504; font-size: 12px; font-weight: 800; line-height: 18px; }
@media (max-width: 600px) { .hud .medal.hoops { order: 10; width: 30px; height: 30px; } }
.hoop-modal .lead { margin-top: 0; }
.hoop-row { display: flex; gap: 12px; justify-content: center; margin: 14px 0 4px; }
.hoop-tile { flex: 1 1 0; max-width: 240px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px 12px; border-radius: 14px; cursor: pointer; text-align: center;
  font: inherit; color: var(--text); background: rgba(6, 20, 30, .85); border: 1px solid rgba(201, 162, 74, .5); transition: transform .15s, box-shadow .15s; }
.hoop-tile .medal { width: 84px; height: 84px; cursor: inherit; }
.hoop-tile .medal img { object-fit: contain; }
.hoop-tile b { font-family: var(--serif); font-size: 19px; color: #ffe2a8; }
.hoop-tile .ht-desc { font-size: 15px; line-height: 1.4; }
.hoop-tile em { margin-top: auto; padding-top: 6px; font-style: normal; font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #ffc46e; }
.hoop-tile:hover, .hoop-tile:focus-visible { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--amber), 0 0 18px rgba(255, 184, 77, .45); outline: none; }
.hoop-have { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); font-size: 14px; text-align: left; }
.hoop-have > b { color: #ffe2a8; }
@media (max-width: 480px) { .hoop-row { gap: 8px; } .hoop-tile { padding: 10px 8px; } .hoop-tile .medal { width: 64px; height: 64px; } .hoop-tile b { font-size: 17px; } .hoop-tile .ht-desc { font-size: 14px; } }
/* Wren's Opening Bell: a bell on her and on Bail and Stir until it rings, then its name and three rings from her belt */
.tb-act.bell-ready { border-color: #ffd98a; animation: bellReady 2.2s ease-in-out infinite; }
.tb-act.bell-ready i { background: radial-gradient(circle at 40% 35%, #fff6d8, #ffd24a 55%, #a56a08); box-shadow: 0 0 7px rgba(255, 210, 74, .9); }
.tb-act.bell-ready[aria-disabled] { animation: none; }
@keyframes bellReady { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 74, 0); } 50% { box-shadow: 0 0 0 2px rgba(255, 210, 74, .45), 0 0 12px rgba(255, 200, 90, .55); } }
.tb-act.rung { animation: bellRung .9s ease; }
@keyframes bellRung { 0% { transform: scale(1); box-shadow: 0 0 0 0 #ffe9a8; } 25% { transform: scale(1.16); box-shadow: 0 0 0 4px #ffe9a8, 0 0 22px #ffc24a; } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 233, 168, 0); } }
.st.bell-chip { color: #ffe08a; border-color: rgba(255, 216, 120, .75); box-shadow: 0 0 8px rgba(255, 200, 90, .5); padding: 0 4px; }
.st.bell-chip.rung { animation: chipRung .8s ease forwards; }
@keyframes chipRung { 30% { transform: scale(1.5); box-shadow: 0 0 16px #ffd24a; } 100% { transform: scale(.6); opacity: 0; } }
.bell-ring { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 3px solid rgba(255, 226, 150, .95); box-shadow: 0 0 16px rgba(255, 196, 80, .8), inset 0 0 10px rgba(255, 220, 140, .5);
  opacity: 0; animation: bellRing 1.1s ease-out forwards; }
@keyframes bellRing { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(7.5); opacity: 0; border-width: 1px; } }
.bell-call { position: absolute; transform: translate(-50%, -50%); display: grid; grid-template-columns: auto auto; column-gap: 7px; align-items: center; justify-items: start; white-space: nowrap; pointer-events: none;
  color: #fff1c9; text-shadow: 0 0 12px #ffb84d, 0 2px 4px #000, 0 0 3px #000; animation: bellCall 1.8s ease-out forwards; }
.bell-call svg { grid-row: span 2; width: 34px; height: 34px; color: #ffd66e; filter: drop-shadow(0 0 8px #ffb84d) drop-shadow(0 2px 3px #000); animation: bellSwing .5s ease-in-out 3; transform-origin: 50% 10%; }
.bell-call b { font-family: var(--serif); font-size: 26px; letter-spacing: .04em; line-height: 1.05; }
.bell-call small { font: 800 14px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #ffe2a8; }
@keyframes bellCall { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.7); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 22% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%); } }
@keyframes bellSwing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(16deg); } 75% { transform: rotate(-16deg); } }
@media (max-width: 480px) { .bell-call b { font-size: 21px; } .bell-call svg { width: 28px; height: 28px; } }
@media (prefers-reduced-motion: reduce) {
  .tb-act.bash.finisher, .tb-act.bell-ready, .unit.player.bash-lunge .sprite, .bell-call svg { animation: none; }
  .tb-act.bash.finisher { box-shadow: 0 0 0 2px rgba(255, 208, 106, .75); }
  .tb-act.bell-ready { box-shadow: 0 0 0 2px rgba(255, 210, 74, .45); }
  /* the call stays readable and still: everything else here is cut to nothing by the rule for all animations */
  .bell-call { animation-name: bellCallStill; animation-duration: 1.8s !important; }
}
@keyframes bellCallStill { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
