@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-primary: #050811;
  --bg-surface: rgba(13, 20, 36, 0.85);
  --bg-surface-elevated: rgba(26, 38, 64, 0.92);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(34, 197, 94, 0.4);
  
  --accent-green: #22c55e;
  --accent-green-glow: rgba(34, 197, 94, 0.45);
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.45);
  --accent-blue: #38bdf8;
  --accent-blue-glow: rgba(56, 189, 248, 0.45);
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(34, 197, 94, 0.3);

  --font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-latin: 'Outfit', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
}

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

body {
  font-family: var(--font-arabic);
  direction: rtl;
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
}

/* App Layout */
#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 3D Globe Viewport with Space / Starry Backdrop */
#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: #030509;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 150px 180px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 300px 90px, #94a3b8, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 450px 320px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 600px 220px, #60a5fa, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 750px 140px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 900px 300px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 1050px 70px, #38bdf8, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 1200px 250px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(circle at 50% 50%, rgba(14, 30, 60, 0.45) 0%, rgba(3, 5, 9, 1) 75%);
  background-repeat: repeat;
  background-size: 800px 800px, 800px 800px, 800px 800px, 800px 800px, 800px 800px, 800px 800px, 800px 800px, 800px 800px, 800px 800px, 100% 100%;
}

/* Header Bar */
.game-header {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.game-header > * {
  pointer-events: auto;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.brand-badge:hover {
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 15px var(--accent-green-glow);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-green);
  text-transform: uppercase;
}

/* Top Mini Sponsor Banner (Ad 1: Discreet & Non-Intrusive) */
.ad-top-sponsor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(13, 20, 36, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  color: #e2e8f0;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s;
}

.ad-top-sponsor .ad-tag {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

.ad-top-sponsor code {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-green);
  font-weight: 700;
}

/* User Profile Badge in Header */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-profile-badge:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.user-avatar {
  font-size: 1.1rem;
}

.pro-crown-tag {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  color: #fff;
}

/* Score Pill */
.score-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 0.95rem;
}

.score-pill .score-label {
  font-family: var(--font-arabic);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.score-pill .score-val {
  color: var(--accent-green);
  text-shadow: 0 0 12px var(--accent-green-glow);
}

/* Right Small Square Ad Widget (Ad 2: Non-Intrusive, Collapsible) */
.ad-square-widget {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  z-index: 20;
  width: 175px;
  background: rgba(10, 16, 30, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-square-widget.minimized {
  width: 80px;
  padding: 6px 8px;
}

.ad-square-widget.minimized .ad-square-body {
  display: none;
}

.ad-square-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ad-badge-sm {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

.ad-minimize-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  border-radius: 4px;
}

.ad-minimize-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.ad-square-body {
  text-align: center;
}

.ad-product-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.ad-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.ad-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
}

.ad-cta-btn {
  width: 100%;
  padding: 5px 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.ad-cta-btn:hover {
  transform: scale(1.02);
}

/* Question HUD Card */
.question-card-container {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 92%;
  max-width: 680px;
  pointer-events: none;
}

.question-card {
  pointer-events: auto;
  background: rgba(10, 16, 30, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 11px 16px;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  animation: slideDownFade 0.35s ease-out forwards;
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #38bdf8, #f59e0b);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.round-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
  transform: scale(1.3);
}

.progress-dot.green {
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.progress-dot.yellow {
  background: var(--accent-gold);
}

.progress-dot.red {
  background: var(--accent-red);
}

.round-number-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.category-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.14);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.question-text {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
  color: #ffffff;
  margin-bottom: 4px;
}

.question-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* City search row (keyboard/mouse alternative to globe clicking) */
.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  background: rgba(13, 20, 36, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
}
.search-input:disabled { opacity: 0.6; }
.search-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.search-btn:hover { border-color: var(--accent-blue); transform: translateY(-1px); }

/* Resume FAB (dead-end rescue: finished round, no visible action) */
.resume-fab {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 14px 28px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floating Bottom Guess Controls */
.bottom-controls {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 90%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.bottom-controls > * {
  pointer-events: auto;
}

.hint-banner {
  background: rgba(13, 20, 36, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulseHint 2s infinite ease-in-out;
}

.btn-confirm {
  width: 100%;
  padding: 16px 28px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.01em;
}

.btn-confirm:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.6);
}

.btn-confirm:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.btn-confirm:disabled {
  background: rgba(30, 41, 59, 0.65);
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Result Reveal Modal Card */
.reveal-card {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  width: 92%;
  max-width: 620px;
  background: rgba(10, 16, 30, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.8);
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.score-badge-large {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-emoji {
  font-size: 2.4rem;
  line-height: 1;
}

.score-number-group {
  display: flex;
  flex-direction: column;
}

.score-main {
  font-family: var(--font-latin);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
}

.score-main.green { color: var(--accent-green); text-shadow: 0 0 18px var(--accent-green-glow); }
.score-main.yellow { color: var(--accent-gold); text-shadow: 0 0 18px var(--accent-gold-glow); }
.score-main.red { color: var(--accent-red); }

.distance-tag {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.answer-location-name {
  font-size: 1.18rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.answer-story {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.btn-next-question {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
  transition: all 0.2s ease;
}

.btn-next-question:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.6);
}

/* Modals General */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0d1527;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.9);
  position: relative;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Social Login Buttons */
.social-login-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-social {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

.btn-google:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  padding: 0 10px;
}

/* Email & OTP Inputs */
.input-group {
  margin-bottom: 14px;
  text-align: right;
}

.input-label {
  display: block;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  direction: ltr;
}

.otp-digit {
  width: 52px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-latin);
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  color: #fff;
  outline: none;
  transition: all 0.2s;
}

.otp-digit:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green-glow);
  background: rgba(255, 255, 255, 0.1);
}

/* Paywall Countdown Box */
.countdown-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-top: 6px;
}

.countdown-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.countdown-timer {
  font-family: var(--font-latin);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.pricing-headline {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-align: center;
}

/* Pricing Cards */
.pricing-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.pricing-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.pricing-card.active {
  border-color: var(--accent-green);
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.pricing-card.featured {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.08);
}

.pricing-card.featured.active {
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
}

.featured-ribbon {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.plan-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}

.plan-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.plan-radio.selected {
  border-color: var(--accent-green);
  background: var(--accent-green);
  color: #000;
  font-weight: 900;
}

.plan-price {
  margin-bottom: 10px;
}

.price-number {
  font-family: var(--font-latin);
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
}

.price-curr {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.plan-features {
  list-style: none;
  font-size: 0.72rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
}

/* Checkout Buttons (Apple Pay & Mada) */
.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-apple-pay {
  width: 100%;
  padding: 14px 20px;
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.2s;
}

.btn-apple-pay:hover {
  background: #111;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

.apple-pay-logo {
  font-size: 1.25rem;
  font-weight: 900;
}

.btn-mada-pay {
  width: 100%;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-mada-pay:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Apple Pay Native Simulation Sheet */
.apple-pay-modal {
  width: 100%;
  max-width: 400px;
  background: #f2f2f7;
  color: #000;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

.ap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid #d1d1d6;
  padding-bottom: 10px;
}

.ap-cancel {
  background: transparent;
  border: none;
  color: #007aff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.ap-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.ap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ap-label {
  color: #8e8e93;
}

.ap-val {
  font-weight: 700;
  color: #1c1c1e;
}

.ap-divider {
  border-bottom: 1px dashed #c7c7cc;
  margin: 4px 0;
}

.ap-total {
  font-size: 1.05rem;
  font-weight: 800;
  color: #000;
}

.ap-total-amount {
  color: #007aff;
  font-family: var(--font-latin);
}

.ap-biometric-prompt {
  text-align: center;
  padding: 16px 0;
}

.face-id-animation svg {
  animation: pulsePin 1.5s infinite;
}

.btn-confirm-apple-pay {
  width: 100%;
  padding: 14px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-confirm-apple-pay:hover {
  opacity: 0.9;
}

/* Primary Action Buttons */
.btn-primary-action {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.6);
}

.btn-share {
  width: 100%;
  padding: 13px 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-share:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-secondary {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* 3D Globe Pins */
.maplibregl-marker {
  z-index: 9999 !important;
  cursor: pointer;
  pointer-events: none;
}

.guess-marker-pin {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, #38bdf8 30%, #0284c7 100%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 20px #38bdf8, 0 0 40px rgba(56, 189, 248, 0.9);
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ffffff;
  cursor: pointer;
  animation: pulsePin 1.5s infinite;
  transform: translateZ(0);
}

.answer-marker-pin {
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, #22c55e 30%, #15803d 100%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 25px #22c55e, 0 0 50px rgba(34, 197, 94, 0.9);
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  animation: bounceIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateZ(0);
}

/* Final Summary Card Inside Modal */
.final-score-hero {
  text-align: center;
  padding: 22px;
  background: linear-gradient(180deg, rgba(26, 38, 64, 0.8) 0%, rgba(13, 21, 38, 0.95) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 18px;
}

.final-score-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.final-score-val {
  font-family: var(--font-latin);
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #10b981 30%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.final-score-max {
  font-size: 1.15rem;
  color: var(--text-dim);
}

.final-rating-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.16);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.rounds-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.round-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}

.round-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-row-score {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.05rem;
}

.round-row-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-row-dist {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Animations */
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.7; }
}

@keyframes pulsePin {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.8); }
  70% { box-shadow: 0 0 0 16px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}

/* Toast Notification (bottom-anchored above controls, never covering the question card) */
.toast-msg {
  position: fixed;
  bottom: calc(170px + env(safe-area-inset-bottom));
  top: auto;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 2000;
  background: rgba(16, 185, 129, 0.96);
  color: #ffffff;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
  max-width: min(440px, 92vw);
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.toast-msg.error {
  background: rgba(239, 68, 68, 0.96);
}

/* Results: questions open in a separate modal (closes back to results) */
.btn-toggle-questions { margin-bottom: 12px; }
#questions-modal .rounds-breakdown { display: flex; max-height: 52vh; overflow-y: auto; margin-bottom: 16px; }

/* Archive list */
.archive-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.archive-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
}
.archive-row-info { display: flex; flex-direction: column; gap: 2px; }
.archive-row-title { font-size: 0.9rem; font-weight: 800; color: #fff; }
.archive-row-date { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-latin); }
.archive-play-btn {
  padding: 8px 16px; border: none; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #10b981, #059669); color: #fff;
  font-family: var(--font-arabic); font-weight: 800; font-size: 0.85rem; cursor: pointer; white-space: nowrap;
}
.archive-play-btn:disabled { background: rgba(30,41,59,0.65); color: #64748b; cursor: not-allowed; }
.archive-lock-note { font-size: 0.75rem; color: var(--accent-gold); }

/* Responsive + mobile-first ads: never block gameplay */
@media (max-width: 900px) {
  .game-header { flex-wrap: wrap; gap: 8px; top: 10px; left: 10px; right: 10px; }
  .brand-badge { padding: 6px 12px; }
  .brand-title { font-size: 0.9rem; }
  .brand-logo-img { width: 28px; height: 28px; }
  .header-actions { flex-wrap: wrap; gap: 6px; }
  .btn-icon { width: 38px; height: 38px; font-size: 1rem; }
  .score-pill { padding: 5px 10px; font-size: 0.85rem; }
  .user-profile-badge { padding: 5px 10px; font-size: 0.78rem; }
}
@media (max-width: 768px) {
  .ad-top-sponsor { display: none; }
  .brand-sub { display: none; }
  .pricing-cards-grid { grid-template-columns: 1fr; }
  .question-card-container { top: 104px; width: 94%; }
  .question-text { font-size: 0.9rem; }
  .question-card { padding: 10px 14px; }
  .question-meta { flex-wrap: wrap; gap: 8px; }
  .reveal-card { padding: 16px; width: 94%; bottom: 12px; max-height: 62vh; overflow-y: auto; }
  .score-main { font-size: 1.8rem; }
  .final-score-val { font-size: 2.6rem; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal-dialog { padding: 20px 16px; max-height: 92vh; border-radius: 18px 18px var(--radius-lg) var(--radius-lg); }
  .bottom-controls { bottom: calc(10px + env(safe-area-inset-bottom)); width: 94%; }
  .btn-confirm { padding: 14px 20px; font-size: 1.05rem; min-height: 52px; }
  .hint-banner { font-size: 0.78rem; padding: 6px 14px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* side ad becomes a small floating chip, never over the confirm button */
  .ad-square-widget {
    top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); right: 8px;
    width: 128px; padding: 8px; z-index: 15; opacity: 0.96;
  }
  .ad-square-widget.minimized { width: 44px; }
  .ad-desc { display: none; }
  .round-row-name { max-width: 150px; }
}
@media (max-width: 380px) {
  .btn-icon { width: 34px; height: 34px; }
  .score-pill .score-label { display: none; }
  .question-card-container { top: 118px; }
  .question-text { font-size: 0.92rem; line-height: 1.55; }
  .ad-square-widget { width: 110px; bottom: calc(160px + env(safe-area-inset-bottom)); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .game-header { top: calc(8px + env(safe-area-inset-top)); }
  .question-card-container {
    top: 64px;
    left: 12px;
    right: auto;
    transform: none;
    width: 46%;
  }
  .question-text { font-size: 0.85rem; }
  .question-hint { display: none; }
  .bottom-controls {
    left: auto;
    right: 12px;
    transform: none;
    width: 42%;
    bottom: 12px;
  }
  .search-row { display: none; }
  .reveal-card { max-height: 72vh; width: 60%; }
  .ad-square-widget { display: none; }
}
/* touch targets + map gestures */
button { touch-action: manipulation; }
#map { touch-action: pan-x pan-y; }
#map canvas { display: block; }

/* Mobile dropdown menu (phones: consolidates header icons) */
.btn-menu { display: none; }
.mobile-menu { display: none; }
@media (max-width: 900px) {
  .header-actions > .btn-icon { display: none; }
  .header-actions > .btn-menu { display: flex; }
  .header-actions { position: relative; }
  .mobile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: rgba(10, 16, 30, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 60;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    min-height: 46px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-align: right;
  }
  .mobile-menu button:hover { background: rgba(255, 255, 255, 0.08); }
  .mobile-menu button.menu-on { color: var(--accent-green); }
}

/* Native ad bar inside results (slim, dismissible) */
.native-ad-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.native-ad-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.native-ad-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
}

/* Paywall reminder button */
.btn-remind { margin-top: 10px; font-size: 0.85rem; }

/* Coach mark pulse on confirm button (first run) */
@keyframes coachPulse {
  0%, 100% { box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45); transform: scale(1); }
  50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0.25); transform: scale(1.04); }
}
.btn-confirm.coach-pulse:not(:disabled) { animation: coachPulse 1.2s infinite; }

/* Safe-area aware chrome */
.game-header {
  top: calc(14px + env(safe-area-inset-top));
}
.modal-overlay {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.reveal-card {
  bottom: calc(24px + env(safe-area-inset-bottom));
}

/* Tablets: roomier layout */
@media (min-width: 769px) and (max-width: 1024px) {
  .question-card-container { max-width: 600px; }
  .modal-dialog { max-width: 620px; }
  .ad-square-widget { width: 200px; }
  .bottom-controls { max-width: 500px; }
}

/* PRO subscription box in results (dashed-box format, 4 features 2x2) */
.pro-box {
  margin-bottom: 8px;
  padding: 10px;
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.06);
}
.pro-box-content {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pro-box-icon { font-size: 1.4rem; }
.pro-box-title { font-weight: 800; font-size: 0.88rem; color: #fff; }
.pro-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-size: 0.75rem;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.btn-pro-subscribe {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
  transition: all 0.2s;
}
.btn-pro-subscribe:hover { transform: translateY(-2px); }
.ad-extra-wrap { margin-bottom: 8px; }
.btn-rewarded-ad {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
  transition: all 0.2s;
}
.btn-rewarded-ad:hover:not(:disabled) { transform: translateY(-2px); }
.btn-rewarded-ad:disabled {
  background: rgba(30, 41, 59, 0.65);
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}
/* Paywall rewarded box (same dashed format) */
.rewarded-ad-box {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.06);
}
.rewarded-ad-content {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.rewarded-ad-icon { font-size: 1.8rem; }
.rewarded-ad-title { font-weight: 800; font-size: 0.92rem; color: #fff; }
.rewarded-ad-sub { font-size: 0.8rem; color: var(--text-muted); }
.rewarded-ad-note { text-align: center; font-size: 0.72rem; color: var(--text-dim); margin-top: 8px; }

/* Rewarded Ad Player Modal */
.rewarded-ad-player {
  width: 100%;
  max-width: 420px;
  background: #0d1527;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.rap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rap-ad-tag {
  font-size: 0.7rem;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}
.rap-timer { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; }
.rap-creative {
  text-align: center;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(56,189,248,0.12));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 26px 16px;
  margin-bottom: 14px;
}
.rap-creative-icon { font-size: 3rem; margin-bottom: 8px; }
.rap-creative-title { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.rap-creative-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }
.rap-progress-track {
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.rap-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  transition: width 0.2s linear;
}
.rap-creative-hint { font-size: 0.68rem; color: var(--text-dim); }
.rap-actions { display: flex; flex-direction: column; gap: 10px; }

/* Results modal: compact, fully visible without scrolling */
#results-modal .modal-dialog { padding: 14px; }
#results-modal .modal-title { font-size: 1.05rem; margin-bottom: 0; }
#results-modal .modal-subtitle { margin-bottom: 6px; font-size: 0.75rem; }
#results-modal .final-score-hero { padding: 8px; margin-bottom: 6px; }
#results-modal .final-score-title { font-size: 0.78rem; margin-bottom: 2px; }
#results-modal .final-score-val { font-size: 1.7rem; }
#results-modal .final-score-max { font-size: 0.78rem; }
#results-modal .final-rating-badge { margin-top: 4px; font-size: 0.7rem; padding: 2px 10px; }
#results-modal .btn-toggle-questions { margin-bottom: 6px; padding: 7px 12px; font-size: 0.78rem; }
#results-modal .share-preview { margin-bottom: 6px; padding: 6px 10px; font-size: 0.73rem; line-height: 1.6; }
#results-modal .rank-line { margin-bottom: 6px; font-size: 0.78rem; }
#results-modal .modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#results-modal #btn-continue-next-round { grid-column: 1 / -1; }
#results-modal .btn-share, #results-modal .btn-primary-action, #results-modal #btn-show-leaderboard { padding: 9px 10px; font-size: 0.8rem; }
#results-modal .pro-box { padding: 8px; margin-bottom: 6px; }
#results-modal .pro-box-content { margin-bottom: 6px; }
#results-modal .pro-box-icon { font-size: 1.15rem; }
#results-modal .pro-box-title { font-size: 0.8rem; }
#results-modal .pro-features { font-size: 0.68rem; margin-bottom: 6px; }
#results-modal .btn-pro-subscribe { padding: 8px 12px; font-size: 0.8rem; }
#results-modal .ad-extra-wrap { margin-bottom: 6px; }
#results-modal .btn-rewarded-ad { padding: 8px 12px; font-size: 0.78rem; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35); }
#results-modal #btn-continue-next-round { background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4); }
#results-modal .rewarded-ad-note { font-size: 0.62rem; margin-top: 4px; }
@media (max-height: 700px) {
  #results-modal .modal-dialog { padding: 10px 12px; }
  #results-modal .final-score-val { font-size: 1.5rem; }
  #results-modal .final-score-hero { padding: 6px; margin-bottom: 6px; }
  #results-modal .share-preview { font-size: 0.68rem; }
  #results-modal .pro-features { font-size: 0.64rem; }
}

/* Stats total hero (cumulative points driving the leaderboard rank) */
.stats-total-hero {
  text-align: center;
  padding: 14px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(13, 21, 38, 0.95) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-bottom: 14px;
}
.stats-total-label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.stats-total-val {
  font-family: var(--font-latin);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent-gold);
  text-shadow: 0 0 18px var(--accent-gold-glow);
}

/* Player rank line under result */
.rank-line {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rank-line strong {
  color: var(--accent-gold);
  font-family: var(--font-latin);
  font-size: 1.05rem;
}

/* Leaderboard: sorted list, first place on top, scrollable to last */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-left: 4px;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}
.leaderboard-row.top-1 {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}
.leaderboard-row.top-2 { border-color: rgba(203, 213, 225, 0.4); }
.leaderboard-row.top-3 { border-color: rgba(217, 119, 6, 0.4); }
.leaderboard-row.is-me {
  border-color: var(--accent-green);
  background: rgba(34, 197, 94, 0.1);
}
.lb-rank {
  min-width: 44px;
  text-align: center;
  font-family: var(--font-latin);
  font-weight: 800;
  color: var(--text-muted);
}
.top-1 .lb-rank { color: var(--accent-gold); font-size: 1.15rem; }
.lb-name { flex: 1; font-size: 0.88rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-me-tag {
  font-size: 0.65rem; font-weight: 800; color: #000;
  background: var(--accent-green); border-radius: var(--radius-pill); padding: 1px 8px;
}
.lb-score { font-family: var(--font-latin); font-weight: 800; color: var(--accent-green); }

/* Compact share preview card */
.share-preview {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
  line-height: 1.9;
  color: #e2e8f0;
  white-space: pre-line;
  text-align: center;
}
