/* Base layout, HUD, sheets and interface rounds 1 to 3 (imported by styles.css) */
:root {
  --ui: 'Fredoka', system-ui, sans-serif;
  --display: 'Dela Gothic One', 'Fredoka', system-ui, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #bfe6e0;
  font-family: var(--ui);
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  container-type: size;
}

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

/* The interface sits above the canvas: buttons never end up starting the aim. */
#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#ui button,
#ui input,
#ui section {
  pointer-events: auto;
}
[hidden] {
  display: none !important;
}

/* ---------- HUD: ink over the game, no boxes ---------- */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.hud-l {
  display: flex;
  align-items: center;
  line-height: 1;
}
.foes {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sep {
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.32;
  box-shadow: 0 0 0 2px var(--paper-hi);
}
.stars {
  display: flex;
  gap: 2px;
}
.stars svg {
  paint-order: stroke fill;
  transition: fill 0.2s;
}
.score {
  min-width: 3ch;
  display: flex;
  align-items: center;
  gap: 5px;
}
.score svg {
  width: 19px;
  height: 19px;
}
.hud-l {
  transition: opacity 0.16s;
}
/* spike, enemy or hero under the scoreboard: it moves out of the way */
.hud-l.ghost {
  opacity: 0.2;
}
.pulse {
  animation: pulse 0.32s ease-out;
}
@keyframes pulse {
  40% {
    transform: scale(1.28);
  }
}

.chip {
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.chip svg {
  width: 20px;
  height: 20px;
}

.toast,
.badge {
  position: absolute;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  paint-order: stroke fill;
  animation: drop 0.25s ease-out;
}
.badge {
  top: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  font-size: 13px;
  opacity: 0.85;
}
.toast svg {
  width: 22px;
  height: 22px;
}
.toast .flip svg {
  transform: scaleX(-1);
}
@keyframes drop {
  from {
    opacity: 0;
    translate: 0 -8px;
  }
}

/* ---------- title: only the logo and the call to action, over the live game ---------- */
.title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(14px, 9cqh, 90px);
  gap: clamp(4px, 2cqh, 14px);
  cursor: pointer;
}
.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 15cqh, 92px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  display: flex;
  gap: 0.22em;
  align-items: center;
}
/* NINJA cut diagonally by a blade: two slightly offset halves and the blue edge */
.logo .cut {
  position: relative;
  color: transparent;
}
.logo .cut::before,
.logo .cut::after {
  content: attr(data-w);
  position: absolute;
  left: 0;
  top: 0;
  paint-order: stroke fill;
}
.logo .cut i {
  position: absolute;
  border-radius: 0.03em;
}
.logo span:last-child {
  color: var(--paper-hi);
  padding: 0.08em 0.2em 0.12em;
  transform: rotate(-3deg);
}
.premise {
  margin: 0;
  text-align: center;
  paint-order: stroke fill;
}
.tap {
  margin: 0;
  position: absolute;
  bottom: clamp(48px, 16cqh, 120px);
  font-weight: 700;
  font-size: clamp(17px, 5.6cqh, 28px);
}
@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}
.langs button,
.seg button {
  font: 600 14px var(--ui);
  min-width: 46px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--paper-hi);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px 14px 11px 13px;
  cursor: pointer;
}
.langs button.on,
.seg button.on {
  background: var(--ink);
  color: var(--paper-hi);
}

/* ---------- pause and result: sheet of paper with ink ---------- */
.sheet {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
}
.card {
  /* paper with very subtle grain and a thin indigo line inside */
  outline-offset: -9px;
  padding: clamp(12px, 4cqh, 24px) clamp(14px, 3cqw, 28px);
  max-width: min(680px, 96cqw);
  max-height: 96cqh;
}
.pause .card {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(230px, 1fr);
  align-items: center;
}
.pause .side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h2 {
  margin: 0 0 4px;
}
.btn {
  min-height: 48px;
  padding: 0 20px;
  cursor: pointer;
  white-space: nowrap;
}
/* "Continuar" domina a pausa */
.pause #bResume {
  font-size: 21px;
  padding: 0 28px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  font-weight: 600;
  font-size: 16px;
}
/* custom controls, finger-sized: nothing that looks like a browser */
.row input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: min(190px, 36cqw);
  height: 44px;
  background: transparent;
  cursor: pointer;
}
.row input[type='range']::-webkit-slider-runnable-track {
  border-radius: 7px;
}
.row input[type='range']::-moz-range-track {
  height: 8px;
  border-radius: 7px;
}
.row input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  border-radius: 50%;
}
.row input[type='range']::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.row input[type='checkbox'] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  margin: 0;
  border-radius: 18px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.row input[type='checkbox']::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  transition:
    transform 0.15s,
    background 0.15s;
}
.seg {
  display: flex;
}

.result .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: min(420px, 92cqw);
}
.bigstars {
  display: flex;
  gap: 6px;
}
.bigstars svg {
  stroke-width: 1.2;
}
.bigstars svg:nth-child(2) {
  transform: translateY(-10%) scale(1.12);
  animation-delay: 0.18s;
}
.bigstars svg:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes pop {
  from {
    scale: 0.2;
    opacity: 0;
  }
}
.onward {
  margin: 0;
  font-weight: 500;
  font-size: 15px;
  opacity: 0.8;
}
.stats {
  margin: 0;
  display: grid;
  gap: 4px clamp(12px, 4cqw, 30px);
  text-align: center;
}
.stats dt {
  font-weight: 600;
  opacity: 0.7;
}
.stats dd {
  margin: 0;
  font-size: clamp(17px, 6cqh, 24px);
}

/* ---------- portrait on phone: paused view and invitation to rotate ---------- */
/* Full-screen and opaque, above everything (menus and buttons included): the game cannot be played upright, and nothing behind receives touch. */
.rotate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: max(26px, env(safe-area-inset-top)) 24px max(26px, env(safe-area-inset-bottom));
  background: var(--paper);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  font-weight: 700;
  font-size: 22px;
  text-align: center;
}
.rotate p {
  margin: 0;
}
.rotate svg {
  width: 62px;
  height: 62px;
  animation: turn 2.2s ease-in-out infinite;
}
@keyframes turn {
  0%,
  25% {
    rotate: 0deg;
  }
  60%,
  100% {
    rotate: -90deg;
  }
}

.audiofix {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(28, 28, 34, 0.4);
  color: var(--paper-hi);
  font: 700 20px var(--ui);
  cursor: pointer;
}

/* short screens (small phone on its side): same pause, more compact, still no scrolling */
@container (max-height: 360px) {
  .row {
    min-height: 44px;
  }
  .pause #bResume {
    min-height: 52px;
  }
  .card h2 {
    font-size: 22px;
  }
}

@container (max-width: 560px) {
  .pause .card {
    grid-template-columns: 1fr;
  }
  .pause .side {
    grid-row: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .stats {
    grid-template-columns: repeat(2, auto);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tap,
  .rotate svg {
    animation: none;
  }
}

/* ---------- medidor de combo ---------- */
.combo {
  position: absolute;
  top: clamp(8px, 3cqh, 18px);
  translate: -50% 0;
  display: grid;
  pointer-events: none;
}
.combo .x {
  font: 400 clamp(24px, 9cqh, 38px) var(--display);
  color: #fff;
}
.combo .m {
  font: 700 clamp(13px, 4.4cqh, 18px) var(--ui);
  paint-order: stroke fill;
}
.combo .bar {
  grid-column: 1 / -1;
  border-radius: 6px;
  overflow: hidden;
}
.combo .bar i {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- fases e roupas ---------- */
.levels .card,
.skins .card {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.6cqh, 16px);
  width: min(720px, 96cqw);
  max-width: none;
}
.head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.head h2 {
  margin: 0;
  flex: 1;
}
.head .btn {
  font-size: 15px;
}
.total {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 700 17px var(--ui);
}
.total svg {
  width: 20px;
  height: 20px;
  fill: var(--gold);
}
.levels .grid {
  display: grid;
}
.lv,
.sk {
  position: relative;
  font: 600 14px var(--ui);
  color: var(--ink);
  cursor: pointer;
}
.lv {
  grid-template-columns: auto 1fr auto;
  text-align: left;
}
.lv b {
  grid-row: 1 / span 2;
}
.lv .nm {
  overflow: hidden;
  text-overflow: ellipsis;
}
.lv .st {
  display: flex;
  gap: 2px;
}
.lv .st svg {
  stroke-width: 1.5;
}
.lv .gr {
  grid-row: 1 / span 2;
  grid-column: 3;
  font-style: normal;
}
.lv .lock {
  display: none;
  grid-row: 1 / span 2;
  grid-column: 3;
  width: 26px;
  height: 26px;
}
.lv.shut,
.sk.shut {
  cursor: default;
}
.lv.shut .st,
.lv.shut .gr {
  visibility: hidden;
}
.skins .grid {
  display: grid;
  gap: clamp(7px, 2.2cqw, 12px);
}
.sk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 8px;
}
.sk canvas {
  width: 100%;
  max-width: 132px;
  height: auto;
  aspect-ratio: 168 / 150;
  max-height: 34cqh;
}
.sk small {
  font-weight: 700;
  min-height: 15px;
}

/* ---------- resultado: nota de estilo ---------- */
.result .top {
  display: flex;
  align-items: center;
  gap: clamp(12px, 4cqw, 28px);
}
.grade {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.grade small {
  font-weight: 700;
}
.grade b {
  font: 400 clamp(54px, 24cqh, 96px) / 0.95 var(--display);
  paint-order: stroke fill;
}
.result .mid {
  display: flex;
  flex-direction: column;
}
.best {
  margin: 0;
  font-weight: 700;
}
.acts {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.pause .side .btn {
  min-height: 44px;
}

/* the notice sits below the scoreboard and the combo, never over them */
.toast {
  top: clamp(58px, 20cqh, 92px);
  white-space: normal;
  text-align: center;
}

/* ==========================================================================================
   CLEAN INTERFACE. Light, flat panels, chunky buttons with volume (highlight on top, dark lip
   below), green to proceed, neutral for the rest, scoreboard in translucent dark pills. Paper
   grain, crooked outlines and ink are gone. This block comes last and overrides what is above.
   ========================================================================================== */
:root {
  --ink: #1b2437;
  --paper: #eef2f8;
  --paper-hi: #ffffff;
  --blue: #2f86f6;
  --blue-d: #1a5bd0;
  --red: #e5484d;
  --gold: #ffc83a;
  --green: #62cf33;
  --green-d: #2f9416;
  --line: #c3cee0;
  --lip: #a9b6cd;
}

/* ---------- scoreboard: pills ---------- */
.hud-l {
  gap: 7px;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
}
.foes,
.stars,
.score {
  height: 40px;
  padding: 0 13px 0 6px;
  background: rgba(16, 26, 48, 0.56);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14);
}
.stars {
  padding: 0 9px;
  align-items: center;
}
.score {
  font-size: 22px;
  padding-left: 10px;
}
.sep {
  display: none;
}
.foes svg {
  width: 30px;
  height: 30px;
  filter: none;
}
.score svg {
  filter: none;
}
.stars svg {
  width: 24px;
  height: 24px;
}
.stars svg.on {
  fill: var(--gold);
  stroke: #9a6a00;
  stroke-width: 1.4;
}
.chip {
  border: none;
}
.combo .x,
.combo .m {
  font-family: var(--ui);
  font-weight: 700;
  -webkit-text-stroke: 0;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.45),
    0 0 6px rgba(0, 0, 0, 0.35);
}
.combo .bar {
  height: 8px;
  border: none;
  background: rgba(16, 26, 48, 0.56);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14);
}
.combo .bar i {
  background: linear-gradient(#ffe27a, var(--gold));
  border-radius: 6px;
}
.toast,
.badge {
  color: #fff;
  -webkit-text-stroke: 0;
  font-weight: 600;
  font-size: 15px;
}
.toast svg {
  stroke: #fff;
}

/* ---------- panels ---------- */
.sheet {
  background: rgba(12, 20, 40, 0.58);
}
.card {
  background: var(--paper);
  outline: none;
  border: none;
  border-radius: 22px;
  box-shadow:
    inset 0 0 0 3px #fff,
    0 6px 0 var(--lip),
    0 16px 32px rgba(10, 20, 45, 0.4);
}
.card h2 {
  font-family: var(--ui);
  font-weight: 700;
  font-size: clamp(20px, 7cqh, 28px);
  color: var(--ink);
}
.head {
  margin: -4px -4px 0;
  padding: 7px 8px 7px 18px;
  background: linear-gradient(#4f9eff, #2a73e8);
  border-radius: 16px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    0 3px 0 #1a55b8;
}
.head h2 {
  color: #fff;
}
.head .total {
  color: #fff;
  padding: 4px 12px 4px 8px;
  background: rgba(10, 25, 60, 0.35);
  border-radius: 999px;
}
.total svg {
  stroke: #9a6a00;
  stroke-width: 1.4;
}

/* ---------- buttons ---------- */
.btn {
  font: 700 17px var(--ui);
  color: var(--ink);
  background: linear-gradient(#ffffff, #dfe6f2);
  border: none;
  border-radius: 14px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    0 4px 0 var(--lip),
    0 6px 10px rgba(10, 20, 45, 0.22);
}
.btn.primary {
  color: #fff;
  background: linear-gradient(#8be34f, #55c228);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 4px 0 var(--green-d),
    0 6px 10px rgba(10, 20, 45, 0.25);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.chip:active,
.btn:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 1px 0 var(--lip);
}
.seg button {
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}
.seg button.on {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue-d);
}

/* ---------- controles ---------- */
.row input[type='range']::-webkit-slider-runnable-track {
  border: none;
}
.row input[type='range']::-moz-range-track {
  border: none;
}
.row input[type='range']::-moz-range-thumb {
  background: var(--blue);
  border: 3px solid #fff;
}
.row input[type='checkbox'] {
  border: none;
}
.row input[type='checkbox']::after {
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(10, 20, 45, 0.3);
}
.row input[type='checkbox']:checked::after {
  background: #fff;
}

/* ---------- fases e roupas ---------- */
.lv,
.sk {
  background: #fff;
  border: none;
  border-radius: 16px;
  box-shadow:
    0 4px 0 var(--lip),
    0 6px 10px rgba(10, 20, 45, 0.14);
}
.lv b {
  display: grid;
  place-items: center;
  border-radius: 13px;
}
.lv .st svg {
  fill: #dbe2ee;
  stroke: none;
}
.lv .st svg.on {
  fill: var(--gold);
  stroke: #9a6a00;
  stroke-width: 1.4;
}
.lv .gr {
  font: 700 clamp(20px, 7.4cqh, 28px) var(--ui);
  color: #fff;
  background: linear-gradient(#ffd866, #f5a623);
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 0 #c77f0a;
}
.lv .gr:empty {
  display: none;
}
.lv.shut,
.sk.shut {
  background: #dfe5ee;
  box-shadow: none;
  opacity: 1;
}
.lv.shut b {
  background: #b9c3d3;
  box-shadow: none;
}
.lv.shut .nm,
.sk.shut .nm {
  opacity: 0.55;
}
.sk.on {
  background: #eafbe0;
  outline: 3px solid var(--green);
  outline-offset: -3px;
}
.sk small {
  color: #7a869b;
}

/* ---------- resultado ---------- */
.grade b {
  font-family: var(--ui);
  font-weight: 700;
  -webkit-text-stroke: 0;
  rotate: none;
  color: #fff;
  width: 1.25em;
  text-align: center;
  background: linear-gradient(#5aa7ff, #2f7cf0);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    0 5px 0 var(--blue-d);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
  line-height: 1.25;
}
.grade b[data-g='S'] {
  color: #fff;
  background: linear-gradient(#ffd866, #f5a623);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    0 5px 0 #c77f0a;
}
.grade b[data-g='A'] {
  color: #fff;
  background: linear-gradient(#8be34f, #55c228);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    0 5px 0 var(--green-d);
}
.grade b[data-g='D'] {
  color: #fff;
  background: linear-gradient(#b9c3d3, #8d99ad);
  box-shadow: 0 5px 0 #6c788c;
}
.stats {
  padding: 8px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px var(--line);
}
.stats dd {
  font-family: var(--ui);
  font-weight: 700;
}
.bigstars svg {
  fill: #dbe2ee;
  stroke: none;
}
.bigstars svg.on {
  fill: var(--gold);
  stroke: #9a6a00;
  stroke-width: 1;
}
.lv .nm {
  white-space: normal;
  font-size: clamp(12px, 3.9cqh, 14px);
  line-height: 1.1;
}

/* ---------- result with impact: stars hit one by one, the grade enters stamped with rays ---------- */
.bigstars svg.on {
  animation: slam 0.34s cubic-bezier(0.2, 1.5, 0.4, 1) backwards;
  animation-delay: 0.38s;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.18));
}
.bigstars svg.on:nth-child(2) {
  animation-delay: 0.64s;
}
.bigstars svg.on:nth-child(3) {
  animation-delay: 0.9s;
}
@keyframes slam {
  from {
    scale: 3.4;
    rotate: -28deg;
    opacity: 0;
  }
  60% {
    scale: 0.86;
    opacity: 1;
  }
}
.grade {
  position: relative;
  animation: none;
}
.grade small {
  animation: drop 0.2s 1.3s backwards;
}
.grade b {
  position: relative;
  z-index: 1;
  animation: stamp 0.36s cubic-bezier(0.2, 1.3, 0.4, 1) 1.36s backwards;
}
@keyframes stamp {
  from {
    scale: 4.2;
    rotate: -20deg;
    opacity: 0;
  }
  55% {
    scale: 0.88;
    rotate: 3deg;
    opacity: 1;
  }
}
/* rays spinning behind the grade and a shock ring at the instant of the stamp */
.grade::before,
.grade::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 58%;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
}
.grade::before {
  aspect-ratio: 1;
  animation:
    rays 9s linear 1.5s infinite,
    drop 0.3s 1.5s backwards;
}
.grade::after {
  width: 120%;
  aspect-ratio: 1;
  border: 6px solid #fff;
  opacity: 0;
  animation: shock 0.5s ease-out 1.42s;
}
@keyframes rays {
  to {
    rotate: 360deg;
  }
}
@keyframes shock {
  from {
    scale: 0.4;
    opacity: 0.9;
  }
  to {
    scale: 2.6;
    opacity: 0;
  }
}
.result .card {
  animation: cardin 0.26s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes cardin {
  from {
    scale: 0.8;
    opacity: 0;
  }
}
.stats {
  animation: drop 0.3s 1.75s ease-out backwards;
}
.result .btn {
  animation: drop 0.3s 2s ease-out backwards;
}
@media (prefers-reduced-motion: reduce) {
  .grade::before {
    animation: none;
  }
}

/* ---------- ten stages per world: 5x2 grid, tile with number, stars and grade in the corner ---------- */
.levels .grid {
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 2.4cqh, 12px);
}
.lv {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: clamp(70px, 26cqh, 104px);
  padding: 6px 4px;
}
.lv b {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: 700 clamp(26px, 9cqh, 36px) var(--ui);
}
.lv .nm {
  display: none;
}
.lv .st svg {
  width: 20px;
  height: 20px;
}
.lv .gr {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 15px;
  padding: 0 4px;
  line-height: 28px;
}
.lv.shut b {
  display: none;
}
.lv.shut .lock {
  display: block;
  width: 28px;
  height: 28px;
}
.lv.shut .st {
  display: none;
}

/* ==========================================================================================
   INTERFACE, ROUND 2: a single button anatomy (ring, hard highlight on top, lip), outline on
   all text over color, a single star, dark glass pause, title migrated.
   ========================================================================================== */
.btn,
.seg button,
.langs button {
  --top: #ffffff;
  --bot: #dfe6f2;
  --ring: #a9b6cd;
  --lip: #a9b6cd;
  --stroke: transparent;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  color: #1b2437;
  background:
    linear-gradient(rgba(255, 255, 255, 0.26) 0 48%, transparent 48%),
    linear-gradient(var(--top), var(--bot));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 0 0 2px var(--ring),
    0 5px 0 2px var(--lip),
    0 10px 12px rgba(10, 20, 45, 0.22);
  text-shadow: none;
}
.btn.primary,
.seg button.on,
.langs button.on {
  color: #fff;
  -webkit-text-stroke: 3px var(--stroke);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--stroke);
}
.btn.primary {
  --top: #7ddc3f;
  --bot: #4fbf22;
  --ring: #2f8f14;
  --lip: #2f8f14;
  --stroke: #1f6b0c;
}
.seg button.on,
.langs button.on {
  --top: #5aa7ff;
  --bot: #2f7cf0;
  --ring: #1a5bd0;
  --lip: #1a5bd0;
  --stroke: #123f94;
}
.btn:active,
.seg button:active,
.langs button:active,
.lv:active,
.sk:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 0 0 2px var(--ring, #a9b6cd),
    0 1px 0 2px var(--lip, #a9b6cd);
}
.btn.primary:active {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 0 0 2px var(--ring),
    0 1px 0 2px var(--lip);
}
.lv.shut:active,
.sk.shut:active {
  transform: none;
  animation: nope 0.24s;
}
@keyframes nope {
  25% {
    translate: -4px 0;
  }
  75% {
    translate: 4px 0;
  }
}
:focus-visible {
  outline: 3px solid #ffd24a;
  outline-offset: 2px;
}
.head .btn {
  min-height: 44px;
}
.seg {
  gap: 8px;
}
.seg button {
  min-height: 44px;
  font: 700 15px var(--ui);
  padding: 0 14px;
}

/* text over color: header, grades, combo */
.head h2 {
  -webkit-text-stroke: 3px #123f94;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #123f94;
}
.lv .gr,
.grade b {
  -webkit-text-stroke: 3px #8a5200;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #8a5200;
}
.lv .gr[data-g='A'],
.grade b[data-g='A'] {
  -webkit-text-stroke-color: #1f6b0c;
  text-shadow: 0 2px 0 #1f6b0c;
}
.lv .gr[data-g='B'],
.grade b[data-g='B'] {
  -webkit-text-stroke-color: #123f94;
  text-shadow: 0 2px 0 #123f94;
}
.lv .gr[data-g='C'],
.lv .gr[data-g='D'],
.grade b[data-g='C'],
.grade b[data-g='D'] {
  -webkit-text-stroke-color: #55627a;
  text-shadow: 0 2px 0 #55627a;
}
/* a single grade color map, in the result and on the stages screen */
.lv .gr[data-g='A'] {
  background: linear-gradient(#7ddc3f, #4fbf22);
  box-shadow: 0 2px 0 #2f8f14;
}
.lv .gr[data-g='B'],
.grade b[data-g='B'] {
  background: linear-gradient(#5aa7ff, #2f7cf0);
}
.lv .gr[data-g='B'] {
  box-shadow: 0 2px 0 #1a5bd0;
}
.lv .gr[data-g='C'],
.lv .gr[data-g='D'],
.grade b[data-g='C'] {
  background: linear-gradient(#b9c3d3, #8d99ad);
}
.lv .gr[data-g='C'],
.lv .gr[data-g='D'] {
  box-shadow: 0 2px 0 #6c788c;
}
.grade b[data-g='C'] {
  box-shadow: 0 5px 0 #6c788c;
}

/* a single star */
.stars svg.on,
.bigstars svg.on,
.lv .st svg.on,
.total svg {
  fill: #ffc21a;
  stroke: #8a5200;
  stroke-width: 2.2;
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 0 #b87400);
}
.bigstars svg,
.lv .st svg {
  fill: #d5dce8;
  stroke: #8591a8;
  stroke-width: 1.6;
  paint-order: stroke fill;
}
.stars svg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2;
}

/* scoreboard: numbers with outline, widths that do not jump, dark glass pause */
.hud-l {
  -webkit-text-stroke: 3px #0f1830;
  paint-order: stroke fill;
  text-shadow: none;
}
.foes .n {
  min-width: 2ch;
  text-align: center;
}
.score .v {
  min-width: 4ch;
}
.chip {
  position: relative;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(16, 26, 48, 0.62);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16);
}
.chip::before {
  content: '';
  position: absolute;
  inset: -6px;
}
.chip:active {
  transform: scale(0.94);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.combo .x {
  -webkit-text-stroke: 4px #0f1830;
  paint-order: stroke fill;
  text-shadow: none;
}
.combo .m {
  padding: 1px 7px;
  border-radius: 8px;
  color: #5a3800;
  background: linear-gradient(#ffd866, #f5a623);
  -webkit-text-stroke: 0;
  text-shadow: none;
  align-self: center;
}
.combo .bar {
  min-width: 96px;
}
.toast,
.badge {
  border-radius: 16px;
  padding: 8px 16px;
  background: rgba(16, 26, 48, 0.72);
  max-width: min(440px, 70cqw);
  text-wrap: balance;
}

/* title: no paper veil, premise in a pill, green play button, languages in the corner */
.title {
  background: linear-gradient(rgba(12, 20, 40, 0.18), rgba(12, 20, 40, 0.42));
}
.premise {
  padding: 6px 16px;
  border-radius: 16px;
  background: rgba(16, 26, 48, 0.62);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.tap {
  display: inline-grid;
  place-items: center;
  min-width: 220px;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 14px;
  font: 700 20px var(--ui);
  color: #fff;
  -webkit-text-stroke: 3px #1f6b0c;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #1f6b0c;
  background:
    linear-gradient(rgba(255, 255, 255, 0.26) 0 48%, transparent 48%),
    linear-gradient(#7ddc3f, #4fbf22);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 0 0 2px #2f8f14,
    0 6px 0 2px #2f8f14,
    0 12px 16px rgba(10, 20, 45, 0.3);
}
.langs {
  position: absolute;
  display: flex;
  gap: 8px;
}
.langs button {
  min-height: 44px;
  min-width: 48px;
  font: 700 14px var(--ui);
}
.logo span:last-child {
  border-radius: 0.16em;
  background:
    linear-gradient(rgba(255, 255, 255, 0.24) 0 46%, transparent 46%),
    linear-gradient(#5aa7ff, #2f7cf0);
  box-shadow:
    inset 0 0.04em 0 rgba(255, 255, 255, 0.5),
    0 0.08em 0 #1a5bd0,
    0 0.14em 0.2em rgba(10, 20, 45, 0.35);
}

/* controls with contrast */
.row input[type='range']::-webkit-slider-runnable-track {
  height: 12px;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.25);
}
.row input[type='range']::-moz-range-track {
  background: #55627a;
}
.row input[type='range']::-moz-range-progress {
  height: 8px;
  border-radius: 7px;
  background: #5aa7ff;
}
.row input[type='range']::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -9px;
  background: linear-gradient(#ffffff, #dfe6f2);
  border: none;
  box-shadow:
    0 0 0 2px #a9b6cd,
    0 3px 0 2px #a9b6cd;
}
.row input[type='checkbox'] {
  width: 64px;
  height: 36px;
  background: #7a869b;
}
.row input[type='checkbox']:checked {
  background: #4fbf22;
  box-shadow: 0 0 0 2px #2f8f14;
}
.row input[type='checkbox']:checked::after {
  transform: translateX(28px);
}
.sk small,
.sk.shut .nm {
  color: #4a566c;
  opacity: 1;
}
.sk.shut canvas {
  filter: grayscale(1) opacity(0.45);
}
.grade small {
  font-size: 13px;
  opacity: 1;
  color: #5a667d;
}
.stats dt {
  font-size: 13px;
}
.langs {
  left: auto;
  height: auto;
  align-items: flex-start;
  transform: none;
}
.langs button {
  height: 44px;
  flex: none;
}
.seg button.on,
.langs button.on {
  background:
    linear-gradient(rgba(255, 255, 255, 0.26) 0 48%, transparent 48%),
    linear-gradient(var(--top), var(--bot));
  border: none;
}

/* ==========================================================================================
   INTERFACE, ROUND 3. Title with nothing over the logo, result reordered with the rays attached
   to the card, two-line notice, combo without a doubled "x", pause with header and X, outfits with
   padlock and progress, highlight on the next stage, outline proportional to the letter size,
   states and "reduced motion".
   ========================================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.btn.ico {
  width: 52px;
  min-height: 52px;
  padding: 0;
}
.btn.ico svg {
  width: 24px;
  height: 24px;
}
.btn.x {
  --top: #ff6b6b;
  --bot: #e5484d;
  --ring: #a82a2f;
  --lip: #a82a2f;
  width: 44px;
  padding: 0;
  color: #fff;
  font-size: 20px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.26) 0 48%, transparent 48%),
    linear-gradient(var(--top), var(--bot));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 0 0 2px var(--ring),
    0 4px 0 2px var(--lip);
}
.btn:disabled {
  --top: #d5dbe6;
  --bot: #b9c3d3;
  --ring: #98a4b8;
  --lip: #98a4b8;
  color: #6c788c;
  -webkit-text-stroke: 0;
  text-shadow: none;
  pointer-events: none;
}
[data-calm] * {
  animation: none !important;
  transition: none !important;
}
.btn.primary,
.seg button.on,
.langs button.on,
.head h2,
.lv .gr,
.grade b,
.tap {
  -webkit-text-stroke-width: clamp(2px, 0.15em, 4px);
}

/* title */
.langs {
  top: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  right: max(12px, env(safe-area-inset-right));
}
.tap {
  animation: tapbeat 1.4s ease-in-out infinite;
  opacity: 1;
}
@keyframes tapbeat {
  50% {
    scale: 1.04;
  }
}
.logo .cut::before,
.logo .cut::after {
  color: #fff;
  -webkit-text-stroke: 0.12em #1b2437;
  text-shadow: 0 0.06em 0 #1b2437;
}

/* scoreboard: each piece moves out of the way on its own; hidden behind pause and result */
.combo,
.toast,
.chip {
  transition: opacity 0.16s;
}
.combo.ghost,
.toast.ghost,
.chip.ghost {
  opacity: 0.2;
}
#ui:has(.sheet:not([hidden])) .hud-l,
#ui:has(.sheet:not([hidden])) .chip {
  visibility: hidden;
}
.score .v {
  text-align: left;
}
.combo {
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 0 8px;
}
.combo .lbl {
  font: 700 12px var(--ui);
  letter-spacing: 0.06em;
  color: #fff;
  -webkit-text-stroke: 2.5px #0f1830;
  paint-order: stroke fill;
}
.combo .m {
  margin-left: 4px;
  font-size: 16px;
  height: 22px;
  line-height: 20px;
  box-shadow: 0 2px 0 #c77f0a;
}

/* aviso em duas linhas */
.toast {
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(340px, 60cqw);
  text-wrap: wrap;
}
.toast .t1 {
  flex-basis: 100%;
  text-align: center;
  font: 700 17px var(--ui);
  color: #ffd24a;
}
.toast .tx {
  font: 600 15px var(--ui);
}

/* result: stars spilling over the top, stage name, grade + points, three numbers, one main button */
.result .card {
  isolation: isolate;
  overflow: visible;
}
.result .bigstars {
  margin-top: -30px;
  gap: 4px;
}
.bigstars svg {
  width: clamp(48px, 16cqh, 64px);
  height: clamp(48px, 16cqh, 64px);
}
.result .head {
  align-self: stretch;
  justify-content: center;
  padding: 4px 16px;
}
.result .head h2 {
  font-size: clamp(16px, 5cqh, 20px);
  flex: none;
  margin: 0;
}
.result .mid {
  align-items: flex-start;
  gap: 4px;
}
.grade b {
  font-size: clamp(40px, 15cqh, 56px);
  border-radius: 16px;
}
.pts {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 clamp(26px, 9cqh, 34px) var(--ui);
  color: var(--ink);
}
.pts svg {
  width: 0.8em;
  height: 0.8em;
}
.best {
  font: 700 13px var(--ui);
  color: #5a3800;
  background: linear-gradient(#ffd866, #f5a623);
  border-radius: 8px;
  padding: 2px 8px;
  box-shadow: 0 2px 0 #c77f0a;
}
.stats {
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  z-index: 1;
}
.acts {
  align-self: stretch;
  flex-wrap: nowrap;
}
#bNext {
  flex: 1;
  font-size: 20px;
}
.grade::before {
  width: 170%;
  background: repeating-conic-gradient(rgba(255, 200, 58, 0.32) 0 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 62%);
  mask: radial-gradient(circle, #000 25%, transparent 62%);
}

/* pause: blue header with red X, and fits in 667x375 */
.pause .card {
  gap: 4px clamp(14px, 3cqw, 30px);
  padding: 12px clamp(14px, 3cqw, 28px);
}
.pause .head {
  grid-column: 1 / -1;
  min-height: 40px;
  padding: 4px 4px 4px 16px;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pause .head h2 {
  margin: 0;
}
.pause .side {
  grid-row: 2 / span 6;
}
.pause .row {
  min-height: 44px;
}
.pause #bResume {
  min-height: 56px;
}
.row input[type='range']::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #5aa7ff var(--v, 50%), #55627a var(--v, 50%));
}

/* outfits: horizontal scroll, seal on the chosen one, padlock and progress bar on the locked one */
.skins .grid {
  grid-template-columns: none;
  grid-auto-flow: column;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.sk {
  position: relative;
  scroll-snap-align: start;
}
.sk .nm {
  min-height: 2.2em;
  text-wrap: balance;
}
.sk .ok {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4fbf22;
  box-shadow:
    0 0 0 2px #fff,
    0 2px 0 2px #2f8f14;
}
.sk .ok svg {
  width: 16px;
  height: 16px;
}
.sk.on .ok {
  display: grid;
  place-items: center;
}
.sk .lock {
  display: none;
  position: absolute;
}
.sk.shut .lock {
  display: block;
}
.sk .need {
  display: none;
  width: 70%;
  height: 6px;
  border-radius: 3px;
  background: #55627a;
  overflow: hidden;
}
.sk.shut .need {
  display: block;
}
.sk .need i {
  display: block;
  height: 100%;
  background: linear-gradient(#ffe27a, #ffb300);
}
.skins .head h2 {
  flex: 1;
}

/* stages: the next one to play in green, pulsing */
.levels .grid {
  padding-top: 10px;
}
.lv .lock {
  color: #6c788c;
}
.lv.next {
  background:
    linear-gradient(rgba(255, 255, 255, 0.26) 0 48%, transparent 48%),
    linear-gradient(#7ddc3f, #4fbf22);
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px #2f8f14,
    0 5px 0 5px #2f8f14;
  animation: tapbeat 1.2s ease-in-out infinite;
}
.lv.next b {
  color: #fff;
  -webkit-text-stroke: 3px #1f6b0c;
  paint-order: stroke fill;
}
.lv.next .st svg {
  fill: rgba(0, 0, 0, 0.18);
  stroke: rgba(255, 255, 255, 0.7);
}

/* the NINJA cut reads as a blade strike, not as a struck-out word: well offset halves,
   larger angle and a thin edge, tapered at the ends */
.logo .cut::before {
  clip-path: polygon(-12% -30%, 112% -30%, 112% 26%, -12% 66%);
  transform: translate(0.07em, -0.05em);
}
.logo .cut::after {
  clip-path: polygon(-12% 66%, 112% 26%, 112% 130%, -12% 130%);
  transform: translate(-0.07em, 0.05em);
}
.logo .cut i {
  left: -6%;
  width: 112%;
  top: 46%;
  transform: rotate(-5.4deg);
}
/* short phone (667x375): the pause shrinks to fit entirely */
@media (max-height: 400px) {
  .pause .card {
    padding: 8px clamp(12px, 3cqw, 24px) 10px;
    gap: 2px clamp(12px, 3cqw, 24px);
  }
  .pause .row {
    min-height: 40px;
  }
  .pause .seg button {
    min-height: 38px;
  }
  .pause #bResume {
    min-height: 50px;
  }
  .pause .side .btn {
    min-height: 42px;
  }
}

/* the combo never touches the scoreboard pills (at 667 px wide it covered the points) */
.combo {
  left: max(50%, 380px);
}
/* the notice also responds above the screens (tap on a locked stage or outfit) */

/* scoreboard with impact: star hits, points and enemies leap with a flash, combo bursts */
.hud .pulse {
  animation: hudpop 0.38s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes hudpop {
  30% {
    transform: scale(1.34) rotate(-4deg);
    filter: brightness(1.7) drop-shadow(0 0 6px #ffd24a);
  }
}
.stars svg.on.pulse {
  animation: starslam 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes starslam {
  0% {
    transform: scale(2.6) rotate(-30deg);
    opacity: 0;
  }
  45% {
    transform: scale(0.82) rotate(6deg);
    opacity: 1;
    filter: brightness(1.6) drop-shadow(0 0 8px #ffd24a);
  }
}
.combo .x.pulse {
  animation: combopop 0.3s cubic-bezier(0.3, 1.7, 0.5, 1);
}
@keyframes combopop {
  0% {
    transform: scale(1.75) rotate(-6deg);
    color: #ffd24a;
  }
}
.combo .m.pulse {
  animation: hudpop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
/* End of src/styles-core.css */
/* Interface rounds 4 and 5, title scene and notice (imported by styles.css) */
/* ==========================================================================================
   INTERFACE, ROUND 4. Notice only on the right screen, result that fits in 667x375,
   outfits without gaps, NINJA cut with a dark gap, pause with 44 px targets.
   ========================================================================================== */
.toast {
  z-index: auto;
}
.toast.over {
  z-index: 60;
  top: 50%;
  margin-top: -20px;
  background: rgba(16, 26, 48, 0.92);
}
.sheet.result {
  padding-top: 36px;
}
.result .card {
  gap: 8px;
}
.result .head {
  min-height: 32px;
}
#bNext {
  min-height: 52px;
}
.grade::before {
  display: none;
}
.skins .grid {
  grid-auto-columns: calc((100% - 30px) / 4);
  padding: 8px 6px;
}
.skins .grid:has(.sk:nth-child(5)) {
  grid-auto-columns: calc((100% - 30px) / 4.3);
}
.sk {
  justify-content: center;
}
.sk .lock {
  top: -6px;
  right: -6px;
  left: auto;
  translate: none;
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 50%;
  background: #7a869b;
  color: #fff;
  box-shadow:
    0 0 0 2px #fff,
    0 2px 0 2px #55627a;
}
.sk small {
  font: 700 13px var(--ui);
}
.sk small svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  fill: #ffb300;
  stroke: #8a5200;
  stroke-width: 1.6;
}
.logo .cut i {
  z-index: 1;
  height: 0.05em;
  box-shadow: none;
  background: linear-gradient(
    90deg,
    transparent,
    #8fd0ff 5%,
    #1b2437 11%,
    #1b2437 89%,
    #8fd0ff 95%,
    transparent
  );
}
.premise {
  margin-top: 6px;
}
.pause .side {
  align-self: center;
}
.row input[type='checkbox'] {
  box-shadow: 0 0 0 2px #5a667d;
}
.pause .seg button,
.pause .side .btn {
  position: relative;
}
.pause .seg button::before,
.pause .side .btn::before {
  content: '';
  position: absolute;
  inset: -4px 0;
}
@media (min-height: 401px) {
  .pause #bResume {
    min-height: 64px;
    font-size: 22px;
  }
}
.combo .lbl {
  font-size: 13px;
}
.lv.next b {
  -webkit-text-stroke-width: clamp(2px, 0.15em, 4px);
}
.btn.x {
  min-height: 44px;
}
#ui:not([data-kbd]) :focus-visible {
  outline: none;
}
@media (min-height: 401px) {
  .pause .row {
    min-height: 46px;
  }
}

/* ---------- result: the star and the stamp ACCELERATE until they hit ---------- */
.bigstars svg.on {
  animation: slam2 0.28s linear backwards;
  animation-delay: 0.38s;
}
.bigstars svg:not(.on) {
  animation: tapdry 0.14s ease-out 0.52s backwards;
}
.bigstars svg:not(.on):nth-child(2) {
  animation-delay: 0.78s;
}
.bigstars svg:not(.on):nth-child(3) {
  animation-delay: 1.04s;
}
@keyframes slam2 {
  0% {
    scale: 4.2;
    rotate: -24deg;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.6, 0, 1, 0.5);
  }
  50% {
    scale: 1;
    rotate: 0deg;
    opacity: 1;
  }
  62% {
    scale: 0.84;
  }
  80% {
    scale: 1.06;
  }
}
@keyframes tapdry {
  50% {
    scale: 0.9;
  }
}
.grade b {
  rotate: -7deg;
  animation: stamp2 0.28s linear 1.36s backwards;
}
@keyframes stamp2 {
  0% {
    scale: 4.2;
    rotate: -20deg;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.6, 0, 1, 0.5);
  }
  50% {
    scale: 1;
    rotate: -7deg;
    opacity: 1;
  }
  62% {
    scale: 0.84;
  }
  80% {
    scale: 1.06;
  }
}
/* shock ring in the grade color (white on a white card did not show) */
.grade::after {
  border: 8px solid #f5a623;
  animation: shock 0.5s ease-out 1.5s;
}
.grade:has(b[data-g='A'])::after {
  border-color: #55c228;
}
.grade:has(b[data-g='B'])::after {
  border-color: #2f7cf0;
}
.grade:has(b[data-g='C'])::after,
.grade:has(b[data-g='D'])::after {
  border-color: #8d99ad;
}
/* the card feels every beat */
.result .card.bump {
  animation: cardbump 0.12s ease-out;
}
.result .card.bump2 {
  animation: cardbump2 0.16s ease-out;
}
@keyframes cardbump {
  40% {
    translate: 0 4px;
  }
}
@keyframes cardbump2 {
  40% {
    translate: 0 7px;
    rotate: -0.6deg;
  }
}
.pts.pulse {
  animation: hudpop 0.38s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.best {
  animation: bestin 0.3s cubic-bezier(0.3, 1.5, 0.5, 1) 1.75s backwards;
}
@keyframes bestin {
  from {
    scale: 2;
    rotate: -4deg;
    opacity: 0;
  }
}
/* tapped the card before the celebration ended: everything goes to the final state, immediately */
.result.skip *,
.result.skip *::before,
.result.skip *::after {
  animation: none !important;
}

/* ---------- loose interface effects: ring on the star that hits, rays on the scoreboard, S confetti ---------- */
.fxring {
  position: absolute;
  z-index: 70;
  pointer-events: none;
}
.fxring.star {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 4px solid #ffd24a;
  animation: fxring 0.38s ease-out forwards;
}
@keyframes fxring {
  from {
    scale: 0.5;
    opacity: 1;
  }
  to {
    scale: 2;
    opacity: 0;
  }
}
.fxring.rays {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: repeating-conic-gradient(#ffd24a 0 9deg, transparent 9deg 45deg);
  -webkit-mask: radial-gradient(circle, transparent 34%, #000 36%, #000 68%, transparent 70%);
  mask: radial-gradient(circle, transparent 34%, #000 36%, #000 68%, transparent 70%);
  animation: fxrays 0.16s ease-out forwards;
}
@keyframes fxrays {
  from {
    scale: 0.5;
    opacity: 1;
  }
  to {
    scale: 1.35;
    opacity: 0;
  }
}
.fxring.confetti {
  width: 8px;
  height: 12px;
  margin: -6px 0 0 -4px;
  border-radius: 2px;
  animation: confetti 0.9s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes confetti {
  to {
    translate: var(--dx) calc(var(--dy) + 60px);
    rotate: var(--r);
    opacity: 0;
  }
}

/* ==========================================================================================
   RESULT, ROUND 5.
   Victory screen: dark background with spinning golden rays, large stars in an arc spilling over
   the top, blue ribbon with folds, grade medallion, large points and three cards with icons.
   Everything under .r5 (the old card does not have this class).
   ========================================================================================== */
.sheet.result {
  padding-top: 54px;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 46%,
    rgba(44, 70, 140, 0.78),
    rgba(8, 12, 30, 0.92) 72%
  );
}
.result .glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 160vmax;
  height: 160vmax;
  translate: -50% -50%;
  pointer-events: none;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 214, 102, 0.2) 0deg 8deg,
    transparent 8deg 18deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.55) 20%, transparent 44%);
  mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.55) 20%, transparent 44%);
  animation: r5spin 48s linear infinite;
}
@keyframes r5spin {
  to {
    rotate: 360deg;
  }
}
.result .card.r5 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: min(540px, calc(100vw - 76px));
  max-width: none;
  padding: 0 16px 14px;
  border-radius: 22px;
  background: linear-gradient(#fbfcff, #e4eaf7);
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px #1b2a55,
    0 9px 0 6px #121c3d,
    0 26px 44px rgba(0, 0, 0, 0.5);
}
/* stars: the middle one larger and higher, the side ones tilted outward */
.result .r5 .bigstars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2px;
  height: 78px;
  margin: -48px 0 -8px;
  position: relative;
  z-index: 2;
}
.result .r5 .bigstars svg {
  width: 60px;
  height: 60px;
  margin: 0;
  fill: #2a3660;
  stroke: #121c3d;
  stroke-width: 2.2;
  filter: drop-shadow(0 3px 0 rgba(8, 12, 30, 0.6));
}
.result .r5 .bigstars svg:nth-child(1) {
  rotate: -14deg;
  translate: 4px 4px;
}
.result .r5 .bigstars svg:nth-child(2) {
  width: 80px;
  height: 80px;
  translate: 0 -6px;
}
.result .r5 .bigstars svg:nth-child(3) {
  rotate: 14deg;
  translate: -4px 4px;
}
.result .r5 .bigstars svg.on {
  fill: #ffc21a;
  stroke: #8a5200;
  filter: drop-shadow(0 3px 0 #b87400) drop-shadow(0 0 12px rgba(255, 200, 60, 0.8));
}
/* faixa */
.result .r5 .rib {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 -30px;
  padding: 2px 20px;
  border-radius: 7px;
  background: linear-gradient(#63adff, #2f7cf0);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 0 0 3px #123f94,
    0 5px 0 3px #0c2d6b;
}
.result .r5 .rib::before,
.result .r5 .rib::after {
  content: '';
  position: absolute;
  top: 10px;
  width: 22px;
  height: calc(100% + 3px);
  background: #1a5bd0;
}
.result .r5 .rib::before {
  left: -24px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 42% 50%);
}
.result .r5 .rib::after {
  right: -24px;
  clip-path: polygon(0 0, 100% 0, 58% 50%, 100% 100%, 0 100%);
}
.result .r5 .rib h2 {
  margin: 0;
  font: 400 clamp(18px, 6cqh, 24px) var(--display);
  color: #fff;
  -webkit-text-stroke: 4px #123f94;
  paint-order: stroke fill;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.result .r5 .lvname {
  margin: 8px 0 0;
  text-align: center;
  font: 700 13px var(--ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a7791;
}
/* body: grade medallion on the left, points and cards on the right */
.result .r5 .body {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
}
.result .r5 .grade {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #ffffff, #dbe4f5 72%);
  box-shadow:
    inset 0 0 0 4px #fff,
    inset 0 0 0 7px #c2cee6,
    0 4px 0 #aab8d4;
}
.result .r5 .grade small {
  position: absolute;
  top: 11px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font: 700 10.5px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a869b;
}
.result .r5 .grade b {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-top: 12px;
  font-size: 42px;
  line-height: 1;
}
.result .r5 .col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.result .r5 .pts {
  gap: 8px;
  font: 400 clamp(30px, 11cqh, 42px) / 1 var(--display);
  color: #1b2437;
}
.result .r5 .pts svg {
  width: 0.72em;
  height: 0.72em;
}
.result .r5 .best {
  position: absolute;
  top: 2px;
  right: 0;
  margin: 0;
  padding: 4px 11px;
  rotate: 5deg;
  border-radius: 999px;
  font: 700 12px var(--ui);
  color: #fff;
  background: linear-gradient(#ff7a8f, #ef3d5f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 2px #a81f3d,
    0 3px 0 2px #7c1730;
}
.result .r5 .tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}
.result .r5 .tiles div {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 7px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    inset 0 0 0 2px #d5dce8,
    0 3px 0 #c2cce0;
}
.result .r5 .tiles svg {
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
}
.result .r5 .tiles dd {
  margin: 0;
  font: 400 19px / 1.05 var(--display);
  color: #1b2437;
}
.result .r5 .tiles dt {
  font: 700 10px var(--ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #7a869b;
}
.result .r5 .acts {
  margin-top: 4px;
}
/* arrow on the main button */
.result .r5 #bNext::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 12px;
  border: solid currentColor;
  border-width: 4px 4px 0 0;
  border-radius: 1px;
  rotate: 45deg;
  translate: 0 -1px;
}
/* the cards enter one by one after the stamp */
.result .r5 .tiles div {
  animation: r5tile 0.26s cubic-bezier(0.3, 1.5, 0.5, 1) 1.5s backwards;
}
.result .r5 .tiles div:nth-child(2) {
  animation-delay: 1.6s;
}
.result .r5 .tiles div:nth-child(3) {
  animation-delay: 1.7s;
}
@keyframes r5tile {
  from {
    scale: 0.6;
    opacity: 0;
  }
}
.result .r5 .rib {
  animation: r5rib 0.3s cubic-bezier(0.3, 1.4, 0.5, 1) 0.16s backwards;
}
@keyframes r5rib {
  from {
    scale: 0.2 1;
    opacity: 0;
  }
}

/* result, juice adjustments: truly golden rays, medallion rim in the grade color, and the middle
   star not stuck to the top on a short screen */
.result .glow {
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 200, 58, 0.26) 0deg 8deg,
    transparent 8deg 18deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.6) 30%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.6) 30%, transparent 62%);
}
.result .r5 .grade {
  --ring: #f5a623;
  box-shadow:
    inset 0 0 0 4px #fff,
    inset 0 0 0 7px #c9d3ea,
    0 0 0 3px var(--ring),
    0 4px 0 3px #aab8d4;
}
.result .r5 .grade:has(b[data-g='A']) {
  --ring: #55c228;
}
.result .r5 .grade:has(b[data-g='B']) {
  --ring: #2f7cf0;
}
.result .r5 .grade:has(b[data-g='C']),
.result .r5 .grade:has(b[data-g='D']) {
  --ring: #8d99ad;
}
@media (max-height: 380px) {
  .sheet.result {
    padding-top: 58px;
  }
  .result .r5 .bigstars svg:nth-child(2) {
    width: 72px;
    height: 72px;
  }
  .result .r5 .bigstars {
    height: 70px;
    margin-top: -42px;
  }
  .result .r5 .grade {
    width: 104px;
    height: 104px;
  }
}

/* result, interface adjustments: vertical breathing room at 375 and 390, 12 px labels with
   contrast, numbers in the scoreboard font, gold record seal stuck to the points, blue rays
   leaving the stars (gold on navy turned khaki) */
.result .card.r5 {
  width: min(540px, calc(100cqw - 76px));
}
.result .glow {
  top: 72px;
  width: 90vmax;
  height: 90vmax;
  scale: 1.8;
  will-change: rotate;
  background: repeating-conic-gradient(rgba(120, 170, 255, 0.22) 0 8deg, transparent 8deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.6) 26%, transparent 56%);
  mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.6) 26%, transparent 56%);
}
.result .r5 .grade {
  width: 96px;
  height: 96px;
}
.result .r5 .grade b {
  width: 54px;
  height: 54px;
  font-size: 36px;
}
.result .r5 .grade small {
  top: 9px;
  font: 700 12px var(--ui);
  letter-spacing: 0.06em;
  color: #55627a;
}
.result .r5 .lvname {
  margin-top: 4px;
  color: #55627a;
}
.result .r5 .tiles dt {
  font: 700 12px var(--ui);
  color: #55627a;
}
.result .r5 .pts {
  font: 700 clamp(28px, 10cqh, 36px) / 1 var(--ui);
}
.result .r5 .tiles dd {
  font: 700 22px / 1.05 var(--ui);
}
#rScore {
  display: inline-block;
  min-width: 4ch;
}
.result .r5 .best {
  position: static;
  margin: 0 0 0 10px;
  rotate: -4deg;
  font: 700 13px var(--ui);
  color: #5a3800;
  background: linear-gradient(#ffd866, #f5a623);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 2px #c77f0a,
    0 3px 0 2px #8a5200;
}
@media (max-height: 380px) {
  .result .r5 .grade {
    width: 96px;
    height: 96px;
  }
}

/* result, juice check: an empty star reads as a socket (flat on navy it weighed more than the
   earned star) and the ray celebration is halved at grades C and D */
.result .r5 .bigstars svg:not(.on) {
  fill: #3a4a7a;
  stroke: #5a6aa0;
}
.result:has(#rGrade[data-g='C']) .glow,
.result:has(#rGrade[data-g='D']) .glow {
  opacity: 0.5;
}
.result .r5 #bNext::after {
  filter: drop-shadow(0 2px 0 #1f6b0c);
}

/* combo that ends: flies to the points and vanishes */
.combo.gone {
  animation: combogone 0.32s cubic-bezier(0.5, 0, 0.9, 0.4) forwards;
}
@keyframes combogone {
  to {
    translate: calc(-50% + var(--gx)) var(--gy);
    scale: 0.35;
    opacity: 0;
  }
}

/* ==========================================================================================
   TITLE, NEW SCENE. The title is a real stage running behind: the hero arrives sliding, gathers
   momentum and slices the logo; the pieces fall bouncing and become the slices of the
   "Jogar agora" and "Opções" buttons, which rest on the ground.
   The position comes from the game, frame by frame: --lx/--ly (logo center), --gy (ground), --fs (body).
   ========================================================================================== */
.title.t2 {
  padding: 0;
  cursor: default;
  background: none;
}
.t2 .lg {
  position: absolute;
  left: var(--lx, 50%);
  top: var(--ly, 38%);
  translate: -50% -50%;
  margin: 0;
  font: 400 var(--fs, 64px) / 0.95 var(--display);
  letter-spacing: 0.01em;
  white-space: nowrap;
  animation: lgdrop 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
}
@keyframes lgdrop {
  from {
    translate: -50% -170%;
    opacity: 0;
  }
}
.t2 .half {
  display: flex;
  gap: 0.22em;
  align-items: center;
  transition:
    translate 0.16s cubic-bezier(0.3, 1.9, 0.5, 1),
    rotate 0.16s ease-out;
}
.t2 .half.b {
  position: absolute;
  inset: 0;
  visibility: hidden;
}
.t2.cut .half.b {
  visibility: visible;
}
/* the two halves move away from the cut, each to its own side */
.t2.cut .half.a {
  translate: calc(var(--nx) * 0.075em) calc(var(--ny) * 0.075em);
  rotate: -1.1deg;
}
.t2.cut .half.b {
  translate: calc(var(--nx) * -0.075em) calc(var(--ny) * -0.075em);
  rotate: 1.1deg;
}
.t2 .w1 {
  color: #fff;
  -webkit-text-stroke: 0.12em #1b2437;
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0 #1b2437;
}
.t2 .w2 {
  padding: 0.08em 0.2em 0.12em;
  border-radius: 0.16em;
  rotate: -3deg;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.24) 0 46%, transparent 46%),
    linear-gradient(#5aa7ff, #2f7cf0);
  box-shadow:
    inset 0 0.04em 0 rgba(255, 255, 255, 0.5),
    0 0.08em 0 #1a5bd0,
    0 0.14em 0.2em rgba(10, 20, 45, 0.35);
}
/* the cut: enters white and wide, and stays as a dark thread with blue tips */
.t2 .slash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 124%;
  height: 0.055em;
  translate: -50% -50%;
  rotate: var(--ang, -0.9rad);
  border-radius: 0.03em;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent,
    #8fd0ff 5%,
    #1b2437 11%,
    #1b2437 89%,
    #8fd0ff 95%,
    transparent
  );
}
.t2.cut .slash {
  opacity: 1;
  animation: slashin 0.46s ease-out backwards;
}
@keyframes slashin {
  0% {
    scale: 0 1;
    height: 0.16em;
    background: #fff;
    box-shadow: 0 0 0.4em 0.1em #8fd0ff;
  }
  30% {
    scale: 1 1;
    height: 0.16em;
    background: #fff;
    box-shadow: 0 0 0.4em 0.1em #8fd0ff;
  }
  60% {
    height: 0.055em;
    box-shadow: 0 0 0 0 transparent;
  }
}
.t2.cut .lg {
  animation: lgflash 0.3s ease-out;
}
@keyframes lgflash {
  0% {
    filter: brightness(2.4);
    scale: 1.05;
  }
}
.t2 .premise {
  position: absolute;
  left: var(--lx, 50%);
  top: calc(var(--ly, 38%) + var(--fs, 64px) * 0.86);
  translate: -50% 0;
  margin: 0;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s 0.25s;
}
.t2.ready .premise {
  opacity: 1;
}
/* the buttons stand on the ground, like blocks */
.t2 .tmenu {
  position: absolute;
  left: var(--lx, 50%);
  top: var(--gy, 78%);
  translate: -50% calc(-100% + 4px);
  display: flex;
  gap: 14px;
  align-items: flex-end;
}
.t2 .tmenu .btn {
  visibility: hidden;
  min-height: 60px;
  white-space: nowrap;
}
.t2.ready .tmenu .btn {
  visibility: visible;
  animation: tmpop 0.36s cubic-bezier(0.3, 1.6, 0.5, 1) backwards;
}
.t2.ready .tmenu .btn + .btn {
  animation-delay: 0.07s;
}
@keyframes tmpop {
  from {
    scale: 1.1 0.84;
    translate: 0 5px;
  }
}
#bPlay {
  min-width: 232px;
  padding: 0 28px;
  font-size: 22px;
}
#bOpts {
  padding: 0 22px;
  font-size: 18px;
}
.t2 .bits {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.t2 .bit {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 7px;
  background: var(--face);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 0 0 2px var(--edge),
    0 5px 0 2px var(--edge);
  will-change: transform;
}
/* the pause sheet opened from the title holds only settings */
.pause.opts .side {
  display: none;
}
[data-calm] .t2 .lg,
[data-calm] .t2 .slash,
[data-calm] .t2 .tmenu .btn {
  animation: none;
}
/* short screen: the sentence does not touch the buttons */
@media (max-height: 400px) {
  .t2 .tmenu .btn {
    min-height: 52px;
  }
  .t2 .premise {
    font-size: 13px;
    padding: 4px 14px;
  }
}

/* ---------- title: "tap to start", sound and fullscreen on top, three buttons on the ground ---------- */
/* the first tap is what unlocks the sound: only after it does the scene run */
.t2 .tap {
  left: var(--lx, 50%);
  top: var(--gy, 78%);
  bottom: auto;
  translate: -50% calc(-100% - 6px);
  white-space: nowrap;
  display: none;
}
.t2.gate .tap {
  display: inline-grid;
}
.t2 .tchips {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
}
.t2 .tchips .chip svg {
  width: 22px;
  height: 22px;
}
/* speaker: waves when there is sound, the X when all three channels are muted */
#bSound .x,
#bSound.off .w {
  display: none;
}
#bSound.off .x {
  display: inline;
}
#bFull.on {
  background: rgba(47, 124, 240, 0.85);
}
.t2 .sndpop {
  position: absolute;
  top: 52px;
  right: 0;
  min-width: 190px;
  padding: 8px 14px;
  border-radius: 16px;
  background: #eef2fa;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px #1b2a55,
    0 8px 0 5px #121c3d,
    0 16px 24px rgba(0, 0, 0, 0.35);
}
.t2 .sndpop .row {
  min-height: 44px;
  gap: 14px;
}
#bTSkins,
#bOpts {
  padding: 0 20px;
  font-size: 18px;
}
@media (max-width: 720px) {
  .t2 .tmenu {
    gap: 10px;
  }
  #bPlay {
    min-width: 176px;
    padding: 0 16px;
    font-size: 20px;
  }
  #bTSkins,
  #bOpts {
    padding: 0 14px;
    font-size: 16px;
  }
}

/* pause with four buttons ("Menu inicial" was added): on a short screen the bottom three get shorter */
@media (max-height: 420px) {
  .pause .side {
    gap: 6px;
  }
  .pause .side .btn:not(#bResume) {
    min-height: 40px;
    font-size: 15px;
  }
  .pause #bResume {
    min-height: 50px;
  }
}

/* enemy scoreboard: a red stroke crosses the number at each cut; the last three blink */
.foes .n {
  position: relative;
}
.foes.strike .n::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: #ff4a3a;
  box-shadow: 0 0 0 1.5px #0f1830;
  transform: rotate(-14deg) scaleX(0);
  transform-origin: left center;
  animation: foe-strike 0.34s ease-out forwards;
}
@keyframes foe-strike {
  45% {
    transform: rotate(-14deg) scaleX(1);
    opacity: 1;
  }
  100% {
    transform: rotate(-14deg) scaleX(1);
    opacity: 0;
  }
}
.foes.last svg {
  animation: foe-last 0.9s ease-in-out infinite;
}
@keyframes foe-last {
  50% {
    filter: brightness(1.6) drop-shadow(0 0 4px #ff4a3a);
    transform: scale(1.12);
  }
}

/* stages: live thumbnail at the top of the card (the stage's sky with the weather over it) */
.lv {
  position: relative;
  overflow: hidden;
}
.lv .mini {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 30%;
  pointer-events: none;
  box-shadow: inset 0 -2px 0 rgba(15, 24, 48, 0.18);
}
.lv .mini::after {
  content: '';
  position: absolute;
  inset: 0;
}
.lv .mini[data-w='rain']::after {
  background: repeating-linear-gradient(
    105deg,
    transparent 0 7px,
    rgba(255, 255, 255, 0.45) 7px 8.5px
  );
}
.lv .mini[data-w='fireflies']::after {
  background:
    radial-gradient(circle at 22% 40%, #d6ff8a 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 58% 66%, #d6ff8a 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 81% 30%, #d6ff8a 0 1.6px, transparent 2.4px);
}
.lv .mini[data-w='breeze']::after {
  background:
    linear-gradient(transparent 38%, rgba(255, 255, 255, 0.55) 38% 44%, transparent 44%) 0 0 / 60%
      100% no-repeat,
    linear-gradient(transparent 64%, rgba(255, 255, 255, 0.4) 64% 69%, transparent 69%) 100% 0 / 45%
      100% no-repeat;
}
.lv.shut .mini {
  filter: grayscale(0.85) brightness(0.8);
}
.lv > :not(.mini) {
  position: relative;
}
.lv .lock {
  position: absolute;
}

/* ==========================================================================================
   NOTICE WITH WEIGHT. Not a black box with text on top.
   Dusk-purple plaque with gold border and a dark lip underneath, gold coin with the stage number,
   name in the title font with outline, hint in a deep strip. Pops in, a shine crosses it, two
   petals in the corner, leaves rising.
   ========================================================================================== */
#ui .toast {
  --plate-hi: #5a4aa8;
  --plate-lo: #2b2266;
  --plate-ink: #160f3a;
  overflow: visible;
  isolation: isolate;
  gap: 2px 8px;
  padding: 7px 16px 8px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(180deg, var(--plate-hi), var(--plate-lo));
  border: 2px solid #ffd76a;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -3px 0 rgba(0, 0, 0, 0.18),
    0 4px 0 var(--plate-ink),
    0 10px 22px rgba(12, 6, 36, 0.45);
  -webkit-text-stroke: 3px var(--plate-ink);
  paint-order: stroke fill;
  animation: plate-in 0.42s cubic-bezier(0.2, 1.5, 0.4, 1) backwards;
}
#ui .toast.over {
  background: linear-gradient(180deg, var(--plate-hi), var(--plate-lo));
}
#ui .toast.out {
  animation: plate-out 0.26s ease-in forwards;
}
/* shine that crosses the plaque once, right after the entrance */
#ui .toast::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 12px;
  background: linear-gradient(
      105deg,
      transparent 35%,
      rgba(255, 255, 255, 0.34) 48%,
      transparent 60%
    )
    no-repeat;
  background-size: 260% 100%;
  background-position: 130% 0;
  animation: plate-shine 0.9s 0.3s ease-out both;
  pointer-events: none;
}
/* two cherry petals pinned to the left corner */
#ui .toast::before {
  content: '';
  position: absolute;
  left: -7px;
  top: -6px;
  width: 11px;
  height: 7px;
  border-radius: 70% 30% 70% 30%;
  background: #ffc3d8;
  transform: rotate(-28deg);
  box-shadow: 10px 3px 0 -1px #f58db5;
  filter: drop-shadow(0 1.5px 0 var(--plate-ink));
  animation: petal-sway 2.4s 0.4s ease-in-out infinite;
}
#ui .toast .t1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-basis: 100%;
}
#ui .toast .t1[hidden] {
  display: none;
}
#ui .toast .nm {
  font: 400 21px / 1.1 var(--display);
  color: #fff3c4;
  letter-spacing: 0.01em;
  -webkit-text-stroke: 4px var(--plate-ink);
  text-shadow: 0 3px 0 var(--plate-ink);
}
/* gold coin with the number, which enters spinning */
#ui .toast .num {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin-left: -6px;
  border-radius: 50%;
  font: 400 17px / 1 var(--display);
  font-style: normal;
  color: #5a2e00;
  -webkit-text-stroke: 0;
  background: radial-gradient(circle at 35% 30%, #fff6c0 0 18%, #ffd24a 45%, #e39a12 100%);
  box-shadow:
    inset 0 0 0 2px #8a5200,
    inset 0 -3px 0 rgba(138, 82, 0, 0.45),
    0 3px 0 var(--plate-ink);
  animation: coin-in 0.6s 0.08s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
#ui .toast .num:empty {
  display: none;
}
#ui .toast .tx {
  font: 600 15px / 1.25 var(--ui);
  color: #f1ecff;
  -webkit-text-stroke: 2.5px var(--plate-ink);
}
/* with a title, the hint moves to a deep strip inside the plaque */
#ui .toast.big .tx {
  margin-top: 3px;
  padding: 3px 12px 4px;
  border-radius: 9px;
  background: rgba(10, 6, 34, 0.32);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.22);
  font-size: 14px;
}
#ui .toast svg {
  color: #ffd76a;
  filter: drop-shadow(0 2px 0 var(--plate-ink));
}
@keyframes plate-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-14px) scale(0.6) rotate(-3deg);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) rotate(0);
  }
}
@keyframes plate-out {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-18px) scale(0.92);
  }
}
@keyframes plate-shine {
  to {
    background-position: -30% 0;
  }
}
@keyframes coin-in {
  from {
    transform: scale(0.2) rotateY(540deg);
  }
  to {
    transform: scale(1) rotateY(0);
  }
}
@keyframes petal-sway {
  50% {
    transform: rotate(-12deg) translateY(1px);
  }
}
/* hero passing behind the notice: the plaque becomes almost transparent (the animation must not pin the opacity) */
#ui .toast.ghost {
  opacity: 0.2;
}

/* replay medals on the stage card: star, crossed-out skull (no deaths) and clock */
.lv .md {
  position: absolute;
  right: 6px;
  top: 5px;
  display: flex;
  gap: 2px;
}
.lv.shut .md,
.lv:not(.done) .md {
  display: none;
}
.lv .md i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d5dce8;
  box-shadow: inset 0 0 0 1.5px #a9b6cd;
}
.lv .md i.on {
  background: radial-gradient(circle at 35% 30%, #fff6c0 0 20%, #ffd24a 50%, #e39a12);
  box-shadow:
    inset 0 0 0 1.5px #8a5200,
    0 1px 0 #8a5200;
}
.lv .md i[data-m='1'].on {
  background: radial-gradient(circle at 35% 30%, #dff6ff 0 20%, #7cc4ff 55%, #2f7cf0);
  box-shadow:
    inset 0 0 0 1.5px #123f94,
    0 1px 0 #123f94;
}
.lv .md i[data-m='2'].on {
  background: radial-gradient(circle at 35% 30%, #e9ffe0 0 20%, #7ddc3f 55%, #2f8f14);
  box-shadow:
    inset 0 0 0 1.5px #1f6b0c,
    0 1px 0 #1f6b0c;
}

/* result: each part of the grade gets a "passed" seal (green, with a check) or "missed" (gray, with a dash) */
.result .tiles > div {
  position: relative;
}
.result .tiles > div.ok::after,
.result .tiles > div.miss::after {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-sizing: border-box;
}
.result .tiles > div.ok::after {
  background: linear-gradient(#7ddc3f, #4fbf22);
  box-shadow:
    inset 0 0 0 2px #2f8f14,
    0 2px 0 #1f6b0c;
}
.result .tiles > div.ok::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: -1px;
  right: 0px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2.4px 2.4px 0;
  transform: rotate(40deg);
}
.result .tiles > div.miss::after {
  background: linear-gradient(#dfe6f2, #a9b6cd);
  box-shadow:
    inset 0 0 0 2px #8591a8,
    0 2px 0 #6c7891;
}
.result .tiles > div.miss::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 2px;
  right: -1px;
  width: 8px;
  height: 2.4px;
  border-radius: 2px;
  background: #fff;
}

/* scoreboard: restart next to the pause */
.hud-r {
  display: flex;
  gap: 8px;
}

/* NEW seal on the newly unlocked stage: tilted red ribbon in the corner, gently pulsing */
.lv.fresh::after {
  content: attr(data-fresh);
  position: absolute;
  top: 6px;
  left: -2px;
  padding: 2px 7px 3px;
  border-radius: 0 7px 7px 0;
  font: 700 11px / 1 var(--ui);
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(#ff6b6b, #e5484d);
  box-shadow:
    inset 0 0 0 1.5px #a82a2f,
    0 2px 0 #a82a2f;
  -webkit-text-stroke: 0;
  transform: rotate(-6deg);
  animation: fresh-beat 1.6s ease-in-out infinite;
}
@keyframes fresh-beat {
  50% {
    transform: rotate(-6deg) scale(1.08);
  }
}

/* opening notice: medallion with the new enemy the stage teaches */
#ui .toast .foe {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -10px 0 -8px -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff4e6, #ffd8b0 60%, #f0a46a);
  box-shadow:
    inset 0 0 0 2.5px #8a3a12,
    0 3px 0 var(--plate-ink);
  animation: coin-in 0.6s 0.15s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
/* End of src/styles-polish.css */
/* End of src/styles.css */

/* End of dist-static/assets/styles-CjBwV5cK.css */
