:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #65706c;
  --line: #dbe4dc;
  --paper: #fbfdf9;
  --panel: #ffffff;
  --mist: #edf5ef;
  --forest: #163f3a;
  --leaf: #3f8f64;
  --teal: #1f8a92;
  --amber: #d99a29;
  --ember: #b65f3f;
  --violet: #6d5aa8;
  --shadow: 0 18px 50px rgba(23, 33, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 18%, rgba(63, 143, 100, 0.16), transparent 28rem),
    radial-gradient(circle at 80% 8%, rgba(217, 154, 41, 0.16), transparent 24rem),
    linear-gradient(135deg, #f7fbf4 0%, #eef6f2 48%, #f8f3ec 100%);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px clamp(14px, 3vw, 32px) 42px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(22, 63, 58, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 34px rgba(23, 33, 31, 0.08);
}

.brand-block,
.profile-bar,
.sync-pill,
.tabs,
.mission-hero,
.companion-panel,
.challenge-panel,
.side-panel,
.map-grid,
.word-toolbar,
.parent-layout,
.stat-grid,
.reward-row,
.question-options,
.word-grid {
  display: flex;
}

.brand-block {
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  background: conic-gradient(from 160deg, var(--forest), var(--teal), var(--amber), var(--forest));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
}

.profile-bar {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-chip,
.tab,
.primary-btn,
.ghost-btn,
.icon-btn,
.answer-btn,
.mini-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.profile-chip {
  min-height: 42px;
  padding: 8px 12px;
  color: var(--forest);
  background: #eff7f0;
  border-color: rgba(63, 143, 100, 0.18);
  font-weight: 800;
}

.profile-chip.is-active {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 10px 26px rgba(22, 63, 58, 0.24);
}

.sync-pill {
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--forest);
  background: #fff7e6;
  border: 1px solid rgba(217, 154, 41, 0.3);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-pill.is-online {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.tabs {
  gap: 8px;
  overflow-x: auto;
  padding: 16px 2px 14px;
}

.tab {
  min-height: 44px;
  padding: 10px 16px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(22, 63, 58, 0.13);
  font-weight: 900;
  white-space: nowrap;
}

.tab.is-active {
  color: #fff;
  background: var(--forest);
}

.main-stage {
  outline: none;
}

.daily-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: stretch;
}

.auth-hero {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 4vw, 36px);
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(140deg, rgba(22, 63, 58, 0.96), rgba(31, 138, 146, 0.9)),
    linear-gradient(35deg, rgba(217, 154, 41, 0.3), transparent);
  box-shadow: var(--shadow);
}

.auth-hero h2 {
  margin-bottom: 14px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
}

.auth-hero p {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
}

.auth-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-panels {
  display: grid;
  gap: 16px;
}

.mission-hero {
  position: relative;
  min-height: 260px;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(18px, 3vw, 32px);
  overflow: hidden;
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(125deg, rgba(22, 63, 58, 0.96), rgba(31, 138, 146, 0.88)),
    linear-gradient(45deg, rgba(217, 154, 41, 0.3), transparent);
  box-shadow: var(--shadow);
}

.mission-hero.legend {
  background:
    linear-gradient(125deg, rgba(29, 33, 31, 0.97), rgba(82, 78, 63, 0.9)),
    linear-gradient(45deg, rgba(182, 95, 63, 0.28), transparent);
}

.mission-copy {
  width: min(580px, 100%);
  z-index: 1;
}

.mission-copy h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.mission-copy p {
  max-width: 58ch;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.72;
}

.mission-actions,
.panel-actions,
.form-row,
.filter-row,
.session-row,
.grade-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.mini-btn {
  min-height: 42px;
  padding: 10px 15px;
  font-weight: 900;
}

.primary-btn {
  color: #1a211d;
  background: #ffcf62;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.primary-btn.dark {
  color: #fff;
  background: var(--forest);
  box-shadow: none;
}

.ghost-btn,
.icon-btn,
.mini-btn {
  color: var(--forest);
  background: #ffffff;
  border-color: rgba(22, 63, 58, 0.14);
}

.mini-btn.is-active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.mission-hero .ghost-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

button:hover {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(31, 138, 146, 0.38);
  outline-offset: 2px;
}

.beast-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 220px;
  min-height: 238px;
  z-index: 1;
}

.beast-aura {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 207, 98, 0.45), rgba(255, 255, 255, 0.06) 58%, transparent 70%);
  animation: pulse 3.8s ease-in-out infinite;
}

.beast {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  border: 4px solid rgba(255, 255, 255, 0.34);
  border-radius: 48% 52% 44% 56%;
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0 8%, transparent 9%),
    radial-gradient(circle at 66% 31%, #ffffff 0 8%, transparent 9%),
    linear-gradient(150deg, #72c98c, #2c8065);
  box-shadow: inset 0 -22px 36px rgba(0, 0, 0, 0.18), 0 24px 34px rgba(0, 0, 0, 0.24);
}

.beast.legend {
  border-radius: 24px 52px 28px 52px;
  background:
    radial-gradient(circle at 35% 32%, #f6f2d8 0 7%, transparent 8%),
    radial-gradient(circle at 65% 32%, #f6f2d8 0 7%, transparent 8%),
    linear-gradient(150deg, #8d7e55, #393936);
}

.beast.stage-2 {
  width: 176px;
  height: 170px;
}

.beast.stage-3 {
  width: 184px;
  height: 176px;
}

.beast.stage-4,
.beast.stage-5 {
  width: 192px;
  height: 184px;
}

.beast.stage-5 {
  filter: drop-shadow(0 0 18px rgba(255, 207, 98, 0.38));
}

.beast::before,
.beast::after {
  content: "";
  position: absolute;
  top: 74px;
  width: 18px;
  height: 12px;
  border-radius: 99px;
  background: #13201c;
}

.beast::before {
  left: 48px;
}

.beast::after {
  right: 48px;
}

.beast-level {
  position: absolute;
  right: -6px;
  bottom: 12px;
  display: grid;
  place-items: center;
  min-width: 50px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 999px;
  color: #17211f;
  background: #ffcf62;
  font-size: 13px;
  font-weight: 950;
}

.beast-rank {
  position: absolute;
  left: -8px;
  bottom: 14px;
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 63, 58, 0.86);
  font-size: 12px;
  font-weight: 950;
}

.beast-caption {
  position: absolute;
  bottom: 0;
  padding: 5px 10px;
  border-radius: 999px;
  color: #17211f;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 950;
}

.beast-part {
  position: absolute;
  display: none;
  pointer-events: none;
}

.beast.stage-2 .tail,
.beast.stage-3 .tail,
.beast.stage-4 .tail,
.beast.stage-5 .tail {
  display: block;
  right: -38px;
  bottom: 36px;
  width: 68px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2c8065, #a8e6a1);
  transform: rotate(-18deg);
  z-index: -1;
}

.beast.legend.stage-2 .tail,
.beast.legend.stage-3 .tail,
.beast.legend.stage-4 .tail,
.beast.legend.stage-5 .tail {
  background: linear-gradient(90deg, #393936, #c9a45c);
}

.beast.stage-3 .crest,
.beast.stage-4 .crest,
.beast.stage-5 .crest {
  display: block;
  top: -30px;
  width: 84px;
  height: 54px;
  border-radius: 50% 50% 40% 40%;
  background:
    radial-gradient(circle at 20% 60%, #ffcf62 0 18%, transparent 19%),
    radial-gradient(circle at 50% 25%, #ffffff 0 18%, transparent 19%),
    radial-gradient(circle at 80% 60%, #ffcf62 0 18%, transparent 19%);
}

.beast.legend.stage-3 .crest,
.beast.legend.stage-4 .crest,
.beast.legend.stage-5 .crest {
  top: -24px;
  width: 112px;
  background:
    linear-gradient(120deg, transparent 0 35%, #c9a45c 36% 48%, transparent 49%),
    linear-gradient(60deg, transparent 0 35%, #c9a45c 36% 48%, transparent 49%);
}

.beast.stage-4 .wing,
.beast.stage-5 .wing {
  display: block;
  top: 52px;
  width: 64px;
  height: 86px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(160deg, rgba(168, 230, 161, 0.95), rgba(31, 138, 146, 0.62));
  z-index: -1;
}

.beast.stage-4 .wing.left,
.beast.stage-5 .wing.left {
  left: -52px;
  transform: rotate(-22deg);
}

.beast.stage-4 .wing.right,
.beast.stage-5 .wing.right {
  right: -52px;
  transform: rotate(22deg) scaleX(-1);
}

.beast.legend.stage-4 .wing,
.beast.legend.stage-5 .wing {
  border-radius: 22px 70px 26px 70px;
  background: linear-gradient(160deg, rgba(201, 164, 92, 0.94), rgba(57, 57, 54, 0.7));
}

.beast.stage-5 .crown {
  display: block;
  top: -46px;
  width: 94px;
  height: 38px;
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(135deg, transparent 0 18%, #ffcf62 19% 34%, transparent 35% 47%, #ffcf62 48% 64%, transparent 65% 78%, #ffcf62 79%),
    linear-gradient(#ffdf7e, #d99a29);
}

.beast.stage-5 .rune {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffcf62;
  box-shadow: 0 0 14px rgba(255, 207, 98, 0.9);
}

.beast.stage-5 .r1 {
  left: -22px;
  top: 42px;
}

.beast.stage-5 .r2 {
  right: -24px;
  top: 72px;
}

.beast.stage-5 .r3 {
  left: 50%;
  bottom: -24px;
}

.ability-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f6faf6;
  border: 1px solid rgba(63, 143, 100, 0.14);
}

.ability-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--forest);
}

.ability-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ability-grid {
  display: grid;
  gap: 10px;
}

.ability-row {
  display: grid;
  gap: 5px;
}

.ability-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ability-label strong {
  color: var(--forest);
}

.ability-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8e1;
}

.ability-fill {
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.stat-tile {
  min-height: 86px;
  padding: 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.stat-tile strong {
  display: block;
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1;
}

.stat-tile span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.grade-picker {
  margin: 4px 0 10px;
}

.grade-picker .mini-btn {
  min-width: 42px;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}

.grade-picker .mini-btn.is-active {
  color: #1a211d;
  background: #ffcf62;
  border-color: #ffcf62;
}

.content-stack {
  display: grid;
  gap: 16px;
}

.challenge-panel,
.side-panel,
.companion-panel,
.map-region,
.parent-panel,
.word-card {
  border: 1px solid rgba(22, 63, 58, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 34px rgba(23, 33, 31, 0.08);
}

.challenge-panel {
  flex-direction: column;
  gap: 16px;
  padding: clamp(16px, 3vw, 24px);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.panel-heading h3,
.side-panel h3,
.parent-panel h3 {
  margin-bottom: 4px;
  font-size: 20px;
}

.panel-heading p,
.side-panel p,
.parent-panel p,
.word-card p {
  color: var(--muted);
  line-height: 1.58;
}

.question-box {
  display: grid;
  gap: 14px;
  min-height: 280px;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f5faf6);
}

.question-type {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.question-prompt {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.18;
  font-weight: 950;
}

.question-sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.question-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.answer-btn {
  min-height: 58px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  text-align: left;
  font-weight: 850;
}

.answer-btn.is-correct {
  color: #fff;
  background: var(--leaf);
  border-color: var(--leaf);
}

.answer-btn.is-wrong {
  color: #fff;
  background: var(--ember);
  border-color: var(--ember);
}

.spell-form {
  display: grid;
  gap: 10px;
}

.spell-form input,
.parent-panel input,
.parent-panel select,
.parent-panel textarea,
.word-toolbar input,
.word-toolbar select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.letter {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border-radius: 10px;
  background: #eff7f0;
  color: var(--forest);
  font-weight: 950;
}

.feedback {
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #eef6f2;
  color: var(--forest);
  font-weight: 800;
}

.feedback.bad {
  color: #7a331f;
  background: #fff0e9;
}

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

.progress-fill {
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--amber));
}

.side-column {
  display: grid;
  gap: 16px;
}

.companion-panel,
.side-panel,
.parent-panel {
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.reward-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settlement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reward {
  min-height: 72px;
  padding: 10px;
  border-radius: 12px;
  color: var(--forest);
  background: #f2f8f3;
  border: 1px solid rgba(63, 143, 100, 0.14);
  font-weight: 850;
}

.reward strong {
  display: block;
  margin-bottom: 4px;
  font-size: 20px;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.mini-list.compact li {
  grid-template-columns: minmax(96px, auto) 1fr;
  align-items: start;
}

.mini-list.compact strong {
  text-align: right;
  font-size: 12px;
}

.tag {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--violet);
  font-size: 12px;
  font-weight: 900;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 14px;
  align-items: start;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.map-region {
  position: relative;
  min-height: 190px;
  padding: 18px;
  overflow: hidden;
  display: block;
  width: 100%;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.map-region::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -36px;
  width: 116px;
  height: 116px;
  border-radius: 38px;
  background: rgba(31, 138, 146, 0.13);
  transform: rotate(18deg);
}

.map-region h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.map-region p {
  min-height: 50px;
  color: var(--muted);
  line-height: 1.5;
}

.region-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 8px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 900;
}

.map-region.is-selected {
  border-color: rgba(31, 138, 146, 0.55);
  box-shadow: 0 16px 36px rgba(31, 138, 146, 0.18);
}

.map-region.is-focused {
  outline: 3px solid rgba(217, 154, 41, 0.28);
  outline-offset: 2px;
}

.region-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.region-detail {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(22, 63, 58, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 34px rgba(23, 33, 31, 0.08);
}

.region-plan,
.muted-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.detail-columns {
  display: grid;
  gap: 14px;
}

.detail-columns h4,
.question-box h4 {
  margin: 0 0 8px;
}

.word-toolbar {
  display: grid;
  grid-template-columns: 1fr 160px 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.word-card {
  min-height: 182px;
  padding: 15px;
}

.word-card h3 {
  margin-bottom: 7px;
  font-size: 24px;
}

.word-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.word-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eff7f0;
  color: var(--forest);
  font-size: 12px;
  font-weight: 850;
}

.mastery-dots {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.dot {
  width: 18px;
  height: 8px;
  border-radius: 999px;
  background: #dce6df;
}

.dot.on {
  background: var(--leaf);
}

.parent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 900;
}

.full {
  grid-column: 1 / -1;
}

.danger-zone {
  border-color: rgba(182, 95, 63, 0.3);
  background: #fff8f4;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed rgba(22, 63, 58, 0.22);
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.74);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 20;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 14px;
  color: #fff;
  background: var(--forest);
  box-shadow: var(--shadow);
  font-weight: 800;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@media (max-width: 1040px) {
  .topbar,
  .auth-layout,
  .daily-layout,
  .parent-layout,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .profile-bar {
    justify-content: flex-start;
  }

  .sync-pill {
    width: fit-content;
  }

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

  .word-toolbar {
    grid-template-columns: 1fr 150px;
  }

  .word-toolbar select:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding-inline: 12px;
  }

  .mission-hero {
    flex-direction: column;
  }

  .beast-stage {
    min-width: 0;
    min-height: 190px;
  }

  .stat-grid,
  .auth-points,
  .reward-row,
  .settlement-grid,
  .question-options,
  .map-grid,
  .word-grid,
  .form-grid,
  .word-toolbar {
    grid-template-columns: 1fr;
  }

  .question-prompt {
    font-size: 25px;
  }

  .topbar {
    border-radius: 16px;
  }
}
