/* ============================================================
   Barbie no Mundo dos Sons — folha de estilo principal
   Cenário: grama estilo Mário Bros + universo Barbie
   ============================================================ */

:root {
  --pink-50:  #fff2f9;
  --pink-100: #ffe0f1;
  --pink-200: #ffc2e4;
  --pink-300: #ff9ed6;
  --pink-400: #ff6ec0;
  --pink-500: #ff2e93;
  --pink-600: #d61f7c;
  --purple:   #7b3fa0;
  --ink:      #4a1036;
  --cream:    #fffaf4;
  --green-400:#7bea63;
  --green-500:#4fcc3d;
  --green-600:#2f9a2a;
  --gold:     #ffd75e;

  --radius: 18px;
  --shadow-soft: 0 10px 30px rgba(74, 16, 54, .18);
  --shadow-hard: 0 6px 0 rgba(74, 16, 54, .22);
  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, #ffe6f6 0%, transparent 55%),
    radial-gradient(circle at 85% 80%, #d9f4ff 0%, transparent 55%),
    #ffd7ee;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

/* ============================ ARENA ============================ */

.game {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #cdeeff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ============================ CÉU ============================ */

.sky {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      #b6e7ff 0%,
      #d8f0ff 22%,
      #ffe6f7 52%,
      #ffeef7 68%,
      #fff6fb 100%);
  z-index: 0;
}

.sun {
  position: absolute;
  top: clamp(50px, 10%, 120px);
  right: 7%;
  width: clamp(58px, 9vw, 120px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fffdf3, #ffe9a3 55%, #ffd75e 100%);
  box-shadow: 0 0 0 clamp(8px, 1.4vw, 20px) rgba(255, 232, 160, .35),
              0 0 70px rgba(255, 214, 120, .75);
  animation: sunPulse 6s ease-in-out infinite;
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.cloud {
  position: absolute;
  display: flex;
  align-items: flex-end;
  filter: drop-shadow(0 8px 0 rgba(255, 182, 222, .45));
  opacity: .96;
}
.cloud i {
  display: block;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #ffeaf6);
}
.cloud i:nth-child(1) { width: 46px; height: 46px; }
.cloud i:nth-child(2) { width: 62px; height: 62px; margin-left: -16px; }
.cloud i:nth-child(3) { width: 44px; height: 44px; margin-left: -18px; }

.cloud--1 { top: 8%;  left: 4%;  transform: scale(.9);  animation: drift 46s linear infinite; }
.cloud--2 { top: 17%; left: 42%; transform: scale(1.25); animation: drift 62s linear infinite reverse; }
.cloud--3 { top: 5%;  left: 62%; transform: scale(.7);  animation: drift 54s linear infinite; }
.cloud--4 { top: 26%; left: 22%; transform: scale(.6);  animation: drift 70s linear infinite reverse; }

@keyframes drift {
  from { margin-left: -6vw; }
  to   { margin-left: 6vw; }
}

.sparkle {
  position: absolute;
  color: #fff;
  font-size: clamp(12px, 1.6vw, 22px);
  text-shadow: 0 0 10px rgba(255, 120, 200, .9);
  animation: twinkle 3.4s ease-in-out infinite;
}
.sparkle--1 { top: 12%; left: 30%; animation-delay: .2s; }
.sparkle--2 { top: 30%; left: 56%; animation-delay: 1.1s; }
.sparkle--3 { top: 20%; left: 78%; animation-delay: .7s; }
.sparkle--4 { top: 38%; left: 12%; animation-delay: 1.7s; }

@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.8) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.25) rotate(20deg); }
}

/* ============================ COLINAS / ARBUSTOS ============================ */

.hills {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hill {
  position: absolute;
  bottom: 16%;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hill--far {
  width: 62%;
  height: 22%;
  left: -8%;
  background: linear-gradient(180deg, #ffd3ec, #ffb4dc);
}
.hill--mid {
  width: 54%;
  height: 18%;
  left: 34%;
  background: linear-gradient(180deg, #c9f2c0, #96e08b);
  bottom: 15%;
}
.hill--near {
  width: 40%;
  height: 14%;
  right: -6%;
  background: linear-gradient(180deg, #e7c6f5, #cd9fe8);
  bottom: 15%;
}

.bush {
  position: absolute;
  bottom: 14%;
  width: clamp(70px, 9vw, 130px);
  height: clamp(38px, 5vw, 66px);
  border-radius: 50% 50% 12px 12px / 90% 90% 12px 12px;
  background: linear-gradient(180deg, #8ef07c, #46bd38);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08);
}
.bush--1 { left: 6%; }
.bush--2 { left: 47%; transform: scale(.8); }
.bush--3 { right: 8%; transform: scale(1.1); }

/* ============================ CASTELO (fundo) ============================ */

.castle {
  position: absolute;
  right: 12%;
  bottom: 15.6%;
  width: clamp(110px, 15vw, 220px);
  z-index: 2;
  pointer-events: none;
  opacity: .95;
  filter: drop-shadow(0 6px 0 rgba(123, 63, 160, .18));
}
.castle__body {
  position: relative;
  height: clamp(58px, 7vw, 104px);
  margin: 0 clamp(16px, 2.4vw, 34px);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #ffe0f1, #f9bfe2);
  border: 3px solid #fff;
  border-bottom: none;
}
.castle__tower {
  position: relative;
  width: clamp(22px, 3vw, 40px);
  height: clamp(74px, 9vw, 132px);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #ffd0e9, #f6a9d6);
  border: 3px solid #fff;
  border-bottom: none;
}
.castle__tower span {
  position: absolute;
  top: -18px;
  left: 50%;
  translate: -50% 0;
  width: 0;
  height: 0;
  border-left: clamp(11px, 1.5vw, 20px) solid transparent;
  border-right: clamp(11px, 1.5vw, 20px) solid transparent;
  border-bottom: clamp(14px, 1.9vw, 26px) solid #ff2e93;
}
.castle__tower--l { position: absolute; left: 0; bottom: 0; }
.castle__tower--r { position: absolute; right: 0; bottom: 0; }
.castle__door {
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: 34%;
  height: 62%;
  border-radius: 40% 40% 0 0;
  background: linear-gradient(180deg, #7b3fa0, #4a1d63);
  box-shadow: inset 0 0 0 3px #fff0f8;
}
.castle__win {
  position: absolute;
  top: 22%;
  width: 15%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #a86bd0;
  box-shadow: inset 0 0 0 2px #fff;
}
.castle__win--1 { left: 12%; }
.castle__win--2 { right: 12%; }

/* ============================ BLOCOS ? + CANOS ============================ */

.blocks {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 800;
}

.block {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(34px, 4.4vw, 62px);
  aspect-ratio: 1;
  border-radius: 10px;
  color: #fff;
  font-size: clamp(16px, 2vw, 26px);
  background: linear-gradient(160deg, #ff9ede, #ff37a0);
  border: 3px solid #fff;
  box-shadow: 0 5px 0 #c2166f, 0 12px 22px rgba(74, 16, 54, .18);
  animation: blockBob 3.2s ease-in-out infinite;
}
.block--q { top: 20%; left: 14%; }
.block--coin { top: 20%; left: 9%; color: var(--gold); animation-delay: .5s; }
.block--q:nth-of-type(3) { top: 28%; left: 9.5%; animation-delay: 1s; }

@keyframes blockBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.pipe {
  position: absolute;
  bottom: 15%;
  width: clamp(30px, 3.6vw, 52px);
  height: clamp(44px, 5.4vw, 78px);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, #37a832, #7ee86a 40%, #37a832);
  border: 3px solid #fff;
  border-bottom: none;
}
.pipe--l { left: 26%; }
.pipe--r { left: calc(26% + clamp(34px, 4vw, 58px)); }

/* ============================ CHÃO DE GRAMA ============================ */

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15%;
  z-index: 3;
  pointer-events: none;
}
.ground__grass {
  position: relative;
  height: 42%;
  background: linear-gradient(180deg, #a6f690 0%, #6fe05a 45%, #45c235 100%);
  border-top: 5px solid #d3ffc8;
  box-shadow: 0 -6px 0 rgba(255, 255, 255, .5);
}
.ground__grass::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 10px 0, #8ef07c 8px, transparent 8px);
  background-size: 26px 26px;
  opacity: .55;
}
.ground__dirt {
  height: 58%;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.10) 0 26px, transparent 26px 52px),
    linear-gradient(180deg, #d98a5c, #b96a3f 60%, #9c5230);
}
.ground__dirt::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 58%;
  height: 4px;
  background: rgba(120, 60, 30, .35);
}

.flower {
  position: absolute;
  top: -14px;
  font-size: clamp(14px, 1.8vw, 24px);
  color: #ff4fae;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .8);
  animation: flowerSway 4s ease-in-out infinite;
}
.flower--1 { left: 8%; animation-delay: .1s; }
.flower--2 { left: 22%; animation-delay: .6s; color: #ffd75e; }
.flower--3 { left: 41%; animation-delay: 1.2s; }
.flower--4 { left: 64%; animation-delay: .3s; color: #b98cff; }
.flower--5 { left: 84%; animation-delay: .9s; color: #ffd75e; }

@keyframes flowerSway {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(7deg); }
}

/* ============================ PALCO / PERSONAGEM ============================ */

.stage {
  position: absolute;
  inset: 0;
  z-index: 6;
}

.char {
  position: absolute;
  left: 50%;
  top: 60%;
  width: clamp(44px, 6.6vw, 74px);
  translate: -50% -100%;
  z-index: 20;
  will-change: left, top;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(74, 16, 54, .28));
}

.char__inner {
  transform-origin: 50% 92%;
  transition: transform .16s ease;
}

.char__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.char__shadow {
  transition: opacity .2s ease;
}

/* andar: quique + balanço das pernas */
.char.is-walking .char__inner { animation: charBob .34s ease-in-out infinite; }
@keyframes charBob {
  0%, 100% { transform: translateY(0) rotate(-1.6deg); }
  50%      { transform: translateY(-5px) rotate(1.6deg); }
}

.char.is-walking .char__leg--l { animation: legSwingL .34s ease-in-out infinite; transform-origin: 34px 84px; }
.char.is-walking .char__leg--r { animation: legSwingR .34s ease-in-out infinite; transform-origin: 46px 84px; }
@keyframes legSwingL {
  0%, 100% { transform: rotate(9deg); }
  50%      { transform: rotate(-9deg); }
}
@keyframes legSwingR {
  0%, 100% { transform: rotate(-9deg); }
  50%      { transform: rotate(9deg); }
}

.char.is-walking .char__arm--l,
.char.is-walking .char__arm--r { animation: armSwing .34s ease-in-out infinite; transform-origin: 40px 54px; }
@keyframes armSwing {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(7deg); }
}

/* olhando para a esquerda */
.char.face-left .char__svg { transform: scaleX(-1); }

/* correndo rápido */
.char.is-sprinting .char__inner { animation-duration: .2s; }

/* Pulo curto ao confirmar resposta certa */
.char.is-cheering .char__inner { animation: cheer .5s ease-in-out 2; }
@keyframes cheer {
  0%, 100% { transform: translateY(0) scale(1); }
  40%      { transform: translateY(-16px) scale(1.05, .97); }
  70%      { transform: translateY(0) scale(.98, 1.03); }
}

/* MORTE: cai do mundo girando e encolhendo */
.char.is-dying {
  animation: fallOutOfWorld 1.45s cubic-bezier(.55, .06, .9, .45) forwards;
  z-index: 30;
}
@keyframes fallOutOfWorld {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  18%  { transform: translate(0, -22px) rotate(-8deg) scale(1); opacity: 1; }
  45%  { transform: translate(10px, 34vh) rotate(180deg) scale(.92); opacity: 1; }
  100% { transform: translate(24px, 120vh) rotate(720deg) scale(.5); opacity: 0; }
}
.char.is-dying .char__inner { animation: panicFlail .5s ease-in-out infinite; }
@keyframes panicFlail {
  0%, 100% { transform: rotate(-10deg); }
  50%      { transform: rotate(10deg); }
}

/* ============================ PORTAS / OPÇÕES ============================ */

.doors {
  position: absolute;
  inset: 0;
  z-index: 12;
}

.door {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: clamp(88px, 15vw, 168px);
  min-height: clamp(56px, 8vh, 82px);
  padding: clamp(6px, 1vh, 12px) clamp(6px, .8vw, 12px) clamp(7px, 1.1vh, 13px);
  translate: -50% -50%;
  border: 3px solid #fff;
  border-radius: 46% 46% 16px 16px / 34% 34% 16px 16px;
  background: linear-gradient(180deg, #fff4fb 0%, #ffd6ec 55%, #ffb0dd 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(11px, 1.35vw, 16px);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(198, 32, 118, .35), 0 14px 26px rgba(74, 16, 54, .22);
  transition: transform .16s ease, box-shadow .16s ease, background .2s ease, opacity .2s ease;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
}
.door::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255,255,255,.55) 0%, transparent 45%);
  pointer-events: none;
}

.door__num {
  display: inline-grid;
  place-items: center;
  min-width: 1.65em;
  height: 1.65em;
  padding: 0 .2em;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5fb4, #d61f7c);
  color: #fff;
  font-size: clamp(10px, 1.15vw, 14px);
  box-shadow: 0 2px 0 #9c1257;
}

.door__label {
  text-wrap: balance;
  max-width: 100%;
}

.door__key {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: clamp(8px, .95vw, 11px);
  font-weight: 700;
  color: #c989ab;
  font-family: var(--font-body);
}

.door:hover { transform: translateY(-4px) scale(1.02); }
.door:focus-visible {
  outline: 4px solid #7b3fa0;
  outline-offset: 3px;
}

/* porta alcançável: destaca quando o personagem está perto */
.door.is-near {
  background: linear-gradient(180deg, #fffbe6 0%, #ffe9a8 55%, #ffd75e 100%);
  box-shadow: 0 0 0 5px rgba(255, 215, 94, .65), 0 8px 0 #d8a520, 0 16px 30px rgba(74, 16, 54, .28);
  animation: nearGlow 1.1s ease-in-out infinite;
}
@keyframes nearGlow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 215, 94, .5), 0 8px 0 #d8a520, 0 16px 30px rgba(74,16,54,.25); }
  50%      { box-shadow: 0 0 0 10px rgba(255, 215, 94, .25), 0 8px 0 #d8a520, 0 16px 30px rgba(74,16,54,.25); }
}

.door.is-correct {
  background: linear-gradient(180deg, #f2ffec, #a8f79a 55%, #5ee04a 100%);
  box-shadow: 0 0 0 6px rgba(94, 224, 74, .45), 0 8px 0 #2f9a2a, 0 16px 30px rgba(74,16,54,.28);
  animation: correctPop .5s ease;
}
@keyframes correctPop {
  0%   { transform: translateY(0) scale(1); }
  45%  { transform: translateY(-12px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

.door.is-wrong {
  background: linear-gradient(180deg, #fff0f0, #ffb3b3 55%, #ff7a7a 100%);
  color: #6b0f1a;
  animation: wrongShake .45s ease;
}
@keyframes wrongShake {
  0%, 100% { margin-left: 0; }
  20% { margin-left: -9px; }
  40% { margin-left: 9px; }
  60% { margin-left: -6px; }
  80% { margin-left: 6px; }
}

.door.is-locked {
  cursor: default;
  filter: grayscale(.25);
  opacity: .82;
}
.door.is-locked:hover { transform: none; }

/* posições das 4 opções ao redor do personagem */
.door--back  { left: 50%; top: 22%; }
.door--left  { left: 17%; top: 56%; }
.door--right { left: 83%; top: 56%; }
.door--front { left: 50%; top: 80%; }

/* ============================ FLUTUANTES ============================ */

.floaters {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(18px, 2.6vw, 34px);
  color: #fff;
  translate: -50% -50%;
  text-shadow: 0 3px 0 #d61f7c, 0 0 18px rgba(255, 110, 192, .8);
  animation: floatUp 1.1s ease-out forwards;
  white-space: nowrap;
}
.floater--good { text-shadow: 0 3px 0 #2f9a2a, 0 0 18px rgba(140, 255, 120, .85); }
.floater--bad  { text-shadow: 0 3px 0 #a01020, 0 0 18px rgba(255, 90, 90, .85); }

@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(14px) scale(.6); }
  25%  { opacity: 1; transform: translateY(-4px) scale(1.12); }
  100% { opacity: 0; transform: translateY(-64px) scale(1); }
}

/* ============================ HUD ============================ */

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

.hud__group {
  display: flex;
  align-items: center;
  gap: clamp(5px, .8vw, 10px);
  flex-wrap: wrap;
}
.hud__group--right { pointer-events: auto; }

.hud__lives {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px clamp(8px, 1vw, 13px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
}

.heart {
  font-size: clamp(14px, 1.8vw, 22px);
  line-height: 1;
  color: var(--pink-500);
  text-shadow: 0 2px 0 rgba(255, 255, 255, .9);
  transition: transform .25s ease, opacity .25s ease, filter .25s ease;
}
.heart.is-lost {
  color: #cbb6c4;
  opacity: .5;
  transform: scale(.82);
  filter: grayscale(1);
}
.heart.is-pulsing { animation: heartPop .5s ease; }
@keyframes heartPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.hud__pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px clamp(8px, 1vw, 13px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  font-family: var(--font-display);
  line-height: 1.1;
}
.hud__label {
  font-size: clamp(9px, 1.05vw, 12px);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #b0608f;
  font-family: var(--font-body);
  font-weight: 900;
}
.hud__value {
  font-size: clamp(12px, 1.5vw, 18px);
  color: var(--pink-600);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: clamp(32px, 3.6vw, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #fff;
  background: linear-gradient(180deg, #ffa8db, #ff4fae);
  color: #fff;
  font-size: clamp(14px, 1.8vw, 20px);
  cursor: pointer;
  box-shadow: 0 4px 0 #c2166f, 0 10px 18px rgba(74, 16, 54, .2);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.icon-btn:hover { transform: translateY(-2px); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c2166f; }
.icon-btn.is-off { background: linear-gradient(180deg, #d9cfd6, #a99aa4); box-shadow: 0 4px 0 #8b7b85; }

.prompt {
  position: absolute;
  z-index: 50;
  top: clamp(52px, 8.5vh, 78px);
  left: 50%;
  translate: -50% 0;
  margin: 0;
  padding: clamp(6px, .9vh, 10px) clamp(12px, 1.6vw, 22px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(11px, 1.4vw, 17px);
  color: var(--pink-600);
  text-align: center;
  max-width: min(92vw, 640px);
  line-height: 1.15;
  pointer-events: none;
  transition: background .2s ease, color .2s ease;
}
.prompt.is-good { background: #eaffe4; color: #1f7a1a; }
.prompt.is-bad  { background: #ffecec; color: #a01020; }

/* ============================ CONTROLES TOUCH ============================ */

.touchpad {
  position: absolute;
  z-index: 55;
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.touchpad__cross {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, var(--pad));
  grid-template-rows: repeat(2, var(--pad));
  gap: 4px;
  --pad: clamp(40px, 5.4vw, 62px);
  pointer-events: auto;
}

.pad-btn {
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255, 194, 228, .96));
  color: var(--pink-600);
  font-size: clamp(13px, 1.7vw, 20px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(198, 32, 118, .45), 0 10px 18px rgba(74, 16, 54, .18);
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}
.pad-btn:active,
.pad-btn.is-pressed {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(198, 32, 118, .45);
  background: linear-gradient(180deg, #ffe8f5, #ff9ed6);
}

.pad-btn--up    { grid-column: 2; grid-row: 1; }
.pad-btn--left  { grid-column: 1; grid-row: 2; }
.pad-btn--right { grid-column: 3; grid-row: 2; }
.pad-btn--down  { grid-column: 2; grid-row: 2; border-radius: 14px; }

.pad-btn--choose {
  pointer-events: auto;
  padding: 0 clamp(16px, 2.4vw, 30px);
  height: clamp(46px, 6vw, 62px);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8fd0, #ff2e93);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.7vw, 19px);
  letter-spacing: .02em;
  box-shadow: 0 6px 0 #b31465, 0 12px 22px rgba(74, 16, 54, .25);
}
.pad-btn--choose:active { box-shadow: 0 1px 0 #b31465; }

/* ============================ OVERLAY / PAINEL ============================ */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 35%, rgba(255, 225, 244, .82), rgba(120, 40, 100, .55));
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  overflow-y: auto;
}
.overlay.is-visible { opacity: 1; visibility: visible; }

.panel {
  width: min(560px, 96vw);
  padding: clamp(16px, 3vh, 30px) clamp(16px, 3vw, 34px);
  border-radius: 26px;
  border: 4px solid #fff;
  background: linear-gradient(180deg, #fffafd, #ffe9f5 70%, #ffd9ee);
  box-shadow: 0 18px 0 rgba(198, 32, 118, .18), 0 30px 60px rgba(74, 16, 54, .35);
  text-align: center;
  animation: panelIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes panelIn {
  from { transform: translateY(18px) scale(.94); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.panel__kicker {
  margin: 0 0 4px;
  font-size: clamp(9px, 1.2vw, 12px);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #c989ab;
}

.panel__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(21px, 3.4vw, 34px);
  line-height: 1.05;
  color: var(--pink-600);
  text-shadow: 0 2px 0 #fff, 0 5px 0 rgba(214, 31, 124, .18);
}

.panel__text {
  margin: 0 auto 12px;
  max-width: 44ch;
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.5;
  color: #6b3a58;
}

.panel__keys {
  display: grid;
  gap: 6px;
  margin: 0 auto 16px;
  padding: 10px 12px;
  max-width: 46ch;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 2px dashed rgba(214, 31, 124, .3);
  font-size: clamp(11px, 1.35vw, 14px);
  color: #7a4a68;
  text-align: left;
}

kbd {
  display: inline-block;
  margin: 0 1px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 2px solid #ffc2e4;
  border-bottom-width: 3px;
  background: #fff;
  font-family: var(--font-body);
  font-size: .95em;
  font-weight: 900;
  color: var(--pink-600);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: clamp(10px, 1.5vh, 14px) clamp(22px, 3vw, 40px);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(14px, 1.9vw, 21px);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn--primary {
  background: linear-gradient(180deg, #ff7fc8, #ff2e93 60%, #e0177f);
  color: #fff;
  box-shadow: 0 7px 0 #a31159, 0 16px 30px rgba(198, 32, 118, .35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--primary:active { transform: translateY(5px); box-shadow: 0 2px 0 #a31159; }

.panel__hint {
  margin: 10px 0 0;
  font-size: clamp(9px, 1.15vw, 12px);
  color: #b0608f;
}

.panel__score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 16px;
}
.panel__score div {
  padding: 8px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .8);
  border: 2px solid #ffd9ee;
}
.panel__score span {
  display: block;
  font-size: clamp(8px, 1.05vw, 11px);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #b0608f;
}
.panel__score strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 26px);
  color: var(--pink-600);
}

/* ============================ RESPONSIVO ============================ */

/* Telas baixas / paisagem de celular: compacta o HUD e as portas */
@media (max-height: 560px) {
  .door { min-height: 48px; font-size: clamp(10px, 1.7vh, 14px); padding: 4px 6px 6px; }
  .door--back { top: 26%; }
  .door--front { top: 78%; }
  .prompt { top: 46px; font-size: 11px; padding: 4px 12px; }
  .touchpad__cross { --pad: clamp(36px, 9vh, 46px); }
  .pad-btn--choose { height: 44px; }
  .ground { height: 18%; }
  .panel__keys { display: none; }
  .hud__pill--score { display: none; }
}

/* Celular em pé: portas mais estreitas, controles maiores */
@media (max-width: 620px) {
  .door {
    width: clamp(80px, 27vw, 132px);
    font-size: clamp(9.5px, 2.6vw, 13px);
    min-height: 52px;
  }
  .door--back  { top: 26%; }
  .door--left  { left: 22%; top: 58%; }
  .door--right { left: 78%; top: 58%; }
  .door--front { top: 79%; }
  .char { width: clamp(46px, 13vw, 66px); }
  .prompt { top: clamp(58px, 10vh, 86px); max-width: 94vw; }
  .hud__label { display: none; }
  .hud__pill { padding: 4px 8px; }
  .hud__pill--score { display: none; }
  .touchpad__cross { --pad: clamp(44px, 13vw, 58px); }
  .block, .pipe { display: none; }
}

@media (max-width: 400px) {
  .door { width: clamp(78px, 30vw, 118px); }
  .door--back { top: 27%; }
  .door--front { top: 80%; }
}

/* Telas grandes: um pouco mais de ar */
@media (min-width: 1500px) and (min-height: 900px) {
  .door { width: 176px; }
}

/* Preferência por menos animação */
@media (prefers-reduced-motion: reduce) {
  .cloud, .sparkle, .block, .flower, .sun, .char__inner,
  .char__leg, .char__arm, .heart { animation: none !important; }
  .char.is-dying { animation-duration: 1.2s; }
}

/* Acessibilidade: foco visível nos botões */
.icon-btn:focus-visible,
.pad-btn:focus-visible,
.btn:focus-visible {
  outline: 4px solid #7b3fa0;
  outline-offset: 3px;
}
