/* Misión Lengua: look of the menu, the play screen and the overlays. */
:root {
  --c1: #2f7fe8;
  --c2: #47c6f5;
  --ink: #1d2257;
  --ol: #14215e;
  --font: "Baloo 2", ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  --ok: #1fb45a;
  --bad: #ef4343;
  --gold: #ffc531;
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --ol: color-mix(in srgb, var(--c1) 45%, #0d0a3a);
  }
}
* {
  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));
  transition: background 0.4s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Tilde ---------- */
.owl {
  display: block;
  overflow: visible;
}
.owl .lids {
  transform-origin: 60px 30px;
  transform: scaleY(0);
  animation: blink 4.5s infinite;
}
.owl .joy {
  display: none;
}
.owl.cheer .eyes,
.owl.cheer .lids,
.tilde.happy .owl .eyes,
.tilde.happy .owl .lids {
  display: none;
}
.owl.cheer .joy,
.tilde.happy .owl .joy {
  display: block;
}
.owl .body {
  transform-origin: 60px 116px;
}
.owl.big .body,
.owl.mid .body {
  animation: bob 2.6s ease-in-out infinite;
}
.owl.cheer .body {
  animation: hop 0.7s ease-in-out infinite;
}
.owl.cheer .wing.l {
  transform-origin: 24px 64px;
  animation: flapL 0.35s ease-in-out infinite alternate;
}
.owl.cheer .wing.r {
  transform-origin: 96px 64px;
  animation: flapR 0.35s ease-in-out infinite alternate;
}
.owl.sad .body,
.tilde.sad .owl .body {
  transform: rotate(-6deg) translateY(3px);
}
.owl.sad .eyes,
.tilde.sad .owl .eyes {
  transform: translateY(4px);
}
.owl.sad .lids,
.tilde.sad .owl .lids {
  animation: none;
  transform: scaleY(0.42);
}
.tilde.happy .owl .body {
  animation: hop 0.5s ease-in-out 2;
}
@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(0);
  }
  95% {
    transform: scaleY(1);
  }
}
@keyframes bob {
  50% {
    transform: translateY(-5px) rotate(2deg);
  }
}
@keyframes hop {
  50% {
    transform: translateY(-10px);
  }
}
@keyframes flapL {
  to {
    transform: rotate(28deg);
  }
}
@keyframes flapR {
  to {
    transform: rotate(-28deg);
  }
}

/* ---------- Menu ---------- */
.menu {
  overflow-y: auto;
  overflow-x: hidden;
  align-items: center;
  padding: 10px 14px 30px;
  touch-action: pan-y;
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(10, 0, 40, 0.2) 100%);
}
.menu > * {
  position: relative;
  z-index: 1;
}
.menu > .deco {
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  min-height: 760px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.rays {
  position: absolute;
  left: 50%;
  top: 70px;
  width: 760px;
  height: 760px;
  margin: -380px 0 0 -380px;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.13) 0 9deg, rgba(255, 255, 255, 0) 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0, #000 16%, transparent 58%);
  mask: radial-gradient(circle, #000 0, #000 16%, transparent 58%);
  animation: spin 60s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.cloud {
  position: absolute;
  width: 220px;
  height: 90px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.cloud::before {
  width: 110px;
  height: 110px;
  left: 30px;
  top: -50px;
}
.cloud::after {
  width: 80px;
  height: 80px;
  left: 115px;
  top: -30px;
}
.cloud.a {
  left: -120px;
  top: 150px;
}
.cloud.b {
  right: -130px;
  top: 40px;
  transform: scale(0.8);
}
.cloud.c {
  right: -100px;
  top: 600px;
  transform: scale(1.2);
  opacity: 0.8;
}
.glyph {
  position: absolute;
  font-weight: 800;
  font-size: 120px;
  line-height: 1;
  color: #fff;
  opacity: 0.13;
}
.glyph.g0 {
  left: -6px;
  top: 40px;
  transform: rotate(-16deg);
}
.glyph.g1 {
  right: -10px;
  top: 250px;
  font-size: 150px;
  transform: rotate(14deg);
}
.glyph.g2 {
  left: -20px;
  top: 540px;
  font-size: 160px;
  transform: rotate(-8deg);
  opacity: 0.1;
}
.logo {
  width: 124px;
  height: 120px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 250, 210, 0.75) 0%, rgba(255, 250, 210, 0) 65%);
}
.logo .owl {
  width: 108px;
  height: 112px;
  filter: drop-shadow(0 8px 10px rgba(20, 0, 60, 0.35));
}
.title {
  margin: -4px 0 0;
  font-size: clamp(38px, 11vw, 58px);
  font-weight: 800;
  line-height: 1.05;
  color: #fffaf0;
  text-align: center;
  text-shadow:
    3px 0 0 var(--ol),
    -3px 0 0 var(--ol),
    0 3px 0 var(--ol),
    0 -3px 0 var(--ol),
    2px 2px 0 var(--ol),
    -2px 2px 0 var(--ol),
    2px -2px 0 var(--ol),
    -2px -2px 0 var(--ol),
    0 6px 0 var(--ol),
    3px 6px 0 var(--ol),
    -3px 6px 0 var(--ol),
    0 11px 14px rgba(20, 0, 50, 0.35);
}
.how {
  max-width: 440px;
  margin: 10px 0 6px;
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(20, 0, 50, 0.35);
}
.total {
  margin: 4px 0 12px;
  padding: 4px 22px;
  border-radius: 999px;
  background: rgba(20, 8, 70, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.big-go {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  padding: 10px 18px 10px 12px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffe066, #ffb820);
  box-shadow:
    inset 0 -4px 0 rgba(190, 110, 0, 0.35),
    0 6px 0 rgba(30, 10, 80, 0.3),
    0 10px 18px rgba(20, 0, 60, 0.22);
  color: #4a2600;
  text-align: left;
  transition: transform 0.12s;
}
.big-go:active {
  transform: translateY(3px);
}
.big-go .pl {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  color: #ff8a00;
  font-size: 26px;
  padding-left: 4px;
  box-shadow: 0 3px 0 rgba(190, 110, 0, 0.4);
}
.big-go b {
  display: block;
  font-size: 26px;
  line-height: 1;
}
.big-go small {
  display: block;
  font-size: 15px;
  font-weight: 700;
  opacity: 0.8;
  line-height: 1.2;
}
.modes {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin: 12px 0 16px;
}
.mode {
  flex: 1;
  padding: 10px 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 0 rgba(30, 10, 80, 0.25);
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
}
.mode.reto {
  background: linear-gradient(180deg, #ff7aa8, #ff3d7f);
  color: #fff;
  text-shadow: 0 1px 0 rgba(120, 0, 40, 0.35);
}
.mode:active {
  transform: translateY(2px);
}
.tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 480px;
  padding: 5px;
  border-radius: 20px;
  background: rgba(20, 8, 70, 0.25);
  margin-bottom: 12px;
}
.tab {
  flex: 1;
  padding: 6px 4px 5px;
  border-radius: 15px;
  background: transparent;
  color: #fff;
  line-height: 1.05;
}
.tab b {
  display: block;
  font-size: 22px;
}
.tab span {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
}
.tab.on {
  background: #fff;
  color: var(--tc);
  box-shadow: 0 3px 0 rgba(20, 0, 60, 0.2);
}
.units {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}
.unit {
  border-radius: 24px;
  padding: 10px 10px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f0 70%, #f8eadf 100%);
  box-shadow:
    inset 0 -3px 0 rgba(200, 150, 160, 0.3),
    0 5px 0 rgba(30, 10, 80, 0.28),
    0 9px 16px rgba(20, 0, 60, 0.18);
  animation: rise 0.35s both;
}
.unit:nth-child(2) {
  animation-delay: 0.05s;
}
.unit:nth-child(3) {
  animation-delay: 0.1s;
}
.unit:nth-child(4) {
  animation-delay: 0.15s;
}
.unit.gold {
  background: linear-gradient(180deg, #fffbe6 0%, #fff0b8 100%);
  box-shadow:
    inset 0 0 0 3px #ffd34d,
    0 5px 0 rgba(170, 110, 0, 0.35),
    0 9px 16px rgba(20, 0, 60, 0.18);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
.u-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 8px;
}
.u-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--c2), var(--c1));
  color: #fff;
  font-size: 22px;
  box-shadow: 0 3px 0 rgba(20, 0, 60, 0.25);
}
.u-ic {
  font-size: 26px;
}
.u-t {
  flex: 1;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
}
.u-t small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #7a6fa0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.u-medal {
  font-size: 28px;
  animation: bob 2s ease-in-out infinite;
}
.u-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.lvl {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 2px 6px;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    inset 0 0 0 2px #ece4f6,
    0 3px 0 #d9cbe8;
  line-height: 1.05;
  transition: transform 0.12s;
}
.lvl:active {
  transform: translateY(2px);
}
.lvl.new {
  box-shadow:
    inset 0 0 0 2.5px var(--c1),
    0 3px 0 #d9cbe8;
}
.lvl .wm {
  position: absolute;
  right: -8px;
  bottom: -10px;
  font-size: 44px;
  opacity: 0.1;
  transform: rotate(-12deg);
}
.lvl .ic {
  font-size: 24px;
}
.lvl b {
  font-size: 14px;
  margin: 2px 0;
}
.st i,
.lvl .st i {
  font-style: normal;
  font-size: 16px;
  color: #ddd3e8;
}
.st i.on {
  color: var(--gold);
  text-shadow: 0 1px 0 #c98a00;
}
.repaso {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffe9f3, #ffd0e4);
  box-shadow:
    inset 0 0 0 2.5px #ff7aa8,
    0 5px 0 rgba(30, 10, 80, 0.25);
  text-align: left;
}
.r-ic {
  font-size: 32px;
}
.r-t {
  flex: 1;
  line-height: 1.1;
}
.r-t b {
  display: block;
  font-size: 18px;
}
.r-t small {
  font-size: 13px;
  font-weight: 700;
  color: #a0517a;
}
.foot {
  max-width: 440px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}

/* ---------- Play ---------- */
.play {
  align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 12px 12px;
  overflow-y: auto;
  touch-action: pan-y;
}
.play > * {
  width: 100%;
  max-width: 560px;
}
.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}
.hb {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(20, 8, 70, 0.28);
  color: #fff;
}
.hb svg {
  width: 22px;
  height: 22px;
}
.mute .cross {
  display: none;
}
.mute.off .cross {
  display: inline;
}
.mute.off .waves {
  display: none;
}
.ht {
  flex: 1;
  min-width: 0;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(20, 0, 50, 0.3);
}
.ht b {
  display: block;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ht span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hearts {
  flex: none;
  font-size: 20px;
  letter-spacing: 1px;
}
.hearts i {
  font-style: normal;
  color: rgba(255, 255, 255, 0.35);
  display: inline-block;
}
.hearts i.on {
  color: #ff4466;
  text-shadow: 0 2px 0 rgba(120, 0, 30, 0.35);
}
.clock {
  font-weight: 800;
  font-size: 18px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(20, 8, 70, 0.28);
}
.prog {
  display: flex;
  gap: 5px;
  margin: 10px 0 6px;
}
.prog i {
  flex: 1;
  height: 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.3s;
}
.prog i.now {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
.prog i.ok {
  background: #7cf06b;
}
.prog i.bad {
  background: #ff6b6b;
}
.talk {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 4px 0 10px;
}
.tilde {
  flex: none;
  width: 70px;
}
.tilde .owl {
  width: 70px;
  height: 72px;
  filter: drop-shadow(0 4px 4px rgba(20, 0, 60, 0.3));
}
.bubble {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 60px;
  margin-bottom: 14px;
  padding: 8px 8px 8px 14px;
  border-radius: 20px 20px 20px 6px;
  background: #fff;
  box-shadow: 0 4px 0 rgba(20, 0, 60, 0.2);
}
.bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 6px;
  border: 8px solid transparent;
  border-right-color: #fff;
  border-bottom-color: #fff;
}
.bubble.in {
  animation: pop 0.3s;
}
.q {
  flex: 1;
  margin: 0;
  font-weight: 800;
  font-size: 19px;
  line-height: 1.2;
}
.say {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--c1);
}
.say svg {
  width: 20px;
  height: 20px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(46vh, 420px);
  padding: 18px 14px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf6ff 100%);
  box-shadow:
    0 6px 0 rgba(20, 0, 60, 0.22),
    0 14px 24px rgba(20, 0, 60, 0.18);
}
.card.in {
  animation: cardIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.card.shake {
  animation: shake 0.45s;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.96);
  }
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-9px);
  }
  40%,
  80% {
    transform: translateX(9px);
  }
}
@keyframes pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
}
.lock {
  pointer-events: none;
}
.opts {
  display: grid;
  gap: 10px;
}
.opts.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.opts.grid.n3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.opts.tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}
.opt {
  padding: 13px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow:
    inset 0 0 0 2.5px #e3d9f3,
    0 4px 0 #d3c4ea;
  font-weight: 800;
  font-size: 19px;
  line-height: 1.2;
  color: var(--ink);
  transition:
    transform 0.1s,
    background 0.2s;
}
.opts.tiles .opt {
  min-width: 84px;
  padding: 12px 18px;
  font-size: 28px;
}
.opt:active,
.syl:active,
.chip:active,
.tile:active,
.pc:active {
  transform: translateY(3px);
}
.right {
  background: #d9fbe3 !important;
  box-shadow:
    inset 0 0 0 3px var(--ok),
    0 4px 0 #8fdca8 !important;
  color: #0b6b31 !important;
}
.wrong {
  background: #ffe1e1 !important;
  box-shadow:
    inset 0 0 0 3px var(--bad),
    0 4px 0 #f3a3a3 !important;
  color: #a31616 !important;
  animation: shake 0.4s;
}
.sentence {
  margin: 4px 0 6px;
  text-align: center;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;
}
.sentence.word {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 1px;
}
.gap {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 6px;
  margin: 0 2px;
  border-radius: 10px;
  border: 3px dashed var(--c1);
  color: var(--c1);
  background: #eef5ff;
  line-height: 1.15;
  animation: glow 1.4s ease-in-out infinite;
}
.gap.filled {
  border: 3px solid var(--ok);
  background: #d9fbe3;
  color: #0b6b31;
  animation: pop 0.3s;
}
.gap.fixed {
  border: 3px solid var(--bad);
  background: #fff1d6;
  color: #b25a00;
  animation: pop 0.3s;
}
.gap.empty {
  min-width: 0.7em;
}
@keyframes glow {
  50% {
    background: #dbeaff;
  }
}
.big-word {
  margin: 0 0 14px;
  text-align: center;
  font-weight: 800;
  font-size: 44px;
  letter-spacing: 1px;
}
.syls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.syl {
  min-width: 70px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f2ecff);
  box-shadow:
    inset 0 0 0 2.5px #d9cdf3,
    0 5px 0 #c4b3e6;
  font-weight: 800;
  font-size: 30px;
}
.syl.right {
  transform: scale(1.12);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 6px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
}
.chips .w {
  display: inline-flex;
  align-items: center;
}
.chip {
  padding: 8px 10px;
  border-radius: 14px;
  background: #f4f0ff;
  box-shadow: 0 3px 0 #d6cbef;
  font-weight: 700;
}
.chip.found,
.chip.missed {
  background: #d9fbe3;
  box-shadow:
    inset 0 0 0 3px var(--ok),
    0 3px 0 #8fdca8;
  color: #0b6b31;
  animation: pop 0.3s;
}
.chip.missed {
  background: #fff6cc;
  box-shadow:
    inset 0 0 0 3px #f0b400,
    0 3px 0 #e6cc6b;
  color: #7a5200;
}
.pu {
  padding: 0 1px;
}
.count {
  margin: 12px 0 0;
  text-align: center;
  font-weight: 800;
  color: #8a7fb0;
  font-size: 16px;
}
.sort-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 92px;
}
.sort-chip {
  padding: 10px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff7c2, #ffe066);
  box-shadow: 0 5px 0 #e0b400;
  font-weight: 800;
  font-size: 28px;
  color: #4a3200;
  text-align: center;
  transition:
    transform 0.25s,
    opacity 0.25s;
}
.sort-chip.pop {
  animation: pop 0.3s;
}
.sort-chip.fly {
  transform: translateY(60px) scale(0.5);
  opacity: 0;
}
.sort-chip.bad {
  background: #ffe1e1;
  box-shadow: 0 5px 0 #f3a3a3;
  color: #a31616;
}
.sort-stage .count {
  margin-top: 8px;
}
.bins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.bins.n3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.bin {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 20px;
  background: #eef5ff;
  box-shadow:
    inset 0 0 0 3px #b9d4ff,
    0 4px 0 #a8c4f0;
  line-height: 1.1;
}
.bin.b1 {
  background: #fff0f6;
  box-shadow:
    inset 0 0 0 3px #ffbcd6,
    0 4px 0 #f0a9c4;
}
.bin.b2 {
  background: #effbe9;
  box-shadow:
    inset 0 0 0 3px #b4e8a0,
    0 4px 0 #9fd68b;
}
.bin b {
  font-size: 18px;
}
.bin .got {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}
.bin .got i {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  animation: pop 0.3s;
}
.bin.bump {
  animation: pop 0.3s;
}
.answer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 8px;
  min-height: 66px;
  padding: 10px;
  border-radius: 18px;
  border: 3px dashed #cfc2ea;
  background: #faf7ff;
}
.answer.tight {
  gap: 3px;
}
.answer.good {
  border: 3px solid var(--ok);
  background: #e6fbee;
}
.answer.badrow {
  border: 3px solid var(--bad);
  background: #fff0f0;
}
.answer.fixed {
  margin-top: 8px;
  border: 3px solid var(--ok);
  background: #e6fbee;
}
.answer .hint {
  color: #a79bc9;
  font-weight: 700;
}
.pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  margin-top: 14px;
}
.tile {
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f2ecff);
  box-shadow:
    inset 0 0 0 2.5px #d9cdf3,
    0 4px 0 #c4b3e6;
  font-weight: 800;
  font-size: 21px;
  animation: pop 0.25s;
}
.tile.in {
  background: linear-gradient(180deg, #e9f3ff, #d6e8ff);
  box-shadow:
    inset 0 0 0 2.5px #9cc3f5,
    0 4px 0 #8fb3e3;
}
span.tile {
  display: inline-block;
}
.check {
  display: block;
  margin: 14px auto 0;
  padding: 10px 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5be08a, #1fb45a);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 0 #128a42;
  animation: pop 0.3s;
}
.pairs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pcol {
  display: grid;
  gap: 9px;
}
.pc {
  min-height: 52px;
  padding: 8px 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    inset 0 0 0 2.5px #e3d9f3,
    0 4px 0 #d3c4ea;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.1;
  transition: transform 0.12s;
}
.pc.sel {
  background: #fff6cc;
  box-shadow:
    inset 0 0 0 3px #f0b400,
    0 4px 0 #e6cc6b;
  transform: scale(1.04);
}
.pc.done {
  animation: pop 0.3s;
  color: #fff;
}
.pc.h0 {
  background: #4caf50;
  box-shadow: 0 4px 0 #2e7d32;
}
.pc.h1 {
  background: #2f7fe8;
  box-shadow: 0 4px 0 #1b5bb0;
}
.pc.h2 {
  background: #ff7a3d;
  box-shadow: 0 4px 0 #c9541b;
}
.pc.h3 {
  background: #a35ce8;
  box-shadow: 0 4px 0 #7536b3;
}
.pc.h4,
.pc.h5 {
  background: #e83e8c;
  box-shadow: 0 4px 0 #b02066;
}
.praise {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--ok);
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  white-space: nowrap;
  box-shadow: 0 5px 0 #128a42;
  pointer-events: none;
  animation: praise 0.95s both;
}
@keyframes praise {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }
  25% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -110%) scale(1);
    opacity: 0;
  }
}
.reveal-toast {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #e6fbee;
  color: #0b6b31;
  font-weight: 800;
  text-align: center;
  animation: pop 0.3s;
}
.streak {
  align-self: center;
  width: auto !important;
  margin-top: 12px;
  padding: 4px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb347, #ff6a00);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 3px 0 #c44f00;
}
.streak.pulse {
  animation: pop 0.35s;
}

/* ---------- Overlays ---------- */
.ov {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(14, 6, 50, 0.55);
  animation: fade 0.25s;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.ov .rays {
  top: 50%;
  opacity: 0.8;
}
.panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 16px 18px 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #f6f0ff);
  box-shadow: 0 8px 0 rgba(20, 0, 60, 0.3);
  text-align: center;
  animation: pop 0.35s;
}
.panel .owl {
  width: 96px;
  height: 100px;
  margin: -64px auto 0;
  filter: drop-shadow(0 6px 6px rgba(20, 0, 60, 0.3));
}
.ov.win,
.ov.lose,
.ov.intro {
  padding-top: 70px;
}
.panel h2 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.1;
}
.panel .sub {
  margin: 4px 0 6px;
  font-weight: 700;
  color: #7a6fa0;
}
.panel p {
  font-weight: 600;
  line-height: 1.3;
}
.panel .rule {
  padding: 10px 12px;
  border-radius: 16px;
  background: #f1ecff;
  color: #3b2f7a;
  text-align: left;
}
.bigstars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 4px 0;
}
.bigstars i {
  font-style: normal;
  font-size: 58px;
  line-height: 1;
  color: #e3dcef;
}
.bigstars i.on {
  color: var(--gold);
  text-shadow: 0 4px 0 #c98a00;
  animation: starIn 0.5s both;
}
@keyframes starIn {
  0% {
    transform: scale(0) rotate(-90deg);
  }
  70% {
    transform: scale(1.3) rotate(10deg);
  }
  100% {
    transform: scale(1);
  }
}
.facts {
  margin: 4px 0 12px;
  color: #5a4f86;
}
.acts {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  flex: 1 1 0;
  min-width: 96px;
  white-space: nowrap;
  padding: 11px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, #5be08a, #1fb45a);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 4px 0 #128a42;
}
.btn.ghost {
  background: #efeaff;
  color: var(--ink);
  box-shadow: 0 4px 0 #d3c4ea;
}
.btn:active {
  transform: translateY(3px);
}
.sheet {
  place-items: end center;
  padding: 0;
  background: rgba(14, 6, 50, 0.4);
}
.sheet-box {
  width: 100%;
  max-width: 560px;
  padding: 16px 18px max(18px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -6px 24px rgba(20, 0, 60, 0.25);
  animation: up 0.3s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes up {
  from {
    transform: translateY(100%);
  }
}
.sh-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sh-head .owl {
  width: 52px;
  height: 54px;
}
.sh-head b {
  font-size: 26px;
  color: #e0532c;
}
.sh-ans {
  margin: 8px 0;
  font-size: 18px;
  font-weight: 600;
}
.sh-ans b {
  color: #0b6b31;
}
.sh-why {
  margin: 0 0 8px;
  font-weight: 700;
  color: #7a4a00;
}
.sh-rule {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f1ecff;
  color: #3b2f7a;
  font-weight: 600;
  line-height: 1.3;
}
.sh-go {
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #5be08a, #1fb45a);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 0 #128a42;
}
.round-card {
  position: relative;
  padding: 18px 30px 22px;
  border-radius: 28px;
  background: #fff;
  text-align: center;
  box-shadow: 0 8px 0 rgba(20, 0, 60, 0.3);
  animation: pop 0.4s;
}
.round-card .owl {
  width: 80px;
  height: 84px;
  margin: 0 auto;
}
.round-card .r {
  font-weight: 800;
  font-size: 30px;
  color: var(--c1);
}
.round-card .w {
  font-weight: 700;
  font-size: 19px;
  color: #6a5f96;
}
.confetti {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: conf 1.3s ease-out both;
}
@keyframes conf {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), calc(var(--dy) + 260px)) rotate(var(--r));
    opacity: 0;
  }
}

/* Short phones */
@media (max-height: 640px) {
  .tilde,
  .tilde .owl {
    width: 54px;
    height: 56px;
  }
  .q {
    font-size: 17px;
  }
  .sentence.word,
  .big-word {
    font-size: 34px;
  }
}
@media (max-width: 360px) {
  .q {
    font-size: 17px;
  }
  .chips {
    font-size: 20px;
  }
  .opt {
    font-size: 17px;
  }
  .pc {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
