/* ===== Hexes of Empire — game-specific styles =====
   Generic chrome (bar, buttons, modals, toast) comes from shared/css/glass.css.
   This file re-tints that chrome to a crown-and-banner palette, then lays out
   the one-screen frame: nation strip on top, hex map beside an order panel. */

:root {
  --accent-1: #7c5cff;
  --accent-2: #34d6b4;
  --on-accent: #06111a;
  --bg-glow-a: rgba(96, 72, 255, .34);
  --bg-glow-b: rgba(38, 214, 184, .16);
  --gold: #ffd479;
  --parch: #f2e6c8;
}

/* glass.css hides its own overlays explicitly; everything else here needs it. */
[hidden] { display: none !important; }

html, body { height: 100%; }
body.rw-page { overflow: hidden; }

/* ---------- Frame: one screen, no page scroll ---------- */
.c-app { height: 100vh; height: 100dvh; max-height: 100dvh; overflow: hidden; }
.rw-page .c-bar {
  flex: 0 0 auto;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 9px clamp(10px, 2.4vw, 22px);
}
.rw-page .c-bar__stats i { font-style: normal; opacity: .55; }
.rw-page .c-bar__controls { margin-left: auto; }

/* The shared back chip is a light pill; this cabinet is dark. */
.gc-back {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(10, 12, 26, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e8ecff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  opacity: .8;
}
.gc-back:hover { color: #fff; opacity: 1; }

/* ---------- Nation strip ---------- */
.rw-nations {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 8px clamp(10px, 2.4vw, 22px) 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.nat {
  flex: 1 1 0;
  min-width: 156px;
  max-width: 420px;
  display: grid;
  gap: 3px;
  padding: 7px 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.nat.is-on {
  border-color: var(--pc);
  box-shadow: 0 0 0 1px var(--pc), 0 10px 26px rgba(0, 0, 0, .35);
  background: linear-gradient(180deg, var(--pa), rgba(255, 255, 255, .05));
}
.nat.is-dead { opacity: .4; }
.nat__top { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.nat__dot {
  width: 9px; height: 9px; border-radius: 3px;
  background: var(--pc);
  box-shadow: 0 0 8px var(--pc);
}
.nat__name { font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.nat__tag {
  margin-left: auto;
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-muted);
}
.nat__res { display: flex; gap: 9px; font-size: 11.5px; color: var(--c-muted); }
.nat__res span { display: inline-flex; align-items: center; gap: 3px; }
.nat__res svg { width: 12px; height: 12px; color: var(--gold); opacity: .85; }
.nat__res b { color: #fff; font-variant-numeric: tabular-nums; font-weight: 700; }
.nat__foot {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--c-muted);
}
.nat__pip { flex: 1 1 0; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.nat__pip.is-full { background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); }
.nat.is-dead .nat__foot { display: none; }

/* ---------- Stage ---------- */
.rw-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 322px);
  gap: 12px;
  padding: 4px clamp(10px, 2.4vw, 22px) 14px;
}
.rw-boardCol {
  position: relative;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid var(--glass-line);
  background:
    radial-gradient(70% 60% at 50% 38%, rgba(124, 92, 255, .16), transparent 70%),
    radial-gradient(50% 50% at 50% 100%, rgba(52, 214, 180, .08), transparent 70%),
    rgba(8, 10, 22, .4);
  overflow: hidden;
}
.rw-fit { position: absolute; inset: 6px 6px 26px; }

.rw-board {
  --hs: 44px;
  position: absolute;
  inset: 0;
  margin: auto;
  width: calc(var(--hs) * 11);
  height: calc(var(--hs) * 12.124);
}
.rw-hint {
  position: absolute;
  left: 12px; right: 12px; bottom: 5px;
  margin: 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--c-muted);
  pointer-events: none;
}
.rw-hint b { color: var(--gold); font-weight: 600; }

/* ---------- Hexes ---------- */
.hex {
  position: absolute;
  left: calc(var(--hs) * var(--x));
  top: calc(var(--hs) * var(--y));
  width: calc(var(--hs) * 2);
  height: calc(var(--hs) * 1.732);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 1;
  transition: transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.hex:hover { transform: translateY(calc(var(--hs) * -.03)); z-index: 2; }
.hex:focus-visible { outline: none; z-index: 4; }
.hex__rim,
.hex__face {
  position: absolute;
  inset: 0;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.hex__rim { background: var(--pc, #6c7794); transition: background .15s ease, filter .15s ease; }
.hex__face {
  /* Thicker cut-out so the coloured rim reads as ownership from across the board. */
  inset: max(2px, calc(var(--hs) * .07));
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, .10), transparent 62%),
    linear-gradient(165deg, var(--t1, #2a2f40), var(--t2, #171b27));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hex__tint {
  position: absolute;
  inset: 0;
  background: var(--pa, transparent);
  transition: background .25s ease;
}
.hex__ico {
  width: 38%;
  height: 38%;
  /* keeps the mark clear of the army pill sitting in the bottom third */
  transform: translateY(-5%);
  color: var(--tc, #a9b4cc);
  opacity: .92;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
}
.hex__ico svg { width: 100%; height: 100%; display: block; }
.hex__cap {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 26%;
  color: var(--gold);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7));
}
.hex__cap svg { width: 100%; height: auto; display: block; }
.hex__fort {
  position: absolute;
  /* A flat-top hex has no corner here: hug the slant or the shield gets sliced. */
  top: 11%;
  right: 21%;
  width: calc(var(--hs) * .28);
  height: calc(var(--hs) * .28);
  display: grid;
  place-items: center;
  font-size: calc(var(--hs) * .15);
  font-weight: 800;
  line-height: 1;
  color: #101a2e;
}
.hex__fort svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #c2d3f3;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}
.hex__fort i {
  position: relative;
  transform: translateY(-10%);
  font-style: normal;
}
.hex__army {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  min-width: calc(var(--hs) * .5);
  height: calc(var(--hs) * .44);
  padding: 0 calc(var(--hs) * .12);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--hs) * .28);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #08111e;
  background: var(--pc, #8b97b3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5);
}
/* Bandit garrisons read as outlaws, not as a nameless nation. */
.hex.is-band .hex__army {
  background: #262c3d;
  color: #eaded0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(234, 222, 208, .55);
}
.hex.is-band .hex__army::before {
  content: "\2620";
  font-size: .72em;
  margin-right: .18em;
}
.hex__bar {
  position: absolute;
  /* Same slant rule as the fort shield, mirrored to the left. */
  top: 9%;
  left: 23%;
  width: calc(var(--hs) * .20);
  height: calc(var(--hs) * .20);
  color: #ffd479;
  opacity: .9;
}
.hex__bar svg { width: 100%; height: 100%; display: block; }

/* Terrain palettes */
.hex[data-t="farm"]   { --t1: #4e4626; --t2: #2a2916; --tc: #e8c76c; }
.hex[data-t="forest"] { --t1: #244b35; --t2: #12261a; --tc: #7fe3a8; }
.hex[data-t="mine"]   { --t1: #353d55; --t2: #1a1e2c; --tc: #aebfdf; }
.hex[data-t="meadow"] { --t1: #33452c; --t2: #1a2418; --tc: #bcd68c; }

/* Selection, march targets, battle flashes */
.hex.is-sel { z-index: 4; transform: translateY(calc(var(--hs) * -.03)); }
.hex.is-sel .hex__rim {
  background: var(--gold);
  filter: drop-shadow(0 0 calc(var(--hs) * .18) rgba(255, 212, 121, .85));
}
.hex.is-target { z-index: 3; }
/* Softer than the selected hex's own rim, so "this one" and "there" read apart. */
.hex.is-target .hex__rim { background: rgba(255, 212, 121, .5); }
/* Aiming: first tap on a target holds it bright and lifted until a second tap commits. */
.hex.is-aim { z-index: 4; transform: translateY(calc(var(--hs) * .12)); }
.hex.is-aim .hex__rim {
  background: var(--gold);
  filter: drop-shadow(0 0 calc(var(--hs) * .22) rgba(255, 212, 121, .95));
}
.hex.is-target.is-foe .hex__rim {
  background: #ff7c66;
  animation: hexPulse 1.1s ease-in-out infinite;
}
/* Coach glow: the first turns point at the hex to tap instead of describing it. */
.hex.is-coach { z-index: 3; }
/* March commit button: pops under the aimed hex; pressing it is the only way to move. */
.rw-marchGo {
  position: absolute;
  z-index: 20;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: calc(var(--hs) * .09);
  min-height: calc(var(--hs) * .62);
  padding: calc(var(--hs) * .16) calc(var(--hs) * .34);
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #241a05;
  font-weight: 800;
  font-size: calc(var(--hs) * .32);
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .55), 0 0 0 4px rgba(255, 212, 121, .22);
  animation: numPop .18s ease;
}
.rw-marchGo svg { width: 1em; height: 1em; flex: none; }
.rw-marchGo:active { transform: translate(-50%, -50%) scale(.94); }
.hex.is-coach .hex__rim {
  background: var(--gold);
  filter: drop-shadow(0 0 calc(var(--hs) * .16) rgba(255, 212, 121, .8));
  animation: hexPulse 1.2s ease-in-out infinite;
}
@keyframes hexPulse { 50% { background: #ffd479; } }
.hex.is-hit .hex__face { animation: hexHit .55s ease; }
@keyframes hexHit {
  0% { box-shadow: inset 0 0 0 40px rgba(255, 92, 72, .85); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 92, 72, 0); }
}

/* ---------- Side panels ---------- */
.rw-side {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}
.panel {
  border-radius: 14px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  padding: 10px 12px;
}
.panel--log { display: flex; flex-direction: column; min-height: 0; padding-bottom: 6px; }
.panel__title {
  margin: 0 0 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--c-muted);
}
.panel--log .panel__title { display: flex; justify-content: space-between; }

.turn__top { display: flex; align-items: center; gap: 7px; }
.turn__dot { width: 10px; height: 10px; border-radius: 3px; background: var(--pc); box-shadow: 0 0 8px var(--pc); }
.turn__name { font-weight: 700; letter-spacing: -.01em; }
.turn__round { margin-left: auto; font-size: 11px; color: var(--c-muted); }
.turn__pips { display: flex; gap: 5px; margin: 9px 0 6px; }
.turn__pip {
  flex: 1 1 0; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  transition: background .2s ease;
}
.turn__pip.is-full { background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); }
.turn__line { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--c-muted); }
.turn__line b { color: #fff; font-weight: 700; }
.turn__think { color: var(--gold); }

.councilBtn {
  width: 100%;
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, .05);
  color: var(--c-text);
  font: inherit; font-size: 12px; font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.councilBtn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.councilBtn:disabled { opacity: .38; cursor: default; }
.councilBtn svg { width: 15px; height: 15px; color: var(--gold); flex: 0 0 auto; }
.councilBtn small { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--c-muted); }
.councilBtn small.is-poor { color: #ff9c8f; }

.sel__head { display: flex; align-items: baseline; gap: 8px; }
.sel__terr { font-weight: 700; letter-spacing: -.01em; }
.sel__own { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--pc, var(--c-muted)); }
.sel__chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 8px; }
/* Split-march slider: choose how many banners leave the hex. */
.sel__split {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 7px;
  font-size: 12px;
  color: var(--c-muted);
}
.sel__splitTxt { white-space: nowrap; }
.sel__splitTxt b { color: var(--gold); font-weight: 800; }
.sel__range {
  flex: 1;
  min-width: 0;
  height: 26px;
  accent-color: var(--gold);
  cursor: pointer;
}
.sel__chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: rgba(0, 0, 0, .22);
  font-size: 11px; color: var(--c-text);
}
.sel__chip svg { width: 12px; height: 12px; color: var(--gold); }
.sel__acts { display: grid; gap: 6px; }
.act {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, .05);
  color: var(--c-text);
  font: inherit; font-size: 12.5px; font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.act:hover:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); }
.act:active:not(:disabled) { transform: translateY(1px); }
.act:disabled { opacity: .38; cursor: default; }
.act svg { width: 15px; height: 15px; color: var(--gold); flex: 0 0 auto; }
.act__cost { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--c-muted); white-space: nowrap; }
.act__cost.is-poor { color: #ff9c8f; }
.sel__empty { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--c-muted); }
.sel__empty b { color: var(--parch); }

.log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
  font-size: 11.5px;
  line-height: 1.45;
  scrollbar-width: thin;
}
.log li { padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .06); color: var(--c-muted); }
.log li:last-child { border-bottom: 0; }
.log li b { color: #fff; font-weight: 600; }
.log li.is-battle { color: #ffd6a6; }
.log li.is-warn { color: #ff9c8f; }
.log li.is-gain { color: #9fe3b8; }
.log li.is-turn { color: var(--gold); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 10.5px; }

/* ---------- Battle report ---------- */
.clash {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  z-index: 8;
  width: max-content;
  max-width: min(94%, 460px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-line);
  background: rgba(9, 11, 24, .88);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  animation: clashIn .2s ease;
}
@keyframes clashIn { from { opacity: 0; transform: translate(-50%, -6px); } }
.clash__side { display: grid; gap: 1px; font-size: 10.5px; color: var(--c-muted); }
.clash__side--b { text-align: right; }
.clash__who { color: var(--pc); font-weight: 700; white-space: nowrap; }
.clash__num {
  font-size: 16px; font-weight: 800; line-height: 1.1;
  color: #fff; font-variant-numeric: tabular-nums;
  animation: numPop .25s ease;
}
@keyframes numPop { from { transform: scale(.65); opacity: 0; } }
.clash__side--win .clash__num { color: var(--gold); }
/* Rock-paper-scissors tiebreak line inside the battle report. */
.clash__rps {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  animation: numPop .25s ease;
}
.clash__vs { font-size: 10.5px; color: var(--c-muted); }
.clash__out {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
}
.clash__out.is-loss { color: #ff9c8f; }

/* Popups stay until clicked — a chip says so. */
.clash { cursor: pointer; }
.clash::after, .rw-event::after {
  content: "\2715";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(9, 11, 24, .95);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #cfd7ea;
  font-size: 10px;
  line-height: 19px;
  text-align: center;
}

/* ---------- War events banner ---------- */
.rw-event {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 212, 121, .5);
  background: rgba(9, 11, 24, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  color: var(--gold);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
  pointer-events: none;
  animation: eventIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
.rw-event svg { width: 20px; height: 20px; flex: 0 0 auto; }
.rw-event small { font-weight: 600; font-size: 12px; color: var(--c-text); }
@keyframes eventIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }

/* Battles rattle the table. */
.rw-boardCol.is-shake { animation: boardShake .4s ease; }
@keyframes boardShake {
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(6px, -2px); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(3px, -1px); }
}

/* Sound toggle: icon-only pill. */
.rw-snd { padding: 0 10px; display: inline-flex; align-items: center; }
.rw-snd svg { width: 17px; height: 17px; display: block; color: var(--gold); }

/* ---------- Setup modal rows ---------- */
.rw-count { margin-bottom: 10px; }
.rw-seats { display: grid; gap: 6px; }
.rw-seat {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, .04);
}
.rw-seat__dot { width: 10px; height: 10px; border-radius: 3px; background: var(--pc); box-shadow: 0 0 8px var(--pc); }
.rw-seat__name { font-size: 13px; font-weight: 600; }
.rw-seat__you { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.rw-seat .c-seg { margin-left: auto; }
.rw-seat .c-seg__b { padding: 4px 10px; font-size: 11.5px; }

/* ---------- Game over ---------- */
.rw-over__crown { width: 54px; margin: 2px auto 6px; color: var(--gold); filter: drop-shadow(0 4px 14px rgba(255, 212, 121, .45)); }
.rw-over__crown svg { width: 100%; height: auto; display: block; }
.rw-over__name {
  margin: 0;
  text-align: center;
  font-size: 22px; font-weight: 800; letter-spacing: -.02em;
  color: var(--gold);
}
.rw-over__sub { margin: 2px 0 12px; text-align: center; font-size: 13px; color: var(--c-muted); }
.rw-over__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.rw-over__grid div {
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: rgba(0, 0, 0, .2);
  text-align: center;
}
.rw-over__grid span { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.rw-over__grid b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- Rules modal: three taps, three notes ---------- */
.rw-rules .c-modal__body p { font-size: 13px; line-height: 1.55; }
.rw-steps {
  counter-reset: rwstep;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 9px;
}
.rw-steps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; font-size: 13.5px; line-height: 1.45; }
.rw-steps li::before {
  counter-increment: rwstep;
  content: counter(rwstep);
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 11px; font-weight: 800;
  color: var(--on-accent);
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
}
.rw-steps li > span { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.rw-cost {
  font-style: normal;
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, .06);
  font-size: 11px; font-weight: 700;
  color: var(--parch);
  white-space: nowrap;
}
.rw-terr {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
  font-size: 13px;
}
.rw-terr li { border-bottom: 1px dashed rgba(255, 255, 255, .08); padding-bottom: 3px; }
.rw-terr span { float: right; color: var(--gold); font-weight: 700; }

/* ---------- Compact screens ---------- */
@media (max-width: 900px) {
  .rw-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    padding-bottom: 8px;
  }
  .rw-side { grid-template-rows: auto auto; padding-bottom: 42px; }
  .panel--log { display: none; }
  .rw-page .c-bar__stats { display: none; }
  .rw-nations { padding-top: 6px; }
  .nat { min-width: 138px; }
  .rw-boardCol { min-height: 220px; }
}
@media (max-width: 620px) {
  .rw-page .c-bar__title { display: none; }
  .rw-page .c-btn { padding: 6px 9px; font-size: 11.5px; }
}
@media (max-width: 560px) {
  .rw-page .c-bar { padding: 7px 10px; gap: 8px; }
  .rw-nations { padding: 6px 10px 2px; }
  .rw-stage { padding: 0 10px 8px; gap: 6px; }
  .rw-fit { inset: 3px 3px 22px; }
  .panel { padding: 8px 10px; }
  .turn__pips { margin: 6px 0 5px; }
  .sel__chips { margin: 5px 0 6px; }
  /* Three orders side by side keep the map tall on a phone. */
  .sel__acts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .act {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 6px 7px;
    font-size: 11.5px;
    line-height: 1.15;
  }
  .act__cost { margin-left: 0; font-size: 9.5px; white-space: normal; line-height: 1.2; }
}
/* Short handsets: buy the map back its height from the chrome. */
@media (max-width: 560px) and (max-height: 740px) {
  .rw-page .c-bar { padding: 5px 10px; }
  .rw-nations { padding: 4px 10px 1px; }
  .nat { padding: 4px 8px 5px; gap: 2px; }
  .nat__foot { display: none; }
  .panel { padding: 7px 9px; }
  .turn__pips { margin: 5px 0 4px; }
  .councilBtn { margin-top: 6px; padding: 5px 8px; }
  .rw-fit { inset: 3px 3px 3px; }
  .rw-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hex, .hex.is-sel { transition: none; }
  .hex.is-aim { transform: none; }
  .hex.is-target.is-foe .hex__rim, .hex.is-coach .hex__rim, .hex.is-hit .hex__face, .clash { animation: none; }
  .rw-boardCol.is-shake, .rw-event, .clash__num { animation: none; }
  .rw-marchGo { animation: none; }
}
