/* ==========================================================
   Al-Rahman Quest — Stylesheet (Desktop & Mobile PWA)
   ========================================================== */

:root {
  --bg: #f0fdf9;
  --bg-accent: #ccfbf1;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #d1fae5;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --gold: #f59e0b;
  --gold-dark: #b45309;
  --coral: #f43f5e;
  --coral-dark: #be123c;
  --violet: #7c3aed;
  --violet-dark: #5b21b6;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --sidebar-bg: linear-gradient(180deg, #064e3b 0%, #0f766e 100%);
  --sidebar-text: #ecfdf5;
  --hero-grad: linear-gradient(135deg, #0f766e 0%, #059669 52%, #0d9488 100%);
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 10px 28px -8px rgba(15, 118, 110, 0.16);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, 0.22);
}

/* Unlockable Themes */
html[data-theme="alrahman"] {
  --bg: #faf5ff;
  --bg-accent: #f3e8ff;
  --surface: #ffffff;
  --surface-2: #fdfaff;
  --text: #2e1065;
  --text-muted: #5b21b6;
  --border: #e9d5ff;
  --primary: #6b21a8;
  --primary-dark: #4c1d95;
  --primary-light: #9333ea;
  --sidebar-bg: linear-gradient(180deg, #3b0764 0%, #5b2189 60%, #6b21a8 100%);
  --hero-grad: linear-gradient(135deg, #4c1d95 0%, #6b21a8 55%, #7e22ce 100%);
  --shadow: 0 10px 28px -8px rgba(91, 33, 137, 0.2);
}

html[data-theme="space"] {
  --bg: #0f172a;
  --bg-accent: #1e1b4b;
  --surface: #1e293b;
  --surface-2: #0f172a;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary: #8b5cf6;
  --primary-dark: #6d28d9;
  --primary-light: #a78bfa;
  --sidebar-bg: linear-gradient(180deg, #090d1f 0%, #1e1b4b 100%);
  --hero-grad: linear-gradient(135deg, #312e81 0%, #6d28d9 55%, #0284c7 100%);
  --shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.45);
}

html[data-theme="ocean"] {
  --bg: #eff6ff;
  --bg-accent: #dbeafe;
  --surface: #ffffff;
  --surface-2: #f0f9ff;
  --text: #0c4a6e;
  --text-muted: #475569;
  --border: #bae6fd;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #38bdf8;
  --sidebar-bg: linear-gradient(180deg, #0c4a6e 0%, #0284c7 100%);
  --hero-grad: linear-gradient(135deg, #0369a1 0%, #0284c7 55%, #06b6d4 100%);
}

html[data-theme="gold"] {
  --bg: #fffbeb;
  --bg-accent: #fef3c7;
  --surface: #ffffff;
  --surface-2: #fefce8;
  --text: #451a03;
  --text-muted: #78350f;
  --border: #fde68a;
  --primary: #d97706;
  --primary-dark: #92400e;
  --primary-light: #f59e0b;
  --sidebar-bg: linear-gradient(180deg, #451a03 0%, #92400e 100%);
  --hero-grad: linear-gradient(135deg, #92400e 0%, #d97706 55%, #f59e0b 100%);
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: clip;
  transition: background 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, .display-font {
  font-family: 'Fredoka', 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: -0.01em;
}

.arabic-text {
  font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', serif;
  font-size: 1.45em;
  line-height: 1.5;
  direction: rtl;
  display: inline-block;
}

/* Subtle Islamic geometric pattern overlay */
.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.055;
  background-image:
    radial-gradient(circle at 25% 25%, var(--primary) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, var(--gold) 2px, transparent 2px);
  background-size: 44px 44px;
}

/* ==========================================================
   App Shell (Desktop Sidebar + Mobile Bottom Nav)
   ========================================================== */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 268px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 25;
  box-shadow: 6px 0 28px rgba(0, 0, 0, 0.14);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
}

.brand-logo {
  width: 52px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.brand-text h1 {
  margin: 0;
  font-size: 1.2rem;
  color: #ffffff;
  line-height: 1.15;
}

.brand-text span {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.sidebar-profile-mini {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.sidebar-profile-mini:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.mini-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lb-avatar-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.boss-hero-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #fde047;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}

.photo-preview-box {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--bg-accent);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.photo-upload-hint {
  width: 100%;
  font-size: 0.74rem;
  color: var(--text-muted);
}

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

.mini-name {
  font-weight: 700;
  font-size: 0.94rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-sub {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.8);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-item.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.nav-ico {
  font-size: 1.2rem;
}

.nav-pill {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--gold);
  color: #451a03;
  padding: 3px 8px;
  border-radius: 99px;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-icon-text {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 9px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-text:hover {
  background: rgba(255, 255, 255, 0.2);
}

.school-credit {
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.68);
  padding: 0 4px;
}

/* Main Column & Topbar */
.main-column {
  flex: 1;
  min-width: 0;
  margin-left: 268px;
  width: calc(100% - 268px);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  width: 38px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}

.topbar-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.1;
}

.topbar-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 0.88rem;
  font-weight: 700;
}

.stat-chip.streak { border-color: #fdba74; }
.stat-chip.coins { border-color: #fde047; }
.stat-chip.level { border-color: #99f6e4; }

.icon-btn {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-only { display: none; }

.app-main {
  padding: 24px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ==========================================================
   Buttons & Reusable Cards
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 11px 20px;
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
  user-select: none;
}

.btn:active {
  transform: translateY(3px);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 5px 0 var(--primary-dark);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { box-shadow: 0 2px 0 var(--primary-dark); }

.btn-gold {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #451a03;
  box-shadow: 0 5px 0 var(--gold-dark);
}
.btn-gold:active { box-shadow: 0 2px 0 var(--gold-dark); }

.btn-coral {
  background: linear-gradient(180deg, #fb7185, #f43f5e);
  color: #ffffff;
  box-shadow: 0 5px 0 var(--coral-dark);
}
.btn-coral:active { box-shadow: 0 2px 0 var(--coral-dark); }

.btn-violet {
  background: linear-gradient(180deg, #8b5cf6, #7c3aed);
  color: #ffffff;
  box-shadow: 0 5px 0 var(--violet-dark);
}
.btn-violet:active { box-shadow: 0 2px 0 var(--violet-dark); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: 0 3px 0 var(--border);
}
.btn-ghost:active { box-shadow: 0 1px 0 var(--border); }

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

.btn-lg {
  padding: 14px 26px;
  font-size: 1.08rem;
}

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

.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2, .section-head h3 {
  margin: 0;
  font-size: 1.25rem;
}

/* ==========================================================
   Home Dashboard
   ========================================================== */
.hero-banner {
  background: var(--hero-grad);
  color: #ffffff;
  border-radius: 26px;
  padding: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-banner::after {
  content: '✦';
  position: absolute;
  right: -20px;
  top: -40px;
  font-size: 14rem;
  opacity: 0.08;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-banner h2 {
  margin: 0 0 6px;
  font-size: 1.85rem;
  line-height: 1.18;
}

.hero-banner p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-progress-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(8px);
}

.hero-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.xp-bar-wrap {
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 6px;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fde047, #fb923c);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.xp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Game Cards */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  border-radius: 22px;
  padding: 20px;
  color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 215px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.18s ease;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-4px);
}

.game-card.rocket { background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #0ea5e9 100%); }
.game-card.runner { background: linear-gradient(135deg, #065f46 0%, #059669 55%, #10b981 100%); }
.game-card.boss   { background: linear-gradient(135deg, #7c2d12 0%, #dc2626 55%, #f97316 100%); }
.game-card.memory { background: linear-gradient(135deg, #581c87 0%, #9333ea 55%, #ec4899 100%); }

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.game-emoji {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  backdrop-filter: blur(4px);
}

.game-tag {
  background: rgba(0, 0, 0, 0.26);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
}

.game-card h3 {
  margin: 12px 0 4px;
  font-size: 1.28rem;
}

.game-card p {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.game-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-hs {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fde047;
}

.play-pill {
  background: #ffffff;
  color: #0f172a;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 99px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

/* Daily Quests */
.quest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-item {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-ico {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quest-body {
  flex: 1;
  min-width: 0;
}

.quest-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.quest-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 3px;
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 99px;
  transition: width 0.3s ease;
}

.quest-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================
   Game Stage Wrapper (Shared across all 4 games)
   ========================================================== */
.game-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.hud-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-pill {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 6px 13px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
}

.canvas-game-box {
  background: #0b1120;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.game-canvas {
  display: block;
  width: 100%;
  height: 360px;
  touch-action: none;
}

.runner-question-bar {
  background: linear-gradient(90deg, #1e1b4b, #312e81);
  color: #ffffff;
  padding: 14px 18px;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.14);
}

.runner-q-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fde047;
  font-weight: 800;
  margin-bottom: 4px;
}

.runner-q-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.cannon-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: #111827;
}

.cannon-btn {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  color: #f8fafc;
  border: 2px solid #38bdf8;
  border-radius: 16px;
  padding: 14px 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 5px 0 #0369a1;
  transition: transform 0.08s ease, background 0.15s ease;
}

.cannon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0369a1;
}

.cannon-key {
  font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  padding: 2px 7px;
  border-radius: 6px;
}

.lane-touch-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  background: #0f172a;
}

.lane-touch-btn {
  background: #1e293b;
  color: #ffffff;
  border: 2px solid #334155;
  border-radius: 14px;
  padding: 12px 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.lane-touch-btn.active-lane {
  border-color: #fde047;
  background: #312e81;
  color: #fde047;
}

/* ==========================================================
   Game 2: Boss Quest RPG
   ========================================================== */
.subject-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip-btn {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 99px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.boss-arena {
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 60%, #1e293b 100%);
  color: #ffffff;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.combatants {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.fighter {
  text-align: center;
}

.fighter-sprite {
  font-size: 3.6rem;
  line-height: 1;
  display: inline-block;
  margin-bottom: 6px;
  transition: transform 0.2s ease;
}

.fighter-sprite.hit {
  animation: shakeHit 0.38s ease;
}

.fighter-sprite.attack {
  animation: lungeAttack 0.35s ease;
}

@keyframes shakeHit {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  25% { transform: translateX(-10px) rotate(-6deg); filter: brightness(1.8); }
  50% { transform: translateX(10px) rotate(6deg); }
  75% { transform: translateX(-6px); }
}

@keyframes lungeAttack {
  0% { transform: scale(1); }
  45% { transform: scale(1.24) translateY(-8px); }
  100% { transform: scale(1); }
}

.hp-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.hp-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
}

.hp-fill.hero { background: linear-gradient(90deg, #22c55e, #4ade80); }
.hp-fill.boss { background: linear-gradient(90deg, #ef4444, #f97316); }

.vs-badge {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fde047;
  background: rgba(255, 255, 255, 0.12);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.quiz-topic-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--bg-accent);
  color: var(--primary-dark);
  padding: 4px 11px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.quiz-question-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.32rem;
  line-height: 1.45;
  margin: 0 0 18px;
}

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

.quiz-opt-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 15px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 0 var(--border);
  transition: all 0.14s ease;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.quiz-opt-btn.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  box-shadow: 0 4px 0 #16a34a;
}

.quiz-opt-btn.wrong {
  background: #ffe4e6;
  border-color: #e11d48;
  color: #881337;
  box-shadow: 0 4px 0 #e11d48;
}

.quiz-opt-btn.eliminated {
  opacity: 0.25;
  pointer-events: none;
}

.opt-letter {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg-accent);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-feedback {
  margin-top: 14px;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.quiz-feedback.good { background: #dcfce7; color: #166534; }
.quiz-feedback.bad  { background: #ffe4e6; color: #9f1239; }

/* ==========================================================
   Game 4: Memory Match
   ========================================================== */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mem-card {
  aspect-ratio: 1 / 1.05;
  perspective: 800px;
  cursor: pointer;
}

.mem-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mem-card.flipped .mem-card-inner,
.mem-card.matched .mem-card-inner {
  transform: rotateY(180deg);
}

.mem-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  font-weight: 700;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.mem-back {
  background: var(--hero-grad);
  color: #ffffff;
  font-size: 1.8rem;
  border-color: rgba(255, 255, 255, 0.25);
}

.mem-front {
  background: var(--surface);
  color: var(--text);
  transform: rotateY(180deg);
  font-size: 1rem;
  line-height: 1.25;
}

.mem-card.matched .mem-front {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}

.mem-type-dot {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ==========================================================
   Shop, Leaderboard & Profile
   ========================================================== */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.shop-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}

.shop-item.equipped {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.shop-preview {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.house-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.house-card {
  border-radius: 20px;
  padding: 18px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.house-card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.house-card .house-pts { font-family: 'Fredoka', sans-serif; font-size: 1.55rem; font-weight: 700; }

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lb-row {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lb-row.me {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--surface) 88%, #fef08a);
}

.lb-rank {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-accent);
  color: var(--primary-dark);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lb-row:nth-child(1) .lb-rank { background: #fef08a; color: #854d0e; }
.lb-row:nth-child(2) .lb-rank { background: #e2e8f0; color: #334155; }
.lb-row:nth-child(3) .lb-rank { background: #fed7aa; color: #9a3412; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
}

.badge-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 16px 12px;
  text-align: center;
}

.badge-card.locked {
  opacity: 0.48;
  filter: grayscale(0.85);
}

.badge-ico {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

/* Result Summary Card */
.result-card {
  text-align: center;
  padding: 28px 20px;
  max-width: 540px;
  margin: 16px auto;
}

.result-big-ico {
  font-size: 4rem;
  margin-bottom: 8px;
}

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

.result-stat-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 12px 8px;
}

.result-stat-box strong {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  color: var(--primary);
}

.result-stat-box span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================
   Modal (Onboarding)
   ========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--surface);
  color: var(--text);
  border-radius: 26px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.onboarding-header {
  text-align: center;
  margin-bottom: 18px;
}

.onboarding-logo {
  width: 82px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 6px 14px rgba(91, 33, 137, 0.28));
}

.hero-crest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.hero-crest {
  width: 52px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.onboarding-header h2 { margin: 0 0 6px; font-size: 1.45rem; }
.onboarding-header p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  width: 100%;
  padding: 12px 15px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary);
}

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

.pick-card {
  border: 2px solid var(--border);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
  color: var(--text);
  font-family: inherit;
}

.pick-card.selected {
  border-color: var(--primary);
  background: var(--bg-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

.pick-card strong { display: block; font-size: 0.88rem; }
.pick-card small { font-size: 0.74rem; color: var(--text-muted); }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.avatar-pick {
  border: 2px solid var(--border);
  background: var(--surface-2);
  border-radius: 14px;
  height: 52px;
  font-size: 1.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-pick.selected {
  border-color: var(--primary);
  background: var(--bg-accent);
  transform: scale(1.06);
}

.onboarding-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.hidden { display: none !important; }

/* ==========================================================
   Mobile Bottom Navigation
   ========================================================== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}

.bnav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
  min-width: 58px;
}

.bnav-ico { font-size: 1.25rem; }

.bnav-item.active {
  color: var(--primary);
  background: var(--bg-accent);
}

/* ==========================================================
   Toast & Confetti
   ========================================================== */
.toast-container {
  position: fixed;
  top: 74px;
  right: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  animation: toastIn 0.25s ease;
  border-left: 4px solid var(--gold);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}

/* ==========================================================
   Responsive Breakpoints (Tablet & Mobile)
   ========================================================== */
@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .sidebar { display: none; }
  .main-column { margin-left: 0; width: 100%; }
  .topbar-mobile-brand { display: flex; }
  .mobile-only { display: inline-flex; }
  .bottom-nav { display: flex; }
  .app-main { padding: 16px 14px 92px; }
  .topbar { padding: 10px 14px; }
  .hero-banner { grid-template-columns: 1fr; padding: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .games-grid { grid-template-columns: 1fr; }
  .quiz-options-grid { grid-template-columns: 1fr; }
  .house-cards { grid-template-columns: 1fr; }
  .avatar-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-banner h2 { font-size: 1.48rem; }
  .game-canvas { height: 320px; }
  .stat-chip { padding: 5px 9px; font-size: 0.8rem; }
  .memory-grid { gap: 8px; }
  .mem-front { font-size: 0.86rem; padding: 6px; }
}

/* ==========================================================
   Landing Page & Auth Modal Styles
   ========================================================== */
.landing-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--border);
}

.landing-nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-brand-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--hero-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 6px 14px rgba(91, 33, 137, 0.28);
}

.landing-brand strong {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  line-height: 1.1;
}

.landing-brand span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.landing-nav-links {
  display: flex;
  gap: 20px;
}

.landing-nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
}

.landing-nav-links a:hover {
  color: var(--primary);
}

.landing-nav-actions {
  display: flex;
  gap: 8px;
}

.landing-main {
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 48px;
  flex: 1;
}

.lp-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 28px;
  align-items: center;
  padding: 24px 0 42px;
}

.lp-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-accent);
  color: var(--primary-dark);
  border: 1.5px solid var(--border);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.lp-hero h1 {
  margin: 0 0 14px;
  font-size: 2.65rem;
  line-height: 1.12;
}

.lp-highlight {
  color: var(--primary);
}

.lp-lead {
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 22px;
}

.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  border: 2px solid #cbd5e1;
  box-shadow: 0 5px 0 #cbd5e1;
}

.btn-google:hover {
  background: #f8fafc;
}

.btn-google:active {
  box-shadow: 0 2px 0 #cbd5e1;
}

.g-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: conic-gradient(#ea4335 0 90deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc05 270deg 360deg);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.lp-sub-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.lp-showcase-card {
  background: var(--hero-grad);
  color: #ffffff;
  border-radius: 28px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.lp-showcase-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.lp-live-dot {
  color: #86efac;
}

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

.lp-mini-tile {
  border-radius: 18px;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lp-mini-tile span { font-size: 1.8rem; }
.lp-mini-tile strong { font-family: 'Fredoka', sans-serif; font-size: 1rem; }
.lp-mini-tile small { font-size: 0.74rem; opacity: 0.88; }

.lp-showcase-foot {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.24);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  color: #fde047;
}

.lp-section {
  padding: 32px 0;
}

.lp-section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 24px;
}

.lp-section-head h2 {
  margin: 0 0 8px;
  font-size: 1.85rem;
}

.lp-section-head p {
  margin: 0;
  color: var(--text-muted);
}

.lp-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.lp-feature-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.lp-f-ico {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 12px;
}

.lp-feature-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.lp-feature-card p { margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.5; }

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

.lp-role-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.lp-role-card.parent {
  border-color: #fde68a;
  background: linear-gradient(180deg, var(--surface) 0%, #fffbeb 100%);
}

.lp-role-tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--bg-accent);
  color: var(--primary-dark);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
}

.lp-role-card h3 { margin: 0; font-size: 1.32rem; }
.lp-role-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.lp-creator-banner {
  background: linear-gradient(135deg, #3b0764 0%, #5b2189 55%, #7e22ce 100%);
  color: #ffffff;
  border-radius: 26px;
  padding: 26px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: var(--shadow-lg);
}

.lp-creator-crest {
  width: 92px;
  height: 104px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.lp-creator-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.lp-creator-info h3 { margin: 0 0 6px; font-size: 1.45rem; }
.lp-creator-info p { margin: 0 0 10px; font-size: 0.92rem; line-height: 1.55; color: rgba(255, 255, 255, 0.92); }
.lp-motto {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde047;
}

.lp-footer {
  border-top: 1.5px solid var(--border);
  background: var(--surface);
  padding: 18px 20px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Auth Modal internals */
.auth-card {
  max-width: 440px;
}

.auth-role-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 14px;
}

.auth-role-bar.three {
  grid-template-columns: repeat(3, 1fr);
}

.auth-role-btn {
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.auth-role-btn.active {
  border-color: var(--primary);
  background: var(--bg-accent);
  color: var(--primary-dark);
}

.local-google-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}

.local-google-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin: 12px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 9px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* Parent Report Grid */
.parent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 960px) {
  .landing-nav-links { display: none; }
  .lp-hero { grid-template-columns: 1fr; padding-top: 10px; }
  .lp-hero h1 { font-size: 2rem; }
  .lp-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-roles-grid { grid-template-columns: 1fr; }
  .parent-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .lp-feature-grid { grid-template-columns: 1fr; }
  .lp-creator-banner { flex-direction: column; text-align: center; }
  .lp-hero h1 { font-size: 1.72rem; }
  .landing-nav-inner { padding: 10px 14px; }
}

/* ==========================================================
   Multiplayer: Team Battle & PVP Arena Styles
   ========================================================== */
.game-card.team { background: linear-gradient(135deg, #0f766e 0%, #0284c7 55%, #38bdf8 100%); }
.game-card.pvp  { background: linear-gradient(135deg, #881337 0%, #e11d48 55%, #f59e0b 100%); }

.mode-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mode-toggle-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  outline: none;
}

.mini-input:focus {
  border-color: var(--primary);
}

.teammate-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
}

.tm-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

.tm-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tm-input-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.tm-del-btn {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--coral);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  flex-shrink: 0;
}

.tm-del-btn:hover {
  background: #ffe4e6;
}

.teammate-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.teammate-chip.active-turn {
  border-color: #fde047;
  background: rgba(253, 224, 71, 0.18);
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.3);
}

.tm-av {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  overflow: hidden;
  flex-shrink: 0;
}

.tug-bar {
  height: 16px;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.16);
}

.tug-a {
  background: linear-gradient(90deg, #ef4444, #f97316);
  transition: width 0.35s ease;
}

.tug-b {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.35s ease;
}

.pvp-race-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pvp-racer {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.duel-pane {
  background: var(--surface);
  border: 2.5px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.duel-pane.p1 { border-color: #3b82f6; }
.duel-pane.p2 { border-color: #f43f5e; }

.duel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.96rem;
}

.duel-score {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
}

.duel-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

@media (max-width: 720px) {
  .mode-toggle-grid,
  .mode-toggle-grid.three,
  .teammate-strip,
  .duel-split {
    grid-template-columns: 1fr;
  }
}

/* TopupIlmu Brand Logo Polish */
.landing-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(91, 33, 137, 0.28);
  flex-shrink: 0;
}

.app-icon-round {
  border-radius: 16px !important;
  object-fit: cover !important;
  width: 48px;
  height: 48px;
}

.onboarding-logo.app-icon-round {
  width: 80px;
  height: 80px;
  border-radius: 22px !important;
}

.topbar-logo.app-icon-round {
  width: 38px;
  height: 38px;
  border-radius: 11px !important;
}

.hero-crest.app-icon-round {
  width: 54px;
  height: 54px;
  border-radius: 16px !important;
}

/* ==========================================================
   Studio Avatar 3D & Power Game Vault Styles
   ========================================================== */
.stat-chip.playtime {
  border-color: #a855f7;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.stat-chip.playtime:hover {
  background: var(--bg-accent);
}

.game-card.power {
  background: linear-gradient(135deg, #1e1b4b 0%, #6d28d9 48%, #db2777 100%);
  min-height: 195px;
}

.power-vault-hero {
  background: linear-gradient(135deg, #0f172a 0%, #3b0764 52%, #6d28d9 100%);
  color: #ffffff;
  border: 2px solid #a855f7;
  display: grid;
  grid-template-columns: 1.4fr 0.7fr;
  gap: 20px;
  align-items: center;
}

.pv-right {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pv-avatar-frame {
  width: 130px;
  height: 130px;
  border-radius: 32px;
  border: 4px solid #fde047;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  animation: floatBob 2.6s ease-in-out infinite;
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.topup-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.topup-time-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.topup-time-card small {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.avatar-studio-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  align-items: start;
}

.avatar-preview-stage {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar3d-showcase {
  width: 210px;
  height: 210px;
  border-radius: 42px;
  overflow: hidden;
  box-shadow: 0 18px 38px -8px rgba(91, 33, 137, 0.38);
  transition: transform 0.25s ease;
}

.avatar3d-showcase:hover {
  transform: perspective(600px) rotateY(-8deg) rotateX(6deg) scale(1.04);
}

.avatar3d-showcase svg {
  width: 100%;
  height: 100%;
  display: block;
}

.av3d-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.av3d-opt-card {
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 16px;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.14s ease;
}

.av3d-opt-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.av3d-opt-card.selected {
  border-color: var(--gold);
  background: var(--bg-accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.av3d-mini-svg {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  overflow: hidden;
}

.av3d-mini-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.av3d-opt-card strong {
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: center;
}

.av3d-price {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold-dark);
}

.av3d-price.free {
  color: #16a34a;
}

@media (max-width: 860px) {
  .power-vault-hero,
  .avatar-studio-grid,
  .topup-time-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   Game 8: Misi Rumah Misteri (Hello Neighbor Stealth) Styles
   ========================================================== */
.game-card.neighbor {
  background: linear-gradient(135deg, #1e293b 0%, #7c2d12 52%, #ca8a04 100%);
}

.ne-controls-bar {
  background: #0f172a;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1.5px solid rgba(255, 255, 255, 0.12);
}

.ne-status-msg {
  color: #fde047;
  font-size: 0.85rem;
  font-weight: 700;
  flex: 1;
  min-width: 190px;
}

.dpad-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.dpad-mid {
  display: flex;
  gap: 6px;
}

.dpad-btn {
  width: 48px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid #475569;
  background: #1e293b;
  color: #ffffff;
  font-size: 1.15rem;
  cursor: pointer;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dpad-btn:active {
  background: #4f46e5;
  border-color: #fde047;
  transform: scale(0.95);
}

/* ==========================================================
   Game 9: Kembara Super Avatar (Mario-Style Platformer) Styles
   ========================================================== */
.game-card.mario {
  background: linear-gradient(135deg, #dc2626 0%, #ea580c 48%, #16a34a 100%);
}

.sa-quiz-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sa-quiz-box {
  background: var(--surface);
  color: var(--text);
  border: 2.5px solid #fde047;
  border-radius: 20px;
  padding: 18px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

.mario-controls-bar {
  background: #0f172a;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.mario-move-group {
  display: flex;
  gap: 8px;
}

.mario-btn {
  background: #1e293b;
  color: #ffffff;
  border: 2px solid #475569;
  border-radius: 14px;
  padding: 12px 18px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 4px 0 #020617;
}

.mario-btn:active {
  transform: translateY(2px);
  border-color: #fde047;
  background: #334155;
}

.mario-btn.jump {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #451a03;
  border-color: #fde047;
  box-shadow: 0 4px 0 #b45309;
  padding: 12px 22px;
}

/* ==========================================================
   Class League & Inter-School League Styles
   ========================================================== */
.league-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 6px;
  border-radius: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.league-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 8px;
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.league-tab:hover {
  color: var(--primary);
  background: var(--surface-2);
}

.league-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(91, 33, 137, 0.28);
}

.class-challenge-banner {
  background: var(--hero-grad);
  color: #ffffff;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}

.school-logo-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--bg-accent);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  overflow: hidden;
  padding: 4px;
  flex-shrink: 0;
}

.register-school-card {
  border: 2px dashed var(--primary);
  background: var(--surface-2);
}

@media (max-width: 680px) {
  .league-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================
   Game 10: Kembara Umrah × ikhlas.com Styles
   ========================================================== */
.game-card.umrah {
  background: linear-gradient(135deg, #064e3b 0%, #0f766e 48%, #00a8a3 100%);
  border: 2px solid #c8b07b;
}

.ikhlas-card-badge {
  background: #ffffff;
  color: #0f766e;
  padding: 5px 12px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ikhlas-pill {
  background: #ffffff;
  border-color: #00a8a3;
}

.umrah-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.u-step {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 7px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.u-step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.u-step.active {
  border-color: #00a8a3;
  color: #0f766e;
  background: #f0fdfa;
}

.u-step.active span {
  background: #00a8a3;
  color: #ffffff;
}

.u-step.done {
  border-color: #16a34a;
  color: #166534;
}

.u-step.done span {
  background: #16a34a;
  color: #ffffff;
}

.umrah-sponsor-hero {
  background: linear-gradient(135deg, #0f766e 0%, #00a8a3 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.umrah-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 99px;
}

.ikhlas-logo-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.umrah-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.pack-item-btn {
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: all 0.14s ease;
}

.pack-item-btn:hover {
  border-color: #00a8a3;
  transform: translateY(-2px);
}

.pack-item-btn.packed {
  background: #ccfbf1;
  border-color: #00a8a3;
  color: #0f766e;
}

.pack-item-btn strong { font-size: 0.84rem; }
.pack-item-btn small { font-size: 0.72rem; opacity: 0.85; }

.umrah-cert-card {
  max-width: 580px;
  margin: 12px auto;
  text-align: center;
  border: 3px solid #c8b07b;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
  color: #0f172a;
  padding: 26px 22px;
}

/* ==========================================================
   Game 11: Bandar 3D TopupIlmu (Three.js) Styles
   ========================================================== */
.game-card.city3d {
  background: linear-gradient(135deg, #090d1f 0%, #1d4ed8 46%, #f97316 100%);
  border: 2px solid #38bdf8;
}

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

.city3d-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.city3d-viewport {
  width: 100%;
  height: 410px;
  background: #090d1f;
  touch-action: none;
  cursor: grab;
  overflow: hidden;
}

.city3d-viewport:active {
  cursor: grabbing;
}

.city3d-hud-tip {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.8);
  color: #fde047;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: 94%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  border: 1px solid rgba(253, 224, 71, 0.35);
}

.city3d-controls-bar {
  background: #0f172a;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  user-select: none;
}

@media (max-width: 600px) {
  .city3d-viewport {
    height: 330px;
  }
}

/* ==========================================================
   Rich Game Card Cover Artwork Layout (Roblox / Arcade Store Feel)
   ========================================================== */
.game-card.has-cover {
  padding: 0;
  min-height: 295px;
  display: flex;
  flex-direction: column;
}

.game-cover-media {
  position: relative;
  width: 100%;
  height: 158px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.25);
}

.game-cover-media.tall {
  height: 185px;
}

.game-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-card.has-cover:hover .game-cover-img {
  transform: scale(1.07);
}

.game-cover-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.32) 0%, rgba(15, 23, 42, 0.05) 45%, rgba(15, 23, 42, 0.52) 100%);
  pointer-events: none;
}

.game-cover-media .game-card-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
}

.game-cover-media .game-emoji {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.5rem;
  background: rgba(15, 23, 42, 0.58);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.game-cover-media .game-tag {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.game-card-body {
  padding: 15px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.game-card.has-cover h3 {
  margin: 0 0 5px;
  font-size: 1.2rem;
}

.game-card.has-cover p {
  margin: 0 0 14px;
  font-size: 0.85rem;
}

/* ==========================================================
   Dual Mode (Versi Belajar vs Versi Game) & Study Hub Styles
   ========================================================== */
.dual-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dual-mode-card {
  border-radius: 22px;
  padding: 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.18s ease;
}

.dual-mode-card:hover {
  transform: translateY(-3px);
}

.dual-mode-card.study {
  background: linear-gradient(135deg, #0f766e 0%, #0284c7 60%, #1d4ed8 100%);
  border: 2px solid #7dd3fc;
}

.dual-mode-card.game {
  background: linear-gradient(135deg, #581c87 0%, #9333ea 55%, #ec4899 100%);
  border: 2px solid #f0abfc;
}

.dm-ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.dm-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.26);
  color: #fde047;
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 4px;
}

.dual-mode-card h3 {
  margin: 0 0 4px;
  font-size: 1.18rem;
}

.dual-mode-card p {
  margin: 0;
  font-size: 0.83rem;
  opacity: 0.92;
  line-height: 1.45;
}

.study-hero {
  background: linear-gradient(135deg, #064e3b 0%, #0f766e 50%, #0284c7 100%);
  color: #ffffff;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}

.study-arabic-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.48rem;
  line-height: 1.65;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.study-points {
  margin: 0;
  padding-left: 20px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

/* 3D Study Flashcard */
.flashcard-stage {
  perspective: 1000px;
  height: 230px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.flashcard-stage.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 22px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--primary);
  box-shadow: var(--shadow);
}

.flashcard-face.front {
  background: var(--surface-2);
  color: var(--text);
}

.flashcard-face.back {
  background: linear-gradient(135deg, #ecfdf5, #dcfce7);
  color: #14532d;
  border-color: #16a34a;
  transform: rotateY(180deg);
}

/* Roda Ilmu (SpinJawab Wheel) */
.wheel-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 14px auto 18px;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 1.7rem;
  color: #ef4444;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

.spin-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #fde047;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  background: conic-gradient(
    #7c3aed 0deg 60deg,
    #0f766e 60deg 120deg,
    #d97706 120deg 180deg,
    #059669 180deg 240deg,
    #e11d48 240deg 300deg,
    #2563eb 300deg 360deg
  );
  transition: transform 1.2s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.w-lbl {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #ffffff;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  transform-origin: 0 0;
  white-space: nowrap;
}

.w-lbl.l1 { transform: rotate(30deg) translate(24px, -6px); }
.w-lbl.l2 { transform: rotate(90deg) translate(24px, -6px); }
.w-lbl.l3 { transform: rotate(150deg) translate(24px, -6px); }
.w-lbl.l4 { transform: rotate(210deg) translate(24px, -6px); }
.w-lbl.l5 { transform: rotate(270deg) translate(24px, -6px); }
.w-lbl.l6 { transform: rotate(330deg) translate(24px, -6px); }

@media (max-width: 780px) {
  .dual-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   Game 12: Vibe 5G Ilmu Rush × Vibe MOBILE Styles
   ========================================================== */
.game-card.vibe5g {
  background: linear-gradient(135deg, #041414 0%, #065f46 55%, #00c48c 100%);
  border: 2px solid #00f5a0;
}

.vibe-pill {
  background: #ffffff;
  border-color: #00f5a0;
  color: #064e3b;
}

.vibe-lobby-hero {
  background: linear-gradient(135deg, #031515 0%, #064e3b 60%, #042f2e 100%);
  color: #ffffff;
  border: 2px solid #00f5a0;
  display: grid;
  grid-template-columns: 1.4fr 0.65fr;
  gap: 20px;
  align-items: center;
}

.vibe-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(0, 245, 160, 0.16);
  color: #00f5a0;
  border: 1px solid rgba(0, 245, 160, 0.45);
  padding: 4px 12px;
  border-radius: 99px;
}

.vibe-lobby-right {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vibe-sim-float {
  width: 150px;
  max-width: 100%;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(0, 245, 160, 0.32);
  animation: floatBob 2.5s ease-in-out infinite;
}

.btn-vibe {
  background: linear-gradient(180deg, #00f5a0, #10b981);
  color: #03221c;
  box-shadow: 0 5px 0 #047857;
}

.btn-vibe:active {
  box-shadow: 0 2px 0 #047857;
}

@media (max-width: 780px) {
  .vibe-lobby-hero {
    grid-template-columns: 1fr;
  }
}

/* Study Subject Practice Cards */
.study-subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 12px;
}

.study-pick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
}

/* ==========================================================
   Pro Features: Prayer/Tasbih Widget, Smart Tutor & Teacher Panel
   ========================================================== */
.prayer-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.prayer-pill {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 7px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.prayer-pill strong {
  font-size: 0.84rem;
  color: var(--text);
}

.prayer-pill.next {
  background: var(--bg-accent);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.prayer-pill.next strong {
  color: var(--primary-dark);
}

.tasbih-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tutor-chat-box {
  max-height: 410px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  background: var(--surface-2);
}

.tutor-msg {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 18px;
}

.tutor-msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1.5px solid var(--border);
}

.tutor-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.tutor-input-row {
  display: flex;
  gap: 8px;
}

@media (max-width: 560px) {
  .prayer-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==========================================================
   Teacher Focus Mode, Multi-Class & Student Preview Styles
   ========================================================== */
.role-preview-btn {
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid rgba(253, 224, 71, 0.75);
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.22), rgba(245, 158, 11, 0.25));
  color: #fef9c3;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.role-preview-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.34), rgba(245, 158, 11, 0.36));
}

.role-preview-btn.in-preview {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #422006;
  border-color: #fef08a;
}

.teacher-preview-banner {
  background: linear-gradient(90deg, #4c1d95, #6d28d9, #7c3aed);
  color: #ffffff;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.86rem;
  border-bottom: 2px solid #fde047;
}

.stat-chip.teacher-mode-chip {
  background: linear-gradient(135deg, #f3e8ff, #fef9c3);
  border-color: #a855f7;
  color: #581c87;
}

.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  padding: 7px 12px;
  border-radius: 99px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.chip-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.class-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

.class-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 99px;
  background: var(--bg-accent);
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.class-tag button {
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.72rem;
  line-height: 1;
}

.class-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.class-check-pill.checked {
  border-color: var(--primary);
  background: var(--bg-accent);
  color: var(--primary-dark);
}

.parent-child-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.parent-child-card.active {
  border-color: var(--primary);
  background: var(--bg-accent);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.14);
}

@media (max-width: 640px) {
  .parent-add-child-row {
    grid-template-columns: 1fr !important;
  }
}
