:root {
  /* v2.0 iOS Native Light App Palette */
  --bg: #ffffff;
  --bg-subtle: #f7f9fb;
  --bg-surface: #ecf0f3;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: #dce2e6;
  --border-strong: #00142f;
  --text: #00142f;
  --text-muted: #6a7280;
  --brand: #ff0030;
  --imposter: #ff0030;
  --imposter-dark: #c80025;
  --crew: #1f7a36;
  --crew-bg: #e7faea;
  --accent: #007cff;
  --accent-soft: rgba(0, 124, 255, 0.12);
  --warning: #b45309;
  --warning-bg: #fff3e0;
  --cta-bg: #000000;
  --cta-text: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 20, 47, 0.06);
  --max-w: 1040px;
  --app-w: 490px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-subtle: #111827;
  --bg-surface: #1e293b;
  --bg-elevated: #111827;
  --bg-card: #151e30;
  --border: rgba(148, 163, 184, 0.22);
  --border-strong: #e2e8f0;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --crew: #34d399;
  --crew-bg: rgba(16, 185, 129, 0.18);
  --warning: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.18);
  --cta-bg: #ffffff;
  --cta-text: #00142f;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 17, 32, 0.9);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.72rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.brand span em {
  font-style: normal;
  color: var(--brand);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  transition: background 0.16s ease, color 0.16s ease;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--bg-surface);
  text-decoration: none;
}

.main-nav a.active {
  color: #ffffff;
  background: var(--brand);
  text-decoration: none;
}

.theme-btn,
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.theme-btn:active,
.menu-btn:active {
  transform: scale(0.95);
}

.menu-btn {
  display: none;
}

/* Main Container */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.15rem 1rem 3.5rem;
}

/* Focused Mobile-First App Shell */
.app-stage-wrap {
  max-width: var(--app-w);
  margin: 0 auto 2.5rem;
}

.game-shell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.15rem;
  margin-bottom: 2.25rem;
}

.game-shell.app-shell-v2 {
  max-width: var(--app-w);
  margin: 0 auto 2.25rem;
  padding: 1rem;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--bg);
}

/* Top Brand Banner (imposter.app inspired red hero banner) */
.app-brand-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--brand);
  color: #ffffff;
  border-radius: 18px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.9rem;
}

.app-brand-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.app-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-brand-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #ffffff;
}

.app-brand-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.banner-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.22);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease;
}

.banner-icon-btn:active {
  transform: scale(0.94);
}

/* Mode Selector Dual Cards */
.app-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.app-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.95rem 0.9rem;
  border-radius: 18px;
  background: var(--bg-surface);
  border: 1.5px solid transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.app-mode-card:active {
  transform: scale(0.98);
}

.app-mode-card.selected {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.app-mode-icon {
  font-size: 1.45rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.app-mode-card strong {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.app-mode-card small {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.mode-check {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-mode-card.selected .mode-check {
  opacity: 1;
  transform: scale(1);
}

/* Compact Solo vs AI Bar */
.app-solo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.72rem 0.95rem;
  margin-bottom: 0.9rem;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1.5px solid transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.app-solo-bar:active {
  transform: scale(0.98);
}

.app-solo-bar.selected {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.app-solo-bar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-solo-bar strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
}

.app-solo-bar small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.solo-check-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.app-solo-bar.selected .solo-check-pill {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* iOS Settings Grouped List */
.ios-group {
  background: var(--bg-surface);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 0.9rem;
}

.ios-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  min-height: 54px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  width: 100%;
  border-left: none;
  border-right: none;
  border-top: none;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}

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

.ios-row.clickable {
  cursor: pointer;
  transition: background 0.12s ease;
}

.ios-row.clickable:active {
  background: rgba(0, 20, 47, 0.05);
}

.ios-row-label strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.ios-row-label small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ios-row-right {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
}

.ios-chevron {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Stepper & iOS Switch */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.stepper button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.stepper button:active {
  transform: scale(0.92);
}

.stepper span {
  min-width: 24px;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
}

.toggle {
  position: relative;
  width: 50px;
  height: 30px;
  display: inline-block;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

[data-theme="dark"] .toggle-slider {
  background: #334155;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Sub-view Header with Black Circular Back Button */
.subview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.circle-back-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--cta-bg);
  color: var(--cta-text);
  line-height: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 20, 47, 0.14);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.circle-back-btn svg {
  transform: translateX(-1px);
}

.circle-back-btn:active {
  transform: scale(0.93);
}

.subview-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Pill CTA Buttons */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.25rem;
  border-radius: 99px;
  border: 1.5px solid transparent;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pill-btn-black {
  background: var(--cta-bg);
  color: var(--cta-text);
}

.pill-btn-outline {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}

.pill-btn-blue {
  background: var(--accent);
  color: #ffffff;
}

.pill-btn-soft {
  background: var(--bg-surface);
  color: var(--text);
}

.pill-btn-sm {
  width: auto;
  min-height: 36px;
  padding: 0.42rem 0.9rem;
  font-size: 0.84rem;
}

/* Online Multiplayer Lobby & Room Cards */
.online-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.join-code-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-strong);
  border-radius: 20px;
  padding: 0.95rem;
  animation: popSpring 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.code-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.55rem 0;
}

.room-code-input {
  flex: 1;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.32em;
  padding: 0.72rem 0.6rem;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.room-code-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.25rem 0 0.6rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.public-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.room-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.9rem;
  transition: border-color 0.15s ease;
}

.room-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.room-card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.room-emoji-tile {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.avatar-dashed {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.online-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background: var(--crew-bg);
  color: var(--crew);
}

.room-code-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text);
}

.room-card-name {
  font-weight: 800;
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.mini-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.room-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.initial-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
  flex-shrink: 0;
}

.avatar-stack .initial-avatar + .initial-avatar {
  margin-left: -9px;
}

.avatar-overflow {
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.72rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
}

.status-pill.ready {
  background: var(--crew-bg);
  color: var(--crew);
}

.status-pill.waiting {
  background: var(--warning-bg);
  color: var(--warning);
}

.empty-rooms-box {
  background: var(--bg-surface);
  border-radius: 18px;
  padding: 1.35rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Modal with Spring Animation */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 20, 47, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border-radius: 22px;
  padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 20, 47, 0.25);
  animation: popSpring 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popSpring {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

/* Online Room Waiting Lobby */
.room-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  background: var(--bg-surface);
  margin-bottom: 0.85rem;
}

.room-code-big {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.player-roster {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  background: var(--bg-surface);
}

.roster-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.94rem;
}

.roster-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.roster-badge.host {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.roster-badge.ready {
  background: var(--crew-bg);
  color: var(--crew);
  border-color: transparent;
}

.inline-error {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 0, 48, 0.1);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* Waiting Lobby Invite Card & Digit Tiles (imposter.app style) */
.lobby-invite-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.1rem;
  text-align: center;
  margin-bottom: 0.9rem;
}

.digit-tiles {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.65rem 0 0.85rem;
}

.digit-tile {
  width: 44px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1.5px solid transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 0.55rem;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.option-card.selected {
  background: rgba(0, 124, 255, 0.08);
  border-color: var(--accent);
}

.option-card strong {
  display: block;
  font-size: 0.96rem;
  font-weight: 800;
}

.option-card small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.name-preview-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.name-preview-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: transparent;
  flex-shrink: 0;
}

.check-circle.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* Inputs & Selects */
select, input[type="text"], textarea {
  width: 100%;
  background: var(--bg-surface);
  color: var(--text);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 0.65rem 0.82rem;
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

select:focus, input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.cat-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.68rem 0.75rem;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1.5px solid transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.cat-chip.selected {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
}

.player-edit-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.player-edit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Legacy / Secondary Game Pages Compatibility (Question, Ranking, Daily, Generator) */
.hero {
  text-align: center;
  margin-bottom: 1.35rem;
}

.hero-compact {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.85rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 3.8vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0 auto;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.game-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crew);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1.5px solid transparent;
  border-radius: 99px;
  padding: 0.78rem 1.25rem;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--cta-bg);
  color: var(--cta-text);
}

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

.btn-crew {
  background: var(--crew);
  color: #ffffff;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

.btn-lg {
  width: 100%;
  padding: 0.92rem 1.3rem;
  font-size: 1rem;
}

.panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem;
}

.panel-title {
  margin: 0 0 0.85rem;
  font-size: 0.96rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

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

.stepper-label strong {
  display: block;
  font-size: 0.94rem;
}

.stepper-label small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.15rem;
}

.player-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

/* Reveal & 3D Flip Card */
.stage {
  max-width: 460px;
  margin: 0.25rem auto;
  text-align: center;
}

.stage-progress {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.stage h2 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.stage-sub {
  margin: 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.flip-scene {
  perspective: 1000px;
  margin: 0 auto 1.15rem;
  max-width: 360px;
  height: 230px;
}

.flip-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  user-select: none;
}

.flip-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 22px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  box-shadow: 0 14px 32px rgba(0, 20, 47, 0.12);
}

.card-front {
  background: #00142f;
  color: #ffffff;
  border-color: #00142f;
}

.card-front .tap-icon {
  font-size: 2.5rem;
  margin-bottom: 0.45rem;
}

.card-front strong {
  font-size: 1.15rem;
}

.card-front span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 0.25rem;
}

.card-back {
  transform: rotateY(180deg);
  color: #ffffff;
}

.card-back.crew {
  background: linear-gradient(150deg, #15803d, #065f46);
  border-color: #10b981;
}

.card-back.imposter {
  background: linear-gradient(150deg, #ff0030, #991b1b);
  border-color: #ff0030;
}

.role-pill {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  margin-bottom: 0.65rem;
}

.secret-word {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0.15rem 0 0.45rem;
}

.role-hint {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.24);
  padding: 0.42rem 0.8rem;
  border-radius: 10px;
}

/* Clues, Timer, Voting & Results */
.timer-box {
  font-size: 3.1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  margin: 0.65rem 0;
}

.timer-box.urgent {
  color: var(--brand);
}

.first-speaker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.clue-board {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  margin: 0.85rem 0 1rem;
  text-align: left;
}

.clue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: var(--bg-surface);
  animation: fadeSlideIn 0.22s ease both;
}

.clue-player {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.92rem;
}

.clue-word-pill {
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.88rem;
}

.clue-input-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.solo-role-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  margin-bottom: 0.9rem;
  text-align: left;
}

.solo-role-banner.crew {
  background: var(--crew-bg);
  color: var(--crew);
}

.solo-role-banner.imposter {
  background: rgba(255, 0, 48, 0.1);
  color: var(--brand);
}

.vote-grid,
.guess-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0;
}

.vote-btn {
  padding: 0.82rem 0.7rem;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1.5px solid transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}

.vote-btn:active {
  transform: scale(0.97);
}

.vote-btn:hover,
.vote-btn.selected {
  border-color: var(--brand);
  background: rgba(255, 0, 48, 0.08);
}

.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.app-shell-v2 .avatar-badge {
  width: 36px;
  height: 36px;
  color: #ffffff;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 20, 47, 0.14);
}

/* Space Ejection Banner */
.ejection-banner {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 1.65rem 1rem;
  margin: 0.5rem 0 1rem;
  background:
    radial-gradient(2px 2px at 15% 25%, #fff, transparent),
    radial-gradient(2px 2px at 42% 75%, #cbd5e1, transparent),
    radial-gradient(2px 2px at 78% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 68%, #94a3b8, transparent),
    linear-gradient(135deg, #00142f, #0f172a 60%, #1e1b4b);
  color: #ffffff;
  text-align: center;
}

.ejected-floater {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.65rem;
  animation: ejectSpin 3.4s ease-in-out infinite;
}

.ejection-text {
  font-size: 1.18rem;
  font-weight: 900;
}

@keyframes ejectSpin {
  0% { transform: translateX(-16px) rotate(-14deg); }
  50% { transform: translateX(16px) rotate(14deg); }
  100% { transform: translateX(-16px) rotate(-14deg); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  border-radius: 16px;
  padding: 1.15rem;
  background: var(--bg-surface);
  margin: 0.85rem 0 1.15rem;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: var(--bg-surface);
  font-size: 0.86rem;
}

/* Word Generator & Tags */
.generator-result {
  background: var(--crew-bg);
  border: 1.5px solid var(--crew);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.word-tag {
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-surface);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

/* Below-the-fold Arcade Hub & SEO Content */
.hub-section {
  margin-bottom: 2rem;
}

.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.hub-header h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--cta-bg);
  border-color: var(--cta-bg);
  color: var(--cta-text);
}

.arcade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 0.9rem;
}

.arcade-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 172px;
  padding: 1.15rem;
  border-radius: 20px;
  color: #ffffff;
  transition: transform 0.16s ease;
}

.arcade-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
}

.arcade-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.arcade-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.arcade-pill {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: #ffffff;
}

.arcade-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
}

.arcade-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.card-rose { background: linear-gradient(135deg, #ff0030, #f97316); }
.card-indigo { background: linear-gradient(135deg, #007cff, #4f46e5); }
.card-emerald { background: linear-gradient(135deg, #059669, #14b8a6); }
.card-amber { background: linear-gradient(135deg, #d97706, #ef4444); }
.card-violet { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.card-sky { background: linear-gradient(135deg, #0284c7, #2563eb); }
.card-teal { background: linear-gradient(135deg, #0d9488, #22c55e); }
.card-fuchsia { background: linear-gradient(135deg, #c026d3, #f43f5e); }

.content-section {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.65rem;
  margin-bottom: 1.35rem;
}

.content-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
}

.content-section h3 {
  margin: 1.2rem 0 0.4rem;
  font-size: 1.05rem;
}

.content-section p,
.content-section li {
  color: var(--text-muted);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.step-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.faq-list details {
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
}

.faq-list details:last-child {
  border-bottom: none;
}

.faq-list summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-list summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.geo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.geo-table th,
.geo-table td {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.geo-table th {
  background: var(--bg-surface);
  font-weight: 800;
}

.geo-table tr:last-child td {
  border-bottom: none;
}

.edition-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.edition-card {
  display: block;
  padding: 1rem;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.14s ease;
}

.edition-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.edition-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.edition-card span {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 1.8rem 1rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.88rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.hidden {
  display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-inner {
    position: relative;
  }

  .menu-btn {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.8rem 1rem 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(0, 20, 47, 0.12);
    z-index: 50;
  }

  .main-nav.open {
    display: grid;
  }

  .main-nav a {
    padding: 0.62rem 0.7rem;
    border-radius: 12px;
    font-size: 0.9rem;
    text-align: center;
    background: var(--bg-surface);
  }

  .main-nav a.active {
    background: var(--brand);
    color: #ffffff;
  }

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

  .game-shell.app-shell-v2 {
    border: none;
    box-shadow: none;
    padding: 0.25rem 0;
    border-radius: 0;
  }

  .content-section {
    padding: 1.25rem;
  }

  /* Responsive mobile cards for Compare Game Modes table */
  .table-wrap {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .geo-table thead {
    display: none;
  }

  .geo-table,
  .geo-table tbody,
  .geo-table tr,
  .geo-table td {
    display: block;
    width: 100%;
  }

  .geo-table tr {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.65rem;
  }

  .geo-table tr:last-child {
    margin-bottom: 0;
  }

  .geo-table td {
    padding: 0.32rem 0;
    border-bottom: none;
    font-size: 0.88rem;
    color: var(--text-muted);
  }

  .geo-table td:first-child {
    padding: 0 0 0.5rem;
    margin-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text);
  }

  .geo-table td[data-label] {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
  }

  .geo-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text);
    flex-shrink: 0;
  }

  .geo-table td[data-label="How It Plays"] {
    flex-direction: column;
    gap: 0.18rem;
    padding-top: 0.45rem;
  }
}
