/* ===========================
   Al-Asmaa — Main Stylesheet
   Concept: "Sacred Arcade" — Islamic sacred geometry meets premium mobile game
   =========================== */

/* --- Google Fonts ---
   NOTE: Fonts chargées via <link> dans le HTML pour éviter le @import bloquant.
   Fallback conservé ci-dessous au cas où la feuille est utilisée sans le <link>.
   --- */

/* --- CSS Variables --- */
:root {
  /* Deep, rich dark palette */
  --bg-deep: #050811;
  --bg-primary: #0a0e1a;
  --bg-card: rgba(15, 19, 36, 0.85);
  --bg-card-hover: rgba(22, 28, 52, 0.9);
  --bg-elevated: rgba(25, 32, 60, 0.9);
  --bg-glass: rgba(12, 16, 32, 0.6);

  /* Sacred gold spectrum */
  --gold: #d4a24c;
  --gold-light: #f0cc7a;
  --gold-bright: #ffd866;
  --gold-deep: #a67c2e;
  --gold-glow: rgba(212, 162, 76, 0.4);
  --gold-glow-strong: rgba(212, 162, 76, 0.65);

  /* Accent palette */
  --emerald: #2dd4a0;
  --emerald-glow: rgba(45, 212, 160, 0.35);
  --ruby: #ef4444;
  --ruby-glow: rgba(239, 68, 68, 0.35);
  --sapphire: #60a5fa;
  --sapphire-glow: rgba(96, 165, 250, 0.3);
  --amber-warm: #f59e0b;

  /* Text hierarchy */
  --text-primary: #eae6df;
  --text-secondary: #9a978f;
  --text-muted: #5c5952;
  --text-gold: var(--gold-light);

  /* Borders & surfaces */
  --border-subtle: rgba(212, 162, 76, 0.08);
  --border-card: rgba(212, 162, 76, 0.12);
  --border-active: rgba(212, 162, 76, 0.35);
  --border-glass: rgba(255, 255, 255, 0.06);

  /* Typography */
  --font-arabic: 'Reem Kufi', 'Amiri', serif;
  --font-latin: 'Outfit', sans-serif;
  --font-display: 'Syne', 'Outfit', sans-serif;
  --font-body: 'Outfit', sans-serif;

  /* Motion & shape */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 50px;
  --radius-sm: 10px;

  /* Shadows & depth */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
  --shadow-elevated: 0 8px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 20px rgba(212, 162, 76, 0.2), 0 1px 4px rgba(212, 162, 76, 0.15);
  --shadow-button: 0 2px 12px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  --shadow-inset: inset 0 2px 6px rgba(0,0,0,0.4);

  /* Noise & texture */
  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");

  /* Legacy aliases for JS compatibility */
  --green-dark: #0a0e1a;
  --green-mid: #2dd4a0;
  --green-light: #5eead4;
  --gold-light: #f0cc7a;
  --cream: #eae6df;
  --cream-dark: #9a978f;
  --black: #050811;
  --white: #ffffff;
  --red: #ef4444;
  --red-light: #f87171;
  --orange: #f59e0b;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-heavy: rgba(0, 0, 0, 0.6);
  --border-amber: rgba(212, 162, 76, 0.25);
  --sacred-gold: #ffd866;
  --amber: #d4a24c;
  --amber-light: #f0cc7a;
  --amber-glow: rgba(212, 162, 76, 0.4);
  --coral: #ef4444;
  --coral-glow: rgba(239, 68, 68, 0.3);
  --teal: #2dd4a0;
  --teal-glow: rgba(45, 212, 160, 0.3);
  --purple: #a78bfa;
  --purple-glow: rgba(167, 139, 250, 0.25);
}

/* --- Colorblind mode --- */
body.colorblind {
  --gold: #4a90d9;
  --gold-light: #7bb3e8;
  --gold-bright: #93c5fd;
  --gold-deep: #2563eb;
  --gold-glow: rgba(74, 144, 217, 0.4);
  --gold-glow-strong: rgba(74, 144, 217, 0.65);
  --emerald: #4a90d9;
  --emerald-glow: rgba(74, 144, 217, 0.35);
  --ruby: #d97706;
  --ruby-glow: rgba(217, 119, 6, 0.35);
  --amber: #4a90d9;
  --amber-light: #7bb3e8;
  --amber-glow: rgba(74, 144, 217, 0.4);
  --coral: #d97706;
  --coral-glow: rgba(217, 119, 6, 0.3);
  --teal: #4a90d9;
  --teal-glow: rgba(74, 144, 217, 0.3);
  --green-mid: #4a90d9;
  --green-light: #7bb3e8;
  --red: #d97706;
  --red-light: #e88e1f;
  --orange: #d97706;
  --sacred-gold: #93c5fd;
  --text-gold: #7bb3e8;
  --border-card: rgba(74, 144, 217, 0.12);
  --border-active: rgba(74, 144, 217, 0.35);
  --border-subtle: rgba(74, 144, 217, 0.08);
}

/* --- Large font mode --- */
body.large-font {
  font-size: 18px;
}
body.large-font .flashcard-arabic,
body.large-font .fc-arabic,
body.large-font .encyclopedia-detail-arabic {
  font-size: 4rem;
}

/* --- RTL support --- */
body.rtl {
  direction: rtl;
  text-align: right;
}

/* ===========================
   GLOBAL RESET & BASE
   =========================== */

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

/* Prevent horizontal overflow on all main content */
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Global overflow prevention — only on html/body (lines 177/186) */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-latin);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* ===========================
   DISPLAY TYPOGRAPHY (Syne)
   Titres, boutons, labels, badges, tabs, chips, navigation
   Body text (paragraphes, descriptions) hérite d'Outfit via body
   =========================== */

/* Buttons */
.btn,
.btn-primary,
.btn-play,
.btn-glass,
.btn-secondary,
.btn-small,
.btn-success,
.btn-danger,
.btn-review,
.btn-hard,
.btn-easy,
.btn-back,
.btn-green,
.btn-ghost,
.btn-spectator,
.btn-home-primary,
.btn-home-secondary,
.btn-home-ghost,
.home-cta,
.create-btn,
.lobby-action-btn,
.browse-action-btn,
.report-submit,
.donate-amount-btn,
.donate-paypal-btn,
.gp-submit-btn,
.gp-leave-btn,
.gp-sound-toggle,
.ency-nav-btn,
.ency-nav-center,

/* Titles & headings */
.hero-tagline,
.loader-tagline,
.modal-title,
.browse-title,
.create-header-title,
.create-section-title,
.lobby-header-title,
.lobby-players-title-row,
.plobby-title,
.plobby-status-title,
.plobby-section-title,
.card-title,
.menu-item-title,
.names-panel-title,
.encyclopedia-section-title,
.ency-topbar-title,
.ency-faq-title,
.ency-v2-block-title,
.dlg-title,
.res-banner-title,
.res-names-title,
.tr-topbar-title,
.tr-topbar-hero-title,
.tr-heading,
.tr-dialog-title,
.tr-progress-title,
.guide-topbar-title,
.guide-hero-title,
.guide-section-label,
.guide-cta-label,
.report-title,
.gp-progress-label,
.gp-scoreboard-title,
.iq-unavail-title,
.logo-title-premium,
.btn-home-title,
.hadith-source,
.support-heading-badge,

/* Badges, chips, tabs, labels */
.pseudo-badge,
.pseudo-name,
.counter-badge,
.counter-label,
.badge,
.badge-number,
.badge-text,
.logo-badge-99,
.home-feature-name,
.tab,
.ency-tab,
.ency-subtab,
.ency-tab-badge,
.ency-chip,
.ency-chip-label,
.ency-detail-badge,
.ency-detail-label,
.ency-meaning-sources-label,
.ency-v2-field-label,
.tr-chip,
.tr-mode-badge,
.gp-mode-badge,
.gp-joker-badge,
.glossary-count-badge,
.category-chip,
.name-chip,
.arena-me-tag,
.config-label,
.lobby-code-label,
.lobby-badge,
.lobby-players-label,
.current-player-label,
.last-name-label,
.active-player-label,
.active-player-name,
.quiz-question-label,
.asso-card-label,
.donate-label,
.report-label,
.browse-room-tag,
.browse-count,
.donate-summary-text {
  font-family: var(--font-display);
}


/* --- Noise texture overlay --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  mix-blend-mode: overlay;
}

/* --- Islamic geometric background pattern --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
  background-image:
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4a24c' stroke-width='0.5'%3E%3Cpath d='M40 0L50 15L65 10L55 25L70 30L55 35L65 50L50 45L40 60L30 45L15 50L25 35L10 30L25 25L15 10L30 15Z'/%3E%3Ccircle cx='40' cy='30' r='12'/%3E%3Ccircle cx='40' cy='30' r='6'/%3E%3Cpath d='M0 0h80v80H0z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  animation: patternDrift 60s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 0%, transparent 85%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 0%, transparent 85%);
}

@keyframes patternDrift {
  from { background-position: 0 0; }
  to { background-position: 80px 80px; }
}

/* ===========================
   BACKGROUND LAYERS
   =========================== */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%, rgba(212, 162, 76, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 90%, rgba(45, 180, 140, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 70%, rgba(120, 80, 200, 0.025) 0%, transparent 50%),
    radial-gradient(ellipse 100% 40% at 50% 100%, rgba(8, 12, 28, 0.8) 0%, transparent 60%);
}


/* ===========================
   LOADING SCREEN
   =========================== */

.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--bg-deep);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-screen.out {
  opacity: 0;
  visibility: hidden;
}

.loader-mandala {
  animation: mandalaRotate 20s linear infinite;
  filter: drop-shadow(0 0 20px rgba(212, 162, 76, 0.3));
}

.loader-title {
  font-family: var(--font-arabic);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212, 162, 76, 0.5), 0 0 80px rgba(212, 162, 76, 0.2);
  letter-spacing: 0.05em;
}

.loader-bar {
  width: 140px;
  height: 3px;
  background: rgba(212, 162, 76, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright));
  border-radius: 2px;
  animation: loaderFill 0.8s ease-out forwards;
}

@keyframes loaderFill {
  to { width: 100%; }
}

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

/* ===========================
   PREMIUM LOADING SCREEN
   =========================== */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: flex !important;
}

.loading-screen.hidden .loader-content {
  transform: scale(1.04);
  opacity: 0;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  animation: loaderContentAppear 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes loaderContentAppear {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* Ring wrapper — centers text inside the ring */
.loader-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: loaderRingSpin 2.4s linear infinite;
  filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.25));
}

.loader-ring-trace {
  stroke-dasharray: 276;
  stroke-dashoffset: 200;
}

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

/* Arabic text inside ring */
.loader-arabic {
  position: relative;
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(212, 162, 76, 0.3);
  animation: loaderTextReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
  letter-spacing: 0.02em;
}

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

/* Tagline below */
.loader-tagline {
  font-family: var(--font-latin);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: loaderTagReveal 0.6s ease 0.5s forwards;
}

@keyframes loaderTagReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 0.6; transform: translateY(0); }
}

/* ===========================
   BACKGROUND LANTERNS
   =========================== */

.bg-lanterns {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  animation: lanternsReveal 3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bg-lanterns::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 0;
  right: 0;
  height: 50%;
  background: radial-gradient(ellipse 160% 100% at 50% 0%, rgba(255, 190, 60, 0.04) 0%, rgba(255, 160, 40, 0.015) 40%, transparent 68%);
  animation: ambientWarmth 24s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ambientWarmth {
  0%, 100% { opacity: 0.6; transform: scaleX(1); }
  50% { opacity: 0.85; transform: scaleX(1.02); }
}

@keyframes lanternsReveal {
  from { opacity: 0; transform: translateY(-15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bg-lanterns-svg {
  width: 100%;
  height: 100%;
}

.lantern-halo {
  mix-blend-mode: screen;
}

/* ===========================
   LAYOUT
   =========================== */

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 80px;
  position: relative;
  z-index: 1;
}

.page {
  display: none;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
  flex-direction: column;
}

.page.active {
  display: flex;
  animation: pageEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Center page content vertically when shorter than viewport */
.page > .container,
.page > .results-container,
.page > .res-wrapper {
  margin-top: auto;
  margin-bottom: auto;
  width: 100%;
}

/* Content pages with sticky headers must align to top, not center */
#pageEncyclopedia > .container,
#pageGuide > .container {
  margin-top: 0;
  margin-bottom: 0;
  flex: 1;
}

.page > .game-wrapper,
.page > .gp-wrapper {
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
}

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

.hidden {
  display: none !important;
}

/* ===========================
   HOME SCREEN
   =========================== */

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0 28px;
  position: relative;
}

.title-mandala {
  position: absolute;
  width: 280px;
  height: 280px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  opacity: 0.5;
  animation: mandalaRotate 40s linear infinite;
  filter: drop-shadow(0 0 12px rgba(212, 162, 76, 0.15));
}

/* .logo-title and .logo-subtitle removed — only Arabic logo remains */

/* (legacy .home-actions / .home-name-card removed — replaced by home-cta-duo + home-features) */

.btn-spectator {
  opacity: 0.7;
  align-self: center;
  transition: opacity var(--transition);
}
.btn-spectator:hover {
  opacity: 1;
}

/* --- Counter Badge --- */
.counter-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 28px;
  padding: 16px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.counter-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  font-variant-numeric: tabular-nums;
}

.counter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* --- Respect Note --- */
.respect-note {
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 24px;
  padding: 0 12px;
  opacity: 0.7;
}

/* ===========================
   TYPOGRAPHY
   =========================== */

h1, h2, h3 {
  font-family: var(--font-latin);
  font-weight: 700;
  color: var(--text-primary);
}

.text-center { text-align: center; }
.text-gold { color: var(--gold) !important; text-shadow: 0 0 20px var(--gold-glow); }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ===========================
   BUTTONS — Premium Tactile Design
   =========================== */

.btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-latin);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  text-align: center;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: scale(0.96) translateY(1px);
  filter: brightness(0.92);
  transition-duration: 0.08s;
}

/* Primary button — Burnished gold with depth */
.btn-primary {
  background: linear-gradient(175deg, #e8b84a 0%, #c9952e 50%, #a67c2e 100%);
  color: #1a1000;
  font-weight: 700;
  box-shadow:
    0 4px 16px rgba(212, 162, 76, 0.35),
    0 1px 3px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255, 230, 160, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  text-shadow: 0 1px 0 rgba(255, 230, 160, 0.3);
  border: 1px solid rgba(255, 230, 160, 0.2);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.btn-primary:hover {
  box-shadow:
    0 6px 24px rgba(212, 162, 76, 0.5),
    0 2px 6px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255, 230, 160, 0.5),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 216, 102, 0.25);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(2px) scale(0.96);
  filter: brightness(0.9);
  box-shadow:
    0 1px 4px rgba(212, 162, 76, 0.2),
    inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Play button — Extra emphasis */
.btn-play {
  padding: 18px 24px;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Glass button — Frosted glass with gold border */
.btn-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-button);
}

.btn-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

.btn-glass:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 1px var(--border-active);
}

/* Secondary button */
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-button);
}

.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.03) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 162, 76, 0.25);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), 0 0 0 1px rgba(212, 162, 76, 0.08);
  transform: translateY(-1px);
}

.btn-secondary.selected {
  background: rgba(212, 162, 76, 0.12);
  border-color: var(--border-active);
  color: var(--gold-light);
  box-shadow: 0 0 12px rgba(212, 162, 76, 0.15), var(--shadow-button);
}

/* Small button */
.btn-small {
  padding: 8px 16px;
  font-size: 0.82rem;
  display: inline-block;
  width: auto;
  border-radius: var(--radius-sm);
}

/* Success / Danger buttons */
.btn-success {
  background: linear-gradient(175deg, #34d399 0%, #10b981 50%, #059669 100%);
  color: #002b1c;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--emerald-glow), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(0,0,0,0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.btn-success::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}

.btn-danger {
  background: linear-gradient(175deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
  color: #2b0000;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--ruby-glow), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(0,0,0,0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}

/* Review / Hard / Easy training buttons */
.btn-review {
  background: linear-gradient(175deg, #f87171 0%, #ef4444 100%);
  color: white;
  font-weight: 600;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 12px var(--ruby-glow);
  display: inline-block;
  width: auto;
  cursor: pointer;
  font-family: var(--font-latin);
  font-size: 0.85rem;
}

.btn-hard {
  background: linear-gradient(175deg, #fb923c 0%, #f59e0b 100%);
  color: #1a1000;
  font-weight: 600;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
  display: inline-block;
  width: auto;
  cursor: pointer;
  font-family: var(--font-latin);
  font-size: 0.85rem;
}

.btn-easy {
  background: linear-gradient(175deg, #34d399 0%, #10b981 100%);
  color: #002b1c;
  font-weight: 600;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 12px var(--emerald-glow);
  display: inline-block;
  width: auto;
  cursor: pointer;
  font-family: var(--font-latin);
  font-size: 0.85rem;
}

/* Button group */
.btn-group {
  display: flex;
  gap: 8px;
}

.btn-group .btn {
  flex: 1;
}

/* Disabled state */
.btn:disabled,
.btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.3);
}

/* ===========================
   CARDS — Glass Morphism
   =========================== */

.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

/* Card inner edge highlight */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.15), transparent);
  pointer-events: none;
}

.card-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 14px;
  text-shadow: 0 0 12px var(--gold-glow);
}

/* ===========================
   GAME HEADER
   =========================== */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  gap: 12px;
}

.game-info {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.game-score {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ===========================
   INPUT FIELDS
   =========================== */

input[type="text"],
input[type="search"] {
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 0.95rem;
  outline: none;
  width: 100%;
  transition: all var(--transition);
  box-shadow: var(--shadow-inset);
}

input[type="text"]:focus,
input[type="search"]:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-inset), 0 0 0 3px rgba(212, 162, 76, 0.1);
}

input[type="text"]::placeholder,
input[type="search"]::placeholder {
  color: var(--text-muted);
}

.player-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===========================
   SELECT CUSTOM
   =========================== */

.select-custom {
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-inset);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239a978f' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.select-custom:focus {
  border-color: var(--gold);
}

/* ===========================
   SETTINGS
   =========================== */

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  border-radius: 13px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-inset);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-slider {
  background: rgba(212, 162, 76, 0.2);
  border-color: var(--gold);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--gold);
  box-shadow: 0 2px 8px var(--gold-glow);
}

/* ===========================
   PLAYER SETUP
   =========================== */

.players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.player-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(212, 162, 76, 0.1);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold-light);
}

.remove-player {
  cursor: pointer;
  opacity: 0.5;
  font-size: 1.1rem;
  transition: opacity var(--transition-fast);
}

.remove-player:hover {
  opacity: 1;
  color: var(--ruby);
}

/* Difficulty options */
.diff-option {
  display: inline-block;
  width: auto;
}

/* Lives selector */
.lives-selector {
  display: flex;
  gap: 8px;
}

.life-option {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-button);
}

.life-option:hover {
  border-color: var(--border-active);
  background: rgba(212, 162, 76, 0.08);
}

.life-option.selected {
  background: rgba(212, 162, 76, 0.15);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 162, 76, 0.2), var(--shadow-button);
}

/* ===========================
   MODE SELECT — Menu List
   =========================== */

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.menu-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  pointer-events: none;
}

.menu-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateX(4px);
}

.menu-item.selected {
  background: rgba(212, 162, 76, 0.08);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.12), var(--shadow-card);
}

.menu-item.selected::after {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--gold-glow);
}

.menu-item-icon {
  font-size: 1.5rem;
  min-width: 36px;
  text-align: center;
}

.menu-item-text {
  flex: 1;
}

.menu-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===========================
   PLAYERS BAR (In-game)
   =========================== */

.players-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.players-bar::-webkit-scrollbar {
  display: none;
}

.player-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 8px 6px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.player-avatar.active {
  background: rgba(212, 162, 76, 0.1);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 162, 76, 0.2);
  animation: playerPulse 2s ease-in-out infinite;
}

@keyframes playerPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(212, 162, 76, 0.2); }
  50% { box-shadow: 0 0 24px rgba(212, 162, 76, 0.35); }
}

.player-avatar.eliminated {
  opacity: 0.3;
  filter: grayscale(1);
}

.player-avatar-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15), rgba(212, 162, 76, 0.05));
  border: 1px solid var(--border-card);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
}

.player-avatar.active .player-avatar-icon {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #1a1000;
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

.player-avatar-name {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.player-avatar.active .player-avatar-name {
  color: var(--gold-light);
}

.player-avatar-lives {
  display: flex;
  gap: 1px;
  font-size: 0.55rem;
}

.heart {
  font-size: 0.55rem;
  transition: all var(--transition);
}

.heart.lost {
  opacity: 0.25;
  filter: grayscale(1);
}

.player-avatar-score {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ===========================
   CURRENT PLAYER HIGHLIGHT
   =========================== */

.current-player {
  text-align: center;
  padding: 16px;
  margin: 12px 0;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.current-player::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.current-player-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.current-player-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
}

/* ===========================
   CATEGORY / LETTER / QUIZ DISPLAYS
   =========================== */

.category-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(212, 162, 76, 0.06);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  margin: 8px 0;
}

.category-icon {
  font-size: 1.3rem;
}

.category-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-light);
}

.letter-display {
  text-align: center;
  padding: 16px;
  margin: 8px 0;
  background: rgba(212, 162, 76, 0.06);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
}

.letter-arabic {
  font-family: var(--font-arabic);
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold-glow);
  line-height: 1.2;
}

.letter-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.quiz-display {
  text-align: center;
  padding: 20px;
  margin: 8px 0;
}

.quiz-meaning {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.quiz-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   BOMB AREA
   =========================== */

.bomb-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.timer-text {
  font-size: 2.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(212, 162, 76, 0.3);
  margin-bottom: 8px;
}

.timer-text.safe { color: var(--emerald); text-shadow: 0 0 20px var(--emerald-glow); }
.timer-text.warning { color: var(--amber-warm); text-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
.timer-text.danger { color: var(--ruby); text-shadow: 0 0 20px var(--ruby-glow); animation: timerPulse 0.5s ease-in-out infinite; }

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ===========================
   PROGRESS BARS
   =========================== */

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-inset);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 8px var(--gold-glow);
}

.progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* ===========================
   NAMES PANEL
   =========================== */

.names-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 14px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
}

.names-panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.name-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(212, 162, 76, 0.08);
  border: 1px solid rgba(212, 162, 76, 0.15);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  margin: 2px;
  color: var(--text-secondary);
}

.name-arabic {
  font-family: var(--font-arabic);
  color: var(--gold);
  font-size: 0.85rem;
}

/* ===========================
   TOAST NOTIFICATION
   =========================== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%) translateY(24px) scale(0.92);
  background: linear-gradient(160deg, rgba(18, 24, 48, 0.94), rgba(12, 16, 34, 0.96));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
              0 4px 12px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  overflow: hidden;
  max-width: 88vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* --- Toast icon --- */
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Toast progress bar --- */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2.5px;
  border-radius: 0 0 14px 14px;
  animation: toastProgress 3.2s linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* --- Type: info --- */
.toast.info {
  border-color: rgba(96, 165, 250, 0.15);
}
.toast.info .toast-icon {
  background: rgba(96, 165, 250, 0.12);
  color: var(--sapphire);
}
.toast.info .toast-progress {
  background: linear-gradient(90deg, var(--sapphire), rgba(96, 165, 250, 0.3));
}

/* --- Type: correct --- */
.toast.correct {
  border-color: rgba(45, 212, 160, 0.15);
}
.toast.correct .toast-icon {
  background: rgba(45, 212, 160, 0.12);
  color: var(--emerald);
}
.toast.correct .toast-progress {
  background: linear-gradient(90deg, var(--emerald), rgba(45, 212, 160, 0.3));
}

/* --- Type: warning --- */
.toast.warning {
  border-color: rgba(245, 158, 11, 0.15);
}
.toast.warning .toast-icon {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-warm);
}
.toast.warning .toast-progress {
  background: linear-gradient(90deg, var(--amber-warm), rgba(245, 158, 11, 0.3));
}

/* --- Type: error --- */
.toast.error {
  border-color: rgba(239, 68, 68, 0.15);
}
.toast.error .toast-icon {
  background: rgba(239, 68, 68, 0.12);
  color: var(--ruby);
}
.toast.error .toast-progress {
  background: linear-gradient(90deg, var(--ruby), rgba(239, 68, 68, 0.3));
}

/* ===========================
   NAME POPUP
   =========================== */

.name-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--bg-elevated);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  z-index: 4000;
  text-align: center;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 30px rgba(212, 162, 76, 0.15);
}

.name-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.name-popup-arabic {
  font-family: var(--font-arabic);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold-glow);
  line-height: 1.3;
}

.name-popup-translit {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 4px;
}

.name-popup-meaning {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===========================
   TABS
   =========================== */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-latin);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  background: rgba(212, 162, 76, 0.12);
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ===========================
   SCORES
   =========================== */

.score-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.score-entry::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
}

.score-rank {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 162, 76, 0.1);
  border: 1px solid var(--border-card);
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--gold);
  flex-shrink: 0;
}

.score-details {
  flex: 1;
  min-width: 0;
}

.score-mode {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.score-players {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.score-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.score-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px var(--gold-glow);
}

/* ===========================
   BADGE
   =========================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(212, 162, 76, 0.1);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.2);
  font-weight: 600;
  color: var(--gold);
}

.badge-unlock {
  animation: badgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge-icon {
  font-size: 1.5rem;
}

@keyframes badgePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===========================
   PODIUM (End Screen)
   =========================== */

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: 24px 0;
  height: 180px;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 12px;
  position: relative;
  overflow: hidden;
}

.podium-place::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.podium-place.first {
  width: 110px;
  height: 160px;
  background: linear-gradient(to top, rgba(212, 162, 76, 0.15), rgba(212, 162, 76, 0.05));
  border: 1px solid var(--gold);
  border-bottom: none;
  box-shadow: 0 0 24px rgba(212, 162, 76, 0.2);
}

.podium-place.first::before {
  background: linear-gradient(to top, transparent, rgba(212, 162, 76, 0.08));
}

.podium-place.second {
  width: 100px;
  height: 120px;
  background: rgba(192, 192, 192, 0.08);
  border: 1px solid rgba(192, 192, 192, 0.2);
  border-bottom: none;
}

.podium-place.third {
  width: 100px;
  height: 90px;
  background: rgba(180, 120, 60, 0.08);
  border: 1px solid rgba(180, 120, 60, 0.2);
  border-bottom: none;
}

.podium-rank {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 16px var(--gold-glow);
}

.podium-place.second .podium-rank { color: #c0c0c0; text-shadow: none; }
.podium-place.third .podium-rank { color: #b47840; text-shadow: none; }

.podium-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 2px;
}

.podium-place.animate {
  animation: podiumRise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.podium-place.first.animate { animation-delay: 0.2s; }
.podium-place.second.animate { animation-delay: 0.4s; }
.podium-place.third.animate { animation-delay: 0s; }

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

/* ===========================
   END SCREEN
   =========================== */

.end-screen {
  text-align: center;
  padding: 24px 0;
}

.last-name-display {
  padding: 20px;
  margin: 20px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.last-name-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.last-name-arabic {
  font-family: var(--font-arabic);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold-glow);
  line-height: 1.3;
}

.last-name-trans {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Names review (end screen) */
.names-review {
  max-height: 300px;
  overflow-y: auto;
}

.names-review-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.names-review-item:last-child {
  border-bottom: none;
}

.nr-arabic {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--gold);
  min-width: 60px;
  text-align: right;
}

.nr-trans {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

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

/* ===========================
   DUEL MODE
   =========================== */

.duel-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.duel-player {
  flex: 1;
  text-align: center;
  padding: 16px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

.duel-player.active {
  border-color: var(--gold);
  background: rgba(212, 162, 76, 0.08);
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.15);
}

.duel-player-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.duel-vs {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.duel-faults {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.fault-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition);
}

.fault-dot.active {
  background: var(--ruby);
  border-color: var(--ruby);
  box-shadow: 0 0 8px var(--ruby-glow);
}

/* ===========================
   TEAM MODE
   =========================== */

.teams-container {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.team-card {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

.team-card.active {
  border-color: var(--gold);
  background: rgba(212, 162, 76, 0.08);
  box-shadow: 0 0 16px rgba(212, 162, 76, 0.15);
}

.team-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 4px;
}

.team-score {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.team-members {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Consultation bar */
.consultation-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0;
}

.consultation-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sapphire), var(--emerald));
  border-radius: 2px;
  transition: width 0.3s linear;
  box-shadow: 0 0 8px var(--sapphire-glow);
}

/* Phase indicator (Infinite mode) */
.phase-indicator {
  text-align: center;
  padding: 10px 16px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--purple);
  margin: 8px 0;
}

/* ===========================
   ENCYCLOPEDIA
   =========================== */

.encyclopedia-search {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 12px;
  box-shadow: var(--shadow-inset);
  transition: all var(--transition);
}

.encyclopedia-search:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-inset), 0 0 0 3px rgba(212, 162, 76, 0.1);
}

/* Category filters */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.category-chip {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-card);
}

.category-chip.active {
  background: rgba(212, 162, 76, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 162, 76, 0.15);
}

/* Encyclopedia grid */
.encyclopedia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.encyclopedia-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.encyclopedia-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.1), transparent);
}

.encyclopedia-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 12px rgba(212, 162, 76, 0.1);
}

.encyclopedia-card-arabic {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
  text-shadow: 0 0 12px var(--gold-glow);
}

.encyclopedia-card-translit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 4px;
}

.encyclopedia-card-meaning {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.encyclopedia-card-number {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.5;
}

/* Encyclopedia detail */
.encyclopedia-detail {
  padding-bottom: 20px;
}

.encyclopedia-detail-header {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.encyclopedia-detail-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.encyclopedia-detail-arabic {
  font-family: var(--font-arabic);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
  text-shadow: 0 0 40px var(--gold-glow);
}

.encyclopedia-detail-translit {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 8px;
}

.encyclopedia-detail-meaning {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.encyclopedia-detail-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
}

.encyclopedia-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}

.encyclopedia-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 8px;
}

.encyclopedia-section-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.encyclopedia-nav {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 16px;
}

/* --- Encyclopedia Card Enhancements --- */
.encyclopedia-card {
  position: relative;
}

.encyclopedia-card-category {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.encyclopedia-card-preview {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.encyclopedia-card-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(45, 212, 160, 0.15);
  color: var(--emerald);
  margin-top: 6px;
}

/* --- Encyclopedia Detail: Root Pill --- */
.encyclopedia-detail-root {
  display: inline-block;
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--gold);
  background: rgba(212, 162, 76, 0.12);
  border: 1px solid rgba(212, 162, 76, 0.2);
  padding: 4px 14px;
  border-radius: 999px;
  margin-top: 8px;
}

/* --- Verse Card --- */
.encyclopedia-verse-card {
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.encyclopedia-verse-arabic {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  color: var(--gold);
  text-align: center;
  direction: rtl;
  line-height: 2;
  margin-bottom: 8px;
}

.encyclopedia-verse-translation {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.encyclopedia-verse-ref {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Scholar Card --- */
.encyclopedia-scholar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--sapphire);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.encyclopedia-scholar-card[data-tradition="Sunnite Malikite"] {
  border-left-color: var(--emerald);
}

.encyclopedia-scholar-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
}

.encyclopedia-scholar-work {
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 2px;
}

.encyclopedia-scholar-tradition {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(45, 212, 160, 0.12);
  color: var(--emerald);
  margin-top: 4px;
}

.encyclopedia-scholar-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-top: 8px;
}

/* --- Hadith Card --- */
.encyclopedia-hadith-card {
  background: rgba(10, 14, 26, 0.5);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--emerald);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.encyclopedia-hadith-collection {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 6px;
}

.encyclopedia-hadith-text {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.7;
}

/* --- Links --- */
.encyclopedia-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--emerald);
  text-decoration: none;
  transition: opacity 0.2s;
}

.encyclopedia-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* --- Sources List --- */
.encyclopedia-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.encyclopedia-sources-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.encyclopedia-sources-list li:last-child {
  border-bottom: none;
}

/* Old training section — replaced by .tr-* classes below */

/* Old flashcard/quiz/matching/writing — replaced by .tr-* section */

/* ===========================
   EXPLOSION & EFFECTS
   =========================== */

.explosion-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 100, 0, 0.3), transparent 60%);
  animation: explosionFlash 0.6s ease-out;
}

@keyframes explosionFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 2001;
  pointer-events: none;
}

.particle.fire {
  background: radial-gradient(circle, #fff 0%, #ffd866 30%, #f59e0b 60%, #ef4444 100%);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.particle.smoke {
  background: rgba(100, 100, 100, 0.6);
  border-radius: 50%;
}

.particle.ember {
  width: 4px;
  height: 4px;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-glow);
}

/* Victory overlay */
.victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(212, 162, 76, 0.15), transparent 70%);
}

.victory-text {
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow:
    0 0 40px var(--gold-glow-strong),
    0 0 80px rgba(212, 162, 76, 0.3);
  animation: victoryPulse 1.5s ease-in-out infinite;
}

@keyframes victoryPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.victory-star {
  position: fixed;
  font-size: 1.5rem;
  z-index: 2001;
  pointer-events: none;
  animation: starFloat 3s ease-out forwards;
}

@keyframes starFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-100px) scale(0.5); }
}

/* Flash effects */
.correct-flash {
  animation: correctFlash 0.5s ease;
}

@keyframes correctFlash {
  0% { box-shadow: inset 0 0 0 0 rgba(45, 212, 160, 0); }
  50% { box-shadow: inset 0 0 40px rgba(45, 212, 160, 0.15); }
  100% { box-shadow: inset 0 0 0 0 rgba(45, 212, 160, 0); }
}

.wrong-flash {
  animation: wrongFlash 0.5s ease;
}

@keyframes wrongFlash {
  0% { box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: inset 0 0 40px rgba(239, 68, 68, 0.15); }
  100% { box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ===========================
   FLASHCARD SLIDE ANIMATIONS
   =========================== */

.flashcard-slide-left {
  animation: slideLeft 0.3s ease;
}

.flashcard-slide-right {
  animation: slideRight 0.3s ease;
}

@keyframes slideLeft {
  0% { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  0% { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ===========================
   PLAYER TURN ANIMATION
   =========================== */

.player-turn-enter {
  animation: turnEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes turnEnter {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Category change animation */
.category-change {
  animation: categoryPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes categoryPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Phase transition */
.phase-transition {
  animation: phaseFade 0.4s ease;
}

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

/* ===========================
   SCROLLBAR
   =========================== */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 162, 76, 0.15);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 162, 76, 0.3);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 380px) {
  .container {
    padding: 12px 12px 60px;
  }

  .title-mandala {
    width: 220px;
    height: 220px;
  }

  .encyclopedia-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .podium {
    gap: 4px;
    height: 160px;
  }

  .podium-place.first { width: 90px; }
  .podium-place.second { width: 80px; }
  .podium-place.third { width: 80px; }
}

@media (min-width: 768px) {
  .container {
    padding: 24px 24px 80px;
  }

  .encyclopedia-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ===========================
   SAFE AREA (iOS notch)
   =========================== */

@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}


/* ================================================================
   MULTIPLAYER PUBLIC PAGES — Additional Styles
   Matches the "Sacred Arcade" theme
   ================================================================ */


/* ---------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------- */

.page-wide {
  max-width: 900px;
}

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-back svg {
  width: 20px;
  height: 20px;
}

.btn-back:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 162, 76, 0.06);
}





/* ---------------------------------------------------------------
   DISCONNECT OVERLAY
   --------------------------------------------------------------- */

.disconnect-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 24px;
}

.disconnect-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.disconnect-card {
  text-align: center;
  padding: 36px 40px 32px;
  background: linear-gradient(165deg, rgba(18, 22, 42, 0.97), rgba(10, 14, 28, 0.98));
  border: 1px solid rgba(212, 162, 76, 0.12);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  max-width: 320px;
  width: 100%;
  animation: disconnectCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes disconnectCardIn {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.disconnect-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 0 0 2px 2px;
}

.disconnect-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 162, 76, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.disconnect-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.08);
  border: 1.5px solid rgba(245, 158, 11, 0.18);
  animation: disconnectPulse 2.4s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.disconnect-icon svg {
  stroke: var(--amber-warm);
  opacity: 0.9;
}

@keyframes disconnectPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.1); transform: scale(1); }
  50% { box-shadow: 0 0 24px 8px rgba(245, 158, 11, 0.08); transform: scale(1.04); }
}

.disconnect-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.disconnect-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.disconnect-dots::after {
  content: '';
  animation: disconnectDots 1.5s steps(4, end) infinite;
}

@keyframes disconnectDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ---------------------------------------------------------------
   TOAST / OVERLAYS
   --------------------------------------------------------------- */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast-container > * {
  pointer-events: auto;
}

/* --- Unavailable / leave popup (shared) --- */
.iq-unavail-wrapper {
  margin: auto;
  max-width: 420px;
  width: 100%;
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: unavailIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes unavailIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.iq-unavail-icon {
  width: 100px; height: 100px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212, 162, 76, 0.06);
  border: 1.5px solid rgba(212, 162, 76, 0.15);
  animation: unavailPulse 3s ease-in-out infinite;
}
.iq-unavail-icon svg { stroke: var(--gold); }
@keyframes unavailPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 162, 76, 0.08); }
  50% { box-shadow: 0 0 30px 8px rgba(212, 162, 76, 0.12); }
}
.iq-unavail-title {
  font-family: var(--font-display), var(--font-latin), sans-serif;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800; color: var(--text-primary); margin: 0;
}
.iq-unavail-desc {
  font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; margin: 0; max-width: 320px;
}
.iq-unavail-actions { margin-top: 12px; }
.iq-unavail-btn-home {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px; font-size: 0.92rem; font-weight: 700;
  font-family: var(--font-latin), sans-serif;
  color: var(--bg-deep); text-decoration: none;
  background: linear-gradient(135deg, var(--gold), #e8c868);
  border: none; border-radius: 14px; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 20px rgba(212, 162, 76, 0.25);
}
.iq-unavail-btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(212, 162, 76, 0.4);
}

/* --- Player leave popup (shared) --- */
.classic-leave-popup {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px) scale(0.9);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px 10px 12px;
  background: linear-gradient(160deg, rgba(18, 22, 44, 0.94), rgba(12, 16, 34, 0.96));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 40px;
  z-index: 6000;
  opacity: 0;
  pointer-events: none;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.classic-leave-popup.popup-in {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.classic-leave-popup.popup-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-14px) scale(0.92);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.classic-leave-popup-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.classic-leave-popup-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.classic-leave-popup-name {
  font-weight: 700;
  color: var(--text-primary);
}

.feedback-flash {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.feedback-flash.correct {
  background: radial-gradient(ellipse at center, rgba(45, 212, 160, 0.2) 0%, transparent 70%);
  opacity: 1;
  animation: flashFade 0.5s ease-out forwards;
}

.feedback-flash.wrong {
  background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.25) 0%, transparent 70%);
  opacity: 1;
  animation: flashFade 0.5s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}


.name-display-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 350;
  text-align: center;
  background: linear-gradient(160deg, rgba(20, 26, 50, 0.97) 0%, rgba(12, 16, 35, 0.98) 100%);
  border: 1.5px solid rgba(212, 162, 76, 0.35);
  border-radius: var(--radius-lg);
  padding: 36px 44px 32px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(212, 162, 76, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.name-display-popup::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), var(--gold), var(--gold-bright), transparent);
}

.name-display-popup::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 162, 76, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.name-display-popup.show,
.name-display-popup:not(.hidden) {
  animation: nameCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}

@keyframes nameCardIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7) translateY(20px); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(0); }
}

@keyframes nameCardOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9) translateY(-15px); }
}

.name-display-popup.hiding {
  animation: nameCardOut 0.35s ease-in forwards;
}

.name-display-arabic {
  font-family: var(--font-arabic);
  font-size: 2.8rem;
  color: var(--sacred-gold);
  text-shadow: 0 0 40px rgba(212, 162, 76, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.name-display-divider {
  width: 48px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 12px auto 14px;
  position: relative;
  z-index: 1;
}

.name-display-translit {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.name-display-meaning {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
  position: relative;
  z-index: 1;
}


/* ---------------------------------------------------------------
   HOME PAGE
   --------------------------------------------------------------- */

.logo-crescent {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  opacity: 0.85;
  filter: drop-shadow(0 0 12px rgba(212, 162, 76, 0.3));
}

.logo-mandala {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  pointer-events: none;
  animation: mandalaRotatePublic 60s linear infinite;
}

@keyframes mandalaRotatePublic {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Premium Animated Title --- */
.logo-title-premium {
  font-family: var(--font-latin);
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(135deg, #FFE7A3 0%, #F6C864 20%, #D89E2C 40%, #F4D27E 60%, #FFE7A3 80%, #D89E2C 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: titleShimmer 4s ease-in-out infinite;
  position: relative;
  z-index: 1;
  margin: 0;
  cursor: default;
  filter: drop-shadow(0 0 30px rgba(212, 162, 76, 0.3)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
}

@keyframes titleShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.logo-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  animation: letterReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--i) * 0.08s + 0.3s);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.logo-letter:hover {
  transform: translateY(-6px) scale(1.15);
  filter: drop-shadow(0 0 12px rgba(212, 162, 76, 0.6));
}

.logo-separator {
  display: inline-block;
  width: 0.3em;
}

@keyframes letterReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.logo-arabic-sub {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  color: var(--gold);
  opacity: 0;
  text-shadow: 0 0 20px rgba(212, 162, 76, 0.2);
  letter-spacing: 0.06em;
  direction: rtl;
  animation: subReveal 0.8s ease forwards 1.2s;
  margin-top: 6px;
}

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

.logo-underline {
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-bright), var(--gold), transparent);
  border-radius: 2px;
  margin: 10px auto 0;
  animation: underlineGrow 1s ease forwards 1s;
  box-shadow: 0 0 12px rgba(212, 162, 76, 0.3);
}

@keyframes underlineGrow {
  from { width: 0; opacity: 0; }
  to { width: 120px; opacity: 1; }
}

/* Legacy .logo-arabic kept for loader reference */
.logo-arabic {
  font-family: var(--font-arabic);
  font-size: 4.5rem;
  color: var(--sacred-gold);
  text-shadow:
    0 0 40px rgba(212, 162, 76, 0.35),
    0 0 80px rgba(212, 162, 76, 0.12);
  line-height: 1.3;
  letter-spacing: 0.04em;
  direction: rtl;
  position: relative;
  z-index: 1;
}

.logo-badge-99 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 18px;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.12), rgba(212, 162, 76, 0.04));
  border: 1px solid rgba(212, 162, 76, 0.25);
  border-radius: var(--radius-pill);
  position: relative;
  z-index: 1;
}

.badge-number {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge-text {
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.home-ornament-top,
.home-ornament-bottom {
  text-align: center;
  padding: 8px 0;
  opacity: 0.7;
}

.ornament-svg {
  width: 100%;
  max-width: 400px;
  height: auto;
}

.gold-divider {
  text-align: center;
  padding: 10px 0 20px;
  opacity: 0.8;
}

.divider-svg {
  width: 80%;
  max-width: 300px;
  height: auto;
}


/* ---------------------------------------------------------------
   HOME BUTTONS
   --------------------------------------------------------------- */

.btn-home-primary,
.btn-home-secondary,
.btn-home-ghost {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-latin);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.btn-home-primary {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15), rgba(212, 162, 76, 0.06));
  border: 1px solid rgba(212, 162, 76, 0.3);
  color: var(--text-primary);
  box-shadow: 0 4px 24px rgba(212, 162, 76, 0.1);
}

.btn-home-primary:hover {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.22), rgba(212, 162, 76, 0.1));
  border-color: var(--gold);
  box-shadow: 0 6px 30px rgba(212, 162, 76, 0.2);
  transform: translateY(-2px);
}

.btn-home-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
}

.btn-home-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-home-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 12px 18px;
}

.btn-home-ghost:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-card);
  color: var(--text-primary);
}

.btn-home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(212, 162, 76, 0.08);
  color: var(--gold);
}

.btn-home-icon svg { width: 22px; height: 22px; }

.btn-home-content { flex: 1; min-width: 0; }

.btn-home-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.btn-home-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-home-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.5;
  transition: all var(--transition);
}

.btn-home-arrow svg { width: 18px; height: 18px; }

.btn-home-primary:hover .btn-home-arrow,
.btn-home-secondary:hover .btn-home-arrow {
  opacity: 1;
  color: var(--gold);
  transform: translateX(3px);
}

.shimmer { position: relative; overflow: hidden; }

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04), transparent);
  animation: shimmerSlide 3s ease-in-out infinite;
}

@keyframes shimmerSlide {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}


/* ---------------------------------------------------------------
   GLASS CARD
   --------------------------------------------------------------- */

.glass-card-static {
  background: rgba(15, 19, 36, 0.85);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
}

.glass-card-static::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.2), transparent);
  border-radius: 1px;
}


/* ---------------------------------------------------------------
   CONFIG / SETTINGS
   --------------------------------------------------------------- */

.config-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold-light);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.config-section { margin-bottom: 18px; }
.config-section:last-child { margin-bottom: 0; }

.config-options { display: flex; gap: 6px; flex-wrap: wrap; }

.config-option {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  user-select: none;
}

.config-option:hover {
  border-color: rgba(212, 162, 76, 0.3);
  background: var(--bg-card-hover);
}

.config-option.selected {
  background: rgba(212, 162, 76, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(8,12,24,0.80);
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 1rem;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), 0 1px 0 rgba(255,255,255,0.03);
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
}

.input-field:focus {
  border-color: rgba(212,162,76,0.5);
  box-shadow:
    0 0 0 3px rgba(212,162,76,0.12),
    0 0 20px rgba(212,162,76,0.08),
    inset 0 2px 4px rgba(0,0,0,0.2);
  background: rgba(10,14,28,0.90);
}

.input-field::placeholder { color: var(--text-muted); opacity: 0.6; }

.input-code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 800;
  text-align: center;
  font-size: 1.35rem;
  padding: 16px 18px;
  font-family: var(--font-display);
  color: var(--gold-light);
}

/* Shake + red glow on invalid join code */
.input-invalid {
  border-color: rgba(239, 68, 68, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 0 20px rgba(239, 68, 68, 0.15) !important;
  animation: inputRedPulse 0.6s ease;
}

@keyframes inputRedPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 0 20px rgba(239, 68, 68, 0.15); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.3), 0 0 32px rgba(239, 68, 68, 0.25); }
}

.shake-invalid {
  animation: shakeCard 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeCard {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-8px); }
  20% { transform: translateX(7px); }
  30% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  50% { transform: translateX(-3px); }
  60% { transform: translateX(2px); }
  70% { transform: translateX(-1px); }
}

/* ---------------------------------------------------------------
   ROOM NOT FOUND MODAL
   --------------------------------------------------------------- */

.room-not-found-card {
  max-width: 380px;
}

.room-not-found-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ef4444;
  animation: roomNotFoundPulse 0.6s ease both;
}

@keyframes roomNotFoundPulse {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.room-not-found-card .modal-title {
  color: #ef4444;
}

/* ---------------------------------------------------------------
   BUTTONS — Additional variants
   --------------------------------------------------------------- */

.btn-green {
  background: linear-gradient(135deg, var(--emerald), #26b893);
  color: var(--bg-deep);
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--emerald-glow);
}

.btn-green:hover {
  box-shadow: 0 6px 24px rgba(45, 212, 160, 0.45);
  transform: translateY(-2px);
}

.btn-green:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-lg { padding: 18px 28px; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-block { display: block; width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  font-weight: 500;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: 10px; }


/* ---------------------------------------------------------------
   CREATE ROOM PAGE
   --------------------------------------------------------------- */

/* =====================================================
   CREATE ROOM — Premium Compact Configuration
   ===================================================== */

/* --- Page: center content on wide screens --- */
#pageCreateRoom {
  align-items: center;
}

/* --- Container: scrollable, vertically centered --- */
.create-container {
  width: 100%;
  max-width: 480px;
  padding: 0 20px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
}

/* --- Header — stylized block --- */
.create-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(212,162,76,0.06) 0%, rgba(10,14,30,0.8) 60%, rgba(212,162,76,0.03) 100%);
  border: 1px solid rgba(212,162,76,0.12);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.create-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(212,162,76,0.3) 30%, rgba(255,230,160,0.15) 50%, rgba(212,162,76,0.3) 70%, transparent 95%);
}
.create-header .btn-back {
  flex-shrink: 0;
}
.create-header-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.create-header-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(212,162,76,0.1);
  border: 1px solid rgba(212,162,76,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

/* --- Stagger entrance --- */
.create-stagger {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  animation: createReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--stagger, 0) * 0.07s + 0.05s);
}

@keyframes createReveal {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* --- Pseudo preview — compact identity --- */
.create-pseudo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background:
    linear-gradient(135deg, rgba(212, 162, 76, 0.06) 0%, rgba(15, 19, 36, 0.9) 50%, rgba(212, 162, 76, 0.03) 100%);
  border: 1px solid rgba(212, 162, 76, 0.18);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.create-pseudo-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 120% 80% at 0% 50%, rgba(212, 162, 76, 0.07), transparent 60%);
  pointer-events: none;
}

.create-pseudo-preview::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(212, 162, 76, 0.25) 30%, rgba(255, 230, 160, 0.12) 50%, rgba(212, 162, 76, 0.25) 70%, transparent 95%);
}

.create-pseudo-preview:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.create-pseudo-preview .pseudo-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.create-pseudo-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-bright), var(--gold), var(--gold-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--bg-deep);
  font-weight: 700;
  box-shadow:
    0 0 14px rgba(212, 162, 76, 0.22),
    0 0 28px rgba(212, 162, 76, 0.06),
    inset 0 1px 2px rgba(255, 255, 255, 0.25);
  position: relative;
}

.create-pseudo-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
}

/* --- Section — Compact config group --- */
.create-section {
  margin-bottom: 8px;
  padding: 10px 14px;
  background: rgba(10, 14, 26, 0.5);
  border: 1px solid rgba(212, 162, 76, 0.05);
  border-radius: var(--radius);
  position: relative;
  flex-shrink: 0;
}

.create-section::before {
  content: '';
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.08), transparent);
}

.create-section-title {
  color: var(--gold-light);
  font-size: 0.65rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-section-title::before {
  content: '';
  width: 2px;
  height: 12px;
  background: linear-gradient(to bottom, var(--gold-bright), var(--gold-deep));
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(212, 162, 76, 0.25);
}

/* --- Difficulty — 2×2 compact grid --- */
.create-diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.create-diff-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(15, 19, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.create-diff-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.create-diff-card:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.create-diff-card.selected {
  border-color: rgba(212, 162, 76, 0.45);
  background:
    linear-gradient(135deg, rgba(212, 162, 76, 0.1) 0%, rgba(15, 19, 36, 0.85) 60%, rgba(212, 162, 76, 0.04) 100%);
  box-shadow:
    0 0 0 1px rgba(212, 162, 76, 0.12) inset,
    0 2px 12px rgba(212, 162, 76, 0.1);
}

.create-diff-card.selected::before {
  opacity: 1;
  background: radial-gradient(ellipse 60% 100% at 0% 50%, rgba(212, 162, 76, 0.06), transparent 70%);
}

.create-diff-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(25, 32, 60, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.create-diff-card.selected .create-diff-icon {
  color: var(--gold);
  background: rgba(212, 162, 76, 0.1);
  border-color: rgba(212, 162, 76, 0.18);
  box-shadow: 0 0 10px rgba(212, 162, 76, 0.12);
}

.create-diff-info {
  flex: 1;
  min-width: 0;
}

.create-diff-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.2s;
  line-height: 1.2;
}

.create-diff-card.selected .create-diff-name {
  color: var(--gold-light);
}

.create-diff-timer {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--gold);
  opacity: 0.7;
  margin-top: 1px;
  letter-spacing: 0.02em;
}

.create-diff-card.selected .create-diff-timer {
  opacity: 1;
}

/* --- Lives hearts — compact --- */
.create-lives-row {
  display: flex;
  gap: 16px;
  padding: 2px 0;
  justify-content: center;
}

.create-heart {
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.15;
  filter: grayscale(1) brightness(0.5);
  position: relative;
}

.create-heart::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.22), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.create-heart svg {
  width: 100%;
  height: 100%;
  fill: var(--ruby);
  stroke: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.create-heart.active {
  opacity: 1;
  filter: grayscale(0) drop-shadow(0 0 10px var(--ruby-glow));
  transform: scale(1);
}

.create-heart.active::after {
  opacity: 1;
}

.create-heart:active {
  transform: scale(1.2);
  transition-duration: 0.08s;
}

/* --- Steppers Row — Jokers + Players premium side by side --- */
.create-steppers-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.create-stepper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.create-stepper:first-child { padding-right: 12px; }
.create-stepper:last-child { padding-left: 12px; }

.create-steppers-divider {
  width: 1px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, transparent, rgba(212,162,76,0.12), transparent);
}

.stepper-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(10,14,30,0.6);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 4px;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.stepper-btn:hover { border-color: rgba(212,162,76,0.3); color: var(--gold); background: rgba(212,162,76,0.06); }
.stepper-btn:active { transform: scale(0.9); }
.stepper-btn.disabled {
  opacity: 0.2;
  pointer-events: none;
}

.stepper-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.stepper-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  font-family: var(--font-display);
  text-shadow: 0 0 16px rgba(212,175,55,0.3);
  transition: transform 0.15s ease;
}
.stepper-value.bump {
  transform: scale(1.25);
}

.stepper-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.stepper-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transition: all 0.25s ease;
}
.stepper-dot.active {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(212,175,55,0.5);
}

.stepper-icons {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}
.stepper-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transition: all 0.25s ease;
}
.stepper-icon.active {
  background: var(--gold);
  box-shadow: 0 0 4px rgba(212,175,55,0.4);
}

/* --- Visibility — vertical cards with icon circle --- */
.create-vis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.create-vis-card {
  padding: 14px 10px 12px;
  text-align: center;
  background: rgba(15, 19, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  font: inherit;
  color: inherit;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.create-vis-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.create-vis-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, rgba(255,255,255,0.04) 50%, transparent 90%);
  transition: background 0.3s;
}

.create-vis-card:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.create-vis-card.selected {
  border-color: rgba(212, 162, 76, 0.4);
  background: linear-gradient(160deg, rgba(212,162,76,0.1) 0%, rgba(15,19,36,0.9) 100%);
  box-shadow:
    0 0 0 1px rgba(212,162,76,0.1) inset,
    0 4px 20px rgba(212,162,76,0.08);
}
.create-vis-card.selected::before {
  opacity: 1;
  background: radial-gradient(ellipse 90% 70% at 50% 0%, rgba(212,162,76,0.1), transparent 70%);
}
.create-vis-card.selected::after {
  background: linear-gradient(90deg, transparent 5%, rgba(212,162,76,0.3) 30%, rgba(255,230,160,0.15) 50%, rgba(212,162,76,0.3) 70%, transparent 95%);
}

/* Icon circle */
.create-vis-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s;
}
.create-vis-card.selected .create-vis-icon-wrap {
  background: rgba(212,162,76,0.1);
  border-color: rgba(212,162,76,0.2);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(212,175,55,0.15);
}

.create-vis-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.2s;
  line-height: 1.2;
}
.create-vis-card.selected .create-vis-name {
  color: var(--gold-light);
}

.create-vis-desc {
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.6;
  line-height: 1.3;
  transition: all 0.2s;
}
.create-vis-card.selected .create-vis-desc {
  color: var(--gold-light);
  opacity: 0.6;
}

/* --- Create button — inline bottom --- */
.create-btn {
  margin-top: 12px;
  flex-shrink: 0;
  padding: 14px 24px;
  font-size: 1rem;
}


/* =====================================================
   HOST LOBBY — Premium Animated Waiting Room
   ===================================================== */

/* --- Particles canvas --- */
.lobby-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- Container --- */
.lobby-container {
  padding-bottom: 160px;
  position: relative;
  z-index: 1;
}

/* --- Stagger entrance --- */
.lobby-stagger {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  filter: blur(8px);
  animation: lobbyEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--stagger, 0) * 0.12s + 0.1s);
}

@keyframes lobbyEnter {
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* --- Header --- */
.lobby-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 18px;
}

.lobby-back-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lobby-back-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(212,162,76,0.2);
  color: var(--gold);
  transform: translateX(-2px);
}
.lobby-back-btn svg { width: 20px; height: 20px; }

.lobby-header-center { flex: 1; }
.lobby-header-title {
  font-family: var(--font-latin);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.lobby-header-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.lobby-vis-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(212,162,76,0.06);
  border: 1px solid rgba(212,162,76,0.18);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s;
}

/* --- Share Card — Glassmorphism Invite --- */
.lobby-share-card {
  position: relative;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
}

.lobby-share-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 0%, rgba(212,162,76,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 80% 100%, rgba(45,212,160,0.04) 0%, transparent 50%);
  animation: lobbyShareGlow 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes lobbyShareGlow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.lobby-share-inner {
  position: relative;
  z-index: 1;
  padding: 24px;
  background: rgba(10,14,26,0.7);
  border: 1px solid rgba(212,162,76,0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.lobby-share-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(212,162,76,0.35) 30%, rgba(255,230,160,0.2) 50%, rgba(212,162,76,0.35) 70%, transparent 95%);
}

/* --- Invite grid: QR left | Code + actions right --- */
.lobby-invite-grid {
  display: flex;
  align-items: stretch;
  gap: 24px;
}

/* QR side */
.lobby-qr-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lobby-qr-frame {
  position: relative;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,162,76,0.12);
  border-radius: 18px;
}
.lobby-qr-glow {
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(212,162,76,0.1) 0%, transparent 70%);
  animation: lobbyQrPulse 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lobbyQrPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.97); }
  50% { opacity: 0.8; transform: scale(1.03); }
}

.lobby-qr-frame img {
  display: block;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  width: 120px;
  height: 120px;
  position: relative;
  z-index: 1;
}

.lobby-qr-hint {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 10px;
  text-align: center;
}

/* Invite (right) side */
.lobby-invite-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 16px;
}

/* Code block — premium redesign */
.lobby-code-block {
  text-align: center;
  position: relative;
  cursor: pointer;
  padding: 22px 28px 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,162,76,0.06) 0%, transparent 70%),
    rgba(212,162,76,0.03);
  border: 1px solid rgba(212,162,76,0.12);
  border-radius: 18px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.lobby-code-block::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,162,76,0.3), transparent);
}
.lobby-code-block:hover {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,162,76,0.1) 0%, transparent 70%),
    rgba(212,162,76,0.05);
  border-color: rgba(212,162,76,0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212,162,76,0.08);
}
.lobby-code-block:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.lobby-code-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.lobby-code-value {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0 4px;
  overflow: hidden;
}

.lobby-code-hint {
  font-size: 0.56rem;
  color: var(--text-muted);
  opacity: 0.4;
  margin-top: 10px;
  letter-spacing: 0.04em;
  transition: opacity 0.3s;
}
.lobby-code-block:hover .lobby-code-hint {
  opacity: 0.75;
}

.room-code {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 900;
  font-family: var(--font-latin);
  letter-spacing: 0.25em;
  padding-left: 0.25em;
  color: var(--gold-light);
  text-shadow:
    0 0 24px rgba(212,162,76,0.4),
    0 0 48px rgba(212,162,76,0.15),
    0 2px 4px rgba(0,0,0,0.3);
  text-transform: uppercase;
  animation: lobbyCodeBreath 4s ease-in-out infinite;
  line-height: 1;
  white-space: nowrap;
}
@keyframes lobbyCodeBreath {
  0%, 100% { text-shadow: 0 0 24px rgba(212,162,76,0.35), 0 0 48px rgba(212,162,76,0.12), 0 2px 4px rgba(0,0,0,0.3); }
  50% { text-shadow: 0 0 36px rgba(212,162,76,0.55), 0 0 64px rgba(212,162,76,0.22), 0 2px 4px rgba(0,0,0,0.3); }
}

.lobby-code-copied {
  display: block;
  text-align: center;
  background: var(--emerald);
  color: var(--bg-deep);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  opacity: 0;
  transform: translateY(4px) scale(0.8);
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  position: absolute;
  top: -8px;
  right: 8px;
  box-shadow: 0 4px 14px rgba(45,212,160,0.35);
  z-index: 5;
}
.lobby-code-copied.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Action buttons */
.lobby-invite-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-latin);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}
.lobby-action-btn:active { transform: scale(0.97); }
.lobby-action-btn svg { flex-shrink: 0; }

/* Code button — gold accent */
.lobby-action-btn--code {
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(212,162,76,0.12), rgba(212,162,76,0.06));
  border: 1px solid rgba(212,162,76,0.2);
}
.lobby-action-btn--code:hover {
  background: linear-gradient(135deg, rgba(212,162,76,0.2), rgba(212,162,76,0.1));
  border-color: rgba(212,162,76,0.35);
  box-shadow: 0 0 16px rgba(212,162,76,0.12);
  transform: translateY(-1px);
}

/* Link button — subtle */
.lobby-action-btn--link {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.lobby-action-btn--link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

/* Copied feedback on buttons */
.lobby-action-btn.copied {
  border-color: var(--emerald) !important;
  color: var(--emerald) !important;
  background: rgba(45,212,160,0.08) !important;
}
.lobby-action-btn.copied span:first-of-type {
  display: none;
}
.lobby-action-btn.copied::after {
  content: 'Copié !';
  font-weight: 700;
}

/* Copied badge inside link button */
.lobby-action-btn .lobby-code-copied {
  top: -10px;
  right: 12px;
}

/* --- Responsive: stack on small screens --- */
@media (max-width: 440px) {
  .lobby-invite-grid {
    flex-direction: column;
    gap: 20px;
  }
  .lobby-qr-side {
    order: 2;
  }
  .lobby-invite-side {
    order: 1;
  }
  .room-code {
    font-size: 1.6rem;
    letter-spacing: 0.22em;
    padding-left: 0.22em;
  }
  .lobby-qr-frame img {
    width: 100px;
    height: 100px;
  }
}

/* --- Config badges row --- */
.lobby-config-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  justify-content: center;
  padding: 0 4px;
}

.lobby-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lobby-badge--gold {
  color: var(--gold);
  border: 1px solid rgba(212,162,76,0.15);
  background: rgba(212,162,76,0.06);
}
.lobby-badge--ruby {
  color: var(--ruby);
  border: 1px solid rgba(239,68,68,0.15);
  background: rgba(239,68,68,0.05);
}
.lobby-badge--ruby .badge-icon { stroke: var(--ruby); }
.lobby-badge--sapphire {
  color: var(--sapphire);
  border: 1px solid rgba(96,165,250,0.15);
  background: rgba(96,165,250,0.05);
}
.lobby-badge--sapphire .badge-icon { stroke: var(--sapphire); }
.lobby-badge--emerald {
  color: var(--emerald);
  border: 1px solid rgba(45,212,160,0.15);
  background: rgba(45,212,160,0.05);
}
.lobby-badge--emerald .badge-icon { stroke: var(--emerald); }
.lobby-badge--amethyst {
  color: #c084fc;
  border: 1px solid rgba(192,132,252,0.15);
  background: rgba(192,132,252,0.05);
}
.lobby-badge--amethyst .badge-icon { stroke: #c084fc; fill: #c084fc; }

.lobby-badge svg, .lobby-vis-badge svg { flex-shrink: 0; opacity: 0.85; }

.badge-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Players Section --- */
.lobby-players-section {
  background: rgba(12,16,32,0.6);
  border: 1px solid rgba(212,162,76,0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lobby-players-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(212,162,76,0.08);
}

.lobby-players-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lobby-players-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.lobby-players-count {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 700;
  background: rgba(212,162,76,0.08);
  border: 1px solid rgba(212,162,76,0.12);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
}
.lobby-count-sep {
  opacity: 0.4;
  margin: 0 1px;
}

.lobby-ring-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.lobby-ring-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lobby-ring-svg { flex-shrink: 0; }
.lobby-ring-progress {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

/* Players list */
.lobby-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 100%;
}
.lobby-empty-state::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(212,162,76,0.06);
  border: 1px dashed rgba(212,162,76,0.15);
}

/* --- Player card --- */
.lobby-player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(15,19,36,0.5);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.35s cubic-bezier(0.22,1,0.36,1);
  width: 100%;
  position: relative;
  overflow: hidden;
}
.lobby-player-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--player-color, transparent);
  opacity: 0.6;
  transition: all 0.4s;
}
.lobby-player-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at left center, color-mix(in srgb, var(--player-color, var(--gold)) 8%, transparent), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
.lobby-player-card:hover::after { opacity: 1; }

.lobby-player-card.ready {
  border-color: rgba(45,212,160,0.2);
  background: rgba(45,212,160,0.03);
}
.lobby-player-card.ready::before {
  background: var(--emerald);
  opacity: 0.8;
  box-shadow: 0 0 12px var(--emerald-glow);
}
.lobby-player-card.ready::after {
  background: radial-gradient(ellipse at left center, rgba(45,212,160,0.06), transparent 70%);
  opacity: 1;
}

.lobby-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--player-color, var(--gold)), color-mix(in srgb, var(--player-color, var(--gold)) 50%, #000));
  border: 2.5px solid color-mix(in srgb, var(--player-color, var(--gold)) 60%, #fff);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--player-color, var(--gold)) 35%, transparent),
    inset 0 1px 2px rgba(255,255,255,0.25);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.lobby-player-card:hover .lobby-card-avatar { transform: scale(1.08); }

.lobby-card-badge {
  position: absolute;
  bottom: -3px;
  right: -4px;
  font-size: 0.7rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.lobby-card-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.lobby-card-name {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lobby-card-host {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(212,162,76,0.15), rgba(212,162,76,0.08));
  border: 1px solid rgba(212,162,76,0.2);
  color: var(--gold);
  margin-left: 8px;
  vertical-align: middle;
}
.lobby-card-status {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
  transition: color 0.3s;
}
.lobby-player-card.ready .lobby-card-status { color: var(--emerald); }

/* Ready dot */
.lobby-card-ready-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
  animation: readyDotPulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 10px var(--emerald-glow), 0 0 20px rgba(45,212,160,0.12);
  position: relative;
  z-index: 1;
}
@keyframes readyDotPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Kick button */
.lobby-card-kick {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(239,68,68,0.15);
  background: rgba(239,68,68,0.04);
  color: var(--ruby);
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}
.lobby-player-card:hover .lobby-card-kick { opacity: 0.5; }
.lobby-card-kick:hover {
  opacity: 1 !important;
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.5);
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(239,68,68,0.2);
}

/* Card enter animation */
.lobby-card-enter {
  animation: lobbyCardEnter 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
  animation-delay: calc(var(--card-stagger, 0) * 0.08s);
}
@keyframes lobbyCardEnter {
  from { opacity: 0; transform: translateX(-20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* --- Waiting Orbital --- */
.lobby-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 0 8px;
}
.lobby-orbital {
  position: relative;
  width: 36px;
  height: 36px;
}
.lobby-orbital-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  top: 50%;
  left: 50%;
  margin: -3px;
  animation: lobbyOrbit 1.8s cubic-bezier(0.45,0.05,0.55,0.95) infinite;
  animation-delay: var(--dot-delay, 0s);
  box-shadow: 0 0 8px rgba(212,162,76,0.4);
}
@keyframes lobbyOrbit {
  0% { transform: rotate(0deg) translateX(14px) scale(0.6); opacity: 0.3; }
  50% { transform: rotate(180deg) translateX(14px) scale(1); opacity: 1; }
  100% { transform: rotate(360deg) translateX(14px) scale(0.6); opacity: 0.3; }
}

.lobby-waiting-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.lobby-waiting-text.ready {
  color: var(--emerald);
  font-weight: 600;
}
.lobby-dots span {
  display: inline-block;
  animation: lobbyDotBounce 1.4s ease-in-out infinite;
}
.lobby-dots span:nth-child(2) { animation-delay: 0.15s; }
.lobby-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lobbyDotBounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* --- Start Section --- */
.lobby-start-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(to top,
      var(--bg-deep) 0%,
      rgba(5,8,17,0.98) 40%,
      rgba(5,8,17,0.85) 70%,
      transparent 100%
    );
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lobby-start-section::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,162,76,0.12), transparent);
  pointer-events: none;
}

/* Premium start button */
.lobby-start-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  padding: 16px 32px;
  border: none;
  border-radius: 16px;
  font-family: var(--font-latin);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--emerald), #34d399, #10b981);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
  box-shadow:
    0 4px 20px rgba(45,212,160,0.3),
    0 1px 3px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.lobby-start-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(45,212,160,0.4),
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.lobby-start-btn:not(:disabled):active { transform: translateY(0) scale(0.98); }
.lobby-start-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.lobby-start-btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  pointer-events: none;
}
.lobby-start-btn:not(:disabled) .lobby-start-btn-glow {
  animation: lobbyBtnGlow 3s ease-in-out infinite;
}
@keyframes lobbyBtnGlow {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.lobby-start-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 10px;
  transition: opacity var(--transition);
  text-align: center;
}
.lobby-start-hint.hidden { opacity: 0; }

/* --- Legacy player-card (game screen) --- */
.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 6px;
  border: 1px solid var(--border-card);
  transition: all var(--transition);
}

.player-card:hover { background: var(--bg-card-hover); }
.player-card.active { border-color: var(--gold); background: rgba(212, 162, 76, 0.06); box-shadow: 0 0 16px var(--gold-glow); }
.player-card.eliminated { opacity: 0.35; filter: grayscale(0.6); }
.player-card.ready { border-color: var(--emerald); background: rgba(45, 212, 160, 0.04); }

.stagger-fade-in > * {
  opacity: 0;
  transform: translateY(10px);
  animation: staggerFadeIn 0.4s ease-out forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-fade-in > *:nth-child(8) { animation-delay: 0.4s; }

@keyframes staggerFadeIn {
  to { opacity: 1; transform: translateY(0); }
}


/* ---------------------------------------------------------------
   GAME
   --------------------------------------------------------------- */

.active-player-display {
  text-align: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.active-player-display::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.active-player-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 4px; }
.active-player-name { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--gold), var(--gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.bomb-wrapper { position: relative; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.bomb-timer-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.6rem; font-weight: 900; color: var(--text-primary); font-variant-numeric: tabular-nums; z-index: 5; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }

.timer-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.04); stroke-width: 6; }
.timer-ring-progress { fill: none; stroke: var(--emerald); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.1s linear, stroke 0.5s; }
.timer-ring-progress.warning { stroke: var(--amber-warm); }
.timer-ring-progress.danger { stroke: var(--ruby); }

.fuse-glow { animation: fuseGlowPulse 0.3s ease-in-out infinite alternate; }
@keyframes fuseGlowPulse { 0% { opacity: 0.5; } 100% { opacity: 1; } }

.names-used-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.names-used-list .name-chip, .names-used-list > span, .names-used-list > div {
  display: inline-block; padding: 3px 10px; font-size: 0.78rem;
  background: rgba(212, 162, 76, 0.06); border: 1px solid rgba(212, 162, 76, 0.12);
  border-radius: var(--radius-pill); color: var(--text-secondary);
}

.answer-zone { position: relative; margin-top: 12px; }
.answer-input { width: 100%; padding: 14px 18px; border: 2px solid var(--border-card); border-radius: var(--radius); background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-latin); font-size: 1.1rem; outline: none; transition: all var(--transition); text-align: center; }
.answer-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.answer-input::placeholder { color: var(--text-muted); }
.answer-input.correct { border-color: var(--emerald); background: rgba(45, 212, 160, 0.06); box-shadow: 0 0 0 3px var(--emerald-glow); }
.answer-input.wrong { border-color: var(--ruby); background: rgba(239, 68, 68, 0.06); box-shadow: 0 0 0 3px var(--ruby-glow); animation: inputShake 0.4s ease-out; }

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.suggestions-list { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-elevated); border: 1px solid var(--border-card); border-radius: 0 0 var(--radius) var(--radius); max-height: 180px; overflow-y: auto; z-index: 20; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.suggestions-list > div, .suggestions-list > button { display: block; width: 100%; padding: 10px 16px; border: none; background: transparent; color: var(--text-primary); font-family: var(--font-latin); font-size: 0.9rem; text-align: left; cursor: pointer; transition: background var(--transition-fast); }
.suggestions-list > div:hover, .suggestions-list > button:hover { background: rgba(212, 162, 76, 0.08); }

.game-counter { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
.game-counter strong { color: var(--gold); font-weight: 800; }


/* ---------------------------------------------------------------
   GAME ARENA — Sacred Arcade Premium
   --------------------------------------------------------------- */

/* --- Arena container --- */
.game-arena {
  position: relative;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.game-arena.arena-compact {
  padding: 8px 0;
}

/* --- Circle container --- */
.arena-circle {
  position: relative;
  margin: 0 auto;
  flex-shrink: 0;
  overflow: visible;
}

/* --- Center bomb --- */
.arena-center-bomb {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.3s;
}

.arena-center-bomb.exploding {
  animation: arenaBombExplode 0.75s ease-out;
}

@keyframes arenaBombExplode {
  0%   { transform: translate(-50%, -50%) scale(1); filter: brightness(1); }
  12%  { transform: translate(-50%, -50%) scale(1.7); filter: brightness(3) saturate(1.5); }
  25%  { transform: translate(-50%, -50%) scale(0.7); filter: brightness(1.8); }
  40%  { transform: translate(-50%, -50%) scale(1.3); filter: brightness(1.3); }
  100% { transform: translate(-50%, -50%) scale(1); filter: brightness(1); }
}

/* Host bomb wrapper inside arena */
.arena-bomb-wrapper {
  width: 90px;
  height: 90px;
}

.arena-compact .arena-bomb-wrapper {
  width: 68px;
  height: 68px;
}

/* Mini bomb icon for player arena */
.arena-bomb-icon {
  filter: drop-shadow(0 3px 12px rgba(255, 165, 0, 0.35));
}

/* --- Player (absolutely positioned on circle) --- */
.arena-player {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity 0.6s ease, filter 0.6s ease;
  width: 76px;
  z-index: 3;
  overflow: visible;
}

.arena-player.active {
  z-index: 20;
}

.arena-player.eliminated {
  opacity: 0.2;
  filter: grayscale(1) brightness(0.7);
  pointer-events: none;
}

.arena-player.just-hit .arena-avatar {
  animation: arenaAvatarFlash 0.7s ease-out;
}

@keyframes arenaAvatarFlash {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.9); }
  25%  { box-shadow: 0 0 30px 12px rgba(239, 68, 68, 0.6); border-color: var(--ruby); }
  100% { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
}

/* --- Lives (hearts above avatar) --- */
.arena-lives {
  display: flex;
  gap: 3px;
  justify-content: center;
  min-height: 16px;
}

.arena-heart {
  width: 14px;
  height: 14px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.arena-heart.alive {
  fill: var(--ruby);
}

.arena-heart.lost {
  fill: var(--text-muted);
  opacity: 0.12;
  transform: scale(0.5);
}

.arena-heart.flying {
  animation: arenaHeartFly 0.9s ease-out forwards;
  z-index: 30;
  position: relative;
}

@keyframes arenaHeartFly {
  0%   { transform: scale(1); opacity: 1; }
  15%  { transform: scale(2) translateY(-5px); opacity: 1; fill: var(--ruby); }
  40%  { transform: scale(1.5) translateY(-25px); opacity: 0.8; }
  70%  { transform: scale(0.8) translateY(-50px); opacity: 0.3; }
  100% { transform: scale(0.3) translateY(-70px); opacity: 0; }
}

/* --- Avatar --- */
.arena-avatar-wrap {
  position: relative;
  transition: transform 0.3s;
}

.arena-avatar-wrap.shaking {
  animation: arenaShake 0.65s ease-out;
}

@keyframes arenaShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10%  { transform: translate(-6px, -3px) rotate(-8deg); }
  20%  { transform: translate(7px, 2px) rotate(6deg); }
  30%  { transform: translate(-5px, 5px) rotate(-5deg); }
  40%  { transform: translate(6px, -2px) rotate(4deg); }
  50%  { transform: translate(-4px, 3px) rotate(-3deg); }
  60%  { transform: translate(5px, -4px) rotate(3deg); }
  70%  { transform: translate(-3px, 2px) rotate(-2deg); }
  80%  { transform: translate(3px, -1px) rotate(1deg); }
  90%  { transform: translate(-1px, 1px) rotate(0deg); }
}

.arena-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--player-color, var(--gold-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
  border: 3px solid rgba(255,255,255,0.15);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

.arena-player.active .arena-avatar {
  border-color: var(--gold);
  box-shadow:
    0 0 24px var(--gold-glow),
    0 0 48px rgba(212,162,76,0.18),
    0 4px 20px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transform: scale(1.15);
}

/* --- Active ring animation --- */
.arena-active-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: arenaRingPulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes arenaRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.22); opacity: 0.08; }
}

/* --- Eliminated badge (X) --- */
.arena-elim-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  backdrop-filter: blur(2px);
}

.arena-elim-badge svg {
  width: 28px;
  height: 28px;
}

/* --- Name --- */
.arena-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.arena-name.crossed {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* --- "Toi" tag --- */
.arena-me-tag {
  font-size: 0.55rem;
  color: var(--gold-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1;
  text-shadow: 0 0 10px var(--gold-glow);
}

/* --- Typing bubble under active player --- */
.arena-player-typing {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%) translateY(-4px) scale(0.92);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-light);
  text-align: center;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 12px;
  background: rgba(212,162,76,0.12);
  border: 1px solid rgba(212,162,76,0.3);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(6px);
  z-index: 50;
}

.arena-player-typing::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid rgba(212,162,76,0.3);
}

.arena-player-typing.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Blinking cursor when typing */
.arena-player-typing.visible::after {
  content: '\2758';
  margin-left: 1px;
  animation: arenaCursorBlink 0.7s step-end infinite;
  font-weight: 400;
}

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

/* --- Error cross animation --- */
.arena-error-cross {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
}

.arena-error-cross svg {
  width: 64px;
  height: 64px;
  opacity: 0;
  filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.5));
}

.arena-error-cross.animate svg {
  animation: arenaErrorPop 0.85s ease-out forwards;
}

@keyframes arenaErrorPop {
  0%   { opacity: 0; transform: scale(0.2) rotate(-15deg); }
  18%  { opacity: 1; transform: scale(1.5) rotate(5deg); }
  35%  { transform: scale(0.9) rotate(-2deg); opacity: 1; }
  50%  { transform: scale(1.05) rotate(0deg); opacity: 0.9; }
  100% { opacity: 0; transform: scale(0.7) rotate(0deg); }
}

/* --- Lock overlay animation (already-used names) --- */
.arena-lock-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
}

.arena-lock-overlay svg {
  width: 64px;
  height: 64px;
  opacity: 0;
  color: #f59e0b;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.5));
}

.arena-lock-overlay.animate svg {
  animation: arenaLockShake 1.2s ease-out forwards;
}

@keyframes arenaLockShake {
  0%   { opacity: 0; transform: scale(0.2); }
  15%  { opacity: 1; transform: scale(1.3); }
  25%  { transform: scale(1.0) translateX(-6px); }
  30%  { transform: scale(1.0) translateX(6px); }
  35%  { transform: scale(1.0) translateX(-5px); }
  40%  { transform: scale(1.0) translateX(5px); }
  45%  { transform: scale(1.0) translateX(-3px); }
  50%  { transform: scale(1.0) translateX(3px); }
  55%  { transform: scale(1.0) translateX(-1px); }
  60%  { transform: scale(1.0) translateX(0); opacity: 1; }
  100% { opacity: 0; transform: scale(0.7); }
}

/* --- Explosion particles (spawned by JS) --- */
.arena-explosion-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 25;
  animation: arenaParticleFly var(--dur, 0.8s) ease-out forwards;
}

@keyframes arenaParticleFly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0); opacity: 0; }
}

/* --- Compact arena (player myTurn page) --- */
.arena-compact .arena-avatar {
  width: 42px;
  height: 42px;
  font-size: 0.95rem;
}

.arena-compact .arena-heart {
  width: 11px;
  height: 11px;
}

.arena-compact .arena-player {
  width: 62px;
  gap: 3px;
}

.arena-compact .arena-name {
  font-size: 0.64rem;
}

.arena-compact .arena-active-ring {
  inset: -6px;
}

.arena-compact .arena-bomb-wrapper {
  width: 68px;
  height: 68px;
}

/* --- Responsive: small screens --- */
@media (max-width: 400px) {
  .arena-avatar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .arena-heart {
    width: 12px;
    height: 12px;
  }

  .arena-player {
    width: 66px;
  }

  .arena-bomb-wrapper {
    width: 74px;
    height: 74px;
  }

  .arena-compact .arena-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .arena-compact .arena-bomb-wrapper {
    width: 56px;
    height: 56px;
  }
}


/* ---------------------------------------------------------------
   WAIT / ELIMINATED / SPECTATOR
   --------------------------------------------------------------- */

/* ---------------------------------------------------------------
   PLAYER LOBBY (plobby) — Premium Redesign
   --------------------------------------------------------------- */

.plobby-container {
  padding-bottom: 110px;
  position: relative;
  z-index: 1;
}

/* Stagger for player lobby */
.plobby-stagger {
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  filter: blur(6px);
  animation: lobbyEnter 0.7s cubic-bezier(0.22,1,0.36,1) forwards;
  animation-delay: calc(var(--stagger, 0) * 0.12s + 0.1s);
}

.plobby-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 18px;
}

.plobby-header-center { flex: 1; }

.plobby-title {
  font-family: var(--font-latin);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.plobby-code-pill {
  font-family: var(--font-latin);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
  background: rgba(212,162,76,0.06);
  border: 1px solid rgba(212,162,76,0.2);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Status hero card */
.plobby-status-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  background: rgba(12,16,32,0.6);
  border: 1px solid rgba(212,162,76,0.1);
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.plobby-status-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,162,76,0.25), transparent);
}
.plobby-status-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 0% 50%, rgba(212,162,76,0.04), transparent 60%);
  pointer-events: none;
}

.plobby-status-visual {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.plobby-status-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Orbit ring */
.plobby-orbit-ring {
  position: absolute;
  inset: 0;
}
.plobby-orbit-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  top: 50%;
  left: 50%;
  margin: -2.5px;
  animation: plobbyOrbit 2.4s linear infinite;
  animation-delay: calc(var(--orbit-i, 0) * 0.8s);
  box-shadow: 0 0 6px rgba(212,162,76,0.5);
}
@keyframes plobbyOrbit {
  0% { transform: rotate(0deg) translateX(24px) scale(0.5); opacity: 0.2; }
  50% { transform: rotate(180deg) translateX(24px) scale(1); opacity: 1; }
  100% { transform: rotate(360deg) translateX(24px) scale(0.5); opacity: 0.2; }
}

.plobby-status-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.plobby-status-title {
  font-family: var(--font-latin);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}
.plobby-status-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}

/* Players section */
.plobby-section { margin-bottom: 16px; }

.plobby-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.plobby-section-title {
  font-family: var(--font-latin);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.plobby-section-count {
  font-family: var(--font-latin);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(212,162,76,0.08);
  border: 1px solid rgba(212,162,76,0.12);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.plobby-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Player card */
.plobby-player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(15,19,36,0.5);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  animation: plobbyPlayerIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.plobby-player::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--p-color, rgba(212,162,76,0.3));
  opacity: 0.6;
}
.plobby-player.is-ready {
  border-color: rgba(45,212,160,0.18);
  background: rgba(45,212,160,0.03);
}
.plobby-player.is-ready::before {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald-glow);
}

@keyframes plobbyPlayerIn {
  from { opacity: 0; transform: translateX(-16px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.plobby-player-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-latin);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--p-color, var(--gold)), color-mix(in srgb, var(--p-color, var(--gold)) 50%, #000));
  border: 2px solid color-mix(in srgb, var(--p-color, var(--gold)) 60%, #fff);
  box-shadow: 0 0 14px color-mix(in srgb, var(--p-color, var(--gold)) 30%, transparent);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.plobby-player-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.plobby-player-name {
  font-family: var(--font-latin);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.plobby-player-you {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold);
  background: linear-gradient(135deg, rgba(212,162,76,0.15), rgba(212,162,76,0.08));
  border: 1px solid rgba(212,162,76,0.2);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}
.plobby-player-host {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}

.plobby-player-ready {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  border: 1.5px solid rgba(255,255,255,0.06);
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  z-index: 1;
}
.plobby-player-ready.is-ready {
  background: rgba(45,212,160,0.12);
  border-color: var(--emerald);
  color: var(--emerald);
  box-shadow: 0 0 10px rgba(45,212,160,0.2);
  transform: scale(1.1);
}

/* Bottom ready button */
.plobby-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg-deep) 60%, rgba(5,8,17,0.9) 80%, transparent);
  z-index: 100;
  display: flex;
  justify-content: center;
}

.plobby-ready-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 400px;
  width: 100%;
  padding: 16px 32px;
  border: none;
  border-radius: 16px;
  font-family: var(--font-latin);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--emerald), #34d399, #10b981);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
  box-shadow:
    0 4px 20px rgba(45,212,160,0.3),
    0 1px 3px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.plobby-ready-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(45,212,160,0.4),
    0 2px 8px rgba(0,0,0,0.3);
}
.plobby-ready-btn:active { transform: translateY(0) scale(0.98); }

.plobby-ready-pulse {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  animation: plobbyReadyPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes plobbyReadyPulse {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.plobby-ready-icon { flex-shrink: 0; position: relative; z-index: 1; }
.plobby-ready-label { position: relative; z-index: 1; }

/* Active state (already ready) */
.plobby-ready-active {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}
.plobby-ready-active .plobby-ready-pulse { display: none; }
.plobby-ready-active .plobby-ready-icon { stroke: var(--text-muted); }

.wait-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 70vh; padding: 20px 0; }
.wait-message { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px; }
.wait-current-player { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--gold), var(--gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.spectator-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; min-height: 80vh; }
.spectator-main { display: flex; flex-direction: column; align-items: center; }
.spectator-sidebar { background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--border-card); align-self: start; position: sticky; top: 20px; max-height: calc(100vh - 60px); overflow-y: auto; }
.spectator-sidebar::-webkit-scrollbar { width: 3px; }
.spectator-sidebar::-webkit-scrollbar-thumb { background: rgba(212, 162, 76, 0.2); border-radius: 3px; }

@media (max-width: 768px) {
  .spectator-layout { grid-template-columns: 1fr; }
  .spectator-sidebar { position: static; max-height: none; }
}


/* ---------------------------------------------------------------
   RESULTS
   --------------------------------------------------------------- */

.results-container { text-align: center; padding: 30px 0; max-width: 600px; margin: 0 auto; }
.title-display { font-family: var(--font-arabic); color: var(--sacred-gold); text-shadow: 0 0 30px rgba(212, 162, 76, 0.25); line-height: 1.3; direction: rtl; }
.podium-container { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 30px auto; height: 220px; max-width: 400px; }

.names-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; margin-top: 10px; }
.names-results-grid > * { padding: 4px 8px; font-size: 0.75rem; background: rgba(212, 162, 76, 0.05); border: 1px solid rgba(212, 162, 76, 0.1); border-radius: 8px; text-align: center; color: var(--text-secondary); transition: all var(--transition-fast); }
.names-results-grid > .used, .names-results-grid > .found { background: rgba(45, 212, 160, 0.08); border-color: rgba(45, 212, 160, 0.2); color: var(--emerald); }
.names-results-grid > .missed { opacity: 0.4; }

/* ===========================
   RES — RESULTS PAGE (premium redesign v3)
   =========================== */

/* --- Background Orbs --- */
.res-bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.res-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: resBgOrbFloat var(--orb-dur, 10s) ease-in-out var(--orb-delay, 0s) infinite alternate,
             resBgOrbFadeIn 2s ease var(--orb-delay, 0s) forwards;
}

@keyframes resBgOrbFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 15px) scale(0.9); }
  100% { transform: translate(10px, -30px) scale(1.05); }
}

@keyframes resBgOrbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Wrapper --- */
.res-wrapper {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
}

/* --- Radial glow backdrop --- */
.res-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: resGlowIn 1.5s ease 0.2s forwards;
  z-index: 0;
}

.res-glow.victory {
  background: radial-gradient(circle, rgba(212, 162, 76, 0.3) 0%, rgba(212, 162, 76, 0.1) 35%, transparent 70%);
}

.res-glow.silver {
  background: radial-gradient(circle, rgba(192, 192, 192, 0.22) 0%, rgba(192, 192, 192, 0.07) 35%, transparent 70%);
}

.res-glow.bronze {
  background: radial-gradient(circle, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.06) 35%, transparent 70%);
}

.res-glow.tie {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.08) 35%, transparent 70%);
}

@keyframes resGlowIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.3); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.05); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* --- Banner --- */
.res-banner {
  position: relative;
  padding: 40px 16px 28px;
  overflow: hidden;
  z-index: 1;
}

.res-banner-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.res-banner-particle {
  position: absolute;
  border-radius: 50%;
  animation: resBannerFloat var(--dur, 3s) ease-in-out infinite alternate;
  opacity: 0;
}

.res-banner-particle.diamond {
  border-radius: 2px;
  transform: rotate(45deg);
}

@keyframes resBannerFloat {
  0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.5); }
  20% { opacity: var(--op, 0.6); }
  100% { opacity: 0; transform: translateY(var(--ty, -40px)) translateX(var(--tx, 0px)) scale(1.3) rotate(180deg); }
}

/* --- Icon container --- */
.res-banner-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  animation: resIconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.res-banner-icon svg {
  width: 38px;
  height: 38px;
}

.res-banner.victory .res-banner-icon {
  background: linear-gradient(145deg, rgba(212, 162, 76, 0.25), rgba(212, 162, 76, 0.05));
  border: 2px solid var(--gold);
  box-shadow: 0 0 40px rgba(212, 162, 76, 0.35), 0 0 80px rgba(212, 162, 76, 0.1);
}

.res-banner.victory .res-banner-icon svg {
  stroke: var(--gold-bright);
  filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.6));
}

.res-banner.place-2 .res-banner-icon {
  background: linear-gradient(145deg, rgba(192, 192, 192, 0.18), rgba(192, 192, 192, 0.04));
  border: 2px solid rgba(192, 192, 192, 0.5);
  box-shadow: 0 0 25px rgba(192, 192, 192, 0.2);
}

.res-banner.place-2 .res-banner-icon svg {
  stroke: #d4d4d4;
  filter: drop-shadow(0 0 4px rgba(192, 192, 192, 0.4));
}

.res-banner.place-3 .res-banner-icon {
  background: linear-gradient(145deg, rgba(205, 127, 50, 0.18), rgba(205, 127, 50, 0.04));
  border: 2px solid rgba(205, 127, 50, 0.4);
  box-shadow: 0 0 25px rgba(205, 127, 50, 0.15);
}

.res-banner.place-3 .res-banner-icon svg {
  stroke: #e8a960;
  filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.4));
}

.res-banner.tie .res-banner-icon {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.05));
  border: 2px solid rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 35px rgba(139, 92, 246, 0.25), 0 0 70px rgba(139, 92, 246, 0.08);
}

.res-banner.tie .res-banner-icon svg {
  stroke: #c4b5fd;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.5));
}

.res-banner.defeat .res-banner-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  width: 68px;
  height: 68px;
}

.res-banner.defeat .res-banner-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-muted);
  opacity: 0.6;
}

@keyframes resIconPop {
  0% { opacity: 0; transform: scale(0) rotate(-20deg); }
  40% { opacity: 1; transform: scale(1.2) rotate(5deg); }
  70% { transform: scale(0.95) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Pulsing rings */
.res-banner.victory .res-banner-icon::after,
.res-banner.tie .res-banner-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  opacity: 0;
  animation: resIconPulse 2s ease-in-out 1s infinite;
}

.res-banner.tie .res-banner-icon::after {
  border-color: rgba(167, 139, 250, 0.6);
}

.res-banner.victory .res-banner-icon::before,
.res-banner.tie .res-banner-icon::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  animation: resIconPulse 2s ease-in-out 1.5s infinite;
}

.res-banner.tie .res-banner-icon::before {
  border-color: rgba(167, 139, 250, 0.4);
}

@keyframes resIconPulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* --- Title --- */
.res-banner-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0;
  line-height: 1.1;
  position: relative;
  animation: resBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes resBannerTitle {
  0% { opacity: 0; transform: scale(0.2) translateY(30px); letter-spacing: 0.5em; }
  50% { transform: scale(1.08) translateY(-4px); }
  75% { transform: scale(0.98) translateY(1px); }
  100% { opacity: 1; transform: scale(1) translateY(0); letter-spacing: 0.12em; }
}

.res-banner.victory .res-banner-title {
  background: linear-gradient(135deg, var(--gold-bright), #fff6c2, var(--gold), #ffe0a0, var(--gold-bright));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(212, 162, 76, 0.5));
  animation: resBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             resGoldShift 3s ease-in-out 1.2s infinite;
}

@keyframes resGoldShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.res-banner.victory .res-banner-title::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: resShimmer 2.5s ease-in-out 1.5s infinite;
}

@keyframes resShimmer {
  0% { left: -100%; }
  100% { left: 300%; }
}

.res-banner.tie .res-banner-title {
  background: linear-gradient(135deg, #a78bfa, #ddd6fe, #818cf8, #c4b5fd, #a78bfa);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.4));
  animation: resBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             resTieShift 4s ease-in-out 1.2s infinite;
}

@keyframes resTieShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.res-banner.tie .res-banner-title::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: resShimmer 3s ease-in-out 2s infinite;
}

.res-banner.defeat .res-banner-title {
  color: var(--text-secondary);
  opacity: 0.55;
  font-size: 2.4rem;
  letter-spacing: 0.06em;
}

.res-banner.place-2 .res-banner-title {
  background: linear-gradient(135deg, #b0b0b0, #f0f0f0, #c0c0c0, #e8e8e8, #a0a0a0);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  animation: resBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             resTieShift 5s ease-in-out 1.2s infinite;
}

.res-banner.place-3 .res-banner-title {
  background: linear-gradient(135deg, #cd7f32, #e8c080, #d4a060, #b87333);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  animation: resBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             resTieShift 5s ease-in-out 1.2s infinite;
}

/* --- Rank subtitle --- */
.res-banner-rank {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 10px;
  animation: resFadeSlideIn 0.6s ease 0.7s both;
}

.res-banner.victory .res-banner-rank {
  color: var(--gold-light);
  opacity: 0.85;
}

.res-banner.tie .res-banner-rank {
  color: #c4b5fd;
  opacity: 0.85;
}

/* --- Subtitle --- */
.res-subtitle {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  z-index: 1;
  animation: resFadeSlideIn 0.5s ease 0.5s both;
}

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

@keyframes resFadeSlideIn {
  from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* --- Podium --- */
.res-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  min-height: 250px;
  padding: 20px 0 0;
  z-index: 1;
  perspective: 600px;
}

.pod-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: podRise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pod-col:nth-child(1) { animation-delay: 0.4s; }
.pod-col:nth-child(2) { animation-delay: 0.15s; }
.pod-col:nth-child(3) { animation-delay: 0.6s; }

@keyframes podRise {
  0% { opacity: 0; transform: translateY(60px) scale(0.7); }
  60% { transform: translateY(-8px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.pod-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pod-avatar:hover {
  transform: scale(1.1);
}

.pod-col.first .pod-avatar {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
  border: 3px solid var(--gold);
  box-shadow: 0 0 32px var(--gold-glow), 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: podAvatarGlow 2s ease-in-out 1.2s infinite alternate;
}

.res-podium.is-tie .pod-col.first .pod-avatar,
.pod-col.pod-tied .pod-avatar {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: podAvatarTieGlow 2s ease-in-out 1.2s infinite alternate;
}

@keyframes podAvatarGlow {
  0% { box-shadow: 0 0 24px var(--gold-glow), 0 6px 20px rgba(0, 0, 0, 0.35); }
  100% { box-shadow: 0 0 44px var(--gold-glow-strong), 0 6px 20px rgba(0, 0, 0, 0.35); }
}

@keyframes podAvatarTieGlow {
  0% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35); }
  100% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.45), 0 6px 20px rgba(0, 0, 0, 0.35); }
}

.pod-crown {
  position: absolute;
  top: -20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  animation: podCrownBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1s both;
}

@keyframes podCrownBounce {
  0% { opacity: 0; transform: translateY(-20px) scale(0); }
  60% { transform: translateY(3px) scale(1.2); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.pod-crown svg {
  width: 24px;
  height: 24px;
  stroke: var(--gold-bright);
  fill: none;
  filter: drop-shadow(0 0 6px rgba(212, 162, 76, 0.7));
}

.pod-name {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pod-col.first .pod-name {
  color: var(--gold-bright);
}

.res-podium.is-tie .pod-col.first .pod-name,
.pod-col.pod-tied .pod-name {
  color: #c4b5fd;
}

.pod-me {
  color: var(--emerald) !important;
}

.pod-score {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pod-bar {
  width: 86px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  position: relative;
  overflow: hidden;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pod-col.first .pod-bar {
  height: 110px;
  width: 106px;
  background: linear-gradient(to top, rgba(212, 162, 76, 0.25), rgba(212, 162, 76, 0.03));
  border: 1px solid var(--gold);
  border-bottom: none;
  color: var(--gold);
  box-shadow: 0 0 28px rgba(212, 162, 76, 0.15);
}

.pod-col.first .pod-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.12), transparent);
  animation: podBarShimmer 3s ease-in-out 1.5s infinite;
}

@keyframes podBarShimmer {
  0% { left: -100%; }
  100% { left: 250%; }
}

.pod-col.second .pod-bar {
  height: 76px;
  background: linear-gradient(to top, rgba(192, 192, 192, 0.1), rgba(192, 192, 192, 0.02));
  border: 1px solid rgba(192, 192, 192, 0.25);
  border-bottom: none;
  color: rgba(192, 192, 192, 0.6);
}

.pod-col.third .pod-bar {
  height: 52px;
  background: linear-gradient(to top, rgba(180, 120, 60, 0.1), rgba(180, 120, 60, 0.02));
  border: 1px solid rgba(180, 120, 60, 0.22);
  border-bottom: none;
  color: rgba(180, 120, 60, 0.6);
}

.pod-col.pod-tied .pod-bar {
  height: 88px !important;
  background: linear-gradient(to top, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.03));
  border-color: rgba(167, 139, 250, 0.35);
  color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

.pod-col.pod-tied .pod-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
  animation: podBarShimmer 3.5s ease-in-out 2s infinite;
}

/* --- Stats row --- */
.res-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(15, 19, 36, 0.9), rgba(20, 25, 48, 0.85));
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), inset 0 0 40px rgba(212, 162, 76, 0.02);
  z-index: 1;
  animation: resFadeSlideIn 0.6s ease 0.6s both;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.res-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.res-stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-bright);
  transition: color 0.3s ease;
}

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

.res-stat-divider {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--border-card), transparent);
}

/* --- Names grid card --- */
.res-names-card {
  background: linear-gradient(135deg, rgba(15, 19, 36, 0.9), rgba(20, 25, 48, 0.85));
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  z-index: 1;
  animation: resFadeSlideIn 0.6s ease 0.7s both;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.res-names-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
}

.res-names-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.res-names-count {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.res-names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
  padding: 12px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 162, 76, 0.2) transparent;
}

.res-names-grid::-webkit-scrollbar {
  width: 4px;
}

.res-names-grid::-webkit-scrollbar-thumb {
  background: rgba(212, 162, 76, 0.2);
  border-radius: 4px;
}

.res-name-chip {
  padding: 8px 10px;
  font-size: 0.7rem;
  border-radius: 10px;
  text-align: center;
  transition: all 0.25s ease;
  animation: resChipIn 0.4s ease both;
  animation-delay: calc(var(--chip-index, 0) * 30ms + 1s);
  cursor: default;
}

.res-name-chip.found {
  background: rgba(45, 212, 160, 0.06);
  border: 1px solid rgba(45, 212, 160, 0.12);
  color: var(--emerald);
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  direction: rtl;
}

.res-name-chip.found:hover {
  background: rgba(45, 212, 160, 0.14);
  border-color: rgba(45, 212, 160, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 212, 160, 0.15);
}

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

/* --- Action buttons --- */
.res-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
  animation: resFadeSlideIn 0.6s ease 0.85s both;
}

.res-btn-replay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 24px rgba(212, 162, 76, 0.3);
  position: relative;
  overflow: hidden;
}

.res-btn-replay::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.res-btn-replay:hover::before {
  left: 100%;
}

.res-btn-replay:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 8px 32px rgba(212, 162, 76, 0.45);
  transform: translateY(-3px);
}

.res-btn-replay:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 12px rgba(212, 162, 76, 0.3);
}

.res-btn-replay:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.res-btn-home {
  width: 100%;
  padding: 14px 24px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.res-btn-home:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: rgba(212, 162, 76, 0.06);
  transform: translateY(-1px);
}

/* --- Results Mobile --- */
@media (max-width: 480px) {
  .res-wrapper {
    padding: 16px 14px 32px;
    gap: 20px;
  }

  .res-glow {
    width: 300px;
    height: 300px;
    top: -50px;
  }

  .res-banner {
    padding: 28px 12px 20px;
  }

  .res-banner-icon {
    width: 66px;
    height: 66px;
    margin-bottom: 12px;
  }

  .res-banner-icon svg {
    width: 32px;
    height: 32px;
  }

  .res-banner.defeat .res-banner-icon {
    width: 58px;
    height: 58px;
  }

  .res-banner.defeat .res-banner-icon svg {
    width: 26px;
    height: 26px;
  }

  .res-banner-title {
    font-size: 2.4rem;
  }

  .res-banner.defeat .res-banner-title {
    font-size: 1.9rem;
  }

  .res-banner.place-2 .res-banner-title,
  .res-banner.place-3 .res-banner-title {
    font-size: 2rem;
  }

  .res-banner.tie .res-banner-title {
    font-size: 2.4rem;
  }

  .res-podium {
    gap: 8px;
    min-height: 220px;
    padding: 12px 0 0;
  }

  .pod-avatar {
    width: 46px;
    height: 46px;
    font-size: 1rem;
  }

  .pod-col.first .pod-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
  }

  .pod-bar {
    width: 72px;
  }

  .pod-col.first .pod-bar {
    width: 88px;
    height: 92px;
  }

  .pod-col.second .pod-bar { height: 64px; }
  .pod-col.third .pod-bar { height: 44px; }

  .pod-col.pod-tied .pod-bar {
    height: 76px !important;
  }

  .pod-name {
    font-size: 0.76rem;
    max-width: 75px;
  }

  .pod-crown {
    top: -16px;
  }

  .pod-crown svg {
    width: 20px;
    height: 20px;
  }

  .res-stats {
    gap: 14px;
    padding: 14px 16px;
  }

  .res-stat-value {
    font-size: 1.35rem;
  }

  .res-stat-label {
    font-size: 0.62rem;
  }

  .res-names-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 4px;
    padding: 10px;
    max-height: 180px;
  }

  .res-name-chip.found {
    font-size: 0.82rem;
    padding: 6px 8px;
  }

  .res-btn-replay {
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .res-btn-home {
    padding: 12px 20px;
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .res-banner-title {
    font-size: 2rem;
  }

  .res-banner.tie .res-banner-title {
    font-size: 2rem;
  }

  .pod-bar {
    width: 60px;
  }

  .pod-col.first .pod-bar {
    width: 74px;
    height: 80px;
  }

  .pod-col.second .pod-bar { height: 56px; }
  .pod-col.third .pod-bar { height: 38px; }

  .res-stats {
    gap: 10px;
    padding: 12px 12px;
  }

  .res-stat-value {
    font-size: 1.2rem;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .res-wrapper {
    gap: 14px;
    padding: 12px 16px 24px;
  }

  .res-banner {
    padding: 16px 12px 12px;
  }

  .res-banner-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
  }

  .res-banner-icon svg {
    width: 24px;
    height: 24px;
  }

  .res-banner-title {
    font-size: 1.8rem;
  }

  .res-podium {
    min-height: 160px;
  }

  .pod-col.first .pod-bar { height: 70px; }
  .pod-col.second .pod-bar { height: 50px; }
  .pod-col.third .pod-bar { height: 35px; }
}


/* ===========================
   PREMIUM DIALOG POPUP
   =========================== */

.dlg-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 17, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.dlg-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.dlg-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(165deg, rgba(18, 22, 42, 0.97), rgba(10, 14, 28, 0.98));
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dlg-overlay.visible .dlg-card {
  transform: scale(1) translateY(0);
}

/* Top gold accent line */
.dlg-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 0 0 2px 2px;
}

.dlg-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dlg-icon.warning {
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.15);
}

.dlg-icon.warning svg {
  color: var(--ruby);
}

.dlg-icon.info {
  background: rgba(212, 162, 76, 0.1);
  box-shadow: 0 0 24px rgba(212, 162, 76, 0.15);
}

.dlg-icon.info svg {
  color: var(--gold);
}

.dlg-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.dlg-message {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.dlg-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.dlg-btn {
  flex: 1;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dlg-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

.dlg-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-active);
  color: var(--text-primary);
}

.dlg-btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.dlg-btn-danger:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.dlg-btn-danger:active {
  transform: translateY(0) scale(0.98);
}

.dlg-btn-primary {
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.2), rgba(45, 212, 160, 0.1));
  border: 1px solid rgba(45, 212, 160, 0.3);
  color: #2dd4a0;
  box-shadow: 0 4px 16px rgba(45, 212, 160, 0.15);
}

.dlg-btn-primary:hover {
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.3), rgba(45, 212, 160, 0.15));
  box-shadow: 0 6px 24px rgba(45, 212, 160, 0.25);
  transform: translateY(-1px);
}

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

.dlg-btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--bg-deep);
  box-shadow: 0 4px 16px rgba(212, 162, 76, 0.25);
}

.dlg-btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 6px 24px rgba(212, 162, 76, 0.35);
  transform: translateY(-1px);
}

.dlg-btn-gold:active {
  transform: translateY(0) scale(0.98);
}

/* Single-button variant */
.dlg-actions.single {
  justify-content: center;
}

.dlg-actions.single .dlg-btn {
  flex: none;
  min-width: 180px;
}

@media (max-width: 480px) {
  .dlg-card {
    padding: 24px 20px;
    border-radius: var(--radius);
  }

  .dlg-icon {
    width: 48px;
    height: 48px;
  }

  .dlg-title {
    font-size: 1.05rem;
  }

  .dlg-btn {
    padding: 12px 16px;
    font-size: 0.85rem;
  }
}

/* ---------------------------------------------------------------
   TEXT / LAYOUT UTILITIES
   --------------------------------------------------------------- */

.text-dim { color: var(--text-muted); }
.text-arabic-large { font-family: var(--font-arabic); font-size: 2rem; color: var(--sacred-gold); direction: rtl; text-shadow: 0 0 20px rgba(212, 162, 76, 0.15); text-align: center; }
.text-translit { font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); }
.flex { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 8px; }


/* ===========================
   ENCYCLOPEDIA
   =========================== */

/* --- Encyclopedia page: scrollable, no flex centering --- */
#pageEncyclopedia.active {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
#pageEncyclopedia > .container {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0;
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  max-width: 100%;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}
/* Responsive widths for encyclopedia */
@media (min-width: 640px) {
  #pageEncyclopedia > .container {
    max-width: 640px;
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (min-width: 768px) {
  #pageEncyclopedia > .container {
    max-width: 768px;
  }
  .ency-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
}
@media (min-width: 1024px) {
  #pageEncyclopedia > .container {
    max-width: 960px;
    padding-left: 32px;
    padding-right: 32px;
  }
  .ency-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
  }
  .ency-card {
    padding: 26px 14px 24px;
  }
  .ency-card-arabic {
    font-size: 2.3rem;
  }
}
@media (min-width: 1280px) {
  #pageEncyclopedia > .container {
    max-width: 1100px;
    padding-left: 40px;
    padding-right: 40px;
  }
  .ency-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ===========================
   ENCYCLOPEDIA — Topbar (scrolls with content)
   =========================== */
.ency-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 4px 16px;
  position: relative;
}
.ency-topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.12), transparent);
}
.ency-topbar-back {
  flex-shrink: 0;
}
.ency-topbar-center {
  flex: 1;
  min-width: 0;
}
.ency-topbar-title {
  font-family: var(--font-display, var(--font-latin));
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.ency-topbar-subtitle {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.ency-header-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-left: auto;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(212, 162, 76, 0.06);
  border: 1px solid rgba(212, 162, 76, 0.12);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* ===========================
   ENCYCLOPEDIA — Toolbar (Search + Categories)
   Sticky inside the scrollable container
   =========================== */
.ency-toolbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(5, 8, 17, 0.92);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  margin: 10px -4px 0;
  padding: 14px 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transition: box-shadow 0.3s ease;
}

/* --- Search Bar --- */
.ency-search-bar {
  position: relative;
  display: flex;
  align-items: center;
}
.ency-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gold-deep);
  pointer-events: none;
  transition: color 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
  z-index: 3;
  filter: drop-shadow(0 0 4px rgba(212, 162, 76, 0.15));
}
.ency-search-bar:focus-within .ency-search-icon {
  color: var(--gold);
  transform: translateY(-50%) scale(1.12);
  filter: drop-shadow(0 0 10px rgba(212, 162, 76, 0.5));
}
.ency-search-input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 48px 0 50px !important;
  background: linear-gradient(135deg, rgba(12, 15, 30, 0.85) 0%, rgba(18, 22, 42, 0.75) 100%);
  border: 1px solid rgba(212, 162, 76, 0.12);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 52px;
  outline: none;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ency-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 1;
  line-height: normal;
  letter-spacing: 0.02em;
}
.ency-search-input:focus {
  border-color: rgba(212, 162, 76, 0.45);
  background: linear-gradient(135deg, rgba(15, 19, 36, 0.95) 0%, rgba(22, 28, 52, 0.9) 100%);
  box-shadow:
    0 0 0 3px rgba(212, 162, 76, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(212, 162, 76, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Remove browser-native search styling */
.ency-search-input::-webkit-search-cancel-button,
.ency-search-input::-webkit-search-decoration,
.ency-search-input::-webkit-search-results-button,
.ency-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.ency-search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(212, 162, 76, 0.08);
  border: 1px solid rgba(212, 162, 76, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
}
.ency-search-clear:hover {
  background: rgba(212, 162, 76, 0.15);
  border-color: rgba(212, 162, 76, 0.25);
  color: var(--gold-light);
  transform: translateY(-50%) scale(1.1);
}

/* --- Category Filter Pills --- */
.ency-cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.ency-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: var(--font-latin);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}
/* Chip subtle shimmer on hover */
.ency-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(212, 162, 76, 0.06) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ency-chip:hover::before { opacity: 1; }

.ency-chip-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.ency-chip.active .ency-chip-icon {
  opacity: 1;
}
.ency-chip-label {
  font-size: 0.78rem;
  font-weight: 600;
  position: relative;
}
.ency-chip-count {
  font-size: 0.62rem;
  opacity: 0.3;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  position: relative;
}

/* Hover & active states */
.ency-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 162, 76, 0.15);
  transform: translateY(-1px);
}
.ency-chip:active {
  transform: scale(0.96) translateY(0);
  transition-duration: 0.06s;
}
.ency-chip.active {
  background: rgba(212, 162, 76, 0.1);
  border-color: rgba(212, 162, 76, 0.3);
  color: var(--gold);
  box-shadow: 0 2px 12px rgba(212, 162, 76, 0.08);
}
.ency-chip.active .ency-chip-count { opacity: 0.55; }

/* Focus visible for keyboard nav */
.ency-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.ency-chip.ency-chip-all {
  gap: 5px;
}

/* ===========================
   ENCYCLOPEDIA — Names Grid
   =========================== */
.ency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
  padding-top: 18px;
  contain: layout style;
}
@media (min-width: 540px) {
  .ency-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

.ency-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  animation: encyFadeIn 0.4s ease both;
}
.ency-empty-icon {
  margin-bottom: 12px;
  opacity: 0.3;
  color: var(--text-muted);
}
.ency-empty-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===========================
   ENCYCLOPEDIA — Name Card
   =========================== */
.ency-card {
  background: linear-gradient(168deg, rgba(14, 18, 35, 0.92) 0%, rgba(10, 14, 28, 0.88) 100%);
  border: 1px solid rgba(212, 162, 76, 0.08);
  border-radius: 18px;
  padding: 24px 12px 22px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease,
              box-shadow 0.35s ease,
              background 0.35s ease;
  position: relative;
  overflow: hidden;
  contain: layout style paint;
  opacity: 0;
  transform: translateY(16px);
  animation: encyCardEntrance 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--stagger-delay, 0ms);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
/* Fine top edge highlight */
.ency-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.15), transparent);
  transition: opacity 0.3s ease;
}
/* Inner glow — hidden at rest, appears on hover */
.ency-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 70% 50% at 50% 30%, var(--card-glow, rgba(212, 162, 76, 0.05)), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.ency-card:hover {
  border-color: var(--card-accent, rgba(212, 162, 76, 0.3));
  transform: translateY(-5px) scale(1.02);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 20px var(--card-glow, rgba(212, 162, 76, 0.06));
  background: linear-gradient(168deg, rgba(18, 23, 44, 0.95) 0%, rgba(14, 18, 35, 0.92) 100%);
}
.ency-card:hover::before { opacity: 1; }
.ency-card:hover::after { opacity: 1; }
.ency-card:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.06s;
}
/* Focus visible */
.ency-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.ency-card-number-badge {
  position: absolute;
  top: 9px; right: 11px;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.25s ease, color 0.25s ease;
  z-index: 1;
}
.ency-card:hover .ency-card-number-badge { opacity: 0.65; color: var(--gold-deep); }

.ency-card-arabic {
  font-family: var(--font-arabic);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
  text-shadow: 0 0 16px rgba(212, 162, 76, 0.2);
  transition: text-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  z-index: 1;
}
.ency-card:hover .ency-card-arabic {
  text-shadow: 0 0 28px var(--gold-glow);
  transform: scale(1.04);
}

.ency-card-translit {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 8px;
  letter-spacing: 0.02em;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

.ency-card-meaning {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.45;
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}

.ency-card-cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--card-accent, var(--gold));
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.3;
  transition: opacity 0.25s ease, box-shadow 0.25s ease;
  z-index: 1;
}
.ency-card:hover .ency-card-cat-dot {
  opacity: 0.85;
  box-shadow: 0 0 6px var(--card-glow, rgba(212, 162, 76, 0.15));
}

/* Small screens */
@media (max-width: 370px) {
  .ency-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ency-card { padding: 18px 8px 16px; }
  .ency-card-arabic { font-size: 1.8rem; }
}
@media (min-width: 480px) {
  .ency-card { padding: 24px 14px 22px; }
  .ency-card-arabic { font-size: 2.2rem; }
  .ency-card-translit { font-size: 0.88rem; }
  .ency-card-meaning { font-size: 0.76rem; }
}

/* --- Detail View --- */
.ency-detail {
  padding: 0;
  animation: encyDetailSlideIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.ency-detail-progress {
  height: 3px;
  background: rgba(212, 162, 76, 0.06);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}
.ency-detail-progress::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 14px var(--gold-glow), 0 0 4px var(--gold-glow);
}

.ency-detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 2px;
}
.ency-nav-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 19, 36, 0.7);
  border: 1px solid rgba(212, 162, 76, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ency-nav-btn:hover:not(:disabled) {
  background: rgba(212, 162, 76, 0.1);
  border-color: rgba(212, 162, 76, 0.3);
  color: var(--gold);
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(212, 162, 76, 0.1);
}
.ency-nav-btn:active:not(:disabled) {
  transform: scale(0.94);
  transition-duration: 0.08s;
}
.ency-nav-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.ency-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: linear-gradient(175deg, #e8b84a 0%, #c9952e 50%, #a67c2e 100%);
  border: none;
  color: #1a1000;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-latin);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(212, 162, 76, 0.2),
    0 1px 6px rgba(212, 162, 76, 0.15);
}
.ency-nav-center-glow {
  position: absolute;
  inset: -8px -24px;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 50%, rgba(212, 162, 76, 0.15) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(12px);
  z-index: -1;
}
.ency-nav-center:hover {
  background: linear-gradient(175deg, #f0c45a 0%, #d4a23a 50%, #b08832 100%);
  transform: translateY(-2px) scale(1.06);
  box-shadow:
    0 6px 28px rgba(212, 162, 76, 0.35),
    0 2px 10px rgba(212, 162, 76, 0.2);
}
.ency-nav-center:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 8px rgba(212, 162, 76, 0.15);
  transition-duration: 0.08s;
}
.ency-nav-center-icon {
  flex-shrink: 0;
  color: #0a0e1a;
  transition: transform 0.3s ease;
}
.ency-nav-center:hover .ency-nav-center-icon {
  transform: scale(1.12);
}
.ency-nav-center-label {
  white-space: nowrap;
}
/* Hidden counter — keeps JS working without visible UI */
.ency-nav-counter-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ency-detail-card {
  background: linear-gradient(180deg, rgba(10, 13, 28, 0.94) 0%, rgba(7, 9, 20, 0.97) 100%);
  border: 1px solid rgba(212, 162, 76, 0.12);
  border-radius: 22px;
  padding: 0 0 28px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 20px 64px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  position: relative;
  scroll-behavior: smooth;
}
/* Top gold accent bar on the card — shimmer sweep */
.ency-detail-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, transparent 95%);
  background-size: 200% 100%;
  opacity: 0.5;
  z-index: 2;
  animation: encyShimmerSweep 8s ease-in-out infinite;
}

/* --- Detail Hero --- */
.ency-hero {
  text-align: center;
  padding: 64px 24px 48px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 162, 76, 0.08) 0%, transparent 100%),
    linear-gradient(180deg, rgba(212, 162, 76, 0.04) 0%, transparent 60%);
}

/* Geometric pattern overlay on hero */
.ency-hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    repeating-conic-gradient(rgba(212, 162, 76, 1) 0% 25%, transparent 0% 50%);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
/* Big ambient glow behind Arabic text */
.ency-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  width: 360px;
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--card-accent, rgba(212, 162, 76, 0.12)) 0%, rgba(212, 162, 76, 0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: encyHeroPulse 6s ease-in-out infinite;
}
/* Bottom ornamental separator */
.ency-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212, 162, 76, 0.25) 30%, rgba(212, 162, 76, 0.4) 50%, rgba(212, 162, 76, 0.25) 70%, transparent 100%);
}
/* Corner ornaments on hero */
.ency-hero-ornament-tl,
.ency-hero-ornament-br {
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.2;
}
.ency-hero-ornament-tl {
  top: 14px;
  left: 14px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  border-radius: 6px 0 0 0;
}
.ency-hero-ornament-tl::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  border-radius: 3px 0 0 0;
  opacity: 0.5;
}
.ency-hero-ornament-br {
  bottom: 14px;
  right: 14px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  border-radius: 0 0 6px 0;
}
.ency-hero-ornament-br::after {
  content: '';
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  border-radius: 0 0 3px 0;
  opacity: 0.5;
}

.ency-hero-number {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding: 7px 22px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.12) 0%, rgba(212, 162, 76, 0.06) 100%);
  border: 1px solid rgba(212, 162, 76, 0.25);
  box-shadow: 0 0 24px rgba(212, 162, 76, 0.1), 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1;
  animation: encyNumberPulse 3s ease-in-out infinite;
}

.ency-detail-arabic {
  position: relative;
  font-family: var(--font-arabic);
  font-size: 5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
  text-shadow: 0 0 40px var(--gold-glow);
  animation: encyArabicGlow 4s ease-in-out infinite;
  z-index: 1;
  margin-bottom: 8px;
  padding-bottom: 16px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep, #b8862c));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px var(--gold-glow));
}
/* Decorative line under Arabic name */
.ency-detail-arabic::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
  border-radius: 2px;
}

.ency-detail-translit {
  position: relative;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 16px;
  letter-spacing: 0.06em;
  font-family: var(--font-display, var(--font-latin));
  z-index: 1;
}

.ency-detail-meaning {
  position: relative;
  font-size: 1.08rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
  z-index: 1;
  font-weight: 500;
}

.ency-detail-english {
  position: relative;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-style: italic;
  opacity: 0.7;
  z-index: 1;
  letter-spacing: 0.02em;
}

.ency-detail-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 24px;
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.1) 0%, rgba(212, 162, 76, 0.04) 100%);
  border: 1px solid rgba(212, 162, 76, 0.2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 1;
  box-shadow: 0 0 16px rgba(212, 162, 76, 0.06), 0 2px 8px rgba(0, 0, 0, 0.15);
}
.ency-detail-badge .ency-chip-icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.ency-detail-root {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  color: var(--gold);
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.12) 0%, rgba(212, 162, 76, 0.05) 100%);
  border: 1px solid rgba(212, 162, 76, 0.22);
  padding: 8px 24px;
  border-radius: 999px;
  margin-top: 16px;
  z-index: 1;
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.08), 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Section Dividers --- */
.ency-section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  position: relative;
}
.ency-section-divider::before,
.ency-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.18));
}
.ency-section-divider::after {
  background: linear-gradient(90deg, rgba(212, 162, 76, 0.18), transparent);
}
.ency-section-divider-diamond {
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  margin: 0 18px;
  opacity: 0.6;
  box-shadow: 0 0 14px rgba(212, 162, 76, 0.4), 0 0 28px rgba(212, 162, 76, 0.15);
  position: relative;
  animation: encyDiamondPulse 4s ease-in-out infinite;
}
/* Side dots flanking the diamond */
.ency-section-divider-diamond::before,
.ency-section-divider-diamond::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--gold);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.35;
}
.ency-section-divider-diamond::before {
  left: -12px;
}
.ency-section-divider-diamond::after {
  right: -12px;
}

/* --- Detail Sections --- */
.ency-detail-section {
  padding: 0 20px;
  margin-bottom: 12px;
}

.ency-open-section {
  padding: 4px 22px 20px;
}
.ency-open-section-body {
  animation: encyCollapsibleReveal 0.35s ease-out both;
}
.ency-open-section + .ency-open-section {
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  padding-top: 16px;
}

.ency-detail-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(212, 162, 76, 0.12);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
/* Accent dot on the left of section label */
.ency-detail-label::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--gold);
  opacity: 0.3;
  border-radius: 2px;
}

.ency-detail-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15) 0%, rgba(212, 162, 76, 0.06) 100%);
  border: 1px solid rgba(212, 162, 76, 0.2);
  box-shadow: 0 4px 12px rgba(212, 162, 76, 0.08), 0 0 20px rgba(212, 162, 76, 0.04);
  transition: all 0.3s ease;
}
.ency-open-section:hover .ency-detail-label-icon {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.2) 0%, rgba(212, 162, 76, 0.08) 100%);
  box-shadow: 0 4px 16px rgba(212, 162, 76, 0.12), 0 0 24px rgba(212, 162, 76, 0.06);
  transform: scale(1.05);
}
.ency-detail-label-icon svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  opacity: 0.85;
}

.ency-detail-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.95;
  letter-spacing: 0.015em;
}

/* --- Meaning source attribution (ultra-detailed) --- */
.ency-meaning-sources {
  margin-top: 22px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.05) 0%, rgba(212, 162, 76, 0.01) 100%);
  border: 1px solid rgba(212, 162, 76, 0.12);
  border-radius: 14px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
}
/* Subtle left accent on source attribution */
.ency-meaning-sources::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), rgba(212, 162, 76, 0.2));
  border-radius: 3px 0 0 3px;
  opacity: 0.4;
}
.ency-meaning-sources-label {
  font-weight: 800;
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 162, 76, 0.1);
}
.ency-msrc-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 0;
  flex-wrap: wrap;
}
.ency-msrc-line + .ency-msrc-line {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}
.ency-msrc-icon {
  flex-shrink: 0;
  width: 14px;
  display: inline-flex;
  align-items: center;
  opacity: 0.5;
}
.ency-msrc-icon svg {
  width: 14px;
  height: 14px;
}
.ency-msrc-type {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-right: 4px;
}
.ency-msrc-line a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.ency-msrc-line a:hover {
  color: var(--gold);
}
.ency-msrc-line em {
  font-size: 0.74rem;
  opacity: 0.7;
}
.ency-msrc-trad {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(212, 162, 76, 0.08);
  color: var(--gold);
  letter-spacing: 0.03em;
  margin-left: auto;
  white-space: nowrap;
}

/* --- Source Card (fallback when no encyclopedia data) --- */
.ency-source-card {
  background: linear-gradient(135deg, rgba(15, 19, 36, 0.5) 0%, rgba(10, 14, 28, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px 22px;
}
.ency-source-text {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* --- Verse Card --- */
.ency-verse-card {
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.7) 0%, rgba(15, 20, 40, 0.55) 100%);
  border: 1px solid rgba(212, 162, 76, 0.12);
  border-left: 3px solid var(--gold);
  border-radius: 16px;
  padding: 28px 26px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* Decorative corner glow */
.ency-verse-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(212, 162, 76, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
/* Left accent glow */
.ency-verse-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, rgba(212, 162, 76, 0.04), transparent);
  pointer-events: none;
}
.ency-verse-card:hover {
  border-color: rgba(212, 162, 76, 0.3);
  background: linear-gradient(135deg, rgba(14, 18, 34, 0.8) 0%, rgba(20, 26, 52, 0.7) 100%);
  transform: translateY(-3px) scale(1.005);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 24px rgba(212, 162, 76, 0.06);
}
.ency-verse-arabic {
  font-family: var(--font-arabic);
  font-size: 1.55rem;
  color: var(--gold);
  text-align: center;
  direction: rtl;
  line-height: 2.3;
  margin-bottom: 16px;
  text-shadow: 0 0 32px rgba(212, 162, 76, 0.25);
  padding: 16px 20px 12px;
  position: relative;
  z-index: 1;
}
/* Decorative opening quotation mark */
.ency-verse-arabic::before {
  content: '\201F';
  position: absolute;
  top: -4px;
  right: 8px;
  font-size: 2.5rem;
  color: var(--gold);
  opacity: 0.12;
  font-family: serif;
  line-height: 1;
}
.ency-verse-translation {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 14px;
  padding-left: 16px;
  border-left: 2px solid rgba(212, 162, 76, 0.2);
  position: relative;
  z-index: 1;
}
.ency-verse-ref {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 162, 76, 0.06);
  position: relative;
  z-index: 1;
}

/* --- Scholar Card --- */
.ency-scholar-card {
  background: linear-gradient(135deg, rgba(12, 16, 32, 0.7) 0%, rgba(10, 14, 30, 0.55) 100%);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-left: 3px solid var(--sapphire);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 18px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ency-scholar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.03), transparent);
  pointer-events: none;
}
.ency-scholar-card:hover {
  background: linear-gradient(135deg, rgba(16, 20, 40, 0.8) 0%, rgba(14, 18, 38, 0.7) 100%);
  border-color: rgba(96, 165, 250, 0.2);
  transform: translateY(-3px) scale(1.005);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 20px rgba(96, 165, 250, 0.05);
}
.ency-scholar-card[data-tradition="Sunnite Malikite"] {
  border-left-color: var(--emerald);
}
.ency-scholar-card[data-tradition="Sunnite Malikite"]:hover {
  border-color: rgba(45, 212, 160, 0.15);
}
.ency-scholar-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}
.ency-scholar-work {
  font-size: 0.74rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}
.ency-scholar-tradition {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(45, 212, 160, 0.1);
  color: var(--emerald);
  margin-top: 8px;
}
.ency-scholar-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.9;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 1;
}
/* --- Scholar citation reference --- */
.ency-scholar-citation {
  font-size: 0.76rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(212, 162, 76, 0.04);
  border-left: 2px solid rgba(212, 162, 76, 0.2);
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}
/* --- Scholar source links with language badges --- */
.ency-scholar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.ency-source-link-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition);
}
.ency-source-link-item:hover {
  background: rgba(212, 162, 76, 0.08);
  border-color: rgba(212, 162, 76, 0.2);
  color: var(--gold-light);
}
.ency-source-link-item svg {
  opacity: 0.5;
  flex-shrink: 0;
}
.ency-lang-badge {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
  flex-shrink: 0;
}
.ency-lang-ar {
  background: rgba(45, 212, 160, 0.12);
  color: var(--emerald);
}
.ency-lang-en {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
}
.ency-lang-fr {
  background: rgba(212, 162, 76, 0.12);
  color: var(--gold);
}

/* --- Hadith Card --- */
.ency-hadith-card {
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.65) 0%, rgba(8, 16, 24, 0.55) 100%);
  border: 1px solid rgba(45, 212, 160, 0.1);
  border-left: 3px solid var(--emerald);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 18px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ency-hadith-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, rgba(45, 212, 160, 0.03), transparent);
  pointer-events: none;
}
.ency-hadith-card:hover {
  background: linear-gradient(135deg, rgba(12, 18, 30, 0.8) 0%, rgba(10, 20, 32, 0.7) 100%);
  border-color: rgba(45, 212, 160, 0.2);
  transform: translateY(-3px) scale(1.005);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 20px rgba(45, 212, 160, 0.05);
}
.ency-hadith-collection {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ency-hadith-collection::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--emerald);
  opacity: 0.6;
}
.ency-hadith-text {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.75;
}

/* --- External Links --- */
.ency-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(212, 162, 76, 0.06);
  border: 1px solid rgba(212, 162, 76, 0.1);
}
.ency-link:hover {
  color: var(--gold-light);
  background: rgba(212, 162, 76, 0.12);
  border-color: rgba(212, 162, 76, 0.2);
  gap: 8px;
  transform: translateY(-1px);
}

/* --- Sources List --- */
.ency-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ency-sources-list li {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.ency-sources-list li:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* --- Open Sections (no collapsible) --- */

/* --- Touch active state for mobile cards --- */
.ency-verse-card:active,
.ency-scholar-card:active,
.ency-hadith-card:active {
  transform: scale(0.985);
  transition-duration: 0.1s;
}

/* --- Responsive Breakpoints (detail view only) --- */
@media (max-width: 360px) {
  .ency-detail-arabic { font-size: 3.2rem; }
  .ency-detail-translit { font-size: 1.1rem; }
  .ency-detail-meaning { font-size: 0.92rem; }
  .ency-hero { padding: 40px 14px 28px; }
  .ency-hero-ornament-tl,
  .ency-hero-ornament-br { width: 28px; height: 28px; }
  .ency-hero-ornament-tl::after,
  .ency-hero-ornament-br::after { display: none; }
  .ency-detail-label { font-size: 0.68rem; gap: 10px; }
  .ency-detail-label-icon { width: 28px; height: 28px; border-radius: 8px; }
  .ency-detail-label-icon svg { width: 12px; height: 12px; }
  .ency-collapsible-body { padding: 4px 12px 14px; }
  .ency-collapsible summary { padding: 10px 12px; }
  .ency-section-divider { padding: 18px 12px; }
  .ency-open-section { padding: 2px 14px 14px; }
  .ency-verse-card,
  .ency-scholar-card,
  .ency-hadith-card {
    padding: 16px 16px;
    border-radius: 12px;
  }
  .ency-verse-arabic { font-size: 1.3rem; line-height: 2.1; }
  .ency-v2-grid { grid-template-columns: 1fr; }
  .ency-tabs-nav { padding: 8px 6px 6px; gap: 3px; }
  .ency-tab { padding: 6px 10px; font-size: 0.72rem; }
}

@media (max-width: 480px) {
  .ency-detail-arabic { font-size: 4rem; }
  .ency-hero { padding: 48px 18px 36px; }
  .ency-verse-arabic { font-size: 1.4rem; }
  .ency-detail-card { border-radius: 18px; }
  .ency-nav-btn { width: 40px; height: 40px; }
  .ency-nav-center { padding: 9px 16px; font-size: 0.7rem; gap: 6px; }
  .ency-nav-center-label { display: none; }
}

@media (min-width: 480px) {
  .ency-detail-arabic { font-size: 5.5rem; }
  .ency-hero { padding: 72px 36px 52px; }
  .ency-hero-ornament-tl,
  .ency-hero-ornament-br { width: 56px; height: 56px; }
  .ency-open-section { padding: 6px 32px 24px; }
  .ency-detail-card { border-radius: 26px; }
  .ency-verse-card,
  .ency-scholar-card,
  .ency-hadith-card {
    padding: 28px 30px;
    border-radius: 18px;
  }
}

@media (min-width: 768px) {
  .ency-hero { padding: 80px 48px 56px; }
  .ency-detail-arabic { font-size: 6rem; }
  .ency-detail-card {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* ===========================
   ENCYCLOPEDIA V2 — Onglets trilingues
   =========================== */

/* --- Tabs Navigation --- */
.ency-tabs-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 12px 8px 8px;
  background: rgba(10, 14, 26, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 162, 76, 0.1);
  border-radius: 16px 16px 0 0;
}
.ency-tabs-nav::-webkit-scrollbar { display: none; }

.ency-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(15, 19, 36, 0.6);
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.ency-tab:hover {
  background: rgba(212, 162, 76, 0.08);
  color: rgba(255,255,255,0.8);
  border-color: rgba(212, 162, 76, 0.15);
}
.ency-tab.active {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15) 0%, rgba(212, 162, 76, 0.08) 100%);
  color: var(--gold);
  border-color: rgba(212, 162, 76, 0.35);
  font-weight: 700;
  box-shadow: 0 0 16px rgba(212, 162, 76, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
}
/* Active tab underline glow */
.ency-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(212, 162, 76, 0.4);
}
.ency-tab-badge {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.65rem;
  opacity: 0.5;
  vertical-align: super;
}
.ency-tab.active .ency-tab-badge { opacity: 0.8; }

/* --- Tab Panels --- */
.ency-tab-panel {
  display: none;
  padding: 18px 16px;
  animation: encyTabFadeIn 0.3s ease;
}
.ency-tab-panel.active { display: block; }

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

/* ---- Encyclopedia Swipe Animations ---- */
@keyframes encyDetailSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes encySwipeLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}

@keyframes encySwipeRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

@keyframes encySwipeEnter {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes encySwipeEnterReverse {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- Swipe Indicator Hints (Mobile) ---- */
.ency-swipe-hints {
  display: none;
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 100;
}

@media (max-width: 768px) and (hover: none) {
  .ency-swipe-hints {
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
  }
}

.ency-swipe-hint {
  width: 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, rgba(212, 162, 76, 0.08), transparent);
  border-radius: 0 16px 16px 0;
  opacity: 0;
  animation: encySwipeHintPulse 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

.ency-swipe-hint.right {
  background: linear-gradient(270deg, rgba(212, 162, 76, 0.08), transparent);
  border-radius: 16px 0 0 16px;
}

.ency-swipe-hint svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
  opacity: 0.5;
}

@keyframes encySwipeHintPulse {
  0%, 100% { opacity: 0; transform: translateX(0); }
  10% { opacity: 0.7; }
  20% { opacity: 0.7; transform: translateX(4px); }
  30% { opacity: 0.7; transform: translateX(0); }
  40% { opacity: 0; }
}

.ency-swipe-hint.right svg {
  transform: rotate(180deg);
}

/* ---- Pagination Badge ---- */
.ency-pagination {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 162, 76, 0.15);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ency-pagination.visible {
  opacity: 1;
}

.ency-pagination-current {
  color: var(--gold);
  font-weight: 700;
}

.ency-pagination-sep {
  opacity: 0.4;
}

.ency-pagination-total {
  opacity: 0.6;
}

/* ---- Swipe Feedback (finger follow) ---- */
.ency-detail-content {
  transition: transform 0.1s ease-out;
}

.ency-detail-content.swiping {
  transition: none;
}

/* --- Madhab Sub-tabs --- */
.ency-subtabs-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ency-subtab {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(15, 19, 36, 0.5);
  color: rgba(255,255,255,0.5);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.ency-subtab:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.75);
}
.ency-subtab.active {
  font-weight: 600;
  border-color: var(--subtab-color, rgba(255,255,255,0.2));
  color: var(--subtab-color, #fff);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 0 10px rgba(var(--subtab-rgb, 255,255,255), 0.08);
}
.ency-subtab-count {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.62rem;
  opacity: 0.6;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 6px;
}

.ency-subtab-panel {
  display: none;
  animation: encyTabFadeIn 0.25s ease;
}
.ency-subtab-panel.active { display: block; }

/* Scholar cards within V2 */
.ency-v2-scholar-card {
  border-left: 3px solid var(--scholar-color, rgba(255,255,255,0.15));
  padding: 14px 16px;
  margin-bottom: 12px;
  background: rgba(15, 19, 36, 0.5);
  border-radius: 0 10px 10px 0;
  transition: background 0.2s ease;
}
.ency-v2-scholar-card:hover {
  background: rgba(15, 19, 36, 0.7);
}

/* --- Trilingual Block --- */
.ency-v2-trilingual {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  background: rgba(10, 14, 26, 0.3);
}
.ency-v2-trilingual-title {
  padding: 10px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: rgba(212, 162, 76, 0.04);
}
.ency-v2-lang-row {
  padding: 10px 14px;
  font-size: 0.84rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.82);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ency-v2-lang-row:last-child { border-bottom: none; }
.ency-v2-lang-row.rtl {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: 1rem;
  line-height: 2;
  color: var(--gold);
}
.ency-v2-lang-row .ency-lang-ar,
.ency-v2-lang-row .ency-lang-en,
.ency-v2-lang-row .ency-lang-fr {
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- V2 Blocks & Grid --- */
.ency-v2-block {
  margin-bottom: 20px;
}
.ency-v2-block-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212, 162, 76, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ency-v2-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.ency-v2-field {
  padding: 10px 12px;
  background: rgba(15, 19, 36, 0.45);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
}
.ency-v2-field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.ency-v2-field-value {
  font-size: 0.86rem;
  color: rgba(255,255,255,0.88);
  line-height: 1.5;
}
.ency-v2-field-value.ar {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  color: var(--gold);
  font-size: 1.1rem;
}

/* --- Source cards with reliability badges --- */
.ency-v2-source-card {
  padding: 12px 14px;
  background: rgba(10, 14, 26, 0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}
.ency-v2-source-card:hover {
  border-color: rgba(212, 162, 76, 0.15);
}
.ency-v2-source-entry {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.ency-v2-source-text-ar {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--gold);
  margin-bottom: 6px;
}
.ency-v2-source-text-fr {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  font-style: italic;
}

/* Verified / unverified badges */
.ency-v2-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.ency-v2-badge-unverified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- Placeholder for empty sections --- */
.ency-v2-placeholder {
  padding: 24px 16px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.82rem;
  font-style: italic;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 10px;
}

/* --- V2 Verse & Hadith cards (trilingual) --- */
.ency-v2-verse-card {
  border-left: 3px solid var(--gold);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: rgba(10, 14, 26, 0.5);
  border-radius: 0 10px 10px 0;
  position: relative;
}
.ency-v2-verse-card::before {
  content: '\201C';
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 2.5rem;
  color: var(--gold);
  opacity: 0.06;
  font-family: serif;
  line-height: 1;
}
.ency-v2-verse-arabic {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  line-height: 2.1;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow, rgba(212,162,76,0.15));
  margin-bottom: 10px;
}
.ency-v2-verse-ref {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
}
.ency-v2-verse-ref a {
  color: var(--gold);
  text-decoration: none;
}
.ency-v2-verse-ref a:hover { text-decoration: underline; }

.ency-v2-hadith-card {
  border-left: 3px solid #2dd4a0;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: rgba(10, 14, 26, 0.45);
  border-radius: 0 10px 10px 0;
}
.ency-v2-hadith-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ency-v2-hadith-collection {
  font-size: 0.78rem;
  font-weight: 600;
  color: #2dd4a0;
}
.ency-v2-hadith-grading {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.15);
}
.ency-v2-hadith-arabic {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: 1rem;
  line-height: 2;
  color: var(--gold);
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* --- V2 Debate/Theological block --- */
.ency-v2-debate {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  background: rgba(10, 14, 26, 0.35);
}
.ency-v2-debate-school {
  padding: 8px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ency-v2-debate-scholars {
  padding: 0 14px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  padding-top: 4px;
}

/* --- V2 Du'a / Dhikr blocks --- */
.ency-v2-dua-card {
  padding: 14px 16px;
  background: rgba(10, 14, 26, 0.4);
  border: 1px solid rgba(212, 162, 76, 0.1);
  border-radius: 12px;
  margin-bottom: 12px;
}
.ency-v2-dua-arabic {
  direction: rtl;
  text-align: center;
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  line-height: 2;
  color: var(--gold);
  text-shadow: 0 0 16px var(--gold-glow, rgba(212,162,76,0.12));
  margin-bottom: 6px;
}
.ency-v2-dua-translit {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  margin-bottom: 10px;
}
.ency-v2-dua-source {
  text-align: center;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
}
.ency-v2-dua-source a {
  color: var(--gold);
  text-decoration: none;
}
.ency-v2-dua-source a:hover { text-decoration: underline; }

/* --- V2 Links grid --- */
.ency-v2-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.ency-v2-link-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(15, 19, 36, 0.5);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.ency-v2-link-card:hover {
  border-color: rgba(212, 162, 76, 0.2);
  color: var(--gold);
  background: rgba(212, 162, 76, 0.04);
}

/* --- V2 Responsive --- */
@media (max-width: 640px) {
  .ency-tabs-nav {
    padding: 8px 6px 6px;
    gap: 3px;
  }
  .ency-tab {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
  .ency-tab-panel { padding: 14px 12px; }
  .ency-v2-grid { grid-template-columns: 1fr; }
  .ency-subtabs-nav { flex-wrap: wrap; }
  .ency-subtab {
    padding: 5px 10px;
    font-size: 0.7rem;
  }
  .ency-v2-links-grid {
    grid-template-columns: 1fr;
  }
  .ency-v2-verse-arabic { font-size: 1.1rem; }
  .ency-v2-dua-arabic { font-size: 1.1rem; }
}
/* ---- Training Topbar Hero ---- */
#pageTraining > .container {
  max-width: 640px;
  width: 100%;
  padding: 24px 16px;
}
.tr-topbar-hero {
  position: relative;
  overflow: hidden;
  padding: 20px 20px 0;
  margin: 0 0 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 162, 76, 0.06) 0%, transparent 100%),
    linear-gradient(180deg, rgba(212, 162, 76, 0.03) 0%, transparent 60%);
}
.tr-topbar-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212, 162, 76, 0.25) 30%, rgba(212, 162, 76, 0.4) 50%, rgba(212, 162, 76, 0.25) 70%, transparent 100%);
}
.tr-topbar-ornament-tl,
.tr-topbar-ornament-br {
  position: absolute;
  width: 40px;
  height: 40px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.15;
}
.tr-topbar-ornament-tl {
  top: 12px; left: 12px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  border-radius: 6px 0 0 0;
}
.tr-topbar-ornament-br {
  bottom: 12px; right: 12px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  border-radius: 0 0 6px 0;
}
.tr-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 18px;
  position: relative;
  z-index: 2;
}
.tr-topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.12), transparent);
}
.tr-topbar-center { flex: 1; min-width: 0; }
.tr-topbar-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
  display: block;
}
.tr-topbar-subtitle {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.tr-topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald);
  letter-spacing: 0.04em;
  margin-left: auto;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(45, 212, 160, 0.06);
  border: 1px solid rgba(45, 212, 160, 0.15);
  flex-shrink: 0;
}
.tr-topbar-badge svg { flex-shrink: 0; }
.tr-topbar-hero-body {
  text-align: center;
  padding: 24px 4px 32px;
  position: relative;
  z-index: 1;
}
.tr-topbar-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.14) 0%, rgba(212, 162, 76, 0.04) 100%);
  border: 1.5px solid rgba(212, 162, 76, 0.22);
  box-shadow: 0 0 24px rgba(212, 162, 76, 0.10), 0 4px 12px rgba(0, 0, 0, 0.25);
  margin-bottom: 0.75rem;
  color: var(--gold);
}
.tr-topbar-hero-icon svg { width: 26px; height: 26px; }
.tr-topbar-hero-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.6rem;
  line-height: 1.3;
}
.tr-topbar-hero-sep {
  width: 40px;
  height: 2px;
  margin: 0 auto 0.6rem;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
  opacity: 0.45;
}
.tr-topbar-hero-sub {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  #pageTraining > .container {
    max-width: 640px;
    padding: 32px 24px;
  }
  .tr-topbar-hero {
    margin: 0;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-card);
  }
  .tr-modes {
    gap: 14px;
  }
}
@media (min-width: 768px) {
  #pageTraining > .container { max-width: 720px; }
  .tr-topbar-hero-title { font-size: 1.3rem; }
  .tr-topbar-hero-body { padding: 28px 8px 36px; }
}
@media (min-width: 1024px) {
  #pageTraining > .container { max-width: 780px; padding: 40px 32px; }
}
@media (min-width: 1280px) {
  #pageTraining > .container { max-width: 820px; padding: 48px 40px; }
}

/* ---- Progress card (redesigned) ---- */
.tr-progress {
  padding: 24px 20px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 40px rgba(212, 162, 76, 0.03);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  animation: trFadeIn 0.5s ease both;
}

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

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

.tr-progress::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, rgba(212, 162, 76, 0.6) 50%, var(--gold) 70%, transparent 100%);
  background-size: 200% 100%;
  animation: trShimmer 4s ease infinite;
}

.tr-progress-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.tr-ring {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}

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

.tr-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 4.5;
}

.tr-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.45));
}

.tr-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-latin);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: -0.5px;
}

.tr-ring-label small {
  font-size: 0.55rem;
  font-weight: 600;
  opacity: 0.5;
  margin-left: 1px;
}

.tr-progress-info { flex: 1; min-width: 0; }

.tr-progress-title {
  font-family: var(--font-latin);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tr-progress-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Stats row */
.tr-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tr-stat {
  text-align: center;
  padding: 14px 8px 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.tr-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  border-radius: 1px;
}

.tr-stat:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.tr-stat-num {
  font-family: var(--font-latin);
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: block;
}

.tr-stat-num.emerald { color: var(--emerald); }
.tr-stat-num.amber { color: var(--amber-warm); }
.tr-stat-num.dim { color: var(--text-muted); }

.tr-stat-lbl {
  display: block;
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 5px;
}

.tr-stat-bar {
  width: 75%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  margin: 6px auto 0;
  overflow: hidden;
}

.tr-stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tr-stat-bar-fill.emerald { background: var(--emerald); box-shadow: 0 0 6px rgba(45, 212, 160, 0.3); }
.tr-stat-bar-fill.amber { background: var(--amber-warm); box-shadow: 0 0 6px rgba(245, 158, 11, 0.3); }
.tr-stat-bar-fill.dim { background: var(--text-muted); }

.tr-reset-btn {
  display: block;
  margin: 16px auto 0;
  padding: 6px 16px;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-latin);
  transition: all 0.25s ease;
}

.tr-reset-btn:hover {
  color: var(--ruby);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

/* ---- Stat icons ---- */
.tr-stat-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.tr-stat-ico svg {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}
.tr-stat-num.gold { color: var(--gold); }
.tr-stat-num.ruby { color: var(--ruby); }

/* ---- Secondary info (score & streak) ---- */
.tr-progress-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.tr-secondary-item {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tr-secondary-item strong {
  color: var(--text-secondary);
  font-weight: 700;
}

/* ---- Custom Reset Dialog ---- */
.tr-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  padding: 24px;
}
.tr-dialog-overlay.show {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}
.tr-dialog {
  background: linear-gradient(160deg, rgba(18, 22, 42, 0.98) 0%, rgba(10, 13, 28, 0.98) 100%);
  border: 1px solid rgba(212, 162, 76, 0.12);
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.tr-dialog-overlay.show .tr-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.tr-dialog-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.tr-dialog-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.tr-dialog-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px;
}
.tr-dialog-actions {
  display: flex;
  gap: 10px;
}
.tr-dialog-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}
.tr-dialog-cancel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.tr-dialog-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
.tr-dialog-confirm {
  background: linear-gradient(135deg, var(--ruby) 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}
.tr-dialog-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.35);
  filter: brightness(1.1);
}
.tr-dialog-confirm:active {
  transform: scale(0.97);
}

/* ---- Continue button ---- */
.tr-continue-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-latin);
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright, #ffd866) 100%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(212, 162, 76, 0.25);
}
.tr-continue-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(212, 162, 76, 0.35);
  filter: brightness(1.08);
}
.tr-continue-btn:active {
  transform: scale(0.98);
}
.tr-continue-btn svg {
  flex-shrink: 0;
}

/* ---- Category filter (redesigned) ---- */
.tr-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 22px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tr-cats::-webkit-scrollbar { display: none; }

.tr-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  white-space: nowrap;
  font-family: var(--font-latin);
  position: relative;
}

.tr-chip:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.tr-chip.active {
  background: rgba(212, 162, 76, 0.12);
  border-color: rgba(212, 162, 76, 0.35);
  color: var(--gold-light);
  box-shadow: 0 0 12px rgba(212, 162, 76, 0.08);
}

.tr-chip-icon {
  display: inline-flex;
  align-items: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tr-chip-icon svg {
  width: 14px;
  height: 14px;
}

.tr-chip.active .tr-chip-icon svg {
  color: var(--gold);
}

.tr-chip-n {
  font-size: 0.6rem;
  font-weight: 700;
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
  padding-left: 2px;
}

.tr-chip.active .tr-chip-n { opacity: 0.7; }

/* ---- Section heading (redesigned) ---- */
.tr-heading {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tr-heading::before {
  content: '';
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.3));
}
.tr-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 162, 76, 0.3), transparent);
}

/* ---- Mode cards (redesigned — premium vertical cards) ---- */
@keyframes trModeIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.tr-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tr-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  width: 100%;
  padding: 0;
  background:
    linear-gradient(165deg, rgba(15, 19, 36, 0.9) 0%, rgba(10, 14, 28, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  font-family: var(--font-latin);
  animation: trModeIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) var(--mode-delay, 0s) both;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

/* Top banner area with gradient */
.tr-mode-gradient {
  width: 100%;
  padding: 24px 16px 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 100% 90% at 50% -10%, color-mix(in srgb, var(--mode-color, var(--gold)) 10%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(15, 19, 36, 0.4) 0%, transparent 100%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Top shimmer line */
.tr-mode-gradient::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mode-color, var(--gold)), transparent);
  opacity: 0.4;
  transition: opacity 0.4s ease;
}

.tr-mode:hover .tr-mode-gradient::before {
  opacity: 1;
}

/* Hidden pseudo for hover glow */
.tr-mode::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--mode-color, var(--gold)) 6%, transparent), transparent 70%);
}

.tr-mode:hover::after {
  opacity: 1;
}

.tr-mode:hover {
  border-color: color-mix(in srgb, var(--mode-color, var(--gold)) 22%, transparent);
  transform: translateY(-4px);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 28px color-mix(in srgb, var(--mode-color, var(--gold)) 8%, transparent);
}

.tr-mode:active {
  transform: scale(0.97) translateY(0);
  transition-duration: 0.08s;
}

.tr-mode-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 16px;
  background: color-mix(in srgb, var(--mode-color, var(--gold)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--mode-color, var(--gold)) 12%, transparent);
  color: var(--mode-color, var(--gold));
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.tr-mode-ico svg {
  width: 24px;
  height: 24px;
}

.tr-mode:hover .tr-mode-ico {
  background: color-mix(in srgb, var(--mode-color, var(--gold)) 20%, transparent);
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--mode-color, var(--gold)) 16%, transparent);
  border-color: color-mix(in srgb, var(--mode-color, var(--gold)) 25%, transparent);
}

/* Card body below icon */
.tr-mode-txt {
  padding: 2px 16px 10px;
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
}

.tr-mode-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  transition: color 0.3s ease;
}

.tr-mode:hover .tr-mode-name {
  color: var(--gold-light, #f0dca8);
}

.tr-mode-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Name count badge */
.tr-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto 14px;
  padding: 4px 12px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}
.tr-mode:hover .tr-mode-badge {
  color: var(--mode-color, var(--gold));
  background: color-mix(in srgb, var(--mode-color, var(--gold)) 6%, transparent);
  border-color: color-mix(in srgb, var(--mode-color, var(--gold)) 12%, transparent);
}

.tr-mode-chevron {
  display: none;
}

/* ---- Session header ---- */
.tr-sh {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 16px;
}
.tr-sh-back {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.tr-sh-back svg { width: 18px; height: 18px; }
.tr-sh-right { margin-left: auto; }

.tr-sh-mode {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.tr-sh-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tr-sh-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.tr-sh-bar {
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.tr-sh-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--emerald));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px rgba(212, 162, 76, 0.3);
}

/* ---- Session complete (redesigned) ---- */
.tr-done {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 60px rgba(45, 212, 160, 0.04);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  overflow: hidden;
}

.tr-done::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--emerald) 30%, var(--gold) 70%, transparent 95%);
  background-size: 200% 100%;
  animation: trShimmer 3s ease infinite;
}

.tr-done-emoji {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.tr-done-title {
  font-family: var(--font-latin);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tr-done-score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(212, 162, 76, 0.3);
}

.tr-done-pct {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.tr-done-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Last mode card spans full width when odd count */
.tr-mode:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 260px;
  justify-self: center;
}

/* ---- Mobile: single-column mode cards ---- */
@media (max-width: 400px) {
  .tr-modes {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .tr-mode-gradient {
    padding: 20px 12px 14px;
  }
  .tr-mode-ico {
    width: 44px;
    height: 44px;
  }
  .tr-mode-ico svg {
    width: 20px;
    height: 20px;
  }
  .tr-mode-txt {
    padding: 2px 10px 8px;
  }
  .tr-mode-name {
    font-size: 0.82rem;
  }
  .tr-mode-sub {
    font-size: 0.65rem;
  }
  .tr-mode-badge {
    padding: 3px 10px;
    font-size: 0.58rem;
    margin-bottom: 10px;
  }
  .tr-mode:last-child:nth-child(odd) {
    max-width: none;
  }
}

/* Flashcard */
/* Flashcard — now uses .fc-* classes in modes.css */

/* Quiz */
.quiz-container {
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.quiz-question-arabic {
  font-family: var(--font-arabic);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  text-align: center;
  margin-bottom: 2px;
}

.quiz-question-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-latin);
  text-align: left;
  width: 100%;
}

.quiz-option:hover {
  border-color: rgba(212, 162, 76, 0.2);
  background: rgba(212, 162, 76, 0.03);
}

.quiz-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.quiz-option:hover .quiz-letter {
  background: rgba(212, 162, 76, 0.08);
  color: var(--gold);
}

.quiz-option.correct {
  background: rgba(45, 212, 160, 0.1);
  border-color: var(--emerald);
  box-shadow: 0 0 12px var(--emerald-glow);
  animation: correctBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-option.correct .quiz-letter {
  background: var(--emerald);
  color: var(--bg-deep);
}

.quiz-option.wrong {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--ruby);
  animation: wrongShake 0.4s ease;
}

.quiz-option.wrong .quiz-letter {
  background: var(--ruby);
  color: white;
}

/* Matching — now uses .match-* classes in modes.css */

/* Writing — now uses .writing-game/.writing-card classes in modes.css */


/* ---------------------------------------------------------------
   MICRO-INTERACTIONS
   --------------------------------------------------------------- */

.ripple-wave { position: absolute; border-radius: 50%; background: rgba(212, 162, 76, 0.15); transform: scale(0); animation: rippleWaveExpand 0.6s ease-out forwards; pointer-events: none; }
@keyframes rippleWaveExpand { to { transform: scale(4); opacity: 0; } }

.respect-bismillah { font-family: var(--font-arabic); font-size: 1.3rem; color: var(--sacred-gold); text-shadow: 0 0 12px rgba(212, 162, 76, 0.15); margin-bottom: 8px; direction: rtl; }
.respect-text { font-size: 0.78rem; color: var(--text-muted); line-height: 1.7; }


/* ---------------------------------------------------------------
   RESPONSIVE — Multiplayer
   --------------------------------------------------------------- */

@media (min-width: 768px) {
  .app-container { max-width: 600px; padding: 30px; }
  .page-wide .app-container, .page-wide { max-width: 900px; }
  .room-code { font-size: 2.6rem; letter-spacing: 0.3em; padding-left: 0.3em; }
  .active-player-name { font-size: 2.5rem; }
}

@media (max-width: 360px) {
  .app-container { padding: 12px; }
  .logo-arabic { font-size: 2.4rem; }
  .logo-title-premium { font-size: 2.6rem; }
  .logo-arabic-sub { font-size: 1rem; }
  .room-code { font-size: 1.3rem; letter-spacing: 0.18em; padding-left: 0.18em; }
  .btn-home-primary, .btn-home-secondary { padding: 12px 14px; gap: 10px; }
  .btn-home-icon { width: 34px; height: 34px; }
  .spectator-layout { grid-template-columns: 1fr; }
  .hero-arabic { font-size: 4rem; }
  .hero-husna { font-size: 1.4rem; }
}

/* ===========================
   HERO SECTION
   =========================== */

/* --- Home container: centered layout --- */
.home-container {
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Subtle stagger entrance for home elements
   Uses fill-mode "both" so base opacity stays 1 (visible by default).
   If animation fails or is disabled, elements remain visible. */
.pseudo-badge,
.home-cta-duo,
.home-features,
.support-block,
.donate-collapse,
.hadith-section {
  animation: homeFadeIn 0.5s ease both;
}
.pseudo-badge    { animation-delay: 0.55s; }
.home-cta-duo    { animation-delay: 0.65s; }
.home-features   { animation-delay: 0.75s; }
.support-block   { animation-delay: 0.85s; }
.donate-collapse { animation-delay: 0.95s; }
.hadith-section  { animation-delay: 1.05s; }

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

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 8px;
  position: relative;
  overflow: visible;
}

.hero-compact { padding: 24px 0 6px; }

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 162, 76, 0.14) 0%, rgba(212, 162, 76, 0.05) 40%, transparent 70%);
  pointer-events: none;
  animation: heroGlowPulse 4s ease-in-out infinite;
}

@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -55%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -55%) scale(1.08); }
}

.hero-arabic {
  font-family: var(--font-arabic);
  font-size: 4rem;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(135deg, #FFE7A3 0%, #F6C864 18%, #D89E2C 38%, #F4D27E 58%, #FFE7A3 78%, #D89E2C 100%);
  background-size: 250% 250%;
  -webkit-background-clip: text;
  background-clip: text;
  line-height: 1.1;
  direction: rtl;
  position: relative;
  z-index: 1;
  cursor: default;
  filter: drop-shadow(0 0 30px rgba(212, 162, 76, 0.3)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  animation:
    heroShimmer 5s ease-in-out infinite,
    heroReveal 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

.hero-arabic:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 0 50px rgba(212, 162, 76, 0.5)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.hero-arabic:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

@keyframes heroShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(14px);
    filter: blur(12px) drop-shadow(0 0 0 transparent);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0) drop-shadow(0 0 30px rgba(212, 162, 76, 0.3)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  }
}

.hero-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  opacity: 0;
  animation: heroSubReveal 0.6s ease forwards 0.9s;
}

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

.hero-husna {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(212, 162, 76, 0.2);
  direction: rtl;
  opacity: 0.65;
}

.hero-tagline {
  font-family: var(--font-latin);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-ornament {
  flex-shrink: 0;
  opacity: 0.7;
}

.hero-ornament-left {
  transform: translateY(1px);
}

.hero-ornament-right {
  transform: translateY(1px);
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-bright);
  pointer-events: none;
  animation: heroParticleFly var(--dur, 1s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  box-shadow: 0 0 6px rgba(212, 162, 76, 0.6);
}

/* (legacy .home-grid removed — replaced by home-features grid) */

/* --- Hero Enhancements --- */
.hero-bismillah {
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  color: var(--gold);
  opacity: 0.35;
  margin-bottom: 4px;
  direction: rtl;
  letter-spacing: 0.02em;
  user-select: none;
  -webkit-user-select: none;
}
.hero-sacred-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.2;
  margin-top: 8px;
}

/* --- Dual CTA --- */
.home-cta-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
  width: 100%;
}

/* --- Base CTA --- */
.home-cta {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  overflow: visible;
  background: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
              filter 0.4s ease;
}
.home-cta:active {
  transform: scale(0.95) !important;
  transition-duration: 0.08s;
}

.hcta-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 16px;
  font-family: var(--font-latin);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
}
.hcta-icon { flex-shrink: 0; display: flex; }
.hcta-text { position: relative; z-index: 1; }

/* =============================================
   PRIMARY — "Créer une partie"
   Molten gold with pulse glow + shimmer sweep
   ============================================= */
.home-cta--primary .hcta-inner {
  background: linear-gradient(165deg, #c8982e, #e2b84a 35%, #f5d96a 55%, #e2b84a 75%, #a8792a);
  color: #1a1000;
  border: 1.5px solid rgba(255, 230, 140, 0.35);
  text-shadow: 0 1px 0 rgba(255,220,120,0.35);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.5),
    0 4px 14px rgba(180,140,50,0.25),
    0 10px 36px rgba(180,140,50,0.12),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -2px 0 rgba(0,0,0,0.08);
}

/* Pulsing gold glow behind the button */
.hcta-glow {
  position: absolute;
  inset: -6px;
  z-index: 0;
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 60%, rgba(212,162,76,0.35) 0%, rgba(212,162,76,0.10) 50%, transparent 75%);
  pointer-events: none;
  animation: hctaPulse 2.5s ease-in-out infinite;
  filter: blur(4px);
}

@keyframes hctaPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Shimmer lives inside .hcta-inner so it gets clipped */
.hcta-shimmer {
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  z-index: 3;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255,255,255,0.08) 25%,
    rgba(255,255,255,0.40) 50%,
    rgba(255,255,255,0.08) 75%,
    transparent 100%
  );
  pointer-events: none;
  animation: hctaShimmer 3.5s ease-in-out infinite;
  animation-delay: 0.8s;
}
@keyframes hctaShimmer {
  0%   { left: -120%; }
  40%  { left: 160%; }
  100% { left: 160%; }
}

.home-cta--primary:hover {
  transform: translateY(-4px) scale(1.04);
  filter: brightness(1.1) drop-shadow(0 8px 24px rgba(212,162,76,0.35));
}
.home-cta--primary:hover .hcta-inner {
  box-shadow:
    0 2px 8px rgba(0,0,0,0.4),
    0 12px 40px rgba(212,162,76,0.35),
    0 0 60px rgba(212,162,76,0.12),
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.08);
}

/* =============================================
   SECONDARY — "Rejoindre"
   Premium dark glass + spinning border + shimmer
   ============================================= */
.home-cta--secondary .hcta-inner {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 40%) padding-box,
    linear-gradient(160deg, rgba(16,20,42,0.98), rgba(24,30,58,0.92)) padding-box;
  color: var(--gold-light);
  border: 1.5px solid rgba(212,162,76,0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.6),
    0 4px 16px rgba(0,0,0,0.30),
    0 8px 32px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.25);
}

/* Pulsing glow behind secondary */
.hcta-glow-sec {
  position: absolute;
  inset: -5px;
  z-index: 0;
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 60%, rgba(212,162,76,0.15) 0%, rgba(212,162,76,0.05) 50%, transparent 75%);
  pointer-events: none;
  animation: hctaPulseSec 3s ease-in-out infinite;
  filter: blur(3px);
}
@keyframes hctaPulseSec {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.04); }
}

/* Gold shimmer variant for secondary */
.hcta-shimmer--sec {
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(212,162,76,0.05) 25%,
    rgba(212,162,76,0.25) 50%,
    rgba(212,162,76,0.05) 75%,
    transparent 100%
  ) !important;
  animation-delay: 2.5s !important;
  animation-duration: 4s !important;
}

/* Spinning gold border light */
.hcta-border-spin {
  position: absolute;
  inset: -2px;
  z-index: 1;
  border-radius: 18px;
  pointer-events: none;
  background: conic-gradient(
    from var(--hcta-spin, 0deg) at 50% 50%,
    transparent 0%,
    rgba(212,162,76,0.55) 6%,
    rgba(245,215,100,0.80) 12%,
    rgba(212,162,76,0.55) 18%,
    transparent 26%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
  animation: hctaSpin 3.5s linear infinite;
  opacity: 0.8;
}

@property --hcta-spin {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes hctaSpin {
  to { --hcta-spin: 360deg; }
}

.home-cta--secondary:hover {
  transform: translateY(-4px) scale(1.04);
  filter: drop-shadow(0 8px 24px rgba(212,162,76,0.20));
}
.home-cta--secondary:hover .hcta-inner {
  border-color: rgba(212,162,76,0.40);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 40%) padding-box,
    linear-gradient(160deg, rgba(20,26,50,0.99), rgba(30,36,64,0.95)) padding-box;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.5),
    0 12px 40px rgba(0,0,0,0.30),
    0 0 50px rgba(212,162,76,0.10),
    inset 0 1px 0 rgba(255,255,255,0.12);
}
.home-cta--secondary:hover .hcta-border-spin {
  opacity: 1;
}
.home-cta--secondary:hover .hcta-glow-sec {
  opacity: 1;
}

/* --- Feature Grid --- */
.home-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}
.home-feature {
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 9px;
  background: linear-gradient(160deg, rgba(15, 19, 36, 0.9), rgba(20, 25, 48, 0.75));
  border: 1px solid rgba(var(--feat-color, 212,162,76), 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* Ambient orb glow behind icon */
.home-feature-orb {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--feat-color, 212,162,76), 0.12) 0%, transparent 70%);
  pointer-events: none;
  transition: all 0.3s ease;
  filter: blur(5px);
}
/* Top-edge gradient line */
.home-feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--feat-color, 212,162,76), 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
/* Inner light wash */
.home-feature::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% -20%, rgba(var(--feat-color, 212,162,76), 0.06) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.home-feature:hover::before { opacity: 1; }
.home-feature:hover::after { opacity: 1; }
.home-feature:hover .home-feature-orb {
  width: 65px;
  height: 65px;
  background: radial-gradient(circle, rgba(var(--feat-color, 212,162,76), 0.2) 0%, transparent 70%);
}
.home-feature:hover {
  border-color: rgba(var(--feat-color, 212,162,76), 0.3);
  transform: translateY(-3px);
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.2),
    0 0 16px rgba(var(--feat-color, 212,162,76), 0.08);
}
.home-feature:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 0.1s;
}
.home-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  position: relative;
  z-index: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.home-feature:hover .home-feature-icon {
  transform: scale(1.1) translateY(-1px);
}
.home-feature-icon--sapphire {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(96, 165, 250, 0.08));
  border: 1px solid rgba(96, 165, 250, 0.15);
  color: var(--sapphire);
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.1), inset 0 1px 0 rgba(96, 165, 250, 0.1);
}
.home-feature:hover .home-feature-icon--sapphire {
  box-shadow: 0 0 28px rgba(96, 165, 250, 0.25), 0 4px 12px rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
}
.home-feature-icon--emerald {
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.15), rgba(45, 212, 160, 0.08));
  border: 1px solid rgba(45, 212, 160, 0.15);
  color: var(--emerald);
  box-shadow: 0 0 20px rgba(45, 212, 160, 0.1), inset 0 1px 0 rgba(45, 212, 160, 0.1);
}
.home-feature:hover .home-feature-icon--emerald {
  box-shadow: 0 0 28px rgba(45, 212, 160, 0.25), 0 4px 12px rgba(45, 212, 160, 0.15);
  border-color: rgba(45, 212, 160, 0.3);
}
.home-feature-icon--amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: var(--amber-warm);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.1), inset 0 1px 0 rgba(245, 158, 11, 0.1);
}
.home-feature:hover .home-feature-icon--amber {
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.25), 0 4px 12px rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}
.home-feature-icon--gold {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15), rgba(212, 162, 76, 0.08));
  border: 1px solid rgba(212, 162, 76, 0.15);
  color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.1), inset 0 1px 0 rgba(212, 162, 76, 0.1);
}
.home-feature:hover .home-feature-icon--gold {
  box-shadow: 0 0 28px rgba(212, 162, 76, 0.25), 0 4px 12px rgba(212, 162, 76, 0.15);
  border-color: rgba(212, 162, 76, 0.3);
}
.home-feature-icon--muted {
  background: linear-gradient(135deg, rgba(154, 151, 143, 0.1), rgba(154, 151, 143, 0.05));
  border: 1px solid rgba(154, 151, 143, 0.08);
  color: var(--text-secondary);
}
.home-feature-icon svg { width: 16px; height: 16px; }
.home-feature-name {
  font-family: var(--font-latin);
  font-size: 0.64rem;
  font-weight: 600;
  text-align: center;
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
  letter-spacing: 0.01em;
}
.home-feature:hover .home-feature-name {
  color: rgb(var(--feat-color, 212,162,76));
}

/* --- Hadith decorative quote --- */
.hadith-section {
  position: relative;
}
.hadith-section::after {
  content: '\201D';
  position: absolute;
  top: -8px;
  right: 12px;
  font-family: Georgia, serif;
  font-size: 3rem;
  color: var(--gold);
  opacity: 0.1;
  pointer-events: none;
  line-height: 1;
}

/* --- Responsive: Home Redesign --- */
@media (max-width: 380px) {
  .hcta-inner { padding: 14px 10px; font-size: 0.78rem; gap: 7px; }
  .home-cta { border-radius: 12px; }
  .home-cta svg { width: 15px; height: 15px; }
  .home-feature { padding: 9px 4px 8px; gap: 4px; }
  .home-feature-icon { width: 28px; height: 28px; border-radius: 8px; }
  .home-feature-icon svg { width: 14px; height: 14px; }
  .home-feature-name { font-size: 0.6rem; }
  .asso-card { padding: 10px; gap: 8px; }
  .asso-card-initial { width: 30px; height: 30px; font-size: 0.6rem; }
  .asso-card-label { font-size: 0.68rem; }
  .asso-card-desc { display: none; }
  .asso-card-arrow { display: none; }
}
@media (min-width: 480px) {
  .home-features { gap: 10px; }
  .home-feature { flex: 0 0 calc((100% - 20px) / 3); padding: 12px 8px 10px; }
  .asso-grid { gap: 12px; }
}
@media (min-width: 768px) {
  .hcta-inner { padding: 20px 20px; font-size: 0.92rem; }
  .home-features { gap: 12px; }
  .home-feature { flex: 0 0 calc((100% - 24px) / 3); padding: 14px 10px 12px; gap: 7px; }
  .home-feature-icon { width: 36px; height: 36px; border-radius: 11px; }
  .home-feature-name { font-size: 0.74rem; }
  .asso-card { padding: 16px 16px; gap: 12px; }
  .asso-card-initial { width: 40px; height: 40px; font-size: 0.72rem; border-radius: 12px; }
  .asso-card-label { font-size: 0.82rem; }
  .asso-card-desc { font-size: 0.66rem; }
}
@media (min-width: 1024px) {
  .home-cta-duo { max-width: 600px; margin-left: auto; margin-right: auto; }
  .home-features { max-width: 600px; margin-left: auto; margin-right: auto; }
  .support-block { max-width: 600px; margin-left: auto; margin-right: auto; }
}

/* --- Support Blocks (home page) --- */
.support-block {
  margin-top: 20px;
  padding-top: 16px;
  position: relative;
  width: 100%;
}

.support-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.support-heading-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.15), transparent);
}

.support-heading-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-latin);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(212, 162, 76, 0.06);
  border: 1px solid rgba(212, 162, 76, 0.12);
  white-space: nowrap;
}

.support-heading-badge svg {
  opacity: 0.7;
  flex-shrink: 0;
}

/* --- Associations: 2×2 premium grid --- */
.asso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.asso-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  background: linear-gradient(160deg, rgba(15, 19, 36, 0.9), rgba(20, 25, 48, 0.75));
  border: 1px solid rgba(var(--ac-rgb, 212,162,76), 0.1);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
/* Inner ambient glow */
.asso-card-glow {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--ac-rgb, 212,162,76), 0.12) 0%, transparent 70%);
  pointer-events: none;
  transition: all 0.4s ease;
  filter: blur(8px);
}
.asso-card:link,
.asso-card:visited,
.asso-card:active {
  color: var(--text-primary);
  text-decoration: none;
}
.asso-card:hover {
  border-color: rgba(var(--ac-rgb, 212,162,76), 0.3);
  transform: translateY(-3px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 0 16px rgba(var(--ac-rgb, 212,162,76), 0.08);
}
.asso-card:hover .asso-card-glow {
  width: 100px;
  height: 100px;
  top: -30px;
  left: -30px;
  background: radial-gradient(circle, rgba(var(--ac-rgb, 212,162,76), 0.2) 0%, transparent 70%);
}
.asso-card:hover .asso-card-arrow {
  opacity: 1;
  transform: translate(0, 0);
}
.asso-card:hover .asso-card-initial {
  box-shadow: 0 0 16px rgba(var(--ac-rgb, 212,162,76), 0.2);
  transform: scale(1.08);
}
.asso-card:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}
.asso-card-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--ac-rgb, 212,162,76), 0.18), rgba(var(--ac-rgb, 212,162,76), 0.08));
  color: var(--ac);
  font-family: var(--font-latin);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  border: 1px solid rgba(var(--ac-rgb, 212,162,76), 0.2);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}
.asso-card-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.asso-card-label {
  font-family: var(--font-latin);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.asso-card-desc {
  font-family: var(--font-latin);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.3;
}
.asso-card-arrow {
  flex-shrink: 0;
  color: var(--ac);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

/* --- Donate card --- */
.donate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.donate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.2), transparent);
}

.donate-header {
  margin-bottom: 12px;
}

.creator-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.creator-av {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15), rgba(212, 162, 76, 0.05));
  border: 1.5px solid rgba(212, 162, 76, 0.3);
  font-family: var(--font-latin);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold-light);
}

.creator-id {
  min-width: 0;
}

.creator-name-sm {
  font-family: var(--font-latin);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.creator-role-sm {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.donate-message {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.donate-section {
  margin-bottom: 4px;
}

.donate-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.donate-amounts {
  display: flex;
  gap: 8px;
}

.donate-amount-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  flex: 1;
  border-radius: var(--radius-sm);
  font-family: var(--font-latin);
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a1000;
  background: linear-gradient(175deg, #e8b84a 0%, #c9952e 50%, #a67c2e 100%);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(212, 162, 76, 0.2), inset 0 1px 0 rgba(255, 230, 160, 0.3);
  border: 1px solid rgba(255, 230, 160, 0.15);
  white-space: nowrap;
}

.donate-amount-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212, 162, 76, 0.45), inset 0 1px 0 rgba(255, 230, 160, 0.4);
}

.donate-amount-btn:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.donate-stripe-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0.6;
}

.donate-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-card), transparent);
  margin: 14px 0;
}

.donate-paypal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-latin);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-button);
}

.donate-paypal-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 112, 186, 0.35);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.donate-paypal-btn:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

.donate-paypal-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
}

.donate-paypal-logo {
  flex-shrink: 0;
  display: block;
}

/* --- Donate collapsible --- */
.donate-collapse {
  margin-top: 16px;
  width: 100%;
}

.donate-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  padding: 14px 20px;
  list-style: none;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.08), rgba(212, 162, 76, 0.03));
  border: 1px solid rgba(212, 162, 76, 0.25);
  border-radius: var(--radius-lg);
  transition: background var(--transition), border-color var(--transition),
              box-shadow var(--transition), border-radius 0.3s ease, border-bottom-color 0.3s ease;
}

.donate-summary:hover {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.14), rgba(212, 162, 76, 0.06));
  border-color: rgba(212, 162, 76, 0.4);
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.1);
}

.donate-summary.is-open {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom-color: transparent;
}

.donate-summary::-webkit-details-marker { display: none; }

.donate-summary-text {
  font-family: var(--font-latin);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.03em;
}

.donate-summary-icon {
  flex-shrink: 0;
}

.donate-summary-chevron {
  color: var(--gold);
  opacity: 0.6;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.donate-collapse[open] .donate-summary-chevron {
  transform: rotate(180deg);
}

.donate-body {
  padding: 0;
  border: 1px solid rgba(212, 162, 76, 0.25);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.donate-body .donate-card {
  border: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* --- Hadith section (bottom of home) --- */
.hadith-section {
  margin-top: 16px;
  text-align: center;
  padding: 14px 12px;
  border-radius: var(--radius);
  background: rgba(212, 162, 76, 0.02);
  border: 1px solid rgba(212, 162, 76, 0.06);
  width: 100%;
  box-sizing: border-box;
}

.hadith-quote {
  margin: 0 0 10px;
  padding: 0 4px;
  border: none;
}

.hadith-arabic {
  font-family: var(--font-arabic);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.9;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(212, 162, 76, 0.12);
  direction: rtl;
  text-align: center;
}

.hadith-translation {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-secondary);
  padding: 0 4px;
  margin-bottom: 10px;
  font-style: italic;
}

.hadith-source {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 6px;
}

.hadith-narrator {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hadith-radi {
  font-family: var(--font-arabic);
  font-size: 0.75rem;
  color: var(--gold);
  opacity: 0.7;
}

.hadith-ref {
  font-size: 0.85rem;
  color: var(--gold);
  opacity: 0.9;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* --- Encyclopedia FAQ & Hadith --- */
.ency-faq {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.04);
  animation: encyFadeIn 0.6s ease both;
  animation-delay: 0.3s;
}
.ency-hadith-banner {
  background: linear-gradient(135deg, rgba(212,162,76,0.06) 0%, rgba(10, 14, 26, 0.5) 100%);
  border: 1px solid rgba(212,162,76,0.1);
  border-radius: 18px;
  padding: 24px 22px 20px;
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.8;
  font-size: 0.88rem;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
}
.ency-hadith-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.2;
}
.ency-hadith-icon {
  margin-bottom: 10px;
  opacity: 0.6;
}
.ency-hadith-banner p {
  margin: 0;
}
.ency-hadith-banner em {
  color: var(--gold);
  font-style: italic;
}
.ency-hadith-ref {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  opacity: 0.45;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.ency-faq-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ency-faq-title svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.ency-faq-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.ency-faq-item:hover {
  border-color: rgba(212, 162, 76, 0.1);
  background: rgba(255,255,255,0.03);
}
.ency-faq-item summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s ease;
}
.ency-faq-item summary::before {
  content: '+';
  font-size: 1.15rem;
  color: var(--gold);
  font-weight: 600;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 162, 76, 0.06);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}
.ency-faq-item[open] summary::before {
  content: '\2212';
  background: rgba(212, 162, 76, 0.12);
  transform: rotate(180deg);
}
.ency-faq-item summary::-webkit-details-marker { display: none; }
.ency-faq-item[open] summary {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--gold);
}
.ency-faq-item p {
  padding: 14px 16px 18px;
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.8;
  animation: encyCollapsibleReveal 0.3s ease both;
}
/* FAQ keyboard focus */
.ency-faq-item summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  border-radius: 14px;
}

/* --- Guide Page (Premium) --- */
#pageGuide > .container {
  max-width: 100%;
  width: 100%;
  padding-top: 0;
}
.guide-content { padding-bottom: 2.5rem; }

/* Topbar (integrated inside hero) */
.guide-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 20px;
  position: relative;
  z-index: 2;
}
.guide-topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.12), transparent);
}
.guide-topbar-center {
  flex: 1;
  min-width: 0;
}
.guide-topbar-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.guide-topbar-subtitle {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.guide-topbar-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-left: auto;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(212, 162, 76, 0.06);
  border: 1px solid rgba(212, 162, 76, 0.12);
  flex-shrink: 0;
}

/* Hero */
.guide-hero {
  position: relative;
  overflow: hidden;
  padding: 20px 20px 0;
  margin: 0 -16px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 162, 76, 0.06) 0%, transparent 100%),
    linear-gradient(180deg, rgba(212, 162, 76, 0.03) 0%, transparent 60%);
}
.guide-hero::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 50%;
  width: 400px;
  height: 400px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(212, 162, 76, 0.10) 0%, rgba(212, 162, 76, 0.02) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: guideHeroPulse 6s ease-in-out infinite;
}
.guide-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212, 162, 76, 0.25) 30%, rgba(212, 162, 76, 0.4) 50%, rgba(212, 162, 76, 0.25) 70%, transparent 100%);
}
.guide-hero-ornament-tl,
.guide-hero-ornament-br {
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.18;
}
.guide-hero-ornament-tl {
  top: 14px;
  left: 14px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  border-radius: 6px 0 0 0;
}
.guide-hero-ornament-tl::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  border-radius: 3px 0 0 0;
  opacity: 0.5;
}
.guide-hero-ornament-br {
  bottom: 14px;
  right: 14px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  border-radius: 0 0 6px 0;
}
.guide-hero-ornament-br::after {
  content: '';
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  border-radius: 0 0 3px 0;
  opacity: 0.5;
}
.guide-hero-body {
  text-align: center;
  padding: 32px 4px 40px;
  position: relative;
  z-index: 1;
}
.guide-hero-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15) 0%, rgba(212, 162, 76, 0.05) 100%);
  border: 1.5px solid rgba(212, 162, 76, 0.25);
  box-shadow: 0 0 30px rgba(212, 162, 76, 0.12), 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.25rem;
  animation: guideIconFloat 5s ease-in-out infinite;
}
.guide-hero-icon {
  width: 34px;
  height: 34px;
  color: var(--gold);
}
.guide-hero-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}
.guide-hero-sep {
  width: 48px;
  height: 2px;
  margin: 0 auto 0.75rem;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
  opacity: 0.5;
}
.guide-hero-sub {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto;
}

/* Hadith */
.guide-hadith {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}
.guide-hadith::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(212, 162, 76, 0.07) 0%, transparent 70%);
  pointer-events: none;
}
.guide-hadith-quote {
  position: absolute;
  top: -4px;
  left: 12px;
  font-size: 4rem;
  font-family: Georgia, serif;
  color: var(--gold);
  opacity: 0.12;
  line-height: 1;
  pointer-events: none;
}
.guide-hadith-text {
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-primary);
  margin: 0 0 0.6rem;
  position: relative;
  z-index: 1;
}
.guide-hadith-ref {
  font-size: 0.78rem;
  color: var(--gold);
  opacity: 0.7;
  font-weight: 600;
}

/* Divider */
.guide-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 22px;
}
.guide-divider::before,
.guide-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.18));
}
.guide-divider::after {
  background: linear-gradient(90deg, rgba(212, 162, 76, 0.18), transparent);
}
.guide-divider-diamond {
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
  margin: 0 18px;
  opacity: 0.5;
  box-shadow: 0 0 10px rgba(212, 162, 76, 0.3);
  position: relative;
}
.guide-divider-diamond::before,
.guide-divider-diamond::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--gold);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.35;
}
.guide-divider-diamond::before { left: -12px; }
.guide-divider-diamond::after { right: -12px; }

/* Section label */
.guide-section-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 162, 76, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.guide-section-label::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--gold);
  opacity: 0.3;
  border-radius: 2px;
}
.guide-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.12) 0%, rgba(212, 162, 76, 0.05) 100%);
  border: 1px solid rgba(212, 162, 76, 0.15);
  box-shadow: 0 2px 8px rgba(212, 162, 76, 0.06);
}
.guide-label-icon svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  opacity: 0.85;
}

/* Timeline */
.guide-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.5rem;
  padding-left: 2px;
}
.guide-tl-item {
  display: flex;
  gap: 1rem;
  transition-delay: var(--step-delay, 0s);
}
.guide-tl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 36px;
}
.guide-tl-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(212, 162, 76, 0.10);
  border: 1.5px solid rgba(212, 162, 76, 0.5);
  color: var(--gold);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 14px rgba(212, 162, 76, 0.12), 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.guide-tl-item:hover .guide-tl-dot {
  box-shadow: 0 0 22px rgba(212, 162, 76, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: var(--gold);
  transform: scale(1.1);
}
.guide-tl-dot--check {
  background: rgba(45, 212, 160, 0.12);
  border-color: rgba(45, 212, 160, 0.5);
  color: var(--emerald);
  box-shadow: 0 0 14px rgba(45, 212, 160, 0.15), 0 2px 8px rgba(0, 0, 0, 0.25);
}
.guide-tl-dot--check svg {
  width: 16px;
  height: 16px;
}
.guide-tl-item:hover .guide-tl-dot--check {
  box-shadow: 0 0 22px rgba(45, 212, 160, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: var(--emerald);
}
.guide-tl-line {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: linear-gradient(180deg, rgba(212, 162, 76, 0.20) 0%, rgba(212, 162, 76, 0.05) 100%);
  border-radius: 2px;
}
.guide-tl-item--final .guide-tl-line { display: none; }

/* Timeline cards */
.guide-tl-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.guide-tl-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--gold) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.guide-tl-item:hover .guide-tl-card {
  border-color: rgba(212, 162, 76, 0.2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}
.guide-tl-item:hover .guide-tl-card::before { opacity: 0.4; }

.guide-tl-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.12) 0%, rgba(212, 162, 76, 0.04) 100%);
  border: 1px solid rgba(212, 162, 76, 0.12);
  margin-bottom: 0.55rem;
}
.guide-tl-card-icon svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  opacity: 0.8;
}
.guide-tl-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.4rem;
}
.guide-tl-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}
.guide-tl-tip {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(212, 162, 76, 0.08);
  font-size: 0.76rem;
  color: var(--gold);
  opacity: 0.5;
  transition: opacity 0.3s ease;
  line-height: 1.5;
}
.guide-tl-item:hover .guide-tl-tip { opacity: 0.85; }

/* CTA */
.guide-cta {
  text-align: center;
  padding: 0;
}
.guide-cta-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.guide-cta-card::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(212, 162, 76, 0.06) 0%, transparent 65%);
  pointer-events: none;
}
.guide-cta-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.12) 0%, rgba(45, 212, 160, 0.04) 100%);
  border: 1px solid rgba(45, 212, 160, 0.2);
  margin-bottom: 1rem;
}
.guide-cta-icon-wrap svg {
  width: 22px;
  height: 22px;
  color: var(--emerald);
}
.guide-cta-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.4rem;
  position: relative;
  z-index: 1;
}
.guide-cta-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 1.25rem;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}
.guide-cta-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.guide-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.guide-cta-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Animations */
@keyframes guideHeroPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}
@keyframes guideIconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Responsive */
@media (max-width: 380px) {
  .guide-hero { padding: 16px 14px 0; }
  .guide-hero-body { padding: 24px 0 32px; }
  .guide-hero-icon-wrap { width: 60px; height: 60px; }
  .guide-hero-icon { width: 28px; height: 28px; }
  .guide-hero-title { font-size: 1.2rem; }
  .guide-tl-card { padding: 0.85rem 1rem; }
  .guide-hadith { padding: 1rem 1.2rem 1rem 1.4rem; }
  .guide-cta-buttons { flex-direction: column; align-items: center; }
  .guide-cta-card { padding: 1.5rem 1.2rem; }
}
@media (min-width: 600px) {
  #pageGuide > .container {
    max-width: 640px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .guide-hero {
    margin: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-card);
    margin-top: 8px;
  }
}
@media (min-width: 768px) {
  #pageGuide > .container {
    max-width: 768px;
  }
  .guide-hero { padding: 24px 28px 0; }
  .guide-hero-body { padding: 36px 8px 48px; }
  .guide-hero-icon-wrap { width: 84px; height: 84px; }
  .guide-hero-icon { width: 40px; height: 40px; }
  .guide-hero-title { font-size: 1.6rem; }
  .guide-hero-sub { font-size: 0.92rem; max-width: 480px; }
  .guide-hadith { padding: 1.75rem 2rem 1.75rem 2.25rem; }
  .guide-hadith-text { font-size: 0.95rem; }
  .guide-tl-card { padding: 1.25rem 1.5rem; }
  .guide-tl-card h3 { font-size: 1rem; }
  .guide-tl-card p { font-size: 0.88rem; }
  .guide-cta-card { padding: 2.5rem 2rem; }
}
@media (min-width: 1024px) {
  #pageGuide > .container {
    max-width: 860px;
    padding-left: 32px;
    padding-right: 32px;
  }
  .guide-hero-title { font-size: 1.75rem; }
  .guide-tl-card { padding: 1.35rem 1.75rem; }
}
@media (min-width: 1280px) {
  #pageGuide > .container {
    max-width: 960px;
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* --- Home Footer --- */
.home-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  width: 100%;
}
.home-footer .report-trigger {
  margin-bottom: 0.6rem;
}
.home-footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}
.home-footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.home-footer-links a {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  opacity: 0.6;
}
.home-footer-links a:hover { color: var(--gold); opacity: 1; }
.home-footer-sep {
  color: var(--text-muted);
  opacity: 0.25;
  font-size: 0.6rem;
}
.home-footer-copy {
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.4;
  margin: 0;
}

/* --- Noqta credit --- */
.noqta-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  text-decoration: none;
  transition: opacity 0.3s;
  opacity: 0.5;
}
.noqta-credit:hover {
  opacity: 1;
}
.noqta-credit-label {
  font-size: 0.6rem;
  color: var(--text-muted);
}
.noqta-credit-logo {
  width: 13px;
  height: 13px;
}
.noqta-credit-name {
  font-family: 'Syne', var(--font-latin);
  font-weight: 800;
  font-size: 0.65rem;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.noqta-dot {
  color: var(--gold);
  font-weight: 800;
}

/* ===========================
   REPORT SYSTEM
   =========================== */

/* --- Trigger button in footer --- */
.report-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(212, 162, 76, 0.15);
  border-radius: var(--radius-pill);
  background: rgba(212, 162, 76, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-latin);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.report-trigger svg {
  color: var(--gold);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.report-trigger:hover {
  background: rgba(212, 162, 76, 0.08);
  border-color: rgba(212, 162, 76, 0.3);
  color: var(--text-primary);
}
.report-trigger:hover svg { opacity: 1; }
.report-trigger:active { transform: scale(0.96); transition-duration: 0.08s; }

/* ── Card shell ─────────────────────────────────────────── */
.report-card {
  background: #0b0f1e;
  border: 1px solid rgba(212, 162, 76, 0.12);
  border-radius: 24px;
  width: min(440px, calc(100vw - 32px));
  max-height: min(calc(100dvh - 48px), 720px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(212, 162, 76, 0.05);
  animation: reportCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Gold accent line at top */
.report-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0.5;
  z-index: 5;
}

/* Subtle top glow */
.report-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(212, 162, 76, 0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Islamic pattern (very subtle) */
.report-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.02;
  background-image: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(212, 162, 76, 1) 0deg 30deg,
    transparent 30deg 60deg
  );
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 35%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 35%);
}

/* Children layering — exclude absolutely positioned elements */
.report-card > .report-hero,
.report-card > #reportForm,
.report-card > .report-success { position: relative; z-index: 1; }
.report-glow,
.report-pattern { position: absolute; z-index: 0; }

@keyframes reportCardIn {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Close button ───────────────────────────────────────── */
.report-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.report-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: scale(1.05);
}
.report-close:active {
  transform: scale(0.95);
}

/* ── Hero header ────────────────────────────────────────── */
.report-hero {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 24px 16px;
}

.report-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(212, 162, 76, 0.14) 0%, rgba(212, 162, 76, 0.03) 100%);
  border: 1px solid rgba(212, 162, 76, 0.18);
  color: var(--gold);
  margin-bottom: 14px;
  box-shadow: 0 0 0 5px rgba(212, 162, 76, 0.04);
}

.report-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}

.report-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 0.01em;
}

/* ── Stagger entrance ───────────────────────────────────── */
.report-stagger {
  animation: reportFieldIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(0.12s + var(--i, 0) * 0.06s);
}
@keyframes reportFieldIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollable form body ───────────────────────────────── */
#reportForm {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 24px 24px;
}
#reportForm::-webkit-scrollbar { width: 3px; }
#reportForm::-webkit-scrollbar-track { background: transparent; }
#reportForm::-webkit-scrollbar-thumb {
  background: rgba(212, 162, 76, 0.15);
  border-radius: 3px;
}

/* ── Type selector ──────────────────────────────────────── */
.report-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.report-type-card { cursor: pointer; }
.report-type-card input { display: none; }

.report-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  height: 100%;
  box-sizing: border-box;
  user-select: none;
}

.report-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.report-type-icon svg { width: 18px; height: 18px; }

.report-type-name {
  font-family: var(--font-latin);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color 0.25s;
  text-align: center;
}

.report-type-desc {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  opacity: 0.55;
  transition: opacity 0.25s, color 0.25s;
}

/* Hover */
.report-type-card:hover .report-card-inner {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.report-type-card:active .report-card-inner {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

/* ── Bug (amber) ── */
.report-type-card[data-type="bug"] input:checked + .report-card-inner {
  background: rgba(239, 158, 50, 0.06);
  border-color: rgba(239, 158, 50, 0.35);
  box-shadow: 0 0 0 1px rgba(239, 158, 50, 0.06), 0 4px 16px rgba(239, 158, 50, 0.06);
}
.report-type-card[data-type="bug"] input:checked + .report-card-inner .report-type-icon {
  background: rgba(239, 158, 50, 0.12);
  border-color: rgba(239, 158, 50, 0.3);
  color: #f0a030;
  box-shadow: 0 0 12px rgba(239, 158, 50, 0.15);
}
.report-type-card[data-type="bug"] input:checked + .report-card-inner .report-type-name { color: #f5b555; }
.report-type-card[data-type="bug"] input:checked + .report-card-inner .report-type-desc { opacity: 0.85; color: rgba(245, 181, 85, 0.7); }

/* ── Content (blue) ── */
.report-type-card[data-type="content"] input:checked + .report-card-inner {
  background: rgba(96, 165, 250, 0.06);
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.06), 0 4px 16px rgba(96, 165, 250, 0.06);
}
.report-type-card[data-type="content"] input:checked + .report-card-inner .report-type-icon {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
  color: #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.15);
}
.report-type-card[data-type="content"] input:checked + .report-card-inner .report-type-name { color: #93bbfc; }
.report-type-card[data-type="content"] input:checked + .report-card-inner .report-type-desc { opacity: 0.85; color: rgba(147, 187, 252, 0.7); }

/* ── Suggestion (emerald) ── */
.report-type-card[data-type="suggestion"] input:checked + .report-card-inner {
  background: rgba(45, 212, 160, 0.06);
  border-color: rgba(45, 212, 160, 0.3);
  box-shadow: 0 0 0 1px rgba(45, 212, 160, 0.06), 0 4px 16px rgba(45, 212, 160, 0.06);
}
.report-type-card[data-type="suggestion"] input:checked + .report-card-inner .report-type-icon {
  background: rgba(45, 212, 160, 0.12);
  border-color: rgba(45, 212, 160, 0.25);
  color: var(--emerald);
  box-shadow: 0 0 12px rgba(45, 212, 160, 0.15);
}
.report-type-card[data-type="suggestion"] input:checked + .report-card-inner .report-type-name { color: #5ee8c0; }
.report-type-card[data-type="suggestion"] input:checked + .report-card-inner .report-type-desc { opacity: 0.85; color: rgba(94, 232, 192, 0.7); }

/* ── Divider ────────────────────────────────────────────── */
.report-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  margin: 18px 0;
}

/* ── Form fields ────────────────────────────────────────── */
.report-field { margin-bottom: 16px; }

.report-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.report-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  font-size: 0.64rem;
}
.report-required { color: rgba(239, 158, 50, 0.6); font-weight: 400; }

/* ── Input with icon ── */
.report-input-wrap { position: relative; }
.report-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.2s, color 0.2s;
}
.report-input-wrap .report-input { padding-left: 40px; }
.report-input-wrap:focus-within .report-input-icon { opacity: 0.8; color: var(--gold); }

/* ── Text inputs ── */
.report-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.report-input::placeholder { color: var(--text-muted); opacity: 0.4; }
.report-input:focus {
  border-color: rgba(212, 162, 76, 0.35);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.06);
}

.report-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 0.84rem;
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  line-height: 1.65;
}
.report-textarea::placeholder { color: var(--text-muted); opacity: 0.4; }
.report-textarea:focus {
  border-color: rgba(212, 162, 76, 0.35);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.06);
}

/* ── Char counter ── */
.report-char-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.report-char-bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
}
.report-char-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  border-radius: 2px;
  transition: width 0.15s ease;
}
.report-char-count {
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ── Submit button ──────────────────────────────────────── */
.report-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(160deg, #edc059 0%, #c9922d 100%);
  color: #1a0e00;
  font-family: var(--font-latin);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 16px rgba(212, 162, 76, 0.2);
  position: relative;
  overflow: hidden;
  margin-top: 6px;
}
.report-submit-text {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-submit-text svg { opacity: 0.7; }

.report-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 8px 28px rgba(212, 162, 76, 0.3);
  filter: brightness(1.05);
}
.report-submit:active:not(:disabled) {
  transform: scale(0.98) translateY(0);
  transition-duration: 0.08s;
}
.report-submit:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  filter: saturate(0.4);
}

/* Spinner */
.report-spinner { animation: reportSpin 0.75s linear infinite; }
@keyframes reportSpin {
  to { transform: rotate(360deg); }
}

/* ── Success screen ──────────────────────────────────────── */
.report-success {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 28px 36px;
  position: relative;
}

/* Expanding rings */
.report-success-ring {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid rgba(45, 212, 160, 0.5);
  opacity: 0;
  animation: reportRingExpand 1s 0.25s ease-out forwards;
  pointer-events: none;
}
.report-success-ring-2 { animation: reportRingExpand 1s 0.5s ease-out forwards; }
@keyframes reportRingExpand {
  0%   { transform: translateX(-50%) scale(0.6); opacity: 0.5; }
  100% { transform: translateX(-50%) scale(2.2); opacity: 0; }
}

.report-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(45, 212, 160, 0.12) 0%, rgba(45, 212, 160, 0.03) 100%);
  border: 1px solid rgba(45, 212, 160, 0.22);
  color: var(--emerald);
  margin-bottom: 24px;
  animation: reportIconPop 0.45s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 0 40px rgba(45, 212, 160, 0.08);
}
@keyframes reportIconPop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

.report-check-path {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: reportCheckDraw 0.45s 0.4s ease-out forwards;
}
@keyframes reportCheckDraw { to { stroke-dashoffset: 0; } }

.report-success-title {
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
  animation: reportFadeUp 0.4s 0.45s ease-out both;
  direction: rtl;
}
.report-success-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
  animation: reportFadeUp 0.4s 0.55s ease-out both;
}
@keyframes reportFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive: mobile bottom sheet ───────────────────── */
@media (max-width: 500px) {
  #reportModal {
    align-items: flex-end;
    padding: 0;
  }

  .report-card {
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    animation: reportCardInMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  /* Drag handle indicator */
  .report-card::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    z-index: 10;
  }

  @keyframes reportCardInMobile {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .report-hero { padding: 28px 20px 16px; }

  .report-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    margin-bottom: 12px;
  }
  .report-hero-icon svg { width: 22px; height: 22px; }

  .report-title { font-size: 1.05rem; }
  .report-subtitle { font-size: 0.72rem; }

  #reportForm { padding: 0 18px 20px; }

  .report-types { gap: 6px; }

  .report-card-inner {
    padding: 14px 6px 12px;
    border-radius: 12px;
    gap: 6px;
  }

  .report-type-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .report-type-icon svg { width: 16px; height: 16px; }

  .report-type-name { font-size: 0.72rem; }
  .report-type-desc { font-size: 0.55rem; }

  .report-input { font-size: 16px; padding: 11px 13px; border-radius: 10px; }
  .report-input-wrap .report-input { padding-left: 38px; }
  .report-textarea { font-size: 16px; min-height: 90px; padding: 12px 14px; border-radius: 10px; }

  .report-submit { padding: 14px 18px; font-size: 0.88rem; border-radius: 12px; }

  .report-close { top: 12px; right: 12px; width: 32px; height: 32px; }

  .report-success { padding: 40px 20px 28px; }
  .report-success-icon { width: 64px; height: 64px; }
  .report-success-icon svg { width: 28px; height: 28px; }

  .report-divider { margin: 14px 0; }
  .report-field { margin-bottom: 14px; }
}

@media (max-width: 340px) {
  .report-type-desc { display: none; }
  .report-card-inner { padding: 12px 4px 10px; gap: 5px; }
}

@keyframes heroParticleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0);
  }
}

/* ===========================
   PSEUDO MODAL
   =========================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 12, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: modalOverlayIn 0.35s ease both;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: linear-gradient(170deg, rgba(18, 22, 44, 0.98), rgba(10, 14, 28, 0.99));
  border: 1.5px solid rgba(212, 162, 76, 0.15);
  border-radius: 22px;
  padding: 36px 28px 32px;
  max-width: 380px;
  width: 100%;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(212, 162, 76, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  animation: modalCardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  overflow: hidden;
}

/* Top gold accent line */
.modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212,162,76,0.6), rgba(255,220,130,0.4), rgba(212,162,76,0.6), transparent);
  border-radius: 0 0 2px 2px;
}

/* Subtle top glow */
.modal-card::after {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 120px;
  background: radial-gradient(ellipse, rgba(212,162,76,0.08) 0%, transparent 70%);
  pointer-events: none;
}

@keyframes modalCardIn {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-bismillah {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(212, 162, 76, 0.3);
  margin-bottom: 18px;
  direction: rtl;
  position: relative;
  z-index: 1;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

/* Modal icon badge */
.modal-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(212,162,76,0.14), rgba(212,162,76,0.04));
  border: 1px solid rgba(212,162,76,0.22);
  color: var(--gold);
  box-shadow: 0 0 0 6px rgba(212,162,76,0.04), 0 4px 16px rgba(212,162,76,0.08);
  position: relative;
  z-index: 1;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.modal-card .input-field {
  text-align: center;
  margin-bottom: 16px;
}

/* Modal button overrides */
.modal-card .btn-primary {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

/* ===========================
   PSEUDO BADGE (Home)
   =========================== */

.pseudo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-family: var(--font-latin);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pseudo-badge:hover {
  background: var(--bg-card-hover);
  border-color: rgba(212, 162, 76, 0.2);
}

.pseudo-badge:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.pseudo-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(212, 162, 76, 0.08);
  font-size: 0.9rem;
  color: var(--gold-light);
}

.pseudo-avatar svg {
  color: var(--text-muted);
}

.pseudo-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pseudo-chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  opacity: 0.35;
  transition: all var(--transition);
}

.pseudo-badge:hover .pseudo-chevron {
  opacity: 1;
  color: var(--gold);
}

/* ===========================
   SCROLL REVEAL ANIMATIONS
   =========================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===========================
   RESPONSIVE — Extended
   =========================== */

@media (min-width: 768px) {
  .hero-arabic { font-size: 7rem; }
  .hero-husna { font-size: 2.2rem; }
  .hero-tagline { font-size: 1rem; }
  .hero-line { animation-fill-mode: forwards; }

  .container { max-width: 540px; }

  .modal-card { padding: 40px 32px; }
}

@media (min-width: 1024px) {
  .container { max-width: 600px; }
  .hero-arabic { font-size: 8rem; }
}

/* ===========================
   BROWSE ROOMS MODAL
   =========================== */

/* ===========================
   BROWSE ROOMS PANEL
   =========================== */

/* ---------------------------------------------------------------
   BROWSE — Bottom Sheet
   --------------------------------------------------------------- */

/* =====================================================
   BROWSE — Centered Modal for Public Rooms
   ===================================================== */
.browse-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(3, 5, 12, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              -webkit-backdrop-filter 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.browse-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(3, 5, 12, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.browse-sheet {
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  min-height: 300px;
  background: linear-gradient(170deg, rgba(18, 22, 44, 0.98) 0%, rgba(10, 14, 28, 0.99) 100%);
  border: 1.5px solid rgba(212, 162, 76, 0.15);
  border-radius: 24px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(212, 162, 76, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(30px);
  opacity: 0;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.browse-backdrop.open .browse-sheet {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Closing animation */
.browse-backdrop.closing .browse-sheet {
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 1, 1),
              opacity 0.2s cubic-bezier(0.4, 0, 1, 1);
}

.browse-backdrop.closing {
  opacity: 0;
  background: rgba(3, 5, 12, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 1, 1),
              background 0.25s ease,
              backdrop-filter 0.25s ease,
              -webkit-backdrop-filter 0.25s ease;
}

/* Top accent line */
.browse-sheet::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.5), rgba(255, 230, 160, 0.3), rgba(212, 162, 76, 0.5), transparent);
  border-radius: 0 0 2px 2px;
  z-index: 1;
}

/* Subtle top glow */
.browse-sheet::after {
  content: '';
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  width: 250px; height: 100px;
  background: radial-gradient(ellipse, rgba(212,162,76,0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Header --- */
.browse-header {
  flex-shrink: 0;
  padding: 22px 22px 16px;
  background: linear-gradient(160deg, rgba(212, 162, 76, 0.06) 0%, transparent 50%);
  border-bottom: 1px solid rgba(212, 162, 76, 0.10);
  position: relative;
}

.browse-header-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.browse-header-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(212, 162, 76, 0.15), rgba(212, 162, 76, 0.04));
  border: 1px solid rgba(212, 162, 76, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(212,162,76,0.08);
}

.browse-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.browse-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.browse-count {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.browse-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.browse-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.browse-action-btn:hover {
  background: rgba(212, 162, 76, 0.12);
  border-color: rgba(212, 162, 76, 0.25);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(212,162,76,0.08);
}

/* --- Room list --- */
.browse-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.browse-list::-webkit-scrollbar { width: 3px; }
.browse-list::-webkit-scrollbar-thumb {
  background: rgba(212, 162, 76, 0.30);
  border-radius: 3px;
}

/* --- Empty state --- */
.browse-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 24px 56px;
  text-align: center;
}

.browse-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(212,162,76,0.04);
  border: 1px solid rgba(212,162,76,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  opacity: 0.35;
  margin-bottom: 6px;
  box-shadow: 0 0 24px rgba(212,162,76,0.05);
}

.browse-empty-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.browse-empty-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 280px;
}

.browse-empty-hint strong {
  color: var(--gold-light);
  font-weight: 600;
}

/* --- Room card --- */
.browse-room {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(160deg, rgba(15, 19, 38, 0.70), rgba(18, 22, 42, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.browse-room::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  opacity: 0;
  border-radius: 0 2px 2px 0;
  transition: opacity 0.3s ease;
}

.browse-room:hover {
  border-color: rgba(212, 162, 76, 0.22);
  background: linear-gradient(160deg, rgba(22, 28, 52, 0.90), rgba(28, 34, 58, 0.80));
  box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 16px rgba(212,162,76,0.04);
}

.browse-room:hover::before {
  opacity: 1;
}

.browse-room:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.browse-room-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(212, 162, 76, 0.18), rgba(212, 162, 76, 0.05));
  border: 1px solid rgba(212, 162, 76, 0.22);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-light);
  box-shadow: 0 2px 8px rgba(212,162,76,0.08);
}

.browse-room-info {
  flex: 1;
  min-width: 0;
}

.browse-room-host {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.browse-room-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.browse-room-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  white-space: nowrap;
}

.browse-room-tag svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.browse-room-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
  flex-shrink: 0;
}

.browse-room-join {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid rgba(212, 162, 76, 0.30);
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.15), rgba(212, 162, 76, 0.06));
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
  white-space: nowrap;
}

.browse-room-join:hover {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.28), rgba(212, 162, 76, 0.14));
  border-color: rgba(212, 162, 76, 0.50);
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.15);
  transform: scale(1.04);
  color: #fff;
}

.browse-room-join:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.browse-room-full {
  opacity: 0.55;
}

.browse-tag-full {
  background: rgba(220, 60, 60, 0.15) !important;
  border-color: rgba(220, 60, 60, 0.2) !important;
  color: #e06060;
}

.browse-tag-iq {
  background: rgba(100, 140, 255, 0.12) !important;
  border-color: rgba(100, 140, 255, 0.15) !important;
  color: #8ab4ff;
}

.browse-tag-classic {
  background: rgba(212, 162, 76, 0.12) !important;
  border-color: rgba(212, 162, 76, 0.15) !important;
  color: var(--gold-light);
}

/* Larger screen: constrain width */
@media (min-width: 500px) {
  .browse-sheet {
    max-width: 440px;
  }
}

/* Small button variant */
.btn-sm {
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Small icon button (refresh) */
.btn-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  padding: 0;
}

.btn-icon-sm:hover {
  border-color: var(--border-active);
  color: var(--gold);
  background: rgba(212, 162, 76, 0.06);
}

.btn-icon-sm:hover {
  border-color: var(--border-active);
  color: var(--gold);
  background: var(--bg-card-hover);
}

.btn-icon-sm:active {
  transform: rotate(180deg);
}

/* ===========================
   GP — GAME PAGE (unified host + player)
   Premium "Sacred Arcade" design
   =========================== */
.gp-wrapper {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- TOP BAR ---------- */
.gp-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--bg-card), rgba(20, 25, 48, 0.9));
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.gp-topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.2), transparent);
}

.gp-topbar-ring {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.gp-ring-svg {
  width: 50px;
  height: 50px;
  display: block;
  filter: drop-shadow(0 0 4px rgba(212, 162, 76, 0.15));
}

.gp-ring-bar {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gp-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: -0.02em;
}

.gp-topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.gp-mode-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.12), rgba(212, 162, 76, 0.04));
  border: 1px solid rgba(212, 162, 76, 0.2);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Joker button (inside input row) --- */
.gp-joker-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(212, 162, 76, 0.2), rgba(212, 162, 76, 0.06));
  border: 1.5px solid rgba(212, 162, 76, 0.3);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.gp-joker-btn:not(.disabled):hover {
  background: linear-gradient(145deg, rgba(212, 162, 76, 0.35), rgba(212, 162, 76, 0.15));
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 162, 76, 0.25), inset 0 0 12px rgba(212, 162, 76, 0.06);
  transform: translateY(-1px);
}

.gp-joker-btn:not(.disabled):active {
  transform: translateY(0) scale(0.94);
}

.gp-joker-btn.disabled {
  opacity: 0.4;
  cursor: default;
  border-color: rgba(212, 162, 76, 0.12);
}

.gp-joker-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
  border: 2px solid var(--bg-deep);
}

/* --- Pause button --- */
.gp-pause-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gp-pause-btn:hover {
  border-color: var(--border-active);
  color: var(--gold);
  background: rgba(212, 162, 76, 0.06);
}

/* --- Leave button — always red, premium --- */
.gp-leave-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(220, 50, 50, 0.10);
  border: 1.5px solid rgba(220, 50, 50, 0.30);
  color: #e85555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  box-shadow: 0 2px 10px rgba(220, 50, 50, 0.10), inset 0 1px 0 rgba(255,255,255,0.04);
}

.gp-leave-btn:hover {
  border-color: rgba(239, 68, 68, 0.55);
  color: #ff6b6b;
  background: rgba(220, 50, 50, 0.18);
  box-shadow: 0 4px 20px rgba(220, 50, 50, 0.20), 0 0 24px rgba(220, 50, 50, 0.10);
  transform: scale(1.08);
}

.gp-leave-btn:active {
  transform: scale(0.94);
  transition-duration: 0.08s;
}

/* --- Sound toggle button --- */
.gp-sound-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  overflow: hidden;
}

.gp-sound-toggle:hover {
  border-color: rgba(212, 162, 76, 0.3);
  background: rgba(212, 162, 76, 0.06);
}

.gp-sound-toggle:active {
  transform: scale(0.9);
  transition: transform 0.1s ease;
}

/* Icon layers */
.gp-sound-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gp-sound-icon svg {
  width: 16px;
  height: 16px;
}

.gp-sound-on {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.gp-sound-off {
  opacity: 0;
  transform: scale(0.3) rotate(-90deg);
}

.gp-sound-toggle.muted {
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.04);
}

.gp-sound-toggle.muted .gp-sound-on {
  opacity: 0;
  transform: scale(0.3) rotate(90deg);
}

.gp-sound-toggle.muted .gp-sound-off {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ---------- TURN BANNER ---------- */
.gp-turn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--bg-card), rgba(18, 22, 42, 0.9));
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.gp-turn-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.15), transparent);
  transition: opacity 0.4s;
}

.gp-turn-banner.is-my-turn {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.12), rgba(212, 162, 76, 0.03));
  box-shadow: 0 0 24px var(--gold-glow), var(--shadow-card);
  animation: gpTurnPulse 2.5s ease-in-out infinite;
}

.gp-turn-banner.is-my-turn::before {
  background: linear-gradient(90deg, transparent, rgba(212, 162, 76, 0.5), transparent);
}

@keyframes gpTurnPulse {
  0%, 100% { box-shadow: 0 0 20px var(--gold-glow), var(--shadow-card); }
  50% { box-shadow: 0 0 32px var(--gold-glow-strong), var(--shadow-card); }
}

.gp-turn-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gp-turn-banner.is-my-turn .gp-turn-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gp-turn-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-turn-banner.is-my-turn .gp-turn-text {
  color: var(--gold-bright);
  text-shadow: 0 0 20px rgba(212, 162, 76, 0.3);
}

/* ---------- ARENA ---------- */
.gp-arena-wrap {
  position: relative;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at center, rgba(212, 162, 76, 0.04) 0%, rgba(5, 8, 17, 0.5) 75%);
  border: 1px solid rgba(212, 162, 76, 0.1);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.2), 0 4px 24px rgba(0, 0, 0, 0.15);
}

.gp-arena-wrap::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(212, 162, 76, 0.15), transparent 40%, transparent 60%, rgba(212, 162, 76, 0.08));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
  pointer-events: none;
}

/* ---------- PROGRESS BAR ---------- */
.gp-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
}

.gp-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(212, 162, 76, 0.06);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.gp-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(212, 162, 76, 0.3);
  position: relative;
}

.gp-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  border-radius: 0 4px 4px 0;
}

.gp-progress-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.gp-progress-label span {
  color: var(--gold-bright);
}

/* ---------- INPUT ZONE ---------- */
.gp-input {
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(212, 162, 76, 0.06), var(--bg-card));
  border: 1.5px solid var(--gold-deep);
  box-shadow: 0 0 24px rgba(212, 162, 76, 0.1), var(--shadow-card);
  animation: gpInputAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.gp-input::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

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

.gp-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.gp-input-field {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-deep);
  border: 1.5px solid var(--border-card);
  border-radius: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.gp-input-field::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.gp-input-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.08), 0 0 16px rgba(212, 162, 76, 0.06);
}

.gp-submit-btn {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border: none;
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(212, 162, 76, 0.25);
}

.gp-submit-btn:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 4px 24px rgba(212, 162, 76, 0.35);
  transform: translateY(-1px);
}

.gp-submit-btn:active {
  transform: translateY(0) scale(0.95);
}

/* ---------- JOKER HINT POPUP ---------- */
.joker-hint-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
}

.joker-hint-popup.visible {
  animation: jokerCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.joker-hint-popup.hiding {
  animation: jokerCardOut 0.35s ease-in forwards;
}

@keyframes jokerCardOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85) translateY(-15px); }
}

@keyframes jokerCardIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(-3deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

.joker-hint-content {
  background: linear-gradient(160deg, rgba(20, 26, 50, 0.97) 0%, rgba(12, 16, 35, 0.98) 100%);
  border: 1.5px solid rgba(212, 162, 76, 0.4);
  border-radius: var(--radius-lg);
  padding: 36px 44px 32px;
  text-align: center;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 80px var(--gold-glow),
    0 0 120px rgba(212, 162, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
}

.joker-hint-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), var(--gold), var(--gold-bright), transparent);
}

.joker-hint-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 162, 76, 0.08) 0%, transparent 55%);
  pointer-events: none;
}

.joker-hint-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  background: rgba(212, 162, 76, 0.1);
  border: 1px solid rgba(212, 162, 76, 0.2);
  border-radius: 20px;
  padding: 3px 14px;
  margin-bottom: 16px;
}

.joker-hint-icon {
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
  animation: jokerPulse 2s ease-in-out infinite;
}

.joker-hint-divider {
  width: 40px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 8px auto 10px;
  position: relative;
  z-index: 1;
}

@keyframes jokerPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.4)); }
  50% { filter: drop-shadow(0 0 20px rgba(212, 162, 76, 0.7)); }
}

.joker-hint-french {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 10px;
  text-shadow: 0 0 24px rgba(212, 162, 76, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.joker-hint-category {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
  opacity: 0.7;
}

/* ---------- SCOREBOARD ---------- */
.gp-scoreboard-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(18, 22, 42, 0.85));
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.gp-scoreboard-card:has(.gp-scoreboard:empty) {
  display: none;
}

.gp-scoreboard-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
  background: rgba(212, 162, 76, 0.04);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gp-scoreboard {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gp-scoreboard:empty {
  display: none;
}

.sb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.sb-row.is-me {
  background: rgba(212, 162, 76, 0.07);
  border: 1px solid rgba(212, 162, 76, 0.1);
}

.sb-row.eliminated {
  opacity: 0.25;
}

.sb-rank {
  width: 22px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

.sb-row:first-child .sb-rank {
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(212, 162, 76, 0.3);
}

.sb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.sb-name {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-name small {
  color: var(--text-muted);
  font-weight: 400;
}

.sb-score {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ---------- MOBILE ---------- */
@media (max-width: 480px) {
  .gp-wrapper {
    padding: 10px 12px 28px;
    gap: 10px;
  }

  .gp-topbar {
    gap: 8px;
    padding: 8px 12px;
    border-radius: 14px;
  }

  .gp-topbar-ring {
    width: 42px;
    height: 42px;
  }

  .gp-ring-svg {
    width: 42px;
    height: 42px;
  }

  .gp-ring-text {
    font-size: 0.55rem;
  }

  .gp-turn-banner {
    padding: 10px 16px;
    gap: 10px;
    border-radius: 14px;
  }

  .gp-turn-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
  }

  .gp-turn-text {
    font-size: 0.9rem;
  }

  .gp-mode-badge {
    padding: 4px 12px;
    font-size: 0.6rem;
  }

  .gp-arena-wrap {
    padding: 10px;
    border-radius: 20px;
  }

  .gp-progress {
    padding: 6px 10px;
    border-radius: 8px;
  }

  .gp-input {
    padding: 12px;
    border-radius: 14px;
  }

  .gp-input-field {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .gp-submit-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .gp-joker-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .gp-joker-btn svg {
    width: 16px;
    height: 16px;
  }

  .gp-pause-btn,
  .gp-sound-toggle {
    width: 32px;
    height: 32px;
  }
  .gp-leave-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .gp-scoreboard-card {
    border-radius: 14px;
  }

  .gp-scoreboard-title {
    padding: 10px 14px;
  }

  .sb-row {
    gap: 8px;
    padding: 6px 8px;
  }

  .sb-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.65rem;
  }

  .sb-name {
    font-size: 0.78rem;
  }

  .sb-score {
    font-size: 0.78rem;
  }
}

/* ===========================
   GLOSSARY — Interactive Lexique
   =========================== */

/* --- Highlighted terms in text --- */
.glossary-term {
  color: var(--gold-light);
  text-decoration: underline dotted rgba(212, 162, 76, 0.4);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: background var(--transition-fast), text-decoration-color var(--transition-fast);
  border-radius: 2px;
  padding: 1px 3px;
  position: relative;
  z-index: 2;
}

.glossary-term:hover {
  background: rgba(212, 162, 76, 0.12);
  text-decoration-color: var(--gold);
  text-decoration-style: solid;
}

.glossary-term:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Lexique section --- */
.glossary-section {
  margin-top: 4px;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.3) 0%, transparent 100%);
  border-radius: 16px;
  padding-bottom: 8px;
}

.glossary-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: rgba(212, 162, 76, 0.15);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

/* --- Glossary items (accordion) --- */
.glossary-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glossary-item {
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.6s ease, transform 0.2s ease;
}

.glossary-item:hover {
  transform: translateY(-1px);
}

.glossary-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: rgba(15, 19, 36, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  text-align: left;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: rgba(212, 162, 76, 0.15);
}

.glossary-item-header:hover {
  background: rgba(22, 28, 52, 0.7);
  border-color: var(--border-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.glossary-item-header:active {
  background: rgba(25, 32, 58, 0.8);
  transform: scale(0.995);
}

.glossary-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.glossary-item-term {
  flex: 1;
  font-weight: 600;
  color: var(--gold-light);
}

.glossary-item-cat {
  font-size: 0.73rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.glossary-chevron {
  flex-shrink: 0;
  transition: transform var(--transition);
  color: var(--text-muted);
}

.glossary-item-header[aria-expanded="true"] .glossary-chevron {
  transform: rotate(180deg);
}

.glossary-item-header[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  background: rgba(18, 24, 46, 0.7);
  border-color: rgba(212, 162, 76, 0.12);
}

/* --- Collapsible body --- */
.glossary-item-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.7) 0%, rgba(15, 19, 36, 0.5) 100%);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  padding: 0 14px;
}

.glossary-item-body[aria-hidden="false"] {
  max-height: 400px;
  padding: 16px 18px;
}

.glossary-item-body p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  padding: 4px 0 4px 12px;
  border-left: 2px solid rgba(212, 162, 76, 0.2);
}

/* --- Highlight animation when scrolled to --- */
@keyframes glossaryHighlight {
  0%   { box-shadow: 0 0 0 0 rgba(212, 162, 76, 0.5); }
  40%  { box-shadow: 0 0 12px 4px rgba(212, 162, 76, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(212, 162, 76, 0); }
}

.glossary-highlight {
  animation: glossaryHighlight 1.5s ease-out;
}

/* --- Responsive: hide category label on mobile --- */
@media (max-width: 480px) {
  .glossary-item-cat {
    display: none;
  }

  .glossary-item-header {
    padding: 11px 12px;
    gap: 8px;
    font-size: 0.84rem;
  }

  .glossary-item-body[aria-hidden="false"] {
    padding: 12px 14px;
  }

  .glossary-item-body p {
    font-size: 0.82rem;
    line-height: 1.7;
    padding: 2px 0 2px 10px;
  }

  .ency-scholar-citation {
    font-size: 0.72rem;
    padding: 6px 10px;
  }
}

/* ===========================
   REDUCED MOTION
   =========================== */
@media (prefers-reduced-motion: reduce) {
  .pseudo-badge,
  .home-cta-duo,
  .home-features,
  .support-block,
  .donate-collapse,
  .hadith-section {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .hcta-shimmer,
  .hcta-border-spin,
  .hcta-glow,
  .hcta-glow-sec {
    animation: none !important;
    display: none;
  }
}
