:root {
  --ink: #eef5ed;
  --muted: #8ea29a;
  --bg: #060b0a;
  --panel: #0c1513;
  --panel-2: #111d1a;
  --line: #22332e;
  --accent: #d6b25e;
  --accent-bright: #f2d584;
  --red: #d75a55;
  --blue: #4f8fd8;
  --green: #50a978;
  --gold: #d4a83f;
  --neutral: #58645e;
  --danger: #e15c59;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 50% -20%, #18352d 0, var(--bg) 42%); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-nav, .command-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(6, 11, 10, .92); backdrop-filter: blur(14px); }
.site-nav { padding: 18px clamp(18px, 5vw, 70px); }
.brand, .mini-brand { color: var(--accent-bright); font-weight: 900; letter-spacing: .15em; text-decoration: none; }
.nav-links { display: flex; gap: 22px; color: var(--muted); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--ink); }

.hero { max-width: 1000px; margin: 0 auto; padding: 74px 24px 48px; text-align: center; }
.eyebrow, .panel-kicker { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.beta-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #63d38e; box-shadow: 0 0 14px #63d38e; }
.hero h1 { margin: 12px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(56px, 10vw, 112px); line-height: .9; letter-spacing: -.07em; }
.hero h1 span { color: var(--accent); }
.hero > p { max-width: 720px; margin: 22px auto; color: #b7c7c0; font-size: clamp(17px, 2.2vw, 22px); line-height: 1.55; }
.match-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.match-facts span, .room-badge { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; background: #0b1412; color: var(--muted); font-size: 12px; }

.lobby-shell { min-height: 100vh; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 18px; max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(155deg, rgba(17, 29, 26, .96), rgba(8, 15, 13, .98)); box-shadow: 0 20px 55px rgba(0, 0, 0, .24); }
.lobby-grid .panel, .waiting-room { padding: 24px; }
.panel h2 { margin: 5px 0 20px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 600; }
.panel label { display: block; margin: 14px 0 7px; color: #b8c8c1; font-size: 13px; font-weight: 700; }
.panel input, .panel select, .private-panel input, .private-panel select { width: 100%; border: 1px solid #30453e; border-radius: 8px; outline: none; background: #07100e; color: var(--ink); padding: 11px 12px; }
.panel input:focus, .panel select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214, 178, 94, .1); }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }

button { border: 1px solid var(--line); border-radius: 8px; background: #17241f; padding: 10px 14px; cursor: pointer; transition: .16s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); border-color: #4e695f; filter: brightness(1.08); }
button:disabled { opacity: .4; cursor: not-allowed; }
.primary-btn { border-color: #b08d43; background: var(--accent); color: #171208; font-weight: 900; }
.secondary-btn { background: #172720; font-weight: 750; }
.danger-btn { border-color: #7a3735; background: #7f312f; font-weight: 800; }
.text-btn { border: 0; background: transparent; color: var(--muted); padding: 5px; }
.danger { color: #ff8985 !important; }
.profile-panel > .primary-btn, .private-panel > .secondary-btn { width: 100%; margin-top: 18px; }
.join-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.join-line input { text-transform: uppercase; letter-spacing: .12em; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-heading h2 { margin-bottom: 10px; }

.room-list { display: grid; gap: 9px; max-height: 280px; overflow: auto; }
.room-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: #09110f; }
.room-row strong { display: block; margin-bottom: 3px; }
.room-row small { color: var(--muted); }

.waiting-room { max-width: 1132px; margin: 0 auto 42px; }
.waiting-room > div:first-child { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.waiting-room h2 { margin-bottom: 4px; }
#waitingCode { color: var(--accent-bright); letter-spacing: .18em; }
.seat-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; }
.seat { position: relative; min-height: 94px; border: 1px solid var(--line); border-top: 3px solid var(--seat-color); border-radius: 10px; padding: 14px; background: #08100e; }
.seat b, .seat span { display: block; }
.seat span { margin-top: 8px; color: var(--muted); font-size: 13px; }
.waiting-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.how-it-works { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; max-width: 1180px; margin: 0 auto; padding: 20px 24px 80px; }
.how-it-works article { border-top: 1px solid var(--line); padding-top: 20px; }
.how-it-works b { color: var(--accent); font-family: Georgia, serif; font-size: 30px; }
.how-it-works h3 { margin: 9px 0; }
.how-it-works p { color: var(--muted); line-height: 1.55; }

.game-shell { min-height: 100vh; padding-bottom: 45px; }
.command-bar { position: sticky; top: 0; z-index: 20; padding: 11px 18px; }
.command-bar > div:first-child { display: flex; align-items: center; gap: 13px; }
.mini-brand { font-size: 14px; }
.match-clock { color: var(--accent-bright); font: 700 22px ui-monospace, SFMono-Regular, Menlo, monospace; }
.command-actions { display: flex; gap: 8px; }
.command-actions button { padding: 7px 10px; background: transparent; }

.nation-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 16px 0; }
.nation-card { border: 1px solid var(--line); border-left: 4px solid var(--nation-color); border-radius: 9px; padding: 9px 12px; background: #0a1210; }
.nation-card.is-me { box-shadow: inset 0 0 0 1px var(--accent); }
.nation-card.is-leading { background: #14170f; }
.nation-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nation-card span { color: var(--muted); font-size: 11px; }

.resource-bar { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); gap: 7px; padding: 10px 16px; }
.resource-chip { display: flex; justify-content: space-between; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #0c1513; }
.resource-chip span { color: var(--muted); font-size: 12px; }
.resource-chip > div { display: grid; justify-items: end; }
.resource-chip strong { font-variant-numeric: tabular-nums; line-height: 1; }
.resource-chip small { margin-top: 4px; color: #778b82; font-size: 9px; font-weight: 800; }
.resource-chip small.rate-positive { color: #65ca91; }
.resource-chip small.rate-negative { color: #ef7b74; }
.campaign-status { display: flex; justify-content: center; gap: 1px; margin: 0 16px 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0a1311; }
.campaign-status > div { display: flex; align-items: center; justify-content: center; flex: 1; gap: 8px; min-width: 110px; padding: 8px 12px; border-right: 1px solid var(--line); }
.campaign-status > div:last-child { border-right: 0; }
.campaign-status i { color: var(--accent); font-style: normal; font-size: 17px; }
.campaign-status span, .campaign-status strong, .campaign-status small { display: block; }
.campaign-status strong { font-size: 13px; line-height: 1; }
.campaign-status small { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 12px; padding: 0 16px; }
.map-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #07100e; }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.map-toolbar strong, .map-toolbar span { display: block; }
.map-toolbar span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.map-tools, .map-mode { display: flex; align-items: center; gap: 7px; }
.player-identity { display: inline-flex !important; align-items: center; gap: 7px; border: 2px solid var(--identity-color); border-radius: 999px; padding: 6px 10px; background: color-mix(in srgb, var(--identity-color) 24%, #08110f); color: #fff !important; font-size: 11px; letter-spacing: .08em; box-shadow: 0 0 12px color-mix(in srgb, var(--identity-color) 35%, transparent); white-space: nowrap; }
.player-identity::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--identity-color); box-shadow: 0 0 7px var(--identity-color); }
.clear-selection-btn { border-color: #7d6750; padding: 7px 10px; background: #2a2117; color: #f3dca4; font-size: 11px; font-weight: 850; }
.map-mode { gap: 2px; border: 1px solid #355149; border-radius: 9px; padding: 2px; background: #07110f; }
.map-mode button { border: 0; padding: 6px 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; }
.map-mode button.is-active { background: #29473d; color: #f3e3b7; box-shadow: inset 0 0 0 1px #527366; }
.zoom-tools { display: flex; align-items: center; border: 1px solid #355149; border-radius: 9px; overflow: hidden; background: #07110f; }
.zoom-tools button { min-width: 29px; border: 0; border-right: 1px solid #294139; border-radius: 0; padding: 6px 8px; background: transparent; color: #c6d5cf; font-size: 12px; font-weight: 900; }
.zoom-tools button:last-child { border-right: 0; }
#zoomResetBtn { min-width: 48px; color: var(--muted); font-size: 9px; }
.order-guide { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 9px 14px; border-bottom: 1px solid #1c332e; background: #091714; color: #7f958c; font-size: 12px; font-weight: 750; }
.order-guide span { display: flex; align-items: center; gap: 7px; }
.order-guide b { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #3e5b51; border-radius: 50%; color: #b7c8c1; }
.order-guide .is-active { color: #f5dc91; }
.order-guide .is-active b { border-color: var(--accent); background: #4b3b19; }
.order-guide .is-done { color: #83d5ac; }
.order-guide .is-done b { border-color: #4c9d73; background: #17412d; }
.map-scroll { position: relative; overflow: auto; scrollbar-color: #53695f #09120f; scrollbar-width: thin; }
#worldMap { display: block; width: 100%; min-width: 720px; min-height: 500px; background: #092b3a; }
.map-tooltip { position: absolute; z-index: 15; width: 178px; border: 1px solid #dbc270; border-radius: 8px; padding: 9px 10px; background: rgba(7,18,16,.96); box-shadow: 0 10px 24px rgba(0,0,0,.45); pointer-events: none; }
.map-tooltip strong, .map-tooltip span, .map-tooltip small { display: block; }
.map-tooltip strong { color: #fff1b8; font: 700 14px Georgia, serif; }
.map-tooltip span { margin-top: 3px; color: #77d09c; font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.map-tooltip small { margin-top: 5px; color: #b3c2bc; font-size: 10px; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding: 9px 14px; color: var(--muted); font-size: 11px; }
.keyboard-hint { margin-left: auto; color: #72877e; font-size: 9px; }
.legend-rail { display: inline-block; width: 20px; border-top: 3px double var(--accent); }
.legend-capital { color: var(--accent-bright); font-style: normal; }
.legend-battle { color: #ff8e87; font-style: normal; }
.legend-factory { color: #f3cf75; font-style: normal; }

.island-silhouette { fill: #8a7e58; stroke: #d0bd82; stroke-width: 10; stroke-linejoin: round; opacity: .78; }
.compass-rose circle { fill: #082532; stroke: #c6b474; stroke-width: 1.2; opacity: .8; }
.compass-rose path { fill: #d8c685; stroke: #122e34; stroke-width: .5; }
.compass-rose text { fill: #e4d49b; text-anchor: middle; font: 800 10px Georgia, serif; }

.rail-line { stroke: #e9c668; stroke-width: 5; stroke-linecap: round; opacity: .8; }
.rail-tie { stroke: #17140b; stroke-width: 1.5; stroke-dasharray: 3 5; }
.trade-line { fill: none; stroke: #7ad7b0; stroke-width: 2.5; stroke-dasharray: 8 7; opacity: .75; }
.territory { cursor: pointer; }
.territory .province-shape { stroke: #172820; stroke-width: 1.8; transition: .15s; }
.territory .ownership-ring { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 2.3; stroke-dasharray: 5 3; pointer-events: none; filter: drop-shadow(0 0 2px rgba(255,255,255,.85)); }
.territory.is-mine .province-shape { filter: brightness(1.08); }
.territory:hover polygon { stroke: #f1d487; stroke-width: 3; filter: brightness(1.13); }
.territory.is-source polygon { stroke: #fff0b4; stroke-width: 5; }
.territory.is-target polygon { stroke: #fff; stroke-width: 4; stroke-dasharray: 6 4; }
.territory.is-valid-target:not(.is-source):not(.is-target) .province-shape { stroke: #e4ce7c; stroke-width: 2.8; filter: drop-shadow(0 0 4px rgba(244,214,130,.65)); }
.territory.is-battle polygon { animation: battlePulse 1s infinite alternate; }
.map-mode-terrain .territory.terrain-plains .province-shape { fill: #607d4c; }
.map-mode-terrain .territory.terrain-farmland .province-shape { fill: #9a8750; }
.map-mode-terrain .territory.terrain-forest .province-shape { fill: #315d3d; }
.map-mode-terrain .territory.terrain-hills .province-shape { fill: #6f7049; }
.map-mode-terrain .territory.terrain-mountains .province-shape { fill: #64675f; }
.map-mode-terrain .territory.owner-red .province-shape { stroke: #e86b64; }
.map-mode-terrain .territory.owner-blue .province-shape { stroke: #68a9ee; }
.map-mode-terrain .territory.owner-green .province-shape { stroke: #62c38c; }
.map-mode-terrain .territory.owner-gold .province-shape { stroke: #e4b942; }
.map-mode-terrain .territory.owner-neutral .province-shape { stroke: #283b34; }
.map-mode-political .territory.owner-red .province-shape { fill: #823f3b; stroke: #e97d75; }
.map-mode-political .territory.owner-blue .province-shape { fill: #345f8b; stroke: #77b4ed; }
.map-mode-political .territory.owner-green .province-shape { fill: #326b4a; stroke: #75ce98; }
.map-mode-political .territory.owner-gold .province-shape { fill: #846b2d; stroke: #e4bd55; }
.map-mode-political .territory.owner-neutral .province-shape { fill: #4e5b50; stroke: #26382f; }
.terrain-decoration { pointer-events: none; opacity: .8; }
.map-mode-political .terrain-decoration { opacity: .25; }
.mountain-shape { fill: #3e4541; stroke: #232d28; stroke-width: 1.2; }
.snow-line { fill: none; stroke: #e5e5d3; stroke-width: 2; }
.tree-shape { fill: #234a30; stroke: #152f20; stroke-width: 1.2; }
.hill-shape { fill: none; stroke: #464d31; stroke-width: 5; stroke-linecap: round; }
.field-lines { fill: none; stroke: #c0a766; stroke-width: 2; opacity: .65; }
.territory text { pointer-events: none; text-anchor: middle; fill: #f2f7f4; paint-order: stroke; stroke: rgba(0,0,0,.7); stroke-width: 2px; stroke-linejoin: round; }
.territory .troop-label { font-size: 13px; font-weight: 900; }
.territory .resource-label { font-size: 11px; stroke-width: 1px; }
.territory .capital-label { fill: #ffe79b; font-size: 17px; }
.you-marker { pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); }
.you-marker rect { fill: #fff4c3; stroke: #362b13; stroke-width: 1; }
.you-marker text { fill: #211a0c; stroke: none; text-anchor: middle; font-size: 8px; font-weight: 1000; letter-spacing: .08em; }
.building-tray { pointer-events: none; }
.building-marker circle { fill: #17221e; stroke: #f0d078; stroke-width: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.7)); }
.building-marker text { fill: #f5da87; stroke: none; text-anchor: middle; font-size: 8px; font-weight: 900; }
.building-marker .building-count { fill: #fff; stroke: #101a17; stroke-width: 2px; paint-order: stroke; font-size: 7px; }
.building-more { fill: #f1d481; stroke: #111; stroke-width: 1px; font-size: 8px; font-weight: 900; }
.construction-marker circle { fill: #1b241f; stroke: #6b756f; stroke-width: 3; }
.construction-marker .construction-progress { fill: none; stroke: #f2c95d; transform: rotate(-90deg); }
.construction-marker text { fill: #ffe99b; stroke: none; text-anchor: middle; font-size: 10px; }
.territory.upgrade-complete .province-shape { animation: upgradeFlash 1.1s ease-in-out 4; }
.battle-mark { fill: #ffb0a9; font-size: 20px; font-weight: 900; }
@keyframes battlePulse { from { filter: brightness(.9); } to { filter: brightness(1.35); } }
@keyframes upgradeFlash { 0%,100% { filter: none; } 50% { filter: brightness(1.65) drop-shadow(0 0 9px #ffe087); stroke: #fff0a8; stroke-width: 5; } }

.inspector { min-height: 570px; padding: 20px; overflow: auto; }
.empty-guide { display: grid; gap: 8px; margin-top: 22px; }
.empty-guide p { display: flex; align-items: center; gap: 11px; margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: #091411; }
.empty-guide b { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: #233b32; color: var(--accent-bright); }
.empty-guide span, .empty-guide strong { display: block; }
.empty-guide span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.empty-guide strong { margin-bottom: 2px; color: var(--ink); font-size: 12px; }
.territory-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stat { border: 1px solid var(--line); border-radius: 7px; padding: 8px; background: #08110f; }
.stat span, .stat strong { display: block; }
.stat span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.stat strong { margin-top: 3px; font-size: 14px; }
.queue-status { margin: 11px 0; border-left: 3px solid var(--accent); padding: 9px 10px; background: #18180f; font-size: 12px; }
.action-section { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.action-section h3 { margin: 0 0 9px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title span { color: var(--muted); font-size: 9px; }
.construction-title { margin-top: 20px; }
.action-main { min-height: 42px; }
.recruit-cost { margin: -2px 0 9px; color: #a9c6b9; text-align: right; font-size: 9px; font-weight: 750; }
.recruit-cost.unaffordable { color: #ef837d; }
.amount-row { display: grid; grid-template-columns: 1fr 55px; align-items: center; gap: 8px; margin-bottom: 8px; }
.amount-row input { padding: 0; }
.amount-row output { border: 1px solid var(--line); border-radius: 6px; padding: 5px; text-align: center; font-variant-numeric: tabular-nums; }
.action-section > button { width: 100%; }
.building-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.building-button { position: relative; min-height: 92px; overflow: hidden; padding: 9px 10px; text-align: left; background: linear-gradient(145deg, #13231d, #0c1714); }
.building-button strong, .building-button span { display: block; }
.building-heading { display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 5px; }
.building-heading i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #2b3925; color: #f1cf70; font-style: normal; }
.building-heading strong { font-size: 10px; line-height: 1.15; }
.building-heading b { color: #d9c070; font-size: 8px; }
.building-button .building-effect { margin-top: 7px; color: #a9bbb3; font-size: 9px; }
.building-button .building-cost { margin-top: 6px; color: #d8c993; font-size: 8px; font-weight: 800; }
.building-button em { position: absolute; inset: auto 0 0; padding: 3px; background: rgba(70,25,23,.92); color: #ffaaa4; text-align: center; font-size: 8px; font-style: normal; font-weight: 850; }
.building-button:disabled { opacity: .72; filter: saturate(.45); }
.order-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; margin-bottom: 12px; }
.order-route > div { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #08120f; }
.order-route small, .order-route strong { display: block; }
.order-route small { color: var(--accent); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.order-route strong { margin-top: 3px; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.order-route > span { color: var(--accent); font-weight: 900; }
.battle-forecast { margin: 9px 0; border: 1px solid; border-radius: 7px; padding: 8px 10px; font-size: 11px; font-weight: 850; }
.battle-forecast.favorable { border-color: #3f845e; background: #102b1e; color: #7ddb9e; }
.battle-forecast.uncertain { border-color: #8a7438; background: #2b2512; color: #ead07e; }
.battle-forecast.dangerous { border-color: #85413d; background: #311716; color: #ff928c; }
.amount-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: -2px 0 10px; }
.amount-presets button { padding: 6px; color: #c9d7d1; background: #0b1714; font-size: 11px; font-weight: 800; }
.target-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.target-buttons button { min-height: 42px; padding: 8px 5px; font-size: 11px; }

.lower-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; padding: 12px 16px; }
.trade-panel, .log-panel { padding: 18px; }
.muted.compact { max-width: 500px; margin: -10px 0 14px; }
.trade-form { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr .8fr auto; align-items: end; gap: 7px; }
.trade-form > div { display: grid; grid-template-columns: auto 58px 1fr; align-items: center; gap: 5px; }
.trade-form > div span { color: var(--muted); font-size: 11px; }
.trade-form input, .trade-form select { padding: 8px; }
.trade-list { display: grid; gap: 7px; margin-top: 10px; }
.trade-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: #08110f; font-size: 12px; }
.trade-row small { display: block; margin-top: 3px; color: var(--muted); }
.trade-actions { display: flex; gap: 5px; }
.trade-actions button { padding: 5px 8px; }
.event-log { max-height: 250px; overflow: auto; }
.event-row { border-bottom: 1px solid #17231f; padding: 7px 0; color: #b5c4bd; font-size: 12px; line-height: 1.4; }

.toast { position: fixed; z-index: 100; top: 68px; left: 50%; max-width: min(500px, calc(100vw - 30px)); transform: translate(-50%, -20px); border: 1px solid #73413d; border-radius: 9px; padding: 11px 15px; background: #321d1b; color: #ffd2cf; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.modal { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.76); backdrop-filter: blur(7px); }
.modal-card { position: relative; width: min(620px, 100%); max-height: 90vh; overflow: auto; border: 1px solid #3a4e46; border-radius: 16px; padding: 30px; background: #0d1714; box-shadow: 0 30px 90px #000; }
.modal-card li { margin: 12px 0; color: #b9c8c1; line-height: 1.5; }
.modal-close { position: absolute; top: 13px; right: 13px; border: 0; background: transparent; font-size: 25px; }
.end-card { text-align: center; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px max(20px, 4vw); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; gap: 16px; }

@media (max-width: 1000px) {
  .lobby-grid { grid-template-columns: 1fr 1fr; }
  .rooms-panel { grid-column: span 2; }
  .how-it-works { grid-template-columns: 1fr 1fr; }
  .game-layout { grid-template-columns: 1fr; }
  .inspector { min-height: 0; }
  .lower-grid { grid-template-columns: 1fr; }
  .trade-form { grid-template-columns: 1fr 1fr; }
  .campaign-status { justify-content: flex-start; overflow-x: auto; }
  .campaign-status > div { flex: 0 0 125px; }
}

@media (max-width: 700px) {
  .site-nav { padding: 15px; }
  .nav-links { display: none; }
  .hero { padding-top: 50px; }
  .lobby-grid { grid-template-columns: 1fr; padding: 0 14px 30px; }
  .rooms-panel { grid-column: auto; }
  .waiting-room { margin: 0 14px 30px; }
  .waiting-room > div:first-child { display: block; }
  .seat-list { grid-template-columns: 1fr 1fr; }
  .how-it-works { grid-template-columns: 1fr; padding: 10px 18px 50px; }
  .command-bar { flex-wrap: wrap; }
  .room-badge { display: none; }
  .nation-scores { grid-template-columns: 1fr 1fr; }
  .resource-bar { grid-template-columns: repeat(3, 1fr); }
  .resource-chip { padding: 7px; }
  .resource-chip > span { max-width: 62px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .campaign-status { margin-left: 8px; margin-right: 8px; }
  .game-layout, .lower-grid { padding-left: 8px; padding-right: 8px; }
  .map-scroll { overflow-x: auto; }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  .map-tools { width: 100%; flex-wrap: wrap; }
  .player-identity { order: -2; }
  .map-mode { order: -1; }
  .clear-selection-btn { margin-left: auto; }
  .building-grid { grid-template-columns: 1fr 1fr; }
  .trade-form { grid-template-columns: 1fr; }
  .target-buttons { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
