/* Both clients use the same visible viewport, including the software keyboard. */
:root { --arena-height:100vh; --arena-top:0px; }
@supports (height:100dvh) { :root { --arena-height:100dvh; } }
.mobile-only, .tactic-unit button.mobile-only, .rotate-prompt[hidden], #practice-pool[hidden] { display:none; }
@media (min-width:641px) and (min-height:551px), (min-width:1025px) {
  #tactic-editor:not(.personal) {
    display:grid; gap:6px; padding:6px;
    grid-template-columns:minmax(145px,23%) minmax(0,1fr);
    grid-template-rows:auto auto auto minmax(0,1fr) auto;
    grid-template-areas:"summary summary" "team tabs" "team settings" "team results" "foot foot";
  }
  #tactic-editor:not(.personal) .tactic-summary { grid-area:summary; }
  #tactic-editor:not(.personal) #tactic-team { grid-area:team; display:flex; flex-direction:column; overflow:auto; margin:0; }
  #tactic-editor:not(.personal) .tactic-unit { flex:none; grid-template-columns:36px minmax(0,1fr); }
  #tactic-editor:not(.personal) .tactic-face { display:block; grid-row:span 2; padding:0; }
  #tactic-editor:not(.personal) .tactic-face img { display:block; width:34px; height:38px; object-fit:cover; }
  #tactic-editor:not(.personal) .tactic-unit > span { text-align:left; }
  #tactic-editor:not(.personal) .tactic-unit :is([data-focus-hero],.unit-troop) { grid-column:1/-1; }
  #tactic-editor:not(.personal) .unit-troop { display:block; font-size:.78rem; color:#b6c7d8; }
  #tactic-editor:not(.personal) .tactic-tabs { grid-area:tabs; display:flex; gap:4px; }
  #tactic-editor:not(.personal) .tactic-tabs button { min-height:34px; padding:4px 12px; border:1px solid #40506a; border-radius:4px; background:#223148; color:#d5e0ef; }
  #tactic-editor:not(.personal) .tactic-tabs button[aria-pressed=true] { color:#ffe3a8; background:#39342b; border-color:#9e885c; }
  #tactic-editor:not(.personal) #tactic-settings { display:block; grid-area:settings; margin:0; max-height:35dvh; overflow:auto; }
  #tactic-editor:not(.personal) #tactic-adjust { display:none; }
  #tactic-editor:not(.personal) :is(#tactic-scroll,#tactic-history) { grid-area:results; }
  #tactic-editor:not(.personal) .tactic-footer { grid-area:foot; }
  #tactic-editor:not(.personal)[data-tab=attributes] #tactic-attributes { display:block; padding:8px 16px; }
  #tactic-editor:not(.personal):not([data-tab=skills]) #tactic-settings { grid-row:3/5; max-height:none; }
  #tactic-editor:not(.personal):not([data-tab=skills]) :is(#tactic-scroll,#tactic-history,.tactic-facets,.tactic-groups,#tactic-source,#tactic-search,#tactic-tools > button),
  #tactic-editor:not(.personal):not([data-tab=troops]) #tactic-troops,
  #tactic-editor:not(.personal):not([data-tab=attributes]) .move-unit { display:none; }
}
.match-menu { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.retained-result { padding:8px; margin-bottom:10px; background:#1a2537; border:1px solid #435168; border-radius:8px; }
.retained-result button { min-height:44px; }
.rotate-prompt { margin:14px auto; padding:12px; max-width:420px; border:1px solid #657392; border-radius:8px; background:#1a293c; }
.rotate-prompt p { margin:8px 0; }
.rotate-phone { display:inline-grid; place-items:center; width:33px; height:22px; border:2px solid #dfc38a; border-radius:4px; color:#dfc38a; font-size:20px; line-height:1; transform:rotate(-12deg); }
.rotate-prompt button, .match-menu button { min-height:44px; }
.rotate-prompt button + button { margin-left:6px; }
.move-target { outline:1px dashed #acbede; outline-offset:-2px; }
.move-source, .move-over { outline:2px solid #efca7e; outline-offset:-2px; background:#443c30; }
.available-heroes { display:inline-flex; align-items:center; gap:3px; }
.pool-card picture, .general picture { display:block; height:100%; }
@media (max-width:640px), (max-width:1024px) and (max-height:550px) {
  body > .arena { display:flex; flex-direction:column; gap:4px; overflow:hidden; }
  .arena .mast { flex:none; display:grid; grid-template-columns:auto 1fr auto; gap:3px 6px; align-items:center; padding:0; }
  .arena .mast h1,.arena .rulesline,.arena .mast::before { display:none; }
  .arena .utilities { position:static; grid-area:1/3; display:flex; align-items:center; gap:3px; }
  .arena .utilities button,#practice-filter { border:1px solid #40506a; background:#223148; color:#dfebf6; border-radius:4px; }
  .arena .phase { grid-area:1/1; gap:4px; padding:3px 5px; border-radius:4px; }
  .arena .phase :is(span,b,strong) { font-size:12px; }
  .arena .clock { grid-area:1/2; gap:3px; width:100%; margin:0; }
  .arena .clock[hidden] { display:none; }
  .arena .practice-stage { grid-column:1/-1; align-items:center; gap:8px; }
  #practice-score { color:#e6c78b; font:700 17px Georgia,serif; white-space:nowrap; }
  #practice-order { flex:1; display:flex; justify-content:space-around; background:#192235; border-radius:4px; }
  #practice-order span { padding:2px; color:#a5b6d0; font-size:12px; }
  #practice-order [aria-current] { color:var(--tint); border-bottom:2px solid var(--accent); }
  .arena .ban-panel { padding:2px 6px; margin:0; border-radius:5px; }
  .arena .ban-side { display:flex; gap:4px; align-items:center; }
  .arena .ban-side.red { justify-content:flex-end; }
  .arena .ban-side h2 { margin:0; font-size:11px; }
  .arena .ban-cards { gap:2px; }
  .arena .ban-slot { width:27px; height:23px; }
  .arena .ban-slot em { font-size:10px; }
  .arena .ban-center { display:none; }
  .arena .ban-panel { grid-template-columns:1fr 1fr; }
  .arena .match { flex:1; display:grid; min-height:0; gap:4px; }
  .arena .team.blue { grid-area:blue; }
  .arena .team.red { grid-area:red; }
  .arena .team-head { padding:0; }
  .arena .team-head h2 { font-size:14px; }
  .arena .team-head > span { display:none; }
  .arena .squad-head { gap:3px; flex-wrap:wrap; }
  .arena .squad-head button { font-size:12px; padding:4px; }
  .arena .squad { margin-top:3px; }
  .arena :is(.versus,#practice-pool) { grid-area:center; }
  #practice-pool { background:#192235; border:1px solid #34445e; }
  .practice-option { position:relative; min-width:0; }
  .practice-option .general { width:100%; }
  .practice-option .inspect-general { position:absolute; top:0; right:0; min-width:30px; min-height:30px; background:#111c2cbb; border-radius:0 4px; color:#f4e9d3; }
  #practice-pool .filters[hidden],.match:has(#practice-pool:not([hidden])) .versus { display:none; }
  #practice-pool .filters { flex-basis:100%; flex-wrap:wrap; font-size:12px; gap:3px; }
  #practice-pool .filters button { padding:2px 5px; }
  #practice-pool .filters label { display:flex; align-items:center; }
  #practice-pool .pick-foot { flex:none; gap:4px; margin-top:4px; }
  #practice-pool .pick-foot span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; flex:1; font-size:12px; }
  #practice-pool .pick-foot button { min-height:44px; padding:4px 8px; font-size:13px; }
  .arena .squad-tabs { gap:2px; }
  .arena .squad-tab { padding:2px; }
  .arena .squad-tab .mini-row { display:none; }
  .arena footer { min-height:30px; flex-wrap:wrap; justify-content:space-between; gap:0 4px; }
  .arena footer div { flex-wrap:wrap; gap:5px; }
}
@media (max-width:640px), (max-width:1024px) and (max-height:550px) {
  body { padding-inline:env(safe-area-inset-left) env(safe-area-inset-right); }
  .mobile-only { display:inline-flex; }
  button { touch-action:manipulation; }
  .in-match, body:has(> .arena) { min-height:0; }
  .in-match #app, body > .arena {
    position:fixed; top:var(--arena-top); left:0; right:0; height:var(--arena-height);
    padding:max(3px,env(safe-area-inset-top)) max(5px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left));
  }
  .in-match .topbar, .in-match #app > footer, .playing > .room-line { display:none; }
  .room.playing > .room-line { display:flex; margin:0; min-height:27px; }
  .room.playing > .room-line button:not(.room-exit) { display:none; }
  .room.playing .room-exit { padding:4px 10px; }
  .room.playing { width:100%; height:100%; padding:0; margin:0; display:flex; flex-direction:column; gap:3px; }
  .playing > :not(.arena-grid) { flex:none; }
  .playing .scoreboard { padding:4px 12px; gap:4px; border-radius:6px; }
  .playing .score-team .player-link { max-width:100%; min-width:0; }
  .score-team .player-link b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .playing .score-team > span { display:none; }
  .playing .score-team .player-avatar { width:30px; height:30px; }
  .playing .score-team b { font-size:14px; }
  .playing .score-meta { gap:8px; flex-direction:row; }
  .playing .score-meta strong { font:700 18px/1.1 Georgia,serif; }
  .playing .turn-line { gap:9px; margin:0; }
  .playing .turn-line h1 { font-size:16px; line-height:1.25; }
  .playing .turn-clock { padding:0; font-size:16px; }
  .playing .draft-order { margin:0; padding:0; gap:3px; }
  .playing .draft-order li { padding:2px 0; font-size:12px; }
  .playing .time-row { margin:0 auto; }
  .playing .arena-grid { flex:1; min-height:0; margin:0; gap:4px; align-items:stretch; }
  .playing .team-panel, .playing .pool-panel, .match .team, #practice-pool { min-height:0; min-width:0; padding:5px; border-radius:6px; overflow:auto; overscroll-behavior:contain; box-shadow:none; }
  .playing .team-panel.blue { grid-area:blue; }
  .playing .team-panel.red { grid-area:red; }
  .playing .pool-panel { grid-area:center; }
  .playing .draft-pool, #practice-pool:not([hidden]) { display:flex; flex-direction:column; overflow:hidden; }
  .team-panel .side-title { margin:0 0 4px; font-size:13px; gap:3px; }
  .team-panel .side-title .player-link { display:none; }
  .team-panel .side-list { padding:4px 0; }
  .team-panel .side-list p, .team-panel .side-list label { font-size:12px; }
  .team-panel .round-cards,.team-panel .progress-title { display:none; }
  .playing .slots { max-width:none; }
  .playing .hero-card { min-width:0; }
  .slot .card-tactics, .position .card-tactics { margin:0; gap:2px; }
  .slot .card-tactics > *, .position .card-tactics > * { text-align:left; font-size:12px; }
  .slot .learn-slot, .position .learn-slot { min-height:25px; }
  [data-board-hero] .hero-card, [data-board-hero] > small, .position[draggable] .hero-slot, .position[draggable] .pos-label, .tactic-unit[draggable] > b, .tactic-unit[draggable] .tactic-face { touch-action:none; user-select:none; -webkit-touch-callout:none; }
  .playing .team-config { grid-template-columns:1fr; gap:3px; margin:4px 0; }
  .playing .config-btn { margin:0; padding:4px; min-height:32px; font-size:12px; }
  .playing .pool-panel .section-head { min-height:25px; gap:5px; }
  .playing .section-head h2 { font-size:14px; margin:0; }
  .playing .section-head .compact { padding:4px 6px; }
  .playing .pool-tools, #practice-pool .pool-tools { display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin:3px 0; }
  .playing .pool-tools input[type=search], #practice-pool #search { min-width:0; width:60%; flex:1; margin:0; font-size:16px; height:33px; }
  .playing .pool-tools #pool-filter-toggle, #practice-filter { min-height:33px; padding:4px 9px; }
  .playing .pool-tools:not(.expanded) :is(select,label) { display:none; }
  .playing .pool-tools.expanded input[type=search] { flex-basis:75%; }
  .playing .pool-tools.expanded select { flex:1; width:16%; min-width:0; padding:4px 0; }
  .playing #cards, #practice-pool #pool { flex:1; min-height:0; max-height:none; grid-template-columns:repeat(auto-fill,minmax(60px,1fr)); gap:4px; overflow:auto; overscroll-behavior:contain; align-content:start; }
  .playing #cards, #practice-pool #pool { grid-auto-rows:clamp(80px,10vw,98px); }
  .playing .pool-card, #practice-pool .general { aspect-ratio:auto; height:100%; min-height:44px; }
  .playing .pool-card span { font-size:13px; background:linear-gradient(transparent,#0c1324 52%); }
  .pool-card.available em { display:none; }
  @media (hover:none) { .playing .pool-card::after { display:none; } }
  .playing .round-links { flex-wrap:nowrap; margin:0; gap:4px; justify-content:flex-end; align-items:center; }
  .round-links > [data-act=journal], .round-links > [data-act=skill-history] { display:none; }
  .round-links button { padding:4px 6px; min-height:32px; font-size:12px; }
  .series-strip { gap:2px; order:-2; }
  .series-strip button { min-width:22px; padding:2px; }
  .series-strip [aria-current] { opacity:1; color:#f6d69a; border-color:#ad915a; }
  .room-code { margin-right:auto; order:-1; font:12px/1.2 system-ui; color:#b4c3d5; }
  .playing .prep { display:flex; flex-direction:column; justify-content:safe center; align-items:center; gap:8px; }
  .prep-actions { position:sticky; bottom:0; background:#192233; padding:4px; }
  .prep .primary, .tactic-footer .primary, #choose-now { min-height:44px; }
  .playing .battle-versus { min-height:0; }
  dialog:not(.tactics-window) { max-width:calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 8px); max-height:calc(var(--arena-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 8px); }
  #dialog[open]:not(.tactics-window), #player-dialog[open], #modal[open]:not(.tactics-window) { display:flex; flex-direction:column; overflow:hidden; }
  #dialog > .modal-head, #player-dialog > .modal-head, #modal > .dialog-head { flex:none; position:static; padding:4px 12px; }
  :is(.modal-head,.dialog-head) button { min-width:44px; min-height:44px; }
  #dialog-body,#modal-body,#player-body { min-height:0; overflow:auto; overscroll-behavior:contain; }
  .result-banner { box-shadow:none; }
  .match-final.victory::before,.result-score strong,.battle-versus b { animation:none; }
  .settled { overflow-wrap:anywhere; }
  .result-footer { position:sticky; bottom:0; background:#192334; }
  .in-final .topbar,.in-final #app > footer { display:none; }
  .in-final .room { padding:4px; }
  .in-final .room-line { padding:3px 0; margin:0; }
  .in-final .settled { margin:4px auto; padding:8px; }
  .in-final .result-actions { position:sticky; bottom:env(safe-area-inset-bottom); padding:5px; background:#192334; z-index:1; }
  #dialog-body:has(#round-archive) { display:flex; flex-direction:column; }
  #dialog-body:has(#round-archive) { height:var(--arena-height); }
  #dialog-body:has(#round-archive) > .result-banner { flex:none; }
  #round-archive { flex:1; overflow:auto; min-height:0; }
  #round-archive + .result-footer { flex:none; position:static; padding-top:4px; }
  dialog.tactics-window[open] { position:fixed; inset:var(--arena-top) 0 auto; margin:0 auto; width:100%; max-width:100%; height:var(--arena-height); max-height:var(--arena-height); padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-radius:0; }
  dialog.tactics-window :is(.modal-head,.dialog-head) { min-height:34px; padding:0 8px; }
  .tactics-window :is(.modal-head,.dialog-head) h2 { margin:0; font-size:16px; }
  .tactics-window :is(.modal-head,.dialog-head) button { min-height:34px; }
  dialog.tactics-window :is(#modal-body,#dialog-body) { flex:1; overflow:hidden; }
  #tactic-editor { flex:1; height:auto; min-height:0; display:grid; gap:3px; padding:3px 5px; grid-template-columns:minmax(0,30fr) minmax(0,70fr) auto; grid-template-rows:auto auto auto minmax(0,1fr) auto; grid-template-areas:"summary summary summary" "preset preset preset" "team tabs adjust" "team content content" "foot foot foot"; }
  .tactic-summary { grid-area:summary; min-height:0; padding:3px 6px; }
  #tactic-search { flex:1; max-width:420px; margin-right:auto; height:34px; font-size:16px; }
  #preset-chooser { grid-area:preset; margin:0; }
  #tactic-team { grid-area:team; display:flex; flex-direction:column; margin:0; min-height:0; overflow:auto; gap:4px; }
  #tactic-team .tactic-unit { flex:none; display:grid; grid-template-columns:32px 1fr 1fr; align-items:center; padding:4px; gap:2px; }
  #tactic-team .tactic-unit > b, #tactic-team .tactic-unit > span { grid-column:2/-1; text-align:left; font-size:12px; }
  #tactic-team .tactic-face { display:block; grid-row:1/3; padding:0; border:0; background:none; }
  .tactic-face img { width:32px; height:34px; object-fit:cover; display:block; border-radius:3px; }
  #tactic-team .tactic-unit > [data-focus-hero]:not(.tactic-face) { grid-column:span 1; min-height:30px; padding:3px; }
  #tactic-team .tactic-unit > [data-index]:not(.tactic-face):nth-last-child(3) { grid-column:1/3; }
  #tactic-team .unit-troop { grid-column:1/-1; font-size:12px; color:#aabbd3; }
  #tactic-editor .tactic-tabs { grid-area:tabs; gap:4px; }
  .tactic-tabs button, #tactic-editor #tactic-adjust { border:1px solid #3c506b; background:#223148; color:#d5e0ef; padding:4px 8px; border-radius:4px; min-height:32px; font-size:13px; }
  #tactic-editor #tactic-adjust { grid-area:adjust; display:block; align-self:stretch; margin:0; }
  #tactic-editor:not([data-tab=skills]) #tactic-adjust { visibility:hidden; }
  #tactic-editor:not([data-tab=skills]) #tactic-search { visibility:hidden; }
  #tactic-scroll,#tactic-history,#tactic-settings { grid-area:content; }
  #tactic-scroll { padding:2px; gap:4px; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); }
  #tactic-settings, #tactic-editor.settings-expanded #tactic-settings { display:none; max-height:none; overflow:auto; min-height:0; padding:4px; background:#192538; }
  #tactic-editor:not([data-tab=skills]) #tactic-settings, #tactic-editor.settings-expanded[data-tab=skills] #tactic-settings { display:block; }
  #tactic-editor:not([data-tab=skills]) :is(.tactic-groups,.tactic-facets,#tactic-source,#tactic-scroll,#tactic-history),
  #tactic-editor.settings-expanded[data-tab=skills] :is(#tactic-scroll,#tactic-history),
  #tactic-editor:not([data-tab=troops]) #tactic-troops,
  #tactic-editor:not([data-tab=attributes]) :is(#tactic-tools,#tactic-attributes) { display:none; }
  #tactic-editor[data-tab=attributes] #tactic-settings { display:flex; flex-wrap:wrap; align-content:flex-start; gap:4px; }
  #tactic-editor[data-tab=attributes] #tactic-tools { display:contents; }
  #tactic-editor[data-tab=attributes] .move-unit { order:-1; flex:0 0 100%; align-items:center; gap:5px; margin:0; }
  .move-unit > span { margin-right:auto; }
  #tactic-editor[data-tab=attributes] .move-unit button { min-height:34px; padding:4px 9px; }
  #tactic-editor[data-tab=attributes] #tactic-attributes { flex:1 0 90%; }
  #tactic-attributes { display:grid; gap:8px; margin:4px 8px; }
  #tactic-attributes:empty { display:none; }
  #tactic-editor.settings-expanded[data-tab=skills] .no-matches .filter-empty { display:block; padding:6px; }
  #tactic-editor #tactic-troops { margin:0; padding:10px; gap:12px; }
  #tactic-editor .troop-row button { min-height:44px; }
  .tactic-grid .tactic-info { min-width:30px; min-height:30px; }
  .tactic-footer { grid-area:foot; min-height:0; padding:2px 8px; }
  .tactic-detail-head { position:sticky; top:0; background:#252e40; }
  #tactic-details { max-height:77%; bottom:45px; }
  .tactic-footer #tactic-confirm { margin-left:auto; white-space:nowrap; }
}
@media (max-width:640px), (max-width:1024px) and (max-height:550px) {
  :where(.arena-wide) #tactic-team .tactic-unit:not(.vacant) > b { grid-area:1/2/2/4; }
  :where(.arena-wide) #tactic-team .tactic-unit > span[title] { display:none; }
  :where(.arena-wide) #tactic-team .tactic-unit .unit-troop { grid-area:2/2/3/4; }
  :where(.arena-wide) #tactic-team .tactic-unit > [data-focus-hero] { grid-row:3; }
  :where(.arena-wide) #tactic-team .tactic-unit > [data-focus-hero][data-index="0"] { grid-column:1/3; }
  :where(.arena-wide) #tactic-team .tactic-unit > [data-focus-hero][data-index="1"] { grid-column:3; }
  :where(.arena-wide) .room.playing { position:relative; }
  :where(.arena-wide) .room.playing > .room-line { position:absolute; right:4px; top:4px; z-index:1; }
  :where(.arena-wide) .playing > .room-line > div:first-child { display:none; }
  :where(.arena-wide) .room.playing .scoreboard { padding-right:86px; }
  :where(.arena-wide) .room.playing .room-exit { min-height:32px; }
  :where(.arena-wide) .result-banner { padding:6px; }
  :where(.arena-wide) .result-banner .victory-cup { width:34px; height:28px; }
  :where(.arena-wide) .result-banner h2 { font-size:28px; }
  :where(.arena-wide) .result-score { margin-top:3px; }
  :where(.arena-wide) .result-score strong { font-size:24px; }
  :where(.arena-wide) .in-final .settled { max-width:860px; }
  :where(.arena-wide) .in-final .result-actions button { min-height:40px; }
  :where(.arena-wide:not(.board-wide)) .playing .arena-grid, :where(.arena-wide:not(.board-wide)) .arena .match { grid-template-columns:minmax(0,22fr) minmax(0,56fr) minmax(0,22fr); grid-template-areas:"blue center red"; grid-template-rows:minmax(0,1fr); }
  :where(.arena-wide:not(.board-wide)) .playing .score-center { display:flex; align-items:center; gap:12px; }
  :where(.arena-wide:not(.board-wide)) .playing .score-center .pick-count { font-size:11px; }
  :where(.arena-wide:not(.board-wide)) .playing .slots, :where(.arena-wide:not(.board-wide)) .arena .positions { grid-template-columns:1fr; gap:4px; }
  :where(.arena-wide:not(.board-wide)) .playing .slot, :where(.arena-wide:not(.board-wide)) .arena .position { display:grid; grid-template-columns:minmax(44px,34%) minmax(0,1fr); align-items:start; gap:0 4px; border-top:1px solid #304059; }
  :where(.arena-wide:not(.board-wide)) .slot > small, :where(.arena-wide:not(.board-wide)) .position .pos-label { grid-column:1; grid-row:2; text-align:center; margin:0; font-size:12px; color:#a6b6cc; }
  :where(.arena-wide:not(.board-wide)) .slot > .hero-card, :where(.arena-wide:not(.board-wide)) .position > .hero-slot { grid-area:1/1; }
  :where(.arena-wide:not(.board-wide)) .slot > .card-tactics, :where(.arena-wide:not(.board-wide)) .position > .card-tactics { grid-column:2; grid-row:1/3; }
  :where(.arena-wide:not(.board-wide)) .slot .card-tactics, :where(.arena-wide:not(.board-wide)) .position .card-tactics { display:flex; flex-wrap:wrap; align-content:flex-start; gap:1px 3px; }
  :where(.arena-wide:not(.board-wide)) .slot .card-tactics > :is(span,button), :where(.arena-wide:not(.board-wide)) .position .card-tactics > :is(span,button) { flex-basis:100%; }
  :where(.arena-wide:not(.board-wide)) .slot .card-tactics small, :where(.arena-wide:not(.board-wide)) .position .card-tactics small { line-height:1.25; }
  :where(.arena-wide:not(.board-wide)) .slot .learn-slot, :where(.arena-wide:not(.board-wide)) .position .learn-slot { min-height:20px; }
  :where(.arena-wide:not(.board-wide)) .slot .sealed small, :where(.arena-wide:not(.board-wide)) .position .sealed small { display:none; }
  :where(.arena-wide:not(.board-wide)) .slot .sealed::after, :where(.arena-wide:not(.board-wide)) .position .sealed::after { content:"配置未公开"; font-size:12px; color:#a6b6cc; }
  :where(.arena-wide:not(.board-wide)) .playing .hero-card, :where(.arena-wide:not(.board-wide)) .arena .hero-slot { min-height:46px; max-height:58px; }
  :where(.arena-wide:not(.board-wide)) .slot:has(.blank), :where(.arena-wide:not(.board-wide)) .position:has(.hero-slot:not(.filled)) { align-items:center; min-height:46px; border:1px dashed #3b4d66; border-radius:4px; padding:2px 5px; }
  :where(.arena-wide:not(.board-wide)) .slot:has(.blank) > small, :where(.arena-wide:not(.board-wide)) .position:has(.hero-slot:not(.filled)) .pos-label { grid-area:1/1; }
  :where(.arena-wide:not(.board-wide)) .slot .hero-card.blank, :where(.arena-wide:not(.board-wide)) .position .hero-slot:not(.filled) { grid-area:1/2; }
  :where(.arena-wide:not(.board-wide)) .slot .hero-card.blank, :where(.arena-wide:not(.board-wide)) .position .hero-slot:not(.filled) { width:100%; height:40px; min-height:0; aspect-ratio:auto; border:none; background:transparent; }
  :where(.arena-wide:not(.board-wide)) .playing .slot:has(.next-slot) { border-color:var(--accent); }
  .board-wide .playing .arena-grid, .board-wide .arena .match { display:grid; grid-template-columns:minmax(0,1fr) clamp(30px,5%,54px) minmax(0,1fr); grid-template-areas:"blue center red"; grid-template-rows:minmax(0,1fr); }
  .board-wide .playing .score-center { display:flex; align-items:center; gap:9px; }
  .board-wide .playing .score-center .pick-count { font-size:11px; }

}
@media (max-width:640px) and (orientation:portrait) {
  :where(.arena-portrait) .playing .round-links .room-code { display:none; }
  :where(.arena-portrait) .playing .arena-grid, :where(.arena-portrait) .arena .match { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-areas:"blue red" "center center"; grid-template-rows:minmax(65px,32%) minmax(0,1fr); }
  :where(.arena-portrait) .playing .slots, :where(.arena-portrait) .arena .positions { grid-template-columns:repeat(3,minmax(0,1fr)); }
  :where(.arena-portrait) .room-code { font-size:11px; }
  :where(.arena-portrait) .series-strip { gap:1px; }
  :where(.arena-portrait) .series-strip button { min-width:19px; }
  :where(.arena-portrait) #tactic-editor { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto minmax(50px,20%) auto minmax(0,1fr) auto; grid-template-areas:"summary summary" "preset preset" "team team" "tabs adjust" "content content" "foot foot"; }
  :where(.arena-portrait) #tactic-team { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  :where(.arena-portrait) #tactic-team .tactic-unit { display:flex; flex-direction:column; align-items:stretch; gap:2px; }
  :where(.arena-portrait) #tactic-team .tactic-unit { position:relative; }
  :where(.arena-portrait) #tactic-team .tactic-face { position:absolute; left:4px; top:4px; }
  :where(.arena-portrait) #tactic-team .tactic-face img { width:23px; height:24px; }
  :where(.arena-portrait) #tactic-team .tactic-unit:not(.vacant) > b { min-height:24px; padding-left:26px; white-space:normal; line-height:1.1; }
  :where(.arena-portrait) #tactic-scroll { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:1024px) and (max-height:320px) and (orientation:landscape) {
  .playing .draft-pool { display:grid; grid-template-columns:auto minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); gap:3px; }
  .playing .draft-pool .section-head { flex-wrap:wrap; align-content:center; max-width:84px; }
  .playing .draft-pool .section-head > span { display:none; }
  .playing .draft-pool #cards { grid-column:1/-1; }
}

/* Android WebViews may keep the viewport upright. Rotate the game and its top-layer dialogs
   around the same visible rectangle so native touch hit testing follows the displayed controls. */
html.arena-rotated, .arena-rotated body { height:100%; overflow:hidden; }
.arena-rotated body > :is(#app, .arena) {
  position:fixed; inset:var(--arena-top) auto auto calc(var(--arena-left) + var(--arena-height));
  width:var(--arena-width); height:var(--arena-height); max-width:none; margin:0;
  transform-origin:0 0; transform:rotate(90deg); overflow:auto;
  padding:max(3px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom))
          max(3px,env(safe-area-inset-left)) max(5px,env(safe-area-inset-top));
}
.arena-rotated .in-match > #app, .arena-rotated body > .arena { overflow:hidden; }
.arena-rotated body > dialog[open] {
  position:fixed; inset:calc(var(--arena-top) + var(--arena-width) / 2) auto auto calc(var(--arena-left) + var(--arena-height) / 2);
  margin:0; transform:translate(-50%, -50%) rotate(90deg);
  width:min(490px, calc(var(--arena-width) - 12px)); max-width:calc(var(--arena-width) - 8px);
  max-height:calc(var(--arena-height) - 8px);
}
.arena-rotated body > :where(dialog.large, #modal:not(.narrow)):not(.tactics-window)[open] { width:min(790px, calc(var(--arena-width) - 12px)); }
.arena-rotated body > dialog.tactics-window[open] {
  width:var(--arena-width); height:var(--arena-height); max-width:none; max-height:none;
  padding:env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left) env(safe-area-inset-top);
}
.arena-rotated #duel-dialog[open] { inset:calc(var(--arena-top) + var(--arena-width) / 2) auto auto calc(var(--arena-left) + var(--arena-height) / 2); }
.turn-flash {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  margin: auto;
  width: min(540px, 92vw);
  height: max-content;
  padding: 10px;
  text-align: center;
  border: 0;
  background: linear-gradient(106deg, transparent 3%, #101826ea 28%, #142031fa 52%, #101826ea 72%, transparent 97%);
  color: var(--accent);
  animation: flash-turn var(--turn-flash-duration,1050ms) both;
}
.turn-flash::before, .turn-flash::after {
  content: "";
  position: absolute;
  inset: 0 5% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.turn-flash::after { inset: auto 5% 0; }
.turn-flash b, .turn-flash small { display: block; }
.turn-flash b { font-size: clamp(22px, 3vw, 34px); letter-spacing: .12em; }
.turn-flash small { font: 700 .68rem/1.6 Consolas, monospace; letter-spacing: .3em; }
.turn-flash::backdrop { pointer-events: none; background: transparent; }
@keyframes flash-turn {
  0% { opacity: 0; transform: scale(.96); }
  20%, 70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.025); }
}
.reduce-motion .turn-flash { display: none; }
@media (prefers-reduced-motion: reduce) { .turn-flash { display: none; } }
.turn-flash.blue { --accent:#9ac6ff; }
.turn-flash.red { --accent:#ffaba0; }
@media (max-width:640px), (max-width:1024px) and (max-height:550px) {
  :is(.arena,.playing) :is(.board-heading,.squad-head) .choose:is([data-pick],[data-act=board-pick]) {
    color:#191b21; background:#f0ce8d; border-color:#ffe3a6; font-weight:700;
  }
  .arena .phase .my-turn { color:#ffe2a2; font-weight:700; }
}
.arena-rotated .turn-flash { rotate:90deg; width:min(540px, var(--arena-width)); }
.arena-rotated #notice {
  inset:calc(var(--arena-top) + var(--arena-width) / 2) auto auto calc(var(--arena-left) + 22px);
  transform:translate(-50%, -50%) rotate(90deg); max-width:calc(var(--arena-width) - 16px);
}
/* Landscape clients use the desktop practice board hierarchy at touch-friendly sizes. */
.history-shortcut { display:none; }
:is(.board-wide,.online-board) .has-squad-history :is(.board-picker,.tactics-window) .history-shortcut {
  display:block; flex:none; width:auto; min-width:74px; height:34px; min-height:34px; margin:0 8px 0 auto; padding:4px 8px;
  border:1px solid #42506a; border-radius:5px; background:#222d40; color:#dae4f1; white-space:nowrap; font:600 13px/1.2 system-ui;
}
:is(.board-wide,.online-board) .board-heading { display:flex; min-height:32px; align-items:center; gap:7px; }
:is(.board-wide,.online-board) .board-heading h2 { margin:0; font-size:16px; color:var(--tint,var(--accent)); }
:is(.board-wide,.online-board) .board-heading > span { font-size:12px; color:#b8c4d7; }
:is(.board-wide,.online-board) .board-heading .choose { min-height:30px; border:1px solid #716345; border-radius:5px; background:#342f29; color:#edd39a; padding:3px 7px; font-size:12px; }
:is(.board-wide,.online-board) .board-heading .choose:first-of-type { margin-left:auto; }
:is(.board-wide,.online-board) :is(.playing .team-panel, .match .team) {
  display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:3px; overflow:auto; margin:0;
  border:1px solid #354158; border-top:3px solid var(--accent); padding:3px 6px;
  background:linear-gradient(155deg,#192235,#151c2c 82%);
}
:is(.board-wide,.online-board) .board-slots { container-type:size; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:2px 4px; min-height:0;
  background:linear-gradient(140deg,#252d43,#20273c); border:1px solid #313b50; border-radius:6px; overflow:auto; }
:is(.board-wide,.online-board) .board-slots > :is(.slot,.position) { display:flex; min-height:0; align-items:center; flex-direction:column; gap:1px; }
:is(.board-wide,.online-board) .board-slots :is(.slot > small,.pos-label) { flex:none; margin:0; color:#b6c3d8; font:12px/15px system-ui; }
:is(.board-wide,.online-board) .board-slots :is(.hero-slot,.hero-card) { flex:1 1 auto; position:relative; width:100%; max-width:94px; min-height:44px; max-height:132px; aspect-ratio:auto; margin:0; padding:0; border-radius:4px; overflow:hidden; }
:is(.board-wide,.online-board) .board-slots :is(.hero-slot,.hero-card) img { width:100%; height:100%; object-fit:cover; object-position:50% 24%; }
:is(.board-wide,.online-board) .board-slots .card-base { display:none; }
:is(.board-wide,.online-board) .board-slots .card-tactics { grid-template-columns:repeat(2,minmax(0,1fr)); flex:none; width:100%; max-width:110px; display:grid; gap:1px; margin:0; }
:is(.board-wide,.online-board) .board-slots .card-tactics > small { display:none; }
:is(.board-wide,.online-board) .board-slots .card-tactics > span { grid-column:1/-1; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font:12px/15px system-ui; }
:is(.board-wide,.online-board) .board-slots .card-tactics .learn-slot { min-height:22px; padding:1px 3px; text-align:center; font-size:12px; line-height:1.1; }
:is(.board-wide,.online-board) .board-slots .sealed::after { grid-column:1/-1; content:"配置未公开"; text-align:center; color:#acb8ce; font-size:11px; }
:is(.board-wide,.online-board) :is(.arena .versus,.board-vs) { display:grid; grid-area:center; place-items:center; background:#121625; border-radius:6px; color:#f4eee5; font:italic bold 21px Georgia,serif; }
:is(.board-wide,.online-board) .vs-inner strong { font-size:21px; }
:is(.board-wide,.online-board) .vs-inner .vs-side { font-size:11px; }
:is(.board-wide,.online-board) .board-progress > div:first-child { color:#b7c5da; font:11px/15px system-ui; }
:is(.board-wide,.online-board) .board-rounds { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:3px; }
:is(.board-wide,.online-board) .board-round { display:grid; gap:1px; min-width:0; padding:1px 2px; margin:0; color:#c1cbe0; border:1px solid #384259; border-radius:4px; background:#20283c; opacity:1; font:11px/13px system-ui; }
:is(.board-wide,.online-board) .board-round.current-round { border-color:#8e9fb8; }
:is(.board-wide,.online-board) .board-round small { font:inherit; }
:is(.board-wide,.online-board) .board-round.won small { color:#a6d9ad; }
:is(.board-wide,.online-board) .board-round.lost small { color:#edaaa4; }
:is(.board-wide,.online-board) .board-round .mini-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; }
:is(.board-wide,.online-board) .board-round .mini-card { display:block; min-width:0; height:clamp(14px,calc(var(--arena-height) / 18),27px); aspect-ratio:auto; border:1px solid #424d62; background:#192031; overflow:hidden; }
:is(.board-wide,.online-board) .board-round img { width:100%; height:100%; object-fit:cover; object-position:center 24%; display:block; }
:is(.board-wide,.online-board) .board-bans { display:flex; align-items:center; justify-content:space-between; border:1px solid #354158; background:#101726; border-radius:5px; padding:2px 6px; }
:is(.board-wide,.online-board) .board-bans > div { display:flex; align-items:center; gap:3px; color:var(--accent); font:600 11px system-ui; }
:is(.board-wide,.online-board) .board-bans .red { flex-direction:row-reverse; }
:is(.board-wide,.online-board) .ban-face { display:grid; place-items:center; width:30px; height:23px; padding:0; overflow:hidden; border:1px solid #39445b; border-radius:3px; color:#acb6ca; background:#212a3e; }
:is(.board-wide,.online-board) .ban-face img { width:100%;height:100%;object-fit:cover;object-position:50% 18%;filter:grayscale(.9); }
:is(.board-wide,.online-board) .playing .round-links .series-strip { display:none; }
:is(.board-wide,.online-board) .round-links > [data-act=journal] { display:inline-flex; }
:is(.board-wide,.online-board) .playing .round-links { justify-content:center; }
:is(.board-wide,.online-board) .playing .round-links .room-code { margin-right:auto; }
:is(.board-wide,.online-board) dialog.board-picker[open], :is(.board-wide,.online-board) dialog.board-history[open] {
  width:calc(var(--arena-width) - 12px); max-width:calc(var(--arena-width) - 12px);
  height:calc(var(--arena-height) - 8px); max-height:calc(var(--arena-height) - 8px); padding:0; overflow:hidden;
}
:is(.board-wide,.online-board) dialog.board-picker :is(#modal-body,#dialog-body) {
  display:flex; flex:1; flex-direction:column; min-height:0; gap:4px; overflow:hidden; padding:4px 9px; }
:is(.board-wide,.online-board) .board-picker #modal-eyebrow { display:none; }
:is(.board-wide,.online-board) .board-picker .pool-tools { flex:none; display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin:0; }
:is(.board-wide,.online-board) .board-picker .pool-tools input[type=search] { width:auto; min-width:110px; max-width:230px; flex:1; height:34px; margin:0; font-size:16px; }
:is(.board-wide,.online-board) .board-picker .filters { display:flex; gap:3px; flex-wrap:wrap; align-items:center; }
:is(.board-wide,.online-board) .board-picker .filters button, :is(.board-wide,.online-board) .board-picker .pool-tools select { width:auto; min-height:28px; padding:2px 4px; font-size:12px; }
:is(.board-wide,.online-board) .board-picker :is(#cards,#pool) { flex:1; min-height:48px; max-height:none; display:grid; grid-template-columns:repeat(auto-fill,minmax(74px,1fr)); grid-auto-rows:100px; align-content:start; gap:5px; overflow:auto; overscroll-behavior:contain; }
:is(.board-wide,.online-board) .board-picker :is(.pool-card,.general) { width:100%; height:100%; padding:0; aspect-ratio:auto; }
:is(.board-wide,.online-board) .board-picker .selected { outline:2px solid #efd08f; outline-offset:-2px; }
:is(.board-wide,.online-board) .board-picker .pool-card.available em { display:block; }
:is(.board-wide,.online-board) .board-picker .pick-foot { flex:none; display:flex; align-items:center; justify-content:flex-end; gap:8px; margin:0; padding:2px 0; }
:is(.board-wide,.online-board) .board-picker .pick-foot span { margin-right:auto; }
:is(.board-wide,.online-board) .board-picker .pick-foot button { min-height:40px; margin:0; }
.board-wide #tactic-scroll { grid-template-columns:repeat(auto-fill,minmax(122px,1fr)); gap:6px; }
.board-wide #tactic-scroll .skill-card { min-height:48px; }
.board-history[open] { display:flex; flex-direction:column; }
.board-history header,.board-history nav { display:flex; align-items:center; gap:6px; padding:4px 9px; }
.board-history header { justify-content:space-between; border-bottom:1px solid #37455e; }
.board-history h2 { font-size:18px; margin:0; }
.board-history button { padding:6px 12px; min-height:34px; border-radius:4px; background:#28354a;color:#e4e9f2; }
.board-history nav { flex-wrap:wrap; padding:0; }
.board-history nav [aria-pressed=true] { outline:1px solid #dfbd7e; color:#eed59f; }
.board-history-content { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:8px 12px; }
.board-history-content > h3 { margin:6px 0; }
.board-history .archive-trio { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
:is(.board-wide,.online-board) .board-slots :is(.hero-card,.hero-slot) { flex:none; width:auto; height:clamp(44px,calc(100cqh - 59px),135px); max-width:100%; aspect-ratio:.82; }
:is(.board-wide,.online-board) .board-slots :is(.hero-card,.hero-slot) :is(.card-stars,.card-faction,.slot-name) { position:absolute; z-index:1; }
:is(.board-wide,.online-board) .board-slots .card-stars { top:1px; right:1px; font:8px/1.2 Georgia,serif; color:#ffe397; text-shadow:0 1px 3px #000; }
:is(.board-wide,.online-board) .board-slots .card-faction { top:0; left:0; padding:0 2px; font:bold 11px/1.3 serif; color:#d9e4f1; background:#172235c9; }
:is(.board-wide,.online-board) .board-slots :is(.hero-card,.hero-slot.filled) .slot-name { inset:auto 0 0; padding:5px 1px 1px; writing-mode:horizontal-tb; color:#fff2db; background:linear-gradient(transparent,#121523ed 55%); font:600 12px/15px system-ui; text-align:center; }
:is(.board-wide,.online-board) .board-slots .learn-slot { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
:is(.board-wide,.online-board) .board-slots .learn-slot.vacant-slot { font-size:0; }
:is(.board-wide,.online-board) .board-slots .vacant-slot::after { font:12px/1.3 system-ui; }
:is(.board-wide,.online-board) .board-slots .vacant-slot[data-slot="0"]::after { content:"＋战法1"; }
:is(.board-wide,.online-board) .board-slots .vacant-slot[data-slot="1"]::after { content:"＋战法2"; }
:is(.board-wide,.online-board) .board-vs .vs-inner { display:grid; justify-items:center; gap:8px; }
:is(.board-wide,.online-board) .board-vs .vs-inner span { font:600 11px system-ui; color:var(--accent); }
:is(.board-wide,.online-board) .board-bans .ban-face { position:relative; }
:is(.board-wide,.online-board) .ban-face em { position:absolute; bottom:0; inset-inline:0; font:9px/11px system-ui; color:white; background:#121720b8; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
:is(.board-wide,.online-board) .board-picker .filters > label { display:inline-flex; flex:none; width:auto; min-width:max-content; align-items:center; gap:4px; margin:0; white-space:nowrap; font-size:12px; }
:is(.board-wide,.online-board) .board-picker .filters > label input { flex:none; width:15px; min-width:0; height:15px; margin:0; padding:0; }
:is(.board-wide,.online-board) .board-picker [data-board-faction][aria-pressed=true] { border-color:#b6995d; color:#f1d79a; background:#443c2e; }
:is(.board-wide,.online-board) .board-heading .choose:disabled { opacity:.7; }
.board-wide #turn.done { display:none; }

.online-board .playing .arena-grid {
  display:grid; align-items:stretch; grid-template-areas:"blue center red";
  grid-template-columns:minmax(0,1fr) clamp(24px,5%,64px) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr);
}
.online-board .team-panel.blue { grid-area:blue; }
.online-board .team-panel.red { grid-area:red; }
.online-board .board-heading { flex-wrap:wrap; }
.online-board .board-heading h2,.online-board .board-heading .choose { white-space:nowrap; }
.online-board dialog.board-picker[open] { display:flex; flex-direction:column; }
.online-board .board-slots .card-tactics { min-width:0; }

@media (min-width:1025px), (min-width:641px) and (min-height:551px) {
  .online-board .playing .arena-grid { height:clamp(325px,45vh,470px); gap:10px; }
  .online-board .playing .team-panel { padding:9px; gap:8px; }
  .online-board .board-heading h2 { font-size:21px; }
  .online-board .board-heading > span,.online-board .board-heading .choose { font-size:14px; }
  .online-board .board-slots { padding:6px; align-items:center; }
  .online-board .board-slots .hero-card { height:clamp(80px,calc(100cqh - 68px),190px); max-height:190px; }
  .online-board .board-round .mini-card { height:32px; }
  .online-board .board-bans { margin-top:9px; padding:5px 10px; }
  .online-board .board-bans > div { gap:6px; font-size:13px; }
  .online-board .ban-face { width:38px; height:35px; }
  .online-board .board-vs .vs-inner strong { font-size:32px; }
  .online-board dialog:is(.board-picker,.board-history)[open] {
    width:min(94vw,980px); height:min(84vh,760px);
  }
  .online-board .board-picker #cards { grid-template-columns:repeat(auto-fill,minmax(98px,1fr)); grid-auto-rows:136px; }
}
@media (max-width:640px) and (orientation:portrait) {
  .online-board.arena-portrait .playing .arena-grid { gap:2px; grid-template-columns:minmax(0,1fr) 22px minmax(0,1fr); }
  .online-board.arena-portrait .playing .team-panel { padding:4px 2px; gap:4px; }
  .online-board.arena-portrait .board-heading { gap:3px; }
  .online-board.arena-portrait .board-heading .choose { min-height:32px; padding:2px 4px; }
  .online-board.arena-portrait .board-slots { gap:2px; padding:4px 1px; align-items:center; }
  .online-board.arena-portrait .board-slots .hero-card { width:100%; height:auto; aspect-ratio:2/3; }
  .online-board.arena-portrait .board-slots .card-tactics { grid-template-columns:minmax(0,1fr); }
  .online-board.arena-portrait .board-slots .learn-slot { min-height:28px; }
  .online-board.arena-portrait .board-rounds { gap:1px; }
  .online-board.arena-portrait .board-round { padding:2px 0; }
  .online-board.arena-portrait .board-round .mini-row { gap:0; }
  .online-board.arena-portrait .board-round .mini-card { height:19px; }
  .online-board.arena-portrait .board-vs .vs-inner strong { font-size:15px; }
  .online-board.arena-portrait .playing .round-links { flex-wrap:wrap; gap:3px; }
}
.arena-wide body > dialog.round-summary[open] {
  width:min(960px,calc(var(--arena-width) - 8px)); max-width:calc(var(--arena-width) - 8px);
  height:calc(var(--arena-height) - 8px); max-height:calc(var(--arena-height) - 8px); padding:0;
}
.arena-wide .round-summary :is(.modal-head,.dialog-head) { padding:2px 10px; min-height:30px; }
.arena-wide .round-summary .dialog-head > div { display:flex; align-items:center; gap:10px; }
.arena-wide .round-summary .dialog-head h2 { order:-1; }
.arena-wide .round-summary :is(.modal-head,.dialog-head) button { min-height:30px; height:30px; }
.arena-wide .round-summary :is(#dialog-body,#modal-body) {
  display:flex; flex:1; flex-direction:column; gap:3px; height:auto; min-height:0; padding:3px 8px; overflow:hidden;
}
.arena-wide .round-summary .result-banner { flex:none; display:flex; align-items:center; justify-content:center; gap:18px; padding:3px 8px; }
.arena-wide .round-summary .result-banner h2 { margin:0; font-size:21px; }
.arena-wide .round-summary .result-en { display:none; }
.arena-wide .round-summary .result-score { margin:0; gap:10px; }
.arena-wide .round-summary .result-score strong { font-size:22px; }
.arena-wide .round-summary .result-player img { width:20px; height:22px; }
.arena-wide .round-summary #round-archive { flex:1; overflow:auto; min-height:0; overscroll-behavior:contain; }
.arena-wide .round-summary .record-teams.report-teams { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:0; }
.arena-wide .round-summary .archive-team { padding:3px 5px; }
.arena-wide .round-summary .archive-team h3,.arena-wide .round-summary .result-round-count { margin:0; font-size:12px; line-height:16px; }
.arena-wide .round-summary .archive-trio { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
.arena-wide .round-summary .archive-face {
  height:clamp(42px,calc(var(--arena-height) * .23 - 12px),100px); width:auto; min-width:min(100%,52px);
  max-width:100%; margin:auto; aspect-ratio:0.82;
}
.arena-wide .round-summary .archive-face img { object-fit:contain; }
.arena-wide .round-summary .card-tactics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px 2px; margin:2px 0; }
.arena-wide .round-summary .card-tactics > :is(span,small) { grid-column:1/-1; }
.arena-wide .round-summary .archive-slot { min-height:0; }
.arena-wide .round-summary .army-stats span { line-height:1.2; }
.arena-wide .round-summary .army-stats { margin-top:2px; padding-top:2px; }
.arena-wide .round-summary .result-footer { flex:none; position:static; padding:1px 0; }
.arena-wide .round-summary .result-footer button { min-height:30px; padding:3px 10px; }
.online-board #picker-clock { margin-inline:8px auto; font:700 16px/1.2 monospace; color:#f3ddb4; }
.online-board #picker-clock[data-warning=urgent] { color:#ffa098; }
.online-board .board-bans .current-ban { border-color:var(--accent); color:var(--accent); }
@media (max-width:640px) and (orientation:portrait) and (min-height:620px) {
  .online-board.arena-portrait .board-rounds { grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }
  .online-board.arena-portrait .board-round { grid-template-columns:auto 1fr; align-items:center; gap:2px; padding:2px; }
  .online-board.arena-portrait .board-round .mini-row { grid-row:2; grid-column:1/-1; gap:1px; }
  .online-board.arena-portrait .board-round .mini-card { height:24px; }
  .online-board.arena-portrait .board-slots > .slot { align-self:start; padding-top:7px; }
  .online-board.arena-portrait .board-slots { align-content:center; }
}
