:root {
  --bg-primary: #0d0f14;
  --bg-card: #151922;
  --bg-card-hover: #1c2230;
  --bg-input: #0a0c10;
  --border: #232a3b;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --primary: #ff6b35;
  --primary-hover: #fa5719;
  --primary-glow: rgba(255, 107, 53, 0.3);
  --gold: #ffd166;
  --gold-glow: rgba(255, 209, 102, 0.25);
  --red: #ef476f;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Consolas, monospace;

  --z-pile: 40;
  --z-head: 60;
  --z-setup-bar: 55;
  --z-toast: 80;
  --z-takeover: 90;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* No overflow-x: hidden — it silently kills position: sticky on the
     ticker head, and the pile clips itself anyway. */
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px max(32px, env(safe-area-inset-bottom, 32px));
  /* No z-index here on purpose: it would trap .ticker-head in a stacking
     context below the pile, and the pile would bury the punchline too. */
  position: relative;
}

/* ============================================================
   THE PILE
   One gesture, overcommitted. It grows from the floor and buries
   the list. It never blocks a click and never eats the punchline.
   ============================================================ */
.pile {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-pile);
  overflow: hidden;
  contain: strict;
}

.pile-item {
  position: absolute;
  width: var(--pz-size, 64px);
  height: var(--pz-size, 64px);
  will-change: transform;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.6)) brightness(var(--pz-bri, 1));
}

.pile-item.dropping {
  animation: pileDrop 0.62s cubic-bezier(0.34, 0.72, 0.36, 1);
}

@keyframes pileDrop {
  0% { transform: translateY(-105vh) rotate(var(--pz-rot-from, 0deg)); }
  100% { transform: translateY(0) rotate(var(--pz-rot, 0deg)); }
}

/* ============================================================
   TAKEOVER — the punchline hits, then leaves the stage
   ============================================================ */
.takeover {
  position: fixed;
  inset: 0;
  z-index: var(--z-takeover);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 11, 15, 0.965);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.takeover.show {
  visibility: visible;
  animation: takeoverBeat 1.5s ease-out forwards;
}

/* Hard cut in. A punchline that fades in is a punchline apologising. */
@keyframes takeoverBeat {
  0%, 84% { opacity: 1; }
  100% { opacity: 0; }
}

.takeover-inner {
  text-align: center;
  width: 100%;
  max-width: 820px;
}

.takeover.show .takeover-inner {
  animation: takeoverPush 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes takeoverPush {
  0% { transform: scale(0.86); }
  10% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.takeover-kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}

.takeover-name {
  font-size: clamp(1.75rem, 7.2vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  color: #fff;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

.takeover-count {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 4vw, 1.9rem);
  font-weight: 700;
  color: var(--gold);
}

.takeover-count:empty { display: none; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
  min-width: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px var(--primary-glow));
}

.logo-text { min-width: 0; }

.logo-text h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.icon-btn.active {
  color: var(--gold);
  border-color: var(--gold);
}

.cur-btn {
  width: auto !important;
  padding: 0 12px !important;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ============================================================
   SETUP
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.form-group { margin-bottom: 22px; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.label-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.label-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.pill-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  touch-action: manipulation;
  min-height: 44px;
}

.pill-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--text-dim);
}

.pill-btn.active {
  background: rgba(255, 107, 53, 0.15);
  border-color: var(--primary);
  color: #fff;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.role-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  touch-action: manipulation;
  min-height: 44px;
}

.role-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.role-card.active {
  background: rgba(255, 107, 53, 0.12);
  border-color: var(--primary);
}

.role-header {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.role-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.slider-input {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-input);
  outline: none;
  accent-color: var(--primary);
  cursor: pointer;
  touch-action: manipulation;
}

.custom-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-mono);
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  min-height: 44px;
}

.input-field:focus { border-color: var(--primary); }

/* The joke lands before the timer even starts */
.preview-hero {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 0 20px;
  margin-bottom: 24px;
}

.preview-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.preview-unit {
  font-size: clamp(1.35rem, 4.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
  text-wrap: balance;
}

.preview-unit b {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.preview-rates {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.preview-rates .dot { margin: 0 10px; opacity: 0.5; }

.setup-start-bar {
  margin-top: 16px;
}

.setup-start-bar .btn-primary {
  width: 100%;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  touch-action: manipulation;
  min-height: 56px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

/* ============================================================
   TICKER
   ============================================================ */
.ticker-view { display: none; }
/* display: contents, not block — otherwise the sticky head is trapped by
   this element's box and slides away at the bottom of the page, which is
   exactly where the pile pushes the reader. */
.ticker-view.active { display: contents; }
.setup-view.hidden { display: none; }

/* Sticky head — the pile is allowed to bury the list, never this */
.ticker-head {
  position: sticky;
  top: 0;
  z-index: var(--z-head);
  background: var(--bg-primary);
  padding: 14px 0 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 18px 30px -12px var(--bg-primary);
}

.live-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 8px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 71, 111, 0.15);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-badge.paused {
  background: rgba(255, 209, 102, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.live-badge.finished {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--text-dim);
  color: var(--text-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  animation: pulseDot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.live-badge.paused .live-dot { background: var(--gold); animation: none; }
.live-badge.finished .live-dot { background: var(--text-dim); animation: none; }

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.participants-quick-adjust {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex-shrink: 0;
}

.adjust-mini-btn {
  background: var(--bg-card-hover);
  border: none;
  color: var(--text-main);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.adjust-mini-btn:hover { background: var(--primary); color: #fff; }

/* HERO — the rate owns the screen */
.hero { margin-bottom: 18px; }

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.hero-name {
  font-size: clamp(1.9rem, 7vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.038em;
  line-height: 0.98;
  color: #fff;
  text-wrap: balance;
}

.hero-interval {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 3.6vw, 1.6rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

/* Everything that used to shout, demoted to one quiet line */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.stat-cell { white-space: nowrap; }
.stat-dim { color: var(--text-dim); }
.time-ms { color: var(--text-dim); }

.control-bar {
  display: grid;
  /* auto-flow, so hiding Pause/Finish leaves two full-width buttons
     instead of two buttons and a hole. */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 10px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-finish-meeting {
  border-color: rgba(255, 209, 102, 0.35);
  color: var(--gold);
}

.btn-finish-meeting:hover { border-color: var(--gold); }

.btn-share {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.btn-share:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.kbd-hint-bar {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Next milestone — anticipation */
.next-milestone-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.next-milestone-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 0.82rem;
  gap: 10px;
}

.next-milestone-label {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-milestone-time {
  font-family: var(--font-mono);
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.15s ease;
}

/* Finished */
.finished-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 22px;
  position: relative;
  z-index: calc(var(--z-pile) + 1);
}

.finished-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 14px;
}

.finished-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.finished-stat {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.finished-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ============================================================
   THE LIST — an inventory, not an achievement board
   ============================================================ */
.milestone-box { margin-bottom: 24px; }

.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  touch-action: manipulation;
  min-height: 38px;
}

.tab-btn:hover { color: var(--text-main); border-color: var(--text-dim); }

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.milestones-list {
  display: flex;
  flex-direction: column;
}

.milestone-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(35, 42, 59, 0.55);
}

.milestone-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.3;
  min-width: 0;
}

/* Eaten: struck out. Not "done", not a checkbox. Gone. */
.milestone-item.eaten .milestone-name {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--primary);
}

.milestone-count {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.milestone-pending {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.milestone-cost {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.bottom-bar {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s ease;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-link:hover { color: var(--primary); }

/* Toast — copy confirmation only */
.toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%) translateY(140px);
  background: #1e2535;
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: var(--z-toast);
  max-width: 90vw;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 680px) {
  .container { padding: 14px 12px max(24px, env(safe-area-inset-bottom, 24px)); }
  .card { padding: 16px 14px; border-radius: var(--radius-md); }

  .header { margin-bottom: 16px; padding-bottom: 12px; gap: 8px; }
  #fullscreen-btn { display: none; }
  .logo { gap: 8px; flex: 1; min-width: 0; }
  .logo-mark { width: 30px; height: 30px; }
  .logo-text h1 { font-size: 1rem; }
  .logo-text p { font-size: 0.72rem; }
  .header-actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .cur-btn { padding: 0 8px !important; font-size: 0.8rem; }

  .ticker-head { padding: 10px 0 14px; margin-bottom: 18px; }
  .live-badge-row { margin-bottom: 14px; }
  .hero { margin-bottom: 14px; }
  .stat-strip { gap: 4px 14px; font-size: 0.8rem; padding-top: 12px; margin-bottom: 14px; }

  .control-bar { grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 8px; }
  .btn-secondary { padding: 11px 8px; font-size: 0.88rem; }

  .finished-grid { grid-template-columns: 1fr; gap: 8px; }
  .finished-actions { grid-template-columns: 1fr; }
  .custom-inputs-row { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .role-card { padding: 10px; }
  .role-header { font-size: 0.85rem; }
  .role-desc { font-size: 0.75rem; }

  .next-milestone-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .kbd-hint-bar { display: none; }

  .setup-view {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .setup-start-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-setup-bar);
    margin-top: 0;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom, 12px));
    background: linear-gradient(to top, var(--bg-primary) 72%, rgba(13, 15, 20, 0));
    border-top: 1px solid var(--border);
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.45);
  }

  .setup-start-bar .btn-primary {
    min-height: 52px;
    font-size: 1.05rem;
  }

  .card:last-of-type,
  .setup-view > .card {
    margin-bottom: 0;
  }
}

@media (max-width: 400px) {
  .role-grid { grid-template-columns: 1fr; }
  .pill-grid { gap: 4px; }
  .pill-btn { font-size: 0.8rem; padding: 8px 2px; }
}

/* ============================================================
   REDUCED MOTION — the pile stays, the theatre stops
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .pile-item.dropping { animation: none; }
  .live-dot { animation: none; }
  .takeover.show { animation: none; opacity: 1; }
  .takeover.show .takeover-inner { animation: none; }
  .btn-primary:hover, .btn-secondary:hover { transform: none; }
  * { transition-duration: 0.01ms !important; }
}
