:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --ink: #111118;
  --paper: #fff4cf;
  --cream: #f4dfaa;
  --red: #e8342f;
  --yellow: #ffd92f;
  --blue: #38c8f4;
  --muted: #5f5b5b;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #111118; color: var(--ink); }
body { display: grid; place-items: center; }
button, select { font: inherit; }
#app {
  width: 100vw; height: 100vh; height: 100dvh; position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, transparent 0 18%, #e9363217 18.3% 20%, transparent 20.3%),
    repeating-conic-gradient(from -8deg at 50% 48%, #fff1c7 0 5deg, #edc970 5deg 8deg, #fff1c7 8deg 13deg);
}
#app[data-aspect="portrait"] { width: min(100vw, 56.25vh); width: min(100vw, 56.25dvh); height: min(100vh, 177.78vw); height: min(100dvh, 177.78vw); }
#app[data-aspect="landscape"] { width: min(100vw, 177.78vh); width: min(100vw, 177.78dvh); height: min(100vh, 56.25vw); height: min(100dvh, 56.25vw); }
#app[data-aspect="square"] { width: min(100vw, 100vh); width: min(100vw, 100dvh); height: min(100vw, 100vh); height: min(100vw, 100dvh); }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.manga-burst { pointer-events: none; position: absolute; inset: 0; z-index: 2; opacity: .13; background: repeating-conic-gradient(from 2deg at 50% 52%, transparent 0 3.4deg, #111118 3.5deg 3.9deg, transparent 4deg 8deg); mix-blend-mode: multiply; }
.ink-frame { pointer-events: none; position: absolute; z-index: 31; inset: 0; border: clamp(5px, .7vw, 12px) solid #111118; box-shadow: inset 0 0 0 4px var(--yellow); }
.ink-frame b { position: absolute; right: 17px; bottom: 11px; color: #111118; font: 1000 clamp(28px, 5vw, 64px) Impact, sans-serif; opacity: .16; }
.scanlines { pointer-events: none; position: absolute; inset: 0; opacity: .12; z-index: 30; background-image: radial-gradient(#111118 1px, transparent 1.5px); background-size: 6px 6px; mix-blend-mode: multiply; }

.panel {
  position: absolute; z-index: 20; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-.2deg);
  width: min(820px, calc(100% - 64px)); max-height: calc(100% - 40px); overflow: auto; padding: 38px;
  border: 7px solid var(--ink); color: var(--ink);
  background:
    linear-gradient(135deg, transparent 0 96%, var(--red) 96%),
    radial-gradient(circle, #18181e20 0 1px, transparent 1.5px) 0 0/8px 8px,
    var(--paper);
  box-shadow: 14px 14px 0 #111118, 20px 20px 0 #e8342f;
  clip-path: polygon(17px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 17px);
  scrollbar-color: var(--red) var(--cream);
}
.panel::before { content: ""; position: absolute; z-index: -1; top: 0; right: 0; width: 28%; height: 14px; background: var(--yellow); border-left: 5px solid var(--ink); border-bottom: 5px solid var(--ink); }
.menu-panel { width: min(720px, calc(100% - 64px)); text-align: center; padding-top: 22px; background: radial-gradient(circle at 50% 38%, #fffbe9 0 18%, transparent 45%), repeating-conic-gradient(from 0deg at 50% 38%, #fff1c7 0 7deg, #ffd92f 7deg 10deg, #fff1c7 10deg 17deg); }
.compact { width: min(500px, calc(100% - 50px)); text-align: center; }
.eyebrow { display: inline-block; margin: 0 0 7px; padding: 4px 10px; color: #fff; background: var(--red); border: 3px solid var(--ink); letter-spacing: .17em; font: italic 1000 12px Impact, "Arial Black", sans-serif; transform: skewX(-7deg); }
.main-logo { display: block; width: min(100%, 610px); margin: -12px auto -34px; filter: saturate(.8) contrast(1.45) drop-shadow(5px 6px 0 #111118); }
h2 { margin: 0 0 24px; color: #fff9dc; font: italic 1000 clamp(38px, 6vw, 68px)/.9 Impact, "Arial Black", sans-serif; letter-spacing: -.025em; -webkit-text-stroke: 2px var(--ink); text-shadow: 5px 5px 0 var(--red), 8px 8px 0 var(--ink); text-transform: uppercase; }
.lede { margin: 30px 0 22px; color: var(--ink); font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .05em; }
.legal { color: #70685c; font-size: 10px; font-weight: 700; margin: 22px 0 0; }
button {
  display: block; width: 100%; margin-top: 12px; padding: 13px 20px; cursor: pointer;
  border: 4px solid var(--ink); color: var(--ink); background: #fff8df;
  box-shadow: 5px 5px 0 var(--ink); font: italic 1000 15px Impact, "Arial Black", sans-serif; letter-spacing: .1em;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}
button:hover, button:focus-visible { transform: translate(-2px, -2px) rotate(-.6deg); box-shadow: 8px 8px 0 var(--ink); background: var(--yellow); outline: none; }
button:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
button.primary { color: #fff; background: var(--red); text-shadow: 2px 2px 0 var(--ink); }
button.primary:hover { color: var(--ink); background: var(--yellow); text-shadow: none; }
.boss-mode-button { color: #fff; background: #2b172f; border-color: var(--ink); box-shadow: 5px 5px 0 var(--red); text-shadow: 2px 2px 0 #000; }
.boss-mode-button:hover { color: #fff; background: #8c2741; }

.panel-heading { text-align: center; }
.selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.format-selector { max-width: 400px; margin: 18px auto 0; }
label { display: block; color: var(--ink); font: italic 1000 12px Impact, "Arial Black", sans-serif; letter-spacing: .14em; }
select { width: 100%; margin-top: 7px; padding: 12px; color: var(--ink); border: 4px solid var(--ink); border-radius: 0; background: #fff9e8; box-shadow: 4px 4px 0 var(--red); font-weight: 800; }
select:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.record-option {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  max-width: 520px; margin: 18px auto 0; padding: 12px 14px; cursor: pointer;
  border: 4px solid var(--ink); background: #fff9e8; box-shadow: 5px 5px 0 var(--ink);
}
.record-option input { position: absolute; opacity: 0; pointer-events: none; }
.record-check { width: 28px; height: 28px; border: 4px solid var(--ink); background: #fff; }
.record-option input:checked + .record-check { background: var(--red); box-shadow: inset 0 0 0 5px #fff; }
.record-option input:focus-visible + .record-check { outline: 3px solid var(--blue); outline-offset: 2px; }
.record-option > span:nth-of-type(2) { min-width: 0; }
.record-option strong { display: block; color: var(--ink); font: italic 1000 15px Impact, "Arial Black", sans-serif; letter-spacing: .08em; }
.record-option small { display: block; margin-top: 2px; color: #5b5751; font: 700 10px Arial, sans-serif; letter-spacing: 0; }
.record-option > b { padding: 5px 7px; color: #fff; background: var(--red); border: 3px solid var(--ink); font: italic 1000 13px Impact, sans-serif; }
.record-option:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.record-status, .record-result { min-height: 14px; margin: 9px 0 0; text-align: center; color: #5f5a52; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.record-status[data-state="error"], .record-result[data-state="error"] { color: #b21f24; }
.record-status[data-state="saved"], .record-result[data-state="saved"] { color: #148449; }

.character-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 25px 0; }
.fighter-card {
  position: relative; min-height: 165px; padding: 16px; overflow: hidden; border: 5px solid var(--ink);
  background: linear-gradient(115deg, color-mix(in srgb, var(--fighter-color, #ddd) 26%, #fff7d9), #fff7d9 60%);
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--fighter-color, #e8342f) 70%, #111118);
}
.fighter-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12; background: repeating-linear-gradient(-48deg, transparent 0 10px, #111 11px 13px); }
.fighter-card h3 { position: relative; margin: 1px 0 4px; font: italic 1000 28px/.95 Impact, "Arial Black", sans-serif; text-transform: uppercase; letter-spacing: .01em; }
.series-title { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 4px); margin: 2px 0 7px; padding: 4px 8px; color: #fff9df; background: var(--ink); border-left: 6px solid var(--fighter-color, var(--red)); font: italic 1000 11px/1.1 Impact, "Arial Black", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.series-title span { color: var(--yellow); font-size: 8px; letter-spacing: .12em; }
.fighter-card small { position: relative; color: color-mix(in srgb, var(--fighter-color, var(--red)) 70%, #111); font-weight: 1000; text-transform: uppercase; }
.fighter-card p { position: relative; color: #504b45; font-size: 12px; font-weight: 650; line-height: 1.42; }
.fighter-portrait { position: relative; display: block; width: 118px; height: 118px; float: right; margin: -5px -5px 7px 9px; filter: drop-shadow(5px 6px 0 #11111870); }
.kit-list { position: relative; clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; padding: 11px 0 0; margin: 11px 0 0; border-top: 3px solid var(--ink); list-style: none; color: #242126; font-size: 10px; font-weight: 800; }
.kit-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit-list em { display: inline-block; min-width: 52px; color: #8d342f; font-size: 8px; font-style: normal; font-weight: 1000; text-transform: uppercase; }
.type-guide { margin: 0 0 16px; border: 4px solid var(--ink); background: #fff8df; box-shadow: 5px 5px 0 var(--ink); }
.type-guide summary { padding: 11px 14px; cursor: pointer; color: #fff; background: var(--red); font: italic 1000 11px Impact, "Arial Black", sans-serif; letter-spacing: .13em; text-shadow: 2px 2px 0 #111; }
#type-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: var(--ink); border-top: 3px solid var(--ink); }
#type-list article { min-height: 115px; padding: 12px; background: #fff4d2; }
#type-list strong { color: var(--ink); text-transform: uppercase; font: italic 1000 13px Impact, "Arial Black", sans-serif; }
#type-list p { min-height: 43px; margin: 6px 0; color: #5a554e; font-size: 10px; font-weight: 650; line-height: 1.35; }
#type-list small { color: #b52c29; font-size: 9px; font-weight: 900; line-height: 1.3; }
.simulation-note { color: #504b43; text-align: center; font: italic 1000 10px Impact, "Arial Black", sans-serif; letter-spacing: .13em; margin: 4px 0 17px; }
.actions { display: grid; grid-template-columns: 1fr 2fr; gap: 13px; }
.boss-select-panel { width: min(900px, calc(100% - 64px)); }
.boss-config { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.boss-preview { position: relative; display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 20px; margin: 22px 0; padding: 14px 20px; color: #fff7df; background: #1a121d; border: 5px solid var(--ink); box-shadow: 7px 7px 0 var(--red); overflow: hidden; }
.boss-preview::before { content: 'WARNING'; position: absolute; right: 8%; color: #fff1; font: italic 1000 76px Impact, sans-serif; transform: rotate(-7deg); }
.boss-portrait { position: relative; width: 170px !important; height: 170px !important; filter: drop-shadow(6px 7px 0 #000); }
.boss-preview div { position: relative; z-index: 1; }
.boss-preview span { color: var(--yellow); font: italic 1000 11px Impact, sans-serif; letter-spacing: .15em; text-transform: uppercase; }
.boss-preview h3 { margin: 2px 0; color: #fff; font: italic 1000 clamp(32px, 5vw, 56px)/.9 Impact, sans-serif; text-transform: uppercase; text-shadow: 4px 4px 0 var(--red); }
.boss-preview strong { color: #fa6a5e; font: italic 1000 16px Impact, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.boss-preview p { margin: 8px 0 0; color: #d8ccbf; font-size: 12px; font-weight: 700; line-height: 1.4; }
.raid-fighter-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; padding: 15px; border: 4px solid var(--ink); background: #edcf87; }

.boss-hud { pointer-events: none; position: absolute; z-index: 11; inset: 14px 24px auto; }
.boss-banner { position: relative; width: min(780px, 76%); margin: 0 auto; padding: 8px 14px 13px; color: #fff; background: #171119eb; border: 5px solid #111118; outline: 3px solid var(--red); box-shadow: 7px 7px 0 #111; transform: skewX(-3deg); }
.boss-banner > div:first-child { display: flex; align-items: baseline; justify-content: center; gap: 11px; }
#boss-series { padding: 3px 7px; color: #111; background: var(--yellow); font: italic 1000 9px Impact, sans-serif; letter-spacing: .1em; }
#boss-name { font: italic 1000 clamp(22px, 3.4vw, 42px)/1 Impact, sans-serif; text-transform: uppercase; text-shadow: 3px 3px 0 var(--red); }
#boss-title { color: #f37868; font: italic 1000 11px Impact, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.boss-phase { padding: 3px 7px; color: #171119; background: #d8bd72; border: 2px solid #fff4d7; font: italic 1000 10px Impact, sans-serif; letter-spacing: .08em; white-space: nowrap; }
.boss-phase.full-power { color: #fff; background: #a62e3b; animation: bossPhasePulse .72s steps(2, end) infinite; }
.boss-hud.full-power .boss-banner { outline-color: #a62e3b; box-shadow: 7px 7px 0 #111, 0 0 26px #a62e3b77; }
.boss-meter { position: relative; height: 24px; overflow: hidden; margin-top: 5px; background: #3c1721; border: 4px solid #fff4d7; }
.boss-meter i, .boss-meter b { position: absolute; inset: 0; transform-origin: left; transition: transform .12s linear; }
.boss-meter i { z-index: 2; background: linear-gradient(90deg, #e92f37, #ff783d, #ffe13b); }
.boss-meter b { z-index: 1; background: #fff; transition-duration: .6s; }
.boss-phase-cut { position: absolute; z-index: 3; top: 0; bottom: 0; left: 50%; width: 5px; background: #111118; box-shadow: 0 0 0 2px #fff4d788; transform: translateX(-50%); }
@keyframes bossPhasePulse { 50% { filter: brightness(1.3); transform: scale(1.04); } }
#boss-health-label { display: block; margin-top: 3px; color: #f4d7c7; text-align: center; font: 900 9px Arial, sans-serif; letter-spacing: .12em; }
.raid-team-hud { position: absolute; top: 0; left: 0; display: grid; width: min(245px, 24%); gap: 5px; }
.raid-member { padding: 5px 7px; background: #fff4d9e8; border: 3px solid #111; box-shadow: 3px 3px 0 #111; transform: skewX(-4deg); }
.raid-member strong { display: block; overflow: hidden; font: italic 1000 12px Impact, sans-serif; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.raid-member > span { display: block; height: 8px; overflow: hidden; background: #5b2027; border: 2px solid #111; }
.raid-member i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #4ad774, #f2e73a); transform-origin: left; }
.raid-member small { display: block; min-height: 9px; margin-top: 2px; color: #8d2829; font: italic 1000 7px Impact, sans-serif; letter-spacing: .06em; }
.raid-member.ko { filter: grayscale(1); opacity: .55; }
.raid-clock { position: absolute; top: 0; right: 0; width: min(145px, 15%); padding: 8px; color: #fff; text-align: center; background: #111118; border: 4px solid var(--yellow); transform: rotate(1deg); }
.raid-clock span { display: block; color: var(--yellow); font: italic 1000 9px Impact, sans-serif; letter-spacing: .12em; }
.raid-clock strong { display: block; font: italic 1000 36px/.9 Impact, sans-serif; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.control-grid > div { background: #fff9e6; border: 4px solid var(--ink); padding: 17px; box-shadow: 5px 5px 0 var(--red); }
.control-grid strong { font: italic 1000 19px Impact, "Arial Black", sans-serif; }
.control-grid p, .how-panel > p:not(.eyebrow) { color: #504c46; font-weight: 650; line-height: 1.55; }

.hud { pointer-events: none; position: absolute; z-index: 10; inset: 18px 28px auto; display: grid; grid-template-columns: 1fr 190px 1fr; gap: 17px; filter: drop-shadow(6px 7px 0 #111118); }
.player-hud { min-width: 0; padding: 8px 10px 10px; border: 5px solid var(--ink); background: #fff3cfe8; transform: skewX(-5deg); }
.p2-hud { text-align: right; transform: skewX(5deg); }
.identity { display: flex; justify-content: space-between; align-items: center; height: 44px; gap: 10px; overflow: visible; }
.identity strong { min-width: 0; overflow: visible; color: var(--ink); font: italic 1000 34px/.9 Impact, "Arial Black", sans-serif; letter-spacing: .005em; white-space: nowrap; text-transform: uppercase; -webkit-text-stroke: .35px currentColor; }
.identity strong.long-name { letter-spacing: -.015em; }
.player-chip { flex: none; padding: 5px 9px 4px; color: var(--ink); background: var(--class-color, var(--blue)); border: 3px solid var(--ink); font: italic 1000 13px/.95 Impact, "Arial Black", sans-serif; letter-spacing: .055em; }
.meter { height: 20px; position: relative; overflow: hidden; border: 4px solid var(--ink); background: #5d2026; }
.meter i, .meter b { position: absolute; inset: 0; transform-origin: left; transition: transform .12s linear; }
.p2-hud .meter i, .p2-hud .meter b { transform-origin: right; }
.health i { z-index: 2; background: linear-gradient(90deg, #53dd73, #f3ef38); }
.health b { z-index: 1; background: var(--red); transition-duration: .5s; }
.energy { height: 11px; margin-top: 4px; border-width: 3px; background: #262536; }
.energy i { background: var(--blue); }
.p2-hud .energy i { background: #fc8745; }
.match-hud { align-self: start; padding: 7px 8px 8px; text-align: center; color: #fff7da; background: var(--ink); border: 4px solid #fff6d9; outline: 5px solid var(--ink); font-weight: 1000; transform: rotate(-1deg); }
#round-label { font: italic 1000 12px Impact, sans-serif; letter-spacing: .15em; color: var(--yellow); }
#timer { font: italic 1000 50px/.82 Impact, "Arial Black", sans-serif; }
#score { display: flex; align-items: center; justify-content: center; gap: 9px; height: 24px; font: italic 1000 22px Impact, sans-serif; }
#score b { min-width: 16px; }
#p1-score { color: var(--p1-class-color, var(--blue)); }
#p2-score { color: var(--p2-class-color, #ff7745); }
#score span { color: #fff3d0; font-size: 15px; }
.score-caption { margin-top: 1px; color: #e6d9b9; font: 1000 7px Arial, sans-serif; letter-spacing: .18em; }
.score-pop { animation: score-pop .3s ease-out; }
.status { height: 17px; padding-top: 3px; color: #b32928; font: italic 1000 10px Impact, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.p2-hud .status { color: #2d6d89; }

.announcement { position: absolute; z-index: 15; inset: 0; display: grid; place-items: center; pointer-events: none; }
.announcement span { padding: 6px 32px; color: var(--yellow); font: italic 1000 clamp(58px, 12vw, 140px)/.8 Impact, "Arial Black", sans-serif; letter-spacing: -.03em; -webkit-text-stroke: 4px var(--ink); text-shadow: 9px 9px 0 var(--red), 14px 14px 0 var(--ink); animation: slam .26s cubic-bezier(.2, 1.4, .3, 1); }
.spectator-tools { position: absolute; z-index: 13; left: 50%; bottom: 15px; transform: translateX(-50%) rotate(-.5deg); display: flex; align-items: center; gap: 5px; padding: 5px; background: #fff4d8e8; border: 4px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.spectator-tools span { padding: 0 9px; color: var(--red); font: italic 1000 10px Impact, sans-serif; letter-spacing: .14em; }
.spectator-tools .recording-indicator { color: #fff; background: var(--red); padding: 5px 8px; animation: rec-pulse 1.1s infinite; }
.spectator-tools button { width: auto; min-width: 94px; padding: 6px 11px; margin: 0; border-width: 3px; box-shadow: 3px 3px 0 var(--ink); font-size: 10px; background: #fff; }
@keyframes slam { from { transform: scale(2.2) rotate(-6deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes score-pop { 50% { transform: scale(1.25) rotate(-4deg); } }
@keyframes rec-pulse { 50% { opacity: .45; } }

#app[data-aspect="portrait"] .panel { width: calc(100% - 26px); padding: 25px 17px; max-height: calc(100% - 28px); box-shadow: 8px 8px 0 #111, 12px 12px 0 var(--red); }
#app[data-aspect="portrait"] h2 { font-size: clamp(36px, 11cqw, 52px); overflow-wrap: anywhere; }
#app[data-aspect="portrait"] .selectors,
#app[data-aspect="portrait"] .character-preview,
#app[data-aspect="portrait"] .control-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
#app[data-aspect="portrait"] .fighter-card { min-width: 0; min-height: 115px; }
#app[data-aspect="portrait"] .kit-list { grid-template-columns: minmax(0, 1fr); }
#app[data-aspect="portrait"] #type-list { grid-template-columns: 1fr 1fr; }
#app[data-aspect="portrait"] .hud { inset: max(10px, env(safe-area-inset-top)) 9px auto; grid-template-columns: minmax(0, 1fr) 73px minmax(0, 1fr); gap: 5px; filter: drop-shadow(3px 4px 0 #111); }
#app[data-aspect="portrait"] .player-hud { padding: 5px; border-width: 3px; }
#app[data-aspect="portrait"] .identity { height: 36px; gap: 5px; }
#app[data-aspect="portrait"] .identity strong { font-size: 24px; }
#app[data-aspect="portrait"] .player-chip { padding: 3px 5px; border-width: 2px; font-size: 9px; }
#app[data-aspect="portrait"] .match-hud { padding: 5px 3px; border-width: 2px; outline-width: 3px; }
#app[data-aspect="portrait"] #round-label { font-size: 8px; }
#app[data-aspect="portrait"] #timer { font-size: 32px; }
#app[data-aspect="portrait"] .score-caption { display: none; }
#app[data-aspect="portrait"] .spectator-tools { bottom: max(9px, env(safe-area-inset-bottom)); }
#app[data-aspect="portrait"] .spectator-tools > span:first-child { display: none; }

@media (max-width: 720px) {
  .panel { width: calc(100% - 28px); padding: 25px 17px; max-height: calc(100% - 28px); box-shadow: 8px 8px 0 #111, 12px 12px 0 var(--red); }
  .hud { inset: max(10px, env(safe-area-inset-top)) 9px auto; grid-template-columns: 1fr 73px 1fr; gap: 5px; filter: drop-shadow(3px 4px 0 #111); }
  .player-hud { padding: 5px; border-width: 3px; }
  .identity { height: 36px; gap: 5px; }
  .identity strong { font-size: 24px; }
  .player-chip { padding: 3px 5px; border-width: 2px; font-size: 9px; }
  .match-hud { padding: 5px 3px; border-width: 2px; outline-width: 3px; }
  #round-label { font-size: 8px; }
  #timer { font-size: 32px; }
  .score-caption { display: none; }
  .control-grid, .selectors, .character-preview { grid-template-columns: 1fr; }
  #type-list { grid-template-columns: 1fr 1fr; }
  .fighter-card { min-height: 115px; }
  .kit-list { grid-template-columns: 1fr; }
  .record-option { grid-template-columns: 28px minmax(0, 1fr); }
  .record-option > b { display: none; }
  .boss-config, .raid-fighter-selects { grid-template-columns: 1fr; }
  .boss-preview { grid-template-columns: 110px 1fr; padding: 10px; }
  .boss-portrait { width: 105px !important; height: 105px !important; }
  .boss-preview h3 { font-size: 31px; }
  .boss-preview p { display: none; }
  .boss-hud { inset: 10px 8px auto; }
  .boss-banner { width: 70%; padding: 5px 7px 8px; }
  #boss-title, #boss-series { display: none; }
  .boss-phase { padding: 2px 4px; font-size: 7px; }
  #boss-name { font-size: 20px; }
  .boss-meter { height: 17px; border-width: 3px; }
  .raid-team-hud { width: 27%; gap: 3px; }
  .raid-member { padding: 3px; border-width: 2px; box-shadow: 2px 2px 0 #111; }
  .raid-member strong { font-size: 9px; }
  .raid-member small { display: none; }
  .raid-clock { width: 18%; padding: 4px 2px; border-width: 2px; }
  .raid-clock span { font-size: 6px; }
  .raid-clock strong { font-size: 27px; }
  .spectator-tools { bottom: max(9px, env(safe-area-inset-bottom)); }
  .spectator-tools > span:first-child { display: none; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .panel { padding: 17px 23px; }
  .main-logo { width: 390px; margin: -25px auto -38px; }
  .lede { margin: 10px 0; }
  .legal { margin-top: 9px; }
  .hud { top: 7px; }
  .spectator-tools { left: auto; right: 14px; transform: rotate(-.5deg); }
}

/* Low-glare night manga palette. */
:root {
  color-scheme: dark;
  --ink: #090a10;
  --paper: #181a24;
  --cream: #272838;
  --red: #a92e3b;
  --yellow: #b89a3e;
  --blue: #438ca5;
  --muted: #aaa7b1;
}
html, body { background: #05060a; color: #e9e5dc; }
#app {
  background:
    radial-gradient(circle at 50% 44%, transparent 0 18%, #8c2a3514 18.3% 20%, transparent 20.3%),
    repeating-conic-gradient(from -8deg at 50% 48%, #171923 0 5deg, #202130 5deg 8deg, #171923 8deg 13deg);
}
.manga-burst { opacity: .08; }
.ink-frame { border-color: #07080d; box-shadow: inset 0 0 0 3px #887337; }
.ink-frame b { color: #d7d1c4; opacity: .09; }
.scanlines { opacity: .04; }
.broadcast-mode .hud, .broadcast-mode .boss-hud { visibility: hidden; }
.view-settings { position: absolute; z-index: 40; bottom: 12px; left: 12px; max-width: min(380px, calc(100% - 24px)); padding: 0; color: #eee5d9; background: #191c28; border: 4px solid #080a10; box-shadow: 4px 4px 0 #07080d; font: 13px/1.4 Arial, sans-serif; }
.view-settings > summary { cursor: pointer; list-style: none; padding: 11px 18px; color: #f0e8d7; background: #812a35; font: italic 1000 18px Impact, 'Arial Black', sans-serif; letter-spacing: .06em; text-shadow: 2px 2px 0 #080a10; }
.view-settings > summary::-webkit-details-marker { display: none; }
.view-settings > summary::after { content: ' +'; margin-left: 12px; }
.view-settings[open] > summary::after { content: ' −'; }
.view-settings > summary:focus-visible { outline: 3px solid #d8c19a; outline-offset: 2px; }
.settings-body { width: min(348px, calc(100vw - 40px)); max-height: min(65dvh, 530px); overflow-y: auto; padding: 10px 14px 16px; }
.menu-panel .type-guide { margin-top: 14px; text-align: left; }
.view-settings label { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 9px; }
.view-settings input { accent-color: #9ab5d6; }
.view-settings input[type=range] { width: 110px; }
.view-settings small { display: block; max-width: 250px; color: #a8acbd; }
.view-settings select { font-size: 12px; padding: 3px; width: auto; }
#results { top: 50%; bottom: auto; left: 50%; transform: translate(-50%, -50%); width: min(700px, calc(100% - 36px)); max-height: calc(100% - 32px); overflow-y: auto; padding: clamp(20px, 4vw, 42px); text-align: center; }
#results h2 { font-size: clamp(40px, 7vw, 88px); line-height: 1.05; margin: 0 0 24px; overflow-wrap: anywhere; }
.panel {
  color: #e9e5dc;
  border-color: #090a10;
  background:
    linear-gradient(135deg, transparent 0 96%, #762732 96%),
    radial-gradient(circle, #d7d1c412 0 1px, transparent 1.5px) 0 0/8px 8px,
    #181a24;
  box-shadow: 14px 14px 0 #07080d, 20px 20px 0 #70242e;
}
.panel::before { background: #8d7736; border-color: #090a10; }
.menu-panel {
  background:
    radial-gradient(circle at 50% 38%, #2e3040 0 18%, transparent 45%),
    repeating-conic-gradient(from 0deg at 50% 38%, #181a24 0 7deg, #22232f 7deg 10deg, #181a24 10deg 17deg);
}
.main-logo { filter: saturate(.7) brightness(.78) contrast(1.25) drop-shadow(5px 6px 0 #05060a); }
.limit-clash-brand { display:flex; align-items:center; justify-content:center; gap:16px; margin:0 auto 16px; }
.limit-clash-brand img { width:clamp(64px,12vw,110px); height:auto; }
.limit-clash-brand strong { font:italic 900 clamp(28px,5.6vw,62px)/1 Impact, 'Arial Black', sans-serif; color:#f5ecda; -webkit-text-stroke:1px #080b17; text-shadow:3px 3px #080b17; }
#channel-home { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
#channel-home img { width:28px; height:28px; object-fit:contain; }
.lede, label { color: #ded9ce; }
.legal, .record-status, .record-result { color: #85828c; }
button { color: #e8e3d8; background: #242631; border-color: #090a10; box-shadow: 5px 5px 0 #07080d; }
button:hover, button:focus-visible { color: #f0ece3; background: #3a3440; box-shadow: 8px 8px 0 #07080d; }
button.primary { color: #f4eee3; background: #922c38; text-shadow: 2px 2px 0 #07080d; }
button.primary:hover { color: #f4eee3; background: #704736; }
.boss-mode-button { background: #241925; box-shadow: 5px 5px 0 #762632; }
select { color: #e7e2d8; background: #20222d; border-color: #090a10; box-shadow: 4px 4px 0 #762632; }
.record-option { color: #e9e5dc; background: #20222c; border-color: #090a10; box-shadow: 5px 5px 0 #07080d; }
.record-check { background: #30323d; border-color: #090a10; }
.record-option input:checked + .record-check { background: #9b303c; box-shadow: inset 0 0 0 5px #242630; }
.record-option strong { color: #eee9df; }
.record-option small { color: #a8a3aa; }
.fighter-card {
  color: #e8e3d9;
  border-color: #090a10;
  background: linear-gradient(115deg, color-mix(in srgb, var(--fighter-color, #333) 16%, #242631), #1b1d27 62%);
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--fighter-color, #762632) 45%, #090a10);
}
.fighter-card h3 { color: #eee9df; }
.fighter-card p, .control-grid p, .how-panel > p:not(.eyebrow) { color: #aaa6aa; }
.fighter-card small { color: color-mix(in srgb, var(--fighter-color, #aaa) 62%, #ded8ce); }
.series-title { color: #ded9ce; background: #0c0d13; }
.kit-list { color: #d1ccd0; border-color: #08090e; }
.kit-list em { color: #c06c6f; }
.type-guide { background: #20222c; border-color: #090a10; box-shadow: 5px 5px 0 #07080d; }
.type-guide summary { background: #812a35; color: #eee9df; text-shadow: 2px 2px 0 #07080d; }
#type-list { background: #090a10; border-color: #090a10; }
#type-list article { background: #20222c; }
#type-list strong { color: #eee9df; }
#type-list p { color: #a6a2a8; }
#type-list small { color: #c87872; }
.simulation-note { color: #97939e; }
.control-grid > div { background: #20222c; border-color: #090a10; box-shadow: 5px 5px 0 #762632; }
.raid-fighter-selects { background: #242631; border-color: #090a10; }
.player-hud { color: #ece7dc; background: #191b25e8; border-color: #08090e; }
.identity strong { color: #eee9df; }
.meter { border-color: #c9c4b9; background: #351820; }
.match-hud { color: #e9e4d9; background: #0c0d13; border-color: #bdb6a8; outline-color: #08090e; }
.spectator-tools { background: #181a24eb; border-color: #08090e; box-shadow: 5px 5px 0 #07080d; }
.spectator-tools button { background: #252732; color: #e8e3d9; }
.raid-member { color: #e9e4d9; background: #191b25e8; border-color: #08090e; box-shadow: 3px 3px 0 #07080d; }

/* Character select hierarchy: fighters first, production controls second. */
.select-panel { width: min(900px, calc(100% - 64px)); }
.select-panel .selectors { gap: 18px; }
.production-tools {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
  max-width: 570px;
  margin: 14px auto 2px;
  padding: 8px;
  border: 2px solid #090a10;
  background: #12141ced;
  box-shadow: 3px 3px 0 #090a10;
}
.production-tools .format-selector { max-width: none; margin: 0; }
.production-tools label { font-size: 9px; letter-spacing: .11em; }
.production-tools select { min-height: 34px; margin-top: 3px; padding: 6px 9px; border-width: 2px; box-shadow: none; font-size: 11px; }
.production-tools .record-option {
  display: grid;
  grid-template-columns: 21px auto;
  align-items: center;
  gap: 7px;
  width: auto;
  min-width: 154px;
  margin: 0;
  padding: 6px 9px;
  border-width: 2px;
  box-shadow: none;
}
.production-tools .record-check { width: 20px; height: 20px; border-width: 3px; }
.production-tools .record-option input:checked + .record-check { box-shadow: inset 0 0 0 3px #242630; }
.production-tools .record-option strong { font-size: 11px; }
.production-tools .record-option small { margin-top: 1px; font-size: 8px; }
.production-tools .record-option > b { display: none; }
.production-tools .record-status { grid-column: 1 / -1; min-height: 0; margin: 0; font-size: 8px; }
#view-settings .production-tools { grid-template-columns: minmax(0, 1fr); width: 100%; margin: 0 0 12px; padding: 10px; }
#view-settings .production-tools select { width: 100%; }
#view-settings .record-option { min-width: 0; width: 100%; justify-content: start; }
#view-settings .record-option small { display: block; }
#view-settings .record-status { font-size: 10px; line-height: 1.4; }

.select-panel .character-preview { gap: 20px; margin: 22px 0 20px; }
.select-panel .fighter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 360px;
  padding: 0;
}
.fighter-hero {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 360px;
  padding: 18px 12px;
  overflow: hidden;
  border-right: 4px solid #090a10;
  background:
    radial-gradient(circle at 82% 48%, color-mix(in srgb, var(--fighter-color) 27%, transparent), transparent 44%),
    repeating-linear-gradient(-50deg, transparent 0 13px, #ffffff08 14px 16px);
}
.fighter-hero::after {
  content: '';
  position: absolute;
  right: -24px;
  bottom: -45px;
  width: 210px;
  height: 90px;
  border: 18px solid color-mix(in srgb, var(--fighter-color) 55%, #111);
  border-radius: 50%;
  opacity: .3;
  transform: rotate(-14deg);
}
.fighter-heading { position: relative; z-index: 3; min-width: 0; }
.fighter-class {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  color: #090a10;
  background: var(--fighter-color);
  border: 3px solid #090a10;
  font: italic 1000 15px/.95 Impact, "Arial Black", sans-serif;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.fighter-class i { color: #292631; font-size: 8px; font-style: normal; letter-spacing: .1em; }
.select-panel .fighter-card h3 {
  margin: 11px 0 8px;
  color: #f2ede2;
  font: italic 1000 clamp(34px, 3.2vw, 48px)/.82 Impact, "Arial Black", sans-serif;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
  text-shadow: 4px 4px 0 #090a10;
}
.select-panel .series-title { margin: 0; padding: 5px 9px; font-size: 12px; }
.select-panel .fighter-portrait {
  position: absolute;
  z-index: 2;
  display: block;
  float: none;
  right: -7%;
  bottom: 3%;
  width: 114% !important;
  height: auto !important;
  margin: 0;
  filter: drop-shadow(7px 8px 0 #090a10);
}
.fighter-details { position: relative; min-width: 0; padding: 18px 14px 15px; }
.fighter-archetype {
  display: block;
  color: color-mix(in srgb, var(--fighter-color) 70%, #ece5d8);
  font: italic 1000 13px Impact, "Arial Black", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.select-panel .fighter-details p { min-height: 0; margin: 6px 0 9px; font-size: 9px; line-height: 1.35; }
.select-panel .kit-list {
  grid-template-columns: 1fr;
  gap: 4px 9px;
  padding-top: 9px;
  margin-top: 7px;
  font-size: 9px;
}
.select-panel .kit-list em { min-width: 48px; font-size: 7px; }

@media (max-width: 720px) {
  .production-tools { grid-template-columns: minmax(145px, 1fr) auto; width: 100%; }
  .production-tools .record-option { min-width: 128px; }
  .production-tools .record-option small { display: none; }
  .select-panel .fighter-card { min-height: 300px; }
  .fighter-hero { min-height: 300px; padding: 12px 8px 8px 12px; }
  .select-panel .fighter-portrait { width: 116% !important; height: auto !important; }
  .fighter-class { padding: 4px 6px; font-size: 12px; }
  .select-panel .fighter-card h3 { margin: 8px 0 6px; font-size: clamp(32px, 10vw, 45px); }
  .select-panel .series-title { font-size: 10px; }
  .select-panel .fighter-details p { min-height: 0; }
}

#app[data-aspect="portrait"] .production-tools { grid-template-columns: minmax(130px, 1fr) auto; width: 100%; }
#app[data-aspect="portrait"] .production-tools .record-option { min-width: 122px; }
#app[data-aspect="portrait"] .production-tools .record-option small { display: none; }
#app[data-aspect="portrait"] .fighter-hero { min-height: 300px; padding: 11px 7px 8px 11px; }
#app[data-aspect="portrait"] .select-panel .fighter-portrait { width: 116% !important; height: auto !important; }
#app[data-aspect="portrait"] .fighter-class { font-size: 12px; }
#app[data-aspect="portrait"] .select-panel .fighter-card h3 { font-size: clamp(32px, 10cqw, 44px); }

.arena-selector { margin: 18px 0; border: 3px solid #20232a; background: #b7b09a; color: #1d2229; text-align: left; }
.arena-selector summary { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; font: 900 16px Impact, sans-serif; }
.arena-selector summary span { flex: 1; font: 800 14px system-ui, sans-serif; }
.arena-selector summary small { font: 800 10px system-ui, sans-serif; }
.arena-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; border: 0; margin: 0; padding: 10px; }
.arena-legend { padding: 4px 0; font: 700 12px system-ui,sans-serif; }
.arena-choice { position: relative; display: block; min-width: 0; cursor: pointer; }
.arena-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.arena-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: #252b32; color: #e4dfcf; border: 3px solid #424951; transition: border-color .15s; }
.arena-card canvas,.arena-random-art { display: block; width: 100%; aspect-ratio: 300/154; height: auto; }
.arena-card strong { padding: 8px 8px 3px; font: 900 17px Impact,sans-serif; letter-spacing: .4px; line-height: 1.15; }
.arena-card small { padding: 0 8px 6px; color: #b9beae; font: 700 11px system-ui,sans-serif; }
.arena-detail { padding: 0 8px 10px; font: 400 10px/1.4 system-ui,sans-serif; color: #b4b7bc; }
.arena-choice input:checked + .arena-card { border-color: #c79570; box-shadow: 0 0 0 1px #302925; }
.arena-choice input:focus-visible + .arena-card { outline: 3px solid #e5decb; outline-offset: 2px; }
.arena-random-art { display: grid; place-items: center; background: repeating-linear-gradient(135deg,#283342 0 18px,#303b47 18px 36px); font: 900 64px Impact,sans-serif; color: #b5b6a4; }
@media(max-width:600px) { .arena-options { grid-template-columns: repeat(2,minmax(0,1fr)); } .arena-selector summary { gap: 8px; font-size: 14px; } .arena-selector summary span { font-size: 12px; } }
