/* ارمعها — هوية بنفسجية صفراء، بتخطيط نظيف مستوحى من وضوح Apple */
:root {
  --bg: #F6F1FF;
  --surface: #FFFFFF;
  --surface-2: #EFE6FF;
  --text: #2A1155;
  --muted: #6B4E8C;
  --line: rgba(42, 17, 85, 0.12);
  --line-strong: rgba(42, 17, 85, 0.2);
  --accent: #FFD21F;
  --accent-hover: #FFE25A;
  --accent-soft: rgba(255, 210, 31, 0.28);
  --accent-ink: #2A1155;
  --pink: #FF2E7E;
  --pink-hover: #FF4D94;
  --yellow: #FFD21F;
  --purple: #6A2BD9;
  --ink: #2A1155;
  --grad: linear-gradient(90deg, #6A2BD9 0%, #FF2E7E 100%);
  --grad-hero: linear-gradient(120deg, #6A2BD9 0%, #C5269A 48%, #FF2E7E 100%);
  --danger: #D9366F;
  --ok: #1F8A4C;
  --shadow: 0 8px 24px rgba(42, 17, 85, 0.1);
  --shadow-lg: 0 18px 40px rgba(42, 17, 85, 0.16);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 980px;
  --font: "Tajawal", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "Baloo Bhaijaan 2", "Lalezar", "Tajawal", sans-serif;
  --word-shadow: 3px 3px 0 var(--pink);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-theme="light"] {
  --bg: #F6F1FF;
  --surface: #FFFFFF;
  --surface-2: #EFE6FF;
}


[data-theme="dark"] {
  --bg: #EDE4FF;
  --surface: #FFFFFF;
  --surface-2: #E3D6FF;
  --text: #2A1155;
  --muted: #5A3E7A;
  --line: rgba(42, 17, 85, 0.14);
  --line-strong: rgba(42, 17, 85, 0.22);
  --accent: #FFD21F;
  --accent-hover: #FFE25A;
  --accent-soft: rgba(255, 210, 31, 0.16);
  --accent-ink: #1E0B3F;
  --pink: #FF2E7E;
  --danger: #FF5C8A;
  --ok: #5CE08A;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { direction: rtl; }
html, body {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  overflow: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button, a, .pill, .cat-card, .cell, .buzzer {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { cursor: pointer; }
img, video { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }

#app {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

/* ---------- Layout ---------- */
.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}
.topbar-wrap { position: relative; flex-shrink: 0; z-index: 40; }
.topbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  height: 48px;
  max-height: 48px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(48px + env(safe-area-inset-top, 0px));
  max-height: calc(48px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  z-index: 45;
  overflow: hidden;
}
.topbar-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-inline-start: auto; }
.topbar-credit {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: #3A1C6E;
  border: 1px solid rgba(255,210,31,0.35);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  line-height: 1.2;
  max-width: 42vw;
  overflow: hidden;
  white-space: nowrap;
}
.topbar-credit span { color: rgba(255,255,255,0.85); }
.topbar-credit strong { color: var(--yellow, #FFD21F); font-weight: 800; }
.topbar-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--yellow, #FFD21F);
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-account:hover { background: color-mix(in srgb, var(--yellow) 16%, transparent); }
.topbar-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 9px 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 46;
}
.topbar-burger span {
  display: block;
  height: 2px;
  background: var(--text, #fff);
  margin: 3px 0;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.host-menu-open .topbar-burger span:nth-child(1),
.topbar-wrap.is-open .topbar-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.host-menu-open .topbar-burger span:nth-child(2),
.topbar-wrap.is-open .topbar-burger span:nth-child(2) { opacity: 0; }
.host-menu-open .topbar-burger span:nth-child(3),
.topbar-wrap.is-open .topbar-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.topbar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 4, 24, 0.45);
  z-index: 42;
}
.host-menu-open .topbar-backdrop,
.topbar-wrap.is-open .topbar-backdrop { display: block; }
.topbar-sheet {
  display: none;
  position: fixed;
  top: calc(48px + env(safe-area-inset-top, 0px));
  left: 0;
  width: min(86vw, 340px);
  max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: auto;
  background: #2A1155;
  color: #fff;
  padding: 10px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 12px 0 40px rgba(0,0,0,0.35);
  z-index: 44;
  flex-direction: column;
  gap: 2px;
}
.host-menu-open .topbar-sheet,
.topbar-wrap.is-open .topbar-sheet { display: flex; }
.topbar-sheet-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: right;
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
}
.topbar-sheet-link:hover { background: rgba(255,255,255,0.08); color: var(--yellow, #FFD21F); }
.topbar-sheet-link strong { color: var(--yellow, #FFD21F); }
.topbar-sheet-link.danger { color: #FFB4C8; }
.top-actions { display: none; }

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: inherit; }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: block;
  background: transparent;
  box-shadow: none;
}
.brand h1, .wordmark, .play-brand h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: var(--yellow);
  text-shadow: var(--word-shadow);
}
.brand-mark {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.brand p { display: none; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.room-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 14px 4px 4px;
  box-shadow: var(--shadow);
}
.room-chip .code {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--text);
}
.room-chip .lbl { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.room-chip img {
  width: 40px; height: 40px; border-radius: 10px; background: #fff;
}
.top-actions { display: flex; gap: 8px; align-items: center; }

.main {
  flex: 1;
  overflow: auto;
  padding: 32px 40px 48px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  min-height: 0;
  padding-bottom: max(48px, calc(28px + env(safe-area-inset-bottom)));
}
.main.tight {
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 20px 28px 24px;
  min-height: 0;
}
.main > .view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.main > .view.view-enter {
  animation: viewIn 280ms var(--ease) both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ---------- Buttons ---------- */
.btn {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--surface); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-gold, .btn-teal, .btn-primary {
  background: var(--pink);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 0 #C4165A;
}
.btn-gold:hover, .btn-teal:hover, .btn-primary:hover {
  background: var(--yellow);
  color: var(--accent-ink);
  box-shadow: 0 4px 0 var(--pink);
}
.btn-rose { background: transparent; color: var(--danger); border-color: var(--line); }
.btn-rose:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 5px 12px; font-size: 0.85rem; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  padding: 0; border-radius: 50%;
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.input, select, textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { min-height: 80px; resize: vertical; }

/* ---------- Scoreboard ---------- */
.scoreboard {
  display: grid;
  gap: 12px;
  padding: 0 0 16px;
  flex-shrink: 0;
}
.scoreboard.cols-2 { grid-template-columns: repeat(2, 1fr); }
.scoreboard.cols-3 { grid-template-columns: repeat(3, 1fr); }
.scoreboard.cols-4 { grid-template-columns: repeat(4, 1fr); }
.scoreboard.cols-5,
.scoreboard.cols-6,
.scoreboard.cols-7,
.scoreboard.cols-8 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.team-card {
  position: relative;
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.team-card.turn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}
.team-card .accent {
  display: none;
}
.team-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.team-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 6px;
}
.team-score {
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.score-btns { display: flex; gap: 6px; }
.score-btns .btn {
  width: 32px; height: 32px; padding: 0;
  font-size: 1.1rem; font-weight: 500; border-radius: 50%;
}
.lifelines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.life {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.life:hover { background: var(--accent-soft); }
.life.used { opacity: 0.35; text-decoration: line-through; }
.life.frozen { opacity: 0.4; border-style: dashed; }
.life.active-pending { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.turn-badge {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

/* ---------- Setup ---------- */
.setup-wrap { max-width: 1080px; margin: 0 auto; padding: 12px 0 24px; }
.hero { text-align: center; padding: 12px 0 24px; }
.hero h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
  color: var(--yellow);
  text-shadow: 4px 4px 0 var(--pink);
  display: inline-block;
  position: relative;
}
.hero h2::after, .pricing-hero h1::after, .auth-card h1::after, .admin-page h1::after {
  content: "";
  display: block;
  width: min(180px, 70%);
  height: 12px;
  margin: 8px auto 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 14' fill='none'><path d='M2 9 C 40 1, 80 13, 120 6 S 170 11, 178 7' stroke='white' stroke-width='5' stroke-linecap='round'/></svg>") center / contain no-repeat;
}
.hero h2 em { font-style: normal; color: var(--yellow); }
.hero p {
  color: var(--muted);
  font-size: 1.2rem;
  margin-top: 10px;
  font-weight: 400;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 24px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.panel h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.row .field { flex: 1; min-width: 180px; }

.mode-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.pill.on {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: 10px;
  align-items: stretch;
}
.cat-card {
  text-align: right;
  border-radius: 16px;
  padding: 0;
  background: #2A1155;
  border: 2px solid transparent;
  color: #fff;
  min-height: 0;
  height: auto;
  overflow: hidden;
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.cat-card .cat-cover { aspect-ratio: 4 / 3; min-height: 96px; }
.cat-card:hover { transform: translateY(-2px); border-color: rgba(255,210,31,0.5); }
.cat-card .tag { font-size: 0.72rem; color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }
.cat-card .name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 2px;
  letter-spacing: -0.02em;
  line-height: 1.4;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cat-card .remain, .cat-card .cat-note {
  margin: 0;
  padding: 6px 10px 8px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  background: #24104a;
}
.cat-card.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cat-card.exhausted {
  opacity: 0.78;
  cursor: default;
}
.cat-card.exhausted .cat-note { color: var(--danger); }
.cat-card .cat-gen {
  margin-top: 8px;
  align-self: start;
}

.cat-card.seasonal .tag,
.cat-card.special .tag,
.cat-card.custom .tag { color: var(--muted); }

.hint { color: var(--muted); font-size: 0.92rem; }
.warn { color: var(--danger); }

/* ---------- Board ---------- */
.board-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.board {
  flex: 1;
  display: grid;
  gap: 10px;
  min-height: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-content: stretch;
}
.col { display: grid; grid-template-rows: auto repeat(6, minmax(48px, 1fr)); gap: 8px; min-height: 0; min-width: 0; }
.cat-head {
  text-align: center;
  font-weight: 600;
  font-size: clamp(0.82rem, 1.3vw, 1.2rem);
  padding: 10px 8px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  height: auto;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  border: 1px solid var(--line);
  letter-spacing: -0.02em;
}
.cell {
  border: 1px solid var(--line);
  border-radius: 16px;
  font-weight: 600;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  color: var(--text);
  letter-spacing: -0.03em;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.cell.v200, .cell.v400, .cell.v600 { background: var(--surface); color: var(--text); }
.cell:not(.used):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.cell.used {
  background: transparent;
  color: var(--muted);
  opacity: 0.35;
  box-shadow: none;
  cursor: default;
  border-color: transparent;
  font-size: 1.1rem;
  font-weight: 400;
}

/* ---------- Question ---------- */
.qview {
  flex: 1;
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 16px;
  min-height: 0;
}
.qview.no-media { grid-template-columns: 1fr 0.7fr; max-width: 1100px; margin: 0 auto; width: 100%; }
.qcard, .side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
}
.q-text {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.03em;
  margin: 28px 0 auto;
}
.answer-box {
  margin-top: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  animation: viewIn 280ms var(--ease) both;
}
.answer-box .lbl { color: var(--muted); font-weight: 500; margin-bottom: 4px; font-size: 0.85rem; }
.answer-box .ans { font-size: 1.8rem; font-weight: 600; letter-spacing: -0.03em; }

.media-stage {
  flex: 1;
  min-height: 240px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
  position: relative;
}
.media-stage img, .media-stage video { width: 100%; height: 100%; object-fit: contain; }
.zoom-stage { width: 100%; height: 100%; overflow: hidden; position: relative; }
.zoom-stage img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(4.2); will-change: transform;
}

.timer-wrap { text-align: center; margin-bottom: 8px; }
.timer {
  font-size: 4.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}
.timer.low { color: var(--danger); }
.timer-label { color: var(--muted); font-weight: 500; font-size: 0.9rem; margin-top: 4px; }

.buzz-banner {
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin: 12px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  min-height: 92px;
  display: grid;
  place-items: center;
}
.buzz-banner.hit {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.buzz-banner .who { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.03em; }
.buzz-banner .ms { color: var(--muted); font-weight: 500; font-size: 0.9rem; margin-top: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- End / final ---------- */
.center-col { max-width: 880px; margin: 0 auto; text-align: center; padding-top: 24px; }
.winner-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 8px 0 6px;
}
.winner-name { color: var(--text); }
.end-scores { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.end-score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 22px;
  min-width: 170px;
  box-shadow: var(--shadow);
}
.end-score-card .n { font-weight: 500; color: var(--muted); font-size: 0.9rem; }
.end-score-card .s { font-size: 2.4rem; font-weight: 600; letter-spacing: -0.04em; }
.result-card-wrap { margin: 18px auto; max-width: 400px; }
.result-card-wrap img { width: 100%; border-radius: 20px; box-shadow: var(--shadow-lg); }

/* ---------- Editor ---------- */
.editor-q {
  display: grid;
  grid-template-columns: 72px 1fr 1fr auto;
  gap: 8px;
  align-items: start;
  margin-bottom: 10px;
  background: var(--bg);
  padding: 12px;
  border-radius: 14px;
}
.modal-back {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: grid; place-items: center;
  z-index: 50; padding: 20px;
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, 0.55); }
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  width: min(520px, 100%);
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 8px; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.03em; }
.modal p { color: var(--muted); margin-bottom: 16px; }

/* ---------- Hall of fame ---------- */
.fame-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.fame-table th, .fame-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.fame-table th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }

/* ---------- Phone ---------- */
.play-body { background: var(--bg); overflow: auto; }
.play-wrap {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding: 28px 20px max(40px, calc(20px + env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
}
.play-brand { text-align: center; margin-bottom: 28px; }
.play-brand .brand-mark { width: 40px; height: 40px; border-radius: 0; margin: 0 auto 10px; display: block; background: transparent; }
.play-brand h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; }
.play-brand h1 span { color: inherit; }
.play-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.team-choice { display: grid; gap: 8px; }
.team-choice .btn { width: 100%; text-align: center; font-size: 1.05rem; padding: 14px; border-radius: 16px; }
.team-choice .btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.buzzer-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 0 24px;
}
.buzzer {
  width: min(64vw, 260px);
  height: min(64vw, 260px);
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 30px rgba(0, 113, 227, 0.28);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.15s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.25s var(--ease);
}
.buzzer:active { transform: scale(0.97); }
.buzzer.ready { box-shadow: 0 10px 30px rgba(0, 113, 227, 0.28); }
.buzzer.won {
  background: var(--ok);
  box-shadow: 0 10px 30px rgba(36, 138, 61, 0.25);
}
.buzzer.dead {
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line);
}
.status-pill {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.you-bar {
  width: 100%;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 500;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 12px;
  z-index: 80;
  font-weight: 500;
  font-size: 0.92rem;
  box-shadow: var(--shadow-lg);
}

.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

@media (max-width: 1100px) and (max-aspect-ratio: 1/1) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-aspect-ratio: 1/1) {
  .board { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 900px) and (orientation: portrait) {
  .qview, .qview.no-media { grid-template-columns: 1fr; }
  .team-score { font-size: 2.1rem; }
  .timer { font-size: 3.2rem; }
  .editor-q { grid-template-columns: 1fr; }
  body { overflow: hidden; }
  .main { padding: 20px 16px 40px; }
  /* top-actions folded into the host menu */
}
@media (max-width: 700px) {
  .topbar { flex-wrap: nowrap; padding: 0 12px; padding-top: env(safe-area-inset-top, 0px); }
  .cat-head { font-size: 0.88rem; min-height: 56px; padding: 8px 6px; }
  .cell { font-size: clamp(1.15rem, 6vw, 1.8rem); border-radius: 12px; }
}
@media (max-width: 520px) and (max-aspect-ratio: 1/1) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .col { gap: 6px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row .field { min-width: 140px; }
}

.main.has-setup-footer {
  padding-bottom: max(24px, calc(16px + env(safe-area-inset-bottom, 0px)));
}
.setup-footer {
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background: var(--bg);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.setup-footer .hint { margin-top: 8px; }

/* Auth */
.auth-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  max-width: 440px;
  margin: 0 auto;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  text-decoration: none;
}
.auth-brand img { border-radius: 9px; }
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-card h1, .pricing-hero h1, .admin-page h1 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
  color: var(--yellow);
  text-shadow: var(--word-shadow);
  display: inline-block;
}
.pricing-hero, .admin-page > header { text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth-form .btn { width: 100%; }
.auth-switch { margin-top: 20px; text-align: center; color: var(--muted); font-size: 0.95rem; }
.account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .main > .view.view-enter, .answer-box { animation: none; }
}

/* Pricing + admin */
.ok-msg { color: var(--ok); margin-bottom: 14px; font-weight: 500; }
.pricing-page, .admin-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px calc(40px + env(safe-area-inset-bottom, 0px));
}
.pricing-hero { text-align: center; margin-bottom: 28px; }
.pricing-hero h1, .admin-page h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 8px; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 900px) {
  .plan-grid { grid-template-columns: 1fr; }
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-card.plan-featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-lg); }
.plan-price { font-size: 2.1rem; font-weight: 600; letter-spacing: -0.04em; }
.plan-kwd { color: var(--muted); font-size: 0.95rem; }
.plan-points { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; color: var(--text); }
.plan-points li { padding-right: 2px; }
.plan-card .btn { margin-top: auto; width: 100%; }
.discount-row { margin: 28px auto 0; max-width: 420px; }
.discount-row .row { margin-top: 8px; }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.admin-card h2 { font-size: 1.2rem; margin-bottom: 16px; }
.rev-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rev-tile { background: var(--surface-2); border-radius: 16px; padding: 14px; }
.rev-tile strong { display: block; font-size: 1.25rem; margin-top: 4px; }
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th, .admin-table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grant-form { display: flex; gap: 6px; align-items: center; }
.grant-form .input { width: 72px; }
.disc-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.disc-form .field { flex: 1 1 160px; }
@media (max-width: 720px) {
  .plan-grid, .rev-grid { grid-template-columns: 1fr; }
  .pricing-hero h1, .admin-page h1 { font-size: 1.7rem; }
}


/* Brand decorations and buzzer */
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 28%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g fill='none' stroke='white' stroke-width='3' stroke-linecap='round' opacity='0.16'><path d='M24 28 l7 -16'/><path d='M36 22 l4 -11'/><path d='M132 118 l7 -16'/><path d='M144 112 l4 -11'/></g></svg>");
  background-repeat: no-repeat, repeat;
  background-size: auto, 180px 180px;
}
.auth-brand {
  color: var(--yellow);
  text-shadow: var(--word-shadow);
  font-family: var(--font-display);
  flex-direction: column;
  gap: 8px;
  font-size: 1.6rem;
}
.auth-brand img.brand-lockup {
  width: 168px;
  height: auto;
  border-radius: 0;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.25));
}
.auth-brand.auth-brand-lockup span { display: none; }
.auth-brand img { border-radius: 12px; }
.pill.on {
  background: var(--yellow);
  color: var(--accent-ink);
  border-color: transparent;
}
.cat-card.on {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow);
  background: color-mix(in srgb, var(--yellow) 12%, var(--surface-2));
}
.cell:not(.used):hover {
  background: var(--yellow);
  color: var(--accent-ink);
}
.plan-price { color: var(--yellow); text-shadow: 2px 2px 0 var(--pink); font-family: var(--font-display); }
.plan-card.plan-featured { border-color: var(--yellow); }
.setup-footer { background: var(--bg); }

.buzzer-area { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 12px 0 8px; }
.buzzer {
  position: relative;
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 700;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.buzzer-spark {
  position: absolute;
  top: 6%;
  width: 8px;
  height: 28px;
  background: #fff;
  border-radius: 8px;
  z-index: 3;
  pointer-events: none;
}
.buzzer-spark.s1 { right: 68%; transform: rotate(-34deg); height: 32px; }
.buzzer-spark.s2 { right: 58%; top: 2%; transform: rotate(-18deg); height: 24px; width: 7px; }
.buzzer-shell {
  position: absolute;
  inset: 12% 10% 8% 10%;
  z-index: 1;
}
.buzzer-base {
  position: absolute;
  left: 4%;
  right: 0;
  top: 28%;
  bottom: 6%;
  background: var(--pink);
  border-radius: 50%;
}
.buzzer-top {
  position: absolute;
  left: 0;
  right: 6%;
  top: 8%;
  bottom: 22%;
  background: var(--yellow);
  border-radius: 50%;
  box-shadow: inset 0 -10px 0 rgba(42, 17, 85, 0.08);
  transition: transform 0.12s var(--ease);
}
.buzzer-label { position: relative; z-index: 2; transform: translateY(-6%); }
.buzzer:active .buzzer-top,
.buzzer.is-press .buzzer-top {
  transform: translate(6px, 10px);
}
.buzzer:active .buzzer-label,
.buzzer.is-press .buzzer-label { transform: translate(4px, 6%); }
.buzzer.ready .buzzer-top { filter: saturate(1.05); }
.buzzer.won .buzzer-top { background: #fff; }
.buzzer.won .buzzer-base { background: var(--yellow); }
.buzzer.dead { filter: grayscale(0.35) brightness(0.72); }
.buzzer.dead .buzzer-spark { opacity: 0.25; }

.q-text { font-family: var(--font-display); }
input.input, textarea.input, select.input, .input {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--yellow);
  border-color: var(--yellow);
}
.room-chip img { background: #fff; }


/* TV / cast: fill any screen, hide chrome, enlarge type */
html.tv-mode .tv-hide,
html.tv-mode .top-actions a[href="/pricing.html"],
html.tv-mode .top-actions a[href="/account.html"],
html.tv-mode .top-actions a[href="/login.html"],
html.tv-mode [data-act="fame"] {
  display: none !important;
}
html.tv-mode .topbar {
  padding: 8px clamp(12px, 2vw, 28px);
  padding-top: max(8px, env(safe-area-inset-top));
}
html.tv-mode .brand h1 { font-size: clamp(1.3rem, 2.4vmin, 2rem); }
html.tv-mode .main.tight {
  overflow: hidden;
  padding: clamp(8px, 1.6vh, 20px) clamp(12px, 2vw, 32px);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
html.tv-mode .scoreboard { padding-bottom: clamp(8px, 1.2vh, 16px); gap: clamp(8px, 1vw, 16px); }
html.tv-mode .team-score { font-size: clamp(1.6rem, 4.2vmin, 3.4rem); }
html.tv-mode .board-wrap { overflow: hidden; }
html.tv-mode .board {
  gap: clamp(6px, 1vw, 14px);
}
html.tv-mode .col {
  gap: clamp(6px, 0.9vw, 12px);
  grid-template-rows: auto repeat(6, minmax(0, 1fr));
}
html.tv-mode .cat-head {
  font-size: clamp(0.95rem, 2.1vmin, 2rem);
  min-height: clamp(48px, 8vmin, 92px);
  padding: clamp(6px, 1vmin, 14px);
}
html.tv-mode .cell {
  font-size: clamp(1.6rem, 4.4vmin, 4.8rem);
  border-radius: clamp(10px, 1.2vmin, 20px);
}
html.tv-mode .qview, html.tv-mode .qview.no-media {
  flex: 1;
  min-height: 0;
  max-width: none;
  width: 100%;
  height: 100%;
}
html.tv-mode .q-text {
  font-size: clamp(1.8rem, 5vmin, 5.2rem);
  overflow: auto;
}
html.tv-mode .timer {
  font-size: clamp(3rem, 10vmin, 8rem);
}
html.tv-mode .winner-title, html.tv-mode .winner-name {
  font-size: clamp(2.2rem, 6vmin, 5rem);
  font-family: var(--font-display);
  color: var(--yellow);
  text-shadow: var(--word-shadow);
}
html.tv-mode .end-score-card .s { font-size: clamp(2rem, 5vmin, 4rem); }
html.tv-mode .result-card-wrap { max-width: min(420px, 36vw); }

html.tv-mode .board-wrap.tv-board {
  flex-direction: row;
  align-items: stretch;
  gap: clamp(12px, 2vw, 28px);
}
html.tv-mode .tv-qr {
  flex: 0 0 min(22vw, 280px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(12px, 1.5vw, 20px);
}
html.tv-mode .tv-qr img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: 16px;
}
html.tv-mode .tv-qr .code {
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: clamp(1.3rem, 3vmin, 2.2rem);
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--pink);
}
@media (max-aspect-ratio: 1/1) {
  html.tv-mode .board-wrap.tv-board { flex-direction: column; }
  html.tv-mode .tv-qr {
    flex: 0 0 auto;
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
  }
  html.tv-mode .tv-qr img { width: min(26vw, 140px); height: auto; }
  html.tv-mode .qview, html.tv-mode .qview.no-media { grid-template-columns: 1fr; }
}

/* Always: game surfaces fill the pane and don't clip when cast */
.main.tight > .view { flex: 1; min-height: 0; overflow: auto; }
html.tv-mode .main.tight > .view { overflow: hidden; }
.board, .qview { width: 100%; }
.qcard, .side-card { min-height: 0; overflow: auto; }
@media (min-aspect-ratio: 1/1) {
  .qview, .qview.no-media { grid-template-columns: 1.5fr 0.9fr; }
}


/* Full orientation support — never lock; reflow on rotate */
@media (orientation: portrait) {
  .board {
    grid-template-columns: 1fr !important;
    overflow: auto;
    align-content: start;
    gap: 8px;
  }
  .col {
    display: grid;
    grid-template-columns: minmax(76px, 1.15fr) repeat(6, minmax(0, 1fr));
    grid-template-rows: minmax(56px, auto) !important;
    gap: 6px;
    min-height: 0;
  }
  .cat-head {
    min-height: 56px;
    height: auto;
    font-size: clamp(0.75rem, 3.1vw, 1.05rem);
    padding: 6px 8px;
  }
  .cell {
    font-size: clamp(1rem, 4.4vw, 1.65rem);
    min-height: 52px;
    border-radius: 12px;
  }
  .qview, .qview.no-media { grid-template-columns: 1fr; max-width: none; }
  .main.tight { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
  .scoreboard { gap: 8px; padding-bottom: 10px; }
  .setup-wrap { padding-top: 4px; }
  html.tv-mode .board-wrap.tv-board { flex-direction: column; }
  html.tv-mode .board {
    grid-template-columns: 1fr !important;
  }
  html.tv-mode .col {
    grid-template-columns: minmax(88px, 1.1fr) repeat(6, minmax(0, 1fr));
    grid-template-rows: minmax(64px, auto) !important;
  }
}

@media (orientation: landscape) {
  .board { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .col {
    grid-template-columns: none;
    grid-template-rows: auto repeat(6, minmax(0, 1fr));
  }
  .qview, .qview.no-media {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr);
    max-width: none;
    width: 100%;
  }
  .topbar { flex-wrap: nowrap !important; }
  .hero { padding: 4px 0 10px; }
  .hero h2 { font-size: clamp(1.6rem, 5vw, 2.6rem); }
  .setup-footer { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .auth-wrap {
    justify-content: flex-start;
    padding: 16px 24px max(16px, env(safe-area-inset-bottom, 0px));
  }
  .auth-brand img.brand-lockup { width: 108px; }
  .play-wrap {
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 28px;
    padding: max(8px, env(safe-area-inset-top, 0px)) 20px max(8px, env(safe-area-inset-bottom, 0px));
  }
  .play-brand { margin: 0 12px 0 0; }
  .play-brand .brand-mark { margin: 0 auto 6px; }
  .you-bar { margin: 0; }
  .buzzer-area { flex: 1 1 auto; padding: 0; justify-content: center; }
  .buzzer, .play-wrap .buzzer {
    width: min(52vh, 40vw, 240px);
    height: min(52vh, 40vw, 240px);
  }
  html.tv-mode .board-wrap.tv-board { flex-direction: row; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .topbar { padding: 6px 12px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand h1 { font-size: 1.05rem; }
  .scoreboard { padding-bottom: 6px; }
  .team-card { padding: 8px 12px; }
  .qcard, .side-card { padding: 16px 18px; }
  .pricing-page, .admin-page { padding-top: 16px; }
}

@media (orientation: portrait) {
  .play-wrap { flex-direction: column; max-width: 440px; }
  .buzzer, .play-wrap .buzzer {
    width: min(64vw, 72vh, 260px);
    height: min(64vw, 72vh, 260px);
  }
}

@media (orientation: portrait) {
  .lifelines { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
  .lifelines .life { font-size: 0.72rem; padding: 4px 8px; border-radius: 999px; }
  .team-card { padding: 10px 12px; }
  .topbar { padding: 8px 12px; }
  .qcard, .side-card { padding: 16px 16px 18px; }
  .qcard .actions, .side-card .actions { flex-wrap: wrap; }
  .board-wrap { overflow: auto; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .setup-footer .hint { display: none; }
  .setup-footer { padding: 6px 16px max(6px, env(safe-area-inset-bottom, 0px)); }
  .hero p { display: none; }
  .hero { padding: 0 0 6px; }
  .lifelines { display: flex; flex-wrap: wrap; gap: 4px; }
  .lifelines .life { font-size: 0.7rem; padding: 3px 7px; }
  .scoreboard { max-height: 28vh; overflow: auto; }
}

/* Kill leftover circular-button chrome on the branded buzzer */
.play-wrap .buzzer,
button.buzzer {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
}

@media (orientation: landscape) {
  .main.tight { height: 100%; }
  .main.tight > .view {
    height: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .board-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
  }
  .board {
    flex: 1 1 auto;
    width: 100%;
    min-height: 140px;
    height: 100%;
    align-content: stretch;
  }
  .qview, .qview.no-media {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
  }
  .qcard .actions, .side-card .actions { flex-shrink: 0; }
}

/* ---------- Site footer / contact ---------- */
.site-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.92rem;
}
.site-footer a { color: var(--yellow, #FFD21F); text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  top: 0;
  right: 0;
  pointer-events: none;
}
.ok-msg { color: #8dffb0; font-weight: 600; margin: 8px 0 12px; }

/* ---------- VAR ---------- */
.var-row {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 8px;
}
.var-pill {
  appearance: none;
  border: 0;
  background: #FFD21F;
  color: #2A1155;
  font-family: var(--font-display, inherit);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #FF2E7E;
  min-height: 28px;
}
.var-pill:hover { filter: brightness(1.05); }
.var-pill:active { transform: translateY(1px); box-shadow: 0 2px 0 #FF2E7E; }
.var-pill-play { margin-top: 8px; align-self: center; }
.var-sheet h3 { margin-bottom: 6px; }
.var-reasons, .var-sheet .var-reasons { display: grid; gap: 8px; }
.var-reasons .check, label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

/* ---------- Admin ---------- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 22px;
}
.admin-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.admin-tab.on {
  background: #FFD21F;
  color: #2A1155;
  border-color: transparent;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.admin-toolbar h2 { margin: 0 0 0 auto; }
.admin-toolbar .input { flex: 1 1 160px; }
.cat-admin-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  text-align: right;
  background: var(--surface-2, #4A247A);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.cat-admin-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex: 1; }
.cat-admin-name img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.tag {
  display: inline-block;
  background: #FFD21F;
  color: #2A1155;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 800;
}
.tag-warn { background: #FF2E7E; color: #fff; }
.tag-mute { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.admin-sub { font-size: 1.05rem; margin: 18px 0 10px; }
.q-admin-card, .var-group, .msg-card {
  background: var(--surface-2, #4A247A);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
}
.q-admin-card.is-disabled, .q-admin-card.is-draft, .var-group.is-resolved, .msg-card.is-read { opacity: 0.78; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.msg-body { white-space: pre-wrap; margin: 10px 0; }
.is-suspended td { opacity: 0.7; }
textarea.input { resize: vertical; min-height: 64px; }

@media (orientation: landscape) and (max-height: 500px) {
  .admin-page { padding-top: 12px; }
  .admin-tabs { margin-bottom: 12px; }
  .var-pill { font-size: 0.65rem; padding: 4px 8px; min-height: 22px; }
}
@media (orientation: portrait) {
  .rev-grid { grid-template-columns: 1fr 1fr; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
}

@media (max-height: 900px) {
  .auth-brand img.brand-lockup { width: 120px; height: auto; }
  .auth-wrap { padding-top: 20px; }
}
@media (max-width: 430px) and (max-height: 900px) {
  .auth-brand img.brand-lockup { width: 100px; }
  .auth-card { padding: 22px 20px; }
  .auth-form { margin-top: 14px; gap: 10px; }
}

/* ========== Public site chrome ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(42, 17, 85, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 22px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex: 0 0 auto;
  color: var(--yellow, #FFD21F);
}
.site-logo img, .site-logo svg {
  width: 36px;
  height: 36px;
  display: block;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.site-logo .wordmark {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--yellow, #FFD21F);
  text-shadow: 2px 2px 0 var(--pink, #FF2E7E);
  line-height: 1;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex: 1 1 auto;
}
.site-nav a, .site-link {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 4px;
  border-radius: 8px;
}
.site-nav a:hover, .site-link:hover, .site-nav a.on { color: var(--yellow, #FFD21F); }
.site-nav-auth { display: none; }
.site-tools { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.site-auth-desktop { display: flex; align-items: center; gap: 12px; }
.site-credit {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: #3A1C6E;
  border: 1px solid rgba(255,210,31,0.35);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
}
.site-credit strong { color: var(--yellow, #FFD21F); font-weight: 800; }
.site-burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 10px;
  cursor: pointer;
}
.site-burger span {
  display: block;
  height: 2px;
  background: #fff;
  margin: 6px 0;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
body.nav-open .site-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nav-open .site-burger span:nth-child(2) { opacity: 0; }
body.nav-open .site-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.site-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 4, 24, 0.5);
  z-index: 70;
}

.site-foot {
  margin-top: 64px;
  padding: 40px 22px max(32px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #24104a;
}
.site-foot-inner { max-width: 1180px; margin: 0 auto; text-align: center; }
.site-foot .site-logo { justify-content: center; margin-bottom: 18px; }
.site-foot-links { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; margin-bottom: 16px; }
.site-foot-links a { color: #fff; text-decoration: none; font-weight: 600; }
.site-foot-links a:hover { color: var(--yellow, #FFD21F); }
.site-copy { color: rgba(255,255,255,0.6); font-size: 0.9rem; }

/* Auth logo without a boxed background */
.auth-brand.auth-brand-lockup,
.auth-brand {
  background: transparent;
}
.auth-brand img.brand-lockup,
.auth-brand img {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none;
}
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 24px;
  background: transparent;
}
.auth-logo img, .auth-logo svg {
  width: 88px;
  height: 88px;
  background: transparent;
  border-radius: 0;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
}
.auth-logo .wordmark {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--yellow, #FFD21F);
  text-shadow: 3px 3px 0 var(--pink, #FF2E7E);
}

/* Marketing layout */
.pub-body, .auth-body, .host-body {
  background: #F6F1FF;
  color: #2A1155;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
html.game-play, html.game-play body {
  overflow: hidden;
  background: #5B2BB0;
}

.pub-main { overflow-x: hidden; }
.hero-home {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 22px 64px;
  position: relative;
}
.hero-home .hero-logo {
  width: min(180px, 42vw);
  height: auto;
  background: transparent;
  margin-bottom: 8px;
}
.hero-home .wordmark {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 6.2rem);
  color: var(--yellow, #FFD21F);
  text-shadow: 4px 4px 0 var(--pink, #FF2E7E);
  line-height: 0.95;
  margin: 0 0 16px;
}
.hero-home .tagline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 14px;
}
.hero-home .pitch {
  max-width: 34em;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.86);
  margin: 0 auto 28px;
  line-height: 1.7;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-actions .btn { min-width: 180px; }

.pub-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 22px;
}
.pub-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--yellow, #FFD21F);
  text-shadow: 2px 2px 0 var(--pink, #FF2E7E);
  text-align: center;
  margin: 0 0 12px;
}
.pub-lead {
  text-align: center;
  color: rgba(255,255,255,0.8);
  max-width: 36em;
  margin: 0 auto 40px;
  font-size: 1.1rem;
  line-height: 1.7;
}
.steps-grid, .feat-grid, .life-grid, .cat-preview, .cats-grid {
  display: grid;
  gap: 18px;
}
.steps-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.life-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cat-preview, .cats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step-card, .feat-card, .life-card, .faq-item, .legal-card {
  background: var(--surface, #3A1C6E);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 24px;
}
.step-icon, .feat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #4A247A;
  margin-bottom: 14px;
  font-size: 1.6rem;
}
.step-card h3, .feat-card h3, .life-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step-card p, .feat-card p, .life-card p, .faq-item p { color: rgba(255,255,255,0.8); line-height: 1.65; }
.step-num { color: var(--yellow, #FFD21F); font-weight: 800; font-size: 0.85rem; }

.cat-tile {
  display: flex;
  flex-direction: column;
  background: #2A1155;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.cat-tile:hover { transform: translateY(-3px); border-color: var(--yellow, #FFD21F); }
.cat-tile .cat-cover,
.cat-card .cat-cover {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #2A1155;
}
.cat-tile .cat-cover { aspect-ratio: 1; }
.cat-tile img, .cat-tile .cover,
.cat-card .cat-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #2A1155;
  display: block;
}
.cat-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, rgba(42,17,85,0.05) 20%, rgba(42,17,85,0.88) 100%);
  color: #fff;
}
.cat-overlay h3, .cat-card .cat-overlay .name {
  margin: 0;
  color: var(--yellow, #FFD21F);
  text-shadow: 1px 1px 0 var(--pink, #FF2E7E);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
}
.cat-overlay .hint, .cat-card .cat-overlay .tag {
  color: rgba(255,255,255,0.88);
  font-size: 0.8rem;
  margin: 0 0 4px;
}
.cat-tile .meta { padding: 12px 14px 16px; }
.cat-tile h3 { font-size: 1.05rem; margin: 0 0 4px; }
.cat-tile .hint { font-size: 0.85rem; }

.section-more { text-align: center; margin-top: 28px; }

.cta-band {
  margin: 20px auto 0;
  max-width: 1180px;
  background: linear-gradient(135deg, #4A247A, #2A1155 60%);
  border: 1px solid rgba(255,210,31,0.25);
  border-radius: 28px;
  padding: 48px 22px;
  text-align: center;
}
.cta-band h2 { margin-bottom: 10px; }

.faq-item { margin-bottom: 10px; }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--yellow, #FFD21F); font-size: 1.4rem; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin-top: 10px; }

.cats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.page-hero { padding: 40px 22px 10px; text-align: center; }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--yellow, #FFD21F);
  text-shadow: 2px 2px 0 var(--pink, #FF2E7E);
  margin-bottom: 8px;
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .cat-tile, .site-burger span { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .steps-grid, .feat-grid, .life-grid { grid-template-columns: 1fr 1fr; }
  .cat-preview, .cats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    height: 100dvh;
    height: 100vh;
    width: min(86vw, 360px);
    background: #2A1155;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 22px 28px;
    box-shadow: 12px 0 40px rgba(0,0,0,0.35);
    transform: translateX(-105%);
    transition: transform 0.32s ease;
    z-index: 85;
  }
  body.nav-open .site-nav { transform: translateX(0); }
  body.nav-open .site-nav-backdrop { display: block; }
  .site-nav a { font-size: 1.15rem; padding: 12px 4px; }
  .site-nav-auth { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
  .site-auth-desktop { display: none; }
  .site-burger { display: inline-block; }
}
@media (max-width: 640px) {
  .steps-grid, .feat-grid, .life-grid, .cat-preview, .cats-grid { grid-template-columns: 1fr 1fr; }
  .hero-home { padding-top: 32px; }
  .pub-section { padding: 48px 18px; }
}
@media (max-width: 420px) {
  .cat-preview, .cats-grid { grid-template-columns: 1fr 1fr; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hero-home { min-height: auto; padding: 28px 20px; }
  .hero-home .hero-logo { width: 72px; }
  .hero-home .wordmark { font-size: clamp(2rem, 8vh, 3rem); }
  .site-header-inner { padding-top: 6px; padding-bottom: 6px; }
}


/* Compact host chrome: one 48px row, start CTA never covers tiles */
@media (max-width: 900px), (max-height: 500px) {
  .topbar { gap: 8px; padding-inline: 10px; }
  .brand h1, .topbar .wordmark { font-size: 1.05rem; }
  .brand-mark { width: 24px; height: 24px; }
  .room-chip { padding: 2px 10px; gap: 0; box-shadow: none; }
  .room-chip img, .room-chip .lbl { display: none; }
  .room-chip .code { font-size: 0.86rem; letter-spacing: 0.1em; }
}
@media (max-width: 520px) {
  .topbar-credit { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .setup-footer {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    z-index: 30;
    text-align: start;
  }
  .setup-footer .hint { display: none !important; }
  .setup-footer .btn {
    width: auto;
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.95rem;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  }
  .main.has-setup-footer {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html.tv-mode .setup-footer { display: none; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .cat-card .cat-cover { aspect-ratio: 16 / 9; min-height: 72px; }
  .cat-overlay { padding: 8px 10px 10px; }
  .cat-card .cat-overlay .name { font-size: 0.92rem; }
  .cat-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .main { padding: 10px 14px; }
}


/* ===== Game chrome (landscape play) ===== */
html.game-play, html.game-play body, .game-shell {
  background: #5B2BB0;
  overflow: hidden;
  height: 100%;
  max-height: 100svh;
}
.game-shell {
  display: flex;
  flex-direction: column;
  height: 100svh;
  max-height: 100svh;
  color: #fff;
  min-height: 0;
}
.game-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: clamp(36px, 7.4vh, 52px);
  padding: 0 clamp(8px, 1.2vw, 18px);
  background: #6A2BD9;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 8;
}
.game-top-start, .game-top-end {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 14px);
  flex: 1 1 0;
  min-width: 0;
}
.game-top-start { justify-content: flex-start; }
.game-top-end { justify-content: flex-end; }
.game-top-center {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vh, 1.5rem);
  color: var(--yellow, #FFD21F);
  text-shadow: 2px 2px 0 var(--pink, #FF2E7E);
  letter-spacing: 0;
  line-height: 1;
}
.game-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.game-brand img { width: clamp(22px, 4.2vh, 32px); height: clamp(22px, 4.2vh, 32px); background: transparent; border-radius: 0; }
.game-turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--yellow, #FFD21F);
  color: #2A1155;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: clamp(0.72rem, 1.8vh, 0.95rem);
  white-space: nowrap;
}
.game-top-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.7rem, 1.7vh, 0.9rem);
  padding: 4px 6px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.game-top-act:hover { color: var(--yellow, #FFD21F); }
.game-top-act .ico { width: 1.05em; height: 1.05em; display: inline-block; }
.game-top-theme {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--yellow, #FFD21F);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Board grid: 2 x 3 category blocks */
.game-board-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1.2vh, 16px) clamp(8px, 1.2vw, 20px);
  padding: clamp(6px, 1.4vh, 14px) clamp(8px, 1.4vw, 20px);
}
.cat-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: clamp(4px, 0.7vw, 10px);
  min-height: 0;
}
.cat-vals {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: clamp(3px, 0.8vh, 8px);
}
.cat-val {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(42px, 6.2vw, 92px);
  height: clamp(26px, 6vh, 54px);
  border-radius: 999px;
  background: #3A1C6E;
  color: #fff;
  border: 2px solid rgba(255,210,31,0.45);
  font-weight: 800;
  font-size: clamp(0.8rem, 2.4vh, 1.35rem);
  cursor: pointer;
  padding: 0 6px;
}
.cat-val:hover:not(:disabled) { background: #4A247A; border-color: var(--yellow, #FFD21F); color: var(--yellow, #FFD21F); }
.cat-val.used, .cat-val:disabled {
  opacity: 0.38;
  filter: grayscale(0.7);
  cursor: default;
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
}
.cat-mid {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: clamp(10px, 1.4vh, 16px);
  overflow: hidden;
  background: #2A1155;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
}
.cat-mid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cat-strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  text-align: center;
  font-weight: 800;
  font-size: clamp(0.7rem, 2vh, 1.15rem);
  padding: clamp(3px, 0.8vh, 8px) 6px;
  color: #2A1155;
  background: var(--yellow, #FFD21F);
  line-height: 1.2;
}
.cat-block:nth-child(even) .cat-strip { background: var(--pink, #FF2E7E); color: #fff; }

/* Bottom dock */
.game-dock {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 1vw, 16px);
  padding: clamp(4px, 1vh, 10px) clamp(8px, 1.4vw, 18px) max(6px, env(safe-area-inset-bottom, 0px));
  background: #6A2BD9;
  border-top: 1px solid rgba(255,255,255,0.08);
  min-height: clamp(64px, 16.5vh, 112px);
}
.dock-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.dock-logo img { width: clamp(36px, 7vh, 64px); height: clamp(36px, 7vh, 64px); }
.dock-logo .wordmark {
  font-family: var(--font-display);
  color: var(--yellow, #FFD21F);
  text-shadow: 2px 2px 0 var(--pink, #FF2E7E);
  font-size: clamp(0.85rem, 2vh, 1.2rem);
  line-height: 1;
}
.dock-qr img { width: 36px; height: 36px; border-radius: 6px; background: #fff; margin-top: 2px; }
.dock-team {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dock-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dock-team.is-t0 { align-items: flex-end; }
.dock-team.is-t0 .dock-team-row { flex-direction: row; } /* lifelines then label then name toward the start/right */
.dock-team.is-t1 { align-items: flex-start; }
.dock-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(52px, 8vw, 110px);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.2vh, 1.15rem);
  background: var(--team, #FFD21F);
  color: var(--team-ink, #2A1155);
  border: 3px solid transparent;
}
.dock-team.is-turn .dock-name {
  box-shadow: 0 0 0 3px var(--yellow, #FFD21F);
}
.life-label { font-size: clamp(0.68rem, 1.6vh, 0.88rem); font-weight: 700; color: rgba(255,255,255,0.9); }
.life-row { display: flex; align-items: center; gap: 5px; }
.life-ico {
  width: clamp(22px, 4.2vh, 34px);
  height: clamp(22px, 4.2vh, 34px);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.35);
  background: #3A1C6E;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: default;
}
button.life-ico { cursor: pointer; }
button.life-ico:hover { border-color: var(--yellow, #FFD21F); color: var(--yellow, #FFD21F); }
.life-ico svg { width: 62%; height: 62%; display: block; }
.life-ico.is-used, .life-ico.is-frozen {
  opacity: 0.35;
  filter: grayscale(1);
  cursor: default;
}
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2A1155;
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 2px 4px;
}
.score-pill button {
  width: 26px; height: 26px;
  border: 0; border-radius: 999px;
  background: #3A1C6E; color: #fff;
  font-weight: 800; cursor: pointer;
}
.score-pill button:hover { background: var(--yellow, #FFD21F); color: #2A1155; }
.score-pill .val {
  min-width: 2.2em;
  text-align: center;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.4vh, 1.3rem);
}
.score-pill .val.pop { animation: scorePop 0.7s ease; color: var(--yellow, #FFD21F); }
@keyframes scorePop {
  0% { transform: scale(1); }
  30% { transform: scale(1.45); }
  100% { transform: scale(1); }
}
.score-pop {
  position: absolute;
  font-weight: 800;
  color: var(--yellow, #FFD21F);
  font-size: 1.4rem;
  animation: scoreFly 0.8s ease forwards;
  pointer-events: none;
}
@keyframes scoreFly {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-28px); }
}

/* Question stage: frame + right sidebar */
.question-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(130px, 22%) minmax(0, 1fr);
  gap: clamp(6px, 1vw, 14px);
  padding: clamp(6px, 1.2vh, 12px) clamp(8px, 1.2vw, 16px) clamp(8px, 1.6vh, 16px);
}
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 16px);
  min-width: 0;
  overflow: auto;
}
.side-team {
  background: transparent;
  text-align: center;
}
.side-team .dock-name { width: 100%; padding: 8px 10px; font-size: clamp(0.95rem, 2.4vh, 1.25rem); }
.side-team .side-score {
  font-weight: 800;
  font-size: clamp(1.2rem, 3.4vh, 1.8rem);
  margin: 2px 0 6px;
}
.side-team .life-label { display: block; margin-bottom: 4px; }
.side-team .life-row { justify-content: center; flex-wrap: wrap; }
.side-mark { margin-top: auto; text-align: center; padding-top: 8px; }
.side-mark img { width: 44px; height: 44px; }

.q-frame-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.q-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: clamp(16px, 3.4vh, 26px) clamp(8px, 1.2vw, 18px) 0;
  border: 5px solid var(--pink, #FF2E7E);
  border-radius: clamp(16px, 3vh, 32px);
  background: #5A27C4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.q-state {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.6vh, 18px);
  padding: clamp(12px, 3.5vh, 48px) clamp(14px, 3vw, 48px);
  text-align: center;
  animation: qFade 0.32s ease both;
  min-height: 0;
  overflow: auto;
}
@keyframes qFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .q-state, .score-pill .val.pop { animation: none; }
}
.q-title, .q-text-main {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.6vh, 2.8rem);
  line-height: 1.35;
  color: #fff;
  margin: 0;
  max-width: 18em;
}
.q-media {
  max-width: min(70%, 640px);
  max-height: 46%;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.q-media img, .q-media video {
  max-width: 100%;
  max-height: 38vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.q-who-row {
  display: flex;
  gap: clamp(10px, 2vw, 24px);
  justify-content: center;
  flex-wrap: wrap;
  width: min(80%, 720px);
}
.q-who-btn {
  flex: 1 1 140px;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  font-size: clamp(1rem, 2.6vh, 1.4rem);
  background: var(--team, #FFD21F);
  color: var(--team-ink, #2A1155);
  cursor: pointer;
}
.q-none-btn {
  width: min(80%, 720px);
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.4vh, 1.25rem);
  background: #5A4A70;
  color: #fff;
  cursor: pointer;
}
.q-none-btn:hover { filter: brightness(1.08); }

/* Overlapping frame chrome */
.q-timer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #6A2BD9;
  border: 3px solid var(--pink, #FF2E7E);
  border-radius: 999px;
  padding: 4px 10px;
  z-index: 3;
}
.q-timer button {
  width: 28px; height: 28px;
  border: 0; border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.q-timer button:hover { color: var(--yellow, #FFD21F); }
.q-timer .clock {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.95rem, 2.4vh, 1.25rem);
  min-width: 4.2em;
  text-align: center;
}
.q-timer .clock.low { color: #FF8AA8; }
.q-points {
  position: absolute;
  top: 0;
  inset-inline-start: clamp(24px, 6vw, 80px);
  transform: translateY(-50%);
  background: #6A2BD9;
  color: #fff;
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 800;
  font-size: clamp(0.78rem, 2vh, 1rem);
  z-index: 3;
}
.q-var {
  position: absolute;
  top: 12px;
  inset-inline-end: 16px;
  z-index: 3;
}
.q-corner {
  position: absolute;
  bottom: 0;
  transform: translateY(50%);
  z-index: 3;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.1vh, 1.1rem);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.q-corner-start { inset-inline-start: 18px; } /* visual right in RTL */
.q-corner-end { inset-inline-end: 18px; }     /* visual left in RTL */
/* Match the reference: الإجابة / أي فريق / العودة on the visual LEFT; category / ارجع on the visual RIGHT */
.q-btn-answer, .q-btn-who, .q-btn-back-ans { left: 18px; right: auto; inset-inline-start: auto; inset-inline-end: auto; background: var(--yellow, #FFD21F); color: #2A1155; }
.q-btn-cat, .q-btn-back-q { right: 18px; left: auto; inset-inline-start: auto; inset-inline-end: auto; background: var(--pink, #FF2E7E); color: #fff; }
.q-btn-cat { cursor: default; }

.buzz-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFD21F;
  color: #2A1155;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 14px;
  z-index: 4;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Rotate-to-landscape overlay */
.rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #2A1155;
  color: #fff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
.rotate-overlay img { width: 88px; height: 88px; }
.rotate-overlay p {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--yellow, #FFD21F);
  text-shadow: 2px 2px 0 var(--pink, #FF2E7E);
  margin: 0;
}
.phone-rotate {
  width: 54px;
  height: 90px;
  border: 4px solid var(--yellow, #FFD21F);
  border-radius: 10px;
  position: relative;
  animation: phoneFlip 1.6s ease-in-out infinite;
}
.phone-rotate::after {
  content: "";
  position: absolute;
  bottom: 6px; left: 50%;
  width: 12px; height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--pink, #FF2E7E);
}
@keyframes phoneFlip {
  0%, 20% { transform: rotate(0deg); }
  50%, 80% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}
@media (orientation: portrait) {
  .game-shell > .game-top,
  .game-shell > .game-board-stage,
  .game-shell > .game-dock,
  .game-shell > .question-stage,
  .game-shell > .game-end {
    display: none !important;
  }
  .game-shell > .rotate-overlay { display: flex; }
}
@media (orientation: landscape) {
  .game-shell > .rotate-overlay { display: none !important; }
}

/* Final / end inside game shell */
.game-end {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px;
}

/* Setup option toggles */
.opt-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.join-card {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2, #3A1C6E);
  border-radius: 16px;
  padding: 12px;
}
.join-card img { width: 120px; height: 120px; border-radius: 8px; background: #fff; }
.join-card .code { font-weight: 800; letter-spacing: 0.12em; font-size: 1.3rem; }

/* ===== Bright marketing / setup chrome ===== */
.pub-body .site-header, .auth-body .site-header, .host-body .start-header, .site-header {
  background: #ffffff;
  border-bottom: 1px solid rgba(42, 17, 85, 0.08);
  color: #2A1155;
  box-shadow: 0 2px 12px rgba(42, 17, 85, 0.06);
}
.site-header-inner, .start-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  min-height: 64px;
}
.site-logo .wordmark, .start-header .wordmark {
  color: #FFD21F;
  text-shadow: 2px 2px 0 #FF2E7E;
}
.site-nav a, .site-link, .start-nav a {
  color: #2A1155;
  font-weight: 800;
}
.site-nav a:hover, .site-link:hover, .start-nav a.on, .site-nav a.on { color: #6A2BD9; }
.site-credit, .start-credit {
  background: #F6F1FF;
  border: 1px solid rgba(106, 43, 217, 0.25);
  color: #2A1155;
}
.site-credit strong, .start-credit strong { color: #6A2BD9; }
.btn-primary, .btn.btn-primary {
  background: #FFD21F;
  color: #2A1155;
  border: 0;
  font-weight: 800;
}
.btn-primary:hover { background: #FFE25A; color: #2A1155; }
.pub-section h2, .page-hero h1 { color: #2A1155; }
.step-card, .feat-card, .life-card, .faq-item, .legal-card, .cat-tile {
  background: #fff;
  color: #2A1155;
  border: 1px solid rgba(42, 17, 85, 0.08);
}
.step-card p, .feat-card p, .life-card p, .faq-item p { color: #5A3E7A; }
.hero-home {
  background: var(--grad-hero);
  color: #fff;
  border-radius: 0;
}
.hero-home .pitch, .hero-home .tagline { color: rgba(255,255,255,0.95); }
.hero-home .wordmark { color: #FFD21F; text-shadow: 3px 3px 0 #FF2E7E; }
.cta-band { background: var(--grad-hero); color: #fff; }
.site-foot { background: #2A1155; color: #fff; }
.site-foot a { color: #fff; }
.pub-section { background: transparent; }
.cat-overlay h3 { color: #FFD21F; }

.buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #FF8A1F, #FF2E7E);
  color: #fff;
  font-weight: 800;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 46, 126, 0.25);
  white-space: nowrap;
}
.buy-btn:hover { filter: brightness(1.06); color: #fff; }
.buy-btn .plus {
  width: 20px; height: 20px; border-radius: 999px;
  background: #fff; color: #FF2E7E;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; line-height: 1;
}

.start-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: #2A1155;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 6px;
}
.start-avatar {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}
.start-menu, .user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(42, 17, 85, 0.16);
  padding: 8px;
  z-index: 80;
  display: none;
  flex-direction: column;
}
.start-user-wrap { position: relative; }
.start-user-wrap.open .start-menu, .start-user-wrap.open .user-menu { display: flex; }
.start-menu a, .start-menu button, .user-menu a, .user-menu button {
  background: transparent; border: 0; text-align: right;
  padding: 10px 12px; border-radius: 10px;
  color: #2A1155; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.start-menu a:hover, .start-menu button:hover { background: #F6F1FF; }

/* Purchase popover */
.buy-back {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 17, 85, 0.28);
  z-index: 90;
}
.buy-back.open { display: block; }
.buy-card {
  position: absolute;
  top: 68px;
  left: 16px;
  width: min(420px, calc(100vw - 24px));
  background: #fff;
  color: #2A1155;
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(42, 17, 85, 0.2);
  padding: 16px;
  z-index: 91;
}
.buy-card h3 { font-size: 1.15rem; margin: 0 0 12px; }
.buy-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 3px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-align: right;
}
.buy-plan .qty { font-size: 1rem; }
.buy-plan .price { font-size: 1.05rem; }
.buy-plan.is-single { background: linear-gradient(90deg, #6A2BD9, #8B4DE8); }
.buy-plan.is-pack { background: linear-gradient(90deg, #FF2E7E, #FF6B9D); }
.buy-plan.is-monthly { background: linear-gradient(90deg, #FF8A1F, #FFD21F); color: #2A1155; }
.buy-plan.is-on { box-shadow: 0 0 0 3px #2A1155; }
.buy-plan.is-on::after { content: "✓"; margin-inline-start: 8px; }
.buy-discount { display: flex; gap: 8px; margin: 12px 0; }
.buy-discount input {
  flex: 1;
  border: 1px solid rgba(42,17,85,0.16);
  border-radius: 999px;
  padding: 10px 14px;
  background: #F6F1FF;
  color: #2A1155;
}
.buy-discount button {
  border: 0; border-radius: 999px; padding: 10px 16px;
  background: #6A2BD9; color: #fff; font-weight: 800; cursor: pointer;
}
.buy-msg { font-size: 0.88rem; margin: 0 0 8px; min-height: 1.2em; }
.buy-msg.ok { color: #1F8A4C; }
.buy-msg.err { color: #D9366F; }
.buy-pay {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: #2A1155;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
}
.buy-pay:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 640px) {
  .buy-card {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%;
    border-radius: 22px 22px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* Start-game / setup page */
.host-body .shell:not(.game-shell) {
  background: #F6F1FF;
  color: #2A1155;
  min-height: 100dvh;
  overflow: auto;
}
.start-page { background: #F6F1FF; color: #2A1155; }
.start-hero {
  background: var(--grad-hero);
  color: #fff;
  text-align: center;
  padding: 48px 20px 36px;
  position: relative;
}
.start-hero h1, .start-hero .tagline {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 700;
  margin: 0 0 18px;
}
.start-hero .hows { margin: 0 auto 22px; max-width: 520px; line-height: 1.7; font-weight: 600; }
.start-hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.start-hero-actions .pill-lg {
  border: 0; border-radius: 999px;
  padding: 12px 28px;
  font-weight: 800; font-size: 1.05rem;
  cursor: pointer; text-decoration: none;
}
.pill-lg.solid { background: #2A1155; color: #fff; }
.pill-lg.ghost { background: #fff; color: #2A1155; }
.start-chevron {
  width: 48px; height: 48px; border-radius: 999px;
  background: #fff; color: #6A2BD9;
  border: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800;
  position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%);
  box-shadow: 0 8px 18px rgba(42,17,85,0.16);
  cursor: pointer;
}
.start-section { max-width: 1180px; margin: 0 auto; padding: 48px 20px 20px; }
.start-section h2 {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 6px;
}
.start-sub { text-align: center; color: #6B4E8C; margin: 0 0 18px; }
.start-tools {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; align-items: center;
  margin-bottom: 22px;
}
.start-tools .pill {
  border: 1px solid rgba(42,17,85,0.12);
  background: #fff; color: #2A1155;
  border-radius: 999px; padding: 8px 14px;
  font-weight: 700; cursor: pointer;
}
.start-tools .pill.on { background: #6A2BD9; color: #fff; border-color: transparent; }
.start-search {
  border: 1px solid rgba(42,17,85,0.14);
  border-radius: 999px; padding: 8px 14px;
  background: #fff; color: #2A1155; min-width: 200px;
}
.start-count {
  background: #FFD21F; color: #2A1155;
  border-radius: 999px; padding: 6px 12px; font-weight: 800;
}
.cat-section {
  position: relative;
  background: #EFE6FF;
  border-radius: 28px;
  padding: 28px 16px 18px;
  margin: 28px 0;
}
.cat-section-title {
  position: absolute;
  top: 0; right: 50%;
  transform: translate(50%, -50%);
  background: #6A2BD9; color: #fff;
  border-radius: 999px; padding: 6px 18px;
  font-weight: 800; margin: 0;
}
.cat-collapse {
  position: absolute; top: 10px; left: 12px;
  width: 32px; height: 32px; border-radius: 999px;
  border: 0; background: #fff; color: #6A2BD9;
  font-weight: 800; cursor: pointer;
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 980px) { .start-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .start-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.start-card {
  position: relative;
  display: block;
  border: 3px solid transparent;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  padding: 0;
  color: inherit;
  text-align: right;
}
.start-card .cover { aspect-ratio: 3 / 4; display: block; width: 100%; object-fit: cover; background: #2A1155; }
.start-card .ribbon {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #6A2BD9; color: #fff;
  text-align: center; font-weight: 800;
  padding: 8px 6px; font-size: 0.95rem;
}
.start-card:nth-child(even) .ribbon { background: #FF2E7E; }
.start-card .sticker {
  position: absolute; top: 8px; right: 8px;
  background: #FFD21F; color: #2A1155;
  border-radius: 999px; padding: 3px 8px;
  font-size: 0.72rem; font-weight: 800;
}
.start-card .ico-btn {
  position: absolute; top: 8px;
  width: 28px; height: 28px; border-radius: 999px;
  border: 0; background: rgba(255,255,255,0.92); color: #2A1155;
  font-weight: 800; cursor: pointer;
}
.start-card .ico-info { left: 8px; }
.start-card .ico-fav { left: 40px; color: #FF2E7E; }
.start-card.on {
  border-color: #FFD21F;
  box-shadow: 0 0 0 3px rgba(255,210,31,0.45);
}
.start-card .check {
  display: none;
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 999px;
  background: #FFD21F; color: #2A1155;
  font-weight: 900; align-items: center; justify-content: center;
}
.start-card.on .check { display: flex; }
.start-card.on .sticker { top: 38px; }
.start-card .team-badge {
  position: absolute; bottom: 42px; right: 8px;
  background: #2A1155; color: #FFD21F;
  border-radius: 999px; padding: 2px 8px;
  font-size: 0.72rem; font-weight: 800;
  display: none;
}
.start-card.on .team-badge { display: inline-block; }

.start-form { max-width: 880px; margin: 0 auto 24px; }
.start-form .field { margin-bottom: 14px; }
.start-form label { display: block; font-weight: 800; margin-bottom: 6px; }
.start-form .input, .start-page .input {
  width: 100%;
  border: 1px solid rgba(42,17,85,0.16);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: #2A1155;
}
.team-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 700px) { .team-cols { grid-template-columns: 1fr; } }
.life-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.life-pick {
  width: 52px; height: 52px; border-radius: 999px;
  border: 3px solid transparent;
  background: #EFE6FF; color: #2A1155;
  cursor: pointer;
}
.life-pick.on { border-color: #FFD21F; background: #6A2BD9; color: #fff; }
.opt-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 16px; padding: 12px 16px; margin: 8px 0;
  border: 1px solid rgba(42,17,85,0.08);
}
.accordion {
  background: #fff; border-radius: 18px;
  border: 1px solid rgba(42,17,85,0.08);
  margin: 16px 0 24px;
}
.accordion summary {
  list-style: none; cursor: pointer; font-weight: 800;
  padding: 14px 16px;
}
.accordion .acc-body { padding: 0 16px 16px; }
.start-go {
  display: block;
  width: min(420px, 100%);
  margin: 28px auto 48px;
  border: 0; border-radius: 999px;
  padding: 16px 24px;
  background: #FFD21F; color: #2A1155;
  font-weight: 800; font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 0 #E6B800;
}
.start-go:hover { background: #FFE25A; }
.start-header-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.start-nav { display: flex; gap: 14px; align-items: center; }
@media (max-width: 820px) {
  .start-nav { display: none; }
  body.nav-open .start-nav {
    display: flex; flex-direction: column;
    position: fixed; top: 64px; left: 0; right: 0;
    background: #fff; padding: 16px; z-index: 70;
  }
}

/* Legal pages */
.lang-jump {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
}
.lang-jump a {
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
  color: #2A1155;
  border: 1px solid rgba(42,17,85,0.14);
}
.lang-jump a:hover, .lang-jump a:focus { background: #6A2BD9; color: #fff; }
.legal-card {
  background: #fff;
  color: #2A1155;
  border-radius: 24px;
  padding: 28px 24px 36px;
  border: 1px solid rgba(42,17,85,0.08);
  box-shadow: 0 8px 24px rgba(42,17,85,0.06);
  max-width: 860px;
  margin: 0 auto 28px;
  line-height: 1.85;
}
.legal-card h2 { font-size: 1.2rem; margin: 1.5em 0 0.4em; color: #2A1155; }
.legal-card h3 { font-size: 1.05rem; margin: 1.2em 0 0.3em; }
.legal-card p, .legal-card li { color: #3A1C6E; }
.legal-card ul, .legal-card ol { padding-inline-start: 1.3em; margin: 0.4em 0 0.8em; }
.legal-card a { color: #6A2BD9; font-weight: 700; }
.legal-updated { color: #6B4E8C; font-weight: 700; }
.legal-en {
  direction: ltr;
  text-align: left;
  margin-top: 16px;
}
.legal-en h2, .legal-en h3 { text-align: left; }
.auth-agree { font-size: 0.9rem; line-height: 1.7; margin: 12px 0 16px; color: #5A3E7A; }
.auth-agree a { color: #6A2BD9; font-weight: 700; }

html.game-play #site-header { display: none !important; }
body.host-body:not(.setup-mode) #site-header { display: none; }
body.setup-mode #site-header {
  display: block;
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
}

/* Light header: visible hamburger and a light mobile drawer */
.site-burger span { background: #2A1155; }
@media (max-width: 820px) {
  .site-nav,
  .start-nav {
    display: flex !important;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100dvh;
    width: min(86vw, 360px);
    background: #fff;
    color: #2A1155;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 22px 28px;
    box-shadow: -12px 0 40px rgba(42, 17, 85, 0.16);
    transform: translateX(105%);
    transition: transform 0.32s ease;
    z-index: 85;
  }
  body.nav-open .site-nav,
  body.nav-open .start-nav {
    display: flex !important;
    transform: translateX(0);
  }
  .site-nav a,
  .start-nav a {
    color: #2A1155 !important;
    font-size: 1.15rem;
    padding: 12px 4px;
  }
  .site-burger { display: inline-block; }
}

/* Readable muted text on light pages (WCAG AA) */
:root { --muted: #4A2A70; }
[data-theme="dark"] { --muted: #4A2A70; }
.pub-lead,
.hint,
.start-sub,
.legal-updated,
.auth-agree,
.step-card p,
.feat-card p,
.life-card p,
.faq-item p,
.legal-card p,
.legal-card li,
.page-hero .pub-lead,
.field label,
.auth-switch {
  color: var(--muted);
}
/* On vivid gradient bands, keep near-white text for contrast */
.cta-band .pub-lead,
.hero-home .pitch,
.hero-home .tagline {
  color: #fff;
}
.admin-nav-link {
  display: inline-flex;
  align-items: center;
  background: #2A1155;
  color: #FFD21F !important;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 0 #1A0A33;
}
.admin-nav-link:hover { color: #FFE25A !important; filter: brightness(1.06); }
@media (max-width: 820px) {
  .admin-nav-link {
    justify-content: center;
    margin-top: 8px;
  }
}
.account-admin-card {
  margin-top: 18px;
  padding: 18px;
  background: #EFE6FF;
  border-radius: 16px;
  text-align: center;
}
.copy-group { margin-bottom: 22px; }
.copy-group > h3 {
  background: #6A2BD9;
  color: #fff;
  border-radius: 999px;
  display: inline-block;
  padding: 4px 14px;
  margin: 0 0 12px;
}
.copy-field { margin-bottom: 14px; }
.copy-field label { display: block; font-weight: 800; color: #2A1155; margin-bottom: 4px; }
.copy-field input, .copy-field textarea {
  width: 100%;
  border: 1px solid rgba(42,17,85,0.16);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #2A1155;
  font: inherit;
}
.copy-field textarea { min-height: 5em; resize: vertical; }
.copy-field.html textarea { min-height: 16em; font-family: ui-monospace, monospace; font-size: 0.88rem; }
.copy-field .copy-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.copy-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }


/* Reserved question actions: always visible, never clipped under Safari toolbars */
.q-actions {
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  display: block;
  height: clamp(38px, 7.2vh, 52px);
  margin-top: -18px;
  margin-bottom: 4px;
  pointer-events: none;
}
.q-act {
  pointer-events: auto;
  position: absolute;
  bottom: 6px;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: clamp(0.9rem, 2.5vh, 1.15rem);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.28);
  line-height: 1.2;
  white-space: nowrap;
}
.q-btn-answer, .q-btn-who, .q-btn-back-ans {
  left: 16px;
  right: auto;
  background: #FFD21F;
  color: #2A1155;
}
.q-btn-cat, .q-btn-back-q {
  right: 16px;
  left: auto;
  background: #FF2E7E;
  color: #fff;
}
.q-btn-cat { cursor: default; }
.q-btn-zoom {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  background: #2A1155;
  color: #fff;
}
@media (max-height: 400px) {
  .game-top { height: 36px; }
  .question-stage { padding: 4px 6px 4px; gap: 6px; }
  .q-frame { margin-top: 14px; border-width: 4px; }
  .q-actions { height: 42px; margin-top: -16px; margin-bottom: 2px; }
  .q-act { padding: 7px 14px; font-size: 0.95rem; bottom: 4px; }
  .q-state { padding: 10px 12px; }
  .q-title, .q-text-main { font-size: clamp(1rem, 5.2vh, 1.65rem); }
  .q-timer { padding: 2px 8px; }
  .q-timer button { width: 24px; height: 24px; }
}
@media (max-height: 360px) {
  .game-top { height: 32px; }
  .q-actions { height: 40px; }
  .side-mark { display: none; }
  .q-points { padding: 3px 10px; font-size: 0.78rem; }
}

/* -------- ألعابي library -------- */
.mygames-body { background: #F6F1FF; }
.mygames-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.mygames-title {
  text-align: center;
  font-family: 'Baloo Bhaijaan 2', 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  color: #2A1155;
  margin: 8px 0 28px;
}
.mygames-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}
.mygames-search {
  width: 100%;
  border: 0;
  background: #efe6ff;
  color: #2A1155;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-size: 1rem;
}
.mygames-search::placeholder { color: #6B4E8C; }
.mygames-buy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: linear-gradient(135deg, #FF2E7E, #FF6B9D);
  color: #fff;
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(255, 46, 126, 0.28);
}
.mygames-buy:hover { filter: brightness(1.06); }
.mygames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  padding-top: 18px;
}
.mg-card {
  background: #fff;
  border-radius: 22px;
  overflow: visible;
  box-shadow: 0 14px 36px rgba(42, 17, 85, 0.12);
}
.mg-head {
  position: relative;
  background: linear-gradient(160deg, #7C5CBF 0%, #FF2E7E 58%, #FFD21F 130%);
  color: #fff;
  padding: 44px 20px 22px;
  border-radius: 22px 22px 0 0;
  text-align: center;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.mg-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -45%);
  background: #FFE25A;
  color: #2A1155;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 4px 12px rgba(42, 17, 85, 0.18);
  white-space: nowrap;
}
.mg-name {
  margin: 8px 0 0;
  font-size: 1.55rem;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(42, 17, 85, 0.15);
}
.mg-play {
  border: 0;
  background: #fff;
  color: #7C1B4A;
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  border-radius: 999px;
  padding: 10px 46px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(42, 17, 85, 0.16);
}
.mg-play:hover { transform: translateY(-1px); }
.mg-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border-radius: 0 0 22px 22px;
  overflow: hidden;
}
.mg-cover {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #efe6ff;
}
.mg-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mg-ribbon {
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  background: #FF2E7E;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  text-align: center;
  padding: 5px 4px 6px;
  line-height: 1.2;
}
.mygames-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.resume-back {
  position: fixed;
  inset: 0;
  background: rgba(42, 17, 85, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}
.resume-back[hidden] { display: none; }
.resume-card {
  position: relative;
  width: min(520px, 100%);
  background: #fff;
  color: #2A1155;
  border-radius: 22px;
  padding: 28px 28px 24px;
  box-shadow: 0 20px 50px rgba(42, 17, 85, 0.25);
  text-align: right;
}
.resume-card h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
  padding-left: 36px;
}
.resume-card p {
  margin: 0 0 22px;
  color: var(--muted, #4A2A70);
  line-height: 1.7;
}
.resume-x {
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  border: 0;
  background: transparent;
  color: #2A1155;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  height: 36px;
}
.resume-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.resume-restart {
  background: #2A1155;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 26px;
  font-weight: 800;
}
.resume-continue {
  background: #fff;
  color: #2A1155;
  border: 1.5px solid #d7c6ef;
  border-radius: 999px;
  padding: 10px 26px;
  font-weight: 800;
}
@media (max-width: 760px) {
  .mygames-toolbar { grid-template-columns: 1fr; }
  .mygames-buy { justify-content: center; }
}

/* Admin site-copy editor */
.copy-group { margin-bottom: 28px; }
.copy-group h3 { margin: 0 0 12px; color: #2A1155; }
.copy-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, #eadff8);
}
.copy-row label { font-weight: 600; color: #2A1155; padding-top: 8px; }
.copy-row textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font: inherit;
}
.copy-row.is-overridden label::after {
  content: ' معدّل';
  color: #FF2E7E;
  font-size: 0.78rem;
  font-weight: 700;
}
.copy-row-actions { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 720px) {
  .copy-row { grid-template-columns: 1fr; }
}

/* Phase 0: in-game toasts sit under the top bar so they never cover team scores. */
html.game-play .toast {
  bottom: auto;
  top: 56px;
}

/* Phase 0: header fits one row on phone landscape / small laptops. */
.site-nav a,
.start-nav a { white-space: nowrap; }
@media (max-width: 1100px) {
  .start-user-name { display: none; }
}
/* The nav already shows «لوحة المطور» when it is inline; keep one copy. */
@media (min-width: 821px) {
  .start-header-tools .admin-nav-link { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .start-header-tools { flex-wrap: nowrap; gap: 8px; }
  .start-credit span { display: none; }
}

/* Phase 1 — «حقوق الصور» page */
.credits-ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.credits-ul li { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(122, 77, 224, .06); }
.credits-ul img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.credits-ul small { opacity: .8; word-break: break-word; }
.credits-ul a { word-break: break-all; }
.media-credit { display: block; font-size: 11px; line-height: 1.3; opacity: .7; margin-top: 4px; text-align: center; direction: ltr; }

/* Phase 1 — lifeline help bubble (one at a time, 150ms fade) */
.life-tip {
  position: fixed; z-index: 400; max-width: min(280px, calc(100vw - 16px));
  background: #fff; color: #2A1155; border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(42, 17, 85, .28); border: 1px solid rgba(122, 77, 224, .25);
  opacity: 0; transform: scale(.96); transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: auto; text-align: right; direction: rtl;
}
.life-tip.show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .life-tip { transition: none; transform: none; } }
.life-tip-arrow { position: absolute; width: 12px; height: 12px; background: inherit; border: inherit; transform: rotate(45deg); }
.life-tip[data-side="top"] .life-tip-arrow { bottom: -7px; margin-left: -6px; border-top: 0; border-left: 0; }
.life-tip[data-side="bottom"] .life-tip-arrow { top: -7px; margin-left: -6px; border-bottom: 0; border-right: 0; }
.life-tip[data-side="left"] .life-tip-arrow { right: -7px; margin-top: -6px; border-bottom: 0; border-left: 0; }
.life-tip[data-side="right"] .life-tip-arrow { left: -7px; margin-top: -6px; border-top: 0; border-right: 0; }
.life-tip-name { display: block; font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.life-tip-text { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.life-tip-why { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #B4235A; }
.life-tip-actions { display: flex; gap: 8px; }
.life-tip-actions button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.life-tip-use { background: #7A4DE0; color: #fff; }
.life-tip-cancel { background: rgba(122, 77, 224, .1); color: #2A1155; }
html[data-theme="dark"] .life-tip { background: #241a3d; color: #f3eeff; border-color: rgba(255, 255, 255, .15); }
html[data-theme="dark"] .life-tip-cancel { background: rgba(255, 255, 255, .1); color: #f3eeff; }
html[data-theme="dark"] .life-tip-why { color: #ff8fb8; }
html.tv-mode .life-tip, .life-tip.tv { max-width: 420px; padding: 16px 20px; border-radius: 18px; }
@media (min-width: 1600px) {
  .life-tip { max-width: 420px; padding: 16px 20px; border-radius: 18px; }
  .life-tip-name { font-size: 22px; }
  .life-tip-text { font-size: 19px; }
  .life-tip-why { font-size: 17px; }
  .life-tip-actions button { min-height: 52px; font-size: 19px; padding: 0 22px; }
}
html.tv-mode .life-tip-name { font-size: 22px; }
html.tv-mode .life-tip-text { font-size: 19px; }
html.tv-mode .life-tip-actions button { min-height: 52px; font-size: 19px; }
.life-ico.is-armed { outline: 2px solid #FFD21F; outline-offset: 1px; }
button.life-ico { cursor: pointer; }
.linklike { background: none; border: 0; padding: 0; color: #B4235A; font: inherit; text-decoration: underline; cursor: pointer; }

/* Phase 2 — game modes, lobby, inline answer flow */
.play-modes { margin: 0 0 24px; }
.play-modes-title { margin: 0 0 8px; font-size: 18px; }
.play-mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.play-mode { text-align: right; padding: 16px; border-radius: 16px; border: 2px solid rgba(122, 77, 224, .25); background: #fff; color: #2A1155; font: inherit; cursor: pointer; display: grid; gap: 4px; }
.play-mode strong { font-size: 20px; }
.play-mode span { font-size: 14px; opacity: .8; }
.play-mode.on { border-color: #7A4DE0; box-shadow: 0 0 0 3px rgba(122, 77, 224, .18); }
.play-sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
html[data-theme="dark"] .play-mode { background: #221A38; color: #F1EBFF; }
@media (max-width: 560px) { .play-mode-row { grid-template-columns: 1fr; } }
.lobby { text-align: center; }
.lobby-grid { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: 24px; align-items: start; text-align: right; margin: 16px 0; }
.lobby-qr { background: #fff; border-radius: 22px; padding: 16px; box-shadow: 0 2px 8px rgba(42, 17, 85, .08); }
.lobby-qr img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.lobby-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.lobby-team { display: grid; gap: 4px; padding: 12px 16px; border-radius: 14px; background: var(--team, #FFD21F); color: var(--team-ink, #2A1155); }
.lobby-player { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; background: rgba(122, 77, 224, .08); font-weight: 700; }
.lobby-dot { width: 10px; height: 10px; border-radius: 50%; background: #19C3B1; }
.lobby-actions { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }
.lobby-actions .start-go[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 700px) { .lobby-grid { grid-template-columns: 1fr; } .lobby-qr { max-width: 280px; margin: 0 auto; } }
html.tv-mode .lobby-grid, .lobby-grid { font-size: inherit; }
@media (min-width: 1600px) { .lobby-grid { grid-template-columns: 480px 1fr; } .lobby h2 { font-size: 40px; } .lobby-team, .lobby-player { font-size: 24px; } }
.q-who-inline { margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.q-state[data-step="answer"] .q-none-btn { margin-top: 12px; }
.q-who-btn.is-buzz { outline: 3px solid #fff; outline-offset: 2px; }
.team-choice-big { display: grid; gap: 12px; }
.team-choice-big .btn { min-height: 64px; font-size: 22px; }
.play-scan h2 { margin: 0 0 8px; }
/* Classic mode on one device: bigger type and contrast for the room */
html.game-play .q-text-main { font-size: clamp(22px, 4.2vw, 64px); line-height: 1.35; }
html.game-play .q-title { font-size: clamp(26px, 4.8vw, 72px); }
