/* ============================================================
   KIDS.SUMSATEC.COM — Nur-Kids: Entdecke die Wunder der Welt
   Design: Edles, magisches Schatzbuch des Lichts (Illuminated Manuscript & Celestial Gold)
   Hochwertig, tief, mit goldenen Ornamenten & kindgerechter Wärme
   ============================================================ */

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

:root {
  --font-display: "Cinzel", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Celestial & Gold Palette */
  --bg-deep-space: #070d19;
  --bg-night-velvet: #0d172c;
  --bg-card-parchment: #ffffff;
  --bg-card-subtle: #fefdfa;
  
  --gold-pure: #eab308;
  --gold-bright: #fde047;
  --gold-warm: #f59e0b;
  --gold-deep: #b45309;
  --gold-metallic: linear-gradient(135deg, #fef08a 0%, #facc15 30%, #eab308 60%, #b45309 100%);
  --gold-foil: linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%);
  
  --royal-blue: #1e3a8a;
  --royal-blue-glow: #3b82f6;
  --emerald-rich: #047857;
  --ruby-velvet: #9f1239;
  
  --text-on-dark: #f8fafc;
  --text-muted-dark: #94a3b8;
  --text-ink: #1e293b;
  --text-ink-muted: #475569;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  
  --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.25);
  --shadow-card: 0 14px 30px -5px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(234, 179, 8, 0.25);
}

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

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at 50% -10%, #1e3a8a 0%, #0d172c 40%, #070d19 100%);
  background-attachment: fixed;
  color: var(--text-on-dark);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Subtle Golden Stardust & Constellations Layer */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(1.5px 1.5px at 15% 20%, rgba(254, 240, 138, 0.75), transparent),
    radial-gradient(2px 2px at 85% 15%, rgba(250, 204, 21, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 45% 40%, rgba(253, 224, 71, 0.6), transparent),
    radial-gradient(2px 2px at 70% 65%, rgba(254, 240, 138, 0.7), transparent),
    radial-gradient(1px 1px at 25% 85%, rgba(250, 204, 21, 0.6), transparent),
    radial-gradient(2.5px 2.5px at 90% 85%, rgba(253, 224, 71, 0.8), transparent);
  background-size: 550px 550px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* Safe Area Insets (VPS Standard) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 15, 29, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.45);
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  padding-bottom: 10px;
  padding-inline: max(env(safe-area-inset-left, 0px), 16px) max(env(safe-area-inset-right, 0px), 16px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.6));
  animation: float 3.5s ease-in-out infinite;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  background: var(--gold-metallic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.brand-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: #7dd3fc;
  display: block;
  letter-spacing: 0.5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language Switcher Buttons (Flags) */
.lang-switch {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(234, 179, 8, 0.5);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.lang-btn {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
  transform: scale(1.15);
}

.lang-btn.active {
  background: rgba(234, 179, 8, 0.25);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
  border: 1.5px solid #facc15;
  opacity: 1;
  transform: scale(1.1);
}

.star-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.9) 0%, rgba(69, 26, 3, 0.95) 100%);
  border: 2px solid #f59e0b;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: #fef08a;
  font-size: 1.05rem;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.icon-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(234, 179, 8, 0.4);
  color: #fde047;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: #facc15;
  background: rgba(234, 179, 8, 0.2);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.icon-btn:active {
  transform: scale(0.95);
}

#hard-refresh-btn {
  font-size: 1.4rem;
  color: #7dd3fc;
}

/* Hero Section */
.hero {
  padding: 36px 16px 24px 16px;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-pill {
  display: inline-block;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(180, 83, 9, 0.25) 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.6);
  color: #fef08a;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 20px;
  border-radius: 999px;
  margin-bottom: 16px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  letter-spacing: 0.5px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero h1 span {
  background: var(--gold-metallic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
}

.hero-desc {
  font-size: 1.18rem;
  color: #cbd5e1;
  max-width: 680px;
  margin: 0 auto 24px auto;
  font-weight: 500;
  line-height: 1.7;
}

.hero-desc strong {
  color: #fde047;
  font-weight: 700;
}

/* Noble Badges in Hero */
.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-badge {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(234, 179, 8, 0.4);
  font-weight: 700;
  font-size: 0.92rem;
  color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.hero-badge:hover {
  border-color: #facc15;
  color: #fef08a;
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.3);
}

/* Content Container */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
  position: relative;
  z-index: 1;
}

/* Section Header */
#adventures-heading {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid of Islands / Stations */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
  margin-top: 20px;
}

/* Card: Illuminated Manuscript Style */
.station-card {
  background: linear-gradient(180deg, #ffffff 0%, #fffdfa 70%, #fefce8 100%);
  border-radius: var(--radius-lg);
  border: 2px solid #eab308;
  outline: 1.5px solid rgba(234, 179, 8, 0.35);
  outline-offset: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.station-card:hover {
  transform: translateY(-8px);
  border-color: #facc15;
  outline-color: rgba(250, 204, 21, 0.8);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.6), 0 0 25px rgba(234, 179, 8, 0.4);
}

.card-header-art {
  height: 170px;
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 2px solid rgba(234, 179, 8, 0.4);
}

.station-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.station-pill-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1.5px solid #facc15;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  color: #fef08a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
}

.station-status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border: 1.5px solid #6ee7b7;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.card-icon {
  font-size: 1.9rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.3px;
}

.card-subtitle {
  font-size: 0.88rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 12px;
}

.card-teaser {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 20px;
  flex-grow: 1;
  line-height: 1.55;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1.5px dashed #fde68a;
  padding-top: 16px;
  margin-top: auto;
}

.stars-earned {
  font-weight: 800;
  color: #92400e;
  font-size: 0.95rem;
}

.btn-explore {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.btn-explore:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
}

/* Station Modal / Detail View */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 13, 25, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  border: 3px solid #eab308;
  outline: 2px solid rgba(234, 179, 8, 0.4);
  outline-offset: 4px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.93) translateY(20px);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--text-ink);
}

.modal-backdrop.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 2px solid #eab308;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-icon {
  font-size: 2.3rem;
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.6));
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  background: var(--gold-metallic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.modal-subtitle {
  font-size: 0.88rem;
  font-weight: 700;
  color: #7dd3fc;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(234, 179, 8, 0.4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fef08a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.08);
}

/* Modal Navigation Tabs */
.modal-tabs {
  display: flex;
  border-bottom: 2px solid #fef08a;
  background: #fdfaf3;
}

.modal-tab {
  flex: 1;
  padding: 14px 16px;
  text-align: center;
  font-weight: 800;
  font-size: 0.98rem;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-tab.active {
  color: #92400e;
  background: #ffffff;
  border-bottom: 3.5px solid #d97706;
  font-weight: 900;
}

.modal-body {
  padding: 26px;
  padding-bottom: 40px;
  overflow-y: auto;
  flex-grow: 1;
  background: #fdfbf7;
}

/* Story Styling */
.lead-p {
  font-size: 1.22rem;
  color: #0f172a;
  margin-bottom: 18px;
  line-height: 1.6;
}

.story-box {
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-left: 5px solid #d97706;
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  font-size: 1.05rem;
  color: #334155;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.story-box p {
  margin-bottom: 14px;
}

.story-box p:last-child {
  margin-bottom: 0;
}

.story-box ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.story-box li {
  margin-bottom: 8px;
}

.tip-pill {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fde68a;
  border-left: 5px solid #f59e0b;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-top: 18px;
  font-size: 0.98rem;
  color: #78350f;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  padding: 10px 18px;
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.btn-speech {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

.btn-speech:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
}

.interactive-hint {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  border: 2px dashed #14b8a6;
  color: #0f766e;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quiz Screen */
.quiz-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.quiz-progress-label {
  font-family: var(--font-display);
  font-weight: 800;
  color: #0369a1;
  font-size: 1.05rem;
}

.quiz-progress-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid #cbd5e1;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  width: 0%;
  transition: width 0.35s ease;
}

.quiz-question-box {
  background: #ffffff;
  border: 2.5px solid #fed7aa;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.quiz-question-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.45;
  margin-bottom: 20px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.quiz-option-btn {
  background: #fdfbf7;
  border: 2.5px solid #e2e8f0;
  padding: 16px 22px;
  border-radius: var(--radius-md);
  font-size: 1.08rem;
  font-weight: 700;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: #f59e0b;
  transform: translateX(5px);
  background: #fffbeb;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.quiz-option-btn.correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25) !important;
}

.quiz-option-btn.wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

.option-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 900;
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
}

.quiz-option-btn.correct .option-badge {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.quiz-option-btn.wrong .option-badge {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}

.quiz-explanation-box {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  display: none;
  animation: popIn 0.3s ease;
  line-height: 1.5;
}

.quiz-explanation-box.show {
  display: block;
}

.quiz-explanation-box.correct {
  background: #ecfdf5;
  border: 2px solid #6ee7b7;
  color: #065f46;
}

.quiz-explanation-box.wrong {
  background: #fff7ed;
  border: 2px solid #fed7aa;
  color: #9a3412;
}

.btn-next-question {
  display: none;
  margin-top: 18px;
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
  letter-spacing: 0.5px;
}

.btn-next-question.show {
  display: block;
}

/* Quiz Completion Screen */
.quiz-complete-card {
  text-align: center;
  padding: 30px 16px;
}

.quiz-complete-icon {
  font-size: 4.5rem;
  animation: celebrationBounce 1s ease infinite alternate;
  display: inline-block;
  margin-bottom: 14px;
}

.quiz-complete-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 10px;
}

.quiz-complete-score {
  font-size: 1.4rem;
  font-weight: 800;
  color: #d97706;
  margin-bottom: 18px;
}

.quiz-complete-desc {
  font-size: 1.1rem;
  color: #475569;
  max-width: 480px;
  margin: 0 auto 28px auto;
  line-height: 1.6;
}

/* Certificate Section: Noble Illuminated Manuscript */
.certificate-view {
  display: none;
  margin-top: 50px;
  text-align: center;
}

.cert-card {
  background: radial-gradient(circle at 50% 10%, #ffffff 0%, #fdfbf5 70%, #fcf7e8 100%);
  border: 14px solid #fef3c7;
  outline: 4px solid #d97706;
  outline-offset: -10px;
  border-radius: var(--radius-lg);
  padding: 44px 30px;
  max-width: 660px;
  margin: 0 auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(245, 158, 11, 0.35);
  position: relative;
  color: var(--text-ink);
}

.cert-header {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.cert-title {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
  background: var(--gold-metallic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
  letter-spacing: 1px;
}

.cert-name-input {
  font-family: var(--font-display);
  border: none;
  border-bottom: 3.5px solid #d97706;
  font-size: 1.65rem;
  font-weight: 800;
  text-align: center;
  color: #0f172a;
  padding: 8px 14px;
  width: 85%;
  max-width: 400px;
  margin-bottom: 18px;
  outline: none;
  background: rgba(254, 243, 199, 0.4);
  border-radius: 8px 8px 0 0;
}

.cert-desc {
  font-size: 1.1rem;
  color: #334155;
  line-height: 1.65;
  margin-bottom: 24px;
}

.cert-stars {
  font-size: 2.3rem;
  margin-bottom: 18px;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.4));
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid #fed7aa;
  padding-top: 18px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #92400e;
  font-family: var(--font-display);
}

/* Canvas Confetti Layer */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes pulse-anim {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

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

@keyframes celebrationBounce {
  from { transform: scale(1) rotate(-5deg); }
  to { transform: scale(1.15) rotate(5deg); }
}

.clickable-item {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.clickable-item:hover {
  transform: scale(1.3);
}

/* Footer (Safe Area Comfort) */
.footer {
  text-align: center;
  padding: 40px 16px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 30px);
  color: #94a3b8;
  font-size: 0.92rem;
  border-top: 2px solid rgba(234, 179, 8, 0.25);
  background: rgba(7, 13, 25, 0.75);
  position: relative;
  z-index: 1;
}

.footer-quote {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fef08a;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* Mobile & Tablet Responsive Optimizations */
.modal-pull-handle {
  width: 46px;
  height: 5px;
  background: rgba(234, 179, 8, 0.6);
  border-radius: 999px;
  margin: 8px auto 10px auto;
  display: none;
}

@media (max-width: 640px) {
  /* Brand & Topbar on Phones */
  .brand-subtitle {
    display: none;
  }
  .brand-icon {
    width: 38px;
    height: 38px;
  }
  .brand-title {
    font-size: 1.25rem;
  }
  .topbar-actions {
    gap: 6px;
  }
  .star-counter {
    padding: 4px 10px;
    font-size: 0.92rem;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .lang-btn {
    font-size: 1.15rem;
    padding: 2px 5px;
  }

  /* Hero Section */
  .hero {
    padding: 24px 12px 14px 12px;
  }
  .hero h1 {
    font-size: 1.85rem;
  }
  .hero-desc {
    font-size: 1.02rem;
    line-height: 1.55;
  }
  .hero-badges {
    gap: 8px;
  }
  .hero-badge {
    padding: 6px 14px;
    font-size: 0.82rem;
  }

  /* Cards Grid */
  .stations-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .card-body {
    padding: 18px;
  }
  .card-title {
    font-size: 1.25rem;
  }
  .card-subtitle {
    font-size: 0.85rem;
  }

  /* Native Mobile Bottom-Sheet Modal */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
    background: rgba(7, 13, 25, 0.85);
  }
  .modal-pull-handle {
    display: block;
  }
  .modal-card {
    max-width: 100%;
    width: 100%;
    height: 94dvh;
    max-height: 94dvh;
    border-radius: 24px 24px 0 0;
    border: none;
    border-top: 4px solid #facc15;
    box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.7);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .modal-backdrop.open .modal-card {
    transform: translateY(0);
  }
  .modal-header {
    padding: 14px 16px 12px 16px;
  }
  .modal-icon {
    font-size: 1.8rem;
  }
  .modal-title {
    font-size: 1.25rem;
  }
  .modal-subtitle {
    font-size: 0.82rem;
  }
  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
  .modal-tabs {
    background: #fdfaf3;
  }
  .modal-tab {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  .modal-body {
    padding: 18px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 40px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* Quiz on Mobile */
  .quiz-question-box {
    padding: 18px 16px;
  }
  .quiz-question-text {
    font-size: 1.18rem;
  }
  .quiz-option-btn {
    padding: 14px 16px;
    font-size: 1rem;
    min-height: 54px;
  }

  /* Certificate on Mobile */
  .cert-card {
    border-width: 8px;
    outline-width: 3px;
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }
  .cert-title {
    font-size: 1.65rem;
  }
  .cert-name-input {
    font-size: 1.3rem;
    width: 95%;
  }
  .cert-desc {
    font-size: 0.95rem;
  }
  .cert-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Touch responsiveness */
button, .clickable-item, .station-card {
  touch-action: manipulation;
}
