:root {
  color-scheme: light;
  --ink: #18322e;
  --ink-soft: #5a6f6a;
  --forest: #173b35;
  --forest-light: #24594f;
  --cream: #fffaf0;
  --paper: #f4f5ed;
  --white: #ffffff;
  --line: #dbe3da;
  --yellow: #ffcf5a;
  --yellow-pale: #fff4c7;
  --coral: #ff795f;
  --coral-dark: #d94d3b;
  --coral-pale: #fff0ec;
  --blue: #4d80d8;
  --blue-pale: #eaf1ff;
  --mint: #57b99f;
  --mint-pale: #e6f8f2;
  --violet: #8a69c8;
  --violet-pale: #f1ebff;
  --danger: #b33b45;
  --shadow: 0 20px 55px rgba(31, 60, 52, 0.13);
  --shadow-soft: 0 9px 28px rgba(31, 60, 52, 0.09);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --focus: 0 0 0 4px rgba(77, 128, 216, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 6% 9%, rgba(255, 207, 90, 0.18), transparent 24rem),
    radial-gradient(circle at 95% 18%, rgba(87, 185, 159, 0.13), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--forest-light);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--white);
  color: var(--forest);
  font-weight: 900;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 88px;
  padding: 12px clamp(20px, 4vw, 68px);
  border-bottom: 1px solid rgba(219, 227, 218, 0.92);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--forest);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
}

.brand-tile {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 3px solid var(--forest);
  border-radius: 13px;
  background: var(--yellow);
  font-size: 24px;
  font-weight: 1000;
  box-shadow: 4px 4px 0 rgba(23, 59, 53, 0.16);
  transform: rotate(-3deg);
}

.brand-spark {
  position: absolute;
  z-index: 2;
  top: -7px;
  right: -6px;
  color: var(--coral);
  font-size: 24px;
  text-shadow: 0 2px 0 var(--white);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.02;
}

.brand-copy strong {
  font-size: 22px;
  letter-spacing: -0.04em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--coral-dark);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 17px;
  background: #edf1ea;
}

.nav-button {
  min-height: 48px;
  padding: 9px 17px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
}

.nav-button:hover,
.nav-button.is-active {
  color: var(--forest);
}

.nav-button.is-active {
  background: var(--white);
  box-shadow: 0 3px 12px rgba(23, 59, 53, 0.1);
}

.header-progress {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.spark-total {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 47px;
  padding: 8px 15px;
  border: 1px solid #e7cc72;
  border-radius: 999px;
  background: var(--yellow-pale);
  color: #70550d;
}

.spark-total span {
  color: #d99000;
  font-size: 21px;
}

.name-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
}

.name-button > span:first-child {
  font-size: 26px;
}

.name-button span:nth-child(2) {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.name-button small {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.name-button strong {
  max-width: 115px;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  min-height: calc(100vh - 180px);
}

.app-view {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 66px) 0 86px;
}

.app-view[hidden] {
  display: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--forest);
  line-height: 1.12;
}

h1 {
  font-size: clamp(42px, 6vw, 74px);
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(29px, 3.5vw, 42px);
  letter-spacing: -0.04em;
}

h3 {
  font-size: 23px;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--coral-dark);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  overflow: hidden;
  padding: clamp(34px, 6vw, 76px);
  border-radius: var(--radius-xl);
  background: var(--forest);
  box-shadow: var(--shadow);
  color: #eaf7f2;
}

.hero-card::before {
  position: absolute;
  width: 280px;
  height: 280px;
  border: 44px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
  content: "";
  top: -140px;
  right: 28%;
}

.hero-copy,
.hero-model {
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow {
  color: var(--yellow);
}

.hero-copy h1 {
  max-width: 720px;
  margin-bottom: 22px;
  color: var(--white);
}

.hero-copy h1 em {
  color: var(--yellow);
  font-style: normal;
}

.hero-intro {
  max-width: 660px;
  color: #d1e5df;
  font-size: clamp(19px, 2vw, 23px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button,
.text-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.primary-button {
  padding: 12px 20px;
  border: 2px solid var(--yellow);
  background: var(--yellow);
  color: var(--forest);
  box-shadow: 0 5px 0 #c48f10;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 0 #c48f10;
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c48f10;
}

.secondary-button {
  padding: 12px 20px;
  border: 2px solid var(--forest);
  background: var(--white);
  color: var(--forest);
}

.hero-card .secondary-button {
  border-color: rgba(255, 255, 255, 0.48);
  background: transparent;
  color: var(--white);
}

.text-button {
  min-height: 44px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--forest-light);
}

.promise-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin: 28px 0 0;
  padding: 0;
  color: #c7ddd6;
  font-size: 15px;
  font-weight: 750;
  list-style: none;
}

.promise-list li::before {
  margin-right: 7px;
  color: var(--mint);
  content: "✓";
}

.hero-model {
  justify-self: center;
  width: min(100%, 420px);
  padding: 27px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.09);
  transform: rotate(2deg);
}

.model-note {
  width: fit-content;
  margin: 0 auto 13px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--coral);
  color: var(--forest);
  font-size: 14px;
  font-weight: 1000;
  transform: rotate(-4deg);
}

.seat-array {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: clamp(5px, 0.8vw, 9px);
  max-width: 330px;
  margin: 0 auto;
}

.seat-array span {
  aspect-ratio: 1;
  border: 2px solid rgba(23, 59, 53, 0.5);
  border-radius: 7px 7px 11px 11px;
  background: var(--yellow);
  box-shadow: inset 0 -4px 0 rgba(154, 104, 0, 0.23);
}

.model-equation {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.model-equation strong {
  color: var(--yellow);
  font-size: clamp(25px, 3vw, 34px);
}

.model-equation span {
  color: #cae1da;
  font-size: 14px;
  font-weight: 800;
}

.today-panel,
.world-preview,
.learning-loop {
  margin-top: clamp(54px, 8vw, 94px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h2,
.section-heading p:last-child {
  margin-bottom: 0;
}

.centered-heading {
  display: block;
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.time-pill {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.next-quest-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: clamp(21px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.quest-icon,
.world-icon {
  display: grid;
  place-items: center;
  border-radius: 22px;
  font-size: 38px;
}

.quest-icon {
  width: 72px;
  height: 72px;
}

.next-quest-copy h3 {
  margin: 3px 0 7px;
  font-size: 27px;
}

.next-quest-copy p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.quest-code {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.world-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
}

.world-card {
  position: relative;
  overflow: hidden;
  min-height: 278px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.world-card:hover {
  border-color: var(--world-color);
  transform: translateY(-2px);
}

.world-card::after {
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 120px;
  height: 120px;
  border: 20px solid var(--world-pale);
  border-radius: 50%;
  content: "";
}

.world-card .world-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  background: var(--world-pale);
}

.world-card-title {
  display: block;
  margin-bottom: 9px;
  color: var(--forest);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.world-card-description {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: 16px;
}

.world-progress-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--world-color);
  font-size: 14px;
  font-weight: 900;
}

.world-card[data-world="groups"],
.world-section[data-world="groups"] {
  --world-color: var(--coral-dark);
  --world-pale: var(--coral-pale);
}

.world-card[data-world="money"],
.world-section[data-world="money"] {
  --world-color: #806000;
  --world-pale: var(--yellow-pale);
}

.world-card[data-world="time"],
.world-section[data-world="time"] {
  --world-color: #286f60;
  --world-pale: var(--mint-pale);
}

.world-card[data-world="geometry"],
.world-section[data-world="geometry"] {
  --world-color: #66479e;
  --world-pale: var(--violet-pale);
}

.loop-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.loop-steps li {
  padding: 25px 21px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.loop-steps li > span {
  display: block;
  margin-bottom: 11px;
  font-size: 34px;
}

.loop-steps strong {
  display: block;
  color: var(--forest);
  font-size: 19px;
}

.loop-steps p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.view-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  padding: clamp(30px, 5vw, 58px);
  border-radius: var(--radius-xl);
  background: var(--cream);
  box-shadow: inset 0 0 0 1px #eee4cf;
}

.view-hero h1 {
  margin-bottom: 15px;
  font-size: clamp(40px, 5vw, 62px);
}

.view-hero p:last-child {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 19px;
}

.map-progress {
  flex: 0 0 240px;
  padding: 22px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.map-progress strong,
.map-progress span {
  display: block;
}

.map-progress strong {
  color: var(--forest);
  font-size: 24px;
}

.map-progress > span {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 14px;
}

.progress-track {
  overflow: hidden;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e3e9e2;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transition: width 300ms ease;
}

.world-list {
  display: grid;
  gap: 30px;
  margin-top: 34px;
}

.world-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.world-section-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  background: var(--world-pale);
}

.world-section-header .world-icon {
  width: 68px;
  height: 68px;
  background: var(--white);
}

.world-section-header h2 {
  margin: 0 0 5px;
  font-size: 29px;
}

.world-section-header p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.world-count {
  color: var(--world-color);
  font-weight: 900;
}

.quest-trail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

.quest-card {
  position: relative;
  min-height: 220px;
  padding: 25px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  text-align: left;
}

.quest-card:last-child {
  border-right: 0;
}

.quest-card:not(:disabled):hover {
  z-index: 1;
  background: #fbfcf9;
  box-shadow: inset 0 -5px 0 var(--world-color);
}

.quest-card:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.quest-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.quest-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: var(--world-pale);
  color: var(--world-color);
  font-size: 15px;
  font-weight: 1000;
}

.status-mark {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.quest-card.is-complete .status-mark {
  color: #21725d;
}

.quest-card h3 {
  margin-bottom: 9px;
  font-size: 21px;
}

.quest-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.guide-hero {
  background: var(--forest);
}

.guide-hero h1,
.guide-hero p:last-child {
  color: var(--white);
}

.guide-hero .eyebrow {
  color: var(--yellow);
}

.guide-badge {
  display: grid;
  width: 172px;
  height: 172px;
  flex: 0 0 172px;
  place-items: center;
  border: 5px solid var(--yellow);
  border-radius: 50%;
  color: var(--yellow);
  font-size: 26px;
  font-weight: 1000;
  line-height: 0.85;
  text-align: center;
  transform: rotate(5deg);
}

.guide-badge span {
  color: #d2e5df;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.guide-grid article {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.guide-number {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow-pale);
  color: #745400;
  font-weight: 1000;
}

.guide-grid h2 {
  margin-bottom: 11px;
  font-size: 24px;
}

.guide-grid p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.conversation-card,
.privacy-note {
  display: grid;
  align-items: center;
  margin-top: 28px;
  border-radius: var(--radius-lg);
}

.conversation-card {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  padding: 35px;
  background: var(--yellow-pale);
}

.conversation-card h2 {
  margin-bottom: 0;
}

.conversation-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.conversation-card li {
  padding: 13px 17px;
  border-radius: 13px;
  background: var(--white);
  color: var(--forest);
  font-weight: 850;
}

.privacy-note {
  grid-template-columns: auto 1fr;
  gap: 22px;
  padding: 29px 34px;
  border: 1px solid var(--line);
  background: var(--white);
}

.privacy-note > div:first-child {
  font-size: 38px;
}

.privacy-note h2 {
  margin-bottom: 7px;
  font-size: 24px;
}

.privacy-note p {
  margin-bottom: 8px;
  color: var(--ink-soft);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 34px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: var(--white);
}

.site-footer > div {
  display: flex;
  flex-direction: column;
}

.site-footer span {
  color: var(--ink-soft);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  font-size: 15px;
  font-weight: 800;
}

.mobile-nav {
  display: none;
}

.quest-dialog,
.name-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.quest-dialog {
  width: min(920px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  border-radius: 26px;
  box-shadow: 0 26px 90px rgba(14, 42, 35, 0.3);
}

.quest-dialog::backdrop,
.name-dialog::backdrop {
  background: rgba(14, 35, 31, 0.72);
  backdrop-filter: blur(5px);
}

.dialog-shell {
  overflow: hidden;
  border-radius: 26px;
  background: var(--paper);
}

.quest-header {
  position: sticky;
  z-index: 4;
  top: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  min-height: 76px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.quest-progress-copy > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.quest-reward {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--yellow-pale);
  color: #745400;
  font-size: 15px;
  font-weight: 950;
}

.quest-content {
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  padding: clamp(24px, 5vw, 50px);
}

.quest-page {
  max-width: 760px;
  margin: 0 auto;
}

.quest-page h1,
.quest-page h2 {
  margin-bottom: 15px;
  font-size: clamp(33px, 5vw, 48px);
}

.quest-lead {
  color: var(--ink-soft);
  font-size: 20px;
}

.world-chip,
.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--mint-pale);
  color: #266b5d;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.big-idea-card {
  margin: 25px 0;
  padding: 22px 24px;
  border-left: 7px solid var(--yellow);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.big-idea-card small {
  display: block;
  margin-bottom: 5px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.big-idea-card strong {
  color: var(--forest);
  font-size: 21px;
}

.story-card,
.word-card,
.worked-card {
  margin-top: 20px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.story-card h3,
.word-card h3,
.worked-card h3 {
  margin-bottom: 9px;
}

.story-card p,
.word-card p,
.worked-card p {
  margin-bottom: 0;
}

.word-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 17px;
  background: var(--blue-pale);
}

.word-card > span {
  font-size: 30px;
}

.worked-card ol {
  display: grid;
  gap: 8px;
  margin: 15px 0 0;
  padding-left: 26px;
}

.quest-action-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.visual-stage {
  display: grid;
  min-height: 210px;
  margin: 24px 0;
  padding: clamp(18px, 4vw, 30px);
  place-items: center;
  border: 2px dashed #cfdbcf;
  border-radius: 22px;
  background: var(--cream);
}

.visual-label {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.array-model {
  display: grid;
  gap: 7px;
  width: fit-content;
}

.array-dot {
  width: clamp(17px, 3vw, 29px);
  height: clamp(17px, 3vw, 29px);
  border: 2px solid var(--forest);
  border-radius: 7px;
  background: var(--yellow);
  box-shadow: inset 0 -3px 0 rgba(117, 82, 0, 0.18);
}

.group-model {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
}

.group-box {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 5px;
  width: 92px;
  min-height: 78px;
  padding: 10px;
  border: 3px solid var(--coral);
  border-radius: 18px;
  background: var(--white);
}

.group-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--coral);
}

.bar-model {
  display: flex;
  overflow: hidden;
  width: min(100%, 550px);
  min-height: 68px;
  border: 3px solid var(--forest);
  border-radius: 16px;
}

.bar-part {
  display: grid;
  min-width: 40px;
  flex: 1;
  place-items: center;
  border-right: 2px solid var(--forest);
  background: var(--mint-pale);
  font-weight: 1000;
}

.bar-part:last-child {
  border-right: 0;
}

.money-model {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.money-side {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.money-equals {
  color: var(--forest);
  font-size: 22px;
  font-weight: 1000;
}

.coin {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 4px double #8c8574;
  border-radius: 50%;
  background: #dcd9cf;
  color: #3d403c;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 0 4px 0 #a9a497;
}

.coin.penny {
  width: 55px;
  height: 55px;
  border-color: #965a35;
  background: #ce8559;
  box-shadow: 0 4px 0 #914f2e;
}

.coin.dime {
  width: 50px;
  height: 50px;
}

.coin.quarter {
  width: 72px;
  height: 72px;
}

.bill {
  display: grid;
  min-width: 136px;
  min-height: 68px;
  padding: 8px;
  place-items: center;
  border: 4px double #397d5e;
  border-radius: 9px;
  background: #aee0b8;
  color: #225c45;
  font-size: 24px;
  font-weight: 1000;
  box-shadow: 0 4px 0 #6ca77b;
}

.clock-wrap {
  width: min(100%, 290px);
}

.clock-svg {
  display: block;
  width: 100%;
  height: auto;
}

.timeline-model {
  width: min(100%, 620px);
}

.timeline-line {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 44px 14px 18px;
  border-top: 5px solid var(--forest);
}

.timeline-stop {
  position: relative;
  width: 18px;
  height: 18px;
  border: 4px solid var(--forest);
  border-radius: 50%;
  background: var(--yellow);
  transform: translateY(-11px);
}

.timeline-stop span {
  position: absolute;
  top: 21px;
  left: 50%;
  width: 90px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.shape-model {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.shape-svg {
  width: 120px;
  height: 105px;
  overflow: visible;
}

.shape-svg polygon,
.shape-svg rect,
.shape-svg circle {
  fill: var(--violet-pale);
  stroke: var(--violet);
  stroke-linejoin: round;
  stroke-width: 6;
}

.fraction-model {
  display: grid;
  grid-auto-flow: column;
  gap: 0;
  overflow: hidden;
  width: min(100%, 430px);
  min-height: 150px;
  border: 5px solid var(--forest);
  border-radius: 12px;
}

.fraction-part {
  border-right: 4px solid var(--forest);
  background: var(--yellow-pale);
}

.fraction-part.is-filled {
  background: var(--coral);
}

.fraction-part:last-child {
  border-right: 0;
}

.grid-model {
  display: grid;
  gap: 2px;
  padding: 3px;
  border: 4px solid var(--forest);
  background: var(--forest);
}

.grid-cell {
  width: 37px;
  height: 37px;
  background: var(--mint-pale);
}

.perimeter-model {
  position: relative;
  display: grid;
  width: 290px;
  height: 170px;
  place-items: center;
  border: 12px solid var(--coral);
  background: repeating-linear-gradient(0deg, transparent 0 28px, rgba(23, 59, 53, 0.08) 28px 30px), repeating-linear-gradient(90deg, var(--yellow-pale) 0 28px, #d9c779 28px 30px);
  color: var(--forest);
  font-weight: 1000;
}

.challenge-prompt {
  margin-bottom: 0;
  color: var(--forest);
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -0.03em;
}

.choice-list {
  display: grid;
  gap: 11px;
  margin-top: 22px;
}

.choice-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 62px;
  padding: 11px 17px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.choice-button:hover:not(:disabled) {
  border-color: var(--mint);
  transform: translateY(-1px);
}

.choice-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #edf1ea;
  color: var(--forest);
  font-size: 14px;
  font-weight: 1000;
}

.choice-button.is-wrong {
  border-color: #e8a3aa;
  background: #fff5f5;
}

.choice-button.is-correct {
  border-color: var(--mint);
  background: var(--mint-pale);
}

.choice-button.is-correct .choice-letter {
  background: var(--mint);
  color: var(--white);
}

.support-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  margin-top: 19px;
}

.hint-button {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 9px 14px;
  border: 2px solid #e2c767;
  border-radius: 13px;
  background: var(--yellow-pale);
  color: #715500;
  cursor: pointer;
  font-weight: 900;
}

.feedback-box,
.hint-box {
  flex: 1;
  padding: 14px 17px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 750;
}

.feedback-box {
  background: var(--mint-pale);
  color: #1f6757;
}

.feedback-box.is-retry {
  background: var(--coral-pale);
  color: #8d3025;
}

.hint-box {
  background: var(--yellow-pale);
  color: #6d5306;
}

.completion-card {
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 52px);
  border-radius: var(--radius-xl);
  background: var(--forest);
  color: #d4e8e1;
  text-align: center;
  box-shadow: var(--shadow);
}

.completion-badge {
  display: grid;
  width: 105px;
  height: 105px;
  margin: 0 auto 22px;
  place-items: center;
  border: 6px solid var(--yellow);
  border-radius: 50%;
  background: var(--forest-light);
  color: var(--yellow);
  font-size: 45px;
  animation: badge-arrive 500ms cubic-bezier(0.2, 0.9, 0.2, 1.25);
}

.completion-card h2 {
  color: var(--white);
}

.completion-card strong {
  color: var(--yellow);
}

.completion-card .quest-action-row {
  justify-content: center;
}

.name-dialog {
  width: min(480px, calc(100% - 28px));
  max-width: none;
}

.name-card {
  position: relative;
  padding: 34px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.close-name {
  position: absolute;
  top: 17px;
  right: 17px;
}

.name-card h2 {
  margin-bottom: 23px;
}

.name-card label {
  display: block;
  margin-bottom: 7px;
  font-weight: 900;
}

.name-card input {
  width: 100%;
  min-height: 54px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 13px;
  color: var(--forest);
  font-size: 18px;
}

.name-card .primary-button {
  width: 100%;
}

.toast {
  position: fixed;
  z-index: 1001;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 44px));
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--forest);
  color: var(--white);
  box-shadow: var(--shadow);
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.plain-page {
  background: var(--paper);
}

.simple-header {
  position: static;
  grid-template-columns: 1fr auto;
}

.policy-page {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(44px, 8vw, 90px) 0;
}

.policy-page h1 {
  font-size: clamp(40px, 6vw, 62px);
}

.policy-intro {
  color: var(--ink-soft);
  font-size: 22px;
}

.policy-page section {
  margin-top: 20px;
  padding: 24px 27px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.policy-page h2 {
  margin-bottom: 9px;
  font-size: 25px;
}

.policy-page section p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

@keyframes badge-arrive {
  from { opacity: 0; transform: scale(0.55) rotate(-18deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .hero-card {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.72fr);
    gap: 30px;
  }

  .world-card-grid,
  .loop-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quest-trail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quest-card:nth-child(2) {
    border-right: 0;
  }

  .quest-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav {
    position: fixed;
    z-index: 90;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    display: flex;
    min-height: 51px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-nav button.is-active {
    background: var(--forest);
    color: var(--white);
  }

  .site-footer {
    padding-bottom: 100px;
  }

  .toast {
    bottom: 88px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  .site-header {
    min-height: 74px;
    padding: 9px 16px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand-tile {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .brand-copy span {
    font-size: 12px;
  }

  .spark-total {
    min-height: 42px;
    padding: 6px 11px;
  }

  .name-button {
    min-width: 43px;
    padding: 5px 8px;
  }

  .name-button > span:nth-child(2) {
    display: none;
  }

  .app-view {
    width: min(100% - 24px, 1240px);
    padding-top: 20px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 30px 22px 25px;
  }

  .hero-card h1 {
    font-size: clamp(41px, 13vw, 58px);
  }

  .hero-model {
    width: 100%;
    max-width: 400px;
    padding: 19px;
  }

  .model-equation {
    align-items: center;
  }

  .promise-list {
    display: grid;
    gap: 6px;
  }

  .hero-actions,
  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
  }

  .section-heading,
  .next-quest-card,
  .view-hero,
  .world-section-header,
  .conversation-card,
  .privacy-note {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .section-heading,
  .view-hero {
    flex-direction: column;
  }

  .section-heading {
    align-items: flex-start;
  }

  .next-quest-card {
    display: grid;
  }

  .next-quest-card .primary-button {
    width: 100%;
  }

  .world-card-grid,
  .loop-steps,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .view-hero {
    display: flex;
    padding: 28px 23px;
  }

  .map-progress {
    width: 100%;
    flex-basis: auto;
  }

  .world-section-header {
    display: grid;
  }

  .world-count {
    justify-self: start;
  }

  .guide-badge {
    width: 128px;
    height: 128px;
    flex-basis: 128px;
    font-size: 22px;
  }

  .conversation-card,
  .privacy-note {
    display: grid;
    gap: 18px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .quest-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .dialog-shell {
    min-height: 100dvh;
    border-radius: 0;
  }

  .quest-header {
    min-height: 70px;
    padding: 9px 12px;
  }

  .quest-content {
    max-height: calc(100dvh - 70px);
    padding: 24px 16px 48px;
  }

  .visual-stage {
    min-height: 180px;
    margin: 20px 0;
    padding: 16px 10px;
  }

  .group-box {
    width: 74px;
    min-height: 68px;
  }

  .support-row {
    flex-direction: column;
  }

  .hint-button,
  .feedback-box,
  .hint-box {
    width: 100%;
  }

  .simple-header {
    grid-template-columns: 1fr auto;
  }

  .simple-header .brand-copy {
    display: none;
  }
}

@media (max-width: 540px) {
  .quest-trail {
    grid-template-columns: 1fr;
  }

  .quest-card,
  .quest-card:nth-child(2),
  .quest-card:nth-child(-n + 2) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quest-card:last-child {
    border-bottom: 0;
  }

  .model-equation {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .money-model {
    gap: 8px;
  }

  .coin {
    width: 52px;
    height: 52px;
  }

  .coin.quarter {
    width: 62px;
    height: 62px;
  }

  .bill {
    min-width: 116px;
  }

  .fraction-model {
    min-height: 115px;
  }

  .timeline-stop span {
    width: 66px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
