/*
 * Interface limpa herdada do Little Ninja Dash ("extremamente clean, parecida com Clash of Clans"):
 * painéis claros e lisos, botões gordinhos com volume, verde para seguir, placar em pílulas.
 */
:root {
  --ink: #1b2437;
  --paper: #eef2f8;
  --blue: #2f86f6;
  --blue-d: #1a5bd0;
  --gold: #ffc83a;
  --green: #62cf33;
  --green-d: #2f9416;
  --lip: #a9b6cd;
  --ui: 'Fredoka', system-ui, sans-serif;
  --head: 'Lilita One', 'Fredoka', system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #9fd8e8;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  position: fixed;
  inset: 0;
  font-family: var(--ui);
  color: var(--ink);
}
#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
}
#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#ui button,
#ui input,
#ui select {
  pointer-events: auto;
  font-family: var(--ui);
}
svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(#ffffff, #dfe6f1);
  box-shadow:
    inset 0 -4px 0 #c3cee0,
    0 3px 0 var(--lip),
    0 6px 14px rgba(10, 20, 45, 0.18);
  cursor: pointer;
  transition: transform 0.08s;
}
.btn:active {
  transform: translateY(2px) scale(0.98);
}
.btn.green {
  color: #fff;
  background: linear-gradient(#2b8419, #246f14);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -5px 0 #1a5410,
    0 3px 0 #123d0b,
    0 8px 18px rgba(20, 70, 10, 0.3);
  text-shadow: 0 2px 0 rgba(0, 40, 0, 0.45);
}
.btn.big {
  min-height: 60px;
  font-size: 24px;
  padding: 0 34px;
}
.btn svg {
  width: 22px;
  height: 22px;
}
.row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.ibtn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(#49647e, #2c4662 48%, #243c55);
  box-shadow:
    inset 0 0 0 2px rgba(210, 230, 231, 0.32),
    inset 0 3px 0 rgba(230, 242, 236, 0.14),
    0 3px 0 #142844;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ibtn svg {
  width: 24px;
  height: 24px;
}

/* ---------- título ---------- */
.title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vh, 16px);
  padding: var(--safe-top, env(safe-area-inset-top)) 16px
    var(--safe-bottom, env(safe-area-inset-bottom));
  pointer-events: auto;
  background: linear-gradient(
    rgba(16, 26, 48, 0.2),
    rgba(16, 26, 48, 0.62) 30%,
    rgba(16, 26, 48, 0.62) 70%,
    rgba(16, 26, 48, 0.25)
  );
}
.title[hidden] {
  display: none;
}
.logo-img {
  display: block;
  width: min(620px, 86vw);
  height: auto;
  max-height: 26vh;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px #092e3c66);
  animation: logo-in 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.logo {
  position: relative;
  isolation: isolate;
}
.less-motion .logo-img,
.less-motion .tap,
.less-motion .title .menu,
.less-motion .stars span.on svg,
.less-motion .big-stars span.on svg {
  animation: none;
}
@keyframes bolt {
  0%,
  86%,
  100% {
    transform: none;
  }
  90% {
    transform: translateY(-4px) rotate(-8deg) scale(1.08);
  }
}
@keyframes logo-in {
  from {
    transform: rotate(-3deg) scale(0.4);
    opacity: 0;
  }
}
.tagline {
  margin: 0;
  font-family: var(--head);
  font-size: clamp(16px, 3.2vw, 24px);
  color: #fff;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
  text-align: center;
}
.tap {
  margin: clamp(10px, 4vh, 40px) 0 0;
  font-family: var(--head);
  font-size: clamp(20px, 4vw, 30px);
  color: #fff;
  padding: 8px 22px;
  border-radius: 999px;
  background: rgba(30, 42, 68, 0.85);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14);
  text-shadow: none;
  animation: tap 1.3s ease-in-out infinite;
}
@keyframes tap {
  50% {
    transform: scale(1.04);
  }
}
.title .menu {
  display: none;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: clamp(8px, 3vh, 30px);
}
.title.ready .tap {
  display: none;
}
.title.ready .menu {
  display: flex;
  animation: pop 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.title.arming .menu {
  pointer-events: none;
}
@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

/* ---------- placar ---------- */
/* em pé: pausa | nome | reiniciar na primeira linha; lances e estrelas centrados na segunda */
.hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: none;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) 48px;
  grid-template-areas: 'pause name name restart' 'moves moves stars stars';
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  padding: calc(var(--safe-top, env(safe-area-inset-top)) + 10px)
    calc(var(--safe-right, env(safe-area-inset-right)) + 12px) 0
    calc(var(--safe-left, env(safe-area-inset-left)) + 12px);
}
.hud.on {
  display: grid;
}
.hud-l,
.hud-r {
  display: contents;
}
.hud .pause {
  grid-area: pause;
}
.hud .restart {
  grid-area: restart;
}
.hud-name {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  font-family: var(--head);
  line-height: 1.1;
  color: #fff;
  -webkit-text-stroke: 3px #204e4e;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
}
.hud-name span {
  white-space: nowrap;
  font-size: 20px;
}
/* as duas pílulas do mesmo tamanho, encostadas no meio: o par fica centrado */
.hud .moves {
  grid-area: moves;
  justify-self: end;
}
.hud .stars {
  grid-area: stars;
  justify-self: start;
}
.hud .pill {
  min-width: 132px;
  justify-content: center;
}
.moves .mv svg {
  display: block;
  width: 22px;
  height: 22px;
  opacity: 0.85;
}
.pill {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(#426f6a, #285650 48%, #204742);
  box-shadow:
    inset 0 0 0 2px rgba(210, 230, 231, 0.32),
    inset 0 3px 0 rgba(230, 242, 236, 0.14),
    0 3px 0 #142844;
  font-weight: 700;
}

.moves b {
  font-size: 22px;
  min-width: 1.2em;
  text-align: center;
}
.moves i {
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  padding-left: 9px;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--gold);
  font-size: 16px;
}
.moves i svg {
  width: 18px;
  height: 18px;
}
.stars {
  padding: 0 10px;
  gap: 3px;
}
.stars span svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: #45608e;
}
.stars span.on svg {
  fill: var(--gold);
  stroke: #9a6a00;
  stroke-width: 1.2;
  animation: star-slot 0.45s cubic-bezier(0.2, 1.8, 0.4, 1);
}
.star-art-ready .stars span svg,
.star-art-ready .big-stars span svg,
.star-art-ready .mini i svg {
  background: url('./board-star-C998uTm1.webp') center / contain no-repeat;
  filter: grayscale(1) brightness(0.85);
  opacity: 0.35;
}
.star-art-ready .stars span.on svg,
.star-art-ready .big-stars span.on svg,
.star-art-ready .mini i.on svg {
  filter: none;
  opacity: 1;
}
.star-art-ready .stars span svg path,
.star-art-ready .big-stars span svg path,
.star-art-ready .mini i svg path {
  opacity: 0;
}
@keyframes star-slot {
  0% {
    transform: scale(0.4);
  }
  45% {
    transform: scale(1.3);
  }
}

/* deitado e PC: o placar vira duas colunas e o tabuleiro usa a altura toda */
.wide .hud {
  display: none;
  bottom: 0;
  padding: calc(var(--safe-top, env(safe-area-inset-top)) + 12px)
    calc(var(--safe-right, env(safe-area-inset-right)) + 14px)
    calc(var(--safe-bottom, env(safe-area-inset-bottom)) + 12px)
    calc(var(--safe-left, env(safe-area-inset-left)) + 14px);
}
.wide .hud.on {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.wide .hud-l,
.wide .hud-r {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: clamp(180px, 24vw, 300px);
}
.wide .hud-l {
  align-items: flex-start;
}
.wide .hud-r {
  align-items: flex-end;
}
.wide .hud-name {
  text-align: left;
  width: 100%;
}
.wide .hud-name span {
  white-space: normal;
}
.wide .hud .moves,
.wide .hud .stars {
  justify-self: auto;
}

/* ---------- avisos ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom, env(safe-area-inset-bottom)) + 22px);
  transform: translate(-50%, 20px);
  width: max-content;
  max-width: min(600px, 92vw);
  text-wrap: balance;
  padding: 10px 18px;
  border-radius: 16px;
  background: rgba(16, 26, 48, 0.72);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.wide .toast {
  left: auto;
  right: calc(var(--safe-right, env(safe-area-inset-right)) + 14px);
  bottom: calc(var(--safe-bottom, env(safe-area-inset-bottom)) + 14px);
  max-width: clamp(180px, 24vw, 300px);
  transform: translate(0, 20px);
  font-size: 14px;
  text-align: left;
}
.wide .toast.on {
  transform: none;
}
.wide .guide {
  left: calc(var(--safe-left, env(safe-area-inset-left)) + 14px + clamp(180px, 24vw, 300px) / 2);
  bottom: calc(var(--safe-bottom, env(safe-area-inset-bottom)) + 20px);
  font-size: 16px;
  text-align: center;
  max-width: clamp(180px, 24vw, 300px);
}
.guide {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom, env(safe-area-inset-bottom)) + 76px);
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-family: var(--head);
  font-size: 20px;
  text-shadow: 0 2px 0 var(--ink);
}
.guide.on {
  display: flex;
}
.guide p {
  margin: 0;
}
.hand {
  position: absolute;
  left: var(--hx, 50%);
  top: var(--hy, 50%);
  display: none;
  pointer-events: none;
}
.hand.on {
  display: block;
}
#ui.menu .hand {
  display: none;
}
.hand svg {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 3px 0 rgba(27, 36, 55, 0.35));
  animation: swipe 1.5s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}
/* o dedo nasce em cima do ninja e arrasta para a direita (o primeiro lance da fase 1) */
@keyframes swipe {
  0% {
    transform: translate(-10px, 6px) scale(1);
    opacity: 0;
  }
  15% {
    transform: translate(-10px, 6px) scale(0.9);
    opacity: 1;
  }
  65% {
    transform: translate(90px, 6px) scale(0.9);
    opacity: 1;
  }
  85%,
  100% {
    transform: translate(90px, 6px) scale(1);
    opacity: 0;
  }
}
.guide kbd {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 2px;
  border-radius: 8px;
  background: linear-gradient(#fff, #dfe6f1);
  box-shadow:
    inset 0 -3px 0 #c3cee0,
    0 2px 0 var(--lip);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  text-shadow: none;
}
.audio-fix {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 6px 0 var(--lip);
}

/* ---------- janelas ---------- */
.sheet {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top, env(safe-area-inset-top)) + 12px)
    calc(var(--safe-right, env(safe-area-inset-right)) + 16px)
    calc(var(--safe-bottom, env(safe-area-inset-bottom)) + 12px)
    calc(var(--safe-left, env(safe-area-inset-left)) + 16px);
  background: rgba(12, 20, 40, 0.5);
  pointer-events: auto;
}
.sheet.open {
  display: flex;
  animation: fade 0.2s both;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.card {
  width: min(460px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow:
    inset 0 0 0 3px #fff,
    0 6px 0 var(--lip),
    0 16px 32px rgba(10, 20, 45, 0.4);
  animation: pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.head {
  padding: 8px 16px;
  border-radius: 16px;
  background: linear-gradient(#4f9eff, #2a73e8);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    0 3px 0 #1a55b8;
}
.head h2 {
  margin: 0;
  font-family: var(--head);
  font-weight: 400;
  font-size: 24px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(10, 40, 100, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 6px 6px;
  min-height: 0;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.actions .row .btn {
  flex: 1;
}
.opts {
  display: grid;
  gap: 8px;
}
.opt {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) 1.6fr;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}
.opt.check input {
  justify-self: start;
  width: 26px;
  height: 26px;
  accent-color: var(--green);
}
.opt input[type='range'] {
  width: 100%;
  accent-color: var(--blue);
}
.opt select {
  min-height: 40px;
  border-radius: 12px;
  border: 2px solid #c3cee0;
  background: #fff;
  font-size: 16px;
  padding: 0 8px;
  color: var(--ink);
}
.seg {
  display: flex;
  border-radius: 12px;
  background: #d9e1ee;
  padding: 3px;
  gap: 3px;
}
.seg button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.seg button.on {
  background: #fff;
  box-shadow: 0 2px 0 #c3cee0;
}
.world {
  margin: 0;
  text-align: center;
  font-weight: 600;
  color: #4a5670;
}
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(#ffffff, #e3eaf5);
  box-shadow:
    inset 0 -4px 0 #c3cee0,
    0 3px 0 var(--lip);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--ink);
}
.journey-grid {
  position: relative;
  padding: 14px 8px;
  gap: 24px 10px;
  isolation: isolate;
}
.journey-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: visible;
}
.journey-path path {
  fill: none;
  stroke: #83a986;
  stroke-width: 6;
  stroke-dasharray: 3 9;
  stroke-linecap: round;
}
.journey-grid .tile:nth-of-type(6) {
  grid-column: 5;
  grid-row: 2;
}
.journey-grid .tile:nth-of-type(7) {
  grid-column: 4;
  grid-row: 2;
}
.journey-grid .tile:nth-of-type(8) {
  grid-column: 3;
  grid-row: 2;
}
.journey-grid .tile:nth-of-type(9) {
  grid-column: 2;
  grid-row: 2;
}
.journey-grid .tile:nth-of-type(10) {
  grid-column: 1;
  grid-row: 2;
}
@media (orientation: portrait) {
  .hud {
    row-gap: 5px;
  }
  .hud .pill {
    height: 36px;
    min-width: 122px;
  }
  .hud .pill.moves b {
    font-size: 20px;
  }
}
.tile b {
  font-family: var(--head);
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
}
.tile.full {
  background: linear-gradient(#fff6d6, #ffe08a);
  box-shadow:
    inset 0 -4px 0 #e6b84a,
    0 3px 0 #c7962a;
}
.tile.locked {
  background: #d3dbe8;
  box-shadow: inset 0 -4px 0 #b9c4d6;
  color: #8592ab;
  cursor: default;
}
.tile.locked svg {
  width: 26px;
  height: 26px;
}
.mini {
  display: flex;
}
.mini i svg {
  width: 14px;
  height: 14px;
  fill: #b9c4d6;
}
.mini i.on svg {
  fill: var(--gold);
}
.medal {
  position: absolute;
  top: -6px;
  right: -6px;
  color: #e9a514;
}
.medal svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}
.big-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
}
.big-stars span svg {
  width: clamp(54px, 14vw, 76px);
  height: clamp(54px, 14vw, 76px);
  fill: #c9d2e2;
}
.big-stars span:nth-child(2) svg {
  transform: translateY(-12px);
}
.big-stars span.on svg {
  fill: var(--gold);
  stroke: #9a6a00;
  stroke-width: 1;
  animation: star-in 0.45s cubic-bezier(0.2, 1.8, 0.4, 1) both;
  animation-delay: calc(0.25s + var(--i) * 0.28s);
}
.big-stars span:nth-child(2).on svg {
  animation-name: star-in-up;
}
@keyframes star-in {
  from {
    transform: scale(0) rotate(-40deg);
  }
}
@keyframes star-in-up {
  from {
    transform: translateY(-12px) scale(0) rotate(-40deg);
  }
  to {
    transform: translateY(-12px);
  }
}
.moves-line {
  text-align: center;
  font-size: 22px;
}
.master {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #dfe6f1;
  color: #4a5068;
  font-weight: 700;
}
.master svg {
  width: 26px;
  height: 26px;
}
.master.won {
  background: linear-gradient(#fff3c4, #ffd76a);
  color: #7a4a00;
  box-shadow: 0 3px 0 #d9a632;
  animation: pop 0.4s 1.2s cubic-bezier(0.2, 1.8, 0.4, 1) both;
}
.master.won svg {
  color: #e9a514;
}
.skins-grid {
  grid-template-columns: repeat(4, 1fr);
}
.skin {
  border: 0;
  border-radius: 16px;
  padding: 6px 4px;
  background: linear-gradient(#ffffff, #e3eaf5);
  box-shadow:
    inset 0 -4px 0 #c3cee0,
    0 3px 0 var(--lip);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}
.skin canvas {
  width: 100%;
  aspect-ratio: 1;
}
.skin.on {
  box-shadow:
    inset 0 0 0 3px var(--green),
    inset 0 -4px 0 #c3cee0,
    0 3px 0 var(--lip);
}
.skin.locked canvas {
  filter: grayscale(1) brightness(0.6);
  opacity: 0.6;
}
.inline-star svg {
  width: 16px;
  height: 16px;
  fill: var(--gold);
  vertical-align: -2px;
}

/* telas baixas (celular deitado): tudo mais compacto */
@media (max-height: 460px) {
  .card {
    width: min(620px, 100%);
  }
  .head h2 {
    font-size: 20px;
  }
  .body {
    gap: 8px;
    padding-top: 8px;
  }
  .btn.big {
    min-height: 50px;
    font-size: 20px;
  }
  .grid {
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
  }
  .skins-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  .opts {
    grid-template-columns: 1fr 1fr;
  }
  .opt {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  /* deitado: os quatro botões em grade 2x2, centrados e dentro da área segura */
  .pause .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: min(520px, 100%);
  }
}

/* ---------- telas soltas (sem cartão): pausa, fases, resultado, roupas ---------- */
.sheet.stage {
  flex-direction: column;
  gap: clamp(8px, 2vh, 16px);
  background: radial-gradient(ellipse at 50% 45%, rgba(12, 20, 40, 0.5), rgba(12, 20, 40, 0.72));
  overflow: hidden;
}
.stage-title {
  margin: 0;
  font-family: var(--head);
  font-weight: 400;
  font-size: clamp(30px, 8vw, 46px);
  color: #fff;
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
  text-align: center;
  line-height: 1.05;
}
.stage-title.small {
  font-size: clamp(20px, 5.4vw, 28px);
  -webkit-text-stroke: 5px var(--ink);
}
.stage-sub {
  margin: -4px 0 0;
  max-width: 340px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  text-shadow:
    0 2px 0 var(--ink),
    0 0 8px rgba(12, 20, 40, 0.8);
}
.stage .actions {
  width: min(320px, 86vw);
}
.stage .btn.back {
  min-width: 160px;
}
.pause .actions .btn {
  width: 100%;
}

/* fases: placas de pedra com musgo, a próxima pulsa */
.levels .grid {
  width: min(400px, 92vw);
  gap: 12px;
}
.levels .tile {
  background: linear-gradient(#a3a6bd, #8f92aa);
  box-shadow:
    inset 0 5px 0 #6fbf55,
    inset 0 -5px 0 #6c6f8a,
    0 0 0 3px #3d3f56,
    0 5px 0 #3d3f56,
    0 8px 14px rgba(0, 0, 0, 0.3);
  border-radius: 14px;
  color: #fff;
}
.levels .tile b {
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}
.levels .tile .mini i svg {
  fill: #5f6280;
}
.levels .tile .mini i.on svg {
  fill: var(--gold);
}
.levels .tile.full {
  background: linear-gradient(#ffe48a, #f2b632);
  box-shadow:
    inset 0 5px 0 #fff3b0,
    inset 0 -5px 0 #c98a14,
    0 0 0 3px #7a4a00,
    0 5px 0 #7a4a00,
    0 8px 14px rgba(0, 0, 0, 0.3);
}
.levels .tile.locked {
  background: #5f6280;
  box-shadow:
    0 0 0 3px #3d3f56,
    0 5px 0 #3d3f56;
  color: #a9acc4;
}
.levels .tile.next {
  animation: next-pulse 1.2s ease-in-out infinite;
}
@keyframes next-pulse {
  50% {
    transform: scale(1.06);
  }
}

/* resultado */
.result .hero-cheer {
  width: 180px;
  height: 150px;
  margin: -6px 0 -10px;
  animation: pop 0.45s 0.1s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.result .big-stars span svg {
  width: clamp(64px, 18vw, 88px);
  height: clamp(64px, 18vw, 88px);
  fill: rgba(255, 255, 255, 0.18);
  filter: drop-shadow(0 4px 0 rgba(12, 20, 40, 0.6));
}
.score-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 14px;
}
.moves-big {
  font-family: var(--head);
  font-weight: 400;
  font-size: 30px;
  color: #fff;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
}
.result .master {
  background: rgba(255, 255, 255, 0.92);
}

/* ajustes */
.switch {
  justify-self: start;
  width: 56px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #c3cee0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.switch i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.15s;
}
.switch.on {
  background: #2b8419;
}
.switch.on i {
  transform: translateX(22px);
}
.lang-btn {
  justify-self: stretch;
  min-height: 42px;
  font-size: 16px;
}
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.lang {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 -3px 0 #c3cee0;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.lang.on {
  background: #2b8419;
  color: #fff;
  box-shadow: inset 0 -3px 0 #1a5410;
}

/* roupas: 3x3 em pé, 5+4 deitado */
.skins .skins-grid {
  grid-template-columns: repeat(3, 1fr);
  width: min(360px, 90vw);
  gap: 10px;
}
.skins .skin {
  position: relative;
  font-size: 13px;
}
.skins .skin span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.skins .skin span svg {
  width: 14px;
  height: 14px;
  fill: var(--gold);
}
.skins .skin .badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: #2b8419;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
}
@media (max-height: 460px) {
  .stage-title {
    font-size: 30px;
  }
  .levels .grid {
    width: min(640px, 80vw);
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
  .levels .tile {
    aspect-ratio: 1.4;
  }
  .skins .skins-grid {
    grid-template-columns: repeat(5, 1fr);
    width: min(560px, 80vw);
    justify-items: stretch;
  }
  .skins .skin canvas {
    width: 70%;
  }
  .result {
    display: grid !important;
    grid-template-columns: auto auto;
    grid-template-areas: 'title title' 'stars hero' 'score hero' 'actions actions';
    justify-content: center;
    align-content: center;
    column-gap: 24px;
  }
  .result .stage-title {
    grid-area: title;
  }
  .result .big-stars {
    grid-area: stars;
  }
  .result .hero-cheer {
    grid-area: hero;
  }
  .result .score-row {
    grid-area: score;
  }
  .result .actions {
    grid-area: actions;
    justify-self: center;
    flex-direction: row;
    width: auto;
  }
  .result .actions .btn.big {
    min-width: 220px;
  }
}
.result .big-stars span.on svg {
  fill: var(--gold);
}

/* ---------- rodada 2 do crítico ---------- */
.stage-title,
.hud-name,
.moves-big {
  letter-spacing: 0.02em;
}
.guide p {
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(30, 42, 68, 0.85);
  text-shadow: none;
}
.result .hero-cheer {
  width: 170px;
  height: 191px;
}
.sheet.stage.result {
  background: radial-gradient(ellipse at 50% 45%, rgba(12, 20, 40, 0.72), rgba(12, 20, 40, 0.86));
}
/* ajustes soltos: rótulos brancos sobre o escuro, escolha sempre em verde */
.settings .opts {
  width: min(400px, 86vw);
  gap: 12px;
}
.settings .opt {
  color: #fff;
  text-shadow: 0 2px 0 var(--ink);
  font-size: 17px;
}
.settings .actions,
.settings > .btn {
  width: min(320px, 86vw);
}
.seg {
  background: rgba(255, 255, 255, 0.92);
}
.seg button.on {
  background: #246f14;
  color: #fff;
  box-shadow: inset 0 -3px 0 #1a5410;
}
.langs .lang-grid {
  width: min(400px, 92vw);
}
.lang {
  font-family:
    var(--ui), 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', 'Hiragino Maru Gothic ProN',
    'Malgun Gothic', 'Microsoft YaHei', sans-serif;
}
@media (max-height: 460px) {
  .langs .lang-grid {
    grid-template-columns: repeat(3, 1fr);
    width: min(560px, 80vw);
  }
  .langs .lang {
    min-height: 40px;
  }
  .sheet.stage {
    gap: 8px;
  }
  .settings .opts {
    grid-template-columns: 1fr 1fr;
    width: min(640px, 86vw);
  }
  .settings .opt {
    grid-template-columns: 1fr;
  }
  .stage-title {
    font-size: 26px;
  }
}

/* ---------- rodada 3 do crítico ---------- */
/* janela aberta: o placar some e o jogo vira textura (escuro e desfocado), nada por trás do texto */
#ui.menu .hud {
  opacity: 0;
  pointer-events: none;
}
.hud {
  transition: opacity 0.15s;
}
.sheet.stage {
  background: rgba(12, 20, 40, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.toast {
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.stage-sub {
  text-wrap: balance;
}
.settings .opt {
  grid-template-columns: minmax(120px, 1fr) 1.5fr;
  min-height: 44px;
}
.lang {
  font-weight: 800;
}
/* fases: fechada escura com cadeado; a próxima com borda dourada (lê na foto parada, não só no pulso) */
.levels .tile.next {
  box-shadow:
    inset 0 5px 0 #6fbf55,
    inset 0 -5px 0 #6c6f8a,
    0 0 0 3px #ffc83a,
    0 0 0 6px #3d3f56,
    0 8px 0 #3d3f56,
    0 0 22px rgba(255, 200, 58, 0.55);
}
.levels .tile.locked {
  background: #4a4d66;
  color: #c9cce0;
}
.levels .tile.locked svg {
  width: 28px;
  height: 28px;
}
/* PC e tela grande deitada: placar e aviso no tamanho de quem joga de longe */
@media (min-height: 600px) {
  .wide .ibtn {
    width: 56px;
    height: 56px;
  }
  .wide .hud-name span {
    font-size: 22px !important;
  }
  .wide .moves b {
    font-size: 24px;
  }
  .wide .pill {
    height: 48px;
  }
  .wide .toast {
    font-size: 16px;
    max-width: 300px;
  }
  .wide .guide {
    font-size: 18px;
  }
}
#ui.menu .toast,
#ui.menu .guide {
  opacity: 0;
}

/* ---------- rodada 4 do crítico: menus claros (o escuro genérico foi rejeitado), vitória luminosa ---------- */
.sheet.stage {
  background: rgba(246, 240, 227, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.sheet.stage .stage-title {
  color: #1e2a44;
  -webkit-text-stroke: 0;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.9);
}
.sheet.stage .stage-sub {
  color: #1e2a44;
  text-shadow: none;
}
.sheet.stage .btn:not(.green) {
  box-shadow:
    inset 0 0 0 2px #c9cfdd,
    inset 0 -4px 0 #c3cee0,
    0 3px 0 var(--lip),
    0 6px 14px rgba(10, 20, 45, 0.14);
}
.settings .opt {
  color: #1e2a44;
  text-shadow: none;
}
.seg {
  box-shadow: inset 0 0 0 2px #c9cfdd;
}
.switch {
  box-shadow: inset 0 0 0 2px #b3bdd0;
}
.lang {
  box-shadow:
    inset 0 0 0 2px #c9cfdd,
    inset 0 -3px 0 #c3cee0;
}
/* resultado: véu azul a 55% e luz dourada atrás das estrelas e do ninja */
.sheet.stage.result {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 212, 106, 0.35) 0, rgba(255, 212, 106, 0) 210px),
    rgba(30, 42, 68, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sheet.stage.result .stage-title {
  color: #fff;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
}
.toast {
  transition:
    opacity 0.12s,
    transform 0.12s;
}

/* ---------- rodada 5 do crítico ---------- */
/* Neutral mist carries the result; warm color stays on the rewards. */
.sheet.stage.result {
  background: rgba(30, 42, 68, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  isolation: isolate;
}
.sheet.stage.result::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(214, 238, 229, 0.52) 0,
    rgba(187, 214, 219, 0.14) 150px,
    rgba(187, 214, 219, 0) 280px
  );
  mix-blend-mode: screen;
  pointer-events: none;
}
.moves-big {
  padding: 2px 16px 4px;
  border-radius: 999px;
  background: rgba(30, 42, 68, 0.7);
}
.settings .opt {
  grid-template-columns: 150px 1fr;
}
.safe-probe {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  top: 0;
  left: 0;
  width: var(--safe-left, env(safe-area-inset-left));
  height: var(--safe-bottom, env(safe-area-inset-bottom));
}

/* ---------- rodada 6 do crítico ---------- */
.levels .grid {
  width: min(400px, 100%);
  gap: 8px;
}
@media (max-height: 460px) {
  .skins .skins-grid {
    gap: 8px;
  }
  .skins .skin {
    padding: 4px;
  }
  .skins .skin canvas {
    width: 58%;
  }
  .skins .stage-sub:first-of-type {
    display: none;
  }
}

/* ---------- rodada 7 (polimento opcional) ---------- */
@media (max-width: 460px) {
  .sheet.stage.levels {
    padding-left: calc(var(--safe-left, env(safe-area-inset-left)) + 16px);
    padding-right: calc(var(--safe-right, env(safe-area-inset-right)) + 16px);
  }
  .levels .grid {
    gap: 6px;
  }
}
@media (min-height: 600px) and (min-width: 900px) {
  .skins .skins-grid {
    width: min(560px, 80vw);
    grid-template-columns: repeat(5, 1fr);
  }
  .skins .skin {
    font-size: 15px;
  }
  .stage-sub {
    font-size: 18px;
    max-width: 480px;
  }
}

.guide p {
  white-space: nowrap;
}

/* ---------- idiomas longos e telas pequenas ---------- */
/* ajustes: a coluna de controles pode encolher; rótulo quebra antes de empurrar a tela */
.settings .opt {
  grid-template-columns: minmax(84px, 38%) minmax(0, 1fr);
}
.seg button {
  min-width: 0;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 380px) {
  .seg button {
    font-size: 12px;
  }
  .settings .opt {
    font-size: 15px;
  }
  .toast {
    font-size: 14px;
    padding: 8px 14px;
  }
}
/* cirílico, japonês, coreano e chinês caem na fonte do sistema: peso forte para não ficar fino */
html:is([lang='ru'], [lang='ja'], [lang='ko'], [lang='zh'])
  :is(.stage-title, .hud-name, .tagline, .tap, .moves-big, .guide, .btn, .tile b) {
  font-family:
    system-ui, 'Segoe UI', 'Hiragino Sans', 'Malgun Gothic', 'Microsoft YaHei', sans-serif;
  font-weight: 800;
}

/* The courtyard route keeps the same ten accessible buttons and saved stage IDs. */
.levels .grid.journey-grid {
  width: min(430px, 100%);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 12px;
}
.sheet.stage.levels {
  background:
    linear-gradient(#183a454a, #102b425e),
    url('./board-world-1-GWbuH5TL.webp') center / cover;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.sheet.stage.levels .stage-title {
  color: #fff7df;
  -webkit-text-stroke: 4px #234f4b;
  text-shadow: 0 3px 0 #234f4b;
}
.sheet.stage.levels .stage-sub {
  color: #fff7df;
  text-shadow: 0 2px 2px #173b38;
}
.journey-path {
  filter: drop-shadow(0 2px 0 #22554b);
}
.journey-path path {
  stroke: #fff3c8;
}
.route-lock {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5f0df;
  box-shadow: 0 2px 0 #497b68;
}
.levels .tile.locked .route-lock svg {
  width: 15px;
  height: 15px;
}
.levels .journey-grid .tile {
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(#effced, #b8d8c7);
  color: #204c46;
  box-shadow:
    inset 0 2px 0 #fff,
    inset 0 -4px 0 #80ac98,
    0 4px 0 #497b68,
    0 7px 12px #184f4026;
}
.levels .journey-grid .tile b {
  -webkit-text-stroke: 0;
}
.levels .journey-grid .tile.full {
  background: linear-gradient(#fff3bb, #f7c963);
  box-shadow:
    inset 0 2px 0 #fff9d7,
    inset 0 -4px 0 #db9f42,
    0 4px 0 #98733d;
}
.levels .journey-grid .tile.locked {
  background: linear-gradient(#d7e5dc, #a8bfb5);
  color: #5c7a70;
}
@media (max-height: 460px) {
  .levels .grid.journey-grid {
    width: min(340px, 100%);
    gap: 20px 14px;
  }
  .levels .journey-grid .tile b {
    font-size: 22px;
  }
  .levels .journey-grid .tile .mini i svg {
    width: 11px;
    height: 11px;
  }
}

/* Reward ceremony: glass stage, framed star slots and a small lit pedestal. */
.sheet.stage.result {
  gap: 14px;
  background: linear-gradient(#0b35494d, #092e40bb);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.sheet.stage.result::before {
  inset: 18% 5% 28%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #c6ffe23b, #73e0d414 45%, transparent 70%);
  mix-blend-mode: screen;
}
.result .big-stars {
  gap: 14px;
  padding: 14px 0 6px;
}
.result .big-stars > span {
  position: relative;
  isolation: isolate;
}
.result .big-stars > span::before {
  content: '';
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 50%;
  background: linear-gradient(#b8f0df22, #0c344533);
  box-shadow:
    inset 0 0 0 1px #cff4df55,
    0 4px 14px #061c3833;
}
.result .big-stars > span:nth-child(2)::before {
  transform: translateY(-12px);
}
.result .big-stars span svg {
  width: clamp(64px, 18vw, 88px);
  height: clamp(64px, 18vw, 88px);
}
.result .hero-cheer {
  width: 186px;
  height: 186px;
  margin: -6px 0 -2px;
  border-bottom: 2px solid #ddfce17a;
  border-radius: 0 0 50% 50%;
  background: radial-gradient(ellipse 45% 5% at 50% 95%, #f3dab86b, #a2dbc31c 95%, transparent);
}
.result .score-row {
  flex-direction: column;
  gap: 8px;
}
.result .moves-big {
  background: transparent;
  font-size: 28px;
}
.result .master {
  border: 1px solid #d9f8e680;
  box-shadow: 0 4px 14px #061c3833;
}
.result .master.won {
  background: linear-gradient(#fff2be, #e8ba55);
}
.result .actions {
  width: min(330px, 90vw);
}
.result .actions > .btn.big {
  min-height: 54px;
  background: linear-gradient(#398a63, #23644a);
  box-shadow:
    inset 0 2px 0 #b8edc866,
    0 4px 0 #144f3d;
}
.result .actions .row .btn {
  min-height: 44px;
}
.skins .skins-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(460px, 100%);
  gap: 10px;
}
.skins .skin canvas {
  width: min(100%, 72px);
  height: auto;
  aspect-ratio: 1;
}
.skins .skin {
  min-width: 0;
  font-size: 12px;
}
.skins .skin span {
  text-align: center;
  justify-content: center;
}
@media (max-height: 640px) and (orientation: portrait) {
  .sheet.stage.result {
    gap: 8px;
  }
  .result .hero-cheer {
    width: 132px;
    height: 132px;
  }
  .result .big-stars span svg {
    width: 58px;
    height: 58px;
  }
  .result .big-stars {
    padding-top: 8px;
  }
  .result .actions > .btn.big {
    min-height: 46px;
  }
  .skins .skins-grid {
    gap: 8px;
  }
  .skins .skin canvas {
    width: min(100%, 56px);
  }
  .skins .stage-sub {
    font-size: 13px;
  }
}
@media (max-height: 460px) {
  .sheet.stage.result {
    gap: 10px 24px;
  }
  .result .hero-cheer {
    width: 142px;
    height: 142px;
  }
  .result .big-stars span svg {
    width: 56px;
    height: 56px;
  }
  .result .big-stars {
    gap: 10px;
    padding: 10px 0 0;
  }
  .result .score-row {
    gap: 4px;
  }
  .result .moves-big {
    font-size: 24px;
  }
  .result .actions {
    width: auto;
  }
  .result .actions > .btn.big {
    min-height: 44px;
  }
  .skins .skins-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(560px, 100%);
    gap: 8px;
  }
  .skins .skin canvas {
    width: min(100%, 52px);
  }
  .pause .actions .btn.green {
    grid-column: 1 / -1;
  }
}
.world-tabs {
  display: flex;
  gap: 6px;
  width: min(510px, 92vw);
  justify-content: center;
}
.world-tab {
  flex: 1;
  max-width: 170px;
  min-height: 48px;
  padding: 7px;
  border: 1px solid #e4efda55;
  border-radius: 14px;
  background: #163745d9;
  color: #e0ecec;
  font:
    700 12px/1.15 Fredoka,
    system-ui,
    sans-serif;
  cursor: pointer;
}
.world-tab.on {
  color: #2b3e42;
  background: linear-gradient(#fff3bc, #f4c773);
  border-color: #fff5d2;
  box-shadow: 0 3px 0 #8a692e;
}
.world-tab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.sheet.stage.levels[data-region='2'] {
  background-image: linear-gradient(#20234555, #161d4266), url('./board-world-2-BKa-51K4.webp');
}
.sheet.stage.levels[data-region='3'] {
  background-image: linear-gradient(#20234555, #161d4266), url('./board-world-3-nVI60eEX.webp');
}
@media (max-height: 450px) {
  .world-tab {
    min-height: 32px;
    font-size: 11px;
    padding: 4px;
  }
  .world-tabs {
    gap: 4px;
  }
}

/* End of ui.css */

/* End of dist-static/assets/ui-BCTH6nKx.css */
