:root {
  --paper:#f8f6ef;
  --white:#fffdf8;
  --ink:#3e463a;
  --muted:#687361;
  --forest:#426a46;
  --sage:#e4ebda;
  --peach:#f5d8bf;
  --gold:#e6ba60;
  --line:#e4e6da;
}

body {
  font-family:'Nunito',ui-rounded,'SF Pro Rounded',sans-serif;
  background:var(--paper);
  color:var(--ink);
}

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

button {
  font:inherit;
  cursor:pointer;
  color:inherit;
}

button:focus-visible,a:focus-visible {
  outline:3px solid #bd6e42;
  outline-offset:4px;
}

button svg {
  width:20px;
  height:20px;
  flex-shrink:0;
}

button {
  transition:background .18s,transform .18s;
}

button:hover {
  filter:brightness(.97);
}

button:active {
  transform:translateY(2px);
}

[hidden] {
  display:none!important;
}

#lobby {
  position:fixed;
  inset:0;
  z-index:2;
  display:flex;
  background:var(--paper);
  overflow:auto;
}

#lobby main:focus {
  outline:none;
}

.side-rail {
  width:204px;
  flex-shrink:0;
  padding:40px 22px 26px;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  position:sticky;
  top:0;
  height:100dvh;
}

.brand {
  display:flex;
  align-items:center;
  flex-shrink:0;
  text-decoration:none;
}

.rail-caption {
  font-size:9px;
  font-weight:900;
  letter-spacing:1.6px;
  margin:46px 0 17px 13px;
  color:#7a826b;
}

.side-rail nav {
  display:flex;
  flex-direction:column;
  gap:8px;
}

.nav-item {
  display:flex;
  gap:13px;
  align-items:center;
  padding:14px 15px;
  border:0;
  background:transparent;
  text-align:left;
  font-size:14px;
  font-weight:800;
  border-radius:12px;
  color:var(--muted);
}

.nav-item svg {
  width:21px;
  height:21px;
}

.nav-item.active {
  background:var(--sage);
  color:var(--forest);
}

.rail-bottom {
  margin-top:auto;
  padding:30px 13px 0;
}

.tiny-flower {
  font-size:37px;
  color:#a6b892;
}

.rail-bottom p {
  font-size:13px;
  line-height:1.7;
  font-weight:700;
  color:#7b846f;
}

.local-note {
  font-size:9px;
  color:#7a826b;
}

.lobby-main {
  width:calc(100% - 204px);
  max-width:1580px;
  margin:0 auto;
  padding:31px 38px 20px;
}

.lobby-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-bottom:24px;
  border-bottom:1px solid var(--line);
}

.header-crumb {
  font-size:9px;
  font-weight:900;
  letter-spacing:1.5px;
  color:#687361;
}

.header-crumb span {
  padding:0 12px;
  color:#a6af99;
}

.lobby-header p {
  margin:7px 0 0;
  font-size:13px;
  font-weight:700;
}

.sound-button {
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--white);
  border:1px solid var(--line);
  padding:11px 15px;
  border-radius:25px;
  font-size:11px;
  font-weight:800;
}

.sound-button svg {
  width:16px;
  height:16px;
}

.home-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:30px 0 23px;
}

.section-kicker {
  font-size:9px;
  letter-spacing:1.5px;
  font-weight:900;
  color:#758267;
}

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

h1 {
  font-family:'Lilita One',ui-rounded,sans-serif;
  font-size:clamp(26px,2.6vw,42px);
  line-height:1.15;
  font-weight:400;
  letter-spacing:-.4px;
  margin:8px 0 0;
}

h1>span {
  color:#a0b387;
}

.handwritten {
  font-size:12px;
  font-weight:700;
  color:#7a876d;
  white-space:nowrap;
  display:flex;
  align-items:center;
  gap:10px;
  transform:rotate(-4deg);
}

.handwritten svg {
  width:22px;
  height:22px;
  color:#caa455;
}

.adventure-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 286px;
  gap:23px;
  align-items:stretch;
}

.world-card {
  min-width:0;
  background:var(--white);
  border-radius:19px;
  overflow:hidden;
  box-shadow:0 6px 18px #3e463a08;
}

.world-art {
  position:relative;
  min-height:355px;
  height:calc(100% - 58px);
  overflow:hidden;
  background:#c8ddad;
}

.world-art img {
  width:100%;
  height:100%;
  position:absolute;
  inset:0;
  object-fit:cover;
  object-position:56% 50%;
}

.world-paint {
  width:100%;
  height:100%;
  position:absolute;
  inset:0;
  object-fit:cover;
  object-position:center 60%;
}

.world-shade {
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,#1f37250b 45%,#1f3725a1 100%);
}

.chapter-tag {
  position:absolute;
  left:24px;
  top:23px;
  display:flex;
  align-items:center;
  gap:8px;
  border-radius:24px;
  background:#fffdf8e8;
  color:#4c6746;
  font-size:9px;
  letter-spacing:1.4px;
  font-weight:900;
  padding:10px 13px;
}

.chapter-tag svg {
  width:15px;
  height:15px;
}

.world-caption {
  position:absolute;
  left:28px;
  right:20px;
  bottom:28px;
  color:#fffdf5;
}

.world-caption>span {
  font-size:8px;
  letter-spacing:1.9px;
  font-weight:900;
  color:#f0f1d8;
}

.world-caption h2 {
  font-family:'Lilita One',ui-rounded,sans-serif;
  font-weight:400;
  font-size:38px;
  margin:8px 0 5px;
  text-shadow:0 2px 4px #263c3b40;
}

.world-caption p {
  font-size:12px;
  font-weight:700;
  margin:0;
}

.scene-spark {
  position:absolute;
  color:#fff5bd;
  font-size:31px;
  pointer-events:none;
  animation:twinkle 4s ease-in-out infinite;
}

.spark-one {
  top:28%;
  left:19%;
}

.spark-two {
  top:51%;
  right:16%;
  font-size:19px;
  animation-delay:1s;
}

.world-bottom {
  height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 23px;
  font-size:10px;
  color:#64735b;
  gap:12px;
}

.world-bottom>div {
  display:flex;
  align-items:center;
  gap:9px;
}

.world-bottom svg {
  width:17px;
  height:17px;
}

.boss-note {
  font-size:9px;
  white-space:nowrap;
  color:#866849;
  background:#f7eddb;
  padding:6px 9px;
  border-radius:15px;
}

.companion-card {
  background:#eeefdf;
  border-radius:19px;
  padding:22px 21px 17px;
  display:flex;
  flex-direction:column;
  position:relative;
  overflow:hidden;
}

.companion-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.companion-top .section-kicker {
  font-size:8px;
  letter-spacing:1px;
}

.text-button {
  background:none;
  border:0;
  padding:8px 0;
  font-size:11px;
  font-weight:800;
  color:var(--forest);
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:44px;
}

.text-button svg {
  width:14px;
  height:14px;
}

.companion-top .text-button {
  font-size:10px;
}

.companion-stage {
  height:166px;
  display:grid;
  place-items:center;
  position:relative;
  margin-top:0;
}

.portrait-halo {
  position:absolute;
  width:138px;
  height:138px;
  background:#e0e5cb;
  border-radius:50%;
}

.pal-portrait {
  display:block;
  width:100%;
  height:auto;
  position:relative;
  object-fit:contain;
}

.hero-pal {
  width:175px;
  height:175px;
  animation:pal-breathe 4s ease-in-out infinite;
}

.pal-spark {
  position:absolute;
  right:25px;
  top:28px;
  font-size:30px;
  color:#ab8e4b;
}

.companion-name {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}

.companion-name h2 {
  font-family:'Lilita One',ui-rounded,sans-serif;
  font-size:30px;
  font-weight:400;
  margin:0;
}

.type-tag {
  color:#585f50;
  background:#fffdf8b3;
  border-radius:20px;
  font-size:10px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
}

.type-tag:before {
  content:'';
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--type-color,#9e8878);
}

.companion-description {
  font-size:10px;
  text-align:center;
  line-height:1.65;
  color:#69735b;
  margin:13px 4px;
}

.signature-move {
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 13px;
  background:#fffdf87a;
  border-radius:11px;
  margin:0 0 15px;
}

.signature-move small {
  display:block;
  font-size:7px;
  letter-spacing:1.3px;
  color:#7b846a;
  font-weight:900;
}

.signature-move strong {
  display:block;
  font-size:11px;
  margin-top:3px;
}

.start-adventure {
  border:0;
  border-radius:12px;
  background:var(--forest);
  box-shadow:0 4px 0 #2f5035;
  color:#fffdf8;
  padding:15px 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:17px;
  font-size:14px;
  font-weight:900;
  min-height:49px;
}

.companion-card .start-adventure {
  width:100%;
  margin-top:auto;
}

.start-adventure:hover {
  background:#365d3b;
  filter:none;
}

.start-caption {
  font-size:9px;
  color:#69735b;
  text-align:center;
  margin-top:13px;
}

.destination-section {
  margin:27px 0 21px;
}

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

.section-heading h2 {
  font-size:16px;
  font-weight:900;
  margin:0;
}

.section-heading>span {
  font-size:10px;
  color:var(--muted);
}

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

.destination {
  position:relative;
  border:1.5px solid var(--line);
  border-radius:13px;
  padding:10px;
  background:var(--white);
  display:flex;
  align-items:center;
  text-align:left;
  gap:10px;
  min-height:77px;
}

.destination.selected {
  border-color:#8aab72;
  background:#edf1e4;
}

.destination-art {
  width:43px;
  height:49px;
  border-radius:9px;
  flex-shrink:0;
  display:grid;
  place-items:center;
  background-image:url('../assets/art/terrain-atlas.webp');
  background-size:200% 200%;
  overflow:hidden;
}
.destination-art canvas { width: 100%; height: 100%; object-fit: cover; }

.terrain-0 {
  background-position:0 0;
}

.terrain-1 {
  background-position:100% 0;
}

.terrain-2 {
  background-position:0 100%;
}

.terrain-3 {
  background-position:100% 100%;
}

.destination-art>span {
  font-size:28px;
  color:#557047;
  text-shadow:0 1px #fff9;
}

.terrain-1>span {
  color:#b47374;
}

.terrain-2>span {
  color:#97774d;
}

.terrain-3>span {
  color:#fff5c9;
}

.destination-label {
  min-width:0;
}

.destination-label small {
  display:block;
  font-size:7px;
  font-weight:900;
  color:#7a846a;
  letter-spacing:1px;
  margin-bottom:5px;
}

.destination-label strong {
  display:block;
  font-size:11px;
  line-height:1.3;
}

.destination-check {
  margin-left:auto;
  display:flex;
  color:#6d875a;
}

.destination-check svg {
  width:14px;
  height:14px;
}

.practice-note {
  display:flex;
  align-items:center;
  gap:14px;
  background:#eeece1;
  border-radius:13px;
  padding:16px 20px;
}

.practice-icon {
  background:#e0e1cf;
  color:#71805b;
  width:38px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:11px;
  flex-shrink:0;
}

.practice-icon svg {
  width:20px;
  height:20px;
}

.practice-note strong {
  font-size:12px;
  font-weight:900;
}

.practice-note p {
  font-size:10px;
  color:#6a7361;
  margin:4px 0 0;
  line-height:1.5;
}

.practice-note .text-button {
  margin-left:auto;
  white-space:nowrap;
  font-size:10px;
}

.lobby-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:21px 0 2px;
  color:#768069;
  font-size:9px;
}

.lobby-footer kbd {
  font:inherit;
  background:#eeeee2;
  padding:3px 5px;
  border-radius:4px;
  color:#606d53;
}

.page-heading {
  padding:33px 0 26px;
}

.page-heading h1 {
  margin-bottom:11px;
}

.page-heading p {
  font-size:13px;
  line-height:1.6;
  color:var(--muted);
  margin:0;
}

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

.pal-card {
  border:1.5px solid var(--line);
  background:var(--white);
  border-radius:16px;
  padding:15px 15px 0;
  text-align:center;
  overflow:hidden;
  position:relative;
}

.pal-card.chosen {
  border-color:#85a86e;
  background:#edf1e5;
}

.pal-status {
  font-size:8px;
  letter-spacing:1px;
  font-weight:900;
  color:#718063;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:5px;
  min-height:15px;
}

.pal-status svg {
  width:12px;
  height:12px;
}

.pal-card .pal-portrait {
  width:140px;
  height:140px;
  max-width:100%;
  margin:6px auto;
  background:radial-gradient(circle,var(--pal-tint) 0,transparent 69%);
}

.pal-card h2 {
  font-family:'Lilita One',ui-rounded,sans-serif;
  font-size:25px;
  font-weight:400;
  margin:3px 0 7px;
}

.pal-card p {
  font-size:10px;
  color:#687361;
  margin:10px 0 16px;
}

.pal-select-label {
  font-size:10px;
  font-weight:800;
  border-top:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:13px 0;
}

.pal-select-label svg {
  width:14px;
  height:14px;
}

.collection-bottom {
  position:sticky;
  bottom:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:18px 0;
  background:var(--paper);
}

.collection-bottom>span {
  font-size:12px;
  color:var(--muted);
}

.collection-bottom .start-adventure {
  font-size:12px;
}

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

.badge-card {
  display:flex;
  align-items:flex-start;
  gap:15px;
  background:var(--white);
  padding:20px;
  border-radius:14px;
}

.badge-art {
  width:42px;
  height:45px;
  flex-shrink:0;
  border-radius:50% 50% 42% 42%;
  display:grid;
  place-items:center;
  color:#9da48c;
  background:#eceee3;
}

.badge-art svg {
  width:23px;
  height:23px;
}

.badge-card.earned {
  background:#f6edd5;
}

.earned .badge-art {
  background:#ead090;
  color:#85682b;
}

.badge-status {
  font-size:7px;
  letter-spacing:1px;
  font-weight:900;
  color:#7a826b;
}

.badge-card h2 {
  font-size:13px;
  line-height:1.4;
  margin:6px 0;
}

.badge-card p {
  font-size:10px;
  line-height:1.65;
  margin:0;
  color:#687361;
}

.settings-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:40px;
}

.practice-settings {
  background:var(--white);
  padding:30px;
  border-radius:16px;
}

.practice-settings h2 {
  font-size:17px;
  margin:0 0 7px;
}

.practice-settings>p {
  font-size:12px;
  color:var(--muted);
  margin-bottom:17px;
}

.grade-options {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
  margin-bottom:30px;
}

.option-button {
  border:1.5px solid var(--line);
  border-radius:10px;
  background:var(--paper);
  padding:14px 16px;
  min-height:49px;
  font-size:13px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.option-button.selected {
  background:#e7eeda;
  border-color:#91aa7b;
  color:var(--forest);
}

.option-button svg {
  width:17px;
  height:17px;
}

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

.operation-options .option-button {
  font-size:11px;
  padding:13px 10px;
}

.settings-save {
  font-size:10px;
  color:var(--muted);
  display:flex;
  gap:8px;
  align-items:center;
  margin:25px 0 18px;
}

.settings-save svg {
  width:15px;
  height:15px;
}

.save-transfer {
  margin-top:22px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8f7f0;
}

.save-transfer h2 { margin:0 0 8px; }
.save-transfer p { font-size:11px; line-height:1.65; color:var(--muted); }
.save-transfer textarea {
  width:100%;
  min-height:130px;
  resize:vertical;
  padding:11px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font:10px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;
  overflow-wrap:anywhere;
}
.save-transfer-actions { display:flex; align-items:center; gap:12px; margin-top:10px; }
.save-transfer-status { min-height:16px; margin-bottom:0; }

.practice-friend {
  text-align:center;
  padding:20px 5px;
}

.practice-friend canvas {
  width:240px;
  height:240px;
  margin:0 auto 16px;
}

.practice-friend h2 {
  font-family:'Lilita One',ui-rounded,sans-serif;
  font-size:25px;
  font-weight:400;
}

.practice-friend p {
  font-size:13px;
  line-height:1.8;
  color:var(--muted);
}

.practice-friend>span {
  font-size:34px;
  color:#b9c59b;
}

@keyframes pal-breathe {
  0%,100% {
    transform:translateY(0) rotate(-2deg);
  }
  50% {
    transform:translateY(-5px) rotate(1deg);
  }
}

@keyframes twinkle {
  0%,100% {
    opacity:.4;
    transform:scale(.9);
  }
  50% {
    opacity:1;
    transform:scale(1.15);
  }
}

@media(min-width:1500px) {
  .lobby-main {
    padding:36px 52px 25px;
  }
  .world-art {
    min-height:435px;
  }
  .adventure-layout {
    grid-template-columns:minmax(0,1fr) 320px;
  }
  .companion-stage {
    height:210px;
  }
  .hero-pal {
    width:215px;
    height:215px;
  }
  .companion-description {
    font-size:12px;
  }
  .destination-label strong {
    font-size:13px;
  }
  .destination-art {
    width:55px;
    height:55px;
  }
  .home-heading {
    padding:37px 0 28px;
  }
}

@media(max-width:1200px) {
  .side-rail {
    width:168px;
    padding:32px 15px 22px;
  }
  .lobby-main {
    width:calc(100% - 168px);
    padding:25px;
  }
  .brand {
    font-size:25px;
    gap:8px;
  }

  .rail-caption {
    font-size:8px;
    letter-spacing:1px;
  }
  .handwritten {
    display:none;
  }
  .adventure-layout {
    grid-template-columns:minmax(0,1fr) 255px;
    gap:18px;
  }
  .companion-card {
    padding:16px;
  }
  .world-art {
    min-height:355px;
  }
  .world-bottom {
    padding:0 16px;
  }
  .boss-note {
    display:none;
  }
  .destinations {
    gap:8px;
  }
  .destination {
    gap:7px;
    padding:8px;
  }
  .destination-art {
    width:35px;
    height:43px;
  }
  .destination-label strong {
    font-size:10px;
  }
  .destination-check {
    display:none;
  }
  .badges-grid {
    grid-template-columns:repeat(2,1fr);
  }
  .settings-layout {
    grid-template-columns:minmax(0,1fr) 250px;
    gap:25px;
  }
  .practice-friend canvas {
    width:210px;
    height:210px;
  }
}

@media(max-width:900px) {
  .side-rail {
    width:90px;
    padding:28px 10px;
  }
  .brand {
    justify-content:center;
  }

  .rail-caption,.rail-bottom {
    display:none;
  }
  .side-rail nav {
    margin-top:35px;
    gap:13px;
  }
  .nav-item {
    flex-direction:column;
    gap:7px;
    padding:12px 4px;
    font-size:9px;
    text-align:center;
  }
  .lobby-main {
    width:calc(100% - 90px);
    padding:24px;
  }
  .home-heading h1 {
    font-size:29px;
  }
  .world-caption h2 {
    font-size:30px;
  }
  .world-caption {
    left:20px;
  }
  .adventure-layout {
    grid-template-columns:minmax(0,1fr) 230px;
    gap:15px;
  }
  .companion-top {
    flex-wrap:wrap;
    gap:0;
  }
  .companion-top .text-button {
    min-height:30px;
  }
  .companion-stage {
    height:148px;
  }
  .hero-pal {
    width:150px;
    height:150px;
  }
  .companion-description {
    font-size:10px;
  }
  .world-art {
    min-height:360px;
  }
  .destinations {
    grid-template-columns:repeat(2,1fr);
    gap:10px;
  }
  .destination-art {
    width:45px;
    height:45px;
  }
  .destination-label strong {
    font-size:12px;
  }
  .destination-check {
    display:flex;
  }
  .practice-note {
    flex-wrap:wrap;
    padding:14px;
  }
  .practice-note>div {
    flex:1;
  }
  .practice-note .text-button {
    margin-left:52px;
    min-height:30px;
  }
  .lobby-footer {
    flex-direction:column;
    gap:8px;
    align-items:flex-start;
  }
  .pals-grid {
    grid-template-columns:repeat(3,1fr);
  }
  .settings-layout {
    grid-template-columns:1fr;
  }
  .practice-friend {
    display:none;
  }
}

@media(max-width:650px) {
  #lobby {
    display:block;
  }
  .side-rail {
    width:100%;
    height:auto;
    position:relative;
    display:flex;
    flex-direction:row;
    align-items:center;
    border-right:0;
    border-bottom:1px solid var(--line);
    padding:13px 18px;
    gap:20px;
  }

  .brand {
    font-size:21px;
    line-height:.88;
    gap:7px;
  }


  .side-rail nav {
    margin:0 0 0 auto;
    flex-direction:row;
    gap:4px;
  }
  .nav-item {
    font-size:8px;
    gap:4px;
    padding:8px 9px;
    border-radius:10px;
    min-height:48px;
  }
  .nav-item svg {
    width:18px;
    height:18px;
  }
  .lobby-main {
    width:100%;
    padding:20px 18px 15px;
  }
  .lobby-header {
    padding-bottom:17px;
  }
  .lobby-header p {
    font-size:11px;
  }
  .header-crumb {
    font-size:7px;
    letter-spacing:1px;
  }
  .sound-button {
    padding:10px;
    min-height:44px;
  }
  .sound-button span {
    display:none;
  }
  .home-heading {
    padding:23px 0 18px;
  }
  .home-heading h1 {
    font-size:29px;
    max-width:290px;
  }
  .section-kicker {
    font-size:8px;
  }
  .adventure-layout {
    grid-template-columns:1fr;
    gap:16px;
  }
  .world-art {
    height:320px;
    min-height:0;
  }
  .world-caption h2 {
    font-size:35px;
  }
  .world-bottom {
    height:47px;
    font-size:9px;
  }
  .companion-card {
    display:grid;
    grid-template-columns:102px minmax(0,1fr);
    gap:0 14px;
    padding:17px;
  }
  .companion-top {
    grid-column:1/-1;
    flex-wrap:nowrap;
    margin-bottom:6px;
  }
  .companion-top .text-button {
    font-size:11px;
    min-height:30px;
  }
  .companion-stage {
    grid-column:1;
    grid-row:2/5;
    height:130px;
    align-self:center;
  }
  .hero-pal {
    width:119px;
    height:119px;
  }
  .portrait-halo {
    width:99px;
    height:99px;
  }
  .pal-spark {
    right:0;
    top:10px;
    font-size:22px;
  }
  .companion-name {
    grid-column:2;
    align-items:flex-start;
    gap:6px;
  }
  .companion-name h2 {
    font-size:28px;
  }
  .companion-description {
    grid-column:2;
    text-align:left;
    margin:9px 0;
    font-size:10px;
  }
  .signature-move {
    grid-column:2;
    padding:8px 10px;
    margin:0 0 12px;
  }
  .companion-card .start-adventure {
    grid-column:1/-1;
    min-height:48px;
    font-size:14px;
  }
  .start-caption {
    grid-column:1/-1;
    margin-top:12px;
  }
  .destination-section {
    margin-top:24px;
  }
  .section-heading {
    align-items:flex-start;
    gap:8px;
  }
  .section-heading h2 {
    font-size:15px;
  }
  .section-heading>span {
    font-size:8px;
    max-width:85px;
    text-align:right;
    line-height:1.5;
  }
  .destination {
    min-height:75px;
  }
  .destination-label strong {
    font-size:10px;
  }
  .destination-label small {
    font-size:6px;
  }
  .destination-art {
    width:37px;
    height:45px;
  }
  .destination-check svg {
    width:11px;
    height:11px;
  }
  .practice-note strong {
    font-size:11px;
  }
  .practice-note p {
    font-size:10px;
  }
  .lobby-footer {
    font-size:8px;
    padding-top:18px;
  }
  .page-heading {
    padding:26px 0 22px;
  }
  .page-heading h1 {
    font-size:30px;
  }
  .page-heading p {
    font-size:11px;
  }
  .pals-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:11px;
  }
  .pal-card {
    padding:12px 10px 0;
  }
  .pal-card .pal-portrait {
    width:130px;
    height:130px;
  }
  .pal-card h2 {
    font-size:25px;
  }
  .pal-card p {
    font-size:9px;
  }
  .pal-select-label {
    font-size:9px;
    gap:6px;
  }
  .collection-bottom {
    padding:14px 0;
    gap:14px;
  }
  .collection-bottom>span {
    font-size:9px;
    max-width:120px;
    line-height:1.5;
  }
  .collection-bottom .start-adventure {
    font-size:10px;
    padding:12px;
    gap:10px;
  }
  .badges-grid {
    grid-template-columns:1fr;
  }
  .badge-card {
    padding:18px;
  }
  .badge-card h2 {
    font-size:14px;
  }
  .badge-card p {
    font-size:11px;
  }
  .practice-settings {
    padding:22px 18px;
  }
  .grade-options {
    gap:9px;
  }
  .option-button {
    font-size:12px;
    padding:12px;
  }
  .operation-options {
    grid-template-columns:repeat(2,1fr);
  }
  .practice-settings h2 {
    font-size:16px;
  }
}

@media(max-width:370px) {
  .side-rail {
    padding:12px;
    gap:8px;
  }
  .brand {
    font-size:18px;
  }

  .nav-item {
    padding:7px 8px;
  }
  .lobby-main {
    padding:18px 14px;
  }
  .world-art {
    height:280px;
  }
  .world-caption h2 {
    font-size:30px;
  }
  .destination-check {
    display:none;
  }
  .pal-card .pal-portrait {
    width:115px;
    height:115px;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation:none!important;
    transition:none!important;
  }
}

.mobile-start {
  display:none;
}

@media(max-width:650px) {
  .in-lobby #lobby {
    padding-bottom:90px;
  }
  .mobile-start {
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    z-index:4;
    background:var(--white);
    box-shadow:0 -5px 22px #3e463a12;
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 18px max(15px,env(safe-area-inset-bottom));
    min-height:80px;
  }
  .mobile-start canvas {
    width:48px;
    height:48px;
  }
  .mobile-start>span {
    display:flex;
    flex-direction:column;
    gap:4px;
  }
  .mobile-start small {
    font-size:6px;
    letter-spacing:.5px;
    font-weight:900;
    color:var(--muted);
  }
  .mobile-start strong {
    font-size:17px;
    font-weight:900;
  }
  .mobile-start .start-adventure {
    margin-left:auto;
    padding:13px 15px;
    font-size:12px;
    gap:12px;
    min-height:45px;
  }
  .mobile-start button svg {
    width:17px;
    height:17px;
  }
}

.pal-moves {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:5px;
  margin:0 0 16px;
}

.pal-moves>span {
  font-size:8px;
  font-weight:700;
  line-height:1.4;
  padding:4px 6px;
  background:#eeeee2;
  border-radius:5px;
  color:#64705a;
}

.chosen .pal-moves>span {
  background:#e1e8d5;
}

#loading {
  position:fixed;
  inset:0;
  z-index:10;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:18px;
  background:var(--paper);
  color:var(--forest);
}

#loading>span {
  font-size:50px;
  color:#9ab184;
}

#loading>strong {
  font-size:19px;
}

#loading>a {
  color:var(--forest);
  padding:15px;
  font-weight:800;
}

#game:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: -2px;
}
.pal-combat-role { display: block; color: #536c45; font-size: 9px; font-weight: 800; line-height: 1.5; margin: -5px 0 13px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.wallet-pill { display: inline-flex; align-items: center; gap: 7px; border: 0; background: #f1e6cb; color: #735d2e; border-radius: 24px; min-height: 44px; padding: 10px 14px; font-size: 11px; }
.wallet-pill svg { width: 18px; height: 18px; }
.wallet-pill strong { font-size: 15px; font-weight: 900; }
.camp-note { display: flex; align-items: center; gap: 14px; padding: 17px 20px; margin-bottom: 16px; background: #eee6d3; border-radius: 13px; }
.camp-symbol { color: #9f7b3c; display: flex; }
.camp-symbol svg { width: 30px; height: 30px; }
.camp-note strong { font-size: 12px; font-weight: 900; }
.camp-note p { margin: 5px 0 0; font-size: 10px; color: #716449; line-height: 1.5; }
.camp-note .text-button { margin-left: auto; white-space: nowrap; }
.camp-note .report-link { margin-left: 5px; color: #716449; }
.locked-pal { background: #f1f0e8; border-style: dashed; }
.locked-pal > .pal-portrait { opacity: .65; filter: saturate(.55); }
.locked-pal .pal-status { font-size: 7px; letter-spacing: .7px; }
.rescue-goal { margin: 12px -2px 15px; padding-top: 13px; border-top: 1px solid #dadfce; text-align: left; }
.rescue-goal strong { font-size: 11px; color: #536c45; }
.rescue-goal p { font-size: 10px; line-height: 1.6; margin: 5px 0 11px; }
.rescue-goal > span { display: block; font-size: 9px; font-weight: 800; color: #687361; margin-top: 5px; }
progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 7px; border: 0; border-radius: 7px; overflow: hidden; background: #dde3d2; }
progress::-webkit-progress-bar { background: #dde3d2; border-radius: 7px; }
progress::-webkit-progress-value { background: #86a56c; border-radius: 7px; }
progress::-moz-progress-bar { background: #86a56c; border-radius: 7px; }
.upgrade-wallet { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; background: #eee6d3; border-radius: 15px; margin-bottom: 22px; }
.upgrade-wallet > span { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #735d2e; }
.upgrade-wallet svg { width: 27px; height: 27px; }
.upgrade-wallet strong { font-size: 28px; font-weight: 900; }
.upgrade-wallet p { font-size: 11px; color: #716449; margin: 0; }
.upgrade-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.upgrade-card { background: var(--white); padding: 24px; border-radius: 16px; display: flex; flex-direction: column; }
.upgrade-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.upgrade-card-top canvas { width: 50px; height: 50px; background: #edf0df; border-radius: 15px; }
.upgrade-card-top > span { font-size: 8px; font-weight: 900; letter-spacing: 1px; color: #687361; }
.upgrade-card h2 { font-family: 'Lilita One', ui-rounded, sans-serif; font-weight: 400; font-size: 24px; margin: 0 0 10px; }
.upgrade-card > p { font-size: 12px; line-height: 1.7; color: #687361; margin-bottom: 20px; min-height: 41px; }
.upgrade-ranks { display: flex; gap: 5px; margin-bottom: 17px; }
.upgrade-ranks i { flex: 1; height: 6px; background: #e5e8dc; border-radius: 5px; }
.upgrade-ranks i.filled { background: #8aa66e; }
.upgrade-value { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.upgrade-value > span { color: #687361; }
.upgrade-value strong { color: #426a46; }
.upgrade-next { font-size: 10px; color: #687361; margin: 9px 0 19px; }
.upgrade-buy { display: flex; justify-content: center; align-items: center; gap: 8px; border: 0; background: #426a46; color: #fffdf8; border-radius: 10px; min-height: 46px; padding: 12px; font-weight: 900; font-size: 12px; margin-top: auto; }
.upgrade-buy:disabled { cursor: default; background: #e7eada; color: #65705a; filter: none; }
.upgrade-buy svg { width: 17px; height: 17px; }
.upgrade-shortfall { min-height: 15px; display: block; text-align: center; font-size: 9px; color: #687361; margin-top: 10px; }
.save-note { margin: 22px 0 0; font-size: 10px; color: #687361; line-height: 1.7; }
.results-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 25px; }
.coin-reward { background: #eee6d3; padding: 30px; border-radius: 18px; text-align: center; }
.big-coin { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: #f8e5ad; color: #98723b; margin: 0 auto 14px; }
.big-coin svg { width: 43px; height: 43px; }
.coin-total { display: block; font-family: 'Lilita One', ui-rounded, sans-serif; font-size: 66px; font-weight: 400; line-height: 1.1; color: #735d2e; }
.coin-reward h2 { font-size: 17px; margin: 4px 0 12px; font-weight: 900; }
.coin-reward > p { font-size: 11px; color: #716449; }
.reward-breakdown { padding: 18px 0; margin: 15px 0 20px; border-top: 1px solid #dacfaf; border-bottom: 1px solid #dacfaf; }
.reward-breakdown > div { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; padding: 7px 0; }
.reward-breakdown span { color: #716449; }
.reward-breakdown strong { color: #735d2e; }
.reward-breakdown .fortune-reward { padding-top: 13px; margin-top: 6px; border-top: 1px solid #dacfaf; }
.coin-reward .start-adventure { width: 100%; font-size: 12px; }
.adventure-recap { padding: 5px 0; }
.run-stat-line { display: flex; justify-content: space-between; gap: 20px; padding: 22px; background: var(--white); border-radius: 14px; margin-bottom: 28px; }
.run-stat-line span { font-size: 10px; color: #687361; }
.run-stat-line strong { display: block; font-size: 23px; color: #3e463a; margin-bottom: 5px; }
.adventure-recap > h2 { font-size: 19px; margin-bottom: 19px; }
.next-rescue { padding: 17px; margin-bottom: 15px; background: #edf0e0; border-radius: 14px; }
.next-rescue > div { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.next-rescue canvas { width: 65px; height: 65px; flex-shrink: 0; }
.next-rescue strong { font-size: 14px; }
.next-rescue p { font-size: 11px; line-height: 1.6; color: #687361; margin: 5px 0 0; }
.next-rescue small { font-size: 9px; color: #687361; display: block; margin-top: 7px; }
.rescued-crew { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rescued-crew > div { display: flex; flex-direction: column; align-items: center; padding: 15px; border-radius: 14px; background: #edf0df; text-align: center; }
.rescued-crew canvas { width: 105px; height: 105px; }
.rescued-crew strong { font-size: 17px; margin-top: 5px; }
.rescued-crew span { font-size: 9px; line-height: 1.5; color: #687361; margin-top: 6px; }
.result-actions { display: flex; align-items: center; gap: 20px; margin-top: 25px; }
.result-actions .start-adventure { font-size: 12px; }
.ability-icon { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.pal-moves>span { display: inline-flex; align-items: center; gap: 5px; text-align: left; }
.pal-moves .ability-icon { width: 23px; height: 23px; }
.signature-move>.ability-icon { width: 48px; height: 48px; }
.upgrade-card-top canvas { width: 64px; height: 64px; background: transparent; border-radius: 0; }
@media (max-width: 650px) {
  .collection-bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 2; }
}
@media (max-width: 1100px) {
  .upgrade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upgrade-card { padding: 20px; }
  .results-layout { gap: 18px; }
  .coin-reward { padding: 24px; }
}
@media (max-width: 750px) {
  .results-layout { grid-template-columns: 1fr; }
  .upgrade-wallet { align-items: flex-start; flex-direction: column; gap: 8px; }
  .camp-note { flex-wrap: wrap; }
  .camp-note > div { flex: 1; }
  .camp-note .text-button { margin-left: 43px; min-height: 30px; }
  .camp-note .report-link { margin-left: auto; }
}
@media (max-width: 650px) {
  .side-rail { gap: 12px; padding: 13px 14px; }
  .side-rail .brand { font-size: 19px; gap: 6px; }

  .nav-item { font-size: 7px; padding: 8px 6px; }
  .header-actions { gap: 7px; }
  .wallet-pill { padding: 10px; gap: 5px; }
  .wallet-pill > span { display: none; }
  .wallet-pill strong { font-size: 13px; }
  .wallet-pill svg { width: 16px; height: 16px; }
  .upgrade-grid { grid-template-columns: 1fr; gap: 14px; }
  .upgrade-card > p { min-height: 0; }
  .upgrade-card h2 { font-size: 25px; }
  .camp-note { padding: 16px; }
  .camp-note strong { font-size: 11px; }
  .camp-note p { font-size: 9px; }
  .coin-reward { padding: 25px 22px; }
  .run-stat-line { gap: 12px; padding: 18px; }
  .run-stat-line span { font-size: 9px; }
  .run-stat-line strong { font-size: 21px; }
  .result-actions { gap: 15px; }
  .rescue-goal p { font-size: 9px; }
}
@media (max-width: 370px) {


  .side-rail nav { gap: 2px; }
}

/* Compact run tray (Math Pickups): owned attacks as small icons with
   cooldown rings, plus one round signature button once it unlocks. */
#skill-dock {
  --skill-color: #b69b67;
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(470px, calc(100% - 32px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  z-index: 1;
  pointer-events: none;
}
#skill-dock [hidden] { display: none !important; }
.run-wallet { position: absolute; top: -20px; left: 4px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 15px; padding: 5px 10px; background: #fff8e7ee; color: #735d2e; font-size: 9px; box-shadow: 0 2px 0 #3e463a18; }
.run-wallet svg { width: 13px; height: 13px; }
.run-wallet strong { display: inline; font-size: 11px; }
.attack-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 30px; background: #fffdf8e8; box-shadow: 0 3px 0 #3e463a22, 0 6px 16px #3e463a14; }
.attack-chip { position: relative; width: 46px; height: 46px; flex-shrink: 0; animation: attack-pop .35s ease-out; }
.cooldown-ring { --p: 1; position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--skill-color) calc(var(--p) * 1turn), #e9e0cc 0); }
.cooldown-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fffdf8; }
.cooldown-ring .ability-icon { position: relative; width: 30px; height: 30px; }
.attack-level { position: absolute; right: -3px; bottom: -3px; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: #426a46; color: #fffdf8; border: 1.5px solid #fffdf8; font: 900 9px/14px 'Nunito', ui-rounded, sans-serif; text-align: center; }
.signature-button { position: relative; pointer-events: auto; width: 68px; height: 68px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; animation: attack-pop .35s ease-out; }
.signature-button .cooldown-ring { background: conic-gradient(#e6c986 calc(var(--p) * 1turn), #d9ddcf 0); box-shadow: 0 4px 0 #2f4c33, 0 8px 18px #3e463a33; }
.signature-button .cooldown-ring::before { inset: 5px; background: #426a46; }
.signature-button .ability-icon { width: 42px; height: 42px; }
.signature-button:not(:disabled) .cooldown-ring { animation: signature-ready 1.6s ease-in-out infinite; }
.signature-button:disabled { cursor: default; filter: none; }
.signature-button:disabled .cooldown-ring::before { background: #6d8466; }
.signature-button:disabled .ability-icon { filter: saturate(.6); opacity: .55; }
.signature-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #fffdf8; font: 400 20px 'Lilita One', ui-rounded, sans-serif; text-shadow: 0 2px 0 #2f4c33; }
.signature-key { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); padding: 1px 6px; border-radius: 7px; background: #fff8e7; color: #735d2e; font: 900 7px/12px 'Nunito', ui-rounded, sans-serif; letter-spacing: .5px; box-shadow: 0 1px 0 #3e463a22; }
@media (hover: none) { .signature-key { display: none; } }
@keyframes attack-pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.1); } to { transform: scale(1); opacity: 1; } }
@keyframes signature-ready { 0%, 100% { box-shadow: 0 4px 0 #2f4c33, 0 0 0 0 #e6c98688; } 50% { box-shadow: 0 4px 0 #2f4c33, 0 0 0 7px #e6c98600; } }
@media (prefers-reduced-motion: reduce) { .attack-chip, .signature-button, .signature-button .cooldown-ring { animation: none !important; } }
@media (max-height: 450px) and (orientation: landscape) {
  #skill-dock { width: auto; left: auto; right: 14px; bottom: 12px; transform: none; justify-content: flex-end; }
}

.reduce-motion .attack-chip, .reduce-motion .signature-button, .reduce-motion .signature-button .cooldown-ring { animation: none !important; }

/* Illustrated Number Swarm wordmark; crop to its mascot in the tablet rail. */
.brand-art { display:block; width:158px; height:60px; overflow:hidden; }
.brand-art img { display:block; width:158px; height:auto; max-width:none; }
@media (min-width:901px) and (max-width:1200px) {
  .brand-art { width:138px; height:52px; }
  .brand-art img { width:138px; }
}
@media (min-width:651px) and (max-width:900px) {
  .brand-art { width:58px; height:60px; }
}
@media (max-width:650px) {
  .brand-art { width:120px; height:45px; }
  .brand-art img { width:120px; }
}
@media (max-width:370px) {
  .brand-art { width:96px; height:36px; }
  .brand-art img { width:96px; }
}

@media (max-width:340px) {
  .brand-art { width:80px; height:30px; }
  .brand-art img { width:80px; }
}

/* The pal reveal owns focus and leaves the game safely paused. */
.new-pal-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; border: 0; border-radius: 24px; padding: 32px; background: #fffdf8; color: #3e463a; text-align: center; }
.new-pal-dialog::backdrop { background: #263c3259; }
.new-pal-dialog section { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.new-pal-dialog h1, .new-pal-dialog h2, .new-pal-dialog p { margin: 0; }
.new-pal-dialog .hero-pal { width: 200px; height: 200px; }
.new-pal-dialog .start-adventure { width: 100%; min-height: 48px; }
.unlock-confetti { color: #846429; font-size: 32px; animation: unlock-fall 1.6s ease-out both; }
@keyframes unlock-fall { from { transform: translateY(-32px); } to { transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .unlock-confetti { animation: none; } }
.locked-pal .pal-portrait { filter: brightness(0); opacity: .35; }

/* Painted elemental buddies use the same atlas in the chooser and the world. */
.companion-choice { display:flex; align-items:center; gap:14px; width:100%; min-height:76px; padding:8px 12px; color:#3e463a; background:#fffdf8; border:0; border-radius:12px; text-align:left; cursor:pointer; }
.companion-choice:hover { background:#e4ebda; }
.companion-choice:focus-visible { outline:3px solid #426a46; outline-offset:2px; }
.companion-choice strong,.companion-choice small { display:block; }
.companion-choice small { margin-top:4px; line-height:1.4; }
.companion-portrait { flex:0 0 64px; height:64px; background-image:url('../assets/art/adventure/companions.webp'); background-size:400% 300%; background-position:var(--buddy-x) var(--buddy-y); }
.math-celebration .math-heading h1 { color:#426a46; }
.math-celebration .math-earned { animation:learning-star-arrival 450ms cubic-bezier(.16,1,.3,1); }
@keyframes learning-star-arrival { from { transform:scale(.85); } to { transform:scale(1); } }
@media (prefers-reduced-motion:reduce) { .math-celebration .math-earned { animation:none; } }
.feedback-illustration { display:inline-block; background-image:url('../assets/art/adventure/feedback.webp'); background-size:300% 100%; background-position:var(--feedback-x,0%) 50%; }
.result-illustration { display:block; width:112px; height:112px; margin-bottom:12px; }
.answer-illustration { width:72px; height:72px; flex-shrink:0; }

/* One short story beat before the existing result controls. */
.outcome-dialog { width:min(380px,calc(100% - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; color:#3e463a; background:#fffdf8; border:0; border-radius:24px; text-align:center; }
.outcome-dialog::backdrop { background:rgba(43,53,39,.56); }
.outcome-dialog section { display:flex; flex-direction:column; align-items:center; gap:12px; }
.outcome-dialog h1,.outcome-dialog p { margin:0; }
.outcome-dialog p { line-height:1.5; }
.outcome-dialog .start-adventure { width:100%; min-height:48px; }
.outcome-art { width:112px; height:112px; }
.outcome-pal { width:100px; height:100px; }
.outcome-dialog[data-kind="win"] .outcome-art { animation:outcome-trophy 700ms cubic-bezier(.16,1,.3,1) both; }
.outcome-dialog[data-kind="win"] .outcome-pal { animation:outcome-cheer 650ms ease-in-out 3; }
.outcome-dialog[data-kind="rest"] .outcome-art { animation:outcome-rest 1.2s ease-in-out both; }
.outcome-dialog[data-kind="rest"] .outcome-pal { animation:outcome-nap 1.2s ease-in-out both; }
.outcome-sparks { color:#846429; font-size:28px; animation:outcome-sparks 1.8s ease-out both; }
.math-puzzled [data-math-pal] { animation:answer-puzzle 550ms ease-in-out; }
.math-celebration [data-math-pal] { animation:outcome-cheer 650ms ease-in-out; }
@keyframes outcome-trophy { 0% { transform:translateY(-36px) scale(.8); } 65% { transform:translateY(5px) scale(1.05); } 100% { transform:translateY(0) scale(1); } }
@keyframes outcome-cheer { 0%,100% { transform:translateY(0) rotate(0); } 45% { transform:translateY(-10px) rotate(-5deg); } 70% { transform:translateY(-4px) rotate(4deg); } }
@keyframes outcome-rest { to { transform:scale(.8); } }
@keyframes outcome-nap { to { transform:rotate(12deg) scaleY(.86); } }
@keyframes outcome-sparks { from { transform:translateY(-16px) scale(.8); opacity:0; } 30% { opacity:1; } to { transform:translateY(16px) scale(1.15); opacity:0; } }
@keyframes answer-puzzle { 25% { transform:rotate(-5deg); } 65% { transform:rotate(4deg); } }
@media (max-height:500px) { .outcome-dialog section { display:grid; grid-template-columns:80px 1fr; gap:8px 16px; } .outcome-art,.outcome-pal { width:72px; height:72px; grid-column:1; } .outcome-dialog h1,.outcome-dialog p,.outcome-dialog button { grid-column:2; } .outcome-dialog h1 { grid-row:1; } .outcome-dialog p { grid-row:2; } .outcome-sparks { display:none; } }
@media (prefers-reduced-motion:reduce) { .outcome-dialog *, .math-puzzled [data-math-pal], .math-celebration [data-math-pal] { animation:none !important; } }
.reduce-motion .outcome-dialog *, .reduce-motion .math-puzzled [data-math-pal], .reduce-motion .math-celebration [data-math-pal] { animation:none !important; }
