:root {
  color-scheme: dark;
  --ink: #121118;
  --panel: #1c1b23;
  --paper: #f5eee1;
  --paper-muted: #c9c3bd;
  --line: #4b4549;
  --hot: #ff794b;
  --red: #df443a;
  --mint: #ace5dc;
  --body: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --display: "Archivo Black", Impact, "Arial Black", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html { background: var(--ink); }
body { margin: 0; min-height: 100svh; color: var(--paper); font-family: var(--body); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
/* The in-battle dialog is a sibling of the arena, so it needs its own touch boundary. */
#arena, #veil, #lobby :is(button, summary, canvas) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#veil, #lobby summary { touch-action: manipulation; }
:is(#arena, #veil, #lobby) :is(input, textarea, [contenteditable]:not([contenteditable="false"])) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
button:disabled, button[aria-disabled="true"] { cursor: not-allowed; }
button:focus-visible { outline: 3px solid #f8ce80; outline-offset: 3px; z-index: 2; }
button:active:not(:disabled) { transform: translateY(2px); }
[hidden] { display: none !important; }
canvas { image-rendering: pixelated; }
h1, h2, h3, p { margin: 0; }
.shell { position: relative; max-width: 1420px; margin: auto; padding: 0 clamp(18px, 4.8vw, 76px); }
.topbar, .brand, .topbar nav, .quiet, .mission, .roster-head, .move-heading, .move-detail, .bottom, .vital-top, .exp, .spirit { display: flex; align-items: center; }
.topbar { min-height: 69px; justify-content: space-between; border-bottom: 2px solid #555051; }
.brand { gap: 12px; }
.brand > div { display: grid; gap: 1px; }
.brand strong { font-size: 18px; font-weight: 900; letter-spacing: .13em; }
.brand small { color: var(--hot); font: 700 10px/1.3 var(--body); letter-spacing: .35em; }
.badge-plate { display: grid; place-items: center; position: relative; width: 42px; height: 35px; color: var(--hot); background: #242027; border: 2px solid #e37c56; border-radius: 5px 2px; transform: rotate(-6deg); box-shadow: 2px 2px #06060a; }
.badge-plate::before { content: ""; position: absolute; left: 3px; top: 3px; width: 3px; height: 3px; background: #b2a397; box-shadow: 29px 23px #b2a397; }
.badge-plate canvas { width: 30px; height: 29px; }
.topbar nav { gap: clamp(10px, 2vw, 24px); }
.quiet, .turn { border: 0; background: transparent; color: var(--paper-muted); font-size: 14px; font-weight: 700; }
.quiet { gap: 5px; min-height: 42px; padding: 4px 1px; }
.quiet:hover, .turn:hover { color: var(--hot); }
.quiet canvas { width: 19px; height: 16px; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .95fr); gap: clamp(24px, 3.5vw, 60px); align-items: center; padding: clamp(22px, 4vh, 50px) 0; }
.poster { min-width: 0; }
.poster-head { position: relative; isolation: isolate; overflow: hidden; padding: 0 4px 12px; }
.poster-head::after { content: ""; width: 27%; position: absolute; z-index: -1; inset: 8% -1% 9% auto; background: repeating-linear-gradient(116deg, transparent 0 7px, #32292b 8px 10px, transparent 11px 13px); clip-path: polygon(88% 0,100% 0,100% 100%,0 100%); }
.poster h1 { font: 1000 italic clamp(46px, 6.95vw, 100px)/.84 var(--display); letter-spacing: -.075em; transform: skew(-4deg); }
.poster h1 span { color: var(--hot); }
.poster h1 em { display: block; color: var(--paper); font: inherit; letter-spacing: -.058em; }
.poster-art { position: relative; isolation: isolate; background: var(--paper); border: 3px solid var(--paper); box-shadow: 5px 5px 0 #643b36; }
.cover-wrap { background: #292b43; overflow: hidden; border: 2px solid var(--ink); }
.cover-wrap canvas { display: block; width: 100%; height: auto; }
.mission { gap: 14px; justify-content: space-between; padding: 12px 14px; color: var(--ink); background: radial-gradient(#84776948 .65px, transparent .8px) right bottom / 4px 4px no-repeat, var(--paper); }
.sub { color: var(--hot); font-size: 12px; font-weight: 850; letter-spacing: .13em; }
.mission .sub { color: #963e32; }
.mission h2 { font-size: clamp(18px, 2.1vw, 29px); line-height: 1.25; font-weight: 950; }
.mission p { max-width: 16em; font-size: 14px; line-height: 1.55; color: #443e41; }
.roster { width: 100%; max-width: 485px; justify-self: end; min-width: 0; }
.roster-head { justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.roster-head h2 { font-size: 21px; font-weight: 900; line-height: 1.25; letter-spacing: .08em; }
.recruit-ticket { display: flex; align-items: stretch; min-height: 44px; color: var(--paper); border: 1px solid #b17c65; background: #31252a; padding: 0; }
.recruit-ticket strong, .ticket-balance { display: inline-flex; align-items: center; justify-content: center; }
.recruit-ticket strong { padding: 0 13px; font-size: 15px; letter-spacing: .07em; }
.ticket-balance { gap: 3px; min-width: 48px; padding: 0 7px; border-left: 1px dashed #b3806b; background: #eaba98; color: #302126; font-size: 13px; }
.ticket-balance b { font: 800 16px/1 var(--mono); }
.recruit-ticket:hover { border-color: #f4c7aa; background: #503139; }
.cards { display: grid; gap: 5px; }
.card { position: relative; display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px; min-height: 60px; border: 1px solid var(--line); background: #1c1b23; text-align: left; padding: 1px 13px 1px 5px; }
.card:hover:not(:disabled) { border-color: var(--paper-muted); }
.card[aria-pressed="true"] { border-color: var(--char); background: linear-gradient(105deg, color-mix(in srgb,var(--char) 19%,#1b1a22), #211d23 73%); }
.card[aria-pressed="true"]::before { content: ""; background: var(--char); position: absolute; inset: 0 auto 0 0; width: 3px; }
.card:disabled, .card[aria-disabled="true"] { filter: saturate(.35); opacity: .67; }
.portrait { width: 62px; height: 54px; object-fit: contain; justify-self: center; }
.character-name { display: block; font-size: 18px; line-height: 1.35; letter-spacing: .06em; }
.romaji { color: var(--paper-muted); font: 600 11px/1.4 var(--mono); letter-spacing: .06em; }
.radio { width: 10px; height: 10px; margin: 0 4px; border: 1px solid #88818b; transform: rotate(45deg); }
.card[aria-pressed="true"] .radio { border-color: var(--char); background: var(--char); box-shadow: inset 0 0 0 2px var(--ink); }
.move { margin-top: 10px; border-top: 1px solid var(--line); padding: 7px 0 9px; }
.move-heading { justify-content: space-between; }
.move-heading .sub { color: #e6b6a6; }
.turn { padding: 3px 0 3px 10px; font-size: 13px; }
.turn span { font: 18px/14px var(--body); }
.move-detail { gap: 9px; min-height: 55px; }
.move-detail canvas { width: 48px; height: 44px; object-fit: contain; flex-shrink: 0; }
.move-detail h3 { font-size: 17px; font-weight: 850; line-height: 1.35; }
.move-detail p, .dialog p, .guide { color: var(--paper-muted); font-size: 14px; line-height: 1.55; }
.forms-panel { border-top: 1px solid var(--line); padding: 8px 0 11px; }
.forms-panel h3 { margin: 0 0 5px; color: #e6b6a6; font-size: 12px; letter-spacing: .10em; }
.form-list { display: flex; flex-wrap: wrap; gap: 5px; }
.form-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid #728479; background: #22302e; color: #dcf0e5; font-size: 13px; line-height: 1.45; }
.form-chip.is-locked { border-color: #5b5157; background: #242129; color: #cbbfb9; }
.deploy { display: flex; align-items: center; justify-content: space-between; position: relative; isolation: isolate; overflow: hidden; width: 100%; min-height: 53px; padding: 9px 19px; background: var(--hot); color: var(--ink); border: 2px solid #ffb18c; box-shadow: 3px 3px 0 #703b36; }
.deploy::before { content: ""; position: absolute; z-index: -1; inset: 0 12% 0 44%; background: repeating-linear-gradient(115deg, transparent 0 7px, #cb4d3852 8px 9px); }
.deploy span:first-child { font-size: 22px; font-weight: 950; letter-spacing: .19em; }
.deploy span:last-child { font: 800 12px var(--mono); letter-spacing: .14em; }
.deploy:hover, .dialog-actions .primary:hover { background: #ffa278; }
.bottom { justify-content: space-between; gap: 10px 18px; border-top: 1px solid var(--line); padding: 12px 0 max(13px,env(safe-area-inset-bottom)); color: var(--paper-muted); font: 600 12px/1.6 var(--mono), var(--body); }
.bottom b { margin: 0 .2em; color: var(--hot); }
#record { text-align: right; }

.arena { position: fixed; inset: 0; overflow: hidden; touch-action: none; background: #2d3241; }
#battlefield { display: block; width: 100%; height: 100%; touch-action: none; }
.hud { position: absolute; pointer-events: none; top: max(9px,env(safe-area-inset-top)); left: max(9px,env(safe-area-inset-left)); right: max(9px,env(safe-area-inset-right)); display: grid; grid-template-columns: minmax(122px,218px) minmax(0,1fr) auto auto; grid-template-rows: auto auto; gap: 4px 6px; align-items: start; }
.vitals, .clock, .pause, .battle-strip, .bossbar { background: #15131bf2; border: 1px solid #b7a597; box-shadow: 2px 2px 0 #14121b8a; }
.vitals { padding: 5px 8px 6px; border-left: 3px solid var(--hot); }
.vital-top { gap: 5px; margin-bottom: 4px; font-size: 14px; }
.vital-top strong { line-height: 1.25; white-space: nowrap; }
#hudHp { margin-left: auto; font: 700 11px var(--mono); white-space: nowrap; }
.form-tag { white-space: nowrap; color: var(--hot); font-size: 10px; }
.track { height: 5px; overflow: hidden; background: #433e48; }
.track i { display: block; width: 0; height: 100%; background: var(--mint); }
.track .hp { width: 100%; background: var(--hot); }
.exp, .spirit { gap: 5px; margin-top: 3px; line-height: 1; }
.exp small, .spirit small { color: #e1d9d4; font: 700 10px/1 var(--mono),var(--body); white-space: nowrap; }
.exp .track, .spirit .track { flex: 1; height: 3px; }
.energy-track i { background: #ffb75c; }
.clock { grid-column: 3; display: grid; gap: 2px; justify-items: end; padding: 5px 8px; }
.clock b { font: 800 19px/.95 var(--mono); font-variant-numeric: tabular-nums; }
.clock span { color: #e2d9d3; font-size: 11px; }
.pause { grid-column: 4; pointer-events: auto; min-width: 43px; min-height: 43px; padding: 0; font-size: 20px; }
.battle-strip { grid-row: 2; grid-column: 1 / -1; justify-self: start; display: flex; flex-wrap: wrap; max-width: 100%; padding: 2px 5px; color: #f3dbcd; font-size: 11px; line-height: 1.35; }
.battle-strip span { white-space: nowrap; }
.battle-strip span + span { padding-left: 6px; margin-left: 6px; border-left: 1px solid #75675e; }
.battle-strip span:empty { display: none; }
#wave { color: #ffb58e; font-weight: 800; }
.bossbar { position: absolute; top: calc(max(9px,env(safe-area-inset-top)) + 91px); left: 50%; width: min(270px,65vw); padding: 3px 7px 5px; transform: translateX(-50%); font-size: 12px; pointer-events: none; }
.bossbar span { color: var(--hot); }
.bossbar.is-rift { width: min(320px,82vw); }
.rift-cast-cue { padding: 4px 0 1px; }
.rift-cast-cue strong, .rift-cast-cue small { display: block; }
.rift-cast-cue strong { color: #ffe0a9; font-size: 15px; }
.rift-cast-cue small { color: var(--paper); font-size: 13px; line-height: 1.4; }
.bossbar.is-rift:not([hidden]) ~ .notice { top: calc(max(9px,env(safe-area-inset-top)) + 195px); }
#bossfill { background: #ff586b; }
.dash-hint { position: absolute; left: max(12px,env(safe-area-inset-left)); bottom: max(17px,env(safe-area-inset-bottom)); width: 208px; max-width: calc(100% - 107px - env(safe-area-inset-left) - env(safe-area-inset-right)); padding: 6px 9px 7px; color: var(--paper); background: #15131bf2; border-left: 2px solid var(--mint); pointer-events: none; }
.dash-heading { display: flex; align-items: center; gap: 5px; line-height: 1.4; }
.dash-heading canvas { width: 20px; height: 16px; }
.dash-heading strong { font-size: 15px; white-space: nowrap; }
#dashState { margin-left: auto; color: var(--mint); font: 700 13px/1.3 var(--body); font-variant-numeric: tabular-nums; }
#dashState.cool { color: #ffbd92; }
#dashGesture { margin-top: 2px; font-size: 14px; line-height: 1.4; }
.dash-keys { display: none; color: var(--paper-muted); font-size: 12px; line-height: 1.4; }
@media (hover:hover) and (pointer:fine) and (min-width:481px) { .dash-keys { display: block; } }
.notice { position: absolute; left: 50%; top: calc(max(9px,env(safe-area-inset-top)) + 129px); width: max-content; max-width: 88vw; transform: translateX(-50%) skew(-4deg); background: #15131bf2; box-shadow: 3px 3px 0 var(--red); border: 1px solid var(--paper); border-left: 4px solid var(--hot); text-align: center; padding: 6px 15px; pointer-events: none; }
.notice strong, .notice span { display: block; transform: skew(4deg); }
.notice strong { font-size: clamp(15px,2.2vw,21px); }
.notice span { color: #ead6c7; font-size: 12px; }
.release-cut { position: absolute; inset: 0; display: grid; align-items: center; justify-items: stretch; overflow: hidden; touch-action: none; background: #000; z-index: 3; }
.pause { position: relative; z-index: 4; }
.cut-panel { display: flex; position: relative; isolation: isolate; align-items: center; justify-content: center; gap: clamp(5px,3vw,36px); min-height: clamp(112px,20vmin,210px); overflow: hidden; transform: skewY(-5deg); color: var(--paper); background: repeating-linear-gradient(162deg, transparent 0 10px, #a23c37 11px 12px, transparent 14px 21px),#25191e; border-block: 6px solid var(--paper); box-shadow: 0 5px var(--red),0 -5px var(--red); animation: cut-in .16s .09s ease-out both; }
.cut-panel::before { position: absolute; z-index: -1; content: ""; inset: 0 32% 0 0; background: repeating-linear-gradient(162deg, transparent 0 3px, #31222c 4px 5px, transparent 7px 13px),var(--red); clip-path: polygon(0 0,100% 0,73% 100%,0 100%); }
.cut-panel canvas { width: clamp(95px,23vmin,218px); height: auto; transform: skewY(5deg); }
.cut-panel div { transform: skewY(5deg); }
.cut-panel b { display: inline-block; padding: 2px 7px; background: var(--paper); color: var(--ink); font-weight: 900; }
.cut-panel strong { display: block; font-size: clamp(30px,7vmin,76px); line-height: 1.15; font-weight: 950; letter-spacing: .04em; text-shadow: 3px 3px var(--red); }
.release-cut[data-form="ichigoMask"] .cut-panel { background: repeating-linear-gradient(152deg, transparent 0 16px, #78403e 17px 19px, transparent 20px 31px), #291c24; box-shadow: 0 5px #9a3445,0 -5px #9a3445; }
.release-cut[data-form="ichigoMask"] .cut-panel::before { background: repeating-linear-gradient(152deg, transparent 0 9px, #94394a 10px 14px, transparent 15px 24px), #e7dccc; }
.release-cut[data-form="rukiaBankai"] { background: #091521; }
.release-cut[data-form="rukiaBankai"] .cut-panel { transform: none; background: #b8e8ed; color: #102e47; border-color: #e9fcff; box-shadow: 0 5px #78aabe,0 -5px #78aabe; }
.release-cut[data-form="rukiaBankai"] .cut-panel::before { inset: 0; background: #7bb3cc; clip-path: polygon(0 25%,8% 72%,14% 13%,20% 69%,26% 34%,30% 82%,39% 57%,46% 100%,58% 75%,63% 95%,70% 66%,75% 83%,86% 19%,89% 62%,95% 31%,100% 50%,100% 100%,0 100%); }
.release-cut[data-form="rukiaBankai"] .cut-panel :is(div,canvas) { transform: none; }
.release-cut[data-form="rukiaBankai"] .cut-panel b { color: #efffff; background: #284b65; }
.release-cut[data-form="rukiaBankai"] .cut-panel strong { text-shadow: 2px 2px #e3fbff; }
.release-cut[data-form="byakuyaBankai"] { background: #0a0911; }
.release-cut[data-form="byakuyaBankai"] .cut-panel { background: #241f32; border-color: #f6e3e9; box-shadow: 0 5px #914f73,0 -5px #914f73; }
.release-cut[data-form="byakuyaBankai"] .cut-panel::before { inset: 0; clip-path: polygon(0 0,50% 85%,100% 0,100% 100%,0 100%); background: repeating-linear-gradient(90deg,#644a62 0 3px,#3d3046 3px 8px,transparent 8px 42px); }
.release-cut[data-form="byakuyaBankai"] .cut-panel::after { content: ""; position: absolute; z-index: -1; left: 0; top: 0; width: 7px; height: 3px; box-shadow: 4vw 32px #d68eae, 12vw 21px #a35984, 8vw 91px #ecb9d0, 24vw 55px #de8fab, 29vw 35px #b3779b, 43vw 79px #b3779b, 65vw 15px #e8b4cc, 71vw 91px #b3779b, 77vw 58px #d68eae, 84vw 38px #ebafc7, 93vw 26px #a35984, 97vw 76px #ecb9d0; }
.release-cut[data-form="byakuyaBankai"] .cut-panel strong { text-shadow: 3px 3px #824566; }
@keyframes cut-in { from { opacity: 0; translate: 13% 0; } to { opacity: 1; translate: 0; } }

.veil { position: fixed; z-index: 5; inset: 0; display: grid; place-items: center; overflow: auto; padding: 16px; background: #09070ec2; }
.dialog { width: min(460px,100%); max-height: 90dvh; overflow-y: auto; background: #1e1b22; border: 2px solid var(--paper); border-top: 5px solid var(--hot); box-shadow: 5px 5px 0 #7e473d; padding: clamp(19px,3.5vw,30px); }
.dialog h2 { margin: 5px 0 14px; font-size: clamp(23px,3vw,36px); font-weight: 900; line-height: 1.2; }
.dialog-actions { display: grid; gap: 8px; margin-top: 17px; }
.dialog-actions button { min-height: 44px; background: #2a252c; border: 1px solid #766a6c; padding: 10px 12px; color: var(--paper); text-align: left; font-weight: 750; }
.dialog-actions button:hover { border-color: var(--hot); }
.dialog-actions .primary { background: var(--hot); color: #17131a; border-color: #ffb091; }
.dialog-actions button:disabled { opacity: .55; }
.dialog-actions button strong, .dialog-actions button small { display: block; }
.dialog-actions button small { margin-top: 3px; font-size: 13px; color: var(--paper-muted); font-weight: 500; }
.guide { display: grid; grid-template-columns: max-content 1fr; gap: 10px 13px; }
.guide dt { color: var(--paper); font-weight: 750; }
.guide dd { margin: 0; }
.records { display: flex; flex-wrap: wrap; gap: 15px 22px; margin: 14px 0 0; }
.records dt { color: var(--paper-muted); font-size: 13px; }
.records dd { margin: 4px 0 0; font: 750 20px/1.2 var(--mono), var(--body); }
.enemy-guide { display: grid; gap: 7px; }
.enemy-entry { display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid #574c54; background: #272229; }
.enemy-entry canvas { display: block; width: 50px; height: 48px; object-fit: contain; }
.enemy-entry h3, .enemy-entry strong { font-size: 16px; color: var(--paper); }
.enemy-entry p, .enemy-entry small { color: var(--paper-muted); font-size: 13px; line-height: 1.4; }
.summon-result { display: grid; justify-items: center; gap: 5px; padding: 14px 12px; border: 1px solid #ae7865; background: repeating-linear-gradient(118deg,transparent 0 9px,#c67a5c0c 10px 11px,transparent 12px 24px), #30252b; text-align: center; }
.summon-art { display: block; width: 96px; max-width: 100%; height: 82px; object-fit: contain; }
.summon-kind { color: #ffc097; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.summon-result h3 { font-size: 24px; line-height: 1.22; }
.summon-meta { margin-block: 8px; color: #e6be9d; font-size: 13px; }
.summon-pool { display: grid; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.pool-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 9px; color: var(--paper); border: 1px solid var(--line); background: #29252d; font-size: 14px; }
.pool-item.is-owned { color: #b3d2c5; border-color: #4a6058; }
.pool-item small { white-space: nowrap; color: var(--paper-muted); }

@media(max-width:800px) {
  .shell { padding: 0 15px; }
  .topbar { min-height: 54px; }
  .brand { gap: 7px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 9px; }
  .badge-plate { width: 34px; height: 30px; }
  .badge-plate canvas { width: 25px; height: 25px; }
  .badge-plate::before { box-shadow: 22px 18px #b2a397; }
  .topbar nav { gap: 13px; }
  .quiet { font-size: 13px; }
  .lobby-grid { grid-template-columns: minmax(0,1fr); gap: 18px; padding: 17px 0 20px; }
  .poster-head { padding-bottom: 8px; }
  .poster h1 { font-size: clamp(31px,8.4vw,66px); white-space: nowrap; line-height: .92; }
  .poster h1 em { display: inline; }
  .cover-wrap { max-height: 245px; }
  .cover-wrap canvas { max-height: 245px; object-fit: cover; object-position: center 59%; }
  .mission { padding: 7px 9px; gap: 10px; }
  .mission .sub { font-size: 10px; }
  .mission h2 { font-size: 18px; }
  .mission p { font-size: 12px; max-width: 45%; }
  .roster { max-width: none; }
  .roster-head h2 { font-size: 18px; }
  .roster-head { margin-bottom: 6px; }
  .cards { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .card { display: flex; flex-direction: column; justify-content: center; padding: 1px 2px 5px; min-height: 68px; text-align: center; gap: 0; }
  .card[aria-pressed="true"]::before { height: 2px; width: 100%; inset: 0 0 auto; }
  .portrait { height: 41px; width: 50px; }
  .character-name { font-size: 14px; }
  .romaji { display: none; }
  .radio { position: absolute; top: 5px; right: 2px; width: 6px; height: 6px; }
  .card[aria-pressed="true"] .radio { box-shadow: none; }
  .move { margin-top: 8px; padding: 4px 0 6px; }
  .move-detail { min-height: 42px; }
  .move-detail canvas { width: 42px; height: 38px; }
  .move-detail h3 { font-size: 16px; }
  .move-detail p { font-size: 13px; }
  .deploy { min-height: 47px; padding: 5px 13px; }
  .bottom { padding-top: 8px; font-size: 11px; }
}
@media(max-width:480px) {
  .vitals { min-width: 0; width: 100%; }
  .hud { grid-template-columns: minmax(145px,min(54vw,225px)) minmax(0,1fr) auto auto; }
  .cover-wrap { max-height: 184px; }
  .cover-wrap canvas { max-height: 184px; }
}
@media(max-width:360px) {
  .vital-top { display: grid; grid-template-columns: 1fr auto; row-gap: 1px; }
  .vital-top .form-tag { grid-row: 2; grid-column: 1 / 3; }
  #hudHp { grid-row: 1; grid-column: 2; }
  .shell { padding-inline: 9px; }
  .topbar nav { gap: 9px; }
  .mission { align-items: flex-start; }
  .mission h2 { font-size: 15px; }
  .mission p { font-size: 11px; }
}
@media(max-height:520px) and (orientation:landscape) {
  .hud { top: max(5px,env(safe-area-inset-top)); }
  .bossbar { top: max(6px,env(safe-area-inset-top)); width: min(24vw,220px); }
  .notice { top: 55px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.card.is-locked { background: #211e25; }
.card.is-locked .portrait { filter: saturate(.35); }
.card.is-locked .romaji { color: #dfbeaa; font-family: var(--body); letter-spacing: .025em; }
.card.is-locked .radio { position: relative; width: 10px; height: 8px; border: 1px solid #c7b9b0; transform: none; }
.card.is-locked .radio::before { position: absolute; content: ""; top: -6px; left: 1px; width: 4px; height: 5px; border: 1px solid #c7b9b0; border-bottom: 0; border-radius: 3px 3px 0 0; }
.enemy-entry small { color: #e5ab93; font-weight: 700; }
.enemy-entry .enemy-tip { margin-top: 3px; color: #c6e2dc; }
.dialog .unlock-reward, .dialog .run-form { margin-top: 12px; padding: 7px 9px; border-left: 3px solid var(--hot); background: #33292d; }
.dialog .unlock-reward { color: #ffbb78; font-weight: 750; }
@media(max-width:800px) {
  .card.is-locked .romaji { display: block; font-size: 10px; line-height: 1.3; }
  .card.is-locked .radio { position: absolute; top: 9px; right: 2px; width: 8px; height: 6px; }
  .card.is-locked .radio::before { top: -5px; width: 3px; height: 4px; }
}

.map-pick { border-top: 1px solid var(--line); padding: 12px 0 0; }
.map-pick h2 { font-size: 19px; line-height: 1.25; font-weight: 850; letter-spacing: .06em; }
.map-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin-top: 7px; }
.map-card { --map-ink: var(--hot); display: flex; gap: 9px; align-items: center; min-height: 47px; padding: 4px 8px; border: 1px solid var(--line); background: #201d24; color: var(--paper); text-align: left; }
.map-card canvas { width: 24px; height: 24px; flex-shrink: 0; }
.map-card-text { display: grid; }
.map-card strong { font-size: 15px; line-height: 1.35; }
.map-card .map-status { font-size: 11px; line-height: 1.3; color: var(--paper-muted); }
.map-card[aria-pressed="true"] { border: 1px solid var(--map-ink); background: color-mix(in srgb,var(--map-ink) 16%,#211e25); box-shadow: inset 3px 0 0 var(--map-ink); }
.map-card.is-locked canvas { opacity: .68; }
.map-card:not([aria-pressed="true"]):hover { border-color: var(--paper-muted); }
.map-intel { margin: 8px 0 0; border-block: 1px solid var(--line); padding: 5px 0; display: grid; gap: 3px; }
.map-intel div { display: grid; grid-template-columns: 34px 1fr; gap: 7px; align-items: baseline; }
.map-intel dt { color: var(--paper-muted); font-size: 12px; }
.map-intel dd { margin: 0; color: var(--paper); font-size: 14px; line-height: 1.45; }
#missionLoot { display: inline-flex; align-items: center; gap: 5px; color: #eeb993; }
#missionLoot canvas { width: 20px; height: 20px; }
.gate-hint { padding: 6px 0 0; color: #f4c0a4; font-size: 13px; }
.gear { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 5px 2px; border: 0; background: transparent; text-align: left; }
.gear > span { color: var(--paper-muted); font-size: 13px; }
.gear strong { color: var(--paper); font-size: 14px; }
.gear .gear-edit { margin-inline-start: auto; color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }
.deploy:disabled { background: #363039; color: #c6babe; border-color: #6b616c; box-shadow: 2px 2px #1a171d; }
.deploy:disabled::before { opacity: .2; }
.hud-item { position: absolute; right: max(16px,env(safe-area-inset-right)); bottom: calc(max(17px,env(safe-area-inset-bottom)) + 72px); background: #19151cf0; padding: 4px 7px; border-left: 2px solid var(--hot); color: #f0c3a4; font-size: 12px; pointer-events: none; }
#deadline { color: #bcf6e0; font-family: var(--mono),var(--body); font-weight: 700; }
#deadline.urgent { color: #ffb18d; background-color: #493038; }
.guide-group { border: 1px solid var(--line); }
.guide-group summary { padding: 10px; cursor: pointer; color: var(--paper); font-weight: 750; font-size: 15px; }
.guide-group[open] summary { color: #f5b998; border-bottom: 1px solid var(--line); }
.guide-group .enemy-entry { border: 0; }
.guide-group .enemy-entry + .enemy-entry { border-top: 1px solid var(--line); }
.rift-list { margin: 4px 0 0; }
.rift-list dt { font-size: 14px; font-weight: 700; color: #ffccaa; }
.rift-list dd { margin: 0 0 5px; font-size: 13px; color: var(--paper-muted); line-height: 1.45; }
.encounter-card .offer-moves { margin-top: 6px; font-size: 14px; color: #f5d5ab; }
@media(max-height:520px) and (orientation:landscape) {
  .bossbar.is-rift { top: max(6px,env(safe-area-inset-top)); width: min(300px,36vw); }
  .bossbar.is-rift:not([hidden]) ~ .notice { top: 100px; }
}
.gear-inventory, .checkpoint-card { display: grid; gap: 7px; }
.gear-inventory { margin-top: 11px; }
.inventory-entry { display: grid; grid-template-columns: 28px 1fr auto; place-items: center start; gap: 0 8px; padding: 7px 9px; border: 1px solid var(--line); background: #2b242c; }
.inventory-entry canvas { grid-column: 1; grid-row: 1 / span 2; }
.inventory-entry strong { grid-column: 2; font-size: 15px; }
.inventory-entry b { grid-column: 3; font: 700 14px var(--mono); color: var(--hot); }
.inventory-entry.empty b { color: var(--paper-muted); }
.inventory-entry p { grid-column: 2 / -1; font-size: 13px; }
.loot-row { display: grid; align-items: center; gap: 4px; color: var(--paper); background: #302830; border-left: 3px solid #dba381; padding: 8px 10px; }
.loot-row + .loot-row { margin-top: 6px; }
.loot-row small { color: #d5beb1; font-size: 13px; }
.loot-row span { display: flex; align-items: center; gap: 7px; }
.encounter-card { display: flex; align-items: center; gap: 13px; padding: 10px; background: #2a232c; border-left: 3px solid var(--hot); }
.encounter-card canvas { width: 65px; height: 69px; object-fit: contain; }
.encounter-card .offer-reward { color: #ffd0a9; margin-top: 5px; }
.dialog-actions .primary small { color: #593027; }
@media(min-width:801px) {
  .poster { position: sticky; top: 20px; align-self: start; }
  .cards { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .card { display: flex; flex-direction: column; justify-content: center; gap: 0; padding: 2px 3px 6px; text-align: center; }
  .card .radio { position: absolute; top: 10px; right: 4px; width: 7px; height: 7px; }
  .card.is-locked .radio { position: absolute; top: 11px; }
  .card .romaji { display: none; }
  .card.is-locked .romaji { display: block; font-size: 11px; }
  .card .character-name { font-size: 15px; }
  .card .portrait { height: 43px; width: 53px; }
}
@media(max-width:480px) {
  .map-list { gap: 4px; }
  .map-card { min-height: 44px; }
  .hud-item { right: max(12px,env(safe-area-inset-right)); bottom: calc(max(17px,env(safe-area-inset-bottom)) + 65px); }
}

.release-cut[data-state="vollstandig"] .cut-panel {
  background: repeating-linear-gradient(135deg, transparent 0 18px, #285777 19px 21px, transparent 21px 40px),#132639;
  border-color:#c8f5ff;box-shadow:0 5px #58accc,0 -5px #58accc;
}
.release-cut[data-state="vollstandig"] .cut-panel::before { background:#326582; }
.release-cut[data-state="vollstandig"] .cut-panel strong { text-shadow:2px 2px #30688a; }
.release-cut:is([data-state="resurreccion"],[data-state="segunda"]) .cut-panel {
  background:repeating-linear-gradient(148deg,transparent 0 21px,#40534e 21px 24px,transparent 24px 40px),#142520;
  border-color:#d8e3d5;box-shadow:0 5px #709980,0 -5px #709980;
}
.release-cut:is([data-state="resurreccion"],[data-state="segunda"]) .cut-panel::before { background:#566e63; }
.release-cut:is([data-state="resurreccion"],[data-state="segunda"]) .cut-panel strong { text-shadow:2px 2px #406955; }
