@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-condensed-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-condensed-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/barlow-condensed-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/barlow-condensed-900-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-500-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-500-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter-500-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/inter-500-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, sans-serif;
  background: #050a12;
  color: #f6fbff;
  --cyan: #63e6ff;
  --ember: #ff4e2f;
  --ink: #07101d;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  min-width: 320px;
  overflow-x: hidden;
  background: #050a12;
}

button { font: inherit; }

.game-shell {
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 70% 18%, rgba(85, 178, 255, .3), transparent 25%),
    linear-gradient(180deg, #071223 0%, #0a1725 51%, #05070c 100%);
}

.game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 6, 12, .88) 0%, rgba(2, 6, 12, .5) 48%, rgba(2, 6, 12, .2) 100%);
}

.scene { position: absolute; inset: 0; z-index: -2; }

.moon {
  position: absolute;
  right: 12%; top: 8%; width: min(36vw, 420px); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff 0 4%, #c9eeff 38%, #87bdd5 62%, #59879f 100%);
  box-shadow: 0 0 65px rgba(125, 211, 252, .38);
  opacity: .9;
}

.castle {
  position: absolute;
  right: 19%; top: 25%;
  font-size: clamp(10rem, 26vw, 24rem);
  color: #02050a;
  text-shadow: 0 20px 40px #000;
  transform: scaleX(.72);
}

.fog { position: absolute; left: -10%; width: 120%; height: 16%; filter: blur(16px); opacity: .48; background: linear-gradient(90deg, transparent, #91bed0, transparent); }
.fog--one { bottom: 15%; transform: rotate(-2deg); }
.fog--two { bottom: 1%; transform: rotate(2deg); opacity: .3; }

.age-screen {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 500px);
  gap: clamp(2rem, 7vw, 8rem);
  align-items: center;
  padding: clamp(1.25rem, 4vw, 4rem) clamp(1.25rem, 6vw, 6rem);
}

.brand-kicker, .eyebrow {
  display: block;
  color: var(--cyan);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: .16em;
  font-size: .85rem;
}

.brand-lockup h1 {
  margin: .5rem 0 0;
  max-width: 8ch;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(4rem, 9vw, 8rem);
  line-height: .76;
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-shadow: 0 8px 30px #000;
}

.brand-lockup h1 span { color: #d9f6ff; }
.brand-lockup h1 em { display: block; color: var(--ember); font-style: normal; }
.brand-lockup p { margin: 1.4rem 0 0; color: #c6d9e4; font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 700; }

.age-card {
  width: 100%;
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border: 1px solid rgba(125, 211, 252, .35);
  background: linear-gradient(145deg, rgba(10, 22, 37, .94), rgba(5, 10, 18, .9));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
  border-radius: 1rem;
}

.age-card h2 { margin: .45rem 0 .6rem; font: 800 clamp(2.2rem, 5vw, 3.6rem)/.95 "Barlow Condensed", sans-serif; text-transform: uppercase; }
.age-card > p { color: #a9bdc9; line-height: 1.55; }

.age-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: 1.5rem; }
.age-grid button {
  min-height: 4.4rem;
  border: 1px solid rgba(99, 230, 255, .25);
  border-radius: .7rem;
  color: #e9fbff;
  background: linear-gradient(180deg, #152a3b, #0b1724);
  font: 800 1.35rem "Barlow Condensed", sans-serif;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.age-grid button:hover, .age-grid button:focus-visible { transform: translateY(-3px); border-color: var(--cyan); background: linear-gradient(180deg, #1c4152, #0c2230); outline: none; }
.age-grid button:active { transform: translateY(0) scale(.98); }
.age-card .privacy-note { margin: 1rem 0 0; color: #718a9a; font-size: .78rem; }

@media (max-width: 780px) {
  .age-screen { grid-template-columns: 1fr; align-content: center; gap: 2.2rem; }
  .brand-lockup h1 { font-size: clamp(3.7rem, 18vw, 6rem); }
  .brand-lockup p { margin-top: 1rem; }
  .moon { right: -8%; width: 65vw; }
  .castle { right: -5%; top: 28%; font-size: 16rem; opacity: .62; }
}

@media (max-width: 430px) {
  .age-screen { padding: 1.2rem; }
  .age-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-lockup h1 { font-size: 3.9rem; }
}

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

/* Full game shell */
[hidden] { display: none !important; }

.screen { min-height: 100svh; position: relative; }

.scene {
  position: fixed;
  background:
    linear-gradient(90deg, rgba(2, 6, 12, .72), rgba(2, 6, 12, .08) 70%),
    url("../images/monster-math-battlefield.png") center / cover no-repeat;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 55% 38%, transparent 10%, rgba(0, 4, 10, .12) 54%, rgba(0, 2, 8, .82) 110%),
    linear-gradient(180deg, rgba(2, 6, 12, .08), rgba(2, 6, 12, .35));
}

.glass-card {
  border: 1px solid rgba(135, 219, 255, .24);
  background: linear-gradient(145deg, rgba(11, 24, 39, .94), rgba(4, 9, 16, .92));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .58), inset 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px);
  border-radius: 1rem;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  background: radial-gradient(circle, #13293b, #050912 62%);
  transition: opacity .4s ease, visibility .4s ease;
}

.splash.is-done { opacity: 0; visibility: hidden; }
.splash-mark {
  display: grid;
  place-items: center;
  width: 7rem;
  aspect-ratio: 1;
  border: 2px solid var(--cyan);
  border-radius: 1.2rem;
  color: #e9fbff;
  font: 900 4rem/1 "Barlow Condensed", sans-serif;
  box-shadow: 0 0 3rem rgba(99, 230, 255, .28), inset 0 0 2rem rgba(99, 230, 255, .12);
}
.splash-mark span { color: var(--ember); }
.splash p { margin: 0; color: #9cb9c9; letter-spacing: .22em; font: 800 .9rem "Barlow Condensed", sans-serif; }

.topbar {
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgba(132, 206, 239, .16);
  background: linear-gradient(180deg, rgba(3, 8, 15, .94), rgba(3, 8, 15, .72));
  backdrop-filter: blur(16px);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  border: 0;
  padding: 0;
  color: #eafaff;
  background: none;
  cursor: pointer;
  font: 800 .95rem "Barlow Condensed", sans-serif;
  letter-spacing: .08em;
}
.mini-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  border: 1px solid rgba(99, 230, 255, .65);
  border-radius: .4rem;
  color: var(--cyan);
  box-shadow: inset 0 0 1rem rgba(99, 230, 255, .12);
}
.topbar-stats { display: flex; align-items: center; gap: .7rem; }
.topbar-stats > span {
  display: inline-flex;
  align-items: baseline;
  gap: .22rem;
  min-height: 2.3rem;
  padding: .5rem .75rem;
  border: 1px solid rgba(141, 205, 231, .16);
  border-radius: .45rem;
  background: rgba(8, 18, 29, .82);
  font: 700 .9rem "Barlow Condensed", sans-serif;
}
.topbar-stats small { color: #708b9a; font-size: .75rem; }
.topbar-stats b { color: #dff9ff; }
.topbar-stats .coin-stat i { color: #ffb33b; font-style: normal; }

.primary-button,
.secondary-button,
.danger-button {
  min-height: 3.6rem;
  border-radius: .5rem;
  padding: .8rem 1.3rem;
  font: 800 1.05rem "Barlow Condensed", sans-serif;
  letter-spacing: .05em;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 1px solid #8df0ff;
  color: #021018;
  background: linear-gradient(135deg, #a5f6ff, #48cce8);
  box-shadow: 0 0 1.8rem rgba(78, 217, 241, .25), inset 0 1px rgba(255, 255, 255, .65);
}
.primary-button i { font-size: 1.8em; font-style: normal; line-height: .5; }
.primary-button--large { min-height: 4.6rem; width: 100%; font-size: 1.35rem; }
.secondary-button { border: 1px solid rgba(123, 216, 250, .35); color: #dbf8ff; background: rgba(11, 28, 43, .82); }
.danger-button { border: 1px solid rgba(255, 86, 66, .42); color: #ff9c8e; background: rgba(73, 18, 19, .3); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover,
.primary-button:focus-visible, .secondary-button:focus-visible, .danger-button:focus-visible { transform: translateY(-2px); filter: brightness(1.12); outline: none; }
.primary-button:active, .secondary-button:active, .danger-button:active { transform: translateY(0) scale(.985); }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; filter: grayscale(.75); opacity: .58; transform: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 0;
  margin: 0 0 2rem;
  padding: .5rem 0;
  color: #b8d9e7;
  background: none;
  font-weight: 700;
  cursor: pointer;
}
.back-link:hover, .back-link:focus-visible { color: var(--cyan); outline: none; }

/* Home */
.home-screen { display: flex; flex-direction: column; justify-content: space-between; padding: 7.4rem clamp(1.2rem, 6vw, 6rem) 0; }
.home-content { display: grid; grid-template-columns: minmax(270px, 1fr) minmax(360px, 500px); gap: clamp(2rem, 8vw, 9rem); align-items: center; margin: auto 0; padding: 2rem 0 3rem; }
.brand-lockup--home h1 { font-size: clamp(4.2rem, 9vw, 8.5rem); }
.mission-card { padding: clamp(1.4rem, 3vw, 2.2rem); }
.mission-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.mission-heading h2 { margin: .35rem 0 0; font: 800 clamp(2.1rem, 4vw, 3.1rem)/.96 "Barlow Condensed", sans-serif; text-transform: uppercase; }
.level-seal { display: grid; place-items: center; width: 4.1rem; aspect-ratio: 1; border: 1px solid rgba(99, 230, 255, .42); border-radius: 50%; color: #7fa1b3; font: 700 .75rem "Barlow Condensed", sans-serif; }
.level-seal b { display: block; color: #e7fbff; font-size: 1.45rem; }
.mission-rule { display: flex; align-items: center; gap: 1rem; margin: 1.8rem 0; padding: 1rem; border: 1px solid rgba(122, 192, 220, .15); border-radius: .65rem; background: rgba(0, 0, 0, .18); }
.mission-rule__number { color: var(--ember); font: 900 3.4rem/1 "Barlow Condensed", sans-serif; }
.mission-rule b, .mission-rule small { display: block; }
.mission-rule b { text-transform: uppercase; font: 800 1.05rem "Barlow Condensed", sans-serif; }
.mission-rule small { margin-top: .2rem; color: #879eac; }
.home-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-top: .8rem; }
.home-actions button { min-height: 3.4rem; border: 1px solid rgba(129, 201, 231, .18); border-radius: .45rem; color: #b6ced9; background: rgba(3, 11, 19, .62); cursor: pointer; font: 700 .82rem "Barlow Condensed", sans-serif; letter-spacing: .04em; }
.home-actions button span { margin-right: .3rem; color: var(--cyan); }
.home-actions button:hover, .home-actions button:focus-visible { color: white; border-color: rgba(99, 230, 255, .55); outline: none; }
.home-footer { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(133, 209, 240, .18); background: rgba(3, 8, 14, .78); margin: 0 calc(clamp(1.2rem, 6vw, 6rem) * -1); padding: 1rem clamp(1.2rem, 6vw, 6rem); backdrop-filter: blur(12px); }
.home-footer > div { display: grid; gap: .25rem; padding: .3rem 1.4rem; border-right: 1px solid rgba(135, 204, 232, .15); }
.home-footer > div:first-child { padding-left: 0; }
.home-footer > div:last-child { border: 0; }
.home-footer span { color: #698594; font: 700 .75rem "Barlow Condensed", sans-serif; letter-spacing: .12em; }
.home-footer b { font: 800 1rem "Barlow Condensed", sans-serif; text-transform: uppercase; }

/* Interior panels */
.panel-screen { padding: 7.8rem clamp(1.2rem, 6vw, 6rem) 3rem; }
.page-heading { max-width: 700px; margin-bottom: 2rem; }
.page-heading .back-link { margin-bottom: 1.4rem; }
.page-heading h2 { margin: .35rem 0 .55rem; font: 900 clamp(2.8rem, 6vw, 5rem)/.9 "Barlow Condensed", sans-serif; text-transform: uppercase; }
.page-heading p { margin: 0; color: #9cb1bd; line-height: 1.6; }

/* Maths */
.math-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(420px, 720px); gap: clamp(1rem, 4vw, 4rem); max-width: 1160px; margin: 0 auto; }
.round-sidebar, .question-card { padding: clamp(1.3rem, 3vw, 2.2rem); }
.round-sidebar h2 { margin: .45rem 0 .65rem; font: 800 clamp(2.2rem, 4vw, 3.2rem)/.95 "Barlow Condensed", sans-serif; text-transform: uppercase; }
.round-sidebar > p { color: #91a9b5; line-height: 1.55; }
.seal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .55rem; margin: 1.8rem 0; }
.seal-grid i { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid rgba(130, 201, 231, .2); border-radius: .45rem; color: #456170; background: rgba(0, 0, 0, .25); font-style: normal; font-weight: 900; }
.seal-grid i.is-lit { color: #031118; border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 1.2rem rgba(99, 230, 255, .4); }
.math-level-card { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: 1rem; border: 1px solid rgba(255, 85, 56, .18); border-radius: .55rem; background: linear-gradient(135deg, rgba(255, 78, 47, .08), transparent); }
.math-level-card span { color: #74909f; font: 700 .7rem "Barlow Condensed", sans-serif; letter-spacing: .1em; }
.math-level-card strong { grid-row: span 2; color: var(--ember); font: 900 1.4rem "Barlow Condensed", sans-serif; }
.math-level-card small { color: #d7eaf2; }
.question-card { position: relative; overflow: hidden; }
.question-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--cyan), transparent); }
.question-topline { display: flex; justify-content: space-between; gap: 1rem; color: #7f9aa8; font: 800 .8rem "Barlow Condensed", sans-serif; letter-spacing: .09em; }
.question-topline b { color: white; }
.question-progress { height: .35rem; overflow: hidden; margin: .75rem 0 2rem; border-radius: 99px; background: #111e28; }
.question-progress i { display: block; width: 10%; height: 100%; transform-origin: left; background: linear-gradient(90deg, var(--cyan), #a3f2ff); box-shadow: 0 0 .8rem var(--cyan); transition: width .3s ease; }
.problem-wrap { min-height: 12rem; display: grid; place-content: center; justify-items: center; }
.problem-label { color: #587584; font: 700 .75rem "Barlow Condensed", sans-serif; letter-spacing: .14em; }
.problem { margin-top: .65rem; text-align: center; font: 900 clamp(3.4rem, 8vw, 6.3rem)/1 "Barlow Condensed", sans-serif; letter-spacing: -.02em; text-shadow: 0 0 2.4rem rgba(99, 230, 255, .1); }
.problem-suffix { min-height: 1.4rem; color: #8ca3af; font-weight: 700; }
.answer-form { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(160px, .72fr); gap: .75rem; }
.answer-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.answer-form input { min-width: 0; height: 4.5rem; border: 1px solid rgba(119, 206, 239, .35); border-radius: .55rem; padding: 0 1rem; color: #eafcff; background: rgba(1, 7, 12, .72); text-align: center; font: 800 2rem "Barlow Condensed", sans-serif; }
.answer-form input:focus { border-color: var(--cyan); outline: 2px solid rgba(99, 230, 255, .15); }
.answer-feedback { min-height: 2rem; padding: .65rem 0 .25rem; color: #90a8b5; font-weight: 700; text-align: center; }
.answer-feedback.is-correct { color: #88f7c7; }
.answer-feedback.is-wrong { color: #ff9a8c; }
.learning-hint { margin: .45rem 0 .8rem; padding: .9rem 1rem; border: 1px solid rgba(255, 198, 82, .35); border-radius: .6rem; background: linear-gradient(135deg, rgba(255, 178, 48, .12), rgba(8, 18, 29, .5)); text-align: left; }
.learning-hint > span { display: flex; align-items: center; gap: .45rem; color: #ffd16d; font: 800 .78rem "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.learning-hint > span i { font-style: normal; }
.learning-hint p { margin: .45rem 0 0; color: #e8f3f6; font-size: .9rem; line-height: 1.5; }
.number-pad { display: none; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .7rem; }
.number-pad button { min-height: 3.4rem; border: 1px solid rgba(127, 199, 226, .18); border-radius: .45rem; color: #deeff6; background: rgba(8, 21, 33, .8); font-weight: 800; }
.number-pad__clear { grid-column: 1 / -1; color: #ff9e91 !important; }

/* Battle unlock */
.unlock-screen { display: grid; place-content: center; overflow: hidden; padding: 2rem; text-align: center; background: radial-gradient(circle, rgba(20, 65, 79, .56), rgba(2, 7, 13, .84) 56%); }
.unlock-content { position: relative; z-index: 2; width: min(620px, 92vw); }
.unlock-check { display: grid; place-items: center; width: 4.8rem; aspect-ratio: 1; margin: 0 auto 1.4rem; border: 2px solid var(--cyan); border-radius: 50%; color: var(--cyan); font-size: 2.5rem; box-shadow: 0 0 2rem rgba(99, 230, 255, .35); }
.unlock-content h2 { margin: .8rem 0; font: 900 clamp(4rem, 13vw, 8rem)/.72 "Barlow Condensed", sans-serif; letter-spacing: -.035em; text-transform: uppercase; text-shadow: 0 0 3rem rgba(87, 221, 255, .22); }
.unlock-content h2 em { color: var(--ember); font-style: normal; }
.unlock-content p { margin: 1.5rem 0 2rem; color: #c0d4dd; }
.unlock-rings, .unlock-rings i { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.unlock-rings i { width: 38vw; min-width: 420px; aspect-ratio: 1; border: 1px solid rgba(99, 230, 255, .14); animation: unlock-pulse 3.2s ease-out infinite; }
.unlock-rings i:nth-child(2) { animation-delay: .9s; }
.unlock-rings i:nth-child(3) { animation-delay: 1.8s; }
@keyframes unlock-pulse { from { opacity: .8; transform: translate(-50%, -50%) scale(.4); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }

/* Battle */
.battle-screen { background: #02060b; overflow: hidden; }
.battle-arena { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: none; user-select: none; background: #06101a url("../images/monster-math-battlefield.png") center / cover no-repeat; }
.battle-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(0, 2, 5, .05), transparent 45%, rgba(0, 2, 7, .72)), radial-gradient(circle at center, transparent 35%, rgba(1, 5, 10, .42)); }
.battle-hud { position: absolute; z-index: 120; inset: 1rem 1rem auto; display: grid; grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr); gap: 1rem; align-items: start; pointer-events: none; }
.battle-stat { max-width: 260px; padding: .75rem 1rem; border: 1px solid rgba(142, 211, 237, .32); border-radius: .5rem; background: rgba(3, 10, 16, .82); backdrop-filter: blur(10px); }
.battle-stat > span { display: flex; justify-content: space-between; color: #9bb5c1; font: 700 .72rem "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.battle-stat > span b { color: white; }
.battle-stat > div { height: .38rem; overflow: hidden; margin-top: .45rem; border-radius: 99px; background: #251113; }
.battle-stat > div i { display: block; width: 100%; height: 100%; transform-origin: left; background: linear-gradient(90deg, #ff4934, #ffb14c); transition: transform .2s ease; }
.battle-stat--targets { justify-self: end; text-align: right; }
.battle-stat--targets b { display: block; color: white; font: 900 1.25rem "Barlow Condensed", sans-serif; }
.battle-level { text-align: center; text-shadow: 0 2px 10px #000; }
.battle-level span, .battle-level b { display: block; }
.battle-level span { color: var(--ember); font: 800 .68rem "Barlow Condensed", sans-serif; letter-spacing: .14em; }
.battle-level b { font: 900 1.2rem "Barlow Condensed", sans-serif; }
.battle-level i { color: var(--cyan); font-style: normal; }
.battle-tip { position: absolute; z-index: 115; top: 5.8rem; left: 50%; transform: translateX(-50%); padding: .55rem 1rem; border-radius: 99px; color: #d3eaf3; background: rgba(1, 7, 12, .68); font-size: .78rem; pointer-events: none; animation: tip-away 4s forwards; white-space: nowrap; }
@keyframes tip-away { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.monster-layer { position: absolute; inset: 0; z-index: 10; }
.monster { position: absolute; width: clamp(8rem, 17vw, 15rem); aspect-ratio: .66; border: 0; padding: 0; transform: translate(-50%, -50%) scale(var(--monster-scale, .5)); transform-origin: center bottom; opacity: var(--monster-opacity, .5); color: white; background: transparent; cursor: none; filter: drop-shadow(0 1rem 1.2rem rgba(0, 0, 0, .72)); will-change: transform, left, top; }
.monster img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.monster-fallback { display: none; place-items: center; width: 100%; height: 100%; border-radius: 45% 45% 35% 35%; color: #ff653f; background: radial-gradient(circle at 50% 28%, #ff663c 0 3%, transparent 4%), linear-gradient(150deg, #1b2732, #05080d); font-size: 4rem; }
.monster--fallback .monster-fallback { display: grid; }
.monster-health { position: absolute; z-index: 3; top: 8%; left: 22%; width: 56%; height: .25rem; overflow: hidden; border-radius: 99px; background: rgba(36, 7, 8, .88); box-shadow: 0 0 0 1px rgba(0, 0, 0, .65); }
.monster-health i { display: block; width: 100%; height: 100%; transform-origin: left; background: #ff5137; transition: transform .15s ease; }
.monster--hit { animation: monster-hit .24s ease; }
.monster--defeated { pointer-events: none; animation: monster-defeat .38s ease forwards; }
@keyframes monster-hit { 50% { filter: brightness(2.4) drop-shadow(0 0 1rem #ff533a); } }
@keyframes monster-defeat { to { opacity: 0; transform: translate(-50%, -65%) scale(calc(var(--monster-scale) * .6)) rotate(8deg); filter: brightness(2) blur(4px); } }
.crosshair { position: absolute; z-index: 130; top: 0; left: 0; width: 0; height: 0; pointer-events: none; transform: translate3d(50vw, 50vh, 0); }
.crosshair::before { content: ""; position: absolute; inset: -.35rem; border: 1px solid rgba(225, 250, 255, .85); border-radius: 50%; box-shadow: 0 0 .5rem rgba(92, 224, 255, .65); }
.crosshair i { position: absolute; background: #ecfbff; box-shadow: 0 0 .4rem var(--cyan); }
.crosshair i:first-child { width: 1.6rem; height: 1px; left: -.8rem; }
.crosshair i:last-child { width: 1px; height: 1.6rem; top: -.8rem; }
.shot-flash { position: absolute; z-index: 125; left: var(--shot-x, 50%); top: var(--shot-y, 50%); width: .5rem; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; opacity: 0; background: white; box-shadow: 0 0 2rem 1rem var(--cyan); }
.battle-shoot .shot-flash { animation: shot-flash .16s ease; }
.battle-shoot .battle-weapon { animation: weapon-kick .18s ease; }
@keyframes shot-flash { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5); } }
@keyframes weapon-kick {
  50% { transform: translateX(calc(-50% + var(--weapon-x, 0px))) translateY(calc(var(--weapon-y, 0px) + 7%)) rotate(var(--weapon-turn, 0deg)) scale(.98); }
}
.battle-weapon { position: absolute; z-index: 100; left: 50%; bottom: -20%; width: min(45vw, 490px); max-height: 73vh; object-fit: contain; transform: translateX(calc(-50% + var(--weapon-x, 0px))) translateY(var(--weapon-y, 0px)) rotate(var(--weapon-turn, 0deg)); transform-origin: center bottom; pointer-events: none; filter: drop-shadow(0 1rem 1.8rem rgba(0, 0, 0, .75)); transition: transform .11s ease-out; }
.weapon-readout { position: absolute; z-index: 121; right: 1.1rem; bottom: 1rem; display: grid; grid-template-columns: auto auto; gap: .2rem .6rem; padding: .7rem .9rem; border: 1px solid rgba(99, 230, 255, .32); border-radius: .45rem; background: rgba(2, 9, 15, .8); pointer-events: none; font: 800 .72rem "Barlow Condensed", sans-serif; }
.weapon-readout span { grid-column: 1 / -1; color: #9cb6c1; }
.weapon-readout i { align-self: center; width: .5rem; aspect-ratio: 1; border-radius: 50%; background: #68ffb2; box-shadow: 0 0 .7rem #68ffb2; }
.weapon-readout b { color: white; }
.battle-hit::after { content: ""; position: absolute; inset: 0; z-index: 150; pointer-events: none; border: 5vw solid rgba(255, 45, 35, .22); animation: damage-flash .35s ease; }
@keyframes damage-flash { to { opacity: 0; border-width: 0; } }

/* Results */
.result-screen { display: grid; place-content: center; text-align: center; }
.result-card { width: min(700px, 92vw); padding: clamp(1.6rem, 4vw, 3rem); }
.result-badge { display: grid; place-items: center; width: 5rem; aspect-ratio: 1; margin: -5.5rem auto 1.2rem; border: 1px solid #ffd470; border-radius: 50%; color: #ffcc5d; background: #132331; box-shadow: 0 0 2.2rem rgba(255, 175, 51, .26); font-size: 2.4rem; }
.result-card h2 { margin: .5rem 0 .3rem; font: 900 clamp(3.5rem, 8vw, 6rem)/.9 "Barlow Condensed", sans-serif; }
.result-subtitle { margin: 0 0 1.8rem; color: #91a8b3; }
.reward-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 1.4rem; border: 1px solid rgba(125, 200, 230, .16); border-radius: .7rem; overflow: hidden; }
.reward-grid > div { padding: 1.1rem .6rem; border-right: 1px solid rgba(125, 200, 230, .15); background: rgba(1, 8, 14, .38); }
.reward-grid > div:last-child { border: 0; }
.reward-grid span, .reward-grid small { display: block; color: #6f8b99; font: 700 .65rem "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.reward-grid strong { display: block; margin: .25rem 0; font: 900 2.2rem "Barlow Condensed", sans-serif; }
.reward-grid .coin-text { color: #ffc75e; }
.unlock-tease { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid rgba(255, 85, 53, .35); border-radius: .5rem; background: rgba(255, 71, 43, .08); }
.unlock-tease span { color: #ff8f78; font: 700 .72rem "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.unlock-tease b { font: 900 1.05rem "Barlow Condensed", sans-serif; text-transform: uppercase; }

/* Blasters */
.blaster-grid { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 1rem; }
.blaster-card { position: relative; overflow: hidden; min-height: 390px; padding: 1.2rem; border: 1px solid rgba(123, 199, 229, .2); border-radius: .8rem; background: linear-gradient(155deg, rgba(15, 33, 48, .96), rgba(4, 10, 17, .96)); box-shadow: 0 20px 45px rgba(0, 0, 0, .3); }
.blaster-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--weapon-glow) 18%, transparent), transparent 38%); }
.blaster-card.is-locked { filter: saturate(.45); }
.blaster-card.is-equipped { border-color: var(--weapon-glow); box-shadow: 0 0 0 1px color-mix(in srgb, var(--weapon-glow) 28%, transparent), 0 20px 55px rgba(0, 0, 0, .35); }
.blaster-card__top { position: relative; display: flex; justify-content: space-between; color: #718d9b; font: 700 .75rem "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.blaster-card__top b { color: var(--weapon-glow); }
.blaster-visual { position: relative; display: grid; place-items: center; height: 150px; margin: .7rem 0; overflow: hidden; color: var(--weapon-glow); font: 900 6rem "Barlow Condensed", sans-serif; text-shadow: 0 0 2rem var(--weapon-glow); }
.blaster-visual::after { content: ""; position: absolute; bottom: 12%; width: 70%; height: 10%; border-radius: 50%; background: var(--weapon-glow); filter: blur(18px); opacity: .22; }
.blaster-visual img { position: relative; z-index: 1; width: auto; max-width: 92%; height: 150px; max-height: 100%; object-fit: contain; filter: drop-shadow(0 0 1rem color-mix(in srgb, var(--weapon-glow) 45%, transparent)); }
.blaster-visual span { display: none; }
.blaster-card h3 { position: relative; margin: 0; font: 900 1.8rem "Barlow Condensed", sans-serif; text-transform: uppercase; }
.blaster-card > p { position: relative; min-height: 2.8rem; color: #859daa; font-size: .82rem; line-height: 1.45; }
.weapon-bars { position: relative; display: grid; gap: .55rem; margin: 1rem 0; }
.weapon-bars span { display: grid; grid-template-columns: 3.2rem 1fr; align-items: center; gap: .5rem; color: #718b98; font: 700 .75rem "Barlow Condensed", sans-serif; }
.weapon-bars i { height: .25rem; border-radius: 99px; background: linear-gradient(90deg, var(--weapon-glow) var(--bar), #1a2831 var(--bar)); }
.blaster-card button { position: relative; width: 100%; }
.blaster-price { color: #ffc65b; }
.level-replay { max-width: 1100px; margin: 2rem auto 0; padding: clamp(1.2rem, 3vw, 2rem); }
.level-replay__heading { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 1.2rem; }
.level-replay__heading h3 { margin: .25rem 0; font: 900 clamp(1.8rem, 4vw, 2.6rem) "Barlow Condensed", sans-serif; text-transform: uppercase; }
.level-replay__heading p { margin: 0; color: #839da9; }
.level-replay__heading > strong { color: var(--world-accent); font: 900 1.3rem "Barlow Condensed", sans-serif; text-align: right; text-transform: uppercase; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.level-choice { min-height: 6.5rem; display: grid; align-content: center; gap: .2rem; border: 1px solid rgba(122, 204, 234, .22); border-radius: .65rem; padding: .8rem; color: #dff8ff; background: rgba(5, 18, 28, .8); text-align: left; cursor: pointer; }
.level-choice span, .level-choice small { color: #718e9b; font: 800 .7rem "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.level-choice b { font: 900 1rem "Barlow Condensed", sans-serif; text-transform: uppercase; }
.level-choice.is-selected { border-color: var(--world-accent); background: color-mix(in srgb, var(--world-accent) 12%, rgba(5, 18, 28, .9)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--world-accent) 25%, transparent), 0 0 1.4rem color-mix(in srgb, var(--world-accent) 13%, transparent); }
.level-choice.is-selected small { color: var(--world-accent); }

/* Progress */
.progress-dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.rank-card { min-height: 230px; display: grid; place-content: center; justify-items: center; padding: 1.4rem; text-align: center; background: linear-gradient(145deg, rgba(12, 42, 54, .96), rgba(3, 11, 18, .96)); }
.rank-card > span { color: #7895a3; font: 700 .72rem "Barlow Condensed", sans-serif; letter-spacing: .1em; }
.rank-card > strong { color: var(--cyan); font: 900 6rem/.92 "Barlow Condensed", sans-serif; text-shadow: 0 0 2rem rgba(99, 230, 255, .26); }
.rank-card > small { color: #cee4ed; font-weight: 700; }
.rank-card--math > strong { color: #ff6e50; text-shadow: 0 0 2rem rgba(255, 78, 47, .24); }
.record-card { grid-column: span 2; display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; }
.record-card > div { display: grid; place-content: center; padding: 1.2rem; border-right: 1px solid rgba(127, 199, 227, .14); border-bottom: 1px solid rgba(127, 199, 227, .14); }
.record-card > div:nth-child(even) { border-right: 0; }
.record-card > div:nth-child(n+3) { border-bottom: 0; }
.record-card span { color: #728e9b; font: 700 .75rem "Barlow Condensed", sans-serif; letter-spacing: .07em; }
.record-card strong { font: 900 2rem "Barlow Condensed", sans-serif; }
.loadout-card { grid-column: span 2; padding: 1.5rem; text-align: center; }
.loadout-weapon { color: var(--cyan); font-size: 4.8rem; text-shadow: 0 0 2rem var(--cyan); }
.loadout-card h3 { margin: 0; font: 900 2rem "Barlow Condensed", sans-serif; text-transform: uppercase; }
.loadout-card p { color: #7f99a6; }

/* Settings */
.settings-card { max-width: 850px; padding: .4rem 1.4rem; }
.setting-row { min-height: 5.6rem; display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid rgba(126, 199, 227, .14); }
.setting-row:last-child { border: 0; }
.setting-row b, .setting-row small { display: block; }
.setting-row b { margin-bottom: .3rem; font-size: 1rem; }
.setting-row small { color: #7994a2; line-height: 1.4; }
.setting-row select { min-width: 8rem; min-height: 3rem; border: 1px solid rgba(123, 203, 234, .3); border-radius: .45rem; padding: 0 .8rem; color: white; background: #0c1e2b; font-weight: 700; }
.toggle { appearance: none; position: relative; width: 3.5rem; height: 2rem; margin: 0; border: 1px solid rgba(116, 185, 211, .35); border-radius: 99px; background: #192a34; cursor: pointer; }
.toggle::before { content: ""; position: absolute; top: .22rem; left: .24rem; width: 1.4rem; aspect-ratio: 1; border-radius: 50%; background: #738d9a; transition: transform .2s ease, background .2s ease; }
.toggle:checked { background: rgba(62, 216, 166, .2); border-color: #5df0bd; }
.toggle:checked::before { transform: translateX(1.45rem); background: #78f5ca; }
.toggle-label { min-width: 2.1rem; color: #708b98; font: 800 .75rem "Barlow Condensed", sans-serif; }
.setting-row--danger { margin-top: .5rem; }

.defeat-dialog { width: min(520px, calc(100vw - 2rem)); border: 1px solid rgba(255, 82, 58, .38); border-radius: 1rem; padding: 0; color: white; background: linear-gradient(145deg, #111f2c, #060b12); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.defeat-dialog::backdrop { background: rgba(0, 3, 8, .78); backdrop-filter: blur(8px); }
.defeat-dialog form { display: grid; gap: .7rem; padding: 2rem; text-align: center; }
.defeat-dialog h2 { margin: .2rem 0; font: 900 3.4rem/.9 "Barlow Condensed", sans-serif; }
.defeat-dialog p { margin: .4rem 0 1rem; color: #93aab5; line-height: 1.55; }
.toast { position: fixed; z-index: 500; left: 50%; bottom: 1.2rem; max-width: calc(100vw - 2rem); transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; padding: .8rem 1.1rem; border: 1px solid rgba(99, 230, 255, .35); border-radius: .5rem; color: #e8faff; background: rgba(3, 13, 21, .94); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); font-weight: 700; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

@media (max-width: 1000px) {
  .blaster-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .progress-dashboard { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .topbar { min-height: 4rem; }
  .home-screen { padding-top: 5.6rem; }
  .home-content { grid-template-columns: 1fr; gap: 2rem; }
  .brand-lockup--home h1 { font-size: clamp(3.8rem, 16vw, 6rem); }
  .mission-card { max-width: 580px; }
  .home-footer { grid-template-columns: 1fr; gap: .5rem; }
  .home-footer > div { padding: .25rem 0; border: 0; grid-template-columns: 9rem 1fr; }
  .math-layout { grid-template-columns: 1fr; }
  .round-sidebar { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; }
  .round-sidebar .back-link, .round-sidebar > p, .seal-grid { grid-column: 1 / -1; }
  .math-level-card { min-width: 180px; align-self: end; }
  .battle-weapon { width: min(64vw, 440px); bottom: -14%; }
}

@media (max-width: 620px) {
  .topbar { padding: .6rem .8rem; }
  .brand-button > span:last-child, .topbar-stats small { display: none; }
  .topbar-stats { gap: .35rem; }
  .topbar-stats > span { min-height: 2.1rem; padding: .4rem .55rem; }
  .panel-screen { padding: 6.4rem 1rem 2rem; }
  .home-screen { padding-inline: 1rem; }
  .home-actions { grid-template-columns: 1fr; }
  .home-footer { margin-inline: -1rem; padding-inline: 1rem; }
  .mission-heading h2 { font-size: 2.1rem; }
  .round-sidebar { display: block; }
  .round-sidebar > p { display: none; }
  .round-sidebar h2 { font-size: 2rem; }
  .math-level-card { display: none; }
  .question-card { padding: 1.1rem; }
  .problem-wrap { min-height: 9rem; }
  .problem { font-size: clamp(3.1rem, 15vw, 4.7rem); }
  .answer-form { grid-template-columns: 1fr; }
  .answer-form input { height: 4rem; }
  .number-pad { display: grid; }
  .unlock-content h2 { font-size: clamp(3.6rem, 19vw, 5.4rem); }
  .battle-hud { inset: .6rem .6rem auto; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .battle-level { display: none; }
  .battle-stat { padding: .6rem .7rem; }
  .battle-stat--targets { width: 100%; }
  .battle-tip { top: 4.7rem; }
  .monster { width: clamp(7rem, 34vw, 11rem); }
  .battle-weapon { width: min(86vw, 400px); bottom: -10%; }
  .weapon-readout { display: none; }
  .crosshair { display: none; }
  .reward-grid { grid-template-columns: 1fr; }
  .reward-grid > div { display: grid; grid-template-columns: 1fr auto; align-items: center; border-right: 0; border-bottom: 1px solid rgba(125, 200, 230, .15); text-align: left; }
  .reward-grid > div:last-child { border-bottom: 0; }
  .reward-grid small { display: none; }
  .reward-grid strong { margin: 0; font-size: 1.8rem; }
  .result-badge { margin-top: -4.6rem; }
  .blaster-grid { grid-template-columns: 1fr; }
  .blaster-card { min-height: 350px; }
  .level-replay__heading { display: block; }
  .level-replay__heading > strong { display: block; margin-top: .8rem; text-align: left; }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-dashboard { grid-template-columns: 1fr 1fr; }
  .rank-card { min-height: 180px; }
  .rank-card > strong { font-size: 4.7rem; }
  .record-card, .loadout-card { grid-column: 1 / -1; }
  .setting-row { grid-template-columns: 1fr auto; }
  .setting-row .toggle-label { display: none; }
}

@media (max-width: 400px) {
  .progress-dashboard { grid-template-columns: 1fr; }
  .record-card, .loadout-card { grid-column: 1; }
  .reward-grid > div { padding: .8rem; }
  .question-topline { font-size: .7rem; }
}
