/* Coalition Kart — election-night broadcast styling. */
:root {
  --ink: #0b1422;
  --ink-2: #13203a;
  --ink-3: #1c2c4a;
  --panel: rgb(11 20 34 / 0.82);
  --panel-solid: #101b2e;
  --line: rgb(255 255 255 / 0.12);
  --line-strong: rgb(255 255 255 / 0.24);
  --text: #f2f4f7;
  --muted: #9aa8bd;
  --paper: #f3efe4;
  --paper-ink: #1b1d22;
  --red: #e5383b;
  --blue: #2f6fe4;
  --gold: #f2c14e;
  --green: #4cc38a;
  --radius: 10px;
  --gutter: clamp(12px, 2.2vw, 28px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: Heebo, Arial, sans-serif;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  overscroll-behavior: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.hidden {
  display: none !important;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Full-screen stage */
.arena {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #8fb7c9;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 140px rgb(5 10 20 / 0.35);
  transition: box-shadow 0.25s;
}
.arena.boosting .vignette {
  box-shadow: inset 0 0 160px rgb(110 220 255 / 0.28);
}
.arena.hit-flash .vignette {
  box-shadow: inset 0 0 160px rgb(229 56 59 / 0.45);
}
.arena.starred .vignette {
  box-shadow: inset 0 0 160px rgb(242 193 78 / 0.5);
}
.arena.confused .vignette {
  box-shadow: inset 0 0 160px rgb(160 120 255 / 0.5);
}
.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--ink);
  color: var(--muted);
  z-index: 50;
  font-weight: 500;
}
.loading-mark {
  font-size: 54px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -2px;
  animation: breathe 1.4s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}

/* Shared controls */
.primary,
.secondary {
  border: 0;
  border-radius: var(--radius);
  min-height: 48px;
  padding: 0 22px;
  font-weight: 800;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    transform 0.12s,
    background 0.15s;
}
.primary {
  background: var(--gold);
  color: #201703;
}
.primary:hover {
  background: #f6cf6d;
}
.primary:active,
.secondary:active {
  transform: translateY(1px);
}
.primary:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary.small {
  min-height: 38px;
  font-size: 15px;
  padding: 0 16px;
}
.secondary {
  background: rgb(255 255 255 / 0.08);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.secondary:hover {
  background: rgb(255 255 255 / 0.14);
}
.primary svg,
.secondary svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.6;
}
.text-button {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover {
  color: var(--text);
}
.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 800;
  font-size: 18px;
  backdrop-filter: blur(6px);
}
.icon-button:hover {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.icon-button svg {
  width: 20px;
  height: 20px;
}
#sound[aria-pressed='false'] .wave {
  opacity: 0.25;
}
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* Race HUD */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.hud button {
  pointer-events: auto;
}
.hud-standing {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  width: 186px;
}
.hud-position {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 900;
  line-height: 0.82;
  text-shadow: 0 3px 18px rgb(0 0 0 / 0.45);
}
.hud-position b {
  font-size: 92px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
}
.hud-position span {
  font-size: 30px;
  opacity: 0.8;
}
.hud-lap {
  display: inline-block;
  margin: 8px 0 10px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--panel);
  font-weight: 800;
  font-size: 14px;
}
.hud-board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
.hud-board li {
  display: grid;
  grid-template-columns: 18px 4px 1fr auto;
  gap: 8px;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--panel);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.25s;
}
.hud-board li i {
  height: 16px;
  border-radius: 2px;
  background: var(--party);
}
.hud-board li b {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 800;
}
.hud-board li small {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
}
.hud-board li.me {
  background: var(--paper);
  color: var(--paper-ink);
}
.hud-board li.me b,
.hud-board li.me small {
  color: #4a4f5a;
}
.hud-board li.ally span::after {
  content: ' ●';
  color: var(--green);
  font-size: 10px;
}
.hud-top {
  position: absolute;
  top: var(--gutter);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-top > * {
  background: var(--panel);
  border-radius: 8px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
}
.hud-clock {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}
.hud-sector {
  font-size: 14px;
  font-weight: 700;
  border-inline-start: 4px solid var(--sector, var(--gold));
}
.hud-coalition {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
}
.hud-map {
  position: absolute;
  top: var(--gutter);
  left: var(--gutter);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
#minimap {
  width: 168px;
  height: 126px;
  border-radius: 12px;
  background: rgb(11 20 34 / 0.45);
}
.hud-map-tools {
  display: grid;
  gap: 8px;
}
.hud-kit {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + 46px + var(--safe-b));
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.item-slot,
.ability {
  position: relative;
  border: 0;
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  text-align: right;
}
.item-icon {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 0.06);
  color: var(--muted);
}
.item-icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 1.8;
}
.item-slot.ready {
  box-shadow: inset 0 0 0 2px var(--gold);
}
.item-slot.ready .item-icon {
  background: var(--gold);
  color: #201703;
  animation: nudge 1.4s ease-in-out infinite;
}
@keyframes nudge {
  50% {
    transform: scale(1.06);
  }
}
.kit-copy {
  display: grid;
  gap: 2px;
}
.kit-copy b {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.key-hint {
  justify-self: start;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 5px;
}
.ability {
  --charge: 0;
}
.ability img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid transparent;
  background:
    linear-gradient(var(--ink-2), var(--ink-2)) padding-box,
    conic-gradient(var(--gold) calc(var(--charge) * 1turn), rgb(255 255 255 / 0.14) 0) border-box;
}
.ability .kit-copy b {
  color: var(--muted);
}
.ability.ready {
  box-shadow: inset 0 0 0 2px var(--gold);
}
.ability.ready .kit-copy b {
  color: var(--gold);
}
.ability.ready img {
  animation: glow 0.9s ease-in-out infinite;
}
@keyframes glow {
  50% {
    box-shadow: 0 0 0 4px rgb(242 193 78 / 0.35);
  }
}
.hud-drive {
  position: absolute;
  bottom: calc(var(--gutter) + 52px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
}
.drift-meter {
  width: 240px;
  height: 8px;
  border-radius: 4px;
  background: rgb(11 20 34 / 0.55);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}
.drift-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: #7fe9ff;
  border-radius: 4px;
}
.hud-drive.active .drift-meter {
  opacity: 1;
}
.drift-label {
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 2px 8px rgb(0 0 0 / 0.6);
  min-height: 1em;
}
.hud-coins,
.hud-status {
  font-size: 13px;
  font-weight: 700;
  background: var(--panel);
  border-radius: 6px;
  padding: 2px 10px;
}
.hud-status:empty {
  display: none;
}
.ticker {
  position: absolute;
  inset: auto 0 0 0;
  height: calc(36px + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  align-items: stretch;
  background: rgb(11 20 34 / 0.88);
  border-top: 1px solid var(--line);
}
.ticker-tag {
  display: grid;
  place-items: center;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
}
.ticker-text {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.ticker-text.fresh {
  animation: ticker-in 0.35s ease-out;
}
@keyframes ticker-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
}
.race-hint {
  position: absolute;
  bottom: calc(var(--gutter) + 120px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.race-hint:empty {
  display: none;
}

/* Callouts, countdown and toast */
.callout {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  padding: 10px 22px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--paper-ink);
  font-weight: 900;
  font-size: clamp(18px, 2.4vw, 26px);
  white-space: nowrap;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
  animation: callout-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.callout.danger {
  background: var(--red);
  color: #fff;
}
.callout.gold {
  background: var(--gold);
  color: #201703;
}
@keyframes callout-in {
  from {
    transform: translateX(-50%) scale(0.8);
    opacity: 0;
  }
}
.countdown {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  pointer-events: none;
  font-size: clamp(90px, 16vw, 190px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 8px 40px rgb(0 0 0 / 0.45);
  font-variant-numeric: tabular-nums;
}
.arena.launch-window .countdown {
  color: var(--gold);
}
.toast {
  position: absolute;
  top: calc(var(--gutter) + 52px);
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  background: var(--panel);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 700;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* A leak plasters newsprint over the windscreen. */
.leak-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
}
.leak-overlay p {
  position: absolute;
  margin: 0;
  padding: 18px 26px;
  background: var(--paper);
  color: var(--paper-ink);
  font:
    900 clamp(20px, 3.2vw, 38px) / 1.1 Heebo,
    Arial,
    sans-serif;
  box-shadow: 0 12px 34px rgb(0 0 0 / 0.4);
  border-top: 6px solid var(--paper-ink);
}
.leak-overlay p:nth-child(1) {
  top: 20%;
  right: 12%;
  transform: rotate(-6deg);
}
.leak-overlay p:nth-child(2) {
  top: 44%;
  left: 14%;
  transform: rotate(4deg);
}
.leak-overlay p:nth-child(3) {
  bottom: 24%;
  right: 26%;
  transform: rotate(-2deg);
}
.arena.leaked .leak-overlay {
  opacity: 1;
}

/* Touch controls */
.touch {
  position: absolute;
  inset: auto 0 calc(42px + var(--safe-b)) 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 14px;
  z-index: 8;
  pointer-events: none;
  direction: ltr;
}
.touch button {
  pointer-events: auto;
  border: 0;
  border-radius: 18px;
  background: rgb(11 20 34 / 0.6);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  backdrop-filter: blur(4px);
  font-weight: 900;
  touch-action: none;
}
.touch button.active {
  background: rgb(242 193 78 / 0.9);
  color: #201703;
}
.touch-steer {
  display: flex;
  gap: 10px;
}
.touch-steer button {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
}
.touch-steer svg {
  width: 36px;
  height: 36px;
  stroke-width: 3;
}
.touch-actions {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    'drift gas'
    'brake gas';
  gap: 10px;
}
.touch-gas {
  grid-area: gas;
  width: 84px;
  height: 128px;
}
.touch-drift {
  grid-area: drift;
  width: 84px;
  height: 59px;
}
.touch-brake {
  grid-area: brake;
  width: 84px;
  height: 59px;
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgb(6 11 20 / 0.55);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.sheet {
  width: min(560px, 100%);
  max-height: calc(100dvh - 2 * var(--gutter));
  overflow-y: auto;
  background: var(--panel-solid);
  border-radius: 18px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 30px 80px rgb(0 0 0 / 0.45);
  display: grid;
  gap: 16px;
  animation: sheet-in 0.3s ease-out;
}
.sheet.narrow {
  width: min(420px, 100%);
}
.sheet.wide {
  width: min(980px, 100%);
}
@keyframes sheet-in {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
}
.sheet h2 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 900;
  line-height: 1.08;
}
.sheet p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.actions > * {
  flex: 1 1 140px;
}
.settings {
  display: grid;
  gap: 12px;
}
.settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.settings output {
  color: var(--gold);
  font-weight: 800;
}
.settings input[type='range'] {
  width: 100%;
  accent-color: var(--gold);
}
.settings input[type='checkbox'] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
}

/* Results */
.results-head {
  display: grid;
  gap: 6px;
}
.results-board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.results-board li {
  display: grid;
  grid-template-columns: 26px 5px 40px 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 12px 4px 8px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.04);
}
.results-board li.me {
  background: var(--paper);
  color: var(--paper-ink);
}
.results-board .rank {
  font-weight: 900;
  font-size: 18px;
  text-align: center;
}
.results-board i {
  height: 30px;
  border-radius: 2px;
  background: var(--party);
}
.results-board img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-3);
}
.results-board .who b {
  display: block;
  font-weight: 800;
}
.results-board .who small {
  font-size: 13px;
  color: var(--muted);
}
.results-board li.me .who small {
  color: #555b66;
}
.results-board .time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.results-board .seats {
  min-width: 46px;
  text-align: center;
  font-weight: 900;
  color: var(--gold);
}
.results-board li.me .seats {
  color: #8a6400;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}
.result-stats div {
  background: rgb(255 255 255 / 0.04);
  border-radius: 10px;
  padding: 10px;
}
.result-stats dt {
  font-size: 12px;
  color: var(--muted);
}
.result-stats dd {
  margin: 2px 0 0;
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

/* Knesset chamber: 120 seats in a hemicycle, coloured by party. */
.seat-panel {
  display: grid;
  gap: 10px;
}
.chamber {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
.chamber svg {
  width: 100%;
  height: auto;
  display: block;
  stroke: none;
}
.chamber.large {
  max-width: 560px;
}
.chamber-sum {
  text-align: center;
  font-weight: 800;
  font-size: 18px;
}
.chamber-sum b {
  font-size: 34px;
  font-weight: 900;
}
.chamber-sum.majority b {
  color: var(--green);
}
.chamber-sum small {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* Coalition talks */
.talks-head {
  display: grid;
  gap: 6px;
}
.talks-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.2fr);
  gap: 22px;
  align-items: start;
}
.talks-chamber {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 0;
}
.notice {
  border-radius: 10px;
  padding: 10px 12px;
  background: rgb(229 56 59 / 0.15);
  box-shadow: inset 0 0 0 1px rgb(229 56 59 / 0.5);
  font-weight: 700;
}
.offers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.offer {
  display: grid;
  grid-template-columns: 6px 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px 10px 10px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
}
.offer.joined {
  background: rgb(76 195 138 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(76 195 138 / 0.55);
}
.offer > i {
  align-self: stretch;
  border-radius: 3px;
  background: var(--party);
}
.offer img {
  width: 64px;
  height: 34px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 3px 4px;
}
.offer .who > b {
  display: block;
  font-weight: 800;
}
.offer .who small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
.offer .who .ask {
  color: var(--text);
}
.offer .who .ask em {
  font-style: normal;
  color: var(--gold);
  font-weight: 700;
}
.offer .seats {
  font-weight: 900;
}
.offer.blocked {
  opacity: 0.62;
}
.offer[data-preview]:not([data-preview='']) {
  cursor: default;
}
.offer[data-preview]:not([data-preview='']):hover,
.offer[data-preview]:not([data-preview='']):focus-within {
  background: rgb(255 255 255 / 0.08);
}
.offer .who .gain {
  color: var(--text);
}
.offer .who .gain.majority b {
  color: var(--green);
}
.offer .who .warn {
  color: #ff9a8f;
  font-weight: 700;
}
.offer .who .contract {
  color: #8fe0b6;
}
.offer .tier {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: 1px;
}
.offer .tier.t0 {
  background: rgb(76 195 138 / 0.2);
  color: #8fe0b6;
}
.offer .tier.t1 {
  background: rgb(242 193 78 / 0.2);
  color: var(--gold);
}
.offer .tier.t2 {
  background: rgb(229 56 59 / 0.25);
  color: #ff9a8f;
}
.talks-rules {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.talks-rules li {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.talks-rules b {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.chamber-sum.preview b {
  color: var(--gold);
}
.chamber-sum.preview.majority b {
  color: var(--green);
}
.chamber circle.ghost {
  animation: ghost-seat 1s ease-in-out infinite alternate;
}
@keyframes ghost-seat {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}
.offer button {
  min-height: 38px;
  font-size: 15px;
  padding: 0 14px;
}

/* Final count */
.final {
  text-align: center;
  justify-items: center;
}
.final-parties {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.final-parties li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.05);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700;
}
.final-parties li.in {
  box-shadow: inset 0 0 0 2px var(--gold);
}
.final-parties li i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--party);
}
.final-parties li b {
  font-weight: 900;
}

/* Who holds the chair: a pill under the chamber. */
.role-pill {
  justify-self: center;
  text-align: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  background: rgb(255 255 255 / 0.06);
  box-shadow: inset 0 0 0 1px var(--line);
}
.role-pill:empty {
  display: none;
}
.role-pill.r-pm,
.role-pill.r-rotation-first {
  background: rgb(242 193 78 / 0.16);
  box-shadow: inset 0 0 0 1px rgb(242 193 78 / 0.6);
  color: var(--gold);
}
.role-pill.r-rotation-second,
.role-pill.r-finance,
.role-pill.r-defense {
  background: rgb(127 233 255 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(127 233 255 / 0.45);
  color: #a9eeff;
}

/* Final count: the government and the ladder beside the chamber. */
.final-body {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.1fr);
  gap: 24px;
  align-items: start;
  text-align: start;
}
.final-gov h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--muted);
}
.final-gov h3 + .cabinet + h3 {
  margin-top: 16px;
}
.final-seats {
  display: grid;
  gap: 12px;
}
.cabinet {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.cabinet li {
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
  box-shadow: inset 4px 0 0 var(--party), inset 0 0 0 1px var(--line);
}
.cabinet li.me {
  background: rgb(242 193 78 / 0.1);
  box-shadow: inset 4px 0 0 var(--party), inset 0 0 0 2px var(--gold);
}
.cabinet img,
.cabinet .noface {
  grid-row: 1 / 4;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--party);
}
.cabinet .job {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}
.cabinet li.c-finance .job,
.cabinet li.c-defense .job {
  color: #a9eeff;
}
.cabinet b {
  font-weight: 900;
}
.cabinet small {
  font-size: 13px;
  color: var(--muted);
}
.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.ladder li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: rgb(255 255 255 / 0.03);
}
.ladder li.above {
  opacity: 0.55;
}
.ladder li.here {
  color: var(--text);
  background: rgb(242 193 78 / 0.16);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.ladder em {
  font-style: normal;
  color: var(--gold);
  font-weight: 900;
}

/* Help dialog */
dialog#info {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border: 0;
  border-radius: 18px;
  padding: 28px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 30px 80px rgb(0 0 0 / 0.5);
}
dialog#info::backdrop {
  background: rgb(6 11 20 / 0.6);
}
dialog#info h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 900;
}
dialog#info h3 {
  margin: 18px 0 6px;
  font-size: 17px;
  color: var(--gold);
}
dialog#info p,
dialog#info li {
  line-height: 1.55;
  color: #d5dbe5;
}
dialog#info a {
  color: var(--gold);
}
dialog#info kbd {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  font:
    800 12px Heebo,
    Arial;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  margin: 0 2px;
}
.close {
  position: absolute;
  top: 14px;
  left: 14px;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}
.help-grid li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 10px;
  align-items: center;
  background: rgb(255 255 255 / 0.04);
  border-radius: 10px;
  padding: 10px;
}
.help-grid li svg {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  color: var(--gold);
}
.help-grid li b {
  font-weight: 800;
  color: var(--text);
}
.help-grid li small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

/* Medium screens */

/* Phones and small touch screens */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  :root {
    --gutter: 12px;
  }
  .hud-standing {
    width: auto;
  }
  .hud-position b {
    font-size: 58px;
    letter-spacing: -2px;
  }
  .hud-position span {
    font-size: 20px;
  }
  .hud-lap {
    font-size: 12px;
    margin: 4px 0;
  }
  .hud-board {
    display: none;
  }
  .hud-top {
    top: calc(var(--gutter) + 2px);
  }
  .hud-top > * {
    padding: 4px 8px;
  }
  .hud-sector {
    display: none;
  }
  .hud-clock {
    font-size: 15px;
  }
  #minimap {
    width: 112px;
    height: 84px;
  }
  .hud-map-tools {
    display: flex;
  }
  .hud-map {
    flex-direction: column;
  }
  .hud-kit {
    left: auto;
    right: 12px;
    bottom: calc(210px + var(--safe-b));
    flex-direction: column;
    align-items: flex-end;
  }
  .item-slot,
  .ability {
    padding: 6px;
  }
  .kit-copy {
    display: none;
  }
  .item-icon,
  .ability img {
    width: 54px;
    height: 54px;
  }
  .hud-drive {
    bottom: calc(150px + var(--safe-b));
  }
  .drift-meter {
    width: 170px;
  }
  .ticker {
    height: calc(30px + var(--safe-b));
  }
  .ticker-tag,
  .ticker-text {
    font-size: 13px;
  }
  .race-hint {
    bottom: calc(260px + var(--safe-b));
    white-space: normal;
    width: max-content;
    max-width: 86vw;
    text-align: center;
  }
  .talks-body {
    grid-template-columns: 1fr;
  }
  .final-body {
    grid-template-columns: 1fr;
  }
  .talks-rules {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .talks-rules li {
    padding: 6px 10px;
  }
  .talks-rules b {
    display: inline;
    margin-inline-end: 6px;
  }
  .talks-chamber {
    position: static;
  }
  .offer {
    grid-template-columns: 6px 1fr auto;
  }
  .offer img {
    display: none;
  }
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .results-board li {
    grid-template-columns: 22px 4px 34px 1fr auto auto;
    gap: 7px;
  }
  .results-board img {
    width: 34px;
    height: 34px;
  }
}
@media (pointer: coarse) and (max-height: 520px) {
  .touch-steer button,
  .touch-gas,
  .touch-drift,
  .touch-brake {
    width: 70px;
  }
  .touch-steer button {
    height: 70px;
  }
  .touch-gas {
    height: 100px;
  }
  .touch-drift,
  .touch-brake {
    height: 45px;
  }
  .hud-kit {
    bottom: calc(150px + var(--safe-b));
  }
  .hud-drive {
    bottom: calc(44px + var(--safe-b));
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Signed numbers and times read left-to-right inside Hebrew text. */
.hud-board small,
.results-board .time,
.results-board .seats,
.offer .seats,
.final-parties b,
.hud-clock,
.result-stats dd {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Results: standings beside the chamber on wide screens. */
.sheet.results {
  width: min(980px, 100%);
  grid-template-columns: 1fr;
}
.sheet.results.with-seats {
  grid-template-columns: 1.25fr 1fr;
  grid-template-areas:
    'head head'
    'board seats'
    'stats seats'
    'actions actions';
  align-items: start;
}
.sheet.results.with-seats .results-head {
  grid-area: head;
}
.sheet.results.with-seats .results-board {
  grid-area: board;
}
.sheet.results.with-seats .seat-panel {
  grid-area: seats;
  align-self: center;
}
.sheet.results.with-seats .result-stats {
  grid-area: stats;
  grid-template-columns: repeat(2, 1fr);
}
.sheet.results.with-seats .actions {
  grid-area: actions;
}
@media (max-width: 760px) {
  .sheet.results.with-seats {
    grid-template-columns: 1fr;
    grid-template-areas: 'head' 'board' 'seats' 'stats' 'actions';
  }
}
.final .actions {
  width: min(520px, 100%);
}

/* Phone title screen: 3D kart on top, compact garage, start button pinned to the bottom. */
@media (max-width: 760px) {
  .hud-drive {
    bottom: auto;
    top: calc(var(--gutter) + 50px);
  }
}

/* Landscape phones: garage and mode panel side by side, everything on one screen. */
@media (pointer: coarse) and (max-height: 520px) and (min-width: 600px) {
  .icon-button {
    width: 36px;
    height: 36px;
  }
}

/* Cinematic moments: the HUD steps aside for the intro flyover and the finish. */
.arena.cinematic .hud > :not(.ticker),
.arena.cinematic .touch {
  opacity: 0;
  transition: opacity 0.3s;
}
.arena.cinematic .vignette {
  box-shadow:
    inset 0 90px 60px -40px rgb(0 0 0 / 0.7),
    inset 0 -90px 60px -40px rgb(0 0 0 / 0.7);
}


/* On small screens long sheets scroll, but their action buttons stay in reach. */
@media (max-width: 760px), (max-height: 520px) {
  .sheet > .actions {
    position: sticky;
    bottom: calc(-1 * clamp(18px, 3vw, 30px));
    margin-bottom: calc(-1 * clamp(18px, 3vw, 30px));
    padding: 12px 0 clamp(18px, 3vw, 30px);
    background: linear-gradient(transparent, var(--panel-solid) 22%);
    z-index: 2;
  }
}

/* Ballot meter: ten paper slips; carried ones are bright, slots a partner's cap removed are struck. */
.ballots {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border-radius: 8px;
  padding: 4px 10px;
}
.ballots .hud-coins {
  background: none;
  padding: 0;
}
.ballot-slots {
  display: flex;
  gap: 3px;
}
.ballot-slots i {
  width: 9px;
  height: 13px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.16);
}
.ballot-slots i.on {
  background: #f7f5ee;
  box-shadow: 0 0 6px rgb(255 255 255 / 0.35);
}
.ballot-slots i.off {
  background: repeating-linear-gradient(45deg, rgb(229 56 59 / 0.6) 0 2px, transparent 2px 4px);
}

/* ——— Touch driving ———
   Left/lower area: drag anywhere to steer (a stick appears under the thumb).
   Right thumb arc: ability, item and drift buttons, stacked within reach. */
.touch {
  inset: 0;
  padding: 0;
  display: block;
  pointer-events: none;
}
.steer-zone {
  position: absolute;
  left: 0;
  top: 24%;
  bottom: calc(38px + var(--safe-b));
  width: 60%;
  pointer-events: auto;
  touch-action: none;
}
.stick {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}
.stick-base,
.stick-knob {
  position: absolute;
  border-radius: 50%;
  translate: -50% -50%;
}
.stick-base {
  width: 120px;
  height: 120px;
  background: rgb(11 20 34 / 0.28);
  box-shadow:
    inset 0 0 0 2px rgb(255 255 255 / 0.35),
    0 0 0 1px rgb(11 20 34 / 0.3);
}
.stick-knob {
  width: 56px;
  height: 56px;
  background: rgb(255 255 255 / 0.9);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.35);
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.stick[data-tier='1'] .stick-knob {
  background: #7fe9ff;
  box-shadow: 0 0 22px #7fe9ff;
}
.stick[data-tier='2'] .stick-knob {
  background: #ffb14a;
  box-shadow: 0 0 24px #ffb14a;
}
.stick[data-tier='3'] .stick-knob {
  background: #ee8dff;
  box-shadow: 0 0 28px #ee8dff;
}
.steer-hint {
  position: absolute;
  left: 50%;
  top: 55%;
  translate: -50% -50%;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--panel);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  animation: hint-breathe 1.6s ease-in-out infinite;
}
@keyframes hint-breathe {
  50% {
    opacity: 0.55;
  }
}
.steer-zone .touch-steer {
  display: none;
}
.steer-zone.buttons-mode .touch-steer {
  display: flex;
  position: absolute;
  left: 14px;
  bottom: 8px;
  gap: 10px;
}
.steer-zone.buttons-mode .steer-hint {
  display: none;
}
.touch .touch-drift {
  position: absolute;
  right: 14px;
  bottom: calc(44px + var(--safe-b));
  width: 92px;
  height: 92px;
  border-radius: 50%;
  font-size: 16px;
  pointer-events: auto;
  --charge: 0;
  --tier-color: rgb(255 255 255 / 0.5);
  display: grid;
  place-items: center;
  isolation: isolate;
  transition:
    background 0.25s,
    box-shadow 0.25s,
    transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
/* The rim fills with the drift charge in the tier colour (blue, orange, purple). */
.touch-drift[data-tier='1'] {
  --tier-color: #7fe9ff;
}
.touch-drift[data-tier='2'] {
  --tier-color: #ffb14a;
}
.touch-drift[data-tier='3'] {
  --tier-color: #ee8dff;
}
.drift-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(var(--tier-color) calc(var(--charge) * 1turn), transparent 0);
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  pointer-events: none;
}
.touch-drift[data-tier='3'] .drift-ring {
  filter: drop-shadow(0 0 8px #ee8dff);
}
/* Both faces share one cell and swap with a flip-and-zoom. */
.drift-face {
  grid-area: 1 / 1;
  transition:
    opacity 0.22s,
    transform 0.32s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.speed-face {
  display: grid;
  justify-items: center;
  gap: 0;
  opacity: 0;
  transform: scale(0.4) rotate(-25deg);
}
.speed-face svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.speed-face b {
  font-size: 13px;
  letter-spacing: 0.02em;
}
.touch .touch-drift.boosting {
  background: linear-gradient(160deg, #ffe08a, #ff8a3d 55%, #e5383b);
  color: #2a0d00;
  box-shadow:
    0 0 0 3px rgb(255 214 120 / 0.55),
    0 0 26px rgb(255 138 61 / 0.85);
  transform: scale(1.08);
}
.touch-drift.boosting .drift-ring {
  opacity: 0;
}
.touch-drift.boosting .drift-text {
  opacity: 0;
  transform: scale(1.6);
}
.touch-drift.boosting .speed-face {
  opacity: 1;
  transform: none;
}
.touch-drift.boosting .speed-face svg {
  animation: turbo-chevrons 0.4s linear infinite;
}
@keyframes turbo-chevrons {
  from {
    transform: translateY(6px);
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: translateY(-6px);
    opacity: 0.55;
  }
}
/* A shockwave ring bursts out as each boost starts. */
.touch-drift::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #ffd27a;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.touch-drift.burst::after {
  animation: turbo-burst 0.55s ease-out;
}
@keyframes turbo-burst {
  from {
    transform: scale(1);
    opacity: 0.95;
  }
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .touch-drift.boosting .speed-face svg,
  .touch-drift.burst::after {
    animation: none;
  }
}
@media (pointer: coarse) {
  .item-slot,
  .ability {
    touch-action: none;
  }
  .hud-kit {
    left: auto;
    right: 14px;
    bottom: calc(148px + var(--safe-b));
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
  }
  .item-slot,
  .ability {
    padding: 6px;
    border-radius: 50%;
  }
  .hud-kit .kit-copy {
    display: none;
  }
  .item-icon,
  .ability img {
    width: 66px;
    height: 66px;
    border-radius: 50%;
  }
  .race-hint {
    top: 30%;
    bottom: auto;
  }
}
/* Portrait phones: steer with the thumb over the lower screen, buttons in the right column. */
@media (pointer: coarse) and (orientation: portrait) {
  .steer-zone {
    top: 42%;
    width: auto;
    right: 112px;
  }
}
.touch-only {
  display: none !important;
}
@media (pointer: coarse) {
  .touch-only {
    display: flex !important;
  }
}
.segmented {
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}
.segmented > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.06);
}
.segmented button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  background: none;
  font-weight: 700;
}
.segmented button[aria-checked='true'] {
  background: var(--gold);
  color: #201703;
}

/* Compact ballot meter on phones: slots and the vote count only, on one line. */
@media (max-width: 760px) {
  .hud-drive {
    top: calc(var(--gutter) + 46px);
    left: 50%;
  }
  .ballots {
    white-space: nowrap;
    padding: 3px 8px;
  }
  .ballot-slots i {
    width: 7px;
    height: 11px;
  }
  .ballots .hud-coins {
    font-size: 12px;
  }
}
/* Short landscape screens: a tighter thumb column so it clears the position block. */
@media (pointer: coarse) and (max-height: 520px) {
  .touch .touch-drift {
    width: 76px;
    height: 76px;
    bottom: calc(40px + var(--safe-b));
  }
  .hud-kit {
    bottom: calc(124px + var(--safe-b));
    gap: 6px;
  }
  .item-icon,
  .ability img {
    width: 54px;
    height: 54px;
  }
  .hud-kit {
    flex-direction: row-reverse;
    align-items: flex-end;
  }
  .hud-drive {
    bottom: calc(40px + var(--safe-b));
  }
}
@media (max-width: 760px) and (orientation: portrait) {
  .hud-drive {
    top: calc(var(--gutter) + 150px);
  }
}
