@charset "UTF-8";
/* Warfallow — in-game HUD (construction screen). Layout follows the owner's interface document (WC3-style):
   top bar (menu tabs · resources · wave), stats table right, builder rail + chat left, bottom: minimap · unit card · race emblem · command grid. */
:root { --gold: #d8b36a; --gold-2: #f0cf8a; --border: rgba(196, 165, 107, .32); --north: #7cc9ff; --south: #ff9c6b; --good: #8fd39b; --bad: #f08a7a; --warn: #f2c66d;
  --ink: #efe7d6; --mute: #a4afbb; --race: #7cc9ff; --bottom: 232px; --top: 52px; --rail: 64px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { color: var(--ink); background: #0b1118; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; } button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, select { min-height: 38px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)), #121b26; cursor: pointer; border-radius: 5px; padding: 6px 12px; font-weight: 600; letter-spacing: .02em; }
button:hover:not(:disabled) { background: #1b2735; border-color: var(--gold); box-shadow: 0 0 0 1px rgba(216,179,106,.35); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
input { background: rgba(0,0,0,.4); border: 1px solid var(--border); border-radius: 5px; padding: 8px; min-width: 0; }
a { color: var(--gold); text-decoration: none; } h1, h2, h3, p { margin: 0; } h2, h3 { font-family: var(--serif); font-weight: 500; }
.panel { border: 1px solid var(--border); background: linear-gradient(160deg, rgba(14,21,30,.94), rgba(10,16,23,.94)); box-shadow: 0 14px 40px rgba(0,0,0,.5); border-radius: 6px; }
.primary, #confirm-build { background: linear-gradient(180deg, #e9c87c, #b88a3c 60%, #9a6f2b); color: #1a1208; border-color: #f3dca3; text-shadow: 0 1px 0 rgba(255,255,255,.25); white-space: nowrap; }
.primary:hover:not(:disabled), #confirm-build:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(180deg, #e9c87c, #b88a3c 60%, #9a6f2b); color: #1a1208; }
.eyebrow, .section-label { color: var(--gold); letter-spacing: .16em; text-transform: uppercase; font-size: 11px; }
.muted { color: var(--mute); font-size: 12px; } .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } [hidden] { display: none !important; }

/* arena + race frame */
#arena { position: absolute; inset: var(--top) 0 var(--bottom) 0; width: 100%; height: calc(100% - var(--top) - var(--bottom)); display: block; touch-action: none; outline: none; background: linear-gradient(180deg, #5c7fa6, #7a9ab8); }
body.collapsed { --bottom: 0px; }
.race-frame { position: absolute; inset: var(--top) 0 var(--bottom) 0; pointer-events: none; z-index: 1;
  box-shadow: inset 0 0 90px 10px color-mix(in srgb, var(--race) 55%, transparent), inset 0 0 20px 2px color-mix(in srgb, var(--race) 40%, #000); transition: box-shadow .4s; }

/* top bar */
.topbar { position: absolute; inset: 0 0 auto; height: var(--top); z-index: 5; display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: linear-gradient(180deg, #0e161f, #0a1017); border-bottom: 2px solid var(--gold); box-shadow: 0 6px 24px rgba(0,0,0,.55); }
.menu-tabs { display: flex; gap: 4px; }
.menu-tabs button { min-height: 30px; padding: 4px 10px; font-size: 12px; background: linear-gradient(180deg, #243242, #121b26); color: #e4dcc8; }
.menu-tabs button[aria-expanded="true"] { border-color: var(--gold); color: var(--gold-2); background: linear-gradient(180deg, #2c3a4c, #15202c); }
.resources { display: flex; gap: 6px; flex: 1; justify-content: center; min-width: 0; }
.res { display: flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--border); border-radius: 5px; background: rgba(0,0,0,.35); min-width: 0; }
.res .ico { font-size: 15px; color: var(--gold); } .res.gold .ico { color: #f3cf6b; }
.res small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); line-height: 1; }
.res strong { font-family: var(--serif); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.res.gold strong { color: #f3cf6b; } .res em { display: block; font-style: normal; font-size: 10px; color: var(--mute); } .res em.bonus { color: var(--good); }
.res.game strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.connection-tools { display: flex; gap: 8px; align-items: center; font-size: 12px; }
#connection { display: inline-flex; align-items: center; gap: 7px; color: var(--mute); white-space: nowrap; }
#connection::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); }
body[data-status="online"] #connection { color: var(--good); } body[data-status="online"] #connection::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
body[data-status="offline"] #connection { color: var(--bad); } body[data-status="offline"] #connection::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
body[data-status="reconnecting"] #connection::before, body[data-status="connecting"] #connection::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
#reconnect { min-height: 30px; padding: 3px 8px; font-size: 12px; }

/* wave timer + stats table (right) */
.wave-timer { position: absolute; right: 10px; top: calc(var(--top) + 8px); z-index: 4; display: flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-top: 2px solid var(--gold); }
.wave-timer span { color: var(--mute); font-size: 12px; } .wave-timer strong { font-family: var(--serif); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; } .wave-timer small { font-size: 10px; color: var(--mute); }
.teams { position: absolute; right: 10px; top: calc(var(--top) + 44px); z-index: 4; width: 272px; padding: 5px 8px 4px; }
.roster-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.brand-line { display: inline-flex; align-items: center; gap: 5px; font-family: var(--serif); font-size: 13px; color: #f4e6c6; } .brand-line i { font-style: normal; color: var(--gold); }
#allies-close, #chat-close { min-height: 24px; width: 26px; padding: 0; border: 0; background: transparent; color: var(--mute); font-size: 18px; } #allies-close:hover, #chat-close:hover { box-shadow: none; background: transparent; color: var(--gold-2); }
.roster-cols, .roster-row { display: grid; grid-template-columns: 22px 24px 1fr 32px 36px 44px; gap: 4px; align-items: center; }
.roster-cols { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 3px 0; border-bottom: 1px solid var(--border); }
.team-name { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; padding: 4px 0 1px; color: var(--north); } .team-name.south { color: var(--south); }
.roster-row { font-size: 12px; padding: 1px 0; border-bottom: 1px solid rgba(255,255,255,.04); color: #d6dde5; font-variant-numeric: tabular-nums; }
.roster-row.empty { color: #5f6b78; } .roster-row.me .name { color: var(--gold-2); } .roster-row.off .name { color: var(--mute); text-decoration: line-through; }
.roster-row img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border); background: #000; } .roster-row .race-empty { width: 22px; height: 22px; border-radius: 4px; border: 1px dashed #39434f; }
.roster-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .roster-row .num { text-align: right; color: var(--mute); } .roster-row .num.bonus { color: var(--good); }
.teams > p { display: none; }

/* left rail + chat */
.left-rail { position: absolute; left: 10px; top: calc(var(--top) + 8px); z-index: 4; display: flex; flex-direction: column; gap: 5px; width: var(--rail); }
.rail-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: var(--rail); height: 60px; padding: 4px 2px; border: 1px solid var(--border); border-radius: 6px; background: linear-gradient(160deg, rgba(14,21,30,.94), rgba(10,16,23,.94)); color: var(--mute); text-decoration: none; }
.rail-slot span:last-child { font-size: 8px; letter-spacing: .06em; text-transform: uppercase; } .rail-slot .empty { font-size: 18px; color: #4b5663; }
.rail-slot.builder { border-color: var(--gold); color: var(--gold-2); } .rail-slot.builder img { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; object-position: 50% 15%; }
.rail-slot.building { opacity: .7; } a.rail-slot:hover { border-color: var(--gold); }
.chat-dock { position: absolute; left: 10px; bottom: calc(var(--bottom) + 10px); height: 150px; z-index: 4; width: 250px; display: flex; flex-direction: column; padding: 4px 8px 6px; }
.chat-head { display: flex; align-items: center; gap: 8px; } .chat-head > span { font-family: var(--serif); font-size: 13px; flex: 1; }
.channel-label select { min-height: 24px; padding: 1px 6px; font-size: 11px; }
#chat-log { flex: 1; min-height: 40px; overflow: auto; font-size: 11px; margin: 4px 0; padding: 4px 6px; background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 5px; word-break: break-word; }
#chat-log p { margin: 3px 0; color: #c9d2cf; } #chat-log strong { font-weight: 600; color: var(--gold-2); }
#chat-form { display: flex; gap: 4px; } #chat-text { flex: 1; padding: 4px 6px; min-height: 28px; font-size: 12px; } #chat-form button { padding: 2px 10px; min-height: 28px; }
.chat-dock .muted { margin-top: 4px; font-size: 10px; }

/* minimap, camera, notice */
.map-panel { position: absolute; left: 10px; bottom: 10px; width: 108px; z-index: 6; padding: 4px; }
#minimap { display: block; width: 100%; height: 204px; cursor: crosshair; touch-action: none; border: 1px solid var(--border); border-radius: 4px; background: #0d1a21; }
.map-title { display: flex; justify-content: space-between; color: var(--mute); font-size: 9px; letter-spacing: .06em; padding-top: 2px; }
.camera-tools { position: absolute; right: 10px; bottom: calc(var(--bottom) + 10px); z-index: 4; display: flex; gap: 5px; }
.camera-tools button { background: rgba(17,35,43,.9); min-height: 28px; padding: 2px 8px; font-size: 12px; }
.notice { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom) + 56px); z-index: 7; max-width: 560px; width: max-content; padding: 10px 16px; background: #16221c; border: 1px solid var(--good); color: #d9f5dd; border-radius: 6px; box-shadow: 0 14px 40px rgba(0,0,0,.5); font-size: 13px; }

/* bottom HUD */
.hud { position: absolute; left: 124px; right: 10px; bottom: 10px; height: calc(var(--bottom) - 10px); z-index: 5; display: flex; flex-direction: column; border-top: 2px solid var(--gold); }
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 34px; flex-shrink: 0; border-bottom: 1px solid rgba(196,165,107,.2); padding: 0 6px 0 4px; }
.hud-top nav { display: flex; gap: 2px; }
.hud-top nav button { border: 0; background: transparent; color: var(--mute); min-height: 30px; padding: 4px 10px; font-size: 12px; }
.hud-top nav button[aria-pressed="true"] { color: var(--gold-2); background: linear-gradient(0deg, rgba(216,179,106,.14), transparent); box-shadow: inset 0 -2px var(--gold); }
.field-caption { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: var(--mute); overflow: hidden; white-space: nowrap; }
.field-caption strong { font-family: var(--serif); font-size: 13px; font-weight: 500; color: #f4e6c6; }
#collapse { border: 0; background: transparent; width: 34px; min-height: 30px; font-size: 18px; padding: 0; }
.panel-content { padding: 6px 10px; overflow: auto; flex: 1; min-height: 0; }
.construction-layout { display: grid; grid-template-columns: minmax(280px, 1fr) 76px minmax(360px, 1.6fr); gap: 0 10px; overflow: hidden; }
.unit-card-info { display: grid; grid-template-columns: 78px 1fr; gap: 3px 10px; align-content: start; overflow: auto; min-height: 0; padding-right: 6px; border-right: 1px solid rgba(196,165,107,.18); }
.unit-card-info > .eyebrow, .unit-card-info > h2, .unit-card-info > p { grid-column: 1 / -1; } .unit-card-info h2 { font-size: 17px; color: #f4e6c6; } .unit-card-info > p { color: var(--mute); font-size: 11px; }
.unit-portrait { grid-row: 1 / span 4; width: 78px; height: 78px; object-fit: cover; object-position: 50% 12%; border: 1px solid var(--gold); border-radius: 5px; background: #000; }
.unit-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .unit-title h2 { font-size: 16px; } .unit-title span { font-size: 11px; color: var(--gold); white-space: nowrap; }
.unit-role { font-size: 11px; color: #cfd6c8; }
.stat-grid { display: grid; grid-template-columns: repeat(4, auto); gap: 1px 12px; font-size: 12px; } .stat-grid div { white-space: nowrap; } .stat-grid small { display: block; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.ability { grid-column: 1 / -1; font-size: 11px; color: #c4cfcc; margin-top: 2px; } .ability strong { color: var(--gold-2); font-weight: 600; }
.race-emblem { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.race-emblem img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; border: 2px solid var(--race); box-shadow: 0 0 22px color-mix(in srgb, var(--race) 50%, transparent); background: #000; }
.race-emblem img:not([src]), .race-emblem img[src=""] { visibility: hidden; } .race-emblem span { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.command-wrap { display: flex; flex-direction: column; min-height: 0; }
.command-grid { display: flex; gap: 10px; flex: 1; min-height: 0; overflow: auto; padding-top: 2px; }
.tier-group { flex: 1; min-width: 0; } .tier-heading { font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); margin: 0 0 3px; display: flex; justify-content: space-between; border-bottom: 1px solid rgba(196,165,107,.25); padding-bottom: 2px; }
.tier-heading .state { color: var(--mute); letter-spacing: 0; text-transform: none; font-size: 10px; } .tier-group.locked .tier-heading { color: #8d9299; }
.unit-list { display: flex; flex-wrap: wrap; gap: 4px; }
.unit-card { position: relative; width: 46px; height: 58px; padding: 0; overflow: visible; border: 1px solid #8a7a56; border-radius: 5px; background: #09141a; }
.unit-card img { display: block; width: 100%; height: 41px; object-fit: cover; object-position: 50% 15%; border-radius: 4px 4px 0 0; }
.unit-card .price { display: block; height: 16px; line-height: 16px; margin-top: -1px; font-size: 10px; color: #f3cf6b; background: rgba(0,0,0,.5); border-radius: 0 0 4px 4px; }
.unit-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold-2); z-index: 3; }
.unit-card.selected, .unit-card[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 6px 18px rgba(216,179,106,.35); }
.unit-card.locked img { filter: grayscale(1) brightness(.55); } .unit-card.locked .price { color: #8d9299; }
.unit-card .lock { position: absolute; top: 2px; right: 2px; font-size: 9px; color: #dbe5e7; background: rgba(23,36,42,.9); border-radius: 3px; padding: 1px 4px; }
.tip { position: fixed; width: 270px; padding: 8px 10px; text-align: left; font-weight: 400; font-size: 12px; color: #dfe5e2; background: #0e161f; border: 1px solid var(--gold); border-radius: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.6); display: none; z-index: 20; pointer-events: none; }
.tip.show { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; }
.tip img { grid-row: 1 / span 3; width: 52px; height: 52px; object-fit: cover; object-position: 50% 12%; border-radius: 4px; border: 1px solid var(--border); }
.tip b { color: #f4e6c6; font-family: var(--serif); font-size: 15px; font-weight: 500; } .tip .role { color: var(--gold-2); } .tip .stats { color: #cfd6c8; }
.tip .need { grid-column: 1 / -1; color: var(--warn); border-top: 1px solid rgba(255,255,255,.08); padding-top: 4px; margin-top: 2px; } .tip .ab { grid-column: 1 / -1; color: #aab6b3; }
.placement { display: flex; align-items: center; gap: 6px; border-top: 1px solid rgba(196,165,107,.18); padding-top: 4px; margin-top: 3px; flex-shrink: 0; }
.cell-inputs { display: flex; align-items: center; gap: 6px; } .cell-inputs label { display: flex; gap: 4px; align-items: center; font-size: 11px; color: var(--mute); } .cell-inputs input { width: 44px; padding: 3px; min-height: 28px; } .cell-inputs button { min-height: 28px; padding: 3px 8px; font-size: 12px; }
#placement-note { font-size: 11px; flex: 1; color: #c6d0d2; } #cancel-build, #confirm-build { min-height: 28px; padding: 3px 12px; font-size: 12px; }
.hud-foot { display: flex; justify-content: space-between; gap: 10px; padding: 1px 10px; color: #6f7b88; font-size: 9px; flex-shrink: 0; line-height: 1.2; }
.section-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; } .section-label span { color: var(--mute); letter-spacing: 0; text-transform: none; font-size: 11px; }
.research-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.research-card { border: 1px solid var(--border); background: rgba(27,43,49,.5); padding: 5px 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 5px; }
.research-card h3 { font-size: 13px; } .research-card small { display: block; color: var(--mute); font-size: 11px; } .research-card button { font-size: 12px; white-space: nowrap; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; } .quick-grid button { font-size: 12px; text-align: left; min-height: 30px; padding: 4px 8px; font-weight: 500; }

/* popovers */
.pop { position: absolute; z-index: 9; top: calc(var(--top) + 6px); left: 14px; width: 320px; padding: 12px 14px; }
.pop h3 { font-size: 17px; margin-bottom: 8px; color: #f4e6c6; } .pop dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; } .pop dt { color: var(--gold); } .pop dd { margin: 0; color: #d6dde5; }
.menu-item { display: block; width: 100%; text-align: left; margin-top: 6px; color: var(--ink); }

/* overlay */
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(5,8,12,.7); backdrop-filter: blur(6px); }
.overlay-card { width: min(420px, 100%); text-align: center; padding: 28px 24px 22px; background: #121b26; border: 1px solid rgba(196,165,107,.5); border-radius: 8px; }
.overlay-card h3 { font-size: 1.6rem; margin-bottom: 8px; } .overlay-card p { color: var(--mute); font-size: .9rem; } .overlay-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.spinner { display: block; width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid rgba(216,179,106,.2); border-top-color: var(--gold); animation: spin .9s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

/* collapsed: only rail, minimap, camera stay */
body.collapsed .camera-tools { bottom: 14px; } body.collapsed .notice { bottom: 90px; }
body.collapsed .chat-dock { bottom: 250px; }

@media (min-width: 1600px) { body { --bottom: 250px; } .unit-card { width: 54px; height: 70px; } .unit-card img { height: 52px; } }
@media (max-width: 1250px) { .res.game { display: none; } .teams { width: 250px; } .chat-dock { width: 220px; } .construction-layout { grid-template-columns: minmax(240px, 1fr) 60px minmax(300px, 1.5fr); } .race-emblem img { width: 52px; height: 52px; } }
@media (max-width: 1000px) { .teams, .chat-dock { display: none; } .teams.open, .chat-dock.open { display: flex; flex-direction: column; } .teams.open { display: block; } .wave-timer small { display: none; } .res small { display: none; } .res { padding: 4px 8px; } }
@media (max-width: 700px) {
  body { --top: 92px; --bottom: 46dvh; --rail: 60px; }
  .topbar { flex-wrap: wrap; gap: 4px 8px; padding: 6px 8px; align-content: center; }
  .menu-tabs { order: 1; width: 100%; justify-content: space-between; } .menu-tabs button { flex: 1; padding: 4px 4px; font-size: 11px; min-height: 30px; }
  .resources { order: 2; flex: 1; gap: 4px; } .res { padding: 2px 6px; gap: 4px; } .res strong { font-size: 15px; } .res .ico { font-size: 14px; } .res em { display: none; }
  .connection-tools { order: 3; font-size: 10px; } #reconnect { display: none; } #connection { gap: 4px; }
  .wave-timer { right: 8px; top: calc(var(--top) + 6px); padding: 3px 8px; } .wave-timer strong { font-size: 14px; }
  .left-rail { left: 8px; top: calc(var(--top) + 6px); gap: 4px; } .rail-slot { height: 56px; padding: 3px; overflow: hidden; } .rail-slot img { width: 32px; height: 32px; } .rail-slot span:last-child { font-size: 7px; letter-spacing: 0; } .rail-slot .empty { font-size: 16px; }
  .teams.open { right: 8px; left: 8px; top: calc(var(--top) + 44px); width: auto; z-index: 8; } .chat-dock.open { left: 8px; right: 8px; width: auto; top: calc(var(--top) + 44px); bottom: calc(var(--bottom) + 8px); max-height: none; z-index: 8; }
  .camera-tools { right: 8px; bottom: calc(var(--bottom) + 8px); } .camera-tools button { font-size: 11px; min-height: 32px; padding: 4px 8px; }
  .map-panel { left: 8px; bottom: calc(var(--bottom) + 8px); width: 58px; padding: 3px; z-index: 4; } #minimap { height: 90px; } .map-title { font-size: 7px; letter-spacing: 0; } .map-title span:nth-child(2) { display: none; }
  .hud { left: 0; right: 0; bottom: 0; height: var(--bottom); border-radius: 0; border-left: 0; border-right: 0; padding-bottom: env(safe-area-inset-bottom); }
  .hud-top { height: 42px; } .hud-top nav button { padding: 5px 8px; font-size: 12px; } .field-caption { display: none; }
  .construction-layout { display: flex; flex-direction: column; overflow: auto; gap: 8px; }
  .unit-card-info { border-right: 0; grid-template-columns: 84px 1fr; order: 2; } .unit-portrait { width: 84px; height: 84px; } .race-emblem { display: none; }
  .command-wrap { order: 1; flex: none; min-height: auto; } .command-grid { overflow: visible; flex: none; min-height: auto; } .tier-group { min-height: auto; }  .unit-card { width: 54px; height: 72px; } .unit-card img { height: 50px; }
  .tip { display: none !important; }
  .placement { position: sticky; bottom: 0; background: #0f1821; flex-wrap: wrap; gap: 6px; padding: 8px 0; order: 3; } #placement-note { flex-basis: 100%; order: 4; } .cell-inputs input { width: 44px; }
  .notice { left: 8px; right: 8px; transform: none; width: auto; max-width: none; bottom: calc(var(--bottom) + 52px); font-size: 11px; padding: 8px; }
  .research-grid, .quick-grid { grid-template-columns: 1fr; } .hud-foot { font-size: 8px; } .pop { left: 8px; right: 8px; width: auto; }
  body.collapsed .map-panel { bottom: 8px; } body.collapsed .camera-tools { bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* v9: шахта, итог матча */
.res.mine { cursor: pointer; border: 1px solid rgba(216,179,106,.35); border-radius: 6px; background: rgba(216,179,106,.08); color: inherit; font: inherit; padding: 2px 8px; }
.res.mine:hover:not(:disabled) { background: rgba(216,179,106,.18); border-color: var(--gold); }
.res.mine:disabled { opacity: .55; cursor: default; }
.res.mine strong { color: var(--gold); }
#income.bonus { color: #8fe08a; }
.overlay.result .overlay-card { text-align: center; max-width: 420px; }
.overlay.result h3 { font-family: var(--serif); font-size: 30px; margin: 8px 0 4px; }
.overlay.result.win h3 { color: var(--gold); } .overlay.result.lose h3 { color: #e88a7a; }
.result-stats { display: grid; gap: 4px; margin: 12px 0 16px; font-size: 13px; text-align: left; }
.result-stats div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; border-radius: 4px; background: rgba(255,255,255,.04); }
.sell-box { margin-top: 10px; display: grid; gap: 6px; }
.sell-box button { padding: 8px 10px; border-radius: 6px; border: 1px solid #b0564a; background: rgba(176,86,74,.18); color: #ffd9d2; cursor: pointer; font: inherit; }
.sell-box button:hover:not(:disabled) { background: rgba(176,86,74,.32); }

#wave-timer.soon { color: #ffcf6b; }
