/* Markets of War — in-game screen (HUD, dock, drawers). Every class is prefixed .g-; tokens from base.css.
   Concept: objects on a candle-lit command table. Leather tabs for each commander along the top edge,
   bookmark ribbons down the right edge for the ledger, deal desk, cards, chronicle and settings, and
   a leather order-folder at the bottom holding a parchment order slip: what to do now, in plain words. */

.g-root {
  position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate;
  font-family: var(--font-body); color: var(--parchment);
  --g-top-h: 76px; --g-rail-w: 66px; --g-leather: url("/assets/img/leather.webp");
  --g-brass-tex: url("/assets/img/brass.webp"); --g-paper: url("/assets/img/parchment.webp");
  --g-stitch: rgba(220,193,138,.38);
}
.g-root button { -webkit-tap-highlight-color: transparent; }
.g-map { position: absolute; inset: 0; z-index: var(--z-map); }
.g-map .mv-root { --mv-card-top: calc(var(--g-top-h) + 10px); --mv-card-right: calc(var(--g-rail-w) + 16px); --mv-card-bottom: 250px; --mv-zoom-bottom: 26px; }
.g-ico { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: -.28em; }
.g-small { font-size: .88rem; line-height: 1.4; opacity: .9; margin: .35em 0; }
.g-empty { font-style: italic; opacity: .75; margin: .8em 0; }
.g-money { white-space: nowrap; }
.g-tn { font-style: italic; white-space: nowrap; }
.g-warn { color: var(--oxblood-hi); }
.panel .g-warn { color: var(--oxblood); }
.g-x {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent; background: transparent; color: inherit;
  font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; opacity: .75;
}
.g-x:hover { opacity: 1; border-color: rgba(122,95,53,.5); }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: saturate(.6); }
.btn[aria-disabled="true"]:hover { transform: none; filter: saturate(.6); }
.btn kbd { font: 600 .72rem var(--font-num); margin-left: .25em; padding: 0 .35em; border-radius: 3px; border: 1px solid currentColor; opacity: .55; }

/* ---------- colour-blind seat patterns on medals ---------- */
.g-pat-1 { --pat: repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 3px, transparent 3px 7px); }
.g-pat-2 { --pat: radial-gradient(circle, rgba(255,255,255,.35) 1.4px, transparent 1.7px) 0 0 / 6px 6px; }
.g-pat-3 { --pat: repeating-linear-gradient(45deg, rgba(0,0,0,.25) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, rgba(0,0,0,.25) 0 2px, transparent 2px 6px); }
.g-pat-4 { --pat: repeating-linear-gradient(0deg, rgba(255,255,255,.25) 0 3px, transparent 3px 7px); }
.g-pat-5 { --pat: conic-gradient(rgba(0,0,0,.22) 25%, transparent 0 50%, rgba(0,0,0,.22) 0 75%, transparent 0) 0 0 / 8px 8px; }

.g-medal {
  position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: var(--pat, none), var(--c); color: #fff8e8; font: 700 12px var(--font-display); letter-spacing: .02em;
  border: 2px solid var(--brass-hi); box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 2px 5px rgba(0,0,0,.5); overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.g-medal--portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.g-medal--portrait i { position: absolute; right: -1px; bottom: -1px; font-style: normal; font-size: 9px; line-height: 1; padding: 2px 3px; border-radius: 6px 0 0 0; background: var(--pat, none), var(--c); }
.g-medal i { font-style: normal; }
.g-pn { font-weight: 600; white-space: nowrap; }
.g-pn-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin: 0 .28em .05em 0; background: var(--pat, none), var(--c); border: 1px solid rgba(0,0,0,.5); vertical-align: baseline; }
.panel .g-pn { color: color-mix(in srgb, var(--c) 70%, var(--ink)); }

/* ---------- top bar: leather tabs along the table edge ---------- */
.g-top {
  position: absolute; z-index: var(--z-hud); left: 0; right: 0; top: 0; height: var(--g-top-h);
  display: flex; align-items: flex-start; gap: 8px; padding: 8px calc(var(--g-rail-w) + 4px) 0 10px; pointer-events: none;
  background: linear-gradient(rgba(16,10,6,.72), rgba(16,10,6,0));
}
.g-top > * { pointer-events: auto; }
.g-menu-btn { flex: none; width: 46px; height: 46px; border-radius: 10px; }
.g-round {
  flex: none; display: grid; justify-items: center; align-content: center; width: 58px; height: 52px; border-radius: 8px;
  background: var(--g-brass-tex) center / 220px, var(--brass); color: var(--ink); border: 1px solid #f0dba8;
  box-shadow: inset 0 1px 0 rgba(255,240,200,.6), inset 0 -2px 4px rgba(60,40,10,.4), 0 3px 8px rgba(0,0,0,.5);
}
.g-round-k { font: 600 .66rem var(--font-caps); letter-spacing: .1em; opacity: .8; }
.g-round-n { font-size: 1.35rem; font-weight: 700; line-height: 1; }
.g-ptabs { flex: 1; min-width: 0; display: flex; gap: 6px; margin: 0 0 -56px; padding: 0 2px 64px; list-style: none; overflow-x: auto; scrollbar-width: none; pointer-events: none; }
.g-ptab { pointer-events: auto; }
.g-drawer:focus, .g-dossier:focus { outline: none; }
.g-ptabs::-webkit-scrollbar { display: none; }
.g-ptab { position: relative; flex: 0 1 230px; min-width: 168px; }
.g-ptab-btn {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; row-gap: 2px;
  padding: 6px 10px 6px 8px; min-height: 58px; text-align: left; cursor: pointer; color: var(--parchment-hi);
  background: linear-gradient(180deg, rgba(64,44,30,.94), rgba(34,23,15,.96)), var(--g-leather) center / 300px;
  border: 1px solid rgba(176,141,87,.55); border-top: 4px solid var(--c); border-radius: 4px 4px 10px 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,230,180,.12); transition: transform .18s var(--ease), box-shadow .18s;
}
.g-ptab-btn::after { content: ""; position: absolute; inset: 3px; border: 1px dashed var(--g-stitch); border-radius: 2px 2px 8px 8px; pointer-events: none; opacity: .5; }
.g-ptab-btn:hover { transform: translateY(2px); }
.g-ptab.is-active .g-ptab-btn { transform: translateY(4px); border-color: var(--brass-hi); box-shadow: 0 0 0 1px rgba(220,193,138,.4), 0 0 22px rgba(240,190,90,.35), 0 6px 14px rgba(0,0,0,.5); }
.g-ptab.is-me .g-ptab-btn { background: linear-gradient(180deg, rgba(110,40,32,.95), rgba(60,22,18,.97)), var(--g-leather) center / 300px; }
.g-ptab.is-out { opacity: .5; filter: grayscale(.8); }
.g-ptab-medal { grid-row: 1 / 3; position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.g-ptab-name { font: 600 1rem/1.1 var(--font-display); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.g-ptab-turn { color: var(--brass-hi); font-size: .7rem; }
.g-ptab-stats { display: flex; gap: 8px; font-size: .82rem; align-items: center; color: var(--parchment); white-space: nowrap; }
.g-ptab-stats img { width: 15px; height: 15px; object-fit: contain; vertical-align: -3px; margin-right: 2px; }
.g-ptab-cash { color: var(--gold); font-weight: 600; }
.g-ptab-badges { position: absolute; left: 8px; right: 8px; bottom: -11px; display: flex; gap: 4px; justify-content: flex-end; pointer-events: none; }
.g-badge {
  font: 600 .68rem/1 var(--font-num); padding: 3px 6px; border-radius: 3px; white-space: nowrap; letter-spacing: .02em;
  background: var(--parchment-hi); color: var(--ink); border: 1px solid var(--brass-lo); box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.g-badge--inc { color: #2d5b36; }
.g-badge--debt { background: #f0d9c8; color: var(--oxblood); }
.g-badge--lent { background: #e6e0c6; color: var(--navy); }
.g-badge--war { background: var(--oxblood); color: var(--parchment-hi); border-color: #c9796f; }
.g-badge--out, .g-badge--away { background: #3b3f46; color: #e8e2d4; border-color: #6c7078; }
.g-timer { position: absolute; inset: 0; transform: rotate(-90deg); pointer-events: none; }
.g-timer-bg { fill: none; stroke: rgba(0,0,0,.35); stroke-width: 3; }
.g-timer-fg { fill: none; stroke: var(--brass-hi); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.g-timer.is-low .g-timer-fg { stroke: #e05a48; }
.g-emote {
  position: absolute; z-index: 3; left: 50%; top: calc(100% + 14px); transform: translateX(-50%); white-space: nowrap;
  font: italic 600 1rem var(--font-body); color: var(--ink); background: var(--parchment-hi) var(--g-paper) center / 300px;
  padding: 5px 12px; border-radius: 12px; border: 1px solid var(--brass-lo); box-shadow: var(--shadow); animation: g-pop 3.2s var(--ease) both;
}
.g-emote::before { content: ""; position: absolute; left: 50%; top: -6px; width: 10px; height: 10px; background: var(--parchment-hi); border-left: 1px solid var(--brass-lo); border-top: 1px solid var(--brass-lo); transform: translateX(-50%) rotate(45deg); }
.g-skip { flex: none; align-self: center; }
.g-skip small { font-family: var(--font-num); opacity: .7; }

/* dossier popover */
.g-pop-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(10,6,3,.25); }
.g-dossier { position: fixed; width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 120px); overflow: auto; animation: rise-in .22s var(--ease) both; }
.g-dossier .g-x { position: absolute; top: 6px; right: 6px; }
.g-dos-head { display: flex; gap: 12px; align-items: center; padding-right: 30px; margin-bottom: 8px; }
.g-dos-head h3 { margin: 0; font-size: 1.2rem; }
.g-dos-head p { margin: 2px 0 0; }
.g-dos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.g-dos-grid div { background: rgba(255,250,235,.45); border: 1px solid rgba(122,95,53,.35); border-radius: 6px; padding: 4px 8px; }
.g-dos-grid dt { font: .72rem var(--font-caps); letter-spacing: .06em; color: var(--ink-faint); }
.g-dos-grid dd { margin: 0; font-weight: 600; font-size: 1.05rem; }
.g-dos-record { color: var(--ink-faint); }
.g-dos-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.g-dos-acts .btn { flex: 1 1 45%; }

/* ---------- right rail: bookmark ribbons ---------- */
.g-rail {
  position: absolute; z-index: calc(var(--z-panel) + 1); right: 0; top: calc(var(--g-top-h) + 14px);
  display: flex; flex-direction: column; gap: 6px; width: var(--g-rail-w);
}
.g-rail-tab {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px 8px; min-height: 60px; cursor: pointer;
  color: var(--parchment-hi); border: 1px solid rgba(176,141,87,.6); border-right: 0; border-radius: 10px 0 0 10px;
  background: linear-gradient(90deg, rgba(123,45,38,.96), rgba(84,28,24,.98)), var(--g-leather) center / 260px;
  box-shadow: -3px 3px 8px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,220,180,.15); transition: transform .18s var(--ease), background .18s;
}
.g-rail-tab:nth-child(2) { background: linear-gradient(90deg, rgba(31,58,77,.96), rgba(20,38,52,.98)), var(--g-leather) center / 260px; }
.g-rail-tab:nth-child(3) { background: linear-gradient(90deg, rgba(61,90,58,.96), rgba(38,58,36,.98)), var(--g-leather) center / 260px; }
.g-rail-tab:nth-child(4) { background: linear-gradient(90deg, rgba(92,70,44,.96), rgba(58,43,27,.98)), var(--g-leather) center / 260px; }
.g-rail-tab:nth-child(5) { background: linear-gradient(90deg, rgba(59,63,70,.96), rgba(36,38,43,.98)), var(--g-leather) center / 260px; }
.g-rail-tab:hover, .g-rail-tab.is-on { transform: translateX(-6px); }
.g-rail-tab.is-on { border-color: var(--brass-hi); box-shadow: -4px 4px 12px rgba(0,0,0,.55), 0 0 0 1px rgba(220,193,138,.35); }
.g-rail-tab img, .g-rail-tab svg { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.g-rail-label { font: .66rem/1.05 var(--font-caps); letter-spacing: .05em; text-align: center; }
.g-rail-badge {
  position: absolute; top: 3px; left: 3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center; font: 700 .72rem var(--font-num); color: var(--ink); background: var(--brass-hi);
  border: 1px solid #fff0c8; box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.g-rail-tab.has-badge:nth-child(2) .g-rail-badge { background: #e9c46a; }

/* ---------- drawers ---------- */
.g-drawer {
  position: absolute; z-index: var(--z-panel); top: calc(var(--g-top-h) + 8px); bottom: 14px; right: calc(var(--g-rail-w) + 2px);
  width: min(440px, calc(100% - var(--g-rail-w) - 24px)); display: flex; flex-direction: column; padding: 0;
  animation: g-slide-in .26s var(--ease) both;
}
.g-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 20px; border-bottom: 1px solid rgba(122,95,53,.4); }
.g-drawer-head h2 { margin: 0; font-size: 1.3rem; color: var(--ink); }
.g-drawer-body { flex: 1; min-height: 0; padding: 12px 20px 18px; }
.g-sec { padding: 10px 0 12px; border-bottom: 1px solid rgba(122,95,53,.22); }
.g-sec:last-child { border-bottom: 0; }
.g-sec h3 { font-size: 1rem; margin: 0 0 6px; color: var(--oxblood); letter-spacing: .05em; }
.g-sub { font: 600 .95rem var(--font-display); margin: 14px 0 6px; color: var(--ink-soft); }
.g-big { font-size: 1.6rem; margin: 0; }
.g-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.g-list li { display: grid; gap: 4px; padding: 8px 10px; border-radius: 6px; background: rgba(255,250,235,.4); border: 1px solid rgba(122,95,53,.25); }
.g-list li .btn { justify-self: start; }
.g-note { font-size: .9rem; padding: 6px 10px; border-left: 3px solid var(--brass); background: rgba(255,250,235,.5); margin: 8px 0; }
.g-note.g-warn { border-left-color: var(--oxblood); }

/* ledger tables: ruled like an account book */
.g-ltable, .g-ftable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.g-ltable { background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(31,58,77,.22) 31px 32px); border-left: 2px solid rgba(165,68,58,.45); }
.g-ltable th { text-align: left; font-weight: 400; font-family: var(--font-body); padding: 4px 8px; height: 32px; }
.g-ltable th small { color: var(--ink-faint); }
.g-ltable td { text-align: right; padding: 4px 6px; white-space: nowrap; font-weight: 600; }
.g-lsum th, .g-lsum td { border-top: 1px solid var(--ink-soft); }
.g-lneg td { color: var(--oxblood); }
.g-ltotal th { font-weight: 600; }
.g-ltotal th, .g-ltotal td { border-top: 3px double var(--ink); font-size: 1.08rem; }
.g-ltotal td { color: #2d5b36; }
.g-ftable th, .g-ftable td { padding: 3px 8px; border-bottom: 1px solid rgba(122,95,53,.25); text-align: left; }
.g-ftable thead th { font: .78rem var(--font-caps); letter-spacing: .06em; color: var(--ink-faint); }
.g-ftable tr.is-now td { background: rgba(201,162,39,.25); font-weight: 700; }
.g-inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.g-field-inline { display: grid; gap: 2px; font-size: .8rem; }
.g-field-inline .input { width: 120px; }
.g-chip-war { color: var(--oxblood); }

/* tabs inside panels */
.g-tabs { display: flex; gap: 2px; border-bottom: 1px solid rgba(122,95,53,.45); margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.g-tab {
  flex: none; min-height: 40px; padding: 6px 9px; cursor: pointer; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0;
  background: transparent; color: var(--ink-soft); font: 1rem var(--font-caps); letter-spacing: .05em; position: relative; top: 1px;
}
.g-tab.is-on { background: rgba(255,250,235,.6); border-color: rgba(122,95,53,.45); color: var(--ink); }
.g-count { margin-left: 6px; display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--oxblood); color: var(--parchment-hi); font: 700 .7rem var(--font-num); }

/* segmented choices + forms */
.g-seg { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--brass-lo); border-radius: var(--radius); overflow: hidden; margin: 8px 0; }
.g-seg-opt { flex: 1 1 auto; min-height: 42px; padding: 6px 10px; cursor: pointer; border: 0; border-right: 1px solid rgba(122,95,53,.4); background: rgba(255,250,235,.45); color: var(--ink); font-size: .95rem; }
.g-seg-opt:last-child { border-right: 0; }
.g-seg-opt.is-on { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); font-weight: 600; box-shadow: inset 0 1px 3px rgba(60,40,10,.4); }
.g-seg-opt small { opacity: .7; }
.g-form { display: grid; gap: 4px; }
.g-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.g-num { display: grid; gap: 3px; font-size: .85rem; color: var(--ink-soft); }
.g-num > span:first-child { font-family: var(--font-caps); letter-spacing: .05em; }
.g-num-in { position: relative; }
.g-num-cur { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-family: var(--font-num); }
.g-num-in .input { width: 100%; padding-left: 22px; font-size: 1.05rem; }
.g-num small { color: var(--ink-faint); }
.g-num select.input { width: 100%; }
.g-summary { font-size: 1.02rem; font-style: italic; padding: 10px 12px; margin: 8px 0; background: rgba(255,250,235,.55); border: 1px solid rgba(122,95,53,.3); border-radius: 6px; }
.g-form-acts { display: flex; justify-content: flex-end; margin-top: 6px; }
.g-ppick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.g-ppick-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px 4px 5px; border-radius: 22px; cursor: pointer; background: rgba(255,250,235,.45); border: 1px solid rgba(122,95,53,.4); color: var(--ink); }
.g-ppick-opt.is-on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); background: rgba(255,250,235,.85); font-weight: 600; }
.g-check { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.g-check input { width: 20px; height: 20px; accent-color: var(--oxblood); }
.g-settings-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-confirm { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .92rem; }

/* letters */
.g-letters { display: grid; gap: 12px; }
.g-letter {
  position: relative; padding: 12px 14px 10px; border-radius: 3px; color: var(--ink);
  background: linear-gradient(135deg, rgba(255,250,232,.9), rgba(238,222,186,.9)), var(--g-paper) center / 400px;
  border: 1px solid rgba(122,95,53,.45); box-shadow: 0 3px 8px rgba(43,33,24,.25); border-left: 4px solid var(--c);
}
.g-letter.is-in { transform: rotate(-.4deg); }
.g-letter::after { content: ""; position: absolute; right: 0; top: 0; border-width: 0 18px 18px 0; border-style: solid; border-color: transparent #c9b386 rgba(0,0,0,.08) transparent; }
.g-letter header { display: flex; gap: 10px; align-items: center; }
.g-letter h4 { margin: 0; font: 600 1rem var(--font-display); }
.g-letter header small { color: var(--ink-faint); }
.g-letter p { margin: 8px 0; font-size: 1rem; }
.g-letter footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.g-wax {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 14px 2px 4px; cursor: pointer; border-radius: 24px;
  background: linear-gradient(180deg, #a5443a, #6e2620); color: var(--parchment-hi); border: 1px solid #c9796f; font: 1rem var(--font-caps); letter-spacing: .06em;
  box-shadow: 0 2px 4px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,200,180,.3);
}
.g-wax img { width: 38px; height: 38px; transition: transform .3s var(--ease); }
.g-wax:hover img { transform: rotate(-14deg) scale(1.08); }
.g-stamp { position: absolute; right: 18px; top: 10px; width: 92px; height: 92px; animation: g-stamp .45s cubic-bezier(.3,1.6,.5,1) both; pointer-events: none; }
.g-letter.is-stamped footer { opacity: .4; pointer-events: none; }

/* chronicle */
.g-chron { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.g-drawer--chronicle .g-drawer-body { display: flex; flex-direction: column; overflow: hidden; }
.g-chron-list { flex: 1; min-height: 120px; list-style: none; padding: 0 4px 0 0; margin: 0; overflow: auto; }
.g-chron-item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px dotted rgba(122,95,53,.35); font-size: .95rem; line-height: 1.35; }
.g-chron-item img { width: 20px; height: 20px; flex: none; object-fit: contain; margin-top: 1px; }
.g-chron-item.is-big { font-weight: 600; }
.g-chron-item.is-turn { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--brass-lo); border-bottom: 1px solid rgba(122,95,53,.35); font-family: var(--font-display); font-size: .92rem; letter-spacing: .02em; }
.g-chat { flex-direction: column; gap: 0; }
.g-chat span { font-style: italic; }
.g-chatbox { display: flex; gap: 6px; margin-top: 8px; }
.g-chatbox .input { flex: 1; min-width: 0; }
.g-emotes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* ---------- bottom: phase track + dock ---------- */
.g-bottom {
  position: absolute; z-index: var(--z-hud); left: 12px; right: calc(var(--g-rail-w) + 8px); bottom: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 0; pointer-events: none; transition: right .26s var(--ease);
}
.g-bottom > * { pointer-events: auto; }
.g-root.has-panel .g-bottom { right: calc(var(--g-rail-w) + 460px); }

.g-track {
  display: flex; margin: 0 0 -1px; padding: 5px 14px 7px; list-style: none; gap: 2px; position: relative; z-index: 1;
  background: var(--g-brass-tex) center / 260px, var(--brass); color: var(--ink); border-radius: 12px 12px 0 0;
  border: 1px solid #e8cf98; border-bottom: 0; box-shadow: inset 0 1px 0 rgba(255,240,200,.7), 0 -2px 10px rgba(0,0,0,.35);
}
.g-track-stop { display: flex; align-items: center; gap: 6px; padding: 2px 10px; font: .9rem var(--font-caps); letter-spacing: .06em; opacity: .58; position: relative; }
.g-track-stop + .g-track-stop::before { content: ""; position: absolute; left: -6px; top: 50%; width: 8px; height: 1px; background: rgba(43,33,24,.5); }
.g-track-lamp { width: 10px; height: 10px; border-radius: 50%; background: #5a4630; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.g-track-stop.is-done { opacity: .78; }
.g-track-stop.is-done .g-track-lamp { background: #7a5f35; }
.g-track-stop.is-now { opacity: 1; font-weight: 700; }
.g-track-stop.is-now .g-track-lamp { background: radial-gradient(circle at 40% 35%, #fff3c4, #f0a830 55%, #a5541a); box-shadow: 0 0 8px 2px rgba(255,190,80,.8); }
.g-track.is-theirs .g-track-stop.is-now .g-track-lamp { background: radial-gradient(circle at 40% 35%, #e9e2cf, #8f8a80 60%, #4c473f); box-shadow: none; animation: none; }

.g-dock {
  position: relative; width: min(860px, 100%); border-radius: 16px; padding: 12px 14px 12px;
  background: linear-gradient(180deg, rgba(92,34,28,.97), rgba(52,20,16,.98)), var(--g-leather) center / 360px; color: var(--parchment-hi);
  border: 1px solid var(--brass); box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255,220,180,.18);
}
.g-dock::before { content: ""; position: absolute; inset: 5px; border: 1px dashed var(--g-stitch); border-radius: 12px; pointer-events: none; }
.g-dock.is-waiting { background: linear-gradient(180deg, rgba(50,40,32,.96), rgba(30,23,17,.97)), var(--g-leather) center / 360px; }
.g-dock-grip { display: none; }
.g-dock-head { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.g-purse {
  display: grid; justify-items: center; align-content: center; min-width: 86px; padding: 6px 8px; border-radius: 10px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(176,141,87,.5);
}
.g-purse img { width: 28px; height: 28px; }
.g-purse-amt { font-size: 1.3rem; font-weight: 700; color: var(--gold); line-height: 1.1; }
.g-purse-res { font-size: .72rem; color: var(--brass-hi); text-align: center; line-height: 1.1; margin-top: 2px; }
/* the order slip */
.g-dock-say {
  position: relative; min-width: 0; padding: 9px 16px 9px 18px; border-radius: 3px; color: var(--ink);
  background: linear-gradient(180deg, rgba(250,240,215,.96), rgba(233,217,181,.96)), var(--g-paper) center / 420px;
  box-shadow: 0 2px 6px rgba(0,0,0,.45), inset 0 0 18px rgba(122,95,53,.2); transform: rotate(-.35deg);
}
.g-dock-say::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px; background: rgba(165,68,58,.5); }
.g-prompt { margin: 0; font: 600 1.14rem/1.25 var(--font-body); }
.g-detail { margin: 3px 0 0; font-size: .9rem; line-height: 1.3; color: var(--ink-soft); font-style: italic; }
.g-error { margin: 6px 0 0; font-size: .92rem; color: var(--oxblood); font-weight: 600; display: flex; gap: 6px; align-items: flex-start; animation: g-shake .35s both; }
.g-error img { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.g-dock-acts { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; max-width: 360px; }
.g-primary { min-height: 52px; font-size: 1.08rem; padding: .45em 1.3em; }
.g-seal-btn { background: radial-gradient(circle at 35% 30%, #c25446, #7b2d26 60%, #5a1d18); color: var(--parchment-hi); border-color: #d08a7c; text-shadow: 0 1px 1px rgba(0,0,0,.4); box-shadow: inset 0 2px 0 rgba(255,200,180,.3), 0 3px 8px rgba(0,0,0,.45); }

.g-dock-tray { position: relative; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(176,141,87,.35); }
.g-tray { display: grid; gap: 8px; }
.g-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.g-tools--3 { grid-template-columns: repeat(3, 1fr); }
.g-tool {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  min-height: 52px; padding: 6px 10px; cursor: pointer; border-radius: 8px; color: var(--parchment-hi);
  background: rgba(0,0,0,.25); border: 1px solid rgba(176,141,87,.4);
}
.g-tool img { grid-row: 1 / 3; width: 32px; height: 32px; object-fit: contain; }
.g-tool-name { font: 1rem var(--font-caps); letter-spacing: .04em; }
.g-tool-cost { font-size: .8rem; color: var(--brass-hi); font-family: var(--font-num); }
.g-tool.is-on { background: linear-gradient(180deg, rgba(220,193,138,.95), rgba(176,141,87,.95)); color: var(--ink); border-color: #f0dba8; box-shadow: inset 0 1px 0 rgba(255,245,215,.6), 0 0 0 2px rgba(220,193,138,.25); }
.g-tool.is-on .g-tool-cost { color: var(--ink-soft); }
.g-tool.is-off { opacity: .55; }
.g-buyrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .95rem; }
.g-buyrow-l { font: .9rem var(--font-caps); letter-spacing: .05em; color: var(--brass-hi); }
.g-buyrow-sum { color: var(--parchment); }
.g-buyrow--cards { justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: rgba(201,162,39,.16); border: 1px solid rgba(201,162,39,.45); }
.g-stepper { display: inline-flex; align-items: center; border: 1px solid var(--brass); border-radius: 8px; overflow: hidden; background: rgba(0,0,0,.3); }
.g-step { width: 44px; height: 40px; border: 0; background: transparent; color: var(--parchment-hi); font-size: 1.3rem; cursor: pointer; }
.g-step:disabled { opacity: .35; cursor: not-allowed; }
.g-step:hover:not(:disabled) { background: rgba(220,193,138,.15); }
.g-stepper output { min-width: 40px; text-align: center; font-size: 1.15rem; font-weight: 700; color: var(--gold); }
.g-range { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 44px; }
.g-range-label { font: .9rem var(--font-caps); letter-spacing: .04em; color: var(--brass-hi); white-space: nowrap; }
.panel .g-range-label { color: var(--ink-soft); }
.g-range output { min-width: 3.5em; font-weight: 700; color: var(--gold); white-space: nowrap; }
.panel .g-range output { color: #7a5a10; }
.g-range input[type="range"] { width: 100%; min-width: 0; accent-color: var(--brass); height: 28px; }

/* battle */
.g-tray--battle { grid-template-columns: 1fr 1fr; align-items: start; gap: 10px 16px; }
.g-bt-sides { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.g-bt-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.g-bt-side div { display: grid; min-width: 0; }
.g-bt-side b { font-family: var(--font-display); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bt-side span { font-size: .85rem; color: var(--parchment); }
.g-bt-def { justify-content: flex-end; flex-direction: row-reverse; text-align: right; }
.g-bt-vs img { width: 34px; height: 34px; }
.g-bt-odds { display: grid; gap: 6px; }
.g-bt-win { display: flex; align-items: center; gap: 10px; font-size: .85rem; line-height: 1.25; }
.g-bt-pct { font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; min-width: 2.6em; }
.g-bt-roll { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .8rem; }
.g-bt-roll li { display: grid; grid-template-columns: 7.5em 1fr 3em; align-items: center; gap: 6px; }
.g-bt-roll i { height: 7px; border-radius: 4px; background: rgba(0,0,0,.35); position: relative; overflow: hidden; }
.g-bt-roll i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--brass-hi); border-radius: 4px; }
.g-bt-roll li.is-bad i::after { background: #c0584a; }
.g-bt-roll li.is-mid i::after { background: #9e9a8c; }
.g-bt-roll b { text-align: right; }
.g-bt-last { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .92rem; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.25); animation: g-pop-in .3s var(--ease) both; }
.g-bt-dice { display: flex; gap: 5px; align-items: center; }
.g-bt-dice-vs { font-style: italic; opacity: .7; margin: 0 2px; }
.g-die { width: 28px; height: 28px; padding: 4px; border-radius: 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.5); animation: g-roll .4s var(--ease) both; }
.g-die i { border-radius: 50%; }
.g-die i.on { background: currentColor; }
.g-die--att { background: #f4e9cd; color: var(--oxblood); }
.g-die--def { background: #2b2118; color: var(--parchment-hi); border: 1px solid var(--brass-lo); }
.g-bt-controls { display: grid; gap: 8px; align-content: start; }
.g-dice-pick { display: flex; align-items: center; gap: 6px; }
.g-dice-pick > span { font: .9rem var(--font-caps); color: var(--brass-hi); margin-right: 4px; }
.g-dice-opt { width: 44px; height: 40px; border-radius: 8px; cursor: pointer; font: 700 1.1rem var(--font-num); color: var(--parchment-hi); background: rgba(0,0,0,.28); border: 1px solid rgba(176,141,87,.45); }
.g-dice-opt.is-on { background: #f4e9cd; color: var(--oxblood); border-color: #f0dba8; }
.g-dice-opt:disabled { opacity: .3; cursor: not-allowed; }
.g-blitz { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.g-blitz .g-range { grid-template-columns: auto 1fr auto; }

.g-occ-head { display: flex; gap: 8px; align-items: center; }
.g-occ-head img { width: 30px; height: 30px; }
.g-occ-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.g-occ-quick .btn--ghost { color: var(--parchment-hi); }
.g-rd-amt { display: grid; gap: 4px; }

/* war cards */
.g-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.g-card { position: relative; width: 112px; aspect-ratio: 5 / 7; padding: 0; border: 0; background: none; cursor: pointer; perspective: 800px; }
.g-card:disabled { cursor: default; }
.g-card-face, .g-card-back {
  position: absolute; inset: 0; border-radius: 8px; background-size: cover; background-position: center; backface-visibility: hidden;
  border: 2px solid var(--brass); box-shadow: 0 3px 8px rgba(0,0,0,.45); transition: transform .5s var(--ease);
}
.g-card-back { transform: rotateY(180deg); }
.g-card.is-flip .g-card-face { animation: g-flip-face .9s var(--ease) both; }
.g-card.is-flip .g-card-back { animation: g-flip-back .9s var(--ease) both; }
.g-card-type { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font: 600 .7rem var(--font-caps); letter-spacing: .08em; color: var(--parchment-hi); text-shadow: 0 1px 2px #000; }
.g-card-name {
  position: absolute; left: 5px; right: 5px; bottom: 6px; padding: 3px 4px; border-radius: 3px; text-align: center;
  font: 600 .76rem/1.1 var(--font-body); color: var(--ink); background: rgba(244,233,205,.92); border: 1px solid var(--brass-lo);
}
.g-card-lock { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); font: 700 .8rem var(--font-caps); letter-spacing: .1em; color: var(--parchment-hi); background: rgba(59,63,70,.9); padding: 2px 8px; border: 1px solid #aaa; }
.g-card.is-locked .g-card-face { filter: grayscale(.7) brightness(.85); }
.g-card.is-sel .g-card-face { transform: translateY(-8px); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.6), 0 10px 18px rgba(0,0,0,.45); }
.g-card--sm { width: 78px; }
.g-hand-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-earned { display: flex; gap: 12px; align-items: center; }
.g-earned p { margin: 0; font-size: .92rem; }

/* focus card slot (inside the map view's card) */
.g-focus { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.g-focus .btn { flex: 1 1 auto; }
.g-focus .btn--ghost { color: var(--ink); }
.g-focus-note { flex-basis: 100%; margin: 2px 0 0; font-size: .85rem; font-style: italic; color: var(--ink-soft); }

/* ---------- banners + toasts ---------- */
.g-banner {
  position: absolute; z-index: var(--z-toast); left: 50%; top: 22%; transform: translateX(-50%); pointer-events: none;
  display: grid; justify-items: center; gap: 8px; width: min(620px, calc(100% - 32px)); animation: g-banner var(--ms, 2600ms) var(--ease) both;
}
.g-banner-ribbon {
  position: relative; padding: 14px 70px 16px; text-align: center; color: var(--parchment-hi);
  background: linear-gradient(180deg, #a5443a, #7b2d26 60%, #5c201b); border-top: 2px solid #d08a7c; border-bottom: 2px solid #3d1310;
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
  box-shadow: inset 0 0 0 6px rgba(0,0,0,.08);
}
.g-banner-ribbon h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: .08em; text-shadow: 0 2px 3px rgba(0,0,0,.5); }
.g-banner-sub { margin: 2px 0 0; font-size: 1.1rem; color: #f6dba0; }
.g-banner--turn .g-banner-ribbon, .g-banner--win .g-banner-ribbon { background: linear-gradient(180deg, #e7cf93, var(--brass) 60%, #8a6c3d); color: var(--ink); border-top-color: #fff0c8; border-bottom-color: #5a4630; }
.g-banner--turn .g-banner-sub, .g-banner--win .g-banner-sub { color: #4a2f12; }
.g-banner--turn h2, .g-banner--win h2 { text-shadow: 0 1px 0 rgba(255,240,200,.6); }
.g-banner--deal .g-banner-ribbon { background: linear-gradient(180deg, #3a6584, var(--navy) 60%, #142836); border-top-color: #7aa0bb; }
.g-banner--loss .g-banner-ribbon, .g-banner--big .g-banner-ribbon { background: linear-gradient(180deg, #55595f, #3b3f46 60%, #24272c); border-top-color: #9a9ea6; }
.g-banner-lines { list-style: none; margin: 0; padding: 6px 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: .95rem; color: var(--ink); background: var(--parchment-hi) var(--g-paper) center / 400px; border: 1px solid var(--brass-lo); border-radius: 4px; box-shadow: var(--shadow); }
.g-toasts { position: absolute; z-index: var(--z-toast); right: calc(var(--g-rail-w) + 10px); top: calc(var(--g-top-h) + 12px); display: grid; gap: 8px; width: min(360px, calc(100% - 100px)); }
.g-root.has-panel .g-toasts { right: calc(var(--g-rail-w) + 460px); }
.g-toast { display: flex; align-items: center; gap: 10px; animation: g-slide-in .3s var(--ease) both; font-size: .95rem; }
.g-toast img { width: 30px; height: 30px; flex: none; }
.g-toast span { flex: 1; }
.g-toast .g-x { width: 32px; height: 32px; font-size: 20px; }

/* game over */
.g-over { width: min(980px, 100%); text-align: center; position: relative; padding-top: 34px; }
.g-over-crest img { width: 76px; height: 76px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.g-over h2 { font-size: clamp(2rem, 6vw, 3.2rem); color: var(--oxblood); margin: 4px 0; letter-spacing: .1em; }
.g-over.is-win h2 { color: #7a5a10; }
.g-over-sub { font-size: 1.1rem; margin: 0 0 14px; }
.g-over-tablewrap { overflow-x: auto; }
.g-over-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.g-over-table th, .g-over-table td { padding: 6px 8px; border-bottom: 1px solid rgba(122,95,53,.3); white-space: nowrap; }
.g-over-table thead th { font: .76rem var(--font-caps); letter-spacing: .05em; color: var(--ink-faint); }
.g-over-table tbody th { text-align: left; display: flex; align-items: center; gap: 8px; font-family: var(--font-body); }
.g-over-table tr.is-winner { background: rgba(201,162,39,.22); font-weight: 700; }
.g-over-acts { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.g-over-reopen { position: absolute; z-index: var(--z-hud); left: 50%; transform: translateX(-50%); top: calc(var(--g-top-h) + 12px); }
.g-closed { text-align: center; }

/* ---------- animation ---------- */
@keyframes g-breathe { 50% { opacity: .45; } }
@keyframes g-flicker { 0%, 100% { opacity: 1; } 40% { opacity: .82; } 60% { opacity: .95; } }
@keyframes g-pop { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 10%, 85% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -4px); } }
@keyframes g-pop-in { from { opacity: 0; transform: scale(.96); } }
@keyframes g-slide-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes g-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes g-stamp { from { opacity: 0; transform: scale(2.2) rotate(-25deg); } to { opacity: .92; transform: scale(1) rotate(-12deg); } }
@keyframes g-roll { from { transform: rotate(-200deg) scale(.4); opacity: 0; } }
@keyframes g-banner { 0% { opacity: 0; transform: translateX(-50%) scaleX(.4); } 12% { opacity: 1; transform: translateX(-50%) scaleX(1); } 82% { opacity: 1; transform: translateX(-50%); } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
@keyframes g-flip-face { 0%, 30% { transform: rotateY(-180deg); } 100% { transform: rotateY(0); } }
@keyframes g-flip-back { 0%, 30% { transform: rotateY(0); } 100% { transform: rotateY(180deg); } }

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
  .g-root.has-panel .g-bottom { right: calc(var(--g-rail-w) + 8px); }
  .g-root.has-panel .g-dock { visibility: hidden; }
  .g-ptab { min-width: 150px; }
}

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .g-root { --g-top-h: 64px; --g-rail-w: 0px; }
  .g-map .mv-root { --mv-card-top: 70px; --mv-card-right: 0px; }
  .g-top { padding: 6px 6px 0; gap: 5px; }
  .g-menu-btn { width: 44px; height: 44px; }
  .g-round { width: 44px; height: 44px; }
  .g-round-k { font-size: .55rem; }
  .g-round-n { font-size: 1.05rem; }
  .g-ptab { flex: none; min-width: 0; }
  .g-ptab-btn { grid-template-columns: auto; grid-template-rows: auto; padding: 4px; min-height: 48px; width: auto; justify-items: center; border-top-width: 3px; }
  .g-ptab-body { display: none; }
  .g-ptab-medal { grid-row: auto; width: 40px; height: 40px; }
  .g-ptab-badges { left: -4px; right: -4px; bottom: -9px; justify-content: center; }
  .g-badge { font-size: .6rem; padding: 2px 3px; }
  .g-badge--inc, .g-badge--lent { display: none; }
  .g-ptab.is-me .g-ptab-body, .g-ptab.is-active .g-ptab-body { display: grid; gap: 1px; }
  .g-ptab.is-me .g-ptab-btn, .g-ptab.is-active .g-ptab-btn { grid-template-columns: auto auto; justify-items: start; padding-right: 8px; }
  .g-ptab-name { font-size: .86rem; max-width: 90px; }
  .g-ptab-stats { gap: 5px; font-size: .74rem; }
  .g-ptab-stats > span:nth-child(4) { display: none; }

  .g-rail { top: auto; bottom: auto; right: 0; left: 0; flex-direction: row; width: auto; gap: 0; top: var(--g-top-h); justify-content: flex-end; padding: 0 6px; pointer-events: none; }
  .g-rail-tab { pointer-events: auto; min-height: 44px; width: 48px; padding: 6px 0 4px; border-radius: 0 0 10px 10px; border: 1px solid rgba(176,141,87,.6); border-top: 0; margin-left: 3px; box-shadow: 0 3px 6px rgba(0,0,0,.45); }
  .g-rail-tab:hover, .g-rail-tab.is-on { transform: translateY(4px); }
  .g-rail-tab img, .g-rail-tab svg { width: 22px; height: 22px; }
  .g-rail-label { display: none; }
  .g-rail-badge { top: auto; bottom: -8px; left: 50%; transform: translateX(-50%); }

  .g-drawer { inset: 0; width: auto; border-radius: 0; z-index: calc(var(--z-modal) - 1); animation: rise-in .25s var(--ease) both; }
  .g-drawer-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .g-drawer-body { padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); }

  .g-bottom { left: 0; right: 0; bottom: 0; }
  .g-root.has-panel .g-bottom { right: 0; }
  .g-track { padding: 4px 8px 5px; border-radius: 10px 10px 0 0; max-width: calc(100% - 24px); }
  .g-track-stop { padding: 2px 5px; font-size: .74rem; gap: 4px; }
  .g-track-stop:not(.is-now) { font-size: 0; gap: 0; padding: 2px 4px; }
  .g-track-stop + .g-track-stop::before { display: none; }
  .g-dock { width: 100%; border-radius: 16px 16px 0 0; border-bottom: 0; padding: 4px 10px calc(10px + env(safe-area-inset-bottom)); max-height: 62dvh; overflow-y: auto; }
  .g-dock::before { inset: 4px 4px 0; border-bottom: 0; border-radius: 12px 12px 0 0; }
  .g-dock-grip { display: block; width: 100%; height: 22px; border: 0; background: transparent; cursor: pointer; position: relative; }
  .g-dock-grip::after { content: ""; position: absolute; left: 50%; top: 8px; width: 46px; height: 5px; border-radius: 3px; background: rgba(220,193,138,.55); transform: translateX(-50%); }
  .g-dock-head { grid-template-columns: auto 1fr; gap: 8px; }
  .g-purse { min-width: 64px; padding: 4px; }
  .g-purse img { width: 20px; height: 20px; }
  .g-purse-amt { font-size: 1.05rem; }
  .g-dock-say { padding: 7px 10px 7px 14px; transform: none; }
  .g-prompt { font-size: 1rem; }
  .g-detail { font-size: .82rem; }
  .g-dock.is-collapsed .g-detail { display: none; }
  .g-dock-acts { grid-column: 1 / -1; max-width: none; flex-wrap: nowrap; }
  .g-dock-acts .btn { flex: 1 1 0; min-width: 0; padding-left: .6em; padding-right: .6em; }
  .g-dock-acts .g-primary { flex: 2 1 0; }
  .g-primary kbd { display: none; }
  .g-tools { grid-template-columns: repeat(2, 1fr); }
  .g-tools--3 { grid-template-columns: repeat(3, 1fr); }
  .g-tools--3 .g-tool { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .g-tools--3 .g-tool img { grid-row: auto; width: 24px; height: 24px; }
  .g-tools--3 .g-tool-cost { font-size: .68rem; }
  .g-tool { min-height: 48px; padding: 5px 8px; }
  .g-tool img { width: 26px; height: 26px; }
  .g-tray--battle { grid-template-columns: 1fr; }
  .g-bt-pct { font-size: 1.6rem; }
  .g-banner { top: 18%; }
  .g-banner-ribbon { padding: 10px 40px 12px; }
  .g-toasts { right: 8px; left: 8px; width: auto; top: calc(var(--g-top-h) + 52px); }
  .g-root.has-panel .g-toasts { right: 8px; }
  .g-form-row { grid-template-columns: 1fr; }
  .g-card { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .g-track-stop.is-now .g-track-lamp, .g-ptab-turn { animation: none; }
}

/* ---------- war aid ---------- */
.g-aid-amt { display: grid; gap: 6px; }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chipbtn { min-height: 36px; padding: 4px 12px; border-radius: 18px; cursor: pointer; font: 600 .9rem var(--font-num); color: var(--ink); background: rgba(255,250,235,.5); border: 1px solid rgba(122,95,53,.45); }
.g-chipbtn.is-on { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); border-color: var(--brass-lo); }
.g-aid-purpose { border: 1px solid rgba(122,95,53,.4); border-radius: var(--radius); padding: 6px 10px 8px; margin: 8px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.g-aid-purpose legend { font: .9rem var(--font-caps); letter-spacing: .05em; color: var(--ink-soft); padding: 0 4px; }
.g-radio { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.g-radio input { width: 18px; height: 18px; accent-color: var(--oxblood); }
.g-radio.is-on { background: rgba(201,162,39,.2); font-weight: 600; }
.g-linkbtn { background: none; border: 0; padding: 0; min-height: 0; cursor: pointer; color: var(--navy); text-decoration: underline; text-underline-offset: 2px; font: inherit; }
.g-plist { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 8px; }
.g-pledge { padding: 8px 10px; border-radius: 6px; background: rgba(255,250,235,.45); border: 1px solid rgba(122,95,53,.3); border-left: 4px solid var(--brass); }
.g-pledge.is-honoured, .g-pledge.is-gift { border-left-color: var(--good); }
.g-pledge.is-broken { border-left: 4px double var(--oxblood); background: repeating-linear-gradient(135deg, rgba(165,68,58,.07) 0 6px, transparent 6px 12px), rgba(255,250,235,.45); }
.g-pledge.is-void { border-left-color: #8a8a8a; opacity: .85; }
.g-pledge-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-pledge-head > span:nth-child(2) { flex: 1; min-width: 160px; }
.g-pledge .g-small { margin: 4px 0 0; }
.g-plist--mini .g-pledge { padding: 4px 8px; font-size: .86rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.g-pchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font: 600 .74rem var(--font-num); white-space: nowrap; border: 1px solid; }
.g-pchip--open { color: var(--navy); border-color: var(--navy); background: rgba(31,58,77,.08); }
.g-pchip--honoured, .g-pchip--gift { color: #2d5b36; border-color: #2d5b36; background: rgba(63,125,78,.12); }
.g-pchip--broken { color: #fff4ec; border-color: var(--oxblood); background: var(--oxblood); }
.g-pchip--void { color: #5d5d5d; border-color: #8a8a8a; border-style: dashed; }
.g-rep b { font-family: var(--font-num); }
.g-rep-broken { color: var(--oxblood); text-decoration: underline wavy; text-underline-offset: 3px; }
.g-badge--broken { background: var(--oxblood); color: var(--parchment-hi); border-color: #c9796f; }
.g-reminder {
  display: flex; gap: 10px; align-items: flex-start; width: min(860px, 100%); margin-bottom: 8px; padding: 8px 14px; border-radius: 10px;
  color: var(--ink); background: linear-gradient(180deg, #f6e7bf, #e5cd92); border: 1px solid var(--brass); box-shadow: var(--shadow); font-size: .95rem;
}
.g-reminder img { width: 28px; height: 28px; flex: none; }
.g-reminder p { margin: 0; }

/* ---------- income report ---------- */
.g-income {
  position: absolute; z-index: calc(var(--z-panel) + 2); left: 50%; transform: translateX(-50%); bottom: 236px; width: min(520px, calc(100% - 24px));
  max-height: calc(100% - var(--g-top-h) - 250px); overflow: auto; animation: rise-in .3s var(--ease) both;
}
.g-inc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.g-inc-head img { width: 40px; height: 40px; }
.g-inc-head h2 { margin: 0; font-size: 1.3rem; color: var(--ink); }
.g-inc-head p { margin: 2px 0 0; }
.g-inc-timer { margin-left: auto; font-weight: 700; color: var(--oxblood); border: 2px solid var(--oxblood); border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.g-inc-cash { font-size: 1.05rem; margin: 10px 0 4px; }
.g-inc-extra { margin: 6px 0 0; padding-left: 18px; font-size: .92rem; }
.g-inc-acts { display: flex; justify-content: flex-end; margin-top: 12px; }
.g-bottom.is-inert .g-dock { filter: saturate(.6) brightness(.85); }
@media (max-width: 720px) {
  .g-income { bottom: 0; top: auto; left: 0; right: 0; transform: none; width: auto; max-height: calc(100% - var(--g-top-h) - 50px); border-radius: 16px 16px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); z-index: calc(var(--z-hud) + 5); animation: none; }
  .g-bottom.is-inert { visibility: hidden; }
  .g-aid-purpose { grid-template-columns: 1fr; }
  .g-reminder { width: calc(100% - 16px); font-size: .85rem; }
}

/* ---------- stepping back, ending the turn ---------- */
.g-back-btn { color: var(--brass-hi); border-style: dashed; margin-right: auto; }
.g-endturn { border-color: rgba(201,121,111,.7); color: #f1c6bd; }
.g-track-back { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.g-track-back[aria-disabled="true"] { cursor: not-allowed; text-decoration: none; }
.g-track-stop.is-back { opacity: .9; }
.g-timer-fg { animation-name: g-timer-drain, g-timer-low; animation-timing-function: linear, step-end; animation-fill-mode: forwards, forwards; transition: none; }
@keyframes g-timer-drain { from { stroke-dashoffset: var(--from); } to { stroke-dashoffset: var(--c); } }
@keyframes g-timer-low { to { stroke: #e05a48; } }

/* ---------- cheap compositing during play ---------- */
.g-root { background: var(--wood); contain: layout paint; }
.g-dock { box-shadow: 0 6px 16px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,220,180,.18); }
.g-drawer { box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.g-income, .g-dossier { box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.g-banner-ribbon { border-bottom-width: 4px; }
.g-ptab-btn { box-shadow: 0 3px 6px rgba(0,0,0,.45); }
.g-ptab.is-active .g-ptab-btn { box-shadow: 0 0 0 1px rgba(220,193,138,.45), 0 0 10px rgba(240,190,90,.3); }

/* ---------- pace control + recap ticker ---------- */
.g-pace { flex: none; display: flex; gap: 6px; align-items: center; align-self: center; }
.g-pace-sel select {
  min-height: 36px; padding: 2px 8px; border-radius: 8px; cursor: pointer; font: .9rem var(--font-caps); letter-spacing: .04em;
  color: var(--parchment-hi); background: rgba(28,19,13,.85); border: 1px solid rgba(176,141,87,.6);
}
.g-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.g-ticker {
  position: absolute; z-index: var(--z-toast); left: 50%; top: calc(var(--g-top-h) + 8px); transform: translateX(-50%); margin: 0;
  max-width: min(560px, calc(100% - 32px)); padding: 5px 14px; border-radius: 16px; pointer-events: none; text-align: center;
  font: italic 1rem var(--font-body); color: var(--parchment-hi); background: rgba(28,19,13,.88); border: 1px solid rgba(176,141,87,.55);
  animation: fade-in .2s both;
}
@media (max-width: 720px) {
  .g-pace-sel { display: none; }
  .g-ticker { top: calc(var(--g-top-h) + 50px); font-size: .9rem; }
}

/* ---------- regions ---------- */
.g-legend {
  position: absolute; z-index: calc(var(--z-hud) - 1); left: 12px; top: calc(var(--g-top-h) + 8px); width: 290px; max-height: calc(100% - var(--g-top-h) - 290px);
  display: flex; flex-direction: column; border-radius: 10px; color: var(--parchment-hi);
  background: rgba(28,19,13,.9); border: 1px solid rgba(176,141,87,.6); box-shadow: 0 4px 12px rgba(0,0,0,.45);
}
.g-legend:not(.is-open) { width: auto; }
.g-legend-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 4px 4px; }
.g-legend-toggle { display: flex; align-items: baseline; gap: 8px; min-height: 36px; padding: 2px 8px; background: none; border: 0; color: inherit; cursor: pointer; font: 1.05rem var(--font-display); letter-spacing: .05em; }
.g-legend-toggle small { font: .75rem var(--font-caps); color: var(--brass-hi); }
.g-legend-more { color: var(--brass-hi); font-size: .85rem; }
.g-legend .g-reglist { overflow: auto; scrollbar-width: thin; padding: 0 6px 6px; }
.g-cmode { display: flex; align-items: center; gap: 4px; padding: 2px 10px 6px; font: .8rem var(--font-caps); letter-spacing: .04em; }
.g-cmode > span { margin-right: 4px; opacity: .8; }
.g-cmode-opt { min-height: 30px; padding: 2px 10px; border-radius: 15px; cursor: pointer; font: inherit; color: inherit; background: transparent; border: 1px solid rgba(176,141,87,.55); }
.g-cmode-opt.is-on { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--ink); border-color: #f0dba8; }
.panel .g-cmode { padding-left: 0; }
.panel .g-cmode-opt:not(.is-on) { color: var(--ink); }
.g-reglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.g-reg { border-radius: 8px; border-left: 6px solid var(--rc); background: rgba(255,250,235,.06); }
.panel .g-reg { background: rgba(255,250,235,.45); border: 1px solid rgba(122,95,53,.3); border-left: 6px solid var(--rc); }
.g-reg.is-mine { box-shadow: inset 0 0 0 1px var(--gold); }
.g-reg-row {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "sw name bonus" "prog prog prog" "meta meta meta";
  gap: 2px 8px; align-items: center; padding: 6px 8px; text-align: left; background: none; border: 0; color: inherit; cursor: pointer; font: inherit;
}
.g-reg-swatch { grid-area: sw; width: 14px; height: 14px; border-radius: 3px; background: var(--rc); border: 1px solid rgba(0,0,0,.5); }
.g-reg-name { grid-area: name; font-weight: 600; line-height: 1.15; }
.g-reg-bonus { grid-area: bonus; font-size: 1.25rem; font-weight: 700; color: var(--gold); }
.panel .g-reg-bonus { color: #7a5a10; font-size: 1.45rem; }
.g-reg-prog { grid-area: prog; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.g-reg-track { display: block; height: 6px; border-radius: 3px; background: rgba(0,0,0,.3); overflow: hidden; }
.g-reg-track i { display: block; height: 100%; background: var(--gold); }
.g-reg-prog small { font-size: .78rem; opacity: .9; }
.g-reg-meta { grid-area: meta; font-size: .82rem; opacity: .9; }
.g-reg.is-compact .g-reg-row { padding: 4px 6px; }
.g-reglist.is-compact .g-reg-bonus { font-size: 1.05rem; }
.g-reg-terr { list-style: none; margin: 0; padding: 0 8px 8px 28px; display: grid; gap: 2px; }
.g-reg-terr button { width: 100%; display: flex; align-items: center; gap: 4px; min-height: 32px; text-align: left; background: none; border: 0; color: inherit; cursor: pointer; font: inherit; font-size: .9rem; }
.g-reg-terr small { margin-left: auto; opacity: .8; }
.g-regions-chip { display: none; }
.g-bt-region { grid-column: 1 / -1; margin: 0; padding: 6px 10px; border-radius: 8px; background: rgba(201,162,39,.18); border: 1px solid rgba(201,162,39,.5); font-size: .92rem; }
.g-focus-region { flex-basis: 100%; margin: 0 0 2px; font-size: .88rem; color: var(--ink-soft); }
.g-inc-near { margin: 8px 0 0; padding: 6px 10px 6px 26px; font-size: .92rem; background: rgba(201,162,39,.15); border-radius: 6px; }
@media (max-width: 1100px) { .g-legend { width: 250px; } }
@media (max-width: 720px) {
  .g-legend { display: none; }
  .g-regions-chip { display: inline-flex; position: absolute; z-index: var(--z-hud); left: 8px; top: calc(var(--g-top-h) + 52px); min-height: 40px; }
}
@media (max-width: 720px) { .g-root.has-panel .g-ticker, .g-root.has-panel .g-banner { display: none; } }

/* =====================================================================================
   Compact layouts (phones): the board first, everything else slim and in thumb reach.
   .g-compact is set when the short side < 560px or the height < 620px; .g-portrait / .g-landscape.
   ===================================================================================== */
.g-compact { --g-top-h: calc(50px + env(safe-area-inset-top)); --g-tab-h: calc(52px + env(safe-area-inset-bottom)); overscroll-behavior: none; }

.g-compact button, .g-compact .btn, .g-compact select, .g-compact input[type="range"] { touch-action: manipulation; }
.g-compact input, .g-compact select, .g-compact textarea { font-size: 16px; }
.g-compact .g-legend, .g-compact .g-regions-chip, .g-compact .g-pace-sel { display: none; }
.g-compact .mv-zoom { display: none; }

/* slim top bar */
.g-root.g-compact .g-top {
  height: var(--g-top-h); padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
  gap: 6px; align-items: center; background: rgba(20,13,8,.94); border-bottom: 1px solid rgba(176,141,87,.35);
}
.g-root.g-compact .g-menu-btn { width: 44px; height: 44px; flex: none; }
.g-root.g-compact .g-round { width: 38px; height: 42px; flex: none; }
.g-root.g-compact .g-round-k { display: none; }
.g-root.g-compact .g-round-n { font-size: 1.05rem; }
.g-root.g-compact .g-ptabs { margin: 0; padding: 0 2px; gap: 4px; align-items: center; overflow-x: auto; overflow-y: hidden; pointer-events: auto; }
.g-root.g-compact .g-ptab { flex: none; min-width: 0; }
.g-root.g-compact .g-ptab-btn { grid-template-columns: auto; grid-template-rows: auto; width: auto; min-height: 44px; padding: 2px 3px; border-top-width: 3px; border-radius: 4px 4px 8px 8px; justify-items: center; transform: none; }
.g-root.g-compact .g-ptab-btn::after { display: none; }
.g-root.g-compact .g-ptab-body, .g-root.g-compact .g-ptab-badges { display: none; }
.g-root.g-compact .g-ptab-medal { grid-row: auto; width: 38px; height: 38px; }
.g-root.g-compact .g-ptab-medal .g-medal { width: 34px !important; height: 34px !important; }
.g-root.g-compact .g-ptab.is-me .g-ptab-btn { grid-template-columns: auto auto; column-gap: 6px; padding-right: 8px; justify-items: start; }
.g-root.g-compact .g-ptab.is-me .g-ptab-body { display: grid; gap: 0; }
.g-root.g-compact .g-ptab.is-me .g-ptab-name { display: none; }
.g-root.g-compact .g-ptab.is-me .g-ptab-stats { font-size: .82rem; gap: 6px; }
.g-root.g-compact .g-ptab.is-me .g-ptab-stats > span:nth-child(1), .g-root.g-compact .g-ptab.is-me .g-ptab-stats > span:nth-child(2) { display: none; }
.g-root.g-compact .g-ptab.is-me .g-ptab-stats > span:nth-child(4) { display: inline; }
.g-root.g-compact .g-ptab.is-active .g-ptab-btn { box-shadow: 0 0 0 2px var(--brass-hi); }
.g-root.g-compact .g-pace { flex: none; }
.g-root.g-compact .g-skip { min-height: 40px; padding: 0 .6em; font-size: .8rem; }

/* toasts, ticker and banners stay clear of the controls */
.g-root.g-compact .g-toasts { left: 8px; right: 8px; width: auto; top: calc(var(--g-top-h) + 6px); }
.g-root.g-compact .g-toast { font-size: .88rem; padding: .35em .6em; }
.g-root.g-compact .g-ticker { top: calc(var(--g-top-h) + 6px); font-size: .85rem; }
.g-root.g-compact .g-banner { top: calc(var(--g-top-h) + 40px); }
.g-root.g-compact .g-banner-ribbon { padding: 8px 34px 10px; }
.g-root.g-compact .g-banner-ribbon h2 { font-size: 1.35rem; }
.g-root.g-compact .g-banner-lines { font-size: .82rem; }
.g-root.g-compact .g-reminder { width: auto; margin: 0 6px 6px; font-size: .8rem; padding: 6px 10px; }
.g-root.g-compact .g-reminder img { width: 20px; height: 20px; }

/* compact dock: contextual row/sheet + one slim bar */
.g-root.g-compact .g-dock--compact {
  width: 100%; border-radius: 12px 12px 0 0; border-bottom: 0; padding: 6px max(8px, env(safe-area-inset-left)) 6px max(8px, env(safe-area-inset-right));
  max-height: 40dvh; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 -3px 10px rgba(0,0,0,.4);
}
.g-dock--compact::before { display: none; }
.g-cbar { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.g-cstep { flex: none; min-width: 34px; text-align: center; font: 600 .78rem var(--font-num); color: var(--brass-hi); border: 1px solid rgba(176,141,87,.6); border-radius: 12px; padding: 2px 4px; }
.g-cprompt {
  flex: 1; min-width: 0; min-height: 44px; padding: 0; text-align: left; cursor: pointer; background: none; border: 0; color: var(--parchment-hi);
  font: 600 .95rem/1.2 var(--font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-dock--compact.is-expanded .g-cprompt { white-space: normal; }
.g-root.g-compact .g-dock--compact .g-primary { flex: none; min-height: 48px; max-width: 48%; padding: .3em .8em; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.g-csec { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 0 6px; }
.g-csec::-webkit-scrollbar { display: none; }
.g-csec .btn { flex: none; min-height: 40px; color: var(--parchment-hi); }
.g-cdetail { margin: 0 0 4px; font-size: .82rem; color: var(--parchment); }
.g-dock--compact .g-error { margin: 0 0 4px; font-size: .85rem; color: #f3b7aa; }
.g-dock--compact .g-dock-tray { margin: 0 0 6px; padding: 0; border: 0; }
.g-dock--compact .g-small { font-size: .78rem; margin: 2px 0; }
/* purchase: one scrollable row of chips with the stepper inline */
.g-dock--compact .g-tray--buy { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.g-dock--compact .g-tray--buy::-webkit-scrollbar { display: none; }
.g-dock--compact .g-tools { display: flex; flex: none; gap: 6px; }
.g-dock--compact .g-tool { flex: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 10px 4px 6px; }
.g-dock--compact .g-tool img { width: 26px; height: 26px; }
.g-dock--compact .g-tool-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.g-dock--compact .g-tool-cost { font-size: .85rem; }
.g-dock--compact .g-tools--3 .g-tool-name { position: static; width: auto; height: auto; clip: auto; font-size: .85rem; }
.g-dock--compact .g-tools--3 .g-tool-cost { display: none; }
.g-dock--compact .g-buyrow { flex: none; flex-wrap: nowrap; gap: 8px; font-size: .82rem; }
.g-dock--compact .g-buyrow-l { display: none; }
.g-dock--compact .g-buyrow--cards { padding: 4px 8px; }
.g-dock--compact .g-buyrow--cards > span { display: none; }
/* battle / occupy / redeploy sheets */
.g-dock--compact .g-tray--battle { grid-template-columns: 1fr; gap: 6px; }
.g-dock--compact .g-bt-sides { grid-template-columns: 1fr auto 1fr; gap: 6px; font-size: .88rem; }
.g-dock--compact .g-bt-side .g-medal { width: 24px !important; height: 24px !important; font-size: 10px !important; }
.g-dock--compact .g-bt-vs img { width: 22px; height: 22px; }
.g-dock--compact .g-bt-roll { display: none; }
.g-dock--compact .g-bt-win { font-size: .78rem; }
.g-dock--compact .g-bt-pct { font-size: 1.4rem; min-width: 2.4em; }
.g-dock--compact .g-bt-controls { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.g-dock--compact .g-blitz { flex: 1; min-width: 220px; }
.g-dock--compact .g-blitz .g-range-label { font-size: .78rem; }
.g-dock--compact .g-bt-last { padding: 4px 8px; font-size: .8rem; }
.g-dock--compact .g-die { width: 22px; height: 22px; padding: 3px; }
.g-dock--compact .g-bt-region { font-size: .8rem; padding: 4px 8px; }
.g-dock--compact .g-occ-head { font-size: .88rem; }
.g-dock--compact .g-occ-head img { width: 22px; height: 22px; }
.g-dock--compact .g-tray--occupy > .g-small { display: none; }
.g-dock--compact .g-earned { gap: 8px; font-size: .82rem; }
.g-dock--compact .g-tray--cards > .g-small:last-child { display: none; }
.g-dock--compact .g-range { min-height: 40px; gap: 8px; }
.g-dock--compact input[type="range"] { height: 32px; }

/* ---- portrait: bottom tab bar holds the panels ---- */
.g-root.g-compact.g-portrait .g-rail {
  top: auto; left: 0; right: 0; bottom: 0; width: auto; height: var(--g-tab-h); flex-direction: row; gap: 0; justify-content: space-around;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: #1c130d; border-top: 1px solid rgba(176,141,87,.45);
  pointer-events: auto; z-index: calc(var(--z-hud) + 1);
}
.g-root.g-compact .g-rail-tab {
  flex: 1 1 0; min-width: 0; width: auto; min-height: 50px; margin: 0; padding: 4px 0 2px; border: 0; border-radius: 0; box-shadow: none; transform: none !important;
  background: transparent !important; pointer-events: auto;
}
.g-root.g-compact .g-rail-tab.is-on { background: rgba(176,141,87,.22) !important; box-shadow: inset 0 2px 0 var(--brass-hi); }
.g-root.g-compact .g-rail-tab img, .g-root.g-compact .g-rail-tab svg { width: 22px; height: 22px; }
.g-root.g-compact .g-rail-label { display: block; font-size: .58rem; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.g-root.g-compact .g-rail-badge { top: 2px; bottom: auto; left: auto; right: 14%; transform: none; min-width: 18px; height: 18px; font-size: .66rem; }
.g-root.g-compact.g-portrait .g-bottom { left: 0; right: 0; bottom: var(--g-tab-h); align-items: stretch; }
.g-root.g-compact.g-portrait .g-drawer { inset: 0 0 var(--g-tab-h) 0; width: auto; border-radius: 0; z-index: calc(var(--z-hud) + 2); animation: rise-in .22s var(--ease) both; }
.g-root.g-compact.g-portrait .g-drawer-head { padding-top: calc(6px + env(safe-area-inset-top)); }
.g-root.g-compact .g-sheet-grip { display: none; }
.g-root.g-compact.g-portrait .g-sheet-grip { display: block; position: absolute; left: 50%; top: calc(4px + env(safe-area-inset-top)); width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(60,40,20,.3); }
.g-root.g-compact .g-drawer-head { position: relative; }
.g-root.g-compact .g-drawer-body { padding: 8px 12px 14px; }
.g-root.g-compact.g-portrait .g-income { left: 0; right: 0; bottom: var(--g-tab-h); top: auto; transform: none; width: auto; max-height: calc(100% - var(--g-top-h) - var(--g-tab-h) - 8px); border-radius: 14px 14px 0 0; z-index: calc(var(--z-hud) + 2); animation: none; padding: 12px 14px; }
.g-root.g-compact.g-portrait .g-bottom.is-inert { visibility: hidden; }

/* ---- landscape: board left, a control column on the right ---- */
.g-root.g-compact.g-landscape { --g-col: clamp(250px, 35vw, 330px); --g-colw: calc(var(--g-col) + env(safe-area-inset-right)); --g-top-h: calc(48px + env(safe-area-inset-top)); --g-rail-h: 46px; }
.g-root.g-compact.g-landscape .g-map { right: var(--g-colw); left: 0; width: auto; }
.g-root.g-compact.g-landscape .g-top { left: auto; right: 0; width: var(--g-colw); padding-left: 6px; padding-right: max(6px, env(safe-area-inset-right)); }
.g-root.g-compact.g-landscape .g-rail {
  top: var(--g-top-h); right: 0; left: auto; bottom: auto; width: var(--g-colw); height: var(--g-rail-h); flex-direction: row; gap: 0;
  padding: 0 env(safe-area-inset-right) 0 0; background: #1c130d; border-bottom: 1px solid rgba(176,141,87,.35); z-index: calc(var(--z-hud) + 1);
}
.g-root.g-compact.g-landscape .g-rail-tab { min-height: 46px; padding: 3px 0 1px; }
.g-root.g-compact.g-landscape .g-rail-label { font-size: .52rem; }
.g-root.g-compact.g-landscape .g-bottom {
  left: auto; right: 0; width: var(--g-colw); top: calc(var(--g-top-h) + var(--g-rail-h)); bottom: 0; align-items: stretch; justify-content: flex-end;
  background: #241810; padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom);
}
.g-root.g-compact.g-landscape .g-dock--compact { max-height: 100%; border-radius: 0; box-shadow: none; border: 0; border-top: 1px solid rgba(176,141,87,.35); display: flex; flex-direction: column; }
.g-root.g-compact.g-landscape .g-dock--compact .g-dock-tray { order: 3; margin: 6px 0 0; }
.g-root.g-compact.g-landscape .g-cbar { flex-wrap: wrap; }
.g-root.g-compact.g-landscape .g-cprompt { white-space: normal; flex-basis: calc(100% - 50px); font-size: .9rem; }
.g-root.g-compact.g-landscape .g-dock--compact .g-primary { max-width: none; flex: 1 1 100%; }
.g-root.g-compact.g-landscape .g-dock--compact .g-tray--buy { flex-wrap: wrap; overflow: visible; }
.g-root.g-compact.g-landscape .g-dock--compact .g-tools { flex-wrap: wrap; }
.g-root.g-compact.g-landscape .g-drawer { top: 0; bottom: 0; right: 0; left: auto; width: var(--g-colw); border-radius: 0; z-index: calc(var(--z-hud) + 2); padding-right: env(safe-area-inset-right); animation: g-slide-in .2s var(--ease) both; }
.g-root.g-compact.g-landscape .g-income { left: auto; right: 0; top: 0; bottom: 0; transform: none; width: var(--g-colw); max-height: none; border-radius: 0; z-index: calc(var(--z-hud) + 2); animation: none; padding: 10px 12px; }
.g-root.g-compact.g-landscape .g-toasts { left: max(8px, env(safe-area-inset-left)); right: calc(var(--g-colw) + 8px); top: 8px; }
.g-root.g-compact.g-landscape .g-ticker { left: calc((100% - var(--g-colw)) / 2); top: 8px; }
.g-root.g-compact.g-landscape .g-banner { left: calc((100% - var(--g-colw)) / 2); top: 18%; width: min(440px, calc(100% - var(--g-colw) - 24px)); }
.g-root.g-compact.g-landscape .g-dossier { left: 8px !important; top: 8px !important; max-height: calc(100% - 16px); }
.g-root.g-compact .g-over { padding: 14px; }
.g-root.g-compact .g-over-crest img { width: 48px; height: 48px; }
.g-root.g-compact .g-dossier { position: fixed; left: 8px !important; right: 8px; top: calc(var(--g-top-h) + 6px) !important; width: auto; max-height: calc(100dvh - var(--g-top-h) - 80px); }
/* voice control: one small button in the compact top bar */
body:has(.g-root.g-compact) .vc-dock { top: calc(env(safe-area-inset-top) + 3px) !important; left: auto !important; right: calc(env(safe-area-inset-right) + 4px) !important; z-index: calc(var(--z-hud) + 3); }
body:has(.g-root.g-compact) .vc-dock .vc-join__label { display: none; }
.g-pickrow { display: flex; gap: 8px; flex-wrap: wrap; }
.g-pick { flex: 1 1 150px; display: grid; gap: 2px; font: .75rem var(--font-caps); letter-spacing: .04em; color: var(--brass-hi); }
.g-pick select { min-height: 42px; width: 100%; border-radius: 8px; padding: 4px 8px; color: var(--parchment-hi); background: rgba(0,0,0,.35); border: 1px solid rgba(176,141,87,.6); font: 16px var(--font-body); }
/* compact dock: the bar always shows; the contextual part scrolls */
.g-root.g-compact .g-dock--compact { display: flex; flex-direction: column; overflow: hidden; }
.g-root.g-compact .g-dock--compact .g-dock-tray { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.g-root.g-compact .g-cbar, .g-root.g-compact .g-csec { flex: none; }
.g-root.g-compact .g-csec .btn { min-height: 40px; font-size: .78rem; padding: 0 .7em; }
/* battle / occupy: the tab bar steps aside so the board keeps its share */
.g-root.g-compact.g-portrait.has-sheet .g-rail { display: none; }
.g-root.g-compact.g-portrait.has-sheet .g-bottom { bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
.g-dock--compact .g-bt-side span { font-size: .78rem; }
.g-dock--compact .g-bt-side b { font-size: .85rem; }
.g-dock--compact .g-bt-win br, .g-dock--compact .g-bt-win b { display: none; }
.g-dock--compact .g-dice-pick > span { display: none; }
.g-dock--compact .g-dice-opt { width: 40px; height: 40px; }
.g-dock--compact .g-blitz { min-width: 0; flex: 1 1 160px; grid-template-columns: 1fr auto; }
.g-dock--compact .g-blitz .g-range { grid-template-columns: 1fr auto; }
.g-dock--compact .g-blitz .g-range-label { display: none; }
.g-dock--compact .g-blitz .btn { min-height: 42px; }
.g-dock--compact .g-bt-odds { display: flex; align-items: center; }
.g-root.g-compact.g-portrait .g-income { max-height: 46dvh; overflow-y: auto; }
.g-root.g-compact .g-inc-head p, .g-root.g-compact .g-inc-head img { display: none; }
.g-root.g-compact .g-inc-head h2 { font-size: 1.05rem; }
.g-root.g-compact .g-income .g-ltable th, .g-root.g-compact .g-income .g-ltable td { height: 26px; padding: 2px 6px; font-size: .88rem; }
.g-root.g-compact .g-inc-cash { margin: 6px 0 2px; font-size: .92rem; }
.g-root.g-compact .g-inc-acts { margin-top: 8px; position: sticky; bottom: 0; }
.g-root.g-compact .g-banner-ribbon { padding: 6px 28px 7px; }
.g-root.g-compact .g-banner-ribbon h2 { font-size: 1.05rem; }
.g-root.g-compact .g-banner-sub { font-size: .85rem; }
@media (max-height: 600px) {
  .g-root.g-compact.g-portrait { --g-top-h: calc(46px + env(safe-area-inset-top)); --g-tab-h: calc(44px + env(safe-area-inset-bottom)); }
  .g-root.g-compact.g-portrait .g-rail-label { display: none; }
  .g-root.g-compact.g-portrait .g-rail-tab { min-height: 44px; }
  .g-root.g-compact .g-dock--compact .g-tool { min-height: 40px; padding: 2px 8px 2px 4px; }
  .g-root.g-compact .g-dock--compact .g-tools--3 .g-tool-name { font-size: .75rem; }
  .g-root.g-compact .g-pick select { min-height: 40px; }
  .g-root.g-compact .g-pick > span { display: none; }
  .g-root.g-compact .g-cbar { min-height: 44px; }
  .g-root.g-compact .g-dock--compact .g-primary { min-height: 44px; }
}

/* Compact screens: the voice button sits at the right end of the top bar, so the bar keeps that corner clear. */
body:has(.vc-dock) .g-root.g-compact .g-top { padding-right: calc(env(safe-area-inset-right) + 58px); }
/* during my turn, region plaques must not swallow clicks meant for the territories under them */
.g-root.is-myturn .g-map .mv-plaque { pointer-events: none; }

/* ---------- player strip: even boxes, short names, whose turn ---------- */
.g-ptabs { gap: 14px; padding-top: 10px; margin-top: -10px; }
.g-ptab { flex: 1 1 0; min-width: 120px; max-width: 250px; container-type: inline-size; }
.g-ptab + .g-ptab::before {
  content: "›"; position: absolute; left: -12px; top: 18px; width: 10px; text-align: center; pointer-events: none;
  font: 700 1rem/1 var(--font-num); color: var(--brass-hi); opacity: .7;
}
.g-ptab-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; }
.g-ptab-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-ptab-rank { flex: none; display: none; font: .62rem var(--font-caps); letter-spacing: .06em; opacity: .7; }
@container (min-width: 190px) { .g-ptab-rank { display: inline; } }
.g-ptab-body { min-width: 0; }
.g-ptab-stats { min-width: 0; overflow: hidden; }
@container (max-width: 150px) { .g-ptab-stats > span:nth-child(2) { display: none; } }
.g-ptab-flag {
  position: absolute; z-index: 2; left: 50%; top: -9px; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  padding: 1px 8px 2px; border-radius: 0 0 6px 6px; font: .66rem/1.2 var(--font-caps); letter-spacing: .06em;
  color: #fff8e8; background: var(--pat, none), var(--c); border: 1px solid rgba(255,240,200,.7); box-shadow: 0 2px 4px rgba(0,0,0,.5);
  text-shadow: 0 1px 1px rgba(0,0,0,.6);
}
.g-ptab-flag b { font-weight: 700; text-transform: uppercase; }
.g-ptab.is-active .g-ptab-btn {
  border-color: var(--c); border-top-width: 6px; transform: translateY(5px);
  box-shadow: 0 0 0 2px var(--c), 0 0 16px color-mix(in srgb, var(--c) 70%, transparent), 0 6px 12px rgba(0,0,0,.5);
  animation: g-turn-pulse 2.4s ease-in-out infinite;
}
@keyframes g-turn-pulse { 50% { box-shadow: 0 0 0 2px var(--c), 0 0 26px color-mix(in srgb, var(--c) 85%, transparent), 0 6px 12px rgba(0,0,0,.5); } }
@media (prefers-reduced-motion: reduce) { .g-ptab.is-active .g-ptab-btn { animation: none; } }
.g-ptab.is-out .g-ptab-nm { text-decoration: line-through; }
.g-ptab-outflag { position: absolute; z-index: 2; left: 4px; top: 2px; width: 22px; height: 22px; filter: grayscale(1) drop-shadow(0 1px 1px #000); }
.g-root.g-compact .g-ptab { flex: none; min-width: 0; max-width: none; }
.g-root.g-compact .g-ptabs { gap: 10px; padding-top: 8px; }
.g-root.g-compact .g-ptab + .g-ptab::before { left: -9px; top: 14px; }
.g-root.g-compact .g-ptab-flag { top: -7px; font-size: .55rem; padding: 0 5px; }
.g-root.g-compact .g-ptab.is-active .g-ptab-btn { transform: none; }

/* ---------- opening roll ---------- */
.g-or-back { position: absolute; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 12px; background: rgba(10,6,3,.66); animation: fade-in .2s both; }
.g-or { width: min(680px, 100%); max-height: calc(100% - 24px); overflow: auto; text-align: center; }
.g-or h2 { font-size: 1.6rem; color: var(--oxblood); margin-bottom: 4px; }
.g-or-round { margin: 10px 0 0; }
.g-or-retry { margin: 6px 0; font-style: italic; color: var(--oxblood); }
.g-or-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.g-or-p { display: grid; justify-items: center; gap: 4px; width: 96px; padding: 8px 4px; border-radius: 10px; border: 1px solid rgba(122,95,53,.35); border-top: 4px solid var(--c); background: rgba(255,250,235,.5); }
.g-or-p.is-top { box-shadow: 0 0 0 2px var(--gold); background: rgba(201,162,39,.22); }
.g-or-name { font-size: .85rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-or-die { width: 42px; height: 42px; padding: 6px; border-radius: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #f4e9cd; color: var(--oxblood); border: 1px solid var(--brass-lo); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 2px 4px rgba(0,0,0,.4); }
.g-or-die i { border-radius: 50%; }
.g-or-die i.on { background: currentColor; }
.g-or-die.is-landed, .g-or-p.is-landed .g-or-die { animation: g-roll .45s var(--ease) both; }
.g-or-die.is-rolling { animation: g-or-tumble .35s linear infinite; }
.g-or-die.is-wait { background: rgba(43,33,24,.12); box-shadow: none; border-style: dashed; }
@keyframes g-or-tumble { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-6px); } 100% { transform: rotate(360deg) translateY(0); } }
.g-or-result { display: flex; align-items: center; gap: 14px; margin-top: 12px; text-align: left; }
.g-or-result p { margin: 0; font-size: 1.02rem; }
.g-or-ring { width: 160px; height: 160px; flex: none; }
.g-or-table { fill: rgba(122,95,53,.12); stroke: rgba(122,95,53,.5); stroke-dasharray: 3 4; }
.g-or-arc { fill: none; stroke: #7b2d26; stroke-width: 2; opacity: .8; }
.g-or-init { font: 700 9px var(--font-display); fill: #fff8e8; }
.g-or-tag { font: 700 9px var(--font-caps); fill: var(--oxblood); }
.g-or-acts { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.g-or.is-brief h2 { font-size: 1.3rem; }
@media (max-width: 560px) {
  .g-or-p { width: 78px; }
  .g-or-die { width: 34px; height: 34px; padding: 5px; }
  .g-or-result { flex-direction: column; text-align: center; }
  .g-or-ring { width: 140px; height: 140px; }
}
@media (prefers-reduced-motion: reduce) { .g-or-die.is-rolling { animation: none; } }
.g-ptab.is-active .g-ptab-btn { padding-top: 12px; }
.g-root.g-compact .g-ptab.is-active .g-ptab-btn { padding-top: 6px; }
.g-ptab { min-width: 100px; }
@container (max-width: 160px) {
  .g-ptab-btn { column-gap: 6px; padding-left: 5px; padding-right: 6px; }
  .g-ptab-medal { width: 34px; height: 34px; }
  .g-ptab-medal .g-medal { width: 30px !important; height: 30px !important; }
  .g-ptab-name { font-size: .88rem; letter-spacing: .01em; }
  .g-ptab-stats > span:not(.g-ptab-cash) { display: none; }
  .g-ptab-flag { font-size: .56rem; padding: 0 5px; }
}
@media (max-width: 1180px) { .g-pace-sel { display: none; } }
.g-root.g-compact .g-ptab { container-type: normal; }
.g-root.g-compact .g-ptab-flag { font-size: .5rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.g-root.g-compact .g-ptab-doing { display: none; }

/* =====================================================================================
   Playtest revisions (rounds 1–3)
   ===================================================================================== */
/* corner ticker for routine events: bottom-left, never over the board centre */
.g-root .g-ticker {
  left: 12px; right: auto; top: auto; bottom: 150px; transform: none; max-width: min(320px, 30vw); margin: 0; padding: 0;
  list-style: none; background: none; border: 0; display: grid; gap: 4px; text-align: left; font-size: .88rem; animation: none;
}
.g-root .g-ticker li { padding: 4px 10px; border-radius: 10px; background: rgba(28,19,13,.88); border: 1px solid rgba(176,141,87,.5); color: var(--parchment-hi); animation: fade-in .2s both; font-style: italic; }
.g-root.g-compact .g-ticker { left: 8px; right: 8px; top: calc(var(--g-top-h) + 6px); bottom: auto; max-width: none; transform: none; font-size: .8rem; }
.g-root.g-compact.g-landscape .g-ticker { right: calc(var(--g-colw) + 8px); }
/* banners sit high when the battle sheet is up */
.g-root.has-sheet .g-banner, .g-root[data-phase="attack"] .g-banner, .g-root[data-phase="occupy"] .g-banner { top: calc(var(--g-top-h) + 24px); }

/* peek chip: one line on why nothing happened */
.g-peek {
  position: absolute; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); bottom: 170px; max-width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; font-size: .92rem;
  color: var(--ink); background: var(--parchment-hi) var(--g-paper) center / 400px; border: 1px solid var(--brass-lo); box-shadow: 0 4px 12px rgba(0,0,0,.45);
  animation: rise-in .18s var(--ease) both;
}
.g-peek .btn--ghost { color: var(--ink); }
.g-root.g-compact .g-peek { bottom: calc(var(--g-tab-h, 0px) + 120px); font-size: .82rem; }
.g-root.g-compact.g-landscape .g-peek { left: calc((100% - var(--g-colw)) / 2); bottom: 10px; }

/* step-through Next */
.g-stepnext { position: absolute; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); top: calc(var(--g-top-h) + 14px); min-height: 48px; }
.g-stepbtn { min-height: 36px; }
.g-stepbtn.is-on { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--ink); }

/* first-use hints, shortfall, list link */
.g-hint { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; padding: 3px 4px 3px 10px; border-radius: 8px; font-size: .85rem; background: rgba(31,58,77,.12); border-left: 3px solid var(--navy); }
.g-dock--compact .g-hint { color: var(--parchment-hi); background: rgba(255,255,255,.08); border-left-color: var(--brass-hi); margin: 0 0 6px; font-size: .78rem; }
.g-hint .g-x { width: 32px; height: 32px; font-size: 18px; flex: none; margin-left: auto; }
.g-short { color: var(--oxblood-hi); font-weight: 600; }
.g-picklink { font-size: .85rem; margin-top: 2px; display: inline-block; }
.g-dock--compact .g-picklink { color: var(--brass-hi); font-size: .78rem; }
.g-cprompt-wrap { flex: 1; min-width: 0; display: grid; }
/* the compact prompt wraps to two lines instead of an ellipsis */
.g-root.g-compact .g-cprompt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; font-size: .9rem; }
.g-root.g-compact .g-dock--compact.is-expanded .g-cprompt { -webkit-line-clamp: unset; display: block; }
/* stepper first, always visible in the purchase row */
.g-dock--compact .g-tray--buy .g-buyrow { order: -1; }
.g-dock--compact .g-tray--buy { flex-wrap: wrap; }
.g-dock--compact .g-tray--buy .g-tools { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
/* end turn / secondary actions wrap rather than scroll out of view */
.g-root.g-compact .g-csec { flex-wrap: wrap; overflow: visible; }

/* income card: non-modal, never covers the panels; folds into a one-line bar */
.g-root.has-panel:not(.g-compact) .g-income { left: 24px; transform: none; }
.g-inc-bar {
  position: absolute; z-index: calc(var(--z-panel) + 3); left: 50%; transform: translateX(-50%); bottom: 236px; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 14px; border-radius: 22px;
}
.g-root.g-compact .g-inc-bar { bottom: calc(var(--g-tab-h, 0px) + 8px); left: 8px; right: 8px; transform: none; }
.g-root.g-compact.g-landscape .g-inc-bar { left: 8px; right: calc(var(--g-colw) + 8px); bottom: 8px; }
.g-inc-bar-open { background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink); min-height: 40px; }
.g-inc-letters { min-height: 40px; padding: 0 10px; border-radius: 20px; cursor: pointer; background: var(--oxblood); color: var(--parchment-hi); border: 1px solid #c9796f; font-weight: 600; }
.g-inc-min { margin-left: 4px; }
.g-inc-other { margin: 8px 0 0; padding: 6px 10px; border-radius: 6px; background: rgba(63,125,78,.12); font-size: .92rem; }
.g-inc-other p { margin: 0; }
.g-inc-other ul { margin: 4px 0 0; padding-left: 18px; }
/* voice button never sits on the income title on phones */
.g-root.g-compact .g-inc-head { padding-right: 52px; }

/* game over / out: the stats table scrolls inside itself with a sticky first column */
.g-over-tablewrap { max-width: 100%; max-height: 46vh; overflow: auto; border: 1px solid rgba(122,95,53,.3); border-radius: 6px; }
.g-over-table { width: max-content; min-width: 100%; }
.g-over-table thead th { position: sticky; top: 0; z-index: 1; background: var(--parchment-hi); }
.g-over-table tbody th, .g-over-table thead th:first-child { position: sticky; left: 0; z-index: 2; background: var(--parchment-hi); box-shadow: 1px 0 0 rgba(122,95,53,.3); }
.g-over-table tr.is-winner th { background: #efe0a8; }

/* compact strip: me + the active player in full, others as small markers with status dots */
.g-root.g-compact .g-ptab.is-mini .g-ptab-btn { min-height: 44px; min-width: 40px; padding: 4px 3px; display: grid; place-items: center; }
.g-root.g-compact .g-ptab.is-mini .g-medal { width: 28px !important; height: 28px !important; }
.g-mini-dots { position: absolute; right: 1px; bottom: 2px; display: flex; gap: 2px; }
.g-mini-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid #000; }
.g-mini-dots .d-away { background: #9a9ea6; }
.g-mini-dots .d-broken { background: var(--oxblood-hi); border-radius: 1px; transform: rotate(45deg); }
.g-mini-dots .d-out { background: #3b3f46; }
.g-strip-more { flex: none; min-width: 40px; min-height: 40px; align-self: center; border-radius: 20px; cursor: pointer; font: 600 .8rem var(--font-num); color: var(--parchment-hi); background: rgba(0,0,0,.35); border: 1px solid rgba(176,141,87,.6); }
.g-root:not(.g-compact) .g-strip-more { display: none; }
.g-dos-cash { margin: 0 0 4px; flex-basis: 100%; }
/* token shape on every medal (matches the board; colour is never the only cue) */
.g-medal .g-shape { position: absolute; left: -2px; top: -2px; width: 40%; height: 40%; min-width: 9px; min-height: 9px; fill: var(--c); stroke: #fff8e8; stroke-width: 1.2; filter: drop-shadow(0 0 1px #000); }
.g-medal { overflow: visible; }
.g-medal--portrait { overflow: visible; }
.g-medal--portrait img { border-radius: 50%; }
.g-root.g-compact .g-cprompt { max-height: 2.45em; }
.g-root.g-compact .g-keys { display: none; } .g-keys { flex: none; align-self: center; min-width: 36px; min-height: 36px; }
.g-root:not(.g-compact) .g-peek { bottom: 300px; }

/* ---------- expansion modules ---------- */
.g-evchip {
  flex: none; align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; min-height: 36px; padding: 2px 10px 2px 4px;
  border-radius: 18px; font-size: .82rem; color: var(--parchment-hi); background: rgba(31,58,77,.85); border: 1px solid rgba(176,141,87,.6); cursor: help;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g-evchip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.g-root.g-compact .g-evchip { max-width: 44px; padding: 2px; }
.g-root.g-compact .g-evchip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.g-rcard {
  position: absolute; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); top: calc(var(--g-top-h) + 10px); width: min(420px, calc(100% - 24px));
  display: flex; gap: 10px; padding: 8px; border-radius: 10px; color: var(--ink);
  background: var(--parchment-hi) var(--g-paper) center / 400px; border: 1px solid var(--brass-lo); box-shadow: 0 6px 16px rgba(0,0,0,.45); animation: rise-in .25s var(--ease) both;
}
.g-rcard--fortune { border-left: 5px solid var(--oxblood); }
.g-rcard--event { border-left: 5px solid var(--navy); }
.g-rcard-art { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; flex: none; }
.g-rcard-body { flex: 1; min-width: 0; }
.g-rcard-body small { font: .72rem var(--font-caps); letter-spacing: .06em; color: var(--ink-faint); }
.g-rcard-body h3 { margin: 0; font-size: 1.1rem; color: var(--oxblood); }
.g-rcard-body p { margin: 2px 0 0; font-size: .9rem; }
.g-rcard-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.g-root.g-compact .g-rcard { top: calc(var(--g-top-h) + 44px); }
.g-root.g-compact .g-rcard-art { width: 56px; height: 56px; }
.g-root.g-compact.g-landscape .g-rcard { left: calc((100% - var(--g-colw)) / 2); top: 8px; }
.g-badge--goods { background: #e6e0c6; color: #5a4a1a; }
.g-badge--upkeep { background: var(--oxblood); color: var(--parchment-hi); border-color: #c9796f; }
.g-dos-mods span { margin-right: 10px; }
.g-inc-mods { margin-top: 6px; }
.g-inc-mods th { font-size: .9rem; }
.g-or-bonus { margin: 8px 0 0; font-size: .92rem; }
.g-payopt, .g-dock--compact .g-payopt { width: auto; min-width: 56px; padding: 0 10px; font-size: .95rem; white-space: nowrap; flex: none; }

/* The game shows the round event in its own top-bar chip; the board chip would duplicate it. */
.mv-event-chip { display: none !important; }
