:root {
  --bg-dark: #070814;
  --bg-deep: #0d1024;
  --sand: #c9a66b;
  --dark: #15110c;
  --panel: rgba(13, 16, 36, 0.72);
  --line: rgba(248, 239, 216, 0.12);
  --accent: #d6b35a;
  --gold: #d6b35a;
  --gold-light: #f3d77b;
  --burgundy: #7b1023;
  --burgundy-dark: #3d0814;
  --ivory: #f8efd8;
  --safe: #8fc88f;
  --danger: #d96c54;
  --text: #f8efd8;
  --muted: #c9b896;
  --beige: #e8d4b0;
}

* {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  color: var(--taki-navy, #1a2b49);
  font-family: "Cairo", "Tajawal", "Amiri", sans-serif;
}

/* ─── Sirah Hub — Galaxy Map (full page) ─── */

.sirah-page {
  position: relative;
  width: 100%;
  border: none;
  outline: none;
  box-shadow: none;
  overflow: visible;
  background:
    radial-gradient(circle at 50% 20%, rgba(214, 179, 90, 0.18), transparent 35%),
    radial-gradient(circle at 20% 80%, rgba(123, 16, 35, 0.22), transparent 35%),
    radial-gradient(circle at 80% 60%, rgba(60, 80, 180, 0.12), transparent 40%),
    linear-gradient(180deg, #070814 0%, #0d1024 55%, #05060d 100%);
  color: var(--ivory);
  min-height: 100vh;
}

.sirah-game-zone {
  position: relative;
  background: var(--bg-dark, #070814);
  color: var(--ivory, #f8efd8);
  overflow: hidden;
  min-height: 100vh;
}

.map-page-body {
  background: var(--bg-dark);
  color: var(--ivory);
}

.map-top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(7, 8, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(214, 179, 90, 0.15);
}

.map-top-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.map-top-bar .taki-logo-img {
  height: 52px;
  filter: drop-shadow(0 4px 16px rgba(214, 179, 90, 0.25));
}

.map-back-link {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(214, 179, 90, 0.3);
  transition: background 0.2s;
}

.map-back-link:hover {
  background: rgba(214, 179, 90, 0.12);
}

.map-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.platform-back-link {
  border-color: rgba(123, 0, 36, 0.45);
  color: #f8efd8;
  background: rgba(123, 0, 36, 0.28);
}

.platform-back-link:hover {
  background: rgba(123, 0, 36, 0.42);
}

.platform-back-fab {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(214, 179, 90, 0.35);
  background: rgba(11, 19, 36, 0.88);
  backdrop-filter: blur(8px);
  color: var(--gold-light);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition:
    background 0.2s,
    transform 0.2s;
}

.platform-back-fab:hover {
  background: rgba(123, 0, 36, 0.55);
  transform: translateY(-1px);
}

/* Game zone — خريطة الكواكب (أسفل الصفحة) */

.sirah-game-zone .starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sirah-game-zone .star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--gold-light);
  animation: twinkleStar 5s ease-in-out infinite alternate;
}

@keyframes twinkleStar {
  from {
    opacity: 0.2;
    transform: scale(0.8);
  }
  to {
    opacity: 0.9;
    transform: scale(1.2);
  }
}

.section {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(60px, 10vw, 80px) 6vw;
  box-sizing: border-box;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}

.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 0 32px rgba(243, 215, 123, 0.35);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
  font-size: 1.05rem;
}

/* Hero */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 40px;
  padding-top: 100px;
  padding-bottom: 80px;
}

.hero-inner {
  max-width: 680px;
}

.hero-eyebrow {
  margin: 0 0 14px;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 0 48px rgba(243, 215, 123, 0.45);
  line-height: 1.2;
}

.hero-subtitle {
  margin: 20px auto 0;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 1.1rem;
}

.hero-cta {
  display: inline-block;
  margin-top: 32px;
  padding: 14px 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1008;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 0 32px rgba(243, 215, 123, 0.45);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.hero-cta:hover {
  transform: scale(1.04);
  box-shadow: 0 0 48px rgba(243, 215, 123, 0.65);
}

.hero-planet-wrap {
  display: flex;
  justify-content: center;
}

.planet-hero .planet-sphere-hero:not(.has-island) {
  width: 280px;
  height: 280px;
}

.planet-hero .planet-ring {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  border: 1px solid rgba(243, 215, 123, 0.25);
  animation: spinRing 24s linear infinite;
}

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

/* Planet base */
.planet {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: default;
  text-align: center;
  font: inherit;
  color: inherit;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
  animation: floatPlanet 6s ease-in-out infinite;
}

.planet-station {
  cursor: pointer;
}

.planet-station:hover,
.planet-station.is-hovered,
.planet-station:focus-visible {
  z-index: 10;
  animation-play-state: paused;
}

.planet-station:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 8px;
  border-radius: 50%;
}

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

@keyframes floatPlanetAnchored {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

.planet-orbit-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 179, 90, 0.15), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.planet-station:hover .planet-orbit-glow,
.planet-station.is-hovered .planet-orbit-glow,
.planet.available .planet-orbit-glow {
  opacity: 1;
}

.planet-sphere {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.25), transparent 20%),
    radial-gradient(circle, rgba(214, 179, 90, 0.28), rgba(80, 40, 20, 0.9));
  box-shadow:
    0 0 24px rgba(214, 179, 90, 0.55),
    inset 0 0 30px rgba(255, 255, 255, 0.12);
}

.planet-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.3), transparent 25%),
    radial-gradient(circle at 70% 75%, rgba(123, 16, 35, 0.5), transparent 40%),
    radial-gradient(circle, #3a2818, #0d1024);
}

.planet-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: transparent !important;
  display: block;
}

.planet-sphere.has-island {
  overflow: visible;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.planet-image.island {
  object-fit: contain;
  border-radius: 0;
  background: transparent !important;
  display: block;
  width: var(--island-size, 160px);
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}

.planet.size-sm {
  --island-size: 128px;
}
.planet.size-md {
  --island-size: 160px;
}
.planet.size-lg {
  --island-size: 200px;
}

.planet-sphere-xl.has-island .planet-image.island {
  width: 260px;
}

.planet-sphere-hero.has-island .planet-image.island {
  width: 280px;
}

.planet.has-island .planet-shine,
.planet-sphere.has-island .planet-shine {
  display: none;
}

.planet-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.22) 0%,
    transparent 45%,
    transparent 70%,
    rgba(214, 179, 90, 0.12) 100%
  );
  pointer-events: none;
}

.planet.size-sm .planet-sphere:not(.has-island) {
  width: 128px;
  height: 128px;
}
.planet.size-md .planet-sphere:not(.has-island) {
  width: 160px;
  height: 160px;
}
.planet.size-lg .planet-sphere:not(.has-island) {
  width: 200px;
  height: 200px;
}
.planet-sphere-xl:not(.has-island) {
  width: 260px;
  height: 260px;
}

.planet.completed .planet-sphere:not(.has-island) {
  box-shadow:
    0 0 28px rgba(143, 200, 143, 0.5),
    inset 0 0 24px rgba(255, 255, 255, 0.1);
}

.planet.available .planet-sphere:not(.has-island) {
  box-shadow:
    0 0 36px rgba(243, 215, 123, 0.75),
    inset 0 0 28px rgba(255, 255, 255, 0.14);
}

.planet.completed .planet-sphere.has-island,
.planet.available .planet-sphere.has-island,
.planet-station.completed .planet-sphere.has-island,
.planet-station.available .planet-sphere.has-island {
  background: transparent !important;
  box-shadow: none !important;
}

.planet.completed .planet-image.island {
  filter: drop-shadow(0 0 16px rgba(143, 200, 143, 0.35))
    drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
}

.planet.available .planet-image.island {
  filter: drop-shadow(0 0 18px rgba(243, 215, 123, 0.4)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
}

.planet.locked .planet-sphere:not(.has-island),
.planet-station.locked .planet-image:not(.island) {
  filter: grayscale(0.7) brightness(0.55);
  opacity: 0.75;
}

.planet.locked .planet-sphere.has-island,
.planet-station.locked .planet-sphere.has-island {
  filter: none;
  opacity: 1;
  background: transparent;
  box-shadow: none;
}

.planet-station.locked .planet-image.island {
  filter: grayscale(0.65) brightness(0.58);
  opacity: 0.82;
}

.planet-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.planet-badge.done {
  background: linear-gradient(180deg, #a8e0a8, var(--safe));
  color: #1a3020;
}

.planet-label {
  margin-top: 10px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.planet-label strong {
  display: block;
  font-size: 0.82rem;
  color: var(--gold-light);
  line-height: 1.4;
}

.planet-label span,
.planet-status {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.planet.available .planet-status {
  color: var(--gold-light);
}
.planet.completed .planet-status {
  color: var(--safe);
}

.planet-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  width: max-content;
  max-width: 200px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(7, 8, 20, 0.92);
  border: 1px solid rgba(214, 179, 90, 0.25);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  z-index: 20;
}

.planet-station:hover .planet-tooltip,
.planet-station.is-hovered .planet-tooltip,
.planet-station:focus-visible .planet-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Image tone filters */
.tone-makkah {
  filter: sepia(0.35) brightness(0.85) saturate(1.1);
}
.tone-wahy {
  filter: hue-rotate(200deg) saturate(0.9) brightness(0.9);
}
.tone-dar {
  filter: hue-rotate(320deg) saturate(0.85);
}
.tone-habasha {
  filter: hue-rotate(40deg) saturate(1.1);
}
.tone-aqaba {
  filter: hue-rotate(80deg) brightness(1.05);
}
.tone-hijrah {
  filter: hue-rotate(160deg) saturate(0.95);
}
.tone-masjid {
  filter: hue-rotate(100deg) brightness(1.08);
}
.tone-badr {
  filter: saturate(1.15) brightness(1.05);
}
.tone-uhud {
  filter: hue-rotate(25deg) saturate(1.2) brightness(1.02);
}
.tone-ahzab {
  filter: hue-rotate(-35deg) saturate(1.1);
}
.tone-hudaybiyyah {
  filter: hue-rotate(55deg) saturate(1.05) brightness(1.02);
}

/* Planet map section — vertical full page */
.planet-map-section {
  min-height: auto;
  padding-bottom: 40px;
}

.planet-map {
  position: relative;
  width: min(640px, 94vw);
  min-height: auto;
  padding-bottom: 40px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.planet-map-flow {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.connection-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.connection-line {
  animation: linePulse 4s ease-in-out infinite;
}

.connection-line.is-active {
  animation: linePulse 1.5s ease-in-out infinite;
}

@keyframes linePulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
}

.planet-center {
  position: relative;
  z-index: 3;
  margin: 0 auto 56px;
  animation: floatPlanet 7s ease-in-out infinite;
  pointer-events: none;
  align-self: center;
}

.planet-map-stations {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 96px;
  padding-bottom: 24px;
}

.planet-row {
  display: flex;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.planet-row.side-right {
  justify-content: flex-end;
}

.planet-row.side-left {
  justify-content: flex-start;
}

.planet-station {
  position: relative;
  transform: none;
  animation: floatPlanet 6s ease-in-out infinite;
}

.planet-station:hover,
.planet-station.is-hovered {
  transform: scale(1.06);
  animation-play-state: paused;
}

.planet-map-stations .planet-row:nth-child(odd) .planet-station {
  animation-delay: -1.5s;
}
.planet-map-stations .planet-row:nth-child(3n) .planet-station {
  animation-delay: -3s;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 28px;
  margin-top: 40px;
  font-size: 0.88rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
}

.legend-dot.completed {
  background: var(--safe);
  border-color: var(--safe);
  box-shadow: 0 0 10px rgba(143, 200, 143, 0.5);
}
.legend-dot.available {
  background: var(--gold-light);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(243, 215, 123, 0.55);
}
.legend-dot.locked {
  background: rgba(255, 255, 255, 0.08);
}

/* Features — moons grid */
.moons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}

.moon-card {
  text-align: center;
  padding: 24px 16px;
}

.moon-sphere {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 25%),
    radial-gradient(circle, rgba(214, 179, 90, 0.2), rgba(13, 16, 36, 0.9));
  box-shadow: 0 0 20px rgba(214, 179, 90, 0.3);
  animation: floatPlanet 5s ease-in-out infinite;
}

.moon-icon {
  font-size: 1.6rem;
}

.moon-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--gold-light);
}

.moon-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

/* Mechanics — glass cards */
.glass-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.glass-card {
  padding: 28px 24px;
  border-radius: 18px;
  background: rgba(13, 16, 36, 0.55);
  border: 1px solid rgba(214, 179, 90, 0.18);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(243, 215, 123, 0.35);
  box-shadow: 0 8px 40px rgba(214, 179, 90, 0.12);
}

.glass-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--gold-light);
}

.glass-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
}

/* Goal banner */
.goal-section {
  padding-bottom: 60px;
}

.goal-banner {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 36px;
  text-align: center;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(123, 16, 35, 0.35), rgba(214, 179, 90, 0.15)), rgba(7, 8, 20, 0.6);
  border: 1px solid rgba(214, 179, 90, 0.25);
  box-shadow: 0 0 60px rgba(123, 16, 35, 0.2);
}

.goal-banner p {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  line-height: 1.9;
  color: var(--ivory);
  font-weight: 600;
}

.sirah-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 6vw 48px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.85;
}

.sirah-footer-sources {
  margin-top: 8px;
  font-size: 0.78rem;
  opacity: 0.8;
}

/* Modal */
.hub-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 13, 0.78);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.hub-modal.open {
  display: flex;
}

.hub-modal-box {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(13, 16, 36, 0.95), rgba(7, 8, 20, 0.98));
  border: 1px solid rgba(214, 179, 90, 0.2);
  box-shadow: 0 0 60px rgba(214, 179, 90, 0.15);
  text-align: right;
}

.hub-modal-box h2 {
  margin: 0 0 8px;
  color: var(--gold-light);
  font-size: 1.5rem;
}

.hub-modal-box .tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.tag.completed {
  background: rgba(143, 200, 143, 0.2);
  color: var(--safe);
}
.tag.available {
  background: rgba(214, 179, 90, 0.2);
  color: var(--gold-light);
}
.tag.locked {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.hub-modal-box p {
  color: var(--muted);
  line-height: 1.85;
  margin: 0 0 16px;
  font-size: 14px;
}

.modal-planet-wrap {
  display: flex;
  justify-content: center;
  margin: -4px 0 20px;
}

.planet-modal .planet-sphere:not(.has-island) {
  width: 110px;
  height: 110px;
}

.planet-modal .planet-sphere.has-island {
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
}

.planet-modal .planet-image.island {
  width: 140px;
  height: auto;
}

.modal-intro {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(214, 179, 90, 0.08);
  border: 1px solid rgba(214, 179, 90, 0.15);
}

.hub-btn {
  display: inline-block;
  margin: 6px 0 0 8px;
  padding: 12px 28px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.15s;
}

.hub-btn:hover {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.hub-btn.primary {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1a1008;
}

.hub-btn.secondary {
  background: rgba(13, 16, 36, 0.8);
  color: var(--ivory);
  border: 1px solid var(--line);
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding-top: 80px;
  }

  .planet-hero .planet-sphere-hero.has-island .planet-image.island {
    width: 220px;
  }

  .planet-sphere-xl.has-island .planet-image.island {
    width: 200px;
  }

  .planet.size-sm {
    --island-size: 104px;
  }
  .planet.size-md {
    --island-size: 128px;
  }
  .planet.size-lg {
    --island-size: 160px;
  }

  .planet.size-sm .planet-sphere:not(.has-island) {
    width: 104px;
    height: 104px;
  }
  .planet.size-md .planet-sphere:not(.has-island) {
    width: 128px;
    height: 128px;
  }
  .planet.size-lg .planet-sphere:not(.has-island) {
    width: 160px;
    height: 160px;
  }

  .planet-sphere-xl:not(.has-island) {
    width: 200px;
    height: 200px;
  }

  .planet-map {
    width: 98vw;
  }

  .planet-map-stations {
    gap: 72px;
  }

  .planet-row {
    justify-content: center !important;
  }

  .planet-tooltip {
    display: none;
  }

  .glass-cards {
    grid-template-columns: 1fr;
  }
}

/* Hub legacy class for game sub-pages */
.hub-body {
  min-height: 100vh;
}

/* Game shared (Badr) */
canvas {
  display: block;
}

#app {
  position: fixed;
  inset: 0;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.pane {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

#stagePane {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 290px;
  padding: 12px 14px;
  max-height: 42vh;
  overflow: auto;
}

#stagePane h2 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--gold);
}
#stagePane .brief {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
}

.lesson {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  border-right: 3px solid var(--accent);
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.objs {
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
}
.objs li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 5px 0;
  font-size: 12.5px;
  line-height: 1.5;
}
.objs li .dot {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  margin-top: 1px;
}
.objs li.done .dot {
  background: var(--safe);
  border-color: var(--safe);
}
.objs li.done span {
  color: var(--safe);
  text-decoration: line-through;
  opacity: 0.85;
}

#indPane {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 270px;
  padding: 10px 12px;
  max-height: 38vh;
  overflow: auto;
}

#indPane h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--gold);
}

.ind {
  display: grid;
  grid-template-columns: 58px 1fr 30px;
  gap: 7px;
  align-items: center;
  margin: 4px 0;
  font-size: 11px;
}

.ind .track {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.ind .track > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.4s;
}

.ind .val {
  text-align: left;
  color: var(--muted);
}

#controls {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 11px 13px;
  width: 220px;
}

#controls h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--gold);
}
#controls .k {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.85;
}
#controls .k b {
  color: var(--text);
}

#miniMapPane {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 150px;
  height: 150px;
  padding: 6px;
  pointer-events: none;
}

#miniMap {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: rgba(10, 8, 5, 0.6);
  border: 1px solid var(--line);
}

#narr {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(640px, 80vw);
  padding: 11px 16px;
  text-align: center;
}

#narr .who {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 3px;
}
#narr .txt {
  font-size: 14px;
  line-height: 1.8;
}

#prompt {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: rgba(10, 8, 5, 0.8);
  border: 1px solid var(--accent);
  border-radius: 11px;
  padding: 7px 15px;
  font-size: 13.5px;
  display: none;
  white-space: nowrap;
}

#prompt b {
  color: var(--gold);
}

#badgeToast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 16px 28px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--burgundy), var(--burgundy-dark));
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.4s,
    transform 0.4s;
  z-index: 25;
  text-align: center;
}

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

.btn {
  pointer-events: auto;
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #3a2c1a;
  color: var(--text);
  padding: 9px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.btn:hover {
  background: #4d3a22;
}

.btn.primary {
  background: linear-gradient(180deg, var(--gold), var(--accent));
  color: #231a0c;
  font-weight: bold;
  border: 0;
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  background: radial-gradient(circle at 50% 32%, #3b2c18, #100b06 78%);
}

#loader h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0;
  color: var(--gold);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

#loader p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.9;
  padding: 0 20px;
  font-size: 14px;
}

.barWrap {
  width: min(440px, 80vw);
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  border: 1px solid var(--line);
}

.barWrap > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.25s;
}

#loadMsg {
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

#startBtn {
  display: none;
  padding: 14px 38px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  color: #231a0c;
  background: linear-gradient(180deg, var(--gold), var(--accent));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

#startBtn:hover {
  filter: brightness(1.07);
}

#modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 4, 0.6);
  backdrop-filter: blur(3px);
}

#modalBox {
  width: min(620px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #221a10, #161009);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

#modalBox h2 {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 21px;
}
#modalBox .sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
  line-height: 1.8;
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(230, 196, 106, 0.18);
  color: var(--gold);
  margin-bottom: 6px;
}

.cardGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 4px;
}

.eduCard {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.eduCard h4 {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 14px;
}
.eduCard p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.feedback {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  min-height: 20px;
}
.feedback.ok {
  color: var(--safe);
}
.feedback.bad {
  color: var(--danger);
}

.pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  margin: 3px 3px 0 0;
}

.sort-zone {
  min-height: 52px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-item {
  display: inline-block;
  padding: 6px 12px;
  background: #3a2c1a;
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: grab;
  font-size: 13px;
  user-select: none;
}

.route-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 12px 0;
}

.route-step {
  padding: 6px 12px;
  background: rgba(107, 42, 42, 0.4);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.route-step::after {
  content: " ← ";
  color: var(--muted);
}
.route-step:last-child::after {
  content: "";
}

@media (max-width: 720px) {
  #stagePane,
  #indPane,
  #controls {
    width: min(86vw, 260px);
  }
  #indPane {
    bottom: auto;
    top: 62vh;
  }
  #miniMapPane {
    width: 110px;
    height: 110px;
  }
  .cardGrid {
    grid-template-columns: 1fr;
  }
}
