* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Comic Sans MS', 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: #f7fafc;
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 10%, #2b2f6b 0%, #14163a 55%, #0a0b1f 100%);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 120px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #ffe9a8, transparent);
  background-size: 200px 160px;
}

.hidden { display: none !important; }

section { position: relative; max-width: 960px; margin: 0 auto; padding: 28px; }

button { font-family: inherit; cursor: pointer; }

#btn-to-dashboard {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: bold;
  color: #2c5282;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  text-decoration: none;
}

#screen-missions h1 {
  font-size: 32px;
  margin-bottom: 4px;
  color: #ffe08a;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}
#screen-missions > p { font-size: 16px; color: #cbd5f5; margin-bottom: 4px; }
#screen-missions p.game-intro {
  max-width: 640px;
  margin: 28px 0 4px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}
#screen-missions p.game-intro a { color: #ffe08a; font-weight: bold; }

#mission-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.mission-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 140px;
  padding: 20px;
  border: none;
  border-radius: 18px;
  color: #fff;
  text-align: left;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 8px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: hover) {
  .mission-card:hover { transform: translateY(-3px) scale(1.03); }
}
.mission-card:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 3px 6px rgba(0, 0, 0, 0.3);
}
.mission-card-1 { background: linear-gradient(135deg, #5a67d8, #434190); }
.mission-card-2 { background: linear-gradient(135deg, #2f855a, #276749); }
.mission-card-3 { background: linear-gradient(135deg, #c05621, #9c4221); }
.mission-card-4 { background: linear-gradient(135deg, #b83280, #702459); }
.mission-card-title { font-size: 18px; font-weight: bold; }
.mission-card-desc { font-size: 13px; line-height: 1.5; opacity: 1; }
.mission-card-stars { margin-top: auto; font-size: 22px; letter-spacing: 3px; color: #ffe08a; }

.ad-slot {
  max-width: 728px;
  min-height: 90px;
  margin: 160px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: bold;
}

#mission-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
#mission-header button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #2b6cb0, #2c5282);
  box-shadow: 0 4px 0 #1a365d;
}
#mission-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}
#mission-errors { font-size: 14px; font-weight: bold; color: #feb2b2; }

.primary-btn {
  display: block;
  min-height: 48px;
  margin: 20px auto 0;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f855a, #276749);
  box-shadow: 0 4px 0 #1c4532;
}
.primary-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1c4532; }
.primary-btn:disabled {
  color: #fff;
  background: #4a5568;
  box-shadow: 0 4px 0 #2d3748;
  cursor: not-allowed;
  transform: none;
}

.planet-svg, .sun-svg { width: 100%; height: 100%; display: block; }

.orbit-hint { margin-bottom: 14px; font-size: 14px; color: #cbd5f5; text-align: center; }

.orbit-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.orbit-sun {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #ffe08a;
}
.orbit-sun-icon { display: block; width: 64px; height: 64px; }
.orbit-slot {
  position: relative;
  width: 84px;
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 4px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.orbit-slot.locked { border-style: solid; border-color: #48bb78; background: rgba(72, 187, 120, 0.18); }
.orbit-slot.flash { animation: flashRed 0.45s ease 2; }
@keyframes flashRed {
  0%, 100% { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.4); }
  50% { background: rgba(245, 101, 101, 0.55); border-color: #f56565; }
}
.orbit-slot-num { position: absolute; top: 4px; left: 8px; font-size: 13px; font-weight: bold; color: #ffe08a; }
.slot-planet { display: block; width: 56px; height: 56px; }
.slot-name { font-size: 12px; }

.orbit-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 108px;
  margin-top: 22px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}
.tray-planet {
  width: 84px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.tray-planet.selected { border-color: #ffe08a; background: rgba(255, 224, 138, 0.2); }
.tray-planet-icon { display: block; width: 56px; height: 56px; }
.tray-planet-name { font-size: 12px; }

.question-progress { font-size: 13px; color: #cbd5f5; text-align: center; margin-bottom: 8px; }
.question-label { font-size: 14px; color: #ffe08a; text-align: center; margin-bottom: 6px; }
.question-text {
  max-width: 640px;
  margin: 0 auto 18px;
  font-size: 19px;
  line-height: 1.5;
  text-align: center;
}
.options {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.option-btn {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}
.option-btn:disabled { cursor: default; color: #fff; }
.option-btn.correct { border-color: #48bb78; background: rgba(72, 187, 120, 0.3); }
.option-btn.wrong { border-color: #f56565; background: rgba(245, 101, 101, 0.3); }
.option-planet { display: block; width: 64px; height: 64px; }

.feedback {
  max-width: 640px;
  margin: 18px auto 0;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  border-radius: 12px;
}
.feedback-ok { background: rgba(72, 187, 120, 0.2); }
.feedback-bad { background: rgba(245, 101, 101, 0.2); }

#result-area { max-width: 480px; margin: 40px auto 0; text-align: center; }
.result-title { font-size: 30px; color: #ffe08a; margin-bottom: 8px; }
.result-misi { font-size: 16px; color: #cbd5f5; margin-bottom: 12px; }
.result-stars { font-size: 48px; letter-spacing: 6px; color: #ffe08a; margin-bottom: 8px; }
.result-errors { font-size: 16px; margin-bottom: 6px; }
.result-best { font-size: 14px; color: #9ae6b4; }
.result-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.result-buttons .primary-btn { margin: 20px 0 0; }
.secondary-btn { background: linear-gradient(135deg, #2b6cb0, #2c5282); box-shadow: 0 4px 0 #1a365d; }
.secondary-btn:active { box-shadow: 0 1px 0 #1a365d; }

@media (prefers-reduced-motion: reduce) {
  .mission-card, .primary-btn { transition: none; }
  .orbit-slot.flash {
    animation: none;
    background: rgba(245, 101, 101, 0.55);
    border-color: #f56565;
  }
}

@media (max-width: 560px) {
  section { padding: 16px; }
  .options { grid-template-columns: 1fr; }
  .orbit-slot, .orbit-sun { width: 72px; }
  .orbit-slot { height: 96px; }
  .slot-planet, .tray-planet-icon { width: 48px; height: 48px; }
  .tray-planet { width: 72px; }
}
