:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #edf0ed;
  background: #0b1015;
  --bg: #0b1015;
  --panel: #121a20;
  --line: #303941;
  --muted: #a2abb0;
  --accent: #ff9a58;
  --gold: #ffd3a1;
  --blue: #72e7ff;
  --red: #ff8073;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 1em; height: 1em; }
[data-icon] { display: inline-grid; place-items: center; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.lobby {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 70% 18%, #172329 0%, transparent 53%), #0b1015;
}
.masthead {
  height: 77px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: clamp(22px, 4.5vw, 84px); gap: 22px;
  background: #0d1319; border-bottom: 1px solid #303840;
}
.brand { display: flex; align-items: center; gap: 11px; width: max-content; font-size: 22px; letter-spacing: .13em; font-weight: 950; line-height: 1.12; }
.brand small { display: block; font: 800 9px/1.5 system-ui; letter-spacing: .29em; color: #cea27f; margin-top: 4px; }
.masthead nav { height: 100%; display: flex; gap: clamp(17px, 3.1vw, 54px); }
.nav-link { display: flex; gap: 8px; align-items: center; position: relative; padding: 0 12px; border: 0; background: transparent; color: #a8b0b4; font-size: 15px; font-weight: 800; white-space: nowrap; }
.nav-link:hover, .nav-link.current { color: #ffbf8d; }
.nav-link.current::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: #ff9957; box-shadow: 0 0 12px #ed854f76; }
.nav-link [data-icon] { font-size: 16px; }
.utilities { display: flex; justify-content: end; gap: 8px; }
.icon-button { display: grid; place-items: center; width: 37px; height: 37px; padding: 0; background: #141b22; border: 1px solid #303b45; color: #d1d7d7; font-size: 17px; transition: border-color .16s, color .16s, background .16s; }
.icon-button:hover { border-color: #a66d4b; color: #ffd0a3; background: #241e1a; }
.icon-button:disabled { opacity: .34; }
.lobby-main { width: min(100% - clamp(44px, 9vw, 168px), 1536px); margin-inline: auto; padding: clamp(18px, 2.3vw, 36px) 0 28px; }
.stage {
  position: relative; isolation: isolate; min-height: 348px; height: clamp(348px, 34vw, 515px);
  display: flex; align-items: center; overflow: hidden; border: 1px solid #5b4d40; background: #161d22;
}
.stage-art, .stage::after, .stage-grid { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.stage-art {
  background: var(--stage-image, url("./assets/canyon-cover.webp")) center 44% / cover no-repeat;
  transition: opacity .2s;
}
.stage.portrait-stage .stage-art { background-size: auto 142%; background-position: right 32%; background-color: #141c21; }
.stage::after { content: ""; background: linear-gradient(90deg,#0b1118f5 0%,#0b1518ca 18%,#0c181b49 47%,transparent 70%), linear-gradient(0deg,#0a1016e6,transparent 38%); }
.stage.portrait-stage::after { background: linear-gradient(90deg,#0b1118 0%,#101c22 32%,#101c2240 66%,transparent 84%),linear-gradient(0deg,#10171dd4,transparent 40%); }
.stage-grid { background: repeating-linear-gradient(135deg,#f8c28608 0 1px,transparent 1px 7px); z-index: 0; opacity: .52; mask-image: linear-gradient(90deg,black,transparent 41%); }
.stage-copy { position: relative; padding-left: clamp(24px, 4.3vw, 74px); margin-top: 4px; z-index: 1; }
.mode-line { display: flex; align-items: center; gap: 11px; color: #ffd0a8; font-size: 13px; letter-spacing: .17em; font-weight: 850; }
.mode-line i, .stage-tag i { width: 7px; height: 7px; background: #ff9d62; transform: rotate(45deg); box-shadow: 0 0 12px #ff9d6299; }
.mode-line span { border: 1px solid #e8a57962; padding: 3px 8px 4px; color: #ffb17b; font: 900 11px/1.1 system-ui; letter-spacing: .12em; }
.stage h1 { margin: 10px 0 7px; font-size: clamp(52px, 6.25vw, 99px); font-weight: 1000; letter-spacing: .015em; line-height: 1.08; text-shadow: 0 8px 25px #03080acc; }
.stage-subtitle { margin: 12px 0 30px; color: #d2dcdd; font-size: clamp(14px, 1.45vw, 20px); letter-spacing: .08em; }
.stage-actions { display: flex; align-items: center; gap: clamp(12px, 1.7vw, 24px); }
.primary { min-height: 45px; border: 1px solid #ffbd83; background: linear-gradient(120deg,#ffb271,#ef7f42); color: #26160d; font-size: 15px; font-weight: 950; padding: 9px 20px; transition: filter .16s, transform .16s; }
.primary:hover { filter: brightness(1.16); transform: translateY(-1px); }
.start { display: inline-flex; align-items: center; gap: 13px; min-height: 54px; padding: 12px 25px; clip-path: polygon(0 0,100% 0,100% 76%,94% 100%,0 100%); box-shadow: inset 0 -4px #ad522c60; font-size: 18px; letter-spacing: .05em; }
.start [data-icon]:last-child { margin-left: 8px; }
.stage-help { border: 0; border-bottom: 1px solid #bacbd078; background: transparent; color: #e2e8e7; padding: 8px 0; font-size: 13px; font-weight: 760; display: inline-flex; gap: 6px; align-items: center; }
.stage-help:hover { color: var(--gold); }
.mode-meta { display: flex; gap: 11px; align-items: center; margin: 18px 0 0; color: #b4bfc2; font-size: 11px; letter-spacing: .05em; }
.mode-meta span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; vertical-align: middle; margin: 0 11px 2px 0; background: #9f775c; }
.stage-tag { position: absolute; right: 24px; bottom: 25px; display: flex; align-items: center; gap: 9px; color: #ffcfab; font-size: 11px; letter-spacing: .18em; text-shadow: 0 2px 7px #000; }
.stage-tag strong { font-size: 21px; color: #fff1df; letter-spacing: .08em; }
.corner { position: absolute; width: 24px; height: 24px; border-color: #da9a68; border-style: solid; pointer-events: none; }
.corner-tl { left: 0; top: 0; border-width: 2px 0 0 2px; }
.corner-br { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.draft { padding-top: 22px; scroll-margin-top: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title [data-icon] { color: var(--accent); font-size: 23px; }
.section-title h2 { margin: 0; font-size: clamp(19px, 2.1vw, 29px); font-weight: 950; white-space: nowrap; }
.section-title > span:last-child { color: var(--muted); font-size: 12px; white-space: nowrap; border-left: 1px solid #404a50; padding-left: 10px; }
.draft-nav { display: flex; gap: 6px; align-items: center; }
.draft-nav label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.draft-nav .icon-button { height: 32px; width: 32px; }
select { border: 1px solid #35434d; background: #141d24; color: #e1e5e4; min-height: 32px; padding: 3px 11px; font-size: 12px; border-radius: 0; }
.hero-strip { display: grid; grid-template-rows: auto; grid-auto-flow: column; grid-auto-columns: calc((100% - 63px)/8); gap: 9px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding: 2px 0; }
.hero-strip::-webkit-scrollbar { display: none; }
.hero-card { position: relative; isolation: isolate; display: flex; text-align: left; align-items: end; justify-content: space-between; gap: 5px; width: 100%; min-height: 84px; height: clamp(105px, 10.2vw, 160px); overflow: hidden; border: 1px solid #3e4249; padding: 8px; background: #24262b center 22% / cover no-repeat; scroll-snap-align: start; white-space: nowrap; }
.hero-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg,#0b0e14fc 0%,#0b0e14ac 21%,transparent 57%); transition: background-color .16s; }
.hero-card:hover { border-color: #e5a16c; }
.hero-card:hover::before { background-color: #ffd4ad1c; }
.hero-card[aria-pressed=true] { border-color: #ff9b59; box-shadow: inset 0 0 0 1px #ff9b59, inset 0 -3px #ff9b59; }
.hero-card[aria-pressed=true]::after { content: "✓"; position: absolute; right: 4px; top: 4px; background: #ffad71; color: #1c160e; font-size: 12px; font-weight: 950; text-align: center; width: 18px; height: 18px; }
.hero-card strong { font-size: clamp(12px, 1.1vw, 16px); font-weight: 950; white-space: normal; }
.hero-card small { color: #d0d8d8; font-size: 10px; }
.loadout { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center; min-height: 66px; padding: 10px 14px; margin-top: 11px; background: #151d23; border: 1px solid #303945; border-left: 3px solid #d48052; }
.selected-line { display: flex; align-items: center; gap: 8px; }
.selected-line strong { font-size: 17px; }
.selected-line span { color: #b8c7cb; font-size: 11px; }
.text-button { border: 0; background: none; padding: 0; margin-top: 3px; color: #ffc498; font-size: 11px; display: inline-flex; gap: 3px; align-items: center; }
.text-button:hover { color: #fff0d6; }
.selected-skills { display: flex; gap: 8px; justify-content: center; }
.skill-chip { width: 35px; height: 35px; border: 1px solid color-mix(in srgb,var(--skill-color,#ff9961),#38454f 55%); background: radial-gradient(at 36% 20%,color-mix(in srgb,var(--skill-color,#ff9961),transparent 68%),#141b26 70%); display: grid; place-items: center; color: #fff4de; font-size: 15px; font-weight: 900; }
.configure { display: flex; gap: clamp(8px, 1.7vw, 23px); }
.configure label { display: flex; gap: 8px; align-items: center; color: #bec8ca; font-size: 12px; white-space: nowrap; }

body.in-match { overflow: hidden; overscroll-behavior: none; }
.battle { position: fixed; inset: 0 0 auto; height: 100vh; height: 100dvh; overflow: hidden; background: #142821; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; overscroll-behavior: none; }
.fullscreen-feedback { position: fixed; z-index: 3; left: 50%; bottom: max(25px, calc(env(safe-area-inset-bottom) + 17px)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 36px); padding: 9px 12px; background: #16232ef2; border: 1px solid #a88260; color: #ffe4c6; text-align: center; font-size: 12px; pointer-events: none; }
.fullscreen-feedback:empty { display: none; }
.in-match .fullscreen-feedback { bottom: 32%; max-width: min(58%, 420px); }
#arena, .hud { position: absolute; inset: 0; width: 100%; height: 100%; }
#arena { display: block; }
.hud { pointer-events: none; --safe-x: max(14px, env(safe-area-inset-left)); --safe-right: max(14px, env(safe-area-inset-right)); --safe-top: max(12px, env(safe-area-inset-top)); --safe-bottom: max(14px, env(safe-area-inset-bottom)); --u: clamp(39px, 8.8vmin, 72px); }
.hud button, .hud canvas, .joystick { pointer-events: auto; touch-action: none; }
.map-block { position: absolute; top: var(--safe-top); left: var(--safe-x); width: clamp(116px, 21vmin, 170px); background: #0e1a20e6; border: 1px solid #8b89667d; padding: 4px; box-shadow: 0 5px 16px #050e13a8; }
#minimap { display: block; width: 100%; height: auto; cursor: crosshair; }
.map-caption { display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 0 4px; color: #cedadd; font-size: 9px; letter-spacing: .1em; }
.map-view { border: 0; background: none; color: #a6dae3; padding: 2px; font-size: 13px; }
.scoreline { display: grid; grid-template-columns: 43px 56px 43px; min-width: 145px; text-align: center; align-items: center; position: absolute; left: 50%; top: var(--safe-top); transform: translateX(-50%); background: #101c24ef; border: 1px solid #5e6e76; color: #eef3f0; padding: 4px 7px 3px; box-shadow: 0 5px 17px #0b111d99; }
.scoreline span:first-child { color: var(--blue); font-size: 17px; font-weight: 950; }
.scoreline span:nth-child(3) { color: var(--red); font-size: 17px; font-weight: 950; }
.scoreline span:nth-child(2) { font: 750 12px system-ui; font-variant-numeric: tabular-nums; }
.scoreline small { grid-column: 1/-1; font-size: 10px; color: #c7d2d5; letter-spacing: .1em; }
.match-utils { display: flex; gap: 6px; position: absolute; right: var(--safe-right); top: var(--safe-top); }
.match-utils .icon-button { width: 36px; height: 35px; background: #111b24eb; border-color: #78827d96; }
.gold-button { min-width: 62px; border: 1px solid #9f8353; background: #211d16eb; color: #ffd789; height: 35px; display: flex; align-items: center; justify-content: center; gap: 5px; font: 800 13px system-ui; }
.feed { position: absolute; top: calc(var(--safe-top) + 46px); right: var(--safe-right); display: grid; gap: 3px; text-align: right; }
.feed-line { background: #101923cc; border-right: 2px solid #d0bd9d; padding: 4px 8px; color: #f3ede7; font-size: clamp(9px, 1.7vmin, 12px); }
.feed-line.blue { border-color: var(--blue); }
.feed-line.red { border-color: var(--red); }
.battle-notice { position: absolute; top: 20%; left: 50%; width: max-content; max-width: 54%; transform: translateX(-50%); color: #f9e4bf; text-align: center; font-size: clamp(12px, 2.2vmin, 17px); font-weight: 900; text-shadow: 0 2px 8px #080b10; }
.battle-notice:not(:empty) { padding: 8px 22px; background: linear-gradient(90deg,transparent,#111b25df 20% 80%,transparent); }
.combat-toast { position: absolute; bottom: 29%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 55%; font-size: 12px; color: #fff2cf; text-shadow: 0 1px 8px #02070d; text-align: center; }
.combat-toast:not(:empty) { padding: 6px 12px; background: #171d27da; border: 1px solid #ffe0a443; }
.player-panel { position: absolute; bottom: var(--safe-bottom); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; padding: 4px 7px 4px 4px; background: #111a22ef; border: 1px solid #7789869e; width: clamp(125px, 30vmin, 230px); box-shadow: 0 4px 14px #0b131cbc; }
.player-portrait { width: 36px; aspect-ratio: 1; background: #28323b center / cover; flex: none; border: 1px solid #d4ae7aa3; }
.player-vitals { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 2px; font-size: 11px; min-width: 0; }
.player-vitals strong { color: #ffcf8e; }
.hp-track, .xp-track { grid-column: 1/-1; height: 9px; position: relative; overflow: hidden; background: #27343a; border: 1px solid #384e4d; }
.xp-track { height: 3px; border: 0; background: #38384b; }
.hp-track i, .xp-track i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg,#43a486,#8cebc0); }
.xp-track i { width: 0; background: #ae9cfc; }
.hp-track b { position: absolute; inset: -2px 0 0; text-align: center; font-size: 8px; font-weight: 800; text-shadow: 0 1px 2px #14242d; }
.joystick {
  position: absolute; bottom: max(calc(var(--safe-bottom) + 12px), 9%); left: max(calc(var(--safe-x) + 15px), 5%);
  width: calc(var(--u) * 1.9); aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid #b9d4e185; border-radius: 50%; background: #0a162ab0; box-shadow: inset 0 0 0 6px #86bfd015, 0 4px 16px #07101a64;
}
.joystick i { position: absolute; width: 66%; aspect-ratio: 1; border: 1px dashed #b6d2d44b; border-radius: 50%; }
.joystick em { height: 48%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(at 36% 30%,#7db8c9,#294e65 78%); border: 1px solid #b1d5da; box-shadow: 0 3px 10px #060b19aa; }
.combat-controls { position: absolute; bottom: calc(var(--safe-bottom) + 3px); right: var(--safe-right); width: calc(var(--u) * 4.17); height: calc(var(--u) * 2.8); }
.action {
  --size: var(--u); position: absolute; display: grid; place-items: center; width: var(--size); height: var(--size); padding: 0;
  border: 1px solid #d3c29baf; border-radius: 50%; color: #fff4dc;
  background: radial-gradient(at 36% 23%,#48566e,#182439 73%); box-shadow: inset 0 0 0 3px #d8e7ff14, 0 3px 12px #050a16ad;
}
.action [data-icon] { font-size: calc(var(--size) * .44); }
.action:hover, .action:active { filter: brightness(1.24); }
.action kbd { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); min-width: 16px; border-radius: 3px; font: 800 9px/1.2 system-ui; color: #dbebef; background: #15202e; padding: 2px 3px; white-space: nowrap; }
.main-attack { --size: calc(var(--u) * 1.19); right: .2%; bottom: 8%; border-color: #ffc587; color: #fff4e0; background: radial-gradient(at 35% 25%,#ab6a44,#4e2b25 70%); }
.priority { --size: calc(var(--u) * .6); border-color: #b5c5c9a2; }
.attack-hero { right: 2%; bottom: 57%; }
.attack-tower { right: 29%; bottom: 1%; }
.attack-minion { right: 48%; bottom: 1%; }
.recall-wrap { position: absolute; left: 3%; bottom: 3%; width: calc(var(--u) * .63); height: calc(var(--u) * .85); text-align: center; }
.recall { --size: calc(var(--u) * .62); color: #a4d9fc; }
.recall-wrap small { position: absolute; bottom: -3px; width: 100%; left: 0; color: #e1edf4; font-size: 9px; text-shadow: 0 2px 5px #000; }
.skill-buttons { display: contents; }
.skill-wrap { position: absolute; width: var(--u); height: var(--u); }
.skill-wrap:nth-child(1) { bottom: 27%; right: 49%; }
.skill-wrap:nth-child(2) { bottom: 63%; right: 47%; }
.skill-wrap:nth-child(3) { bottom: 76%; right: 24%; }
.skill-wrap:nth-child(4) { bottom: 39%; right: 25%; }
.skill { border-color: color-mix(in srgb,var(--skill-color),#f3e0c4 48%); background: radial-gradient(at 34% 24%,color-mix(in srgb,var(--skill-color),#272338 60%),#182238 75%); font-weight: 950; font-size: calc(var(--u) * .36); }
.skill.ultimate { box-shadow: inset 0 0 0 3px #edbe7966,0 3px 12px #050a16a9; }
.skill.unlearned { filter: saturate(.15) brightness(.62); }
.skill.on-cd .sigil { opacity: .34; }
.skill .cd { display: none; position: absolute; color: white; text-shadow: 0 2px #10131a; font: 850 calc(var(--u) * .32) system-ui; }
.skill.on-cd .cd { display: block; }
.level-up { position: absolute; z-index: 1; top: -8px; right: -4px; color: #28200f; background: #ffd080; border: 1px solid #fff1c8; width: max(21px,calc(var(--u) * .38)); aspect-ratio: 1; border-radius: 50%; padding: 0; font-weight: 950; }
.aim-flag { position: absolute; right: 10%; bottom: 106%; color: #e2fafb; padding: 5px 8px; background: #102531d9; border: 1px solid #63bfce9c; font-size: 11px; white-space: nowrap; }
.cancel-aim { position: absolute; right: 1%; bottom: 129%; width: calc(var(--u) * .9); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #ffd0c8; background: #31141ddb; border: 1px solid #e28680; }
.cancel-aim.active { background: #a33737; }
.recall-progress, .death-panel { position: absolute; left: 50%; bottom: 20%; width: 124px; padding: 8px; color: #ecf6fa; text-align: center; background: #121e2be9; border: 1px solid #8dbae1; transform: translateX(-50%); font-size: 12px; }
.recall-progress em { display: block; height: 3px; margin-top: 5px; width: var(--progress,0%); background: #88d9ff; }
.death-panel { bottom: 43%; border-color: #c07871; }
.death-panel strong { display: block; font-size: 24px; color: #ffb2a1; }
.match-tip { position: absolute; left: 50%; bottom: calc(var(--safe-bottom) + 56px); width: max-content; max-width: 43%; transform: translateX(-50%); text-align: center; color: #f2e5cc; font-size: 11px; text-shadow: 0 2px 6px #020408; }

.dialog { width: min(640px, calc(100% - 25px)); max-height: calc(100dvh - 22px); overflow: auto; padding: 0; color: #eef1ef; background: #121c24; border: 1px solid #866b54; box-shadow: 0 18px 90px #030508c7; }
.dialog::backdrop { background: #03080ad6; }
.dialog-inner { padding: clamp(16px, 3vw, 32px); position: relative; }
.dialog .close { position: absolute; right: 12px; top: 12px; z-index: 2; }
.dialog h2 { margin: 0 39px 10px 0; font-size: clamp(24px,4vw,33px); }
.dialog p { margin: 6px 0 15px; color: #c8d3d6; line-height: 1.6; font-size: 13px; }
#pause-fullscreen-feedback:not(:empty) { margin: 11px 0 0; color: #ffd3a1; }
#pause-fullscreen-feedback:empty { display: none; }
.dialog-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.secondary { min-height: 44px; border: 1px solid #697984; padding: 8px 14px; background: #1c2a34; color: #e6edef; font-size: 13px; font-weight: 790; }
.secondary:hover { background: #253d46; }
.guide-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; }
.guide-list div, .ability-detail { background: #192630; border: 1px solid #354754; padding: 8px 10px; }
.guide-list dt { font-weight: 850; color: #ffc798; font-size: 13px; }
.guide-list dd { margin: 4px 0 0; font-size: 12px; color: #d4dcdf; }
.hero-detail-top { display: grid; grid-template-columns: 110px auto; gap: 15px; }
.hero-detail-top img { width: 100%; border: 1px solid #b17e54; }
.hero-detail-top .subtitle { color: #ffbf96; margin-bottom: 4px; }
.ability-grid, .shop-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.ability-detail strong, .item-name { color: #ffce9f; font-size: 14px; }
.ability-detail span { color: #9db1b8; font-size: 10px; }
.ability-detail p { margin: 4px 0 0; font-size: 11px; }
.item { display: grid; gap: 4px; grid-template-columns: 30px 1fr auto; align-items: center; text-align: left; border: 1px solid #4f5d65; background: #192630; padding: 9px; }
.item:hover:not(:disabled) { background: #2b363d; border-color: var(--gold); }
.item:disabled { opacity: .54; }
.item-icon { grid-row: span 2; font-size: 22px; color: var(--item-color); }
.item-description { font-size: 10px; color: #d2dcdf; grid-column: 2/-1; }
.item-cost, .wallet { color: #ffda8d; font-weight: 800; }
.wallet { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.team-tables { display: grid; gap: 12px; }
.team-tables table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.team-tables caption { text-align: left; padding: 5px 8px; font-weight: 850; color: var(--blue); background: #1d333e; }
.team-tables table:nth-child(2) caption { color: var(--red); background: #392933; }
.team-tables td, .team-tables th { padding: 3px 5px; text-align: right; border-bottom: 1px solid #34434c; white-space: nowrap; }
.team-tables td:first-child, .team-tables th:first-child { width: 40%; text-align: left; }
.table-hero { display: flex; align-items: center; gap: 6px; }
.table-hero img { width: 21px; height: 21px; }
.result-title.victory { color: #93ebfb; }
.result-title.defeat { color: #ffac93; }
.result-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 12px 0; }
.result-stats div { padding: 12px 8px; text-align: center; background: #1a2731; border: 1px solid #3a4b59; }
.result-stats strong { display: block; color: #ffc998; font-size: 21px; }
.result-stats small { color: #c5d0d3; }
.error-message { color: #ffc087; }

@media (max-width: 930px) {
  .hero-strip { grid-auto-columns: calc((100% - 45px)/6); }
  .hero-card small { display: none; }
}
@media (max-width: 620px) {
  .masthead { height: 57px; padding-inline: 9px; gap: 5px; grid-template-columns: auto 1fr auto; }
  .masthead nav { gap: 0; justify-content: center; }
  .brand { font-size: 13px; gap: 3px; letter-spacing: .05em; }
  .brand img { width: 27px; height: 27px; }
  .brand small { font-size: 6px; margin-top: 1px; letter-spacing: .18em; }
  .nav-link { padding: 0 6px; font-size: 11px; gap: 3px; }
  .nav-link [data-icon] { display: none; }
  .utilities { gap: 4px; }
  .utilities .icon-button { width: 26px; height: 27px; font-size: 13px; }
  .lobby-main { width: calc(100% - 20px); padding-top: 11px; }
  .stage { min-height: 287px; height: min(68vw, 375px); }
  .stage-art { background-position: 57% 42%; }
  .stage.portrait-stage .stage-art { background-size: auto 110%; background-position: 125% center; }
  .stage::after { background: linear-gradient(90deg,#0b1118ed,#0b15188c 55%,transparent),linear-gradient(0deg,#0a1016dd,transparent 53%); }
  .stage-copy { padding-left: 13px; margin-bottom: 15px; }
  .stage h1 { font-size: clamp(35px, 11vw, 62px); }
  .stage-subtitle { font-size: 12px; margin-bottom: 21px; }
  .stage-tag { bottom: 9px; right: 9px; font-size: 9px; gap: 4px; }
  .stage-tag strong { font-size: 15px; }
  .start { min-height: 43px; gap: 7px; padding: 7px 12px; font-size: 14px; }
  .stage-help { font-size: 11px; }
  .draft { padding-top: 16px; }
  .draft-nav label { display: none; }
  .draft-nav select { padding-inline: 4px; }
  .draft-nav .icon-button { width: 27px; }
  .hero-strip { grid-auto-columns: calc((100% - 27px)/4); }
  .hero-card { height: 100px; padding: 6px; }
  .loadout { grid-template-columns: 1fr auto; padding: 7px; gap: 7px; }
  .selected-skills { justify-content: end; gap: 4px; }
  .skill-chip { width: 27px; height: 27px; font-size: 12px; }
  .configure { grid-column: 1/-1; justify-content: space-between; border-top: 1px solid #344149; padding-top: 6px; }
  .configure select { min-height: 26px; }
}
@media (pointer: coarse) {
  .action kbd { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .masthead { height: 44px; }
  .brand img { width: 32px; height: 32px; }
  .brand { font-size: 16px; }
  .lobby-main { padding: 9px 0; width: calc(100% - 32px); }
  .stage { height: 42dvh; min-height: 150px; }
  .stage-art { background-position: center 17%; }
  .stage h1 { font-size: clamp(35px, 9.5vh, 60px); margin: 5px 0; }
  .stage-subtitle { margin: 5px 0 9px; font-size: 12px; }
  .start { min-height: 36px; padding-block: 6px; font-size: 13px; }
  .mode-meta { margin-top: 7px; }
  .draft { padding-top: 9px; }
  .section-head { margin-bottom: 5px; }
  .section-title h2 { font-size: 18px; }
  .hero-card { height: clamp(62px, 18dvh, 102px); min-height: 55px; }
  .loadout { min-height: 47px; margin-top: 4px; }
  .hud { --u: clamp(41px, 12vmin, 62px); --safe-top: max(7px, env(safe-area-inset-top)); --safe-bottom: max(8px,env(safe-area-inset-bottom)); }
  .map-block { width: clamp(95px, 29vmin, 125px); }
  .joystick { bottom: calc(var(--safe-bottom) + 9px); }
  .player-portrait { width: 29px; }
  .match-tip { bottom: calc(var(--safe-bottom) + 45px); }
  .dialog-inner { padding: 12px 17px; }
}
@media (max-width: 530px) and (orientation: portrait) {
  #battle-fullscreen { display: none; }
  .hud { --u: 41px; --safe-x: 8px; --safe-right: 8px; }
  .joystick { left: 13px; bottom: 61px; }
  .combat-controls { bottom: 49px; }
  .match-tip { bottom: 169px; max-width: 75%; }
  .aim-flag { bottom: 145%; }
  .cancel-aim { bottom: 204%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
