﻿:root {
  --panel-edge: rgba(101, 226, 255, 0.45);
  --panel-bg: rgba(8, 21, 34, 0.84);
  --text-main: #ecf8ff;
  --text-soft: #bed6e8;
  --neon-cyan: #57e7ff;
  --neon-amber: #ffd16d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "Nunito", "Malgun Gothic", sans-serif;
  background: radial-gradient(circle at 20% 20%, #12395a 0%, #071a2d 45%, #02060d 100%);
}

.hidden {
  display: none !important;
}

.starfield,
.starfield::before,
.starfield::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.starfield {
  background-image:
    radial-gradient(2px 2px at 8% 22%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 17% 72%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(2px 2px at 35% 43%, rgba(255, 255, 255, 0.78), transparent 60%),
    radial-gradient(1px 1px at 48% 81%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(1px 1px at 59% 14%, rgba(255, 255, 255, 0.86), transparent 60%),
    radial-gradient(2px 2px at 69% 54%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(1px 1px at 84% 18%, rgba(255, 255, 255, 0.84), transparent 60%),
    radial-gradient(1px 1px at 92% 68%, rgba(255, 255, 255, 0.86), transparent 60%);
  animation: twinkle 4.2s ease-in-out infinite alternate;
}

.starfield::before {
  background: linear-gradient(120deg, rgba(87, 231, 255, 0.12), transparent 42%, rgba(129, 167, 255, 0.09));
  mix-blend-mode: screen;
}

.starfield::after {
  background: radial-gradient(circle at 50% 102%, rgba(117, 210, 255, 0.23), transparent 36%);
  animation: fogPulse 6.5s ease-in-out infinite alternate;
}

.warp-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(170, 235, 255, 0.2), rgba(15, 39, 63, 0.6) 45%, rgba(4, 11, 19, 0.95) 100%);
}

.warp-overlay::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: repeating-radial-gradient(circle at center, rgba(150, 225, 255, 0.09) 0 7px, transparent 7px 16px);
}

.warp-overlay.active {
  animation: warpIn 1.2s ease forwards;
}

.warp-text {
  position: relative;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.2rem, 5vw, 2.2rem);
  color: #e5fbff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(130, 230, 255, 0.9), 0 0 24px rgba(88, 177, 255, 0.65);
}

.warp-whiteout {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.98), rgba(220, 245, 255, 0.7) 30%, rgba(120, 197, 255, 0) 68%);
}

.warp-overlay.active .warp-whiteout {
  animation: whiteoutFlash 1.2s ease forwards;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  max-width: none;
  height: 100vh;
  margin: 0;
  padding: 10px 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.cockpit-topbar {
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 30, 48, 0.95), rgba(8, 20, 33, 0.82));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cockpit-topbar h1 {
  margin: 0;
  color: #8eeeff;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.94rem, 2.1vw, 1.18rem);
  text-align: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.system-pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.system-pill.online {
  background: rgba(126, 255, 149, 0.16);
  border: 1px solid rgba(126, 255, 149, 0.56);
  color: #c8ffd2;
}

.system-pill.time {
  background: rgba(255, 210, 112, 0.13);
  border: 1px solid rgba(255, 210, 112, 0.52);
  color: #ffeab6;
}

.encyclopedia-btn {
  border: 1px solid rgba(114, 228, 255, 0.94);
  border-radius: 10px;
  background: rgba(8, 46, 76, 0.78);
  color: #caf5ff;
  padding: 8px 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 0 12px rgba(82, 227, 255, 0.16), 0 0 18px rgba(82, 227, 255, 0.2);
}

.encyclopedia-btn.collecting {
  animation: btnCollect 0.6s ease;
}

.collect-toast {
  position: absolute;
  right: 0;
  top: -28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(111, 255, 150, 0.88);
  color: #053422;
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(111, 255, 150, 0.7);
}

.menu-view {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-height: 0;
  position: relative;
}

.cockpit-stage {
  background-image: url("reference-images/cockpit_background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 18px;
  overflow: hidden;
  padding: 20px 22px;
}

.cockpit-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(0, 255, 255, 0.14), rgba(2, 10, 22, 0.7));
  pointer-events: none;
}

.start-briefing-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: clamp(12px, 2vw, 24px);
  align-items: center;
  min-height: 0;
  margin-top: 10px;
}

.mega-briefing {
  position: relative;
  z-index: 3;
  width: min(88vw, 1240px);
  justify-self: center;
  border-radius: 16px;
  border: 1px solid rgba(119, 246, 255, 0.84);
  background: rgba(0, 255, 255, 0.12);
  box-shadow: inset 0 0 24px rgba(102, 232, 255, 0.22), 0 0 24px rgba(88, 213, 255, 0.36);
  padding: 16px 20px;
  margin-bottom: 6px;
}

.mega-briefing p {
  margin: 0;
  color: #ffdca7;
  font-weight: 800;
  line-height: 1.55;
  font-size: clamp(1rem, 1.42vw, 1.26rem);
  letter-spacing: 0.01em;
  text-shadow: 0 0 9px rgba(255, 198, 113, 0.24);
}

.mega-briefing p + p {
  margin-top: 8px;
}

.mega-briefing p:first-child {
  color: #ffe3b1;
  font-size: clamp(1.06rem, 1.56vw, 1.34rem);
}

.menu-panel,
.status-panel,
.explore-screen {
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  background: var(--panel-bg);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
}

.menu-panel {
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 3;
  background: rgba(0, 255, 255, 0.12);
  border: 1px solid rgba(110, 245, 255, 0.86);
  box-shadow: inset 0 0 30px rgba(92, 232, 255, 0.22), 0 0 34px rgba(78, 202, 255, 0.42);
  width: min(100%, 640px);
  max-width: 640px;
  justify-self: center;
  margin: 0;
  transform: translate(34px, -18px);
}

.mission-tag {
  margin: 0;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(154, 236, 255, 0.9);
  color: #c2f4ff;
  font-size: 0.82rem;
  font-weight: 700;
}

.menu-panel h2 {
  margin: 0;
  font-size: clamp(1.72rem, 3.4vw, 2.24rem);
  color: #ffaf4c;
  text-shadow: 0 0 12px rgba(255, 169, 74, 0.55);
  line-height: 1.2;
}

.guide-text {
  margin: 0;
  color: #ffdca7;
  line-height: 1.45;
  font-weight: 800;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(126, 242, 255, 0.62);
  background: rgba(7, 45, 64, 0.5);
  box-shadow: 0 0 18px rgba(96, 236, 255, 0.34);
}

.guide-text p {
  margin: 0;
}

.guide-text p + p {
  margin-top: 6px;
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 4;
}

.mode-btn {
  border: 2px solid rgba(117, 251, 255, 0.95);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(12, 55, 80, 0.86), rgba(17, 71, 95, 0.7));
  color: var(--text-main);
  padding: 26px 18px;
  display: grid;
  gap: 7px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(117, 251, 255, 0.45), 0 0 30px rgba(97, 225, 255, 0.6);
}

.mode-btn.explore {
  border-color: rgba(117, 251, 255, 0.98);
  box-shadow: 0 0 0 2px rgba(117, 251, 255, 0.5), 0 0 30px rgba(97, 225, 255, 0.7);
}

.mode-btn.mission {
  border-color: rgba(255, 216, 107, 0.98);
  box-shadow: 0 0 0 2px rgba(255, 216, 107, 0.45), 0 0 30px rgba(255, 194, 65, 0.65);
}

.mode-btn .btn-title {
  font-size: 1.52rem;
  font-weight: 800;
}

.mode-btn .btn-desc {
  color: #dff7ff;
  font-size: 1rem;
}

.mode-btn.locked {
  opacity: 0.52;
  cursor: not-allowed;
}

.mode-btn.mission-ready {
  opacity: 1;
  border-color: rgba(255, 228, 140, 0.98);
  box-shadow: 0 0 0 2px rgba(255, 228, 140, 0.45), 0 0 30px rgba(255, 200, 88, 0.75);
  animation: missionPulse 1s ease-in-out infinite alternate, missionShimmer 1.6s ease-in-out infinite;
}

.status-inline {
  margin: 0;
  font-size: 1.02rem;
  color: #d6f0ff;
  font-weight: 700;
}

.explore-screen {
  min-height: 0;
  padding: 14px;
  background-image:
    linear-gradient(rgba(4, 16, 30, 0.48), rgba(4, 16, 30, 0.48)),
    url("reference-images/galaxy_background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(240px, 280px);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header mode guide"
    "dash mode guide";
  gap: 12px;
  overflow: hidden;
  position: relative;
}

.mission-screen {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  border-radius: 18px;
  background-image: linear-gradient(rgba(0, 8, 18, 0.28), rgba(0, 8, 18, 0.28)), url("reference-images/미션모드 시험장.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.mission-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(118, 230, 255, 0.2);
  background: rgba(7, 30, 49, 0.62);
  backdrop-filter: blur(8px);
  padding: 12px 20px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

.mission-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 1.6vw, 1.7rem);
  color: #e7f7ff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.mission-stage {
  position: relative;
  flex-grow: 1;
  display: grid;
  place-items: center;
  padding: 22px;
}

.mission-pingpong {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.mission-pingpong img {
  width: min(78vw, 1080px);
  height: min(78vh, 780px);
  object-fit: contain;
  filter: brightness(1.05) drop-shadow(0 0 30px rgba(80, 200, 240, 0.55));
}

.mission-brief {
  position: relative;
  z-index: 5;
  width: min(100%, 620px);
  margin: 18px;
  border: 1px solid rgba(110, 245, 255, 0.6);
  border-radius: 18px;
  background: rgba(6, 28, 45, 0.86);
  backdrop-filter: blur(12px);
  padding: 22px;
  box-shadow: inset 0 0 24px rgba(92, 232, 255, 0.1), 0 4px 30px rgba(0, 0, 0, 0.5);
}

.mission-intro-panel,
.ox-quiz-panel {
  display: grid;
  gap: 14px;
}

.mission-intro-panel h3,
.ox-quiz-planet {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  color: #ffdca7;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mission-tag,
.ox-quiz-tag {
  margin: 0;
  text-align: center;
  color: #8feeff;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mission-intro,
.ox-quiz-question,
.ox-quiz-feedback {
  margin: 0;
  color: #e9f7ff;
  line-height: 1.65;
  text-align: center;
}

.mission-intro {
  font-size: clamp(1rem, 1.5vw, 1.08rem);
}

.mission-start-btn {
  justify-self: center;
  padding: 14px 28px;
  border-radius: 12px;
  border: 2px solid rgba(255, 226, 143, 0.82);
  background: linear-gradient(165deg, rgba(82, 58, 12, 0.86), rgba(42, 31, 10, 0.9));
  color: #fff1c4;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 216, 115, 0.4), 0 0 24px rgba(255, 216, 115, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mission-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255, 216, 115, 0.6), 0 4px 30px rgba(255, 216, 115, 0.7);
}

.ox-quiz-meta-row,
.ox-quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ox-quiz-progress,
.ox-quiz-result {
  margin: 0;
  color: #bcefff;
  font-weight: 700;
}

.ox-quiz-lives {
  margin: -2px 0 0;
  text-align: center;
  font-size: 1.45rem;
  letter-spacing: 0.18em;
  text-shadow: 0 0 12px rgba(255, 72, 102, 0.3);
}

.ox-quiz-question {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(10, 40, 64, 0.72);
  border: 1px solid rgba(118, 230, 255, 0.26);
  font-size: clamp(1.08rem, 1.7vw, 1.18rem);
}

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

.ox-quiz-btn,
.ox-quiz-next-btn {
  border: 0;
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ox-quiz-btn:hover,
.ox-quiz-next-btn:hover {
  transform: translateY(-2px);
}

.ox-quiz-o {
  background: linear-gradient(180deg, #fff7be, #f1c43f);
  color: #503300;
  box-shadow: 0 0 0 1px rgba(255, 229, 126, 0.4), 0 0 18px rgba(255, 217, 95, 0.45);
}

.ox-quiz-x {
  background: linear-gradient(180deg, #ffd0d0, #ff6b74);
  color: #4b1020;
  box-shadow: 0 0 0 1px rgba(255, 152, 162, 0.4), 0 0 18px rgba(255, 112, 124, 0.45);
}

.ox-quiz-feedback {
  min-height: 3.2em;
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(7, 32, 50, 0.86);
  border: 1px solid rgba(118, 230, 255, 0.18);
}

/* Ensure quiz panel can host an absolute result overlay */
.ox-quiz-panel {
  position: relative;
}

.ox-result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}
.ox-result-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
}
.ox-result-overlay.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.ox-result-icon {
  font-size: 6.5rem;
  line-height: 1;
  text-shadow: 0 6px 20px rgba(0,0,0,0.45);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}
.ox-result-icon.correct {
  color: #00c853;
  text-shadow: 0 8px 40px rgba(0,200,83,0.25), 0 2px 6px rgba(0,0,0,0.35);
}
.ox-result-icon.wrong {
  color: #ff1744;
  text-shadow: 0 8px 40px rgba(255,23,68,0.22), 0 2px 6px rgba(0,0,0,0.35);
}

.ending-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(2,6,18,0.45) 0%, rgba(2,6,18,0.85) 60%);
  z-index: 1600;
  padding: 28px;
}
.ending-panel.hidden { display: none; }
.reset-confirm {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,6,18,0.6);
  z-index: 2000;
}
.reset-confirm.hidden { display: none; }
.reset-card {
  background: #071225;
  color: #eaf6ff;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  max-width: 460px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.7);
}
.reset-card h3 { margin: 0 0 8px 0; }
.reset-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }
.ending-card {
  display: flex;
  gap: 28px;
  align-items: stretch;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.008));
  border: 1px solid rgba(255,255,255,0.06);
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  max-width: 1100px;
  width: 100%;
}
.ending-card { position: relative; }
.ending-pingpong {
  width: 360px;
  height: auto;
  flex: 0 0 360px;
  object-fit: contain;
  transform: translateY(-4px);
}
/* Make pingpong 3x larger visually when requested */
.ending-pingpong.large {
  position: absolute;
  left: 50%;
  top: -8%;
  transform: translateX(-50%);
  width: min(1080px, 60vw);
  flex: 0 0 auto;
  z-index: 1610;
  pointer-events: none;
}

/* Pingpong jump animation */
@keyframes pingJump {
  0% { transform: translateY(0) rotate(-6deg); }
  30% { transform: translateY(-40px) rotate(2deg); }
  60% { transform: translateY(-18px) rotate(-4deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
.ending-pingpong.jump {
  animation: pingJump 900ms cubic-bezier(.25,.9,.3,1) forwards;
}
.ending-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ending-content h2 { margin: 0 0 6px 0; color: #fff; font-size: 1.9rem; }
.ending-content p { margin: 0 0 12px 0; color: #dcefff; font-size: 1.05rem; }
.certificate {
  background: linear-gradient(180deg, #fffdf6, #fff7e6);
  padding: 20px 22px;
  border-radius: 10px;
  border: 6px solid #f5e3b3;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.6), 0 14px 40px rgba(0,0,0,0.35);
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.certificate h3 { margin: 0; color: #000; font-size: 1.45rem; letter-spacing: 0.02em; }
.cert-body { color: #000; font-size: 1rem; }
.cert-line { color: #000; margin: 2px 0; }
.certificate p,
.certificate span {
  color: #000;
}
.cert-seal {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ffd86b, #d99b2c 60%);
  border: 4px solid rgba(255,255,255,0.35);
  box-shadow: 0 6px 18px rgba(217,155,44,0.25), inset 0 -6px 14px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #6b3f00;
}
.cert-seal:after { content: "★"; font-size: 1.8rem; }
.cert-seal.stamp {
  animation: sealStamp 700ms cubic-bezier(.2,.8,.25,1) forwards;
}
@keyframes sealStamp {
  0% { transform: scale(0.06) rotate(-20deg); opacity: 0; }
  40% { transform: scale(1.12) rotate(6deg); opacity: 1; }
  70% { transform: scale(0.96) rotate(-4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Certificate entrance */
.certificate.enter {
  animation: certEnter 520ms cubic-bezier(.2,.9,.2,1) both;
}
@keyframes certEnter {
  0% { transform: translateY(18px) scale(0.98); opacity: 0; }
  60% { transform: translateY(-6px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.cert-input-label { display:block; margin-top:8px; color:#eaf6ff; }
.cert-name-input { margin-top:6px; padding:8px 10px; border-radius:8px; border:1px solid rgba(90,90,90,0.08); width:220px; }
.ending-actions { display: flex; gap: 10px; margin-top: 6px; }

@media (max-width: 900px) {
  .ending-card { flex-direction: column; align-items: center; padding: 18px; }
  .ending-pingpong { width: 260px; flex: 0 0 auto; }
  .certificate { grid-template-columns: 1fr; }
  .cert-seal { margin: 8px auto 0; }
  /* On small screens, keep pingpong in normal flow so it doesn't cover certificate */
  .ending-pingpong.large { position: static; width: 260px; transform: none; }
}

.ox-quiz-next-btn {
  background: linear-gradient(180deg, #b3f8ff, #54d3ff);
  color: #05263b;
  box-shadow: 0 0 0 1px rgba(120, 230, 255, 0.35), 0 0 18px rgba(88, 208, 255, 0.45);
}

.ox-quiz-failed {
  color: #ffd4dc;
}

.mission-speech {
  display: none;
}

/* Focus mode: when entering observation/landing, hide side panels and expand main scene. */
.explore-screen:has(#observationView.active),
.explore-screen:has(#landingView.active) {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "mode";
  padding: 10px;
}

.explore-screen:has(#observationView.active) .explore-header,
.explore-screen:has(#observationView.active) .progress-dash,
.explore-screen:has(#observationView.active) .explore-pingpong,
.explore-screen:has(#landingView.active) .explore-header,
.explore-screen:has(#landingView.active) .progress-dash,
.explore-screen:has(#landingView.active) .explore-pingpong {
  display: none;
}

.explore-header {
  grid-area: header;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(118, 230, 255, 0.58);
  border-radius: 12px;
  background: rgba(7, 30, 49, 0.84);
  box-shadow: inset 0 0 14px rgba(90, 203, 240, 0.2);
  padding: 12px 10px;
}

.explore-header h2 {
  margin: 2px 0 0;
  font-size: clamp(1.42rem, 1.65vw, 1.72rem);
  color: #e7f7ff;
  line-height: 1.32;
}

.explore-tag {
  margin: 0;
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(132, 238, 255, 0.72);
  background: rgba(12, 53, 74, 0.62);
  color: #bff3ff;
  font-size: 0.9rem;
  font-weight: 800;
}

.explore-header .back-btn {
  justify-self: start;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.progress-dash {
  grid-area: dash;
  align-self: stretch;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(68px, auto);
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(118, 230, 255, 0.58);
  background: rgba(7, 30, 49, 0.9);
  box-shadow: inset 0 0 14px rgba(90, 203, 240, 0.2);
  z-index: 20;
}

.progress-planet {
  position: relative;
  border-radius: 9px;
  border: 1px solid rgba(123, 207, 255, 0.32);
  background: rgba(255, 255, 255, 0.05);
  color: #8cb0c8;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  transition: filter 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.progress-planet .icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.progress-planet .name {
  font-size: 1rem;
  font-weight: 800;
}

.progress-planet.completed {
  color: #ebffef;
  border-color: rgba(149, 255, 173, 0.88);
  box-shadow: 0 0 0 1px rgba(149, 255, 173, 0.4), 0 0 16px rgba(133, 245, 170, 0.64);
  filter: brightness(1.14);
}

.progress-planet.completed::after {
  content: "완료";
  position: absolute;
  right: 4px;
  top: 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  padding: 3px 7px;
  font-weight: 900;
  color: #053322;
  background: linear-gradient(150deg, #8aff9f, #bdffd2);
}

.pingpong-hero {
  justify-self: center;
  align-self: end;
  width: min(50vw, 760px);
  max-height: calc(100vh - 178px);
  display: block;
  transform: translate(10px, 2px);
  pointer-events: auto;
  position: relative;
  z-index: 4;
  cursor: pointer;
}

.pingpong-hero::after {
  content: "핑퐁에게 마우스를 올려보세요";
  position: absolute;
  right: 20px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(131, 240, 255, 0.78);
  background: rgba(8, 41, 63, 0.82);
  color: #c9f7ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 0 12px rgba(102, 225, 255, 0.3);
  animation: pingpongHintPulse 1.4s ease-in-out infinite;
}

.pingpong-hero img {
  display: block;
  width: 100%;
  max-width: 760px;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 0 18px rgba(115, 240, 255, 0.86));
  animation: pingpongFloat 2.4s ease-in-out infinite;
  transition: transform 0.28s ease, filter 0.28s ease;
}

.pingpong-hero:hover img,
.pingpong-hero:focus-within img {
  transform: translateY(-5px) scale(1.02);
  filter: brightness(1.18) drop-shadow(0 0 20px rgba(115, 240, 255, 0.95));
}

.pingpong-speech {
  position: absolute;
  left: clamp(-120px, -8vw, -48px);
  top: -68px;
  width: min(460px, 36vw);
  border-radius: 14px;
  border: 1px solid rgba(117, 238, 255, 0.82);
  background: rgba(7, 40, 61, 0.82);
  color: #e4f6ff;
  box-shadow: 0 0 18px rgba(94, 224, 255, 0.42);
  padding: 34px 16px 13px;
  overflow: visible;
  z-index: 6;
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}

.pingpong-hero:hover .pingpong-speech,
.pingpong-hero:focus-within .pingpong-speech {
  opacity: 1;
  transform: translateY(0);
}

.pingpong-speech::before {
  content: "조력자 핑퐁";
  position: absolute;
  left: 12px;
  top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(146, 241, 255, 0.86);
  background: linear-gradient(180deg, rgba(5, 48, 72, 0.98), rgba(7, 32, 52, 0.95));
  color: #c8f7ff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 0 12px rgba(96, 230, 255, 0.35);
}

.pingpong-speech p {
  position: relative;
  margin: 0;
  font-size: clamp(1.08rem, 1.35vw, 1.28rem);
  font-weight: 700;
  line-height: 1.52;
}

.back-btn,
.minor-btn,
.landing-btn,
.landing-fact-buttons button,
.encyclopedia-panel button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #eaf8ff;
  font-weight: 700;
  cursor: pointer;
}

.back-btn,
.minor-btn,
.landing-btn {
  padding: 8px 11px;
}

.mode-stack {
  grid-area: mode;
  position: relative;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 1px solid rgba(118, 230, 255, 0.4);
  border-radius: 14px;
  background: rgba(6, 24, 42, 0.26);
}

.explore-screen:has(#observationView.active) .mode-stack,
.explore-screen:has(#landingView.active) .mode-stack {
  border-color: rgba(118, 230, 255, 0.28);
  background: rgba(6, 24, 42, 0.14);
}

.mode-view {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.mode-view.active {
  opacity: 1;
  pointer-events: auto;
}

.solar-stage {
  position: absolute;
  inset: -5% 0 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 164, 66, 0.08), transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(64, 130, 185, 0.2), transparent 68%);
}

#orbitView {
  overflow: visible;
}

.explore-pingpong {
  grid-area: guide;
  position: relative;
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(220px, 52%) auto;
  align-content: stretch;
  justify-items: center;
  align-items: stretch;
  gap: 8px;
  padding: 8px 6px;
  border: 1px solid rgba(118, 230, 255, 0.48);
  border-radius: 12px;
  background: rgba(7, 30, 49, 0.72);
  box-shadow: inset 0 0 14px rgba(90, 203, 240, 0.18);
  z-index: 24;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.explore-pingpong img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  align-self: stretch;
  object-fit: contain;
  filter: brightness(1.12) drop-shadow(0 0 16px rgba(119, 236, 255, 0.78));
}

.explore-pingpong p {
  margin: 0;
  width: 100%;
  max-width: 100%;
  align-self: start;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(118, 230, 255, 0.72);
  background: rgba(8, 39, 58, 0.92);
  color: #ddf5ff;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.58;
  padding: 12px 13px;
  box-shadow: 0 0 18px rgba(90, 214, 255, 0.28);
  overflow-wrap: anywhere;
}

/* Alias for alternate right-guide class name used in some layouts. */
.pingpong-comms {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(220px, 52%) auto;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
}

.pingpong-comms img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.pingpong-comms p {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.sun {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(68px, 7.6vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: #ffb24a;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255, 245, 186, 0.9), rgba(255, 185, 75, 0.35) 58%, rgba(255, 128, 31, 0.2) 100%),
    url("https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/The_Sun_in_white_light.jpg/512px-The_Sun_in_white_light.jpg");
  background-size: cover;
  background-position: center;
  background-blend-mode: screen;
  box-shadow: 0 0 26px rgba(255, 196, 109, 0.88), 0 0 82px rgba(255, 131, 44, 0.58);
  z-index: 2;
}

.orbit {
  --orbit-size: 240px;
  --duration: 20s;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--orbit-size);
  height: var(--orbit-size);
  margin-left: calc(var(--orbit-size) * -0.5);
  margin-top: calc(var(--orbit-size) * -0.5);
  border-radius: 50%;
  border: 1px solid rgba(125, 194, 230, 0.24);
  animation: orbitRotate var(--duration) linear infinite;
  pointer-events: none;
}

.planet {
  --planet-size: 20px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--planet-size);
  height: var(--planet-size);
  margin-left: calc(var(--planet-size) * -0.5);
  margin-top: calc(var(--planet-size) * -0.5);
  transform: translateX(calc(var(--orbit-size) * 0.5));
  border: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 14px rgba(84, 189, 255, 0.35), 0 0 24px rgba(84, 132, 255, 0.26);
  pointer-events: auto;
  cursor: pointer;
}

.planet:hover,
.planet:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(111, 220, 255, 0.35), 0 0 19px rgba(112, 245, 255, 0.48), 0 0 32px rgba(83, 167, 255, 0.34);
}

.planet.explored::after {
  content: "탐사 완료";
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  background: linear-gradient(150deg, #8aff9f, #bdffd2);
  color: #0a3221;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.62rem;
  font-weight: 900;
  box-shadow: 0 0 8px rgba(138, 255, 159, 0.68);
  white-space: nowrap;
}

.planet.completed {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 22px rgba(138, 255, 159, 0.9), 0 0 48px rgba(76, 210, 255, 0.7);
  filter: brightness(1.25) saturate(1.15);
}

.mercury-orbit { --orbit-size: min(24vw, 170px); --duration: 12s; }
.venus-orbit { --orbit-size: min(31vw, 240px); --duration: 16s; }
.earth-orbit { --orbit-size: min(38vw, 305px); --duration: 20s; }
.mars-orbit { --orbit-size: min(45vw, 365px); --duration: 24s; }
.jupiter-orbit { --orbit-size: min(54vw, 435px); --duration: 30s; }
.saturn-orbit { --orbit-size: min(62vw, 500px); --duration: 36s; }
.uranus-orbit { --orbit-size: min(70vw, 565px); --duration: 42s; }
.neptune-orbit { --orbit-size: min(78vw, 625px); --duration: 48s; }

.mercury-orbit .planet { --planet-size: 16px; transform: rotate(8deg) translateX(calc(var(--orbit-size) * 0.5)); }
.venus-orbit .planet { --planet-size: 20px; transform: rotate(54deg) translateX(calc(var(--orbit-size) * 0.5)); }
.earth-orbit .planet { --planet-size: 22px; transform: rotate(102deg) translateX(calc(var(--orbit-size) * 0.5)); }
.mars-orbit .planet { --planet-size: 19px; transform: rotate(152deg) translateX(calc(var(--orbit-size) * 0.5)); }
.jupiter-orbit .planet { --planet-size: 33px; transform: rotate(198deg) translateX(calc(var(--orbit-size) * 0.5)); }
.saturn-orbit .planet { --planet-size: 30px; transform: rotate(244deg) translateX(calc(var(--orbit-size) * 0.5)); }
.uranus-orbit .planet { --planet-size: 25px; transform: rotate(292deg) translateX(calc(var(--orbit-size) * 0.5)); }
.neptune-orbit .planet { --planet-size: 25px; transform: rotate(336deg) translateX(calc(var(--orbit-size) * 0.5)); }

.planet.mercury { background-image: url("https://upload.wikimedia.org/wikipedia/commons/4/4a/Mercury_in_true_color.jpg"); }
.planet.venus { background-image: url("https://upload.wikimedia.org/wikipedia/commons/e/e5/Venus-real_color.jpg"); }
.planet.earth { background-image: url("https://upload.wikimedia.org/wikipedia/commons/9/97/The_Earth_seen_from_Apollo_17.jpg"); }
.planet.mars { background-image: url("https://upload.wikimedia.org/wikipedia/commons/0/02/OSIRIS_Mars_true_color.jpg"); }
.planet.jupiter { background-image: url("https://upload.wikimedia.org/wikipedia/commons/e/e2/Jupiter.jpg"); }
.planet.saturn { background-image: url("https://upload.wikimedia.org/wikipedia/commons/c/c7/Saturn_during_Equinox.jpg"); }
.planet.uranus { background-image: url("https://upload.wikimedia.org/wikipedia/commons/3/3d/Uranus2.jpg"); }
.planet.neptune { background-image: url("https://upload.wikimedia.org/wikipedia/commons/5/56/Neptune_Full.jpg"); }

.observation-wrap {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 45%, rgba(95, 160, 255, 0.1), rgba(8, 18, 30, 0.7) 62%),
    linear-gradient(rgba(4, 12, 26, 0.48), rgba(4, 12, 26, 0.48)),
    url("reference-images/galaxy_background.png");
  background-size: cover;
  background-position: center;
}

.menu-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: -2px;
}

.menu-actions .minor-btn {
  position: static;
  left: auto;
  top: auto;
  z-index: auto;
}

.observation-wrap .minor-btn,
.landing-surface .minor-btn {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 12;
}

.landing-btn {
  position: absolute;
  left: 50%;
  top: calc(42% + clamp(130px, 18vw, 220px));
  transform: translateX(-50%);
  z-index: 12;
  padding: 12px 24px;
  font-size: 1rem;
  border-color: rgba(255, 226, 143, 0.82);
  background: linear-gradient(165deg, rgba(82, 58, 12, 0.86), rgba(42, 31, 10, 0.9));
  box-shadow: 0 0 0 1px rgba(255, 216, 115, 0.4), 0 0 18px rgba(255, 216, 115, 0.55), 0 0 40px rgba(255, 185, 72, 0.38);
}

.planet-zoom {
  position: absolute;
  left: 50%;
  top: 42%;
  width: clamp(200px, 31vw, 430px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 2px rgba(190, 232, 255, 0.18), 0 0 22px rgba(114, 206, 255, 0.28), 0 0 42px rgba(70, 112, 241, 0.2);
}

.planet-zoom::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset -36px 0 52px rgba(2, 8, 18, 0.28);
  pointer-events: none;
}

.planet-zoom.saturn-focus {
  width: clamp(280px, 44vw, 620px);
  aspect-ratio: 1.65 / 1;
  border-radius: 999px;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: rgba(8, 18, 31, 0.28);
}

.planet-zoom.saturn-focus::after {
  border-radius: 999px;
}

.orbit .planet.explored::after {
  display: none;
}

.orbit .planet.completed {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 14px rgba(84, 189, 255, 0.35), 0 0 24px rgba(84, 132, 255, 0.26);
  filter: none;
}

.point-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.point-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #8defff 55%, #3da2ff 100%);
  box-shadow: 0 0 10px rgba(143, 227, 255, 0.8), 0 0 20px rgba(61, 162, 255, 0.7);
  cursor: pointer;
  animation: pointBlink 1s ease-in-out infinite alternate;
  pointer-events: auto;
}

.point-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(160, 232, 255, 0.45);
}

.point-dot.focused {
  animation: magnifyPulse 0.6s ease-in-out;
}

.point-card {
  position: absolute;
  right: 16px;
  top: 16px;
  width: min(340px, calc(100% - 32px));
  border: 1px solid rgba(113, 226, 255, 0.95);
  border-radius: 12px;
  background: rgba(6, 33, 57, 0.78);
  backdrop-filter: blur(5px);
  box-shadow: inset 0 0 16px rgba(98, 215, 255, 0.16), 0 0 24px rgba(68, 182, 255, 0.32);
  padding: 10px;
  z-index: 11;
  transition: opacity 0.35s ease;
}

/* Observation briefing layout: large Pingpong at bottom-left + wide bottom explanation bar. */
.explore-screen:has(#observationView.active) #pointCard {
  left: 16px;
  right: 16px;
  top: auto;
  bottom: 12px;
  width: auto;
  height: 17vh;
  min-height: 104px;
  max-height: 17vh;
  padding: 8px 12px 8px 188px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: rgba(123, 232, 255, 0.96);
  background: rgba(6, 34, 56, 0.86);
  box-shadow: inset 0 0 18px rgba(98, 215, 255, 0.2), 0 0 28px rgba(68, 182, 255, 0.34);
  overflow: auto;
}

.explore-screen:has(#observationView.active) #pointCard::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 4px;
  bottom: 4px;
  width: 160px;
  background: url("reference-images/pingpong.png") center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(118, 236, 255, 0.72));
  pointer-events: none;
}

.explore-screen:has(#observationView.active) #pointImageFrame {
  display: none;
}

.explore-screen:has(#observationView.active) .point-card-header {
  margin-bottom: 6px;
}

.explore-screen:has(#observationView.active) .point-card-label {
  font-size: 0.9rem;
}

.explore-screen:has(#observationView.active) #pointTitle {
  font-size: 1.38rem;
  line-height: 1.2;
}

.explore-screen:has(#observationView.active) .point-detail {
  display: block;
}

.explore-screen:has(#observationView.active) #pointDescription {
  font-size: 0.98rem;
  line-height: 1.34;
  border-radius: 12px;
  border-color: rgba(136, 222, 255, 0.45);
  background: rgba(6, 27, 44, 0.76);
  padding: 7px 10px;
}

.explore-screen:has(#observationView.active) #toLandingBtn {
  top: auto;
  left: 50%;
  bottom: calc(17vh + 16px);
  transform: translateX(-50%);
  z-index: 14;
}

.explore-screen:has(#observationView.active) .planet-zoom {
  top: 36%;
}

.point-card.fading {
  opacity: 0;
}

.point-card-label {
  margin: 0;
  color: #9befff;
  font-size: 0.78rem;
}

.point-card h3 {
  margin: 4px 0 0;
}

.point-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.point-close-btn {
  border: 1px solid rgba(139, 220, 255, 0.8);
  background: rgba(7, 34, 54, 0.75);
  color: #d9f5ff;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.point-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.point-detail img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(137, 215, 255, 0.45);
}

.image-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

.image-loader {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 8px;
  justify-items: center;
  background: rgba(2, 16, 29, 0.82);
  color: #9befff;
  font-size: 0.85rem;
}

.image-loader span {
  width: 70%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 233, 255, 0.22);
  overflow: hidden;
}

.image-loader span::before {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #84f5ff, transparent);
  animation: loaderScan 1s linear infinite;
}

.point-detail p {
  margin: 0;
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(134, 211, 255, 0.38);
  background: rgba(5, 19, 30, 0.56);
  line-height: 1.55;
}

.landing-surface {
  position: absolute;
  inset: 0;
  background-size: 115%;
  background-position: center;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='13' cy='13' r='8' fill='none' stroke='%23c8f4ff' stroke-width='3'/%3E%3Cline x1='19' y1='19' x2='29' y2='29' stroke='%23c8f4ff' stroke-width='3'/%3E%3C/svg%3E") 10 10, auto;
  filter: brightness(1.2) saturate(1.05);
}

.landing-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 18, 28, 0.12), rgba(4, 14, 22, 0.56));
}

.landing-surface.shake {
  animation: landShake 0.65s ease;
}

.shutter-fx {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(6, 10, 14, 0.96) 0 42%, transparent 42% 58%, rgba(6, 10, 14, 0.96) 58% 100%);
}

.shutter-fx.active {
  animation: shutterSnap 0.34s ease;
}

.helmet-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  border: 3px solid rgba(120, 224, 255, 0.28);
  box-shadow: inset 0 0 60px rgba(89, 198, 255, 0.18), inset 0 0 130px rgba(5, 20, 35, 0.4);
}

.helmet-hud::before,
.helmet-hud::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 56px;
  height: 56px;
  border-top: 3px solid rgba(132, 232, 255, 0.55);
  border-bottom: 3px solid rgba(132, 232, 255, 0.55);
  transform: translateY(-50%);
}

.helmet-hud::before {
  left: 0;
  border-right: 3px solid rgba(132, 232, 255, 0.55);
  border-top-right-radius: 28px;
  border-bottom-right-radius: 28px;
}

.helmet-hud::after {
  right: 0;
  border-left: 3px solid rgba(132, 232, 255, 0.55);
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
}

.landing-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  border: 1px solid rgba(118, 229, 255, 0.86);
  border-radius: 12px;
  padding: 12px;
  background: rgba(8, 36, 57, 0.72);
  box-shadow: inset 0 0 14px rgba(92, 223, 255, 0.14), 0 0 26px rgba(69, 184, 255, 0.24);
  z-index: 8;
}

.landing-label {
  margin: 0;
  color: #9fefff;
  font-size: 0.82rem;
}

.landing-hud h3 {
  margin: 4px 0 8px;
}

.landing-fact-card {
  border-radius: 10px;
  border: 1px solid rgba(146, 217, 255, 0.42);
  background: rgba(5, 17, 27, 0.56);
  padding: 10px;
}

.landing-info-popup {
  position: absolute;
  min-width: 190px;
  max-width: 260px;
  border-radius: 10px;
  border: 1px solid rgba(108, 226, 255, 0.9);
  background: rgba(6, 31, 52, 0.84);
  backdrop-filter: blur(4px);
  color: #ddf5ff;
  padding: 10px;
  z-index: 9;
  box-shadow: 0 0 22px rgba(73, 199, 255, 0.4);
  transform: translate(-50%, -115%);
}

.landing-info-popup h5 {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.landing-info-popup p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.landing-fact-card h4,
.landing-fact-card p {
  margin: 0;
}

.landing-fact-card h4 {
  margin-bottom: 4px;
}

.encyclopedia-panel {
  position: fixed;
  inset: 12px;
  border: 1px solid rgba(111, 238, 255, 0.95);
  border-radius: 18px;
  background: rgba(5, 28, 44, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 40px rgba(95, 236, 255, 0.18), 0 0 60px rgba(62, 180, 255, 0.34);
  z-index: 70;
  padding: 16px;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 10px;
}

.encyclopedia-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(98, 240, 255, 0.08) 0 2px, transparent 2px 11px);
  mix-blend-mode: screen;
  animation: holoScan 2.1s linear infinite;
  opacity: 0.52;
  z-index: -1;
}

.encyclopedia-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(124, 232, 255, 0.28);
}

.encyclopedia-panel h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.3vw, 1.7rem);
  color: #e8f7ff;
}

.encyclopedia-top-actions {
  display: flex;
  gap: 8px;
}

.encyclopedia-panel button {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.encyclopedia-guide {
  margin: 0;
  color: #d1e7f7;
  font-size: 0.97rem;
  line-height: 1.5;
}

.encyclopedia-progress {
  border: 1px solid rgba(120, 228, 255, 0.35);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(7, 36, 58, 0.7);
}

.encyclopedia-progress-meta {
  margin: 0 0 6px;
  color: #dff4ff;
  font-size: 0.9rem;
  font-weight: 700;
}

.encyclopedia-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(149, 214, 255, 0.2);
  overflow: hidden;
}

.encyclopedia-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6de0ff, #8bffbf);
  transition: width 0.35s ease;
}

.encyclopedia-home-view,
.encyclopedia-detail-view {
  min-height: 0;
  overflow: auto;
}

.encyclopedia-planet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  padding-right: 4px;
}

.enc-planet-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(136, 217, 255, 0.42);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 47, 73, 0.9), rgba(6, 24, 40, 0.92));
  color: #e8f8ff;
  text-align: left;
  padding: 10px;
  display: grid;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.enc-planet-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(146, 235, 255, 0.5), 0 0 18px rgba(96, 215, 255, 0.38);
}

.enc-planet-card img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(151, 221, 255, 0.38);
}

.enc-planet-card h4 {
  margin: 0;
  font-size: 1.1rem;
  color: #e9fbff;
}

.enc-planet-progress {
  margin: 0;
  font-size: 0.86rem;
  color: #cde9f9;
}

.enc-planet-progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(171, 226, 255, 0.22);
  overflow: hidden;
}

.enc-planet-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #72e8ff, #9affc5);
}

.enc-planet-card.completed {
  border-color: rgba(151, 255, 173, 0.88);
  box-shadow: 0 0 0 1px rgba(151, 255, 173, 0.44), 0 0 18px rgba(133, 245, 170, 0.36);
}

.enc-complete-stamp {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #103622;
  background: linear-gradient(150deg, #a3ffba, #d9ffe4);
  box-shadow: 0 0 10px rgba(142, 255, 174, 0.65);
}

.enc-planet-card.completed::after {
  content: "";
  position: absolute;
  inset: -30% -10%;
  background: linear-gradient(120deg, transparent 38%, rgba(191, 255, 220, 0.35) 50%, transparent 62%);
  animation: encyclopediaSparkle 2.3s ease-in-out infinite;
  pointer-events: none;
}

.enc-recent-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 900;
  color: #062b3c;
  background: linear-gradient(150deg, #7fefff, #b8f8ff);
  box-shadow: 0 0 10px rgba(120, 234, 255, 0.64);
}

.enc-planet-card.recent-collected {
  animation: encyclopediaRecentPulse 1.2s ease-in-out infinite alternate;
}

.enc-planet-card.not-started {
  filter: saturate(0.78) brightness(0.85);
}

.encyclopedia-detail-view {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.encyclopedia-detail-hero {
  border: 1px solid rgba(133, 227, 255, 0.4);
  border-radius: 14px;
  padding: 10px;
  background: rgba(9, 37, 58, 0.82);
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 12px;
  align-items: center;
}

.encyclopedia-detail-hero img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(4, 16, 28, 0.64);
  border: 1px solid rgba(141, 220, 255, 0.34);
}

.encyclopedia-detail-hero h4 {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.5rem);
  color: #eaf8ff;
}

.encyclopedia-detail-hero p {
  margin: 6px 0 0;
  color: #c6e5f8;
  font-size: 0.95rem;
  font-weight: 700;
}

.encyclopedia-detail-entries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.enc-entry {
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(154, 213, 255, 0.34);
  background: rgba(255, 255, 255, 0.04);
}

.enc-entry h5 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #edfbff;
}

.enc-entry p {
  margin: 0;
  color: #d7e9f8;
  font-size: 0.94rem;
  line-height: 1.58;
}

.enc-entry img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 7px;
  margin-top: 8px;
}

.enc-entry .image-frame {
  margin-top: 8px;
}

.enc-entry.locked {
  border-style: dashed;
  background: rgba(12, 28, 42, 0.55);
}

.enc-entry.recent-unlock {
  border-color: rgba(138, 245, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(138, 245, 255, 0.34), 0 0 18px rgba(94, 224, 255, 0.34);
  animation: encyclopediaRecentGlow 1.1s ease-in-out 3;
}

.enc-entry.locked h5,
.enc-entry.locked p {
  color: #6f91a8;
}

.collect-card {
  position: fixed;
  z-index: 35;
  width: 180px;
  border-radius: 12px;
  border: 1px solid rgba(111, 228, 255, 0.9);
  background: rgba(8, 41, 67, 0.92);
  color: #d9f6ff;
  padding: 8px;
  box-shadow: 0 0 20px rgba(78, 210, 255, 0.4);
  pointer-events: none;
}

.robot-courier {
  position: fixed;
  z-index: 36;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 22px;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(100, 220, 255, 0.7));
}

.completion-fx {
  position: fixed;
  inset: 0;
  z-index: 41;
  pointer-events: none;
}

.completion-stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.4) rotate(-11deg);
  color: #ffefc5;
  border: 4px solid rgba(255, 210, 101, 0.95);
  border-radius: 12px;
  padding: 20px 28px;
  font-family: "Orbitron", sans-serif;
  text-align: center;
  letter-spacing: 0.08em;
  background: rgba(95, 49, 8, 0.62);
  box-shadow: 0 0 38px rgba(255, 190, 74, 0.72);
  opacity: 0;
}

.completion-fx.active .completion-stamp {
  animation: stampBang 1.1s ease forwards;
}

.firework {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  box-shadow: 0 0 0 0 rgba(130, 240, 255, 0.8);
}

.completion-fx.active .firework {
  animation: burst 0.9s ease-out forwards;
}

.firework.f1 { left: 34%; top: 42%; }
.firework.f2 { left: 65%; top: 44%; }
.firework.f3 { left: 50%; top: 34%; }

.collect-card h6 {
  margin: 0 0 4px;
  font-size: 0.86rem;
}

.collect-card p {
  margin: 0;
  font-size: 0.75rem;
  color: #b8dcee;
}

@keyframes orbitRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes twinkle {
  from { opacity: 0.52; }
  to { opacity: 1; }
}

@keyframes fogPulse {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

@keyframes warpIn {
  0% {
    opacity: 0;
    transform: scale(1);
    filter: blur(0px);
  }
  20% {
    opacity: 1;
  }
  62% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
    filter: blur(3px);
  }
}

@keyframes whiteoutFlash {
  0% { opacity: 0; }
  35% { opacity: 0.15; }
  55% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes missionPulse {
  from { box-shadow: 0 0 0 1px rgba(255, 215, 120, 0.4), 0 0 14px rgba(255, 209, 91, 0.2); }
  to { box-shadow: 0 0 0 2px rgba(255, 226, 147, 0.56), 0 0 24px rgba(255, 209, 91, 0.55); }
}

@keyframes missionShimmer {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
  100% { filter: brightness(1); }
}

@keyframes pointBlink {
  from { transform: scale(0.95); opacity: 0.72; }
  to { transform: scale(1.1); opacity: 1; }
}

@keyframes magnifyPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.85); }
  100% { transform: scale(1); }
}

@keyframes landShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 1px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-5px, 2px); }
  80% { transform: translate(4px, -2px); }
  100% { transform: translate(0, 0); }
}

@keyframes shutterSnap {
  0% { opacity: 0; }
  35% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes btnCollect {
  0% { transform: scale(1); box-shadow: inset 0 0 12px rgba(82, 227, 255, 0.16), 0 0 18px rgba(82, 227, 255, 0.2); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 2px rgba(111, 255, 150, 0.5), 0 0 24px rgba(111, 255, 150, 0.7); }
  100% { transform: scale(1); }
}

@keyframes loaderScan {
  from { transform: translateX(-130%); }
  to { transform: translateX(260%); }
}

@keyframes holoScan {
  from { transform: translateY(-12px); }
  to { transform: translateY(12px); }
}

@keyframes encyclopediaSparkle {
  from { transform: translateX(-28%) rotate(0deg); opacity: 0; }
  35% { opacity: 1; }
  to { transform: translateX(28%) rotate(0deg); opacity: 0; }
}

@keyframes encyclopediaRecentPulse {
  from { box-shadow: 0 0 0 1px rgba(113, 239, 255, 0.28), 0 0 10px rgba(88, 210, 255, 0.2); }
  to { box-shadow: 0 0 0 2px rgba(113, 239, 255, 0.52), 0 0 18px rgba(88, 210, 255, 0.42); }
}

@keyframes encyclopediaRecentGlow {
  0% { transform: scale(1); }
  40% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

@keyframes stampBang {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(-11deg);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15) rotate(-11deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1) rotate(-11deg);
  }
}

@keyframes burst {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(130, 240, 255, 0.8);
  }
  100% {
    opacity: 0;
    box-shadow: 0 0 0 34px rgba(130, 240, 255, 0);
  }
}

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

@keyframes pingpongHintPulse {
  0% { opacity: 0.74; transform: scale(0.98); }
  55% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.74; transform: scale(0.98); }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 8px;
  }

  .cockpit-topbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .start-briefing-row {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 8px;
  }

  .mega-briefing {
    width: min(94vw, 980px);
    padding: 13px 14px;
  }

  .mega-briefing p,
  .mega-briefing p:first-child {
    font-size: 0.98rem;
  }

  .pingpong-hero {
    justify-self: center;
    transform: translate(0, -8px);
    width: min(84vw, 420px);
    max-height: none;
  }

  .pingpong-hero::after {
    right: 12px;
    bottom: 2px;
    font-size: 0.72rem;
    padding: 5px 8px;
  }

  .pingpong-speech {
    position: static;
    width: 100%;
    margin-top: 8px;
    margin-left: 0;
    padding: 28px 12px 11px;
  }

  .menu-panel {
    transform: none;
  }

  .pingpong-speech::before {
    top: 7px;
  }

  .pingpong-speech {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .mode-buttons {
    grid-template-columns: 1fr;
  }

  .menu-panel h2 {
    font-size: clamp(1.4rem, 6vw, 1.9rem);
  }

  .mode-btn .btn-title {
    font-size: 1.3rem;
  }

  .mode-btn .btn-desc,
  .status-inline {
    font-size: 0.92rem;
  }

  .progress-dash {
    grid-area: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(52px, auto);
    margin-top: 0;
  }

  .mode-stack {
    grid-area: auto;
  }

  .explore-pingpong {
    position: static;
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 8px;
  }

  .explore-pingpong img {
    width: 78px;
    height: 78px;
  }

  .explore-pingpong p {
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 10px;
  }

  .explore-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: none;
  }

  .mission-stage {
    grid-template-columns: 1fr;
  }

  .mission-pingpong img {
    width: 120px;
    height: 120px;
  }

  .explore-header {
    display: grid;
    gap: 8px;
  }

  .point-detail img {
    height: 110px;
  }

  .planet.explored::after {
    display: none;
  }

  .encyclopedia-panel {
    inset: 8px;
    padding: 10px;
    grid-template-rows: auto auto auto 1fr;
  }

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

  .enc-planet-card img {
    height: 88px;
  }

  .encyclopedia-detail-hero {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .encyclopedia-detail-hero img {
    max-height: 120px;
  }

  .encyclopedia-detail-entries {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .pingpong-speech {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
