:root {
  --navy: #071d2b;
  --gold: #f4b222;
  --cream: #fff8e8;
  --paper: #efe1c5;
  box-sizing: border-box;
}
* { box-sizing: inherit; }
html { scroll-behavior: smooth; background: var(--navy); }
body {
  margin: 0;
  color: var(--cream);
  background: radial-gradient(circle at 50% 0, #294f65, transparent 32rem), var(--navy);
  font-family: Manrope, Arial, sans-serif;
}
.page { width: min(1320px, calc(100% - 40px)); margin: auto; }
.topbar {
  width: min(1380px, calc(100% - 40px));
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-inline: auto;
  padding: 9px 0;
  border-bottom: 1px solid #f4b22255;
}
.brand { display: block; width: 190px; flex: 0 0 auto; }
.brand img { display: block; width: 100%; height: auto; border-radius: 7px; }
.missionStatus {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  color: #83c88a;
  background: #46854824;
  border: 1px solid #72b87547;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.missionStatus i { width: 7px; height: 7px; background: #72b875; border-radius: 50%; animation: statusPulse 1.8s ease-in-out infinite; }
.hero { min-height: 440px; display: flex; align-items: center; padding: 60px 0 48px; }
.hero > div { max-width: 820px; }
.eyebrow, .section-head p, .notebook > p, .controls > p, .learning > p { margin: 0; color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: 2.2px; }
.hero h1 { margin: 10px 0 20px; font-family: "Archivo Black", Impact, sans-serif; font-size: clamp(48px, 6vw, 82px); letter-spacing: -3px; line-height: .94; }
.hero h1 span { display: block; color: var(--gold); }
.hero > div > p:not(.eyebrow) { max-width: 620px; color: #bdcbd2; line-height: 1.7; }
.hero a { display: inline-block; margin-top: 18px; padding: 13px 18px; color: var(--navy); background: var(--gold); font-size: 12px; font-weight: 900; text-decoration: none; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); color: var(--navy); background: var(--paper); border-top: 4px solid var(--gold); }
.how > div { display: flex; gap: 14px; padding: 20px 24px; border-right: 1px solid #071d2b22; }
.how b { display: grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; color: white; background: var(--navy); border-radius: 50%; font-size: 9px; }
.how p { margin: 0; color: #647276; font-size: 10px; line-height: 1.5; }
.how strong { display: block; color: var(--navy); font-size: 12px; }
.game-section { padding: 78px 0; }
.section-head { margin-bottom: 24px; }
.section-head h2, .learning h2 { margin: 5px 0 0; font-family: "Archivo Black", Impact, sans-serif; font-size: clamp(28px, 4vw, 44px); }
.game-shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; color: var(--navy); background: var(--paper); border: 1px solid #f4b22288; box-shadow: 0 30px 80px #0005; }
.game-main { min-width: 0; padding: 20px; }
.toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.toolbar small, .toolbar strong { display: block; }
.toolbar small { color: #758388; font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.toolbar > div:first-child > strong { margin-top: 4px; }
.stats { display: flex; gap: 18px; }
.stats div { padding-left: 14px; border-left: 1px solid #071d2b22; }
.stats strong { margin-top: 3px; font-family: "Archivo Black", Impact, sans-serif; font-size: 18px; }
.board-wrap { overflow: auto; background: #071822; border: 7px solid #302820; }
.maze {
  --cols: 21;
  --rows: 15;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(23px, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(23px, 1fr));
  min-width: calc(var(--cols) * 23px);
  aspect-ratio: var(--cols) / var(--rows);
  touch-action: none;
  user-select: none;
}
.wall { background: linear-gradient(90deg, transparent 48%, #0004 50%, transparent 53%), linear-gradient(#ffffff11, transparent), #62594e; border: 1px solid #443d35; }
.path { position: relative; min-width: 0; min-height: 0; padding: 0; color: white; background: #102735; border: 1px solid #c5a65e22; }
.path.clue { background: radial-gradient(circle, #f4b22255, transparent 68%), #18384a; }
.path.done { background: radial-gradient(circle, #5d955855, transparent 68%), #173a3b; }
.path.exit { background: repeating-linear-gradient(90deg, #7b251d 0 5px, #982f23 5px 10px); }
.path > span { position: absolute; inset: 0; display: grid; place-items: center; }
.player { z-index: 2; width: 130%; height: 130%; margin: -15%; background: var(--gold); border: 3px solid white; border-radius: 50%; font-size: clamp(12px, 1.6vw, 21px); box-shadow: 0 4px 10px #0009; }
.clue-mark { color: var(--gold); font-size: clamp(12px, 1.7vw, 22px); animation: pulse 1.8s infinite; }
.check { color: #79ce7b; font-weight: 900; }
.exit-mark { font-size: clamp(5px, .55vw, 8px); font-weight: 900; transform: rotate(-90deg); }
.overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; color: white; background: #071d2be8; text-align: center; backdrop-filter: blur(4px); }
.overlay > span { color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: 2px; }
.overlay h3 { margin: 8px 0; font-family: "Archivo Black", Impact, sans-serif; font-size: clamp(24px, 3vw, 38px); }
.overlay p { max-width: 460px; margin: 0 0 18px; color: #c3d0d5; font-size: 11px; }
.overlay button { min-height: 43px; padding: 0 20px; color: var(--navy); background: var(--gold); border: 0; font-weight: 900; cursor: pointer; }
.finish-actions { display: flex; gap: 10px; }
.finish-actions a { display: inline-flex; min-height: 43px; align-items: center; padding: 0 20px; color: white; border: 1px solid #ffffff7a; text-decoration: none; font-size: 12px; font-weight: 900; }
.finish-actions a:hover, .finish-actions a:focus-visible { color: var(--navy); background: white; outline: none; }
.status { display: grid; grid-template-columns: 24px 1fr 120px; gap: 9px; align-items: center; padding-top: 12px; }
.status > b { display: grid; width: 22px; height: 22px; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-size: 9px; }
.status p { margin: 0; color: #59686d; font-size: 10px; font-weight: 700; }
.status > div { height: 5px; overflow: hidden; background: #071d2b22; }
.status > div i { display: block; width: 0; height: 100%; background: var(--gold); transition: .2s; }
aside { padding: 20px; background: #e4d4b5; border-left: 1px solid #071d2b22; }
.notebook { padding: 18px; background: #fff9e9; border: 1px solid #cabb99; }
.notebook > p, .controls > p { color: #a27316; }
.notebook h3 { margin: 4px 0 14px; font-family: "Archivo Black", Impact, sans-serif; font-size: 18px; }
.notebook ul { margin: 0; padding: 0; list-style: none; }
.notebook li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 9px 0; border-top: 1px dashed #c9b994; opacity: .56; }
.notebook li > b { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #ad9d7c; border-radius: 50%; font-size: 9px; }
.notebook li strong, .notebook li small { display: block; }
.notebook li strong { font-size: 10px; }
.notebook li small { margin-top: 2px; color: #6b777a; font-size: 8px; line-height: 1.4; }
.notebook li.found { opacity: 1; }
.notebook li.found > b { color: white; background: #5b965a; }
.controls { margin-top: 20px; }
.dpad { display: grid; grid-template-columns: repeat(3, 43px); grid-template-rows: repeat(2, 43px); gap: 5px; justify-content: center; margin: 13px 0 9px; }
.dpad button { color: white; background: var(--navy); border: 0; font-size: 19px; cursor: pointer; }
.dpad button:first-child { grid-column: 2; }
.dpad button:nth-child(2) { grid-column: 1; }
.controls > small { display: block; color: #667579; font-size: 8px; text-align: center; }
.hint, .reset { width: 100%; min-height: 40px; margin-top: 11px; border: 1px solid #071d2b33; font-size: 10px; font-weight: 900; cursor: pointer; }
.hint { color: var(--navy); background: var(--gold); }
.hint:disabled { filter: grayscale(1); opacity: .45; }
.reset { margin-top: 6px; color: #526368; background: transparent; }
.learning { padding: 66px 0; border-top: 1px solid #ffffff22; }
.learning > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 25px; }
.learning article { position: relative; min-height: 150px; padding: 23px; color: var(--navy); background: var(--paper); overflow: hidden; }
.learning article > b { position: absolute; right: 10px; top: 0; color: #071d2b11; font-family: "Archivo Black", Impact, sans-serif; font-size: 60px; }
.learning h3 { position: relative; margin: 35px 0 6px; }
.learning article p { position: relative; margin: 0; color: #68767b; font-size: 11px; }
footer { min-height: 100px; display: flex; align-items: center; justify-content: space-between; color: #91a5ae; border-top: 1px solid #ffffff22; font-size: 10px; }
footer strong { color: var(--gold); letter-spacing: 1px; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: #030e16dd; backdrop-filter: blur(5px); }
.modal[hidden] { display: none; }
.modal > section { width: min(600px, 100%); padding: 30px; color: var(--navy); background: var(--cream); border: 5px solid var(--gold); box-shadow: 0 30px 80px #0009; }
.question-icon { display: grid; width: 50px; height: 50px; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-size: 24px; }
.modal section > p:first-of-type { margin: 15px 0 0; color: #a57414; font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.modal h2 { margin: 7px 0 18px; font-family: "Archivo Black", Impact, sans-serif; font-size: clamp(21px, 4vw, 31px); }
.answers { display: grid; gap: 7px; }
.answers button { display: flex; align-items: center; gap: 10px; min-height: 47px; padding: 7px 12px; color: var(--navy); background: white; border: 1px solid #d1c3a7; cursor: pointer; text-align: left; font-weight: 800; }
.answers button > b { display: grid; width: 27px; height: 27px; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-size: 9px; }
.answers button.correct { color: white; background: #4d8a51; }
.answer-feedback { padding: 10px !important; color: #852a25 !important; background: #f5ded8; font-size: 10px !important; font-weight: 800; }
.continue { min-height: 39px; padding: 0 14px; color: white; background: #477d4b; border: 0; font-weight: 900; cursor: pointer; }
@keyframes pulse { 50% { transform: scale(1.2); } }
@keyframes statusPulse { 50% { opacity: .35; } }
@media (max-width: 1000px) {
  .game-shell { grid-template-columns: 1fr; }
  aside { display: grid; grid-template-columns: 1fr 260px; gap: 20px; border-left: 0; }
  .controls { margin-top: 0; }
}
@media (max-width: 700px) {
  .page { width: min(100% - 24px, 1320px); }
  .topbar { min-height: 90px; gap: 8px; padding-block: 7px; }
  .brand { width: 150px; }
  .missionStatus { width: 11px; height: 11px; overflow: hidden; padding: 0; border: 0; font-size: 0; }
  .missionStatus i { flex: 0 0 auto; }
  .hero { min-height: auto; padding: 38px 0; }
  .hero h1 { font-size: clamp(42px, 13vw, 64px); }
  .how { grid-template-columns: 1fr; }
  .how > div { padding: 14px 16px; }
  .game-section { padding: 55px 0; }
  .game-main { padding: 9px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .stats { width: 100%; justify-content: space-between; gap: 2px; }
  .stats div { padding-left: 7px; }
  .stats strong { font-size: 14px; }
  .maze { grid-template-columns: repeat(var(--cols), minmax(14px, 1fr)); grid-template-rows: repeat(var(--rows), minmax(14px, 1fr)); min-width: calc(var(--cols) * 14px); }
  .status { grid-template-columns: 22px 1fr; }
  .status > div { grid-column: 1 / -1; }
  aside { display: block; padding: 13px; }
  .controls { margin-top: 20px; }
  .learning > div { grid-template-columns: 1fr; }
  .learning article { min-height: 130px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
  .modal > section { padding: 21px 16px; border-width: 4px; }
  .finish-actions { width: min(260px, 100%); flex-direction: column; }
  .finish-actions a { justify-content: center; }
}
