/* ---- 00-base.css ---- */
/* World Order — design tokens, reset, typography, background.
   Visual language: the main board's dark map, red/white "WORLD ORDER" logotype, the four powers' colours
   (USA blue, EU yellow, Russia white, China red), the region colours of the board. */

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/montserrat.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* surfaces (board background) */
  --bg: #14181d;
  --bg-2: #1b2128;
  --panel: rgba(31, 37, 44, 0.95);
  --panel-2: #262d35;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.35);

  /* text */
  --text: #eef1f4;
  --text-2: #c7ced5;
  --muted: #8d98a3;
  --accent: #e3262b;
  --pos: #63c46b;
  --neg: #ff6b5e;
  /* the AI bot's sparkle (admin/ui.tsx BotMark, the «ИИ-бот» choice) */
  --ai: #b99cff;

  /* powers (cube colours) */
  --us: #1f6fc1;
  --eu: #f2b705;
  --ru: #e6e9ec;
  --cn: #d42a20;
  --local: #111111;
  --us-ink: #5aa6f0;
  --eu-ink: #ffcf3a;
  --ru-ink: #f4f6f8;
  --cn-ink: #ff5b4f;

  /* regions (board colours) */
  --rg-AME: #b4532a;
  --rg-EUR: #1fa0a8;
  --rg-MENA: #8e9a2f;
  --rg-AFR: #b08a55;
  --rg-CAS: #d0862a;
  --rg-SAS: #8b2f8f;
  --rg-EAP: #2a9fd8;

  /* action types (card edge colours) */
  --t-diplomatic: #8bc34a;
  --t-economic: #f29b1d;
  --t-military: #d6332b;
  --t-domestic: #2a7fd4;

  --radius: 12px;
  --tap: 44px;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #eef0f2;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-2: #f3f5f7;
  --line: rgba(0, 0, 0, 0.12);
  --text: #15191d;
  --text-2: #3b434b;
  --muted: #6b7681;
  --ai: #7a4fd6;
  --ru: #b9c0c6;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 8px; }
.boot-logo, .logo { font-weight: 300; letter-spacing: 0.08em; font-size: 32px; margin: 0; }
.boot-logo b, .logo b { font-weight: 800; color: var(--accent); }
.boot-sub { color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- 10-chrome.css ---- */
/* Layout, top bar, bottom navigation, sheets, toasts, buttons and small controls. */

.app { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.main { flex: 1; padding: 8px 12px 96px; max-width: 100%; }
.main.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.main.three { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.6fr) minmax(300px, 0.9fr); gap: 12px; }
.col { min-width: 0; }
.panel { display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 16px; margin: 4px 0; letter-spacing: .02em; }
.panel h3, .sheet h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 12px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 20px; }
.err { color: var(--neg); font-size: 14px; }
.neg { color: var(--neg); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.empty { text-align: center; padding: 16px; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top)); background: var(--bg-2); border-bottom: 1px solid var(--line);
}
/* round over phase, the waiting flags on their right; a bot status (thinking, stuck) takes the phase's line and runs
   under the flags too */
/* the flags never shrink (as before): the round and phase text gives way with an ellipsis */
.tb-round { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, max-content) minmax(max-content, 1fr); grid-template-areas: "r w" "p w";
  column-gap: 8px; align-items: center; line-height: 1.1; font-size: 13px; }
.tb-round.has-status { grid-template-areas: "r w" "p p"; }
/* the status fills the line under the round and the flags without widening their columns */
.tb-round.has-status .tb-p { contain: inline-size; }
.tb-r { grid-area: r; } .tb-p { grid-area: p; }
.tb-r, .tb-p { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-wait { grid-area: w; display: flex; gap: 4px; align-items: center; }
/* a waiting bot seat: the robot on the flag's corner (no extra width in the bar) */
.tb-w { position: relative; display: inline-flex; flex: none; }
.tb-w .bot-mark { position: absolute; right: -5px; bottom: -6px; padding: 1px; border-radius: 50%; background: var(--bg-2); }
/* «Бот думает…» / «Бот застрял» in place of the phase name */
.tb-bot { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.tb-bot.stuck { color: var(--neg); font-weight: 700; }
button.tb-bot { display: block; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; text-decoration: underline dotted; }
/* the robot mark of a seat played by the server's bot, the sparkle of the AI bot (admin/ui.tsx BotMark); a failing
   model dims the sparkle (the seat plays on with the engine's choices) */
.bot-mark { display: inline-flex; align-items: center; flex: none; color: var(--text-2); }
.bot-mark.ai { color: var(--ai); }
.bot-mark.ai.degraded { color: var(--muted); }
.bot-mark.stuck { color: var(--neg); }
.vp-chip .bot-mark, .pw-tab .bot-mark { margin-left: -2px; }
.tb-me { display: flex; gap: 8px; font-weight: 700; }
.tb-tools { display: flex; align-items: center; gap: 4px; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn-online { background: var(--pos); }
.conn-offline { background: var(--neg); }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: var(--bg-2); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-b { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; position: relative; cursor: pointer; }
.nav-b.on { color: var(--text); }
.nav-b .dot { position: absolute; top: 8px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.prompt-dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--panel-2); color: var(--text);
  font: inherit; font-weight: 600; text-align: left; box-shadow: var(--shadow); cursor: pointer;
}

.toasts { position: fixed; top: 64px; left: 12px; right: 12px; z-index: 60; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--panel-2); box-shadow: var(--shadow); font-size: 14px; }
.toast.tone-bad { border-left: 4px solid var(--neg); }
.toast.tone-ok { border-left: 4px solid var(--pos); }

.btn { min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; }
.icon-btn { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--text); border-radius: 10px; cursor: pointer; }
.icon-btn:disabled { opacity: .35; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.seg button { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--panel-2); color: var(--text); border-color: var(--text-2); }
.seg button:disabled { opacity: .4; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; justify-content: center; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 36px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip-btn.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip-btn.used { opacity: .45; text-decoration: line-through; }
.chip-btn.pending { opacity: .7; border-style: dashed; }
.badge { display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--panel-2); font-size: 13px; }

.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; }
.stepper b { min-width: 22px; text-align: center; }

.amt { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; white-space: nowrap; }
.amts { display: inline-flex; gap: 6px; }
.ico.inline { vertical-align: -3px; }
.flag { border-radius: 2px; vertical-align: -2px; flex: none; }
.pw-chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.rg-tag { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 13px; font-weight: 600; border-left: 4px solid var(--line); background: var(--panel-2); }
.rg-tag.rg-AME { border-color: var(--rg-AME); } .rg-tag.rg-EUR { border-color: var(--rg-EUR); } .rg-tag.rg-MENA { border-color: var(--rg-MENA); }
.rg-tag.rg-AFR { border-color: var(--rg-AFR); } .rg-tag.rg-CAS { border-color: var(--rg-CAS); } .rg-tag.rg-SAS { border-color: var(--rg-SAS); } .rg-tag.rg-EAP { border-color: var(--rg-EAP); }
.hex { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; font-style: normal; font-weight: 800; font-size: 12px;
  background: var(--text); color: var(--bg); clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }

/* sheets (Hegemony's ui/sheet.tsx) */
body.sheet-open { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap.layer-top { z-index: 70; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.sheet { position: relative; width: 100%; max-width: 760px; max-height: 88vh; display: flex; flex-direction: column; background: var(--bg-2); border-radius: 16px 16px 0 0; box-shadow: var(--shadow); }
.sheet.tall { height: 88vh; }
.sheet-grip { display: flex; justify-content: center; padding: 8px; cursor: grab; touch-action: none; }
.sheet-grip i { width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px 16px; }
.sheet-t { flex: 1; font-weight: 700; font-size: 16px; }
.sheet-body { flex: 1; overflow: auto; padding: 0 16px 16px; outline: none; }
.sheet-sub { padding: 0 16px 8px; }
.sheet-f { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.pf-buttons { display: flex; gap: 8px; justify-content: flex-end; }
@media (min-width: 1100px) {
  .sheet-wrap { justify-content: flex-end; align-items: stretch; }
  .sheet { max-width: 520px; max-height: none; height: 100vh; border-radius: 0; }
}

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.settings { display: grid; gap: 8px; }
.settings label { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.raw { width: 100%; min-height: 160px; font-family: monospace; }
.nav-b .badge-n { position: absolute; top: 4px; right: calc(50% - 24px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--eu); color: #111; font-style: normal; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.settings-more { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---- 20-map.css ---- */
/* The Map: schematic Region cards and the board view. */

.map-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.vp-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.vp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; min-height: 32px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; }

.schema { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.region { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.region.rg-AME { border-left-color: var(--rg-AME); } .region.rg-EUR { border-left-color: var(--rg-EUR); } .region.rg-MENA { border-left-color: var(--rg-MENA); }
.region.rg-AFR { border-left-color: var(--rg-AFR); } .region.rg-CAS { border-left-color: var(--rg-CAS); } .region.rg-SAS { border-left-color: var(--rg-SAS); } .region.rg-EAP { border-left-color: var(--rg-EAP); }
.rg-h { display: flex; align-items: center; gap: 8px; }
.rg-zone { display: inline-flex; gap: 2px; flex: 1; }
.rg-engage { display: inline-flex; gap: 2px; align-items: center; font-weight: 700; }
.slots { display: flex; flex-direction: column; gap: 4px; }
.srow { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; }
.srow.perm { padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.srow-l { width: 40px; flex: none; font-style: normal; font-size: 11px; line-height: 16px; color: var(--muted); }
.slot { position: relative; display: inline-flex; flex-direction: column; align-items: center; min-width: 18px; }
.slot .sv { font-style: normal; font-size: 10px; line-height: 12px; color: var(--muted); }
.slot.extra .cube { outline: 1px dashed var(--muted); outline-offset: 1px; }
.cube { display: inline-block; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .4); }
.cube.free { border: 1px dashed var(--muted); background: transparent; }
.o-US { background: var(--us); } .o-EU { background: var(--eu); } .o-RU { background: var(--ru); } .o-CN { background: var(--cn); } .o-local { background: var(--local); border-color: #666; }
.rg-units { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.unit { display: inline-flex; align-items: center; gap: 2px; }
.rg-f { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.rg-f .score.ok { color: var(--pos); } .rg-f .score.no { color: var(--muted); }
.rg-f .maj { color: var(--text-2); flex: 1; display: inline-flex; gap: 3px; align-items: center; }
.rg-countries { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-country { display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }

/* board view */
.board-view { display: flex; flex-direction: column; gap: 8px; }
.board-zoom { display: flex; gap: 4px; justify-content: flex-end; }
.board-zoom button { min-height: 32px; padding: 2px 10px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--text-2); font: inherit; cursor: pointer; }
.board-zoom button.on { color: var(--text); border-color: var(--text-2); }
.board-scroll { overflow: auto; border-radius: var(--radius); max-height: 78vh; }
.board { position: relative; height: 0; }
.board-img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.board-img.fallback { background: #2b2c2e; }
.board-img.tiles .tile { position: absolute; height: auto; }
.bcube { position: absolute; width: 1.5%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 3px; border: 1px solid rgba(0, 0, 0, .6); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.barmy { position: absolute; transform: translate(-50%, -50%); min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(0, 0, 0, .55); color: #111; }
.barmy.pw-US { background: var(--us); color: #fff; } .barmy.pw-EU { background: var(--eu); } .barmy.pw-RU { background: var(--ru); } .barmy.pw-CN { background: var(--cn); color: #fff; }
.bengage { position: absolute; transform: translate(-50%, -50%); display: flex; gap: 1px; }
.marker { position: absolute; transform: translate(-50%, -50%); }
.marker.round { width: 2.2%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--accent); }
.bregion { position: absolute; width: 1px; height: 1px; opacity: 0; }
.country-band { display: flex; gap: 8px; flex-wrap: wrap; }
.cb-group { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; background: var(--panel); border-top: 3px solid var(--line); }
.cb-group.rg-AME { border-top-color: var(--rg-AME); } .cb-group.rg-EUR { border-top-color: var(--rg-EUR); } .cb-group.rg-MENA { border-top-color: var(--rg-MENA); }
.cb-group.rg-AFR { border-top-color: var(--rg-AFR); } .cb-group.rg-CAS { border-top-color: var(--rg-CAS); } .cb-group.rg-SAS { border-top-color: var(--rg-SAS); } .cb-group.rg-EAP { border-top-color: var(--rg-EAP); }
.cb-cards { display: flex; gap: 4px; }
.cb-card { padding: 0; border: 0; background: none; cursor: pointer; }
.cb-card img { width: 64px; border-radius: 6px; display: block; }
.cb-text { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; min-height: 64px; padding: 4px; border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 11px; }

/* ---- 30-power.css ---- */
/* The Power tab, cards, the Hand, the Market, History and forms. */

.pw-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pw-tab { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.pw-tab.on { background: var(--panel-2); border-color: var(--text-2); }
.pw-tab .me { font-style: normal; font-size: 11px; color: var(--muted); }
.pboard { display: flex; flex-direction: column; gap: 4px; }
.pb-head { display: flex; align-items: center; gap: 10px; }
.pb-head h2 { flex: 1; margin: 0; font-size: 17px; }
.pb-totals { display: flex; gap: 10px; font-size: 16px; }
.pb-row { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.focus { background: var(--accent); color: #fff; }
.pb-sec.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tracks { display: flex; flex-direction: column; gap: 4px; }
.track { display: flex; align-items: center; gap: 8px; }
.tr-ico { width: 24px; display: inline-flex; justify-content: center; }
.tr-cells { display: flex; gap: 2px; flex: 1; }
.cell { width: 26px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; border-radius: 4px; background: var(--panel-2); color: var(--muted); }
.cell.past { color: var(--text-2); }
.cell.at { background: var(--accent); color: #fff; font-weight: 800; }
.tr-stock { min-width: 28px; text-align: right; font-size: 16px; }
.allies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ally { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ally.exhausted { opacity: .5; background: repeating-linear-gradient(135deg, var(--panel), var(--panel) 6px, var(--panel-2) 6px, var(--panel-2) 12px); }
.al-top { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.al-mid { display: flex; gap: 6px; align-items: center; }
.al-sym { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; color: var(--text-2); }
.al-sym .imp { display: inline-flex; gap: 1px; margin-left: 6px; opacity: .8; }
.tok { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; }
.deal-from { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.commerce { display: flex; gap: 6px; flex-wrap: wrap; }
.com-card { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; }
.com-card.down { opacity: .35; }

/* cards */
.acard { display: flex; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.acard.clickable { cursor: pointer; }
.acard.dim { opacity: .55; }
.acard.selected { outline: 2px dashed var(--accent); }
.ac-stripe { width: 8px; display: flex; flex-direction: column; flex: none; }
.ac-stripe i { flex: 1; }
.t-diplomatic { background: var(--t-diplomatic); } .t-economic { background: var(--t-economic); } .t-military { background: var(--t-military); } .t-domestic { background: var(--t-domestic); }
.ac-body { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ac-h { display: flex; gap: 6px; align-items: center; }
.ac-name { flex: 1; font-size: 15px; }
.ac-cost { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; }
.ac-text { margin: 0; font-size: 14px; color: var(--text-2); }
.ac-f { display: flex; gap: 12px; font-size: 13px; }
.acard.compact .ac-body { padding: 6px 8px; gap: 2px; }
.acard.compact .ac-name { font-size: 13px; }
.gcard { padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.gcard header { display: flex; gap: 8px; align-items: center; }
.gcard header b:nth-child(2) { flex: 1; }
.gcard .lvl { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--accent); color: #fff; }
.gcard.used { opacity: .5; }
.card-sheet { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.card-img { max-width: 100%; max-height: 50vh; border-radius: 12px; }
.country-card p { margin: 6px 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* hand & market */
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.hand.mini { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.turn-h { font-size: 17px; margin: 4px 0; }
.turn-h.extra { color: var(--accent); }
.pending {
  position: fixed; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 26; display: flex; gap: 8px; align-items: center;
  padding: 8px 12px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--accent); box-shadow: var(--shadow);
}
.pending p { flex: 1; margin: 0; }
.cols-2 .pending, .cols-3 .pending { left: auto; width: min(420px, 40vw); }
.turn-alts { display: flex; flex-direction: column; gap: 8px; }
.alt-asset { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.alt-order { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.why { color: var(--muted); }
.played .piles { display: flex; gap: 8px; flex-wrap: wrap; }
.pile { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; background: var(--panel); min-width: 140px; }
.pile.facedown { border: 1px dashed var(--line); }
.pile-n { font-size: 12px; color: var(--muted); }
.market-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.mslot { cursor: pointer; }
.mslot.on { outline: 2px solid var(--accent); border-radius: 12px; }
.mslot.dim { opacity: .5; }
.glevel h3 { display: flex; gap: 8px; align-items: center; }
.glevel.next h3 { color: var(--accent); }
.gpiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.gpile { position: relative; cursor: pointer; }
.gpile.gone { opacity: .35; }
.gpile .left { position: absolute; right: 8px; bottom: 6px; font-size: 12px; color: var(--muted); }
.auto-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.auto-card { padding: 8px; border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.auto-row { display: flex; gap: 6px; align-items: center; }

/* history */
.h-filters { display: flex; gap: 8px; }
.h-filters select { min-height: 36px; border-radius: 8px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 4px 8px; font: inherit; }
.logtree { list-style: none; margin: 0; padding: 0; }
.logtree ul { list-style: none; margin: 0; padding-left: 16px; border-left: 1px solid var(--line); }
.le-row { display: flex; gap: 6px; align-items: flex-start; padding: 4px 2px; font-size: 14px; cursor: default; }
.le-row .ico { margin-top: 2px; color: var(--muted); flex: none; }
.le-msg { flex: 1; min-width: 0; }
.le.phase > .le-row { font-weight: 800; margin-top: 8px; }
.le.turn > .le-row { font-weight: 700; }
.le.private > .le-row { color: var(--text-2); font-style: italic; }
.le-more .ico { transition: transform .15s; }
.le-more.open .ico { transform: rotate(90deg); }
.mlink { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: 600; text-decoration: underline dotted; cursor: pointer; }
.msg-missing code { font-size: 12px; color: var(--muted); }
.mres { font-weight: 600; }

/* forms */
.choose { display: flex; flex-direction: column; gap: 6px; }
.opt, .cand { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.opt.on, .cand.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt:disabled, .cand:disabled { opacity: .45; cursor: default; }
.opt .ord { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.cands { display: flex; flex-direction: column; gap: 6px; }
.slot-pick { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.exhaust { margin: 8px 0; }
.trade .imports { display: flex; flex-direction: column; gap: 4px; }
.pile-pick, .asset-pick { padding: 6px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; margin-bottom: 8px; }
.pile-pick.on, .asset-pick.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.eng-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.threats { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.thr { display: inline-flex; gap: 2px; align-items: center; margin: 0 4px; }
.thr.bad { color: var(--neg); font-weight: 700; }
.thr.ignored { opacity: .4; text-decoration: line-through; }
.preview { margin-top: 12px; padding: 8px; border-radius: 10px; background: var(--panel); }
.preview summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.move-row { justify-content: space-between; }
.trade-rows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.trade-row { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.trade-row.on { border-color: var(--accent); }
.trade-row header { display: flex; gap: 6px; align-items: center; }
.tr-line { display: grid; grid-template-columns: 1fr auto 76px; gap: 8px; align-items: center; font-size: 14px; }
.tr-line > span:first-child { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.trade-sum { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mico { vertical-align: -2px; }
.tr-per { white-space: nowrap; }

/* end of the game */
.result { padding: 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.result h2 { margin: 0 0 8px; font-size: 20px; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); font-size: 16px; }
.rank-row.win { box-shadow: inset 0 0 0 2px var(--eu); }
.rank-row.me .rank-name { font-weight: 800; }
.rank-n { width: 22px; text-align: center; }
.rank-name { flex: 1; min-width: 0; }
.result .tb { display: inline-flex; gap: 3px; align-items: center; margin-right: 8px; }
.vp-src { margin-top: 8px; }
.vp-src summary { cursor: pointer; font-weight: 600; }
.tbl .num { text-align: right; }
.tbl tr.total td { border-bottom: 0; }

/* rules reference (help/) */
.help-t { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.help-tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-t .back { margin-left: -6px; }
.help-search { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.help-search input { flex: 1; min-width: 0; min-height: 32px; border: 0; background: none; color: var(--text); font: inherit; outline: none; }
.help-tip { color: var(--text-2); font-size: 14px; margin: 0 0 8px; }
.help-group h4 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.help-results { list-style: none; margin: 0; padding: 0; }
.help-row { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 48px; padding: 8px 10px; margin-bottom: 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.help-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.help-row small { color: var(--muted); font-size: 13px; }
.help-row .go { color: var(--muted); flex: none; }
.help-row .hr-head { font-style: normal; color: var(--text-2); font-weight: 600; }
.help-results mark { background: rgba(242, 183, 5, .35); color: inherit; border-radius: 2px; }
.rsec-sum { color: var(--text-2); font-weight: 600; margin: 0 0 8px; }
.rich { font-size: 15px; line-height: 1.5; }
.rich p { margin: 0 0 10px; }
.rich-h { margin: 16px 0 6px; font-size: 16px; scroll-margin-top: 56px; }
.rich-h.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: rgba(242, 183, 5, .45); } to { background: transparent; } }
.rich-ul, .rich-ol { margin: 0 0 10px; padding-left: 22px; }
.rich-ul li, .rich-ol li { margin: 3px 0; }
.rich-note { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border-left: 3px solid var(--eu); }
.rich-note .ico { flex: none; margin-top: 3px; }
.rich .ico.inline { vertical-align: -3px; }
.rich-w { margin: 6px 0 12px; }
.rlink { border: 0; background: none; padding: 0; color: var(--us-ink); font: inherit; text-decoration: underline; cursor: pointer; }
.rsec-see { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.rsec-see > span { color: var(--muted); font-size: 13px; }
.w-scroll { overflow-x: auto; }
.w-tbl td, .w-tbl th { white-space: nowrap; }
.w-res { display: inline-flex; gap: 4px; align-items: center; }
.w-flags { display: flex; gap: 2px; }
.w-focus section { margin-bottom: 10px; }
.w-focus h5 { margin: 0 0 2px; font-size: 15px; }
.w-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.w-step { display: inline-flex; gap: 3px; align-items: center; margin-right: 8px; }
.pf-help { margin-right: auto; }
.le.new > .le-row { background: rgba(242, 183, 5, .10); border-radius: 6px; }
.le.has-new > .le-row .le-msg::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--eu); vertical-align: 2px; }
.le-report { flex: none; min-height: 28px; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.rep-deltas { margin-bottom: 10px; }
.rep-deltas tr.me td:first-child { font-weight: 800; }
.card-rulings { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); width: 100%; }
.card-rulings h4 { margin: 0 0 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ruling { margin: 4px 0; font-size: 14px; }
.ruling-box { color: var(--eu-ink); font-style: normal; font-size: 12px; }
.eng-opt { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.play-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; } .down-card { opacity: .8; }

/* ---- «Подсказка»: the server's bot suggests a move (forms/prompt.tsx HintButton, panels/hand.tsx) ---- */
:root { --hint: #27b8a6; }
:root[data-theme="light"] { --hint: #0e8a7c; }
.turn-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.turn-top .turn-h { flex: 1; min-width: 0; }
.hint-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--hint); }
.btn.hint-btn { min-height: 36px; padding: 6px 12px; border-color: var(--hint); color: var(--text); }
.btn.hint-btn .ico { color: var(--hint); }
.hint-btn.thinking { cursor: progress; }
.hint-spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--hint); border-right-color: transparent; animation: hint-spin .8s linear infinite; }
.icon-btn .hint-spin { width: 18px; height: 18px; }
@keyframes hint-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hint-spin { animation-duration: 2.4s; } }
.hint-note { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 10px; padding: 8px 4px 8px 10px; border-radius: 10px; background: var(--panel-2); border-left: 3px solid var(--hint); }
.hint-note > .ico { flex: none; margin-top: 2px; color: var(--hint); }
.hint-note p { flex: 1; margin: 0; font-size: 14px; line-height: 1.35; }
.hint-note .icon-btn { flex: none; min-width: 32px; min-height: 32px; margin: -6px 0; }
.hand > .hint-pick { display: grid; }
.hint-pick > .acard { outline: 3px solid var(--hint); outline-offset: 2px; }
.hint-pick.down > .acard { outline-style: dashed; outline-width: 2px; }
.btn.hinted, .alt-asset.hinted { box-shadow: 0 0 0 3px var(--hint); }
.alt-asset.hinted { border-radius: 12px; }

/* ---- 40-admin.css ---- */
/* Pages outside the game screen and the host tools: the admin page (/admin, client/src/admin/), the join page
   (/g/<id>?join=…, client/src/lobby/), the host tools sheet (client/src/panels/host.tsx). Phone first: one column,
   the new game form collapsed above the list; from 960px the form is a column on the left. */

.adm-pw-US { --pw: var(--us); --pw-ink: var(--us-ink); }
.adm-pw-EU { --pw: var(--eu); --pw-ink: var(--eu-ink); }
.adm-pw-RU { --pw: var(--ru); --pw-ink: var(--ru-ink); }
.adm-pw-CN { --pw: var(--cn); --pw-ink: var(--cn-ink); }

/* ---------------- shared bits: fields, checkboxes, notes, links */
.adm-sm { min-height: 40px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.adm-note { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 4px 2px 0; }
.adm-form-err { color: var(--neg); font-size: 14px; margin: 0; }
.adm-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); text-align: left; }
/* 16px: phones do not zoom into the field */
.adm-field input, .adm-input {
  min-height: 44px; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25);
  color: var(--text); padding: 8px 12px; font: inherit; font-size: 16px;
}
.adm-field input::placeholder, .adm-input::placeholder { color: var(--muted); opacity: 0.85; }
.adm-field input:focus, .adm-input:focus { outline: 2px solid var(--text-2); outline-offset: 1px; }
:root[data-theme='light'] .adm-field input, :root[data-theme='light'] .adm-input { background: #fff; }
.adm-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; text-align: left; }
.adm-check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.adm-check span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-check small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.adm-chev { transition: transform .15s; }
.adm-chev.open { transform: rotate(90deg); }
.adm-lang button { min-height: 36px; padding: 4px 10px; font-weight: 600; }

.adm-links { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.adm-link { padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); min-width: 0; }
:root[data-theme='light'] .adm-link { background: var(--panel-2); }
.adm-link-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.adm-link-note { display: block; color: var(--muted); margin-top: 2px; font-size: 13px; }
.adm-host-l { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.adm-seat-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.adm-seat-pn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.adm-url { display: block; margin: 6px 0 8px; font-size: 12px; line-height: 1.35; color: var(--text-2); word-break: break-all; user-select: all; -webkit-user-select: all; }
.adm-link-b { display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 720px) {
  .adm-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
  .adm-link-h, .adm-link-note { grid-column: 1 / -1; }
  .adm-url { margin: 6px 0 0; }
  .adm-link-b { margin-top: 6px; flex-wrap: nowrap; }
}
.adm-seat-n { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text-2); }
.adm-seat-free { color: var(--pos); font-weight: 600; font-size: 14px; }

/* no top bar on these pages: toasts at the bottom */
.adm-root .toasts { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); }

/* ---------------- admin page */
.adm { max-width: 1180px; margin: 0 auto; padding: 12px 16px calc(28px + env(safe-area-inset-bottom)); }
.adm-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.adm-logo { font-size: 18px; letter-spacing: 0.08em; font-weight: 300; white-space: nowrap; }
.adm-logo b { font-weight: 800; color: var(--accent); }
.adm-sub { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; color: var(--text-2); }
.adm-top-b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.adm-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 16px; align-items: start; }
.adm-side, .adm-list { min-width: 0; }
@media (min-width: 960px) {
  .adm-cols { grid-template-columns: 380px minmax(0, 1fr); }
  .adm-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; }
}

.adm-panel { margin: 0 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.adm-panel-t { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; border-radius: var(--radius); }
.adm-panel-t span { flex: 1; }
.adm-panel-t:disabled { cursor: default; opacity: 1; }
.adm-panel-b { padding: 0 12px 12px; }

.adm-form { display: flex; flex-direction: column; gap: 8px; }
.adm-form-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px; }
.adm-form-h small { color: var(--muted); font-size: 13px; }
.adm-nseat { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 52px; padding: 4px 8px 4px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; }
.adm-nseat.on { background: color-mix(in srgb, var(--pw) 10%, transparent); border-color: color-mix(in srgb, var(--pw) 40%, transparent); }
.adm-nseat-t { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; flex: none; width: 132px; cursor: pointer; }
.adm-nseat-t input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.adm-nseat .adm-input { flex: 1; }
/* a seat in the game: «Игрок / Бот» on the first line, the name (or «свободное место») on its own line below */
.adm-nseat.on .adm-input, .adm-nseat.on .adm-free { flex: 1 0 100%; margin: 0 0 4px 4px; }
.adm-nseat .adm-who { margin-left: auto; flex-wrap: nowrap; }
.adm-nseat .adm-who button, .adm-speed .seg button, .host-bots .seg button { min-height: 40px; padding: 6px 12px; }
/* Игрок / Бот / ИИ-бот: three choices fit a phone's row next to the power */
.adm-nseat .adm-who button, .host-bots .host-who button { padding: 6px 10px; gap: 4px; }
.seg button .ico { flex: none; }
.seg .ico-sparkle { color: var(--ai); }
.adm-ai-note { display: flex; gap: 6px; align-items: flex-start; }
.adm-ai-note .ico { color: var(--ai); flex: none; margin-top: 1px; }
.adm-nseat.on.bot { background: color-mix(in srgb, var(--pw) 6%, transparent); border-style: dashed; }
.adm-speed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; }
.adm-speed > span { color: var(--text-2); font-weight: 600; }
.adm-speed .adm-note { flex-basis: 100%; margin: 0; }
.adm-bots-l .adm-link-h { gap: 8px; }
.adm-badge.is-stuck { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 55%, transparent); }
.adm-badge.is-degraded { color: var(--text-2); border-color: color-mix(in srgb, var(--ai) 55%, transparent); }
.adm-g-trouble { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 0; font-size: 13px; color: var(--neg); overflow-wrap: anywhere; }
.adm-g-trouble.is-degraded { color: var(--text-2); }
.adm-who-i { display: inline-flex; align-items: center; gap: 2px; }
.adm-seat .bot-mark { margin-left: -4px; }
.adm-npp { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; }
.adm-free { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1px dashed var(--line); color: var(--pos); font-size: 14px; font-weight: 600; }
.adm-form > .btn { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

.adm-created { margin: 0 0 12px; padding: 10px 12px 12px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--pos) 55%, transparent); background: color-mix(in srgb, var(--pos) 9%, var(--panel)); box-shadow: var(--shadow); }
.adm-created-h { display: flex; align-items: center; gap: 8px; }
.adm-created-h > .ico { color: var(--pos); flex: none; }
.adm-created-h b { flex: 1; min-width: 0; }

.adm-list-h { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin: 6px 2px 10px; }
.adm-list-h h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-2); }
.adm-list-h h2 small { color: var(--muted); font-size: 12px; letter-spacing: 0; margin-left: 4px; }
.adm-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.adm-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.adm-toggle.dim { opacity: 0.6; }
.adm-err { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; border: 1px solid var(--neg); color: var(--neg); font-size: 14px; }
.adm-empty { padding: 18px 4px; text-align: center; }

.adm-game { margin: 0 0 12px; padding: 10px 12px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.adm-game.archived { border-style: dashed; box-shadow: none; }
.adm-game.archived > :not(.adm-g-actions):not(.adm-links) { opacity: 0.72; }
.adm-g-h { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.adm-name { font-size: 16px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; margin-right: 2px; }
.adm-id { font-size: 12px; color: var(--muted); }
.adm-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); line-height: 1.6; }
.adm-badge.is-live { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 50%, transparent); }
.adm-badge.is-arch { color: var(--muted); border-style: dashed; }
.adm-g-meta { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.adm-g-phase { color: var(--text-2); font-weight: 600; }
.adm-g-who { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; color: var(--text-2); }
.adm-g-who.won { color: var(--eu-ink); font-weight: 700; }

.adm-seats { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
@media (min-width: 560px) { .adm-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-seat { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 4px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); }
.adm-seat.turn { box-shadow: inset 3px 0 0 var(--accent); }
.adm-seat.won { box-shadow: inset 3px 0 0 var(--eu); }
.adm-seat .pw-chip { flex: none; }
.adm-seat .amt { flex: none; margin-left: auto; }

.adm-g-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.adm-g-actions .btn { padding-left: 10px; padding-right: 10px; }
.adm-play { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.adm-play-g { align-items: center; }
.adm-play-l { font-size: 13px; color: var(--text-2); margin-right: 2px; }
@media (max-width: 559px) { .adm-play-l { flex-basis: 100%; } }
.adm-play-g + .adm-g-actions { margin-top: 6px; }

.adm-key { padding: 24px 16px; grid-template-columns: minmax(0, 360px); }
.adm-key .adm-key-f { width: min(100%, 360px); justify-self: center; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.adm-key-hint { max-width: 360px; justify-self: center; margin: 8px 0; }
.adm-key .adm-lang { justify-self: center; }

/* ---------------- join page */
.lobby { place-content: start center; grid-template-columns: minmax(0, 560px); justify-items: center; padding: max(32px, 8vh) 16px 32px; }
.lobby-name { font-size: 22px; font-weight: 700; margin: 4px 0 0; }
.lobby-state { margin: 0; }
.lobby-lead { margin: 8px 0 0; color: var(--text-2); }
.lobby-seats { width: min(100%, 420px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 560px) { .lobby-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 560px); } }
.lobby-seat { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border-radius: 14px; text-align: left; font: inherit; color: var(--text);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); opacity: 0.55; cursor: default; }
.lobby-seat.free { opacity: 1; cursor: pointer; border-color: color-mix(in srgb, var(--pw) 55%, transparent); background: color-mix(in srgb, var(--pw) 8%, var(--panel)); }
.lobby-seat.free:hover { background: color-mix(in srgb, var(--pw) 14%, var(--panel)); }
.lobby-seat.on { box-shadow: 0 0 0 2px var(--pw-ink), 0 6px 18px rgba(0, 0, 0, 0.35); }
.lobby-seat .flag { flex: none; }
.lobby-seat-t { display: flex; flex-direction: column; min-width: 0; }
.lobby-seat-t b { font-size: 16px; }
.lobby-seat-t small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-seat.free .lobby-seat-t small { color: var(--pos); font-weight: 600; }
.lobby-form { width: min(100%, 420px); display: flex; flex-direction: column; gap: 8px; text-align: left; margin-top: 4px; }
.lobby-form .btn { min-height: 48px; }
.lobby-err { color: var(--neg); font-size: 14px; margin: 0; max-width: 420px; }
.lobby-note { max-width: 420px; }
.lobby-go { min-width: 220px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.lobby .adm-lang { margin-top: 12px; }

/* ---------------- host tools (the sheet) */
.host-btn { color: var(--eu-ink); }
.host-t { display: inline-flex; align-items: center; gap: 8px; }
.host { display: flex; flex-direction: column; gap: 12px; }
.host section { min-width: 0; }
.host-items { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* phones: the rollback button under the command; wider: on its right */
.host-i { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 4px 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.host-i > .btn, .host-i > .host-now { grid-column: 2; justify-self: start; }
@media (min-width: 560px) {
  .host-i { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .host-i > .btn, .host-i > .host-now { grid-column: 3; grid-row: 1; }
}
.host-i.rev { box-shadow: inset 3px 0 0 var(--muted); }
.host-i.now { background: color-mix(in srgb, var(--pos) 10%, transparent); }
.host-seq { font-weight: 800; color: var(--muted); font-size: 14px; }
.host-ib { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.host-ih { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.host-ih small { color: var(--muted); }
.host-log { color: var(--muted); display: flex; flex-direction: column; overflow-wrap: anywhere; }
.host-now { font-size: 12px; font-weight: 700; color: var(--pos); text-transform: uppercase; letter-spacing: 0.05em; }
.host-adj form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.host-adj .adm-field input.host-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }
.host-cur { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.host-adj .btn-danger { min-height: 44px; background: color-mix(in srgb, var(--neg) 18%, var(--panel-2)); border-color: var(--neg); color: var(--text); }
.host-seats { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.host-seat { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); min-width: 0; }
.host-seat-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.host-seat-h .pw-chip { flex: none; }
.host-seat-h .conn { flex: none; margin-left: auto; }
.host-seat-b { display: flex; gap: 6px; flex-wrap: wrap; }
.host-seat .adm-url { margin: 0; }
.host-export { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; text-decoration: none; }
.host .adm-links { margin-top: 8px; }
/* host: the bots */
.host-bot .host-seat-h { flex-wrap: wrap; }
.host-bot .host-who { margin-left: auto; flex-wrap: nowrap; }
.host-bot.on { box-shadow: inset 3px 0 0 var(--text-2); }
.host-bot.on.ai { box-shadow: inset 3px 0 0 var(--ai); }
.host-bot.stuck { box-shadow: inset 3px 0 0 var(--neg); }
/* an AI bot whose model keeps failing: it plays on, so a note rather than an alarm */
.host-ai-trouble { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px; border-radius: 9px; font-size: 13px;
  color: var(--text); background: color-mix(in srgb, var(--ai) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ai) 40%, transparent); }
.host-bot-trouble { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px; border-radius: 9px; font-size: 13px;
  color: var(--text); background: color-mix(in srgb, var(--neg) 12%, transparent); border: 1px solid color-mix(in srgb, var(--neg) 45%, transparent); }
.host-bot-why { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.host-bots .adm-speed { margin-top: 8px; }
.host > section > .adm-link { margin-top: 8px; }

/* ---- 45-intro.css ---- */
/* «Знакомство с игрой» (help/intro.tsx): a carousel in a top-layer sheet — the step and the page title in the header,
   the page (swipe, ← →, or the buttons), dots and Skip / Back / Next in the footer. Phone first (390 px); a centred
   dialog instead of the side drawer on desktops. Colours from the tokens of 00-base.css, light theme at the end. */

/* ---------------- header */
.intro-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.intro-t small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intro-t b { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; line-height: 1.2; }
.intro-t b .ico { flex: none; color: var(--accent); }

/* ---------------- the page */
.intro-sheet .sheet-body { overscroll-behavior: contain; }
.intro-page { min-height: 100%; padding-top: 4px; touch-action: pan-y; animation: intro-in .22s ease-out; }
.intro-page.from-left { animation-name: intro-in-left; }
@keyframes intro-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes intro-in-left { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }

.intro-page .rich { font-size: 16px; line-height: 1.5; }
.intro-page .rich p { margin: 0 0 12px; }
.intro-page .rich-h { margin: 20px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.intro-page .rich > .rich-h:first-child { margin-top: 4px; }
/* list items as small cards: easier to read one at a time on a phone */
.intro-page .rich-ul { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.intro-page .rich-ul li { margin: 0; padding: 8px 10px 8px 12px; border-radius: 10px; background: var(--panel-2); border-left: 3px solid var(--line); }
.intro-page .rich-ol { padding-left: 0; list-style: none; counter-reset: intro; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.intro-page .rich-ol li { counter-increment: intro; position: relative; margin: 0; padding: 8px 10px 8px 42px; border-radius: 10px; background: var(--panel-2); }
.intro-page .rich-ol li::before { content: counter(intro); position: absolute; left: 10px; top: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.intro-page .rich-note { margin: 4px 0 12px; font-size: 15px; }
.intro-page .rlink { color: var(--us-ink); text-underline-offset: 2px; }

.intro-lead { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line); color: var(--text-2); font-size: 14px; line-height: 1.45; }
.intro-lead .ico { flex: none; margin-top: 2px; }

/* the six rounds (@rounds): a track of circles, the scoring rounds ringed, the current one filled */
.intro-rounds { position: relative; list-style: none; margin: 4px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.intro-rounds::before { content: ''; position: absolute; left: 8%; right: 8%; top: 17px; height: 2px; background: var(--line); }
.intro-rounds li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.intro-rounds b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--bg-2); font-size: 15px; }
.intro-rounds small { min-height: 15px; font-size: 11px; line-height: 15px; color: var(--muted); white-space: nowrap; }
.intro-rounds .scoring b { border-color: var(--eu); color: var(--eu-ink); }
.intro-rounds .scoring small { color: var(--text-2); font-weight: 700; }
.intro-rounds .now b { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------- "your power": the four powers, the power's card */
.intro-pws { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.intro-pws button { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-width: 0; }
.intro-pws button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intro-pws button.on { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.intro-you { font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.intro-pw { --pw: var(--line); margin-bottom: 14px; padding: 10px 12px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--pw); background: var(--panel-2); }
.intro-pw.pw-US { --pw: var(--us); } .intro-pw.pw-EU { --pw: var(--eu); } .intro-pw.pw-RU { --pw: var(--ru); } .intro-pw.pw-CN { --pw: var(--cn); }
.intro-pw header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.intro-pw header span { display: flex; flex-direction: column; min-width: 0; }
.intro-pw header b { font-size: 18px; line-height: 1.2; }
.intro-pw header small { color: var(--muted); font-size: 12px; }
.intro-pw dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px; margin: 0; align-items: baseline; font-size: 14px; }
.intro-pw dt { color: var(--muted); font-size: 13px; }
.intro-pw dd { margin: 0; min-width: 0; }
.intro-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.intro-tags .rg-tag { background: var(--bg-2); }
.intro-amts { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
/* phones: labels over their values (the long ally lists get the whole width) */
@media (max-width: 559px) {
  .intro-pw dl { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .intro-pw dt { font-size: 12px; }
  .intro-pw dd { margin-bottom: 7px; }
  .intro-pw dd:last-child { margin-bottom: 0; }
}

/* ---------------- footer: dots, then Skip … Back / Next */
.intro-sheet .sheet-f { padding-top: 4px; }
.intro-f { display: flex; flex-direction: column; gap: 4px; }
.intro-dots { display: flex; justify-content: center; }
.intro-dot { width: 32px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.intro-dot i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s, background-color .2s; }
.intro-dot.on i { width: 24px; background: var(--accent); }
.intro-dot:hover:not(.on) i { background: var(--muted); }
.intro-btns { display: flex; align-items: center; gap: 8px; }
.intro-btns > :first-child { margin-right: auto; }
.intro-btns .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 16px; }
.intro-skip { padding-left: 6px; padding-right: 6px; border-color: transparent; color: var(--text-2); }
.intro-prev { padding-left: 8px; }
.intro-next { min-width: 128px; padding-right: 10px; }

/* ---------------- desktop: a centred dialog */
@media (min-width: 1100px) {
  .sheet-wrap:has(> .sheet.intro-sheet) { justify-content: center; align-items: center; }
  .sheet.intro-sheet { max-width: 660px; height: min(800px, 92vh); border-radius: 16px; }
}

/* the reference's contents: the way back to the intro */
.help-row.intro-row { border-color: var(--accent); background: var(--panel-2); margin-bottom: 10px; }
.help-row.intro-row > .ico:first-child { color: var(--accent); }

/* ---------------- light theme */
:root[data-theme='light'] .intro-rounds .scoring b { color: var(--text); }
:root[data-theme='light'] .intro-page .rlink { color: var(--us); }
