/* One enemy layout at every viewport: intent, whole square portrait, body. */
.enemy-row{align-items:stretch;padding:10px 12px 12px;gap:12px;height:auto}
.unit-card.enemy-card{display:flex;flex-direction:column;align-items:stretch;position:relative;width:clamp(112px,13vw,176px);flex:0 1 176px;height:auto;min-height:0;max-height:none;min-width:0;padding:6px;gap:6px;overflow:visible}
.enemy-card .enemy-intent{position:static;inset:auto;transform:none;width:100%;max-width:none;min-height:0;padding:5px 6px;white-space:normal;overflow:visible;overflow-wrap:anywhere;text-overflow:clip;line-height:1.3;text-align:center;background:#293528;color:#f1e5c7;border:1px solid #7c865d}
.enemy-card .enemy-figure{position:relative;inset:auto;display:block;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:1;flex:none;overflow:hidden;border-radius:4px;background:#ddcfad}
.enemy-card .enemy-figure:before{inset:0;width:100%;height:100%;aspect-ratio:1;transform:none;background-size:300% 200%;background-position:var(--enemy-portrait)}
.enemy-card .unit-body{position:static;inset:auto;width:100%;min-width:0;min-height:0;margin-top:auto;padding:7px 8px;background:#1b251f;color:#f8edd2;border-top:1px solid #958465;border-radius:0 0 4px 4px;z-index:3}
.enemy-card .unit-name{display:block;white-space:normal;overflow:visible;overflow-wrap:anywhere;text-overflow:clip;-webkit-line-clamp:unset;line-height:1.3;min-height:0;color:#f8edd2;text-shadow:none}
.enemy-card .unit-role{display:none}
.enemy-card .unit-stats{color:#e5ddc8;gap:4px 7px}
.enemy-card .hp-track{margin-top:5px}
.enemy-card .shield-pill{position:static;align-self:flex-end;margin-top:0}
.formation-board{--formation-card-width:clamp(132px,14vw,190px);justify-items:center;overflow-x:auto}
.formation-board[data-capacity="3"]{grid-template-columns:repeat(3,minmax(126px,1fr))!important}
.formation-board[data-capacity="4"]{grid-template-columns:repeat(4,minmax(126px,1fr))!important}
.formation-board .formation-slot{width:min(100%,calc(var(--formation-card-width) + 14px));max-width:calc(var(--formation-card-width) + 14px);justify-self:center;min-height:0;height:auto;padding:6px;background:#1620163d}
.formation-board .formation-slot .unit-card{width:100%;max-width:var(--formation-card-width);height:236px;flex:0 0 auto}
.formation-board .formation-content{min-width:0;min-height:0;width:100%}
.formation-board .formation-empty{width:100%;max-width:var(--formation-card-width);height:236px;min-height:0}
.formation-board .formation-label{line-height:1.2;margin:0 0 6px}

/* The field and reserve share the left column; the sidebar spans both rows. */
@media (min-width: 1000px) and (min-height: 680px) {
  main.shell:has(> .run-layout) {
    --rail: clamp(244px, 21vw, 310px);
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    padding: 8px clamp(12px, 1.6vw, 30px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--rail);
    grid-template-rows: 40px 34px minmax(0, 1fr) 104px 18px;
    gap: 8px 14px;
  }
  main.shell:has(> .hand-panel) {
    grid-template-rows: 40px 34px minmax(0, 1fr) clamp(112px, 18dvh, 160px) 104px 18px;
  }
  main.shell > .topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    height: auto;
    min-height: 0;
  }
  main.shell > .run-heading {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 0;
    min-height: 0;
  }
  .run-heading h2 { margin: 0; font-size: var(--type-body); }
  .run-heading .eyebrow { line-height: 1.2; }
  .topbar .brand-mark { width: 28px; height: 28px; }
  .topbar .brand h1 { font-size: var(--type-body); }
  .topbar .brand small { display: none; }
  .topbar .header-right { gap: 18px; }
  main.shell > .run-layout { display: contents; }
  .run-layout > .battlefield {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 20px minmax(0, 1fr) 8px minmax(0, 1fr) 18px;
    align-content: stretch;
  }
  .battlefield .field-topline {
    padding: 3px 12px;
    min-height: 0;
    line-height: 1.2;
  }
  .battlefield .field-state { padding: 2px 6px; }
  .battlefield .enemy-row {
    min-height: 0;
    height: auto;
    padding: 10px 14px;
    gap: clamp(14px, 2vw, 32px);
    align-items: stretch;
  }
  .battlefield .enemy-card {
    width: clamp(130px, 13vw, 176px);
    flex: 0 1 176px;
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .battlefield .arena-midline {
    height: auto;
    margin: 0;
    font-size: var(--type-caption);
    line-height: 1;
  }
  .battlefield .arena-midline .crossed { font-size: var(--type-body); }
  .battlefield .formation-board {
    height: auto;
    min-height: 0;
    padding: 2px 12px 4px;
    margin: 0;
    gap: 12px;
  }
  .formation-board .formation-slot {
    height: auto;
    min-height: 0;
    width: min(100%,calc(var(--formation-card-width) + 14px));
    padding: 5px 6px;
  }
  .formation-board .formation-label { margin: 0 0 3px; line-height: 1.1; }
  .formation-board .formation-content { min-height: 0; }
  .formation-board .unit-card {
    width: 100%;
    max-width: var(--formation-card-width);
    height: 236px;
    min-height: 0;
    flex: 0 0 auto;
  }
  .formation-board .formation-empty {
    height: 236px;
    min-height: 0;
    max-height: 236px;
    padding: 4px;
    gap: 3px;
  }
  .formation-board .unit-body {
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 5px 7px;
    border-radius: 0 0 6px 6px;
    background: #e4d4aa;
    color: #382d1d;
  }
  .formation-board .unit-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.1;
    text-shadow: none;
  }
  .formation-board .unit-role { margin-top: 2px; }
  .formation-board .hp-track { margin: 4px 0 3px; }
  .formation-board .unit-card .portrait { bottom: 66px; }
  .formation-board .shield-pill { top: 35px; z-index: 4; }
  .battlefield .field-bottom {
    min-height: 0;
    margin: 0;
    padding: 0 8px;
    font-size: var(--type-caption);
    line-height: 1.2;
  }
  .run-layout > .sidebar {
    grid-column: 2;
    grid-row: 3 / -3;
    min-height: 0;
    display: flex;
    gap: 8px;
  }
  .sidebar .panel { padding: 10px 12px; min-height: 0; }
  .sidebar .route-panel h3 { display: none; }
  .sidebar .panel-copy { margin: 7px 0; line-height: 1.4; }
  .sidebar .route-options { gap: 5px; }
  .sidebar .route-option { padding: 7px 8px; gap: 7px; }
  .sidebar .route-option small { line-height: 1.25; margin-top: 2px; }
  .sidebar .route-note { margin-top: 7px; line-height: 1.35; }
  .sidebar .synergies { margin-top: 8px; gap: 7px; }
  .sidebar .synergy { gap: 7px; }
  .sidebar .relic-row { margin-top: 8px; gap: 6px; }
  .sidebar .relic-icon[data-relic] { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar .combat-summary { margin-top: 8px; gap: 6px; }
  .sidebar .battle-log { min-height: 0; margin-top: 8px; line-height: 1.35; }
  .sidebar .battle-log p { padding: 4px 0; }
  main.shell > .hand-panel {
    grid-column: 1;
    grid-row: 4;
    min-height: 0;
    margin: 0;
    padding: 5px 10px;
    display: grid;
    grid-template-rows: 26px minmax(0, 1fr);
    row-gap: 4px;
  }
  .hand-panel > .hand-heading { margin: 0; gap: 8px; flex-wrap: nowrap; }
  .hand-panel > .hand-hint { display: none; }
  .hand-panel .hand-auto { min-height: 26px; padding: 2px 9px; }
  .hand-panel .hand-strip {
    height: 100%;
    min-height: 0;
    padding: 1px 3px 8px;
    gap: 9px;
    align-items: stretch;
  }
  .hand-strip .hand-card {
    height: 100%;
    width: 222px;
    min-width: 222px;
    flex-basis: 222px;
  }
  .hand-card .portrait { inset: 0 auto 0 0; width: 74px; border-radius: 7px 0 0 7px; }
  .hand-card .unit-body { left: 82px; right: 7px; bottom: 8px; }
  .hand-card .unit-name { white-space: normal; line-height: 1.1; }
  .hand-card .unit-role { display: none; }
  .hand-card .rank { left: 5px; right: auto; top: 5px; }
  .hand-card .faction-icon { left: 5px; top: auto; bottom: 5px; width: 20px; height: 20px; }
  .hand-card .hp-track { margin: 6px 0 4px; }
  main.shell > .command-bar {
    grid-column: 1 / -1;
    grid-row: -3 / -2;
    grid-template-columns: minmax(0, 1fr) var(--rail);
    gap: 14px;
    margin: 0;
    padding: 0;
    min-height: 0;
  }
  .command-bar .spells-panel { min-height: 0; padding: 7px 10px; gap: 10px; }
  .command-bar .spells { min-height: 0; align-items: stretch; }
  .command-bar .energy-panel { width: 60px; flex-basis: 60px; padding-right: 8px; }
  .command-bar .spell {
    min-width: 0;
    min-height: 0;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-rows: 26px minmax(0, 1fr);
    gap: 2px 7px;
    align-items: center;
  }
  .command-bar .spell[data-id] .spell-glyph { width: 24px; height: 24px; margin: 0; }
  .command-bar .spell strong { padding-right: 18px; line-height: 1.1; }
  .command-bar .spell small { grid-column: 1 / -1; margin: 0; line-height: 1.2; }
  .command-bar .spell-cost { top: 7px; right: 7px; }
  .command-bar .action-panel { min-height: 0; gap: 5px; }
  .command-bar .action-panel .primary { min-height: 42px; padding: 8px 12px; }
  .command-bar .action-caption { line-height: 1.2; }
  main.shell > .run-footer {
    grid-column: 1 / -1;
    grid-row: -2 / -1;
    min-height: 0;
    margin: 0;
    line-height: 1.1;
  }
}

@media (min-width: 1000px) and (min-height: 680px) and (max-height: 850px) {
  .sidebar .route-note, .sidebar .route-panel > .panel-copy { display: none; }
  .sidebar .synergy-info small { line-height: 1.15; }
  .formation-board .unit-role { display: none; }
  .formation-board .unit-card .portrait { bottom: 56px; }
}

@media(max-width:999px),(max-height:679px){
  .enemy-row{height:auto;min-height:0;align-items:stretch}
  .unit-card.enemy-card{height:auto;max-height:none;min-height:0}
  .enemy-card .enemy-figure{position:relative;inset:auto;width:100%;height:auto;aspect-ratio:1}
  .enemy-card .unit-body,.enemy-card .enemy-intent{position:static;inset:auto;transform:none}
  .battlefield{height:auto;min-height:0;padding-bottom:12px}
  .formation-board,.ally-row.formation-board{height:auto;min-height:0;padding:10px 10px 16px;gap:8px}
}

/* Title is one viewport; its compact panel keeps every action reachable. */
.title-screen{height:100dvh;min-height:0}
.title-screen>.shell{height:100%;min-height:0;display:grid;grid-template-rows:44px minmax(0,1fr);gap:12px;padding:12px 24px}
.title-screen .topbar{height:auto;min-height:0}
.title-screen .title-body{position:fixed;inset:0;height:auto;min-height:0;padding:64px 24px;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;gap:0;pointer-events:none}
.title-screen .draft-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"heading heading" "intro intro" "choices memory" "hint memory" "start memory" "facts record";gap:8px 22px;width:min(860px,100%);max-width:860px;max-height:100%;margin:0;padding:18px 20px;overflow-y:auto;pointer-events:auto}
.title-screen .draft-panel>h2{grid-area:heading;margin:0;line-height:1.2}
.title-screen .draft-panel>p:not(.starter-description):not(.title-data){grid-area:intro;margin:0 0 4px;line-height:1.4}
.title-screen .starter-options{grid-area:choices;gap:6px}
.title-screen .starter-option{padding:8px 10px;gap:10px;min-height:53px}
.title-screen .starter-orb{width:34px;height:34px;flex:0 0 34px}
.title-screen .starter-info small{margin-top:2px;letter-spacing:0;line-height:1.25}
.title-screen .starter-description{grid-area:hint;min-height:0;margin:0;line-height:1.4}
.title-screen .draft-panel>.primary{grid-area:start;min-height:41px;padding:8px 14px}
.title-screen .title-data{font-size:var(--type-caption);line-height:1.35;color:var(--muted);margin:0}
.title-screen .draft-panel>.title-data:not(:last-child){grid-area:facts}
.title-screen .draft-panel>.title-data:last-child{grid-area:record;align-self:end}
.title-screen .meta-panel{grid-area:memory;margin:0;padding:13px 14px;align-self:stretch}
.title-screen .meta-heading{gap:8px}
.title-screen .meta-heading .meta-icon{width:36px;height:36px;flex-basis:36px}
.title-screen .meta-summary{margin:10px 0;padding:8px 0;gap:8px}
.title-screen .meta-upgrade{min-height:38px;padding:8px 10px}
.title-screen .meta-note{margin-top:8px;line-height:1.4}
@media(max-width:699px){.title-screen>.shell{padding:10px 14px;gap:8px;grid-template-rows:40px minmax(0,1fr)}.title-screen .draft-panel{display:block;padding:16px;max-width:460px}.title-screen .draft-panel>h2{margin-bottom:6px}.title-screen .starter-options{margin-top:12px}.title-screen .starter-description{margin:10px 0}.title-screen .meta-panel{margin:12px 0}.title-screen .title-data{margin-top:7px}}

/* Desktop: field, reserve and spells share one viewport without page scroll. */
@media(min-width:1000px) and (min-height:680px){
  main.shell:has(>.run-layout){gap:6px 12px;padding:6px clamp(12px,1.6vw,30px)}
  .run-layout>.battlefield{--battle-art-size:clamp(75px,calc(31.25dvh - 150px),110px);padding-bottom:0}
  .battlefield .enemy-row{height:100%;padding:2px 10px;align-items:center;gap:16px}
  .battlefield .unit-card.enemy-card{width:clamp(170px,18vw,224px);flex:0 1 224px;height:auto;min-height:0;max-height:none;padding:1px;gap:2px}
  .battlefield .enemy-card .enemy-intent{padding:1px 4px;line-height:1.1;font-size:var(--type-caption)}
  .battlefield .enemy-card .enemy-figure{width:var(--battle-art-size);height:var(--battle-art-size);max-width:100%;aspect-ratio:1;align-self:center;flex:none}
  .battlefield .enemy-card .unit-body{padding:3px 6px}
  .battlefield .enemy-card .unit-name{line-height:1.05;font-size:var(--type-body)}
  .battlefield .enemy-card .unit-stats{font-size:var(--type-body);line-height:1.05}
  .battlefield .enemy-card .hp-track{height:3px;margin:3px 0 2px}
  .battlefield .enemy-card .shield-pill{position:absolute;right:3px;top:26px;z-index:4}
  .battlefield .formation-board{--formation-card-width:clamp(148px,16vw,180px);height:100%;padding:1px 10px 2px;gap:10px;align-items:center;overflow-y:visible}
  .formation-board .formation-slot{height:auto;min-height:0;padding:3px 5px;align-self:center}
  .formation-board .formation-label{margin-bottom:3px;line-height:1.1}
  .formation-board .formation-content{flex:0 0 auto}
  .formation-board .formation-slot .unit-card{display:grid;grid-template-rows:var(--battle-art-size) auto;height:auto;min-height:0;max-height:none;width:100%;max-width:var(--formation-card-width)}
  .formation-board .unit-card .portrait{position:relative;inset:auto;width:var(--battle-art-size);height:var(--battle-art-size);justify-self:center;border-radius:3px}
  .formation-board .unit-body{position:static;inset:auto;width:100%;padding:3px 5px;line-height:1.05}
  .formation-board .unit-name{line-height:1.05;font-size:var(--type-body)}
  .formation-board .unit-role{display:none}
  .formation-board .hp-track{height:3px;margin:3px 0 2px}
  .formation-board .unit-stats{line-height:1.05;font-size:var(--type-body)}
  .formation-board .formation-empty{height:calc(var(--battle-art-size) + 52px);max-height:none}
  .formation-board .unit-card .rank{right:3px;top:3px;padding:2px 3px;gap:3px}
  .formation-board .unit-card .faction-icon{left:3px;top:3px;width:20px;height:20px}
  .formation-board .ranksteps{gap:2px}
  .formation-board .ranksteps i{width:5px;height:5px}
  .battlefield .field-topline{padding:1px 10px}
  .battlefield .field-bottom{line-height:1.1}
  .battlefield .arena-midline{line-height:1}
  .stamina-meter.header-stat small:not(.stamina-timer){display:none}
  .stamina-meter.header-stat .stamina-timer{display:block;font-size:var(--type-caption);line-height:1.1;margin-top:1px}
  .stamina-meter.header-stat strong{font-size:var(--type-body);line-height:1.1}
  .energy-label .resource-plus{min-width:18px;width:18px;height:18px}
}
@media(min-width:1000px) and (min-height:680px) and (max-height:760px){
  main.shell:has(>.run-layout){grid-template-rows:34px 26px minmax(0,1fr) 92px 14px;gap:5px 12px;padding:5px 12px}
  main.shell:has(>.hand-panel){grid-template-rows:34px 26px minmax(0,1fr) 100px 92px 14px}
  .run-heading h2,.run-heading .eyebrow{line-height:1}
  .journey-node{width:22px;height:22px}
  .journey-line{width:16px}
  .hand-panel>.hand-heading{gap:6px}
  .hand-panel .hand-auto{font-size:var(--type-caption);min-height:24px}
  .hand-panel .hand-strip{padding-bottom:3px}
  .hand-strip .hand-card{width:222px;min-width:222px;flex-basis:222px}
  .hand-card .unit-body{bottom:4px}
  .hand-card .hp-track{margin:3px 0 2px}
  .command-bar .spells-panel{padding:5px 8px}
  .command-bar .spell{padding:4px 6px;grid-template-rows:22px minmax(0,1fr)}
  .command-bar .spell small{line-height:1.1}
  .command-bar .action-panel .primary{min-height:36px;padding:6px 10px}
  .run-footer{font-size:var(--type-caption)}
}
.title-screen .stamina-meter.header-stat small:not(.stamina-timer){display:none}
.title-screen .stamina-meter.header-stat .stamina-timer{display:block;font-size:var(--type-caption);line-height:1.1}

/* Final alignment pass; keep geometry independent of typography. */
.title-screen .draft-panel{gap:10px 24px;padding:22px 24px;border-radius:8px;border-color:#b69d6b55;box-shadow:0 12px 45px #0004}
.title-screen .draft-panel>h2{font-size:var(--type-heading);font-family:var(--serif);font-weight:400;text-align:left}
.title-screen .draft-panel>p:not(.starter-description):not(.title-data){font-size:var(--type-body);color:var(--muted);line-height:1.45;max-width:680px}
.title-screen .starter-option{min-height:56px;padding:10px 12px;gap:12px;border-radius:5px}
.title-screen .starter-info strong{font-family:var(--sans);font-size:var(--type-body);font-weight:600;line-height:1.3}
.title-screen .starter-info small{font-size:var(--type-caption);font-weight:400;line-height:1.3;color:var(--muted);text-transform:none;letter-spacing:0}
.title-screen .starter-option.selected{background:#35402b;border-color:#cab07a;box-shadow:inset 3px 0 0 #cab07a}
.title-screen .starter-description{font-size:var(--type-caption);color:var(--muted);line-height:1.4}
.title-screen .draft-panel>.primary{margin-top:2px;min-height:42px}
.title-screen .title-actions{grid-area:start;display:flex;align-items:stretch;gap:8px;min-width:0;margin-top:2px}
.title-screen .title-actions>.primary,.title-screen .title-actions>.secondary{flex:1 1 0;min-width:0;min-height:42px;width:auto;margin:0;padding:8px 12px;justify-content:center;font-size:var(--type-body);line-height:1.3}
.title-screen .title-data{font-size:var(--type-caption);line-height:1.4}
.title-screen .draft-panel>.title-data:last-child{text-align:right}
.title-screen .meta-panel{padding:14px;background:#202a22;border-color:#b49b6b3d;border-radius:5px}
.title-screen .meta-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.title-screen .meta-heading .meta-icon{width:28px;height:28px;flex-basis:28px}
.title-screen .meta-heading h3{font-family:var(--sans);font-weight:600;font-size:var(--type-body)}
.title-screen .meta-balance{margin-left:auto;font-size:var(--type-body);font-weight:400;white-space:nowrap}
.title-screen .meta-summary{display:flex;flex-direction:column;align-items:flex-start;gap:5px;margin:12px 0;padding:0;border:0;font-size:var(--type-caption)}
.title-screen .meta-summary strong{font-size:var(--type-caption);font-weight:400}
.title-screen .meta-note{font-size:var(--type-caption);margin-top:10px;line-height:1.4}
.title-screen .meta-upgrade{width:100%;font-size:var(--type-body);font-weight:600;min-height:38px}
.battlefield .field-topline,.battlefield .field-state{font-size:var(--type-caption);font-weight:400;letter-spacing:0;text-transform:none}
.battlefield .enemy-intent{font-size:var(--type-caption);font-weight:400;letter-spacing:0;line-height:1.25;border-radius:3px}
.battlefield .unit-name{font-size:var(--type-body);font-weight:600;line-height:1.2}
.battlefield .unit-stats{font-size:var(--type-body);font-weight:400;line-height:1.2}
.formation-board .formation-label{font-size:var(--type-caption);font-weight:400;letter-spacing:0;text-transform:none}
.formation-board .unit-name{display:block;-webkit-line-clamp:unset;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere}
.hand-heading h3{font-size:var(--type-body);font-weight:600}
.hand-count,.hand-auto{font-size:var(--type-caption);font-weight:400}
.hand-card .unit-name{font-size:var(--type-body);font-weight:600;line-height:1.2}
.command-bar .spell strong{font-size:var(--type-body);font-weight:600;line-height:1.2}
.command-bar .spell small{font-size:var(--type-caption);line-height:1.25}
.sidebar .route-option strong{font-size:var(--type-body);font-weight:600}
.sidebar .route-option small{font-size:var(--type-caption);line-height:1.3}
.sidebar .synergy-info strong{font-weight:600;line-height:1.3}
.sidebar .synergy-info small{line-height:1.3;font-weight:400}
.sidebar .small-label,.sidebar .side-label{font-weight:400;letter-spacing:0;text-transform:none}
@media(min-width:1000px) and (min-height:680px){
  main.shell:has(>.run-layout){grid-template-rows:38px 30px minmax(0,1fr) 90px 18px;gap:6px 14px}
  main.shell:has(>.hand-panel){grid-template-rows:38px 30px minmax(0,1fr) 124px 90px 18px}
  .run-heading{align-items:center}
  .run-heading h2{font-family:var(--sans);font-size:var(--type-body);font-weight:600;line-height:1.2}
  .run-heading .eyebrow{font-size:var(--type-caption);font-weight:400;letter-spacing:0;line-height:1.3}
  .topbar .header-right{gap:14px}
  .topbar .header-stat{gap:7px}
  .battlefield .formation-board{align-items:center}
  .sidebar .panel{padding:10px 12px}
  .hand-panel .hand-heading{align-items:center}
}
@media(min-width:1000px) and (min-height:680px) and (max-height:760px){
  main.shell:has(>.run-layout){grid-template-rows:34px 26px minmax(0,1fr) 82px 14px;gap:5px 12px}
  main.shell:has(>.hand-panel){grid-template-rows:34px 26px minmax(0,1fr) 100px 82px 14px}
  .title-screen .draft-panel{padding:18px 20px;gap:8px 20px}
  .title-screen .starter-option{min-height:51px;padding:8px 10px}
  .title-screen .meta-summary{margin:9px 0}
  .title-screen .meta-note{margin-top:8px}
  .topbar .header-right{gap:10px}
  .battlefield .unit-name,.battlefield .unit-stats{line-height:1.15}
}
@media(max-width:699px){
  .title-screen .draft-panel{padding:18px}
  .title-screen .draft-panel>.title-data:last-child{text-align:left}
  .title-screen .meta-heading{flex-wrap:wrap}
  .title-screen .title-actions{margin:10px 0}
}
@media(max-width:420px){.title-screen .title-actions{flex-direction:column}}

/* Reserve room for save and language controls without stretching the header. */
.topbar .brand{min-width:0;flex:0 1 auto}
.topbar .brand h1{white-space:nowrap}
.topbar .header-right{min-width:0;flex-wrap:nowrap}
.topbar .header-stat{flex:0 0 auto}
.topbar .toolbar{flex:0 0 auto;align-items:center;gap:4px;padding-left:10px}
.topbar .icon-button{width:30px;height:30px;flex:0 0 30px;font-size:var(--type-body);line-height:1}
.language-selector{flex:0 0 auto;max-width:100%}
select.language-selector,.language-selector select{font-family:var(--sans);font-size:var(--type-caption);font-weight:400;line-height:1.2;min-width:62px;max-width:90px;height:30px;padding:4px 6px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--text)}
.language-selector label{font-family:var(--sans);font-size:var(--type-caption);font-weight:400;letter-spacing:0}
@media(min-width:1000px) and (max-width:1199px){.topbar .header-right{gap:8px}.topbar .header-stat{gap:5px}.topbar .toolbar{padding-left:8px}.topbar .brand{gap:8px}}
