body.ui-v2-active {
  --v2-bg: #100f1c;
  --v2-surface: #1b192b;
  --v2-surface2: #27243b;
  --v2-surface3: #302c47;
  --v2-line: #786d98;
  --v2-line-strong: #b8a9e0;
  --v2-text: #f4f0ff;
  --v2-muted: #c5badf;
  --v2-dim: #b8a9e0;
  --v2-accent: #a585e8;
  --v2-accent-text: #c1a8fa;
  --v2-signal: #77c8c0;
  --v2-danger: #f2726a;
  --v2-danger-text: #ff9b96;
  --v2-success: #a8cf8b;
  --v2-range-move: #4fd6a0;
  --v2-range-fire: #f2726a;
  --v2-range-los: #b07cff;
  --v2-select: #ffffff;
  --v2-overlay-alpha: .28;
  background: var(--v2-bg);
  color: var(--v2-text);
}
body.ui-v2-active > .app-shell { display: none; }
.v2-screen[hidden] { display: none; }
body.ui-v2-active.v2-screen-open .v2-head,
body.ui-v2-active.v2-screen-open .v2-layout,
body.ui-v2-active.v2-screen-open .v2-shell > .v2-controls { display: none; }
.v2-screen { display: grid; place-items: center; min-width: 0; }
.v2-screen-panel { width: min(780px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: clamp(16px, 3vw, 30px); border: 1px solid var(--v2-line-strong); border-radius: 14px; background: var(--v2-surface); }
.v2-screen-panel.v2-foundation { display: flex; flex-direction: column; min-width: 0; font: 16px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
body.ui-v2-active .game-dialog { border-color: var(--v2-line-strong); border-radius: 14px; background: var(--v2-surface); color: var(--v2-text); font: 16px/1.4 system-ui, sans-serif; }
body.ui-v2-active .game-dialog :is(h2, .dialog-kind) { color: var(--v2-accent-text); font-family: inherit; }
body.ui-v2-active .game-dialog p { color: var(--v2-muted); }
body.ui-v2-active .game-dialog button { border: 1px solid var(--v2-line-strong); border-radius: 8px; background: var(--v2-surface2); color: var(--v2-text); }
body.ui-v2-active .game-dialog button.primary { background: var(--v2-accent); color: var(--v2-bg); }
body.ui-v2-active .game-dialog button:focus-visible { outline-color: var(--v2-signal); }
body.v2-screen-open .v2-target-card,
body.ui-v2-active:has(.game-dialog[open]) :is(.v2-target-card, .v2-phase-notice, .v2-map-hover, .v2-training) { visibility: hidden; }
.v2-foundation .v2-screen-header, .v2-foundation .v2-screen-main, .v2-foundation .v2-screen-footer { min-width: 0; }
.v2-foundation .v2-screen-footer { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding-top: 12px; background: var(--v2-surface); }
.v2-foundation .v2-screen-footer .v2-screen-actions { margin-top: 0; }
.v2-foundation :is(button, select, input):focus-visible { outline: 3px solid var(--v2-accent-text); outline-offset: 2px; }
.v2-foundation button { min-height: 44px; font-size: max(12px, 1em); overflow-wrap: anywhere; }
.v2-foundation :is(p, label, span, strong) { overflow-wrap: anywhere; }
.v2-screen-panel h2 { margin: 0 0 12px; color: var(--v2-text); font-size: clamp(23px, 5vw, 36px); overflow-wrap: anywhere; }
.v2-screen-panel p { color: var(--v2-muted); overflow-wrap: anywhere; }
.v2-screen-panel:has(.v2-level-layout) { width: min(1360px, 100%); }
.v2-foundation:has(.v2-level-layout) { scroll-padding-bottom: 88px; }
.v2-screen-panel:has(.v2-menu-links) { position: relative; width: min(1440px, 100%); min-height: min(860px, calc(100dvh - 24px)); display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(28px, 7vw, 96px); background: radial-gradient(circle at 78% 44%, var(--v2-surface3) 0, var(--v2-surface) 56%); }
.v2-screen-panel:has(.v2-menu-links)::after { content: ''; position: absolute; inset: 0 0 0 52%; pointer-events: none; opacity: .34; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='156' height='135' viewBox='0 0 156 135'%3E%3Cpath d='M78 0L156 34v67l-78 34L0 101V34Z' fill='none' stroke='%23786d98' stroke-width='2'/%3E%3C/svg%3E"); background-size: 156px 135px; mask-image: linear-gradient(90deg, transparent, #000 30%); }
.v2-menu-intro, .v2-menu-links, .v2-screen-panel:has(.v2-menu-links) .v2-screen-footer { position: relative; z-index: 1; max-width: 560px; }
.v2-screen-panel:has(.v2-menu-links) .v2-screen-footer { margin-top: 0; background: transparent; }
.v2-menu-intro h2 { font-size: clamp(40px, 7vw, 72px); letter-spacing: .06em; }
.v2-menu-eyebrow { color: var(--v2-accent-text) !important; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.v2-menu-links { display: grid; gap: 10px; margin-top: 34px; }
.v2-menu-links button { width: 100%; min-height: 58px; text-align: left; font-weight: 700; }
.v2-level-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; min-height: 0; }
.v2-foundation .v2-level-layout { flex: none; }
.v2-level-list { max-height: min(70dvh, 690px); grid-auto-rows: max-content; align-content: start; }
.v2-stepped-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.v2-stepped-list > :is(.v2-level-list, .v2-library-list) { scrollbar-width: none; }
.v2-stepped-list > :is(.v2-level-list, .v2-library-list)::-webkit-scrollbar { display: none; }
.v2-foundation button.v2-list-step { display: none; flex: none; align-items: center; justify-content: center; width: 100%; min-height: 36px; padding: 0; border: 1px solid var(--v2-line); border-radius: 9px; background: var(--v2-surface2); color: var(--v2-accent-text); }
.v2-stepped-list.v2-overflowing > button.v2-list-step { display: flex; }
.v2-list-step svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.v2-foundation button.v2-list-step:disabled { opacity: .3; cursor: default; }
.v2-foundation button.v2-list-step:not(:disabled):hover { border-color: var(--v2-accent-text); background: var(--v2-surface3); }
.v2-level-choice { display: grid; gap: 2px; width: 100%; min-height: 68px; text-align: left; overflow-wrap: anywhere; }
.v2-level-choice span { color: var(--v2-muted); font-size: 13px; line-height: 1.3; }
.v2-level-choice[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-surface3); box-shadow: inset 4px 0 var(--v2-accent); }
.v2-level-detail { min-width: 0; padding: 16px; border: 1px solid var(--v2-line); border-radius: 10px; background: var(--v2-surface2); }
.v2-level-detail h3 { margin: 0 0 12px; font-size: clamp(22px, 3vw, 30px); overflow-wrap: anywhere; }
.v2-mission-map { margin: 0; overflow: hidden; border: 1px solid var(--v2-line); border-radius: 8px; background: #151b2b; }
.v2-mission-map svg { display: block; width: 100%; height: auto; }
.v2-terrain-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px 8px; margin: 8px 0 0; padding: 0; }
.v2-terrain-list li { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; line-height: 1.15; color: var(--v2-text); overflow-wrap: normal; word-break: normal; }
.v2-terrain-icon { display: block; width: 32px; height: 37.333px; flex: none; object-fit: contain; }
.v2-terrain-info { display: flex; align-items: center; gap: 8px; }
.v2-terrain-info .v2-terrain-icon { width: 48px; height: 56px; }
#intel-terrain-icon .legacy-terrain-icon { display: block; width: 48px; height: 56px; object-fit: contain; }
.v2-preview-open { fill: #28334d; stroke: #54617b; stroke-width: 1; }
.v2-preview-terrain { fill: #594e68; stroke: #9a82a7; stroke-width: 1; }
.v2-preview-tiled { fill: transparent; stroke: #00000033; stroke-width: .6; }
.v2-preview-own { fill: var(--v2-signal); stroke: #102226; stroke-width: 2; }
.v2-preview-enemy { fill: var(--v2-danger); stroke: #102226; stroke-width: 2; }
.v2-mission-stats { display: flex; gap: 10px; }
.v2-mission-stats div { flex: 1; display: grid; padding: 10px; border: 1px solid var(--v2-line); border-radius: 8px; }
.v2-mission-stats span { color: var(--v2-muted); font-size: 12px; font-weight: 700; }
.v2-mission-stats strong { font-size: 26px; }
.v2-screen-panel:has(.v2-briefing-main) { width: min(1180px, 100%); height: min(820px, calc(100dvh - 24px)); overflow: hidden; }
.v2-briefing-number { margin: 0 0 4px; color: var(--v2-accent-text); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.v2-briefing-intro { margin: 0 0 12px; line-height: 1.35; }
.v2-briefing-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto max-content auto; align-content: safe center; gap: 12px 18px; flex: 1 1 auto; min-height: 0; overflow: auto; }
/* The conditions share the map row: they stretch to the map height, a taller column centres the map instead. */
.v2-briefing-conditions { grid-column: 1; grid-row: 2; display: grid; grid-auto-rows: 1fr; gap: 10px; }
.v2-briefing-conditions > div { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 14px; border: 1px solid var(--v2-line); border-radius: 9px; background: var(--v2-surface2); }
.v2-briefing-conditions h3 { margin: 0 0 6px; color: var(--v2-text); }
.v2-briefing-conditions p { margin: 0; line-height: 1.35; }
.v2-briefing-victory { border-left: 4px solid var(--v2-signal) !important; }
.v2-briefing-defeat { border-left: 4px solid var(--v2-accent) !important; }
.v2-briefing-preview { display: contents; }
.v2-briefing-preview > * { grid-column: 2; min-width: 0; margin: 0; }
.v2-briefing-preview > h3 { grid-row: 1; align-self: end; }
.v2-briefing-preview > :nth-child(2) { grid-row: 2; align-self: center; }
.v2-briefing-preview > .v2-mission-stats { grid-row: 3; }
.v2-briefing-main + .v2-screen-footer button { min-height: 56px; }
.v2-legal-text { max-height: min(62dvh, 600px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 system-ui, sans-serif; color: var(--v2-text); }
.v2-screen-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.v2-screen-actions button { flex: 1 1 150px; }
.v2-screen-panel button.primary { border-color: var(--v2-accent-text); background: var(--v2-accent); color: var(--v2-bg); font-weight: 700; }
.v2-screen-meta { margin-top: 24px; font-size: 12px; }
.v2-screen-objective { border-left: 3px solid var(--v2-signal); padding-left: 12px; }
.v2-level-list, .v2-catalog-list { display: grid; gap: 9px; max-height: min(54dvh, 440px); overflow: auto; }
.v2-level { padding: 12px; border: 1px solid var(--v2-line); border-radius: 9px; background: var(--v2-surface2); }
.v2-level h2 { margin: 0; font-size: 20px; }
.v2-level p { margin: 5px 0 8px; }
.v2-level button { width: 100%; text-align: left; }
.v2-catalog-list { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.v2-catalog-list button { display: flex; align-items: center; gap: 10px; min-height: 56px; text-align: left; }
.v2-catalog-list img { width: 40px; height: 40px; object-fit: contain; }
.v2-catalog-entry { display: flex; gap: 8px; min-width: 0; }
.v2-catalog-entry button:first-child { flex: 1; min-width: 0; }
.v2-screen-panel[data-screen="catalog"], .v2-screen-panel:has(.v2-library-footer) { width: min(1240px, 100%); height: min(820px, calc(100dvh - 24px)); overflow: hidden; }
.v2-library-layout { display: grid; grid-template-columns: clamp(210px, 19vw, 250px) minmax(0, 1fr); gap: 10px; min-height: 0; overflow: hidden; }
.v2-library-list { display: grid; align-content: start; gap: 4px; min-width: 0; min-height: 0; overflow: auto; }
.v2-library-choice { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; text-align: left; overflow-wrap: anywhere; }
.v2-library-choice img, .v2-library-map-icon { width: 32px; height: 32px; object-fit: contain; flex: none; }
.v2-library-choice[aria-current="true"] { border-color: var(--v2-accent-text); background: var(--v2-surface3); box-shadow: inset 4px 0 var(--v2-accent); }
.v2-library-detail { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; overflow: auto; padding: 16px; border: 1px solid var(--v2-line); border-radius: 10px; background: var(--v2-surface2); }
.v2-library-art-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-library-art-switch button { min-height: 44px; flex: 1 1 140px; }
.v2-library-art-switch button[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-surface3); box-shadow: inset 0 -3px var(--v2-accent); }
.v2-library-detail-head { display: flex; align-items: center; gap: 16px; min-width: 0; }
.v2-library-art { margin: 0; width: clamp(80px, 15vw, 160px); min-width: 0; flex: none; text-align: center; }
.v2-library-detail-head img { width: clamp(80px, 15vw, 160px); height: clamp(80px, 15vw, 160px); object-fit: contain; flex: none; }
.v2-library-art figcaption { font-size: 12px; line-height: 1.2; overflow-wrap: anywhere; }
.v2-library-identity { min-width: 0; }
.v2-library-identity h3 { margin: 0 0 6px; font-size: clamp(21px, 2.5vw, 30px); overflow-wrap: anywhere; }
.v2-library-identity h2 { margin-bottom: 6px; }
.v2-library-identity p { margin: 4px 0; }
.v2-library-category { font-size: 12px; font-weight: 700; }
.v2-library-team { font-size: 12px; font-weight: 700; }
.v2-library-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.v2-library-values div { min-width: 0; padding: 10px; border: 1px solid var(--v2-line); border-radius: 8px; background: var(--v2-surface3); }
.v2-library-values dt { color: var(--v2-muted); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.v2-library-values dd { margin: 4px 0 0; font-size: clamp(17px, 2.5vw, 25px); font-weight: 800; overflow-wrap: anywhere; }
.v2-library-detail-body { min-height: 0; overflow: auto; }
.v2-library-detail-body p { margin: 0; line-height: 1.4; }
.v2-library-hp { font-weight: 700; }
.v2-library-detail-body p + p { margin-top: 8px; }
.v2-library-tabs { display: flex; gap: 8px; }
.v2-library-tabs button { min-height: 44px; flex: 1; }
.v2-library-tabs button[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-surface3); box-shadow: inset 0 -3px var(--v2-accent); }
.v2-library-range { display: inline-grid; gap: 6px; margin: 0 8px 0 0; width: min(100%, 230px); }
.v2-library-range figcaption { font-size: 12px; font-weight: 700; }
.v2-library-range svg { width: 100%; height: auto; }
.v2-library-range .guide-range-cell { fill: var(--v2-surface3); stroke: var(--v2-line); }
.v2-library-range .guide-range-cell.primary { fill: var(--v2-signal); stroke: var(--v2-line-strong); }
.v2-library-range .guide-range-cell.bonus { fill: var(--v2-accent); stroke: var(--v2-line-strong); }
.v2-library-range .guide-range-cell.attack { fill: var(--v2-danger); stroke: var(--v2-line-strong); }
.v2-library-range .guide-range-cell.origin { fill: var(--v2-text); stroke: var(--v2-line-strong); }
.v2-library-unit-detail { gap: 8px; padding: 10px; border-radius: 8px; }
.v2-library-unit-detail .v2-library-identity > :is(h2,h3,p) { margin: 0; }
.v2-library-unit-top { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 10px; flex: none; }
.v2-library-art-panel, .v2-library-diagram { min-width: 0; display: grid; align-content: start; gap: 4px; }
.v2-library-art-panel .v2-library-art { width: 100%; }
.v2-library-art-panel img { display: block; width: 100%; height: clamp(76px, 16dvh, 124px); object-fit: contain; }
.v2-library-art-panel .v2-library-art-switch { flex-wrap: nowrap; gap: 4px; }
.v2-library-art-panel .v2-library-art-switch button { flex: 1 1 0; min-width: 0; padding-inline: 4px; overflow-wrap: anywhere; }
.v2-library-diagram-map { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; min-width: 0; }
.v2-library-diagram .v2-library-range { width: 100%; text-align: center; margin: 0; gap: 2px; }
.v2-library-diagram svg.guide-range-svg { height: clamp(78px, 18dvh, 145px); }
.v2-library-weapon-rail { display: grid; grid-template-columns: repeat(2, minmax(36px,1fr)); gap: 3px; }
.v2-library-weapon-rail button { min-width: 36px; padding: 3px; }
.v2-library-weapon-rail button[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-surface3); }
.v2-library-weapon-rail .v2-icon { width: 20px; height: 20px; }
.v2-library-unit-detail .v2-library-tabs { flex: none; gap: 4px; }
.v2-library-unit-detail .v2-library-tabs button { min-width: 0; padding-inline: 4px; overflow-wrap: anywhere; }
.v2-library-unit-detail .v2-library-detail-body { flex: 1 1 auto; overflow: auto; }
.v2-library-detail-scroll > .v2-library-detail { flex: 1 1 auto; overflow: auto; scrollbar-width: none; }
.v2-library-detail-scroll > .v2-library-detail::-webkit-scrollbar { display: none; }
.v2-library-detail-scroll .v2-library-detail-body { flex: 0 0 auto; min-height: 4rem; overflow: visible; }
.v2-screen-panel[data-screen="catalog"] > :is(.v2-library-layout,.v2-library-detail-scroll) { flex: 1 1 0; }
.v2-screen-panel[data-screen="catalog"] > :is(.v2-screen-header,.v2-screen-footer) { flex: none; }
.v2-library-layout > .v2-stepped-list > .v2-library-list { flex: 1 1 auto; }
.v2-library-unit-detail .v2-library-map-action { flex: none; }
.v2-library-splash { font-size: 12px; margin: 0; }
.v2-library-reference details { padding: 6px; border: 1px solid var(--v2-line); border-radius: 6px; }
@media (max-width: 900px) {
  .v2-screen-panel:has(.v2-library-footer) > .v2-library-unit-detail { display: flex; }
  .v2-library-unit-detail .v2-library-detail-body { overflow: visible; }
}
@media (max-height: 600px) {
  .v2-library-unit-detail { gap: 4px; padding: 6px; }
  .v2-library-unit-top { gap: 6px; }
  .v2-library-diagram svg.guide-range-svg { height: clamp(70px, 15dvh, 94px); }
}
.v2-library-map-action { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.v2-library-map-action button { min-height: 44px; }
.v2-library-unavailable { margin: 0; font-size: 12px; }
.v2-library-count { align-self: center; margin: 0; min-width: 72px; text-align: center; font-size: 12px; }
.v2-library-footer .v2-screen-actions { display: flex; align-items: center; }
.v2-library-footer .v2-screen-actions button { min-height: 44px; }
@media (max-width: 900px) { .v2-library-layout { display: block; overflow: auto; } .v2-library-layout > .v2-library-detail { display: none; } .v2-library-list { max-height: none; } .v2-screen-panel:has(.v2-library-footer) > .v2-library-detail { border: 0; padding: 0; background: transparent; } }
@media (max-width: 599px) { .v2-library-art { width: min(110px, 25dvh); } .v2-library-detail-head img { width: min(110px, 25dvh); height: min(110px, 25dvh); } .v2-library-values { grid-template-columns: repeat(2, minmax(0, 1fr)); } .v2-library-footer .v2-screen-actions button { flex-basis: auto; } .v2-library-footer .v2-library-map-action button { width: 100%; } }
@media (min-width: 600px) and (max-width: 900px) and (max-height: 500px) { .v2-screen-panel:has(.v2-library-footer) { padding: 12px; } .v2-screen-panel:has(.v2-library-footer) > .v2-library-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; gap: 8px; } .v2-library-detail-head { align-items: flex-start; } .v2-library-detail-head img { width: min(130px, 32dvh); height: min(130px, 32dvh); } .v2-library-identity h2 { font-size: 21px; } .v2-library-values { grid-template-columns: repeat(2, minmax(0, 1fr)); } .v2-library-detail-body { grid-column: 1 / -1; } .v2-library-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; } .v2-library-footer .v2-screen-actions button { flex: 1 1 0; min-width: 0; } .v2-library-footer .v2-library-count { flex: none; } .v2-library-footer .v2-library-map-action { display: flex; min-width: 0; } .v2-library-footer .v2-library-map-action button { flex: none; } }
.v2-screen-panel label:not(.v2-setting-check) { display: grid; gap: 6px; margin: 14px 0; color: var(--v2-muted); }
.v2-screen-panel select { min-height: 56px; width: 100%; padding: 10px; border: 1px solid var(--v2-line-strong); border-radius: 9px; background: var(--v2-surface3); color: var(--v2-text); font: inherit; }
.v2-setting-check { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.v2-setting-check input { width: 24px; height: 24px; }
.v2-animation-options { min-width: 0; margin: 14px 0; padding: 0; border: 0; }
.v2-animation-options legend { margin-bottom: 6px; color: var(--v2-muted); }
.v2-animation-segments { display: grid; grid-template-columns: repeat(3, minmax(44px, 1fr)); gap: 8px; }
.v2-animation-segments button { min-width: 44px; min-height: 44px; }
.v2-animation-segments button[aria-pressed="true"] { border-color: var(--v2-accent-text); box-shadow: inset 0 0 0 1px var(--v2-accent-text); }
.v2-screen-panel.v2-foundation.v2-options-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.v2-options-panel > .v2-options-main { min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 5px; scroll-padding: 5px; }
.v2-options-main::-webkit-scrollbar { display: none; }
.v2-screen-panel:is(.v2-options-panel, [data-screen="editor"]):not([hidden]) { border-radius: 10px; }
.v2-saved-levels { display: grid; gap: 8px; }
.v2-saved-levels article { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border: 1px solid var(--v2-line); border-radius: 8px; }
.v2-saved-levels strong { overflow-wrap: anywhere; }
.v2-options-panel > .v2-screen-footer { position: static; margin-top: 0; z-index: auto; }
.v2-screen-log { max-height: min(54dvh, 440px); overflow: auto; }
.v2-screen-log p { border-bottom: 1px solid var(--v2-line); padding: 8px 0; }
.v2-log-entry { display: flex; align-items: baseline; gap: 10px; }
.v2-log-time { flex: none; color: var(--v2-muted); font-variant-numeric: tabular-nums; }
.v2-log-message { min-width: 0; overflow-wrap: anywhere; }
.v2-shell { box-sizing: border-box; height: 100dvh; min-height: 0; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; background: var(--v2-bg); color: var(--v2-text); font: 16px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
.v2-shell * { box-sizing: border-box; }
.v2-shell button { min-height: 44px; border: 1px solid var(--v2-line-strong); border-radius: 9px; padding: 9px 12px; background: var(--v2-surface3); color: var(--v2-text); font: inherit; cursor: pointer; }
.v2-shell button:focus-visible, .v2-map:focus-visible { outline: 3px solid var(--v2-accent-text); outline-offset: 2px; }
.v2-shell button:disabled { cursor: default; border-color: var(--v2-line); color: var(--v2-muted); }
.v2-shell button[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-surface2); }
body.ui-v2-active .language-picker select { min-width: 88px; min-height: 44px; padding: 8px; }
.v2-head, .v2-card { min-width: 0; border: 1px solid var(--v2-line); border-radius: 10px; background: var(--v2-surface); padding: 10px; }
.v2-head { display: flex; align-items: center; gap: 16px; padding: 8px 12px; }
.v2-head h1 { margin: 0; font-size: clamp(20px, 4vw, 30px); line-height: 1.2; overflow-wrap: anywhere; }
.v2-head p, .v2-card p { margin: 5px 0; color: var(--v2-muted); overflow-wrap: anywhere; }
.v2-label { display: block; color: var(--v2-accent-text); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.v2-layout { display: grid; grid-template-columns: minmax(230px, 260px) minmax(480px, 1fr) minmax(250px, 290px); gap: 8px; min-height: 0; }
.v2-map-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; overflow: hidden; }
.v2-map { height: 100%; min-width: 0; min-height: 0; overflow: auto; scrollbar-width: none; background: #102226; touch-action: none; }
.v2-map::-webkit-scrollbar { display: none; }
.v2-map svg { display: block; min-width: 0; min-height: 0; max-width: none; margin-inline: auto; }
body.ui-v2-active #battlefield-map { min-width: 0; min-height: 0; }
.v2-map-tools { display: flex; gap: 6px; margin-left: auto; }
.v2-map-tools button { background: color-mix(in srgb, var(--v2-surface) 90%, transparent); }
body.ui-v2-active #battlefield-map .unit-svg.acted-unit,
body.ui-v2-active #battlefield-map .unit-svg.transport-unavailable { opacity: 1 !important; filter: none !important; }
body.ui-v2-active #battlefield-map .unit-svg.disabled-unit { opacity: .32 !important; filter: grayscale(1) !important; }
body.ui-v2-active #battlefield-map .unit-svg.acted-unit:not(.disabled-unit) { filter: brightness(1.35) saturate(.7) !important; }
body.ui-v2-active #v2-focus-marker { fill: none; stroke: var(--v2-text); stroke-width: 2; stroke-dasharray: 3 5; }
body.ui-v2-active #battlefield-map .m1-replaced-hp,
body.ui-v2-active #battlefield-map .target-ring,
body.ui-v2-active #battlefield-map .unit-selection-ring,
body.ui-v2-active #battlefield-map .focus-marker { display: none; }
body.ui-v2-active #battlefield-map .hex.selected,
body.ui-v2-active #battlefield-map .hex.attack { stroke: transparent; stroke-width: 0; }
.m1-damage-empty { fill: var(--v2-line); }
.m1-damage-fill { fill: var(--v2-text); }
.m1-damage-border { fill: none; stroke: #0b0e12; stroke-width: .526; }
.m1-ring { fill: none; }
.m1-ring-outer { stroke: #0b0e12; }
.m1-ring-inner.m1-ring-selected { stroke: var(--v2-select); stroke-width: 4px; vector-effect: non-scaling-stroke; fill: #ffffff1f; }
.m1-ring-outer.m1-ring-selected { stroke-width: 7px; vector-effect: non-scaling-stroke; }
.m1-ring-inner.m1-ring-target { stroke: var(--v2-danger); }
.m1-status, .m1-weapon-damage { font: 700 8px system-ui,sans-serif; text-anchor: middle; fill: var(--v2-danger-text); paint-order: stroke; stroke: #0b0e12; stroke-width: 1.5; }
.v2-own, .v2-target { display: grid; align-content: start; gap: 12px; min-height: 0; overflow: auto; }
.v2-units { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.v2-units .v2-unit { display: grid; flex: none; grid-template-columns: 32px minmax(0, 1fr) 20px; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left; }
.v2-roster-art { width: 32px; height: 32px; object-fit: contain; flex: none; }
.v2-system-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--v2-line); padding: 4px 0; font-size: 13px; }
.v2-system-row span { overflow-wrap: anywhere; }
/* Action menu (UR-G): label chip, optional option rows, icon bar; anchored above the selected unit. */
.v2-command-card { position: fixed; z-index: 20; display: grid; justify-items: center; gap: 6px; width: max-content; max-width: min(440px, calc(100vw - 16px)); padding: 0; border: 0; background: transparent; pointer-events: none; }
.v2-command-card > * { pointer-events: auto; }
.v2-command-card[hidden] { display: none !important; }
.v2-command-hint { max-width: 100%; margin: 0; padding: 4px 10px; border: 1px solid var(--v2-accent-text); border-radius: 6px; background: var(--v2-surface); color: var(--v2-text); font-size: 13px; letter-spacing: .06em; text-align: center; text-transform: uppercase; overflow-wrap: anywhere; box-shadow: 0 4px 14px #0009; }
.v2-shell .v2-command-hint, .v2-card .v2-command-hint { color: var(--v2-text); }
#v2-command-intel { color: var(--v2-signal); letter-spacing: 0; text-transform: none; }
#v2-command-intel:empty { display: none; }
.v2-command-body { min-height: 0; max-height: min(40dvh, 260px); overflow-y: auto; padding: 6px; border: 1px solid var(--v2-line-strong); border-radius: 10px; background: var(--v2-surface); box-shadow: 0 4px 14px #0009; }
.v2-command-body[hidden] { display: none; }
.v2-command-bar { display: flex; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--v2-accent-text); border-radius: 12px; background: var(--v2-surface); box-shadow: 0 8px 30px #000b; }
.v2-actions { display: flex; gap: 4px; }
.v2-actions button, .v2-command-footer button { min-width: 48px; min-height: 48px; }
.v2-command-bar .v2-icon-button:disabled { opacity: .35; }
.v2-command-bar .v2-icon-button:not(.v2-command-primary):not([aria-pressed="true"]) { border-color: transparent; background: transparent; }
.v2-actions .v2-command-primary, .v2-actions button[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-accent); }
.v2-command-footer { display: flex; gap: 4px; padding-left: 4px; border-left: 1px solid var(--v2-line); }
.v2-command-card[data-pointer="down"]::after, .v2-command-card[data-pointer="up"]::after { content: ""; position: absolute; left: var(--v2-pointer-x, 50%); width: 0; height: 0; border: 8px solid transparent; transform: translateX(-50%); }
.v2-command-card[data-pointer="down"]::after { bottom: -15px; border-top-color: var(--v2-accent-text); }
.v2-command-card[data-pointer="up"]::after { top: -15px; border-bottom-color: var(--v2-accent-text); }
.v2-context { flex: 1; display: grid; align-content: center; min-width: 0; }
.v2-controls { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--v2-line); border-radius: 14px; background: var(--v2-surface); }
#v2-phase-action { flex: 0 1 380px; min-height: 52px; border-color: var(--v2-accent-text); background: var(--v2-accent); font-weight: 700; }
#v2-undo, #v2-next-unit { flex: none; white-space: nowrap; }
#v2-next-unit { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.v2-next-arrow { font-size: 1.2em; line-height: 1; }
.v2-next-count { min-width: 24px; padding: 2px 7px; border-radius: 12px; background: var(--v2-success); color: var(--v2-bg); font-weight: 700; text-align: center; }
#v2-next-unit:disabled .v2-next-count { background: var(--v2-line); }
#v2-undo { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-width: 599px) { .v2-next-label, .v2-back-label { display: none; } .v2-controls { gap: 6px; } .v2-controls button:last-child { min-width: 0; } #v2-undo, #v2-next-unit { min-width: 48px; } .v2-back-arrow, .v2-next-arrow { font-size: 1.4em; } }
#v2-phase-action:disabled { border-color: var(--v2-line); background: var(--v2-surface3); }
#v2-terminal { display: block; color: var(--v2-success); }
#v2-terminal.v2-failed { color: var(--v2-danger-text); }
#v2-terminal[hidden] { display: none; }
.v2-status { color: var(--v2-danger-text); min-height: 1.4em; }
.v2-area-controls { position: relative; display: flex; flex-wrap: wrap; max-width: 100%; min-width: 0; gap: 4px; padding: 4px; border: 1px solid var(--v2-line); border-radius: 10px; background: color-mix(in srgb, var(--v2-surface) 90%, transparent); }
.v2-area-controls button { min-width: 44px; min-height: 44px; max-width: 100%; padding: 0 8px; font-size: 13px; }
.v2-display-controls { display: contents; }
.v2-display-controls[hidden], #v2-display-toggle[hidden] { display: none !important; }
.v2-area-controls[data-compact="true"] .v2-display-controls:not([hidden]) { display: flex; flex-wrap: wrap; flex-basis: 100%; min-width: 0; max-width: 100%; gap: 4px; padding: 5px; }
.v2-area-controls[data-compact="true"] .v2-display-controls button { flex: 1 1 max-content; }
.v2-control-measure { position: absolute; visibility: hidden; pointer-events: none; width: 0; height: 0; overflow: hidden; }
.v2-control-measure-track { display: flex; width: max-content; gap: 4px; }
.v2-control-measure button { flex: none; max-width: none; white-space: nowrap; }
.v2-weapon-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.v2-weapon-controls[hidden] { display: none; }
.v2-map-overlay .v2-weapon-controls { grid-template-columns: repeat(4, minmax(0, 120px)); padding: 4px; border-radius: 10px; background: color-mix(in srgb, var(--v2-surface) 90%, transparent); }
.v2-weapon-controls button { min-width: 0; min-height: 44px; padding: 4px; font-size: 11px; line-height: 1.15; overflow-wrap: anywhere; }
.v2-weapon-controls button[aria-pressed="true"] { border-width: 2px; }
#v2-command-weapons { display: flex; flex-wrap: wrap; justify-content: center; }
#v2-command-weapons button { flex: 1 1 88px; min-width: 0; max-width: 140px; white-space: normal; overflow-wrap: anywhere; }
.v2-weapon-controls button { display: grid; justify-items: center; align-content: center; gap: 1px; }
.v2-weapon-name { font-weight: 700; letter-spacing: .04em; }
.v2-weapon-count { color: var(--v2-signal); font-size: 10px; }
body.v2-menu-open .v2-map-overlay .v2-weapon-controls { display: none; }
@media (max-width: 599px) { .v2-map-overlay .v2-weapon-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.v2-area-legend { max-width: min(100%, 560px); margin: 0; padding: 6px 10px; border: 1px solid var(--v2-line-strong); border-radius: 8px; background: color-mix(in srgb, var(--v2-bg) 86%, transparent); color: var(--v2-text); font-size: 12px; }
body.ui-v2-active #v2-grid-overlay, body.ui-v2-active #v2-area-overlay { pointer-events: none; }
body.ui-v2-active .v2-grid-line { fill: none; stroke: var(--v2-line-strong); stroke-width: 1.5; stroke-linejoin: round; }
/* Ranges: the cells fill in the range colour with configurable opacity, only the outer edge is outlined. */
body.ui-v2-active .v2-area-movement { fill: var(--v2-range-move); fill-opacity: var(--v2-overlay-alpha); stroke: none; }
body.ui-v2-active .v2-area-fire { fill: var(--v2-range-fire); fill-opacity: var(--v2-overlay-alpha); stroke: none; }
body.ui-v2-active .v2-area-sight { fill: var(--v2-range-los); fill-opacity: var(--v2-overlay-alpha); stroke: none; }
body.ui-v2-active .v2-area-edge { fill: none; stroke-width: 3px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
body.ui-v2-active .v2-area-edge-movement { stroke: var(--v2-range-move); }
body.ui-v2-active .v2-area-edge-fire { stroke: var(--v2-range-fire); }
body.ui-v2-active .v2-area-edge-sight { stroke: var(--v2-range-los); }
body.ui-v2-active .v2-area-edge-plan { stroke: var(--v2-muted); stroke-width: 2; stroke-dasharray: 5 4; }
.v2-screen-panel label.v2-setting-range { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.v2-setting-range input { grid-column: 1; accent-color: var(--v2-accent); }
.v2-setting-range output { grid-column: 2; grid-row: 2; color: var(--v2-text); font-variant-numeric: tabular-nums; }
body.ui-v2-active .v2-area-blocked { fill: none; stroke: var(--v2-muted); stroke-width: 2; stroke-dasharray: 5 5; }
body.ui-v2-active .v2-area-cost-chip { fill: var(--v2-bg); fill-opacity: .94; stroke: var(--v2-line-strong); stroke-width: .8; }
body.ui-v2-active .v2-area-cost { fill: var(--v2-text); text-anchor: middle; dominant-baseline: central; font-family: system-ui,sans-serif; font-weight: 700; }
body.ui-v2-active .v2-fire-link-underlay { stroke: var(--v2-bg); stroke-linecap: round; }
body.ui-v2-active .v2-fire-link-signal { stroke: var(--v2-signal); stroke-linecap: round; }
body.ui-v2-active .v2-fire-ratio-chip { fill: var(--v2-bg); stroke: var(--v2-signal); stroke-width: 1; }
body.ui-v2-active .v2-fire-ratio { fill: var(--v2-text); text-anchor: middle; dominant-baseline: central; font-family: system-ui,sans-serif; font-weight: 700; }
@media (max-width: 599px) { body.ui-v2-active .v2-area-cost-chip, body.ui-v2-active .v2-area-cost { display: none; } }
@media (max-width: 599px) { body.ui-v2-active .v2-fire-ratio-chip, body.ui-v2-active .v2-fire-ratio { display: none; } }
.v2-system { color: var(--v2-muted); }
@media (max-width: 1199px) { .v2-layout { grid-template-columns: minmax(220px, 240px) minmax(0, 1fr); } .v2-target { grid-column: 1 / -1; grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 850px) { .v2-shell { height: auto; min-height: 100dvh; } .v2-layout { grid-template-columns: minmax(0, 1fr); } .v2-own, .v2-target { grid-column: 1; grid-template-columns: repeat(2,minmax(0,1fr)); } .v2-map-card { grid-row: 1; } .v2-map-frame { flex: none; height: min(52dvh, 500px); } .v2-units { max-height: 180px; } }
@media (max-width: 599px), (max-height: 500px) { .v2-shell { display: block; height: auto; min-height: 100dvh; } .v2-head { margin-bottom: 8px; padding: 8px; gap: 4px; } .v2-head { flex-wrap: wrap; } .v2-head-mission { display: none; } .v2-head-turn { flex: 1; gap: 8px; } .v2-head p { font-size: 12px; line-height: 1.2; margin: 2px 0; } .v2-head-goal { order: 5; flex-basis: 100%; text-align: left; } .v2-layout { display: flex; flex-direction: column; } .v2-map-card { order: 0; } .v2-own { order: 1; } .v2-target { order: 2; } .v2-own, .v2-target { display: grid; grid-template-columns: 1fr; overflow: visible; gap: 8px; } .v2-card { margin-bottom: 8px; } .v2-map-frame { flex: none; height: min(56dvh, calc((100vw - 26px) * 0.75)); } .v2-units { max-height: 132px; } }
@media (max-width: 599px), (max-height: 500px) { body.ui-v2-active:not(.v2-screen-open) .v2-head { position: sticky; top: 0; z-index: 7; } body.ui-v2-active .v2-head .language-picker { display: none; } .v2-controls { position: sticky; bottom: 0; z-index: 7; flex-wrap: wrap; padding: 6px; gap: 6px; border-color: var(--v2-line-strong); } .v2-controls .v2-context { flex-basis: 100%; font-size: 12px; } #v2-phase-action { flex: 1 1 0; } }
@media (max-width: 599px) { .v2-screen-panel { max-height: calc(100dvh - 24px); } .v2-screen-actions button { flex-basis: 100%; } .v2-level-list, .v2-catalog-list { max-height: 44dvh; } .v2-catalog-entry { display: grid; } .v2-catalog-entry button { width: 100%; overflow-wrap: anywhere; } }
@media (max-width: 599px) { .v2-foundation:has(.v2-level-layout) { scroll-padding-bottom: 132px; } }
@media (max-width: 850px) { .v2-level-layout { grid-template-columns: minmax(0, 1fr); } .v2-level-list { max-height: min(44dvh, 390px); } }
@media (min-width: 600px) and (max-height: 500px) { .v2-level-list { max-height: none; overflow: visible; } }
@media (min-width: 851px) and (min-height: 501px) { .v2-screen-panel:has(.v2-level-layout) { height: min(820px, calc(100dvh - 24px)); overflow: hidden; } .v2-foundation .v2-level-layout { flex: 1 1 auto; } .v2-level-layout > .v2-stepped-list > .v2-level-list { flex: 1 1 auto; max-height: none; } .v2-level-detail { display: flex; flex-direction: column; gap: 10px; align-self: start; min-height: 0; max-height: 100%; overflow: hidden; } .v2-level-detail > * { margin: 0; } .v2-level-detail .v2-mission-map { flex: 0 1 auto; min-height: 120px; } .v2-level-detail .v2-mission-map svg { height: 100%; } }
@media (max-width: 599px) { .v2-screen-panel:has(.v2-menu-links) { min-height: calc(100dvh - 24px); justify-content: flex-end; padding: 24px; } .v2-screen-panel:has(.v2-menu-links)::after { inset: 0 0 48% 0; mask-image: linear-gradient(180deg, #000, transparent); } .v2-menu-intro h2 { font-size: clamp(31px, 10vw, 48px); } .v2-menu-links { margin-top: 18px; } .v2-menu-links button { min-height: 52px; } .v2-level-choice { min-height: 56px; } .v2-level-detail { padding: 12px; } }
@media (max-width: 599px) { .v2-briefing-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: max-content; } .v2-briefing-conditions, .v2-briefing-main .v2-briefing-preview > * { grid-column: auto; grid-row: auto; } .v2-briefing-main .v2-briefing-preview > h3 { order: -2; } .v2-briefing-main .v2-briefing-preview > :nth-child(2) { order: -1; } .v2-briefing-main + .v2-screen-footer .v2-screen-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .v2-briefing-main + .v2-screen-footer button { min-width: 0; } }
@media (min-width: 600px) and (max-height: 500px) { .v2-screen-panel:has(.v2-briefing-main) { padding: 12px; } .v2-briefing-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; } .v2-briefing-intro { margin-bottom: 4px; font-size: 12px; line-height: 1.2; } .v2-screen-panel:has(.v2-briefing-main) h2 { margin-bottom: 3px; font-size: 22px; } .v2-briefing-conditions { gap: 6px; } .v2-briefing-conditions > div { padding: 7px 9px; } .v2-briefing-conditions h3 { margin-bottom: 3px; font-size: 14px; } .v2-briefing-conditions p { font-size: 12px; line-height: 1.2; } .v2-briefing-preview h3 { margin: 0; font-size: 14px; } }
@media (min-width: 600px) and (max-height: 500px) {
  .v2-controls button { font-size: 12px; line-height: 1.2; padding: 4px 6px; }
  .v2-map-frame { height: min(68dvh, 300px); }
}
/* The frozen display layer owns units during accepted movement, in SVG map coordinates. */
.goblin-moving #v2-command-card { visibility:hidden; }
.goblin-moving #battlefield-map > .unit-svg,
.goblin-moving #battlefield-map > #v2-m1-markers { visibility:hidden; }
.goblin-moving #battlefield-map > :is(#v2-area-overlay,.move-area,.fire-area,.los-area,.focus-marker),
.goblin-moving #battlefield-map > .hex:is(.movement-fill,.fire-range,.los-visible,.attack,.selected) {
  opacity:var(--movement-overlays,0);
}
.v2-specialist-select {display:flex;flex-direction:column;gap:.3rem;min-width:0;max-width:100%;font-size:.85rem;color:var(--v2-muted)}
.v2-specialist-select select {max-width:100%;min-height:2.5rem;padding:.45rem .6rem;border:1px solid var(--v2-line);border-radius:.25rem;background:var(--v2-surface);color:var(--v2-text);font:inherit}
.v2-specialist-select select:focus-visible {outline:2px solid var(--v2-signal);outline-offset:2px}
#v2-specialist-target-controls {display:grid;gap:.5rem;margin:.5rem 0}
.v2-full-blast{pointer-events:none;stroke:#ffb15c;stroke-width:2;vector-effect:non-scaling-stroke}
.v2-full-blast-center{fill:rgba(255,111,48,.35)}
.v2-full-blast-adjacent{fill:rgba(255,177,92,.17);stroke-dasharray:4 3}
.v2-training {
  position: fixed;
  z-index: 4;
  left: -9999px;
  box-sizing: border-box;
  width: min(480px, calc(100vw - 32px));
  margin: 0;
  padding: 8px 10px;
  font-size: 14px;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  pointer-events: none;
}
.v2-training[hidden] { display: none; }
.v2-training.v2-training-confirmation {
  border-color: var(--v2-accent-text);
  box-shadow: 0 8px 24px #0009;
}
.v2-training p { margin: 3px 0; line-height: 1.35; }
.v2-training-preview { color: var(--v2-signal); font-variant-numeric: tabular-nums; }
.v2-training .v2-screen-actions { gap: 4px; margin-top: 6px; }
.v2-shell .v2-training button { flex: 0 1 auto; min-height: 30px; padding: 3px 8px; font-size: 13px; pointer-events: auto; }
.v2-training[data-scrollable="true"] { pointer-events: auto; }
button.training-highlight{outline:2px solid var(--v2-signal);outline-offset:3px}
.hex.training-highlight{stroke:var(--v2-signal);stroke-width:3;stroke-dasharray:5 3}
/* UR-D game layout: compact head, map with overlay controls, unit list, switchable field intel, full-width command bar. */
.v2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.v2-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v2-shell .v2-icon-button { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; }
.v2-head-mission { min-width: 0; }
.v2-head h1 { font-size: clamp(18px, 2vw, 24px); }
.v2-head-turn { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v2-head-turn p { margin: 0; }
#v2-phase { position: absolute; z-index: 2; inset: 10px 10px auto auto; width: max-content; max-width: var(--v2-phase-width); box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--v2-signal); border-radius: 8px; background: var(--v2-surface2); color: var(--v2-signal); font-size: 14px; letter-spacing: .06em; text-align: center; text-transform: uppercase; overflow-wrap: anywhere; pointer-events: none; }
.v2-phase-notice { position: fixed; display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; box-sizing: border-box; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: clamp(8px, 2vmin, 20px); border: 1px solid var(--v2-signal); border-radius: 10px; background: var(--v2-surface); color: var(--v2-signal); text-align: center; overflow: auto; }
.v2-phase-notice[hidden] { display: none; }
.v2-phase-notice::backdrop { background: rgb(0 0 0 / .35); }
.v2-phase-notice strong { font-size: clamp(22px, 5vmin, 56px); line-height: 1.1; overflow-wrap: anywhere; }
.v2-phase-notice label { display: flex; align-items: center; gap: 6px; color: var(--v2-text); font-size: 14px; }
:is(#v2-phase, .v2-phase-notice)[data-phase="movement"] { border-color: var(--v2-success); color: var(--v2-success); }
:is(#v2-phase, .v2-phase-notice)[data-phase="fire"] { border-color: var(--v2-danger-text); color: var(--v2-danger-text); }
.v2-head-goal { flex: 1; min-width: 0; text-align: right; }
.v2-head-goal p { margin: 2px 0; }
body.ui-v2-active .v2-head .language-picker { display: none; }
.v2-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.v2-units-ready { color: var(--v2-success); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.v2-own { display: flex; flex-direction: column; min-height: 0; }
.v2-units-card { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.v2-unit-text { display: grid; min-width: 0; }
.v2-unit-text strong { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.v2-unit-text small { color: var(--v2-muted); font-size: 12px; overflow-wrap: anywhere; }
.v2-unit-mark { justify-self: center; width: 16px; height: 16px; border-radius: 50%; }
.v2-unit-ready .v2-unit-mark { border: 2px solid var(--v2-success); box-shadow: inset 0 0 0 3px var(--v2-surface3), inset 0 0 0 8px var(--v2-success); }
.v2-unit-done .v2-unit-mark { width: 12px; height: 7px; border: solid var(--v2-muted); border-width: 0 0 2px 2px; border-radius: 0; transform: rotate(-45deg); }
.v2-unit-static .v2-unit-mark { height: 2px; border-radius: 0; background: var(--v2-muted); }
.v2-unit-disabled .v2-unit-mark, .v2-unit-destroyed .v2-unit-mark { border: 2px solid var(--v2-danger-text); background: linear-gradient(45deg, transparent 44%, var(--v2-danger-text) 44% 56%, transparent 56%); }
.v2-unit-embarked .v2-unit-mark { border: 2px dashed var(--v2-muted); }
.v2-units .v2-unit[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-accent); box-shadow: inset 0 0 0 1px var(--v2-accent-text); }
.v2-units .v2-unit:is(.v2-unit-done, .v2-unit-static, .v2-unit-disabled, .v2-unit-destroyed):not([aria-pressed="true"]) { opacity: .72; }
.v2-map-frame { position: relative; flex: 1; min-height: 0; --v2-phase-width: clamp(80px, 21%, 180px); }
.v2-map-overlay { position: absolute; z-index: 2; display: flex; gap: 8px; pointer-events: none; }
.v2-map-overlay > * { pointer-events: auto; }
.v2-map-overlay-top { top: 10px; left: 10px; right: calc(var(--v2-phase-width) + 20px); flex-direction: column; align-items: flex-start; }
.v2-map-overlay-bottom { left: 10px; right: 10px; bottom: 10px; justify-content: space-between; align-items: flex-end; }
.v2-area-controls button[aria-pressed="true"] { border-color: var(--v2-accent-text); background: var(--v2-surface2); color: var(--v2-accent-text); }
.v2-area-controls .v2-icon-button:not([aria-pressed="true"]) { border-color: transparent; background: transparent; color: var(--v2-muted); }
.v2-area-legend:empty, .v2-area-legend[hidden], .v2-own[hidden], .v2-target:has(> #v2-intel:empty) { display: none; }
.v2-target { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
#v2-intel { display: grid; gap: 10px; }
.v2-intel-section { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--v2-line); border-radius: 10px; background: var(--v2-surface2); }
.v2-intel-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.v2-intel-art, .v2-intel-tile { width: 44px; height: 44px; border-radius: 6px; background: var(--v2-bg); object-fit: contain; }
.v2-intel-tile { object-fit: cover; }
.v2-intel-name { display: grid; min-width: 0; }
.v2-intel-name strong { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.v2-intel-name small { color: var(--v2-muted); font-size: 12px; }
.v2-shell .v2-intel-help { border-radius: 50%; color: var(--v2-accent-text); }
.v2-intel-bar { display: grid; gap: 4px; }
.v2-intel-bar-head { display: flex; justify-content: space-between; color: var(--v2-muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.v2-intel-bar-head strong { color: var(--v2-success); }
.v2-intel-track { display: flex; gap: 3px; height: 7px; }
.v2-intel-track i { flex: 1; border-radius: 1px; background: var(--v2-surface3); }
.v2-intel-track i.v2-on { background: var(--v2-success); }
.v2-intel-track .v2-intel-fill { flex: none; }
.v2-intel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.v2-intel-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; padding: 7px 8px; border-radius: 6px; background: var(--v2-surface); color: var(--v2-muted); font-size: 11px; letter-spacing: .06em; }
.v2-intel-stat strong { color: var(--v2-text); font-size: 15px; letter-spacing: 0; }
.v2-intel-meter { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 2px; background: var(--v2-surface3); }
.v2-intel-meter i { display: block; height: 100%; background: var(--v2-accent-text); }
.v2-tone-good strong { color: var(--v2-success); }
.v2-tone-warn strong { color: var(--v2-signal); }
.v2-tone-bad strong { color: var(--v2-danger-text); }
.v2-intel-systems { display: grid; gap: 2px; }
.v2-intel-section p { margin: 0; }
.v2-intel-wreck, .v2-intel-cargo, .v2-intel-facts { padding: 6px 8px; border-radius: 6px; background: var(--v2-surface); font-size: 12px; }
.v2-context p { margin: 0; }
#v2-message:empty { min-height: 0; }
#v2-phase-action:has(.v2-phase-title) { display: grid; justify-items: center; gap: 2px; line-height: 1.15; }
.v2-phase-title { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.v2-phase-sub { font-size: 12px; font-weight: 400; opacity: .85; }
.v2-intel-systems .v2-system-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; font-size: 12px; }
.v2-intel-systems .v2-system-row span { overflow-wrap: normal; hyphens: auto; }
.v2-intel-systems .v2-system-row strong { font-weight: 600; text-align: right; }
.v2-intel-compact-label > span[aria-hidden="true"] { overflow-wrap: normal; }
.v2-units .v2-unit[aria-pressed="true"] .v2-unit-text small { color: var(--v2-text); }
.v2-library-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.v2-library-reference { margin-top: 12px; }
.v2-library-reference :is(h3, h4, p, ul) { margin: 0; }
.v2-library-reference ul { padding-inline-start: 22px; }
.v2-library-reference li + li { margin-top: 6px; }
.v2-screen-panel[data-screen="editor"] { width: min(1240px, 100%); }
.v2-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 290px); gap: 16px; align-items: start; }
.v2-editor-map { width: 100%; background: var(--v2-surface2); border-radius: 8px; }
.v2-editor-hex { fill: var(--v2-surface3); stroke: var(--v2-line-strong); cursor: pointer; }
.v2-editor-map-moving .v2-editor-hex { cursor: crosshair; }
.v2-editor-selected { fill: var(--v2-surface); stroke: var(--v2-accent-text); stroke-width: 3px; }
.v2-editor-map image, .v2-editor-token { pointer-events: none; }
.v2-editor-token { fill: var(--v2-text); stroke: var(--v2-bg); paint-order: stroke; stroke-width: 4px; text-anchor: middle; dominant-baseline: central; font: bold 27px system-ui; }
.v2-editor-token-player { fill: var(--v2-signal); }
.v2-editor-token-enemy { fill: var(--v2-danger-text); }
.v2-editor-fields, .v2-screen-panel[data-screen="editor"] label { display: grid; gap: 6px; }
.v2-screen-panel[data-screen="editor"] :is(input,select,textarea) { min-width: 0; width: 100%; color: var(--v2-text); background: var(--v2-surface2); border: 1px solid var(--v2-line-strong); padding: 5px; }
@media (max-width: 750px) { .v2-editor-layout { grid-template-columns: 1fr; } }
.v2-library-terrain-tile { width: min(160px, 30vw); aspect-ratio: 1; border-radius: 10px; object-fit: cover; }
@media (max-width: 599px) {
  .v2-units { flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; }
  .v2-units .v2-unit { position: relative; flex: none; grid-template-columns: 36px; width: 64px; justify-items: center; padding: 6px; }
  .v2-units .v2-unit .v2-unit-text { display: none; }
  .v2-units .v2-unit .v2-unit-mark { position: absolute; right: 4px; bottom: 4px; width: 12px; height: 12px; }
  .v2-units .v2-unit.v2-unit-done .v2-unit-mark { width: 10px; height: 6px; }
  .v2-map-overlay .v2-icon-button { min-width: 40px; min-height: 40px; }
}
@media (max-width: 599px), (max-height: 500px) { .v2-head { gap: 8px; padding: 6px 8px; } .v2-head-turn { flex: 1; gap: 8px; } .v2-head-turn p { font-size: 12px; white-space: nowrap; } #v2-phase { padding: 4px 8px; font-size: 12px; } .v2-head-goal { order: 5; flex: 1 1 100%; text-align: left; } .v2-head-goal p { font-size: 12px; } }
@media (max-width: 1199px) { .v2-target { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; } #v2-intel { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; } }
@media (max-width: 599px), (max-height: 500px) { .v2-target { grid-template-columns: minmax(0, 1fr); } .v2-head-turn { overflow: hidden; } #v2-phase { font-size: 11px; padding: 5px; } }
@media (min-width: 851px) and (min-height: 501px) {
  .v2-layout { position: relative; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .v2-map-card { grid-area: 1 / 1; }
  .v2-map-overlay-top { bottom: 10px; justify-content: space-between; }
  .v2-map-overlay-top > .v2-area-legend { max-width: min(56%, 560px); overflow-wrap: anywhere; pointer-events: none; }
  .v2-layout > :is(.v2-own, .v2-target) { position: absolute; z-index: 3; grid-area: auto; overscroll-behavior: contain; overflow: auto; }
  .v2-layout > .v2-own { top: calc(19px + var(--v2-toolbar-height, 54px)); left: 11px; width: clamp(152px, 16vw, 222px); max-height: max(0px, calc(100% - 38px - var(--v2-toolbar-height, 54px) - var(--v2-legend-height, 0px))); }
  .v2-layout > .v2-target { top: 64px; right: 11px; width: clamp(174px, 18vw, 256px); max-height: max(0px, calc(100% - 126px)); }
  .v2-layout .v2-units-card { padding: 6px; }
  .v2-layout .v2-units { overflow: visible; }
  .v2-layout #v2-intel { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .v2-layout .v2-intel-section { gap: 6px; padding: 7px; }
  .v2-layout .v2-intel-stat > span { overflow-wrap: anywhere; }
  .v2-layout .v2-intel-head { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 5px; }
  .v2-layout :is(.v2-intel-art, .v2-intel-tile) { width: 32px; height: 32px; }
  .v2-layout .v2-intel-systems .v2-system-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-layout .v2-intel-systems .v2-system-row :is(span, strong) { overflow-wrap: anywhere; }
}
@media (max-width: 599px), (max-height: 500px) { .v2-controls .v2-context:has(#v2-message:empty):has(#v2-terminal[hidden]):not(:has(#v2-action-chip:not([hidden]))) { display: none; } }
/* Active action (UR-G2): chosen in the menu, shown in the command bar; the target card confirms the order. */
.v2-action-chip { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 2px 2px 2px 8px; border: 1px solid var(--v2-accent-text); border-radius: 10px; background: var(--v2-surface2); }
.v2-action-chip[hidden] { display: none; }
.v2-action-icon { display: inline-grid; place-items: center; color: var(--v2-accent-text); }
.v2-action-text { display: grid; min-width: 0; line-height: 1.2; }
.v2-action-text strong, .v2-target-head strong { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.v2-action-detail { color: var(--v2-signal); font-size: 12px; overflow-wrap: anywhere; }
.v2-shell .v2-action-cancel { min-width: 40px; min-height: 40px; border-color: transparent; background: transparent; }
.v2-target-card { position: fixed; z-index: 20; display: grid; gap: 6px; width: max-content; max-width: min(320px, calc(100vw - 16px)); padding: 8px 10px; border-color: var(--v2-accent-text); box-shadow: 0 8px 30px #000b; }
.v2-target-card[hidden] { display: none !important; }
.v2-target-choices { display: grid; gap: 4px; overflow: auto; max-height: min(28dvh, 220px); padding: 3px; }
.v2-shell .v2-target-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 3px 8px;
  min-height: 36px;
  padding: 5px 8px;
  text-align: left;
  overflow-wrap: anywhere;
}
.v2-target-row-name { display: flex; align-items: center; min-width: 0; gap: 6px; }
.v2-target-row-metrics { font-size: 12px; color: var(--v2-signal); font-variant-numeric: tabular-nums; }
.v2-target-row-metrics:empty { display: none; }
.v2-target-row-cue { grid-column: 3; grid-row: 1; color: var(--v2-accent-text); }
.v2-target-compare .v2-target-row-metrics { grid-column: 1 / -1; grid-row: 2; }
.v2-target-card .v2-target-warning { margin: 0; color: var(--v2-danger-text); font-size: 13px; overflow-wrap: anywhere; }
.v2-weapon-budget { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.v2-map-hover { position: absolute; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; width: max-content; max-width: min(300px, 95%); padding: 5px 8px; border: 1px solid var(--v2-line); border-radius: 8px; background: var(--v2-surface); color: var(--v2-text); font-size: 12px; pointer-events: none; }
.v2-map-hover[hidden] { display: none; }
.v2-area-load, .v2-area-unload { fill: none; stroke: var(--v2-signal); stroke-width: 2; stroke-dasharray: 5 3; }
.v2-area-unload { stroke-dasharray: 2 3; }
.v2-target-head { display: flex; align-items: center; gap: 8px; }
.v2-card .v2-target-where { margin: 0; color: var(--v2-muted); font-size: 12px; }
.v2-target-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.v2-target-ratio { padding: 1px 6px; border: 1px solid var(--v2-line-strong); border-radius: 4px; font-variant-numeric: tabular-nums; }
.v2-target-chance { color: var(--v2-signal); }
.v2-target-blocked { color: var(--v2-danger-text); }
.v2-target-options { display: grid; gap: 6px; }
.v2-target-actions { display: flex; gap: 6px; }
.v2-shell .v2-action-execute { flex: 1; min-height: 44px; border-color: var(--v2-accent-text); background: var(--v2-accent); font-weight: 700; }
.v2-target-card[data-pointer="down"]::after, .v2-target-card[data-pointer="up"]::after { content: ""; position: absolute; left: var(--v2-pointer-x, 50%); width: 0; height: 0; border: 8px solid transparent; transform: translateX(-50%); }
.v2-target-card[data-pointer="down"]::after { bottom: -16px; border-top-color: var(--v2-accent-text); }
.v2-target-card[data-pointer="up"]::after { top: -16px; border-bottom-color: var(--v2-accent-text); }
