/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1e2430;
  --card: rgba(22, 27, 34, 0.9);
  --gold: #d4a017;
  --gold2: #e8c547;
  --gold-dim: rgba(212, 160, 23, 0.18);
  --gold-glow: rgba(212, 160, 23, 0.35);
  --text: #f0e6d3;
  --text2: #a8956e;
  --text3: #5e4e35;
  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --border: rgba(212,160,23,0.18);
  --border2: rgba(212,160,23,0.45);
  --r: 16px;
  --r-sm: 8px;
  --r-lg: 24px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 24px rgba(212,160,23,0.3);
  --trans: 0.28s cubic-bezier(0.4,0,0.2,1);
  --font-h: 'Georgia', 'Times New Roman', serif;
  --font-b: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

/* ─── Reset ────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { font-size:16px; scroll-behavior:smooth; height:100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  min-height: 100%;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img, svg { display: block; max-width: 100%; }

/* ─── Starfield BG ─────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(212,160,23,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 40%, rgba(240,230,211,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 8%,  rgba(212,160,23,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 55%, rgba(240,230,211,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 25%, rgba(212,160,23,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 70%, rgba(240,230,211,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 12%, rgba(212,160,23,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 5%  80%, rgba(240,230,211,0.25) 0%,transparent 100%),
    radial-gradient(1px 1px at 60% 90%, rgba(212,160,23,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 65%, rgba(240,230,211,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 45%, rgba(212,160,23,0.25) 0%,transparent 100%),
    radial-gradient(1px 1px at 18% 92%, rgba(240,230,211,0.3) 0%, transparent 100%),
    radial-gradient(80px 80px at 15% 30%, rgba(212,160,23,0.04) 0%, transparent 60%),
    radial-gradient(120px 120px at 80% 15%, rgba(167,139,250,0.04) 0%, transparent 60%),
    radial-gradient(100px 100px at 50% 80%, rgba(212,160,23,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: twinkle 8s ease-in-out infinite alternate;
}
@keyframes twinkle {
  0%   { opacity: 0.6; }
  50%  { opacity: 1; }
  100% { opacity: 0.7; }
}

/* ─── Typography ───────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-h); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 4.5vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 3.5vw, 1.4rem); }
h4 { font-size: 1rem; }
.text-gold    { color: var(--gold); }
.text-gold2   { color: var(--gold2); }
.text-muted   { color: var(--text2); }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.85rem; }
.text-lg      { font-size: 1.15rem; }
.text-xl      { font-size: 1.4rem; }
.font-serif   { font-family: var(--font-h); }
.font-bold    { font-weight: 700; }

/* ─── Layout ────────────────────────────────────────────── */
.container   { max-width: 480px; margin: 0 auto; padding: 0 1rem; position: relative; z-index: 1; }
.page        { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.p-2  { padding: 1rem; }
.p-3  { padding: 1.5rem; }
.w-full { width: 100%; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,160,23,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.card-glow { box-shadow: var(--shadow-gold); border-color: var(--border2); }
.card-elevated { box-shadow: var(--shadow); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-weight: 600;
  min-height: 48px;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity 0.15s;
}
.btn:active::after { opacity: 0.1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b8880d 100%);
  color: #0d1117;
  box-shadow: 0 4px 16px rgba(212,160,23,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(212,160,23,0.5); filter: brightness(1.08); }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--gold-dim); border-color: var(--gold); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--gold-dim); }

.btn-danger {
  background: rgba(248,113,113,0.15);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); }

.btn-success {
  background: rgba(74,222,128,0.15);
  color: var(--green);
  border: 1px solid rgba(74,222,128,0.3);
}
.btn-success:hover { background: rgba(74,222,128,0.25); }

.btn-sm { padding: 0.55rem 1rem; font-size: 0.875rem; min-height: 36px; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; min-height: 56px; border-radius: var(--r); }
.btn-icon { width: 48px; height: 48px; padding: 0; border-radius: 50%; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ─── Inputs ─────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 1rem;
  transition: var(--trans);
  outline: none;
  min-height: 48px;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.input::placeholder { color: var(--text3); }
.input-label { display: block; font-size: 0.8rem; color: var(--text2); margin-bottom: 0.35rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.input-group { display: flex; flex-direction: column; gap: 0.35rem; }

textarea.input { resize: vertical; min-height: 100px; }
select.input { cursor: pointer; }

/* ─── Header ─────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--safe-top) + 0.75rem) 1rem 0.75rem;
}
.app-header-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-title {
  font-family: var(--font-h);
  font-size: 1.25rem;
  color: var(--gold);
  flex: 1;
  text-align: center;
}
.back-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text2);
  transition: var(--trans);
  flex-shrink: 0;
}
.back-btn:hover { background: var(--gold-dim); color: var(--gold); }
.header-action {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text2);
  transition: var(--trans);
  flex-shrink: 0;
}
.header-action:hover { background: var(--gold-dim); color: var(--gold); }

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-gold    { background: var(--gold-dim); color: var(--gold2); border: 1px solid var(--border2); }
.badge-green   { background: rgba(74,222,128,0.12); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.badge-red     { background: rgba(248,113,113,0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.badge-blue    { background: rgba(96,165,250,0.12); color: var(--blue); border: 1px solid rgba(96,165,250,0.3); }
.badge-purple  { background: rgba(167,139,250,0.12); color: var(--purple); border: 1px solid rgba(167,139,250,0.3); }

/* ─── Divider ────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text3);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Modal / Overlay ────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.overlay.center { align-items: center; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bot));
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal.center-modal {
  border-radius: var(--r-lg);
  padding: 1.5rem 1.25rem;
  max-height: 85vh;
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 0 auto 1.25rem;
}

/* ─── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 80px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  width: calc(100% - 2rem);
  max-width: 360px;
}
.toast {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  box-shadow: var(--shadow);
}
.toast.success { border-color: rgba(74,222,128,0.4); color: var(--green); }
.toast.error   { border-color: rgba(248,113,113,0.4); color: var(--red); }

/* ─── Player Chip ────────────────────────────────────────── */
.player-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: var(--trans);
}
.player-chip.active { border-color: var(--gold); background: var(--gold-dim); }
.player-chip.eliminated { opacity: 0.4; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, #8b5e0a 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  color: #0d1117;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }

/* ─── Phase Banner ───────────────────────────────────────── */
.phase-banner {
  text-align: center;
  padding: 0.6rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}
.phase-day   { background: rgba(212,160,23,0.12); color: var(--gold2); border-color: var(--border2); }
.phase-night { background: rgba(96,165,250,0.1); color: var(--blue); border-color: rgba(96,165,250,0.3); }
.phase-vote  { background: rgba(248,113,113,0.1); color: var(--red); border-color: rgba(248,113,113,0.3); }

/* ─── Timer ──────────────────────────────────────────────── */
.timer-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .timer-text {
  position: absolute;
  font-family: var(--font-h);
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
}
.timer-ring.urgent .timer-text { color: var(--red); }

/* ─── Flip Card ──────────────────────────────────────────── */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
  -webkit-perspective: 1000px;
}
.flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
  will-change: transform;
  min-height: 280px;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r);
  overflow: hidden;
}
.flip-back { position: absolute; inset: 0; transform: rotateY(180deg); }

/* ─── Shimmer ─────────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212,160,23,0.15) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ─── Glow Pulse ─────────────────────────────────────────── */
.glow-pulse { animation: glowPulse 2.5s ease-in-out infinite; }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 12px rgba(212,160,23,0.2); }
  50%      { box-shadow: 0 0 32px rgba(212,160,23,0.5); }
}

/* ─── Keyframes ──────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity:0; }            to { opacity:1; } }
@keyframes fadeOut   { from { opacity:1; }            to { opacity:0; } }
@keyframes slideUp   { from { transform:translateY(40px); opacity:0; } to { transform:translateY(0); opacity:1; } }
@keyframes slideDown { from { transform:translateY(-20px); opacity:0; } to { transform:translateY(0); opacity:1; } }
@keyframes slideInR  { from { transform:translateX(60px); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes slideInL  { from { transform:translateX(-60px); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes popIn     { from { transform:scale(0.85); opacity:0; } to { transform:scale(1); opacity:1; } }
@keyframes bounce    { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-8px); } }
@keyframes shake     { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-6px); } 75% { transform:translateX(6px); } }
@keyframes spin      { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
@keyframes float     { 0%,100% { transform:translateY(0) rotate(-2deg); } 50% { transform:translateY(-10px) rotate(2deg); } }
@keyframes confettiFall {
  from { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  to   { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.animate-fade-in  { animation: fadeIn 0.4s ease; }
.animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1); }
.animate-pop-in   { animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.animate-bounce   { animation: bounce 1.8s ease-in-out infinite; }
.animate-float    { animation: float 4s ease-in-out infinite; }
.animate-spin     { animation: spin 1s linear infinite; }

/* ─── Section stagger ────────────────────────────────────── */
.stagger > * { animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1) backwards; }
.stagger > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger > *:nth-child(2)  { animation-delay: 0.12s; }
.stagger > *:nth-child(3)  { animation-delay: 0.19s; }
.stagger > *:nth-child(4)  { animation-delay: 0.26s; }
.stagger > *:nth-child(5)  { animation-delay: 0.33s; }
.stagger > *:nth-child(6)  { animation-delay: 0.40s; }
.stagger > *:nth-child(7)  { animation-delay: 0.47s; }
.stagger > *:nth-child(8)  { animation-delay: 0.54s; }
.stagger > *:nth-child(9)  { animation-delay: 0.61s; }
.stagger > *:nth-child(10) { animation-delay: 0.68s; }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ─── Utility ────────────────────────────────────────────── */
.hidden   { display: none !important; }
.visible  { display: flex !important; }
.invisible{ visibility: hidden; }
.opacity-0 { opacity: 0; }
.rounded-full { border-radius: 999px; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.inset-0  { inset: 0; }
.z-10     { z-index: 10; }
.z-50     { z-index: 50; }
.pointer-none { pointer-events: none; }
.select-none  { user-select: none; -webkit-user-select: none; }

/* ─── Confetti ────────────────────────────────────────────── */
.confetti-piece {
  position: fixed;
  width: 8px; height: 8px;
  pointer-events: none;
  z-index: 9999;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

/* ─── Progress bar ────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ─── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--bg3);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 3px;
}
.tab {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
  transition: var(--trans);
  cursor: pointer;
  border: none;
  background: none;
}
.tab.active {
  background: var(--gold-dim);
  color: var(--gold2);
  border: 1px solid var(--border2);
}

/* ─── Toggle ─────────────────────────────────────────────── */
.toggle {
  position: relative;
  width: 48px; height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: var(--trans);
  cursor: pointer;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 2px; top: 2px;
  border-radius: 50%;
  background: var(--text2);
  transition: var(--trans);
}
.toggle input:checked + .toggle-slider { background: var(--gold-dim); border-color: var(--gold); }
.toggle input:checked + .toggle-slider::after { transform: translateX(22px); background: var(--gold); }

/* ─── Jeopardy Grid ──────────────────────────────────────── */
.jeopardy-board {
  display: grid;
  gap: 6px;
  width: 100%;
}
.jeopardy-cell {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
  font-family: var(--font-h);
  padding: 0.4rem;
  min-height: 52px;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
}
.jeopardy-cell:active { transform: scale(0.96); }
.jeopardy-cell.header {
  background: linear-gradient(135deg, rgba(212,160,23,0.2), rgba(212,160,23,0.08));
  border-color: var(--border2);
  color: var(--gold2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: default;
  min-height: 44px;
}
.jeopardy-cell.value {
  color: var(--gold2);
  font-size: 1.1rem;
  font-weight: 700;
}
.jeopardy-cell.answered {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.jeopardy-cell:not(.header):not(.answered):hover {
  border-color: var(--gold);
  background: var(--gold-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,160,23,0.2);
}

/* ─── Role Card ──────────────────────────────────────────── */
.role-card-front {
  background: linear-gradient(145deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border);
  border-radius: var(--r);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
}
.role-card-back {
  background: linear-gradient(145deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border2);
  border-radius: var(--r);
  min-height: 280px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-gold);
}

/* ─── Vote button ────────────────────────────────────────── */
.vote-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
}
.vote-btn:hover   { border-color: var(--border2); background: var(--gold-dim); }
.vote-btn.selected{ border-color: var(--gold); background: var(--gold-dim); box-shadow: 0 0 0 1px var(--gold); }
.vote-btn .vote-count {
  margin-left: auto;
  background: var(--gold-dim);
  color: var(--gold2);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ─── Word reveal card ────────────────────────────────────── */
.word-reveal {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 2px solid var(--gold);
  border-radius: var(--r-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-gold);
}
.word-text {
  font-family: var(--font-h);
  font-size: clamp(1.6rem, 8vw, 2.8rem);
  color: var(--gold2);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 24px rgba(212,160,23,0.4);
}

/* ─── Difficulty selector ─────────────────────────────────── */
.diff-btn {
  flex: 1;
  padding: 0.85rem 0.5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
  font-size: 0.9rem;
  font-weight: 600;
}
.diff-btn:hover  { border-color: var(--border2); color: var(--text); }
.diff-btn.active { border-color: var(--gold); background: var(--gold-dim); color: var(--gold2); box-shadow: 0 0 12px rgba(212,160,23,0.2); }
.diff-btn.easy   .diff-icon { color: var(--green); }
.diff-btn.medium .diff-icon { color: var(--gold); }
.diff-btn.hard   .diff-icon { color: var(--red); }
.diff-icon { font-size: 1.4rem; margin-bottom: 0.25rem; display: block; }

/* ─── Home hero ───────────────────────────────────────────── */
.hero {
  padding: 2.5rem 1rem 1.5rem;
  text-align: center;
  position: relative;
}
.hero-icon {
  font-size: 3.5rem;
  display: block;
  margin: 0 auto 1rem;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(212,160,23,0.4));
}
.hero-title {
  font-family: var(--font-h);
  font-size: clamp(2rem, 8vw, 3rem);
  background: linear-gradient(135deg, var(--gold2) 0%, var(--gold) 60%, #8b5e0a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
}
.hero-sub {
  color: var(--text2);
  font-size: 0.95rem;
}

/* ─── Game card ───────────────────────────────────────────── */
.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,160,23,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.game-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(212,160,23,0.1);
}
.game-card:active { transform: scale(0.98); }
.game-card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 0 8px rgba(212,160,23,0.3));
}
.game-card-title {
  font-family: var(--font-h);
  font-size: 1.25rem;
  color: var(--gold2);
  margin-bottom: 0.4rem;
}
.game-card-desc {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}
.game-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── Safe area padding ────────────────────────────────────── */
.safe-bottom { padding-bottom: calc(1.5rem + var(--safe-bot)); }

/* ─── Loading ─────────────────────────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 9000;
  transition: opacity 0.4s ease;
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Admin specific ──────────────────────────────────────── */
.admin-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.admin-section-header {
  padding: 1rem 1.25rem;
  background: rgba(212,160,23,0.06);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.admin-section-body { padding: 1.25rem; }
.admin-word-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text2);
  transition: var(--trans);
}
.admin-word-tag:hover { border-color: var(--red); color: var(--red); }
.admin-word-tag .remove { cursor: pointer; font-size: 1rem; line-height: 1; }
.words-container { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

/* ─── Score board ─────────────────────────────────────────── */
.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: var(--trans);
}
.score-row.leader { border-color: var(--border2); background: var(--gold-dim); }
.score-value {
  font-family: var(--font-h);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold2);
}

/* ─── Night overlay ───────────────────────────────────────── */
.night-screen {
  background: linear-gradient(160deg, #030508 0%, #050a14 50%, #060a18 100%);
  border: 1px solid rgba(96,165,250,0.2);
}
.night-screen .phase-banner { animation: glowPulse 3s ease-in-out infinite; }
