:root {
  --table: #202533;
  --table-deep: #111827;
  --surface: #f6f3ea;
  --surface-2: #e7e0d2;
  --surface-3: #d8cfbd;
  --ink: #181716;
  --muted: #5f5a52;
  --line: #27231f;
  --line-soft: #d1c7b6;
  --accent: #67e8f9;
  --accent-ink: #09242a;
  --blue: #60a5fa;
  --amber: #f7b733;
  --amber-deep: #9b6911;
  --amber-tint: #fff4d2;
  --amber-tint-ink: #5c3d00;
  --green: #2dd4bf;
  --green-ink: #062925;
  --green-tint: #e8f8d2;
  --green-tint-ink: #0c4b23;
  --green-deep: #0b6b57;
  --rose: #e95669;
  --rose-ink: #181716;
  --rose-tint: #fbe2e5;
  --rose-tint-ink: #7c1523;
  --danger: #f07052;
  --field: #fffef9;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 4px 0 rgba(0, 0, 0, 0.16);
  /* Two-layer ring: a near-white inner ring plus a dark outer ring. Works on
     every actual control background in this system (ivory fields, cyan bid
     tiles and CTAs, dark utility buttons) instead of the single-color cyan
     ring, which disappeared against the cyan surfaces it needed to outline. */
  --focus: 0 0 0 3px var(--field), 0 0 0 6px var(--line);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(circle at 20% 15%, rgba(103, 232, 249, 0.14), transparent 28rem),
    radial-gradient(circle at 84% 8%, rgba(96, 165, 250, 0.18), transparent 24rem),
    linear-gradient(180deg, var(--table), var(--table-deep));
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 8px 0;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.setup-view {
  display: flex;
  justify-content: center;
}

.setup-column {
  width: 100%;
  max-width: 680px;
  display: grid;
  gap: 18px;
}

.scoreboard,
.stat-tiles,
.score-toggle,
.player-controls,
.message-bar,
.standings-panel {
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.setup-intro h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--surface);
  text-wrap: balance;
}

.setup-sheet {
  display: grid;
  gap: 22px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setup-step {
  display: grid;
  gap: 10px;
}

.step-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 700;
}

.field-input:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

/* Step 1: player count stepper */
.player-count-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper-btn {
  flex: 0 0 auto;
  width: 48px;
  min-height: 48px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.stepper-value {
  width: 96px;
  min-height: 56px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}

.stepper-value:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

/* Step 2: vertical name list */
.name-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.name-row.name-row-enter {
  opacity: 0;
  transform: translateY(-6px);
}

.name-index {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.name-cell {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  padding: 0 14px;
  font-size: 18px;
  font-weight: 850;
}

.name-cell:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.name-cell::placeholder {
  color: var(--muted);
  font-weight: 600;
}

/* Step 4: decks + round path */
.decks-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.deck-count-control {
  min-height: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 8px;
}

.deck-count-option {
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.deck-count-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
}

.deck-count-option:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.26);
}

.deck-count-option:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.deck-count-option.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.round-preview {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

#setupStatus {
  margin: 0;
}

.setup-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
}

.button {
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
}

.button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.26);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.button.primary {
  width: 100%;
  margin-top: 0;
  min-height: 64px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 20px;
}

.button.ghost {
  background: var(--surface);
}

.button.red {
  background: var(--table-deep);
  color: var(--surface);
}

.button.won {
  background: var(--green);
  color: var(--green-ink);
}

.button.lost {
  background: var(--rose);
  color: var(--rose-ink);
}

.game-view {
  width: 100%;
}

.game-topbar {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--surface);
}

.game-topbar h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1;
}

.topbar-round {
  color: color-mix(in srgb, var(--surface) 78%, transparent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-dealer {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.topbar-dealer-label {
  color: var(--blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-dealer b {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1;
}

.score-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.scoreboard {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.score-grid {
  display: grid;
  grid-template-columns: 96px repeat(var(--players), minmax(0, 1fr));
  gap: 5px;
  overflow: auto;
  padding: 8px;
  background: var(--surface);
}

.grid-cell {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  text-align: center;
}

.grid-cell.label,
.grid-cell.side-label {
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

.grid-cell.header {
  min-height: 38px;
  border-color: var(--line);
  background: var(--table-deep);
  color: var(--surface);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.dealer-badge {
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--table-deep);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.grid-cell.bid-input {
  min-height: 52px;
  border-color: var(--line);
  background: var(--accent);
}

.grid-cell.bid-input input {
  width: min(88px, 100%);
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  text-align: center;
  font-size: 28px;
  font-weight: 950;
}

.grid-cell.big-total {
  min-height: 44px;
  background: var(--green-tint);
  color: var(--green-tint-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 700;
}

.grid-cell.total-negative {
  background: var(--rose-tint);
  color: var(--rose-tint-ink);
}

.message-bar {
  margin: 0 10px 10px;
  min-height: 32px;
  padding: 6px 12px;
  background: var(--amber-tint);
  color: var(--amber-tint-ink);
  font-weight: 850;
}

.message-bar.ok {
  background: var(--green-tint);
  color: var(--green-tint-ink);
}

/* Expected, not-yet-filled-in state (e.g. a fresh round awaiting bids).
   Same look as the base message-bar: neutral, not an error. */
.message-bar.todo {
  background: var(--amber-tint);
  color: var(--amber-tint-ink);
}

.message-bar.error {
  background: var(--rose-tint);
  color: var(--rose-tint-ink);
}

.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 10px 10px;
  padding: 10px 14px;
  border: 2px solid var(--amber-deep);
  border-radius: 12px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 850;
}

.score-grid.editing-past .grid-cell.bid-input {
  border-color: var(--amber-deep);
  background: var(--amber);
}

/* Reopen affordance once the standings panel below has been collapsed. Same
   position and shape as .edit-banner, but teal (won/complete) rather than
   amber (in-progress edit) so the two states never read as the same thing. */
.standings-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 10px 10px;
  padding: 10px 14px;
  border: 2px solid var(--green-deep);
  border-radius: 12px;
  background: var(--green);
  color: var(--green-ink);
  font-weight: 850;
}

/* The game-end moment: winner name up top, ranked standings below, in place
   of the score grid. Sits in-flow inside .scoreboard, never a modal. */
.standings-panel {
  display: grid;
  gap: 14px;
  margin: 0 10px 10px;
  padding: 16px;
  background: var(--surface);
}

.standings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.standings-winner {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--green);
  color: var(--green-ink);
  opacity: 0;
  animation: standingsWinnerReveal 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.standings-winner .mini-label {
  color: var(--green-ink);
  opacity: 0.72;
}

#standingsWinnerName {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  text-wrap: balance;
}

.standings-list {
  display: grid;
  gap: 6px;
}

.standing-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--field);
  opacity: 0;
  transform: translateY(8px);
  animation: standingsReveal 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(140ms + (var(--stagger, 0) * 40ms));
}

.standing-rank {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.standing-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  text-align: right;
}

.standing-tie {
  flex: 0 0 auto;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Winner row: the brightest tile on the board, same teal used for Won
   elsewhere so the state color vocabulary stays consistent. */
.standing-row.standing-winner {
  border-color: var(--line);
  background: var(--green);
  color: var(--green-ink);
}

.standing-row.standing-winner .standing-rank {
  color: var(--green-ink);
}

.standing-row.standing-winner .standing-tie {
  background: rgba(6, 41, 37, 0.14);
  border-color: rgba(6, 41, 37, 0.3);
  color: var(--green-ink);
}

@keyframes standingsReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes standingsWinnerReveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.history-panel {
  margin: 0 10px 10px;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
}

.history-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.history-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1;
}

.history-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.history-grid {
  position: relative;
  display: grid;
  grid-template-columns: 150px repeat(var(--players), minmax(0, 1fr));
  gap: 4px;
  overflow: auto;
}

:root[data-player-density="spacious"] .score-grid {
  grid-template-columns: 110px repeat(var(--players), minmax(0, 1fr));
  min-width: 640px;
}

:root[data-player-density="dense"] .score-grid {
  grid-template-columns: 74px repeat(var(--players), minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

:root[data-player-density="dense"] .history-grid {
  grid-template-columns: 104px repeat(var(--players), minmax(0, 1fr));
  gap: 3px;
}

:root[data-player-density="dense"] .grid-cell {
  min-height: 32px;
  padding: 4px;
  font-size: 11px;
}

:root[data-player-density="dense"] .grid-cell.header {
  min-height: 34px;
  font-size: 15px;
}

:root[data-player-density="dense"] .grid-cell.bid-input {
  min-height: 46px;
}

:root[data-player-density="dense"] .grid-cell.bid-input input {
  width: min(54px, 100%);
  height: 34px;
  font-size: 20px;
}

:root[data-player-density="dense"] .grid-cell.big-total {
  min-height: 40px;
  font-size: 26px;
}

:root[data-player-density="dense"] .history-cell {
  min-height: 24px;
  padding: 3px 4px;
  font-size: 10px;
}

:root[data-player-density="dense"] .player-controls {
  gap: 6px;
}

:root[data-player-density="dense"] .player-control {
  min-height: 38px;
  padding: 5px 6px;
}

:root[data-player-density="dense"] .player-control strong {
  font-size: 14px;
}

:root[data-player-density="dense"] .player-control .button {
  min-width: 42px;
  min-height: 30px;
  padding: 0 6px;
  font-size: 12px;
}

:root[data-player-density="dense"] .history-label.player {
  font-size: 11px;
}

:root[data-player-density="spacious"] .grid-cell.header {
  font-size: 30px;
}

:root[data-player-density="spacious"] .grid-cell.bid-input input {
  width: min(108px, 100%);
}

:root[data-player-density="spacious"] .grid-cell.big-total {
  font-size: 48px;
}

.history-cell {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}

.history-cell.clickable {
  cursor: pointer;
}

.history-cell.clickable:hover {
  background: var(--surface-3);
}

.history-cell.clickable:active {
  background: var(--line-soft);
}

.history-cell.clickable:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.history-round.live-anchor {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.history-label {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.history-label:not(.player) {
  left: 0;
  z-index: 5;
}

.history-label.player {
  background: var(--table-deep);
  color: var(--surface);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.history-round {
  position: sticky;
  left: 0;
  z-index: 2;
  justify-content: center;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.history-cell.current {
  border-color: var(--amber-deep);
  background: var(--amber);
  color: var(--ink);
}

.history-score.done {
  background: var(--green-tint);
  color: var(--ink);
}

.side-panel {
  display: grid;
  gap: 10px;
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The two numbers the table lives by: Total Bids vs Cards in Play, side by
   side as the biggest figures on the panel, with the under/over verdict as a
   small caption beneath. */
.stat-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  background: var(--table-deep);
  color: var(--surface);
  padding: 12px 16px;
}

.stat-tile {
  display: grid;
  gap: 6px;
}

.stat-tiles .mini-label {
  color: var(--accent);
}

.stat-tile b {
  color: var(--surface);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 1;
}

/* Cards in Play is the one stat that needs to grab the eye (it is what a
   bid total is measured against), so it borrows Danger Coral, the token
   DESIGN.md already reserves for "high-attention stat cells". */
#maxAllowed {
  color: var(--danger);
}

.stat-caption {
  grid-column: 1 / -1;
  padding-top: 6px;
  border-top: 1px solid rgba(251, 247, 237, 0.22);
  color: color-mix(in srgb, var(--surface) 78%, transparent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.score-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
}

.toggle-option {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 950;
}

.toggle-option:hover {
  background: var(--surface-2);
}

.toggle-option:active {
  background: var(--surface-3);
}

.toggle-option.active {
  background: var(--table-deep);
  color: var(--surface);
}

/* High-traffic: the one button pressed every round. */
.next-action {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
}

/* Occasional shortcuts: smaller than the per-player Won/Lost buttons. */
.control-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.control-row .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

/* One-time-use housekeeping: smallest tier. */
.utility-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.utility-row .button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.player-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
  padding: 8px;
  background: var(--surface);
  max-height: 46vh;
  overflow: auto;
}

.player-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--field);
}

.player-control strong {
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-control .button {
  min-width: 48px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13px;
}

.player-control .active {
  outline: 3px solid var(--line);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .score-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: -1;
  }

  .game-topbar {
    flex-wrap: wrap;
    row-gap: 4px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100vw - 12px);
    padding: 8px 0 18px;
  }

  .setup-actions-row {
    grid-template-columns: 1fr;
  }

  #standingsWinnerName {
    font-size: 32px;
  }

  .control-row,
  .utility-row {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 780px) {
  .history-grid {
    max-height: 330px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}
