/* ==========================================================================
   JewishOrNot.net — Elevated Dark Glass Design System
   ========================================================================== */

:root {
  --bg-base: #060913;
  --bg-elevated: rgba(13, 20, 38, 0.76);
  --bg-card-inner: rgba(7, 11, 22, 0.68);
  --bg-hover: rgba(30, 41, 68, 0.72);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(56, 189, 248, 0.45);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8b9bb8;
  --text-faint: #5b6b88;

  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --indigo-600: #4f46e5;
  --cyan-300: #67e8f9;
  --cyan-400: #22d3ee;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --amber-400: #fbbf24;
  --orange-400: #fb923c;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --shadow-card: 0 24px 60px -15px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
  --shadow-glow-blue: 0 14px 36px -10px rgba(37, 99, 235, 0.55);
  --shadow-glow-emerald: 0 12px 30px -8px rgba(16, 185, 129, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

::selection {
  background: rgba(37, 99, 235, 0.65);
  color: #ffffff;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Ambient Background
   ========================================================================== */

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 16%, rgba(37, 99, 235, 0.18), transparent 44%),
    radial-gradient(circle at 86% 78%, rgba(79, 70, 229, 0.16), transparent 46%),
    radial-gradient(circle at 52% 0%, rgba(34, 211, 238, 0.08), transparent 42%),
    #060913;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 35%, rgba(0, 0, 0, 0.7), transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, rgba(0, 0, 0, 0.7), transparent 78%);
}

/* ==========================================================================
   Glass Surface Utility
   ========================================================================== */

.glass-panel {
  background: linear-gradient(
    165deg,
    rgba(19, 29, 54, 0.84) 0%,
    rgba(11, 17, 34, 0.88) 100%
  );
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  position: relative;
}

.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ==========================================================================
   Header & Live HUD
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: rgba(8, 12, 24, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease;
}

.brand-btn:hover .brand-mark {
  transform: scale(1.06);
  box-shadow: 0 8px 24px -4px rgba(56, 189, 248, 0.45);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #22d3ee 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 6px 18px -4px rgba(37, 99, 235, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.1;
}

.brand-tld {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cyan-300);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  padding: 2px 6px;
  border-radius: 6px;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.hud-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 16, 32, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 5px 8px;
}

.hud-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(30, 41, 68, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.hud-cat-btn:hover {
  background: rgba(51, 65, 98, 0.9);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.35);
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(5, 9, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hud-pill--score svg { color: var(--amber-400); }
.hud-pill--streak svg { color: var(--orange-400); }
.hud-pill--streak span { color: var(--orange-400); }
.hud-pill--accuracy svg { color: var(--cyan-400); }
.hud-pill--accuracy span { color: var(--cyan-300); }

/* ==========================================================================
   Main Container
   ========================================================================== */

.main-stage {
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.view-animate {
  animation: viewIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   1. Landing & Category Hub
   ========================================================================== */

.hub-card {
  width: 100%;
  max-width: 680px;
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  text-align: center;
  overflow: hidden;
}

.hub-emblem {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 16px 36px -8px rgba(37, 99, 235, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hub-heading {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hub-heading span {
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-subtitle {
  margin: 10px auto 0;
  max-width: 470px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* Personal Stats Strip (shown after 1st round) */
.personal-strip {
  margin-top: 20px;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(7, 12, 25, 0.72);
  border: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.personal-strip strong {
  color: var(--text-primary);
  font-weight: 700;
}

.personal-strip .sep {
  opacity: 0.3;
}

.section-label {
  display: block;
  margin-top: 26px;
  margin-bottom: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  text-align: left;
}

.cat-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 16px;
  background: rgba(9, 14, 28, 0.72);
  border: 1px solid var(--border-subtle);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
}

.cat-tile:hover {
  transform: translateY(-2px);
  background: rgba(18, 28, 52, 0.85);
  border-color: rgba(148, 163, 184, 0.25);
}

.cat-tile.is-selected {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(6, 182, 212, 0.12));
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 12px 28px -10px rgba(37, 99, 235, 0.45), 0 0 0 1px rgba(56, 189, 248, 0.2) inset;
}

.cat-tile-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(6, 10, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-400);
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.cat-tile.is-selected .cat-icon {
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.cat-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}

.cat-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.cat-best-pill {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 1px 6px;
  border-radius: 999px;
}

.cat-check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #060913;
  transition: all 0.18s ease;
}

.cat-tile.is-selected .cat-check {
  background: var(--cyan-400);
  border-color: var(--cyan-400);
}

/* Hub Footer Controls */
.hub-controls {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hub-options {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-500);
  cursor: pointer;
}

.deck-size-group {
  display: inline-flex;
  align-items: center;
  background: rgba(6, 10, 22, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.deck-size-btn {
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.deck-size-btn.is-active {
  background: rgba(37, 99, 235, 0.35);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 30px;
  border-radius: 15px;
  background: linear-gradient(95deg, #2563eb 0%, #4f46e5 52%, #06b6d4 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-glow-blue);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px -10px rgba(34, 211, 238, 0.45);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ==========================================================================
   2. Gameplay View & Swipeable Quiz Card
   ========================================================================== */

.game-stage {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.quiz-card {
  border-radius: var(--radius-xl);
  padding: 20px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.quiz-card.state-correct {
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.7), 0 0 36px -12px rgba(16, 185, 129, 0.3);
}

.quiz-card.state-wrong {
  border-color: rgba(251, 113, 133, 0.4);
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.7), 0 0 36px -12px rgba(244, 63, 94, 0.28);
}

.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--cyan-300);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-counter {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(6, 10, 22, 0.75);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 55%, #22d3ee 100%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Portrait Frame with Interactive Swipe Physics */
.portrait-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  max-height: min(390px, 46dvh);
  border-radius: 18px;
  overflow: hidden;
  background: #080d1d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  will-change: transform;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.portrait-stage.is-dragging {
  cursor: grabbing;
  transition: none;
}

.portrait-stage.is-locked {
  cursor: default;
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  -webkit-user-drag: none;
}

.portrait-img.is-loaded {
  opacity: 1;
}

/* Subtle bottom vignette on portrait */
.portrait-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 9, 19, 0.12) 0%,
    transparent 32%,
    transparent 68%,
    rgba(6, 9, 19, 0.55) 100%
  );
}

/* Shimmer loader */
.portrait-shimmer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, #0b1328 25%, #16223e 50%, #0b1328 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2.5px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--cyan-400);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fallback Monogram */
.portrait-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle at 30% 25%, #1e2f5c 0%, #0b1224 72%);
}

.fallback-circle {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.22);
  border: 2px solid rgba(56, 189, 248, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--cyan-300);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.fallback-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Swipe Stamp Overlays */
.swipe-stamp {
  position: absolute;
  top: 22px;
  padding: 7px 14px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 4;
}

.swipe-stamp--jewish {
  left: 18px;
  transform: rotate(-10deg);
  background: rgba(37, 99, 235, 0.82);
  border: 2px solid var(--cyan-300);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.5);
}

.swipe-stamp--not {
  right: 18px;
  transform: rotate(10deg);
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid var(--rose-400);
  color: #fecdd3;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

/* Person Info */
.person-header {
  margin-top: 14px;
  text-align: center;
}

.person-name {
  font-family: var(--font-display);
  font-size: clamp(1.38rem, 3.8vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: #ffffff;
}

.person-role {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Guess Buttons Panel */
.buttons-panel {
  margin-top: 16px;
}

.prompt-caption {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.guess-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.btn-guess {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 13px 12px;
  border-radius: 16px;
  font-family: var(--font-display);
  font-weight: 800;
  transition: transform 0.14s ease, filter 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.btn-guess:hover {
  transform: translateY(-2px);
}

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

.btn-guess--jewish {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #ffffff;
  box-shadow: 0 12px 26px -8px rgba(37, 99, 235, 0.6);
}

.btn-guess--jewish:hover {
  filter: brightness(1.09);
  box-shadow: 0 16px 30px -8px rgba(56, 189, 248, 0.5);
}

.btn-guess--not {
  background: linear-gradient(180deg, rgba(30, 41, 66, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-primary);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.7);
}

.btn-guess--not:hover {
  border-color: rgba(148, 163, 184, 0.42);
  background: linear-gradient(180deg, rgba(41, 55, 86, 0.95) 0%, rgba(22, 32, 56, 0.98) 100%);
}

.btn-guess-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.btn-guess-hint {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  opacity: 0.7;
  letter-spacing: 0.03em;
}

.swipe-tip {
  margin-top: 10px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Reveal State Panel */
.reveal-panel {
  margin-top: 15px;
  animation: revealIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.outcome-box {
  padding: 14px 16px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 12px;
  border: 1px solid transparent;
}

.outcome-box--correct {
  background: rgba(6, 78, 59, 0.36);
  border-color: rgba(52, 211, 153, 0.4);
}

.outcome-box--wrong {
  background: rgba(136, 19, 55, 0.34);
  border-color: rgba(251, 113, 133, 0.4);
}

.outcome-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.outcome-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.outcome-box--correct .outcome-header { color: var(--emerald-400); }
.outcome-box--wrong .outcome-header { color: var(--rose-400); }

.identity-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.identity-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.identity-pill {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.identity-pill--jewish {
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--cyan-300);
}

.identity-pill--not {
  background: rgba(30, 41, 66, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
}

.factual-note {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.wiki-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan-300);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.wiki-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.btn-next {
  width: 100%;
  padding: 13px 20px;
  border-radius: 15px;
  background: linear-gradient(95deg, #059669 0%, #0d9488 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: var(--shadow-glow-emerald);
  border: 1px solid rgba(110, 231, 183, 0.3);
  transition: transform 0.14s ease, filter 0.16s ease;
}

.btn-next:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-next:active {
  transform: scale(0.98);
}

.btn-next-key {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.78;
}

/* ==========================================================================
   3. End-of-Round Summary View
   ========================================================================== */

.summary-card {
  width: 100%;
  max-width: 660px;
  border-radius: var(--radius-xl);
  padding: 30px 26px;
  text-align: center;
}

.summary-emblem {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 14px 32px -8px rgba(37, 99, 235, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.new-best-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: var(--amber-400);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.05rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.summary-sub {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.summary-sub strong {
  color: var(--cyan-300);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.stat-box {
  background: rgba(6, 10, 22, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 13px 10px;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.stat-value--white { color: #ffffff; }
.stat-value--emerald { color: var(--emerald-400); }
.stat-value--cyan { color: var(--cyan-400); }
.stat-value--amber { color: var(--amber-400); }

.breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.breakdown-list {
  max-height: 270px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding-right: 4px;
}

.breakdown-list::-webkit-scrollbar {
  width: 5px;
}

.breakdown-list::-webkit-scrollbar-track {
  background: rgba(6, 10, 22, 0.4);
  border-radius: 999px;
}

.breakdown-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(6, 10, 22, 0.75);
  border: 1px solid var(--border-subtle);
}

.breakdown-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.result-dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-dot--correct {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: var(--emerald-400);
}

.result-dot--wrong {
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: var(--rose-400);
}

.breakdown-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-actions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  transition: transform 0.14s ease, filter 0.16s ease, background 0.16s ease;
}

.btn-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.btn-action:active {
  transform: scale(0.98);
}

.btn-action--share {
  background: linear-gradient(95deg, #059669, #0d9488);
  color: #ffffff;
  border: 1px solid rgba(110, 231, 183, 0.3);
}

.btn-action--replay {
  background: linear-gradient(95deg, #2563eb, #3b82f6);
  color: #ffffff;
  border: 1px solid rgba(147, 197, 253, 0.3);
}

.btn-action--hub {
  background: rgba(30, 41, 66, 0.9);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-action--hub:hover {
  color: #ffffff;
  background: rgba(45, 60, 94, 0.95);
}

/* ==========================================================================
   Footer & Toast
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 10;
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 9, 19, 0.88);
  backdrop-filter: blur(10px);
  padding: 14px 18px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-brand {
  color: var(--text-secondary);
  font-weight: 700;
}

.footer-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: color 0.16s ease;
}

.footer-link-btn:hover {
  color: var(--cyan-300);
}

.toast {
  position: fixed;
  bottom: 58px;
  right: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(29, 78, 216, 0.95);
  border: 1px solid rgba(147, 197, 253, 0.45);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 18px 36px -10px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 640px) {
  .brand-sub {
    display: none;
  }

  .hud-pill--accuracy {
    display: none;
  }

  .header-inner {
    padding: 10px 14px;
  }

  .main-stage {
    padding: 16px 12px 24px;
  }

  .hub-card {
    padding: 24px 18px;
  }

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

  .hub-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-options {
    justify-content: space-between;
  }

  .btn-primary {
    width: 100%;
  }

  .quiz-card {
    padding: 16px;
  }

  .portrait-stage {
    max-height: 360px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-actions {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
