:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #fafaf8;
  --surface: #ffffff;
  --fill: #f4f4f5;
  --fill-2: #f3f4f6;

  /* Lines */
  --border: #e5e5e5;
  --border-2: #e4e4e7;

  /* Text */
  --text: #0a0a0a;
  --muted: #6b7280;
  --dim: #9ca3af;
  --faint: #bbbbbb;

  /* Accents */
  --primary: #5e6ad2;
  --primary-hover: #515dc7;
  --primary-bg: #eef0fb;
  --primary-light: #e0e7ff;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --green: #22c55e;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);

  /* Radii */
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Buttons ---------- */
button {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    transform 80ms ease;
}

button:hover {
  background: var(--fill);
}

button:active {
  transform: scale(0.985);
}

.primary {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.primary:hover {
  background: var(--primary-hover);
}

.dark-btn {
  border-color: transparent;
  background: var(--text);
  color: #fff;
  font-weight: 600;
}

.dark-btn:hover {
  background: #1f1f1f;
}

/* reveal / hide toggle */
.toggle {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.toggle:hover {
  background: var(--primary-bg);
}

.toggle.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.toggle.on:hover {
  background: var(--primary-hover);
}

button.icon {
  padding: 0.4rem 0.55rem;
  color: var(--muted);
  line-height: 1;
}

button.icon:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

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

/* ---------- Inputs ---------- */
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.62rem 0.75rem;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
}

input::placeholder {
  color: var(--dim);
  font-weight: 400;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

/* ---------- Shared bits ---------- */
.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.pill .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--primary);
}

.pill .dot.live {
  background: var(--green);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--green);
  flex: 0 0 auto;
}

.status-dot.pulse {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ---------- Avatars ---------- */
.avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  background: var(--avatar-color, var(--primary));
  flex: 0 0 auto;
}

.avatar.sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.7rem;
}

.avatar.md {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.8rem;
}

.avatar.lg {
  width: 5rem;
  height: 5rem;
  font-size: 1.6rem;
}

/* ================================================================
   TOP NAV (host)
   ================================================================ */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.appbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.appbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.appbar-brand h1 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.appbar-brand .substatus {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
}

.segmented {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--r-md);
  padding: 0.4rem 0.7rem;
  font-weight: 500;
}

.segmented button:hover {
  background: var(--fill);
}

.segmented button.active {
  background: var(--fill);
  color: var(--text);
}

.appbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ================================================================
   EVENT TITLE SLIDE  (host landing)
   ================================================================ */
.title-slide {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.title-slide .topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.title-slide .topline .brand-mark {
  font-weight: 700;
}

.title-hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 4rem;
  padding: 4rem 5vw;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.title-hero h2 {
  margin: 0.6rem 0 0;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.title-hero .lede {
  margin: 1.4rem 0 0;
  max-width: 26rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 450;
}

.title-hero .moods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.8rem 0 0;
}

.mood-chip {
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.title-hero .cta-row {
  margin-top: 2.2rem;
}

.title-hero .cta-row .primary {
  font-size: 0.95rem;
  padding: 0.7rem 1.3rem;
}

.invite-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  text-align: center;
}

.invite-card .qr {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: var(--r-lg);
  background: var(--fill);
  padding: 1rem;
}

.invite-card .qr img,
.qr-img {
  width: 100%;
  height: 100%;
  display: block;
}

.invite-card h3 {
  margin: 1.4rem 0 0.3rem;
  font-size: 1rem;
  font-weight: 600;
}

.invite-card .join-url {
  margin: 0;
  font-size: 0.85rem;
  color: var(--dim);
  word-break: break-all;
}

/* ================================================================
   HOST DASHBOARD
   ================================================================ */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: start;
}

.title-edit {
  margin-bottom: 1.6rem;
}

.title-edit .eyebrow {
  display: block;
  margin-bottom: 0.35rem;
}

.session-title-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  margin-left: -0.55rem;
  padding: 0.3rem 0.55rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  border-radius: var(--r-md);
}

.session-title-input::placeholder {
  color: var(--dim);
  font-weight: 800;
}

.session-title-input:hover {
  background: var(--fill);
}

.session-title-input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ---------- Session history ---------- */
.history-head {
  margin-bottom: 1.5rem;
}

.history-title {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.history-table {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem 5rem 5rem;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 0.95rem 1.25rem;
  font-size: 0.9rem;
}

.history-row:last-child {
  border-bottom: none;
}

.history-row.head {
  background: var(--bg);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: default;
}

button.history-row:hover {
  background: var(--fill);
}

.history-row .hs-name {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.history-row .hs-code {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.history-empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 4rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  text-align: center;
}

.section-head .title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--fill);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

/* prompt editor cards */
.prompt-list {
  display: grid;
  gap: 0.75rem;
}

.prompt-card {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.prompt-card .stance {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
}

.prompt-card .stance + .stance {
  border-left: 1px solid var(--border);
}

.prompt-card .stance label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.prompt-card .stance input {
  border: none;
  padding: 0;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
}

.prompt-card .stance input:focus {
  box-shadow: none;
  outline: none;
}

.prompt-card .question-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}

.prompt-card .question-field label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.prompt-card .question-field input {
  border: none;
  padding: 0;
  background: transparent;
  font-weight: 600;
}

.prompt-card .question-field input:focus {
  box-shadow: none;
}

.prompt-card .card-actions {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}

.prompt-card .card-actions .secs {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

.prompt-card .card-actions .secs input {
  width: 2.6rem;
  border: none;
  padding: 0;
  background: transparent;
  font-weight: 600;
  color: var(--text);
}

.prompt-card .card-actions .secs input:focus {
  box-shadow: none;
}

.prompt-card .card-actions button {
  flex: 1;
  border: none;
  border-radius: 0;
}

.row-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* side cards */
.side-col {
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem;
}

.card > .card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card > .card-title .count-badge {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
}

.launch-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: var(--r-lg);
  border: none;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.launch-btn:hover {
  background: var(--primary-hover);
}

.launch-btn .play {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
}

.launch-btn .label {
  display: grid;
  gap: 0.1rem;
}

.launch-btn .label strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.launch-btn .label span {
  font-size: 0.75rem;
  opacity: 0.85;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-md);
  background: var(--fill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.lobby-list {
  display: grid;
  gap: 0.15rem;
}

.lobby-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.25rem;
}

.lobby-row .who {
  display: grid;
  gap: 0.05rem;
}

.lobby-row .who .name {
  font-size: 0.875rem;
  font-weight: 600;
}

.lobby-row .who .sub {
  font-size: 0.7rem;
  color: var(--muted);
}

.lobby-row .remove {
  margin-left: auto;
  border: none;
  background: transparent;
  padding: 0.3rem;
  opacity: 0;
  transition: opacity 120ms ease;
}

.lobby-row:hover .remove {
  opacity: 1;
}

.invite-mini {
  text-align: center;
}

.invite-mini .room-code {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text);
}

.invite-mini .qr {
  width: 150px;
  height: 150px;
  margin: 0.8rem auto 0;
  border-radius: var(--r-lg);
  background: var(--fill);
  padding: 0.7rem;
}

.invite-mini .join-url {
  margin: 0.7rem 0 0;
  font-size: 0.75rem;
  color: var(--dim);
  word-break: break-all;
}

/* ================================================================
   MAIN STAGE  /  reveal
   ================================================================ */
.stage {
  position: relative;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 2rem 5vw 3rem;
}

.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stage-top .right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--fill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: capitalize;
}

.phase-pill .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--primary);
}

/* circular timer */
.timer-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.timer-ring.lg {
  width: 88px;
  height: 88px;
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring .track {
  stroke: var(--border-2);
}

.timer-ring .prog {
  stroke: var(--primary);
  transition: stroke-dashoffset 1s linear;
  stroke-linecap: round;
}

.timer-ring.low .prog {
  stroke: var(--danger);
}

.timer-ring .num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.timer-ring.lg .num {
  font-size: 1.4rem;
}

.stage-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.prompt-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.pdots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pdot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--border-2);
  transition:
    width 200ms ease,
    background 200ms ease;
}

.pdot.done {
  background: var(--dim);
}

.pdot.on {
  width: 1.5rem;
  background: var(--primary);
}

.prompt-progress .muted {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-center h2 {
  margin: 0.3rem 0 0;
  max-width: 16ch;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

/* spectrum */
.spectrum {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.spectrum .stance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.spectrum-chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--fill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Stance labels on the live screen — slightly larger than the default chip. */
.stage-spectrum .spectrum-chip {
  font-size: 1.15rem;
  padding: 0.5rem 1rem;
}

.spectrum-track {
  position: relative;
  height: 1px;
  background: var(--border-2);
}

.spectrum-track .fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--text);
}

.spectrum-track .tick {
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: var(--faint);
  transform: translateX(-50%);
}

.spectrum-track .avg {
  position: absolute;
  top: -7px;
  width: 2px;
  height: 15px;
  background: var(--primary);
  transform: translateX(-50%);
}

.spectrum .ends {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.spectrum .ends .mid {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* main stage opening title slide (lobby) */
.stage-title-wrap {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

.stage-title-wrap .title-hero {
  padding-top: 2rem;
  padding-bottom: 1rem;
}

/* avatar tray during voting (positions hidden until reveal) */
.pin-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  min-height: 3rem;
}

.pin-tray .avatar {
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

.tray-chip.ghost {
  opacity: 0.35;
}

/* avatar pins on stage spectrum */
.pin-lane {
  position: relative;
  height: 3rem;
  margin-top: 1rem;
}

.avatar-pin {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  transition: left 220ms ease;
}

.avatar-pin .avatar {
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

.avatar-pin.ghost {
  opacity: 0.4;
}

/* stage controls */
.stage-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.stage-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.stage-summary strong {
  color: var(--text);
}

/* ================================================================
   PLAYER SCREENS
   ================================================================ */
.player-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.player-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  text-align: center;
}

/* join card */
.join-card {
  width: 100%;
  max-width: 24rem;
  display: grid;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  text-align: left;
}

.join-emblem {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  border: 3px solid var(--primary-light);
}

.player-body h1 {
  margin: 1.1rem 0 0.2rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.player-body .sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.join-card label {
  font-size: 0.8rem;
  font-weight: 600;
  display: grid;
  gap: 0.4rem;
}

.join-card .char-count {
  text-align: right;
  font-size: 0.72rem;
  color: var(--dim);
  font-weight: 600;
}

.join-card .primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem;
}

.powered {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--dim);
}

/* player title / waiting */
.you-joined {
  margin-top: 1.2rem;
}

.you-joined .eyebrow {
  display: block;
  margin-bottom: 0.2rem;
}

.you-joined .name {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.session-card {
  margin: 1.6rem auto 0;
  max-width: 24rem;
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: var(--r-xl);
  background: var(--fill);
  border: 1px solid var(--border);
}

.session-card .k {
  font-size: 0.75rem;
  color: var(--muted);
}

.session-card .v {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.joined-pill {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}

.joined-pill strong {
  font-weight: 700;
}

.waiting-dots {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 1.1rem;
}

.waiting-dots span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--faint);
  animation: blink 1.4s ease-in-out infinite;
}

.waiting-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.waiting-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.waiting-copy {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* player voting / results — left-aligned card layout */
.player-vote {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.vote-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.vote-top .who .eyebrow {
  display: block;
  margin-bottom: 0.15rem;
}

.vote-top .who .name {
  font-size: 1rem;
  font-weight: 700;
}

.player-vote h1 {
  margin: 1.6rem 0 0.3rem;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.player-vote .hint {
  margin: 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* range slider styled as spectrum */
.range-wrap {
  position: relative;
  padding: 1.5rem 0 0.5rem;
}

input[type="range"].spectrum-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1px;
  background: var(--border-2);
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
}

input[type="range"].spectrum-range:focus {
  outline: none;
  box-shadow: none;
}

input[type="range"].spectrum-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
  cursor: grab;
}

input[type="range"].spectrum-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
  cursor: grab;
}

input[type="range"].spectrum-range:disabled {
  opacity: 1;
}

input[type="range"].spectrum-range:disabled::-webkit-slider-thumb {
  background: var(--dim);
  cursor: default;
}

.readout {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.lock-row {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.lock-row .dark-btn {
  min-width: 16rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r-lg);
  background: var(--fill);
}

.submitted-tag {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green);
}

.submit-row button {
  flex: 0 0 auto;
}

.locked-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r-lg);
  background: var(--fill);
  font-size: 0.9rem;
  font-weight: 600;
}

.locked-banner .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--primary);
}

/* ---------- QR modal (host main stage) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 10, 0.4);
  padding: 1.5rem;
}

.modal {
  width: 100%;
  max-width: 22rem;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  text-align: center;
}

.modal .room-code {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.modal .qr {
  width: 200px;
  height: 200px;
  margin: 1rem auto;
  border-radius: var(--r-lg);
  background: var(--fill);
  padding: 1rem;
}

.modal .join-url {
  font-size: 0.8rem;
  color: var(--dim);
  word-break: break-all;
}

.modal .close-row {
  margin-top: 1.2rem;
}

/* reconnect / connecting states */
.center-note {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: 2rem;
}

.center-note h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .title-hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 3rem 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .appbar {
    padding: 0.7rem 1rem;
  }

  .segmented span {
    display: none;
  }
}
