/* Catan: one stylesheet (ADR-0012). Logical properties, so Farsi (dir="rtl") mirrors panels by itself (ADR-0011).
   No text is smaller than 12px; buttons are at least 44px tall for fingers. */

:root {
  --ink: #1d1b16;
  --muted: #5f584a;
  --paper: #f4ecd9;
  --card: #fffaf0;
  --line: #d8c9a6;
  --sea: #3b7fb3;
  --accent: #0d47a1;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --focus: #ff8f00;
  --radius: 10px;
  --bar: 52px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}

html[lang="fa"] {
  font-size: 17px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  line-height: 1.4;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  min-height: 44px;
  padding-block: 8px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

input[type="text"],
input[type="password"] {
  min-height: 44px;
  width: 100%;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

h1,
h2 {
  margin: 0;
}

h2 {
  font-size: 1rem;
  margin-block-end: 8px;
}

a {
  color: var(--accent);
}

code {
  font-size: 0.85rem;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Top bar ------------------------------------------------------------------------------------------------------ */

.bar {
  position: sticky;
  inset-block-start: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  block-size: var(--bar);
  padding-inline: 12px;
  background: #5b3a1e;
  color: #fff8e7;
}

.bar .title {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.bar .status {
  flex: 1;
  font-size: 0.85rem;
  color: #ffe0b2;
}

.bar .language {
  min-height: 36px;
  padding-block: 4px;
  background: transparent;
  color: #fff8e7;
  border-color: #c8a27a;
}

/* ---- Pages --------------------------------------------------------------------------------------------------------- */

.content {
  max-inline-size: 520px;
  margin-inline: auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field {
  display: grid;
  gap: 4px;
}

.health {
  margin: 0;
  color: var(--muted);
}

.error {
  color: var(--danger);
  min-block-size: 1.2em;
}

.notice-page {
  padding: 24px;
  text-align: center;
}

.loading {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

/* ---- The game table ------------------------------------------------------------------------------------------------ */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.board-area {
  position: relative;
  display: flex;
  flex-direction: column;
  block-size: calc(100dvh - var(--bar));
  min-block-size: 360px;
  background: radial-gradient(ellipse at 50% 42%, #4b93c8 0%, var(--sea) 45%, #1f4f78 100%);
}

/* The board and the dice thrown on it. */
.board-stage {
  position: relative;
  flex: 1 1 auto;
  min-block-size: 0;
}

.board {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  touch-action: manipulation;
}

.prompt {
  flex: 0 0 auto;
  max-block-size: 46dvh;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--card);
  border-block-start: 3px solid #5b3a1e;
}

.prompt:empty {
  display: none;
}

.prompt-title {
  font-size: 1.05rem;
  margin-block-end: 6px;
}

.prompt p {
  margin-block: 4px;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 6px;
}

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

.choice.chosen {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.counts {
  display: grid;
  gap: 4px;
}

.count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 2.5em 44px;
  align-items: center;
  gap: 6px;
}

.count-value {
  text-align: center;
  font-weight: 700;
}

.step {
  padding: 0;
  font-size: 1.2rem;
}

.toast {
  position: absolute;
  inset-block-start: 10px;
  inset-inline: 12px;
  z-index: 3;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #263238;
  color: #fff;
  font-size: 0.95rem;
}

/* Why a move was refused, for the games that have no Catan board to hold it. */
.game-toast {
  position: fixed;
  inset-block-start: calc(var(--bar) + 10px);
  inset-inline: 12px;
  z-index: 30;
  max-inline-size: 560px;
  margin-inline: auto;
}

.winner {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}

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

.offer,
.counter-offer {
  display: grid;
  gap: 4px;
  padding: 8px;
  margin-block: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.offer-line .label {
  min-inline-size: 3.5em;
  color: var(--muted);
}

.countdown {
  font-weight: 700;
  color: var(--danger);
}

/* ---- Side panels --------------------------------------------------------------------------------------------------- */

.side {
  display: grid;
  gap: 12px;
  padding: 12px;
  align-content: start;
}

.players,
.hand,
.events,
.host-tools,
.lobby {
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.player {
  padding-block: 6px;
  border-block-end: 1px solid var(--line);
}

.player.current {
  background: #fff3cd;
  border-radius: 6px;
  padding-inline: 6px;
}

.player-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 600;
}

.player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.player-stats .points {
  color: var(--ink);
  font-weight: 700;
}

.award {
  color: #6a1b9a;
  font-weight: 600;
}

.tag {
  font-size: 0.75rem;
  padding-inline: 6px;
  border-radius: 999px;
  background: #ece2c6;
  font-weight: 500;
}

.online {
  font-size: 0.75rem;
  color: #2e7d32;
  font-weight: 500;
}

.online.away {
  color: var(--muted);
}

.name {
  unicode-bidi: isolate;
}

.seat-badge {
  display: inline-grid;
  place-items: center;
  inline-size: 26px;
  block-size: 26px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  border: 2px solid #000;
  flex: 0 0 auto;
}

.seat-1 .seat-badge,
.seat-badge.seat-1 {
  background: #c62828;
  color: #fff;
  border-color: #5d0f0f;
}

.seat-badge.seat-2 {
  background: #1565c0;
  color: #fff;
  border-color: #0b2f57;
}

.seat-badge.seat-3 {
  background: #ef6c00;
  color: #fff;
  border-color: #6b3000;
}

.seat-badge.seat-4 {
  background: #f5f5f5;
  color: #212121;
  border-color: #424242;
}

.seat-badge.seat-5 {
  background: #2e7d32;
  color: #fff;
  border-color: #103d14;
}

.seat-badge.seat-6 {
  background: #6d4c41;
  color: #fff;
  border-color: #2c1e19;
}

.bank {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-block-start: 8px;
  font-size: 0.85rem;
}

.resource {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.icon {
  inline-size: 22px;
  block-size: 22px;
  flex: 0 0 auto;
  vertical-align: middle;
}

.award {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.card-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dev-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dev-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  inline-size: 84px;
  padding: 8px 6px;
  border: 2px solid #8d6e63;
  border-radius: 8px;
  background: linear-gradient(#fffaf0, #f3e3c3);
  text-align: center;
}

.dev-card.new {
  border-style: dashed;
  opacity: 0.8;
}

.card-art {
  inline-size: 44px;
  block-size: 44px;
}

.card-name {
  font-size: 0.8rem;
  line-height: 1.2;
}

.resource-name {
  font-size: 0.85rem;
}

.cards {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.card-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.hand-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}

.hand-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.hand-card.none {
  opacity: 0.5;
}

.hand-card .count {
  font-weight: 700;
  font-size: 1.1rem;
}

.dev-cards ul,
.events ul,
.lobby-players {
  margin: 0;
  padding-inline-start: 18px;
}

.events li {
  font-size: 0.85rem;
  margin-block: 2px;
}

.lobby-players {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}

.lobby-players li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.links {
  display: grid;
  gap: 8px;
  margin-block: 10px;
}

.link-row {
  display: flex;
  gap: 6px;
  align-items: end;
}

.link-row label {
  flex: 1;
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
}

.host-tools summary {
  cursor: pointer;
  min-block-size: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

/* ---- The board (SVG). Sizes here are in board units; the board scales as a whole. ----------------------------- */

.tile polygon {
  stroke-linejoin: round;
}

.tiles {
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}

.token {
  fill: #f7efd9;
  stroke: #5b4a2f;
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.45));
}

/* The tiles whose number was rolled this turn. */
.produced {
  pointer-events: none;
}

.produced-edge {
  fill: rgba(255, 236, 150, 0.16);
  stroke: #ffd54f;
  stroke-width: 5;
  stroke-linejoin: round;
}

.produced-ring {
  fill: none;
  stroke: #ffb300;
  stroke-width: 4;
}

.token-number {
  font-size: 18px;
  font-weight: 700;
  fill: #2b2b2b;
}

.token-number.red {
  fill: #b71c1c;
}

.pips circle {
  fill: #444;
}

.pips.red circle {
  fill: #b71c1c;
}

.harbor-pier {
  stroke: #6d4c41;
  stroke-width: 3;
}

.harbor-disc {
  fill: #fff8e1;
  stroke: #6d4c41;
  stroke-width: 2;
}

.harbor-label {
  font-size: 12px;
  font-weight: 700;
  fill: #3e2723;
}

.road,
.road-outline {
  stroke-linecap: round;
}

.road {
  stroke-width: 7;
}

.road-outline {
  stroke-width: 11;
}

.road-symbol {
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.piece-symbol {
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.robber-disc {
  fill: rgba(255, 250, 240, 0.85);
  stroke: #1f2a30;
  stroke-width: 2;
}

.target .target-mark {
  pointer-events: none;
}

.target.corner .target-mark {
  fill: rgba(255, 255, 255, 0.9);
  stroke: var(--accent);
  stroke-width: 3;
}

.target.edge .target-mark {
  stroke: #ffffff;
  stroke-width: 8;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
}

.target.field .target-mark {
  fill: rgba(255, 255, 255, 0.25);
  stroke: #ffffff;
  stroke-width: 4;
  stroke-dasharray: 8 6;
}

.target.selected .target-mark,
.target:focus-within .target-mark {
  stroke: var(--focus);
  fill: #ffd54f;
}

.target.edge.selected .target-mark {
  stroke: var(--focus);
  stroke-dasharray: none;
}

.target.field.selected .target-mark {
  fill: rgba(255, 213, 79, 0.45);
}

.hit {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
  outline: none;
}

.target.edge .hit {
  stroke-width: 26;
  stroke-linecap: round;
}

/* ---- Dice. Drawn in CSS: a cube is six faces turned in 3D; .show-N turns it so face N is in front. ------------ */

.die-red {
  --die-body: linear-gradient(145deg, #ef5350, #b71c1c);
  --die-pip: #fff8e7;
}

.die-yellow {
  --die-body: linear-gradient(145deg, #ffe082, #f9a825);
  --die-pip: #3e2723;
}

.die-face {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 14%;
  border-radius: 18%;
  background: var(--die-body);
  direction: ltr;
}

.pip {
  inline-size: 80%;
  aspect-ratio: 1;
  place-self: center;
  border-radius: 50%;
  background: var(--die-pip);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.p11 { grid-area: 1 / 1; }
.p13 { grid-area: 1 / 3; }
.p21 { grid-area: 2 / 1; }
.p22 { grid-area: 2 / 2; }
.p23 { grid-area: 2 / 3; }
.p31 { grid-area: 3 / 1; }
.p33 { grid-area: 3 / 3; }

.die-flat,
.die-mini {
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
}

.die-flat {
  inline-size: 26px;
  block-size: 26px;
}

.die-mini {
  inline-size: 16px;
  block-size: 16px;
  margin-inline-start: 4px;
}

.die-flat .die-face,
.die-mini .die-face {
  inline-size: 100%;
  block-size: 100%;
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.die-mini .die-face {
  padding: 12%;
}

/* This turn's roll in the top bar. */
.top-dice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-block: 3px;
  padding-inline: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  direction: ltr;
  transition:
    opacity 0.25s ease-out,
    transform 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}

/* While the dice are still on the board: hidden at once, then shown with the transition above. */
.top-dice.arriving {
  opacity: 0;
  transform: scale(0.5);
  transition: none;
}

.top-dice-total {
  min-inline-size: 1.4em;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  color: #fff8e7;
}

/* A new roll thrown on the board. It never takes a tap: the board stays usable underneath. */
.roll-show {
  --s: clamp(54px, 11vmin, 88px);
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: calc(var(--s) * 0.3);
  pointer-events: none;
}

.roll-show::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side, rgba(10, 20, 30, 0.5), transparent);
  transition: opacity 0.2s;
}

.roll-show.leaving::before {
  opacity: 0;
}

.roll-dice {
  position: relative;
  display: flex;
  gap: calc(var(--s) * 0.5);
  direction: ltr;
}

.die3d {
  --spin-x: 720deg;
  --spin-y: 540deg;
  position: relative;
  inline-size: var(--s);
  block-size: var(--s);
  perspective: calc(var(--s) * 6);
  isolation: isolate;
}

.die3d.die-yellow {
  --spin-x: -540deg;
  --spin-y: 900deg;
}

/* Its shadow on the table. */
.die3d::after {
  content: "";
  position: absolute;
  inset-inline: 6%;
  inset-block-end: -18%;
  block-size: 20%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), transparent);
}

.die3d.show-1 { --rx: 0deg; --ry: 0deg; }
.die3d.show-2 { --rx: 0deg; --ry: -90deg; }
.die3d.show-3 { --rx: -90deg; --ry: 0deg; }
.die3d.show-4 { --rx: 90deg; --ry: 0deg; }
.die3d.show-5 { --rx: 0deg; --ry: 90deg; }
.die3d.show-6 { --rx: 0deg; --ry: 180deg; }

/* The first two turns tilt the resting die, so its top and side show. */
.cube {
  position: relative;
  inline-size: 100%;
  block-size: 100%;
  transform-style: preserve-3d;
  transform: rotateX(-16deg) rotateY(20deg) rotateX(var(--rx)) rotateY(var(--ry));
}

.cube .die-face {
  position: absolute;
  inset: 0;
  border-radius: 14%;
  backface-visibility: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    inset 0 0 calc(var(--s) * 0.16) rgba(0, 0, 0, 0.28);
}

.cube .f1 { transform: translateZ(calc(var(--s) / 2)); }
.cube .f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube .f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube .f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.cube .f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube .f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }

/* The sum, on a number token like the board's. */
.roll-total {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: calc(var(--s) * 1.2);
  block-size: calc(var(--s) * 1.2);
  border: 3px solid #5b4a2f;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffdf5, #efdfb6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  font-size: calc(var(--s) * 0.62);
  font-weight: 800;
  line-height: 1;
  color: #2b2b2b;
}

.roll-total.red {
  color: #b71c1c;
}

/* A seven moves the robber. */
.roll-total.seven {
  border-color: #000;
  background: radial-gradient(circle at 35% 30%, #455a64, #1f2a30);
  color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  .die3d {
    animation: die-throw 1.15s cubic-bezier(0.3, 0.7, 0.4, 1) both;
  }

  .die3d.die-yellow {
    animation-delay: 0.08s;
  }

  .cube {
    animation: die-tumble 1.15s cubic-bezier(0.2, 0.6, 0.3, 1) both;
  }

  .die3d.die-yellow .cube {
    animation-delay: 0.08s;
  }

  .roll-show::before {
    animation: roll-fade 0.3s ease-out both;
  }

  .roll-total {
    animation: total-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) 1.1s backwards;
  }

  .roll-show.leaving {
    animation: roll-leave 0.6s cubic-bezier(0.5, 0, 0.75, 0) forwards;
  }

  .produced {
    animation:
      roll-fade 0.5s ease-out 1.1s backwards,
      produced-pulse 1s ease-in-out 1.6s 3;
  }
}

@keyframes die-throw {
  0% {
    opacity: 0;
    transform: translate(calc(var(--s) * -3), calc(var(--s) * 2.2)) scale(1.3);
  }

  12% {
    opacity: 1;
  }

  55% {
    transform: translate(0, calc(var(--s) * -0.45)) scale(1.05);
  }

  72% {
    transform: translate(0, 0) scale(1);
  }

  85% {
    transform: translate(0, calc(var(--s) * -0.12)) scale(1);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes die-tumble {
  from {
    transform: rotateX(-16deg) rotateY(20deg) rotateX(calc(var(--rx) + var(--spin-x)))
      rotateY(calc(var(--ry) + var(--spin-y)));
  }

  to {
    transform: rotateX(-16deg) rotateY(20deg) rotateX(var(--rx)) rotateY(var(--ry));
  }
}

@keyframes roll-fade {
  from {
    opacity: 0;
  }
}

@keyframes total-pop {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
}

@keyframes roll-leave {
  to {
    opacity: 0.5;
    transform: translate(var(--fly-x, 0px), var(--fly-y, -45vh)) scale(0.3);
  }
}

@keyframes produced-pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---- Wider screens: the board next to the panels -------------------------------------------------------------- */

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  .side {
    block-size: calc(100dvh - var(--bar));
    overflow-y: auto;
  }
}

/* Pieces stand on a light disc so they stand out from any tile. */
.piece-ground {
  fill: rgba(255, 250, 240, 0.7);
}

/* Terrain pictures (ADR-0013): a light edge between tiles. */
.tile-edge {
  fill: none;
  stroke: #f4ecd6;
  stroke-width: 3;
}

.sea-tile {
  opacity: 0.9;
}

/* ---- Choosing a game ------------------------------------------------------------------------------------------- */

.game-choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.game-choice legend {
  padding: 0;
  margin-block-end: 6px;
  font-weight: 600;
}

.game-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.game-option {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.game-option input {
  position: absolute;
  opacity: 0;
  inline-size: 1px;
  block-size: 1px;
}

.game-option.chosen {
  border-color: var(--accent);
  background: #eef3fd;
  box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.15);
}

.game-option:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.game-picture {
  inline-size: 48px;
  block-size: 48px;
  object-fit: cover;
  border-radius: 10px;
}

.game-picture.catan {
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.game-text {
  display: grid;
  gap: 1px;
}

.game-players,
.game-blurb {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Azul ------------------------------------------------------------------------------------------------------
   The tiles, factory plates and wall pattern are drawn for this project (docs/project/CREDITS.md). Every colour has
   its own motif, so tiles are never told apart by colour alone. Player boards are pictures and stay left to right. */

.azul-game {
  --az-cobalt: #1f4fa3;
  --az-navy: #14284f;
  --az-gold: #e0b743;
  --az-glow: #ffc83d;
  --az-linen: #f7f1e3;
  min-block-size: 100dvh;
  background: #efe7d3 url("/assets/img/azul-pattern.svg") repeat;
  background-size: 120px 120px;
}

.azul-game .bar {
  background: var(--az-navy);
  box-shadow: 0 2px 0 var(--az-gold);
}

.azul-game .bar .status {
  color: #c9d8f5;
}

.azul-game .bar .language {
  border-color: #6f86b8;
}

.az-tile {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 1;
  user-select: none;
}

.az-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  max-inline-size: 1440px;
  margin-inline: auto;
  padding: 12px;
}

.az-play {
  display: grid;
  gap: 10px;
  align-content: start;
}

.az-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.az-chip {
  padding: 2px 10px;
  border: 1px solid #d9cdb2;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.85);
  color: #3b3a36;
  font-size: 0.85rem;
}

.az-chip.strong {
  background: var(--az-cobalt);
  border-color: var(--az-cobalt);
  color: #fff;
  font-weight: 600;
}

/* The factory displays stand in a ring around the centre of the table. */
.az-market {
  inline-size: 100%;
  max-inline-size: 580px;
  margin-inline: auto;
}

.az-ring {
  --n: 9;
  --f: 21%;
  --r: -181%;
  --c: 50%;
  position: relative;
  aspect-ratio: 1;
  container-type: inline-size;
}

.az-market.n5 .az-ring {
  --n: 5;
  --f: 26%;
  --r: -135%;
  --c: 41%;
}

.az-market.n7 .az-ring {
  --n: 7;
  --f: 23%;
  --r: -161%;
  --c: 46%;
}

.az-ring::before {
  content: "";
  position: absolute;
  inset: 0.5%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 60%),
    radial-gradient(circle, #f6efdf 0%, #ece0c6 70%, #e2d2b1 100%);
  box-shadow:
    0 0 0 3px #fffaf0,
    0 0 0 5px var(--az-gold),
    0 14px 34px rgba(20, 40, 80, 0.22);
}

.az-factory {
  position: absolute;
  left: 50%;
  top: 50%;
  inline-size: var(--f);
  aspect-ratio: 1;
  background: url("/assets/img/azul-factory.svg") center / contain no-repeat;
  transform: translate(-50%, -50%) rotate(calc(var(--i) / var(--n) * 1turn)) translateY(var(--r))
    rotate(calc(var(--i) / var(--n) * -1turn));
}

.az-factory:nth-child(1) { --i: 0; }
.az-factory:nth-child(2) { --i: 1; }
.az-factory:nth-child(3) { --i: 2; }
.az-factory:nth-child(4) { --i: 3; }
.az-factory:nth-child(5) { --i: 4; }
.az-factory:nth-child(6) { --i: 5; }
.az-factory:nth-child(7) { --i: 6; }
.az-factory:nth-child(8) { --i: 7; }
.az-factory:nth-child(9) { --i: 8; }

.az-factory.empty {
  opacity: 0.55;
}

.az-factory-tiles {
  position: absolute;
  inset: 23%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 6%;
}

.az-pick {
  min-block-size: 0;
  padding: 0;
  border: 0;
  border-radius: 12%;
  background: none;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    filter 0.15s ease;
}

.az-pick:disabled {
  opacity: 1;
  cursor: default;
}

.az-pick .az-tile {
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
}

.az-pick:not(:disabled):hover {
  transform: translateY(-2px) scale(1.05);
}

.az-pick.picked {
  transform: translateY(-3px) scale(1.08);
  outline: 3px solid var(--az-glow);
  outline-offset: 1px;
}

.az-pick.dimmed {
  opacity: 0.5;
}

/* The centre of the table: leftovers by colour, and the first player marker until someone takes from here. */
.az-center {
  position: absolute;
  left: 50%;
  top: 50%;
  inline-size: var(--c);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 4cqi 5cqi;
  padding: 7%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2b5db0, #1a3c78 70%, #132d5c);
  box-shadow:
    inset 0 6px 18px rgba(0, 0, 0, 0.45),
    0 0 0 4px #fffaf0,
    0 0 0 6px var(--az-gold);
}

.az-center .az-pick {
  position: relative;
  inline-size: clamp(26px, 8cqi, 46px);
}

.az-center-marker {
  inline-size: clamp(26px, 8cqi, 46px);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.az-stack {
  display: grid;
}

.az-stack .az-tile {
  grid-area: 1 / 1;
}

.az-stack .az-tile:nth-child(2) {
  translate: 3px -3px;
}

.az-stack .az-tile:nth-child(3) {
  translate: 6px -6px;
}

.az-count {
  position: absolute;
  inset-inline-end: -8px;
  inset-block-end: -8px;
  min-inline-size: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fffaf0;
  color: var(--az-navy);
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* The prompt stays in reach while the page scrolls between the market and the board. */
.az-prompt {
  position: sticky;
  inset-block-end: 8px;
  z-index: 4;
  padding: 12px 14px;
  border: 1px solid #d8c9a6;
  border-block-start: 4px solid var(--az-cobalt);
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.97);
  box-shadow: 0 8px 26px rgba(20, 40, 80, 0.2);
}

.az-prompt .prompt-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.az-prompt .waiting p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.az-picked {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.az-picked > .az-tile {
  inline-size: 40px;
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.az-summary {
  margin: 0;
  padding: 0;
  list-style: none;
}

.az-cost {
  margin: 6px 0 0;
  color: var(--danger);
  font-weight: 700;
}

/* Player boards: pattern lines, the wall, the floor line. */
.az-boards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  align-content: start;
}

.az-board {
  --t: 22px;
  --gap: 3px;
  padding: 10px 12px 12px;
  border: 1px solid #d6c7a3;
  border-radius: 16px;
  background: linear-gradient(180deg, #fdf9f0, #f2e8d3);
  box-shadow:
    inset 0 1px 0 #fff,
    0 6px 18px rgba(30, 40, 70, 0.12);
  transition: box-shadow 0.2s ease;
}

.az-board.mine {
  --t: clamp(24px, calc((100vw - 92px) / 11), 38px);
  grid-column: 1 / -1;
  justify-self: center;
  inline-size: 100%;
  max-inline-size: 560px;
  border: 2px solid var(--az-cobalt);
}

.az-board.current {
  box-shadow:
    0 0 0 3px var(--az-glow),
    0 8px 22px rgba(30, 40, 70, 0.18);
}

.az-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-block-end: 8px;
}

.az-board-head .name {
  font-weight: 700;
}

.az-score {
  margin-inline-start: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--az-navy);
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.az-starts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.az-starts .az-tile {
  inline-size: 20px;
}

.az-board-body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
}

.az-lines,
.az-arrows {
  display: grid;
  gap: var(--gap);
  padding-block: 4px;
}

.az-line-row {
  display: flex;
  justify-content: flex-end;
  inline-size: calc(5 * var(--t) + 4 * var(--gap));
}

.az-line,
.az-floor {
  display: flex;
  gap: var(--gap);
  min-block-size: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
}

.az-line:disabled,
.az-floor:disabled {
  opacity: 1;
  cursor: default;
}

.az-slot {
  inline-size: var(--t);
  block-size: var(--t);
  border-radius: 18%;
  background: #e3d6b9;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
}

.az-line.allowed .az-slot,
.az-floor.allowed .az-floor-slot::before {
  background: #dce8fb;
  box-shadow:
    inset 0 0 0 2px #2f6fdd,
    inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.az-line.chosen .az-slot,
.az-floor.chosen .az-floor-slot::before {
  background: #fff1c4;
  box-shadow:
    inset 0 0 0 2px var(--az-glow),
    inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.az-arrows span {
  block-size: var(--t);
  color: #b6a27a;
  font-size: calc(var(--t) * 0.7);
  line-height: var(--t);
}

.az-wall {
  display: grid;
  grid-template-columns: repeat(5, var(--t));
  gap: var(--gap);
  padding: 4px;
  border-radius: 10px;
  background: linear-gradient(160deg, #2a5aa8, #18396f);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.4),
    0 0 0 2px #fffaf0;
}

.az-cell {
  inline-size: var(--t);
  block-size: var(--t);
  border-radius: 16%;
  background: #f1e9d6;
}

.az-cell.placed .az-tile {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.az-cell:not(.placed) .az-tile {
  opacity: 0.32;
  filter: saturate(0.6);
}

.az-cell.next {
  outline: 2px dashed var(--az-glow);
  outline-offset: 1px;
}

.az-cell.next .az-tile {
  opacity: 0.85;
  filter: none;
}

.az-floor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 4px 10px;
  margin-block-start: 8px;
}

.az-floor-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.az-floor-slot {
  display: grid;
  grid-template-rows: 13px var(--t);
  justify-items: center;
  inline-size: var(--t);
}

.az-floor-slot::before {
  content: "";
  grid-area: 2 / 1;
  inline-size: var(--t);
  block-size: var(--t);
  border-radius: 18%;
  background: #ecd5cc;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
}

.az-floor-slot > .az-tile {
  grid-area: 2 / 1;
  inline-size: var(--t);
}

.az-penalty {
  grid-area: 1 / 1;
  color: #a63a2a;
  font-size: 11px;
  font-weight: 700;
  line-height: 13px;
}

.az-tile.ghost {
  opacity: 0.6;
}

.az-inline {
  display: inline-block;
  vertical-align: -0.25em;
}

.az-inline .az-tile {
  inline-size: 1.2em;
}

.az-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  align-items: start;
}

.az-round-line {
  font-weight: 700;
  color: var(--az-cobalt);
}

/* The lobby: the game's name over the usual lobby card. */
.az-lobby {
  display: grid;
  gap: 16px;
  max-inline-size: 560px;
  margin: 20px auto;
  padding-inline: 12px;
}

.az-banner {
  padding: 22px 16px 16px;
  border: 1px solid #d6c7a3;
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.92);
  text-align: center;
  box-shadow: 0 8px 26px rgba(20, 40, 80, 0.14);
}

.az-banner-tiles {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.az-banner-tiles .az-tile {
  inline-size: 46px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.az-banner h2 {
  margin: 12px 0 2px;
  color: var(--az-cobalt);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  letter-spacing: 0.18em;
}

.az-banner p {
  margin: 0;
  color: var(--muted);
}

/* The end: scores from the highest. */
.az-final ol {
  display: grid;
  gap: 6px;
  margin: 6px 0;
  padding: 0;
  list-style: none;
}

.az-final li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #e3d8bf;
  border-radius: 10px;
  background: #fff;
}

.az-final li.won {
  border-color: #e3c35b;
  background: linear-gradient(90deg, #fff1c2, #fffdf6);
}

.az-winner {
  margin: 4px 0 0;
  font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
  .az-line.allowed .az-slot,
  .az-floor.allowed .az-floor-slot::before {
    animation: az-pulse 1.4s ease-in-out infinite;
  }

  .az-tile.ghost {
    animation: az-ghost 1.1s ease-in-out infinite alternate;
  }

  .az-banner-tiles .az-tile {
    animation: az-drop 0.5s ease-out backwards;
  }

  .az-banner-tiles .az-tile:nth-child(2) { animation-delay: 0.08s; }
  .az-banner-tiles .az-tile:nth-child(3) { animation-delay: 0.16s; }
  .az-banner-tiles .az-tile:nth-child(4) { animation-delay: 0.24s; }
  .az-banner-tiles .az-tile:nth-child(5) { animation-delay: 0.32s; }
}

@keyframes az-pulse {
  50% {
    box-shadow:
      inset 0 0 0 3px #5b8ff0,
      inset 0 1px 3px rgba(0, 0, 0, 0.2);
  }
}

@keyframes az-ghost {
  from {
    opacity: 0.35;
  }

  to {
    opacity: 0.8;
  }
}

@keyframes az-drop {
  from {
    opacity: 0;
    transform: translateY(-14px) rotate(-8deg);
  }
}

/* Phones: the factories in rows above the centre, large enough for fingers, and the prompt fixed at the bottom
   of the screen, so Confirm stays in reach next to the player's own board. */
@media (max-width: 560px) {
  .az-layout {
    padding-block-end: 150px;
  }

  .az-prompt {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    max-block-size: 45dvh;
    overflow-y: auto;
    border-inline: 0;
    border-block-end: 0;
    border-radius: 16px 16px 0 0;
    padding-block-end: max(12px, env(safe-area-inset-bottom));
  }

  .az-ring {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    aspect-ratio: auto;
  }

  .az-ring::before {
    display: none;
  }

  .az-factory {
    position: relative;
    inset: auto;
    flex: 0 0 calc((100% - 12px) / 3);
    inline-size: auto;
    transform: none;
  }

  .az-center {
    position: relative;
    inset: auto;
    flex: 1 1 100%;
    inline-size: auto;
    min-block-size: 70px;
    aspect-ratio: auto;
    transform: none;
    padding: 12px;
    gap: 14px 18px;
    border-radius: 18px;
  }

  .az-center .az-pick,
  .az-center-marker {
    inline-size: 40px;
  }
}

/* Wide screens: the market beside the boards, with the history below. */
@media (min-width: 980px) {
  .az-layout {
    grid-template-columns: minmax(440px, 560px) minmax(0, 1fr);
    align-items: start;
  }

  .az-play {
    position: sticky;
    inset-block-start: calc(var(--bar) + 12px);
  }

  .az-side {
    grid-column: 1 / -1;
  }

  .az-board.mine {
    --t: 38px;
  }

  .az-board {
    --t: 24px;
  }
}

/* ---- The family's list of every game --------------------------------------------------------------------------- */

.manage {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
}

.admin-games {
  list-style: none;
  margin: 0;
  padding-block: 4px;
  padding-inline: 16px;
  gap: 0;
}

.admin-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  border-block-end: 1px solid var(--line);
}

.admin-game:last-child {
  border-block-end: 0;
}

.admin-game-text {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}

.admin-game-text > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-players {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 0.9rem;
}

/* ---- Pandemic --------------------------------------------------------------------------------------------------
   Drawn for this project (docs/project/CREDITS.md). Every Pandemic rule goes between this header and the next one,
   and every selector starts with .pandemic- or .pd- so it cannot touch the other games. */

.pandemic-game {
  --pd-night: #0c1828;
  --pd-deep: #10243d;
  --pd-sea: #0f2b48;
  --pd-land: #2f6a7c;
  --pd-coast: #7cc0d6;
  --pd-ink: #17212e;
  --pd-paper: #f5f7fa;
  --pd-line: #d3dbe6;
  --pd-glow: #7cf0c4;
  --pd-alarm: #e5483f;
  --pd-blue: #3f7fe8;
  --pd-yellow: #f2bf2b;
  --pd-black: #2d2f36;
  --pd-red: #e33b3e;
  --pd-gold: #e9b949;
  --pd-panel: 46dvh;
  min-block-size: 100dvh;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(90, 160, 210, 0.18), transparent 60%),
    linear-gradient(180deg, #0f2036, var(--pd-night));
  color: var(--pd-ink);
}

.pandemic-game .bar {
  background: #0a1422;
  box-shadow: 0 2px 0 #1f6f6a;
}

.pandemic-game .bar .status {
  color: #a9d6ce;
}

.pandemic-game .bar .language {
  border-color: #3d6f7e;
}

.pd-root {
  padding: 8px;
}

/* ---- The lobby -------------------------------------------------------------------------------------------------- */

.pd-lobby {
  display: grid;
  gap: 12px;
  max-inline-size: 760px;
  margin-inline: auto;
}

.pd-banner {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid #24476a;
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% 50%, rgba(124, 240, 196, 0.16), transparent 55%),
    linear-gradient(135deg, #12304f, #0c1d31);
  color: #eaf4ff;
}

.pd-banner-art {
  inline-size: 104px;
  block-size: 104px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.pd-banner h2 {
  margin: 0 0 4px;
  font-size: clamp(1.3rem, 6vw, 1.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.pd-banner p {
  margin: 0;
  color: #bcd3ea;
}

.pd-banner .pd-banner-roles {
  margin-block-start: 6px;
  font-size: 0.9rem;
  color: var(--pd-glow);
}

.pd-lobby-body {
  display: grid;
  gap: 12px;
}

.pd-difficulty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.pd-difficulty h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.pd-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pd-level {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.pd-level:disabled {
  opacity: 0.75;
}

.pd-level.chosen {
  border-color: #1f8a7f;
  background: #e8f7f3;
  box-shadow: 0 0 0 3px rgba(31, 138, 127, 0.18);
  opacity: 1;
}

.pd-level-cards {
  display: flex;
  justify-content: center;
  gap: 1px;
}

.pd-level-cards .pd-icon {
  inline-size: 14px;
  block-size: 14px;
}

.pd-level strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.pd-level-count {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---- Layout: phone first ---------------------------------------------------------------------------------------- */

.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.pd-layout > * {
  min-inline-size: 0;
}

.pd-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-inline-size: 0;
}

.pd-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  min-inline-size: 0;
}

.pd-main > *,
.pd-side > *,
.pd-players > *,
.pd-player > *,
.pd-piles > *,
.pd-panel-body > *,
.pd-choice > *,
.pd-normal > * {
  min-inline-size: 0;
}

/* ---- Tracks ----------------------------------------------------------------------------------------------------- */

/* Scrolling rows are positioned, so that the visually hidden texts inside them stay inside them. */
.pd-status,
.pd-track,
.pd-hand,
.pd-card-row,
.pd-map-tools,
.pd-supply-item,
.pd-cube-count,
.pd-vial,
.pd-history ol {
  position: relative;
}

.pd-status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pd-track {
  flex: none;
  display: grid;
  gap: 3px;
  padding: 4px 7px;
  border: 1px solid #23415f;
  border-radius: 10px;
  background: rgba(10, 24, 40, 0.85);
  color: #dbe8f5;
}

.pd-track-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8fb0cc;
}

.pd-steps {
  display: flex;
  gap: 2px;
}

.pd-step {
  display: grid;
  place-items: center;
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  background: #1b3350;
  color: #7f9db8;
  font-size: 12px;
  font-weight: 700;
}

.pd-outbreaks .pd-step.past {
  background: #7d2f2b;
  color: #ffd2c9;
}

.pd-outbreaks .pd-step.last {
  background: #3b1416;
  color: #ff8d80;
  box-shadow: inset 0 0 0 1px #ff8d80;
}

.pd-outbreaks .pd-step.now {
  background: var(--pd-alarm);
  color: #fff;
  box-shadow: 0 0 0 2px #ffb3a6, 0 0 10px rgba(229, 72, 63, 0.8);
}

.pd-rate .pd-step {
  border-radius: 5px;
}

.pd-rate .pd-step.past {
  background: #1f4a45;
  color: #9fd8cb;
}

.pd-rate .pd-step.now {
  background: #27b38f;
  color: #04261d;
  box-shadow: 0 0 0 2px #a8f5dc, 0 0 10px rgba(39, 179, 143, 0.8);
}

.pd-vials {
  display: flex;
  gap: 4px;
}

.pd-vial {
  display: grid;
  place-items: center;
  inline-size: 22px;
  block-size: 26px;
  border: 2px solid #4b6b8a;
  border-radius: 5px 5px 12px 12px;
  background: #13263d;
}

.pd-vial .pd-icon {
  inline-size: 14px;
  block-size: 14px;
  opacity: 0.45;
}

.pd-vial.cured,
.pd-vial.eradicated {
  border-color: #fff;
}

.pd-vial.cured .pd-icon,
.pd-vial.eradicated .pd-icon {
  opacity: 1;
}

.pd-vial.pd-blue.cured,
.pd-vial.pd-blue.eradicated {
  background: var(--pd-blue);
}

.pd-vial.pd-yellow.cured,
.pd-vial.pd-yellow.eradicated {
  background: var(--pd-yellow);
}

.pd-vial.pd-black.cured,
.pd-vial.pd-black.eradicated {
  background: #5a5f6b;
}

.pd-vial.pd-red.cured,
.pd-vial.pd-red.eradicated {
  background: var(--pd-red);
}

.pd-vial.eradicated {
  box-shadow: 0 0 0 2px var(--pd-glow), 0 0 10px rgba(124, 240, 196, 0.7);
}

.pd-supply-row {
  display: flex;
  gap: 6px;
}

.pd-supply-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
}

.pd-supply-item.low {
  color: #ff9d8f;
}

.pd-supply-item .pd-icon {
  inline-size: 18px;
  block-size: 18px;
}

.pd-status > * {
  max-inline-size: 100%;
}

.pd-decks {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 13px;
}

.pd-deck {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.pd-deck .pd-icon {
  inline-size: 18px;
  block-size: 18px;
}

.pd-deck-back {
  display: grid;
  place-items: center;
  inline-size: 18px;
  block-size: 24px;
  border-radius: 3px;
  background: linear-gradient(135deg, #2a6e9c, #173d5e);
  box-shadow: 0 0 0 1px #6fb2d8;
}

.pd-deck-back .pd-icon {
  inline-size: 13px;
  block-size: 13px;
}

.pd-deck-back.pd-back-infection {
  background: linear-gradient(135deg, #4c8b2f, #1f3d1a);
  box-shadow: 0 0 0 1px #a6e27a;
}

/* On a phone the deck counters stand with the piles, so the map gets the room above the panel. */
.pd-status .pd-decks {
  display: none;
}

.pd-piles .pd-decks {
  border-color: var(--pd-line);
  background: #ffffff;
  color: var(--pd-ink);
}

.pd-deck.pd-deck-quiet {
  color: #c7d3ff;
  white-space: normal;
  max-inline-size: 220px;
}

/* ---- The map ---------------------------------------------------------------------------------------------------- */

.pd-map-area {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-inline-size: 0;
}

.pd-map-tools {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pd-map-tools .pd-chip {
  flex: none;
  min-block-size: 34px;
  padding-inline: 9px;
  font-size: 12px;
}

.pd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 38px;
  padding-block: 4px;
  padding-inline: 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.pd-map-tools .pd-chip {
  border-color: #2d5577;
  background: #12304d;
  color: #dceaf7;
}

.pd-map-tools .pd-chip[aria-pressed="true"] {
  background: #1f6f6a;
  border-color: var(--pd-glow);
}

.pd-map-box {
  overflow-x: auto;
  overflow-y: hidden;
  block-size: 47dvh;
  min-block-size: 300px;
  border: 1px solid #23415f;
  border-radius: 14px;
  background: var(--pd-deep);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}

.pd-map {
  display: block;
  block-size: 100%;
  inline-size: auto;
  aspect-ratio: 1400 / 640;
  touch-action: pan-x pan-y;
  user-select: none;
}

.pd-map-box.wide {
  block-size: auto;
  min-block-size: 0;
}

.pd-map-box.wide .pd-map {
  inline-size: 100%;
  block-size: auto;
}

.pd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-inline: 4px;
  color: #b9cde0;
  font-size: 12px;
}

.pd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pd-legend .pd-icon {
  inline-size: 14px;
  block-size: 14px;
}

.pd-ring {
  display: inline-block;
  inline-size: 14px;
  block-size: 14px;
  border: 2px solid var(--pd-glow);
  border-radius: 50%;
}

.pd-ring.flight {
  border: 2px dashed #ffffff;
}

.pd-news {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fff0ee;
  list-style: none;
  font-size: 0.9rem;
}

.pd-news li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.pd-news li.alarm {
  color: #a3221c;
  font-weight: 650;
}

.pd-news li.good {
  color: #0f6b63;
  font-weight: 650;
}

.pd-news .pd-icon {
  inline-size: 16px;
  block-size: 16px;
}

.pd-sea {
  fill: var(--pd-sea);
}

.pd-grid line {
  stroke: rgba(160, 205, 240, 0.08);
  stroke-width: 1;
}

.pd-land polygon {
  fill: var(--pd-land);
  stroke: var(--pd-coast);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.pd-water polygon {
  fill: var(--pd-sea);
  stroke: var(--pd-coast);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.pd-link {
  stroke: rgba(236, 246, 255, 0.5);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.pd-link.pacific {
  stroke-dasharray: 2 6;
}

.pd-city {
  cursor: pointer;
}

.pd-city-dot {
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.pd-city.pd-blue .pd-city-dot {
  fill: var(--pd-blue);
}

.pd-city.pd-yellow .pd-city-dot {
  fill: var(--pd-yellow);
}

.pd-city.pd-black .pd-city-dot {
  fill: var(--pd-black);
}

.pd-city.pd-red .pd-city-dot {
  fill: var(--pd-red);
}

.pd-city.hot .pd-city-dot {
  stroke: #ffb3a6;
  stroke-width: 3;
}

.pd-city-name {
  font-size: 17px;
  font-weight: 600;
  fill: #f2f7fc;
  paint-order: stroke;
  stroke: #0b1d31;
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.pd-hit {
  fill: transparent;
}

.pd-hit:focus {
  outline: none;
}

.pd-hit:focus-visible {
  fill: rgba(255, 143, 0, 0.18);
  stroke: var(--focus);
  stroke-width: 3;
}

.pd-reach {
  fill: rgba(124, 240, 196, 0.16);
  stroke: var(--pd-glow);
  stroke-width: 2.5;
  pointer-events: none;
}

.pd-reach.flight {
  fill: rgba(255, 255, 255, 0.06);
  stroke: #ffffff;
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.pd-picked {
  fill: none;
  stroke: var(--focus);
  stroke-width: 4;
  pointer-events: none;
}

.pd-cube {
  pointer-events: none;
}

.pd-cube-top,
.pd-cube-left,
.pd-cube-right {
  stroke: rgba(0, 0, 0, 0.45);
  stroke-width: 0.6;
  stroke-linejoin: round;
}

.pd-cube.pd-blue .pd-cube-top {
  fill: #8db5ff;
}

.pd-cube.pd-blue .pd-cube-left {
  fill: #3f7fe8;
}

.pd-cube.pd-blue .pd-cube-right {
  fill: #2557b5;
}

.pd-cube.pd-yellow .pd-cube-top {
  fill: #ffe58a;
}

.pd-cube.pd-yellow .pd-cube-left {
  fill: #f2bf2b;
}

.pd-cube.pd-yellow .pd-cube-right {
  fill: #c48f0d;
}

.pd-cube.pd-black .pd-cube-top {
  fill: #8a8f9c;
}

.pd-cube.pd-black .pd-cube-left {
  fill: #3a3d46;
}

.pd-cube.pd-black .pd-cube-right {
  fill: #1c1e24;
}

.pd-cube.pd-red .pd-cube-top {
  fill: #ff8f8a;
}

.pd-cube.pd-red .pd-cube-left {
  fill: #e33b3e;
}

.pd-cube.pd-red .pd-cube-right {
  fill: #a51f24;
}

.pd-cube-mark {
  fill: #ffffff;
  stroke: rgba(0, 0, 0, 0.5);
  stroke-width: 0.4;
}

.pd-cube.pd-yellow .pd-cube-mark {
  fill: #4a3600;
  stroke: none;
}

.pd-station {
  pointer-events: none;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.7));
}

.pd-station-body {
  fill: #ffffff;
  stroke: #24394f;
  stroke-width: 1;
  stroke-linejoin: round;
}

.pd-station-cross {
  fill: #d7263d;
}

.pd-pawn {
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65));
}

.pd-pawn-body {
  stroke: #0b1d31;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.pd-pawn.mine .pd-pawn-body {
  stroke: #ffffff;
  stroke-width: 2.4;
}

.pd-pawn-icon {
  fill: #ffffff;
}

.pd-role-planner .pd-pawn-body,
.pd-badge.pd-role-planner {
  fill: #20b2a6;
  background: #20b2a6;
}

.pd-role-dispatcher .pd-pawn-body,
.pd-badge.pd-role-dispatcher {
  fill: #d0489f;
  background: #d0489f;
}

.pd-role-medic .pd-pawn-body,
.pd-badge.pd-role-medic {
  fill: #f28c28;
  background: #f28c28;
}

.pd-role-operations .pd-pawn-body,
.pd-badge.pd-role-operations {
  fill: #6fb83a;
  background: #6fb83a;
}

.pd-role-quarantine .pd-pawn-body,
.pd-badge.pd-role-quarantine {
  fill: #2f7d4f;
  background: #2f7d4f;
}

.pd-role-researcher .pd-pawn-body,
.pd-badge.pd-role-researcher {
  fill: #9b6b3f;
  background: #9b6b3f;
}

.pd-role-scientist .pd-pawn-body,
.pd-badge.pd-role-scientist {
  fill: #eef1f6;
  background: #eef1f6;
}

.pd-role-scientist .pd-pawn-icon,
.pd-badge.pd-role-scientist .pd-icon {
  fill: #283548;
}

.pd-badge.pd-role-none {
  background: #8495a8;
}

/* ---- Small pictures in the page --------------------------------------------------------------------------------- */

.pd-icon {
  display: inline-block;
  flex: none;
  inline-size: 20px;
  block-size: 20px;
  vertical-align: middle;
}

.pd-shape-body {
  stroke: #ffffff;
  stroke-width: 1.6;
}

.pd-shape.pd-blue .pd-shape-body {
  fill: var(--pd-blue);
}

.pd-shape.pd-yellow .pd-shape-body {
  fill: var(--pd-yellow);
}

.pd-shape.pd-black .pd-shape-body {
  fill: var(--pd-black);
}

.pd-shape.pd-red .pd-shape-body {
  fill: var(--pd-red);
}

.pd-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 30px;
  block-size: 30px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pd-badge .pd-icon {
  inline-size: 18px;
  block-size: 18px;
  fill: #ffffff;
}

.pd-event-icon,
.pd-role-icon {
  fill: currentColor;
}

.pd-epidemic-icon .pd-virus-body {
  fill: #9be15d;
  stroke: #1b3a12;
  stroke-width: 1;
}

.pd-epidemic-icon .pd-virus-spikes {
  stroke: #9be15d;
  stroke-width: 1.8;
}

.pd-epidemic-icon .pd-virus-tip {
  fill: #c9f59f;
}

.pd-station-icon .pd-station-body {
  stroke-width: 1.4;
}

/* ---- Cards ------------------------------------------------------------------------------------------------------ */

.pd-card {
  position: relative;
  display: inline-grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  flex: none;
  inline-size: 132px;
  min-block-size: 48px;
  border-radius: 9px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(23, 33, 46, 0.18), 0 2px 5px rgba(23, 33, 46, 0.18);
  color: var(--pd-ink);
  font-size: 0.85rem;
  line-height: 1.15;
}

.pd-card-band {
  display: grid;
  place-items: center;
  align-self: stretch;
}

.pd-card-band .pd-icon {
  inline-size: 18px;
  block-size: 18px;
}

.pd-card-name {
  padding: 6px 7px;
  font-weight: 650;
  hyphens: auto;
  overflow-wrap: break-word;
}

.pd-city-card.pd-blue .pd-card-band {
  background: linear-gradient(180deg, #5d95f2, #2557b5);
}

.pd-city-card.pd-yellow .pd-card-band {
  background: linear-gradient(180deg, #ffd65a, #c48f0d);
}

.pd-city-card.pd-black .pd-card-band {
  background: linear-gradient(180deg, #5b5f6a, #1f2128);
}

.pd-city-card.pd-red .pd-card-band {
  background: linear-gradient(180deg, #f06467, #a51f24);
}

.pd-card-band .pd-shape-body {
  stroke: #ffffff;
  stroke-width: 2;
}

.pd-event-card {
  background: linear-gradient(90deg, #fff7df, #ffffff 60%);
}

.pd-event-card .pd-card-band {
  background: linear-gradient(180deg, #f3cd62, #c8922a);
  color: #3d2a05;
}

.pd-event-card.stored {
  box-shadow: 0 0 0 2px #20b2a6, 0 2px 5px rgba(23, 33, 46, 0.18);
}

.pd-epidemic-card {
  background: linear-gradient(90deg, #1d3416, #0f1f0b);
  color: #c9f59f;
}

.pd-epidemic-card .pd-card-band {
  background: #0b1708;
}

.pd-infection-card {
  background: linear-gradient(90deg, #203247, #172434);
  color: #eaf2fb;
}

.pd-infection-card .pd-card-band {
  background: #0f1a27;
}

.pd-card.mini {
  inline-size: auto;
  min-block-size: 24px;
  grid-template-columns: 18px auto;
  font-size: 0.75rem;
}

.pd-card.mini .pd-card-name {
  padding: 2px 6px;
}

.pd-card.mini .pd-icon {
  inline-size: 12px;
  block-size: 12px;
}

.pd-card-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px 2px 6px;
  scrollbar-width: thin;
}

.pd-card-button {
  display: grid;
  gap: 3px;
  justify-items: center;
  flex: none;
  min-block-size: 0;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
}

.pd-card-button.chosen {
  border-color: #1f8a7f;
  background: #e2f6f0;
}

.pd-card-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
}

/* ---- The panel ---------------------------------------------------------------------------------------------------- */

.pd-panel {
  position: sticky;
  inset-block-end: 0;
  z-index: 6;
  max-block-size: var(--pd-panel);
  overflow-y: auto;
  margin-inline: -8px;
  margin-block-end: -8px;
  padding: 10px 12px;
  padding-block-end: max(12px, env(safe-area-inset-bottom));
  border-block-start: 4px solid #1f8a7f;
  border-radius: 18px 18px 0 0;
  background: #f6f9fc;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
}

.pd-panel:empty {
  display: none;
}

.pd-panel-body {
  display: grid;
  gap: 8px;
}

.pd-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pd-panel-title {
  display: grid;
  gap: 3px;
}

.pd-panel-head.mine strong {
  color: #0f6b63;
}

.pd-pips {
  display: flex;
  gap: 4px;
}

.pd-pip {
  inline-size: 22px;
  block-size: 8px;
  border-radius: 4px;
  background: #d3dbe6;
}

.pd-pip.on {
  background: linear-gradient(90deg, #27b38f, #1f8a7f);
}

.pd-panel .hint {
  margin: 0;
}

.pd-panel .actions {
  margin-block: 2px;
}

.pd-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.pd-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pd-who .pd-chip {
  background: #fff;
}

.pd-who .pd-chip.chosen {
  border-color: #1f8a7f;
  background: #e2f6f0;
  box-shadow: inset 0 0 0 1px #1f8a7f;
}

.pd-who .pd-badge {
  inline-size: 24px;
  block-size: 24px;
}

.pd-who .pd-badge .pd-icon {
  inline-size: 14px;
  block-size: 14px;
}

.pd-chip-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.pd-city-info {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 40px 8px 10px;
  border: 1px solid var(--pd-line);
  border-inline-start: 6px solid #8495a8;
  border-radius: 12px;
  background: #ffffff;
}

.pd-city-info.pd-blue {
  border-inline-start-color: var(--pd-blue);
}

.pd-city-info.pd-yellow {
  border-inline-start-color: var(--pd-yellow);
}

.pd-city-info.pd-black {
  border-inline-start-color: var(--pd-black);
}

.pd-city-info.pd-red {
  border-inline-start-color: var(--pd-red);
}

.pd-city-title {
  font-size: 1.05rem;
}

.pd-cube-count,
.pd-has-station,
.pd-here {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.9rem;
}

.pd-here .pd-badge {
  inline-size: 22px;
  block-size: 22px;
}

.pd-here .pd-badge .pd-icon {
  inline-size: 13px;
  block-size: 13px;
}

.pd-close {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 4px;
  min-block-size: 34px;
  inline-size: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
}

.pd-ways,
.pd-here-actions,
.pd-events {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pd-ways {
  margin-block-start: 6px;
}

.pd-way.primary {
  background: #1f8a7f;
  border-color: #1f8a7f;
}

.pd-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 12px;
}

.pd-act .pd-icon {
  inline-size: 20px;
  block-size: 20px;
}

.pd-act.pd-end {
  margin-inline-start: auto;
  border-color: #8495a8;
  color: #3c4a5c;
}

.pd-event {
  border-color: #c8922a;
  background: #fff7df;
  color: #4a3407;
}

.pd-cure {
  border-color: #1f8a7f;
  background: #e2f6f0;
  font-weight: 650;
}

.pd-events {
  padding-block-start: 6px;
  border-block-start: 1px dashed var(--pd-line);
}

.pd-big {
  min-block-size: 52px;
  padding-inline: 22px;
  font-size: 1.05rem;
}

.pd-big.primary {
  background: linear-gradient(180deg, #24a08f, #187a6f);
  border-color: #187a6f;
}

.pd-big.pd-infect.primary {
  background: linear-gradient(180deg, #e65148, #b6302a);
  border-color: #b6302a;
}

.pd-big.pd-intensify.primary {
  background: linear-gradient(180deg, #5e9e2e, #3e7419);
  border-color: #3e7419;
}

.pd-step-box {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.pd-waiting p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.pd-choice {
  display: grid;
  gap: 8px;
}

.pd-choice p {
  margin: 0;
}

.pd-event-help {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pd-event-help p {
  margin: 0;
}

.pd-discard p {
  margin: 0 0 4px;
  color: var(--danger);
}

.pd-forecast-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pd-forecast;
}

.pd-forecast-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  counter-increment: pd-forecast;
}

.pd-forecast-list li::before {
  content: counter(pd-forecast);
  inline-size: 22px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.pd-forecast-list .pd-card {
  inline-size: 170px;
}

.pd-mini {
  min-block-size: 40px;
  inline-size: 44px;
  padding: 0;
}

.pd-ending {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
}

.pd-ending .pd-icon {
  inline-size: 48px;
  block-size: 48px;
}

.pd-ending h2 {
  font-size: 1.4rem;
}

.pd-ending p {
  margin: 0;
}

.pd-ending.won h2 {
  color: #0f6b63;
}

.pd-ending.lost h2 {
  color: var(--danger);
}

/* ---- Players, piles and history ---------------------------------------------------------------------------------- */

.pd-players,
.pd-piles,
.pd-history {
  padding: 10px 12px;
  border: 1px solid var(--pd-line);
  border-radius: 14px;
  background: var(--pd-paper);
}

.pd-players {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.pd-players h2,
.pd-history h2 {
  margin: 0;
}

.pd-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--pd-line);
  border-radius: 12px;
  background: #fff;
}

.pd-player.current {
  border-color: #1f8a7f;
  box-shadow: 0 0 0 2px rgba(31, 138, 127, 0.25);
}

.pd-player-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pd-player-names {
  display: grid;
  gap: 1px;
  min-inline-size: 0;
}

.pd-player-names > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 650;
}

.pd-player-role {
  font-size: 0.85rem;
  color: var(--muted);
}

.pd-role-help {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.pd-hand {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.pd-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pd-piles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.pd-pile summary {
  min-block-size: 36px;
  font-weight: 600;
  cursor: pointer;
}

.pd-history ol {
  display: grid;
  gap: 3px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  max-block-size: 360px;
  overflow-y: auto;
}

.pd-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.pd-history li .pd-icon {
  inline-size: 14px;
  block-size: 14px;
}

.pd-history li.alarm {
  color: #a3221c;
  font-weight: 650;
}

.pd-history li.good {
  color: #0f6b63;
  font-weight: 650;
}

.pd-history li.turn {
  margin-block-start: 4px;
  padding-block-start: 4px;
  border-block-start: 1px solid var(--pd-line);
  font-weight: 650;
}

.pd-history li.quiet {
  color: var(--muted);
}

.pd-mini-cards {
  display: inline-flex;
  gap: 3px;
}

.pd-side > .host-tools {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--pd-paper);
}

/* ---- Motion ----------------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .pd-reach {
    animation: pd-breathe 1.6s ease-in-out infinite;
  }

  .pd-picked {
    animation: pd-breathe 1.1s ease-in-out infinite;
  }

  .pd-city.hot .pd-city-dot {
    animation: pd-alarm 1.4s ease-in-out infinite;
  }

  .pd-outbreaks .pd-step.now {
    animation: pd-alarm 1.8s ease-in-out infinite;
  }
}

@keyframes pd-breathe {
  50% {
    opacity: 0.45;
  }
}

@keyframes pd-alarm {
  50% {
    filter: drop-shadow(0 0 6px rgba(255, 90, 70, 0.95));
  }
}

/* ---- Wide screens: the panel and the players beside the map ---------------------------------------------------- */

@media (min-width: 980px) {
  .pandemic-game {
    --pd-panel: 0px;
  }

  .pd-root {
    padding: 12px;
  }

  .pd-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 12px;
    max-inline-size: 1680px;
    margin-inline: auto;
  }

  .pd-main {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    inset-block-start: calc(var(--bar) + 12px);
  }

  .pd-side {
    grid-column: 2;
    grid-row: 2;
  }

  .pd-status .pd-decks {
    display: flex;
  }

  .pd-piles .pd-decks {
    display: none;
  }

  .pd-map-box {
    block-size: auto;
    min-block-size: 0;
  }

  .pd-map {
    inline-size: 100%;
    block-size: auto;
  }

  .pd-map-tools .pd-region {
    display: none;
  }

  .pd-map-tools .pd-zoom {
    display: none;
  }

  .pd-panel {
    grid-column: 2;
    grid-row: 1;
    position: static;
    margin: 0;
    max-block-size: none;
    border: 1px solid var(--pd-line);
    border-block-start: 4px solid #1f8a7f;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }

  .pd-city-name {
    font-size: 18px;
  }

  .pd-hand {
    flex-wrap: wrap;
    overflow: visible;
  }

  .pd-side .pd-hand .pd-card {
    inline-size: calc(50% - 3px);
    min-block-size: 40px;
  }
}

/* (Pandemic's rules go above this line.) */
/* This block of comment lines keeps the two games' sections apart.
   It is here so that changes to one section never touch the lines around the other.
   Do not put rules in this block.
   Do not remove it. */

/* ---- Dead of Winter ---------------------------------------------------------------------------------------------
   Drawn for this project (docs/project/CREDITS.md). Every Dead of Winter rule goes after this header, and every
   selector starts with .dow- so it cannot touch the other games. */

.dow-game {
  --dow-night: #0d1626;
  --dow-slate: #182538;
  --dow-slate-2: #22385a;
  --dow-ice: #cfe3f2;
  --dow-snow: #f4f8fb;
  --dow-frost: #7fc8f8;
  --dow-amber: #f2a33a;
  --dow-blood: #e5534b;
  --dow-paper: #efe6d2;
  --dow-paper-ink: #2a2418;
  --dow-line: rgba(207, 227, 242, 0.18);
  min-block-size: 100dvh;
  color: var(--dow-snow);
  background:
    url("/assets/img/dow-snow.svg") repeat,
    radial-gradient(ellipse 120% 900px at 50% 0%, #23395c 0%, #0d1626 70%) no-repeat,
    #0d1626;
  background-size:
    160px 160px,
    auto,
    auto;
}

.dow-root .tag {
  background: rgba(255, 255, 255, 0.14);
  color: var(--dow-snow);
}

.dow-game .bar {
  background: #0a1220;
  box-shadow: 0 2px 0 rgba(127, 200, 248, 0.35);
}

.dow-game .bar .status {
  color: var(--dow-ice);
}

.dow-game .bar .language {
  border-color: #4b6a90;
}

/* Low specificity, so every button rule below wins over it. */
.dow-root :where(button:not(.primary):not(.danger)) {
  background: #22344d;
  color: var(--dow-snow);
  border-color: #3f5a7c;
}

.dow-root button:hover:not(:disabled) {
  border-color: var(--dow-frost);
}

.dow-root button.primary {
  background: var(--dow-amber);
  border-color: var(--dow-amber);
  color: #1d1405;
}

.dow-root button.danger {
  background: rgba(229, 83, 75, 0.12);
  border-color: #ff8a80;
  color: #ffb4ab;
}

.dow-img {
  display: block;
  user-select: none;
}

.dow-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--dow-ice);
}

/* ---- Lobby --------------------------------------------------------------------------------------------------- */

.dow-lobby {
  display: grid;
  gap: 14px;
  max-inline-size: 640px;
  margin-inline: auto;
  padding: 14px;
}

.dow-banner {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(127, 200, 248, 0.35);
  border-radius: 18px;
  background: rgba(20, 33, 58, 0.9);
}

.dow-banner-art {
  inline-size: 120px;
  block-size: 120px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.dow-banner h2 {
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}

.dow-banner p {
  margin: 4px 0 0;
  color: var(--dow-ice);
}

.dow-banner .dow-banner-players {
  font-weight: 700;
  color: var(--dow-amber);
}

.dow-lobby .lobby,
.dow-side .host-tools {
  padding: 14px;
  border-radius: 14px;
  background: var(--dow-paper);
  color: var(--dow-paper-ink);
}

/* ---- Layout: one column on a phone, the panel stuck to the bottom ---------------------------------------------- */

.dow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-inline-size: 1640px;
  margin-inline: auto;
  padding: 8px 10px 0;
}

.dow-board,
.dow-info,
.dow-side {
  display: grid;
  gap: 10px;
  align-content: start;
  min-inline-size: 0;
}

.dow-panel {
  position: sticky;
  inset-block-end: 0;
  z-index: 4;
  max-block-size: 54dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-inline: -10px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: #09101d;
  border-block-start: 2px solid var(--dow-frost);
  box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.55);
}

/* ---- Status bar ------------------------------------------------------------------------------------------------ */

.dow-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 10px;
  border: 1px solid var(--dow-line);
  border-radius: 12px;
  background: rgba(24, 37, 56, 0.88);
}

.dow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--dow-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.dow-chip-icon {
  inline-size: 20px;
  block-size: 20px;
}

.dow-chip-value {
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.dow-chip.warn {
  border-color: #ff8a80;
  background: rgba(229, 83, 75, 0.2);
}

.dow-turn-chip {
  border-color: var(--dow-amber);
}

.dow-waste-icon,
.dow-starve-icon {
  inline-size: 16px;
  block-size: 18px;
  border-radius: 2px 2px 5px 5px;
  background: linear-gradient(#8d8f86, #5b5d56);
  box-shadow: inset 0 3px 0 #b5b8ad;
}

.dow-starve-icon {
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, transparent 38%, #e5534b 40%);
  box-shadow: none;
}

.dow-deck-icon {
  display: inline-block;
  inline-size: 14px;
  block-size: 19px;
  border: 1px solid #9fb9d6;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, #3b5478 0 3px, #2a3f5e 3px 6px);
}

.dow-round {
  display: grid;
  gap: 3px;
  padding-inline-end: 6px;
}

.dow-round-text {
  font-weight: 800;
  font-size: 0.9rem;
}

.dow-track {
  display: flex;
  gap: 3px;
}

.dow-track span {
  inline-size: 12px;
  block-size: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.dow-track .done {
  background: #6f8fb2;
}

.dow-track .now {
  background: var(--dow-amber);
}

.dow-morale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--dow-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.dow-morale-track {
  display: flex;
  gap: 2px;
  direction: ltr;
}

.dow-morale-track span {
  display: grid;
  place-items: center;
  inline-size: 9px;
  block-size: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
}

.dow-morale-track .lit {
  background: linear-gradient(#f6b85c, #c46e16);
}

.dow-morale-track .now {
  inline-size: 22px;
  background: var(--dow-snow);
  color: #10192a;
}

.dow-morale.low .lit {
  background: linear-gradient(#ff8a80, #b3261e);
}

.dow-morale.low .now {
  background: #ffb4ab;
}

/* ---- The colony ------------------------------------------------------------------------------------------------ */

.dow-colony {
  position: relative;
  margin-block-start: 12px;
  padding: 10px;
  border: 2px solid #8a5a35;
  border-radius: 6px 6px 16px 16px;
  background:
    linear-gradient(180deg, rgba(138, 90, 53, 0.3), rgba(24, 37, 56, 0.92) 70%),
    #1a2638;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

/* The palisade's pointed stakes along the top. */
.dow-colony::before {
  content: "";
  position: absolute;
  inset-inline: 6px;
  inset-block-start: -13px;
  block-size: 13px;
  background:
    linear-gradient(135deg, transparent 50%, #8a5a35 50%) 0 0 / 14px 13px repeat-x,
    linear-gradient(225deg, transparent 50%, #8a5a35 50%) 7px 0 / 14px 13px repeat-x;
}

.dow-site-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dow-site-head h2 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
}

.dow-site-meta {
  font-size: 0.82rem;
  color: var(--dow-ice);
}

.dow-place-icon {
  inline-size: 34px;
  block-size: 34px;
  flex: 0 0 auto;
}

.dow-colony-body {
  display: grid;
  gap: 10px;
  margin-block-start: 8px;
}

.dow-entrances {
  display: grid;
  gap: 6px;
}

.dow-colony .dow-entrances {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 6px;
}

.dow-entrance {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 4px 4px;
  border: 1px dashed rgba(207, 227, 242, 0.28);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
}

.dow-entrance-number {
  position: absolute;
  inset-block-start: -8px;
  inset-inline-start: 6px;
  padding-inline: 5px;
  border-radius: 6px;
  background: #8a5a35;
  font-size: 0.68rem;
  font-weight: 800;
}

.dow-space {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-inline-size: 0;
  max-inline-size: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(207, 227, 242, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.dow-token {
  inline-size: 100%;
  block-size: 100%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.dow-colony-yard {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  min-block-size: 50px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(242, 163, 58, 0.07);
  box-shadow: inset 0 0 0 1px rgba(242, 163, 58, 0.18);
}

.dow-helpless {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
}

.dow-helpless-icon {
  inline-size: 22px;
  block-size: 22px;
}

/* ---- Survivors on the board ------------------------------------------------------------------------------------- */

.dow-meeple {
  position: relative;
  display: inline-grid;
  justify-items: center;
  gap: 1px;
  min-block-size: 0;
  padding: 2px 3px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
}

.dow-root button.dow-meeple {
  padding: 2px 3px;
  background: transparent;
  border-color: transparent;
}

.dow-root button.dow-meeple.selected {
  border-color: var(--dow-amber);
  background: rgba(242, 163, 58, 0.16);
}

.dow-owner {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-start: -5px;
  transform: scale(0.72);
}

.dow-portrait {
  position: relative;
  flex: 0 0 auto;
  inline-size: 52px;
  block-size: 52px;
}

.dow-portrait.small {
  inline-size: 38px;
  block-size: 38px;
}

.dow-portrait.large {
  inline-size: 76px;
  block-size: 76px;
}

.dow-silhouette {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.dow-sil-bg {
  fill: var(--dow-hue-bg, #5d7fa3);
  stroke: rgba(244, 248, 251, 0.7);
  stroke-width: 1.5;
}

.dow-sil-body {
  fill: var(--dow-hue-ink, #1b2a3d);
}

.dow-sil-scarf {
  fill: var(--dow-hue-accent, #f2a33a);
}

.dow-initials {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 3px;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.dow-portrait.small .dow-initials {
  font-size: 0.6rem;
}

.dow-portrait.large .dow-initials {
  font-size: 0.85rem;
}

.dow-leader-star {
  position: absolute;
  inset-block-start: -5px;
  inset-inline-end: -4px;
  font-size: 0.95rem;
  color: var(--dow-amber);
  text-shadow: 0 1px 2px #000;
}

.dow-wounds {
  display: inline-flex;
  gap: 2px;
  min-block-size: 12px;
}

.dow-wound {
  inline-size: 9px;
  block-size: 12px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: var(--dow-blood);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.dow-wound.frost {
  border-radius: 2px;
  background: var(--dow-frost);
  transform: rotate(45deg) scale(0.8);
}

/* ---- Locations ------------------------------------------------------------------------------------------------- */

.dow-locations {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 74vw);
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block-end: 6px;
  scrollbar-width: thin;
  scrollbar-color: #3f5a7c transparent;
}

.dow-loc {
  --loc-accent: var(--dow-frost);
  display: grid;
  align-content: start;
  gap: 8px;
  padding-block-end: 10px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--dow-line);
  border-radius: 14px;
  background: linear-gradient(180deg, #15233a, #111c2f);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.dow-loc-police {
  --loc-accent: #5b8def;
}

.dow-loc-grocery {
  --loc-accent: #7cc36e;
}

.dow-loc-school {
  --loc-accent: #f2c94c;
}

.dow-loc-library {
  --loc-accent: #c792ea;
}

.dow-loc-hospital {
  --loc-accent: #e5534b;
}

.dow-loc-gas {
  --loc-accent: #f08a3e;
}

.dow-loc .dow-site-head {
  padding: 8px 10px;
  border-block-end: 3px solid var(--loc-accent);
  background: linear-gradient(180deg, #22385a, #182a44);
}

.dow-loc .dow-entrances,
.dow-loc .dow-noise,
.dow-loc .dow-room {
  padding-inline: 10px;
}

.dow-deck {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dow-noise {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #f2c94c;
}

.dow-noise-token {
  display: inline-grid;
  place-items: center;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: #f2c94c;
  color: #1d1405;
  font-size: 0.62rem;
  font-weight: 900;
}

.dow-room {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  min-block-size: 46px;
}

.dow-empty-spot {
  inline-size: 38px;
  block-size: 38px;
  border: 2px dashed rgba(207, 227, 242, 0.18);
  border-radius: 50%;
}

/* ---- Paper cards: the main objective, the crisis, the secret objective ------------------------------------------- */

.dow-paper {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #c9b994;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4ecdc, #e5d9be);
  color: var(--dow-paper-ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.dow-paper h2,
.dow-paper h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}

.dow-paper .dow-hint {
  color: #6a5a40;
}

.dow-paper-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a5a2a;
}

.dow-story {
  margin: 0;
  font-size: 0.88rem;
  font-style: italic;
  color: #5a4b33;
}

.dow-goal {
  margin: 0;
  font-weight: 600;
}

.dow-progress {
  position: relative;
  display: grid;
  place-items: center;
  block-size: 22px;
  margin-block-start: 4px;
  overflow: hidden;
  border-radius: 11px;
  background: #d4c6a5;
  font-size: 0.8rem;
  font-weight: 800;
}

.dow-progress span {
  position: relative;
}

.dow-progress-bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  background: linear-gradient(90deg, #5c8f4d, #8bd47c);
}

.dow-progress-bar.p0 { inline-size: 0; }
.dow-progress-bar.p1 { inline-size: 10%; }
.dow-progress-bar.p2 { inline-size: 20%; }
.dow-progress-bar.p3 { inline-size: 30%; }
.dow-progress-bar.p4 { inline-size: 40%; }
.dow-progress-bar.p5 { inline-size: 50%; }
.dow-progress-bar.p6 { inline-size: 60%; }
.dow-progress-bar.p7 { inline-size: 70%; }
.dow-progress-bar.p8 { inline-size: 80%; }
.dow-progress-bar.p9 { inline-size: 90%; }
.dow-progress-bar.p10 { inline-size: 100%; }

.dow-crisis {
  padding-block-start: 16px;
  border-color: #b3261e;
  background: linear-gradient(180deg, #f6e5dd, #e8cfc3);
}

/* A hazard stripe along the crisis card's top. */
.dow-crisis::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 7px;
  border-radius: 12px 12px 0 0;
  background: repeating-linear-gradient(45deg, #b3261e 0 10px, #241b17 10px 20px);
}

.dow-crisis.empty {
  color: #6a5a40;
}

.dow-crisis-need {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-weight: 700;
}

.dow-crisis-added {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
}

.dow-crisis-fail ul {
  margin: 2px 0 0;
  padding-inline-start: 18px;
}

.dow-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px 2px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
  font-weight: 700;
}

.dow-panel .dow-kind,
.dow-modal .dow-kind {
  background: rgba(255, 255, 255, 0.1);
}

.dow-kind-icon {
  inline-size: 22px;
  block-size: 22px;
}

.dow-secret {
  border-color: #6b4f8a;
  background: linear-gradient(180deg, #2c2338, #1c1626);
  color: var(--dow-snow);
}

.dow-secret summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d3b8f5;
}

.dow-secret-body {
  display: grid;
  gap: 3px;
  margin-block-start: 6px;
}

.dow-secret-body h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.dow-secret-rule,
.dow-secret-body .dow-goal {
  margin: 0;
  font-size: 0.86rem;
}

.dow-secret-body.betrayal {
  padding-inline-start: 8px;
  border-inline-start: 4px solid var(--dow-blood);
}

.dow-secret-body.betrayal h3 {
  color: #ff8a80;
}

.dow-secret-body.exile {
  padding-inline-start: 8px;
  border-inline-start: 4px dashed var(--dow-frost);
}

/* ---- Players and the history -------------------------------------------------------------------------------------- */

.dow-players,
.dow-log {
  padding: 10px;
  border: 1px solid var(--dow-line);
  border-radius: 12px;
  background: rgba(24, 37, 56, 0.88);
}

.dow-players {
  display: grid;
  gap: 8px;
}

.dow-player {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.dow-player.current {
  border-color: var(--dow-amber);
  box-shadow: 0 0 0 2px rgba(242, 163, 58, 0.22);
}

.dow-player.exiled {
  background: repeating-linear-gradient(135deg, rgba(229, 83, 75, 0.1) 0 8px, transparent 8px 16px);
}

.dow-player-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dow-player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.84rem;
  color: var(--dow-ice);
}

.dow-ready {
  color: #9be08b;
  font-weight: 700;
}

.dow-first {
  background: var(--dow-amber);
  color: #1d1405;
}

.dow-exiled-tag {
  background: var(--dow-blood);
  color: #fff;
}

.dow-waiting-line {
  margin: 0;
  font-size: 0.82rem;
  color: #ffd8a6;
}

.dow-log summary {
  cursor: pointer;
  font-weight: 700;
}

.dow-log ol {
  display: grid;
  gap: 4px;
  max-block-size: 340px;
  margin: 6px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  font-size: 0.86rem;
}

.dow-log li {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dow-log .dow-log-round {
  padding-block-start: 4px;
  border-block-start: 1px solid var(--dow-line);
  font-weight: 800;
  color: var(--dow-amber);
}

.dow-log .dow-log-death {
  color: #ff8a80;
}

/* ---- The viewer's panel ----------------------------------------------------------------------------------------- */

.dow-prompt {
  display: grid;
  gap: 8px;
}

.dow-panel .prompt-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--dow-snow);
}

.dow-prompt.waiting p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.dow-big {
  inline-size: 100%;
  min-block-size: 54px;
  font-size: 1.1rem;
}

.dow-dice {
  --s: 46px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  min-block-size: 20px;
}

.dow-die {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.dow-die.used {
  opacity: 0.35;
}

.dow-die-used {
  font-size: 0.7rem;
}

.dow-die-flat {
  inline-size: var(--s, 40px);
  block-size: var(--s, 40px);
}

.dow-ice {
  --die-body: linear-gradient(145deg, #f2faff, #a9d3f2);
  --die-pip: #12233a;
}

.dow-delay-1,
.dow-delay-1 .cube {
  animation-delay: 0.07s;
}

.dow-delay-2,
.dow-delay-2 .cube {
  animation-delay: 0.14s;
}

.dow-delay-3,
.dow-delay-3 .cube {
  animation-delay: 0.21s;
}

.dow-delay-4,
.dow-delay-4 .cube {
  animation-delay: 0.28s;
}

.dow-delay-5,
.dow-delay-5 .cube {
  animation-delay: 0.35s;
}

.dow-root button.dow-boost {
  min-block-size: 32px;
  padding: 2px 8px;
  font-size: 0.74rem;
}

.dow-group {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block-end: 4px;
  scrollbar-width: thin;
  scrollbar-color: #3f5a7c transparent;
}

.dow-group-member {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-inline-size: 176px;
  padding: 6px 10px 6px 6px;
  border: 2px solid rgba(207, 227, 242, 0.2);
  border-radius: 14px;
  background: #17243a;
  color: inherit;
  text-align: start;
}

.dow-root button.dow-group-member {
  padding: 6px 10px 6px 6px;
  border: 2px solid rgba(207, 227, 242, 0.25);
  background: #17243a;
}

.dow-root button.dow-group-member.selected {
  border-color: var(--dow-amber);
  background: #3a2f1f;
}

.dow-group-text {
  display: grid;
  gap: 1px;
  font-size: 0.82rem;
}

.dow-group-where {
  color: var(--dow-ice);
}

.dow-stats {
  color: #ffd8a6;
  font-variant-numeric: tabular-nums;
}

.dow-actions {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(127, 200, 248, 0.32);
  border-radius: 12px;
  background: rgba(127, 200, 248, 0.08);
}

.dow-actions h3,
.dow-hand h3 {
  margin: 0;
  font-size: 1rem;
}

.dow-ability {
  margin: 0;
  font-size: 0.82rem;
  color: #ffd8a6;
}

.dow-action-row {
  display: grid;
  gap: 4px;
}

.dow-action-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dow-ice);
}

.dow-die-choices,
.dow-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dow-die-choices button,
.dow-kinds button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dow-root button.dow-die-choice {
  justify-content: center;
  min-inline-size: 52px;
  padding: 4px;
}

.dow-die-choice .dow-die-flat {
  --s: 36px;
}

.dow-move-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}

.dow-move-choice {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: start;
}

.dow-move-choice .dow-place-icon {
  inline-size: 26px;
  block-size: 26px;
}

.dow-fuel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.dow-fuel input {
  inline-size: 22px;
  block-size: 22px;
}

.dow-hand {
  display: grid;
  gap: 6px;
}

.dow-hand-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block: 4px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #3f5a7c transparent;
}

.dow-hand-card {
  flex: 0 0 auto;
  min-block-size: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  scroll-snap-align: start;
}

.dow-root button.dow-hand-card {
  padding: 0;
  border: 0;
  background: none;
}

.dow-hand-card.selected .dow-card {
  outline: 3px solid var(--dow-amber);
  transform: translateY(-3px);
}

.dow-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 2px;
  inline-size: 116px;
  min-block-size: 150px;
  padding: 6px 7px 8px;
  border: 1px solid #c9b994;
  border-block-start: 5px solid var(--kind-colour, #8d6e63);
  border-radius: 12px;
  background: linear-gradient(180deg, #f6efdf, #e8dcc0);
  color: var(--dow-paper-ink);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  text-align: center;
  font-size: 0.76rem;
  transition: transform 0.15s ease;
}

.dow-card.dow-kind-food,
.dow-kind.dow-kind-food {
  --kind-colour: #c0392b;
}

.dow-card.dow-kind-medicine,
.dow-kind.dow-kind-medicine {
  --kind-colour: #2e86c1;
}

.dow-card.dow-kind-fuel,
.dow-kind.dow-kind-fuel {
  --kind-colour: #d35400;
}

.dow-card.dow-kind-tool,
.dow-kind.dow-kind-tool {
  --kind-colour: #607d8b;
}

.dow-card.dow-kind-weapon,
.dow-kind.dow-kind-weapon {
  --kind-colour: #7b3fa0;
}

.dow-card.dow-kind-junk,
.dow-kind.dow-kind-junk {
  --kind-colour: #8d6e63;
}

.dow-card.dow-kind-survivor,
.dow-kind.dow-kind-survivor {
  --kind-colour: #2e9b5b;
}

.dow-kind.dow-kind-food,
.dow-kind.dow-kind-medicine,
.dow-kind.dow-kind-fuel,
.dow-kind.dow-kind-tool,
.dow-kind.dow-kind-weapon,
.dow-kind.dow-kind-junk,
.dow-kind.dow-kind-survivor {
  box-shadow: inset 0 0 0 2px var(--kind-colour);
}

.dow-card-art {
  display: grid;
  place-items: center;
  block-size: 50px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 40%, #fffaf0, #e2d3b0);
}

.dow-card-art .dow-kind-icon {
  inline-size: 42px;
  block-size: 42px;
}

.dow-card-name {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
}

.dow-card-kind {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a5a2a;
}

.dow-card-text {
  font-size: 0.7rem;
  line-height: 1.25;
  color: #4a3f2c;
}

.dow-misc {
  display: grid;
  gap: 8px;
}

.dow-root button.dow-end-turn {
  inline-size: 100%;
  min-block-size: 50px;
  font-size: 1.05rem;
}

.dow-exile-call summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: #ffb4ab;
}

.dow-requests {
  display: grid;
  gap: 8px;
}

.dow-requests:empty {
  display: none;
}

.dow-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #f2c94c;
  border-radius: 10px;
  background: rgba(242, 201, 76, 0.14);
}

/* ---- Overlays ---------------------------------------------------------------------------------------------------- */

.dow-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow-y: auto;
  background: rgba(5, 9, 16, 0.74);
}

.dow-modal {
  display: grid;
  gap: 10px;
  inline-size: min(580px, 100%);
  max-block-size: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid rgba(127, 200, 248, 0.4);
  border-radius: 18px;
  background: #14213a;
  color: var(--dow-snow);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.dow-modal h2 {
  margin: 0;
  font-size: 1.25rem;
}

.dow-modal .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dow-modal .actions button {
  flex: 1 1 140px;
}

.dow-choose .actions {
  position: sticky;
  inset-block-end: -16px;
  margin-inline: -16px;
  padding: 10px 16px 14px;
  background: #14213a;
  box-shadow: 0 -8px 16px rgba(5, 9, 16, 0.6);
}

.dow-choose {
  inline-size: min(1000px, 100%);
}

.dow-choose-objectives {
  display: grid;
  gap: 10px;
}

.dow-choose-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.dow-root button.dow-choice,
.dow-choice {
  min-block-size: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  color: inherit;
  text-align: start;
}

.dow-survivor-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  block-size: 100%;
  padding: 10px;
  border: 2px solid rgba(207, 227, 242, 0.25);
  border-radius: 14px;
  background: linear-gradient(180deg, #1f3150, #172540);
  color: var(--dow-snow);
}

.dow-choice.leader .dow-survivor-card {
  border-color: var(--dow-amber);
  box-shadow: 0 0 0 3px rgba(242, 163, 58, 0.3);
}

.dow-choice.follower .dow-survivor-card {
  border-color: var(--dow-frost);
  box-shadow: 0 0 0 3px rgba(127, 200, 248, 0.25);
}

.dow-choice-tag {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--dow-amber);
  color: #1d1405;
  font-size: 0.74rem;
  font-weight: 800;
}

.dow-choice.follower .dow-choice-tag {
  background: var(--dow-frost);
}

.dow-survivor-text {
  display: grid;
  align-content: start;
  gap: 3px;
  font-size: 0.86rem;
}

.dow-job {
  color: var(--dow-ice);
}

.dow-survivor-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-weight: 700;
  color: #ffd8a6;
}

.dow-search-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.dow-search-card {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.dow-search-card .dow-card {
  inline-size: 140px;
  min-block-size: 186px;
  font-size: 0.84rem;
}

.dow-noise-choice {
  display: grid;
  gap: 4px;
}

.dow-bite {
  border-color: #ff5252;
}

.dow-bite-art {
  justify-self: center;
  inline-size: 72px;
  block-size: 72px;
}

/* The crossroads card: a story card on old paper. */
.dow-modal.dow-crossroads {
  padding: 24px 22px;
  border: 0;
  outline: 5px double #7a5a2a;
  outline-offset: -12px;
  background: linear-gradient(180deg, #f5ecd6, #e2d2ad);
  color: var(--dow-paper-ink);
}

.dow-crossroads-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
  color: #7a5a2a;
}

.dow-modal.dow-crossroads h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  text-align: center;
}

.dow-crossroads-subject {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.dow-crossroads-story {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
  font-style: italic;
  line-height: 1.5;
}

.dow-crossroads .dow-hint,
.dow-crossroads .dow-votes {
  margin: 0;
  color: #6a5a40;
}

.dow-crossroads-choices {
  display: grid;
  gap: 8px;
}

.dow-root button.dow-crossroads-choice,
.dow-crossroads-choice {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 2px solid #b8a274;
  border-radius: 12px;
  background: #fffaf0;
  color: var(--dow-paper-ink);
  text-align: start;
}

.dow-root button.dow-crossroads-choice:hover:not(:disabled) {
  border-color: #7a5a2a;
}

.dow-root button.dow-crossroads-choice:disabled {
  opacity: 0.8;
}

.dow-choice-number {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a5a2a;
}

.dow-effects {
  margin: 0;
  padding-inline-start: 18px;
  font-size: 0.85rem;
  color: #5a4b33;
}

.dow-effects:not(ul) {
  padding: 0;
}

.dow-exile {
  border-color: #ff8a80;
}

.dow-votes {
  margin: 0;
  font-weight: 700;
}

.dow-results-art {
  justify-self: center;
  inline-size: 120px;
  block-size: 120px;
  border-radius: 18px;
}

.dow-results.won h2 {
  color: #9be08b;
}

.dow-results.lost h2 {
  color: #ff8a80;
}

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

.dow-results-list li {
  padding: 8px;
  border: 1px solid var(--dow-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.dow-results-list li.won {
  border-color: #9be08b;
}

.dow-results-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dow-result-tag {
  margin-inline-start: auto;
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.dow-results-list li.won .dow-result-tag {
  background: #9be08b;
  color: #10240b;
}

.dow-root button.dow-results-open {
  position: fixed;
  inset-block-end: 16px;
  inset-inline-end: 16px;
  z-index: 6;
}

/* The exposure die, thrown above the table for everyone. */
.dow-exposure {
  --s: 60px;
  position: fixed;
  inset-inline: 0;
  inset-block-start: calc(var(--bar) + 96px);
  z-index: 15;
  display: grid;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.dow-exposure-roll {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 12px;
  border: 2px solid var(--dow-frost);
  border-radius: 16px;
  background: rgba(10, 18, 32, 0.94);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dow-exposure-roll.wound {
  border-color: var(--dow-blood);
}

.dow-exposure-roll.bitten {
  border-color: #ff5252;
  background: rgba(60, 10, 14, 0.95);
}

.dow-xdie {
  --die-body: linear-gradient(145deg, #f7fbff, #c3d8ea);
}

.dow-xface {
  display: grid;
  place-items: center;
  padding: 10%;
}

.dow-xface .dow-img {
  inline-size: 80%;
  block-size: 80%;
}

.dow-xblank {
  inline-size: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(18, 35, 58, 0.14);
}

@media (prefers-reduced-motion: no-preference) {
  .dow-exposure-roll {
    animation: dow-toast 3.6s ease both;
  }

  .dow-modal {
    animation: dow-rise 0.25s ease-out both;
  }

  .dow-player.current {
    animation: dow-glow 2.4s ease-in-out infinite;
  }
}

@keyframes dow-toast {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }

  8% {
    opacity: 1;
    transform: none;
  }

  85% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes dow-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

@keyframes dow-glow {
  50% {
    box-shadow: 0 0 0 4px rgba(242, 163, 58, 0.12);
  }
}


/* ---- The phone panel can fold down to its first line, to look at the table -------------------------------------- */

.dow-root button.dow-panel-toggle {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  float: inline-end;
  min-block-size: 36px;
  margin-block-end: -36px;
  padding: 2px 12px;
  font-size: 0.8rem;
  background: #22344d;
}

.dow-panel.collapsed {
  max-block-size: 62px;
  overflow: hidden;
}

.dow-panel.collapsed .dow-prompt > :not(:first-child),
.dow-panel.collapsed .dow-requests {
  visibility: hidden;
}

/* ---- How to play ------------------------------------------------------------------------------------------------ */

.dow-help {
  padding: 10px 12px;
  border: 1px solid var(--dow-line);
  border-radius: 12px;
  background: rgba(24, 37, 56, 0.88);
}

.dow-help summary {
  cursor: pointer;
  font-weight: 700;
}

.dow-help ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-inline-start: 18px;
  font-size: 0.86rem;
  color: var(--dow-ice);
}

/* Who voted what, after a vote. */
.dow-ballots {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-inline-start: 4px;
}

.dow-ballot {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

/* A place the picked survivor may move to. */
.dow-loc.reachable,
.dow-colony.reachable {
  box-shadow:
    0 0 0 3px var(--dow-amber),
    0 8px 20px rgba(0, 0, 0, 0.35);
}

.dow-root button.dow-move-here {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  margin-inline: 10px;
  min-block-size: 40px;
  padding: 2px 12px 2px 4px;
  border-color: var(--dow-amber);
  background: #3a2f1f;
  font-weight: 700;
}

.dow-colony .dow-move-here {
  margin-block-start: 8px;
}

/* What the last colony phase did. */
.dow-report {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--dow-amber);
  border-radius: 12px;
  background: rgba(58, 47, 31, 0.92);
}

.dow-report h2 {
  margin: 0;
  font-size: 1rem;
  color: #ffd8a6;
}

.dow-report ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-inline-start: 18px;
  font-size: 0.88rem;
}

.dow-report button {
  justify-self: end;
}

/* ---- Wider screens --------------------------------------------------------------------------------------------- */

@media (min-width: 700px) {
  .dow-colony .dow-entrances {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dow-locations {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    overflow-x: visible;
  }

  .dow-choose-objectives {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .dow-layout {
    grid-template-columns: 290px minmax(0, 1fr) 380px;
    grid-template-areas:
      "status status status"
      "info board panel"
      "side board panel";
    align-items: start;
    gap: 12px;
    padding: 12px;
  }

  .dow-status {
    grid-area: status;
  }

  .dow-info {
    grid-area: info;
  }

  .dow-board {
    grid-area: board;
  }

  .dow-side {
    grid-area: side;
  }

  .dow-panel {
    grid-area: panel;
    position: sticky;
    inset-block-start: calc(var(--bar) + 12px);
    inset-block-end: auto;
    max-block-size: calc(100dvh - var(--bar) - 24px);
    margin: 0;
    border: 1px solid rgba(127, 200, 248, 0.4);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  }

  .dow-locations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dow-root button.dow-panel-toggle {
    display: none;
  }

  .dow-panel.collapsed {
    max-block-size: calc(100dvh - var(--bar) - 24px);
    overflow-y: auto;
  }

  .dow-panel.collapsed .dow-prompt > :not(:first-child),
  .dow-panel.collapsed .dow-requests {
    visibility: visible;
  }

  .dow-panel .dow-hand-cards,
  .dow-panel .dow-group {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .dow-panel .dow-group-member {
    flex: 1 1 150px;
    min-inline-size: 0;
  }
}

/* ---- Survivor colours: each survivor's silhouette, with initials, so colour is never the only cue -------------- */

.dow-hue-0 {
  --dow-hue-bg: #5d7fa3;
  --dow-hue-ink: #1b2a3d;
  --dow-hue-accent: #f2a33a;
}

.dow-hue-1 {
  --dow-hue-bg: #7a6a9e;
  --dow-hue-ink: #241d38;
  --dow-hue-accent: #7fc8f8;
}

.dow-hue-2 {
  --dow-hue-bg: #4f8a7b;
  --dow-hue-ink: #15302a;
  --dow-hue-accent: #f2c94c;
}

.dow-hue-3 {
  --dow-hue-bg: #a3685d;
  --dow-hue-ink: #3a1f1a;
  --dow-hue-accent: #cfe3f2;
}

.dow-hue-4 {
  --dow-hue-bg: #8a7a4f;
  --dow-hue-ink: #2e2814;
  --dow-hue-accent: #e5534b;
}

.dow-hue-5 {
  --dow-hue-bg: #5e8f4e;
  --dow-hue-ink: #1c2f17;
  --dow-hue-accent: #f08a3e;
}

.dow-hue-6 {
  --dow-hue-bg: #9a5d84;
  --dow-hue-ink: #331b2c;
  --dow-hue-accent: #9be08b;
}

.dow-hue-7 {
  --dow-hue-bg: #4d7f9a;
  --dow-hue-ink: #13283a;
  --dow-hue-accent: #ffd27f;
}

.dow-hue-8 {
  --dow-hue-bg: #a57c4a;
  --dow-hue-ink: #38260f;
  --dow-hue-accent: #7fc8f8;
}

.dow-hue-9 {
  --dow-hue-bg: #6b6f9c;
  --dow-hue-ink: #1f2140;
  --dow-hue-accent: #f2a33a;
}

.dow-hue-10 {
  --dow-hue-bg: #3f8f94;
  --dow-hue-ink: #0f2d30;
  --dow-hue-accent: #ff9e80;
}

.dow-hue-11 {
  --dow-hue-bg: #93704f;
  --dow-hue-ink: #2f2114;
  --dow-hue-accent: #a8d8ff;
}

.dow-hue-12 {
  --dow-hue-bg: #7d5e9a;
  --dow-hue-ink: #271b36;
  --dow-hue-accent: #f2c94c;
}

.dow-hue-13 {
  --dow-hue-bg: #5a7f5c;
  --dow-hue-ink: #18291a;
  --dow-hue-accent: #e5534b;
}

.dow-hue-14 {
  --dow-hue-bg: #9e5f5f;
  --dow-hue-ink: #361919;
  --dow-hue-accent: #cfe3f2;
}

.dow-hue-15 {
  --dow-hue-bg: #4e6f99;
  --dow-hue-ink: #162238;
  --dow-hue-accent: #9be08b;
}

.dow-hue-16 {
  --dow-hue-bg: #8c6f8c;
  --dow-hue-ink: #2d1f2d;
  --dow-hue-accent: #ffd27f;
}

.dow-hue-17 {
  --dow-hue-bg: #6f8f5f;
  --dow-hue-ink: #20301a;
  --dow-hue-accent: #7fc8f8;
}

.dow-hue-18 {
  --dow-hue-bg: #a07a6a;
  --dow-hue-ink: #35241c;
  --dow-hue-accent: #c792ea;
}

.dow-hue-19 {
  --dow-hue-bg: #567c8a;
  --dow-hue-ink: #172a31;
  --dow-hue-accent: #f08a3e;
}

/* ---- Turn alerts ---------------------------------------------------------------------------------------------- */

/* The top bar's switches: the sounds, and the notifications for "your turn" (the bell). */
.bar .bar-icon {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0 8px;
  background: transparent;
  color: #fff8e7;
  border-color: #c8a27a;
}

.azul-game .bar .bar-icon {
  border-color: #6f86b8;
}

.bar-svg {
  inline-size: 18px;
  block-size: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.bar .bar-icon.on {
  background: #ffc83d;
  border-color: #ffc83d;
  color: #14284f;
}

.bar-icon.on .bell-svg,
.sound .speaker {
  fill: currentColor;
}

.bar-icon.blocked {
  opacity: 0.5;
}

.sound:not(.on) .waves,
.sound.on .mute {
  display: none;
}

/* "Your turn" over the table for a moment; it never takes a tap. */
.turn-show {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.turn-show > *,
.turn-show::before {
  grid-area: 1 / 1;
}

.turn-show-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 999px;
  background: rgba(20, 40, 79, 0.94);
  color: #fff;
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 800;
  box-shadow:
    0 0 0 4px #ffc83d,
    0 18px 50px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .turn-show-card {
    animation: turn-in 2.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  }

  .turn-show::before {
    content: "";
    inline-size: 140px;
    block-size: 140px;
    border: 5px solid #ffc83d;
    border-radius: 50%;
    opacity: 0;
    animation: turn-ring 1.3s ease-out 0.15s 2;
  }
}

@keyframes turn-in {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(24px);
  }
  12% {
    opacity: 1;
    transform: scale(1.08);
  }
  20% {
    transform: scale(1);
  }
  82% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.96) translateY(-14px);
  }
}

@keyframes turn-ring {
  from {
    opacity: 0.9;
    transform: scale(0.4);
  }
  to {
    opacity: 0;
    transform: scale(4);
  }
}

/* ---- Azul: moves playing out (AzulScreen) --------------------------------------------------------------------- */

/* Smooth scrolling only while a move brings a board into view. */
html.glide {
  scroll-behavior: smooth;
}

.az-fx {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.az-flyer {
  position: fixed;
  margin: 0;
  filter: drop-shadow(0 8px 8px rgba(20, 30, 60, 0.35));
  animation-name: az-fly;
  animation-timing-function: cubic-bezier(0.35, 0.1, 0.25, 1);
  animation-fill-mode: both;
}

.az-flyer.fade {
  animation-name: az-fly-lid;
}

/* A tile waits, hidden, for the one flying to its space. */
.az-slot.arriving > .az-tile,
.az-floor-slot.arriving > .az-tile {
  visibility: hidden;
}

.az-line-row.emptied .az-slot > .az-tile,
.az-floor-row.gone .az-floor-slot > .az-tile {
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.az-cell.walled .az-tile {
  opacity: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

/* The tiles that score the tile just placed. */
.az-cell.linked {
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 2px var(--az-glow),
    0 0 14px 3px rgba(255, 200, 61, 0.85);
}

.az-floor-row.hit .az-floor {
  box-shadow:
    0 0 0 2px #d6453d,
    0 0 14px rgba(214, 69, 61, 0.6);
}

.az-score {
  position: relative;
}

.az-score.counting {
  background: var(--az-cobalt);
  box-shadow: 0 0 0 3px var(--az-glow);
}

/* Points beside the score, rising: green up, red down. */
.az-bubble {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: calc(100% + 6px);
  translate: 0 -50%;
  z-index: 3;
  padding: 1px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}

.az-bubble.up {
  background: #2f8f4e;
}

.az-bubble.down {
  background: #c8413a;
}

.az-board.spotlight {
  position: relative;
  z-index: 2;
  box-shadow:
    0 0 0 4px var(--az-glow),
    0 16px 44px rgba(30, 40, 70, 0.35);
}

.az-board.shaded {
  opacity: 0.55;
  filter: saturate(0.7);
}

.az-replay-note {
  display: flex;
  justify-content: center;
}

@media (prefers-reduced-motion: no-preference) {
  .az-board {
    transition:
      box-shadow 0.25s ease,
      opacity 0.35s ease,
      filter 0.35s ease,
      transform 0.35s ease;
  }

  .az-board.spotlight {
    transform: scale(1.03);
  }

  .az-slot.landed > .az-tile,
  .az-floor-slot.landed > .az-tile {
    animation: az-land 0.35s ease-out;
  }

  .az-cell.walled .az-tile {
    animation: az-land 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4);
  }

  .az-cell.linked .az-tile {
    animation: az-glow-pulse 0.5s ease-in-out infinite alternate;
  }

  .az-floor-row.hit .az-floor-slot > .az-tile {
    animation: az-shake 0.4s ease-in-out 2;
  }

  .az-score.counting {
    animation: az-count 0.3s ease-out;
  }

  .az-bubble {
    animation: az-bubble 1.1s ease-out both;
  }

  /* A new round: the factories are filled one after the other. */
  .az-market.dealt .az-factory .az-pick {
    animation: az-deal 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards;
    animation-delay: calc(var(--i) * 70ms);
  }
}

@keyframes az-fly {
  0% {
    transform: translate(var(--dx), var(--dy)) scale(var(--s0, 1));
  }
  50% {
    transform: translate(calc(var(--dx) * 0.4), calc(var(--dy) * 0.4 - 36px)) scale(1.3) rotate(10deg);
  }
  100% {
    transform: translate(0, 0) scale(1) rotate(0);
  }
}

@keyframes az-fly-lid {
  0% {
    opacity: 1;
    transform: translate(var(--dx), var(--dy)) scale(var(--s0, 1));
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(0, 0) scale(0.3);
  }
}

@keyframes az-land {
  0% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes az-glow-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.12);
  }
}

@keyframes az-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px) rotate(-4deg);
  }
  75% {
    transform: translateX(3px) rotate(4deg);
  }
}

@keyframes az-count {
  from {
    transform: scale(1.25);
  }
  to {
    transform: scale(1);
  }
}

@keyframes az-bubble {
  0% {
    opacity: 0;
    transform: translateX(12px) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translateX(0) scale(1.15);
  }
  30% {
    transform: scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes az-deal {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.6) rotate(-12deg);
  }
}
