/* =====================================================================
   High Ground - fixed "map table" theme.
   A campaign table at night: olive felt, khaki card stock, brass rules and
   a brick red for the enemy. Both lines hold equal value but different cards,
   and the hills keep their worth hidden until they are taken, so the brass
   numbers on the field are yours alone until a hill turns face up.
   base.css is loaded for the back chip and resets; glass.css is not, because
   this cabinet brings its own c-* chrome.
   ===================================================================== */

:root {
  --void: #070904;
  --table: #11150e;
  --table-2: #171d13;

  --khaki: #cbbd95;
  --khaki-hi: #e9dfc3;
  --khaki-lo: #a99a70;

  --brass: #c9a227;
  --brass-hi: #e6c766;
  --brass-lo: #8d6f18;

  --you: #7f9a5c;
  --you-hi: #aac67f;
  --foe: #b8483a;
  --foe-hi: #d4685a;

  --ink: #ece5d2;
  --dim: rgba(232, 223, 198, .64);
  --faint: rgba(232, 223, 198, .36);
  --line: rgba(201, 162, 39, .24);
  --danger: #ff8a7a;

  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;

  /* Six cards and six hills share the width, so both shrink together - and on a
     big screen both grow together. The board takes whichever axis binds first:
     six tiles across the table, or two hands plus the hill row down it. The
     height term carries a flat allowance for the bar, the tags, the dock, the
     gaps and the padding, so the fit never has to guess at the tiles' own size.
     The ceilings are there so a 4K panel gets a wide table, not six posters. */
  --gap-hand: clamp(3px, 1vw, 10px);
  --gap-field: clamp(3px, 1.1vw, 14px);
  --row-fit: calc((100vw - 18px - 5 * var(--gap-hand)) / 6);
  --field-fit: calc((100vw - 18px - 5 * var(--gap-field)) / 6);
  --height-fit: calc((100dvh - 240px) / 3.9);   /* 1.4 + 1.4 cards, one hill row */
  --card-w: clamp(38px, min(var(--row-fit), var(--height-fit)), 150px);
  --card-h: calc(var(--card-w) * 1.4);
  --hill-w: clamp(44px, min(var(--field-fit), var(--height-fit) * 1.22), 184px);
}

[hidden] { display: none !important; }
:where(button) { -webkit-tap-highlight-color: transparent; }

/* ---------- The table ---------- */
body.hg-page {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: var(--table);
  background-image:
    radial-gradient(74% 44% at 50% 0%, rgba(201, 162, 39, .11), transparent 66%),
    radial-gradient(60% 40% at 50% 106%, rgba(127, 154, 92, .08), transparent 72%),
    repeating-linear-gradient(0deg, rgba(201, 187, 149, .035) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(201, 187, 149, .035) 0 1px, transparent 1px 26px),
    linear-gradient(178deg, #171d13, #0d110a 62%, var(--void));
  background-attachment: fixed;
}
body.hg-page *,
body.hg-page *::before,
body.hg-page *::after { box-sizing: border-box; }

.hg-app {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Top bar: a brass faceplate ---------- */
.c-bar {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px clamp(12px, 3vw, 26px) 9px;
  color: var(--ink);
  background: linear-gradient(180deg, #1b2116, #12170e 60%, #0c100a);
  border-bottom: 1px solid rgba(201, 162, 39, .30);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.c-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 3px;
  height: 1px;
  background: rgba(201, 162, 39, .14);
  pointer-events: none;
}
.c-bar__brand { display: flex; align-items: center; gap: 9px; }
.c-bar__brand svg { display: block; }
.c-bar__title {
  margin: 0;
  font-size: clamp(18px, 2.8vw, 25px);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #efe7cd;
  text-shadow: 0 0 18px rgba(201, 162, 39, .35);
}
.c-bar__stats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stat { font-size: 12.5px; letter-spacing: .02em; color: var(--dim); white-space: nowrap; }
.stat b {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.c-bar__controls { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Buttons: pressed metal plates. */
.c-btn {
  appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 7px 13px;
  border-radius: 4px;
  color: #e4dcc2;
  background: linear-gradient(180deg, #2a3021, #1b2015);
  border: 1px solid rgba(201, 162, 39, .26);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
  cursor: pointer;
  transition: filter .12s ease, transform .06s ease, box-shadow .12s ease;
}
.c-btn:hover { filter: brightness(1.16); }
.c-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.c-btn:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.c-btn:disabled { opacity: .38; cursor: default; transform: none; filter: none; }
.c-btn--primary {
  color: #241d09;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  border-color: #96721a;
  box-shadow: 0 2px 0 #6f5410, 0 6px 16px rgba(201, 162, 39, .22);
}

/* ---------- The field ---------- */
.hg-table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.6vh, 16px);
  padding: clamp(6px, 1.4vh, 16px) 8px clamp(6px, 1.2vh, 14px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hg-table::-webkit-scrollbar { width: 0; height: 0; }

.hg-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hg-line__tag {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}
/* The enemy line carries its own colour now that it carries no name. */
.hg-line--foe .hg-line__tag { color: rgba(212, 104, 90, .74); }
.hg-line--you .hg-line__tag { margin-top: 2px; }

.hg-hand { display: flex; justify-content: center; gap: var(--gap-hand); }

/* ---------- Cards: neutral stock, one per rank in your own drawn hand ------ */
.hg-card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  padding: 0;
  border: 0;
  border-radius: max(5px, calc(var(--card-w) * .055));
  overflow: hidden;
  cursor: pointer;
  background:
    repeating-linear-gradient(0deg, rgba(120, 103, 62, .07) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--khaki-hi), var(--khaki) 56%, var(--khaki-lo));
  box-shadow:
    inset 0 0 0 1px rgba(64, 52, 26, .45),
    inset 0 calc(var(--card-w) * -.045) 0 rgba(112, 96, 56, .32),
    0 calc(var(--card-w) * .045) 0 rgba(0, 0, 0, .55),
    0 calc(var(--card-w) * .13) calc(var(--card-w) * .3) rgba(0, 0, 0, .4);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
/* A red field-order stripe across the top, as if struck by a stamp. */
.hg-card::before {
  content: "";
  position: absolute;
  top: calc(var(--card-w) * .05);
  left: calc(var(--card-w) * .065);
  right: calc(var(--card-w) * .065);
  height: max(2px, calc(var(--card-w) * .022));
  background: rgba(150, 46, 34, .5);
  border-radius: 1px;
}
.hg-card__num {
  position: absolute;
  top: 14%;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: calc(var(--card-w) * .4);
  line-height: 1;
  color: #2b2718;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.hg-card__chev {
  position: absolute;
  left: 0; right: 0; bottom: 9%;
  display: flex;
  justify-content: center;
}
.hg-card__chev svg { height: calc(var(--card-w) * .17); width: auto; display: block; }

.hg-card:hover { transform: translateY(calc(var(--card-w) * -.035)); }
.hg-card.is-idle { opacity: .64; cursor: default; }
.hg-card.is-idle:hover { transform: none; }

/* The enemy hand: identical backs, plus a ghost for every rank already spent. */
.hg-slot { width: var(--card-w); height: var(--card-h); }
.hg-back {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: max(5px, calc(var(--card-w) * .055));
  position: relative;
  background:
    repeating-linear-gradient(45deg, rgba(201, 162, 39, .07) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #4a5440, #2b3124);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .55),
    inset 0 0 0 2px rgba(201, 162, 39, .16),
    0 3px 0 rgba(0, 0, 0, .45);
}
.hg-back::after {
  content: "";
  position: absolute;
  inset: 27%;
  border: 1px solid rgba(201, 162, 39, .42);
  border-radius: 1px;
  transform: rotate(45deg);
}
.hg-ghost {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: max(5px, calc(var(--card-w) * .055));
  border: 1px dashed rgba(232, 223, 198, .16);
  color: rgba(232, 223, 198, .22);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: calc(var(--card-w) * .3);
}

/* ---------- Hills ----------
   Every value starts face down. "?" is ground nobody has scouted, a brass
   number is ground only you have scouted, and a resolved hill shows its worth
   for good. */
.hg-field {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--gap-field);
  flex-wrap: nowrap;
}
.hg-hill {
  position: relative;
  width: var(--hill-w);
  height: calc(var(--hill-w) * .82);
  border-radius: calc(var(--hill-w) * .07) calc(var(--hill-w) * .07)
               calc(var(--hill-w) * .14) calc(var(--hill-w) * .14);
  background:
    linear-gradient(180deg, rgba(201, 187, 149, .10), rgba(201, 187, 149, .03));
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, .16);
  transition: background .15s ease, box-shadow .15s ease;
}
/* A faint contour line, like a ridge on a map. */
.hg-hill__ground {
  position: absolute;
  left: 14%; right: 14%;
  bottom: 56%;
  height: 1px;
  background: rgba(201, 162, 39, .18);
}
.hg-hill__v {
  position: absolute;
  top: calc(var(--hill-w) * .025);
  left: calc(var(--hill-w) * .065);
  font-family: var(--font-mono);
  font-size: clamp(10px, calc(var(--hill-w) * .2), 30px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums;
}
.hg-hill__chips {
  position: absolute;
  left: 0; right: 0; bottom: calc(var(--hill-w) * .035);
  display: flex;
  justify-content: center;
  gap: max(3px, calc(var(--hill-w) * .035));
}
/* Ground nobody has scouted keeps its number as a question mark, dimmed. */
.hg-hill.is-hidden .hg-hill__v { color: rgba(230, 199, 102, .32); }
/* Scouted by you alone: the value reads as your sight, not a printed fact. */
.hg-hill.is-peek .hg-hill__v { color: var(--brass-hi); }
.hg-hill.is-peek::before {
  content: "";
  position: absolute;
  top: calc(var(--hill-w) * .06);
  right: calc(var(--hill-w) * .075);
  width: clamp(7px, calc(var(--hill-w) * .09), 15px);
  height: clamp(7px, calc(var(--hill-w) * .09), 15px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--brass-hi) 0 28%, rgba(201, 162, 39, .3) 28% 50%);
  box-shadow: 0 0 calc(var(--hill-w) * .09) rgba(201, 162, 39, .55);
}
/* Ground already fought for stays legible but stops asking for attention. */
.hg-hill.is-spent .hg-hill__v { opacity: .75; }
.hg-chip {
  min-width: max(14px, calc(var(--hill-w) * .25));
  height: max(18px, calc(var(--hill-w) * .32));
  padding: 0 max(2px, calc(var(--hill-w) * .035));
  display: grid;
  place-items: center;
  border-radius: max(3px, calc(var(--hill-w) * .04));
  font-family: var(--font-mono);
  font-size: max(10px, calc(var(--hill-w) * .165));
  font-weight: 700;
  line-height: 1;
  color: #241f12;
  background: linear-gradient(180deg, var(--khaki-hi), var(--khaki-lo));
  box-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}
.hg-chip--you { box-shadow: inset 0 0 0 1.5px var(--you), 0 1px 0 rgba(0, 0, 0, .45); }
.hg-chip--cpu { box-shadow: inset 0 0 0 1.5px var(--foe), 0 1px 0 rgba(0, 0, 0, .45); }
/* A card committed on even ground stays face down until the hill turns. */
.hg-chip.is-down {
  color: rgba(36, 31, 18, .55);
  background: repeating-linear-gradient(45deg, var(--khaki-lo) 0 3px, var(--khaki) 3px 6px);
}
.hg-chip--burn {
  color: rgba(236, 229, 210, .55);
  background: repeating-linear-gradient(135deg, rgba(30, 24, 16, .9) 0 3px, rgba(58, 50, 36, .9) 3px 6px);
  box-shadow: inset 0 0 0 1px rgba(200, 190, 170, .28);
  text-decoration: line-through;
}

.hg-hill.is-you {
  background: linear-gradient(180deg, rgba(127, 154, 92, .30), rgba(127, 154, 92, .08));
  box-shadow: inset 0 0 0 1.5px rgba(170, 198, 127, .8), 0 0 16px rgba(127, 154, 92, .2);
}
.hg-hill.is-cpu {
  background: linear-gradient(180deg, rgba(184, 72, 58, .30), rgba(184, 72, 58, .08));
  box-shadow: inset 0 0 0 1.5px rgba(212, 104, 90, .8), 0 0 16px rgba(184, 72, 58, .2);
}
/* A little pennant on ground that has changed hands. */
.hg-hill.is-you::after,
.hg-hill.is-cpu::after {
  content: "";
  position: absolute;
  top: calc(var(--hill-w) * .05);
  right: calc(var(--hill-w) * .065);
  width: calc(var(--hill-w) * .13);
  height: calc(var(--hill-w) * .105);
  clip-path: polygon(0 0, 100% 26%, 0 52%, 0 100%);
  border-radius: 1px;
}
.hg-hill.is-you::after { background: var(--you-hi); }
.hg-hill.is-cpu::after { background: var(--foe-hi); }

/* Ground neither side holds: both cards went down and nothing scored. */
.hg-hill.is-burn {
  background: repeating-linear-gradient(135deg, rgba(24, 20, 14, .55) 0 4px, rgba(46, 40, 28, .4) 4px 8px);
  box-shadow: inset 0 0 0 1px rgba(200, 190, 170, .22);
}

.hg-hill.is-next { animation: hgLure 1.7s ease-in-out infinite; }
@keyframes hgLure {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(230, 199, 102, .5); }
  50% { box-shadow: inset 0 0 0 1.5px rgba(230, 199, 102, .95), 0 0 16px rgba(201, 162, 39, .22); }
}

/* ---------- Dock ---------- */
.hg-dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: min(100%, 980px);
}
.hg-say {
  margin: 0;
  min-height: 1.4em;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.4;
  color: rgba(236, 229, 210, .9);
}
.hg-say.is-warn { color: var(--danger); }
.hg-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hg-hint { font-size: 11.5px; color: var(--faint); }
/* The staff's working read of you, out in the open so you can play against it. */
.hg-read {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums;
}

/* ---------- Modals ----------
   The overlay scrolls, never the panel: on Windows a max-height box always
   reserves an inner gutter. margin:auto centres and still lets a tall card
   scroll in from the top. */
.c-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.c-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 3, .72);
  backdrop-filter: blur(3px);
}
.c-modal__panel {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(94vw, 560px);
  color: var(--ink);
  background: linear-gradient(180deg, #21271a, #161b11 62%, #10140c);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 0 0 1px rgba(201, 162, 39, .34),
    0 30px 70px rgba(0, 0, 0, .72);
  animation: hgPlate .24s ease-out both;
}
@keyframes hgPlate {
  0% { transform: translateY(12px) scale(.985); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.hg-rules { width: min(94vw, 640px); }
#rulesModal { z-index: 62; }
.c-modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(201, 162, 39, .2);
}
.c-modal__head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #f0e8ce;
}
.c-modal__x {
  margin-left: auto;
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1px solid rgba(201, 162, 39, .3);
  background: linear-gradient(180deg, #2a3021, #1b2015);
  color: #e4dcc2;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.c-modal__x:hover { filter: brightness(1.16); }
.c-modal__body { padding: 14px 22px 4px; font-size: 14px; line-height: 1.6; color: rgba(232, 223, 198, .86); }
.c-modal__body b { color: #f6efda; }
.c-modal__body kbd {
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid rgba(201, 162, 39, .3);
  background: rgba(6, 8, 4, .8);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
}
.c-modal__lead { margin: 0 0 12px; font-size: 14.5px; color: rgba(236, 229, 210, .92); }
.c-modal__note { margin: 13px 0 2px; font-size: 12.5px; line-height: 1.55; color: var(--dim); }
.c-modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 15px;
}

.hg-steps {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 7px;
}
.hg-steps li {
  counter-increment: step;
  position: relative;
  padding: 8px 11px 8px 44px;
  border-radius: 5px;
  background: rgba(201, 162, 39, .06);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, .14);
  font-size: 13.5px;
  line-height: 1.45;
}
.hg-steps li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #241d09;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
}

/* ---------- Flow: intro, battle won, war lost ---------- */
.hg-flow { width: min(94vw, 560px); }
.hg-verdict { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; }
.hg-verdict__num {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: #f6efda;
  font-variant-numeric: tabular-nums;
}
.hg-verdict__num small { font-size: 13px; font-weight: 600; color: var(--faint); margin-left: 4px; }
.hg-verdict__who { font-size: 13px; color: var(--dim); }
.hg-log { display: grid; gap: 3px; margin: 10px 0 2px; }
.hg-log__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 12.5px;
  border-bottom: 1px dotted rgba(201, 162, 39, .18);
}
.hg-log__row span { color: var(--dim); }
.hg-log__row b {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------- Toast ---------- */
.c-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 70;
  transform: translateX(-50%);
  max-width: min(92vw, 460px);
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #f4ecd8;
  background: rgba(12, 15, 9, .96);
  border: 1px solid rgba(201, 162, 39, .26);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .6);
  animation: hgToast .18s ease-out both;
}
.c-toast[hidden] { display: none; }
@keyframes hgToast {
  0% { transform: translate(-50%, 6px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

/* ---------- Large screens ----------
   The board sizes itself from the viewport; the type around it is nudged up in
   step, so a desktop table reads as one table rather than a phone layout with
   room to spare. Guarded on height as well: a short, wide window is already
   squeezed by the height fit and gains nothing from bigger letters. */
@media (min-width: 1000px) and (min-height: 620px) {
  .c-bar { gap: 16px 18px; }
  .c-bar__title { font-size: 28px; }
  .stat { font-size: 14px; }
  .stat b { font-size: 16px; }
  .c-bar .c-btn { font-size: 14px; padding: 8px 15px; }
  .hg-line__tag { font-size: 12px; letter-spacing: .18em; }
  .hg-say { font-size: 15.5px; }
  .hg-hint, .hg-read { font-size: 13px; }
  .hg-tools { gap: 16px; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 780px) {
  .c-bar { gap: 6px 10px; padding: 6px 10px 7px; }
  .c-bar__title { font-size: 17px; }
  .c-bar__stats { gap: 9px; }
  .stat { font-size: 11.5px; }
  .stat b { font-size: 13px; }
  .c-bar .c-btn { font-size: 12px; padding: 5px 9px; }
  .hg-say { font-size: 12.5px; }
  .c-modal { padding: 10px; }
  .c-modal__body { padding: 10px 14px 2px; }
  /* The back chip is fixed bottom-left, so the tool row steps around it. */
  .hg-tools { padding-left: 128px; justify-content: flex-start; }
  .hg-hint { display: none; }
}

@media (max-width: 430px) {
  .hg-tools { padding-left: 118px; }
  .c-bar__stats { gap: 7px; }
  .stat { font-size: 11px; }
  .hg-line__tag { font-size: 9.5px; }
  .hg-card__num { font-size: calc(var(--card-w) * .44); }
}

@media (prefers-reduced-motion: reduce) {
  .c-modal__panel,
  .c-toast,
  .hg-hill.is-next { animation: none; }
  .hg-card, .c-btn { transition: none; }
}
