:root {
  color-scheme: dark;
  --ink: #fff8ea;
  --muted: #cfc2ff;
  --deep: #09072f;
  --panel: rgba(34, 24, 92, 0.78);
  --panel-strong: rgba(54, 35, 129, 0.9);
  --line: rgba(208, 185, 255, 0.28);
  --violet: #8d5cf7;
  --violet-2: #c694ff;
  --mint: #62ead5;
  --mint-2: #9ff8de;
  --gold: #ffd35d;
  --orange: #f69b31;
  --cream: #fff4de;
  --nav-height: 92px;
  --shadow: 0 18px 45px rgba(2, 0, 18, 0.34);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", Verdana, sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(98, 234, 213, 0.14), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(255, 211, 93, 0.13), transparent 20%),
    linear-gradient(135deg, #09072f, #151052 58%, #07051f);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 211, 93, 0.78) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(98, 234, 213, 0.65) 0 1px, transparent 1.5px);
  background-size: 82px 82px, 137px 137px, 211px 211px;
  background-position: 8px 12px, 44px 18px, 30px 70px;
  opacity: 0.58;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

#sky-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
}

.screen {
  position: relative;
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) clamp(16px, 3vw, 44px) max(20px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
}

.screen::before {
  content: "";
  position: absolute;
  inset: auto -10% -24% -10%;
  height: 38%;
  background:
    radial-gradient(circle at 12% 70%, rgba(77, 239, 211, 0.12), transparent 26%),
    radial-gradient(circle at 80% 30%, rgba(255, 200, 80, 0.13), transparent 24%),
    linear-gradient(180deg, transparent, rgba(2, 0, 20, 0.56));
  pointer-events: none;
}

.loading {
  display: grid;
  place-items: center;
  font-size: clamp(1.3rem, 4vw, 2rem);
}

.topbar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin: 0 auto;
  width: min(1160px, 100%);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-left strong {
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.app-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(124, 83, 232, 0.9), rgba(70, 45, 174, 0.82));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 9px 18px rgba(6, 0, 35, 0.25);
}

.star-count,
.parent-button {
  border: 1px solid var(--line);
  background: rgba(69, 42, 142, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 18px rgba(3, 0, 24, 0.18);
  min-height: 42px;
}

.star-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1.1rem;
}

.parent-button {
  border-radius: 999px;
  padding: 8px 18px;
  color: #eadcff;
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(91, 56, 164, 0.72);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.back-button,
.modal-close {
  font-size: 1.35rem;
  font-weight: 900;
}

.button {
  border: 0;
  min-height: 48px;
  border-radius: 999px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 950;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow), inset 0 2px 0 rgba(255, 255, 255, 0.22);
  transition: transform 160ms ease, filter 160ms ease;
}

.button:hover,
.icon-button:hover,
.parent-button:hover,
.book-row:hover,
.dungeon-island:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.button:active,
.icon-button:active,
.parent-button:active,
.book-row:active,
.dungeon-island:active {
  transform: translateY(1px);
}

.button[disabled],
.icon-button[disabled],
.giant-mic[disabled],
.choice-card[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button-large {
  width: min(100%, 360px);
  min-height: 70px;
  font-size: clamp(1.1rem, 3.5vw, 1.55rem);
}

.button-wide {
  width: min(100%, 620px);
  min-height: 66px;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
}

.button-small {
  min-height: 42px;
  padding: 9px 16px;
}

.button-primary {
  background: linear-gradient(180deg, var(--mint-2), #43d6c3 60%, #23acaa);
  color: #072f46;
}

.button-soft {
  background: linear-gradient(180deg, #f3dcff, #d8b9ff 62%, #ad80f7);
  color: #2f1476;
}

.button-ghost {
  background: rgba(82, 50, 160, 0.72);
  border: 1px solid var(--line);
  color: #eee6ff;
}

.button-danger {
  background: linear-gradient(180deg, #ff917f, #df4d60);
  color: white;
}

.button-orb {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(12, 105, 126, 0.25);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.mic-symbol::before {
  content: "🎙";
}

.arrow-symbol::before {
  content: "➜";
}

.home-layout {
  position: relative;
  z-index: 2;
  min-height: calc(100svh - 80px);
  width: min(1160px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: clamp(20px, 5vw, 72px);
}

.home-copy {
  display: grid;
  gap: 18px;
  align-content: center;
}

.mini-rune,
.spark-crown {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 214, 91, 0.7);
  font-weight: 900;
}

.mini-rune {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 207, 87, 0.12);
  border: 1px solid rgba(255, 207, 87, 0.34);
}

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

h1 {
  font-weight: 950;
  line-height: 0.92;
  font-size: clamp(4rem, 9.5vw, 8.5rem);
  text-shadow: 0 6px 0 rgba(30, 13, 75, 0.38), 0 16px 30px rgba(0, 0, 0, 0.25);
}

h1 span {
  color: var(--mint-2);
}

.home-copy p {
  max-width: 480px;
  font-size: clamp(1.25rem, 2.7vw, 2rem);
  line-height: 1.15;
  font-weight: 900;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.listen-card {
  width: min(100%, 380px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(48, 31, 106, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.listen-card strong,
.listen-card span {
  display: block;
}

.listen-card span {
  color: var(--muted);
}

.home-art {
  position: relative;
  min-height: min(68svh, 620px);
  display: grid;
  place-items: center;
}

.home-art .ghost-hero {
  position: absolute;
  z-index: 3;
  right: 25%;
  top: 12%;
}

.lantern {
  position: absolute;
  right: 7%;
  bottom: 28%;
  width: clamp(90px, 15vw, 150px);
  height: clamp(120px, 18vw, 190px);
  border-radius: 44% 44% 32% 32%;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 225, 0.98), rgba(255, 211, 91, 0.88) 42%, rgba(233, 122, 32, 0.92) 72%),
    #ffbd4a;
  border: 5px solid #9d501c;
  box-shadow: 0 0 42px rgba(255, 180, 58, 0.65), inset 0 0 16px rgba(255, 255, 255, 0.42);
  transform: rotate(-9deg);
}

.lantern::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 64px;
  height: 72px;
  border: 8px solid #a45f24;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  transform: translateX(-50%);
}

.lantern span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9d4e14;
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  font-weight: 950;
}

.portal-door {
  position: absolute;
  right: 2%;
  top: 20%;
  width: clamp(140px, 23vw, 260px);
  height: clamp(210px, 35vw, 360px);
  border-radius: 999px 999px 8px 8px;
  background:
    radial-gradient(circle at 50% 68%, rgba(111, 252, 229, 0.8), transparent 24%),
    linear-gradient(135deg, #182561, #0d173f 54%, #3f267a);
  border: 8px solid rgba(180, 105, 48, 0.94);
  box-shadow: 0 0 34px rgba(78, 238, 214, 0.34), inset 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.portal-door.open::after,
.portal-swirl {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: conic-gradient(from 20deg, #fff, #ffd35d, #ad80f7, #62ead5, #fff);
  filter: blur(1px);
  animation: spin 3s linear infinite;
}

.home-stat-panel {
  position: absolute;
  left: 0;
  bottom: 8%;
  width: min(94%, 520px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--cream);
  color: #171044;
  box-shadow: var(--shadow);
}

.stat-pill {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 18px;
}

.stat-pill + .stat-pill {
  border-left: 1px solid rgba(58, 33, 93, 0.18);
}

.stat-pill .word-icon {
  grid-row: 1 / span 2;
}

.stat-pill strong {
  font-size: 1.6rem;
  line-height: 1;
}

.stat-pill span:last-child {
  color: #30255f;
  font-weight: 750;
  font-size: 0.92rem;
  line-height: 1.05;
}

.ghost {
  --ghost-w: 96px;
  position: relative;
  display: inline-block;
  width: var(--ghost-w);
  height: calc(var(--ghost-w) * 1.05);
  border-radius: 54% 48% 40% 44%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.95), transparent 16%),
    radial-gradient(circle at 70% 72%, rgba(255, 203, 172, 0.62), transparent 12%),
    linear-gradient(145deg, #ffffff, #fff7e8 48%, #e9e5ff);
  filter: drop-shadow(0 12px 22px rgba(46, 33, 114, 0.25));
  animation: floaty 4s ease-in-out infinite;
}

.ghost-art {
  display: inline-grid;
  place-items: center;
  background: transparent;
  border-radius: 0;
  filter: drop-shadow(0 16px 22px rgba(4, 0, 28, 0.22));
}

.ghost-art::after,
.ghost-art .ghost-face,
.ghost-art .ghost-arm {
  display: none;
}

.ghost-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ghost::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 12%;
  bottom: -11%;
  height: 28%;
  background: inherit;
  border-radius: 0 0 55% 35%;
  clip-path: polygon(0 0, 100% 0, 84% 55%, 66% 24%, 48% 68%, 28% 28%, 10% 62%);
}

.ghost-tiny {
  --ghost-w: 34px;
}

.ghost-small {
  --ghost-w: 94px;
}

.ghost-medium {
  --ghost-w: 150px;
}

.ghost-hero {
  --ghost-w: clamp(170px, 24vw, 310px);
}

.ghost-map {
  --ghost-w: clamp(125px, 15vw, 210px);
  position: absolute;
  left: 9%;
  top: 10%;
}

.ghost-scene {
  --ghost-w: clamp(190px, 23vw, 320px);
}

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

.eye {
  position: absolute;
  top: 35%;
  width: 10%;
  height: 16%;
  border-radius: 999px;
  background: #140d22;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.7);
}

.eye.left {
  left: 38%;
}

.eye.right {
  left: 58%;
}

.mouth {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 18%;
  height: 15%;
  border-radius: 50%;
  background: #28102b;
  transform: translateX(-50%);
}

.ghost-worried .eye {
  transform: rotate(8deg);
}

.ghost-worried .mouth {
  width: 15%;
  height: 12%;
  border: 3px solid #28102b;
  border-bottom: 0;
  background: transparent;
}

.ghost-curious .mouth {
  width: 12%;
}

.ghost-arm {
  position: absolute;
  z-index: 1;
  top: 52%;
  width: 26%;
  height: 17%;
  border-radius: 999px;
  background: linear-gradient(145deg, #fff, #e8e5ff);
}

.arm-left {
  left: -9%;
  transform: rotate(-25deg);
}

.arm-right {
  right: -11%;
  transform: rotate(28deg);
}

.centered-screen {
  display: grid;
  grid-template-rows: auto 1fr;
}

.mic-check-card {
  width: min(100%, 780px);
  margin: auto;
  display: grid;
  place-items: center;
  gap: clamp(10px, 1.9vh, 16px);
  text-align: center;
}

.mic-check-card h1,
.completion-copy h1,
.spellbook-title h1,
.map-heading h1 {
  font-size: clamp(3rem, 8vw, 6.5rem);
}

.mic-check-card h1 {
  font-size: clamp(2.65rem, 6vw, 4.8rem);
}

.mic-check-card h1 span,
.map-heading p,
.spellbook-title p,
.completion-copy p {
  color: var(--mint-2);
}

.say-bubble,
.speech-bubble {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(43, 29, 102, 0.84);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.say-bubble {
  border-radius: 999px;
  padding: 12px 30px;
  font-size: clamp(1.35rem, 4vw, 2.35rem);
  font-weight: 950;
}

.say-bubble strong {
  color: var(--gold);
}

.mic-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 7vw, 80px);
  min-height: 170px;
}

.giant-mic {
  --mic-rim: rgba(228, 204, 255, 0.9);
  --mic-highlight: #c694ff;
  --mic-mid: #8d5cf7;
  --mic-edge: #4a2aae;
  --mic-ring: rgba(198, 148, 255, 0.16);
  --mic-glow: rgba(141, 92, 247, 0.4);
  --mic-pin: rgba(255, 211, 93, 0.12);
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(112px, 18vw, 174px);
  aspect-ratio: 1;
  border: 7px solid var(--mic-rim);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 50% 52%, var(--mic-highlight), var(--mic-mid) 60%, var(--mic-edge));
  box-shadow:
    0 0 0 12px var(--mic-ring),
    0 0 36px var(--mic-glow),
    0 0 0 1px var(--mic-pin),
    inset 0 8px 12px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  color: white;
  font-size: clamp(3rem, 8vw, 5rem);
}

.giant-mic.is-listening {
  --mic-rim: #b7fff3;
  --mic-highlight: #85fff0;
  --mic-mid: #29cbbb;
  --mic-edge: #12868a;
  --mic-ring: rgba(98, 234, 213, 0.15);
  --mic-glow: rgba(98, 234, 213, 0.55);
  --mic-pin: rgba(255, 211, 93, 0.16);
  animation: micPulse 700ms ease-in-out infinite alternate;
}

.giant-mic .mic-symbol::before {
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.14));
}

.privacy-note {
  display: flex;
  gap: 14px;
  align-items: center;
  width: min(100%, 640px);
  padding: 16px 18px;
  border-radius: 8px;
  text-align: left;
  background: rgba(56, 39, 123, 0.82);
  border: 1px solid var(--line);
}

.privacy-note span,
.privacy-copy span {
  display: block;
  color: var(--muted);
}

.shield {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(180deg, #a678ff, #6337db);
  font-weight: 950;
}

.stepper {
  display: flex;
  align-items: center;
  width: min(100%, 480px);
}

.stepper span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(65, 43, 130, 0.8);
  color: var(--muted);
  border: 2px solid rgba(255, 255, 255, 0.18);
  font-weight: 950;
}

.stepper span.active {
  background: linear-gradient(180deg, #b487ff, #7146e8);
  color: white;
}

.stepper i {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
}

.map-heading,
.spellbook-title {
  position: relative;
  z-index: 2;
  margin: clamp(12px, 2vw, 28px) auto 0;
  width: min(1160px, 100%);
  text-align: center;
}

.map-heading p,
.spellbook-title p {
  font-weight: 900;
  font-size: clamp(1rem, 2.5vw, 1.45rem);
}

.dungeon-map {
  position: relative;
  z-index: 2;
  width: min(1160px, 100%);
  min-height: min(68svh, 700px);
  margin: 22px auto var(--nav-height);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 48%, rgba(71, 211, 197, 0.2), transparent 20%),
    radial-gradient(circle at 72% 30%, rgba(252, 195, 78, 0.16), transparent 20%),
    rgba(6, 10, 43, 0.42);
  box-shadow: inset 0 0 70px rgba(11, 4, 45, 0.8), var(--shadow);
  overflow: hidden;
}

.map-notice {
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: calc(var(--nav-height) + max(24px, env(safe-area-inset-bottom)));
  width: min(620px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 244, 222, 0.96);
  color: #21164d;
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 950;
}

.dungeon-map::before {
  content: "";
  position: absolute;
  inset: 8%;
  background:
    radial-gradient(ellipse at 20% 72%, rgba(63, 116, 126, 0.82), transparent 14%),
    radial-gradient(ellipse at 46% 47%, rgba(63, 116, 126, 0.68), transparent 18%),
    radial-gradient(ellipse at 74% 35%, rgba(63, 116, 126, 0.7), transparent 16%),
    radial-gradient(ellipse at 68% 76%, rgba(63, 116, 126, 0.54), transparent 12%);
  filter: blur(8px);
  opacity: 0.9;
}

.dungeon-island {
  position: absolute;
  z-index: 3;
  width: clamp(190px, 22vw, 290px);
  min-height: 132px;
  border: 0;
  border-radius: 8px;
  padding: 18px 18px 18px 76px;
  text-align: left;
  background: linear-gradient(180deg, #fff9ef, #eee0ff);
  color: #20124e;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.dungeon-island strong,
.dungeon-island small,
.dungeon-island em {
  position: relative;
  z-index: 2;
  display: block;
}

.dungeon-island strong {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.05;
}

.dungeon-island small {
  margin-top: 6px;
  color: #4b3678;
  font-weight: 900;
}

.dungeon-island em {
  position: absolute;
  right: 16px;
  top: -18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: #613000;
  font-style: normal;
  font-weight: 950;
}

.dungeon-island.locked {
  filter: grayscale(0.35) brightness(0.78);
  opacity: 0.75;
}

.island-1 {
  left: 9%;
  bottom: 23%;
}

.island-2 {
  left: 48%;
  top: 19%;
}

.island-3 {
  right: 7%;
  top: 49%;
}

.island-4 {
  left: 50%;
  bottom: 8%;
}

.island-art {
  position: absolute;
  left: 12px;
  top: 15px;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(145deg, #69eedc, #1f9d9c);
  box-shadow: 0 8px 18px rgba(35, 123, 127, 0.25);
  display: grid;
  place-items: center;
  overflow: visible;
}

.island-sprite {
  width: 82px;
  height: 82px;
  object-fit: contain;
  transform: translate(-12px, -17px);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18));
}

.island-noodle {
  background: linear-gradient(145deg, #ffd36b, #f08a25);
}

.island-sock {
  background: linear-gradient(145deg, #c394ff, #6d44d8);
}

.island-tower {
  background: linear-gradient(145deg, #ffb779, #7b55df);
}

.dungeon-badge {
  position: absolute;
  left: -16px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #7ff2dc, #24aaa4);
  color: white;
  font-size: 1.5rem;
  font-weight: 950;
  border: 4px solid rgba(255, 255, 255, 0.72);
}

.lock,
.complete-mark {
  position: absolute;
  right: -12px;
  bottom: -12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 22, 50, 0.84);
}

.complete-mark {
  background: #21bca5;
  color: white;
  font-weight: 950;
}

.path-line {
  position: absolute;
  z-index: 2;
  height: 6px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 12px, transparent 12px 24px);
  opacity: 0.8;
}

.path-a {
  width: 38%;
  left: 30%;
  top: 44%;
  transform: rotate(-18deg);
}

.path-b {
  width: 35%;
  right: 18%;
  top: 67%;
  transform: rotate(20deg);
}

.dungeon-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  gap: 16px;
  min-height: 0;
  max-height: calc(100svh - 230px);
  padding: clamp(18px, 2.4vw, 28px);
  overflow: auto;
}

.dungeon-map::before,
.path-line,
.ghost-map {
  display: none;
}

.dungeon-island,
.island-1,
.island-2,
.island-3,
.island-4 {
  position: relative;
  inset: auto;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: 100%;
}

/* Visual polish pass: keeps behavior unchanged while making shared surfaces feel hand-finished. */
:root {
  --panel-glass: rgba(38, 22, 96, 0.72);
  --panel-glass-strong: rgba(51, 28, 124, 0.86);
  --panel-rim: rgba(181, 138, 255, 0.58);
  --panel-rim-hot: rgba(255, 205, 95, 0.78);
  --cream-lit: #fff4dc;
  --deep-glow: rgba(97, 67, 202, 0.52);
  --card-radius: 14px;
  --polish-shadow: 0 22px 48px rgba(2, 0, 20, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body {
  background:
    radial-gradient(circle at 16% 22%, rgba(77, 226, 224, 0.18), transparent 19%),
    radial-gradient(circle at 86% 12%, rgba(168, 104, 255, 0.22), transparent 22%),
    radial-gradient(circle at 78% 86%, rgba(255, 194, 76, 0.1), transparent 24%),
    linear-gradient(145deg, #070424 0%, #10094d 48%, #06031c 100%);
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 211, 93, 0.85) 0 1.4px, transparent 2px),
    radial-gradient(circle, rgba(98, 234, 213, 0.72) 0 1.2px, transparent 1.9px);
  opacity: 0.66;
}

.screen::before {
  height: 46%;
  background:
    radial-gradient(ellipse at 12% 92%, rgba(68, 239, 222, 0.17), transparent 30%),
    radial-gradient(ellipse at 84% 65%, rgba(151, 91, 255, 0.18), transparent 32%),
    linear-gradient(180deg, transparent 0%, rgba(3, 0, 24, 0.7) 100%);
}

.topbar {
  width: min(1240px, 100%);
}

.app-icon,
.icon-button,
.star-count,
.parent-button,
.bottom-nav {
  border-color: rgba(208, 185, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(132, 85, 238, 0.86), rgba(67, 39, 154, 0.76)),
    rgba(44, 28, 106, 0.86);
  box-shadow: 0 10px 24px rgba(6, 0, 35, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.parent-button {
  color: #f1e8ff;
}

.map-heading,
.spellbook-title {
  margin-top: clamp(6px, 1.6vw, 18px);
}

.map-heading h1,
.spellbook-title h1 {
  color: var(--cream);
  text-shadow: 0 6px 0 rgba(49, 20, 113, 0.62), 0 0 34px rgba(176, 124, 255, 0.28);
}

.map-heading p,
.spellbook-title p,
.task-line {
  color: var(--mint-2);
  text-shadow: 0 2px 10px rgba(28, 237, 208, 0.2);
}

.dungeon-map {
  isolation: isolate;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 14px);
  width: min(1240px, 100%);
  max-height: calc(100svh - 270px);
  margin-top: 14px;
  padding: clamp(16px, 1.9vw, 22px);
  border: 2px solid rgba(133, 127, 255, 0.45);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 20% 16%, rgba(91, 242, 222, 0.18), transparent 32%),
    radial-gradient(ellipse at 74% 18%, rgba(255, 203, 83, 0.13), transparent 28%),
    radial-gradient(ellipse at 55% 86%, rgba(137, 93, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(9, 12, 59, 0.78), rgba(7, 6, 42, 0.88));
  box-shadow:
    0 0 0 1px rgba(206, 186, 255, 0.1),
    0 28px 68px rgba(3, 0, 26, 0.46),
    inset 0 0 72px rgba(105, 75, 217, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.dungeon-map::before {
  content: "";
  display: block;
  position: absolute;
  inset: 10% 5% 12%;
  z-index: -1;
  background:
    radial-gradient(ellipse at 15% 70%, rgba(84, 239, 220, 0.22), transparent 16%),
    radial-gradient(ellipse at 46% 38%, rgba(255, 211, 93, 0.16), transparent 18%),
    radial-gradient(ellipse at 82% 72%, rgba(142, 93, 255, 0.21), transparent 20%);
  filter: blur(12px);
  opacity: 0.95;
}

.dungeon-map::after {
  content: "";
  position: absolute;
  inset: 42px 42px 52px;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 10%, rgba(255, 211, 93, 0.42) 10% 12%, transparent 12% 33%, rgba(255, 211, 93, 0.32) 33% 35%, transparent 35% 61%, rgba(255, 211, 93, 0.25) 61% 63%, transparent 63%),
    radial-gradient(circle, rgba(255, 211, 93, 0.42) 0 2px, transparent 2.6px);
  background-size: 100% 100%, 36px 36px;
  mask-image: linear-gradient(90deg, transparent 0%, black 10% 90%, transparent 100%);
  opacity: 0.34;
}

.dungeon-island {
  z-index: 2;
  min-height: 108px;
  padding: 12px 40px 12px 86px;
  border: 1px solid rgba(221, 200, 255, 0.36);
  border-radius: 18px;
  color: var(--cream);
  background:
    linear-gradient(115deg, rgba(77, 42, 150, 0.96), rgba(38, 23, 98, 0.9) 54%, rgba(28, 21, 76, 0.88)),
    rgba(33, 22, 92, 0.92);
  box-shadow:
    0 18px 36px rgba(2, 0, 24, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 28px rgba(132, 92, 245, 0.12);
  overflow: visible;
}

.dungeon-island::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(circle at 86% 18%, rgba(255, 211, 93, 0.16), transparent 18%),
    linear-gradient(90deg, rgba(98, 234, 213, 0.11), transparent 46%);
  opacity: 0.82;
}

.dungeon-island.next-up,
.dungeon-island.complete {
  border-color: var(--panel-rim-hot);
  box-shadow:
    0 20px 42px rgba(2, 0, 24, 0.38),
    0 0 28px rgba(255, 211, 93, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dungeon-island.unlocked:not(.complete) {
  border-color: rgba(112, 247, 226, 0.5);
}

.dungeon-island.locked {
  filter: none;
  opacity: 0.78;
  background:
    linear-gradient(115deg, rgba(67, 55, 116, 0.72), rgba(35, 28, 77, 0.8)),
    rgba(31, 28, 70, 0.9);
}

.dungeon-island strong {
  color: #fff8ea;
  font-size: clamp(1rem, 1.65vw, 1.3rem);
  text-shadow: 0 3px 0 rgba(14, 4, 42, 0.42);
}

.dungeon-island small,
.dungeon-island .dungeon-meta {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  color: #decfff;
  font-size: 0.84rem;
  line-height: 1.12;
}

.dungeon-island .dungeon-meta span {
  display: block;
  max-width: 100%;
}

.dungeon-island small span:first-child,
.dungeon-island .dungeon-status {
  color: var(--mint-2);
  font-weight: 950;
  white-space: nowrap;
}

.dungeon-island small span:last-child,
.dungeon-island .dungeon-detail {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dungeon-island em {
  right: 12px;
  top: -16px;
  border: 1px solid rgba(255, 246, 202, 0.7);
  background: linear-gradient(180deg, #ffe589, #f3a834);
  color: #573000;
  box-shadow: 0 8px 20px rgba(255, 169, 50, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.island-art {
  left: 12px;
  top: 50%;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.34), transparent 20%),
    linear-gradient(145deg, rgba(113, 251, 226, 0.95), rgba(73, 55, 196, 0.92));
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.22),
    0 0 18px rgba(98, 234, 213, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.island-sprite {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  border-radius: inherit;
  filter: saturate(1.08) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
}

.island-bubble .island-sprite {
  width: 112%;
  height: 112%;
  object-fit: contain;
  transform: translate(-6%, -7%);
}

.island-symbol {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff8ea;
  font-size: 2.15rem;
  font-weight: 950;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.36);
}

.theme-noodle .island-art,
.island-noodle {
  background: linear-gradient(145deg, #ffd77c, #d9722c 58%, #6d35c6);
}

.theme-garden .island-art {
  background: linear-gradient(145deg, #8df0b1, #2b9b80 55%, #6143c8);
}

.theme-school .island-art {
  background: linear-gradient(145deg, #ffe184, #a86df4 58%, #4a3897);
}

.theme-color .island-art {
  background: conic-gradient(from 25deg, #68f0db, #a76dff, #ffd35d, #ff6e8a, #68f0db);
}

.theme-tower .island-art,
.island-tower {
  background: linear-gradient(145deg, #ffbd82, #8f63e6 62%, #2a2b74);
}

.theme-house .island-art {
  background: linear-gradient(145deg, #ffe4a7, #43c6b7 56%, #6d44d8);
}

.theme-feelings .island-art {
  background: linear-gradient(145deg, #ffb9d6, #8b74f5 58%, #33b7b2);
}

.theme-park .island-art {
  background: linear-gradient(145deg, #aef68b, #36a688 58%, #4b43c7);
}

.theme-market .island-art {
  background: linear-gradient(145deg, #ffe08a, #e07947 58%, #5c43b8);
}

.theme-weather .island-art {
  background: linear-gradient(145deg, #b6efff, #6f86ff 56%, #3a2679);
}

.theme-castle .island-art {
  background: linear-gradient(145deg, #d2c0ff, #7e57dc 58%, #21164d);
}

.dungeon-badge {
  left: -14px;
  bottom: 12px;
  width: 46px;
  height: 46px;
  background: radial-gradient(circle at 35% 28%, #bffdf2, #35c8b7 58%, #1d827e);
  border-color: rgba(218, 255, 247, 0.76);
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.25), 0 0 16px rgba(98, 234, 213, 0.28);
}

.lock,
.complete-mark {
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(224, 213, 255, 0.32);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.lock {
  color: #b7accf;
}

.complete-mark {
  background: linear-gradient(180deg, #67f2dd, #22aaa0);
  color: white;
}

.bottom-nav {
  width: min(500px, calc(100% - 28px));
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(62, 43, 139, 0.9), rgba(31, 20, 86, 0.9)),
    rgba(40, 26, 96, 0.92);
}

.bottom-nav button.active {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(180deg, rgba(130, 91, 245, 0.98), rgba(70, 42, 169, 0.96));
  color: var(--mint-2);
  box-shadow: 0 0 18px rgba(176, 124, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.scene-panel,
.play-panel,
.settings-panel,
.dashboard-card,
.book-page,
.unlock-card {
  border: 1px solid var(--panel-rim);
  border-radius: var(--card-radius);
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, var(--panel-glass-strong), var(--panel-glass));
  box-shadow: var(--polish-shadow);
}

.scene-panel {
  border-radius: 18px;
}

.scene-panel::before {
  display: block;
  background:
    linear-gradient(180deg, rgba(10, 5, 35, 0.12), rgba(7, 4, 24, 0.46)),
    var(--scene-backdrop),
    radial-gradient(ellipse at 48% 72%, rgba(65, 228, 217, 0.16), transparent 34%),
    radial-gradient(circle at 18% 24%, rgba(255, 211, 93, 0.1), transparent 18%),
    radial-gradient(circle, rgba(255, 255, 255, 0.22) 0 1px, transparent 1.6px),
    linear-gradient(180deg, rgba(13, 8, 56, 0.3), rgba(12, 7, 50, 0.72));
  background-size: auto, cover, auto, auto, 92px 92px, auto;
  background-position: center;
  opacity: 1;
}

.speech-bubble,
.say-bubble {
  border-color: rgba(207, 183, 255, 0.44);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(70, 42, 151, 0.92), rgba(41, 28, 104, 0.9));
  box-shadow: 0 15px 30px rgba(2, 0, 24, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.stage-label {
  border: 1px solid rgba(211, 188, 255, 0.32);
  background: linear-gradient(180deg, rgba(132, 84, 235, 0.88), rgba(78, 47, 174, 0.84));
  box-shadow: 0 9px 18px rgba(12, 2, 42, 0.22);
}

.play-panel {
  align-content: start;
}

.target-card,
.choice-card,
.whole-spell-card,
.parent-gate {
  border: 1px solid rgba(255, 231, 180, 0.58);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.62), transparent 22%),
    linear-gradient(180deg, #fff7e8, #f4dfbb);
  box-shadow: 0 13px 28px rgba(4, 0, 30, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.target-card .word-icon,
.choice-card .word-icon,
.book-row .word-icon,
.dashboard-card .word-icon,
.attempt-row .word-icon {
  border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.34), 0 9px 16px rgba(31, 11, 76, 0.22);
}

.target-card .word-icon {
  width: clamp(64px, 7vw, 78px);
  height: clamp(64px, 7vw, 78px);
  font-size: clamp(2.35rem, 4.8vw, 3.35rem);
}

.choice-card .word-icon {
  width: clamp(64px, 6.2vw, 82px);
  height: clamp(64px, 6.2vw, 82px);
  font-size: clamp(2.25rem, 4.1vw, 3.25rem);
}

.mic-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}

.round-tool {
  border: 1px solid rgba(208, 185, 255, 0.38);
  background: linear-gradient(180deg, rgba(113, 72, 206, 0.9), rgba(58, 36, 139, 0.9));
  box-shadow: 0 10px 20px rgba(4, 0, 30, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.listen-first-tool {
  border-color: rgba(255, 229, 137, 0.92);
  background: radial-gradient(circle at 32% 24%, #fff3b5, #f3a834 58%, #7a4bee);
  color: #171044;
  box-shadow:
    0 0 0 4px rgba(255, 229, 137, 0.24),
    0 0 28px rgba(255, 204, 92, 0.38),
    0 12px 24px rgba(4, 0, 30, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.52);
  animation: listen-first-glow 1.35s ease-in-out infinite;
}

.speech-mode-pill,
.hint-box {
  border: 1px solid rgba(197, 177, 255, 0.24);
  border-radius: 12px;
  background: rgba(12, 7, 51, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.listen-first-pill {
  border-color: rgba(255, 229, 137, 0.52);
  color: #fff2a8;
  background: linear-gradient(180deg, rgba(75, 49, 154, 0.78), rgba(28, 16, 83, 0.78));
  box-shadow:
    0 0 0 1px rgba(255, 229, 137, 0.14),
    0 0 20px rgba(255, 205, 92, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes listen-first-glow {
  0%,
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: brightness(1.1);
    transform: translateY(-1px);
  }
}

.feedback {
  border-radius: 14px;
}

.book {
  width: min(1120px, 100%);
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.38)) drop-shadow(0 0 24px rgba(132, 92, 245, 0.2));
}

.book::after {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 207, 92, 0.36), rgba(143, 91, 255, 0.4), rgba(98, 234, 213, 0.18));
  filter: blur(10px);
}

.book-page {
  min-height: 548px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 232, 164, 0.38), transparent 18%),
    radial-gradient(circle at 84% 92%, rgba(154, 92, 255, 0.1), transparent 22%),
    linear-gradient(180deg, #fff1d4, #f2d8aa);
  border-color: rgba(145, 90, 58, 0.28);
  box-shadow: inset 0 0 28px rgba(117, 74, 33, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.book-page:first-child {
  border-radius: 18px 4px 4px 18px;
}

.book-page:last-child {
  border-radius: 4px 18px 18px 4px;
}

.book-page h2,
.badge-shelf h3 {
  color: #278a7d;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.34);
}

.book-row {
  min-height: 70px;
  border-color: rgba(118, 80, 46, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 251, 241, 0.86), rgba(255, 243, 217, 0.8));
  box-shadow: 0 8px 16px rgba(115, 69, 28, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.book-row.learned {
  border-color: rgba(255, 197, 65, 0.44);
}

.book-row.locked {
  opacity: 0.58;
  background: rgba(255, 244, 222, 0.48);
}

.stars {
  color: #ffbd30;
  text-shadow: 0 1px 0 white, 0 0 10px rgba(255, 189, 48, 0.24);
}

.badge-shelf {
  border-color: rgba(118, 80, 46, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 211, 93, 0.18), transparent 28%),
    rgba(138, 88, 173, 0.1);
}

.badge {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(126, 86, 54, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(94, 76, 108, 0.22), rgba(74, 58, 92, 0.16));
  filter: grayscale(0.8) opacity(0.58);
  overflow: hidden;
}

.badge.earned {
  filter: none;
  background: linear-gradient(180deg, rgba(255, 223, 122, 0.42), rgba(160, 97, 236, 0.2));
  box-shadow: 0 10px 18px rgba(101, 56, 20, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.badge-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  filter: saturate(1.08) contrast(1.03);
}

.badge-symbol {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #6c4d84;
  font-weight: 950;
  font-size: 1.3rem;
}

.badge.earned .badge-symbol {
  color: #fff8ea;
  text-shadow: 0 2px 10px rgba(40, 18, 78, 0.42);
}

.dashboard-card {
  background:
    radial-gradient(circle at 16% 12%, rgba(98, 234, 213, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(44, 27, 108, 0.88), rgba(31, 22, 82, 0.82));
}

.settings-panel {
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 211, 93, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(43, 27, 103, 0.9), rgba(31, 22, 82, 0.86));
}

.attempt-row,
.privacy-copy {
  border: 1px solid rgba(197, 177, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.completion-copy h1 {
  text-shadow: 0 5px 0 rgba(42, 20, 105, 0.46), 0 0 32px rgba(98, 234, 213, 0.18);
}

.unlock-card {
  border-color: rgba(255, 211, 93, 0.34);
  background:
    radial-gradient(circle at 50% 35%, rgba(98, 234, 213, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(45, 27, 111, 0.88), rgba(23, 16, 68, 0.88));
}

.unlock-stat {
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

@media (max-width: 1060px) {
  .dungeon-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dungeon-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    min-height: 0;
    padding: 16px;
  }

  .dungeon-map::after {
    opacity: 0.18;
  }

  .dungeon-island,
  .island-1,
  .island-2,
  .island-3,
  .island-4 {
    width: 100%;
    min-height: 120px;
    padding-left: 92px;
  }

  .encounter-layout {
    min-height: auto;
  }

  .scene-panel,
  .play-panel {
    border-radius: 16px;
  }

  .book-page,
  .book-page:first-child,
  .book-page:last-child {
    border-radius: 18px;
  }
}

@media (max-width: 560px) {
  .map-heading h1,
  .spellbook-title h1 {
    font-size: clamp(3rem, 15vw, 4.4rem);
  }

  .dungeon-map {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: calc(var(--nav-height) + 18px);
    border-radius: 18px;
  }

  .dungeon-island,
  .island-1,
  .island-2,
  .island-3,
  .island-4 {
    min-height: 116px;
    padding: 14px 42px 14px 88px;
  }

  .island-art {
    width: 66px;
    height: 66px;
    left: 11px;
  }

  .dungeon-badge {
    width: 44px;
    height: 44px;
    left: -10px;
    bottom: 10px;
    font-size: 1.25rem;
  }

  .lock,
  .complete-mark {
    width: 34px;
    height: 34px;
    right: 10px;
    bottom: 10px;
  }

  .bottom-nav {
    width: min(340px, calc(100% - 28px));
  }

  .book {
    margin-top: 16px;
  }

  .book-page {
    padding: 18px;
  }

  .badge {
    width: 50px;
    height: 50px;
  }
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  width: min(680px, calc(100% - 28px));
  min-height: 70px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(42, 28, 99, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 3px;
  cursor: pointer;
}

.bottom-nav button.active {
  background: linear-gradient(180deg, rgba(114, 89, 231, 0.92), rgba(57, 37, 133, 0.92));
  color: #86f5df;
}

.storage-warning {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(var(--nav-height) + max(22px, env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 211, 93, 0.42);
  border-radius: 16px;
  background: rgba(32, 21, 74, 0.94);
  color: var(--cream);
  text-align: center;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.bottom-nav span {
  font-size: 1.5rem;
  line-height: 1;
}

.bottom-nav strong {
  font-size: 0.86rem;
  white-space: nowrap;
}

.submap-screen,
.node-intro-screen,
.node-complete-screen {
  padding-bottom: calc(var(--nav-height) + 28px);
}

.node-intro-screen::before,
.node-complete-screen::before,
.completion-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(9, 4, 37, 0.36), rgba(9, 4, 37, 0.86)),
    var(--dungeon-backdrop),
    radial-gradient(circle at 18% 20%, rgba(98, 234, 213, 0.18), transparent 28%),
    radial-gradient(circle at 80% 28%, rgba(255, 211, 93, 0.13), transparent 24%);
  background-size: auto, cover, auto, auto;
  background-position: center;
  pointer-events: none;
}

.submap-heading,
.node-intro-layout,
.node-complete-layout {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  margin-inline: auto;
}

.submap-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(14px, 2vw, 24px);
}

.submap-kicker {
  display: block;
  color: var(--mint-2);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.submap-heading h1,
.node-story h1,
.node-complete-copy h1 {
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 0.95;
}

.node-complete-copy h1 {
  font-size: clamp(2.7rem, 6vw, 4.65rem);
}

.submap-heading p,
.node-story p,
.node-complete-copy p {
  color: var(--mint-2);
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 900;
  line-height: 1.15;
}

.submap-progress-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(100%, 250px);
  padding: 14px 16px;
  border: 1px solid var(--panel-rim);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(49, 29, 121, 0.9), rgba(30, 20, 83, 0.88));
  box-shadow: var(--polish-shadow);
}

.submap-star-pill,
.submap-room-count {
  display: grid;
  align-items: center;
}

.submap-star-pill {
  grid-template-columns: auto auto;
  gap: 2px 8px;
  min-width: 82px;
}

.submap-star-pill .word-icon {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
}

.submap-room-count {
  gap: 3px;
  min-width: 120px;
}

.submap-room-count strong {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1;
}

.submap-star-pill strong {
  font-size: 1.25rem;
  line-height: 1;
}

.submap-progress-card span {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.05;
}

.submap-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: clamp(12px, 1.8vw, 18px);
  width: min(1180px, 100%);
  margin: 18px auto var(--nav-height);
  padding: clamp(14px, 2vw, 22px);
  border: 2px solid rgba(133, 127, 255, 0.44);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 22% 18%, rgba(98, 234, 213, 0.18), transparent 32%),
    radial-gradient(ellipse at 78% 78%, rgba(255, 211, 93, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(9, 12, 59, 0.78), rgba(7, 6, 42, 0.9));
  box-shadow: var(--polish-shadow);
  overflow: hidden;
}

.submap-path-line {
  position: absolute;
  inset: 50% 7% auto;
  z-index: 0;
  height: 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(255, 211, 93, 0.72) 0 12px, transparent 12px 24px);
  opacity: 0.36;
}

.room-node {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.room-main {
  position: relative;
  min-height: 188px;
  width: 100%;
  border: 1px solid rgba(221, 200, 255, 0.36);
  border-radius: 18px;
  padding: 16px 14px 14px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(180deg, rgba(71, 43, 157, 0.94), rgba(32, 22, 88, 0.94));
  box-shadow: 0 18px 36px rgba(2, 0, 24, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  text-align: center;
}

.room-node.current .room-main {
  border-color: rgba(105, 247, 226, 0.84);
  box-shadow: 0 0 26px rgba(98, 234, 213, 0.24), 0 18px 36px rgba(2, 0, 24, 0.34);
}

.room-node.complete .room-main {
  border-color: rgba(255, 211, 93, 0.76);
}

.room-node.locked .room-main {
  opacity: 0.68;
  filter: grayscale(0.38);
  background: linear-gradient(180deg, rgba(66, 55, 119, 0.76), rgba(31, 27, 78, 0.86));
}

.room-orb,
.node-big-orb {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #e9fff9, #5cebd8 46%, #5c3fd3);
  box-shadow: 0 0 0 7px rgba(98, 234, 213, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.34);
}

.room-orb .word-icon,
.node-big-orb .word-icon {
  width: 54px;
  height: 54px;
  font-size: 2.05rem;
}

.room-number {
  position: absolute;
  left: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, #9ff8de, #27b7a9);
  color: #092d45;
  font-weight: 950;
}

.room-main strong {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.05;
}

.room-main small,
.room-progress {
  color: var(--muted);
  font-weight: 900;
}

.room-progress {
  display: block;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(12, 7, 51, 0.5);
}

.room-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.node-intro-layout,
.node-complete-layout {
  min-height: calc(100svh - 110px);
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(300px, 0.8fr);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
}

.node-complete-layout {
  min-height: calc(100svh - 132px);
  padding-block: 14px;
}

.node-story,
.node-complete-copy {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(221, 200, 255, 0.28);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(28, 18, 80, 0.84), rgba(17, 12, 55, 0.9));
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.node-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.node-target-chip,
.room-reward {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 231, 180, 0.45);
  border-radius: 14px;
  background: rgba(255, 244, 222, 0.94);
  color: #20154a;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(2, 0, 24, 0.18);
}

.node-target-chip .word-icon,
.room-reward .word-icon {
  width: 40px;
  height: 40px;
  font-size: 1.55rem;
}

.node-preview,
.node-complete-art {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  border: 1px solid rgba(221, 200, 255, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(98, 234, 213, 0.18), transparent 31%),
    linear-gradient(180deg, rgba(30, 18, 88, 0.42), rgba(13, 8, 46, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.node-preview .ghost-hero,
.node-complete-art .ghost-hero {
  position: relative;
  z-index: 2;
}

.node-complete-art {
  padding: clamp(18px, 2.5vw, 30px);
}

.node-complete-art .ghost-hero {
  --ghost-w: clamp(150px, 20vw, 250px);
}

.node-big-orb {
  width: clamp(128px, 18vw, 190px);
  height: clamp(128px, 18vw, 190px);
}

.node-complete-art .node-big-orb {
  width: clamp(112px, 14vw, 158px);
  height: clamp(112px, 14vw, 158px);
}

.node-big-orb .word-icon {
  width: 72%;
  height: 72%;
  font-size: clamp(2.4rem, 6vw, 4.3rem);
}

.node-big-orb.complete {
  background: radial-gradient(circle at 34% 24%, #fff8d6, #ffd35d 46%, #6a48e5);
  box-shadow: 0 0 38px rgba(255, 211, 93, 0.34), inset 0 2px 0 rgba(255, 255, 255, 0.36);
}

.room-reward {
  width: min(100%, 430px);
}

.room-reward strong,
.room-reward span {
  display: block;
}

.encounter-screen {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.encounter-progress {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.4vw, 14px);
  width: min(720px, 92%);
  margin: 6px auto 16px;
}

.encounter-progress span {
  height: 9px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.encounter-progress span.done {
  background: linear-gradient(90deg, var(--gold), var(--orange));
}

.encounter-progress span.active {
  background: linear-gradient(90deg, var(--mint), var(--violet-2));
  box-shadow: 0 0 18px rgba(98, 234, 213, 0.55);
}

.progress-meter {
  flex: 1;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.progress-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--mint), var(--violet-2));
  box-shadow: 0 0 18px rgba(98, 234, 213, 0.45);
}

.encounter-progress small {
  min-width: 68px;
  color: var(--muted);
  font-weight: 950;
  text-align: right;
}

.encounter-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(320px, 0.85fr);
  align-items: stretch;
  gap: clamp(18px, 3vw, 34px);
  width: min(1160px, 100%);
  margin: 0 auto;
  min-height: calc(100svh - 150px);
}

.scene-panel,
.play-panel,
.settings-panel,
.dashboard-card,
.book-page,
.unlock-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.scene-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 540px;
  overflow: hidden;
  padding: clamp(16px, 2vw, 24px);
}

.scene-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 5, 35, 0.08), rgba(7, 4, 24, 0.46)),
    var(--scene-backdrop),
    linear-gradient(90deg, rgba(12, 8, 37, 0.2), rgba(12, 8, 37, 0)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 54px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 70px);
  background-size: auto, cover, auto, auto, auto;
  background-position: center;
  opacity: 0.7;
}

.stage-label {
  position: relative;
  z-index: 2;
  justify-self: start;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(99, 64, 195, 0.68);
  color: #e9ddff;
  font-size: 0.9rem;
  font-weight: 950;
}

.speech-bubble {
  z-index: 2;
  justify-self: center;
  width: min(100%, 560px);
  margin: clamp(10px, 2vw, 24px) 0 0;
  padding: clamp(16px, 2.4vw, 24px);
  border-radius: 8px;
  text-align: center;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 30%;
  top: 100%;
  width: 22px;
  height: 22px;
  background: inherit;
  transform: rotate(45deg) translateY(-13px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.speech-bubble strong,
.speech-bubble span {
  display: block;
}

.speech-bubble strong {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}

.speech-bubble span {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.25;
}

.scene-visual {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}

.scene-ghost-wrap {
  position: absolute;
  left: clamp(10px, 5vw, 70px);
  bottom: clamp(20px, 8vw, 95px);
  z-index: 4;
}

.object {
  position: absolute;
  z-index: 3;
  right: clamp(12px, 7vw, 95px);
  bottom: clamp(34px, 7vw, 86px);
  display: grid;
  place-items: center;
  width: clamp(136px, 18vw, 230px);
  height: clamp(136px, 18vw, 230px);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(36, 30, 89, 0.96), rgba(68, 44, 137, 0.92));
  border: 2px solid rgba(206, 186, 255, 0.24);
  box-shadow: inset 0 0 26px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.3);
}

.object-art {
  width: clamp(180px, 23vw, 300px);
  height: clamp(180px, 23vw, 300px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}

.object-sprite {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.28));
}

.object strong {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-size: clamp(2.1rem, 5vw, 4rem);
  color: #dffbff;
  text-shadow: 0 0 18px rgba(98, 234, 213, 0.8);
}

.object-art strong {
  display: grid;
  place-items: center;
  left: 50%;
  right: auto;
  bottom: 8%;
  width: clamp(84px, 10vw, 132px);
  height: clamp(46px, 5vw, 66px);
  border-radius: 8px;
  background: rgba(19, 12, 55, 0.66);
  border: 1px solid rgba(143, 243, 235, 0.2);
  color: #dffbff;
  font-size: clamp(1.65rem, 3.5vw, 2.8rem);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.scene-recognition-tableau {
  min-height: 320px;
}

.recognition-tableau {
  position: absolute;
  z-index: 3;
  left: 56%;
  top: 58%;
  width: clamp(280px, 34vw, 440px);
  height: clamp(230px, 28vw, 360px);
  transform: translate(-44%, -38%);
  pointer-events: none;
}

.tableau-orbit {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  animation: recognitionTableauOrbit 32s linear infinite;
}

.tableau-slot {
  --tableau-size: clamp(96px, 10.5vw, 150px);
  --tableau-radius: clamp(78px, 9vw, 126px);
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tableau-size);
  height: var(--tableau-size);
  margin-left: calc(var(--tableau-size) / -2);
  margin-top: calc(var(--tableau-size) / -2);
  transform: rotate(var(--tableau-angle)) translateX(var(--tableau-radius));
  transform-origin: 50% 50%;
}

.tableau-counter {
  width: 100%;
  height: 100%;
  transform: rotate(var(--tableau-counter-angle));
  animation: recognitionTableauCounter 32s linear infinite;
}

.tableau-float {
  width: 100%;
  height: 100%;
  animation: recognitionTableauFloat 4.8s ease-in-out infinite;
  animation-delay: var(--tableau-delay);
}

.tableau-object,
.tableau-object.object-art {
  position: relative;
  inset: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  transform: none;
}

.tableau-object:not(.object-art) {
  width: 100%;
  height: 100%;
}

.tableau-object strong {
  display: none;
}

.object-cup,
.object-drink {
  border-radius: 0 0 32px 32px;
  clip-path: polygon(16% 4%, 84% 4%, 72% 100%, 28% 100%);
  background: linear-gradient(180deg, rgba(154, 232, 255, 0.72), rgba(50, 134, 205, 0.46));
}

.cup-water {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 20%;
  height: 44%;
  border-radius: 50% 50% 8px 8px;
  background: linear-gradient(180deg, #b8f7ff, #2faee0);
  animation: slosh 2.5s ease-in-out infinite;
}

.object-candle {
  width: clamp(110px, 14vw, 170px);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff4c8, #ed9244);
}

.flame {
  position: absolute;
  top: -24%;
  width: 42%;
  height: 45%;
  border-radius: 60% 10% 60% 45%;
  background: radial-gradient(circle at 48% 64%, #fff7b8, #ffd35d 38%, #ff7b2a 72%);
  transform: rotate(45deg);
  box-shadow: 0 0 34px rgba(255, 178, 42, 0.9);
  animation: flame 700ms ease-in-out infinite alternate;
}

.object-door,
.object-gate,
.object-portal {
  border-radius: 999px 999px 8px 8px;
  background:
    radial-gradient(circle at 50% 58%, rgba(98, 234, 213, 0.35), transparent 20%),
    linear-gradient(145deg, #251452, #392080 72%, #8b4d2a);
  border: 7px solid #a76d3b;
}

.door-window {
  position: absolute;
  inset: 24% 28%;
  border-radius: 999px 999px 8px 8px;
  background: radial-gradient(circle at 50% 58%, #67f0dc, #11295e 58%);
}

.object-key {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.key-head {
  width: 58%;
  aspect-ratio: 1;
  border: 18px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(255, 211, 93, 0.68);
}

.key-shaft {
  position: absolute;
  top: 47%;
  left: 52%;
  width: 45%;
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
}

.object-cat,
.object-dog {
  border-radius: 38% 38% 44% 44%;
  background: linear-gradient(145deg, #fff3d7, #c99258);
}

.object-dog {
  background: linear-gradient(145deg, #f4d5b1, #9d6a43);
}

.cat-face,
.dog-face {
  font-size: clamp(3rem, 6vw, 5rem);
}

.object-apple {
  border-radius: 46% 46% 54% 54%;
  background: linear-gradient(145deg, #ff6e69, #c92850);
}

.object.object-art {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}

.object:not(.object-art) {
  --object-accent: #67f2dd;
  --object-accent-2: #8f6bff;
  --object-warm: #ffd35d;
  width: clamp(148px, 18vw, 232px);
  height: clamp(148px, 18vw, 232px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(216, 198, 255, 0.42);
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.24), transparent 18%),
    radial-gradient(circle at 70% 72%, color-mix(in srgb, var(--object-accent) 44%, transparent), transparent 30%),
    linear-gradient(145deg, color-mix(in srgb, var(--object-accent-2) 74%, #12083f), rgba(27, 18, 78, 0.94));
  box-shadow:
    0 18px 38px rgba(2, 0, 24, 0.34),
    0 0 28px color-mix(in srgb, var(--object-accent) 28%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 0 34px rgba(255, 255, 255, 0.08);
}

.object:not(.object-art)::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 70% 18%, color-mix(in srgb, var(--object-warm) 42%, transparent), transparent 14%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 52%);
}

.object-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 78%;
  height: 72%;
  transform: translateY(-10px);
  color: #fff8ea;
  font-size: clamp(3rem, 7vw, 5.7rem);
  font-weight: 950;
  line-height: 1;
  text-shadow:
    0 4px 0 rgba(31, 10, 70, 0.42),
    0 0 22px color-mix(in srgb, var(--object-accent) 48%, transparent);
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.2));
}

.object:not(.object-art) strong {
  z-index: 2;
  left: 50%;
  right: auto;
  bottom: 12px;
  width: min(76%, 128px);
  height: clamp(42px, 5vw, 58px);
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(17, 9, 48, 0.58);
  border: 1px solid rgba(143, 243, 235, 0.28);
  color: #ecffff;
  font-size: clamp(1.65rem, 4.2vw, 3.1rem);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.object-red,
.object-pink,
.object-angry,
.object-apple {
  --object-accent: #ff7a96;
  --object-accent-2: #b54be0;
  --object-warm: #ffd06d;
}

.object-blue,
.object-purple,
.object-snow,
.object-cloud,
.object-weather,
.object-shirt,
.object-pants {
  --object-accent: #8adfff;
  --object-accent-2: #766df4;
  --object-warm: #d7c0ff;
}

.object-yellow,
.object-green,
.object-banana,
.object-egg,
.object-sun,
.object-happy {
  --object-accent: #ffe46f;
  --object-accent-2: #4fbf9c;
  --object-warm: #fff2a6;
}

.object-bird,
.object-fish,
.object-rabbit,
.object-duck,
.object-horse,
.object-bear,
.object-monkey,
.object-tiger,
.object-cat,
.object-dog {
  --object-accent: #7ff2dc;
  --object-accent-2: #6f56d9;
  --object-warm: #ffc76d;
}

.object-ball,
.object-book,
.object-toy,
.object-car,
.object-pencil,
.object-backpack,
.object-table,
.object-chair,
.object-sparkle {
  --object-accent: #8ee8ff;
  --object-accent-2: #9a61f3;
  --object-warm: #ffcf65;
}

.object-mom,
.object-dad,
.object-brother,
.object-sister,
.object-teacher,
.object-friend,
.object-wave,
.object-heart {
  --object-accent: #ff9ed6;
  --object-accent-2: #7b66ee;
  --object-warm: #ffe0a1;
}

.object-hand,
.object-foot,
.object-eye,
.object-ear,
.object-nose,
.object-mouth,
.object-belly,
.object-head,
.object-hungry,
.object-tired,
.object-sad,
.object-scared {
  --object-accent: #ffb7c8;
  --object-accent-2: #5f6eed;
  --object-warm: #dffaff;
}

.object-house,
.object-school,
.object-park,
.object-room,
.object-pin,
.object-question,
.object-inside,
.object-outside {
  --object-accent: #72f0c8;
  --object-accent-2: #7a66ee;
  --object-warm: #ffe08a;
}

.object-one,
.object-two,
.object-three,
.object-four,
.object-five,
.object-six,
.object-seven,
.object-eight,
.object-nine,
.object-ten,
.object-measure {
  --object-accent: #ffe070;
  --object-accent-2: #6b67e8;
  --object-warm: #ffefad;
}

.object-rain,
.object-wind,
.object-hat,
.object-shoe,
.object-sock {
  --object-accent: #9de8ff;
  --object-accent-2: #6e78f2;
  --object-warm: #b9f4ff;
}

.apple-shine {
  position: absolute;
  top: 18%;
  left: 24%;
  width: 24%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.effect-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.effect-layer span {
  --angle: calc(var(--i) * 20deg);
  position: absolute;
  left: 56%;
  top: 58%;
  width: 9px;
  height: 16px;
  border-radius: 4px;
  background: hsl(calc(28 * var(--i)), 88%, 66%);
  opacity: 0;
  transform: rotate(var(--angle)) translateY(0);
}

.success-mode .effect-layer span {
  animation: confetti 900ms ease-out forwards;
  animation-delay: calc(var(--i) * 22ms);
}

.play-panel {
  padding: clamp(16px, 2.4vw, 24px);
  display: grid;
  align-content: center;
  gap: 14px;
}

.target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 950;
}

.target-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 244, 222, 0.96);
  color: #171044;
  box-shadow: inset 0 0 0 1px rgba(92, 55, 142, 0.14);
}

.target-card-hidden {
  background: linear-gradient(180deg, #fff9ef, #e9fff9);
  border: 2px dashed rgba(92, 55, 142, 0.25);
}

.target-card div {
  min-width: 0;
}

.target-card b,
.target-card strong,
.target-card span {
  display: block;
}

.target-card b {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.95;
  color: #241563;
}

.target-card strong {
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  line-height: 1;
}

.target-card span {
  margin-top: 4px;
  color: #51447b;
  font-weight: 800;
}

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

.choice-card {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 244, 222, 0.96), rgba(232, 216, 255, 0.95));
  color: #20154a;
  box-shadow: 0 10px 22px rgba(4, 0, 30, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.choice-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.choice-card strong {
  font-size: clamp(0.92rem, 2vw, 1.15rem);
  line-height: 1;
}

.choice-card span {
  color: #624b8e;
  font-weight: 900;
}

.word-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(106, 239, 218, 0.95), rgba(53, 150, 173, 0.92));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 8px 14px rgba(31, 11, 76, 0.2);
  font-size: 1.7rem;
  line-height: 1;
  overflow: hidden;
  text-align: center;
}

.word-icon-symbol {
  display: block;
  width: 1em;
  height: 1em;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif;
  transform: translateY(0.01em);
  text-align: center;
}

.icon-key .word-icon-symbol {
  transform: translateY(0.02em) scale(1.52);
}

.icon-door .word-icon-symbol {
  transform: translateY(0.03em) scale(1.48);
}

.icon-apple .word-icon-symbol {
  transform: translateY(0.23em) scale(1.18);
}

.icon-banana .word-icon-symbol {
  transform: translateY(0.02em) scale(1.18);
}

.icon-mic .word-icon-symbol {
  transform: translateY(0.01em) scale(1.1);
}

.icon-fire,
.icon-apple {
  background: linear-gradient(145deg, #ffd066, #ec7738);
}

.icon-door,
.icon-key,
.icon-star {
  background: linear-gradient(145deg, #e6c2ff, #8a5df6);
}

.component-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-word {
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(49, 32, 112, 0.78);
  padding: 12px;
  color: white;
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}

.mini-word .word-icon {
  width: 52px;
  height: 52px;
  font-size: 2rem;
}

.mini-word strong {
  font-size: 1.15rem;
}

.mini-word span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.plus {
  align-self: center;
  color: var(--gold);
  font-size: 2rem;
  font-weight: 950;
}

.task-line {
  color: #83f5dc;
  text-align: center;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 950;
}

.mic-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 30px);
}

.round-tool {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(75, 49, 154, 0.78);
  color: #f2e9ff;
  font-size: 1.35rem;
  font-weight: 950;
  cursor: pointer;
}

.listen-first-tool {
  border-color: rgba(255, 229, 137, 0.92);
  background: radial-gradient(circle at 32% 24%, #fff3b5, #f3a834 58%, #7a4bee);
  color: #171044;
  box-shadow:
    0 0 0 4px rgba(255, 229, 137, 0.24),
    0 0 28px rgba(255, 204, 92, 0.38),
    0 12px 24px rgba(4, 0, 30, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.52);
  animation: listen-first-glow 1.35s ease-in-out infinite;
}

.speech-mode-pill,
.hint-box {
  border-radius: 8px;
  background: rgba(12, 8, 41, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  padding: 10px 12px;
  text-align: center;
  font-weight: 800;
}

.listen-first-pill {
  border-color: rgba(255, 229, 137, 0.52);
  color: #fff2a8;
  background: linear-gradient(180deg, rgba(75, 49, 154, 0.78), rgba(28, 16, 83, 0.78));
  box-shadow:
    0 0 0 1px rgba(255, 229, 137, 0.14),
    0 0 20px rgba(255, 205, 92, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hint-box {
  color: var(--gold);
}

.voice-unavailable-card {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 213, 120, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 230, 156, 0.14), transparent 28%),
    rgba(20, 12, 54, 0.78);
  color: #fff4d8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.voice-unavailable-card strong,
.voice-unavailable-card span {
  display: block;
}

.voice-unavailable-card span {
  color: var(--muted);
}

.feedback {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
}

.feedback-success {
  background: linear-gradient(145deg, #2dd3b5, #12956f);
  color: white;
  box-shadow: 0 12px 24px rgba(13, 116, 98, 0.24);
}

.feedback-retry {
  background: rgba(255, 244, 222, 0.95);
  color: #241563;
}

.feedback-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
  color: var(--gold);
  font-size: 1.7rem;
}

.feedback strong,
.feedback span,
.feedback small {
  display: block;
}

.feedback span {
  margin-top: 4px;
}

.feedback small {
  margin-top: 6px;
  opacity: 0.78;
}

.encounter-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.spellbook-screen {
  padding-bottom: calc(var(--nav-height) + 32px);
}

.book {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: min(1040px, 100%);
  margin: 22px auto var(--nav-height);
  color: #21164d;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.25));
}

.book::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  bottom: 12px;
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(100, 66, 40, 0.3), rgba(255, 255, 255, 0.6), rgba(100, 66, 40, 0.3));
  transform: translateX(-50%);
  z-index: 3;
}

.book-page {
  min-height: 560px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 230, 156, 0.24), transparent 18%),
    linear-gradient(180deg, #fff6e7, #f5e4c7);
  border-color: rgba(96, 62, 120, 0.24);
  padding: clamp(18px, 3vw, 34px);
}

.book-page:first-child {
  border-radius: 8px 0 0 8px;
}

.book-page:last-child {
  border-radius: 0 8px 8px 0;
}

.book-page h2 {
  text-align: center;
  color: #45b89d;
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin-bottom: 18px;
}

.word-list {
  display: grid;
  gap: 12px;
  max-height: min(58svh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.book-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  border: 1px solid rgba(97, 65, 122, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.63);
  color: #20154a;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 7px 14px rgba(95, 62, 28, 0.08);
}

.book-row.locked {
  opacity: 0.48;
  cursor: default;
}

.book-main {
  min-width: 0;
}

.book-main strong,
.book-main small {
  display: block;
}

.book-main strong {
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  line-height: 1.05;
}

.book-main small {
  color: #5b4a7c;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.stars {
  color: #f8aa2f;
  font-weight: 950;
  white-space: nowrap;
}

.badge-shelf {
  margin-top: 24px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(130, 83, 181, 0.1);
  border: 1px solid rgba(97, 65, 122, 0.16);
}

.badge-shelf h3 {
  text-align: center;
  color: #7e4bcc;
  margin-bottom: 12px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(78, 60, 96, 0.16);
  filter: grayscale(1);
  color: #4c346f;
  font-size: 1rem;
  font-weight: 950;
}

.badge.earned {
  filter: none;
  background: rgba(255, 211, 93, 0.28);
}

.parent-screen {
  overflow-y: auto;
}

.parent-heading,
.dashboard-grid,
.parent-panels {
  position: relative;
  z-index: 2;
  width: min(1160px, 100%);
  margin-inline: auto;
}

.parent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
}

.parent-heading h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
}

.parent-heading p {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.dashboard-card {
  padding: 18px;
  min-height: 150px;
  display: grid;
  gap: 4px;
}

.dashboard-card .word-icon {
  width: 56px;
  height: 56px;
  font-size: 2rem;
}

.dashboard-card span {
  color: var(--muted);
  font-weight: 850;
}

.dashboard-card strong {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.dashboard-card small {
  color: #f1dcff;
  font-weight: 800;
}

.parent-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding-bottom: 30px;
}

.settings-panel {
  padding: 18px;
}

.settings-panel h2 {
  margin-bottom: 14px;
}

.setting-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(15, 10, 53, 0.58);
}

.segmented button {
  flex: 1;
  border: 0;
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.segmented button.active {
  color: #082f47;
  background: linear-gradient(180deg, var(--mint-2), var(--mint));
}

.toggle-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.toggle {
  width: 58px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 7, 47, 0.85);
  padding: 3px;
  cursor: pointer;
}

.toggle i {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #cfc2ff;
  transition: transform 160ms ease;
}

.toggle.on {
  background: #28c7b8;
}

.toggle.on i {
  transform: translateX(25px);
  background: white;
}

.privacy-copy,
.reset-area {
  margin-top: 16px;
}

.privacy-copy {
  padding: 14px;
  border-radius: 8px;
  background: rgba(10, 6, 41, 0.48);
}

.reset-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attempt-list {
  display: grid;
  gap: 10px;
}

.attempt-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.attempt-row strong,
.attempt-row span {
  display: block;
}

.attempt-row span,
.empty {
  color: var(--muted);
}

.completion-screen {
  display: grid;
  grid-template-rows: auto 1fr;
}

.completion-layout {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: clamp(18px, 4vw, 46px);
  align-items: center;
}

.completion-copy {
  display: grid;
  gap: 18px;
}

.completion-copy h1 {
  color: var(--mint-2);
}

.completion-copy p {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 900;
}

.whole-spell-card {
  display: grid;
  gap: 6px;
  width: min(100%, 540px);
  padding: 22px;
  border-radius: 8px;
  background: rgba(255, 244, 222, 0.96);
  color: #21164d;
  box-shadow: var(--shadow);
}

.whole-spell-card strong {
  color: #5b2ad2;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1;
}

.whole-spell-card span {
  font-size: 1.15rem;
  font-weight: 850;
}

.unlock-card {
  min-height: 480px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(6px, 1.2vh, 12px);
  text-align: center;
  padding: 22px;
  overflow: hidden;
}

.unlock-card .ghost-hero {
  --ghost-w: clamp(126px, 17vw, 210px);
  position: relative;
  z-index: 3;
}

.unlock-card .portal-door {
  position: relative;
  inset: auto;
  width: clamp(146px, 14vw, 176px);
  height: clamp(202px, 20vw, 238px);
  margin-top: -24px;
}

.unlock-card strong {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  color: var(--gold);
}

.unlock-card span {
  color: var(--muted);
  font-weight: 850;
}

@media (max-height: 760px) and (min-width: 700px) {
  .unlock-card {
    min-height: 0;
    padding: 16px;
    gap: 6px;
  }

  .unlock-card .ghost-hero {
    --ghost-w: clamp(116px, 13vw, 168px);
  }

  .unlock-card .portal-door {
    width: 136px;
    height: 190px;
    margin-top: -22px;
  }

  .unlock-card strong {
    font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  }
}

.unlock-stat {
  width: min(100%, 360px);
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
  color: #21164d;
}

.unlock-stat .stat-pill {
  grid-template-columns: auto auto 1fr;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 2, 22, 0.72);
  backdrop-filter: blur(12px);
}

.parent-gate {
  position: relative;
  width: min(100%, 420px);
  padding: 24px;
  border-radius: 8px;
  background: var(--cream);
  color: #21164d;
  box-shadow: var(--shadow);
  text-align: center;
}

.parent-gate h2 {
  font-size: 2rem;
}

.parent-gate p {
  margin-top: 8px;
  color: #5b4a7c;
  font-weight: 850;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  color: white;
}

.gate-answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.gate-answers button {
  border: 0;
  min-height: 70px;
  border-radius: 8px;
  background: linear-gradient(180deg, #a877ff, #6338db);
  color: white;
  font-size: 1.7rem;
  font-weight: 950;
  cursor: pointer;
}

.gate-error {
  display: block;
  margin-top: 12px;
  color: #b02d46;
  font-weight: 900;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-12px) rotate(2deg);
  }
}

@keyframes micPulse {
  from {
    box-shadow:
      0 0 0 10px rgba(98, 234, 213, 0.14),
      0 0 44px rgba(98, 234, 213, 0.5),
      0 0 0 1px rgba(255, 211, 93, 0.16),
      inset 0 8px 12px rgba(255, 255, 255, 0.32);
  }

  to {
    box-shadow:
      0 0 0 22px rgba(98, 234, 213, 0.22),
      0 0 70px rgba(255, 211, 93, 0.54),
      0 0 0 1px rgba(255, 211, 93, 0.2),
      inset 0 8px 12px rgba(255, 255, 255, 0.34);
  }
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes slosh {
  0%,
  100% {
    transform: rotate(-2deg) translateY(0);
  }

  50% {
    transform: rotate(3deg) translateY(-8px);
  }
}

@keyframes flame {
  from {
    transform: rotate(42deg) scale(0.94);
  }

  to {
    transform: rotate(48deg) scale(1.06);
  }
}

@keyframes confetti {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(0) scale(0.4);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(-230px) translateX(calc((var(--i) - 9) * 14px)) scale(1);
  }
}

@keyframes recognitionTableauOrbit {
  to {
    transform: rotate(1turn);
  }
}

@keyframes recognitionTableauCounter {
  from {
    transform: rotate(var(--tableau-counter-angle)) rotate(0deg);
  }

  to {
    transform: rotate(var(--tableau-counter-angle)) rotate(-1turn);
  }
}

@keyframes recognitionTableauFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.025);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tableau-orbit,
  .tableau-counter,
  .tableau-float {
    animation: none;
  }
}

@media (max-width: 900px) {
  .screen {
    padding-inline: 14px;
  }

  .topbar {
    min-height: 52px;
  }

  .topbar-left {
    gap: 8px;
  }

  .topbar-left strong {
    font-size: 1rem;
  }

  .app-icon {
    width: 36px;
    height: 36px;
  }

  .parent-button {
    padding-inline: 12px;
    font-size: 0.88rem;
  }

  .star-count {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.96rem;
  }

  .home-layout,
  .encounter-layout,
  .parent-panels,
  .completion-layout,
  .node-intro-layout,
  .node-complete-layout {
    grid-template-columns: 1fr;
  }

  .submap-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .home-layout {
    min-height: auto;
    padding-top: 18px;
  }

  h1 {
    font-size: clamp(4rem, 19vw, 6rem);
  }

  .home-copy {
    text-align: center;
    justify-items: center;
  }

  .home-copy p {
    font-size: 1.35rem;
  }

  .home-actions {
    width: 100%;
    justify-content: center;
  }

  .home-art {
    min-height: 360px;
  }

  .home-art .ghost-hero {
    left: 4%;
    right: auto;
    top: 12%;
  }

  .portal-door {
    right: 4%;
    top: 8%;
  }

  .lantern {
    right: 11%;
    bottom: 36%;
  }

  .home-stat-panel {
    left: 50%;
    bottom: 2%;
    transform: translateX(-50%);
    width: min(100%, 440px);
  }

  .stat-pill {
    padding: 12px 10px;
    column-gap: 6px;
  }

  .stat-pill .word-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .stat-pill strong {
    font-size: 1.25rem;
  }

  .stat-pill span:last-child {
    font-size: 0.76rem;
  }

  .mic-stage {
    flex-direction: column;
    gap: 16px;
  }

  .dungeon-map {
    min-height: 640px;
    margin-bottom: calc(var(--nav-height) + 12px);
  }

  .node-intro-layout,
  .node-complete-layout {
    min-height: auto;
    padding-top: 18px;
  }

  .dungeon-island {
    width: min(82%, 310px);
  }

  .island-1 {
    left: 12%;
    bottom: 44%;
  }

  .island-2 {
    left: 26%;
    top: 15%;
  }

  .island-3 {
    right: 7%;
    top: 56%;
  }

  .island-4 {
    left: 16%;
    bottom: 8%;
  }

  .path-line {
    display: none;
  }

  .ghost-map {
    left: 7%;
    top: 14%;
  }

  .encounter-layout {
    min-height: auto;
  }

  .scene-panel {
    min-height: 430px;
  }

  .play-panel {
    margin-bottom: 20px;
  }

  .scene-ghost-wrap {
    left: 5%;
    bottom: 48px;
  }

  .object {
    right: 5%;
    bottom: 58px;
  }

  .book {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .book::before {
    display: none;
  }

  .book-page,
  .book-page:first-child,
  .book-page:last-child {
    min-height: 0;
    border-radius: 8px;
  }

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

  .dashboard-card {
    min-height: 132px;
  }

  .bottom-nav {
    min-height: 64px;
  }
}

@media (max-height: 760px) and (min-width: 760px) {
  .map-heading,
  .spellbook-title {
    margin-top: 0;
  }

  .map-heading h1,
  .spellbook-title h1 {
    font-size: 4.45rem;
  }

  .dungeon-map {
    min-height: 432px;
    margin-top: 12px;
    margin-bottom: 86px;
  }

  .dungeon-island {
    min-height: 104px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .island-1 {
    bottom: 18%;
  }

  .island-2 {
    top: 18%;
  }

  .island-3 {
    top: 47%;
  }

  .island-4 {
    bottom: 4%;
  }

  .encounter-layout {
    min-height: calc(100svh - 128px);
    gap: 18px;
  }

  .scene-panel {
    min-height: 500px;
    padding: 14px;
  }

  .speech-bubble {
    padding: 13px 16px;
    margin-top: 8px;
  }

  .speech-bubble strong {
    font-size: 1.25rem;
  }

  .speech-bubble span {
    font-size: 0.88rem;
  }

  .play-panel {
    align-content: start;
    gap: 8px;
    padding: 14px;
  }

  .play-panel .target-card {
    padding: 10px;
  }

  .target-card b {
    font-size: 2.45rem;
  }

  .target-card strong {
    font-size: 1.75rem;
  }

  .play-panel .giant-mic {
    width: 128px;
    border-width: 5px;
  }

  .round-tool {
    width: 48px;
    height: 48px;
  }

  .task-line {
    font-size: 1.05rem;
  }

  .speech-mode-pill,
  .hint-box,
  .feedback {
    padding: 9px 10px;
  }

  .feedback-icon {
    width: 38px;
    height: 38px;
    font-size: 1.35rem;
  }

  .encounter-actions .button {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .mic-check-card {
    gap: 8px;
  }

  .home-copy {
    gap: 12px;
  }

  .home-copy h1 {
    font-size: 5.25rem;
  }

  .home-copy p {
    font-size: 1.35rem;
  }

  .home-actions .button-large {
    min-height: 58px;
  }

  .listen-card {
    display: none;
  }

  .mic-check-card h1 {
    font-size: 3.35rem;
  }

  .mic-check-card .spark-crown {
    font-size: 0.9rem;
  }

  .mic-check-card .say-bubble {
    padding: 8px 22px;
    font-size: 1.65rem;
  }

  .mic-stage {
    min-height: 138px;
  }

  .mic-check-card .ghost-medium {
    --ghost-w: 112px;
  }

  .mic-check-card .giant-mic {
    width: 136px;
    border-width: 5px;
  }

  .privacy-note {
    padding: 10px 14px;
  }

  .stepper span {
    width: 34px;
    height: 34px;
  }

  .mic-check-card .button-wide {
    min-height: 54px;
  }
}

@media (min-width: 901px) {
  .map-screen .bottom-nav,
  .submap-screen .bottom-nav {
    display: none;
  }

  .map-screen,
  .submap-screen {
    padding-bottom: 26px;
  }

  .spellbook-screen .bottom-nav {
    display: none;
  }

  .spellbook-screen {
    padding-bottom: 24px;
  }
}

@media (max-width: 700px) {
  .top-spellbook-button {
    display: none;
  }
}

@media (max-width: 560px) {
  :root {
    --nav-height: 82px;
  }

  .screen {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: calc(var(--nav-height) + max(18px, env(safe-area-inset-bottom)));
  }

  .centered-screen,
  .home-screen,
  .completion-screen {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .topbar {
    gap: 8px;
  }

  .topbar.has-back .topbar-left strong {
    display: none;
  }

  .topbar-left {
    gap: 7px;
  }

  .topbar-left strong {
    font-size: 0.95rem;
  }

  .topbar-right {
    gap: 6px;
  }

  .home-screen .star-count {
    display: none;
  }

  .star-count {
    min-width: 50px;
    justify-content: center;
    padding-inline: 8px;
  }

  .parent-button {
    max-width: none;
    padding-inline: 11px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .app-icon {
    width: 34px;
    height: 34px;
  }

  .mic-check-card {
    gap: 8px;
    align-content: start;
    padding-top: 8px;
  }

  .mic-check-card h1 {
    font-size: clamp(2.5rem, 11.8vw, 3.05rem);
    line-height: 0.95;
  }

  .mic-check-card .say-bubble {
    padding: 9px 20px;
    font-size: 1.45rem;
  }

  .mic-check-card .mic-stage {
    flex-direction: row;
    min-height: 146px;
    gap: 18px;
  }

  .mic-check-card .ghost-medium {
    --ghost-w: 128px;
  }

  .mic-check-card .giant-mic {
    width: 112px;
    border-width: 5px;
  }

  .privacy-note {
    padding: 12px;
    gap: 11px;
  }

  .privacy-note span {
    line-height: 1.22;
  }

  .stepper span {
    width: 38px;
    height: 38px;
  }

  .mic-check-card .button-wide {
    min-height: 58px;
  }

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

  .stat-pill + .stat-pill {
    border-left: 0;
    border-top: 1px solid rgba(58, 33, 93, 0.18);
  }

  .home-art {
    min-height: 500px;
  }

  .home-stat-panel {
    bottom: 0;
  }

  .map-heading,
  .spellbook-title {
    margin-top: 10px;
  }

  .map-heading h1,
  .spellbook-title h1 {
    font-size: clamp(3rem, 13vw, 4rem);
  }

  .dungeon-map {
    min-height: 600px;
    margin-top: 18px;
    margin-bottom: calc(var(--nav-height) + 24px);
  }

  .submap-heading h1,
  .node-story h1,
  .node-complete-copy h1 {
    font-size: clamp(2.6rem, 12vw, 3.7rem);
  }

  .submap-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .submap-progress-card {
    justify-content: space-between;
    width: 100%;
  }

  .submap-stage {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: calc(var(--nav-height) + 18px);
    padding: 12px;
    border-radius: 18px;
  }

  .room-main {
    min-height: 132px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
    padding-left: 58px;
  }

  .room-orb {
    width: 62px;
    height: 62px;
  }

  .room-orb .word-icon {
    width: 44px;
    height: 44px;
    font-size: 1.65rem;
  }

  .node-preview,
  .node-complete-art {
    min-height: 260px;
  }

  .dungeon-island {
    width: min(82%, 296px);
    min-height: 112px;
    padding-left: 68px;
  }

  .island-1 {
    left: 12%;
    bottom: 46%;
  }

  .island-2 {
    left: 28%;
    top: 10%;
  }

  .island-3 {
    right: 6%;
    top: 55%;
  }

  .island-4 {
    left: 16%;
    bottom: 5%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .encounter-screen {
    padding-bottom: 18px;
  }

  .encounter-progress {
    margin: 4px auto 10px;
  }

  .encounter-layout {
    gap: 12px;
  }

  .scene-panel {
    min-height: 318px;
    padding: 12px;
  }

  .stage-label {
    padding: 6px 11px;
    font-size: 0.82rem;
  }

  .speech-bubble {
    margin-top: 8px;
    padding: 10px 12px;
  }

  .speech-bubble strong {
    font-size: 0.98rem;
    line-height: 1.15;
  }

  .speech-bubble span {
    margin-top: 5px;
    font-size: 0.76rem;
    line-height: 1.16;
  }

  .scene-visual {
    min-height: 178px;
    margin-top: 6px;
  }

  .scene-recognition-tableau {
    min-height: 194px;
  }

  .scene-ghost-wrap {
    left: 3%;
    bottom: 6px;
  }

  .ghost-scene {
    --ghost-w: clamp(112px, 34vw, 138px);
  }

  .object {
    right: 2%;
    bottom: 2px;
  }

  .object-art {
    width: clamp(132px, 42vw, 164px);
    height: clamp(132px, 42vw, 164px);
  }

  .object-art strong {
    width: 56px;
    height: 42px;
    font-size: 1.75rem;
  }

  .recognition-tableau {
    left: 59%;
    top: 50%;
    width: min(70vw, 268px);
    height: min(52vw, 204px);
    transform: translate(-45%, -42%);
  }

  .tableau-slot {
    --tableau-size: clamp(64px, 18vw, 86px);
    --tableau-radius: clamp(44px, 12vw, 58px);
  }

  .play-panel {
    gap: 9px;
    padding: 12px;
    margin-bottom: 0;
  }

  .target-card {
    padding: 10px;
    gap: 10px;
  }

  .target-card .word-icon {
    width: 58px;
    height: 58px;
    font-size: 2.15rem;
  }

  .component-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .mini-word {
    min-width: 0;
    padding: 9px;
  }

  .mini-word .word-icon {
    width: 48px;
    height: 48px;
    font-size: 1.9rem;
  }

  .choice-grid {
    gap: 8px;
  }

  .choice-card {
    min-height: 102px;
    padding: 8px;
  }

  .choice-card .word-icon {
    width: 58px;
    height: 58px;
    font-size: 2.08rem;
  }

  .task-line {
    font-size: 1rem;
  }

  .mic-row {
    gap: 14px;
  }

  .play-panel .giant-mic {
    width: 112px;
    border-width: 5px;
  }

  .round-tool {
    width: 46px;
    height: 46px;
  }

  .speech-mode-pill,
  .hint-box {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .feedback {
    padding: 10px;
  }

  .encounter-actions {
    flex-direction: row;
  }

  .success-mode .encounter-actions .button-primary {
    flex: 1;
    min-height: 54px;
  }

  .bottom-nav strong {
    font-size: 0.76rem;
  }
}

.dungeon-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  align-content: start;
  gap: 16px;
  min-height: 0;
  max-height: min(520px, calc(100svh - var(--nav-height) - 190px));
  overflow: auto;
}

.dungeon-island,
.island-1,
.island-2,
.island-3,
.island-4 {
  position: relative;
  inset: auto;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: 100%;
}

@media (max-width: 560px) {
  .dungeon-map {
    max-height: calc(100svh - var(--nav-height) - 220px);
  }

  .dungeon-island {
    padding-left: 106px;
    padding-right: 34px;
  }

  .dungeon-island .dungeon-meta {
    gap: 4px;
    font-size: 0.82rem;
  }
}

/* Image-backed map redesign pass. These rules intentionally sit last so the
   new illustrated map assets override the earlier card-grid treatments. */
.map-screen {
  padding-inline: clamp(14px, 1.7vw, 26px);
}

.map-kicker {
  display: block;
  color: var(--mint-2);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-heading {
  width: min(1500px, 100%);
  margin-top: clamp(6px, 1.3vw, 16px);
  text-align: left;
}

.map-heading h1 {
  max-width: 780px;
  font-size: clamp(2.05rem, 3.2vw, 3.2rem);
  line-height: 0.94;
}

.map-heading p {
  font-size: clamp(1.12rem, 1.8vw, 1.45rem);
}

.world-adventure-map {
  display: block;
  width: min(1500px, 100%);
  height: clamp(540px, 76svh, 820px);
  max-height: none;
  margin-top: 12px;
  padding: 0;
  border: 2px solid rgba(143, 123, 255, 0.62);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(8, 4, 34, 0.02), rgba(8, 4, 34, 0.2)),
    var(--world-map-bg, url("./assets/maps/world-map-adventure-web.webp")) center / cover no-repeat;
  box-shadow:
    0 34px 78px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 -80px 130px rgba(3, 0, 28, 0.36);
  overflow: hidden;
}

.world-adventure-map::before,
.world-adventure-map::after,
.world-adventure-map .path-line {
  display: none;
}

.world-adventure-map .dungeon-island {
  position: absolute;
  left: var(--map-x);
  top: var(--map-y);
  width: clamp(135px, 13vw, 210px);
  min-height: 0;
  padding: 34px 8px 8px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  color: var(--cream);
  overflow: visible;
}

.world-adventure-map .dungeon-island::before {
  display: none;
}

.world-adventure-map .island-art {
  display: none;
}

.world-adventure-map .dungeon-badge {
  left: 50%;
  top: 0;
  bottom: auto;
  width: clamp(38px, 4.2vw, 58px);
  height: clamp(38px, 4.2vw, 58px);
  transform: translate(-50%, -40%);
  border-width: 3px;
  font-size: clamp(1.05rem, 1.7vw, 1.55rem);
  z-index: 4;
}

.world-adventure-map .dungeon-island strong,
.world-adventure-map .dungeon-island small {
  border: 1px solid rgba(255, 234, 177, 0.42);
  background:
    linear-gradient(180deg, rgba(34, 25, 52, 0.92), rgba(15, 12, 32, 0.94));
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.world-adventure-map .dungeon-island strong {
  padding: 8px 12px 6px;
  border-radius: 12px 12px 6px 6px;
  color: #fff8ea;
  text-align: center;
  font-size: clamp(0.78rem, 1.25vw, 1.02rem);
  line-height: 1.02;
}

.world-adventure-map .dungeon-island small {
  margin-top: -1px;
  padding: 5px 10px 7px;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  color: #d7ccf8;
  text-align: center;
  font-size: clamp(0.66rem, 0.9vw, 0.8rem);
}

.world-adventure-map .dungeon-island:not(.next-up):not(.complete) small {
  display: none;
}

.world-adventure-map .dungeon-island small span:first-child,
.world-adventure-map .dungeon-status {
  color: var(--mint-2);
  white-space: normal;
}

.world-adventure-map .dungeon-detail {
  -webkit-line-clamp: 1;
}

.world-adventure-map .dungeon-island.next-up strong,
.world-adventure-map .dungeon-island.next-up small {
  border-color: rgba(255, 218, 105, 0.78);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(255, 210, 90, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.world-adventure-map .dungeon-island.locked {
  opacity: 0.82;
  filter: grayscale(0.22) brightness(0.86);
}

.world-adventure-map .dungeon-island em {
  left: 50%;
  right: auto;
  top: -34px;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 5;
}

.world-adventure-map .lock,
.world-adventure-map .complete-mark {
  right: -5px;
  bottom: 4px;
  width: 28px;
  height: 28px;
}

.world-adventure-map .ghost-map {
  display: block;
  left: auto;
  right: 3%;
  top: 48%;
  z-index: 4;
  filter: drop-shadow(0 22px 30px rgba(15, 0, 44, 0.34));
}

.map-coach-bubble {
  position: absolute;
  right: clamp(24px, 4vw, 56px);
  top: clamp(16px, 3vw, 38px);
  z-index: 5;
  width: min(220px, 22vw);
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(246, 241, 255, 0.94);
  color: #21164d;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.25);
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}

.submap-screen {
  padding-inline: clamp(14px, 1.7vw, 26px);
}

.submap-heading {
  width: min(1500px, 100%);
  align-items: end;
}

.submap-heading h1 {
  font-size: clamp(2.3rem, 4.6vw, 4.1rem);
  line-height: 0.96;
}

.submap-art-stage {
  width: min(1500px, 100%);
  height: clamp(430px, 58svh, 680px);
  max-height: none;
  display: block;
  padding: 0;
  border: 2px solid rgba(143, 123, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(5, 10, 33, 0.02), rgba(4, 7, 28, 0.24)),
    var(--submap-bg),
    radial-gradient(ellipse at 50% 90%, rgba(98, 234, 213, 0.18), transparent 35%),
    linear-gradient(180deg, rgba(9, 12, 59, 0.78), rgba(7, 6, 42, 0.9));
  background-size: auto, cover, auto, auto;
  background-position: center;
  box-shadow:
    0 34px 78px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 -80px 130px rgba(3, 0, 28, 0.34);
  overflow: hidden;
}

.submap-art-stage .submap-path-line {
  display: none;
}

.submap-art-stage .ghost-map {
  display: block;
  left: auto;
  right: 2.5%;
  top: 58%;
  z-index: 4;
  --ghost-w: clamp(96px, 10vw, 150px);
}

.submap-coach-bubble {
  top: auto;
  right: clamp(18px, 4vw, 56px);
  bottom: clamp(22px, 4vw, 54px);
  width: min(210px, 18vw);
}

.submap-art-stage .room-node {
  position: absolute;
  left: var(--room-x, 50%);
  top: var(--room-y, 50%);
  width: clamp(132px, 13vw, var(--room-w, 205px));
  transform: translate(-50%, -50%);
  z-index: 3;
}

.submap-art-stage .room-main {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.submap-art-stage .room-main::before {
  display: none;
}

.submap-art-stage .room-number {
  left: 50%;
  top: 0;
  width: clamp(34px, 3.7vw, 50px);
  height: clamp(34px, 3.7vw, 50px);
  transform: translate(-102%, -12%);
  z-index: 4;
  border: 3px solid rgba(213, 255, 246, 0.76);
  color: #07344b;
  font-size: clamp(0.98rem, 1.5vw, 1.35rem);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

.submap-art-stage .room-orb {
  width: clamp(74px, 7.5vw, 112px);
  height: clamp(74px, 7.5vw, 112px);
  margin-inline: auto;
  border: 5px solid rgba(189, 255, 244, 0.58);
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(145deg, rgba(108, 248, 224, 0.92), rgba(74, 55, 198, 0.82));
  box-shadow:
    0 0 0 9px rgba(31, 229, 207, 0.13),
    0 18px 30px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.submap-art-stage .room-main strong {
  display: block;
  width: max-content;
  max-width: 190px;
  margin: -5px auto 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 234, 177, 0.42);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(34, 25, 52, 0.94), rgba(15, 12, 32, 0.96));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff8ea;
  text-align: center;
  font-size: clamp(0.78rem, 1.2vw, 1rem);
}

.submap-art-stage .room-main small {
  display: block;
  width: max-content;
  max-width: 170px;
  margin: 4px auto 0;
  color: var(--cream);
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  font-size: clamp(0.66rem, 0.9vw, 0.82rem);
}

.submap-art-stage .room-progress {
  width: max-content;
  max-width: 170px;
  margin: 4px auto 0;
  border: 1px solid rgba(255, 211, 93, 0.2);
  color: #fff2bd;
  background: rgba(15, 10, 42, 0.76);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

.submap-art-stage .room-node.current .room-orb {
  border-color: rgba(105, 247, 226, 0.92);
  box-shadow:
    0 0 0 11px rgba(31, 229, 207, 0.18),
    0 0 34px rgba(105, 247, 226, 0.42),
    0 18px 30px rgba(0, 0, 0, 0.34);
}

.submap-art-stage .room-node.complete .room-orb {
  border-color: rgba(255, 211, 93, 0.88);
}

.submap-art-stage .room-node.locked {
  opacity: 0.72;
  filter: grayscale(0.35) brightness(0.82);
}

.submap-art-stage .room-node .button-small {
  width: max-content;
  margin: 6px auto 0;
  min-height: 44px;
  padding: 9px 20px;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .world-adventure-map {
    height: auto;
    aspect-ratio: 3 / 2;
    min-height: 430px;
  }

  .world-adventure-map .dungeon-island {
    width: clamp(112px, 18vw, 160px);
  }

  .world-adventure-map .dungeon-island small {
    display: none;
  }

  .map-coach-bubble,
  .world-adventure-map .ghost-map,
  .submap-coach-bubble {
    display: none;
  }

  .submap-heading {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  .map-heading {
    text-align: center;
  }

  .map-heading h1 {
    margin-inline: auto;
  }

  .world-adventure-map {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    padding: 16px;
    overflow: auto;
    background:
      linear-gradient(180deg, rgba(8, 4, 34, 0.52), rgba(8, 4, 34, 0.82)),
      var(--world-map-bg, url("./assets/maps/world-map-adventure-web.webp")) center / cover no-repeat;
  }

  .world-adventure-map .dungeon-island,
  .world-adventure-map .island-1,
  .world-adventure-map .island-2,
  .world-adventure-map .island-3,
  .world-adventure-map .island-4 {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    transform: none;
    padding: 14px 42px 14px 86px;
    border: 1px solid rgba(221, 200, 255, 0.36);
    border-radius: 18px;
    background: linear-gradient(115deg, rgba(77, 42, 150, 0.94), rgba(30, 22, 78, 0.9));
  }

  .world-adventure-map .island-art {
    display: grid;
  }

  .world-adventure-map .dungeon-badge {
    left: -10px;
    top: auto;
    bottom: 12px;
    transform: none;
  }

  .world-adventure-map .dungeon-island strong,
  .world-adventure-map .dungeon-island small {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
  }

  .world-adventure-map .dungeon-island small {
    display: grid;
  }

  .world-adventure-map .dungeon-island em {
    left: auto;
    right: 12px;
    top: -16px;
    transform: none;
  }

  .submap-art-stage {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    background:
      linear-gradient(180deg, rgba(4, 8, 30, 0.62), rgba(4, 8, 30, 0.86)),
      var(--submap-bg) center / cover no-repeat;
  }

  .submap-art-stage .room-node {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    transform: none;
  }

  .submap-art-stage .room-main {
    min-height: 126px;
    padding: 14px 18px 14px 94px;
    border: 1px solid rgba(221, 200, 255, 0.36);
    border-radius: 18px;
    background: linear-gradient(115deg, rgba(77, 42, 150, 0.94), rgba(30, 22, 78, 0.9));
    box-shadow: 0 18px 36px rgba(2, 0, 24, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    justify-items: start;
    align-content: center;
    text-align: left;
  }

  .submap-art-stage .room-number {
    left: 12px;
    top: 12px;
    transform: none;
  }

  .submap-art-stage .room-orb {
    position: absolute;
    left: 20px;
    top: 50%;
    width: 62px;
    height: 62px;
    transform: translateY(-50%);
  }

  .submap-art-stage .room-main strong,
  .submap-art-stage .room-main small,
  .submap-art-stage .room-progress {
    width: auto;
    max-width: 100%;
    margin: 0;
    text-align: left;
  }
}
