/* gol-tally — Stage 0 app shell.
 *
 * Plain, legible, fast (theming is a non-goal per project doc).
 * 100dvh + safe-area insets so iOS Safari's collapsing URL bar
 * cannot eat the footer controls. */

:root {
  --bg: #14141f;
  --surface: #1f1f2e;
  --surface-2: #2a2a3f;
  --border: #34344a;
  --text: #f0f0f5;
  --text-dim: #9090a8;
  --accent: #6aa7ff;
  --danger: #ff7a7a;
  /* Game-of-Life board palette (gol-tally-d3) — mirrors the per-player
   * CHIP_COLORS spectrum in app.js so themed accents and player stripes
   * read as the same "path tile" rainbow. */
  --gol-red: #ff6a8a;
  --gol-orange: #ffb86a;
  --gol-yellow: #ffd96a;
  --gol-green: #9aff7a;
  --gol-blue: #6aa7ff;
  --gol-purple: #c79aff;
  --gol-rainbow: linear-gradient(90deg, var(--gol-red), var(--gol-orange), var(--gol-yellow), var(--gol-green), var(--gol-blue), var(--gol-purple));
  --tap-min: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.app {
  min-height: 100dvh;
  min-height: 100vh; /* fallback for browsers without dvh */
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  display: flex;
  flex-direction: column;
}

/* Body class toggles which view is visible. Both shells live in the
 * DOM so Stage 0 acceptance can verify them by flipping the class. */
.setup-view,
.tally-view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

body.view-setup .setup-view { display: flex; }
body.view-tally .tally-view { display: flex; }

/* ---------- Setup view ---------- */

.setup-view {
  align-items: stretch;
  justify-content: flex-start;
  padding: 16px;
  overflow-y: auto;
}

.setup-card {
  width: 100%;
  max-width: 420px;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setup-title {
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text);
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.count-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.count-btn {
  min-height: var(--tap-min);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s;
}

.count-btn:hover { border-color: var(--accent); }
.count-btn:active { transform: scale(0.97); }

.count-btn[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e1320;
}

.name-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}

.name-input::placeholder {
  color: var(--text-dim);
}

.name-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.primary-cta {
  width: 100%;
  min-height: 56px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #0e1320;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.primary-cta:active { transform: scale(0.98); }

/* ---------- Tally view ---------- */

.tally-view {
  gap: 12px;
  padding: 12px;
}

/* Chip strip — wraps to at most two rows; every chip is visible at
 * once. Per-count flex basis (driven by [data-count] on the strip)
 * decides how many chips share each row:
 *   2 → 1×2, 3 → 1×3, 4 → 2×2, 5 → 3+2, 6 → 2×3.
 * No horizontal scroll, no fade mask. */
.chip-strip {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 8px 12px;
}

.chip-strip:empty::before {
  content: "No players yet — return to Setup.";
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
}

/* Per-count row policy. Gap is 8px; flex-basis subtracts the gap share
 * so two/three chips fit per row without forcing a wrap. flex-grow:1
 * lets the trailing wrapped row (5 players → 2 chips in row 2) share
 * the row width evenly instead of left-aligning at the column basis. */
.chip-strip[data-count="2"] .chip,
.chip-strip[data-count="4"] .chip {
  flex: 1 1 calc(50% - 4px);
}
.chip-strip[data-count="3"] .chip,
.chip-strip[data-count="5"] .chip,
.chip-strip[data-count="6"] .chip {
  flex: 1 1 calc(33.333% - 6px);
}

/* Player chips. The chip itself is a positioned container; the
 * activate button fills most of it (taps activate the player); a small
 * "⋮" details button overlays the top-right corner (taps open the
 * per-player entries modal for surgical delete). Active chip is
 * "unmissable" — filled accent fill, scaled up, accent ring. */
.chip {
  position: relative;
  border-radius: 10px;
  border-left: 4px solid var(--chip-color, var(--border));
  background: transparent; /* the activate button paints the surface */
}

.chip-activate {
  appearance: none;
  -webkit-appearance: none;
  min-height: 56px;
  min-width: 100%;
  padding: 6px 32px 6px 10px; /* room for the details affordance */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: none; /* the .chip already paints the accent stripe */
  border-radius: 8px 10px 10px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
  font-family: inherit;
  color: var(--text);
  text-align: left;
}

.chip-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9ch;
}

.chip-total {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.chip-details {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip-details:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.chip-activate[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(106, 167, 255, 0.32);
}

.chip-activate[aria-selected="true"] .chip-name,
.chip-activate[aria-selected="true"] .chip-total {
  color: #0e1320;
}

.chip-activate[aria-selected="true"] ~ .chip-details {
  color: #0e1320;
}

/* Brief feedback flash on a chip that just received an entry — gives
 * the operator a visible "yes, that landed on Alice" so they don't
 * second-tap-just-to-be-sure (Adversarial 2 / Concerns Matrix). */
@keyframes chip-flash {
  0%   { box-shadow: 0 0 0 0 rgba(154, 255, 122, 0.0); }
  35%  { box-shadow: 0 0 0 6px rgba(154, 255, 122, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(154, 255, 122, 0.0); }
}

.chip.chip-flash .chip-activate {
  animation: chip-flash 360ms ease-out;
}

@keyframes banner-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.active-banner.banner-bump .active-banner-total {
  display: inline-block;
  animation: banner-bump 240ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .chip.chip-flash .chip-activate,
  .active-banner.banner-bump .active-banner-total {
    animation: none;
  }
}

/* ---------- Entries modal (surgical per-entry delete) ---------- */

.entries-modal[hidden] { display: none; }

.entries-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 12;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  max-height: 70vh;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: var(--tap-min);
  height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.entries-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entries-list:empty::after {
  content: "No entries yet.";
  display: block;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 24px 0;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.entry-amount {
  flex: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

.entry-delete {
  width: var(--tap-min);
  height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.entry-delete:active { background: rgba(255, 122, 122, 0.16); }

.footer-btn:not(:disabled):active { transform: scale(0.97); }

/* Active-player banner — "unmissable" treatment lands in Stage 2; the
 * shell here just reserves the space. */
.active-banner {
  flex: 0 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--chip-color, var(--border));
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.active-banner-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.active-banner-total {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Buffer display */
.buffer-display {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1.1rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.buffer-display .buffer-value {
  color: var(--text);
  font-weight: 600;
}

/* Pad — quick-add row above a 4×3 numeric grid. Behaviour wired in
 * Stages 3 (quick-add) and 4 (numeric + ADD + ⌫). */
.pad-shell {
  flex: 1 1 auto;
  min-height: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.numeric-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
}

.pad-btn {
  min-height: var(--tap-min);
  padding: 10px 8px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
  transition: transform 0.08s, background 0.12s;
}

.pad-btn:not(:disabled):active {
  transform: scale(0.96);
  background: var(--surface);
}

.pad-btn:disabled {
  opacity: 0.85; /* Stage 2 is passive — buttons read as present, not absent */
  cursor: default;
}

/* Quick-adds are the bread-and-butter taps — noticeably taller than
 * digit keys. */
.quick-btn {
  font-size: 1.15rem;
  min-height: 56px;
  background: var(--surface);
  border-color: var(--border);
}

.quick-btn-back {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-dim);
}

.digit-btn {
  font-size: 1.45rem;
}

.clear-btn {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* ADD is visually the commit action — accent color, distinct from the
 * digit grid. Spatial separation from Clear is provided by the 0 key
 * sitting between them. */
.add-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e1320;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Footer — Undo / End game. Anchored to the bottom of the app column.
 * Buttons are inert in Stage 0 (disabled attribute on the markup). */
.tally-footer {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
}

.footer-btn {
  flex: 1;
  min-height: var(--tap-min);
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.footer-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

/* ---------- Resume prompt ---------- */

.resume-prompt[hidden] { display: none; }

.resume-prompt {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.resume-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resume-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.resume-body {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.resume-actions {
  display: flex;
  gap: 10px;
}

.resume-btn {
  flex: 1;
  min-height: var(--tap-min);
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.resume-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e1320;
}

.resume-btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #1a0a0a;
}

.modal-body {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

/* ---------- Past games (gol-tally-d2) ---------- */

.setup-ghost-btn {
  width: 100%;
  min-height: var(--tap-min);
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.setup-ghost-btn:not([disabled]):hover { color: var(--text); border-color: var(--accent); }
.setup-ghost-btn[disabled] { cursor: default; opacity: 0.5; }

.history-empty {
  margin: 0;
  padding: 24px 0;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item-date {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.history-player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-player-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  font-size: 1rem;
}

.history-player-row-leader {
  color: var(--accent);
  font-weight: 600;
}

.history-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-player-total {
  font-variant-numeric: tabular-nums;
}

/* Per-row "Use these names" action — closes the modal and pre-fills
 * the setup form with the record's roster. Matches the ghost-button
 * look (.setup-ghost-btn / .resume-btn-secondary). */
.history-use-names {
  align-self: stretch;
  min-height: var(--tap-min);
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.history-use-names:hover { color: var(--text); border-color: var(--accent); }
.history-use-names:active { transform: scale(0.98); }

/* ---------- Winner declaration (gol-tally-d4) ---------- */

.winner-card {
  align-items: stretch;
  text-align: center;
}

.winner-headline {
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.95rem;
}

.winner-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
  margin-top: -4px;
}

.winner-total {
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.winner-leaderboard {
  list-style: none;
  margin: 4px 0 0 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.winner-rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.winner-rank-row-leader {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.winner-rank-place {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-weight: 600;
}

.winner-rank-row-leader .winner-rank-place {
  color: var(--accent);
}

.winner-rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-rank-total {
  font-variant-numeric: tabular-nums;
}

@keyframes winner-pop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

.winner-card-pop {
  animation: winner-pop 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .winner-card-pop {
    animation: none;
  }
}

/* ---------- Game-of-Life theming (gol-tally-d3) ----------
 * Branding layer only: a board palette, a Setup spinner motif, themed
 * chip tints, and an end-of-game flourish. No layout changes, no new
 * deps, no web fonts, no raster art — all CSS + one inline SVG. Keeps
 * the v1 "plain, legible, fast" contract (Adversarial: theming creep).*/

/* Spinner art on the Setup screen — the iconic LIFE wheel. */
.spinner-art {
  display: flex;
  justify-content: center;
  margin-bottom: -8px;
}

.spinner-art svg {
  width: 92px;
  height: 92px;
}

.spinner-wheel {
  transform-origin: 50px 50px;
  animation: gol-spin 24s linear infinite;
}

.wedge-red { fill: var(--gol-red); }
.wedge-orange { fill: var(--gol-orange); }
.wedge-yellow { fill: var(--gol-yellow); }
.wedge-green { fill: var(--gol-green); }
.wedge-blue { fill: var(--gol-blue); }
.wedge-purple { fill: var(--gol-purple); }
.spinner-hub { fill: var(--surface); stroke: var(--bg); stroke-width: 3; }
.spinner-pointer { fill: var(--text); }

@keyframes gol-spin { to { transform: rotate(360deg); } }

/* Branded title — a rainbow "path" rule under the wordmark. */
.setup-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 2px;
  background: var(--gol-rainbow);
}

/* Primary CTA reads as the spinner's "go". */
.primary-cta {
  background: linear-gradient(135deg, var(--gol-blue), var(--gol-purple));
}

/* Themed chip backgrounds — a faint wash of each player's path color.
 * Guarded by @supports so unsupported engines fall back to the plain
 * surface; the active chip still overrides to the solid accent fill. */
@supports (background: color-mix(in srgb, white, black)) {
  .chip-activate {
    background: color-mix(in srgb, var(--chip-color, var(--surface-2)) 12%, var(--surface-2));
  }
}

/* End-of-game flourish on the winner modal. */
.winner-card {
  position: relative;
  overflow: hidden;
}

.winner-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gol-rainbow);
}

.winner-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(106, 167, 255, 0.14), transparent 70%);
  pointer-events: none;
}

.winner-card > * {
  position: relative; /* keep content above the ::after glow */
}

@media (prefers-reduced-motion: reduce) {
  .spinner-wheel { animation: none; }
}

/* ---------- Landscape / tablet ---------- */

@media (min-width: 720px) and (orientation: landscape) {
  .tally-view {
    flex-direction: row;
    gap: 16px;
    padding: 16px;
  }

  .chip-strip {
    flex: 0 0 220px;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .tally-view > .active-banner,
  .tally-view > .buffer-display,
  .tally-view > .pad-shell,
  .tally-view > .tally-footer {
    /* In landscape the right column owns banner/buffer/pad/footer.
     * Stage 0 keeps the same DOM order; a wrapping column lands once
     * Stage 2 introduces real content density. */
  }
}
