﻿:root {
  --ink: #2f4059;
  --muted: #718299;
  --line: rgba(72, 104, 132, 0.14);
  --paper: #fffaf0;
  --white: rgba(255, 255, 255, 0.9);
  --coral: #ff7f85;
  --peach: #ffb463;
  --sun: #ffdc62;
  --mint: #67dca8;
  --sky: #77d2fb;
  --blue: #65a9ff;
  --grape: #a994ff;
  --pink: #ffb6d5;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 11% 8%, rgba(255, 220, 98, .42), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(255, 182, 213, .38), transparent 23%),
    radial-gradient(circle at 74% 86%, rgba(103, 220, 168, .28), transparent 25%),
    linear-gradient(135deg, rgba(255, 248, 226, .9), rgba(220, 249, 255, .86)),
    url("./assets/storybook-bg.png") center / cover fixed;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 4px solid rgba(255, 220, 98, .75); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

.town-shell {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.town-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 22px;
  color: #fff;
  font-size: 31px;
  font-weight: 950;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.6), transparent 24%), linear-gradient(145deg, var(--coral), var(--sun));
  box-shadow: 0 12px 24px rgba(255, 127, 133, .2), inset 0 -5px 0 rgba(0,0,0,.08);
  transform: rotate(-4deg);
}

.brand h1 { font-size: 27px; line-height: 1.05; }
.brand p { color: var(--muted); font-weight: 800; margin-top: 3px; }

.top-nav {
  display: flex;
  gap: 8px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

.top-nav button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #476178;
  font-weight: 900;
  background: transparent;
}

.top-nav button:hover { background: #fff5cf; }

.hero-town {
  position: relative;
  display: grid;
  grid-template-columns: minmax(520px, 1.1fr) minmax(360px, .9fr);
  gap: 18px;
  min-height: 470px;
  padding: 22px;
  overflow: hidden;
  border: 10px solid #40566d;
  border-radius: 38px;
  background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.62)), repeating-linear-gradient(45deg, rgba(255,220,98,.14) 0 18px, rgba(119,210,251,.13) 18px 36px);
  box-shadow: 0 28px 80px rgba(45, 77, 105, .22), inset 0 0 0 6px rgba(255,255,255,.65);
}

.sky-scene {
  position: relative;
  min-height: 420px;
  border-radius: 30px;
  background: linear-gradient(#bfeeff, #fff2be);
  overflow: hidden;
  box-shadow: inset 0 -10px 0 rgba(255, 255, 255, .25);
}

.sun {
  position: absolute;
  left: 44px;
  top: 36px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 18px rgba(255,220,98,.22);
}

.cloud, .movie-cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
}
.cloud::before, .cloud::after, .movie-cloud::before, .movie-cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.cloud-a { width: 150px; height: 56px; right: 80px; top: 58px; animation: floaty 5s ease-in-out infinite; }
.cloud-b { width: 118px; height: 44px; left: 155px; top: 138px; animation: floaty 4.6s ease-in-out infinite reverse; }
.cloud::before { width: 54px; height: 54px; left: 22px; top: -26px; }
.cloud::after { width: 70px; height: 70px; right: 24px; top: -37px; }

.rainbow {
  position: absolute;
  right: 90px;
  bottom: 86px;
  width: 250px;
  height: 125px;
  border-radius: 250px 250px 0 0;
  background: repeating-radial-gradient(ellipse at 50% 100%, transparent 0 42px, #ff7f85 43px 55px, #ffdc62 56px 68px, #67dca8 69px 81px, #77d2fb 82px 94px, #a994ff 95px 107px, transparent 108px 130px);
  opacity: .9;
}

.storybook-house {
  position: absolute;
  left: 74px;
  bottom: 52px;
  width: 190px;
  height: 176px;
}
.roof {
  width: 190px;
  height: 92px;
  clip-path: polygon(50% 0, 100% 70%, 86% 100%, 14% 100%, 0 70%);
  background: linear-gradient(145deg, var(--coral), var(--peach));
}
.house-body {
  position: absolute;
  left: 26px;
  bottom: 0;
  width: 138px;
  height: 104px;
  border: 7px solid #fff;
  border-radius: 28px 28px 18px 18px;
  background: #fff7d4;
}
.house-body span {
  position: absolute;
  left: 45px;
  bottom: 0;
  width: 48px;
  height: 66px;
  border-radius: 24px 24px 0 0;
  background: #7dc9f5;
}

.star-path {
  position: absolute;
  left: 292px;
  bottom: 48px;
  display: flex;
  gap: 20px;
}
.star-path i {
  width: 24px;
  height: 24px;
  background: var(--sun);
  clip-path: polygon(50% 0, 63% 35%, 100% 35%, 70% 57%, 82% 95%, 50% 72%, 18% 95%, 30% 57%, 0 35%, 37% 35%);
}

.mascot-card {
  position: relative;
  align-self: start;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 3px solid rgba(255,255,255,.82);
  border-radius: 30px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 20px 40px rgba(57, 86, 110, .13);
}

.speech {
  position: relative;
  padding: 18px;
  border-radius: 24px;
  background: #fff6cf;
}
.speech::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 58px;
  border: 10px solid transparent;
  border-right-color: #fff6cf;
}
.eyebrow, .panel-title span {
  color: #6d7f96;
  font-size: 12px;
  font-weight: 950;
}
.speech h2 { margin-top: 4px; font-size: clamp(30px, 4vw, 54px); line-height: 1; }
.speech p { margin-top: 12px; color: #52657d; font-size: 18px; line-height: 1.55; font-weight: 800; }

.pegasus {
  position: relative;
  width: 142px;
  height: 140px;
  align-self: center;
  animation: bob 3.6s ease-in-out infinite;
}
.pegasus .body {
  position: absolute;
  left: 30px;
  top: 62px;
  width: 82px;
  height: 48px;
  border-radius: 50px;
  background: #fff;
  box-shadow: inset 0 -7px 0 #eaf5ff, 0 12px 20px rgba(61, 91, 120, .12);
}
.pegasus .head {
  position: absolute;
  left: 80px;
  top: 34px;
  width: 54px;
  height: 58px;
  border-radius: 26px 28px 24px 24px;
  background: #fff;
  box-shadow: inset 0 -6px 0 #eaf5ff;
}
.horn {
  position: absolute;
  left: 24px;
  top: -22px;
  width: 16px;
  height: 34px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(var(--sun), var(--peach));
}
.mane {
  position: absolute;
  left: -8px;
  top: 8px;
  width: 18px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(var(--pink), var(--grape), var(--sky));
}
.eye {
  position: absolute;
  right: 14px;
  top: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}
.smile {
  position: absolute;
  right: 10px;
  top: 34px;
  width: 18px;
  height: 9px;
  border-bottom: 3px solid #7d91a8;
  border-radius: 50%;
}
.wing {
  position: absolute;
  top: 45px;
  width: 58px;
  height: 44px;
  border-radius: 80% 20% 80% 20%;
  background: linear-gradient(145deg, #fff, #dff3ff);
}
.wing-left { left: 14px; transform: rotate(-22deg); }
.wing-right { left: 58px; transform: rotate(18deg); }
.tail {
  position: absolute;
  left: 8px;
  top: 70px;
  width: 40px;
  height: 30px;
  border-radius: 50%;
  border-left: 12px solid var(--pink);
  border-bottom: 12px solid var(--sky);
  transform: rotate(12deg);
}

.task-panel {
  grid-column: 2;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.task-card, .map-item, .story-card, .chapter-card {
  border: 0;
  text-align: left;
  color: var(--ink);
}
.task-card {
  min-height: 126px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 24px rgba(53, 79, 105, .1), inset 0 -5px 0 rgba(52, 64, 90, .04);
}
.task-card.is-active { background: #fff4c9; box-shadow: 0 0 0 4px rgba(255, 220, 98, .75), 0 14px 28px rgba(53,79,105,.12); }
.task-card span { font-size: 34px; display: block; }
.task-card strong { display: block; margin-top: 8px; font-size: 18px; }
.task-card em, .map-item em { display: block; margin-top: 5px; color: var(--muted); font-style: normal; font-size: 13px; font-weight: 800; }

.wish-box {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 26px;
  background: rgba(255,255,255,.88);
}
.wish-box label { color: #52657d; font-weight: 950; }
.wish-input { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.wish-input input {
  min-height: 52px;
  border: 3px solid #d9efff;
  border-radius: 18px;
  padding: 0 16px;
  color: var(--ink);
  font-weight: 850;
  background: #fffdfa;
}
.wish-input button, .primary-button, .soft-button {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  padding: 0 18px;
  font-weight: 950;
}
.wish-input button, .primary-button {
  color: #fff;
  background: linear-gradient(145deg, #38bd7d, var(--mint));
  box-shadow: 0 12px 22px rgba(56, 189, 125, .2), inset 0 -4px 0 rgba(0,0,0,.08);
}
.voice-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voice-row button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #6b4f00;
  font-weight: 950;
  background: #fff1ba;
}
.voice-row span { color: var(--muted); font-size: 13px; font-weight: 800; }

.town-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.map-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 13px 26px rgba(53, 79, 105, .09);
}
.map-item.is-active { background: #fff4c9; }
.map-item span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 20px; font-size: 30px; background: linear-gradient(145deg, var(--sky), var(--grape)); }
.map-item strong { display: block; font-size: 18px; }

.creation-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  gap: 16px;
}
.story-dock, .paint-stage, .companion-panel, .theater-card, .steps-card, .works-card {
  min-width: 0;
  border: 2px solid rgba(255,255,255,.78);
  border-radius: 30px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 14px 32px rgba(53, 79, 105, .09);
}
.story-dock, .paint-stage, .companion-panel, .theater-card, .steps-card, .works-card { padding: 18px; }
.panel-title { display: grid; gap: 4px; margin-bottom: 14px; }
.panel-title strong { font-size: 22px; }

.age-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 6px; border-radius: 18px; background: #ecf8ff; }
.age-tab {
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  color: #49647c;
  font-weight: 950;
  background: transparent;
}
.age-tab.is-active { color: #fff; background: linear-gradient(145deg, var(--sky), var(--grape)); }
.story-list { display: grid; gap: 10px; margin-top: 14px; }
.story-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 10px;
  border-radius: 22px;
  background: #fff;
}
.story-card.is-active { background: #fff4c9; box-shadow: 0 0 0 4px rgba(255,220,98,.8); }
.story-thumb { display: grid; place-items: center; border-radius: 18px; font-size: 28px; background: linear-gradient(145deg, var(--mint), var(--sky)); }
.story-card strong, .story-card span { display: block; }
.story-card strong { margin-top: 4px; font-size: 16px; }
.story-card span { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 800; }
.mission-note { margin-top: 16px; padding: 14px; border-radius: 22px; background: #fff1cf; }
.mission-note span { color: #8a680d; font-size: 12px; font-weight: 950; }
.mission-note p { margin-top: 5px; color: #53677e; font-weight: 850; line-height: 1.45; }

.stage-head, .canvas-header, .stage-actions, .tool-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stage-head { margin-bottom: 14px; }
.stage-head h2 { margin-top: 4px; font-size: clamp(28px, 3vw, 42px); }
.stage-actions { justify-content: flex-end; }
.round-button, .tool-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  font-weight: 950;
  background: #edf8ff;
  box-shadow: inset 0 -4px 0 rgba(50, 83, 112, .07);
}
.chapter-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.chapter-card {
  min-height: 82px;
  padding: 12px;
  border-radius: 22px;
  background: #fff;
}
.chapter-card.is-active { background: linear-gradient(145deg, #f2efff, #fff5cc); box-shadow: 0 0 0 4px rgba(169,148,255,.45); }
.chapter-card span { display: inline-grid; padding: 4px 8px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 950; background: var(--grape); }
.chapter-card strong { display: block; margin-top: 7px; font-size: 15px; }

.canvas-card { padding: 14px; border-radius: 26px; background: #fff; border: 2px solid var(--line); }
.mode-pill { padding: 9px 13px; border-radius: 999px; color: #755700; font-weight: 950; background: #fff0b2; }
.canvas-wrap {
  position: relative;
  margin: 12px 0;
  border: 6px solid #d9efff;
  border-radius: 30px;
  overflow: hidden;
  aspect-ratio: 9 / 5.7;
  background:
    linear-gradient(transparent 31px, rgba(119,210,251,.13) 32px),
    linear-gradient(90deg, transparent 31px, rgba(119,210,251,.13) 32px),
    #fffdfa;
  background-size: 32px 32px;
}
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.canvas-hint {
  position: absolute;
  left: 16px;
  bottom: 14px;
  max-width: calc(100% - 32px);
  padding: 9px 13px;
  border-radius: 999px;
  color: #64778d;
  background: rgba(255,255,255,.92);
  font-weight: 950;
  pointer-events: none;
}
.toolbox { display: grid; gap: 12px; }
.colors { justify-content: flex-start; flex-wrap: wrap; }
.color-swatch {
  width: 34px;
  height: 34px;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(58,78,95,.18);
}
.color-swatch.is-active { box-shadow: 0 0 0 4px var(--ink); }
.tool-button.is-active, .tool-button:hover, .round-button:hover { background: var(--sun); }
.size-control { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 950; }
.size-control input { width: min(210px, 100%); accent-color: var(--coral); }
.magic-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.soft-button { color: #3e5870; background: #eff7ff; box-shadow: inset 0 -4px 0 rgba(58,91,122,.05); }
.soft-button.magic { color: #fff; background: linear-gradient(145deg, var(--coral), var(--pink)); }
.full { width: 100%; }

.companion-panel { display: grid; gap: 12px; align-content: start; }
.mini-pegasus {
  position: relative;
  width: 100%;
  min-height: 108px;
  border-radius: 26px;
  background: linear-gradient(145deg, #dff6ff, #fff6cf);
  overflow: hidden;
}
.mini-body { position: absolute; left: 100px; top: 48px; width: 84px; height: 44px; border-radius: 999px; background: #fff; }
.mini-head { position: absolute; left: 164px; top: 26px; width: 52px; height: 54px; border-radius: 24px; background: #fff; }
.mini-wing { position: absolute; left: 82px; top: 30px; width: 70px; height: 50px; border-radius: 80% 20% 80% 20%; background: #fff; transform: rotate(-18deg); }
.chat-card, .prompt-card, .question-card, .found-card, .preview-card-wrap {
  padding: 14px;
  border-radius: 24px;
  background: #fff;
  border: 2px solid var(--line);
}
.chat-card { background: #eefaff; }
.chat-card p, .prompt-card p, .question-card p { margin-top: 7px; line-height: 1.52; color: #51657d; font-weight: 850; }
.prompt-card span, .question-card span, .found-card span, .preview-card-wrap span { color: #6d7f96; font-size: 12px; font-weight: 950; }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.answer-grid button {
  min-height: 38px;
  border: 0;
  border-radius: 16px;
  color: #3e5870;
  font-weight: 950;
  background: #fff1c7;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.tag-row span { padding: 7px 9px; border-radius: 999px; color: #35506a; font-size: 12px; font-weight: 950; background: #e8f7ed; }
.art-preview {
  position: relative;
  min-height: 165px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 20px;
  background: radial-gradient(circle at 22% 34%, rgba(255,220,98,.8), transparent 13%), linear-gradient(#ccefff, #fff6d8);
}
.preview-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255,255,255,.86);
  font-weight: 950;
}
.generated-art::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 20%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 12px rgba(255,220,98,.28);
  animation: floaty 3s ease-in-out infinite;
}
.generated-art::after {
  content: "";
  position: absolute;
  right: 12%;
  bottom: 18%;
  width: 116px;
  height: 50px;
  border-radius: 999px;
  background: #fff;
  box-shadow: -50px 9px 0 4px rgba(255,255,255,.9);
}
.generated-art .preview-card { left: 16px; right: 16px; top: auto; bottom: 14px; transform: none; text-align: center; color: #405871; }

.bottom-world {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.movie-stage {
  position: relative;
  height: 172px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 22px;
  background: radial-gradient(circle at 18% 36%, rgba(255,220,98,.96), transparent 12%), linear-gradient(#9bdcf8, #fff0bc);
}
.movie-star {
  position: absolute;
  left: 28px;
  top: 58px;
  width: 54px;
  height: 54px;
  background: var(--sun);
  clip-path: polygon(50% 0, 63% 35%, 100% 35%, 70% 57%, 82% 95%, 50% 72%, 18% 95%, 30% 57%, 0 35%, 37% 35%);
}
.theater-card.is-playing .movie-star { animation: fly 3s ease-in-out infinite; }
.movie-cloud { width: 84px; height: 34px; background: #fff; }
.movie-cloud.one { right: 24px; top: 42px; }
.movie-cloud.two { left: 98px; bottom: 30px; }
.flow-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: flow; }
.flow-list li {
  counter-increment: flow;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 18px;
  color: var(--muted);
  font-weight: 950;
  background: #f7fbff;
}
.flow-list li::before {
  content: counter(flow);
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  background: #b8cad8;
}
.flow-list li.is-active, .flow-list li.is-done { color: var(--ink); background: #fff6d9; }
.flow-list li.is-active::before, .flow-list li.is-done::before { background: var(--coral); }
.gallery { display: grid; gap: 9px; max-height: 260px; overflow: auto; }
.empty-gallery, .gallery-item {
  min-height: 66px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--muted);
  background: #f8fbff;
  font-weight: 950;
}
.gallery-item { grid-template-columns: 58px 1fr; gap: 10px; place-items: stretch; padding: 8px; text-align: left; }
.gallery-thumb { border-radius: 14px; background: linear-gradient(145deg, var(--sun), var(--coral)); }
.gallery-item strong, .gallery-item span { display: block; }
.gallery-item strong { margin-top: 4px; color: var(--ink); font-size: 13px; }
.gallery-item span { margin-top: 4px; font-size: 12px; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(47,64,89,.92);
  opacity: 0;
  transition: .25s ease;
  font-weight: 950;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fly { 0%,100% { transform: translate(0,0) rotate(0deg); } 50% { transform: translate(130px,-28px) rotate(18deg); } }

@media (max-width: 1360px) {
  .hero-town {
    grid-template-columns: minmax(320px, 0.75fr) minmax(520px, 1.25fr);
    grid-template-rows: auto auto auto;
    align-items: stretch;
  }

  .creation-layout { grid-template-columns: 250px minmax(0, 1fr); }

  .sky-scene {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 430px;
  }

  .mascot-card {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .task-panel {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }

  .wish-box {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .speech h2 {
    font-size: clamp(34px, 4.2vw, 50px);
  }

  .companion-panel { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mini-pegasus, .chat-card { grid-column: auto; }
  .bottom-world { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .hero-town {
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  }

  .task-panel {
    grid-template-columns: 1fr;
  }

  .task-card {
    min-height: 92px;
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    column-gap: 12px;
  }

  .task-card span {
    grid-row: 1 / 3;
    margin: 0;
  }
}

@media (max-width: 920px) {
  .town-shell { padding: 12px; }
  .town-topbar, .stage-head { align-items: flex-start; flex-direction: column; }
  .top-nav { width: 100%; overflow: auto; }
  .hero-town, .creation-layout, .town-map, .task-panel, .companion-panel { grid-template-columns: 1fr; }
  .sky-scene, .mascot-card, .task-panel, .wish-box {
    grid-column: auto;
    grid-row: auto;
  }
  .mascot-card { grid-template-columns: 1fr; }
  .pegasus { margin: 0 auto; }
  .wish-input, .chapter-strip, .magic-actions { grid-template-columns: 1fr; }
}
