/* An Grianchóras - Solar System Stylesheet */
:root {
  --space-dark: #090d16;
  --space-surface: #111827;
  --space-card: #1f293d;
  --space-line: #374151;
  --space-text: #f3f4f6;
  --space-muted: #9ca3af;
  --accent-gold: #fbbf24;
  --accent-blue: #38bdf8;
  --accent-teal: #2dd4bf;
  --accent-coral: #f87171;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Lexend', system-ui, sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--space-dark);
  color: var(--space-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--space-surface);
  border-bottom: 2px solid var(--space-line);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.back-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--space-muted);
  background: #1f2937;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: all 0.2s;
}
.back-link:hover { color: #fff; background: #374151; }
.logo-icon {
  font-size: 2rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.subtitle {
  font-size: 0.82rem;
  color: var(--space-muted);
}

/* Header Stats */
.header-stats {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.stat-pill {
  background: #1f2937;
  border: 1px solid var(--space-line);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat-label { color: var(--space-muted); font-weight: 600; }
.stat-val { color: var(--accent-gold); font-weight: 800; }
.ctrl-btn {
  background: #1f2937;
  color: #fff;
  border: 1px solid var(--space-line);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.ctrl-btn:hover { background: #374151; border-color: var(--accent-blue); }

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.2rem;
  width: 100%;
  flex: 1;
}

/* Mode Navigation Tabs */
.mode-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.8rem;
  background: #111827;
  padding: 0.35rem;
  border-radius: 16px;
  border: 1px solid var(--space-line);
  overflow-x: auto;
}
.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--space-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mode-tab:hover { color: #fff; }
.mode-tab.active {
  background: var(--space-card);
  color: var(--accent-blue);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Views */
.game-view { display: none; }
.game-view.active { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.view-intro {
  margin-bottom: 1.5rem;
}
.view-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}
.view-intro h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
}
.view-intro p {
  color: var(--space-muted);
  font-size: 0.95rem;
}

/* VIEW 1: SOLAR WORKSPACE */
.solar-workspace {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 950px) {
  .solar-workspace { grid-template-columns: 1fr; }
}

.orrery-panel {
  background: #0b1120;
  border: 1px solid var(--space-line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.speed-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
  justify-content: flex-end;
}
.ctrl-label { font-size: 0.82rem; color: var(--space-muted); font-weight: 600; }
.speed-btn {
  background: #1f2937;
  color: var(--space-text);
  border: 1px solid var(--space-line);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.speed-btn:hover { background: #374151; }
.speed-btn.active { background: var(--accent-blue); color: #0f172a; border-color: var(--accent-blue); }

.orrery-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1 / 1;
}
#solar-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: crosshair;
  background: radial-gradient(circle, #0f172a 0%, #030712 100%);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.8), 0 0 25px rgba(56, 189, 248, 0.08);
}
.orrery-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--space-muted);
  margin-top: 0.8rem;
}

/* Planet Detail Panel */
.planet-card {
  background: var(--space-card);
  border: 1px solid var(--space-line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.planet-card-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  border-bottom: 1px solid var(--space-line);
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
}
.planet-visual-badge {
  font-size: 3rem;
  width: 68px;
  height: 68px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.planet-type-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-teal);
  background: rgba(45, 212, 191, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.2rem;
}
.planet-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}
.planet-irish-alias {
  font-size: 0.85rem;
  color: var(--accent-gold);
}

.planet-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.fact-box {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(55, 65, 81, 0.8);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.fact-title {
  display: block;
  font-size: 0.72rem;
  color: var(--space-muted);
  text-transform: uppercase;
  font-weight: 700;
}
.fact-val {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.15rem;
}

.fun-fact-box {
  background: rgba(251, 191, 36, 0.08);
  border-left: 4px solid var(--accent-gold);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
}
.fun-fact-header {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
}
.fun-fact-box p {
  font-size: 0.88rem;
  color: #fef3c7;
  margin-top: 0.25rem;
  line-height: 1.45;
}

.planet-quick-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.planet-quick-btn {
  background: #111827;
  color: var(--space-text);
  border: 1px solid var(--space-line);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.planet-quick-btn:hover { border-color: var(--accent-blue); color: #fff; }
.planet-quick-btn.active { background: var(--accent-blue); color: #0f172a; border-color: var(--accent-blue); }

/* VIEW 2: MOON LAB */
.moon-lab-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.moon-stage {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background: var(--space-card);
  border: 1px solid var(--space-line);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
@media (max-width: 650px) {
  .moon-stage { flex-direction: column; text-align: center; }
}
.moon-disk-wrap {
  flex-shrink: 0;
  filter: drop-shadow(0 0 25px rgba(248, 250, 252, 0.25));
}
.moon-info-card { flex: 1; }
.moon-phase-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.1);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}
.moon-info-card h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}
.moon-info-card p {
  color: var(--space-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.moon-visibility {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-teal);
}

.moon-slider-box {
  background: var(--space-card);
  border: 1px solid var(--space-line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
}
.slider-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--space-text);
}
#moon-slider {
  width: 100%;
  accent-color: var(--accent-gold);
  cursor: pointer;
  height: 8px;
}
.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--space-muted);
  font-weight: 600;
}

/* VIEW 3: GRAVITY CALCULATOR */
.gravity-calculator-wrap {
  max-width: 900px;
  margin: 0 auto;
}
.gravity-input-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--space-card);
  border: 1px solid var(--space-line);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.gravity-input-bar label { font-weight: 700; color: #fff; }
.input-group {
  display: flex;
  align-items: center;
  background: #111827;
  border: 1px solid var(--space-line);
  border-radius: 8px;
  overflow: hidden;
}
.input-group input {
  background: transparent;
  border: none;
  color: #fff;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 800;
  width: 90px;
  text-align: center;
}
.unit-tag {
  background: #1f2937;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  color: var(--space-muted);
  font-weight: 700;
}
.action-btn {
  background: var(--accent-blue);
  color: #0f172a;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn:hover { background: #7dd3fc; }

.gravity-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.gravity-planet-card {
  background: var(--space-card);
  border: 1px solid var(--space-line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.gravity-planet-card:hover { transform: translateY(-4px); }
.grav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.grav-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: #fff; }
.grav-factor { font-size: 0.75rem; color: var(--accent-gold); font-weight: 700; }
.grav-weight {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-teal);
  line-height: 1;
}
.grav-desc {
  font-size: 0.85rem;
  color: var(--space-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* VIEW 4: QUIZ */
.quiz-wrapper {
  max-width: 720px;
  margin: 0 auto;
}
.quiz-card {
  background: var(--space-card);
  border: 1px solid var(--space-line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow);
}
.quiz-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.quiz-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.quiz-streak { font-size: 0.88rem; font-weight: 700; color: var(--accent-gold); }
.quiz-question {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.8rem;
  line-height: 1.35;
}
.quiz-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}
.choice-btn {
  background: #111827;
  color: #fff;
  border: 2px solid var(--space-line);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.choice-btn:hover { border-color: var(--accent-blue); background: #1f2937; }
.choice-btn.correct { background: rgba(16, 185, 129, 0.2); border-color: #10b981; color: #34d399; }
.choice-btn.wrong { background: rgba(239, 68, 68, 0.2); border-color: #ef4444; color: #f87171; }
.quiz-feedback {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 1.2rem;
  min-height: 28px;
}
