@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Manrope:wght@400;500;600;700;800;900&display=swap");

* { box-sizing: border-box; }
html { min-width: 320px; background: #efe8d8; }
body { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }

.page {
  --navy: #082d48;
  --navy-deep: #041d31;
  --gold: #f3b51b;
  --gold-deep: #d79108;
  --cream: #fbf5e7;
  --paper: #fffdf7;
  --ink: #163247;
  --muted: #61727d;
  --line: rgba(8, 45, 72, 0.16);
  --green: #2f8a59;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(8, 45, 72, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 45, 72, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 8% 8%, rgba(243, 181, 27, 0.22), transparent 25rem),
    #efe8d8;
  background-size: 28px 28px, 28px 28px, auto, auto;
  font-family: "Manrope", Arial, sans-serif;
}

.topbar,
.hero,
.gameShell,
.feedbackBar,
.learning,
.footer {
  width: min(1460px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  width: min(1380px, calc(100% - 40px));
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  width: 190px;
  flex: 0 0 auto;
  color: var(--navy);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
}

.missionStatus {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  color: #356e3c;
  background: rgba(70, 133, 72, 0.1);
  border: 1px solid rgba(70, 133, 72, 0.28);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.missionStatus i { width: 7px; height: 7px; background: #54a65c; border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }

.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 38px;
  align-items: center;
  padding-block: 46px;
}

.hero > div > p,
.panelHeading p,
.learning > div > p {
  margin: 0;
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.2px;
}

.hero h1 {
  margin: 8px 0 14px;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(56px, 7vw, 98px);
  letter-spacing: -4px;
  line-height: 0.92;
  text-transform: uppercase;
}

.hero h1 span {
  display: block;
  color: var(--gold);
  text-shadow: -2px -2px 0 var(--navy), 2px -2px 0 var(--navy), -2px 2px 0 var(--navy), 2px 2px 0 var(--navy);
}

.hero > div > strong { display: block; max-width: 720px; color: var(--muted); font-size: 16px; line-height: 1.65; }

.hero aside {
  display: flex;
  gap: 18px;
  padding: 26px;
  color: white;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 12px 12px 0 rgba(243, 181, 27, 0.55);
  transform: rotate(1deg);
}

.hero aside > span { display: grid; width: 55px; height: 55px; place-items: center; flex: 0 0 auto; color: var(--navy); background: var(--gold); border-radius: 50%; font-size: 30px; }
.hero aside b { color: var(--gold); font-size: 10px; letter-spacing: 1.5px; }
.hero aside p { margin: 6px 0 0; color: rgba(255, 255, 255, 0.8); font-size: 13px; line-height: 1.55; }

.panelHeading { display: flex; align-items: center; gap: 12px; }
.step { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--navy); border-radius: 50%; font-size: 10px; font-weight: 900; }
.panelHeading h2,
.learning h2 { margin: 3px 0 0; font-family: "Archivo Black", Impact, sans-serif; letter-spacing: -0.7px; }

.hintButton,
.successOverlay button,
.successOverlay a {
  min-height: 48px;
  padding: 0 18px;
  color: var(--navy);
  background: var(--gold);
  border: 1px solid var(--gold-deep);
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  transition: 160ms ease;
}

.hintButton:hover,
.hintButton:focus-visible { color: white; background: var(--navy); border-color: var(--navy); outline: none; }
.hintButton:disabled { cursor: not-allowed; opacity: 0.45; }

.gameShell { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 24px; }
.targetPanel,
.sceneCard,
.feedbackBar,
.learning { background: rgba(255, 253, 247, 0.96); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(8, 45, 72, 0.1); }

.targetPanel { padding: 20px; }
.panelHeading h2 { font-size: 20px; }
.targetPanel ol { display: grid; gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
.targetPanel li { display: grid; grid-template-columns: 31px 1fr; gap: 9px; align-items: start; padding: 10px; background: #f4eddf; border-left: 3px solid var(--gold); transition: 180ms ease; }
.targetPanel li > span { display: grid; width: 27px; height: 27px; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-size: 8px; font-weight: 900; }
.targetPanel li b { color: var(--navy); font-size: 10px; }
.targetPanel li p { margin: 3px 0 0; color: #526570; font-size: 9px; line-height: 1.38; }
.targetPanel .foundItem { background: rgba(47, 138, 89, 0.1); border-left-color: var(--green); }
.targetPanel .foundItem > span { background: var(--green); }
.targetPanel .foundItem b,
.targetPanel .foundItem p { text-decoration: line-through; opacity: 0.62; }
.hintButton { width: 100%; background: transparent; border-color: rgba(8, 45, 72, 0.28); }

.sceneCard { position: relative; min-width: 0; padding: 18px; }
.statsBar { display: flex; align-items: center; gap: 17px; min-height: 56px; margin-bottom: 14px; padding: 8px 12px; color: white; background: var(--navy); }
.statsBar div span,
.statsBar div strong { display: block; }
.statsBar div span { margin-bottom: 3px; color: rgba(255, 255, 255, 0.62); font-size: 8px; font-weight: 900; letter-spacing: 1.25px; }
.statsBar div strong { color: var(--gold); font-family: "Archivo Black", Impact, sans-serif; font-size: 19px; }
.statsBar > i { width: 1px; height: 31px; background: rgba(255, 255, 255, 0.18); }
.statsBar button { min-height: 38px; padding: 0 11px; color: white; background: transparent; border: 1px solid rgba(255, 255, 255, 0.26); border-radius: 2px; cursor: pointer; font-size: 10px; }
.statsBar button:first-of-type { margin-left: auto; }
.statsBar button:hover,
.statsBar button:focus-visible { color: var(--navy); background: white; outline: none; }
.statsBar .toolActive { color: var(--navy); background: var(--gold); border-color: var(--gold); }

.sceneViewport { width: 100%; overflow: hidden; background: var(--navy-deep); border: 6px solid var(--navy); box-shadow: 0 16px 36px rgba(8, 45, 72, 0.22); }
.sceneStage { position: relative; width: 100%; aspect-ratio: 3 / 2; min-width: 0; cursor: crosshair; touch-action: none; }
.sceneStage > img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; -webkit-user-drag: none; }

.foundMark { position: absolute; z-index: 3; display: grid; justify-items: center; pointer-events: none; transform: translate(-50%, -50%); }
.foundMark > span { display: grid; width: 32px; height: 32px; place-items: center; color: white; background: var(--green); border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 5px rgba(47, 138, 89, 0.72); font-size: 16px; }
.foundMark > b { margin-top: 8px; padding: 4px 7px; color: white; background: var(--navy); border-radius: 2px; font-size: 8px; white-space: nowrap; }

.wrongMarker { position: absolute; z-index: 5; display: grid; width: 35px; height: 35px; place-items: center; pointer-events: none; color: white; background: #b84135; border: 3px solid white; border-radius: 50%; font-family: "Archivo Black", Impact, sans-serif; transform: translate(-50%, -50%); animation: wrong 700ms ease both; }

.successOverlay { position: absolute; inset: 88px 18px 18px; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; color: white; background: rgba(4, 29, 49, 0.9); text-align: center; backdrop-filter: blur(5px); }
.successOverlay > span { width: 64px; height: 64px; display: grid; place-items: center; color: var(--navy); background: var(--gold); border: 4px solid white; border-radius: 50%; font-size: 31px; }
.successOverlay h2 { margin: 14px 0 6px; font-family: "Archivo Black", Impact, sans-serif; font-size: clamp(26px, 4vw, 44px); }
.successOverlay > p { margin: 14px 0 0; color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: 2.2px; }
.successOverlay > strong { font-size: 14px; }
.successOverlay > small { max-width: 640px; margin-top: 12px; color: rgba(255, 255, 255, 0.72); font-size: 11px; line-height: 1.55; }
.successActions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.successActions button,
.successActions a { display: inline-flex; align-items: center; justify-content: center; margin: 0; }
.successActions a { color: white; background: transparent; border-color: rgba(255, 255, 255, 0.62); }
.successActions button:hover,
.successActions button:focus-visible,
.successActions a:hover,
.successActions a:focus-visible { color: var(--navy); background: white; border-color: white; outline: none; }

.feedbackBar { display: grid; grid-template-columns: 42px 1fr 210px; gap: 14px; align-items: center; margin-top: 20px; padding: 16px 18px; }
.feedbackBar > span { display: grid; width: 40px; height: 40px; place-items: center; color: var(--navy); background: var(--gold); border-radius: 50%; font-size: 22px; }
.feedbackBar p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.feedbackBar > div { display: grid; grid-template-columns: 35px 1fr; gap: 8px; align-items: center; }
.feedbackBar > div > b { color: var(--navy); font-size: 10px; }
.feedbackBar > div > i { height: 7px; overflow: hidden; background: #e7decd; border-radius: 10px; }
.feedbackBar > div > i > span { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width 220ms ease; }

.learning { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; margin-top: 24px; padding: 26px; }
.learning h2 { font-size: 24px; }
.learning ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.learning li { display: flex; gap: 10px; padding: 14px; background: #f4eddf; }
.learning li > b { color: var(--gold-deep); font-family: "Archivo Black", Impact, sans-serif; }
.learning li strong,
.learning li span { display: block; }
.learning li strong { margin-bottom: 4px; color: var(--navy); font-size: 11px; }
.learning li span { color: var(--muted); font-size: 9px; line-height: 1.45; }

.magnifier { --lens-center: 88px; position: fixed; z-index: 50; display: none; box-sizing: border-box; width: 190px; height: 190px; overflow: visible; pointer-events: none; background-color: white; background-repeat: no-repeat; background-clip: padding-box; border: 7px solid var(--gold, #f3b51b); border-radius: 50%; box-shadow: 0 0 0 4px white, 0 14px 38px rgba(4, 29, 49, 0.38); transform: translate(-50%, -50%); }
.magnifier.visible { display: block; }

.footer { min-height: 110px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.footer span { font-weight: 900; letter-spacing: 1.5px; }
.footer p { margin: 0; font-style: italic; }

@keyframes wrong { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 35% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); } }
@keyframes pulse { 50% { opacity: 0.35; } }

@media (max-width: 1120px) {
  .gameShell { grid-template-columns: 1fr; }
  .targetPanel ol { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero aside { transform: none; }
  .learning { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar,
  .hero,
  .gameShell,
  .feedbackBar,
  .learning,
  .footer { width: min(100% - 22px, 1460px); }
  .topbar { min-height: 90px; gap: 8px; padding-block: 7px; }
  .brand { width: 150px; }
  .missionStatus { width: 11px; height: 11px; padding: 0; overflow: hidden; border: 0; background: transparent; }
  .missionStatus i { width: 10px; height: 10px; }
  .hero { gap: 25px; padding-block: 38px 30px; }
  .hero h1 { font-size: clamp(48px, 17vw, 69px); letter-spacing: -3px; }
  .hero > div > strong { font-size: 13px; }
  .hero aside { padding: 18px; }
  .targetPanel,
  .sceneCard,
  .learning { padding: 12px; }
  .targetPanel ol { grid-template-columns: 1fr; }
  .statsBar { gap: 8px; padding: 7px; }
  .statsBar > i { display: none; }
  .statsBar div span { font-size: 6px; letter-spacing: 0.7px; }
  .statsBar div strong { font-size: 14px; }
  .statsBar button { min-height: 34px; padding: 0 8px; font-size: 8px; }
  .statsBar button:last-child { width: 34px; padding: 0; font-size: 16px; }
  .statsBar button:last-child span { display: none; }
  .sceneViewport { border-width: 4px; }
  .successOverlay { inset: 77px 12px 12px; justify-content: flex-start; overflow-y: auto; padding: 14px; }
  .successOverlay > span { width: 48px; height: 48px; font-size: 24px; }
  .successOverlay h2 { margin-top: 8px; }
  .successOverlay > p { margin-top: 8px; }
  .successOverlay > small { margin-top: 7px; }
  .successActions { width: 100%; gap: 6px; margin-top: 10px; }
  .successActions button,
  .successActions a { min-height: 40px; flex: 1; padding-inline: 8px; font-size: 9px; }
  .magnifier { --lens-center: 65px; width: 140px; height: 140px; border-width: 5px; }
  .feedbackBar { grid-template-columns: 34px 1fr; padding: 12px; }
  .feedbackBar > span { width: 32px; height: 32px; font-size: 17px; }
  .feedbackBar p { font-size: 10px; }
  .feedbackBar > div { grid-column: 1 / -1; }
  .learning ul { grid-template-columns: 1fr; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .page *,
  .page *::before,
  .page *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
