/* Skyfire — boot screen, title, HUD, menus. The DOM is built by src/ui/*.js (system 'hud').
   Performance rules (research §8): per-frame changes are transform / opacity / CSS variables only, no
   backdrop-filter over the canvas, no animated box-shadow or filter. */
:root {
  --ink: #fffaf0; --ink-dim: rgba(255, 250, 240, 0.72); --ink-faint: rgba(255, 250, 240, 0.45);
  --navy: #0b1533; --navy-2: #13245a; --panel: rgba(9, 18, 46, 0.72); --panel-2: rgba(16, 30, 72, 0.55);
  --line: rgba(255, 238, 200, 0.42); --gold: #f2c45a; --gold-hi: #ffe7a3; --teal: #6fe0d0; --sky: #1a4fb8;
  --hp-a: #9af7d0; --hp-b: #2ed3a0; --low: #ff4d6d; --red: #ff3b55; --warn: #ffb030; --stam: #7fe3ff; --heat: #ffc94a;
  --f-ui: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-num: "Avenir Next Condensed", "DIN Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-title: Optima, "Palatino", "Book Antiqua", serif;
  --shadow-t: 0 1px 2px rgba(6, 12, 34, 0.75), 0 0 12px rgba(6, 12, 34, 0.35);
}
/* (29.09) Russian: faces with Cyrillic first (Optima, Avenir Next Condensed, Book Antiqua have none — the browser would
   mix two faces in one word). src/ui/i18n.js sets <html lang>.
   Measured in Chrome on macOS (CDP CSS.getPlatformFontsForNode, qa/i18n/hud/fonts.json): Avenir Next has Cyrillic in
   Regular … Bold but NOT in Heavy (800 / 900 — the HUD's warning pill, combo and badge labels): its Cyrillic fell back to
   Helvetica Neue while "!", "-" and digits stayed Avenir. "Skyfire UI RU" is Avenir Next up to Bold for every weight
   (local faces; elsewhere — Windows, a TV — the next faces in the stack all have Cyrillic). Avenir Next Condensed has no
   Cyrillic at all: the numbers' face is Arial Narrow (Bold Italic like the English heavy italic digits), then DIN
   Condensed / PT Sans Narrow. Palatino has Cyrillic in every weight. */
@font-face { font-family: "Skyfire UI RU"; font-style: normal; font-weight: 1 450; src: local("AvenirNext-Regular"), local("Avenir Next Regular"); }
@font-face { font-family: "Skyfire UI RU"; font-style: normal; font-weight: 451 550; src: local("AvenirNext-Medium"), local("Avenir Next Medium"); }
@font-face { font-family: "Skyfire UI RU"; font-style: normal; font-weight: 551 650; src: local("AvenirNext-DemiBold"), local("Avenir Next Demi Bold"); }
@font-face { font-family: "Skyfire UI RU"; font-style: normal; font-weight: 651 1000; src: local("AvenirNext-Bold"), local("Avenir Next Bold"); }
@font-face { font-family: "Skyfire UI RU"; font-style: italic; font-weight: 1 450; src: local("AvenirNext-Italic"), local("Avenir Next Italic"); }
@font-face { font-family: "Skyfire UI RU"; font-style: italic; font-weight: 451 550; src: local("AvenirNext-MediumItalic"), local("Avenir Next Medium Italic"); }
@font-face { font-family: "Skyfire UI RU"; font-style: italic; font-weight: 551 650; src: local("AvenirNext-DemiBoldItalic"), local("Avenir Next Demi Bold Italic"); }
@font-face { font-family: "Skyfire UI RU"; font-style: italic; font-weight: 651 1000; src: local("AvenirNext-BoldItalic"), local("Avenir Next Bold Italic"); }
:root[lang="ru"] {
  --f-ui: "Skyfire UI RU", "Segoe UI", "Helvetica Neue", Arial, system-ui, -apple-system, sans-serif;
  /* (+ Bahnschrift SemiCondensed / Condensed: Windows 10+, with Cyrillic; sans-serif-condensed: Android's Roboto Condensed) */
  --f-num: "Arial Narrow", "DIN Condensed", "PT Sans Narrow", "Roboto Condensed", "Bahnschrift SemiCondensed", "Bahnschrift Condensed", "sans-serif-condensed", "Helvetica Neue", Arial, sans-serif;
  --f-title: "Palatino", "Palatino Linotype", Georgia, "Times New Roman", serif;
  /* the manga letterings (hit words, LEVEL UP!, move call-outs): Impact — heavy, condensed, with Cyrillic (the English
     Avenir Next Condensed Heavy Italic has none); hitwords.js measures its advances (CW_RU) */
  --f-manga: Impact, "Arial Black", "Arial Narrow", sans-serif;
}
:root[lang="ko"] {
  /* 천신 한국어: 본문·제목·만화 글씨 모두 Noto Sans KR (XGAME 공용 폰트 /assets/fonts/core.css), 숫자는 영어와 같은 좁은 글꼴 */
  --f-ui: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-title: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  --f-manga: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
:root[lang="ko"] .hw-t { font-family: var(--f-manga); font-weight: 900; }
:root[lang="ko"] .warn-t { white-space: normal; text-align: center; word-break: keep-all; }
/* (114) 한국어는 어절 단위로만 줄바꿈 ("무사 / 하다" 처럼 낱말 가운데서 끊기던 것) */
:root[lang="ko"] body { word-break: keep-all; overflow-wrap: anywhere; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1f3f; color: var(--ink);
  font-family: var(--f-ui); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; overflow: hidden; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#ui { position: absolute; inset: 0; pointer-events: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
button { font: inherit; color: inherit; }
/* a hidden item stays hidden whatever display its own rule gives it (menu items, settings rows, buttons) */
#ui [hidden] { display: none !important; }

/* ------------------------------------------------------------------ boot */
.boot { position: absolute; inset: 0; display: grid; place-content: end center; padding-bottom: max(64px, 11vh); text-align: center; gap: 10px; z-index: 40;
  /* key art v2: Kaede and Sora's head sit in the middle band — the title goes in the dark lower third, under them */
  background: linear-gradient(180deg, rgba(8, 18, 52, .2) 0%, rgba(8, 18, 52, .12) 45%, rgba(8, 18, 52, .78) 72%, #081230 100%),
    url(assets/textures/keyart.jpg) center 34% / cover no-repeat, #0d1f3f;
  transition: opacity .8s ease; }
.boot.hidden { opacity: 0; pointer-events: none; }
.boot-title { font: 700 clamp(46px, 8.5vw, 104px)/1 var(--f-title); letter-spacing: .16em; padding-left: .16em;
  color: #fffaf0; text-shadow: 0 0 2px #13245a, 0 3px 0 #13245a, 0 6px 30px rgba(0, 0, 0, .45); }
.boot-sub { font: 600 clamp(12px, 1.6vw, 17px)/1.2 var(--f-ui); letter-spacing: .42em; padding-left: .42em; text-transform: uppercase; color: var(--gold-hi); text-shadow: var(--shadow-t); }
.boot-bar { width: min(420px, 70vw); height: 3px; margin: 22px auto 0; background: rgba(255,255,255,.18); border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #fff6d8, var(--gold)); transition: width .25s ease; }
.boot-note { font-size: 13px; color: var(--ink-dim); min-height: 1.2em; letter-spacing: .04em; }
.boot-errors { position: fixed; left: 12px; bottom: 12px; max-width: 70vw; white-space: pre-wrap; font: 12px/1.4 ui-monospace, Menlo, monospace;
  color: #ffd2cc; background: rgba(40, 0, 0, .6); padding: 8px 10px; border-radius: 6px; z-index: 50; pointer-events: none; }

/* ------------------------------------------------------------------ screens (title, pause, results) */
.scr { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s linear .45s; }
.scr.on { opacity: 1; visibility: visible; transition: opacity .45s ease; }
.scr.on.block { pointer-events: auto; }            /* pause/results swallow clicks; the title lets drags reach the canvas */
.scr button, .scr input { pointer-events: auto; }

/* title */
.t-art { position: absolute; inset: -3%; background: url(assets/textures/keyart.jpg) center 42% / cover no-repeat;
  transform-origin: 60% 45%; animation: kenburns 38s ease-in-out infinite alternate; }
.title.live .t-art { opacity: 0; visibility: hidden; }
/* key art → live render: a sunlit cloud passes the camera (hud.js goLive: 0.52 s in, the swap under the full veil,
   1.15 s out); never a cross-fade of the two pictures */
.t-veil { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(120% 95% at 64% 38%, #fffdf6 0%, #f4f1ea 34%, #dfe7f3 68%, #b9cbe6 100%); }
@keyframes kenburns { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.12) translate3d(-1.5%, 1%, 0); } }
.t-shade { position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 16, 48, .82) 0%, rgba(8, 20, 58, .58) 28%, rgba(8, 20, 58, .3) 44%, rgba(8, 20, 58, 0) 60%),   /* (124) 메뉴 둘째 열이 흰 구름 위에서 흐렸다 */
    linear-gradient(0deg, rgba(6, 14, 40, .7) 0%, rgba(6, 14, 40, 0) 26%),
    radial-gradient(130% 100% at 60% 45%, rgba(0,0,0,0) 55%, rgba(4, 10, 32, .45) 100%); }
.t-flare { position: absolute; right: 16%; top: 4%; width: 46vmin; height: 46vmin; border-radius: 50%; mix-blend-mode: screen; opacity: .55;
  background: radial-gradient(circle, rgba(255, 246, 220, .55) 0%, rgba(255, 236, 190, .18) 22%, rgba(255, 220, 160, 0) 60%);
  animation: flare 7s ease-in-out infinite alternate; }
.title:not(.live) .t-flare { opacity: .25; }
@keyframes flare { from { transform: scale(.94); } to { transform: scale(1.06); } }
.t-frame { position: absolute; inset: 18px; border: 1px solid rgba(255, 236, 196, .28); pointer-events: none; }
.t-frame::before, .t-frame::after { content: ""; position: absolute; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); top: -5px; left: -5px; box-shadow: 0 0 10px rgba(255, 220, 140, .8); }
.t-frame::after { top: auto; left: auto; bottom: -5px; right: -5px; }
.t-left { position: absolute; left: clamp(28px, 7vw, 120px); top: clamp(40px, 11vh, 120px); bottom: 84px; display: flex; flex-direction: column; justify-content: space-between; width: min(520px, 86vw); }
.logo { position: relative; width: min(500px, 84vw); animation: logo-in 1.4s cubic-bezier(.2, .8, .2, 1) both; }
.logo svg { width: 100%; height: auto; display: block; overflow: visible; }
.logo-sub { display: flex; align-items: center; gap: 14px; margin: 2px 0 0 6px; font: 600 clamp(11px, 1.25vw, 15px)/1 var(--f-ui); letter-spacing: .42em;
  text-transform: uppercase; color: var(--gold-hi); text-shadow: var(--shadow-t); white-space: nowrap; }
.logo-sub i { flex: 0 0 46px; height: 1px; background: linear-gradient(90deg, rgba(255, 231, 163, 0), var(--gold-hi)); }
.logo-sub i:last-child { background: linear-gradient(90deg, var(--gold-hi), rgba(255, 231, 163, 0)); }
@keyframes logo-in { from { opacity: 0; transform: translate3d(-24px, 0, 0); letter-spacing: .1em; } to { opacity: 1; transform: none; } }
.t-menu { margin-bottom: 4vh; }
.t-menu .mbtn { text-shadow: 0 1px 2px rgba(6, 12, 34, .85), 0 0 10px rgba(6, 12, 34, .55), 0 0 22px rgba(6, 12, 34, .35); }
.t-left { transition: opacity .3s ease; }
.scr.dim .t-left, .scr.dim .p-card, .scr.dim .t-foot { opacity: .25; }
.t-foot { position: absolute; left: 0; right: 0; bottom: max(30px, env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 34px; font-size: 12px; letter-spacing: .12em;
  color: var(--ink-dim); text-shadow: var(--shadow-t); text-transform: uppercase; padding: 0 20px; flex-wrap: wrap; }
.t-foot b { color: var(--gold-hi); font-weight: 600; }
.t-foot .tonly { display: none; }
.tm .t-foot .tonly { display: inline; }

/* menu buttons */
.menu { display: flex; flex-direction: column; gap: 6px; }
.mbtn { position: relative; display: grid; grid-template-columns: 26px 1fr; align-items: center; column-gap: 12px; width: min(360px, 84vw); min-height: 50px;
  padding: 8px 18px 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; outline: none; color: var(--ink);
  text-shadow: var(--shadow-t); transition: transform .18s ease, color .18s ease; }
.mbtn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 214, 120, .38), rgba(255, 214, 120, .12) 55%, rgba(255, 214, 120, 0));
  border-left: 2px solid var(--gold-hi); opacity: 0; transform: scaleX(.6); transform-origin: left; transition: opacity .18s ease, transform .22s ease; }
.mbtn::after { content: ""; position: absolute; left: 12px; right: 18px; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(255, 238, 200, .35), rgba(255, 238, 200, 0)); }
.mb-dia { position: relative; width: 10px; height: 10px; margin-left: 8px; transform: rotate(45deg); border: 1px solid rgba(255, 238, 200, .7); transition: background .18s, box-shadow .18s; }
.mb-t { position: relative; font: 600 19px/1.15 var(--f-ui); letter-spacing: .06em; }
.mb-s { position: relative; grid-column: 2; font-size: 12px; letter-spacing: .08em; color: var(--ink-dim); margin-top: 2px; }
.mbtn.primary .mb-t { font-size: 23px; letter-spacing: .05em; }
/* Survival: the best run under the subtitle (hidden until there is one) */
.mb-best { position: relative; grid-column: 2; display: none; margin-top: 4px; font: 600 11px/1.2 var(--f-num); letter-spacing: .14em; color: var(--gold-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mbtn.mb-surv.has-best .mb-best { display: block; }
.mb-best b { font: 700 9.5px/1 var(--f-ui); letter-spacing: .3em; color: var(--ink-faint); margin-right: 9px; text-transform: uppercase; }
.mbtn.mb-surv .mb-dia { border-color: #ff9aa8; }
.mbtn.mb-surv.focus .mb-dia { background: #ff8a9c; box-shadow: 0 0 10px rgba(255, 110, 140, .9); }
.mbtn.focus { transform: translate3d(8px, 0, 0); color: #fff; }
.mbtn.focus::before { opacity: 1; transform: none; }
.mbtn.focus .mb-dia { background: var(--gold-hi); box-shadow: 0 0 10px rgba(255, 220, 140, .9); }
.mbtn:active { transform: translate3d(10px, 1px, 0); }

/* panels (settings / controls) */
.panel { position: absolute; top: 50%; left: 50%; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  transform: translate(-50%, -50%) translate3d(0, 10px, 0); opacity: 0; visibility: hidden; pointer-events: auto;
  background: linear-gradient(180deg, rgba(20, 38, 92, .94), rgba(9, 18, 46, .95)); border: 1px solid rgba(255, 238, 200, .28);
  box-shadow: 0 30px 80px rgba(0, 0, 20, .55), inset 0 1px 0 rgba(255, 255, 255, .08); border-radius: 4px; padding: 26px 30px 22px;
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; z-index: 5; scrollbar-width: thin; }
.panel.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition: opacity .3s ease, transform .3s ease; }
.panel::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 2px; background: linear-gradient(90deg, rgba(242, 196, 90, 0), var(--gold), rgba(242, 196, 90, 0)); }
.pn-h { display: flex; align-items: center; gap: 12px; font: 700 15px/1 var(--f-ui); letter-spacing: .36em; text-transform: uppercase; color: var(--gold-hi); margin-bottom: 18px; }
.pn-h::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold); }
.pn-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 238, 200, .4), rgba(255, 238, 200, 0)); }
.pn-foot { display: flex; justify-content: flex-end; margin-top: 18px; gap: 10px; }
.pbtn { border: 1px solid rgba(255, 238, 200, .45); background: rgba(255, 255, 255, .04); padding: 10px 26px; border-radius: 999px; cursor: pointer;
  font: 600 14px/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; outline: none; transition: background .15s, color .15s, border-color .15s; }
.pbtn.focus, .pbtn:hover { background: var(--gold-hi); color: var(--navy); border-color: var(--gold-hi); }
.set-row { display: grid; grid-template-columns: 170px 1fr 64px; align-items: center; gap: 14px; padding: 10px 10px; border-radius: 3px; outline: none; }
.set-row:focus-within, .set-row.focus { background: rgba(255, 231, 163, .09); box-shadow: inset 2px 0 0 var(--gold-hi); }
.set-l { font-size: 14px; letter-spacing: .06em; color: var(--ink); }
.set-v { font: 600 14px/1 var(--f-num); letter-spacing: .04em; text-align: right; color: var(--gold-hi); }
.seg { display: flex; gap: 4px; }
.seg button { flex: 1; border: 1px solid rgba(255, 238, 200, .28); background: rgba(255, 255, 255, .03); padding: 8px 4px; cursor: pointer; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; border-radius: 2px; outline: none; }
.seg button.sel { background: var(--gold-hi); color: var(--navy); border-color: var(--gold-hi); font-weight: 700; }
.seg button:focus-visible { box-shadow: 0 0 0 2px rgba(255, 231, 163, .7); }
.toggle { justify-self: start; width: 58px; height: 28px; border-radius: 99px; border: 1px solid rgba(255, 238, 200, .4); background: rgba(255, 255, 255, .06); position: relative; cursor: pointer; outline: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-dim); transition: transform .18s ease, background .18s; }
.toggle.on { background: rgba(111, 224, 208, .35); border-color: var(--teal); }
.toggle.on::after { transform: translateX(30px); background: #fff; }
.toggle:focus-visible { box-shadow: 0 0 0 2px rgba(255, 231, 163, .7); }
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; outline: none; }
input[type=range].rng::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold-hi) var(--p, 50%), rgba(255, 255, 255, .18) var(--p, 50%)); }
input[type=range].rng::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; transform: rotate(45deg); background: #fff; border: 2px solid var(--gold); }
input[type=range].rng::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); }
input[type=range].rng::-moz-range-progress { height: 4px; background: var(--gold-hi); }
input[type=range].rng::-moz-range-thumb { width: 14px; height: 14px; transform: rotate(45deg); background: #fff; border: 2px solid var(--gold); border-radius: 0; }
input[type=range].rng:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(255, 231, 163, .45); }
.ctl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 30px; }
.ctl-grp { font: 700 11px/1 var(--f-ui); letter-spacing: .3em; color: var(--teal); text-transform: uppercase; margin: 12px 0 4px; grid-column: 1 / -1; }
.ctl { display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(255, 238, 200, .09); font-size: 13.5px; }
.ctl span:last-child { color: var(--ink-dim); }
.keys { display: flex; gap: 4px; flex-wrap: wrap; }
.panel.wide { width: min(820px, calc(100vw - 32px)); }
kbd { display: inline-block; min-width: 24px; padding: 3px 7px 2px; border-radius: 4px; border: 1px solid rgba(255, 238, 200, .45); border-bottom-width: 2px;
  font: 600 11.5px/1.3 var(--f-ui); letter-spacing: .04em; text-align: center; background: rgba(255, 255, 255, .06); color: #fff; }
.ctl-pad { margin-top: 12px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }
/* the touch layout's "keys": the on-screen captions / gestures, round-cornered chips in the buttons' colours */
kbd.tk { border-radius: 999px; padding: 3px 10px 2px; border-bottom-width: 1px; background: rgba(255, 214, 120, .12); border-color: rgba(255, 214, 120, .55); letter-spacing: .08em; }
/* settings: two groups — one column with keyboard & mouse, two in touch mode (.two) */
.set-cols { display: grid; grid-template-columns: 1fr; gap: 0 34px; }
.panel.set.two .set-cols { grid-template-columns: 1fr 1fr; }
.set-grp { font: 700 11px/1 var(--f-ui); letter-spacing: .3em; color: var(--teal); text-transform: uppercase; margin: 10px 0 4px 10px; }
.set-col:first-child .set-grp { margin-top: 0; }
.set-sub { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--ink-faint); text-transform: uppercase; margin-top: 3px; }
.set-sub:empty { display: none; }
.seg button { line-height: 1.1; }

/* pause */
.pause .p-dim { position: absolute; inset: 0; background: radial-gradient(120% 90% at 30% 50%, rgba(6, 14, 42, .55), rgba(4, 8, 28, .82)); }
.p-card { position: absolute; left: clamp(28px, 8vw, 130px); top: 50%; transform: translateY(-50%); width: min(420px, calc(100vw - 56px)); }
.p-k { font: 600 12px/1 var(--f-ui); letter-spacing: .4em; color: var(--gold-hi); text-transform: uppercase; }
.p-title { font: 700 clamp(40px, 6vw, 64px)/1.05 var(--f-title); letter-spacing: .14em; margin: 8px 0 6px; text-shadow: 0 3px 0 #13245a, 0 8px 30px rgba(0,0,0,.4); }
.p-obj { font-size: 14px; color: var(--ink-dim); margin-bottom: 26px; letter-spacing: .04em; min-height: 1.2em; }
.p-obj b { color: var(--ink); font-weight: 600; }
.p-info { font: 600 12px/1.3 var(--f-num); letter-spacing: .16em; color: var(--gold-hi); margin: -18px 0 24px; text-shadow: var(--shadow-t); }

/* results */
.results .r-dim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 14, 42, .25), rgba(6, 14, 42, .75) 60%, rgba(4, 8, 26, .92)); }
.results.lose .r-dim { background: linear-gradient(180deg, rgba(30, 8, 20, .35), rgba(20, 6, 18, .78) 60%, rgba(10, 4, 12, .94)); }
.r-wrap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%); width: min(860px, calc(100vw - 32px)); text-align: center; }
.r-k { font: 600 13px/1 var(--f-ui); letter-spacing: .5em; padding-left: .5em; color: var(--gold-hi); text-transform: uppercase; text-shadow: var(--shadow-t); }
.lose .r-k { color: #ffb3bf; }
.r-title { font: 700 clamp(56px, 11vw, 132px)/1 var(--f-title); letter-spacing: .16em; padding-left: .16em; margin: 12px 0 8px;
  background: linear-gradient(180deg, #ffffff 20%, #fff1c8 55%, #f2c45a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #13245a) drop-shadow(0 12px 26px rgba(0, 0, 0, .45)); }
.lose .r-title { background: linear-gradient(180deg, #ffffff 15%, #ffd0d6 55%, #ff5c74 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 4px 0 #3a0c1e) drop-shadow(0 12px 26px rgba(0, 0, 0, .5)); }
.r-line { font-size: 15px; color: var(--ink-dim); letter-spacing: .06em; margin-bottom: 14px; }
.r-head { position: relative; display: inline-block; }
.r-grade { position: absolute; left: 100%; top: 50%; transform: translate(18px, -50%) rotate(-8deg); width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center; align-content: center; background: radial-gradient(circle, rgba(255, 231, 163, .22), rgba(255, 231, 163, 0) 70%);
  border: 2px solid var(--gold-hi); box-shadow: 0 0 22px rgba(255, 210, 120, .45), inset 0 0 14px rgba(255, 210, 120, .35); animation: gradein .7s cubic-bezier(.2, 1.6, .4, 1) .6s both; }
.r-gk { font: 700 9px/1 var(--f-ui); letter-spacing: .3em; color: var(--gold-hi); margin-bottom: 2px; text-transform: uppercase; }
.r-gl { font: 800 italic 52px/1 var(--f-num); color: #fff; text-shadow: 0 3px 0 #13245a, 0 0 18px rgba(255, 220, 140, .8); }
.r-grade.g-s .r-gl { color: #ffe27a; }
.r-grade.g-d .r-gl { color: #d4dbeb; text-shadow: 0 3px 0 #13245a; }
.lose .r-grade { border-color: #ffb3bf; box-shadow: 0 0 18px rgba(255, 90, 110, .4); }
@keyframes gradein-m { from { opacity: 0; transform: translate(16px, -50%) rotate(-30deg) scale(2.2); } to { opacity: 1; transform: translate(16px, -50%) rotate(-8deg) scale(1); } }
@keyframes gradein { from { opacity: 0; transform: translate(18px, -50%) rotate(-30deg) scale(2.2); } to { opacity: 1; transform: translate(18px, -50%) rotate(-8deg) scale(1); } }
.r-score { font: 700 16px/1 var(--f-num); letter-spacing: .24em; color: var(--gold-hi); margin-bottom: 26px; text-shadow: var(--shadow-t); text-transform: uppercase; }
.r-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 34px; }
.r-stat { padding: 16px 10px 14px; background: linear-gradient(180deg, rgba(20, 38, 92, .7), rgba(9, 18, 46, .7)); border: 1px solid rgba(255, 238, 200, .22); border-radius: 3px; position: relative; }
.r-stat::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--gold); }
.lose .r-stat::before { background: var(--low); }
.r-sv { font: 700 32px/1 var(--f-num); letter-spacing: .02em; }
.r-sl { font: 600 11px/1 var(--f-ui); letter-spacing: .18em; color: var(--ink-dim); margin-top: 8px; text-transform: uppercase; white-space: nowrap; }
.r-menu { flex-direction: row; justify-content: center; gap: 14px; }
.r-menu .pbtn { padding: 13px 38px; font-size: 15px; }
.pbtn small { font-size: 12px; letter-spacing: .12em; margin-left: 8px; opacity: .8; }
.pbtn small:empty { display: none; }
.r-lvl { display: inline-flex; align-items: center; gap: 7px; margin: -4px 0 16px; padding: 7px 26px 6px 22px; transform: skewX(-12deg);
  background: linear-gradient(90deg, rgba(8, 14, 40, 0), rgba(8, 14, 40, .7) 14%, rgba(8, 14, 40, .7) 86%, rgba(8, 14, 40, 0)); text-shadow: 0 1px 2px rgba(6, 10, 34, .9); }
.r-lvl > * { transform: skewX(12deg); }
.rl-ic { width: 13px; height: 17px; background: linear-gradient(180deg, #fff, var(--e2) 40%, var(--e1)); clip-path: polygon(50% 0, 64% 20%, 82% 36%, 94% 60%, 88% 84%, 68% 100%, 32% 100%, 12% 84%, 6% 60%, 20% 42%, 32% 54%, 36% 30%); }
.r-lvl.bolt .rl-ic { clip-path: polygon(62% 0, 12% 58%, 44% 58%, 30% 100%, 88% 38%, 56% 38%, 74% 0); width: 15px; }
.rl-k { font: 800 11px/1 var(--f-ui); letter-spacing: .16em; color: var(--e2); }
.rl-n { font: 800 italic 26px/1 var(--f-num); color: #fff; text-shadow: 0 0 12px var(--eg), 0 2px 0 #13245a; }
.r-lvl > .rl-dot { width: 5px; height: 5px; transform: skewX(12deg) rotate(45deg); background: var(--e1); margin: 0 3px; }
.rl-el { font: 700 13px/1 var(--f-ui); letter-spacing: .24em; color: var(--e2); }
.rl-xp { font: 600 12px/1 var(--f-num); letter-spacing: .08em; color: var(--ink-dim); white-space: pre; }
.r-reach { font: 600 13px/1 var(--f-ui); letter-spacing: .22em; color: var(--ink); text-transform: uppercase; margin: -4px 0 14px; text-shadow: var(--shadow-t); }
.r-next { font: 600 12px/1 var(--f-ui); letter-spacing: .14em; color: var(--ink-dim); margin: -16px 0 24px; text-shadow: var(--shadow-t); }
.r-parts { display: flex; justify-content: center; gap: 22px; margin: -14px 0 22px; }
.r-part { display: grid; gap: 5px; justify-items: center; }
.r-part span { font: 700 10px/1 var(--f-ui); letter-spacing: .24em; color: var(--ink-dim); text-transform: uppercase; }
.r-part b { position: relative; display: block; width: 86px; height: 4px; transform: skewX(-24deg); background: rgba(8, 12, 36, .6); border: 1px solid rgba(255, 255, 255, .35); overflow: hidden; }
.r-part b i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #ffe7a3, #ffb030); }
.lose .r-part b i { background: linear-gradient(90deg, #ffd0d6, #ff5c74); }
.r-run { font-size: 12.5px; letter-spacing: .06em; color: var(--ink-dim); margin: -18px 0 26px; text-shadow: var(--shadow-t); }
/* survival results: gold-violet (the end of every run, not a story defeat), the wave reached as the title */
.results.surv .r-dim { background: linear-gradient(180deg, rgba(10, 12, 44, .3), rgba(16, 10, 44, .78) 60%, rgba(8, 6, 26, .93)); }
.results.surv .r-k { color: #ffc2cb; }
.results.surv .r-title { background: linear-gradient(180deg, #ffffff 15%, #ffe7a3 55%, #ff9a5a 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 0 #2a1450) drop-shadow(0 12px 26px rgba(0, 0, 0, .5)); }
.results.surv .r-stat::before { background: #ff8a9c; }
.results.surv .r-score { font-size: 22px; letter-spacing: .26em; margin-bottom: 20px; }
.r-best { position: absolute; right: 100%; top: 50%; transform: translate(-18px, -50%) rotate(-10deg); width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center;
  border: 2px solid var(--gold-hi); background: radial-gradient(circle, rgba(255, 214, 120, .35), rgba(40, 20, 70, .8) 70%); box-shadow: 0 0 22px rgba(255, 210, 120, .55);
  animation: bestin .6s cubic-bezier(.3, 1.6, .5, 1) both .35s; text-align: center; }
@keyframes bestin-m { from { opacity: 0; transform: translate(-6px, -50%) rotate(20deg) scale(2); } to { opacity: 1; transform: translate(-6px, -50%) rotate(-10deg) scale(1); } }
@keyframes bestin { from { opacity: 0; transform: translate(-18px, -50%) rotate(20deg) scale(2.2); } to { opacity: 1; transform: translate(-18px, -50%) rotate(-10deg) scale(1); } }
.r-best b { font: 800 italic 30px/1 var(--f-num); color: #fff; letter-spacing: .04em; text-shadow: 0 3px 0 #2a1450, 0 0 14px rgba(255, 220, 140, .9); }
.r-best span { font: 700 11px/1 var(--f-ui); letter-spacing: .38em; padding-left: .38em; color: var(--gold-hi); margin-top: 3px; text-transform: uppercase; }
.r-run b { color: var(--gold-hi); font-weight: 600; margin-right: 6px; text-transform: uppercase; letter-spacing: .16em; font-size: 11.5px; }
.lose .r-run b { color: #ffb3bf; }

/* ------------------------------------------------------------------ HUD */
.hud { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.hud.on { opacity: 1; }
.hud.cine .hud-fly { opacity: 0; }
.hud-fly { position: absolute; inset: 0; transition: opacity .6s ease; }
.hud.hidden-all, .hud.hidden-all .hud-fly { opacity: 0 !important; }
.hud.photo-mode > :not(.photo) { opacity: 0 !important; transition: opacity .3s; }

/* vignettes */
.vig { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.vig-dmg { background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(255, 30, 60, 0) 42%, rgba(255, 40, 70, .42) 70%, rgba(255, 30, 60, .7) 100%); }
.vig-low { background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(255, 20, 50, 0) 48%, rgba(210, 10, 44, .38) 72%, rgba(170, 0, 36, .7) 100%); }
.vig-low.on { animation: lowpulse .83s ease-in-out infinite; }
/* 실사: 분홍 물감 대신 가장자리가 핏빛으로 어두워진다 (곱하기 합성 — 흰 구름도 분홍으로 칠하지 않는다) */
html.real-art .vig-dmg { mix-blend-mode: multiply; background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(255, 255, 255, 0) 46%, rgba(190, 40, 34, .55) 74%, rgba(120, 8, 10, .85) 100%); }
html.real-art .vig-low { mix-blend-mode: multiply; background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(255, 255, 255, 0) 50%, rgba(170, 28, 26, .5) 76%, rgba(100, 4, 8, .85) 100%); }
@keyframes lowpulse { 0%, 100% { opacity: .35; } 45% { opacity: .9; } }
.hitdir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
.hitdir i { position: absolute; left: -130px; top: calc(-1 * min(38vh, 300px)); width: 260px; height: 60px; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border-top: 5px solid rgba(255, 60, 80, .95); filter: blur(.5px); }

/* objective */
.objective { position: absolute; left: 28px; top: 26px; display: flex; gap: 12px; align-items: flex-start; max-width: min(460px, 60vw);
  text-shadow: 0 1px 2px rgba(6, 12, 34, .9), 0 0 10px rgba(6, 12, 34, .6), 0 0 24px rgba(6, 12, 34, .35);
  /* a soft navy plate: the sub-line stays ≥ 4.5 : 1 even over a sunlit white cumulus */
  margin: -9px 0 0 -12px; padding: 9px 34px 10px 12px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(8, 16, 44, .7) 0, rgba(8, 16, 44, .66) calc(100% - 34px), rgba(8, 16, 44, 0) 100%); }
.obj-dia { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 3px; transform: rotate(45deg); border: 2px solid var(--gold-hi); background: rgba(242, 196, 90, .35); box-shadow: 0 0 10px rgba(255, 210, 120, .5); }
.obj-k { font: 700 10.5px/1 var(--f-ui); letter-spacing: .32em; color: var(--gold-hi); text-transform: uppercase; margin-bottom: 5px; }
.obj-t { font: 600 16px/1.25 var(--f-ui); letter-spacing: .02em; }
.obj-s { font: 600 13px/1.3 var(--f-ui); color: #e6ecfa; margin-top: 3px; letter-spacing: .03em; }
.objective.flash .obj-t { animation: objflash 1.2s ease; }
@keyframes objflash { 0% { color: var(--gold-hi); transform: translateX(10px); opacity: 0; } 30% { opacity: 1; transform: none; } 100% { color: var(--ink); } }

@media (min-width: 901px) {
  .boss.on ~ .objective { max-width: calc(50vw - min(26vw, 380px) - 52px); }
  .wave.on ~ .objective { max-width: calc(50vw - 190px - 52px); }
  .svh.on ~ .objective { max-width: calc(50vw - 200px - 52px); }
}
/* wave strip (top centre while no boss): "WAVE 2/3 · 6 LEFT" */
.wave { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); display: grid; justify-items: center; gap: 7px; opacity: 0; transition: opacity .5s ease;
  text-shadow: 0 1px 2px rgba(6, 12, 34, .9), 0 0 10px rgba(6, 12, 34, .7), 0 0 22px rgba(6, 12, 34, .45); pointer-events: none; }
.wave.on { opacity: 1; }
.wv-row { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.wv-dia { width: 8px; height: 8px; transform: rotate(45deg); background: #ff5a6e; box-shadow: 0 0 8px rgba(255, 60, 90, .7); }
.wv-t { font: 700 16px/1 var(--f-title); letter-spacing: .3em; color: #fff; }
.wv-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); }
.wv-l { font: 700 12px/1 var(--f-ui); letter-spacing: .24em; color: #ffc2cb; font-variant-numeric: tabular-nums; }
.wave.cleared .wv-l { color: var(--gold-hi); }
.wave.cleared .wv-dia { background: var(--gold-hi); box-shadow: 0 0 10px rgba(255, 220, 140, .9); }
.wv-bar { position: relative; width: 230px; height: 4px; transform: skewX(-24deg); background: rgba(8, 12, 36, .6); border: 1px solid rgba(255, 255, 255, .45); overflow: hidden; }
.wv-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, #ffe7a3, #ff9a5a); transition: transform .45s ease; }
.wave.nobar .wv-bar { display: none; }
/* survival panel (top centre in place of the wave strip): SURVIVAL · WAVE n / time · score · best / enemies */
.svh { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; opacity: 0; transition: opacity .5s ease;
  padding: 8px 34px 10px; pointer-events: none; white-space: nowrap;
  background: radial-gradient(closest-side, rgba(8, 16, 44, .62), rgba(8, 16, 44, .38) 62%, rgba(8, 16, 44, 0));
  text-shadow: 0 1px 2px rgba(6, 12, 34, .9), 0 0 10px rgba(6, 12, 34, .7), 0 0 22px rgba(6, 12, 34, .45); }
.svh.on { opacity: 1; }
.sv-top { display: flex; align-items: center; gap: 10px; }
.sv-dia { width: 7px; height: 7px; transform: rotate(45deg); background: #ff8a9c; box-shadow: 0 0 8px rgba(255, 90, 120, .8); }
.sv-t { font: 700 12px/1 var(--f-title); letter-spacing: .4em; padding-left: .4em; color: #ffc2cb; }
.sv-wk { font: 700 15px/1 var(--f-title); letter-spacing: .3em; color: #fff; margin-left: 4px; }
.sv-wn { display: inline-block; min-width: .7em; margin: -8px 0 -6px -4px; font: 800 italic 34px/1 var(--f-num); color: var(--gold-hi); -webkit-text-stroke: 5px #1b1030; paint-order: stroke fill; text-align: center; }
.sv-row { display: flex; align-items: baseline; gap: 12px; font-variant-numeric: tabular-nums; }
.sv-row b { display: inline-block; font: 700 18px/1 var(--f-num); letter-spacing: .03em; }
.sv-k { font: 700 9.5px/1 var(--f-ui); letter-spacing: .26em; color: var(--ink-dim); margin-right: 6px; }
.sv-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); align-self: center; }
.sv-sc b { color: var(--gold-hi); transform-origin: center 70%; }
.sv-bs.none b { color: var(--ink-faint); }
.svh.newbest .sv-bs .sv-k { color: var(--gold-hi); }
.svh.newbest .sv-bs b { color: #fff; text-shadow: 0 0 12px rgba(255, 210, 120, .95), 0 1px 2px rgba(6, 12, 34, .9); }
.sv-foe { display: flex; align-items: baseline; gap: 6px; }
.sv-fd { align-self: center; width: 7px; height: 7px; transform: rotate(45deg); background: #ff5a6e; box-shadow: 0 0 8px rgba(255, 60, 90, .7); }
.sv-foe b { font: 700 15px/1 var(--f-num); color: #ffc2cb; }
.sv-foe .sv-k { color: #ffc2cb; margin-right: 0; }
.sv-foe.many b, .sv-foe.many .sv-k { color: #ff8a9c; }
.sv-foe.many .sv-fd { animation: blink4 .5s steps(2) infinite; }
.sv-next { font: 600 9.5px/1 var(--f-ui); letter-spacing: .2em; color: var(--ink-dim); }
/* kills + combo (top right) */
.tally { position: absolute; right: 28px; top: 22px; display: grid; justify-items: end; gap: 5px; text-shadow: var(--shadow-t); pointer-events: none; }
.kills { display: flex; align-items: baseline; gap: 8px; opacity: 0; transition: opacity .4s; transform-origin: right center; }
.kills.on { opacity: 1; }
.kl-ic { align-self: center; width: 9px; height: 9px; transform: rotate(45deg); background: #ff5a6e; box-shadow: 0 0 8px rgba(255, 60, 90, .6); }
.kills b { font: 800 italic 24px/1 var(--f-num); font-variant-numeric: tabular-nums; }
.kills span { font: 700 10.5px/1 var(--f-ui); letter-spacing: .3em; color: var(--ink-dim); }
.combo { display: grid; justify-items: end; gap: 4px; opacity: 0; transform: translate3d(14px, 0, 0); transition: opacity .25s ease, transform .25s ease; }
.combo.on { opacity: 1; transform: none; }
.cb-row { display: flex; align-items: baseline; gap: 8px; }
.cb-n { font: 800 italic 36px/1 var(--f-num); color: var(--gold-hi); -webkit-text-stroke: 5px #1b1030; paint-order: stroke fill; transform-origin: right bottom; }
.cb-k { font: 800 12px/1 var(--f-ui); letter-spacing: .34em; color: #fff; }
.combo.hot .cb-n { color: #ffa860; }
.cb-bar { position: relative; width: 124px; height: 3px; background: rgba(8, 12, 36, .55); overflow: hidden; }
.cb-bar i { position: absolute; inset: 0; transform-origin: right; background: linear-gradient(90deg, #fff1c8, var(--gold)); }
.combo.hot .cb-bar i { background: linear-gradient(90deg, #ffd08a, #ff6a3a); }
/* boss bar */
.boss { position: absolute; left: 50%; top: 26px; width: min(52vw, 760px); transform: translateX(-50%); opacity: 0; transition: opacity .8s ease; }
.boss.on { opacity: 1; }
.boss-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; text-shadow: 0 1px 2px rgba(6, 12, 34, .9), 0 0 10px rgba(6, 12, 34, .7), 0 0 22px rgba(6, 12, 34, .45); }
.boss-name { font: 700 17px/1 var(--f-title); letter-spacing: .34em; color: #fff; }
.boss-name small { font: 600 11px/1 var(--f-ui); letter-spacing: .24em; color: var(--gold-hi); margin-left: 14px; text-transform: uppercase; }
.boss-phase { font: 700 12px/1 var(--f-ui); letter-spacing: .26em; color: var(--gold-hi); text-transform: uppercase; white-space: nowrap; }
.boss-name { white-space: nowrap; }
/* below ≈1400 px the subtitle does not fit beside the name and the phase (it wrapped at 1280): the name card has it */
@media (max-width: 1400px) { .boss-name small { display: none; } }
.boss.enraged .boss-phase { color: #ff8a9c; }
.boss-esc { font: 700 11px/1 var(--f-ui); letter-spacing: .22em; color: #ffc2cb; }
.bar { position: relative; height: 12px; transform: skewX(-24deg); background: rgba(8, 12, 36, .72); border: 1px solid rgba(255, 255, 255, .7); overflow: hidden; }
.bar > i { position: absolute; inset: 0; transform-origin: left; will-change: transform; }
.bar .chip { background: #fff7e0; transition: transform .5s cubic-bezier(.2, .7, .2, 1) .35s; }
.boss .bar { height: 14px; }
.boss .bar .fill { background: linear-gradient(180deg, #ffd88a 0%, #ffb030 45%, #e2632c 100%); }
.boss.enraged .bar .fill { background: linear-gradient(180deg, #ff9aa8 0%, #ff4d6d 50%, #b8123a 100%); }
.bar .tick { position: absolute; top: -1px; bottom: -1px; width: 2px; background: rgba(8, 12, 36, .9); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.boss-under { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; font: 600 12px/1 var(--f-num); letter-spacing: .06em; color: var(--ink); text-shadow: 0 1px 2px rgba(6, 12, 34, .9), 0 0 10px rgba(6, 12, 34, .7); }

/* player panel */
.pl { position: absolute; left: 28px; bottom: 28px; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 0 14px; width: min(430px, 44vw); text-shadow: var(--shadow-t); }
.pl-por { position: relative; width: 88px; height: 64px; }
.por { position: absolute; bottom: 0; width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255, 246, 225, .95);
  background: url(assets/textures/keyart.jpg) no-repeat; box-shadow: 0 4px 14px rgba(0, 0, 20, .45); }
/* crops of assets/textures/keyart.jpg (2048², scarlet Sora v2): Sora's head ⌀330 at (1580, 1180), Kaede ⌀160 at (962, 905) */
.por.sora { left: 0; background-size: 360px 360px; background-position: -249px -178px; border-color: #ffe2a0; }
.por.kaede { left: 34px; bottom: 10px; width: 50px; height: 50px; background-size: 640px 640px; background-position: -276px -258px; border-color: #ffd7cf; }
.pl-main { padding-bottom: 2px; }
.pl-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pl-name { font: 700 13px/1 var(--f-ui); letter-spacing: .26em; }
.pl-hp { font: 700 15px/1 var(--f-num); letter-spacing: .04em; }
.pl-hp small { color: var(--ink-dim); font-weight: 600; }
.pl .bar { height: 13px; }
.pl .bar .fill { background: linear-gradient(180deg, var(--hp-a), var(--hp-b)); }
.pl .bar .heal { background: #b8ffdf; }
.pl.low .bar .fill { background: linear-gradient(180deg, #ff9aac, var(--low)); animation: hpblink .83s ease-in-out infinite; }
@keyframes hpblink { 50% { opacity: .55; } }
.pl-st { margin-top: 5px; height: 5px; transform: skewX(-24deg); background: rgba(8, 12, 36, .6); position: relative; overflow: hidden; }
.pl-st i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #bff4ff, var(--stam)); }
.pl-st.low i { background: linear-gradient(90deg, #ffe0a0, var(--warn)); }
/* levels (levels.js): element colours — e1 main, e2 light, e3 deep, ea translucent, eg glow */
.el-ember { --e1: #ff8a2a; --e2: #ffd27a; --e3: #b8261a; --ea: rgba(255, 120, 40, .55); --eg: rgba(255, 140, 60, .85); }
.el-azure { --e1: #3fa2ff; --e2: #c4e8ff; --e3: #163fa8; --ea: rgba(60, 150, 255, .55); --eg: rgba(90, 175, 255, .9); }
.el-radiant { --e1: #ffcf4a; --e2: #fffbe6; --e3: #b8700c; --ea: rgba(255, 214, 110, .55); --eg: rgba(255, 236, 170, .95); }
.el-lightning { --e1: #62e2ff; --e2: #effdff; --e3: #1d58c4; --ea: rgba(100, 220, 255, .55); --eg: rgba(150, 235, 255, .95); }
.el-storm { --e1: #ffcc3a; --e2: #e6fbff; --e3: #1b4aa8; --ea: rgba(110, 205, 255, .5); --eg: rgba(255, 214, 110, .9); }
/* level badge "LV 7" before the name: element colour, a flame (bolt from lightning on) */
.lvb { display: none; align-self: center; align-items: center; gap: 3px; margin-right: 12px; padding: 3px 8px 2px 6px; transform: skewX(-14deg);
  background: linear-gradient(180deg, var(--e3), rgba(8, 12, 36, .92)); border: 1px solid var(--e2); box-shadow: 0 0 10px var(--ea), inset 0 0 6px var(--ea); text-shadow: none; }
.lvb.on { display: inline-flex; }
.lvb > * { transform: skewX(14deg); }
.lvb-ic { width: 9px; height: 12px; background: linear-gradient(180deg, #fff, var(--e2) 40%, var(--e1)); clip-path: polygon(50% 0, 64% 20%, 82% 36%, 94% 60%, 88% 84%, 68% 100%, 32% 100%, 12% 84%, 6% 60%, 20% 42%, 32% 54%, 36% 30%); }
.lvb.bolt .lvb-ic { clip-path: polygon(62% 0, 12% 58%, 44% 58%, 30% 100%, 88% 38%, 56% 38%, 74% 0); width: 10px; }
.lvb-k { font: 800 9px/1 var(--f-ui); letter-spacing: .12em; color: var(--e2); margin-left: 2px; }
.lvb-n { font: 800 italic 16px/1 var(--f-num); color: #fff; min-width: .6em; text-align: center; text-shadow: 0 0 8px var(--eg), 0 1px 0 rgba(6, 10, 34, .9); }
.lvb + .pl-name { margin-right: auto; }
/* XP bar under the stamina bar: in-level progress; a gain flashes its segment, a level-up fills + flashes */
.pl-xp { display: none; align-items: center; gap: 8px; margin-top: 5px; }
.pl-xp.on { display: flex; }
.xp-bar { position: relative; flex: 1; height: 5px; transform: skewX(-24deg); background: rgba(8, 12, 36, .7); box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); overflow: hidden; }
/* notches every 10 %: a segmented bar (the stamina bar above is a plain one) */
.xp-bar::before { content: ""; position: absolute; inset: 0; z-index: 2; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0 calc(10% - 1.5px), rgba(8, 12, 36, .85) calc(10% - 1.5px) 10%); }
.xp-bar > i { position: absolute; top: 0; bottom: 0; left: 0; }
.xp-fill { right: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--e2), var(--e1)); transition: transform .35s cubic-bezier(.2, .8, .3, 1); will-change: transform; }
.xp-gl { width: 0; background: #fff; opacity: 0; will-change: opacity; }
.pl-xp.lvl .xp-fill { transition: transform .18s ease-out; }
.pl-xp.snap .xp-fill { transition: none; }
.pl-xp.lvl .xp-bar::after { content: ""; position: absolute; inset: 0; z-index: 3; background: #fff; animation: xpflash .55s ease-out both; }
@keyframes xpflash { 0% { opacity: 0; } 30% { opacity: .95; } 100% { opacity: 0; } }
.pl-xp.max .xp-fill { background: linear-gradient(90deg, var(--e2), #fff 50%, var(--e1)); }
.xp-t { min-width: 70px; text-align: right; font: 800 11px/1 var(--f-num); letter-spacing: .06em; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 1px #0b1533, 0 1px 2px rgba(6, 12, 34, .95), 0 0 8px rgba(6, 12, 34, .8), 0 0 10px var(--ea); }
@media (max-width: 1100px) { .lvb + .pl-name { letter-spacing: .16em; } }

/* flight readouts */
.fr { position: absolute; top: 50%; transform: translateY(-50%); text-shadow: var(--shadow-t); display: flex; flex-direction: column; gap: 4px; }
.fr.spd { right: calc(50% + min(26vw, 330px)); align-items: flex-end; }
.fr.alt { left: calc(50% + min(26vw, 330px)); align-items: flex-start; }
.fr-k { font: 700 10px/1 var(--f-ui); letter-spacing: .34em; color: var(--ink-dim); }
.fr-v { font: 700 30px/1 var(--f-num); letter-spacing: .01em; font-style: italic; font-variant-numeric: tabular-nums; }
.fr-v small { font-size: 13px; font-style: normal; font-weight: 600; color: var(--ink-dim); margin-left: 4px; letter-spacing: .06em; }
.fr-tape { width: 2px; height: 64px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); position: relative; }
.fr.spd .fr-tape { align-self: flex-end; margin-right: 2px; }
.fr-vs { font: 700 12px/1 var(--f-num); color: var(--ink-dim); letter-spacing: .05em; }
.fr-vs.vs-up { color: #a8f0ff; } .fr-vs.vs-dn { color: #ffd38a; }
.fr.boosting .fr-v { color: #bff4ff; }
.fr { transition: opacity .25s ease; }
.fr.near { opacity: .22; }

/* reticle (heading crosshair + heat/stamina arcs + breath range cue) */
.ret { position: absolute; left: 0; top: 0; width: 132px; height: 132px; margin: -66px 0 0 -66px; will-change: transform; }
.ret svg { width: 100%; height: 100%; overflow: visible;
  /* (151) 크림색 십자·괄호가 흰 구름 위에선 사라졌다 — 얇은 남색 테두리 그림자로 어떤 배경에서도 읽히게 */
  filter: drop-shadow(0 0 1px rgba(6, 12, 34, .7)) drop-shadow(0 0 3px rgba(6, 12, 34, .3)); }
.ret .rg-bg { fill: none; stroke: rgba(8, 14, 40, .45); stroke-width: 5; stroke-linecap: round; }
.ret .rg-heat { fill: none; stroke: var(--heat); stroke-width: 3.5; stroke-linecap: round; transition: stroke .2s; }
.ret .rg-stam { fill: none; stroke: var(--stam); stroke-width: 3.5; stroke-linecap: round; }
.ret.hot .rg-heat { stroke: #ff7a3a; } .ret.over .rg-heat { stroke: var(--red); }
.ret .ch { stroke: #fffaf0; stroke-width: 2; fill: none; stroke-linecap: round; }
.ret .ch-dot { fill: #fffaf0; }
.ret .br { stroke: rgba(255, 250, 240, .55); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s, transform .2s; transform-origin: 66px 66px; }
.ret.inrange .br { stroke: #ffb347; transform: scale(.86); }
.ret.inrange .ch { stroke: #ffd49a; }
.ret-lbl { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px; white-space: nowrap; font: 700 11px/1 var(--f-ui); letter-spacing: .26em; text-shadow: var(--shadow-t); opacity: 0; transition: opacity .2s;
  padding: 4px 6px 4px 9px; border-radius: 2px; background: rgba(12, 6, 26, .62); }   /* a dark pill: readable over the flame */
.ret.inrange .ret-lbl.range { opacity: 1; color: #ffc27a; }
.ret.over .ret-lbl.range { opacity: 0; }
.ret-lbl.over { color: #ff6b80; }
.ret.over .ret-lbl.over { opacity: 1; animation: blink4 .25s steps(2) infinite; }
@keyframes blink4 { 50% { opacity: .25; } }
.ret .hitx { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; opacity: 0; transform-origin: 66px 66px; }
.ret .hitx.kill { stroke: var(--red); }
.aim { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 1.5px solid rgba(255, 250, 240, .55); border-radius: 50%; will-change: transform;
  box-shadow: 0 0 0 1px rgba(6, 12, 34, .35), inset 0 0 0 1px rgba(6, 12, 34, .3); }
.aim::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; border-radius: 50%; background: rgba(255, 250, 240, .7); }
/* the reticle's edge chevron while the reticle is off screen (free look): a small crosshair ring (the reticle's own
   look, cream on a dark disc) and a chevron around it pointing where the reticle is; cream, not red / gold / violet,
   so it never reads as an enemy, the titan or a flock */
.ret-edge { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .1s ease; will-change: transform, opacity; }
.re-ring { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fffaf0;
  background: rgba(8, 14, 40, .5); box-shadow: 0 0 0 1.5px rgba(6, 12, 34, .6); }
.re-ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #fffaf0; }
.re-rot { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.re-chev { position: absolute; left: 19px; top: -10px; width: 16px; height: 20px; background: #fffaf0; clip-path: polygon(0 0, 100% 50%, 0 100%, 32% 50%); }
.re-chev.bk { left: 16.5px; top: -13px; width: 21.5px; height: 26px; background: rgba(6, 12, 34, .75); }

/* skills (desktop: display only, touch: buttons) */
.skills { position: absolute; right: 30px; bottom: 26px; display: grid; grid-template-columns: repeat(3, auto); grid-template-rows: auto auto; gap: 10px 12px; align-items: end; }
.sk { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; padding: 0; background: rgba(9, 18, 46, .6); box-shadow: inset 0 0 0 1.5px rgba(255, 246, 225, .55); display: grid; place-items: center; }
.sk.big { width: 74px; height: 74px; grid-row: span 2; align-self: center; }
.sk svg.ic { width: 55%; height: 55%; fill: none; stroke: #fffaf0; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 30, .6)); }
.sk .ring { position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--rc, var(--gold-hi)) calc(var(--v, 1) * 360deg), rgba(255, 255, 255, .08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px)); }
.sk .cd { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(4, 8, 26, .72) calc(var(--c, 0) * 360deg), transparent 0); }
.sk .cdt { position: absolute; inset: 0; display: grid; place-items: center; font: 700 19px/1 var(--f-num); text-shadow: var(--shadow-t); }
.sk .key { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); min-width: 22px; padding: 2px 5px 1px; border-radius: 3px; background: rgba(6, 12, 34, .88);
  border: 1px solid rgba(255, 238, 200, .5); font: 700 10px/1.2 var(--f-ui); letter-spacing: .04em; white-space: nowrap; text-align: center; }
.sk.ready { box-shadow: inset 0 0 0 1.5px rgba(255, 246, 225, .9), 0 0 16px rgba(255, 214, 130, .45); }
.sk.off svg.ic { opacity: .45; }
.sk.hot { --rc: #ff7a3a; } .sk.over { --rc: var(--red); }
.sk[data-sk=boost], .sk[data-sk=power], .sk[data-sk=dodge] { --rc: var(--stam); }
.sk[data-sk=breath] { --rc: var(--heat); }
.sk.over svg.ic { stroke: #ff8a9a; }
.sk.cooling svg.ic { opacity: .28; }
.sk.partial { box-shadow: inset 0 0 0 1.5px rgba(255, 246, 225, .8), 0 0 10px rgba(255, 214, 130, .25); }
.sk.over .ring { animation: overblink .5s steps(2) infinite; }
@keyframes overblink { 50% { opacity: .3; } }
.pips { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); display: none; gap: 5px; }
.pips.on { display: flex; }
.pips i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid rgba(255, 238, 200, .85); background: rgba(8, 12, 36, .75); }
.pips i.on { background: var(--gold-hi); box-shadow: 0 0 6px rgba(255, 210, 120, .9); }
.sk.pressed { transform: scale(.92); }

/* enemy markers, lock, off-screen arrows */
.mk { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform, opacity; }
.mk-in { position: absolute; left: 0; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; white-space: nowrap; text-shadow: var(--shadow-t); }
.mk-name { font: 700 10.5px/1 var(--f-ui); letter-spacing: .18em; color: #ffe4e4; }
.mk .bar { width: 84px; height: 6px; transform: skewX(-24deg); border-color: rgba(255, 255, 255, .6); }
.mk .bar .fill { background: linear-gradient(180deg, #ff9aa6, #e0283f); }
.mk-dist { font: 600 11px/1 var(--f-num); letter-spacing: .06em; color: rgba(255, 250, 240, .85); text-shadow: 0 1px 2px rgba(6, 12, 34, .95), 0 0 6px rgba(6, 12, 34, .75); }
/* a small dark plate: name and distance stay readable over a sunlit cloud */
.mk-name, .mk-dist { padding: 2px 5px 1px; border-radius: 2px; background: rgba(14, 8, 26, .46); }
.mk-chev { position: absolute; left: -7px; top: -5px; width: 14px; height: 10px; }
.mk-chev::before { content: ""; position: absolute; inset: 0; background: #ff5a6e; clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.mk.far .mk-name, .mk.far .mk-dist { display: none; }
.mk.far .bar { width: 44px; height: 4px; }
.mk-lock { position: absolute; left: -32px; top: -32px; width: 64px; height: 64px; opacity: 0; transition: opacity .15s; }
.mk-lock svg { width: 100%; height: 100%; overflow: visible; }
.mk-lock .lk-o { fill: none; stroke: #ff5a6e; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(255, 60, 90, .6)); }
.mk-lock .lk-i { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 1.2; }
.mk.locked .mk-lock { opacity: 1; animation: lockspin 3s linear infinite; }
.mk.locked .mk-chev { display: none; }
.mk.locked .mk-in { bottom: 28px; }
.mk.titan .mk-in, .mk.titan .mk-chev { display: none; }
.mk.titan .mk-lock { left: -40px; top: -40px; width: 80px; height: 80px; }
.mk.drake .mk-chev::before { background: #c78cff; }
.mk.drake .bar .fill { background: linear-gradient(180deg, #e6ccff, #9b5cff); }
/* compact marker for every rider that is not near / locked / just hit */
.mk.mini .mk-chev { left: -5px; top: -4px; width: 10px; height: 7px; }
.mk.mini .mk-in { bottom: 7px; }
.mk.mini .bar { width: 26px; height: 3px; border-width: 1px; border-color: rgba(255, 255, 255, .5); }
.mk.mini.hit .bar { width: 36px; }
/* one aggregated marker per drake flock */
.fk-ic { position: absolute; left: -12px; top: -9px; width: 24px; height: 14px; }
.fk-ic i { position: absolute; width: 9px; height: 7px; background: #c78cff; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.fk-ic i:nth-child(1) { left: 7.5px; top: 0; } .fk-ic i:nth-child(2) { left: 0; top: 6px; } .fk-ic i:nth-child(3) { left: 15px; top: 6px; }
.mk.flock .mk-in { bottom: 12px; }
.fk-row { display: flex; align-items: baseline; gap: 6px; }
.mk.flock .mk-name { color: #eadcff; font-size: 10px; }
.fk-n { font: 800 italic 15px/1 var(--f-num); color: #fff; }
.mk.flock .bar { width: 60px; height: 4px; }
.mk.flock .bar .fill { background: linear-gradient(180deg, #e6ccff, #9b5cff); }
.mk.flock.far .mk-name, .mk.flock.far .mk-dist { display: none; }
.mk.flock.far .bar { width: 36px; }
@keyframes lockspin { from { transform: rotate(0deg); } to { transform: rotate(90deg); } }
.arr { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform, opacity; }
.arr i { position: absolute; left: -11px; top: -9px; width: 22px; height: 18px; background: #ff5a6e; clip-path: polygon(100% 50%, 0 0, 26% 50%, 0 100%); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.arr.titan i { left: -17px; top: -14px; width: 34px; height: 28px; background: var(--gold); }
.arr.shot i { background: var(--warn); }
.arr.shot.soon i { background: var(--red); }
.arr b { position: absolute; left: 0; top: 14px; transform: translateX(-50%); font: 700 10.5px/1 var(--f-num); letter-spacing: .05em; color: rgba(255, 250, 240, .9); white-space: nowrap;
  text-shadow: 0 1px 2px rgba(6, 12, 34, .95), 0 0 6px rgba(6, 12, 34, .8); }   /* readable over white cumulus */
.arr em { font: 800 italic 13px/1 var(--f-num); color: #fff; margin-right: 4px; }
.arr em:empty { display: none; }
.arr.multi i { left: -13px; top: -11px; width: 26px; height: 22px; }
.arr.flock i { background: #c78cff; }
.arr.locked i { background: #fff; filter: drop-shadow(0 0 4px #ff2d55); }
.arr.shot b { display: none; }

/* off-screen attack runs (hud.js ATTACK_RUN): a red double chevron inside the enemy arrows, toward a rider's breath run
   or a drake's dive that is about to reach Sora from off-screen; "ATTACK RUN" (+ "BEHIND") on the inner side */
.atk { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; visibility: hidden; will-change: transform, opacity; }
.atk.on { visibility: visible; }
.atk-c { position: absolute; left: -24px; top: -19px; width: 48px; height: 38px; filter: drop-shadow(0 0 1.5px rgba(50, 0, 10, .95)) drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.atk-c::before, .atk-c::after { content: ''; position: absolute; top: 0; bottom: 0; width: 30px; clip-path: polygon(100% 50%, 46% 0, 12% 0, 62% 50%, 12% 100%, 46% 100%); }
.atk-c::before { right: 0; background: linear-gradient(90deg, #ff2d4a, #ff7a55 62%, #fff0cf); }
.atk-c::after { left: 2px; background: linear-gradient(90deg, #c8102e, #ff3b55); opacity: .82; transform: scale(.86); }
.atk.on .atk-c::before { animation: atkpulse .3s ease-in-out infinite alternate; }
@keyframes atkpulse { from { opacity: 1; } to { opacity: .5; } }
.atk.bite .atk-c::after { background: linear-gradient(90deg, #7a2bd6, #c78cff); }
.atk-l { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.atk-t { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) skewX(-10deg); white-space: nowrap; padding: 3px 7px 2px 8px; border-radius: 2px;
  font: 800 italic 13px/1 var(--f-num); letter-spacing: .14em; color: #fff; background: linear-gradient(90deg, rgba(190, 14, 44, .9), rgba(255, 59, 85, .9));
  text-shadow: 0 1px 1px rgba(60, 0, 12, .6); box-shadow: 0 0 0 1px rgba(255, 220, 226, .55); }
.atk-s { position: absolute; left: 0; top: 12px; transform: translateX(-50%); white-space: nowrap; font: 800 10px/1 var(--f-num); letter-spacing: .3em; padding: 3px 4px 2px calc(4px + .3em);
  border-radius: 2px; color: #fff; background: rgba(34, 6, 18, .78); }
.atk-s:empty { display: none; }
.atk.up .atk-s { top: auto; bottom: 11px; }
.atk.bite .atk-t { background: linear-gradient(90deg, rgba(150, 30, 120, .9), rgba(255, 59, 85, .9)); }

/* titan weak points while a damage window is open */
.wk { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform, opacity; }
.wk-ring { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #ffe7a3;
  box-shadow: 0 0 0 1px rgba(40, 20, 0, .45), inset 0 0 0 1px rgba(40, 20, 0, .35); animation: wkpulse .7s ease-in-out infinite alternate; }
.wk.core .wk-ring { left: -28px; top: -28px; width: 56px; height: 56px; border-color: #ffcf40; }
.wk b { position: absolute; left: 0; top: -42px; transform: translateX(-50%); white-space: nowrap; font: 800 italic 12px/1 var(--f-num); letter-spacing: .12em;
  color: #ffe27a; padding: 3px 6px 2px; border-radius: 2px; background: rgba(20, 10, 4, .6); text-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.wk.core b { top: -50px; }
/* at the reticle: the label moves out to the right, past the reticle's arcs */
.wk.aim b { top: -8px; left: 76px; transform: none; }
.wk.aim.l b { left: -76px; transform: translateX(-100%); }
@keyframes wkpulse { from { transform: scale(.88); opacity: .7; } to { transform: scale(1.08); opacity: 1; } }

/* damage numbers */
.dn { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.dn span { display: block; transform: translate(-50%, -50%); font: 800 italic 26px/1 var(--f-num); letter-spacing: .01em; white-space: nowrap;
  color: #fff; -webkit-text-stroke: 5px #1b1030; paint-order: stroke fill; text-shadow: 0 2px 0 rgba(27, 16, 48, .8); }
.dn.fire span { color: #ffd08a; }
.dn.crit span { color: #ffe27a; font-size: 36px; }
.dn.crit span::after { content: " CRIT"; font-size: 15px; letter-spacing: .12em; color: #fff3b0; }
/* on enemy dragons the hit word says CRITICAL HIT!: the number keeps its gold and size, not a second "CRIT" */
.dn.crit.dn-hw span::after { content: none; }
.dn.player span { color: #ff8a9a; font-size: 24px; }
.dn.kill span { color: #ffe27a; font-size: 22px; letter-spacing: .18em; }
.dn.xp span { color: #c8f0ff; font-size: 18px; letter-spacing: .12em; }
.dn.combo span { color: #ffd88a; font-size: 22px; letter-spacing: .1em; -webkit-text-stroke: 4px #1b1030; }
/* levels and elements (hud.js DamageRoll): the lightning stream's one growing number per target (ice-white on deep
   blue) and the chain's one "CHAIN ×N" word instead of a number per jump */
.dn.dn-bolt span { color: #e4fbff; -webkit-text-stroke-color: #0a1a52; text-shadow: 0 2px 0 rgba(8, 20, 70, .85), 0 0 10px rgba(110, 220, 255, .55); }
.dn.crit.dn-bolt span { color: #fff6c0; }
.dn.chain span { color: #bff4ff; font-size: 19px; letter-spacing: .14em; -webkit-text-stroke: 4px #081650;
  text-shadow: 0 2px 0 rgba(8, 20, 70, .85), 0 0 12px rgba(110, 220, 255, .75); }

/* hit words (hitwords.js): manga SFX lettering that confirms every hit on an enemy dragon. Every letter is its own
   unit — three stacked copies: a light rim, a near-black ink outline, a gradient fill with a cel-shaded hard stop —
   tilted, sized and shifted a little on its own (set once per word by hitwords.js) and overlapping its neighbour, so
   the word reads as hand-lettered and on white cumulus and dark sky alike. Per frame only transforms / opacity change
   (the pop is a paused Web Animation that the word's own clock drives); the animated parts are their own layers. */
.hwords { position: absolute; inset: 0; pointer-events: none; }
.hw { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform, opacity; }
.hw-in { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%); white-space: nowrap; font-size: 40px; will-change: transform, opacity; }
.hw-row { position: relative; display: flex; align-items: center; justify-content: center; will-change: transform; }
.hw-t { position: relative; font: italic 900 1em/.92 "Avenir Next Condensed", Futura, Impact, "Arial Black", sans-serif; letter-spacing: .01em;
  --fill: linear-gradient(180deg, #fff 0%, #fffbe8 33%, #fff0a0 35%, #ffc53a 62%, #ff7418 100%); --ol: #140806; --rim: #fff7e6; --glow: rgba(12, 6, 36, 0); }
.hw-t b { display: block; font: inherit; white-space: nowrap; }
.hw-t .l1, .hw-t .l2 { position: absolute; left: 0; top: 0; }
.hw-t .ch { display: inline-block; margin-right: -.03em; transform-origin: 50% 62%; }
.hw-t .ch.sp { width: .45em; }
.hw-t .ch.bang { margin-left: .04em; }
.hw-t .l0 { color: var(--rim); -webkit-text-stroke: .32em var(--rim); text-shadow: 0 0 .32em var(--glow), .05em .1em 0 rgba(12, 6, 36, .45); }
.hw-t .l1 { color: var(--ol); -webkit-text-stroke: .19em var(--ol); }
/* each letter's fill box reaches .14em past it on both sides (same centre, same layout width): an italic letter's
   overhang keeps its fill */
.hw-t .l2 .ch { padding: 0 .14em; margin: 0 -.17em 0 -.14em; background: var(--fill); background-origin: content-box; background-repeat: repeat-x;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.hw-t .l2 .ch.bang { margin-left: -.1em; }
.hw-pre { display: none; position: relative; z-index: 1; font-size: .5em; letter-spacing: .12em; margin-bottom: .02em; }
.hw.pre .hw-pre { display: block; }
.hw-fl, .hw-sub { display: none; }
.hw.fl .hw-fl { display: block; }
.hw.sub .hw-sub { display: block; }
/* flavour: smaller, beside the confirmation, raised, its own tilt (set by the pop animation) */
.hw-fl { position: absolute; left: 100%; top: -.12em; margin-left: .4em; font-size: .54em; transform-origin: 0 100%; will-change: transform, opacity; }
.hw.fl-l .hw-fl { left: auto; right: 100%; margin: 0 .4em 0 0; transform-origin: 100% 100%; }
.hw.pre .hw-fl { top: .1em; }   /* level with HIT!, clear of the wider DIRECT / CRITICAL line above it */
.hw-sub { position: relative; z-index: 1; font-size: .62em; margin-top: .06em; letter-spacing: .04em; will-change: transform, opacity;
  --fill: linear-gradient(180deg, #fffdf0 0%, #fff4c8 34%, #ffe27a 36%, #f2a81c 100%); --ol: #1c0c02; --rim: #fffbe8; --glow: rgba(255, 200, 80, .55); }
/* "+25 XP" under a kill word (levels): small, cool white-cyan (the combo line above it is gold) */
.hw-xp { display: none; position: relative; z-index: 1; font-size: .4em; margin-top: .1em; letter-spacing: .06em; will-change: transform, opacity;
  --fill: linear-gradient(180deg, #fff 0%, #fff 38%, #d8f6ff 40%, #7fd4ff 100%); --ol: #0a1640; --rim: #f0fbff; --glow: rgba(110, 200, 255, .6); }
.hw.xp .hw-xp { display: block; }
/* types: breath HIT! (default, fire), fireball DIRECT HIT! / splash HIT!, CHARGED HIT!, CRITICAL HIT!, kills */
.hw.k-fb .hw-main, .hw.k-fb .hw-pre { --fill: linear-gradient(180deg, #fff 0%, #fff4e6 31%, #ffd7a0 33%, #ff9a3a 58%, #e8321e 100%); --ol: #140806; }
.hw.k-chg .hw-main, .hw.k-chg .hw-pre { --fill: linear-gradient(180deg, #fff 0%, #fff 38%, #fff2c0 40%, #ffd25a 66%, #ff9412 100%); --ol: #140806; --rim: #fff; --glow: rgba(255, 190, 60, .85); }
.hw.k-crit .hw-main, .hw.k-crit .hw-pre { --fill: linear-gradient(180deg, #fff 0%, #fffdf0 34%, #fff6a0 36%, #ffe94a 62%, #ffc000 100%); --ol: #a3106a; --rim: #fff; --glow: rgba(255, 70, 200, .7); }
.hw.k-kill .hw-main { --fill: linear-gradient(180deg, #fff 0%, #fff 44%, #eee6ff 46%, #c9b2ff 100%); --ol: #22106a; --rim: #d9c9ff; --glow: rgba(140, 90, 255, .9); letter-spacing: .03em; }
.hw-fl.f-fire { --fill: linear-gradient(180deg, #fff 0%, #fff6c8 30%, #ffd84a 32%, #ff5a14 100%); --ol: #140806; }
.hw-fl.f-fb { --fill: linear-gradient(180deg, #fff 0%, #ffe8c8 28%, #ffc46a 30%, #ff4a1a 100%); --ol: #140806; }
/* two hard white glints on the letters (twinkle after the pop) */
.hw-gl { position: absolute; z-index: 2; width: .3em; height: .3em; margin: -.15em 0 0 -.15em; opacity: 0; background: #fff; will-change: transform, opacity;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.hw-gl.g1 { left: 14%; top: 36%; }
.hw-gl.g2 { left: 80%; top: 62%; width: .22em; height: .22em; margin: -.11em 0 0 -.11em; }
/* HIT!: a short wedge of speed lines on the side away from the flavour (ink lines with a light edge) */
.hw-sl { position: absolute; top: 50%; right: 86%; width: 1.5em; height: 1.1em; margin-top: -.6em; opacity: 0; display: none; transform-origin: 100% 50%; will-change: transform, opacity;
  background: repeating-linear-gradient(174deg, rgba(20, 8, 6, .92) 0 .03em, rgba(255, 248, 230, .96) .03em .065em, rgba(20, 8, 6, .92) .065em .09em, rgba(0, 0, 0, 0) .09em .2em);
  clip-path: polygon(0 44%, 100% 0, 100% 100%, 0 56%);
  -webkit-mask: linear-gradient(90deg, transparent, #000 60%); mask: linear-gradient(90deg, transparent, #000 60%); }
.hw.sl .hw-sl { display: block; }
.hw.fl-l .hw-sl { right: auto; left: 86%; transform-origin: 0 50%; clip-path: polygon(0 0, 100% 44%, 100% 56%, 0 100%);
  -webkit-mask: linear-gradient(270deg, transparent, #000 60%); mask: linear-gradient(270deg, transparent, #000 60%); }
/* manga focus lines behind the big words (direct, charged, crit, kill) */
.hw-fx { position: absolute; left: 50%; top: 50%; width: 5.6em; height: 3.2em; margin: -1.6em 0 0 -2.8em; border-radius: 50%; opacity: 0; display: none; will-change: transform, opacity;
  background: repeating-conic-gradient(from 2deg, rgba(255, 250, 232, .95) 0deg 1.3deg, rgba(255, 250, 232, 0) 1.3deg 7deg),
    repeating-conic-gradient(from 0deg, rgba(255, 250, 232, .75) 0deg .7deg, rgba(255, 250, 232, 0) .7deg 11deg);
  -webkit-mask: radial-gradient(closest-side, transparent 46%, #000 60%, rgba(0, 0, 0, .55) 84%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 46%, #000 60%, rgba(0, 0, 0, .55) 84%, transparent 100%); }
.hw.big .hw-fx { display: block; }
.hw.k-chg .hw-fx { background: repeating-conic-gradient(from 2deg, rgba(255, 252, 238, .98) 0deg 1.5deg, rgba(255, 252, 238, 0) 1.5deg 6.5deg),
  repeating-conic-gradient(from 0deg, rgba(255, 200, 90, .85) 0deg .8deg, rgba(255, 200, 90, 0) .8deg 10deg); }
.hw.k-crit .hw-fx { background: repeating-conic-gradient(from 2deg, rgba(255, 246, 250, .95) 0deg 1.3deg, rgba(255, 246, 250, 0) 1.3deg 7deg),
  repeating-conic-gradient(from 0deg, rgba(255, 140, 220, .8) 0deg .7deg, rgba(255, 140, 220, 0) .7deg 11deg); }
.hw.k-kill .hw-fx { width: 6.4em; height: 3.8em; margin: -1.9em 0 0 -3.2em;
  background: repeating-conic-gradient(from 2deg, rgba(246, 240, 255, .95) 0deg 1.4deg, rgba(246, 240, 255, 0) 1.4deg 6.5deg),
    repeating-conic-gradient(from 0deg, rgba(170, 130, 255, .85) 0deg .8deg, rgba(170, 130, 255, 0) .8deg 10deg); }
/* spiky burst balloon behind CRITICAL HIT! and kills (clip-path set per word from three shapes) */
.hw-star { position: absolute; left: 50%; top: 50%; width: 3.1em; height: 1.8em; margin: -.9em 0 0 -1.55em; opacity: 0; display: none; will-change: transform, opacity;
  background: radial-gradient(closest-side, #fff 0%, #fffbe0 35%, #ffe45a 70%, #ffb000 100%); }
.hw-star.bk { width: 3.42em; height: 2.04em; margin: -1.02em 0 0 -1.71em; background: #a3106a; }
.hw.star .hw-star { display: block; }
.hw.k-kill .hw-star { width: 4.1em; height: 2em; margin: -1em 0 0 -2.05em; background: radial-gradient(closest-side, #fff 0%, #f4efff 38%, #b89aff 75%, #6a3cff 100%); }
.hw.k-kill .hw-star.bk { width: 4.48em; height: 2.26em; margin: -1.13em 0 0 -2.24em; background: #1c0c5a; }
/* the struck dragon's name + HP, only when it has no full name plate this frame */
.hw-tag { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 3px; font-size: 10px; }
.hw-nm { font: 700 10px/1 var(--f-ui); letter-spacing: .16em; color: #fff; padding: 2px 5px 1px; border-radius: 2px; background: rgba(232, 60, 40, .88); }
.hw-bar { position: relative; width: 72px; height: 5px; transform: skewX(-24deg); background: rgba(8, 12, 36, .78); border: 1px solid #fff; overflow: hidden; }
.hw-bar i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(180deg, #ff9aa6, #e0283f); }
/* reticle burst: manga X slashes, colour by type (the only reticle hit marker for enemy dragons) */
.hwx { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; will-change: transform, opacity; --hx: #ffd24a; --hxo: #6a0c04; }
.hwx svg { position: absolute; left: -80px; top: -80px; width: 160px; height: 160px; overflow: visible; will-change: transform, opacity; }
.hwx .hx-s { fill: var(--hx); stroke: var(--hxo); stroke-width: 2.2; stroke-linejoin: round; paint-order: stroke fill; }
.hwx .hx-t { fill: #fffaf0; stroke: var(--hxo); stroke-width: 1.4; paint-order: stroke fill; }
.hwx .hx-r { fill: none; stroke: none; }
.hwx.fb { --hx: #ff8a2a; --hxo: #3a0a08; }
.hwx.chg { --hx: #fff2b0; --hxo: #7a3a00; }
.hwx.chg .hx-r { stroke: #ffd98a; stroke-width: 2.4; }
.hwx.crit { --hx: #fff27a; --hxo: #b0126e; }
.hwx.kill { --hx: #ffffff; --hxo: #3a1a9a; }
.hwx.kill .hx-r { stroke: #e8dcff; stroke-width: 3; }
@media (max-width: 600px) { .hwx svg { left: -64px; top: -64px; width: 128px; height: 128px; } }

/* LEVEL UP! cut-in (levels.js): slides in from the left in the upper-left third — never over the centre of the view.
   A skewed band in the element's colour with speed lines, manga lettering (the hit words' .hw-t), the new level, the
   gains and, when the element changes, its name with an edge flash in its colour. Driven by paused animations. */
.lvup { position: absolute; left: 0; top: max(150px, 21vh); width: min(640px, 47vw); height: 230px; pointer-events: none; will-change: transform, opacity; }
/* the band reaches under every line of the card (its slanted bottom edge at 88 % on the left) */
.lv-band, .lv-lines { position: absolute; left: 0; top: 4px; width: 100%; height: 222px; clip-path: polygon(0 7%, 100% 0, 84% 100%, 0 94%); }
.lvup:not(.changed) .lv-band, .lvup:not(.changed) .lv-lines { height: 150px; clip-path: polygon(0 9%, 100% 0, 84% 100%, 0 92%); }
.lv-band { transform-origin: 0 50%; will-change: transform;
  background: linear-gradient(90deg, rgba(6, 10, 34, .9) 0%, rgba(6, 10, 34, .74) 26%, var(--ea) 58%, rgba(0, 0, 0, 0) 97%); }
.lv-lines { will-change: transform, opacity;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0) 0 11px, rgba(255, 255, 255, .42) 11px 12px, rgba(255, 255, 255, 0) 12px 19px, rgba(255, 255, 255, .2) 19px 21px, rgba(255, 255, 255, 0) 21px 31px);
  -webkit-mask: linear-gradient(90deg, transparent 4%, #000 34%, rgba(0, 0, 0, .6) 70%, transparent 96%); mask: linear-gradient(90deg, transparent 4%, #000 34%, rgba(0, 0, 0, .6) 70%, transparent 96%); }
.lv-edge { position: absolute; left: 0; top: 18px; width: 88%; height: 3px; transform-origin: 0 50%; background: linear-gradient(90deg, #fff, var(--e2) 30%, var(--e1) 70%, rgba(0, 0, 0, 0)); box-shadow: 0 0 12px var(--eg); rotate: -1.7deg; will-change: transform, opacity; }
.lv-body { position: absolute; left: clamp(22px, 2.6vw, 40px); top: 12px; display: grid; justify-items: start; gap: 1px; white-space: nowrap; }
.lv-main { font-size: clamp(40px, 6.8vh, 64px); transform-origin: 18% 60%; will-change: transform, opacity;
  --fill: linear-gradient(180deg, #fff 0%, #fff 36%, var(--e2) 38%, var(--e1) 72%, var(--e3) 100%); --ol: #0c0a22; --rim: #fff; --glow: var(--eg); }
.lv-row { display: flex; align-items: baseline; gap: 7px; margin-top: 2px; will-change: transform, opacity; }
.lv-from { font: 800 italic 15px/1 var(--f-num); letter-spacing: .06em; color: rgba(255, 255, 255, .72); text-shadow: 0 1px 2px rgba(6, 10, 34, .9); }
.lv-arr { align-self: center; width: 14px; height: 11px; background: var(--e2); clip-path: polygon(0 28%, 52% 28%, 52% 0, 100% 50%, 52% 100%, 52% 72%, 0 72%); }
.lv-lk { font: 800 13px/1 var(--f-ui); letter-spacing: .2em; color: var(--e2); text-shadow: 0 1px 2px rgba(6, 10, 34, .9); }
.lv-to { display: inline-block; font: 800 italic 46px/1 var(--f-num); color: #fff; -webkit-text-stroke: 6px #0c0a22; paint-order: stroke fill; text-shadow: 0 0 18px var(--eg); transform-origin: 30% 70%; will-change: transform, opacity; }
.lv-stats { display: flex; align-items: center; gap: 10px; margin-top: 4px; font: 700 12.5px/1 var(--f-ui); letter-spacing: .18em; color: #fff; text-shadow: 0 1px 2px rgba(6, 10, 34, .95), 0 0 8px rgba(6, 10, 34, .6); will-change: transform, opacity; }
.lv-stats b { font: 800 italic 17px/1 var(--f-num); letter-spacing: .02em; color: var(--e2); }
.lv-dot { width: 5px; height: 5px; transform: rotate(45deg); background: var(--e1); box-shadow: 0 0 6px var(--eg); }
.lv-el { display: none; align-items: center; gap: 9px; margin-top: 9px; transform-origin: 8% 60%; will-change: transform, opacity; }
.lvup.changed .lv-el { display: flex; }
.lv-ic { width: 22px; height: 28px; background: linear-gradient(180deg, #fff, var(--e2) 40%, var(--e1)); clip-path: polygon(50% 0, 64% 20%, 82% 36%, 94% 60%, 88% 84%, 68% 100%, 32% 100%, 12% 84%, 6% 60%, 20% 42%, 32% 54%, 36% 30%); }
.lvup.bolt .lv-ic { clip-path: polygon(62% 0, 12% 58%, 44% 58%, 30% 100%, 88% 38%, 56% 38%, 74% 0); width: 24px; }
.lv-eln { font-size: clamp(22px, 3.5vh, 33px); letter-spacing: .05em;
  --fill: linear-gradient(180deg, #fff 0%, #fff 30%, var(--e2) 34%, var(--e1) 100%); --ol: #0c0a22; --rim: var(--e2); --glow: var(--eg); }
.lv-eld { display: none; margin: 2px 0 0 31px; font: 600 12px/1.2 var(--f-ui); letter-spacing: .1em; color: #eef4ff; text-shadow: 0 1px 2px rgba(6, 10, 34, .95), 0 0 8px rgba(6, 10, 34, .7); will-change: opacity; }
.lvup.changed .lv-eld { display: block; }
.lvup.el-storm .lv-band { background: linear-gradient(90deg, rgba(6, 10, 34, .9) 0%, rgba(6, 10, 34, .74) 24%, rgba(110, 205, 255, .5) 50%, rgba(255, 204, 58, .45) 72%, rgba(0, 0, 0, 0) 97%); }
/* two hard white glints twinkle on LEVEL UP! (the hit words' four-point star) */
.lv-gl { position: absolute; z-index: 2; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: #fff; opacity: 0; will-change: transform, opacity;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); filter: drop-shadow(0 0 4px var(--eg)); }
/* the element's colour flashes at the screen edges (the centre stays clear) */
.lv-flash { position: absolute; inset: 0; pointer-events: none; will-change: opacity;
  background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(0, 0, 0, 0) 50%, var(--ea) 76%, var(--e1) 100%); }
/* the speed readout steps back while the cut-in may reach it (short windows) */
.fr.spd.lv-dim { opacity: .22; }
@media (max-width: 600px) {
  /* compact: LEVEL UP! and the level on one row, no description line — the words keep a band between the card and
     the reticle (a portrait phone has no side third) */
  .lvup { top: 21vh; width: 82vw; height: 120px; }
  .lv-band, .lv-lines { height: 112px; } .lvup:not(.changed) .lv-band, .lvup:not(.changed) .lv-lines { height: 84px; }
  .lv-body { left: 14px; top: 10px; grid-template-columns: auto auto; column-gap: 16px; align-items: end; }
  .lv-main { grid-column: 1; } .lv-row { grid-column: 2; margin: 0 0 3px; }
  .lv-stats, .lv-el { grid-column: 1 / -1; } .lv-el { margin-top: 5px; }
  .lvup.changed .lv-eld { display: none; }
  /* the kill feed (right, y 214) steps back while the card is up: it reaches the card's stats line on a phone */
  .toasts { transition: opacity .2s ease; } .toasts.lv-dim { opacity: .28; }
  .lv-main { font-size: 36px; } .lv-to { font-size: 30px; -webkit-text-stroke: 5px #0c0a22; } .lv-eln { font-size: 21px; } .lv-gl { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  .lv-stats { font-size: 10.5px; letter-spacing: .12em; gap: 8px; } .lv-stats b { font-size: 14px; }
  .lv-eld { font-size: 10.5px; letter-spacing: .06em; } .lv-ic { width: 17px; height: 22px; }
  .lvb { position: absolute; left: 0; top: 40px; margin: 0; padding: 2px 6px 1px 5px; z-index: 1; } .lvb-n { font-size: 13px; }
}

/* banner / warning / toasts */
.banner { position: absolute; left: 0; right: 0; top: 12vh; display: grid; justify-items: center; opacity: 0; text-align: center; padding: 10px 0 12px;
  background: linear-gradient(90deg, rgba(8, 16, 46, 0) 22%, rgba(8, 16, 46, .46) 36%, rgba(8, 16, 46, .46) 64%, rgba(8, 16, 46, 0) 78%); pointer-events: none; }
.banner::before, .banner::after { content: ""; position: absolute; left: 30%; right: 30%; height: 1px; background: linear-gradient(90deg, rgba(255, 231, 163, 0), var(--gold-hi), rgba(255, 231, 163, 0)); top: 0; }
.banner::after { top: auto; bottom: 0; }
.bn-t { font: 700 clamp(24px, 3.2vw, 42px)/1.1 var(--f-title); letter-spacing: .2em; padding-left: .2em; text-shadow: 0 3px 0 #13245a, 0 6px 22px rgba(0, 0, 0, .5); }
.bn-s { font: 600 clamp(11px, 1.2vw, 14px)/1.3 var(--f-ui); letter-spacing: .28em; padding-left: .28em; color: var(--gold-hi); margin-top: 5px; text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(6, 12, 34, .95), 0 0 10px rgba(6, 12, 34, .7); }
/* warnings: a compact pill in the upper third (under the boss bar / wave strip), never across the centre of the screen,
   with an arrow toward the attack; 1.1–3 s */
.warn { position: absolute; left: 0; right: 0; top: 100px; display: flex; justify-content: center; pointer-events: none; }
.warn-p { position: relative; display: flex; align-items: center; gap: 11px; min-height: 34px; padding: 6px 26px 6px 22px; max-width: min(640px, calc(100vw - 32px)); opacity: 0;
  background: linear-gradient(90deg, rgba(24, 4, 14, 0), rgba(24, 4, 14, .72) 16%, rgba(24, 4, 14, .72) 84%, rgba(24, 4, 14, 0)); }
.warn-p::before, .warn-p::after { content: ""; position: absolute; left: 14%; right: 14%; height: 2px; top: 0;
  background: repeating-linear-gradient(-45deg, var(--wc, var(--red)) 0 7px, rgba(0, 0, 0, 0) 7px 14px); }
.warn-p::after { top: auto; bottom: 0; }
.warn-t { position: relative; font: 800 15px/1.15 var(--f-ui); letter-spacing: .18em; padding-left: .18em; color: #fff; white-space: nowrap;
  text-shadow: 0 0 10px var(--wc, var(--red)), 0 1px 0 rgba(0, 0, 0, .7); }
/* the arrow toward the attack: a chevron in a dark disc (reads the same over sky, cloud and stone) */
.warn-dir { position: relative; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: rgba(24, 4, 14, .85);
  box-shadow: 0 0 0 1.5px var(--wc, var(--red)); transition: transform .08s linear; }
.warn-dir::after { content: ""; position: absolute; left: 4px; top: 5px; width: 16px; height: 14px; background: #fff;
  clip-path: polygon(0 36%, 52% 36%, 52% 4%, 100% 50%, 52% 96%, 52% 64%, 0 64%); }
.warn.l2 .warn-t { animation: warnblink .25s steps(2) 4; }
@keyframes warnblink { 50% { opacity: .6; } }
.warn.l1 { --wc: var(--warn); } .warn.l0 { --wc: var(--teal); }
.edge { position: absolute; top: 10%; bottom: 10%; width: 150px; opacity: 0; }
.edge.l { left: 0; background: radial-gradient(100% 50% at 0% 50%, rgba(255, 40, 72, .95), rgba(255, 40, 72, .4) 38%, rgba(255, 40, 72, 0) 100%); }
.edge.r { right: 0; background: radial-gradient(100% 50% at 100% 50%, rgba(255, 40, 72, .95), rgba(255, 40, 72, .4) 38%, rgba(255, 40, 72, 0) 100%); }
.edge.t { top: 0; bottom: auto; left: 15%; right: 15%; width: auto; height: 130px; background: radial-gradient(50% 100% at 50% 0%, rgba(255, 40, 72, .95), rgba(255, 40, 72, .4) 38%, rgba(255, 40, 72, 0) 100%); }
.edge::after { content: ""; position: absolute; top: 50%; width: 22px; height: 40px; margin-top: -20px; background: #fff; clip-path: polygon(0 50%, 100% 0, 70% 50%, 100% 100%); filter: drop-shadow(0 0 6px #ff2d55); }
.edge.l::after { left: 16px; transform: scaleX(-1); }
.edge.r::after { right: 16px; transform: none; }
.edge.t::after { top: 16px; left: 50%; margin: 0 0 0 -11px; width: 22px; height: 40px; transform: rotate(90deg) scaleX(-1); }
.edge.on { animation: edgepulse .3s ease-in-out infinite alternate; }
@keyframes edgepulse { from { opacity: .45; } to { opacity: 1; } }
.toasts { position: absolute; right: 28px; top: 118px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 7px 16px 7px 12px; background: linear-gradient(90deg, rgba(9, 18, 46, 0), rgba(9, 18, 46, .72) 30%);
  font: 600 13px/1.2 var(--f-ui); letter-spacing: .1em; text-shadow: var(--shadow-t); border-right: 2px solid var(--gold-hi); white-space: nowrap; }
.toast::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg); background: var(--gold-hi); flex: 0 0 auto; }
.toast.kill { border-right-color: var(--red); }
.toast.kill::before { background: var(--red); }
.toast.kill b { color: #ffc2cb; font-weight: 700; }

/* prompts and hints */
.prompt { position: absolute; left: 50%; top: 76%; transform: translate(-50%, -50%); text-align: center; opacity: 0; transition: opacity .3s; text-shadow: var(--shadow-t); }
.prompt.on { opacity: 1; }
.prompt { padding: 14px 34px 13px; background: linear-gradient(90deg, rgba(9, 18, 46, 0), rgba(9, 18, 46, .62) 18%, rgba(9, 18, 46, .62) 82%, rgba(9, 18, 46, 0)); }
.pr-t { font: 700 22px/1 var(--f-ui); letter-spacing: .34em; padding-left: .34em; animation: breathe 1.8s ease-in-out infinite; }
.pr-s { font-size: 13px; color: var(--ink-dim); margin-top: 10px; letter-spacing: .08em; }
@keyframes breathe { 50% { opacity: .6; } }
/* first-flight tips: bottom-left above the player panel (clear of the dragon, which flies in the middle third) */
.tips { position: absolute; left: 28px; bottom: 124px; max-width: min(470px, 34vw); opacity: 0; transition: opacity .4s;
  margin-left: -14px; padding: 7px 34px 7px 14px; border-left: 2px solid var(--gold-hi);
  background: linear-gradient(90deg, rgba(9, 18, 46, .76) 0, rgba(9, 18, 46, .68) calc(100% - 40px), rgba(9, 18, 46, 0) 100%);
  font-size: 13.5px; line-height: 1.95; letter-spacing: .04em; text-shadow: var(--shadow-t); white-space: normal; }
.tips.on { opacity: 1; }
.tips.done { border-left-color: var(--teal); color: #dffaf4; }
.tips kbd { margin: 0 2px; }
/* a two-line tip breaks between its phrases, never inside one (tips.js segments) */
.tips .tp-seg { display: inline-block; max-width: 100%; }
.tips .tp-arr { display: inline-block; width: 13px; height: 11px; margin-right: 3px; vertical-align: -1px; background: #ff5a6e; clip-path: polygon(100% 50%, 0 0, 26% 50%, 0 100%); }
.tips .tp-lv { display: inline-block; width: 11px; height: 14px; margin-right: 4px; vertical-align: -2px; background: linear-gradient(180deg, #fff, #ffd27a 45%, #ff8a2a); clip-path: polygon(50% 0, 64% 20%, 82% 36%, 94% 60%, 88% 84%, 68% 100%, 32% 100%, 12% 84%, 6% 60%, 20% 42%, 32% 54%, 36% 30%); }
.tips .tp-atk { display: inline-block; width: 17px; height: 12px; margin-right: 4px; vertical-align: -1px; background: linear-gradient(90deg, #c8102e, #ff3b55 55%, #ffb08f);
  clip-path: polygon(100% 50%, 78% 0, 62% 0, 82% 50%, 62% 100%, 78% 100%, 55% 50%, 32% 0, 16% 0, 38% 50%, 16% 100%, 32% 100%, 55% 50%, 78% 100%); }
.photo { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 18px; align-items: center; opacity: 0; transition: opacity .3s;
  padding: 10px 22px; background: rgba(9, 18, 46, .62); border: 1px solid rgba(255, 238, 200, .25); border-radius: 999px; font-size: 12.5px; letter-spacing: .06em; white-space: nowrap; }
.photo.on { opacity: 1; }
.photo .ph-k { font: 700 12px/1 var(--f-ui); letter-spacing: .3em; color: var(--gold-hi); }
.photo span { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-dim); }
.mute-ic { position: absolute; right: 30px; bottom: 186px; font: 700 11px/1 var(--f-ui); letter-spacing: .2em; color: var(--ink-dim); opacity: 0; transition: opacity .3s; text-shadow: var(--shadow-t); }
.mute-ic.on { opacity: 1; }
/* PAUSE + FULLSCREEN (top-left). Touch: both, 64 px, always there in flight. Desktop: FULLSCREEN only, 44 px, while the
   cursor is free (it cannot be clicked under pointer lock); the objective steps right of it. */
.tbtns { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); top: max(16px, env(safe-area-inset-top, 0px)); display: flex; gap: 14px; pointer-events: none; transition: opacity .3s ease; }
.tbtn, .fsb { position: relative; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(255, 246, 225, .62); background: rgba(9, 18, 46, .58);
  display: grid; place-items: center; cursor: pointer; pointer-events: auto; outline: none; touch-action: manipulation;
  box-shadow: 0 2px 10px rgba(0, 0, 20, .35); transition: background .15s, transform .12s, opacity .25s; }
.tbtn:active, .fsb:active { transform: scale(.92); background: rgba(255, 214, 120, .35); }
.fsb svg.ic { width: 50%; height: 50%; fill: none; stroke: #fffaf0; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 30, .6)); }
.fsb.on { border-color: var(--gold-hi); }
.tb-bars { position: relative; width: 36%; height: 40%; }
.tb-bars::before, .tb-bars::after { content: ""; position: absolute; top: 0; bottom: 0; width: 32%; background: #fff; border-radius: 2px; left: 0; box-shadow: 0 1px 1px rgba(0, 0, 30, .5); }
.tb-bars::after { left: auto; right: 0; }
.tbtns .tbtn { display: none; }
.hud:not(.touch) .tbtns .fsb { display: grid; opacity: 0; pointer-events: none; }
.hud.free:not(.touch) .tbtns .fsb { opacity: 1; pointer-events: auto; }
@media (min-width: 901px) {
  .hud.fsa:not(.touch):not(.min) .objective { left: 80px; }
  .hud.fsa:not(.touch):not(.min) .boss.on ~ .objective { max-width: calc(50vw - min(26vw, 380px) - 104px); }
  .hud.fsa:not(.touch):not(.min) .wave.on ~ .objective { max-width: calc(50vw - 190px - 104px); }
  .hud.fsa:not(.touch):not(.min) .svh.on ~ .objective { max-width: calc(50vw - 200px - 104px); }
}
.hud.touch .tbtns .tbtn { display: grid; width: 64px; height: 64px; }
.hud.cine .tbtns, .hud.paused .tbtns { opacity: 0; }
.hud.cine .tbtns > *, .hud.paused .tbtns > *, .hud:not(.on) .tbtns > *, .hud.photo-mode .tbtns > * { pointer-events: none !important; }
/* the title's FULLSCREEN corner button (inside the gold frame) */
.t-fs { position: absolute; right: max(34px, env(safe-area-inset-right, 0px)); top: max(34px, env(safe-area-inset-top, 0px)); width: 46px; height: 46px; }

/* ------------------------------------------------------------------ touch devices */
/* the old on-screen skill buttons: the touch controls only while there is no touch layer (.ntu = game.touchUI owns the
   stick and the buttons; the old ones and moves.js's R / FLY step aside — never two sets on screen) */
.touch .skills { pointer-events: auto; right: 18px; bottom: 18px; gap: 12px 14px; }
.touch .sk { pointer-events: auto; touch-action: none; cursor: pointer; }
.touch .sk .key { display: none; }
.touch .sk.big { width: 88px; height: 88px; }
.touch .mute-ic { right: 18px; bottom: 214px; }
.tm .hud.touch:not(.ntu) .skills { zoom: var(--z); }
.hud.touch.ntu .skills, .hud.touch.ntu .mv-sp, .hud.touch.ntu .mv-fly, .hud.touch.ntu .mv-fring { display: none !important; }
/* photo mode: keys on the desktop; two buttons + the gestures in touch mode (Hide: a tap anywhere brings the bar back) */
.photo .tonly, .photo .ph-b { display: none; }
.photo .tonly b { font: 700 12px/1 var(--f-ui); letter-spacing: .12em; color: #fff; margin-right: 6px; text-transform: uppercase; }
.hud.touch .photo .desk { display: none; }
.hud.touch .photo .tonly { display: inline-flex; }
.hud.touch .photo .ph-b { display: inline-block; min-width: 96px; min-height: 56px; padding: 0 22px; border-radius: 999px; border: 1.5px solid rgba(255, 238, 200, .6);
  background: rgba(255, 255, 255, .06); font: 700 14px/1 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: #fff; pointer-events: none; cursor: pointer; touch-action: manipulation; }
/* (only a bar that is shown takes taps: an invisible one must never catch a finger meant for the view or a button) */
.hud.touch.photo-mode .photo.on:not(.ph-off) .ph-b { pointer-events: auto; }
.hud.touch .photo .ph-b:active { background: var(--gold-hi); color: var(--navy); }
.hud.touch .photo { padding: 8px 10px 8px 24px; pointer-events: none; }
.photo.ph-off { opacity: 0 !important; }
.photo.ph-off .ph-b { pointer-events: none !important; }

/* ------------------------------------------------------------------ Minimal HUD (.hud.min)
   Settings HUD: Minimal, or Auto in touch mode. What stays: the reticle (its heat / stamina arcs go — the buttons show
   them), enemy markers and brackets, hit words, off-screen arrows / ATTACK RUN chevrons, damage vignettes, the warning
   pill, the slim titan bar in the boss fight, the cut-ins (LEVEL UP!, wave cards, results) and the one info panel
   top-right: LV badge + element, HP bar "480 / 600", thin stamina, thin XP. */
.hud.min .objective, .hud.min .wave, .hud.min .svh, .hud.min .tally, .hud.min .fr, .hud.min .toasts, .hud.min .tips,
.hud.min .mv-mode, .hud.min .mvh-bn, .hud.min .pl-por, .hud.min .pl-name, .hud.min .xp-t { display: none !important; }
/* touch mode with the Full HUD (Settings HUD: Full): the same top-right panel (the stick owns the bottom-left), the
   tally and the kill feed under it, the objective under the PAUSE / FULLSCREEN pair */
.hud.touch .pl-por, .hud.touch .pl-name, .hud.touch .xp-t { display: none !important; }
/* no key hints in touch mode (the HOVER pill's "hold W") */
.hud.touch .mv-mode .md-hint { display: none !important; }
.hud.touch:not(.min) .tally { top: 118px; }
.hud.touch:not(.min) .toasts { top: 230px; }
.hud.touch:not(.min) .objective { top: 104px; }
.hud.touch:not(.min) .mute-ic { top: 186px; right: 26px; bottom: auto; }
.hud.min .ret .rg-bg, .hud.min .ret .rg-heat, .hud.min .ret .rg-stam, .hud.min .mv-ret .mm-cost, .hud.min .mv-ret .mm-deny { display: none; }
/* (fix 29.09) markers: name / HP / distance only on the locked and the soft target (markers.js), minis for the rest; a
   drake flock is its icon, "×5" and a thin bar; the off-screen arrows keep their count, not the distance */
.hud.min .mk.flock .mk-name, .hud.min .mk.flock .mk-dist, .hud.min .arr b span { display: none; }
/* (fix 29.09) OVERHEAT stays under the reticle in touch mode as well: the thumb holding FIRE covers the button's own
   OVERHEAT (and its heat ring), and the eye is on the reticle — so the heat arc comes back at the reticle while the
   breath runs hot (heat > 70 %, .ret.hot) as the warning before it; the stamina arc stays off (the BOOST ring) */
.hud.min.touch .ret.hot svg > path:first-of-type, .hud.min.touch .ret.hot .rg-heat { display: inline; }
.hud.min .pl, .hud.touch .pl { left: auto; right: max(20px, env(safe-area-inset-right, 0px)); top: max(18px, env(safe-area-inset-top, 0px)); bottom: auto; width: 372px; display: block; }
.hud.min .pl-main, .hud.touch .pl-main { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 5px; align-items: center; padding: 9px 14px 11px 10px; border-radius: 4px;
  background: linear-gradient(270deg, rgba(8, 16, 44, .72) 0, rgba(8, 16, 44, .62) calc(100% - 30px), rgba(8, 16, 44, 0) 100%); }
.hud.min .pl-top, .hud.touch .pl-top { display: contents; }
.hud.min .lvb, .hud.touch .lvb { grid-column: 1; grid-row: 1 / span 4; margin: 0 0 0 4px; padding: 6px 11px 5px 9px; }
.hud.min .lvb-n, .hud.touch .lvb-n { font-size: 24px; }
.hud.min .lvb-k, .hud.touch .lvb-k { font-size: 13px; }
.hud.min .lvb-ic, .hud.touch .lvb-ic { width: 12px; height: 16px; }
.hud.min .lvb.bolt .lvb-ic, .hud.touch .lvb.bolt .lvb-ic { width: 13px; }
.hud.min .pl-hp, .hud.touch .pl-hp { grid-column: 2; grid-row: 1; justify-self: end; font-size: 21px; }
.hud.min .pl .bar, .hud.touch .pl .bar { grid-column: 2; grid-row: 2; height: 13px; }
.hud.min .pl-st, .hud.touch .pl-st { grid-column: 2; grid-row: 3; margin-top: 1px; height: 4px; }
.hud.min .pl-xp, .hud.touch .pl-xp { grid-column: 2; grid-row: 4; margin-top: 1px; }
.hud.min .xp-bar, .hud.touch .xp-bar { height: 4px; }
.hud.min .mute-ic { top: 120px; right: 24px; bottom: auto; }
/* the slim titan bar (the boss fight only; the numbers and escorts are on the pause screen) */
/* (integration 28.09) the titan bar sits between the PAUSE / FULLSCREEN pair and the top-right panel: centred while it
   fits (the panel is 372 + 20 px from the right, so a centred bar ends ≥ 14 px before it), left-aligned on narrow screens */
.hud.min .boss { top: 20px; width: min(40vw, 600px, calc(100vw - 812px)); }
.hud.min .boss-under, .hud.min .boss-name small { display: none; }
.hud.min .boss-head { margin-bottom: 4px; }
.hud.min .boss-name { font-size: 13px; letter-spacing: .3em; }
.hud.min .boss-phase { font-size: 10.5px; }
.hud.min .boss .bar { height: 9px; }
.hud.min .warn { top: 104px; }                        /* (under the top-right panel) */
/* the hazard pill never runs under the controls: narrower than the space between the button arcs (--tch-side: the
   touch layer's cluster width + margin, touch.js) */
.tm .hud .warn-p { max-width: min(640px, calc((100vw - 2 * var(--tch-side, 16px)) / var(--z))); }
.tm .hud .warn-t { white-space: normal; text-align: center; }

/* ------------------------------------------------------------------ touch mode scale (#ui.tm)
   --z = min(w, h) / 1080 (hud.js): 1 at 1080p, 2 at 4K — the touch UI keeps its proportions on a 13" tablet and on an
   86" TV. CSS zoom scales a box and its offsets; viewport units inside a zoomed box are divided back by --z. */
.tm { --z: 1; }
.tm .hud .pl, .tm .tbtns, .tm .boss, .tm .banner, .tm .warn, .tm .photo, .tm .mute-ic, .tm .lvup,
.tm .objective, .tm .wave, .tm .svh, .tm .tally, .tm .toasts,
.tm .t-left, .tm .t-foot, .tm .t-fs, .tm .p-card, .tm .r-wrap, .tm .panel { zoom: var(--z); }
.tm .hud:not(.min) .objective { max-width: min(460px, calc(60vw / var(--z))); }
/* the world HUD grows with it (hud.js worldScale() = --z in touch mode): each anchor stays where the code puts it (a
   translate in screen px), its parts are zoomed around it, and the placement code (hit words, markers, damage numbers,
   chevrons, brackets) works with the same factor */
.tm .ret, .tm .mv-ret { width: calc(132px * var(--z)); height: calc(132px * var(--z)); margin: calc(-66px * var(--z)) 0 0 calc(-66px * var(--z)); }
.tm .aim { width: calc(18px * var(--z)); height: calc(18px * var(--z)); margin: calc(-9px * var(--z)) 0 0 calc(-9px * var(--z)); }
.tm .fr > *, .tm .ret-lbl, .tm .mv-rl, .tm .mk > *, .tm .arr > *, .tm .wk > *, .tm .ret-edge > *, .tm .dn > span, .tm .hwx > svg,
.tm .atk-c, .tm .atk-t, .tm .atk-s, .tm .hw-tag, .tm .mv-aim .ma-c, .tm .mv-aim .ma-dot { zoom: var(--z); }
.tm .hud.min .boss { width: min(calc(40vw / var(--z)), 600px, calc(100vw / var(--z) - 812px - 2 * var(--safe-x, 0px) / var(--z))); }
/* the cut-in banner: below the top-left pair and the top-right panel, between the button arcs */
.tm .banner { top: calc(max(104px, 12vh / var(--z)) + var(--safe-y, 0px) / var(--z)); left: calc(var(--tch-side, 0px) / var(--z)); right: calc(var(--tch-side, 0px) / var(--z)); }
.tm .banner::before, .tm .banner::after { left: 10%; right: 10%; }
.tm .banner { background: linear-gradient(90deg, rgba(8, 16, 46, 0) 0%, rgba(8, 16, 46, .46) 18%, rgba(8, 16, 46, .46) 82%, rgba(8, 16, 46, 0) 100%); }
/* narrow screens (a 13" laptop-size tablet in portrait-ish widths, a landscape phone): a narrower panel; the titan bar
   left-aligned after the PAUSE / FULLSCREEN pair, up to the panel; the hazard pill under the panel */
@media (max-width: 1180px) {
  .hud.min .pl, .hud.touch .pl { width: min(372px, 40vw); }
  .hud.min .boss, .tm .hud.min .boss { left: calc(178px + max(0px, env(safe-area-inset-left, 0px) - 16px) + var(--safe-x, 0px)); transform: none;
    width: calc(100vw - 178px - min(372px, 40vw) - 44px - max(0px, env(safe-area-inset-left, 0px) - 16px) - max(0px, env(safe-area-inset-right, 0px) - 20px) - 2 * var(--safe-x, 0px)); }
  .hud.min .boss-phase { display: none; }            /* (the bar's colour says ENRAGED; the phase is on the pause screen) */
}
/* the hit-direction flash (a wedge around the screen centre) stays inside the space between the panel and the buttons */
/* (hud.js hitReach: --hd-r, per hit, shorter where its direction runs into the controls — a 4:3 screen has the button
   arc ~170 px right of the centre) */
.hud.min .hitdir i, .hud.touch .hitdir i { top: calc(-1 * var(--hd-r, min(38vh, 300px, 50vh - 112px))); width: min(260px, 40vh); left: calc(-0.5 * min(260px, 40vh)); }
/* short screens (a landscape phone): the title menu in two columns, a smaller logo — every item stays a 64 px target */
@media (max-height: 560px) {
  .tm .t-left { top: 14px; bottom: 42px; width: min(640px, calc(100vw - 190px - env(safe-area-inset-left, 0px))); left: max(clamp(20px, 5vw, 60px), calc(env(safe-area-inset-left, 0px) / var(--z) + 8px)); }
  .tm .logo { width: min(300px, 40vw); }
  .tm .t-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-bottom: 0; }
  .tm .t-menu .mbtn { width: 100%; min-height: 64px; }
  .tm .t-menu .mbtn.focus { transform: none; }
  .tm .t-foot { bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) / var(--z))); font-size: 10px; gap: 2px 18px; }
  .tm .t-fs { right: max(20px, calc(env(safe-area-inset-right, 0px) / var(--z) + 4px)); top: max(20px, calc(env(safe-area-inset-top, 0px) / var(--z))); }
}
/* (78단계) 휴대폰 가로(높이 ≤ 430): 7개 항목이 2열 4줄이면 마지막 줄(XGAME 으로)이 아래 안내 줄에 걸렸다 — 3열 3줄 */
@media (max-height: 430px) and (min-width: 700px) {
  .tm .scr.title .t-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; }
  .tm .scr.title .t-menu .mbtn { padding-left: 12px; padding-right: 8px; }
  .tm .scr.title .t-menu .mbtn .mb-t, .tm .scr.title .t-menu .mbtn b { white-space: normal; line-height: 1.1; }
}
.tm .lvup { top: max(150px, calc(21vh / var(--z))); width: min(640px, calc(47vw / var(--z))); }
/* (fix 29.09, hud.js placeLevelCard) where the stylesheet's place would lie on the stick ring (a landscape phone) or the
   left-handed button arc, the card moves up, takes this compact variant (LEVEL UP! and the level on one row, 84 / 112 px),
   or goes right under the panel (.rside, mirrored: it comes in from the right edge) */
.tm .lvup.compact { height: 120px; width: min(520px, calc(62vw / var(--z))); }
.tm .lvup.compact .lv-band, .tm .lvup.compact .lv-lines { height: 112px; }
.tm .lvup.compact:not(.changed) .lv-band, .tm .lvup.compact:not(.changed) .lv-lines { height: 84px; }
.tm .lvup.compact .lv-body { left: 14px; top: 10px; grid-template-columns: auto auto; column-gap: 16px; align-items: end; }
.tm .lvup.compact .lv-main { grid-column: 1; font-size: 36px; }
.tm .lvup.compact .lv-row { grid-column: 2; margin: 0 0 3px; }
.tm .lvup.compact .lv-stats, .tm .lvup.compact .lv-el { grid-column: 1 / -1; }
.tm .lvup.compact .lv-el { margin-top: 5px; }
.tm .lvup.compact.changed .lv-eld { display: none; }
.tm .lvup.compact .lv-to { font-size: 30px; -webkit-text-stroke: 5px #0c0a22; }
.tm .lvup.compact .lv-eln { font-size: 21px; }
.tm .lvup.compact .lv-gl { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.tm .lvup.compact .lv-stats { font-size: 10.5px; letter-spacing: .12em; gap: 8px; }
.tm .lvup.compact .lv-stats b { font-size: 14px; }
.tm .lvup.compact .lv-ic { width: 17px; height: 22px; }
.tm .lvup.rside .lv-band, .tm .lvup.rside .lv-lines { clip-path: polygon(100% 7%, 0 0, 16% 100%, 100% 94%); transform-origin: 100% 50%; }
.tm .lvup.rside:not(.changed) .lv-band, .tm .lvup.rside:not(.changed) .lv-lines { clip-path: polygon(100% 9%, 0 0, 16% 100%, 100% 92%); }
.tm .lvup.rside .lv-band { background: linear-gradient(270deg, rgba(6, 10, 34, .9) 0%, rgba(6, 10, 34, .74) 26%, var(--ea) 58%, rgba(0, 0, 0, 0) 97%); }
.tm .lvup.rside.el-storm .lv-band { background: linear-gradient(270deg, rgba(6, 10, 34, .9) 0%, rgba(6, 10, 34, .74) 24%, rgba(110, 205, 255, .5) 50%, rgba(255, 204, 58, .45) 72%, rgba(0, 0, 0, 0) 97%); }
.tm .lvup.rside .lv-lines { -webkit-mask: linear-gradient(270deg, transparent 4%, #000 34%, rgba(0, 0, 0, .6) 70%, transparent 96%); mask: linear-gradient(270deg, transparent 4%, #000 34%, rgba(0, 0, 0, .6) 70%, transparent 96%); }
.tm .lvup.rside .lv-edge { left: auto; right: 0; transform-origin: 100% 50%; rotate: 1.7deg; background: linear-gradient(270deg, #fff, var(--e2) 30%, var(--e1) 70%, rgba(0, 0, 0, 0)); }
.tm .lvup.rside .lv-body { left: auto; right: clamp(22px, calc(2.6vw / var(--z)), 40px); justify-items: end; }
.tm .lvup.rside.compact .lv-body { right: 14px; }
.tm .lv-main { font-size: clamp(40px, calc(6.8vh / var(--z)), 64px); }
.tm .lv-eln { font-size: clamp(22px, calc(3.5vh / var(--z)), 33px); }
.tm .t-left { top: clamp(40px, calc(11vh / var(--z)), 120px); width: min(560px, calc(86vw / var(--z))); left: max(clamp(28px, calc(7vw / var(--z)), 120px), calc(env(safe-area-inset-left, 0px) / var(--z) + 8px)); }
.tm .t-fs { width: 64px; height: 64px; }
/* (a zoomed box scales its own offsets: the safe-area insets — a notch, the home indicator — are divided by --z) */
.tm .t-fs { right: max(34px, calc(env(safe-area-inset-right, 0px) / var(--z) + 4px)); top: max(34px, calc(env(safe-area-inset-top, 0px) / var(--z))); }
.tm .t-foot { bottom: max(30px, calc(env(safe-area-inset-bottom, 0px) / var(--z))); }
.tm .p-card { left: max(clamp(28px, calc(8vw / var(--z)), 130px), calc(env(safe-area-inset-left, 0px) / var(--z) + 12px)); }
.tm .panel { max-height: calc((100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / var(--z) - 48px);
  width: min(640px, calc((100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / var(--z) - 32px)); }
.tm .panel.wide { width: min(1100px, calc((100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / var(--z) - 32px)); }
.tm .panel.set.two { width: min(1240px, calc((100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / var(--z) - 32px)); }
.tm .r-wrap { width: min(900px, calc((100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / var(--z) - 32px)); }
/* (fix 29.09) + Settings → Screen margin (a TV that overscans HDMI; touch.js publishes the margin on #ui as --safe-x /
   --safe-y px and moves the stick and the buttons in by it): the HUD's corner items come in by the same margin */
.tm .tbtns { left: calc(max(16px, env(safe-area-inset-left, 0px) / var(--z)) + var(--safe-x, 0px) / var(--z)); top: calc(max(16px, env(safe-area-inset-top, 0px) / var(--z)) + var(--safe-y, 0px) / var(--z)); }
.tm .hud.min .pl, .tm .hud.touch .pl { right: calc(max(20px, env(safe-area-inset-right, 0px) / var(--z)) + var(--safe-x, 0px) / var(--z)); top: calc(max(18px, env(safe-area-inset-top, 0px) / var(--z)) + var(--safe-y, 0px) / var(--z)); }
.tm .hud.min .mute-ic { right: calc(max(24px, env(safe-area-inset-right, 0px) / var(--z)) + var(--safe-x, 0px) / var(--z)); }
.tm .hud.min .boss { top: calc(20px + var(--safe-y, 0px) / var(--z)); }
.tm .hud.min .warn { top: calc(104px + var(--safe-y, 0px) / var(--z)); }
.photo { bottom: max(26px, env(safe-area-inset-bottom, 0px)); }
.tm .photo { bottom: max(26px, calc(env(safe-area-inset-bottom, 0px) / var(--z))); }
.tm .r-title { font-size: clamp(56px, calc(11vw / var(--z)), 132px); }
.tm .p-title { font-size: clamp(40px, calc(6vw / var(--z)), 64px); }
/* touch targets ≥ 64 px */
.tm .mbtn { min-height: 64px; }
.tm .pbtn { min-height: 64px; padding: 0 40px; font-size: 16px; }
.tm .r-menu .pbtn { padding: 0 48px; font-size: 17px; }
.tm .set-row { min-height: 72px; grid-template-columns: 164px 1fr 58px; gap: 12px; padding: 4px 8px; }
.tm .panel.set { padding-left: 24px; padding-right: 24px; }
.tm .seg { gap: 5px; }
.tm .seg button { min-height: 64px; font-size: 13.5px; }
.tm .toggle { width: 112px; height: 64px; }
.tm .toggle::after { top: 6px; left: 6px; width: 50px; height: 50px; }
.tm .toggle.on::after { transform: translateX(48px); }
.tm input[type=range].rng { height: 64px; }
.tm input[type=range].rng::-webkit-slider-runnable-track { height: 6px; }
.tm input[type=range].rng::-webkit-slider-thumb { width: 34px; height: 34px; margin-top: -14px; }
.tm .t-foot .desk { display: none; }
.tm .ctl { font-size: 15px; padding: 9px 0; grid-template-columns: 204px 1fr; }
.tm .ctl-grp { font-size: 12px; }

/* ------------------------------------------------------------------ narrow / short screens */
@media (max-width: 900px) {
  .fr.spd { right: auto; left: 18px; top: auto; bottom: 108px; transform: none; align-items: flex-start; }
  .fr.alt { left: 110px; top: auto; bottom: 108px; transform: none; }
  .fr-tape, .fr-vs { display: none; }
  .fr-v { font-size: 22px; }
  .boss { width: calc(100vw - 32px); top: 14px; }
  .objective { top: 70px; left: 18px; }
  .boss:not(.on) ~ .objective { top: 18px; }
  .svh.on ~ .objective { top: 104px; }
  .hud:has(.svh.on) .warn { top: 150px; }
  .warn { top: 128px; }
  /* a long line (e.g. "The storm lashes you — fly back to the Titan") wraps inside the pill instead of running out of it */
  .warn-t { white-space: normal; text-align: center; }
  /* narrow screens: the pill takes the objective's place while it is up (hud.js sets .warning) */
  .objective { transition: opacity .2s ease; }
  .hud.warning .objective { opacity: 0; }
}
@media (max-width: 600px) {
  .t-left { left: 16px; right: 16px; width: auto; top: 30px; bottom: 70px; }
  .logo { width: 100%; }
  .logo-sub { letter-spacing: .26em; gap: 8px; font-size: 10.5px; }
  .logo-sub i { flex-basis: 20px; }
  .t-menu { margin-bottom: 0; }
  .mbtn { width: 100%; min-height: 46px; }
  .mb-t { font-size: 17px; } .mbtn.primary .mb-t { font-size: 20px; }
  .t-foot { bottom: 18px; gap: 6px 16px; font-size: 10px; letter-spacing: .08em; }
  .t-foot .desk { display: none; }
  .t-frame { inset: 8px; }
  .t-shade { background: linear-gradient(180deg, rgba(7, 16, 48, .55) 0%, rgba(8, 20, 58, .15) 35%, rgba(6, 14, 40, .78) 70%, rgba(6, 14, 40, .92) 100%); }
  .t-art { background-position: 68% 40%; }      /* key art v2: Kaede and Sora's eye both in frame */
  .boot { background-position: center, 66% 34%; }
  .panel { padding: 20px 16px 16px; }
  .set-row { grid-template-columns: 1fr 52px; gap: 6px 10px; padding: 8px 6px; }
  .set-row .set-l { grid-column: 1 / -1; }
  .ctl-grid { grid-template-columns: 1fr; }
  .pl { left: 14px; bottom: auto; top: 14px; width: calc(100vw - 90px); grid-template-columns: auto 1fr; }
  .pl-por { width: 66px; height: 48px; }
  .por { width: 44px; height: 44px; }
  .por.sora { background-size: 273px 273px; background-position: -189px -135px; }
  .por.kaede { left: 26px; width: 38px; height: 38px; bottom: 8px; background-size: 486px 486px; background-position: -210px -196px; }
  .pl-name { font-size: 11px; letter-spacing: .16em; }
  .boss { top: 76px; }
  .boss-name { font-size: 13px; letter-spacing: .2em; } .boss-name small { display: none; }
  .objective { top: 76px; max-width: calc(100vw - 36px); margin-top: 0; padding-top: 6px; padding-bottom: 7px; }
  .boss.on ~ .objective { top: 130px; }
  .wave { top: 76px; gap: 5px; }
  .wv-t { font-size: 13px; letter-spacing: .22em; } .wv-l { font-size: 11px; letter-spacing: .16em; }
  .wv-bar { width: 170px; }
  .wave.on ~ .objective { top: 118px; }
  .svh { top: 70px; gap: 4px; padding: 6px 18px 8px; }
  .sv-t { font-size: 10px; letter-spacing: .26em; } .sv-wk { font-size: 12px; } .sv-wn { font-size: 26px; }
  .sv-row { gap: 8px; } .sv-row b { font-size: 15px; } .sv-k { font-size: 8.5px; letter-spacing: .16em; margin-right: 4px; }
  .sv-next { display: none; }
  .svh.on ~ .objective { top: 158px; }
  .hud:has(.svh.on) .fr.spd { display: none; }
  .hud:has(.svh.on) .warn { top: 158px; }
  /* bottom-left: the only corner a portrait phone leaves free (panel top, buttons bottom-right, arrows on the edges) */
  .tally { top: auto; bottom: 206px; right: auto; left: 14px; justify-items: start; }
  .kills { transform-origin: left center; } .combo { transform: translate3d(-14px, 0, 0); } .combo.on { transform: none; }
  .cb-n { transform-origin: left bottom; }
  .kills b { font-size: 20px; } .cb-n { font-size: 28px; } .cb-bar { width: 96px; }
  .mute-ic { right: 70px; top: 22px; bottom: auto; }
  .touch .mute-ic { right: 70px; top: 22px; bottom: auto; }
  .obj-t { font-size: 14px; }
  .fr.spd { bottom: auto; top: 66px; left: auto; right: 16px; align-items: flex-end; }
  .fr.alt { display: none; }
  .hud:has(.boss.on) .fr.spd { display: none; }
  .toasts { right: 12px; top: 214px; } .toast { font-size: 11px; letter-spacing: .06em; padding: 6px 12px 6px 10px; }
  .warn { top: 76px; } .hud:has(.wave.on) .warn { top: 118px; } .hud:has(.boss.on) .warn { top: 130px; }
  .warn-p { padding: 6px 20px; }
  .banner { top: 27vh; } .bn-t { letter-spacing: .14em; }
  .warn-t { font-size: 13px; letter-spacing: .1em; white-space: normal; text-align: center; }
  .tips { display: none; }
  .photo { gap: 10px; font-size: 11px; padding: 8px 14px; flex-wrap: wrap; justify-content: center; white-space: normal; width: calc(100vw - 24px); border-radius: 14px; }
  .r-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  /* (114) 1fr 은 줄바꿈 없는 긴 이름(독일어 'SCHADEN VERURSACHT')만큼 넓어져 결과표가 화면 밖으로 — 칸은 반씩, 이름은 두 줄까지 */
  .r-stat { padding-left: 6px; padding-right: 6px; } .r-sl { white-space: normal; letter-spacing: .1em; line-height: 1.25; overflow-wrap: anywhere; }
  .r-parts { gap: 8px 12px; flex-wrap: wrap; } .r-part b { width: 64px; }
  .r-stat:last-child { grid-column: 1 / -1; }
  .r-sv { font-size: 26px; }
  .r-k { font-size: 11px; letter-spacing: .28em; padding-left: .28em; }
  /* a smaller title leaves room for the rank badge beside it ("Victory" + badge ≈ 360 px on a 390 px phone) */
  .r-title, .tm .r-title { font-size: 46px; } .r-title { white-space: nowrap; }   /* (158) .tm 의 clamp(56px …) 가 이겨 터치 세로 폰은 56 px 였다 — '서바이벌' 옆 등급 원이 화면 밖으로 */
  .r-grade { width: 56px; height: 56px; transform: translate(16px, -50%) rotate(-8deg); animation-name: gradein-m; } .r-gl { font-size: 32px; }   /* (154) 6 px 은 붓글씨 제목('승리'·'패배' 끝 획)에 등급 원이 걸쳤다 */
  .r-best { width: 60px; height: 60px; transform: translate(-6px, -50%) rotate(-10deg); animation-name: bestin-m; } .r-best b { font-size: 18px; } .r-best span { font-size: 8px; letter-spacing: .2em; }
  .results.surv .r-score { font-size: 17px; }
  .r-menu { flex-wrap: wrap; gap: 10px; } .r-menu .pbtn { padding: 12px 26px; }
  .p-card { left: 16px; right: 16px; width: auto; }
  .hud.paused .hud-fly { opacity: 0; }
  .ret { width: 112px; height: 112px; margin: -56px 0 0 -56px; }
}
@media (max-height: 560px) {
  .t-left { top: 22px; bottom: 44px; }
  .logo { width: min(340px, 60vw); }
  .mbtn { min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
  .mb-s { display: none; }
  .t-foot { bottom: 10px; }
}
/* (142) 세로 휴대폰: 메뉴 일곱 줄(설명 포함 ~70 px)이 화면 아래 2/3 를 덮어 용이 '서바이벌·전체 화면' 글씨 위를 지나갔다 —
   설명 줄은 첫 항목(비행 개시)만 남기고 접어 메뉴를 아래로 모은다. 로고와 메뉴 사이 띠는 카메라(poseOrbit)가 용 자리로 쓴다 */
@media (max-width: 600px) and (max-aspect-ratio: 4/5) and (min-height: 600px) {
  .scr.title .t-menu .mbtn:not(.primary) .mb-s { display: none; }
  .scr.title .t-menu .mbtn:not(.primary) { min-height: 48px; padding-top: 2px; padding-bottom: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .t-art, .t-flare, .mk.locked .mk-lock, .wk-ring, .atk.on .atk-c::before, .pl-xp.lvl .xp-bar::after { animation: none; }
}

/* ------------------------------------------------------------------ Russian HUD (languages, 29.09; :root[lang="ru"] only —
   the English layout is untouched). The words are src/ui/i18n/ru-hud.js; the fonts are the :root[lang="ru"] stacks. */
/* the manga letterings (hit words, the LEVEL UP! card) in the face with Cyrillic */
:root[lang="ru"] .hw-t { font-family: var(--f-manga); }
/* the photo bar (desktop keys) is ~25 % longer in Russian: on a narrow screen it wraps into two rows inside the screen */
@media (max-width: 1000px) {
  :root[lang="ru"] .photo { flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: calc(100vw - 24px); border-radius: 14px; }
}
/* the crit number's tag */
:root[lang="ru"] .dn.crit span::after { content: " \41A \420 \418 \422 "; }
/* the XP number over the titan ("+120 \43E \43F \44B \442 \430 ") in capitals, like the hit words' «+25 \41E \41F \42B \422 \410 » and the English "+25 XP" */
:root[lang="ru"] .dn.xp span { text-transform: uppercase; }
/* (fix 29.09, the layout review #1) the longest Russian telegraphs ("\423 \414 \410 \420  \41A \420 \42B \41B \42C \42F \41C \418  — \41E \422 \41B \415 \422 \410 \419  \418 \41B \418  \41D \410  \412 \421 \41F \42B \428 \41A \415  \423 \412 \41E \420 \41E \422  Q / E")
   ran 38 px out of the 640 px pill on the desktop too: in Russian the pill's words wrap inside it on every screen */
:root[lang="ru"] .warn-t { white-space: normal; text-align: center; }

/* (29.09, both languages — fix: the coordinator's phone review) With the panel top-right (Minimal HUD / touch mode) the
   centred hazard pill ran under the LV / HP panel wherever the screen is narrower than ≈1440 px (the panel sits under
   the watermark since 29.09, the pill's 104 px top did not move): there the pill keeps to the space between the PAUSE /
   FULLSCREEN pair and the panel, wrapping its words (wide screens: centred, as before; a portrait phone keeps its own rules). */
/* (fix 29.09, the regression review: at 1440 × 900 the centred pill — ≤ 560 px wide — already cleared the panel, the rule
   moved it off centre for nothing) up to the width where the centred pill would reach the panel: w / 2 + 280 px ≥
   w − (min(372 px, 40vw) + 36 px), i.e. up to 1376 px */
@media (min-width: 601px) and (max-width: 1376px) {
  .hud.min .warn, .hud.touch .warn { left: calc(178px + var(--safe-x, 0px)); right: calc(min(372px, 40vw) + 36px + var(--safe-x, 0px)); }
  .hud.min .warn-t, .hud.touch .warn-t { white-space: normal; text-align: center; }
  /* (Russian, fix 29.09: its short words are kept with their neighbours — a tighter tracking keeps the longest telegraph
     to 3 lines on a 844 px phone, 4 at .18em; measured: qa/i18n/fix-hud/live/pill-track.json) */
  :root[lang="ru"] .hud.min .warn-t, :root[lang="ru"] .hud.touch .warn-t { letter-spacing: .12em; padding-left: .12em; }
}
/* (fix 29.09, both languages — the layout review, fixcheck/banner2.json) the same for the wave / name card in touch mode
   and the Minimal HUD: centred between the arcs it ran under the top-right panel (1280 × 800 Russian «\412 \43E \43B \43D \430  1 · \412 \441 \430 \434 \43D \438 \43A \438 
   \422 \435 \43D \438 » over «\423 \420  1»; 844 × 390 in both languages); it keeps to the space between the PAUSE / FULLSCREEN pair and the panel,
   the touch title a little smaller and tighter so the long Russian titles stay on one line */
@media (max-width: 1440px) {
  .tm .hud.touch .banner, .tm .hud.min .banner { left: calc(178px + var(--safe-x, 0px)); right: calc(min(372px, 40vw) + 36px + var(--safe-x, 0px)); }
  .tm .hud.touch .banner .bn-t { font-size: clamp(20px, 2.6vw, 42px); letter-spacing: .14em; padding-left: .14em; }
}

/* ------------------------------------------------------------------ 천신 실사 HUD 초상화 (2026-11-14, :root.real-art = ?real=0 이 아닐 때)
   assets/textures/portraits_real.jpg (768×256): 실사 3D 모델에서 렌더한 소라(용) · 카에데(Meshy 로 얼굴 정리한 정면) · 구름 거신 — 키아트 애니 크롭 대신.
   터치·미니 HUD(오른쪽 위 패널)에서도 초상화를 보인다. */
:root.real-art .por { background-image: url(assets/textures/portraits_real.jpg); background-size: 300% 100%; }
:root.real-art .por.sora { background-position: 0% 0%; border-color: #e9dcc0; }
:root.real-art .por.kaede { background-position: 50% 0%; border-color: #d9b8a8; }
/* 오른쪽 위 패널은 그대로 두고 초상화는 패널 바로 아래 오른쪽 끝에 (가운데 보스 체력바·경고와 겹치지 않게) */
:root.real-art .hud.touch .pl, :root.real-art .hud.min .pl { position: absolute; }
:root.real-art .hud.touch .pl-por, :root.real-art .hud.min .pl-por { display: block !important; position: absolute; top: calc(100% + 8px); right: 2px; width: 82px; height: 56px; }
:root.real-art .hud.touch .por.sora, :root.real-art .hud.min .por.sora { left: auto; right: 0; bottom: auto; top: 0; width: 54px; height: 54px; }
:root.real-art .hud.touch .por.kaede, :root.real-art .hud.min .por.kaede { left: 0; bottom: auto; top: 22px; width: 36px; height: 36px; }
.boss-por { display: none; }
:root.real-art .boss-por { display: block; position: absolute; left: -74px; top: -6px; width: 60px; height: 60px; border-radius: 50%;
  background: url(assets/textures/portraits_real.jpg) 100% 0% / 300% 100% no-repeat; border: 2px solid #c9a46a; box-shadow: 0 4px 14px rgba(0, 0, 20, .5); }
:root.real-art .boss.enraged .boss-por { border-color: #ff5a3a; box-shadow: 0 0 16px rgba(255, 80, 40, .6); }
/* 낮은 화면(휴대폰 가로): 패널 아래는 오른쪽 버튼 줄이라 — 패널 왼쪽 옆에 */
@media (max-height: 520px) {
  :root.real-art .hud.touch .pl-por, :root.real-art .hud.min .pl-por { top: 4px; right: calc(100% + 8px); }
  /* (75단계) 거신전: 휴대폰 가로에선 거신 바가 일시정지·전체화면 쌍과 패널 사이를 다 쓴다 — 패널 옆 초상화는 바 끝을,
     거신 초상화는 전체화면 단추를 덮었다. 그동안은 둘 다 숨김 (이름·체력은 바에 있다) */
  :root.real-art .hud.touch:has(.boss.on) .pl-por, :root.real-art .hud.min:has(.boss.on) .pl-por { display: none !important; }
  :root.real-art .hud.touch .boss-por, :root.real-art .hud.min .boss-por { display: none; }
}
@media (max-width: 700px) {
  :root.real-art .hud.touch .pl-por, :root.real-art .hud.min .pl-por { width: 64px; height: 44px; }
  :root.real-art .hud.touch .por.sora, :root.real-art .hud.min .por.sora { width: 42px; height: 42px; }
  :root.real-art .hud.touch .por.kaede, :root.real-art .hud.min .por.kaede { top: 16px; width: 28px; height: 28px; }
  :root.real-art .boss-por { width: 40px; height: 40px; left: -48px; top: -2px; }
}
/* 천신 실사: 타이틀·로딩 배경도 게임 화면 컷 (assets/textures/title_real.jpg, 흰 용 Sora — 애니 키아트의 붉은 용 대신) */
:root.real-art .t-art { background-image: url(assets/textures/title_real.jpg); background-position: 62% 40%; }
:root.real-art .boot { background: linear-gradient(180deg, rgba(8, 18, 52, .1) 0%, rgba(8, 18, 52, .06) 45%, rgba(8, 18, 52, .72) 74%, #081230 100%),
    url(assets/textures/title_real.jpg) 62% 40% / cover no-repeat, #0d1f3f; }
/* 한국어: 영어 대문자용 넓은 자간(.24–.34em)은 한글에서 띄어 쓴 것처럼 보인다 */
:root[lang="ko"] .boss-name, :root[lang="ko"] .pl-name, :root[lang="ko"] .warn-t { letter-spacing: .08em; }
:root[lang="ko"] .boss-name small { letter-spacing: .06em; }

/* ------------------------------------------------------------------ 천신 실사 글자체 (2026-11-14, :root.real-art)
   제목 = SOG Serif (Noto Serif KR 부분집합, 가변 굵기) — 각진 붓끝 명조로 '하늘의 신' 무게. 본문·HUD = SOG Sans
   (Pretendard 부분집합) — 한글·라틴이 한 글꼴이라 섞여도 고르다. 둘 다 게임이 쓰는 한글(+라틴)만 담았다(OFL, assets/fonts).
   러시아어는 키릴 문자가 없어 기존 글꼴 그대로. 숫자(--f-num)는 폭이 맞춰진 좁은 글꼴 그대로. */
@font-face { font-family: "SOG Sans"; font-weight: 100 900; font-display: swap; src: url(assets/fonts/sog-sans.woff2) format("woff2"); }
@font-face { font-family: "SOG Serif"; font-weight: 200 900; font-display: swap; src: url(assets/fonts/sog-serif.woff2) format("woff2"); }
:root.real-art {
  --f-ui: "SOG Sans", "Avenir Next", "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
  --f-title: "SOG Serif", "Noto Serif KR", Optima, "Book Antiqua", serif;
}
:root.real-art[lang="ko"] {
  --f-ui: "SOG Sans", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-title: "SOG Serif", "Noto Serif KR", "Noto Sans KR", serif;
  --f-manga: "SOG Sans", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}
:root.real-art[lang="ko"] .hw-t { font-weight: 900; letter-spacing: -.01em; }
/* 제목 로고: 두꺼운 고딕 + 만화 테두리 → 명조 + 얇은 음각 테두리 + 금속 금빛 */
:root.real-art .logo text { font-family: "SOG Serif", "Noto Serif KR", serif; font-weight: 900; letter-spacing: 22px; }
:root.real-art .logo .lg-edge { stroke-width: 4; fill: #0a1330; stroke: #0a1330; }
:root.real-art .logo .lg-glow { opacity: .28; }
:root.real-art .logo .lg-fill { stroke: rgba(255, 246, 220, .55); stroke-width: .8; }
:root.real-art #sf-fill stop:nth-child(1) { stop-color: #fffaf0; }
:root.real-art #sf-fill stop:nth-child(2) { stop-color: #f4e2b4; }
:root.real-art #sf-fill stop:nth-child(3) { stop-color: #d9ad5c; }
:root.real-art #sf-fill stop:nth-child(4) { stop-color: #a8702c; }
:root.real-art .logo-sub { font-family: var(--f-title); font-weight: 600; letter-spacing: .5em; }
:root.real-art .boot-title { font-family: var(--f-title) !important; font-weight: 900 !important; }
/* 제목류 명조는 고딕보다 획이 가늘다 — 한 단계 굵게, 자간은 조금 좁게 */
:root.real-art .p-title, :root.real-art .r-title, :root.real-art .bn-t, :root.real-art .boss-name { font-weight: 800; }
:root.real-art[lang="ko"] .p-title, :root.real-art[lang="ko"] .r-title, :root.real-art[lang="ko"] .bn-t { letter-spacing: .08em; }

/* 천신 17개 언어 (2026-11-14): 라틴·키릴·베트남어는 SOG 글꼴(부분집합에 포함). 한자·가나·태국·데바나가리는 XGAME 공용
   Noto Sans (i18n.js 가 그 언어에서만 /assets/fonts/*.css 를 붙인다) — 라틴 글자는 SOG 로, 나머지는 그 글꼴로. 제목은
   해당 문자 명조가 시스템에 있으면 명조, 없으면 굵은 고딕. 터키어 ğ ş ı 는 명조 부분집합에 없어 제목도 고딕. */
:root.real-art[lang="ru"] { --f-num: "Arial Narrow", "Bahnschrift SemiCondensed", "Roboto Condensed", "SOG Sans", sans-serif; --f-manga: "SOG Sans", Impact, sans-serif; }
:root.real-art[lang="ru"] .hw-t { font-weight: 900; }
:root.real-art[lang="tr"] { --f-title: "SOG Sans", "Segoe UI", sans-serif; }
:root.real-art[lang="ja"] { --f-ui: "SOG Sans", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-title: "SOG Serif", "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", "Noto Sans JP", serif; --f-manga: "SOG Sans", "Noto Sans JP", sans-serif; }
:root.real-art[lang="zh"] { --f-ui: "SOG Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-title: "SOG Serif", "Noto Serif SC", "Songti SC", "Noto Sans SC", serif; --f-manga: "SOG Sans", "Noto Sans SC", sans-serif; }
:root.real-art[lang="zh-Hant"] { --f-ui: "SOG Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --f-title: "SOG Serif", "Noto Serif TC", "Songti TC", "Noto Sans TC", serif; --f-manga: "SOG Sans", "Noto Sans TC", sans-serif; }
:root.real-art[lang="th"] { --f-ui: "SOG Sans", "Noto Sans Thai", "Leelawadee UI", sans-serif; --f-title: "SOG Serif", "Noto Sans Thai", serif; --f-manga: "SOG Sans", "Noto Sans Thai", sans-serif; }
:root.real-art[lang="hi"] { --f-ui: "SOG Sans", "Noto Sans Devanagari", "Nirmala UI", sans-serif; --f-title: "SOG Serif", "Noto Sans Devanagari", serif; --f-manga: "SOG Sans", "Noto Sans Devanagari", sans-serif; }
/* 대문자·넓은 자간은 라틴 글자용 — 한자·가나·태국·데바나가리에서는 자간을 줄인다 (글자가 흩어져 보인다) */
:root.real-art:is([lang="ja"], [lang="zh"], [lang="zh-Hant"], [lang="th"], [lang="hi"]) :is(.p-title, .r-title, .bn-t, .boss-name, .pn-h, .r-k, .p-k, .wv-t, .sv-t) { letter-spacing: .06em; }
:root:is([lang="ja"], [lang="zh"], [lang="zh-Hant"], [lang="th"], [lang="hi"]) .hw-t { font-family: var(--f-manga); font-weight: 900; }
:root:is([lang="ja"], [lang="zh"], [lang="zh-Hant"]) .warn-t, :root:is([lang="th"], [lang="hi"]) .warn-t { white-space: normal; text-align: center; }
/* 천신 실사: 결과·일시정지·배너 제목의 애니 '3D 돌출 그림자'와 사탕색 그라데이션 → 영화 자막처럼 부드러운 그림자와 절제된 금속빛 */
:root.real-art .r-title { filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .55)); text-shadow: none; }
:root.real-art .results:not(.lose):not(.surv) .r-title { background: linear-gradient(180deg, #fffaf0 20%, #f1dcaa 60%, #c9984e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root.real-art .lose .r-title { background: linear-gradient(180deg, #f4f1ee 20%, #d9c6c6 60%, #9c6b6f 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .6)); }
:root.real-art .results.surv .r-title { background: linear-gradient(180deg, #fffaf0 20%, #f1dcaa 60%, #c98a52 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .55)); }
:root.real-art .p-title, :root.real-art .bn-t { text-shadow: 0 2px 12px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .5); }
/* 명조 제목은 글자가 줄 상자 아래로 내려온다 — background-clip:text 그라데이션이 '승'의 ㅇ 아래를 잘랐다 */
:root.real-art .r-title { line-height: 1.12; padding-bottom: .06em; margin-bottom: 2px; }
/* 제목 배너가 떠 있는 동안 경고 알약은 배너 아래로 */
.hud.bn-live .warn { transform: translateY(calc(12vh + 70px)); transition: transform .25s ease; }
.hud .warn { transition: transform .25s ease; }
/* (88단계) 실사: 타격 문구가 굵은 검정 테두리·흰 외곽 빛·기울어진 만화 의성어(별·집중선·반짝이)였다 — 영화 자막처럼
   똑바른 명조, 가는 어두운 테두리와 부드러운 그림자, 장식은 끄고 색 그라데이션만 남긴다. 조준점 폭발 별은 작고 옅게 */
:root.real-art .hw-t, :root.real-art[lang] .hw-t { font-style: normal; font-family: var(--f-title); font-weight: 800; letter-spacing: .05em; }
:root.real-art .hw-in { font-size: 32px; }
:root.real-art .hw-t .l0 { color: transparent; -webkit-text-stroke: 0; text-shadow: 0 .04em .35em rgba(4, 8, 20, .55), 0 0 .9em var(--glow, rgba(255, 150, 60, .35)); }
:root.real-art .hw-t .l1 { -webkit-text-stroke: .075em rgba(16, 10, 6, .82); }
:root.real-art .hw-star, :root.real-art .hw-sl, :root.real-art .hw-gl, :root.real-art .hw-fx { display: none !important; }
:root.real-art .hwx svg { transform: scale(.6); opacity: .55; }
/* (89단계) 실사: 레벨업 카드 — 기울어진 띠·속도선·이탤릭 숫자(만화 컷인) 대신 반듯한 띠, 줄무늬 없음, 명조 숫자 */
:root.real-art .lv-band, :root.real-art .lv-lines { clip-path: none; }
:root.real-art .lv-band { background: linear-gradient(90deg, rgba(6, 10, 30, .82) 0%, rgba(6, 10, 30, .6) 40%, rgba(6, 10, 30, 0) 92%); }
:root.real-art .lv-lines { display: none; }
:root.real-art .lv-edge { rotate: 0deg; height: 1.5px; box-shadow: none; opacity: .8; }
:root.real-art .lv-from, :root.real-art .lv-stats b { font-style: normal; }
:root.real-art .lv-to { font: 800 46px/1 var(--f-title); -webkit-text-stroke: 0; text-shadow: 0 2px 12px rgba(4, 8, 20, .7), 0 0 18px var(--eg); }
/* 글자마다 기울이고 튀게 하는 만화 연출도 끔 (단어 전체의 등장 애니메이션은 그대로) */
:root.real-art .hw-t .ch { transform: none !important; }
:root.real-art .hw-t b, :root.real-art .hw-t .ch { font-style: normal !important; }
:root.real-art .lv-gl { display: none; }
:root.real-art .lv-eln { font-style: normal; }
:root.real-art .hw-t .l1 { display: none; }
:root.real-art .hw-t .l0 { text-shadow: 0 .03em .06em rgba(4, 6, 14, .9), 0 .04em .35em rgba(4, 8, 20, .6), 0 0 .9em var(--glow, rgba(255, 150, 60, .35)); }
/* 바탕 층은 글자 간격이 채움 층과 달라 그림자가 옆으로 비껴 유령 글자가 됐다 — 채움 층에 그림자를 직접 */
:root.real-art .hw-t .l0 { visibility: hidden; }
:root.real-art .hw-t .l2 { filter: drop-shadow(0 1px 1px rgba(4, 6, 14, .9)) drop-shadow(0 2px 8px rgba(4, 8, 20, .55)); }
/* (95단계) 세로 휴대폰 타이틀: 언어 단추가 로고의 '신' 글자를 덮었다 — 좁은 세로 화면에선 전체화면 단추 왼쪽, 로고 위 줄로 */
@media (max-width: 560px) and (orientation: portrait) {
  /* 세로 휴대폰: 단추 무리가 양옆 256 px 씩 차지해 연출 배너가 20 px 폭에 한 글자씩 접혔다 — 배너는 단추 위 화면 전체 폭
     (단추는 아래쪽이라 위 배너와 겹치지 않는다) */
  .tm .banner { left: 12px !important; right: 12px !important; top: calc(130px + var(--safe-y, 0px) / var(--z)) !important; }
  .tm .hud .warn-p { max-width: calc(100vw / var(--z) - 32px); }
  /* 거신 바: 가로용 식(100vw − 178 − 패널)이 세로 390 px 에선 음수 폭이라 일시정지 단추 위에 이름만 떴다 — 패널·초상화 아래 전체 폭 */
  .tm .hud.min .boss, .tm .hud.touch .boss { left: 16px !important; right: 16px; width: auto !important; transform: none !important; top: calc(160px + var(--safe-y, 0px) / var(--z)) !important; }
  :root.real-art .tm .boss-por { display: none; }
  .tm .hud:has(.boss.on) .banner { top: calc(206px + var(--safe-y, 0px) / var(--z)) !important; }
  .tm .hud:has(.boss.on) .warn { top: calc(206px + var(--safe-y, 0px) / var(--z)) !important; }
  .tm .scr.title .t-left { bottom: 80px !important; }   /* 3줄로 접힌 아래 안내(독일어 등)가 마지막 메뉴에 겹쳤다 */
  /* 언어 목록(3열)이 왼쪽 화면 밖으로 51 px 나갔다 — 2열, 화면 폭 안에서 오른쪽 정렬 */
  .tm .scr.title .t-lang .tl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); width: calc(100vw / var(--z) - 40px); max-width: none; right: -86px; max-height: 62vh; overflow: auto; }
  .tm .scr.title .t-lang { top: max(34px, calc(env(safe-area-inset-top, 0px) / var(--z))) !important; right: max(106px, calc(env(safe-area-inset-right, 0px) / var(--z) + 76px)) !important; }
}
/* (105단계) 실사 데스크톱: 거신 바 왼쪽에 붙은 거신 초상화(74 px)가 목표 패널 끝을 덮었다 —
   1600 px 보다 좁은 데스크톱은 초상화를 접는다 — 남기면 목표 패널이 글자 몇 개 폭으로 접히거나 초상화가 패널을 덮었다(기존) */
@media (max-width: 1599px) { :root.real-art .hud:not(.touch):not(.min) .boss-por { display: none; } }
@media (min-width: 1600px) {
  :root.real-art .hud:not(.touch):not(.min) .boss.on ~ .objective { max-width: calc(50vw - min(26vw, 380px) - 52px - 80px); }
  :root.real-art .hud.fsa:not(.touch):not(.min) .boss.on ~ .objective { max-width: calc(50vw - min(26vw, 380px) - 104px - 80px); }
}
/* (152) 세로 휴대폰: 좁은 화면용 '.lvb 절대 위치'(왼쪽 아래 패널용)가 오른쪽 위 패널(터치·미니멀)에도 걸려 LV 배지가 체력 바를 덮었다 —
   이 패널에선 제자리(첫 열)에 작게, 패널은 일시정지·전체화면 단추 오른쪽 남은 폭만큼 */
@media (max-width: 600px) {
  .hud.min .pl, .hud.touch .pl { width: min(372px, calc(100vw - 176px)); }
  .hud.min .pl-main, .hud.touch .pl-main { column-gap: 9px; padding: 8px 12px 10px 8px; }
  .hud.min .lvb, .hud.touch .lvb { position: static; margin: 0 0 0 2px; padding: 4px 7px 3px 6px; }
  .hud.min .lvb-n, .hud.touch .lvb-n { font-size: 17px; }
  .hud.min .lvb-k, .hud.touch .lvb-k { font-size: 10px; }
  .hud.min .lvb-ic, .hud.touch .lvb-ic { width: 9px; height: 12px; }
  .hud.min .pl-hp, .hud.touch .pl-hp { font-size: 17px; }
}
/* (155) 일시정지 중엔 연출 배너('웨이브 1 · 그림자 기수단 …')를 숨긴다 — 가로 휴대폰에서 배너가 '계속하기' 줄 위에 겹쳐 읽혔다
   (배너 등장 애니메이션이 opacity 를 쥐고 있어 visibility 로; 다시 이어 하면 남은 시간만큼 그대로 보인다) */
.hud.paused .banner { visibility: hidden !important; }
/* (156) touch title on a portrait phone: the brand line ran on after the stick hint as if one sentence
   ("… 조준   천신 · SKY OF GOD") — the logo is right above, so drop it there and give each hint its own centred line */
@media (max-width: 600px) {
  .tm .t-foot > span:last-child { display: none; }
  .tm .t-foot .tonly { flex-basis: 100%; text-align: center; }
}
/* (157) 서바이벌 + 간소 HUD(휴대폰의 자동): 상단 서바이벌 판이 통째로 숨겨져 지금 몇 웨이브인지·점수가 어디에도 없었다.
   거신 바처럼 얇은 판으로 남긴다 — 'SURVIVAL · WAVE n' 과 시간 · 점수 (최고 기록·남은 적은 일시정지 화면 몫).
   자리: 넓은 화면은 위 가운데, ≤1180 은 거신 바 자리(일시정지·전체화면 쌍 다음), 세로 폰은 그 쌍 바로 아래 */
.hud.min div.svh { display: grid !important; top: 18px; gap: 3px; padding: 4px 18px 6px; }
.hud.min .svh .sv-foe, .hud.min .svh .sv-bs, .hud.min .svh .sv-row > i:last-of-type { display: none; }
.hud.min .svh .sv-t { font-size: 9.5px; letter-spacing: .26em; } .hud.min .svh .sv-wk { font-size: 11px; letter-spacing: .22em; }
.hud.min .svh .sv-wn { font-size: 22px; -webkit-text-stroke-width: 4px; }
.hud.min .svh .sv-row { gap: 8px; } .hud.min .svh .sv-row b { font-size: 14px; } .hud.min .svh .sv-k { font-size: 8px; letter-spacing: .16em; margin-right: 4px; }
@media (max-width: 1180px) {
  .hud.min div.svh { left: calc(170px + max(0px, env(safe-area-inset-left, 0px) - 16px) + var(--safe-x, 0px)); transform: none; justify-items: start; }
}
@media (max-width: 600px) {
  .hud.min div.svh { left: calc(8px + var(--safe-x, 0px)); top: calc(max(16px, env(safe-area-inset-top, 0px)) + 70px + var(--safe-y, 0px)); }
}
/* (159) 결과 제목은 어느 화면에서도 한 줄 — 데스크톱 베트남어 'Chiến Thắng'(132 px)이 두 줄로 감겨 등급 원이 제목에서 떨어져
   틀 오른쪽 끝(1280 px 에서 x 1206)에 붙었다. 넘치면 screens.js fitTitle 이 글자를 줄인다 */
.r-title { white-space: nowrap; }

/* (161) Medals panel */
.md-count { margin: -8px 0 14px; font: 600 13px/1.3 var(--f-ui); color: var(--ink-dim); letter-spacing: .04em; }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr)); gap: 8px; }
.md-card { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid rgba(255, 238, 200, .14); background: rgba(255, 255, 255, .03); }
.md-card.got { border-color: rgba(255, 231, 163, .4); background: linear-gradient(135deg, rgba(242, 196, 90, .12), rgba(255, 255, 255, .02)); }
.md-card .md-ic { margin-top: 1px; }
.md-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.md-tn { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.md-tn b { font: 700 14px/1.2 var(--f-ui); color: var(--ink); }
.md-card:not(.got) .md-tn b { color: var(--ink-dim); }
.md-tn small { font: 700 9.5px/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }
.md-ds { font: 400 12px/1.35 var(--f-ui); color: var(--ink-dim); }
.md-at { font: 600 11px/1.2 var(--f-ui); color: var(--gold-hi); margin-top: 2px; }
.md-prog { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.md-bar { position: relative; flex: 1; max-width: 120px; height: 4px; background: rgba(255, 250, 240, .12); }
.md-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--teal); box-shadow: 0 0 6px rgba(111, 224, 208, .5); }
.md-prog b { font: 600 11px/1 var(--f-ui); color: var(--ink-faint); }
/* (161) a portrait phone's title menu: the corner FULLSCREEN button stays, the menu item steps out (8 items with Medals reached the footer at 375×667) */
@media (max-width: 600px) { .tm .t-menu .mb-fs { display: none; } }
@media (max-height: 800px) { #ui:not(.tm) .t-menu .mb-fs { display: none; } }
/* (162) Daily Challenge: a teal diamond; nine menu lines — short screens fold the descriptions and tighten the rows */
.mbtn.mb-daily .mb-dia { border-color: #7fe3d4; }
.mbtn.mb-daily.focus .mb-dia { background: #7fe3d4; box-shadow: 0 0 10px rgba(111, 224, 208, .9); }
@media (max-height: 760px) { #ui:not(.tm) .scr.title .t-menu .mbtn:not(.primary) .mb-s { display: none; } #ui:not(.tm) .scr.title .t-menu .mbtn:not(.primary) { min-height: 42px; padding-top: 3px; padding-bottom: 3px; } }
@media (max-width: 600px) and (max-aspect-ratio: 4/5) and (min-height: 600px) and (max-height: 700px) { .scr.title .t-menu .mbtn:not(.primary) { min-height: 41px; } }
/* (164) Chapter choice: two cards — the Cloud Titan in the afternoon, the Storm Titan at golden hour */
.ch-panel { max-width: 1120px; }   /* (191) five chapters */
.ch-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 4px 0 6px; }   /* (187) four, (191) five chapters */
.ch-card { position: relative; display: flex; flex-direction: column; min-height: 248px; padding: 0; text-align: left; cursor: pointer;
  border: 1px solid rgba(255, 238, 200, .2); background: #0d1f3f; color: var(--ink); overflow: hidden; font: inherit;
  transition: border-color .18s, transform .18s, box-shadow .18s; }
.ch-art { position: absolute; inset: 0; background: url(assets/textures/keyart.jpg) 62% 40% / cover no-repeat; }
:root.real-art .ch-art { background-image: url(assets/textures/title_real.jpg); }
.ch-2 .ch-art { filter: sepia(.55) saturate(1.5) hue-rotate(-18deg) brightness(.82) contrast(1.08); background-position: 30% 55%; }
/* (181) Chapter III · the Onyx Night: the key art by moonlight */
.ch-3 .ch-art { filter: saturate(.55) brightness(.78) contrast(1.15); background-position: 80% 35%; }
.ch-3 .ch-art::after { background: linear-gradient(180deg, rgba(20, 30, 96, .42) 0%, rgba(16, 20, 70, .45) 40%, rgba(10, 8, 30, .94) 78%); }
.ch-3 .ch-k { color: #b9a6ff; }
/* (187) Chapter IV · the Onyx Highlands: the key art at an ashen dawn */
.ch-4 .ch-art { filter: sepia(.3) saturate(.7) brightness(.85) contrast(1.1); background-position: 55% 40%; }
.ch-4 .ch-art::after { background: linear-gradient(180deg, rgba(90, 40, 40, .25) 0%, rgba(50, 30, 40, .45) 40%, rgba(22, 14, 18, .94) 78%); }
.ch-4 .ch-k { color: #ffb0a0; }
/* (191) Chapter V · the Parting Sky: the key art lit from below */
.ch-5 .ch-art { filter: saturate(.6) brightness(.95) contrast(1.2) hue-rotate(-10deg); background-position: 50% 20%; }
.ch-5 .ch-art::after { background: linear-gradient(180deg, rgba(10, 16, 60, .45) 0%, rgba(20, 60, 90, .35) 45%, rgba(8, 10, 30, .94) 78%); }
.ch-5 .ch-k { color: #9fe8ff; }
.ch-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 16, 40, .05) 20%, rgba(8, 16, 40, .9) 78%); }
.ch-2 .ch-art::after { background: linear-gradient(180deg, rgba(60, 22, 6, .1) 10%, rgba(24, 10, 18, .92) 78%); }
.ch-tx { position: relative; margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 15px; }
.ch-k { font: 700 10px/1 var(--f-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-hi); }
.ch-2 .ch-k { color: #ffb36b; }
.ch-n { font: 600 24px/1.1 var(--f-title); color: var(--ink); text-shadow: var(--shadow-t); }
.ch-s { font: 400 12.5px/1.4 var(--f-ui); color: var(--ink-dim); }
.ch-st { align-self: flex-start; margin-top: 6px; padding: 3px 8px; font: 700 10px/1.2 var(--f-ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--navy); background: var(--teal); }
.ch-card.done .ch-st { background: var(--gold); }
.ch-card:disabled { cursor: default; } .ch-card:disabled .ch-art { filter: grayscale(1) brightness(.5); }
.ch-card:disabled .ch-st { background: rgba(255, 250, 240, .16); color: var(--ink-dim); }
.ch-card:not(:disabled):hover, .ch-card.focus, .ch-card:focus-visible { border-color: var(--gold-hi); transform: translateY(-2px); box-shadow: 0 8px 26px rgba(0, 0, 20, .5), 0 0 0 1px rgba(255, 231, 163, .4); outline: none; }
@media (max-width: 1100px) { .ch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }   /* (191) */
@media (max-width: 800px) { .ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* (187) */
@media (max-width: 600px) { .ch-grid { grid-template-columns: 1fr; } .ch-card { min-height: 150px; } .ch-n { font-size: 20px; } }
@media (max-height: 520px) { .ch-card { min-height: 150px; } .ch-s { display: none; } }
/* the results row with Chapter II in front: Play again steps back */
.r-menu .r-next-ch small { margin-left: 6px; }
/* (165) the Storm Titan: its portrait's molten gold turns storm blue (the boss bar keeps its colours) */
.boss.storm .boss-por { filter: hue-rotate(185deg) saturate(1.15) brightness(1.05); }
.boss.onyx .boss-por { filter: hue-rotate(250deg) saturate(.9) brightness(.8) contrast(1.15); }
.boss.ash .boss-por { filter: sepia(.6) hue-rotate(-20deg) saturate(1.3) brightness(.9) contrast(1.1); }   /* (187) the Ash Titan */
.boss.god .boss-por { filter: brightness(1.35) saturate(.45) hue-rotate(160deg) contrast(1.1); }   /* (191) the Sky God */
/* (167) chapter records: on the cards and the results' new-record line */
.ch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; } .ch-row .ch-st { margin-top: 0; }
.ch-rec { font: 600 11.5px/1.2 var(--f-num); letter-spacing: .06em; color: var(--gold-hi); text-shadow: var(--shadow-t); }
.r-reach.r-rec { color: var(--gold-hi); font-weight: 700; letter-spacing: .08em; }

/* (172) the story's spoken lines: low in the centre, the speaker's portrait (a crop of the key art) + name + words */
.say { position: absolute; left: 50%; bottom: 17vh; display: none; align-items: center; gap: 14px; max-width: min(640px, 86vw);
  padding: 10px 22px 10px 10px; transform: translateX(-50%); pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(8, 16, 46, .78), rgba(8, 16, 46, .62) 70%, rgba(8, 16, 46, .30));
  border-left: 2px solid var(--gold-hi); border-radius: 4px 30px 30px 4px; box-shadow: 0 8px 26px rgba(0, 0, 20, .35); }
.say.on { display: flex; }
.say .sy-por { position: relative; flex: 0 0 auto; left: auto; bottom: auto; width: 50px; height: 50px; }
.say .sy-por.kaede { background-size: 640px 640px; background-position: -276px -258px; }
.say .sy-por.sora { background-size: 310px 310px; background-position: -214px -153px; }
.say .sy-b { display: grid; gap: 3px; min-width: 0; }
.say .sy-n { font: 700 11px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-hi); }
.say .sy-t { font: 500 clamp(14px, 1.35vw, 17px)/1.38 var(--f-ui); color: var(--ink); text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.hud.paused .say { visibility: hidden; }
/* touch: at the very bottom between the stick and the action buttons (not under the reticle) */
.tm .say { bottom: calc(14px + var(--safe-y, 0px) / var(--z)); max-width: min(560px, calc(100vw / var(--z) - 330px)); }
.tm .say .sy-t { font-size: 13px; line-height: 1.32; }
@media (max-height: 560px) { .say { bottom: 24vh; padding: 7px 16px 7px 7px; gap: 10px; } .say .sy-por { width: 38px; height: 38px; }
  .say .sy-por.kaede { background-size: 486px 486px; background-position: -210px -196px; } .say .sy-t { font-size: 13px; } }
/* (172) the spoken line's portrait in the real-art HUD: the rendered portraits strip (Sora · Kaede · titan) */
:root.real-art .say .sy-por { background-size: 300% 100%; }
:root.real-art .say .sy-por.kaede { background-position: 50% 0%; }
:root.real-art .say .sy-por.sora { background-position: 0% 0%; }
/* (179) the Onyx Aces' lines: their portrait (crops of the story cards) and a violet edge instead of the gold */
.say .sy-por.foe-hood, .say .sy-por.foe-helm, :root.real-art .say .sy-por.foe-hood, :root.real-art .say .sy-por.foe-helm {
  background-image: url(assets/textures/foes_real.jpg); background-size: 200% 100%; border-color: #9b84c9; }
.say .sy-por.foe-hood, :root.real-art .say .sy-por.foe-hood { background-position: 0% 0%; }
.say .sy-por.foe-helm, :root.real-art .say .sy-por.foe-helm { background-position: 100% 0%; }
.say.foe { border-left-color: #a58bd8; background: linear-gradient(90deg, rgba(26, 12, 40, .82), rgba(26, 12, 40, .64) 70%, rgba(26, 12, 40, .30)); }
.say.foe .sy-n { color: #c9b2f2; }
