/**
 * One dark surface, one accent, three weights of text.
 *
 * Dark plates over the canvas, with enough fill and edge on tabs and buttons
 * that they read as controls. Saturated colour still belongs to the data —
 * resource swatches, building chips and flags. The build tree and the wallet
 * sit heaviest because that is where the game is played.
 *
 * Nothing here animates a property that costs layout. Panels do not blur what is
 * behind them either: the canvas repaints constantly, and a backdrop filter over
 * it re-composites on every one of those frames.
 */

:root {
  --bg: #080b12;
  --surface: rgba(28, 37, 51, 0.92);
  --surface-solid: #1c2533;
  --raise: rgba(36, 48, 68, 0.95);
  --raise-strong: rgba(61, 77, 102, 0.55);
  --line: rgba(139, 155, 176, 0.28);
  --line-strong: rgba(183, 196, 216, 0.42);

  --text: #eef3fb;
  --text-dim: #b7c4d8;
  --muted: #8b9bb0;

  --accent: #6aa6ff;
  --accent-soft: rgba(106, 166, 255, 0.22);
  --good: #6fae63;
  --warn: #d9bd54;
  --bad: #e2685f;

  --t-micro: 9px;
  --t-small: 10px;
  --t-body: 11px;
  --t-mid: 12px;
  --t-lead: 13px;
  --t-name: 15px;
  --t-head: 19px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 18px;
  --s5: 26px;

  --r1: 6px;
  --r2: 10px;
  --r3: 14px;

  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Mono', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-mid);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  overscroll-behavior: none;
  touch-action: none;
}

/* Class-level display rules would otherwise beat the UA rule for [hidden]. */
.modal[hidden],
#modal-crowns[hidden],
#modal-rename[hidden],
.objective[hidden],
.targeting[hidden],
.tip[hidden],
.build-tip[hidden],
.toast[hidden],
.panel[hidden],
.console[hidden],
.host__tab[hidden],
.me-pane[hidden],
#coach[hidden],
#intro[hidden],
#paid[hidden],
.pin[hidden],
.save-cta[hidden] {
  display: none;
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  cursor: crosshair;
}

body[data-cursor='grab'] #stage {
  cursor: grab;
}
body[data-cursor='grabbing'] #stage {
  cursor: grabbing;
}
body[data-cursor='build'] #stage {
  cursor: copy;
}
body[data-cursor='remove'] #stage {
  cursor: not-allowed;
}
body[data-cursor='aim'] #stage {
  cursor: crosshair;
}

/* The UI layer is inert so the canvas keeps every stray pointer event, and only
   the surfaces a player can actually press opt back in. Naming them one by one
   rather than reviving every child is what keeps the cursor-following tip and
   the control strip from stealing hover away from the map. */
#ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'top top'
    'left .'
    'left bottom';
  padding: 0;
  gap: 0;
}

.bar,
.panel,
.dock__build,
.dock__tools,
.modal,
.hotbar,
.sidenav,
.console,
.pin {
  pointer-events: auto;
}

/* ------------------------------------------------------------- shared bits */

.panel__title {
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel__title--spaced {
  margin-top: var(--s4);
}

.panel__hint {
  margin-top: var(--s2);
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}

.swatch,
.store__swatch,
.tier__chip,
.cost__chip,
.tally__chip,
.sheet__chip,
.piece__chip {
  display: inline-block;
  flex: none;
  background: var(--chip, #8a8a8a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
}

.ghost,
.primary,
.icon,
.chain,
.tab,
.tier,
.piece,
.identity,
.crowns,
.season,
.row__go,
.stand__head,
.stand__member,
.console__filter,
.opt,
.swatch {
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.ghost {
  font-size: var(--t-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--raise);
  border-radius: var(--r1);
  padding: 7px 12px;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.ghost:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--raise-strong);
}

.ghost[data-active='true'] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ghost--icon {
  padding: 5px 10px;
  font-size: var(--t-mid);
  letter-spacing: 0;
}

.primary {
  font-size: var(--t-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: var(--r1);
  padding: 8px 14px;
  color: #f4f8ff;
  border-color: rgba(106, 166, 255, 0.75);
  background: linear-gradient(180deg, rgba(106, 166, 255, 0.42), rgba(77, 141, 255, 0.22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.primary:hover {
  background: linear-gradient(180deg, rgba(106, 166, 255, 0.55), rgba(77, 141, 255, 0.32));
  border-color: #9cc4ff;
}

/* Disabled buttons still say what they would do, so they keep their label and
   only lose their affordance. */
.ghost:disabled,
.ghost:disabled:hover,
.primary:disabled,
.primary:disabled:hover {
  opacity: 0.38;
  cursor: not-allowed;
  color: var(--text-dim);
  border-color: var(--line);
  background: transparent;
}

.icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--r1);
  border-color: var(--line);
  background: var(--raise);
  color: var(--text-dim);
  font-size: var(--t-mid);
  line-height: 1;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.icon:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: var(--raise-strong);
}

kbd {
  font-family: var(--mono);
  font-size: var(--t-small);
  padding: 1px 5px;
  border-radius: var(--r1);
  border: 1px solid var(--line-strong);
  background: var(--raise);
  color: var(--text);
}

.badge {
  justify-self: start;
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ----------------------------------------------------------------- top bar */

.bar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 3px 8px;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bar__clock {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.bar__you {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-left: auto;
  min-width: 0;
}

.identity {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 148px;
  padding: 4px 8px;
  border-radius: var(--r1);
  border: 1px solid var(--line-strong);
  background: var(--raise);
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.identity:hover {
  background: var(--raise-strong);
  border-color: var(--accent);
}

.identity__flag {
  display: block;
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.identity__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--t-body);
  font-weight: 620;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.identity__team {
  flex: none;
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.identity__team:empty {
  display: none;
}

.ghost--bar {
  padding: 5px 9px;
}

/* Resource stores — a vertical list, every resource always present. */

.wallet {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  min-width: 0;
}

.wallet__group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wallet__label {
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 2px 2px;
}

.store {
  appearance: none;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 8px;
  row-gap: 1px;
  width: 100%;
  margin: 0;
  padding: 6px 7px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--raise);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.12s ease, border-color 0.12s ease;
}

.store:hover {
  background: var(--raise-strong);
  border-color: var(--line-strong);
}

.store:has(.store__swatch--art) {
  grid-template-columns: 18px minmax(0, 1fr);
}

.store[data-idle='true'] {
  opacity: 0.38;
}

.store[data-idle='true']:hover {
  opacity: 0.72;
}

.store__swatch {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
  width: 8px;
  min-height: 28px;
  border-radius: 2px;
  margin-top: 2px;
}

.store__swatch--art {
  width: 18px;
  height: 18px;
  min-height: 18px;
  align-self: center;
  object-fit: contain;
  background: none;
  box-shadow: none;
  margin-top: 0;
}

.store__head,
.store__row,
.store__bar {
  grid-column: 2;
}

.store__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.store__name {
  font-size: var(--t-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.store__rate {
  font-family: var(--mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  line-height: 1.1;
}

.store__rate[data-sign='up'] {
  color: var(--good);
}

.store__rate[data-sign='down'] {
  color: var(--bad);
}

.store__rate[data-sign='full'],
.store[data-full='true'] .store__held {
  color: #e8b86a;
}

.store__row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.store__held {
  font-family: var(--mono);
  font-size: var(--t-lead);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.store__cap {
  font-family: var(--mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.store__bar {
  display: block;
  height: 3px;
  margin-top: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.store__bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: 999px;
  background: var(--store, var(--accent));
}

/* Crowns and the season clock

   Neither is a resource, so neither takes the wallet's treatment: Crowns are
   gold on their own plate rather than a coin in the row, and the countdown is
   the only piece of chrome in the bar allowed a boxed background. Getting this
   wrong would make a cosmetic currency read as something you build with. */

.crowns {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  flex: none;
  padding: 6px 8px;
  border-radius: var(--r1);
  border-color: rgba(255, 212, 121, 0.24);
  background: rgba(255, 212, 121, 0.07);
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.2s ease;
}

.crowns--bar {
  width: auto;
  gap: 4px;
  padding: 2px 7px;
}

.crowns--bar .crowns__amount {
  font-size: var(--t-mid);
}

.crowns:hover {
  border-color: rgba(255, 212, 121, 0.5);
  background: rgba(255, 212, 121, 0.12);
}

.crowns[data-idle='true'] {
  opacity: 0.6;
}

.crowns__mark {
  font-size: var(--t-small);
  line-height: 1;
  color: #ffd479;
}

.crowns__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.crowns__name {
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 212, 121, 0.7);
  line-height: 1;
}

.crowns__amount {
  font-family: var(--mono);
  font-size: var(--t-lead);
  font-variant-numeric: tabular-nums;
  color: #ffe4a6;
  line-height: 1.1;
}

.crowns__info {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 8px;
  font-style: italic;
  color: var(--muted);
}

.season {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: none;
  min-width: 148px;
  padding: 3px 8px 4px;
  border-radius: var(--r1);
  border-color: var(--line);
  background: var(--raise);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.season:hover,
.season[data-active='true'] {
  border-color: var(--line-strong);
  background: var(--raise-strong);
}

.season__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}

.season__label {
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.season__time {
  font-family: var(--mono);
  font-size: var(--t-lead);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
}

.season__bar {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.season__bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #8f6fe0);
}

/* The last hour is the only hour anyone changes their plans in. */
.season[data-state='urgent'] {
  border-color: rgba(226, 96, 60, 0.55);
  background: rgba(226, 96, 60, 0.1);
}

.season[data-state='urgent'] .season__time {
  color: #ffb0a0;
}

.season[data-state='urgent'] .season__label {
  color: rgba(255, 176, 160, 0.8);
}

.season[data-state='urgent'] .season__bar span {
  background: linear-gradient(90deg, var(--warn), var(--bad));
}

.season[data-state='over'] .season__time {
  font-family: var(--font);
  font-size: var(--t-body);
  color: var(--warn);
}

.season[data-state='unknown'] .season__time {
  color: var(--muted);
}

.bar__tools {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
}

.unit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: var(--s2);
  border-right: 1px solid var(--line);
}

.unit__label {
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.unit__select {
  font-family: var(--font);
  font-size: var(--t-body);
  color: var(--text);
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 4px 6px;
  cursor: pointer;
}

.unit__select:hover {
  border-color: var(--line-strong);
}

.unit__select option {
  background: var(--surface-solid);
}

.tick {
  display: flex;
}

.tick__track {
  fill: none;
  stroke: rgba(140, 175, 230, 0.18);
  stroke-width: 3;
}

.tick__fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  stroke-dasharray: 81.68;
}

.pill {
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill--good {
  color: var(--good);
  border-color: rgba(86, 196, 107, 0.35);
  background: rgba(86, 196, 107, 0.08);
}
.pill--warn {
  color: var(--warn);
  border-color: rgba(223, 166, 63, 0.35);
  background: rgba(223, 166, 63, 0.08);
}
.pill--bad {
  color: var(--bad);
  border-color: rgba(226, 96, 60, 0.4);
  background: rgba(226, 96, 60, 0.08);
}

/* ------------------------------------------------------------- side panels */

.sidenav {
  grid-area: left;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 268px;
  min-height: 0;
  background: rgba(10, 13, 20, 0.97);
  border: none;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.sidenav__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: none;
  padding: 8px 8px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.sidenav__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 8px 10px;
}

.save-cta {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r2);
  border: 1px solid rgba(255, 212, 121, 0.48);
  background: linear-gradient(180deg, rgba(255, 212, 121, 0.2), rgba(210, 140, 40, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.22),
    0 0 20px rgba(255, 196, 90, 0.14);
  color: #ffe7a8;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.save-cta:hover {
  border-color: rgba(255, 212, 121, 0.8);
  background: linear-gradient(180deg, rgba(255, 212, 121, 0.3), rgba(210, 140, 40, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.3),
    0 0 26px rgba(255, 196, 90, 0.22);
}

.save-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 28%,
    rgba(255, 255, 255, 0.16) 48%,
    transparent 64%
  );
  transform: translateX(-130%);
  animation: sheen 5.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sheen {
  0%,
  58% {
    transform: translateX(-130%);
  }
  78%,
  100% {
    transform: translateX(130%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-cta::after {
    animation: none;
  }
}

.save-cta__mark {
  flex: none;
  font-size: 13px;
  line-height: 1;
  color: #ffd479;
}

.save-cta__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.save-cta__title {
  font-size: var(--t-small);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.save-cta__sub {
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: #c9b07a;
}

.save-cta--bar {
  width: auto;
  gap: 0;
  padding: 3px 8px;
  border-radius: var(--r1);
  font-size: var(--t-small);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.base {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

.base__tier {
  margin-top: 4px;
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warn);
}

.base .kv {
  margin-top: var(--s2);
}

.base .progress {
  margin-top: var(--s2);
}

.panel {
  flex: none;
  width: 100%;
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.host__body {
  flex: 1;
  min-height: 0;
  margin-top: var(--s2);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.host__lead {
  font-size: var(--t-body);
  color: var(--text-dim);
  line-height: 1.5;
}

.host__lead--name {
  font-size: var(--t-name);
  font-weight: 620;
  color: var(--text);
}

.host__status {
  margin-top: var(--s3);
  font-size: var(--t-body);
  color: var(--warn);
  line-height: 1.4;
}

.host__status:empty {
  display: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.tab {
  padding: 6px 10px;
  border-radius: var(--r1);
  border-color: var(--line);
  background: var(--raise);
  font-size: var(--t-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.tab:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: var(--raise-strong);
}

.tab[data-active='true'] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(106, 166, 255, 0.28);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.read__lead {
  margin-top: var(--s2);
  font-size: var(--t-lead);
  font-weight: 600;
  line-height: 1.3;
}

.read__sub {
  margin-bottom: var(--s3);
  font-size: var(--t-body);
  color: var(--text-dim);
  line-height: 1.4;
}

.kv {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 5px var(--s2);
  margin: var(--s3) 0 0;
  font-size: var(--t-body);
}

.kv dt {
  font-size: var(--t-small);
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-size: var(--t-body);
  overflow-wrap: anywhere;
}

.progress {
  margin-top: var(--s3);
}

.progress__bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress__bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #8f6fe0);
  transition: transform 0.4s ease;
}

.progress__label {
  margin-top: 6px;
  font-size: var(--t-small);
  color: var(--muted);
}

.flow {
  list-style: none;
  margin: var(--s2) 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.flow__row {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.flow__row:hover {
  background: var(--raise);
  border-color: var(--line-strong);
}

.flow__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.flow__kind {
  display: block;
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow__amount {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.flow__empty {
  margin-top: var(--s2);
  font-size: var(--t-body);
  color: var(--muted);
  line-height: 1.5;
}

/* Neighbour rows */

.rows {
  list-style: none;
  margin: var(--s2) 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.rows__note {
  padding: var(--s2) 0;
  font-size: var(--t-body);
  color: var(--muted);
  line-height: 1.5;
}

.row {
  display: flex;
  align-items: stretch;
  gap: var(--s1);
}

.row__go {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px;
  border-radius: var(--r1);
  text-align: left;
  transition: background 0.12s ease;
}

.row__go:hover {
  background: var(--raise);
}

.row__flag {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  flex: none;
}

.row__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.row__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-body);
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row[data-me='true'] .row__name {
  color: #9dc0ff;
}

.row__tag {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
}

.row__meta {
  font-size: var(--t-small);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__dist {
  font-family: var(--mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  flex: none;
}

.row__info {
  align-self: center;
  font-family: var(--mono);
  font-style: italic;
}

.board {
  list-style: none;
  margin: var(--s2) 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
  font-size: var(--t-body);
}

.board li {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  padding: 2px 0;
  cursor: pointer;
}

.board li:hover .board__name {
  color: var(--text);
}

.board__name {
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board li[data-me='true'] .board__name {
  color: #9dc0ff;
}

.board__area {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* A row that looks like a neighbour row but does nothing when pressed. */
.row__still {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px;
}

/* Standings */

.stands {
  list-style: none;
  margin: var(--s2) 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.stand {
  display: grid;
  border-radius: var(--r1);
}

.stand[data-me='true'] {
  background: var(--accent-soft);
}

.stand__head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px 6px;
  border-radius: var(--r1);
  text-align: left;
  transition: background 0.12s ease;
}

.stand__head:hover {
  background: var(--raise);
}

.stand__rank {
  flex: none;
  min-width: 18px;
  font-family: var(--mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-align: right;
}

.stand__flag {
  display: block;
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.stand__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.stand__name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: var(--t-body);
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stand[data-me='true'] .stand__name {
  color: #9dc0ff;
}

.stand__tag {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--accent);
}

.stand__meta {
  font-size: var(--t-small);
  color: var(--muted);
}

.stand__score {
  flex: none;
  font-family: var(--mono);
  font-size: var(--t-body);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.stand__members {
  display: none;
  padding: 2px 6px 8px 26px;
}

.stand[data-open='true'] .stand__members {
  display: grid;
  gap: 2px;
}

.stand__member {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 3px 5px;
  border-radius: var(--r1);
  text-align: left;
}

.stand__member:hover {
  background: var(--raise);
}

.stand__member .stand__name {
  flex: 1;
  font-weight: 500;
  color: var(--text-dim);
}

.stand__note {
  margin-top: var(--s1);
  font-size: var(--t-small);
  color: var(--muted);
  line-height: 1.45;
}

/* Your own line, pinned under the board */

.stands__mine {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

.mine__head {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.mine__label {
  flex: 1;
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9dc0ff;
}

.stands__mine .facts {
  grid-template-columns: 88px 1fr;
  margin-top: var(--s2);
}

.plot {
  display: grid;
  gap: 8px;
  margin-top: var(--s2);
}

.plot__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.plot__canvas {
  display: block;
  width: 100%;
  height: 160px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: #080b12;
}

.plot__canvas--wide {
  height: 320px;
}

.plot__hover {
  min-height: 1.4em;
  font-size: var(--t-small);
  color: var(--text-dim);
  line-height: 1.4;
}

.plot__hover:empty {
  display: none;
}

.plot__legend {
  display: grid;
  gap: 2px;
}

.plot__swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--chip, #8a8a8a);
}

.plot__row {
  appearance: none;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 3px 4px;
  border: 0;
  border-radius: var(--r1);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.plot__row:hover {
  background: var(--raise);
}

.plot__row[data-off='true'] {
  opacity: 0.38;
}

.plot__row[data-me='true'] .plot__name {
  color: #ffe4a6;
}

.plot__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--t-body);
}

.plot__value {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--muted);
}

.plot__open {
  justify-self: start;
  padding: 3px 8px;
}

.mine__award {
  margin-top: var(--s2);
  font-size: var(--t-small);
  color: var(--warn);
}

/* The payout curve */

.payout {
  list-style: none;
  margin: var(--s2) 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.payout__row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--t-small);
}

.payout__rank {
  flex: none;
  width: 38px;
  color: var(--text-dim);
}

.payout__bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.payout__bar::after {
  content: '';
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd479, rgba(255, 212, 121, 0.35));
}

.payout__crowns {
  flex: none;
  min-width: 38px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #ffe4a6;
}

/* The floor is a sentence rather than a place, so it takes the whole width. */
.payout__row--floor {
  flex-wrap: wrap;
  margin-top: var(--s1);
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
}

.payout__row--floor .payout__rank {
  width: auto;
  flex: 1;
  color: var(--muted);
}

.payout__note {
  margin-top: var(--s2);
  font-size: var(--t-small);
  color: var(--muted);
  line-height: 1.45;
}

/* The one claim this interface has to keep. */
.promise {
  margin: var(--s3) 0 0;
  padding: var(--s2) var(--s3);
  border-left: 2px solid #ffd479;
  background: rgba(255, 212, 121, 0.07);
  border-radius: 0 var(--r1) var(--r1) 0;
  font-size: var(--t-small);
  color: var(--text-dim);
  line-height: 1.55;
}

.past {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 4px 0;
}

/* Teams */

.team {
  display: grid;
  gap: var(--s2);
}

.team + .team {
  margin-top: var(--s3);
}

.team__ident {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.team__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-lead);
  font-weight: 620;
}

.team__foot {
  display: flex;
  justify-content: flex-end;
}

.field__row {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.field {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: var(--t-body);
  color: var(--text);
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 6px 8px;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
}

.field:disabled {
  opacity: 0.4;
}

.field--tag {
  flex: none;
  width: 56px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------- the dock */

.dock {
  grid-area: bottom;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    '. targeting .'
    '. objective .'
    '. build tools'
    'hint hint hint';
  align-items: end;
  gap: var(--s2) var(--s3);
  padding: var(--s3);
}

.dock__build {
  grid-area: build;
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 12px 36px rgba(0, 0, 0, 0.42);
}

.dock__tools {
  grid-area: tools;
  justify-self: end;
  display: flex;
  gap: 6px;
  padding-bottom: var(--s1);
}

/* Compact build bar — icons only; the card lives in the hover tip. */

.dock__build {
  padding: 6px 8px;
}

.hotbar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.hot__group {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.hot__key {
  align-self: center;
  margin-right: 2px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 4px;
}

.slot {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  border-color: var(--line-strong);
  background: var(--raise);
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.slot:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--raise-strong);
}

.slot[data-selected='true'] {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 6px 16px rgba(77, 141, 255, 0.18);
}

.slot[data-state='short'] {
  opacity: 0.88;
}

.slot[data-state='locked'],
.slot[data-state='built'] {
  opacity: 0.42;
}

.slot__icon {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto;
}

.slot__count {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
}

.slot__count:empty {
  display: none;
}

.build-tip {
  position: fixed;
  z-index: 40;
  width: 380px;
  padding: 12px 14px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.build-tip__head {
  margin-bottom: 10px;
}

.build-tip__name {
  font-size: var(--t-name);
  font-weight: 620;
}

.build-tip__tag {
  margin-top: 2px;
  font-size: var(--t-body);
  color: var(--text-dim);
}

.build-tip__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.build-tip__kicker {
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.tip-panel {
  min-height: 92px;
  padding: 8px 10px;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tip-panel__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.tip-panel__sub {
  margin-top: 4px;
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tip-panel__sub:first-child {
  margin-top: 0;
}

.tip-panel__note,
.tip-panel__free {
  font-size: var(--t-small);
  color: var(--text);
  line-height: 1.4;
}

.tip-panel__free {
  color: var(--good);
}

.tip-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-small);
  color: var(--warn);
  font-weight: 560;
}

.tip-hour {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: var(--warn);
}

.build-tip__place {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.build-tip__rules {
  margin: 0;
  padding-left: 16px;
  font-size: var(--t-body);
  color: var(--text);
  line-height: 1.45;
}

.build-tip__blurb {
  margin: 10px 0 0;
  font-size: var(--t-small);
  color: var(--muted);
  line-height: 1.45;
}

.build-tip__lock {
  margin-top: 8px;
  font-size: var(--t-small);
  color: var(--warn);
}

.cost {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cost__chip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.cost__amount {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.cost[data-short='true'] {
  color: var(--bad);
}

/* Controls reminder */

.hint {
  grid-area: hint;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px 14px;
  font-size: var(--t-small);
  color: var(--text-dim);
  background: rgba(8, 11, 18, 0.62);
  border: 1px solid var(--line);
  border-radius: 999px;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.hint[data-familiar='true'] {
  display: none;
}

.hint__sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

/* Artillery readout

   In the dock's own grid above the objective, so a gun being aimed can never
   land on top of the build tree however tall the cards are. */

.targeting {
  grid-area: targeting;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px 14px;
  font-size: var(--t-small);
  background: rgba(9, 12, 20, 0.92);
  border: 1px solid rgba(226, 96, 60, 0.4);
  border-radius: 999px;
  pointer-events: none;
  animation: lift 0.25s ease;
}

.targeting__gun {
  font-size: var(--t-body);
  font-weight: 620;
  color: #ffb0a0;
}

.targeting__where {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.targeting__state {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--warn);
}

.targeting[data-ready='true'] .targeting__state {
  color: var(--good);
}

.targeting__ammo {
  color: var(--muted);
  padding-left: var(--s2);
  border-left: 1px solid var(--line);
}

.targeting__verdict {
  color: var(--text-dim);
  padding-left: var(--s2);
  border-left: 1px solid var(--line);
}

.targeting[data-ok='true'] .targeting__verdict {
  color: #b9f7c4;
}

.targeting[data-ok='false'] .targeting__verdict {
  color: #ffb0a0;
}

/* --------------------------------------------------------------- floating */

.pin {
  position: fixed;
  z-index: 12;
  transform: translate(-50%, calc(-100% - 12px));
  pointer-events: none;
}

.pin__card {
  position: relative;
  pointer-events: auto;
  width: 228px;
  padding: 8px 10px 9px;
  background: rgba(12, 16, 24, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.pin__card::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: rgba(12, 16, 24, 0.96);
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

.pin__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin__title {
  flex: 1;
  min-width: 0;
  font-size: var(--t-lead);
  font-weight: 650;
  line-height: 1.2;
}

.pin__body {
  display: grid;
  gap: 3px;
  margin: 6px 0 8px;
}

.pin__line {
  margin: 0;
  font-size: var(--t-body);
  color: var(--text-dim);
  line-height: 1.4;
}

.pin__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pin__actions .ghost,
.pin__actions .primary {
  padding: 4px 8px;
}

/* In the dock's own grid rather than floated above it, so it can never land on
   top of the build tree whatever height the cards end up. */
.objective {
  grid-area: objective;
  justify-self: center;
  margin-bottom: var(--s1);
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--t-mid);
  background: rgba(9, 12, 20, 0.9);
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  pointer-events: none;
  animation: lift 0.35s ease;
}

.objective__step {
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0a0d15;
  background: var(--warn);
  padding: 3px 8px;
  border-radius: 999px;
}

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* First-session coach — guests and brand-new accounts only. */

#coach {
  position: fixed;
  inset: 0;
  z-index: 16;
  pointer-events: none;
}

#coach[hidden] {
  display: none;
}

.coach__veil {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.56);
  -webkit-mask-image:
    radial-gradient(
      circle at var(--coach-x) var(--coach-y),
      transparent 0,
      transparent calc(var(--coach-size) * 0.55),
      #000 calc(var(--coach-size) * 1.25)
    ),
    radial-gradient(
      circle at var(--mouse-x) var(--mouse-y),
      transparent 0,
      transparent var(--mouse-r, 72px),
      #000 var(--mouse-fade, 140px)
    );
  mask-image:
    radial-gradient(
      circle at var(--coach-x) var(--coach-y),
      transparent 0,
      transparent calc(var(--coach-size) * 0.55),
      #000 calc(var(--coach-size) * 1.25)
    ),
    radial-gradient(
      circle at var(--mouse-x) var(--mouse-y),
      transparent 0,
      transparent var(--mouse-r, 72px),
      #000 var(--mouse-fade, 140px)
    );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.coach__pulse {
  position: absolute;
  left: var(--coach-x);
  top: var(--coach-y);
  width: var(--coach-size);
  height: var(--coach-size);
  margin: calc(var(--coach-size) / -2) 0 0 calc(var(--coach-size) / -2);
  border-radius: 50%;
  border: 3px solid #ffd479;
  box-shadow: 0 0 0 2px rgba(10, 12, 18, 0.45), 0 0 22px rgba(255, 212, 121, 0.35);
  animation: coach-ring 1.35s ease-out infinite;
}

.coach__pulse::after {
  content: '';
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 2px solid rgba(255, 212, 121, 0.7);
  animation: coach-ring 1.35s ease-out 0.28s infinite;
}

.coach__arrow {
  position: absolute;
  left: var(--coach-x);
  width: 44px;
  height: 64px;
  margin-left: -22px;
  background: #ffd479;
  clip-path: polygon(50% 100%, 0 42%, 28% 42%, 28% 0, 72% 0, 72% 42%, 100% 42%);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  animation: coach-nudge 0.7s ease-in-out infinite;
}

#coach[data-dir='down'] .coach__arrow {
  top: var(--coach-y);
  margin-top: calc(var(--coach-size) / -2 - 78px);
}

#coach[data-dir='up'] .coach__arrow {
  top: var(--coach-y);
  margin-top: calc(var(--coach-size) / 2 + 14px);
  transform: rotate(180deg);
}

#coach[data-dir='down'] .coach__say {
  top: var(--coach-y);
  margin-top: calc(var(--coach-size) / -2 - 148px);
}

#coach[data-dir='up'] .coach__say {
  top: var(--coach-y);
  margin-top: calc(var(--coach-size) / 2 + 86px);
}

.coach__say {
  position: absolute;
  left: var(--coach-x);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  pointer-events: none;
}

.coach__label {
  padding: 8px 14px;
  border-radius: 999px;
  background: #ffd479;
  color: #1a1408;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.coach__skip {
  pointer-events: auto;
  font: inherit;
  font-size: var(--t-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 231, 168, 0.7);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.coach__skip:hover {
  color: #ffe7a8;
}

@keyframes coach-ring {
  0% {
    transform: scale(0.72);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes coach-nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(7px);
  }
}

#coach[data-dir='up'] .coach__arrow {
  animation-name: coach-nudge-up;
}

@keyframes coach-nudge-up {
  0%,
  100% {
    transform: rotate(180deg) translateY(0);
  }
  50% {
    transform: rotate(180deg) translateY(-7px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .coach__pulse,
  .coach__pulse::after,
  .coach__arrow {
    animation: none;
  }
}

/* First-session splash — covers the map, then hands off to the coach. */

#intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  background: #05070c;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

#intro[hidden] {
  display: none;
}

.intro__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 42%, rgba(77, 141, 255, 0.16), transparent 62%),
    radial-gradient(ellipse 40% 30% at 50% 48%, rgba(255, 212, 121, 0.12), transparent 55%),
    #05070c;
  opacity: 0;
}

.intro__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(150, 185, 235, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 185, 235, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0;
  transform: scale(1.12) rotate(-8deg);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

.intro__bloom {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 121, 0.55), rgba(255, 212, 121, 0) 68%);
  opacity: 0;
  filter: blur(8px);
}

.intro__flash {
  position: absolute;
  inset: 0;
  background: #fff6d8;
  opacity: 0;
  pointer-events: none;
}

.intro__stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8vh 6vw 12vh;
  text-align: center;
}

.intro__mark {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 18px rgba(255, 212, 121, 0.7));
  opacity: 0;
  transform: scale(0.2) rotate(-24deg);
}

.intro__title {
  margin: 0;
  display: grid;
  gap: 0.02em;
  font-size: clamp(56px, 14vw, 148px);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f4f7ff;
  text-shadow: 0 0 40px rgba(77, 141, 255, 0.35);
}

.intro__word {
  display: block;
}

.intro__word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) scale(0.7);
}

.intro__rule {
  width: min(420px, 70vw);
  height: 2px;
  margin: 22px 0 18px;
  background: linear-gradient(90deg, transparent, #ffd479, transparent);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
}

.intro__kicker,
.intro__tag {
  margin: 0;
  max-width: 16em;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(16px);
}

.intro__kicker {
  font-size: clamp(13px, 2.4vw, 22px);
  color: #ffd479;
  text-shadow: 0 0 22px rgba(255, 212, 121, 0.45);
}

.intro__tag {
  margin-top: 8px;
  font-size: clamp(12px, 2vw, 18px);
  color: #dce6f8;
}

.intro__skip {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 0;
  border: 0;
  background: none;
  color: #6f7d94;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

#intro.intro--play .intro__bg {
  animation: intro-fade 0.5s ease-out both;
}

#intro.intro--play .intro__grid {
  animation: intro-grid 5s ease-out both;
}

#intro.intro--play .intro__bloom {
  animation: intro-bloom 1.1s ease-out 0.12s both;
}

#intro.intro--play .intro__mark {
  animation: intro-mark 0.7s cubic-bezier(0.16, 1.2, 0.32, 1) 0.18s both;
}

#intro.intro--play .intro__word:first-child span {
  animation: intro-letter 0.55s cubic-bezier(0.12, 1.15, 0.28, 1) both;
  animation-delay: calc(0.48s + var(--i) * 0.07s);
}

#intro.intro--play .intro__word:last-child span {
  animation: intro-letter 0.55s cubic-bezier(0.12, 1.15, 0.28, 1) both;
  animation-delay: calc(0.78s + var(--i) * 0.07s);
}

#intro.intro--play .intro__flash {
  animation: intro-flash 0.45s ease-out 0.92s both;
}

#intro.intro--play .intro__rule {
  animation: intro-rule 0.55s ease-out 1.28s both;
}

#intro.intro--play .intro__kicker {
  animation: intro-line 0.6s ease-out 1.55s both;
}

#intro.intro--play .intro__tag {
  animation: intro-line 0.6s ease-out 2.05s both;
}

#intro.intro--play .intro__skip {
  animation: intro-fade 0.4s ease-out 1.4s both;
  pointer-events: auto;
}

#intro.intro--out {
  animation: intro-leave 0.7s ease-in forwards;
  pointer-events: none;
}

@keyframes intro-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes intro-grid {
  from {
    opacity: 0;
    transform: scale(1.18) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(-6deg);
  }
}

@keyframes intro-bloom {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0.45;
    transform: scale(1.15);
  }
}

@keyframes intro-mark {
  0% {
    opacity: 0;
    transform: scale(0.15) rotate(-28deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.12) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes intro-letter {
  from {
    opacity: 0;
    transform: translateY(0.55em) scale(0.65);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes intro-flash {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
  }
}

@keyframes intro-rule {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes intro-line {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes intro-leave {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #intro.intro--play .intro__bg,
  #intro.intro--play .intro__grid,
  #intro.intro--play .intro__bloom,
  #intro.intro--play .intro__mark,
  #intro.intro--play .intro__word span,
  #intro.intro--play .intro__flash,
  #intro.intro--play .intro__rule,
  #intro.intro--play .intro__kicker,
  #intro.intro--play .intro__tag,
  #intro.intro--play .intro__skip {
    animation: intro-fade 0.2s ease-out both;
    transform: none;
    filter: none;
    opacity: 1;
  }

  #intro.intro--play .intro__flash {
    display: none;
  }
}

/* Stripe return — wait for the webhook, then a check and the haul. */

#paid {
  position: fixed;
  inset: 0;
  z-index: 52;
  overflow: hidden;
  background: #05070c;
  cursor: default;
  user-select: none;
  touch-action: manipulation;
}

#paid[hidden] {
  display: none;
}

#paid[data-state='done'] {
  cursor: pointer;
}

.paid__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 42%, rgba(77, 141, 255, 0.14), transparent 62%),
    radial-gradient(ellipse 40% 30% at 50% 48%, rgba(255, 212, 121, 0.16), transparent 55%),
    #05070c;
  opacity: 0;
}

.paid__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(150, 185, 235, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 185, 235, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0;
  transform: scale(1.12) rotate(-8deg);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

.paid__bloom {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 121, 0.5), rgba(255, 212, 121, 0) 68%);
  opacity: 0;
  filter: blur(8px);
}

.paid__flash {
  position: absolute;
  inset: 0;
  background: #fff6d8;
  opacity: 0;
  pointer-events: none;
}

.paid__burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.paid__bit {
  position: absolute;
  left: 50%;
  top: 44%;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  animation: paid-bit 1.4s cubic-bezier(0.12, 0.72, 0.18, 1) var(--delay) both;
}

.paid__bit--crown {
  color: #ffd479;
  font-size: var(--size);
  line-height: 1;
  text-shadow: 0 0 14px rgba(255, 212, 121, 0.75);
}

.paid__bit--coin {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #fff3c4, #ffd479 42%, #c9862a 78%, #7a4e12);
  box-shadow: 0 0 12px rgba(255, 212, 121, 0.5);
}

.paid__stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8vh 6vw 12vh;
  text-align: center;
}

.paid__mark {
  width: 120px;
  height: 120px;
  margin-bottom: 22px;
  filter: drop-shadow(0 0 22px rgba(255, 212, 121, 0.55));
  opacity: 0;
  transform: scale(0.4);
}

.paid__check {
  display: block;
  overflow: visible;
}

.paid__ring,
.paid__tick {
  fill: none;
  stroke: #ffd479;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.paid__ring {
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
}

.paid__tick {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.paid__kicker {
  margin: 0;
  font-size: clamp(18px, 3.2vw, 28px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f4f7ff;
  opacity: 0;
}

.paid__amount {
  margin: 10px 0 0;
  min-height: 1.1em;
  font-size: clamp(42px, 9vw, 88px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #ffd479;
  text-shadow: 0 0 36px rgba(255, 212, 121, 0.45);
  opacity: 0;
  transform: translateY(0.3em) scale(0.85);
}

.paid__track {
  width: min(280px, 56vw);
  height: 4px;
  margin-top: 28px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 212, 121, 0.14);
  opacity: 0;
}

.paid__bar {
  width: 100%;
  height: 100%;
  transform: scaleX(0.08);
  transform-origin: left center;
  background: linear-gradient(90deg, #c9a24a, #ffd479);
}

.paid__hint {
  margin: 22px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9aa8bf;
  opacity: 0;
}

#paid.paid--play .paid__bg {
  animation: intro-fade 0.5s ease-out both;
}

#paid.paid--play .paid__grid {
  animation: intro-grid 5s ease-out both;
}

#paid.paid--play .paid__bloom {
  animation: intro-bloom 1.1s ease-out 0.08s both;
}

#paid.paid--play .paid__kicker {
  animation: intro-line 0.5s ease-out 0.2s both;
}

#paid.paid--play .paid__track {
  animation: intro-fade 0.4s ease-out 0.28s both;
}

#paid.paid--play[data-state='wait'] .paid__bar {
  animation: paid-wait 8s cubic-bezier(0.22, 0.8, 0.2, 1) forwards;
}

#paid.paid--done .paid__mark {
  animation: paid-mark 0.55s cubic-bezier(0.16, 1.2, 0.32, 1) both;
}

#paid.paid--done .paid__ring {
  animation: paid-ring 0.55s ease-out both;
}

#paid.paid--done .paid__tick {
  animation: paid-tick 0.4s ease-out 0.28s both;
}

#paid.paid--done .paid__flash {
  animation: intro-flash 0.4s ease-out both;
}

#paid.paid--done .paid__amount {
  animation: paid-amount 0.55s cubic-bezier(0.12, 1.15, 0.28, 1) 0.2s both;
}

#paid.paid--done .paid__bar {
  animation: none;
  transform: scaleX(1);
  transition: transform 0.28s ease-out;
}

#paid.paid--done .paid__hint {
  animation: intro-fade 0.4s ease-out 0.7s both;
}

#paid.paid--out {
  animation: intro-leave 0.7s ease-in forwards;
}

@keyframes paid-wait {
  from {
    transform: scaleX(0.08);
  }
  to {
    transform: scaleX(0.88);
  }
}

@keyframes paid-mark {
  from {
    opacity: 0;
    transform: scale(0.35) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes paid-ring {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes paid-tick {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes paid-amount {
  from {
    opacity: 0;
    transform: translateY(0.35em) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes paid-bit {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.15);
  }
  12% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  #paid.paid--play .paid__bg,
  #paid.paid--play .paid__grid,
  #paid.paid--play .paid__bloom,
  #paid.paid--play .paid__kicker,
  #paid.paid--play .paid__track,
  #paid.paid--done .paid__mark,
  #paid.paid--done .paid__amount,
  #paid.paid--done .paid__hint {
    animation: intro-fade 0.2s ease-out both;
    transform: none;
    filter: none;
    opacity: 1;
  }

  #paid.paid--play[data-state='wait'] .paid__bar,
  #paid.paid--done .paid__ring,
  #paid.paid--done .paid__tick {
    animation: none;
  }

  #paid.paid--done .paid__ring,
  #paid.paid--done .paid__tick {
    stroke-dashoffset: 0;
  }

  #paid.paid--done .paid__flash {
    display: none;
  }

  .paid__bit {
    animation: intro-fade 0.3s ease-out both;
    transform: translate(var(--dx), var(--dy));
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* Cursor-following readout */
.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: var(--r1);
  background: rgba(9, 12, 20, 0.95);
  border: 1px solid var(--line-strong);
  pointer-events: none;
}

.tip__lead {
  font-size: var(--t-body);
  font-weight: 600;
}

.tip__sub {
  font-size: var(--t-small);
  color: var(--text-dim);
}

.tip__sub:empty {
  display: none;
}

.tip[data-ok='false'] {
  border-color: rgba(226, 96, 60, 0.55);
}

.tip[data-ok='false'] .tip__sub {
  color: #ffb0a0;
}

.tip[data-ok='true'] {
  border-color: rgba(86, 196, 107, 0.45);
}

.tip[data-ok='true'] .tip__sub {
  color: #b9f7c4;
}

/* -------------------------------------------------------------- console */

.console {
  flex: none;
  display: flex;
  flex-direction: column;
  width: auto;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.console__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 4px 10px;
  user-select: none;
}

.console__title {
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.console__filters {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.console__filter {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--raise);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 4px;
}

.console__filter:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: var(--raise-strong);
}

.console__filter[data-on='true'] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.console__toggle {
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 1;
}

.console__lines {
  list-style: none;
  margin: 0;
  padding: 2px 8px 6px;
  max-height: 112px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.console[data-collapsed='true'] .console__lines,
.console[data-collapsed='true'] .console__form {
  display: none;
}

.console__line {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px;
  font-size: var(--t-body);
  line-height: 1.35;
  color: var(--text-dim);
  padding: 2px 4px;
  border-radius: 4px;
  border-left: 2px solid transparent;
}

.console__line[data-kind='chat'] {
  color: var(--text);
}

.console__line[data-tone='mine'] {
  color: #ffe7a8;
  border-left-color: #ffd479;
  background: rgba(255, 212, 121, 0.08);
}

.console__line[data-tone='about'] {
  color: #ffc4b6;
  border-left-color: #e2603c;
  background: rgba(226, 96, 60, 0.12);
}

.console__line[data-tone='ally'] {
  color: #c5dbff;
  border-left-color: #4d8dff;
  background: rgba(77, 141, 255, 0.1);
}

.console__line[data-tone='chat'] {
  color: var(--text);
}

.console__line[data-jump='true'] {
  cursor: pointer;
}

.console__line[data-jump='true']:hover {
  background: var(--raise-strong);
}

.console__time {
  font-family: var(--mono);
  font-size: var(--t-micro);
  color: var(--muted);
  padding-top: 1px;
}

.console__body {
  min-width: 0;
}

.console__who {
  color: #9ec0ff;
  font-weight: 600;
}

.console__line[data-tone='mine'] .console__who {
  color: #ffe7a8;
}

.console__form {
  display: flex;
  gap: 6px;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--line);
}

.console__input {
  flex: 1;
  min-width: 0;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: var(--t-mid);
  padding: 5px 8px;
}

.console__input:focus {
  outline: none;
  border-color: var(--line-strong);
}

.console__send {
  flex: none;
}

.console__form[data-guest='true'] .console__input {
  cursor: pointer;
  color: var(--muted);
}

.console__form[data-guest='true'] .console__send {
  display: none;
}

.console[data-filter='event'] .console__line[data-kind='chat'],
.console[data-filter='chat'] .console__line:not([data-kind='chat']) {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  top: 46px;
  transform: translateX(-50%);
  font-size: var(--t-mid);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(9, 12, 20, 0.95);
  border: 1px solid var(--line-strong);
  pointer-events: none;
  animation: rise 0.25s ease;
  z-index: 15;
}

.toast[data-kind='bad'] {
  color: #ffb0a0;
  border-color: rgba(226, 96, 60, 0.6);
}

.toast[data-kind='good'] {
  color: #b9f7c4;
  border-color: rgba(86, 196, 107, 0.5);
}

/* ----------------------------------------------------------------- modals */

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--s5);
  background: rgba(4, 6, 11, 0.78);
  z-index: 20;
}

.modal__card {
  width: min(560px, 92vw);
  max-height: 86vh;
  overflow: auto;
  padding: var(--s5);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--r3);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.modal__card--wide {
  width: min(720px, 94vw);
}

.modal__card--signin {
  width: min(440px, 92vw);
}

.signin__lead {
  margin: 0 0 var(--s4);
  font-size: var(--t-mid);
  color: var(--text-dim);
  line-height: 1.6;
}

.perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.perks li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--raise);
  font-size: var(--t-body);
  color: var(--text-dim);
  line-height: 1.45;
}

.perks b {
  display: block;
  margin-bottom: 2px;
  font-size: var(--t-mid);
  font-weight: 620;
  color: var(--text);
}

.modal__foot--signin {
  justify-content: space-between;
}

.primary--save {
  color: #1a1408;
  border-color: rgba(255, 212, 121, 0.7);
  background: linear-gradient(180deg, #ffe08a, #e0a83a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.primary--save:hover {
  background: linear-gradient(180deg, #ffe9a8, #f0b84a);
  border-color: #ffd479;
}

.modal__card--profile {
  width: min(920px, 96vw);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.modal__head h2 {
  margin: 0;
  font-size: var(--t-head);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

.modal__status {
  margin-right: auto;
  font-size: var(--t-body);
  color: var(--muted);
}

.steps {
  margin: 0 0 var(--s4);
  padding-left: var(--s4);
  display: grid;
  gap: var(--s2);
  color: var(--text-dim);
  line-height: 1.65;
  font-size: var(--t-mid);
}

.steps b {
  color: var(--text);
  font-weight: 600;
}

.note {
  margin: 0 0 var(--s4);
  padding: var(--s3);
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r1) var(--r1) 0;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: var(--t-mid);
}

.keys {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 7px var(--s3);
  font-size: var(--t-body);
}

.keys span {
  color: var(--muted);
}

/* Sheets: the node inspector and profiles */

.sheet {
  display: grid;
  gap: var(--s5);
}

.sheet__block {
  display: grid;
  gap: var(--s2);
}

.sheet__title {
  margin: 0;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet__lead {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
}

.sheet__chip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  align-self: center;
}

.sheet__name {
  font-size: var(--t-name);
  font-weight: 620;
}

.sheet__tagline {
  font-size: var(--t-body);
  color: var(--muted);
}

.sheet__body {
  margin: 0;
  font-size: var(--t-mid);
  color: var(--text-dim);
  line-height: 1.6;
}

.sheet__note {
  font-size: var(--t-mid);
  color: var(--muted);
  line-height: 1.6;
}

/* The same sheet, read in a 306px panel rather than a modal. */
.sheet--tight {
  gap: var(--s4);
  margin-top: var(--s3);
}

.sheet--tight .ident {
  gap: var(--s3);
}

.sheet--tight .ident__sub {
  font-size: var(--t-body);
}

.sheet--tight .facts {
  grid-template-columns: 78px 1fr;
}

.sheet--tight .facts dd {
  overflow-wrap: anywhere;
}

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

.facts {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 5px var(--s3);
  margin: 0;
  font-size: var(--t-body);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-body);
}

.table th {
  text-align: left;
  padding: 0 var(--s3) 6px 0;
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 7px var(--s3) 7px 0;
  border-bottom: 1px solid rgba(140, 172, 220, 0.07);
}

.table__name {
  font-weight: 560;
}

.table__verdict {
  color: var(--good);
  white-space: nowrap;
}

.table tr[data-allowed='false'] {
  color: var(--muted);
}

.table tr[data-allowed='false'] .table__verdict {
  color: var(--bad);
}

/* Identity blocks */

.ident {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.ident__flag {
  display: block;
  width: 80px;
  height: 52px;
  aspect-ratio: 40 / 26;
  border-radius: var(--r1);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  flex: none;
  image-rendering: pixelated;
}

.ident__meta {
  display: grid;
  gap: 5px;
}

.ident__sub {
  font-size: var(--t-mid);
  color: var(--text-dim);
}

.tally {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  font-size: var(--t-body);
}

.tally__row {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.tally__chip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.tally__name {
  flex: 1;
  color: var(--text-dim);
}

.tally__count {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Your own settlement and the flag editor */

.me-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s5);
  padding: var(--s5) var(--s5) var(--s4);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--me-a, #4d8dff) 55%, transparent), transparent 58%),
    linear-gradient(125deg, color-mix(in srgb, var(--me-a, #4d8dff) 38%, #0c1018), color-mix(in srgb, var(--me-b, #20242e) 42%, #0c1018));
  border-bottom: 1px solid var(--line);
}

.me-hero__close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.me__flag {
  width: 160px;
  height: 104px;
  aspect-ratio: 40 / 26;
  border-radius: var(--r1);
  flex: none;
  image-rendering: pixelated;
  background: #0a0d14;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.me__meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.me__name {
  appearance: none;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  max-width: 100%;
  margin: 0;
  padding: 4px 8px 4px 0;
  border: 1px solid transparent;
  border-radius: var(--r2);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.me__name:hover,
.me__name:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.22);
  outline: none;
}

.me__rename-mark {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.28);
  font-size: var(--t-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffe7a8;
}

.me__name:hover .me__rename-mark,
.me__name:focus-visible .me__rename-mark {
  border-color: rgba(255, 212, 121, 0.55);
  background: rgba(255, 212, 121, 0.16);
}

.me__name[data-nameplate='serif'] {
  font-family: 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  letter-spacing: 0.03em;
}

.me__name[data-nameplate='shadow'] {
  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45);
}

.me__name[data-nameplate='gilt'] {
  color: #f0c860;
  text-shadow: 0 0 18px rgba(240, 200, 96, 0.35);
}

.me__name[data-nameplate='banner'] {
  justify-self: start;
  padding: 4px 12px 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
}

.me__name[data-nameplate='sovereign'] {
  font-family: 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  color: #ffe4a6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(240, 200, 96, 0.4);
}

.me__sub {
  font-size: var(--t-mid);
  color: rgba(221, 229, 243, 0.78);
}

.me__crowns {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 212, 121, 0.35);
  background: rgba(255, 212, 121, 0.1);
  color: #ffe4a6;
  font-family: var(--mono);
  font-size: var(--t-body);
  cursor: pointer;
}

.me__crowns:hover {
  background: rgba(255, 212, 121, 0.18);
}

.me-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.me-tabs .tab {
  padding: 8px 12px;
}

.me-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--s4) var(--s5);
}

.me-pane[hidden] {
  display: none;
}

.me__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--s3) 0;
}

.me__rename-cta {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: var(--t-mid);
}

.modal__card--profile .modal__foot {
  margin: 0;
  padding: var(--s3) var(--s5);
}

.ghost--danger {
  color: var(--bad);
  border-color: rgba(255, 107, 87, 0.35);
}

.studio {
  display: block;
}

.closet {
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(0, 1.2fr);
  grid-template-areas:
    'title title'
    'list preview';
  gap: var(--s3) var(--s4);
  min-height: 280px;
}

.closet > .panel__title {
  grid-area: title;
}

.closet > .closet__list {
  grid-area: list;
}

.closet > .closet__preview {
  grid-area: preview;
}

.closet-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

.closet__col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: var(--s2);
}

.closet__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
  max-height: 360px;
  overflow-y: auto;
}

.closet__item {
  appearance: none;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--raise);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.closet__item:hover {
  background: var(--raise-strong);
  border-color: var(--line-strong);
}

.closet__item[data-active='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(106, 166, 255, 0.22);
}

.closet__item[data-locked='true'] {
  opacity: 0.5;
}

.closet__chip {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--chip, #8a8a8a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.closet__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.closet__cost {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: #ffe4a6;
}

.closet__preview {
  display: grid;
  align-content: start;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--raise);
  min-height: 220px;
}

.closet__preview h3 {
  margin: 0;
  font-size: var(--t-name);
}

.closet__preview p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.5;
}

.shop {
  display: grid;
  gap: var(--s4);
}

.shop__packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s3);
}

.shop__pack {
  display: grid;
  gap: 6px;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--raise);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.shop__pack:hover {
  border-color: var(--line-strong);
  background: var(--raise-strong);
}

.shop__pack[data-tag='popular'] {
  border-color: rgba(77, 141, 255, 0.45);
}

.shop__pack[data-tag='best'] {
  border-color: rgba(255, 212, 121, 0.45);
}

.shop__tag {
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warn);
}

.shop__name {
  font-size: var(--t-name);
  font-weight: 620;
}

.shop__crowns {
  font-family: var(--mono);
  color: #ffe4a6;
}

.shop__usd {
  font-family: var(--mono);
  color: var(--text);
}

.shop__blurb {
  font-size: var(--t-body);
  color: var(--muted);
  line-height: 1.45;
}

.draw {
  display: grid;
  gap: var(--s2);
  justify-items: start;
}

.draw__grid {
  display: grid;
  width: 256px;
  aspect-ratio: 40 / 26;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(16, 1fr);
  border: 1px solid var(--line-strong);
  background:
    repeating-conic-gradient(#1a1f2a 0% 25%, #12161f 0% 50%)
    0 0 / 12.5% 12.5%;
  cursor: crosshair;
  touch-action: none;
}

.draw__cell {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
}

.draw__cell:hover {
  outline: 1px solid rgba(255, 255, 255, 0.45);
  outline-offset: -1px;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 224px;
}

.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.45);
}

.swatch[data-chosen='true'] {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.swatch[data-locked='true'] {
  opacity: 0.35;
  cursor: pointer;
}

.palette__unlock {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.palette__unlock[hidden] {
  display: none;
}

.palette__unlock-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-small);
}

.studio-help {
  display: grid;
  gap: var(--s4);
}

.crowns-help-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.crowns-help-row .panel__hint,
.crowns-help-row .sheet__note {
  flex: 1;
  min-width: 180px;
  margin: 0;
}

.crowns-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r1);
  border: 1px solid rgba(255, 212, 121, 0.32);
  background: rgba(255, 212, 121, 0.08);
  color: #ffe7a8;
  font-family: var(--font);
  font-size: var(--t-small);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.crowns-help:hover {
  border-color: rgba(255, 212, 121, 0.55);
  background: rgba(255, 212, 121, 0.16);
}

.crowns-help__mark {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 212, 121, 0.55);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.modal--lift {
  z-index: 24;
}

.modal--rename {
  animation: modal-veil 0.22s ease;
}

.modal--rename .modal__card {
  animation: modal-pop 0.34s cubic-bezier(0.22, 1.15, 0.36, 1);
}

@keyframes modal-veil {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__card--rename {
  width: min(420px, 92vw);
}

.field--rename {
  font-size: var(--t-name);
  padding: 10px 12px;
}

.rename__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.rename__count {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--muted);
}

.modal--rename .modal__foot {
  margin-top: var(--s4);
}

.modal__card--crowns {
  width: min(440px, 92vw);
}

.crowns-sources {
  list-style: none;
  margin: 0 0 var(--s4);
  padding: 0;
  display: grid;
  gap: 8px;
}

.crowns-sources li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--raise);
  font-size: var(--t-body);
  color: var(--text-dim);
  line-height: 1.45;
}

.crowns-sources b {
  display: block;
  margin-bottom: 2px;
  font-size: var(--t-mid);
  font-weight: 620;
  color: var(--text);
}

.swatch--clear {
  background:
    linear-gradient(45deg, #2a3140 25%, transparent 25%),
    linear-gradient(-45deg, #2a3140 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a3140 75%),
    linear-gradient(-45deg, transparent 75%, #2a3140 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

.studio__opts {
  display: grid;
  gap: var(--s4);
  align-content: start;
}

.flagger__group {
  display: grid;
  gap: 8px;
}

.optgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.opt {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r1);
  border: 1px solid var(--line);
  background: var(--raise);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: var(--t-small);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.opt:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--raise-strong);
}

.opt[data-chosen='true'] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.opt[data-locked='true'],
.opt:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.opt__chip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  flex: none;
}

.opt__lock {
  color: var(--warn);
  font-size: var(--t-micro);
}

.motto {
  width: 100%;
}

.admin__field,
.admin__check {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: var(--s3) 0;
  font-size: var(--t-body);
}

.admin__field {
  flex-direction: column;
  align-items: stretch;
}

/* ------------------------------------------------------------ narrow views */

@media (max-width: 1100px) {
  .sidenav {
    width: 232px;
  }
  .identity {
    max-width: 110px;
  }
}

@media (max-width: 960px) {
  .dock__tools {
    display: none;
  }
  .sidenav {
    position: fixed;
    z-index: 10;
    top: 44px;
    bottom: 0;
    left: 0;
    width: min(268px, 100vw);
    margin: 0;
  }
  .dock {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'targeting'
      'objective'
      'build'
      'hint';
  }
  .dock__build {
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }
  .studio {
    grid-template-columns: minmax(0, 1fr);
  }
  .closet {
    grid-template-columns: 1fr;
    grid-template-areas:
      'title'
      'list'
      'preview';
    min-height: 0;
  }
  .closet-split {
    grid-template-columns: 1fr;
  }
  .me__name {
    font-size: 22px;
  }
  .build-tip {
    width: min(380px, calc(100vw - 16px));
  }
}

#sayings {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.saying {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 220px;
  padding: 8px 11px 9px;
  background: #f3eee3;
  color: #1c1712;
  border-radius: 14px 14px 14px 5px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 550;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
  white-space: pre-wrap;
  word-break: break-word;
}

.saying::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #f3eee3;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 2px 0;
}

.saying--out {
  opacity: 0;
  transition: opacity 0.22s ease;
}

.set {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
  cursor: pointer;
  color: var(--text);
}

.set input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.set b {
  display: block;
  font-size: var(--t-mid);
  font-weight: 600;
}

.set span {
  color: var(--text-dim);
  font-size: var(--t-body);
  line-height: 1.4;
}

.set--select {
  flex-direction: column;
  gap: 8px;
  cursor: default;
}

.set--select .field {
  width: 100%;
}
