/* ============================================
   Among Us IRL - Apple-like design system
   ============================================ */

:root {
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 20px;
  --s-xxl: 28px;
  --s-xxxl: 40px;
}

:root[data-theme="dark"] {
  --bg: #000;
  --bg-secondary: #0a0a0a;
  --card: #1c1c1e;
  --card-elevated: #2c2c2e;
  --card-highlight: #3a3a3c;
  --text: #fff;
  --text-secondary: #ebebf5;
  --text-tertiary: #8e8e93;
  --separator: #38383a;
  --blue: #0a84ff;
  --red: #ff453a;
  --green: #30d158;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --purple: #bf5af2;
  --scrim: rgba(0,0,0,.4);
}

:root[data-theme="light"] {
  --bg: #f2f2f7;
  --bg-secondary: #fff;
  --card: #fff;
  --card-elevated: #fff;
  --card-highlight: #f2f2f7;
  --text: #000;
  --text-secondary: #3c3c43;
  --text-tertiary: #8e8e93;
  --separator: #e5e5ea;
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --purple: #af52de;
  --scrim: rgba(0,0,0,.2);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
  line-height: 1.4;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
input, textarea, button { font-family: inherit; }

/* ---------- Header ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 50;
}
:root[data-theme="dark"] .topbar { background: rgba(0,0,0,.6); border-bottom: .5px solid var(--separator); }
:root[data-theme="light"] .topbar { background: rgba(242,242,247,.7); border-bottom: .5px solid var(--separator); }

.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; letter-spacing: -.2px;
  color: var(--text); text-decoration: none;
  font-size: 17px;
}
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 18px;
  border: none; cursor: pointer; background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: opacity .15s;
}
.icon-btn:hover { opacity: .6; }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ---------- Layout ---------- */
.content {
  padding: 16px 20px 60px;
  max-width: 640px;
  margin: 0 auto;
}

.large-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .37px;
  line-height: 41px;
  margin: 8px 0 4px;
}
.subtitle-large {
  color: var(--text-tertiary);
  font-size: 15px;
  margin: 0 0 24px;
}
h1, h2, h3, h4, h5, p { margin: 0; }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 16px;
  margin-bottom: 8px;
}
.section { margin-bottom: 28px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow: hidden;
}
.card.center { text-align: center; }
.card.flush { padding: 0; }

/* ---------- List rows ---------- */
.list { background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: .5px solid var(--separator);
  cursor: pointer;
  background: transparent;
  border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left;
  color: var(--text);
  transition: background .12s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--card-highlight); }
.list-row .row-icon-bg {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-row .row-icon-bg svg { width: 20px; height: 20px; }
.list-row .row-title { font-weight: 600; font-size: 16px; }
.list-row .row-sub { color: var(--text-tertiary); font-size: 13px; margin-top: 2px; }
.list-row .row-end {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  color: var(--text-tertiary);
}
.list-row .row-end svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  border-radius: var(--r-md);
  font-size: 17px; font-weight: 600;
  border: none; cursor: pointer;
  transition: opacity .12s, transform .08s;
  width: 100%;
  box-sizing: border-box;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue); color: white; }
.btn-secondary { background: var(--card-elevated); color: var(--text); }
.btn-tinted { background: rgba(10,132,255,.15); color: var(--blue); }
.btn-destructive { background: var(--red); color: white; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary svg, .btn-destructive svg { stroke: white; }

.btn-lg { padding: 17px 20px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; padding: 0; }
.input, .textarea {
  width: 100%;
  background: var(--card);
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 17px;
  border: none;
  outline: none;
  font-family: inherit;
}
.input:focus, .textarea:focus { box-shadow: inset 0 0 0 1.5px var(--blue); }
.textarea { resize: vertical; min-height: 180px; }

.input-code {
  text-align: center;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 10px;
  padding: 24px 16px;
  font-variant-numeric: tabular-nums;
}

.seg {
  display: flex; gap: 4px;
  background: var(--card);
  border-radius: var(--r-md);
  padding: 4px;
}
.seg-btn {
  flex: 1;
  padding: 12px;
  border-radius: calc(var(--r-md) - 4px);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
}
.seg-btn.active { background: var(--card-elevated); color: var(--text); }
:root[data-theme="light"] .seg-btn.active { background: white; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- Code display ---------- */
.code-display {
  text-align: center;
  padding: 32px 20px;
  background: var(--card);
  border-radius: var(--r-lg);
}
.code-display .code {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 10px;
  font-variant-numeric: tabular-nums;
  margin: 8px 0;
}
.share-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(10,132,255,.15);
  color: var(--blue);
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
  margin-top: 8px;
  border: none; cursor: pointer;
}
.share-pill svg { width: 14px; height: 14px; stroke: var(--blue); fill: none; stroke-width: 2; }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: white;
  flex-shrink: 0;
}
.avatar.dead { opacity: .55; background: #5a5a5e !important; }

/* ---------- Player row ---------- */
.player-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: .5px solid var(--separator);
}
.player-row:last-child { border-bottom: none; }
.player-row.dead { opacity: .55; }
.player-row .name { font-weight: 600; flex: 1; }
.player-row.dead .name { text-decoration: line-through; }
.host-badge {
  background: var(--blue); color: white;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  letter-spacing: .5px;
}
.dead-badge { color: var(--text-tertiary); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.dead-badge svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---------- Counter row ---------- */
.row-counter {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px; margin-bottom: 8px;
}
.row-counter .label { padding: 0; margin: 0; }
.row-counter .count { color: var(--text-tertiary); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Progress bar ---------- */
.progress {
  height: 6px; background: var(--card-elevated); border-radius: 3px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width .3s ease; }
.progress-info {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
}
.progress-info .label { padding: 0; margin: 0; }
.progress-info .pct { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Role card ---------- */
.role-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  border: 1.5px solid transparent;
}
.role-card.crewmate { border-color: var(--green); }
.role-card.imposter { border-color: var(--red); }
.role-card.locked {
  flex-direction: column; gap: 8px;
  justify-content: center; align-items: center;
  min-height: 130px; cursor: pointer;
  user-select: none;
  border: 1.5px dashed var(--separator);
  background: var(--card);
}
.role-card.locked .role-name { color: var(--text-tertiary); font-size: 17px; }
.role-icon {
  width: 56px; height: 56px; border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.role-card.crewmate .role-icon { background: rgba(48,209,88,.15); color: var(--green); }
.role-card.imposter .role-icon { background: rgba(255,69,58,.15); color: var(--red); }
.role-icon svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.role-info .role-name { font-size: 20px; font-weight: 700; margin: 0; }
.role-info .role-desc { color: var(--text-tertiary); font-size: 13px; margin-top: 2px; }
.role-card.crewmate .role-name { color: var(--green); }
.role-card.imposter .role-name { color: var(--red); }

/* ---------- Task list ---------- */
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: .5px solid var(--separator);
  cursor: pointer;
  background: transparent;
  border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left;
  color: var(--text);
  font-size: 17px;
  transition: background .12s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover:not(.done) { background: var(--card-highlight); }
.task-row.done { color: var(--text-tertiary); text-decoration: line-through; cursor: default; }
.task-check { width: 26px; height: 26px; flex-shrink: 0; color: var(--text-tertiary); }
.task-row.done .task-check { color: var(--green); }
.task-check svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ---------- Report button ---------- */
.report-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin: 12px 0;
}
.report-btn {
  width: 120px; height: 120px; border-radius: 60px;
  background: var(--red); color: white;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 36px rgba(255,69,58,.35);
  position: relative;
  transition: transform .12s;
  animation: report-pulse 1.4s ease-out infinite;
}
.report-btn:active { transform: scale(.96); animation: none; }
.report-btn:disabled { background: var(--card-elevated); box-shadow: none; animation: none; cursor: not-allowed; }
.report-btn svg { width: 50px; height: 50px; stroke: white; fill: white; }
.report-btn:disabled svg { fill: var(--text-tertiary); stroke: var(--text-tertiary); }
.report-label { margin-top: 12px; font-size: 12px; color: var(--text-tertiary); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }

@keyframes report-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,69,58,.5), 0 12px 36px rgba(255,69,58,.35); }
  70% { box-shadow: 0 0 0 24px rgba(255,69,58,0), 0 12px 36px rgba(255,69,58,.35); }
  100% { box-shadow: 0 0 0 0 rgba(255,69,58,0), 0 12px 36px rgba(255,69,58,.35); }
}

/* ---------- Meeting ---------- */
.meeting-hero {
  text-align: center;
  padding: 24px 0;
}
.meeting-hero .icon-circle {
  width: 80px; height: 80px; border-radius: 40px;
  background: rgba(255,69,58,.15);
  display: inline-flex; align-items: center; justify-content: center;
  animation: report-pulse 2s ease-out infinite;
}
.meeting-hero .icon-circle svg { width: 44px; height: 44px; stroke: var(--red); fill: var(--red); }
.meeting-hero h1 { font-size: 34px; font-weight: 800; margin: 16px 0 4px; letter-spacing: 1px; }
.meeting-hero p { color: var(--text-tertiary); font-size: 15px; }

.timer-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 28px;
  text-align: center;
}
.timer-card .timer {
  font-size: 72px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.timer-card .timer.urgent { color: var(--red); }

.vote-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-bottom: .5px solid var(--separator);
  width: 100%; text-align: left;
  color: var(--text); font-size: 17px;
  cursor: pointer;
  transition: background .12s;
}
.vote-row:last-child { border-bottom: none; }
.vote-row:hover:not(:disabled) { background: var(--card-highlight); }
.vote-row.voted { background: rgba(255,69,58,.1); }
.vote-row .name { flex: 1; font-weight: 600; }
.vote-row .check { color: var(--red); }
.vote-row .check svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.vote-row:disabled { opacity: .5; cursor: not-allowed; }

.skip-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px;
  background: var(--card);
  border: none; border-radius: var(--r-md);
  color: var(--text-secondary); font-size: 17px; font-weight: 600;
  cursor: pointer; width: 100%;
}
.skip-btn.voted { background: rgba(142,142,147,.2); }
.skip-btn svg { width: 18px; height: 18px; fill: var(--text-secondary); }

/* ---------- Result ---------- */
.result-hero {
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border-radius: var(--r-lg);
}
.result-hero .icon-circle {
  width: 96px; height: 96px; border-radius: 48px;
  display: inline-flex; align-items: center; justify-content: center;
}
.result-hero.crewmates .icon-circle { background: rgba(48,209,88,.15); }
.result-hero.imposters .icon-circle { background: rgba(255,69,58,.15); }
.result-hero.crewmates svg { stroke: var(--green); fill: var(--green); }
.result-hero.imposters svg { stroke: var(--red); fill: var(--red); }
.result-hero .icon-circle svg { width: 56px; height: 56px; }
.result-hero h1 { font-size: 34px; font-weight: 800; margin-top: 8px; }
.result-hero.crewmates h1 { color: var(--green); }
.result-hero.imposters h1 { color: var(--red); }
.result-hero p { color: var(--text-tertiary); margin-top: 8px; font-size: 15px; }

/* ---------- Utilities ---------- */
.muted { color: var(--text-tertiary); }
.center { text-align: center; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 16px; }
.mt-xl { margin-top: 20px; }
.mb-md { margin-bottom: 12px; }
.mb-lg { margin-bottom: 16px; }
.mb-xl { margin-bottom: 20px; }
.mb-xxl { margin-bottom: 28px; }
.hidden { display: none; }
.small { font-size: 13px; }
.footnote { font-size: 13px; color: var(--text-tertiary); padding: 0 16px; margin-top: 8px; }

/* Loading dot */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--card-elevated);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 720px) {
  .content { max-width: 560px; }
}

/* ============================================
   v2 : Avatar picker, presets, sabotage, ghost, ejection, rules carousel
   ============================================ */

/* ---------- Avatar picker (emoji + couleurs) ---------- */
.avatar-preview-wrap {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px 18px;
}
.avatar-preview-wrap .preview-meta { display: flex; flex-direction: column; gap: 2px; }
.avatar-preview-wrap .preview-name { font-size: 17px; font-weight: 700; }
.avatar-preview-wrap .preview-sub { font-size: 12px; color: var(--text-tertiary); letter-spacing: .8px; text-transform: uppercase; }

.avatar.avatar-emoji {
  display: inline-flex; align-items: center; justify-content: center;
  color: white; text-shadow: 0 1px 2px rgba(0,0,0,.25);
}

.avatar-picker { display: flex; flex-direction: column; gap: 14px; }
.avatar-picker .picker-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-tertiary);
  padding: 0 4px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px;
}
.emoji-cell {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--card-elevated);
  border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  transition: transform .1s, border-color .12s;
  padding: 0;
}
.emoji-cell:active { transform: scale(.92); }
.emoji-cell.active { border-color: var(--blue); background: var(--card-highlight); }
@media (max-width: 480px) {
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px;
}
.color-cell {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s;
  padding: 0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.04);
}
.color-cell:active { transform: scale(.9); }
.color-cell.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg) inset, 0 0 0 4px rgba(255,255,255,.15);
}
@media (max-width: 480px) {
  .color-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Task presets (categories collapsibles) ---------- */
.tasks-summary {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px 18px;
}
.tasks-summary .label { padding: 0; margin: 0; }
.tasks-summary .count {
  font-size: 22px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

.task-presets { display: flex; flex-direction: column; gap: 10px; }
.preset-group {
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.preset-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  cursor: pointer; user-select: none;
  background: transparent; border: none; width: 100%;
  color: var(--text); font-size: 17px;
  text-align: left;
}
.preset-header .preset-title { font-weight: 700; flex: 1; }
.preset-header .preset-count {
  font-size: 13px; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.preset-header .preset-chev { color: var(--text-tertiary); transition: transform .2s; }
.preset-group.open .preset-chev { transform: rotate(180deg); }
.preset-list {
  display: none;
  border-top: .5px solid var(--separator);
}
.preset-group.open .preset-list { display: block; }
.preset-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: .5px solid var(--separator);
  cursor: pointer; user-select: none;
}
.preset-item:last-child { border-bottom: none; }
.preset-item .check-box {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--text-tertiary);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.preset-item.checked .check-box {
  background: var(--blue); border-color: var(--blue);
}
.preset-item.checked .check-box::after {
  content: ""; width: 6px; height: 11px;
  border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg); margin-bottom: 3px;
}
.preset-item .preset-label { flex: 1; font-size: 15px; }
.preset-item.checked .preset-label { color: var(--text); }

/* ---------- Custom tasks ---------- */
.custom-add {
  display: flex; gap: 8px;
  background: var(--card);
  border-radius: var(--r-md);
  padding: 6px;
}
.custom-add .input {
  background: transparent;
  padding: 12px;
}
.custom-add button {
  background: var(--blue); color: white;
  border: none; border-radius: var(--r-md);
  width: 44px; height: 44px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.custom-add button:disabled { opacity: .35; cursor: not-allowed; }
.custom-add button svg { width: 18px; height: 18px; stroke: white; }

.custom-list { background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
.custom-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: .5px solid var(--separator);
}
.custom-row:last-child { border-bottom: none; }
.custom-row .text { flex: 1; font-size: 15px; }
.custom-row .del {
  background: transparent; border: none; cursor: pointer;
  color: var(--red);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.custom-row .del svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

/* ---------- Rules carousel ---------- */
.rules-carousel {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 12px;
  margin: 0 -20px;
  padding-left: 20px; padding-right: 20px;
  scrollbar-width: none;
}
.rules-carousel::-webkit-scrollbar { display: none; }
.rule-card {
  flex: 0 0 78%;
  max-width: 280px;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  border-left: 4px solid var(--blue);
}
.rule-card .rule-emoji { font-size: 32px; line-height: 1; }
.rule-card .rule-title {
  font-size: 17px; font-weight: 700;
  letter-spacing: .2px;
}
.rule-card .rule-desc {
  font-size: 13px; color: var(--text-tertiary); line-height: 1.4;
}
.rule-card.color-blue { border-left-color: var(--blue); }
.rule-card.color-blue .rule-title { color: var(--blue); }
.rule-card.color-red { border-left-color: var(--red); }
.rule-card.color-red .rule-title { color: var(--red); }
.rule-card.color-orange { border-left-color: var(--orange); }
.rule-card.color-orange .rule-title { color: var(--orange); }
.rule-card.color-purple { border-left-color: var(--purple); }
.rule-card.color-purple .rule-title { color: var(--purple); }
.rule-card.color-green { border-left-color: var(--green); }
.rule-card.color-green .rule-title { color: var(--green); }
.rule-card.color-yellow { border-left-color: var(--yellow); }
.rule-card.color-yellow .rule-title { color: var(--yellow); }
.carousel-dots {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 4px;
}
.carousel-dots .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--card-elevated);
  transition: background .2s, transform .2s;
}
.carousel-dots .dot.active { background: var(--blue); transform: scale(1.4); }

/* ---------- Ready pill + player row v2 ---------- */
.ready-pill {
  background: var(--green); color: white;
  font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 1px;
}
.player-row .ready-pill { margin-left: auto; }
.player-row .host-badge + .ready-pill { margin-left: 6px; }

.player-row.ghost { opacity: .55; }
.player-row.ghost .name { font-style: italic; }

/* ---------- Role badges ---------- */
.role-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase;
}
.role-badge.crewmate { background: rgba(48,209,88,.18); color: var(--green); }
.role-badge.imposter { background: rgba(255,69,58,.2); color: var(--red); }

/* ---------- Sabotage banner ---------- */
.sabotage-banner {
  background: var(--red);
  color: white;
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  animation: sab-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 10px 30px rgba(255,69,58,.35);
}
.sabotage-banner .sab-emoji { font-size: 38px; line-height: 1; }
.sabotage-banner .sab-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sabotage-banner .sab-label {
  font-size: 16px; font-weight: 800;
  letter-spacing: .3px;
}
.sabotage-banner .sab-instr {
  font-size: 13px; opacity: .9; line-height: 1.3;
}
.sabotage-banner .sab-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.sabotage-banner .sab-timer {
  font-size: 30px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  line-height: 1;
}
.sabotage-banner .sab-btn {
  background: white; color: var(--red);
  font-size: 12px; font-weight: 800;
  padding: 6px 12px; border-radius: 999px;
  border: none; cursor: pointer;
  letter-spacing: .5px;
}
.sabotage-banner .sab-btn:disabled { opacity: .6; cursor: not-allowed; }
.sabotage-banner .sab-btn.validated { background: rgba(255,255,255,.25); color: white; }
.sabotage-banner .sab-note { font-size: 11px; opacity: .85; }

@keyframes sab-pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(255,69,58,.35), 0 0 0 0 rgba(255,69,58,.5); }
  50% { box-shadow: 0 10px 30px rgba(255,69,58,.55), 0 0 0 8px rgba(255,69,58,0); }
}

/* ---------- Sabotage modal ---------- */
.sabotage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sabotage-card {
  background: var(--card-elevated);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-align: left;
  color: var(--text);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .12s, transform .08s;
}
.sabotage-card:active { transform: scale(.98); }
.sabotage-card:hover { border-color: var(--red); }
.sabotage-card .sc-emoji { font-size: 28px; line-height: 1; }
.sabotage-card .sc-label { font-size: 15px; font-weight: 700; }
.sabotage-card .sc-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.3; }

/* ---------- Emergency pill ---------- */
.emergency-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 14px;
  background: rgba(255,159,10,.16);
  color: var(--orange);
  border: none; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
}
.emergency-pill:disabled { opacity: .4; cursor: not-allowed; }
.emergency-pill svg { width: 18px; height: 18px; stroke: var(--orange); fill: none; stroke-width: 2; }

/* ---------- Sabotage button (imposter) ---------- */
.sabotage-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 14px;
  background: rgba(255,69,58,.16);
  color: var(--red);
  border: none; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
}
.sabotage-trigger:disabled { opacity: .4; cursor: not-allowed; }
.sabotage-trigger svg { width: 18px; height: 18px; fill: var(--red); }
.sabotage-trigger .cooldown { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }

/* ---------- Action stack (sabotage + emergency) ---------- */
.action-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

/* ---------- Report modal player row ---------- */
.report-modal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: .5px solid var(--separator);
  background: transparent;
  border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left;
  color: var(--text); font-size: 16px;
  cursor: pointer;
  transition: background .12s;
}
.report-modal-row:last-child { border-bottom: none; }
.report-modal-row:hover { background: var(--card-highlight); }
.report-modal-row .name { flex: 1; font-weight: 600; }
.report-modal-row .triangle {
  width: 32px; height: 32px; border-radius: 16px;
  background: var(--red); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.report-modal-row .triangle svg { width: 18px; height: 18px; fill: white; stroke: white; }

/* ---------- Ghost banner ---------- */
.ghost-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(94,92,230,.15);
  color: var(--purple);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 13px; font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 16px;
}
.ghost-banner svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ---------- Modal generic ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .15s ease-out;
}
.modal-backdrop.center { align-items: center; }
.modal-sheet {
  background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px;
  width: 100%; max-width: 640px;
  max-height: 85vh; overflow-y: auto;
  animation: slideUp .22s ease-out;
}
.modal-backdrop.center .modal-sheet {
  border-radius: var(--r-xl);
  max-width: 420px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h3 { font-size: 19px; font-weight: 800; }
.modal-close {
  background: var(--card-elevated); border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 16px;
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Ejection overlay ---------- */
.ejection-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  padding: 40px 20px;
  animation: fadeIn .25s ease-out;
  color: white;
}
.ejection-overlay .ej-avatar {
  width: 130px; height: 130px;
  display: flex; align-items: center; justify-content: center;
  font-size: 76px;
  border-radius: 65px;
  color: white;
  animation: ej-pop .45s ease-out;
}
.ejection-overlay .ej-name {
  font-size: 28px; font-weight: 800; text-align: center;
}
.ejection-overlay .ej-text {
  font-size: 17px; color: var(--text-tertiary); text-align: center; max-width: 320px;
}
.ejection-overlay .ej-role-badge {
  font-size: 13px; font-weight: 800; letter-spacing: 2px;
  padding: 8px 16px; border-radius: 999px;
  text-transform: uppercase;
}
.ejection-overlay .ej-role-badge.imposter { background: var(--red); color: white; }
.ejection-overlay .ej-role-badge.crewmate { background: var(--green); color: white; }
@keyframes ej-pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; top: 70px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 900;
  pointer-events: none;
}
.toast {
  background: var(--card-elevated);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  animation: toastIn .25s ease-out;
  max-width: 90%;
  text-align: center;
}
.toast.toast-danger { background: var(--red); color: white; }
.toast.toast-warning { background: var(--orange); color: white; }
.toast.toast-success { background: var(--green); color: white; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

