:root {
  --ink: #07050d;
  --ink-2: #0d0a16;
  --panel: #120e1d;
  --panel-2: #1a1327;
  --paper: #f4ecdc;
  --muted: #a89bb9;
  --pink: #ff2e63;
  --pink-deep: #a90d38;
  --cyan: #29e7ff;
  --yellow: #ffd23f;
  --violet: #7a3df0;
  --green: #57e389;
  --line: rgba(244, 236, 220, .13);
  --mono: "Courier New", "Menlo", "Consolas", monospace;
  --display: Impact, "Arial Black", "Haettenschweiler", "PingFang SC", "Microsoft YaHei", sans-serif;
  --cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  background:
    radial-gradient(1100px 700px at 15% -5%, rgba(122, 61, 240, .16), transparent 60%),
    radial-gradient(1000px 700px at 95% 15%, rgba(41, 231, 255, .10), transparent 55%),
    radial-gradient(900px 800px at 55% 110%, rgba(255, 46, 99, .13), transparent 60%),
    #07050d;
}

button, input { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.is-hidden { display: none !important; }

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ambient-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .3; }
.glow-a { width: 44vw; height: 44vw; background: #5b1ea8; left: -18vw; top: -18vw; }
.glow-b { width: 38vw; height: 38vw; background: #9c123d; right: -16vw; bottom: -20vw; opacity: .28; }
.ambient-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(41, 231, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 231, 255, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 78%);
}
.ambient-noise {
  position: absolute; inset: 0; opacity: .055; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.page {
  position: relative; z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

/* ————— top bar ————— */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 4px 16px;
}
.brand-mark {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center; position: relative;
  background: var(--paper); color: var(--ink);
  font-family: var(--display); font-style: italic; font-size: 22px; line-height: .8;
  transform: skew(-7deg);
  box-shadow: 5px 5px 0 rgba(255, 46, 99, .75);
}
.brand-mark small {
  position: absolute; right: 2px; bottom: 2px;
  font-family: var(--mono); font-size: 6px; font-style: normal; letter-spacing: .08em;
}
.topbar-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-kicker { font-size: 9px; letter-spacing: .22em; color: var(--cyan); opacity: .8; }
.topbar-copy strong {
  font-family: var(--display); font-size: 17px; letter-spacing: .06em;
  font-weight: 900;
}
.topbar-copy em { font-family: var(--cn); font-style: normal; font-size: 11px; letter-spacing: .2em; color: var(--muted); margin-left: 8px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.utility-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.035);
  color: var(--muted); padding: 8px 11px; font-size: 10px; letter-spacing: .08em;
  cursor: pointer; transition: .18s ease;
}
.utility-btn:hover { color: var(--paper); border-color: rgba(41, 231, 255, .45); background: rgba(41, 231, 255, .07); }

/* ————— cabinet ————— */
.cabinet {
  position: relative;
  padding: 11px 11px 7px;
  border: 1px solid rgba(244, 236, 220, .14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 12%),
    linear-gradient(135deg, #191224, #0b0812 55%, #140e1e);
  box-shadow:
    0 40px 80px rgba(0,0,0,.58),
    0 0 0 1px rgba(0,0,0,.8) inset,
    0 0 60px rgba(255, 46, 99, .08);
}
.cabinet-topline {
  display: flex; align-items: center; gap: 12px;
  padding: 1px 3px 8px;
  font-size: 8px; letter-spacing: .22em; color: #776b88;
}
.cabinet-topline i { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 3px, transparent 3px 7px); }
.cabinet-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px 2px; font-size: 7px; letter-spacing: .18em; color: #6e637e;
}
.footer-leds { display: flex; gap: 5px; }
.footer-leds i { width: 4px; height: 4px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.footer-leds i:nth-child(2) { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.footer-leds i:nth-child(3) { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }

.screen {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #05030a;
  border: 1px solid rgba(0,0,0,.95);
  border-radius: 7px;
  box-shadow:
    0 0 0 2px rgba(255,255,255,.04),
    0 0 40px rgba(41, 231, 255, .05) inset;
  isolation: isolate;
  touch-action: none;
}
#game {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  background: #05030a;
  outline: none;
  filter: saturate(1.08) brightness(1.06) contrast(1.02);
}

/* CRT overlays */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.fx-scanlines {
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.20) 0, rgba(0,0,0,.20) 1px, transparent 1px, transparent 3px);
  opacity: .42; mix-blend-mode: multiply;
}
.fx-vignette {
  background: radial-gradient(ellipse at 50% 48%, transparent 51%, rgba(2,1,7,.42) 88%, rgba(2,1,7,.72) 100%);
  box-shadow: inset 0 0 4cqw rgba(0,0,0,.45);
}
.fx-glass {
  background:
    linear-gradient(112deg, rgba(255,255,255,.035) 0%, transparent 22%, transparent 78%, rgba(255,255,255,.018) 100%),
    radial-gradient(ellipse at 50% -20%, rgba(255,255,255,.07), transparent 45%);
}
#damage-flash {
  position: absolute; inset: 0; z-index: 13; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(255, 20, 55, .55) 100%);
  opacity: 0; transition: opacity .16s ease-out;
}
#damage-flash.hit { opacity: .9; transition: none; }

/* ————— HUD ————— */
.hud {
  position: absolute; z-index: 15; inset: 0 0 auto 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  gap: 1.4cqw;
  padding: 1.25cqw 1.6cqw 2.4cqw;
  background: linear-gradient(to bottom, rgba(4,2,10,.86), rgba(4,2,10,.38) 65%, transparent);
  pointer-events: none;
  font-family: var(--mono);
  text-shadow: 1px 1px 0 #000;
}
.hud-left { display: flex; align-items: center; gap: .7cqw; min-width: 0; }
.hud-portrait {
  width: 3.45cqw; height: 4.3cqw; min-width: 32px; min-height: 40px;
  border: 1px solid rgba(255, 210, 63, .5);
  background: linear-gradient(135deg, rgba(255,46,99,.24), rgba(41,231,255,.08));
  overflow: hidden; flex: 0 0 auto;
}
.hud-portrait canvas { width: 100%; height: 100%; display: block; }
.hud-vitals { min-width: 13cqw; }
.hud-name-row { display: flex; align-items: baseline; gap: .55cqw; }
.hud-name-row b { font-size: max(10px, 1.15cqw); letter-spacing: .1em; color: var(--paper); }
.hud-lives { font-size: max(8px, .82cqw); color: var(--yellow); letter-spacing: .12em; }
.meter { position: relative; overflow: hidden; background: rgba(0,0,0,.72); border: 1px solid rgba(244,236,220,.35); }
.meter i { position: absolute; inset: 0; display: block; transform-origin: left center; }
.hp-meter { height: .72cqw; min-height: 7px; margin-top: .26cqw; }
.hp-meter #hp-ghost { background: #fff2cf; opacity: .18; transition: transform .5s ease .15s; }
.hp-meter #hp-fill { background: linear-gradient(90deg, #ffb52e, #ffe66d 65%, #fff4b0); box-shadow: 0 0 8px rgba(255, 200, 60, .45); }
.hp-meter.low #hp-fill { background: linear-gradient(90deg, #ff2e63, #ff6b3d); animation: lowhp .7s steps(2) infinite; }
.hud-subrow {
  display: flex; justify-content: space-between; gap: .7cqw;
  margin-top: .3cqw; font-size: max(10px, .72cqw); letter-spacing: .05em; color: #ded2e8;
}
.hud-subrow #hud-weapon { color: var(--cyan); }
.hud-center { text-align: center; padding: .15cqw .65cqw .2cqw; background: rgba(4,2,10,.42); border-bottom: 1px solid rgba(255,210,63,.18); }
.hud-center > span { font-size: max(9px, .7cqw); letter-spacing: .24em; color: var(--yellow); }
.hud-center > div { font-size: max(9px, .58cqw); letter-spacing: .14em; color: #e4d9ed; margin-top: .25cqw; }
.hud-right { text-align: right; line-height: 1.1; }
.hud-score span, .hud-combo span { font-size: max(9px, .6cqw); letter-spacing: .12em; color: #d7cbe1; display: block; }
.hud-score b { font-size: max(12px, 1.23cqw); letter-spacing: .09em; color: var(--paper); font-weight: 400; }
.hud-combo { margin-top: .2cqw; }
.hud-combo b { font-size: max(11px, 1.15cqw); color: var(--cyan); letter-spacing: .08em; font-weight: 400; }
.hud-combo.hot b { color: var(--pink); text-shadow: 0 0 10px rgba(255,46,99,.8); }

.boss-ui {
  position: absolute; z-index: 15; top: 5.6cqw; left: 50%; transform: translateX(-50%);
  width: 38cqw; min-width: 220px; pointer-events: none;
  background: rgba(4,2,10,.78); border: 1px solid rgba(255,46,99,.4);
  padding: .5cqw .7cqw .65cqw;
  box-shadow: 0 0 20px rgba(255,46,99,.15);
}
.boss-ui-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1cqw; padding-bottom: .25cqw; }
.boss-ui-head span { font-size: max(10px, .64cqw); letter-spacing: .17em; color: #ffd08a; }
.boss-ui-head b { font-size: max(11px, .92cqw); letter-spacing: .15em; color: #fff6e8; }
.boss-meter { height: max(8px, .72cqw); border-color: rgba(255,46,99,.7); background-image: repeating-linear-gradient(90deg, transparent 0 9%, rgba(0,0,0,.38) 9% 10%); }
.boss-meter i { background: linear-gradient(90deg, #ff2e63, #ff5b7d 55%, #ffd23f); box-shadow: 0 0 14px rgba(255,46,99,.85); }
.boss-row + .boss-row {
  margin-top: .45cqw; padding-top: .4cqw;
  border-top: 1px solid rgba(255,46,99,.25);
}
.boss-row-2 .boss-meter { border-color: rgba(41,231,255,.6); }
.boss-row-2 .boss-meter i { background: linear-gradient(90deg, #29e7ff, #7ef4ff 55%, #ffd23f); box-shadow: 0 0 14px rgba(41,231,255,.8); }

/* ————— title ————— */
.overlay { position: absolute; inset: 0; z-index: 20; }
.title-screen {
  background:
    linear-gradient(90deg, rgba(4,2,10,.88) 0%, rgba(4,2,10,.55) 35%, rgba(4,2,10,.05) 62%, rgba(4,2,10,.48) 100%),
    linear-gradient(0deg, rgba(4,2,10,.8) 0%, transparent 26%, transparent 76%, rgba(4,2,10,.5) 100%);
}
.title-content {
  position: absolute; left: 6.4cqw; top: 9%;
  width: 55%; z-index: 2;
  animation: titleIn .8s cubic-bezier(.2,.8,.2,1) both;
}
.eyebrow {
  font-size: max(8px, .72cqw); letter-spacing: .26em; color: var(--cyan);
  display: flex; align-items: center; gap: .6cqw; text-transform: uppercase;
}
.eyebrow span { color: var(--pink); }
.game-logo {
  margin: 1.3cqw 0 0;
  display: flex; flex-direction: column; align-items: flex-start;
  font-family: var(--display); font-weight: 900;
  line-height: .76; letter-spacing: -.035em;
  transform: skew(-5deg);
  filter: drop-shadow(0 .7cqw 0 rgba(0,0,0,.55));
}
.logo-neon {
  position: relative; display: block;
  font-size: 12.8cqw; color: #f8f0df;
  text-shadow:
    0 .35cqw 0 #8f7c96,
    0 .48cqw 0 #17101e,
    .18cqw .18cqw 0 rgba(41,231,255,.5),
    -.12cqw -.12cqw 0 rgba(255,46,99,.3);
}
.logo-neon::after {
  content: "NEON"; position: absolute; left: 0; top: 0; z-index: -1;
  color: var(--cyan); opacity: .25; transform: translate(.4cqw, .12cqw);
}
.logo-rage {
  position: relative; display: block;
  font-size: 13.6cqw; color: var(--pink);
  text-shadow:
    0 .35cqw 0 #6f0a24,
    .2cqw .5cqw 0 #160a13,
    -.12cqw -.1cqw 0 rgba(255,210,63,.55);
}
.logo-rage::after {
  content: "RAGE"; position: absolute; left: 0; top: 0; z-index: -1;
  color: var(--yellow); opacity: .2; transform: translate(.55cqw, .18cqw);
}
.logo-cn {
  margin-top: 1.2cqw;
  font-family: var(--cn); font-weight: 900;
  font-size: 1.55cqw; letter-spacing: .62em; color: #f4ecdc;
  text-shadow: 0 0 18px rgba(255,46,99,.55);
}
.title-copy {
  margin: 1.25cqw 0 1.5cqw;
  font-family: var(--cn); font-size: max(9px, 1.05cqw); letter-spacing: .14em;
  color: #cfc1d8;
}
.arcade-btn {
  position: relative; display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: .15cqw; min-width: 16cqw;
  padding: 1cqw 2.6cqw 1.05cqw 1.35cqw;
  border: 0; cursor: pointer;
  color: #130914; background: var(--yellow);
  font-family: var(--cn); font-weight: 900;
  clip-path: polygon(0 0, 100% 0, calc(100% - 1.1cqw) 100%, 0 100%);
  box-shadow: 0 .35cqw 0 #a5163e, 0 1.2cqw 3cqw rgba(0,0,0,.4);
  transition: transform .14s ease, filter .14s ease;
  animation: btnPulse 2.4s ease-in-out infinite;
}
.arcade-btn::after {
  content: "›"; position: absolute; right: 1.25cqw; top: 50%; transform: translateY(-50%);
  font-family: var(--display); font-size: 2.5cqw; color: #6c0c2b;
}
.arcade-btn:hover { transform: translateY(-2px) skew(-2deg); filter: brightness(1.08); }
.arcade-btn:active { transform: translateY(1px); }
.btn-main { font-size: 1.3cqw; letter-spacing: .12em; line-height: 1; }
.btn-sub { font-family: var(--mono); font-weight: 400; font-size: max(8px, .53cqw); letter-spacing: .16em; color: #6b3a13; }
.arcade-btn.compact { min-width: 12cqw; padding: .75cqw 2.3cqw .8cqw 1.1cqw; animation: none; }
.arcade-btn.compact .btn-main { font-size: 1.05cqw; }
.arcade-btn.compact .btn-sub { font-size: .48cqw; }
.arcade-btn.compact::after { font-size: 2cqw; right: 1cqw; }

.title-meta {
  display: flex; gap: 1.5cqw; flex-wrap: wrap;
  margin-top: 1.8cqw;
  font-size: max(8px, .55cqw); letter-spacing: .15em; color: #81748f;
}
.title-meta span::before { content: "◆"; color: var(--pink); margin-right: .45cqw; font-size: .45cqw; }
.title-stamp {
  position: absolute; right: 4.6cqw; top: 15%;
  display: flex; flex-direction: column; align-items: flex-end; gap: .12cqw;
  font-family: var(--display); font-style: italic; font-size: 2.5cqw;
  line-height: .85; color: transparent;
  -webkit-text-stroke: 1px rgba(244,236,220,.34);
  transform: rotate(4deg); opacity: .95; z-index: 1;
}
.title-stamp span:nth-child(2) { color: rgba(255,46,99,.22); -webkit-text-stroke: 1px rgba(255,46,99,.45); }
.title-stamp span:nth-child(4) { color: rgba(41,231,255,.12); -webkit-text-stroke: 1px rgba(41,231,255,.32); }
.title-rays {
  position: absolute; width: 70cqw; height: 70cqw; right: -20cqw; top: -27cqw;
  background: repeating-conic-gradient(from 10deg at 50% 50%, rgba(255,46,99,.09) 0 5deg, transparent 5deg 14deg);
  border-radius: 50%; filter: blur(.2px);
  animation: spin 70s linear infinite;
  mask-image: radial-gradient(circle, #000 0 18%, transparent 62%);
  opacity: .8;
}
.title-ticker {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 2cqw;
  padding: .55cqw 1.4cqw;
  background: rgba(4,2,10,.82);
  border-top: 1px solid rgba(41,231,255,.16);
  font-size: max(8px, .56cqw); letter-spacing: .16em; color: #b8abc6;
  white-space: nowrap; overflow: hidden;
}
.title-ticker span:nth-child(2n) { color: var(--pink); }

/* ————— character select ————— */
.select-screen {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(122,61,240,.16), transparent 55%),
    rgba(4,2,10,.9);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 2.4cqw 3.6cqw 2cqw;
  gap: 1.15cqw;
  overflow: hidden;
}
.select-head { text-align: center; flex: 0 0 auto; }
.select-head .eyebrow { justify-content: center; font-size: .62cqw; }
.select-head h2 {
  margin: .45cqw 0 .2cqw;
  font-family: var(--display); font-size: 3.2cqw; letter-spacing: .04em;
  color: var(--paper); text-shadow: .18cqw .18cqw 0 rgba(255,46,99,.45);
}
.select-head p { margin: 0; font-family: var(--cn); font-size: max(9px, .9cqw); color: var(--muted); letter-spacing: .08em; }
.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3cqw; flex: 1 1 auto; min-height: 0; }
.char-card {
  --char-bg: none;
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  padding: 1.1cqw 1.5cqw 1cqw 1.2cqw;
  text-align: left; cursor: pointer;
  border: 1px solid rgba(244,236,220,.16);
  background-color: #090610;
  background-image:
    linear-gradient(180deg, rgba(4,2,10,.56) 0%, rgba(4,2,10,.22) 30%, rgba(4,2,10,.7) 64%, rgba(4,2,10,.95) 100%),
    linear-gradient(155deg, color-mix(in srgb, var(--char-color, #7a3df0) 14%, transparent), transparent 46%, rgba(9,6,16,.62) 100%),
    var(--char-bg);
  background-size: cover;
  background-position: center, center, center 28%;
  background-repeat: no-repeat;
  color: var(--paper);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.char-card::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 12px);
  pointer-events: none;
}
.char-card[data-char="rex"] { --char-color: #ff2e63; --char-bg: url("images/char-rex.webp"); }
.char-card[data-char="luna"] { --char-color: #7a3df0; --char-bg: url("images/char-luna.webp"); }
.char-card[data-char="bruno"] { --char-color: #ffd23f; --char-bg: url("images/char-bruno.webp"); }
.char-card:hover, .char-card.selected {
  transform: translateY(-.18cqw);
  border-color: var(--char-color, var(--pink));
  box-shadow: 0 .8cqw 2.5cqw rgba(0,0,0,.5), 0 0 2.2cqw color-mix(in srgb, var(--char-color, var(--pink)) 28%, transparent);
  background-image:
    linear-gradient(180deg, rgba(4,2,10,.4) 0%, rgba(4,2,10,.08) 30%, rgba(4,2,10,.64) 64%, rgba(4,2,10,.94) 100%),
    linear-gradient(155deg, color-mix(in srgb, var(--char-color, var(--pink)) 22%, transparent), transparent 46%, rgba(9,6,16,.58) 100%),
    var(--char-bg);
}
.char-card.selected::before {
  border: 1px solid rgba(255,255,255,.12);
}
.char-index {
  position: absolute; right: .8cqw; top: .35cqw;
  font-family: var(--display); font-size: 3.1cqw; line-height: 1;
  color: rgba(255,255,255,.1);
}
.char-preview {
  width: 100%; height: 14.8cqw; display: block; object-fit: contain;
  margin: 0 auto .1cqw;
  filter: drop-shadow(0 1cqw 1cqw rgba(0,0,0,.55));
}
.char-tag { font-size: max(8px, .5cqw); letter-spacing: .2em; color: var(--char-color, var(--pink)); }
.char-name { font-family: var(--display); font-size: max(14px, 2.1cqw); line-height: 1.1; letter-spacing: .03em; margin-top: .1cqw; }
.char-name em { font-family: var(--cn); font-style: normal; font-size: max(9px, .82cqw); letter-spacing: .18em; color: #cbbfd7; margin-left: .35cqw; }
.char-role { font-family: var(--cn); font-size: max(8px, .72cqw); color: #b9adc7; letter-spacing: .08em; margin-bottom: .5cqw; }
.stat-row { display: flex; align-items: center; gap: .5cqw; width: 100%; margin-top: .22cqw; }
.stat-row > span { width: max(10px, .9cqw); font-family: var(--cn); font-size: max(8px, .55cqw); color: #c2b6cf; }
.stat-track { flex: 1; height: max(4px, .45cqw); background: rgba(0,0,0,.82); border: 1px solid rgba(255,255,255,.12); }
.stat-track i { display: block; height: 100%; background: var(--char-color, var(--pink)); background: linear-gradient(90deg, var(--char-color, var(--pink)), color-mix(in srgb, var(--char-color, var(--pink)) 45%, #fff)); box-shadow: 0 0 6px color-mix(in srgb, var(--char-color, var(--pink)) 65%, transparent); opacity: 1; }
.char-trait { display: none; }
.char-desc {
  margin: auto 0 0; padding-top: .5cqw; font-family: var(--cn); font-size: max(10px, .72cqw); line-height: 1.55;
  color: #cdc1da; letter-spacing: .03em;
}
.select-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1cqw;
  flex: 0 0 auto; padding-top: .15cqw;
}
.select-help { font-family: var(--cn); font-size: max(8px, .64cqw); color: #9a8da8; letter-spacing: .05em; }
.select-help kbd { margin: 0 .15cqw; }
.select-buttons { display: flex; align-items: center; gap: .7cqw; }
.ghost-btn {
  border: 1px solid rgba(244,236,220,.22); background: transparent;
  color: #b7aac5; padding: .7cqw 1.2cqw; font-family: var(--cn); font-size: max(9px, .72cqw);
  cursor: pointer; transition: .16s ease; letter-spacing: .08em;
}
.ghost-btn:hover { color: var(--paper); border-color: rgba(244,236,220,.5); background: rgba(255,255,255,.045); }
.ghost-btn.danger:hover { border-color: var(--pink); color: var(--pink); }

/* ————— stage intro ————— */
.stage-card {
  background: rgba(4,2,10,.8);
  display: grid; place-items: center; z-index: 22;
}
.stage-card::before, .stage-card::after {
  content: ""; position: absolute; left: 0; right: 0; height: 9%;
  background: #030208; z-index: 2;
}
.stage-card::before { top: 0; border-bottom: 1px solid rgba(255,46,99,.35); }
.stage-card::after { bottom: 0; border-top: 1px solid rgba(41,231,255,.25); }
.stage-card-inner { text-align: center; width: 73%; animation: stageIn .65s cubic-bezier(.2,.8,.2,1) both; }
.stage-kicker { font-size: max(8px, .58cqw); letter-spacing: .35em; color: var(--cyan); }
.stage-number { margin-top: 1.3cqw; font-size: max(9px, 1cqw); letter-spacing: .36em; color: #a99bbb; }
.stage-number span { color: var(--yellow); }
.stage-card h2 {
  margin: .2cqw 0 0;
  font-family: var(--display); font-size: 7.3cqw; line-height: 1; letter-spacing: .02em;
  color: var(--paper); text-shadow: .28cqw .28cqw 0 rgba(255,46,99,.5);
}
.stage-cn { font-family: var(--cn); font-size: 1.55cqw; letter-spacing: .6em; color: var(--pink); margin-top: .6cqw; }
.stage-line { width: 8cqw; height: 2px; margin: 1.3cqw auto; background: linear-gradient(90deg, transparent, var(--yellow), transparent); }
.stage-card p { margin: 0 auto; max-width: 40cqw; font-family: var(--cn); font-size: max(9px, .92cqw); line-height: 1.9; color: #cabfd4; letter-spacing: .06em; }
.stage-skip { margin-top: 1.4cqw; font-size: max(8px, .5cqw); letter-spacing: .25em; color: #8d809b; animation: blink 1.4s steps(2) infinite; }

/* ————— modals ————— */
.modal-screen {
  background: rgba(3,2,8,.8);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 25;
}
.modal-card {
  position: relative; width: 60%;
  padding: 2.3cqw 2.6cqw 2cqw;
  border: 1px solid rgba(244,236,220,.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), transparent 30%),
    linear-gradient(150deg, #171022, #0a0712 70%);
  box-shadow: 0 2.5cqw 6cqw rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.7);
  animation: modalIn .25s ease both;
}
.modal-card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 3.2cqw; height: 3px;
  background: var(--pink); box-shadow: 0 0 12px var(--pink);
}
.modal-card .eyebrow { font-size: max(8px, .55cqw); }
.modal-card h2 { margin: .55cqw 0 .3cqw; font-family: var(--display); font-size: 3.8cqw; line-height: 1; letter-spacing: .03em; }
.modal-copy { margin: 0; font-family: var(--cn); font-size: max(9px, .82cqw); line-height: 1.8; color: #c0b4cc; letter-spacing: .04em; }
.pause-controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5cqw .9cqw;
  padding: 1.2cqw 0; margin: 1.1cqw 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.pause-controls div { display: flex; align-items: center; justify-content: space-between; gap: .5cqw; font-family: var(--cn); font-size: max(8px, .64cqw); color: #a99bbb; }
.pause-controls span { color: #d4c9dd; }
kbd {
  display: inline-block; min-width: 1.35em; padding: .16em .38em;
  border: 1px solid rgba(244,236,220,.28); border-bottom-width: 2px;
  background: rgba(255,255,255,.06); color: #f4ecdc;
  font-family: var(--mono); font-size: .86em; text-align: center;
}
.modal-buttons { display: flex; align-items: center; gap: .8cqw; flex-wrap: wrap; margin-top: 1cqw; }

.result-card { width: 66%; text-align: center; overflow: hidden; }
.result-card .eyebrow { justify-content: center; }
.result-grade {
  position: absolute; right: 2.2cqw; top: 2.3cqw;
  font-family: var(--display); font-size: 7.8cqw; line-height: 1; color: var(--yellow);
  -webkit-text-stroke: 1px #8f5b08; opacity: .96;
  text-shadow: .28cqw .28cqw 0 rgba(97, 8, 34, .92), 0 0 3cqw rgba(255,210,63,.35);
}
.result-grade::before {
  content: "RANK"; position: absolute; right: .2cqw; bottom: calc(100% + .15cqw);
  font-family: var(--mono); font-size: max(8px, .52cqw); letter-spacing: .22em; color: #a99bbb;
  -webkit-text-stroke: 0; text-shadow: none;
}
.result-card h2 { font-size: 3.3cqw; }
.result-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: 1.2cqw 0 .4cqw; padding: .9cqw 0;
}
.result-stats > div { display: flex; flex-direction: column; gap: .2cqw; border-right: 1px solid var(--line); }
.result-stats > div:last-child { border-right: 0; }
.result-stats span { font-size: max(9px, .54cqw); letter-spacing: .12em; color: #c9bdd5; }
.result-stats b { font-size: max(12px, 1.32cqw); font-weight: 400; letter-spacing: .06em; color: var(--yellow); }
.result-card .modal-buttons { justify-content: center; }
.result-stats.mini { grid-template-columns: 1fr 1fr; width: 72%; margin: 1.2cqw auto; }
.gameover-card { text-align: center; }
.gameover-card .eyebrow { justify-content: center; }
.gameover-title {
  font-size: 5.8cqw !important; color: var(--pink) !important;
  text-shadow: 0 0 3cqw rgba(255,46,99,.35), .35cqw .35cqw 0 #4c0619;
}
.gameover-card .modal-buttons { justify-content: center; }

/* ————— toast / touch ————— */
.toast {
  position: absolute; z-index: 18; left: 50%; bottom: 30%;
  transform: translate(-50%, 8px);
  padding: .55cqw 1.2cqw;
  background: rgba(4,2,10,.82); border: 1px solid rgba(41,231,255,.3);
  color: var(--cyan); font-family: var(--cn); font-size: max(9px, .72cqw); letter-spacing: .1em;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.rotate-hint {
  position: absolute; z-index: 30; left: 50%; bottom: 7%; transform: translateX(-50%);
  padding: .8cqw 1.2cqw; border: 1px solid rgba(255,210,63,.35);
  background: rgba(4,2,10,.86); color: var(--yellow);
  font-family: var(--cn); font-size: .9cqw; letter-spacing: .1em;
  pointer-events: none;
}

.touch-controls { display: none; }
body.touch-mode .touch-controls {
  display: block; position: absolute; inset: 0; z-index: 17; pointer-events: none;
}
.touch-key {
  pointer-events: auto; touch-action: none; user-select: none;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(9,6,16,.5);
  color: rgba(255,255,255,.75);
  backdrop-filter: blur(4px);
  font-family: var(--cn); font-weight: 900;
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 8px rgba(0,0,0,.3);
}
.touch-key:active, .touch-key.pressed {
  background: rgba(255,46,99,.45); border-color: #fff; color: #fff;
  transform: scale(.96);
}
.touch-dpad {
  position: absolute; left: 2%; bottom: 5%;
  width: 20%; aspect-ratio: 1; display: grid;
  grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 3px; opacity: .82;
}
.touch-dpad .touch-key { border-radius: 6px; font-size: 2.2cqw; }
.touch-dpad .up { grid-area: 1 / 2; }
.touch-dpad .left { grid-area: 2 / 1; }
.touch-dpad .right { grid-area: 2 / 3; }
.touch-dpad .down { grid-area: 3 / 2; }
.touch-actions {
  position: absolute; right: 2.6%; bottom: 3.6%;
  width: 33%; aspect-ratio: 1.5;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2cqw; align-items: end;
  opacity: .86;
}
.touch-actions .touch-key {
  border-radius: 50%; aspect-ratio: 1; font-size: 1.25cqw; line-height: 1.1;
  align-self: end;
}
.touch-actions .attack { width: 100%; background: rgba(255,46,99,.42); border-color: rgba(255,46,99,.9); box-shadow: 0 0 12px rgba(255,46,99,.25), inset 0 1px 0 rgba(255,255,255,.16); }
.touch-actions .jump { margin-bottom: 16%; }
.touch-actions .special { margin-bottom: 3%; background: rgba(255,210,63,.22); border-color: rgba(255,210,63,.6); }
.touch-actions .grab { margin-bottom: 4%; }
.touch-pause {
  position: absolute; right: 1.5%; top: 1.5%; width: 5.6%; aspect-ratio: 1;
  border-radius: 4px; font-size: 1.2cqw;
}
body.touch-mode .hud { padding-bottom: 3.4cqw; }
body.touch-mode .toast { bottom: 30%; }

/* ————— manual ————— */
.manual {
  display: grid; grid-template-columns: 1.05fr 1.25fr 1fr; gap: 24px;
  margin-top: 26px; padding: 22px 4px 6px;
  border-top: 1px solid var(--line);
}
.manual-block { min-width: 0; }
.manual-kicker {
  display: block; margin-bottom: 12px;
  font-size: 9px; letter-spacing: .22em; color: var(--cyan);
}
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.keys div { display: flex; align-items: center; gap: 8px; font-family: var(--cn); font-size: 11px; color: #b3a7c0; }
.keys kbd { flex: 0 0 auto; }
.tips-block ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.tips-block li { position: relative; padding-left: 13px; font-family: var(--cn); font-size: 11px; line-height: 1.6; color: #b3a7c0; }
.tips-block li::before { content: "▸"; position: absolute; left: 0; top: 0; color: var(--pink); }
.tips-block b { color: #eee5d7; font-weight: 600; }
.credits-block p { margin: 0 0 9px; font-family: var(--cn); font-size: 10.5px; line-height: 1.7; color: #a99bbb; }
.credits-block .fineprint { font-size: 9px; color: #71657f; }
.page-footer {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding: 14px 4px 0;
  border-top: 1px solid rgba(255,255,255,.05);
  font-size: 8px; letter-spacing: .16em; color: #61566e;
}


/* ————— cover / difficulty / boss talk ————— */
.cover-ribbon {
  display: inline-flex; align-items: center; gap: .55cqw;
  margin-bottom: .9cqw; padding: .3cqw .75cqw;
  border-left: 2px solid var(--yellow);
  background: rgba(255,210,63,.08);
  font-family: var(--mono); font-size: max(8px, .55cqw);
  letter-spacing: .18em; color: var(--yellow);
}
.cover-ribbon span { color: var(--pink); }
.cover-next {
  margin-top: .75cqw;
  font-family: var(--mono); font-size: max(8px, .5cqw);
  letter-spacing: .22em; color: #8d7f9b;
}
.cover-next::before { content: "▸"; color: var(--cyan); margin-right: .45cqw; }

.difficulty-screen {
  display: flex; flex-direction: column; justify-content: center;
  padding: 2.3cqw 3.6cqw 1.8cqw; gap: 1.1cqw;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(255,210,63,.1), transparent 55%),
    linear-gradient(180deg, rgba(4,2,10,.88), rgba(4,2,10,.95));
  backdrop-filter: blur(4px);
}
.difficulty-head { text-align: center; flex: 0 0 auto; }
.difficulty-head .eyebrow { justify-content: center; font-size: .62cqw; }
.difficulty-head h2 {
  margin: .35cqw 0 .18cqw;
  font-family: var(--display); font-size: 3.2cqw; letter-spacing: .04em;
  color: var(--paper); text-shadow: .18cqw .18cqw 0 rgba(255,46,99,.45);
}
.difficulty-head p {
  margin: 0; font-family: var(--cn); font-size: max(9px, .84cqw);
  color: var(--muted); letter-spacing: .06em;
}
.difficulty-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.15cqw;
  flex: 1 1 auto; min-height: 0;
}
.difficulty-card {
  --diff-color: var(--yellow);
  --diff-bg: none;
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  padding: 1.05cqw 1.2cqw; text-align: left; cursor: pointer;
  border: 1px solid rgba(244,236,220,.16);
  background-color: #090610;
  background-image:
    linear-gradient(180deg, rgba(4,2,10,.5) 0%, rgba(4,2,10,.16) 30%, rgba(4,2,10,.68) 62%, rgba(4,2,10,.94) 100%),
    linear-gradient(160deg, color-mix(in srgb, var(--diff-color) 12%, transparent), transparent 42%, rgba(9,6,16,.6) 100%),
    var(--diff-bg);
  background-size: cover;
  background-position: center, center, center 32%;
  background-repeat: no-repeat;
  color: var(--paper);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  overflow: hidden;
}
.difficulty-card[data-diff="easy"] { --diff-color: #57e389; --diff-bg: url("images/difficulty-easy.webp"); }
.difficulty-card[data-diff="normal"] { --diff-color: var(--yellow); --diff-bg: url("images/difficulty-normal.webp"); }
.difficulty-card[data-diff="hard"] { --diff-color: #ff5b6b; --diff-bg: url("images/difficulty-hard.webp"); }
.difficulty-card:hover, .difficulty-card.selected {
  transform: translateY(-.18cqw);
  border-color: var(--diff-color);
  box-shadow: 0 .7cqw 2cqw rgba(0,0,0,.5), 0 0 1.8cqw color-mix(in srgb, var(--diff-color) 25%, transparent);
}
.diff-index {
  position: absolute; right: .7cqw; top: .25cqw;
  font-family: var(--display); font-size: 3cqw; line-height: 1;
  color: rgba(255,255,255,.09);
}
.diff-tag {
  font-family: var(--mono); font-size: max(8px, .56cqw);
  letter-spacing: .2em; color: var(--diff-color);
}
.diff-name {
  margin-top: .22cqw;
  font-family: var(--display); font-size: max(14px, 1.75cqw); line-height: 1.05;
}
.diff-name em {
  display: block; margin-top: .18cqw;
  font-family: var(--mono); font-style: normal;
  font-size: max(7px, .44cqw); letter-spacing: .14em; color: #8f819e;
}
.diff-role {
  margin-top: .3cqw; font-family: var(--cn);
  font-size: max(8px, .62cqw); color: #cbbfd7; letter-spacing: .1em;
}
.diff-badge {
  position: absolute; right: .8cqw; top: 2.3cqw;
  padding: .12cqw .38cqw; border: 1px solid rgba(255,210,63,.5);
  color: var(--yellow); font-family: var(--cn); font-size: max(7px, .48cqw);
}
.diff-stats {
  width: 100%; margin-top: .7cqw; padding-top: .55cqw;
  border-top: 1px solid rgba(255,255,255,.09);
  display: grid; gap: .26cqw;
}
.diff-stats div { display: flex; align-items: center; justify-content: space-between; gap: .5cqw; }
.diff-stats span { font-family: var(--cn); font-size: max(8px, .56cqw); color: #9d90ac; }
.diff-stats b { font-family: var(--mono); font-weight: 700; font-size: max(9px, .68cqw); color: var(--diff-color); }
.diff-desc {
  margin: auto 0 0; padding-top: .55cqw;
  font-family: var(--cn); font-size: max(9px, .64cqw); line-height: 1.5;
  color: #b7aac5;
}
.difficulty-footer { padding-top: .1cqw; }

.pause-diff {
  margin: .2cqw 0 .7cqw; padding: .35cqw .6cqw;
  border-left: 2px solid var(--yellow);
  font-family: var(--cn); font-size: max(8px, .66cqw); color: #b7aac5;
  letter-spacing: .08em;
}
.pause-diff b { color: var(--yellow); font-family: var(--mono); font-size: .9em; }
.select-difficulty {
  display: inline-block; margin-top: .45cqw !important;
  padding: .18cqw .55cqw; border: 1px solid rgba(255,210,63,.28);
  color: var(--yellow) !important; font-family: var(--mono) !important;
  font-size: max(8px, .52cqw) !important; letter-spacing: .16em;
}

.boss-talk {
  position: absolute; z-index: 19; left: 50%; bottom: 4.5%;
  transform: translateX(-50%);
  width: min(84cqw, 640px); min-width: 280px;
  display: flex; align-items: stretch; gap: 1cqw;
  padding: .9cqw 1.1cqw;
  background:
    linear-gradient(90deg, rgba(255,46,99,.12), transparent 28%),
    rgba(4,2,10,.92);
  border: 1px solid rgba(255,210,63,.46);
  box-shadow: 0 1cqw 3cqw rgba(0,0,0,.62), inset 0 0 2cqw rgba(255,46,99,.08);
  pointer-events: auto;
}
.boss-talk::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan));
}
#boss-talk-portrait {
  width: 7.8cqw; height: 9.1cqw; min-width: 74px; min-height: 88px;
  flex: 0 0 auto; display: block;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,46,99,.16), transparent 68%), #0b0710;
  border: 1px solid rgba(255,255,255,.16);
  image-rendering: pixelated;
}
.boss-talk-body { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.boss-talk-top { display: flex; align-items: baseline; gap: .6cqw; flex-wrap: wrap; }
.boss-talk-kicker {
  font-family: var(--mono); font-size: max(7px, .46cqw);
  letter-spacing: .18em; color: #ff9f9f;
}
.boss-talk-top b {
  font-family: var(--display); font-size: max(12px, 1.18cqw);
  letter-spacing: .05em; color: var(--yellow);
}
.boss-talk-top em {
  font-family: var(--cn); font-style: normal; font-size: max(8px, .58cqw);
  letter-spacing: .08em; color: #b9adc7;
}
#boss-talk-text {
  margin: .35cqw 0 .45cqw;
  font-family: var(--cn); font-size: max(10px, .82cqw); line-height: 1.55;
  color: #f0e8dc; letter-spacing: .04em; min-height: 3.1em;
}
.boss-talk-foot { display: flex; align-items: center; gap: .8cqw; margin-top: auto; }
#boss-talk-progress {
  font-family: var(--mono); font-size: max(8px, .52cqw);
  letter-spacing: .12em; color: #9b8da9;
}
.boss-talk-hint {
  font-family: var(--cn); font-size: max(8px, .5cqw);
  color: #766a84; letter-spacing: .06em;
}
#boss-talk-skip {
  margin-left: auto; pointer-events: auto;
  padding: .32cqw .7cqw; font-size: max(8px, .58cqw);
}
.ghost-btn.small { padding: .3cqw .7cqw; }

/* ————— animations ————— */
@keyframes titleIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes stageIn { from { opacity: 0; transform: scale(.96); letter-spacing: .08em; } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes lowhp { 50% { opacity: .55; } }
@keyframes btnPulse { 0%,100% { box-shadow: 0 .35cqw 0 #a5163e, 0 1.2cqw 3cqw rgba(0,0,0,.4); } 50% { box-shadow: 0 .35cqw 0 #a5163e, 0 0 2.4cqw rgba(255,210,63,.35), 0 1.2cqw 3cqw rgba(0,0,0,.4); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cardFlash { 0% { filter: brightness(2.2); } 100% { filter: none; } }

/* selected card flash when confirming */
.char-card.confirmed { animation: cardFlash .35s steps(2) 2; }

@media (max-width: 980px) {
  .page { width: calc(100% - 20px); padding-top: 12px; }
  .topbar { padding-bottom: 10px; }
  .manual { grid-template-columns: 1fr 1fr; gap: 18px; }
  .credits-block { grid-column: 1 / -1; }
  .title-content { left: 5.5cqw; width: 64%; }
  .title-stamp { display: none; }
}

@media (max-width: 700px) {
  .page { width: calc(100% - 12px); padding-bottom: 16px; }
  .topbar { gap: 10px; }
  .brand-mark { width: 36px; height: 36px; font-size: 18px; box-shadow: 3px 3px 0 rgba(255,46,99,.75); }
  .topbar-copy strong { font-size: 13px; }
  .topbar-copy em, .topbar-kicker { display: none; }
  .utility-btn { padding: 7px 8px; font-size: 9px; }
  .cabinet { padding: 6px 6px 4px; border-radius: 10px; }
  .cabinet-topline, .cabinet-footer { display: none; }
  .screen { border-radius: 5px; }
  .manual { grid-template-columns: 1fr; gap: 18px; padding-top: 16px; margin-top: 18px; }
  .credits-block { grid-column: auto; }
  .page-footer { display: none; }
  .manual { padding-left: 2px; padding-right: 2px; }
  .select-head p, .char-desc, .select-help { display: none; }
  .select-footer { justify-content: flex-end; }
  .char-grid { gap: .8cqw; }
  .char-card { padding: .8cqw; }
  .char-preview { height: 16cqw; }
  .title-content { top: 8%; left: 5.5cqw; width: 68%; }
  .title-meta { display: none; }
  .title-ticker { font-size: .7cqw; }
  .modal-card, .result-card { width: 78%; padding: 3cqw; }
  .pause-controls { grid-template-columns: 1fr; gap: .4cqw; }
  .pause-controls div:nth-child(n+4) { display: none; }
  .result-stats { grid-template-columns: repeat(2, 1fr); gap: .6cqw; }
  .result-stats > div:nth-child(2) { border-right: 0; }
  .result-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); padding-bottom: .4cqw; }
}


@media (max-width: 700px) {
  .cover-ribbon { margin-bottom: .55cqw; padding: .2cqw .5cqw; font-size: max(7px, .95cqw); }
  .cover-next { font-size: max(7px, .9cqw); margin-top: .45cqw; }
  .title-copy { font-size: max(8px, 1.5cqw); margin: .8cqw 0 1cqw; }
  .difficulty-screen { padding: 1.6cqw 1.4cqw 1.1cqw; gap: .55cqw; }
  .difficulty-head .eyebrow { font-size: .9cqw; }
  .difficulty-head h2 { margin: .2cqw 0 .1cqw; font-size: 4cqw; }
  .difficulty-head p { display: none; }
  .difficulty-grid { gap: .55cqw; }
  .difficulty-card { padding: .55cqw .6cqw; }
  .diff-index { display: none; }
  .diff-tag { font-size: max(7px, .9cqw); }
  .diff-name { margin-top: .1cqw; font-size: max(9px, 2.2cqw); }
  .diff-name em { display: none; }
  .diff-role, .diff-badge, .diff-desc { display: none; }
  .diff-stats { margin-top: .35cqw; padding-top: .3cqw; gap: .12cqw; }
  .diff-stats span { font-size: max(7px, .92cqw); }
  .diff-stats b { font-size: max(7px, 1.02cqw); }
  .difficulty-footer { padding-top: 0; }
  .difficulty-footer .select-help { display: none; }
  .difficulty-footer .select-buttons { margin-left: auto; }
  .select-difficulty { font-size: max(7px, .9cqw) !important; margin-top: .2cqw !important; }
  .pause-diff { font-size: max(8px, 1.5cqw); }
  .boss-talk { width: 94%; bottom: 3%; padding: .7cqw .8cqw; gap: .7cqw; }
  #boss-talk-portrait { width: 12cqw; height: 14cqw; min-width: 52px; min-height: 62px; }
  #boss-talk-text { margin: .2cqw 0 .3cqw; font-size: max(9px, 1.3cqw); line-height: 1.42; min-height: 2.7em; }
  .boss-talk-kicker { font-size: max(6px, .82cqw); }
  .boss-talk-top b { font-size: max(10px, 2.4cqw); }
  .boss-talk-top em, .boss-talk-hint { display: none; }
  .boss-talk-foot { gap: .5cqw; }
  #boss-talk-progress { font-size: max(7px, .9cqw); }
  #boss-talk-skip { font-size: max(7px, 1cqw); padding: .2cqw .5cqw; }
}
@media (hover: none) and (pointer: coarse) {
  .manual { margin-top: 16px; }
  .hud-name-row b { font-size: 1.7cqw; }
  .hud-lives { font-size: max(9px, 1.1cqw); }
  .hud-subrow { font-size: max(10px, 1.2cqw); }
  .hud-center > span { font-size: max(9px, 1.05cqw); }
  .hud-center > div { font-size: max(9px, .9cqw); }
  .hud-score span, .hud-combo span { font-size: max(9px, .9cqw); }
  .hud-score b { font-size: max(12px, 1.55cqw); }
  .hud-combo b { font-size: max(11px, 1.4cqw); }
  .hud-vitals { min-width: 18cqw; }
  .hud-right { margin-right: 7.4cqw; }
  .select-help { display: none !important; }
  body.touch-mode .select-footer { justify-content: flex-end; }
  .toast { font-size: max(10px, 1.3cqw); bottom: 27%; }
  .boss-ui { top: 7.2cqw; width: 48cqw; }
  .boss-ui-head span { font-size: max(10px, .95cqw); }
  .boss-ui-head b { font-size: max(11px, 1.25cqw); }
  .char-tag { font-size: max(8px, .95cqw); }
  .char-name { font-size: 2.5cqw; }
  .char-name em { font-size: max(9px, 1.15cqw); }
  .char-role { font-size: max(8px, 1.05cqw); }
  .char-desc { display: none; }
  .char-trait { display: block !important; font-family: var(--cn); font-size: max(8px, 1.02cqw); letter-spacing: .04em; color: #d9cde5; margin-top: .7cqw; }
  .stat-row { margin-top: .7cqw; gap: .65cqw; }
  .stat-row > span { width: max(12px, 1.15cqw); font-size: max(9px, 1.08cqw); color: #e2d6ee; }
  .stat-track { height: max(5px, .8cqw); }
  .char-preview { height: 17.5cqw; }
  .select-head h2 { font-size: 3.7cqw; }
  .select-head p { font-size: max(9px, 1.2cqw); }
  .arcade-btn.compact { min-height: 40px; padding: .9cqw 2.6cqw .95cqw 1.3cqw; }
  .ghost-btn { min-height: 40px; }
  .touch-pause { min-width: 40px; min-height: 40px; }
}

@media (orientation: portrait) and (max-width: 900px) {
  body.touch-mode .rotate-hint { display: block; }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  body.touch-mode { overflow: hidden; }
  body.touch-mode .page {
    width: 100%;
    height: 100dvh;
    padding: 0;
    margin: 0;
  }
  body.touch-mode .topbar,
  body.touch-mode .manual,
  body.touch-mode .page-footer,
  body.touch-mode .cabinet-topline,
  body.touch-mode .cabinet-footer {
    display: none;
  }
  body.touch-mode .cabinet {
    height: 100dvh;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    box-shadow: none;
  }
  body.touch-mode .screen {
    width: min(100vw, calc(100dvh * 16 / 9));
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  body.touch-mode .rotate-hint { display: none !important; }
}

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