/* Ritmo Pop: a stage of colour. Each screen sets --c1 and --c2. */
:root {
  --c1: #6a3df0;
  --c2: #ff5fa8;
  --ink: #24164f;
  --font: "Baloo 2", ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  --emo: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --ok: #1fbf62;
  --bad: #ff4757;
  --gold: #ffc531;
  --pink: #ff3d7f;
  --st: max(10px, env(safe-area-inset-top));
  --sb: max(12px, env(safe-area-inset-bottom));
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(165deg, var(--c1), var(--c2));
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
button:focus {
  outline: none;
}
button:focus-visible,
.pad:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.emo {
  font-family: var(--emo);
  font-style: normal;
  line-height: 1;
}

/* ---------- Background: lights and floating notes ---------- */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%),
    radial-gradient(70% 40% at 50% 105%, rgba(20, 0, 60, 0.35), rgba(20, 0, 60, 0) 70%);
}
.bg .beam {
  position: absolute;
  top: -10%;
  width: 34vmax;
  height: 120%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
  animation: sweep 9s ease-in-out infinite alternate;
  mix-blend-mode: soft-light;
}
.bg .b1 {
  left: -8%;
}
.bg .b2 {
  left: 33%;
  animation-delay: -3s;
  animation-duration: 11s;
}
.bg .b3 {
  right: -8%;
  animation-delay: -6s;
}
@keyframes sweep {
  from {
    transform: rotate(-16deg);
  }
  to {
    transform: rotate(16deg);
  }
}
.bg .fl {
  position: absolute;
  bottom: -60px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 800;
  animation: rise linear infinite;
  will-change: transform;
}
@keyframes rise {
  0% {
    transform: translate(0, 0) rotate(-10deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  50% {
    transform: translate(26px, -55vh) rotate(12deg);
  }
  100% {
    transform: translate(-10px, -115vh) rotate(-8deg);
    opacity: 0;
  }
}

.app {
  position: fixed;
  inset: 0;
}
.scr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--st) max(14px, env(safe-area-inset-right)) var(--sb) max(14px, env(safe-area-inset-left));
  animation: scrIn 0.35s ease-out;
}
.scr > * {
  width: 100%;
  max-width: 620px;
}
@keyframes scrIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  flex: none;
}
.top .grow,
.top .screen-title {
  flex: 1;
}
.screen-title {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(30, 0, 70, 0.3);
}
.screen-title small {
  display: block;
  font-size: 14px;
  opacity: 0.9;
  margin-top: 3px;
  font-weight: 700;
}
.rbtn {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.25);
  transition: transform 0.1s;
}
.rbtn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(30, 0, 70, 0.25);
}
.rbtn svg {
  width: 26px;
  height: 26px;
}
.rbtn .cross {
  display: none;
}
.rbtn.off .waves {
  display: none;
}
.rbtn.off .cross {
  display: inline;
}
.rbtn.off {
  color: #a19bb8;
}

/* ---------- Tambi ---------- */
.tambi {
  display: block;
  overflow: visible;
}
.tambi .bd {
  transform-origin: 60px 124px;
}
.tambi .lids {
  transform-box: fill-box;
  transform-origin: 50% 0;
  transform: scaleY(0);
  animation: blink 4.2s infinite;
}
.tambi .joy,
.tambi .mouth-sad {
  display: none;
}
.tambi .note {
  transform-origin: 70px 30px;
  animation: wig 2s ease-in-out infinite;
}
.tambi .arm {
  transition: transform 0.08s;
}
.tambi .arm.l {
  transform-origin: 21px 62px;
}
.tambi .arm.r {
  transform-origin: 99px 62px;
}
.tambi.big .bd,
.tambi.mid .bd {
  animation: bob 2.4s ease-in-out infinite;
}
.tambi.play .arm.l {
  animation: hitL 0.16s ease-in-out infinite alternate;
}
.tambi.play .arm.r {
  animation: hitR 0.16s ease-in-out infinite alternate;
  animation-delay: 0.08s;
}
.tambi.happy .eyes,
.tambi.cheer .eyes {
  display: none;
}
.tambi.happy .joy,
.tambi.cheer .joy {
  display: block;
}
.tambi.happy .bd {
  animation: hop 0.45s ease-in-out 2;
}
.tambi.cheer .bd {
  animation: hop 0.6s ease-in-out infinite;
}
.tambi.cheer .arm.l {
  animation: hitL 0.3s ease-in-out infinite alternate;
}
.tambi.cheer .arm.r {
  animation: hitR 0.3s ease-in-out infinite alternate;
}
.tambi.sad .bd {
  transform: rotate(-5deg) translateY(3px);
}
.tambi.sad .lids {
  animation: none;
  transform: scaleY(0.45);
}
.tambi.sad .mouth {
  display: none;
}
.tambi.sad .mouth-sad {
  display: block;
}
.tambi.listen .bd {
  transform: rotate(7deg);
  transition: transform 0.3s;
}
.tambi.listen .pupils {
  transform: translate(3px, -2px);
}
@keyframes blink {
  0%,
  93%,
  100% {
    transform: scaleY(0);
  }
  96% {
    transform: scaleY(1);
  }
}
@keyframes bob {
  50% {
    transform: translateY(-6px) rotate(2deg);
  }
}
@keyframes hop {
  50% {
    transform: translateY(-12px) scale(1.03, 0.97);
  }
}
@keyframes wig {
  50% {
    transform: rotate(14deg);
  }
}
@keyframes hitL {
  to {
    transform: rotate(-28deg);
  }
}
@keyframes hitR {
  to {
    transform: rotate(28deg);
  }
}

/* ---------- Home ---------- */
.home {
  justify-content: space-between;
}
.home .top {
  justify-content: flex-end;
}
.title {
  margin: 0;
  text-align: center;
  font-size: clamp(50px, 15vw, 92px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: 1px;
  flex: none;
}
.title .word {
  display: inline-block;
  white-space: nowrap;
}
.title .ch {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: 3px #2a1066;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #2a1066;
  animation: jump 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.11s);
}
@keyframes jump {
  0%,
  60%,
  100% {
    transform: translateY(0) rotate(0);
  }
  70% {
    transform: translateY(-12px) rotate(-5deg);
  }
  80% {
    transform: translateY(0) rotate(3deg);
  }
}
.tagline {
  margin: 6px 0 0;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: clamp(15px, 4.2vw, 19px);
  line-height: 1.2;
  text-shadow: 0 2px 0 rgba(30, 0, 70, 0.3);
  flex: none;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage .spot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(80vw, 420px);
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(50% 18% at 50% 92%, rgba(255, 255, 220, 0.55), rgba(255, 255, 220, 0) 100%),
    linear-gradient(180deg, rgba(255, 250, 200, 0) 0%, rgba(255, 250, 200, 0.22) 100%);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
}
.stage .floor {
  display: none;
  position: absolute;
  bottom: 4%;
  left: 18%;
  right: 18%;
  height: 14px;
  border-radius: 50%;
  background: rgba(40, 0, 80, 0.2);
}
.hero {
  position: relative;
  height: min(88%, 340px);
  aspect-ratio: 120 / 132;
  cursor: pointer;
  z-index: 1;
}
.hero .tambi {
  width: 100%;
  height: 100%;
}
.hello {
  position: absolute;
  right: -2%;
  top: -7%;
  max-width: 150px;
  background: #fff;
  border-radius: 18px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.15;
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.2);
  animation: floaty 3s ease-in-out infinite;
}
.hello::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: -8px;
  border: 8px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}
.hello.pop {
  animation: popIn 0.35s cubic-bezier(0.3, 1.6, 0.6, 1);
}
@keyframes floaty {
  50% {
    transform: translateY(-5px);
  }
}
.total {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  margin: 8px 0 4px;
  flex: none;
  text-shadow: 0 2px 0 rgba(30, 0, 70, 0.3);
}
.total svg {
  width: 24px;
  height: 24px;
}
.total b {
  font-size: 24px;
}
svg.st path {
  fill: rgba(255, 255, 255, 0.45);
  stroke: rgba(40, 0, 80, 0.25);
  stroke-width: 1.2;
}
svg.st.on path {
  fill: var(--gold);
  stroke: #c98a00;
}
.menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: none;
  max-width: 420px;
}
.bigbtn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 66px;
  border-radius: 34px;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #ffd23a, #ff8a1f);
  box-shadow: 0 6px 0 #c4520c, 0 12px 24px rgba(60, 0, 40, 0.3);
  text-shadow: 0 2px 0 rgba(150, 50, 0, 0.5);
  animation: breathe 2.2s ease-in-out infinite;
}
.bigbtn svg {
  width: 30px;
  height: 30px;
}
.bigbtn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #c4520c;
}
@keyframes breathe {
  50% {
    transform: scale(1.03);
  }
}
.menu .row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.midbtn {
  flex: 1;
  height: 54px;
  border-radius: 28px;
  background: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 5px 0 rgba(30, 0, 70, 0.25);
}
.midbtn.reto {
  background: linear-gradient(180deg, #fff, #ffe9f4);
  color: #c4135a;
}
.midbtn:active,
.smallbtn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(30, 0, 70, 0.25);
}
.smallbtn {
  height: 42px;
  padding: 0 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  gap: 6px;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

/* ---------- Map ---------- */
.worlds {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 0 4px;
  max-width: 560px;
}
.wcard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--w1), var(--w2));
  color: #fff;
  text-align: left;
  box-shadow: 0 6px 0 rgba(30, 0, 70, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  min-height: 0;
  overflow: hidden;
  animation: cardIn 0.5s cubic-bezier(0.3, 1.4, 0.6, 1) backwards;
  animation-delay: calc(var(--i) * 0.07s);
}
.wcard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}
.wcard:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(30, 0, 70, 0.3);
}
.wcard.locked {
  filter: saturate(0.35) brightness(0.92);
}
.wcard.shake,
.stone.shake {
  animation: shake 0.45s;
}
.isl {
  position: relative;
  flex: none;
  height: 100%;
  max-height: 120px;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #bdf3ff, #6fd6ff);
}
.isl .sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(180deg, #2fa8ff, #1b7fe0);
}
.isl .land {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 18%;
  height: 30%;
  border-radius: 50% 50% 40% 40%;
  background: radial-gradient(ellipse at 50% 20%, #ffe7a3, #f4c35e);
}
.isl .pic {
  position: absolute;
  inset: 6% 10% 22%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.isl .pic .inst {
  height: 100%;
  width: auto;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.2));
  animation: floaty 3s ease-in-out infinite;
}
.isl .pic .inst.second {
  position: absolute;
  height: 70%;
  right: -8%;
  bottom: 0;
  animation-delay: -1.5s;
}
.wt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.wt small {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.wt b {
  font-size: clamp(20px, 6vw, 30px);
  overflow-wrap: anywhere;
  text-shadow: 0 2px 0 rgba(30, 0, 70, 0.3);
}
.wt em {
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
  opacity: 0.95;
}
.ws,
.wlock {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border-radius: 16px;
  padding: 4px 9px;
  font-weight: 800;
  font-size: 15px;
}
.ws svg {
  width: 18px;
  height: 18px;
}
.wlock {
  flex-direction: column;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  padding: 6px 8px;
}
.wlock svg {
  width: 22px;
  height: 22px;
}

/* ---------- Levels path ---------- */
.intro-bubble {
  flex: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  padding: 8px 14px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.2);
  max-width: 460px;
}
.path {
  position: relative;
  flex: 1;
  min-height: 0;
  max-width: 460px;
  margin: 10px 0 6px;
}
.trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stone {
  position: absolute;
  width: 78px;
  height: 78px;
  margin: -39px 0 0 -39px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe9a8 60%, #ffc531);
  box-shadow: 0 6px 0 #c98a00, 0 10px 16px rgba(30, 0, 70, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: popIn 0.45s cubic-bezier(0.3, 1.6, 0.6, 1) backwards;
  animation-delay: calc(var(--i) * 0.07s);
}
.stone .num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: #8a3d00;
}
.stone .num svg {
  width: 26px;
  height: 26px;
}
.stone .sts {
  position: absolute;
  bottom: -9px;
  display: flex;
  gap: 1px;
}
.stone .sts svg {
  width: 20px;
  height: 20px;
}
.stone .lname {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: rgba(30, 0, 70, 0.35);
  padding: 1px 10px;
  border-radius: 10px;
}
.stone.boss {
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  background: radial-gradient(circle at 35% 30%, #fff, #ffc3e1 55%, #ff5fae);
  box-shadow: 0 6px 0 #c4135a, 0 10px 16px rgba(30, 0, 70, 0.3);
}
.stone.boss .num {
  color: #8a0c3c;
}
.stone.locked {
  background: radial-gradient(circle at 35% 30%, #f3f0fa, #c9c2dc);
  box-shadow: 0 6px 0 #8f86ab;
}
.stone.locked .num {
  color: #7d7499;
}
.stone.next::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 4px solid #fff;
  animation: ring 1.4s ease-out infinite;
}
.stone:active {
  transform: translateY(4px);
}
@keyframes ring {
  from {
    transform: scale(0.9);
    opacity: 1;
  }
  to {
    transform: scale(1.35);
    opacity: 0;
  }
}
.walker {
  position: absolute;
  width: 62px;
  margin: -46px 0 0 -31px;
  pointer-events: none;
  animation: hop 0.9s ease-in-out infinite;
}

/* ---------- Free play ---------- */
.free {
  justify-content: space-around;
}
.free-tambi {
  width: 90px;
  flex: none;
}
.free .pad {
  width: min(64vw, 260px);
}

/* ---------- Play screen ---------- */
.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 52px;
}
.ht {
  flex: 1;
  min-width: 0;
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 2px 0 rgba(30, 0, 70, 0.3);
}
.ht b {
  display: block;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ht span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hearts {
  display: flex;
  gap: 2px;
  font-size: 24px;
  flex: none;
}
.hearts i {
  font-style: normal;
  color: rgba(40, 0, 80, 0.3);
  transition: transform 0.3s;
}
.hearts i.on {
  color: #ff2e63;
  text-shadow: 0 2px 0 rgba(120, 0, 30, 0.35);
}
.clock {
  background: #fff;
  border-radius: 14px;
  padding: 2px 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--ink);
}
.prog {
  display: flex;
  gap: 5px;
  padding: 6px 0 2px;
  flex: none;
}
.prog i {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}
.prog i.now {
  background: #fff;
  animation: blinkbar 1s ease-in-out infinite alternate;
}
.prog i.ok {
  background: #7cf06b;
}
.prog i.bad {
  background: #ff6b81;
}
@keyframes blinkbar {
  to {
    opacity: 0.55;
  }
}
.talk {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin: 6px 0 4px;
}
.talk .tb {
  width: 60px;
  flex: none;
}
.bubble {
  position: relative;
  flex: 1;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 18px;
  padding: 6px 6px 6px 14px;
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.2);
}
.bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  margin-top: -9px;
  border: 9px solid transparent;
  border-right-color: #fff;
  border-left: 0;
}
.bubble.in {
  animation: popIn 0.3s cubic-bezier(0.3, 1.6, 0.6, 1);
}
.bubble .q {
  flex: 1;
  margin: 0;
  font-weight: 800;
  font-size: clamp(16px, 4.4vw, 20px);
  line-height: 1.15;
}
.bubble .say {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #efeaff;
  color: #6a3df0;
  display: grid;
  place-items: center;
}
.bubble .say svg {
  width: 22px;
  height: 22px;
}
.card {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vh, 18px);
  padding: 4px 0;
}
.card.in {
  animation: cardIn 0.35s ease-out;
}
.card.shake {
  animation: shake 0.45s;
}
@keyframes shake {
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}
@keyframes popIn {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
.ctrl {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  flex: none;
}
.pill {
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 26px;
  background: #fff;
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.25);
  color: #5a32d6;
}
.pill svg {
  width: 22px;
  height: 22px;
}
.pill.go {
  background: linear-gradient(180deg, #7cf06b, #1fbf62);
  color: #fff;
  box-shadow: 0 4px 0 #11853f;
  text-shadow: 0 1px 0 rgba(0, 80, 30, 0.5);
  font-size: 19px;
  padding: 0 24px 0 18px;
  animation: breathe 1.6s ease-in-out infinite;
}
.pill:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(30, 0, 70, 0.25);
}

/* ---------- Drum pad ---------- */
.pad {
  position: relative;
  width: min(80vw, 330px);
  max-height: 34vh;
  aspect-ratio: 220 / 150;
  flex: none;
  cursor: pointer;
  touch-action: none;
}
.pad svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.pad .skin {
  transform-origin: 110px 50px;
}
.pad.hit .skin {
  animation: skin 0.18s ease-out;
}
@keyframes skin {
  40% {
    transform: scale(0.94, 0.8);
    filter: brightness(1.15);
  }
}
.pad.hit svg {
  animation: thump 0.18s ease-out;
}
@keyframes thump {
  40% {
    transform: translateY(3px) scale(1.02, 0.98);
  }
}
.pad .ring {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 70%;
  height: 34%;
  transform: translate(-50%, -50%) scale(0.4);
  border-radius: 50%;
  border: 5px solid #fff;
  opacity: 0;
  pointer-events: none;
}
.pad.hit .ring {
  animation: ripple 0.45s ease-out;
}
@keyframes ripple {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.4);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.4);
  }
}
.pad .hint {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 18px;
  color: #b3874a;
  pointer-events: none;
}
.pad.lock {
  opacity: 0.8;
  cursor: default;
}
.pad.lock .hint {
  opacity: 0;
}

/* ---------- Rhythm cards ---------- */
.cards {
  position: relative;
  display: flex;
  width: min(100%, 470px);
  flex: none;
}
.fc {
  position: relative;
  flex: 1 1 0;
  margin: 0 3px;
  background: #fff;
  border-radius: 16px;
  border: 3px solid rgba(40, 0, 90, 0.12);
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px 4px;
  transition: transform 0.12s, background 0.12s;
}
.fc .fig {
  height: clamp(54px, 9vh, 76px);
  width: auto;
}
.fc .syl {
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  color: #6a3df0;
}
.fc.f-r .syl {
  color: #9b93b5;
}
.fc.f-h {
  background: linear-gradient(90deg, #fff 0%, #fff 40%, #fff7e0 100%);
}
.fc.now {
  transform: translateY(-5px);
  background: #fff6c8;
  border-color: #ffc531;
}
.dots {
  display: flex;
  gap: 8px;
  height: 16px;
  align-items: center;
  margin-top: 3px;
}
.dots i {
  position: relative;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e6e0f5;
}
.dots i.rest {
  width: 18px;
  height: 4px;
  border-radius: 2px;
}
.dots i.good {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(31, 191, 98, 0.3);
}
.dots i.ok {
  background: #ffb020;
}
.dots i.miss {
  background: var(--bad);
}
.dots i[data-l]::after {
  content: attr(data-l);
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  color: #b06b00;
  white-space: nowrap;
}
.ph {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: 0;
  width: 5px;
  margin-left: -2px;
  border-radius: 3px;
  background: var(--pink);
  box-shadow: 0 0 10px rgba(255, 61, 127, 0.8);
  transform: translateX(-40px);
  pointer-events: none;
}
.cards.mini .fc {
  padding: 3px 0;
  border-radius: 10px;
  border-width: 2px;
  box-shadow: none;
  margin: 0 2px;
}
.cards.mini .fc .fig {
  height: 40px;
}
.countin {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  font-size: 110px;
  font-weight: 800;
  color: #fff;
  -webkit-text-stroke: 4px #2a1066;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #2a1066;
  pointer-events: none;
  z-index: 5;
}
.countin.pop {
  animation: countPop calc(0.7s) ease-out forwards;
}
@keyframes countPop {
  0% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
  25% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
}
.beats {
  display: flex;
  gap: 6px;
  flex: none;
}
.beats i {
  font-style: normal;
  font-size: 30px;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.1s;
}
.beats i.beat {
  color: #fff;
  animation: beatPop 0.3s ease-out;
}
.beats i.good {
  color: #7cf06b;
}
.beats i.ok {
  color: #ffd23a;
}
.beats i.miss {
  color: rgba(80, 0, 40, 0.4);
}
@keyframes beatPop {
  40% {
    transform: scale(1.45);
  }
}
.reveal {
  min-height: 90px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.reveal.pop .ear {
  animation: popIn 0.35s cubic-bezier(0.3, 1.6, 0.6, 1);
}
.ear {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: rgba(30, 0, 70, 0.22);
  padding: 8px 22px;
  border-radius: 24px;
}
.rhopts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 420px);
}
.rhopt {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  padding: 8px 6px;
  border: 3px solid transparent;
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.2);
}
.rhopt .cards {
  width: 100%;
  pointer-events: none;
}
.rhopt.right {
  background: var(--ok);
  border-color: #fff;
}
.rhopt.wrong {
  background: var(--bad);
  animation: shake 0.4s;
}
.bigfig {
  background: #fff;
  border-radius: 24px;
  padding: 10px 30px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 6px 0 rgba(30, 0, 70, 0.22);
  flex: none;
}
.bigfig .fig {
  height: clamp(90px, 16vh, 140px);
  width: auto;
}
.bigfig .syl {
  font-weight: 800;
  font-size: 26px;
  color: #6a3df0;
  line-height: 1;
}

/* ---------- Options ---------- */
.opts {
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
  flex: none;
}
.opts.row2 {
  grid-template-columns: 1fr 1fr;
}
.opts.row3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.opt {
  min-height: 56px;
  border-radius: 18px;
  background: #fff;
  font-weight: 800;
  font-size: 20px;
  padding: 6px 12px;
  box-shadow: 0 5px 0 rgba(30, 0, 70, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.1;
}
.opt.big {
  flex-direction: column;
  font-size: 34px;
  min-height: 92px;
  gap: 0;
}
.opt.big b {
  font-size: 20px;
}
.opt.song .emo {
  font-size: 26px;
}
.opt:active,
.fam:active,
.iopt:active,
.snd:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(30, 0, 70, 0.25);
}
.opt.right,
.fam.right,
.iopt.right,
.snd.right {
  background: var(--ok);
  color: #fff;
  animation: right 0.5s;
}
.opt.wrong,
.fam.wrong,
.iopt.wrong,
.snd.wrong {
  background: var(--bad);
  color: #fff;
  animation: shake 0.4s;
}
@keyframes right {
  40% {
    transform: scale(1.07);
  }
}
.lock {
  pointer-events: none;
}

/* ---------- Xylophone ---------- */
.xylo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: clamp(130px, 27vh, 230px);
  width: min(100%, calc(var(--n) * 66px));
  flex: none;
  padding: 0 4px;
}
.xylo.big {
  height: clamp(150px, 30vh, 240px);
  width: min(100%, calc(var(--n) * 84px));
}
.xylo .rails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(40, 10, 0, 0.3));
}
.bar {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  height: var(--h);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.25) 30%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.15)), var(--bc);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28), inset 0 -6px 0 rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.08s, filter 0.2s;
  touch-action: none;
}
.bar::before,
.bar::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #bfc6d4 60%, #7d8798);
}
.bar::before {
  top: calc(17% - 4.5px);
}
.bar::after {
  bottom: calc(17% - 4.5px);
}
.bar .shine {
  position: absolute;
  left: 18%;
  top: 6px;
  bottom: 6px;
  width: 16%;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.28);
}
.bar .nm {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24%;
  text-align: center;
  font-weight: 800;
  font-size: clamp(14px, 3.8vw, 19px);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  line-height: 1;
  white-space: nowrap;
}
.bar.low .nm::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #fff;
}
.bar:active {
  transform: translateY(3px) scaleY(0.98);
}
.bar.hit {
  animation: barHit 0.35s ease-out;
}
@keyframes barHit {
  0% {
    filter: brightness(1.6) saturate(1.2);
    transform: translateY(4px) scale(0.97);
    box-shadow: 0 0 22px 6px var(--bc), 0 1px 0 rgba(0, 0, 0, 0.28);
  }
  100% {
    filter: none;
    transform: none;
  }
}
.bar.right {
  outline: 4px solid #fff;
  outline-offset: 2px;
}
.bar.wrong {
  filter: grayscale(0.6) brightness(0.8);
  animation: shake 0.4s;
}
.bar.want {
  animation: want 0.7s ease-in-out infinite alternate;
  outline: 4px dashed #fff;
  outline-offset: 2px;
}
@keyframes want {
  to {
    transform: translateY(-6px);
  }
}
.xylo.lock .bar {
  cursor: default;
}
.notepop {
  position: fixed;
  z-index: 50;
  font-size: 30px;
  font-weight: 800;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 0 2px #fff;
  transform: translate(-50%, 0);
  animation: notepop 0.85s ease-out forwards;
}
@keyframes notepop {
  to {
    transform: translate(calc(-50% + var(--dx)), -70px) rotate(15deg);
    opacity: 0;
  }
}
.seqdots {
  display: flex;
  gap: 8px;
  flex: none;
}
.seqdots i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.2s;
}
.seqdots i.on {
  transform: scale(1.15);
  border-color: #fff;
}

/* sube / baja */
.ladder {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  height: 110px;
  flex: none;
}
.lnote {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.6, 1), background 0.3s;
  transform: translateY(var(--y, 0));
}
.lnote.shown {
  transform: translateY(calc(var(--y) + 30px));
}
.lnote.pop {
  animation: notePulse 0.35s ease-out;
}
@keyframes notePulse {
  40% {
    scale: 1.3;
  }
}
.mystery {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}
.mystery span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 24px;
  color: #fff;
}
.mystery .ref {
  background: #ff4d5e;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}
.mystery .qm {
  background: rgba(255, 255, 255, 0.3);
  border: 3px dashed #fff;
  font-size: 32px;
}
.mystery .arrow {
  width: auto;
  font-size: 30px;
}
.mystery .pop {
  animation: notePulse 0.4s ease-out;
}
.staffbox {
  width: min(100%, 400px);
  flex: none;
  filter: drop-shadow(0 5px 0 rgba(30, 0, 70, 0.22));
}
.staffbox svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 24vh;
}
.staff .head {
  animation: popIn 0.4s cubic-bezier(0.3, 1.6, 0.6, 1);
  transform-box: fill-box;
  transform-origin: center;
}

/* ---------- Instruments ---------- */
.instcard {
  position: relative;
  width: min(62vw, 230px);
  aspect-ratio: 1 / 0.92;
  max-height: 30vh;
  flex: none;
  background: radial-gradient(circle at 50% 35%, #fff, #f1ecff);
  border-radius: 28px;
  box-shadow: 0 6px 0 rgba(30, 0, 70, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.instcard .inst {
  flex: 1;
  min-height: 0;
  width: 100%;
}
.instcard b {
  font-size: 20px;
  line-height: 1.1;
}
.instcard .hidden-inst {
  flex: 1;
  min-height: 0;
  width: 70%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  aspect-ratio: 1;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  margin-bottom: 4px;
}
.instcard .hidden-inst svg {
  width: 62%;
  height: 62%;
}
.instcard.sounding::before,
.snd.sounding::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 32px;
  border: 5px solid #fff;
  animation: ring 0.9s ease-out infinite;
}
.instcard.sounding .inst,
.instcard.sounding .hidden-inst {
  animation: wiggle 0.3s ease-in-out infinite alternate;
}
@keyframes wiggle {
  from {
    transform: rotate(-4deg) scale(1);
  }
  to {
    transform: rotate(4deg) scale(1.04);
  }
}
.fams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 440px);
  flex: none;
}
.fam {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 18px;
  background: #fff;
  border-bottom: 6px solid var(--fc);
  box-shadow: 0 4px 0 rgba(30, 0, 70, 0.2);
  text-align: left;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.05;
}
.fams.n2 .fam {
  min-height: 84px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 19px;
}
.fam .inst.fi {
  width: 46px;
  height: 46px;
  flex: none;
  background: color-mix(in srgb, var(--fc) 18%, #fff);
  border-radius: 12px;
  padding: 3px;
}
.instopts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(100%, 440px);
  flex: none;
}
.iopt {
  background: #fff;
  border-radius: 20px;
  padding: 8px 4px 6px;
  box-shadow: 0 5px 0 rgba(30, 0, 70, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.05;
}
.iopt .inst {
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  height: auto;
}
.ask {
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
  text-shadow: 0 2px 0 rgba(30, 0, 70, 0.3);
  flex: none;
}
.ask b {
  color: #fff36b;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: min(100%, 400px);
  flex: none;
}
.snd {
  position: relative;
  background: #fff;
  border-radius: 26px;
  padding: 12px 6px;
  box-shadow: 0 6px 0 rgba(30, 0, 70, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 800;
  font-size: 18px;
}
.snd svg {
  width: 64px;
  height: 64px;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  border-radius: 50%;
  padding: 12px;
}
.snd .n {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 28px;
  color: #6a3df0;
}

/* ---------- Songs ---------- */
.songhead {
  text-align: center;
  color: #fff;
  line-height: 1.05;
  flex: none;
  text-shadow: 0 2px 0 rgba(30, 0, 70, 0.3);
}
.songhead b {
  display: block;
  font-size: 24px;
}
.songhead small {
  font-weight: 700;
  font-size: 13px;
  opacity: 0.9;
}
.nrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  width: min(100%, 520px);
  flex: none;
}
.nbar {
  position: relative;
  display: flex;
  gap: 3px;
  flex: 1 1 45%;
  max-width: 50%;
  padding: 5px 5px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(30, 0, 70, 0.2);
}
.nb {
  flex: 1 1 0;
  min-width: 26px;
  height: 34px;
  border-radius: 17px;
  background: var(--bc, #ccc);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
}
.nb.gap {
  background: #fff;
  color: var(--pink);
  border: 3px dashed var(--pink);
  font-size: 20px;
  text-shadow: none;
  animation: want 0.6s ease-in-out infinite alternate;
}
.nb.filled {
  border: 0;
  color: #fff;
  background: var(--bc);
  animation: right 0.5s;
}
.nb.pop {
  animation: notePulse 0.3s ease-out;
}
.disc {
  position: relative;
  width: min(40vw, 150px);
  aspect-ratio: 1;
  flex: none;
}
.disc .vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #2b2140 0 3px, #3a2d57 3px 6px);
  box-shadow: 0 6px 0 rgba(30, 0, 70, 0.3);
}
.disc .lbl {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffd23a, #ff5fae);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
}
.disc.spin .vinyl,
.disc.spin .lbl {
  animation: spin 2s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tile lane */
.lane {
  position: relative;
  flex: 1;
  min-height: 0;
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meter {
  position: relative;
  height: 24px;
  border-radius: 12px;
  background: rgba(30, 0, 70, 0.3);
  overflow: hidden;
  flex: none;
}
.meter .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #7cf06b, #ffd23a);
  transition: width 0.2s;
}
.meter b {
  position: relative;
  display: block;
  text-align: center;
  color: #fff;
  font-size: 15px;
  line-height: 24px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.field {
  position: relative;
  flex: 1;
  min-height: 120px;
  border-radius: 20px 20px 8px 8px;
  background: linear-gradient(180deg, rgba(20, 0, 50, 0.55), rgba(20, 0, 50, 0.25));
  overflow: hidden;
}
.field .col {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bc) 22%, transparent));
}
.hitline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: #fff;
  box-shadow: 0 0 14px #fff;
  z-index: 2;
}
.tile {
  position: absolute;
  top: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 40%), var(--bc);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3), 0 0 12px color-mix(in srgb, var(--bc) 60%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  will-change: transform;
}
.tile span {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.tile.hit {
  opacity: 0;
  transition: opacity 0.25s, scale 0.25s;
  scale: 1.25;
}
.tile.miss {
  filter: grayscale(1) brightness(0.7);
  opacity: 0.5;
}
.xylo.lanepads {
  height: clamp(80px, 13vh, 110px);
  width: 100%;
  gap: 6px;
  padding: 0;
}
.lanepads .bar {
  border-radius: 10px;
}
.lanepads .bar .nm {
  bottom: 30%;
}
.lanepads .rails {
  display: none;
}

/* ---------- Feedback ---------- */
.wordpop {
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: 6;
  transform: translate(-50%, -50%);
  font-size: 38px;
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: 3px #2a1066;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #2a1066;
  pointer-events: none;
  animation: wordpop 0.9s ease-out forwards;
}
.wordpop.good {
  color: #7cf06b;
}
.wordpop.meh {
  color: #ffd23a;
}
.wordpop.turn {
  color: #fff36b;
  top: 20%;
}
.wordpop.tiny {
  font-size: 24px;
  top: 70%;
}
.wordpop.qm {
  font-size: 28px;
  top: -10px;
  color: var(--pink);
}
@keyframes wordpop {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }
  25% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  75% {
    transform: translate(-50%, -60%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -80%) scale(0.95);
    opacity: 0;
  }
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 16px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 16px;
  width: max-content;
  max-width: 94%;
  text-align: center;
  box-shadow: 0 6px 18px rgba(30, 0, 70, 0.35);
  z-index: 7;
  animation: popIn 0.3s;
}
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}
.confetti i {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  background: var(--c);
  animation: conf 1.5s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
.confetti i.nt {
  background: none;
  width: auto;
  height: auto;
  color: var(--c);
  font-size: 24px;
  font-style: normal;
  font-weight: 800;
}
@keyframes conf {
  to {
    transform: translate(var(--dx), calc(var(--dy) + 260px)) rotate(var(--r));
    opacity: 0;
  }
}

/* ---------- Overlays ---------- */
.ov {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(25, 5, 60, 0.6);
  animation: fadeIn 0.25s;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.ov .rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160vmax;
  height: 160vmax;
  margin: -80vmax 0 0 -80vmax;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.12) 0 10deg, rgba(255, 255, 255, 0) 10deg 20deg);
  animation: spin 30s linear infinite;
  pointer-events: none;
}
.panel {
  position: relative;
  width: min(100%, 400px);
  background: #fff;
  border-radius: 30px;
  padding: 18px 20px 20px;
  text-align: center;
  box-shadow: 0 10px 0 rgba(30, 0, 70, 0.3);
  animation: popIn 0.4s cubic-bezier(0.3, 1.5, 0.6, 1);
}
.panel .tambi {
  width: 110px;
  margin: -70px auto 0;
}
.panel h2 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.05;
  color: #6a3df0;
}
.panel .sub {
  margin: 4px 0 6px;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
}
.panel p {
  font-size: 16px;
  line-height: 1.3;
  margin: 6px 0;
}
.bigstars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 4px 0;
}
.bigstars span {
  width: 64px;
  height: 64px;
  animation: starIn 0.5s cubic-bezier(0.3, 1.8, 0.6, 1) backwards;
}
.bigstars span:nth-child(2) {
  transform: translateY(-12px);
}
.bigstars svg {
  width: 100%;
  height: 100%;
}
.bigstars svg.st path {
  fill: #e8e3f3;
  stroke: #cfc6e4;
}
.bigstars svg.st.on path {
  fill: var(--gold);
  stroke: #c98a00;
}
@keyframes starIn {
  from {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
  }
}
.facts {
  font-weight: 700;
  color: #6b6190;
}
.acts {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.btn {
  height: 50px;
  padding: 0 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, #7cf06b, #1fbf62);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 0 #11853f;
  text-shadow: 0 1px 0 rgba(0, 80, 30, 0.5);
}
.btn.ghost {
  background: #efeaff;
  color: #5a32d6;
  box-shadow: 0 4px 0 #cfc3f7;
  text-shadow: none;
}
.btn:active {
  transform: translateY(3px);
  box-shadow: none;
}
.sheet {
  align-items: flex-end;
  padding: 0;
}
.sheet-box {
  width: min(100%, 520px);
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 16px 20px max(20px, env(safe-area-inset-bottom));
  text-align: center;
  animation: up 0.35s cubic-bezier(0.3, 1.3, 0.6, 1);
}
@keyframes up {
  from {
    transform: translateY(100%);
  }
}
.sh-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 26px;
  color: #ff4f7b;
}
.sh-head .tambi {
  width: 54px;
}
.sh-tip {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  margin: 8px 0 14px;
}
.round-card {
  position: relative;
  text-align: center;
  color: #fff;
  animation: popIn 0.4s cubic-bezier(0.3, 1.5, 0.6, 1);
}
.round-card .tambi {
  width: 120px;
  margin: 0 auto;
}
.round-card .r {
  font-size: 22px;
  font-weight: 800;
  opacity: 0.9;
}
.round-card .w {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  -webkit-text-stroke: 3px #2a1066;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 #2a1066;
}
.intro .panel p:last-child {
  font-weight: 600;
}

/* ---------- Bigger screens / landscape ---------- */
@media (min-width: 760px) {
  .worlds {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    max-width: 860px;
    gap: 18px;
    padding: 18px 0;
  }
  .wcard {
    flex-direction: column;
    text-align: center;
    padding: 14px;
  }
  .wcard .isl {
    height: auto;
    width: min(60%, 170px);
    max-height: none;
    flex: 1;
    min-height: 0;
  }
  .wt {
    flex: none;
    align-items: center;
  }
  .ws,
  .wlock {
    position: absolute;
    top: 12px;
    right: 12px;
  }
  .scr.mapscr > .worlds {
    max-width: 860px;
  }
}
@media (max-height: 640px) {
  .talk .tb {
    width: 46px;
  }
  .bubble {
    min-height: 44px;
  }
  .pad {
    max-height: 26vh;
  }
  .xylo {
    height: clamp(110px, 25vh, 200px);
  }
  .hud {
    min-height: 46px;
  }
  .rbtn {
    width: 42px;
    height: 42px;
  }
  .opt {
    min-height: 48px;
  }
  .opt.big {
    min-height: 74px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .home .stage {
    min-height: 80px;
  }
  .title {
    font-size: 44px;
  }
  .talk {
    margin: 2px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bg .fl,
  .bg .beam,
  .title .ch,
  .bigbtn,
  .pill.go {
    animation: none;
  }
}

.stone .sts svg.st path {
  fill: #fff4d2;
  stroke: #d6b25a;
}
.stone .sts svg.st.on path {
  fill: var(--gold);
  stroke: #b57800;
}
.instcard.sounding::before,
.snd.sounding::before {
  animation: soundring 0.9s ease-out infinite;
}
@keyframes soundring {
  from {
    transform: scale(0.97);
    opacity: 1;
  }
  to {
    transform: scale(1.1);
    opacity: 0;
  }
}
.instcard .hidden-inst {
  flex: 1 1 auto;
  width: auto;
  height: 0;
  aspect-ratio: 1;
}
.tile .tail {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 34%;
  margin-left: -17%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(0deg, var(--bc), color-mix(in srgb, var(--bc) 30%, transparent));
  opacity: 0.85;
}
