@font-face {
  font-family: Fredoka;
  src: url('../../public/fonts/Fredoka.ttf') format('truetype');
  font-display: swap;
  font-weight: 300 700;
}

@font-face {
  font-family: Nunito;
  src: url('../../public/fonts/Nunito.ttf') format('truetype');
  font-display: swap;
  font-weight: 200 1000;
}

:root {
  color-scheme: light;
  --ink: #302044;
  --muted: #665276;
  --cream: #fff9ec;
  --paper: #fffdf8;
  --violet: #6d43bb;
  --pink: #ef7bb1;
  --gold: #ffdb69;
  --cyan: #a8f4ec;
  --line: #e5dce8;
  --radius: 26px;
  --ease: cubic-bezier(.16,1,.3,1);
  font-family: Nunito,sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: #211e43;
}

* {
  box-sizing: border-box;
}

html,body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  overscroll-behavior: none;
}

button,input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

button,input {
  touch-action: manipulation;
}

button {
  color: inherit;
}

button:focus-visible,input:focus-visible,canvas:focus-visible {
  outline: 3px solid #6836a9;
  outline-offset: 4px;
}

canvas:focus-visible {
  outline-color: var(--gold);
  outline-offset: -5px;
}

button,input,label {
  user-select: none;
}

button .icon {
  pointer-events: none;
}

::selection {
  background: #e6c8fb;
  color: #302044;
}

a {
  text-underline-offset: .2em;
}

input {
  accent-color: var(--violet);
  caret-color: var(--violet);
}

[hidden] {
  display: none!important;
}

.icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: block;
}

.sr-only {
  position: absolute!important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.game {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 320px;
  overflow: hidden;
}

.game canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.scene-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,rgba(25,19,54,.25),transparent 27%,transparent 62%,rgba(20,17,40,.55));
  transition: opacity .4s;
}

.game[data-view=loading] .scene-shade {
  opacity: 0;
}

.game[data-view=playing] .scene-shade {
  background: linear-gradient(180deg,rgba(25,19,54,.3),transparent 19%,transparent 78%,rgba(20,17,40,.36));
}

.home-bar {
  position: absolute;
  top: max(24px,env(safe-area-inset-top));
  left: max(32px,env(safe-area-inset-left));
  right: max(32px,env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  z-index: 3;
  pointer-events: none;
}

.home-bar>* {
  pointer-events: auto;
}

.wordmark {
  font-family: Fredoka,sans-serif;
  font-size: clamp(32px,3.6vw,48px);
  font-weight: 650;
  line-height: .9;
  color: #fff9ed;
  text-shadow: 0 3px 10px rgba(0,0,0,.35);
  letter-spacing: -.035em;
}

.wordmark span {
  display: block;
  font-family: Nunito,sans-serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.6;
  letter-spacing: .01em;
  margin-top: 8px;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.heart-bank {
  height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff9ed;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 25px;
  box-shadow: 0 5px 15px rgba(28,19,48,.15);
}

.heart-bank>.icon,.heart-bank>span>.icon {
  color: #ac356a;
  fill: #f6a5ca;
  width: 23px;
}

.heart-bank strong {
  font-family: Fredoka,sans-serif;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--cream);
  box-shadow: 0 5px 14px rgba(28,19,48,.13);
  transition: transform .18s var(--ease),background .18s;
}

.icon-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button[aria-pressed=true] {
  background: var(--cyan);
  border-color: #e7fffb;
}

.home-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-dock {
  position: absolute;
  bottom: max(28px,env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(940px,calc(100% - 64px));
  display: grid;
  grid-template-columns: minmax(190px,1fr) minmax(190px,240px) minmax(255px,1.1fr);
  gap: 24px;
  align-items: center;
  pointer-events: auto;
}

.next-adventure {
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  display: flex;
  flex-direction: column;
  gap: 5px;
  line-height: 1.25;
}

.next-adventure>span:first-child {
  font-size: 14px;
  font-weight: 850;
  color: #fff3b6;
}

.next-adventure>strong {
  font-family: Fredoka,sans-serif;
  font-size: 23px;
  font-weight: 550;
  text-wrap: balance;
  letter-spacing: -.015em;
}

.next-adventure>span:last-child {
  font-size: 13px;
  font-weight: 850;
}

.button {
  border: 2px solid transparent;
  border-radius: 20px;
  min-height: 54px;
  padding: 13px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 950;
  font-size: 16px;
  line-height: 1.2;
  transition: transform .18s var(--ease),background .18s,box-shadow .18s;
  position: relative;
  text-decoration: none;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

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

.button:disabled {
  opacity: .55;
  box-shadow: none;
}

.button-primary {
  background: #7042b9;
  color: #fff;
  border-color: #8756ca;
  box-shadow: 0 6px 14px rgba(34,20,58,.17);
}

.button-primary:hover {
  background: #6334a9;
}

.button-play {
  background: var(--gold);
  color: #493111;
  border-color: #fff0ab;
  box-shadow: 0 12px 25px rgba(0,0,0,.22);
  min-height: 72px;
  font-family: Fredoka,sans-serif;
  font-size: 27px;
  font-weight: 600;
  overflow: hidden;
}

.button-play>.icon {
  width: 29px;
  height: 29px;
  fill: currentColor;
}

.button-play:active:not(:disabled) {
  box-shadow: 0 6px 12px rgba(0,0,0,.18);
  transform: translateY(4px);
}

.button-spark {
  position: absolute;
  left: -15%;
  top: -50%;
  width: 26%;
  height: 200%;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,.5),transparent);
  transform: skewX(-20deg);
  animation: button-light 7s 1.8s infinite;
  pointer-events: none;
}

.button-secondary {
  background: #eee5f5;
  border-color: #e0d2ed;
  color: #4c2e67;
}

.button-secondary:hover {
  background: #e6d8f0;
}

.button-quiet {
  background: transparent;
  color: #5e3a7c;
}

.button-quiet:hover {
  background: #eee5f5;
}

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

.home-tools button {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 86px;
  padding: 10px 6px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 20px;
  background: #fff9ec;
  box-shadow: 0 6px 16px rgba(26,20,46,.16);
  font-weight: 950;
  transition: transform .18s var(--ease),background .18s;
}

.home-tools button>.icon {
  color: #75499d;
  width: 25px;
  height: 25px;
}

.home-tools button>span {
  font-size: 14px;
}

.home-tools small {
  font-size: 12px;
  font-weight: 900;
  color: #6a5278;
  white-space: nowrap;
}

.home-tools button:hover {
  transform: translateY(-3px);
  background: #fff;
}

.home-tools button:active {
  transform: translateY(1px);
}

.save-note {
  position: absolute;
  left: 50%;
  bottom: 155px;
  transform: translateX(-50%);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px 11px 18px;
  border-radius: 18px;
  background: #fff9ec;
  width: min(520px,calc(100% - 40px));
  box-shadow: 0 6px 20px rgba(29,21,48,.16);
}

.save-note p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.save-note button {
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  border: 0;
  background: transparent;
  border-radius: 13px;
}

.storage-warning {
  position: absolute;
  left: 50%;
  bottom: 135px;
  transform: translateX(-50%);
  color: #fff;
  background: #4e2445;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0;
  width: min(500px,90%);
  font-size: 12px;
  font-weight: 850;
}

.play-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.play-hud {
  position: absolute;
  top: max(18px,env(safe-area-inset-top));
  left: max(24px,env(safe-area-inset-left));
  right: max(24px,env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.play-hud>.icon-button {
  pointer-events: auto;
  background: #fff9ec;
}

.route-readout {
  flex: 1;
  max-width: 410px;
  padding: 9px 17px 10px;
  border-radius: 19px;
  color: #fff9ed;
  background: rgba(40,29,67,.92);
  box-shadow: 0 5px 15px rgba(24,17,44,.13);
}

.route-readout>span {
  font-size: 12px;
  font-weight: 900;
  color: #ffe4a0;
  display: block;
}

.route-readout strong {
  font-family: Fredoka,sans-serif;
  font-size: 18px;
  font-weight: 500;
  display: block;
  line-height: 1.25;
  margin-top: 2px;
}

.route-progress {
  height: 5px;
  background: #665278;
  margin: 9px 12px 0 0;
  border-radius: 5px;
  position: relative;
}

.route-progress>span:first-child {
  height: 100%;
  display: block;
  width: 0;
  background: #91e9d7;
  border-radius: 5px;
  transition: width .14s linear;
}

.route-progress>span:last-child {
  position: absolute;
  right: -13px;
  top: -8px;
  color: #ffdd76;
}

.route-progress .icon {
  height: 18px;
  width: 18px;
}

.parade-readout {
  margin-left: auto;
  background: #fff9ec;
  border: 2px solid #fff0b9;
  border-radius: 20px;
  min-width: 120px;
  display: grid;
  grid-template-columns: 23px auto;
  grid-template-rows: 32px 16px;
  align-items: center;
  column-gap: 8px;
  padding: 8px 14px;
  box-shadow: 0 6px 17px rgba(23,16,43,.16);
}

.parade-readout>.icon {
  color: #75439e;
}

.parade-readout>strong {
  font-family: Fredoka,sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.parade-label {
  grid-column: 1/3;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  color: #675174;
}

.shield-readout {
  position: absolute;
  right: 1px;
  top: 79px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #c5f7ec;
  color: #244e45;
  padding: 5px 11px;
  border: 1px solid #effffa;
  border-radius: 14px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.shield-readout .icon {
  width: 18px;
  height: 18px;
}

.shield-readout.is-empty {
  visibility: hidden;
}

.action-dock {
  position: absolute;
  left: max(24px,env(safe-area-inset-left));
  right: max(24px,env(safe-area-inset-right));
  bottom: max(20px,env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.steering-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff9ec;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
}

.steering-hint>.icon {
  width: 31px;
  height: 31px;
}

.steering-hint p {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 950;
  margin: 0;
}

.steering-hint span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 5px;
}

.cohesion-wrap {
  width: 125px;
  margin-left: auto;
  color: #fff9ec;
  font-size: 12px;
  font-weight: 950;
  text-align: right;
  text-shadow: 0 2px 5px rgba(0,0,0,.5);
}

.cohesion-wrap>span {
  display: block;
  margin-bottom: 5px;
}

meter {
  width: 100%;
  height: 9px;
  display: block;
  appearance: none;
  border: none;
  background: #655074;
  border-radius: 9px;
  overflow: hidden;
}

meter::-webkit-meter-bar {
  border: 0;
  background: #655074;
  border-radius: 9px;
}

meter::-webkit-meter-optimum-value {
  background: #a7ebd2;
  border-radius: 9px;
}

meter::-webkit-meter-suboptimum-value {
  background: #ffcf78;
  border-radius: 9px;
}

meter::-webkit-meter-even-less-good-value {
  background: #f598aa;
  border-radius: 9px;
}

meter::-moz-meter-bar {
  background: #a7ebd2;
  border-radius: 9px;
}

.power-button {
  pointer-events: auto;
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  min-width: 238px;
  border: 2px solid #d8b7f3;
  border-radius: 23px;
  padding: 11px 16px;
  background: #412b61;
  color: #fff4ff;
  box-shadow: 0 6px 18px rgba(19,14,35,.23);
  text-align: left;
  transition: transform .18s var(--ease),border-color .2s,background .2s;
}

.power-button>.icon {
  width: 32px;
  height: 32px;
  z-index: 1;
}

.power-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.power-copy strong {
  font-family: Fredoka,sans-serif;
  font-size: 20px;
  font-weight: 500;
}

.power-copy small {
  font-size: 12px;
  font-weight: 900;
  color: #f4ddff;
}

.power-fill {
  position: absolute;
  inset: auto 0 0;
  height: 0;
  background: #74509a;
  z-index: -1;
  transition: height .18s;
}

.power-button.is-ready {
  background: #c4f6ea;
  color: #254b43;
  border-color: #f2fff7;
  box-shadow: 0 12px 22px rgba(0,0,0,.2);
}

.power-button.is-ready .power-fill {
  background: #a5ebda;
}

.power-button.is-ready .power-copy small {
  color: #355c50;
}

.power-button.is-ready:hover {
  transform: translateY(-2px);
}

.power-button.is-ready:active {
  transform: translateY(3px);
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.power-button:disabled {
  opacity: 1;
}

.power-button kbd {
  margin-left: auto;
  font-family: inherit;
  font-weight: 950;
  font-size: 12px;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 4px 5px;
  opacity: .85;
}

.event-banner {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%,-8px);
  width: max-content;
  max-width: 86%;
  font-family: Fredoka,sans-serif;
  font-size: clamp(20px,3vw,32px);
  font-weight: 550;
  line-height: 1.2;
  text-align: center;
  background: #fff9ec;
  color: #442e5c;
  padding: 11px 24px;
  border: 2px solid #fff;
  border-radius: 22px;
  box-shadow: 0 6px 22px rgba(23,18,42,.2);
  opacity: 0;
  transition: opacity .16s,transform .3s var(--ease);
}

.event-banner.is-visible {
  opacity: 1;
  transform: translate(-50%,0);
}

.combo-banner {
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff4bc;
  font-family: Fredoka,sans-serif;
  font-size: 21px;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.combo-banner>.icon {
  width: 22px;
  height: 22px;
}

.loading-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: #ede2f0;
  color: #49325d;
  padding: 32px;
  z-index: 10;
}

.loading-mark {
  width: 110px;
  height: 110px;
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 25px;
}

.loading-mark>.icon {
  width: 80px;
  height: 80px;
  stroke-width: 1.4;
  color: #9e3977;
  fill: #f6a5c7;
  animation: heart-arrival 1.8s var(--ease) infinite;
}

.loading-mark i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #af78cf;
  animation: orbit-dot 2.6s var(--ease) infinite;
}

.loading-mark i:nth-child(2) {
  top: 0;
  left: 10px;
}

.loading-mark i:nth-child(3) {
  bottom: 2px;
  right: 7px;
  animation-delay: .3s;
}

.loading-mark i:nth-child(4) {
  top: 20px;
  right: 0;
  width: 6px;
  height: 6px;
  animation-delay: .6s;
}

.loading-view h1 {
  font-family: Fredoka,sans-serif;
  font-size: clamp(28px,4vw,40px);
  font-weight: 550;
  letter-spacing: -.02em;
  margin: 0;
}

.loading-view p {
  font-size: 15px;
  font-weight: 800;
  max-width: 38ch;
  line-height: 1.5;
  margin: 13px 0 22px;
}

.loading-view progress {
  width: 220px;
  height: 10px;
  appearance: none;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #d4bfdc;
  color: #8250ae;
}

.loading-view progress::-webkit-progress-bar {
  background: #d4bfdc;
}

.loading-view progress::-webkit-progress-value {
  background: #8250ae;
  border-radius: 8px;
  transition: width .25s;
}

.loading-view progress::-moz-progress-bar {
  background: #8250ae;
}

.loading-view .button {
  margin-top: 10px;
}

.loading-view.is-error .loading-mark>.icon {
  animation: none;
}

.loading-view.is-error .loading-mark i {
  display: none;
}

.game-dialog {
  border: 0;
  padding: 27px 29px 25px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  width: min(620px,calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-shadow: 0 22px 70px rgba(21,13,38,.28);
  scrollbar-width: thin;
  scrollbar-color: #bca4d1 transparent;
  overscroll-behavior: contain;
}

.game-dialog::backdrop {
  background: rgba(25,17,47,.57);
}

.game-dialog::-webkit-scrollbar {
  width: 8px;
}

.game-dialog::-webkit-scrollbar-thumb {
  background: #bca4d1;
  border: 2px solid var(--paper);
  border-radius: 8px;
}

.game-dialog[open] {
  animation: dialog-arrive .26s var(--ease);
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 23px;
}

.dialog-heading h2 {
  font-family: Fredoka,sans-serif;
  font-weight: 550;
  letter-spacing: -.025em;
  line-height: 1.12;
  font-size: 31px;
  margin: 2px 0 8px;
  text-wrap: balance;
}

.dialog-heading p {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  max-width: 43ch;
}

.dialog-heading .icon-button {
  flex: 0 0 auto;
  background: #f0e8f4;
  border: 0;
  box-shadow: none;
}

.dialog-heading .icon-button:hover {
  background: #e4d6ed;
}

.dialog-footnote {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--muted);
  margin: 22px 0 0;
}

.dialog-done {
  display: flex;
  width: 100%;
  margin-top: 25px;
}

.dialog-feedback {
  min-height: 21px;
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 900;
  color: #4e6c45;
}

.map-dialog {
  width: min(760px,calc(100% - 32px));
}

.map-world+.map-world {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.map-world h3 {
  font-family: Fredoka,sans-serif;
  font-size: 21px;
  font-weight: 550;
  margin: 0 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-world h3>span {
  margin-left: auto;
  font-family: Nunito,sans-serif;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.world-levels {
  display: grid;
  grid-template-columns: repeat(8,1fr);
  gap: 8px;
}

.level-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-height: 72px;
  border-radius: 17px;
  border: 2px solid #e7daef;
  background: #f0e7f5;
  color: #674882;
  transition: transform .18s var(--ease),background .18s;
}

.level-button:hover {
  transform: translateY(-3px);
  background: #e5d4ef;
}

.level-button>strong {
  font-family: Fredoka,sans-serif;
  font-size: 24px;
  line-height: 1;
  font-weight: 550;
}

.level-button.is-complete {
  background: #e6f5e9;
  border-color: #c1e0c7;
  color: #37644a;
}

.level-button.is-next {
  background: #ffdf7b;
  border-color: #bd8439;
  color: #4d3418;
}

.level-button.is-next::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  background: #bd8439;
  transform: rotate(45deg);
  z-index: -1;
}

.level-stars {
  display: flex;
  gap: 1px;
  height: 12px;
}

.level-stars .icon {
  width: 12px;
  height: 12px;
  stroke-width: 1.8;
  color: currentColor;
}

.level-stars .is-earned {
  fill: currentColor;
}

.level-button .boss-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 11px;
  height: 11px;
  opacity: .7;
}

.build-balance {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8e315f;
  background: #fce8ef;
  border-radius: 16px;
  padding: 10px 15px;
  margin-bottom: 6px;
}

.build-balance strong {
  font-family: Fredoka,sans-serif;
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.build-balance>span:last-child {
  font-size: 12px;
  font-weight: 900;
  margin-left: 3px;
}

.building {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  column-gap: 15px;
  row-gap: 8px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.building:last-child {
  border-bottom: 0;
}

.building-emblem {
  display: grid;
  place-items: center;
  width: 48px;
  height: 54px;
  color: #74439e;
  background: #eee3f5;
  border-radius: 16px;
}

.building:nth-child(2) .building-emblem {
  background: #fff0bb;
  color: #885f1f;
}

.building:nth-child(3) .building-emblem {
  background: #dff4e8;
  color: #3a7251;
}

.building h3 {
  font-family: Fredoka,sans-serif;
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -.015em;
  margin: 0 0 5px;
}

.building p {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--muted);
  margin: 0;
  max-width: 31ch;
}

.build-steps {
  display: flex;
  gap: 4px;
  margin-top: 9px;
}

.build-steps i {
  width: 19px;
  height: 5px;
  border-radius: 4px;
  background: #dfd3e6;
}

.build-steps i.is-built {
  background: #8350ad;
}

.building .button {
  min-height: 52px;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  min-width: 99px;
}

.building .button .icon {
  width: 17px;
  height: 17px;
}

.building .button:disabled {
  opacity: 1;
  background: #eae5ed;
  color: #735e7d;
  border-color: #dfd7e3;
}

.building-cost {
  display: flex;
  align-items: center;
  gap: 5px;
}

.support-options {
  padding: 0;
  border: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-choice {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid #e5d9ed;
  border-radius: 20px;
  background: #f9f4fb;
  cursor: pointer;
  transition: background .2s,border-color .2s;
}

.support-choice:has(input:checked) {
  background: #ece0f8;
  border-color: #8453b4;
}

.support-choice:has(input:focus-visible) {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.support-choice>.icon {
  height: 35px;
  width: 35px;
  color: #7542a0;
}

.support-choice > .family-avatar {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.support-choice:nth-of-type(2)>.icon {
  color: #986328;
}

.support-choice:nth-of-type(3)>.icon {
  color: #4e7892;
}

.support-choice strong {
  font-family: Fredoka,sans-serif;
  font-size: 22px;
  font-weight: 550;
  display: block;
}

.support-choice b {
  font-size: 12px;
  display: block;
  margin: 2px 0;
  color: #6d478d;
}

.support-choice small {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  display: block;
  color: var(--muted);
  max-width: 39ch;
}

.support-choice input {
  width: 24px;
  height: 24px;
  margin: 0;
}

.mode-options {
  border: 0;
  padding: 0;
  margin: 0 0 23px;
}

.mode-options legend {
  font-weight: 950;
  font-size: 14px;
  margin-bottom: 10px;
}

.mode-options label {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 2px solid #e9dfef;
  border-radius: 17px;
  cursor: pointer;
  min-height: 66px;
}

.mode-options label+label {
  margin-top: 8px;
}

.mode-options label:has(input:checked) {
  border-color: #8753b4;
  background: #f0e5f8;
}

.mode-options input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 0;
}

.mode-options strong {
  font-family: Fredoka,sans-serif;
  font-size: 19px;
  font-weight: 550;
  display: block;
}

.mode-options small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  margin-top: 2px;
}

.setting-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.setting-switch label {
  flex: 1;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.setting-switch strong {
  font-size: 14px;
  font-weight: 950;
}

.setting-switch span {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 800;
}

.setting-switch input {
  appearance: none;
  width: 50px;
  height: 30px;
  border-radius: 18px;
  border: 2px solid #a68bb6;
  background: #d6c9df;
  position: relative;
  margin: 9px 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.setting-switch input::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 3px rgba(35,22,52,.2);
  transition: transform .2s var(--ease);
}

.setting-switch input:checked {
  background: #7850a4;
  border-color: #7850a4;
}

.setting-switch input:checked::after {
  transform: translateX(20px);
}

.setting-switch input:disabled {
  opacity: .55;
  cursor: default;
}

.volume-setting {
  margin: 12px 0 16px;
}

.volume-setting label {
  font-size: 13px;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.volume-setting output {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.volume-setting input {
  width: 100%;
  height: 32px;
  margin: 2px 0 0;
  cursor: pointer;
}

.volume-setting input:disabled {
  opacity: .45;
  cursor: default;
}

.pause-dialog {
  width: min(390px,calc(100% - 32px));
  text-align: center;
  padding: 32px 30px;
}

.dialog-emblem {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  background: #eee1f6;
  color: #7846a6;
  border-radius: 23px;
  margin: 0 auto 18px;
}

.dialog-emblem .icon {
  width: 30px;
  height: 30px;
}

.pause-dialog h2,.result-dialog h2 {
  font-family: Fredoka,sans-serif;
  font-weight: 550;
  font-size: 34px;
  letter-spacing: -.025em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

.pause-dialog p,.result-dialog>p {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 800;
  color: var(--muted);
  margin: 13px 0 24px;
}

.pause-dialog>.button {
  width: 100%;
  min-height: 65px;
  font-size: 25px;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 20px;
}

.pause-actions>.button {
  min-height: 50px;
  font-size: 14px;
}

.result-dialog {
  width: min(480px,calc(100% - 32px));
  text-align: center;
  padding: 27px 30px 25px;
  overflow-x: hidden;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 0 0 22px;
}

.result-stars .icon {
  width: 51px;
  height: 51px;
  color: #a389b2;
  fill: #e8deed;
  stroke-width: 1.5;
}

.result-stars .icon.is-earned {
  color: #ad7629;
  fill: #ffdb6e;
  animation: star-arrive .5s var(--ease) both;
}

.result-stars .icon:nth-child(2) {
  margin-top: -8px;
  animation-delay: .1s;
}

.result-stars .icon:nth-child(3) {
  animation-delay: .2s;
}

.result-dialog>p {
  margin-bottom: 15px;
}

.result-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #9e3166;
  margin: 17px 0 22px;
}

.result-reward>.icon {
  width: 29px;
  height: 29px;
  fill: #f8c0d6;
}

.result-reward strong {
  font-family: Fredoka,sans-serif;
  font-size: 38px;
  font-weight: 550;
  line-height: 1;
}

.result-reward>span {
  font-size: 13px;
  font-weight: 950;
}

.result-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 19px 0 23px;
  gap: 0;
}

.result-stats>div {
  flex: 1;
  padding: 0 14px;
}

.result-stats>div+div {
  border-left: 1px solid #e5dce8;
}

.result-stats dt {
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 3px;
}

.result-stats dd {
  font-family: Fredoka,sans-serif;
  font-size: 25px;
  font-weight: 550;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.result-dialog>.button {
  width: 100%;
  min-height: 66px;
  font-size: 24px;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.result-actions>.button {
  flex: 1;
  font-size: 13px;
  min-height: 51px;
  padding: 10px;
  gap: 7px;
}

.result-actions .icon {
  width: 20px;
  height: 20px;
}

.result-dialog.is-lost .result-stars .icon {
  width: 36px;
  height: 36px;
}

.is-activating {
  animation: power-press .3s var(--ease);
}

@keyframes button-light {
  0%,76%,100% {
    left: -35%;
  }
  88% {
    left: 120%;
  }
}

@keyframes heart-arrival {
  0%,100% {
    transform: scale(1) rotate(-5deg);
  }
  50% {
    transform: scale(1.06) rotate(3deg);
  }
}

@keyframes orbit-dot {
  0%,100% {
    transform: translateY(0);
    opacity: .5;
  }
  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

@keyframes dialog-arrive {
  from {
    opacity: .4;
    transform: translateY(14px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes star-arrive {
  from {
    transform: translateY(16px) scale(.45) rotate(-15deg);
  }
  to {
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes power-press {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(.95);
  }
  100% {
    transform: scale(1);
  }
}

@media(min-width:1500px) {
  .home-dock {
    bottom: 42px;
    width: min(1120px,calc(100% - 100px));
    grid-template-columns: 1fr 280px 1fr;
    gap: 40px;
  }
  .next-adventure>strong {
    font-size: 26px;
  }
  .home-tools button {
    min-height: 92px;
  }
  .button-play {
    min-height: 80px;
    font-size: 31px;
  }
}

@media(max-width:900px) {
  .home-dock {
    width: calc(100% - 42px);
    gap: 15px;
    grid-template-columns: minmax(120px,1fr) 190px minmax(225px,1.3fr);
  }
  .next-adventure>strong {
    font-size: 19px;
  }
  .home-tools {
    gap: 6px;
  }
  .home-tools button {
    min-height: 82px;
    border-radius: 17px;
  }
  .home-tools small {
    font-size: 12px;
  }
  .button-play {
    font-size: 25px;
    min-height: 70px;
  }
  .home-bar {
    left: 22px;
    right: 22px;
  }
}

@media(max-width:650px) {
  .home-bar {
    top: max(17px,env(safe-area-inset-top));
    left: 17px;
    right: 17px;
    gap: 10px;
  }
  .wordmark {
    font-size: 35px;
  }
  .wordmark span {
    font-size: 12px;
    margin-top: 6px;
  }
  .bar-actions {
    gap: 7px;
  }
  .heart-bank {
    padding: 0 12px;
    height: 46px;
    gap: 6px;
  }
  .heart-bank strong {
    font-size: 22px;
  }
  .heart-bank .icon {
    width: 19px;
    height: 19px;
  }
  .bar-actions .icon-button {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 15px;
    padding: 10px;
  }
  .home-dock {
    width: calc(100% - 34px);
    bottom: max(18px,env(safe-area-inset-bottom));
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
  }
  .next-adventure {
    gap: 4px;
    padding: 0 4px;
  }
  .next-adventure>span:first-child {
    font-size: 12px;
  }
  .next-adventure>strong {
    font-size: 18px;
    line-height: 1.1;
  }
  .next-adventure>span:last-child {
    font-size: 12px;
  }
  .home-dock>.button-play {
    min-height: 65px;
    font-size: 25px;
    border-radius: 21px;
  }
  .home-tools {
    grid-column: 1/3;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
  }
  .home-tools button {
    display: grid;
    grid-template-columns: 25px auto;
    grid-template-rows: 21px 14px;
    min-height: 61px;
    column-gap: 6px;
    row-gap: 0;
    padding: 10px 9px;
    border-radius: 17px;
    align-content: center;
  }
  .home-tools button>.icon {
    grid-row: 1/3;
    width: 24px;
    height: 24px;
  }
  .home-tools button>span {
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
  }
  .home-tools small {
    text-align: left;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .save-note {
    bottom: 180px;
    padding-left: 14px;
  }
  .save-note p {
    font-size: 12px;
  }
  .storage-warning {
    bottom: 174px;
    font-size: 12px;
  }
  .play-hud {
    top: max(14px,env(safe-area-inset-top));
    left: 13px;
    right: 13px;
    gap: 8px;
  }
  .play-hud>.icon-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 16px;
  }
  .route-readout {
    padding: 9px 12px 10px;
    min-width: 0;
    border-radius: 16px;
  }
  .route-readout>span {
    font-size: 12px;
  }
  .route-readout strong {
    font-size: 14px;
    line-height: 1.15;
    min-height: 16px;
    max-width: 35ch;
  }
  .route-progress {
    margin-top: 8px;
    height: 4px;
  }
  .parade-readout {
    min-width: 75px;
    grid-template-columns: 15px auto;
    grid-template-rows: 25px 13px;
    column-gap: 4px;
    padding: 7px 8px;
    border-radius: 16px;
  }
  .parade-readout>.icon {
    width: 17px;
    height: 17px;
  }
  .parade-readout>strong {
    font-size: 26px;
  }
  .parade-label {
    font-size: 12px;
  }
  .shield-readout {
    top: 66px;
    padding: 4px 9px;
    gap: 4px;
    font-size: 12px;
  }
  .shield-readout .icon {
    width: 15px;
    height: 15px;
  }
  .action-dock {
    left: 15px;
    right: 15px;
    bottom: max(17px,env(safe-area-inset-bottom));
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
  }
  .steering-hint {
    gap: 6px;
    padding-bottom: 7px;
  }
  .steering-hint>.icon {
    width: 25px;
    height: 25px;
  }
  .steering-hint p {
    font-size: 12px;
  }
  .steering-hint span {
    font-size: 12px;
    margin-top: 4px;
  }
  .cohesion-wrap {
    position: absolute;
    left: 0;
    bottom: 59px;
    width: 94px;
    text-align: left;
    font-size: 12px;
  }
  .cohesion-wrap meter {
    height: 6px;
  }
  .power-button {
    min-width: 0;
    width: 59%;
    max-width: 270px;
    min-height: 69px;
    padding: 10px 12px;
    gap: 8px;
    border-radius: 21px;
  }
  .power-button>.icon {
    width: 26px;
    height: 26px;
  }
  .power-copy strong {
    font-size: 18px;
  }
  .power-copy small {
    font-size: 12px;
  }
  .power-button kbd {
    display: none;
  }
  .event-banner {
    top: 24%;
    font-size: 23px;
    padding: 9px 18px;
  }
  .combo-banner {
    top: 114px;
    font-size: 18px;
  }
  .game-dialog {
    padding: 23px 20px 21px;
    max-height: calc(100dvh - 28px);
    border-radius: 24px;
  }
  .dialog-heading {
    gap: 10px;
    margin-bottom: 20px;
  }
  .dialog-heading h2 {
    font-size: 28px;
    margin-top: 1px;
  }
  .dialog-heading p {
    font-size: 12px;
  }
  .dialog-heading .icon-button {
    width: 46px;
    height: 46px;
    padding: 11px;
    min-width: 46px;
  }
  .world-levels {
    grid-template-columns: repeat(4,1fr);
    gap: 9px;
  }
  .level-button {
    min-height: 67px;
  }
  .map-world h3 {
    font-size: 20px;
  }
  .building {
    grid-template-columns: 39px 1fr;
    gap: 12px;
    padding: 20px 0;
  }
  .building-emblem {
    width: 39px;
    height: 48px;
    border-radius: 14px;
  }
  .building-emblem .icon {
    width: 23px;
    height: 23px;
  }
  .building h3 {
    font-size: 20px;
  }
  .building p {
    font-size: 12px;
  }
  .building .button {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
    min-width: 135px;
  }
  .build-steps {
    margin-top: 7px;
  }
  .build-balance {
    padding: 9px 12px;
  }
  .build-balance>span:last-child {
    font-size: 12px;
  }
  .support-choice {
    padding: 13px;
    grid-template-columns: 34px 1fr 22px;
    gap: 10px;
  }
  .support-choice>.icon {
    width: 28px;
    height: 28px;
  }
  .support-choice strong {
    font-size: 21px;
  }
  .support-choice small {
    font-size: 12px;
  }
  .support-choice b {
    font-size: 12px;
  }
  .support-choice input {
    width: 22px;
    height: 22px;
  }
  .result-dialog {
    padding: 25px 23px;
  }
  .result-dialog h2 {
    font-size: 33px;
  }
  .result-stars {
    margin-bottom: 20px;
  }
  .result-stars .icon {
    width: 45px;
    height: 45px;
  }
  .result-actions>.button {
    font-size: 12px;
  }
  .pause-dialog {
    padding: 28px 24px;
  }
  .pause-dialog h2 {
    font-size: 33px;
  }
}

@media(max-height:620px) and (min-width:651px) {
  .home-bar {
    top: 15px;
    left: 21px;
    right: 21px;
  }
  .wordmark {
    font-size: 32px;
  }
  .wordmark span {
    font-size: 12px;
    margin-top: 5px;
  }
  .home-dock {
    bottom: 17px;
    gap: 20px;
    grid-template-columns: 1fr 190px 1.3fr;
    max-width: 850px;
  }
  .home-tools button {
    min-height: 67px;
    display: grid;
    grid-template-columns: 23px auto;
    grid-template-rows: 20px 12px;
    gap: 0 5px;
    padding: 10px 8px;
  }
  .home-tools button>.icon {
    grid-row: 1/3;
    width: 23px;
  }
  .home-tools button>span,.home-tools small {
    text-align: left;
  }
  .next-adventure>strong {
    font-size: 17px;
  }
  .next-adventure>span:first-child {
    font-size: 12px;
  }
  .next-adventure>span:last-child {
    font-size: 12px;
  }
  .home-dock>.button-play {
    min-height: 60px;
    font-size: 24px;
  }
  .save-note {
    bottom: 100px;
  }
  .storage-warning {
    bottom: 100px;
  }
  .play-hud {
    top: 12px;
    left: 15px;
    right: 15px;
  }
  .route-readout {
    max-width: 340px;
    padding: 7px 13px 9px;
  }
  .route-readout strong {
    font-size: 15px;
  }
  .route-readout>span {
    font-size: 12px;
  }
  .action-dock {
    bottom: 14px;
    left: 18px;
    right: 18px;
  }
  .power-button {
    min-height: 62px;
    min-width: 220px;
    padding: 8px 13px;
  }
  .power-copy strong {
    font-size: 18px;
  }
  .combo-banner {
    top: 105px;
  }
  .event-banner {
    top: 30%;
    font-size: 24px;
  }
  .game-dialog {
    max-height: calc(100dvh - 24px);
  }
}

@media(max-height:590px) and (max-width:650px) {
  .home-dock {
    bottom: 12px;
    gap: 9px;
  }
  .home-dock>.button-play {
    min-height: 54px;
    font-size: 23px;
  }
  .home-tools button {
    min-height: 54px;
    padding: 7px 9px;
  }
  .home-bar {
    top: 12px;
  }
  .home-bar .wordmark {
    font-size: 30px;
  }
  .wordmark span {
    display: none;
  }
  .bar-actions {
    gap: 5px;
  }
  .heart-bank {
    padding: 0 10px;
  }
  .save-note {
    bottom: 152px;
  }
  .storage-warning {
    bottom: 152px;
  }
  .event-banner {
    top: 30%;
  }
  .power-button {
    min-height: 61px;
  }
  .action-dock {
    bottom: 13px;
  }
  .cohesion-wrap {
    bottom: 55px;
  }
  .result-stars {
    margin-bottom: 15px;
  }
  .result-stars .icon {
    width: 35px;
    height: 35px;
  }
  .result-dialog h2 {
    font-size: 28px;
  }
  .result-dialog>p {
    font-size: 12px;
    margin: 10px 0;
  }
  .result-stats {
    margin: 13px 0 17px;
  }
  .result-reward {
    margin: 13px 0;
  }
  .result-dialog>.button {
    min-height: 57px;
    font-size: 23px;
  }
  .result-actions {
    margin-top: 15px;
  }
}

.game.is-soft-motion *,body.is-soft-motion .game-dialog,body.is-soft-motion .game-dialog * {
  animation: none!important;
  scroll-behavior: auto!important;
  transition-duration: .01ms!important;
}

.mode-note {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
  color: var(--muted);
  margin: -11px 0 19px;
}

@media(max-width:650px) {
  .bar-actions .icon-button,.dialog-heading .icon-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }
  .home-tools button {
    min-height: 65px;
  }
}

@media(max-width:420px) {
  .home-tools button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 74px;
    padding: 7px 4px;
  }
  .home-tools button>span,.home-tools small {
    text-align: center;
  }
  .home-tools button>.icon {
    width: 22px;
    height: 22px;
    margin-bottom: 1px;
  }
  .home-tools small {
    font-size: 12px;
  }
  .home-tools button>span {
    font-size: 12px;
  }
  .save-note,.storage-warning {
    bottom: 192px;
  }
}

@media(max-width:370px) {
  .wordmark {
    font-size: 30px;
  }
  .wordmark span {
    display: none;
  }
  .bar-actions {
    gap: 6px;
  }
  .heart-bank {
    padding: 0 9px;
    gap: 5px;
  }
  .heart-bank strong {
    font-size: 20px;
  }
  .next-adventure>strong {
    font-size: 16px;
  }
  .home-dock>.button-play {
    font-size: 23px;
    gap: 9px;
  }
  .result-actions {
    flex-direction: column;
  }
  .result-actions>.button {
    flex: auto;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation: none!important;
    transition-duration: .01ms!important;
    scroll-behavior: auto!important;
  }
}

/* Event text stays off the driving line. Gates carry their own live values. */

.game .event-banner {
  top: 105px;
  left: max(24px, env(safe-area-inset-left));
  max-width: min(270px, calc(100% - 48px));
  transform: translateY(-5px);
  padding: 9px 13px;
  border: 1px solid #6e668c;
  border-radius: 12px;
  background: #2d2948;
  color: #fff6e6;
  font: 800 15px/1.35 Nunito, sans-serif;
  text-align: left;
}

.game .event-banner.is-visible {
  transform: translateY(0);
}

.game .combo-banner {
  top: 133px;
  right: 24px;
  left: auto;
  transform: none;
}

.gate-steer, .waiting-for-gate .normal-steer {
  display: none;
}

.waiting-for-gate .gate-steer {
  display: inline;
}

.parade-readout > span:first-child {
  display: grid;
  place-items: center;
}

.parade-readout > span:first-child .icon {
  width: 20px;
  height: 20px;
}

@media (max-width: 650px) {
  .game .event-banner {
    top: 88px;
    left: 13px;
    max-width: calc(100% - 26px);
    font-size: 13px;
  }
  .game .combo-banner {
    top: 137px;
    right: 14px;
    font-size: 15px;
  }
  .parade-readout > span:first-child .icon {
    width: 15px;
    height: 15px;
  }
}

.game {
  --arcade-panel: #211b35;
  --arcade-rim: #75618d;
  --arcade-light: #ffdc89;
  --arcade-wind: #ffc5a9;
  --arcade-open: #a8f4ec;
  --arcade-inset: max(24px, env(safe-area-inset-left));
  --boss-top: max(106px, calc(env(safe-area-inset-top) + 88px));
}

.game[data-world="2"] { --arcade-light: #ffbb9f; }
.game[data-world="3"] { --arcade-light: #e0d0ff; }

.wordmark sup {
  display: inline-block;
  vertical-align: top;
  margin-top: .12em;
  padding: 4px 6px;
  border: 1px solid #ffe7a6;
  border-radius: 6px;
  background: var(--arcade-panel);
  color: #ffe5a3;
  font: 950 11px/1 Nunito, sans-serif;
  letter-spacing: .04em;
  text-shadow: none;
}

.route-readout {
  background: linear-gradient(180deg, #302543, var(--arcade-panel));
  border: 1px solid var(--arcade-rim);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 6px 20px rgba(15,9,31,.24);
}

.route-readout > span,
.route-progress > span:last-child { color: var(--arcade-light); }

.route-progress > span:first-child {
  background: linear-gradient(90deg, #91e9d7, var(--arcade-light));
}

.parade-readout {
  background: linear-gradient(155deg, #fffdf3, #fff1cc);
  border-color: #ffd786;
  box-shadow: inset 0 1px 0 #fff, 0 7px 24px rgba(36,23,20,.28);
}

.wave-readout {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 9px;
  color: #fff6e6;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
}

.wave-readout > b {
  flex: 0 0 auto;
  border-radius: 5px;
  background: var(--arcade-light);
  color: #2d2141;
  padding: 3px 5px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.wave-readout > span:not(.sr-only) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-goal {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: #ffe4a7;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.route-goal .icon { width: 14px; height: 14px; }
.route-goal.is-met { color: #b2f4df; }
#next-button-label { white-space: normal; }

.game .event-banner {
  top: calc(var(--boss-top) + 27px);
  border-color: var(--arcade-rim);
  background: var(--arcade-panel);
}

.game .event-banner[data-tone="reward"] {
  border-color: #d8a956;
  color: #ffdf8c;
}

.game.is-boss-active .event-banner { top: calc(var(--boss-top) + 107px); }

.boss-readout {
  position: absolute;
  top: var(--boss-top);
  left: var(--arcade-inset);
  width: min(326px, calc(100vw - 112px));
  padding: 10px 13px;
  background: var(--arcade-panel);
  color: #fff6e6;
  border: 1px solid var(--arcade-rim);
  border-radius: 14px;
  box-shadow: 0 7px 24px rgba(15,9,31,.27);
}

.boss-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.boss-name-row > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 550 19px/1.15 Fredoka, sans-serif;
}

.boss-phase {
  flex: 0 0 auto;
  color: var(--arcade-light);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.boss-meter {
  height: 8px;
  margin-top: 8px;
  background: #504265;
  border-radius: 4px;
  overflow: hidden;
}

.boss-meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #e985aa, #ffd49b);
  transform-origin: left center;
  transition: transform .14s ease-out;
}

.boss-status {
  margin: 7px 0 0;
  color: #f5e7ff;
  font: 800 13px/1.3 Nunito, sans-serif;
}

.boss-readout[data-state="windup"] { border-color: #f5a675; }
.boss-readout[data-state="windup"] .boss-status { color: var(--arcade-wind); }
.boss-readout[data-state="open"] { border-color: #74cbb7; }
.boss-readout[data-state="open"] .boss-status { color: var(--arcade-open); }

.boss-intro {
  position: absolute;
  left: 50%;
  top: 27%;
  width: min(510px, calc(100% - 44px));
  transform: translateX(-50%);
  padding: 10px 12px 12px;
  display: grid;
  justify-items: center;
  background: linear-gradient(90deg, transparent, rgba(33,27,53,.96) 15% 85%, transparent);
  color: #fff6e6;
  text-align: center;
  animation: boss-marquee .48s var(--ease) both;
}

.boss-intro small {
  margin-top: 8px;
  color: var(--arcade-light);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.boss-intro strong {
  margin: 2px 0 9px;
  font: 600 clamp(24px, 4.5vw, 48px)/1.05 Fredoka, sans-serif;
  text-wrap: balance;
}

.boss-intro-rule {
  width: 93%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--arcade-light) 50%, transparent);
}

@keyframes boss-marquee {
  from { opacity: 0; transform: translate(-50%, -9px) scale(.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.result-dialog:not(.is-lost) {
  border: 2px solid #f5d286;
  background: linear-gradient(180deg, #fff4d5, #fffdf8 41%);
}

.result-dialog > :not(.result-lights) { position: relative; }

.result-lights {
  position: absolute;
  inset: 0 0 auto;
  height: 145px;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 27%, #ffdc8060, transparent 63%);
}

.is-lost .result-lights { display: none; }

.result-lights i {
  --light-x: 20%;
  position: absolute;
  left: var(--light-x);
  top: 52px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #e7a449;
  opacity: .65;
  transform: rotate(45deg);
  animation: result-twinkle .82s var(--ease) both;
}

.result-lights i:nth-child(2) { --light-x: 29%; top: 20px; width: 6px; height: 6px; animation-delay: .12s; }
.result-lights i:nth-child(3) { --light-x: 51%; top: 13px; width: 5px; height: 5px; animation-delay: .08s; }
.result-lights i:nth-child(4) { --light-x: 71%; top: 27px; width: 7px; height: 7px; animation-delay: .2s; }
.result-lights i:nth-child(5) { --light-x: 81%; top: 58px; animation-delay: .18s; }

@keyframes result-twinkle {
  0% { opacity: 0; transform: translateY(12px) rotate(45deg) scale(.5); }
  55% { opacity: 1; transform: translateY(-4px) rotate(135deg) scale(1.15); }
  100% { opacity: .65; transform: rotate(135deg) scale(1); }
}

@media (max-width: 650px) {
  .game {
    --arcade-inset: max(13px, env(safe-area-inset-left));
    --boss-top: max(91px, calc(env(safe-area-inset-top) + 76px));
  }
  .wave-readout { margin-top: 7px; }
  .wave-readout > b { padding-inline: 4px; }
  .boss-readout { width: min(265px, calc(100vw - 108px)); padding: 8px 10px; }
  .boss-name-row > strong { font-size: 17px; }
  .boss-status { font-size: 12px; }
  .game .event-banner { top: calc(var(--boss-top) + 26px); max-width: min(230px, calc(100% - 146px)); }
  .game.is-boss-active .event-banner { top: calc(var(--boss-top) + 94px); }
}

@media (max-height: 480px) {
  .boss-intro { top: 33%; }
  .boss-readout { padding-block: 6px; }
}

/* The shared room owns its lobby and player bar. Only the game's own controls live here. */
.home-dock > .online-controls {
  grid-column: 1 / -1;
  justify-self: center;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.button-online {
  color: #452646;
  background: #ffe3ee;
  border-color: #fff7fb;
  box-shadow: 0 5px 16px rgba(22, 19, 25, .35);
  min-height: 54px;
}

.online-controls select,
.online-level-setting select {
  min-height: 48px;
  max-width: 100%;
  border: 2px solid #ead8eb;
  border-radius: 16px;
  background: #fff6fb;
  color: #452646;
  font: 850 14px/1.2 Nunito,sans-serif;
  padding: 8px 10px;
}

.online-level-setting {
  display: grid;
  gap: 6px;
  margin-block: 10px;
  color: var(--ink);
  font-weight: 850;
}

.game:has(.online-controls:not([hidden])) .save-note,
.game:has(.online-controls:not([hidden])) .storage-warning {
  translate: 0 -70px;
}

.game[data-room] {
  --room-bar-space: 76px;
}

.game[data-room] .play-hud,
.game[data-room] .boss-readout,
.game[data-room] .event-banner,
.game[data-room] .combo-banner {
  translate: 0 var(--room-bar-space);
}

.room-status {
  position: absolute;
  inset: auto auto max(114px, calc(env(safe-area-inset-bottom) + 108px)) 50%;
  translate: -50% 0;
  margin: 0;
  padding: 10px 16px;
  max-width: calc(100% - 24px);
  border: 1px solid #e6bad6;
  border-radius: 16px;
  background: #2b213c;
  color: #fff5f9;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

@media(max-width:650px) {
  .home-dock > .online-controls {
    width: 100%;
  }
  .online-controls .button-online {
    flex: 1;
    gap: 8px;
    padding-inline: 10px;
  }
  .online-controls select { width: min(39%, 152px); }
  .game:has(.online-controls:not([hidden])) .save-note,
  .game:has(.online-controls:not([hidden])) .storage-warning {
    translate: 0 -66px;
  }
}

@media(max-height:540px) and (min-width:651px) {
  .game[data-room] { --room-bar-space: 62px; }
  .button-online { min-height: 46px; padding-block: 9px; }
}

/* The stage stays visible while the player pauses to look or rest. */
.edition-v7 .wave-remaining {
  flex: 0 0 auto;
  margin-left: auto;
  color: #fff2d9;
  font-variant-numeric: tabular-nums;
}

.edition-v7 .pause-dialog {
  inset: auto auto max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  width: min(300px, calc(100% - 48px));
  margin: 0;
  padding: 18px;
  border: 1px solid #f0cd8a;
  border-radius: 22px;
  text-align: left;
  background: #fff8e9;
}

.edition-v7 .pause-dialog::backdrop {
  background: linear-gradient(23deg, rgba(24,17,39,.42), transparent 46%);
}

.edition-v7 .pause-dialog .dialog-emblem {
  float: left;
  width: 38px;
  height: 38px;
  margin: 0 10px 0 0;
  border-radius: 12px;
}

.edition-v7 .pause-dialog .dialog-emblem .icon { width: 20px; height: 20px; }
.edition-v7 .pause-dialog h2 { padding-top: 1px; font-size: 23px; text-wrap: pretty; }
.edition-v7 .pause-dialog p { margin: 2px 0 14px; font-size: 12px; }
.edition-v7 .pause-dialog > .button { min-height: 49px; font-size: 20px; }
.edition-v7 .pause-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; }
.edition-v7 .pause-actions > .button { min-height: 44px; padding-inline: 5px; font-size: 12px; }
.edition-v7 #pause-home { grid-column: 1 / -1; }

@media (max-width: 650px) {
  .edition-v7 .pause-dialog {
    inset: auto 0 max(12px, env(safe-area-inset-bottom)) 0;
    width: min(330px, calc(100% - 26px));
    margin: 0 auto;
  }
  .edition-v7 .pause-dialog::backdrop {
    background: linear-gradient(0deg, rgba(24,17,39,.37), transparent 44%);
  }
}

.boost-readout {
  position: absolute;
  inset: auto 0 calc(100% + 10px) auto;
  min-width: 176px;
  max-width: 52vw;
  display: grid;
  grid-template-columns: 19px 1fr auto;
  align-items: center;
  gap: 4px 7px;
  padding: 8px 11px 9px;
  border: 1px solid #d2abe4;
  border-radius: 13px;
  background: #382849;
  color: #fff5e7;
  font: 800 12px/1.15 Nunito, sans-serif;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.boost-readout[data-kind="surge"] { border-color: #ebc877; }
.boost-readout .icon { width: 17px; height: 17px; color: #f2bdff; }
.boost-readout[data-kind="surge"] .icon { color: #ffda83; }
.boost-meter { grid-column: 1 / -1; height: 3px; border-radius: 2px; overflow: hidden; background: #695476; }
.boost-meter > span { display: block; height: 100%; background: #ebbbff; transform-origin: left; }
.boost-readout[data-kind="surge"] .boost-meter > span { background: #ffda83; }

/* ---------- 2.0: vännens knapp. Porträttet ur spelmodulerna, brickan visar hur många gånger talangen räcker ---------- */
.friend-button { pointer-events: auto; position: relative; display: flex; align-items: center; gap: 10px; min-height: 76px; min-width: 190px; border: 2px solid #ffc3d4; border-radius: 23px; padding: 8px 14px 8px 8px; background: #fff7f3; color: #5a2f45; box-shadow: 0 6px 18px rgba(19,14,35,.23); text-align: left; transition: transform .18s var(--ease), box-shadow .2s, filter .2s; }
.friend-button[hidden] { display: none; }
.friend-button img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: #ffe6ee; box-shadow: 0 0 0 3px #ff9db8; }
.friend-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.friend-copy strong { font-family: Fredoka, sans-serif; font-size: 19px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-copy small { font-size: 12px; font-weight: 900; color: #a25674; }
.friend-charges { position: absolute; top: -8px; left: 46px; min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 13px; background: #e2587f; color: #fff; font: 900 14px/1 Fredoka, sans-serif; box-shadow: 0 2px 6px rgba(90,47,69,.3); }
.friend-button.is-ready { box-shadow: 0 0 0 3px #ff9db8, 0 12px 22px rgba(0,0,0,.2); }
.friend-button.is-ready:hover, .friend-button.is-ready:focus-visible { transform: translateY(-2px); }
.friend-button:disabled { filter: saturate(.55); opacity: .82; }
.friend-button:disabled .friend-charges { background: #b79aa6; }
.friend-button kbd { margin-left: auto; }
.friend-button.is-activating { animation: friend-pop .5s var(--ease); }
@keyframes friend-pop { 0% { transform: scale(1); } 40% { transform: scale(1.09) rotate(-2deg); } 100% { transform: scale(1); } }
@media (max-width: 760px) {
  .friend-button { min-width: 0; min-height: 64px; padding: 6px; border-radius: 50%; }
  .friend-button img { width: 52px; height: 52px; }
  .friend-button .friend-copy, .friend-button kbd { display: none; }
  .friend-charges { left: auto; right: -4px; }
}
@media (prefers-reduced-motion: reduce) { .friend-button, .friend-button.is-activating { transition: none; animation: none; } }

/* ---------- 2.0: berättelsens sida. Bilderbokens bild, den rosa tråden under och texten i läsbar storlek ---------- */
.story-dialog { width: min(94vw, 600px); padding: 20px 20px 18px; text-align: center; }
.story-over { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #c0607a; }
.story-dialog h2 { margin: 2px 0 10px; }
.story-picture { position: relative; margin: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 24px rgba(19,14,35,.22); background: #f6e7dc; }
.story-picture img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.story-text { position: relative; margin: 0; padding: 22px 4px 12px; font-size: 18px; line-height: 1.5; text-align: start; text-wrap: pretty; }
.story-text::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 12px; background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 12' preserveAspectRatio='none'%3E%3Cpath d='M2 6 C 40 -2, 70 14, 110 6 S 180 -2, 220 6 S 300 14, 340 6 S 380 2, 398 6' fill='none' stroke='%23e99392' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.story-next { margin: 0 0 12px; font-size: 13.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #c0607a; }
.story-next[hidden] { display: none; }
@media (max-width: 520px) { .story-dialog { padding: 16px 14px 14px; } .story-text { font-size: 16.5px; padding-top: 20px; } }

/* ---------- 2.0: Mästare, hemliga banor och två vid samma skärm ---------- */
.mode-options label.is-locked { cursor: not-allowed; background: #f6f1f8; border-style: dashed; }
.mode-options label.is-locked strong, .mode-options label.is-locked small:not(.mode-lock) { opacity: .55; }
.mode-options .mode-lock { color: #8a3f73; font-weight: 900; }
.level-button .master-mark { position: absolute; top: 3px; left: 4px; width: 14px; height: 14px; color: #b9801c; fill: #ffd766; }
.level-button.is-mastered { border-color: #d9a93a; }
.map-legend { margin-top: 18px; padding-top: 14px; border-top: 2px dashed #e3c7ec; }
.legend-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.legend-button { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; min-height: 86px; padding: 12px 14px; text-align: start; border-radius: 17px; border: 2px solid #d9a9d6; background: linear-gradient(160deg, #fff1fa, #f3e4ff); color: #5b2f6f; transition: transform .18s var(--ease), background .18s; }
.legend-button:hover:not(:disabled) { transform: translateY(-3px); background: linear-gradient(160deg, #ffe6f6, #ead6ff); }
.legend-button:disabled { cursor: not-allowed; background: #f4eef7; border-style: dashed; color: #8c7a98; }
.legend-button .twist-marks { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; height: 20px; }
.legend-button .twist-mark { width: 18px; height: 18px; flex: 0 0 auto; }
.legend-button strong { grid-column: 1 / -1; font-family: Fredoka, sans-serif; font-size: 18px; font-weight: 550; line-height: 1.15; }
.legend-button small { grid-column: 1 / -1; font-size: 12px; font-weight: 800; line-height: 1.3; color: inherit; opacity: .8; }
.legend-button .level-stars { grid-column: 1 / -1; margin-top: 4px; }
.legend-button.is-complete { border-color: #d9a93a; }
.legend-teaser { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 2px dashed #e3c7ec; border-radius: 17px; color: #6d4a80; font-size: 14px; font-weight: 800; line-height: 1.35; }
.legend-teaser .icon { width: 20px; height: 20px; flex: 0 0 auto; }
.twist-chip { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.twist-chip span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; background: rgba(53, 22, 74, .72); color: #ffe9a8; font-size: 11.500px; font-weight: 900; letter-spacing: .01em; }
.twist-chip .icon { width: 13px; height: 13px; }
.duo-zones { position: absolute; inset: 0; pointer-events: none; display: grid; grid-template-rows: 46fr 54fr; z-index: 3; animation: duo-zones 6.500s ease-out forwards; }
.duo-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; text-shadow: 0 2px 10px rgba(40, 10, 60, .7); font-family: Fredoka, sans-serif; }
.duo-zone b { font-size: clamp(20px, 5vw, 30px); font-weight: 600; }
.duo-zone small { font-size: 14px; font-weight: 800; opacity: .95; }
.duo-zone img { width: 44px; height: 44px; border-radius: 50%; background: #fff3fa; border: 2px solid #ff9ccf; object-fit: cover; }
.duo-friend { background: linear-gradient(180deg, rgba(255, 110, 180, .34), rgba(255, 110, 180, .06)); border-bottom: 2px dashed rgba(255, 255, 255, .7); }
.duo-parade { background: linear-gradient(0deg, rgba(60, 200, 210, .30), rgba(60, 200, 210, .04)); }
@keyframes duo-zones { 0%, 72% { opacity: 1; } 100% { opacity: 0; } }
@media (hover: hover) and (pointer: fine) { .duo-zone small { display: none; } }
@media (max-width: 640px) { .legend-levels { grid-template-columns: 1fr; } .legend-button { min-height: 74px; } }
@media (prefers-reduced-motion: reduce) { .duo-zones { animation-duration: 6.500s; animation-timing-function: steps(1, end); } }
.twist-chip span[data-twist=wind]::after { content: ''; font-weight: 950; }
.twist-chip[data-gust="1"] span[data-twist=wind], .twist-chip[data-gust="-1"] span[data-twist=wind] { background: #fff3c4; color: #4a2a63; }
.twist-chip[data-gust="1"] span[data-twist=wind]::after { content: '\2192'; }
.twist-chip[data-gust="-1"] span[data-twist=wind]::after { content: '\2190'; }
/* Panelen växer med målet, vågen och regelbrickan: beskedet och bossens ruta ligger alltid under den. */
.game .boss-readout { top: max(var(--boss-top), var(--hud-bottom, 0px)); }
.game .event-banner { top: max(calc(var(--boss-top) + 27px), var(--hud-bottom, 0px)); }
.game.is-boss-active .event-banner { top: calc(max(var(--boss-top), var(--hud-bottom, 0px)) + 107px); }
@media (max-width: 650px) {
  .game .event-banner { top: max(calc(var(--boss-top) + 26px), var(--hud-bottom, 0px)); }
  .game.is-boss-active .event-banner { top: calc(max(var(--boss-top), var(--hud-bottom, 0px)) + 94px); }
}
/* 2.0: Amors spinn på startsidan */
.title-character.is-patted img { animation: amor-pat .32s ease-out; }
@keyframes amor-pat { 40% { transform: scale(1.06, .95); } 100% { transform: none; } }
.spinn-bubble { position: fixed; z-index: 6; transform: translate(-50%, -100%); pointer-events: none; width: max-content; max-width: min(320px, calc(100vw - 32px)); animation: spinn-in 4.200s ease-out forwards; }
.spinn-bubble p { margin: 0; padding: 10px 16px; border-radius: 18px; background: #fff9ec; border: 2px solid #ffb3d1; color: #5a2f6e; font: 800 15px/1.35 Nunito, sans-serif; text-align: center; box-shadow: 0 10px 26px rgba(40, 14, 60, .28); }
.spinn-heart { position: absolute; left: calc(50% + (var(--i) - 2) * 26px); top: -6px; width: 22px; height: 22px; color: #ff6fa8; animation: spinn-heart 1.800s calc(var(--i) * .14s) ease-out both; }
.spinn-heart .icon { width: 100%; height: 100%; fill: currentColor; }
@keyframes spinn-in { 0% { opacity: 0; transform: translate(-50%, -92%); } 6%, 88% { opacity: 1; transform: translate(-50%, -100%); } 100% { opacity: 0; transform: translate(-50%, -104%); } }
@keyframes spinn-heart { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-58px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .title-character.is-patted img { animation: none; } .spinn-heart { animation: none; opacity: 1; top: -26px; } .spinn-bubble { animation-timing-function: steps(1, end); } }
.game .event-banner[data-tone="secret"] { border-color: #ffd98a; color: #fff3c4; background: linear-gradient(135deg, #4a2468, #7a2f6b); box-shadow: 0 0 0 2px rgba(255, 217, 138, .35), 0 10px 26px rgba(30, 10, 50, .4); }

/* 2.0, standarden 2026-11-11: trappan i inställningarna och på resultatet */
.mode-options .trappa-andra-rad { margin: 8px 0 8px 48px; }
.mode-options .trappa-andra-rad .button { min-height: 44px; }
.mode-options .trappa-andra-rad + label { margin-top: 0; }
.result-steg { width: fit-content; max-width: 100%; margin: 6px auto 0; padding: 7px 16px; border-radius: 999px; background: linear-gradient(180deg, #fffaf0, #fbedd2); box-shadow: 0 0 0 2px #e8c98a; font-weight: 850; font-size: 15px; line-height: 1.35; color: #7a5520; text-align: center; }
.result-steg span { white-space: nowrap; }
.result-steg b { color: #8a3f73; }

/* 2.0, standarden avsnitt 7: Amor räcker upp tassen i resultatrutan, och knappen Nästa äventyr har banans namn under. */
.result-amor { position: absolute !important; left: 18px; top: 8px; width: auto; height: 88px; pointer-events: none; transform-origin: 50% 100%; filter: drop-shadow(0 6px 8px rgba(120, 78, 20, .22)); }
.result-dialog[open] .result-amor:not([hidden]) { animation: result-amor-in .62s cubic-bezier(.2, 1.35, .4, 1) .18s both; }
@keyframes result-amor-in { from { opacity: 0; transform: translateY(26px) scale(.7) rotate(-9deg); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
[dir="rtl"] .result-amor { left: auto; right: 16px; transform: scaleX(-1); }
[dir="rtl"] .result-dialog[open] .result-amor:not([hidden]) { animation-name: result-amor-in-rtl; }
@keyframes result-amor-in-rtl { from { opacity: 0; transform: translateY(26px) scale(-.7, .7) rotate(9deg); } 60% { opacity: 1; } to { opacity: 1; transform: scaleX(-1); } }
.next-labels { display: grid; justify-items: center; gap: 1px; min-width: 0; }
#next-button-sub { font: 800 13px/1.25 Nunito, system-ui, sans-serif; letter-spacing: 0; opacity: .78; white-space: normal; text-wrap: balance; }
#next-button-sub[hidden] { display: none; }
@media (max-width: 520px) { .result-amor { height: 78px; left: 10px; top: 8px; } [dir="rtl"] .result-amor { right: 10px; } }
@media (prefers-reduced-motion: reduce) { .result-dialog[open] .result-amor:not([hidden]) { animation: none; } }
.reduced-motion .result-dialog[open] .result-amor:not([hidden]) { animation: none; }
