@font-face {
  font-family: 'Chakra Petch';
  font-weight: 500;
  font-display: swap;
  src: url(./assets/fonts/chakra-petch-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 600;
  font-display: swap;
  src: url(./assets/fonts/chakra-petch-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 700;
  font-display: swap;
  src: url(./assets/fonts/chakra-petch-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 500;
  font-display: swap;
  src: url(./assets/fonts/chakra-petch-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 600;
  font-display: swap;
  src: url(./assets/fonts/chakra-petch-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 700;
  font-display: swap;
  src: url(./assets/fonts/chakra-petch-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
:root {
  --ink: #10123a;
  --deep: #0a0c2a;
  --panel: rgba(20, 22, 70, 0.92);
  --panel-2: rgba(32, 36, 100, 0.9);
  --line: rgba(150, 160, 255, 0.28);
  --text: #f4f1ff;
  --soft: #a9a6d6;
  --cyan: #2fd8ff;
  --violet: #a274ff;
  --coral: #ff6f61;
  --amber: #ffc14d;
  --mint: #2ff0a8;
  --rose: #ff5fae;
  --danger: #ff3d6e;
  --cut: 10px;
  --font: 'Chakra Petch', 'Trebuchet MS', system-ui, 'Noto Sans', 'Hiragino Sans', 'Apple SD Gothic Neo', 'PingFang SC', 'Microsoft YaHei', 'Malgun Gothic', 'Yu Gothic', sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}
body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
canvas#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}
canvas#post {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
body.post-on canvas#game {
  opacity: 0;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
svg {
  width: 1em;
  height: 1em;
  flex: none;
}
/* ---------- carregando ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at 50% 40%, #241c66, #10123a 60%, #0a0c2a);
  transition: opacity 0.35s ease;
}
#loader.done {
  opacity: 0;
  pointer-events: none;
}
.ld-gem {
  width: 74px;
  height: 74px;
  position: relative;
  animation: ldSpin 2.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
  background: linear-gradient(135deg, #b8f4ff, #2fd8ff 40%, #a274ff 70%, #4b2aa8);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.ld-gem i {
  position: absolute;
  inset: 24%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.15));
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
@keyframes ldSpin {
  0% {
    transform: rotate(0) scale(1);
  }
  45% {
    transform: rotate(90deg) scale(0.9);
  }
  55% {
    transform: rotate(90deg) scale(1.06);
  }
  100% {
    transform: rotate(90deg) scale(1);
  }
}
.ld-name {
  font-family: var(--font);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.12em;
  color: #fff3c4;
  text-shadow: 0 3px 0 #2a1450;
}
.ld-bar {
  width: min(240px, 60vw);
  height: 12px;
  padding: 2px;
  background: #0d1035;
  box-shadow: inset 0 0 0 1.5px #3a4290;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
}
.ld-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2fd8ff, #a274ff, #ffc14d);
  transition: width 0.25s ease;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 50%, calc(100% - 4px) 100%, 4px 100%, 0 50%);
}
html.reduced .ld-gem {
  animation: none;
}
#safe-probe {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  visibility: hidden;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
/* ---------- formas facetadas ---------- */
.facet {
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
/* ---------- botoes ---------- */
.btn {
  --c1: #343a9a;
  --c2: #232873;
  white-space: nowrap;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3), inset 0 -5px 0 rgba(0, 0, 30, 0.38);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.08s ease;
}
.btn svg {
  width: 20px;
  height: 20px;
}
.btn:hover {
  filter: brightness(1.12);
}
.btn:active {
  transform: translateY(3px) scale(0.985);
  filter: brightness(0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 0 rgba(0, 0, 30, 0.38), inset 0 3px 6px rgba(0, 0, 30, 0.25);
}
.btn.primary {
  --c1: #ffd36e;
  --c2: #ff8a4c;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -5px 0 rgba(150, 50, 10, 0.45);
  color: #2a1205;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.btn.shine::after, .title-actions .btn.primary::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: sweep 2.8s ease-in-out 0.6s infinite;
  pointer-events: none;
}
@keyframes sweep {
  0%, 60% {
    left: -60%;
  }
  100% {
    left: 130%;
  }
}
@media (hover: hover) {
  .btn:hover {
    transform: scale(1.03);
  }
  .btn:hover:active {
    transform: translateY(3px) scale(0.985);
  }
}
.btn.primary:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(150, 50, 10, 0.45), inset 0 3px 6px rgba(120, 40, 0, 0.25);
}
.btn.big {
  min-height: 58px;
  font-size: 21px;
  font-weight: 700;
  padding: 0 30px;
  --cut: 13px;
}
.btn.small {
  min-height: 42px;
  font-size: 14px;
  padding: 0 14px;
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.icon-btn {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: rgba(30, 34, 96, 0.82);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.08s ease, background 0.15s;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}
.icon-btn:hover {
  background: rgba(48, 54, 130, 0.92);
}
.icon-btn:active {
  transform: translateY(2px) scale(0.95);
  filter: brightness(0.9);
}
/* dentro dos cartoes: fundo mais escuro com contorno (o botao nao some no painel) */
.card .card-head .icon-btn {
  position: relative;
  background: rgba(150, 160, 255, 0.35);
  box-shadow: none;
}
.card .card-head .icon-btn::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: #0c0e33;
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
  transition: background 0.15s;
}
.card .card-head .icon-btn:hover::before {
  background: #1a1d55;
}
.card .card-head .icon-btn svg {
  position: relative;
}
/* ---------- HUD ---------- */
/* cores do capitulo (gelo, geodo, forja e os 7 seguintes): bordas, selo da fase, brilhos e textos secundarios acompanham o cenario */
:root, body.th-geode {
  --acc: #a98bff;
  --acc-hi: #efe8ff;
  --acc-lo: #4b38b0;
  --acc-rgb: 169, 139, 255;
  --hud-soft: #b9b0e8;
  --hud-top: rgba(44, 36, 112, 0.95);
  --hud-bot: rgba(15, 12, 50, 0.97);
  --badge-1: #d7c8ff;
  --badge-2: #7a5cf0;
  --badge-3: #2e1f86;
}
body.th-ice {
  --acc: #66d6ff;
  --acc-hi: #e6f9ff;
  --acc-lo: #1b5d92;
  --acc-rgb: 102, 214, 255;
  --hud-soft: #a5cfe4;
  --hud-top: rgba(20, 60, 98, 0.95);
  --hud-bot: rgba(7, 25, 48, 0.97);
  --badge-1: #c6f3ff;
  --badge-2: #2fa8e6;
  --badge-3: #0d4677;
}
body.th-forge {
  --acc: #ffa552;
  --acc-hi: #fff0d6;
  --acc-lo: #8f3b1c;
  --acc-rgb: 255, 165, 82;
  --hud-soft: #e2bfa9;
  --hud-top: rgba(74, 30, 44, 0.95);
  --hud-bot: rgba(30, 11, 24, 0.97);
  --badge-1: #ffe0a8;
  --badge-2: #f07a2f;
  --badge-3: #7c2716;
}
body.th-emerald {
  --acc: #3fe0a5;
  --acc-hi: #e0fff2;
  --acc-lo: #12735a;
  --acc-rgb: 63, 224, 165;
  --hud-soft: #a6dcc8;
  --hud-top: rgba(16, 72, 62, 0.95);
  --hud-bot: rgba(5, 30, 27, 0.97);
  --badge-1: #c6ffe9;
  --badge-2: #22c48e;
  --badge-3: #0b5a45;
}
body.th-coral {
  --acc: #ff7f86;
  --acc-hi: #fff0f0;
  --acc-lo: #93323f;
  --acc-rgb: 255, 127, 134;
  --hud-soft: #e6b7c0;
  --hud-top: rgba(18, 62, 80, 0.95);
  --hud-bot: rgba(6, 26, 38, 0.97);
  --badge-1: #ffd1d4;
  --badge-2: #ff6577;
  --badge-3: #8a1f33;
}
body.th-amber {
  --acc: #ffc04d;
  --acc-hi: #fff5d6;
  --acc-lo: #8a5a12;
  --acc-rgb: 255, 192, 77;
  --hud-soft: #e5cfa0;
  --hud-top: rgba(70, 50, 18, 0.95);
  --hud-bot: rgba(30, 20, 6, 0.97);
  --badge-1: #ffe9b0;
  --badge-2: #f0a422;
  --badge-3: #6e4308;
}
body.th-obsidian {
  --acc: #ff4f6a;
  --acc-hi: #ffe3e8;
  --acc-lo: #851427;
  --acc-rgb: 255, 79, 106;
  --hud-soft: #e0aab4;
  --hud-top: rgba(52, 16, 30, 0.95);
  --hud-bot: rgba(20, 5, 12, 0.97);
  --badge-1: #ffc2cc;
  --badge-2: #e8304f;
  --badge-3: #6a0a1c;
}
body.th-neon {
  --acc: #ff5fd7;
  --acc-hi: #ffe6f8;
  --acc-lo: #7d1a6b;
  --acc-rgb: 255, 95, 215;
  --hud-soft: #dcb0d6;
  --hud-top: rgba(48, 18, 72, 0.95);
  --hud-bot: rgba(18, 6, 32, 0.97);
  --badge-1: #ffc9f0;
  --badge-2: #e23cbf;
  --badge-3: #5e0e54;
}
body.th-storm {
  --acc: #d4ff4f;
  --acc-hi: #f8ffe0;
  --acc-lo: #5f7a12;
  --acc-rgb: 212, 255, 79;
  --hud-soft: #c8d6a6;
  --hud-top: rgba(30, 40, 52, 0.95);
  --hud-bot: rgba(10, 14, 20, 0.97);
  --badge-1: #f0ffc0;
  --badge-2: #b6e02a;
  --badge-3: #4a5e0c;
}
body.th-prism {
  --acc: #ffd36e;
  --acc-hi: #fff8e0;
  --acc-lo: #7a5410;
  --acc-rgb: 255, 211, 110;
  --hud-soft: #d9cfa8;
  --hud-top: rgba(36, 28, 86, 0.95);
  --hud-bot: rgba(12, 9, 36, 0.97);
  --badge-1: #fff0c0;
  --badge-2: #f5b630;
  --badge-3: #6a4a0a;
}
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
/* o painel engole toques: tocar no placar ou entre botoes nunca vira disparo */
.hud-panel {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}
.hud-stat b, .volley-info, .res-score > span, .res-stats b {
  font-variant-numeric: tabular-nums;
}
/* painel facetado: borda em degrade na cor do capitulo + vidro escuro por dentro (duas camadas recortadas) */
.gp {
  --c: 12px;
  --bw: 1.5px;
  position: relative;
  isolation: isolate;
}
.gp::before, .gp::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.gp::before {
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--acc-hi), var(--acc) 22%, rgba(var(--acc-rgb), 0.45) 70%, var(--acc-lo));
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}
.gp::after {
  inset: var(--bw);
  z-index: -1;
  --ci: calc(var(--c) - 0.6px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 34%),
    radial-gradient(120% 90% at 50% -10%, rgba(var(--acc-rgb), 0.16), transparent 60%),
    linear-gradient(180deg, var(--hud-top), var(--hud-bot));
  clip-path: polygon(var(--ci) 0, calc(100% - var(--ci)) 0, 100% var(--ci), 100% calc(100% - var(--ci)), calc(100% - var(--ci)) 100%, var(--ci) 100%, 0 calc(100% - var(--ci)), 0 var(--ci));
}
.hud .gp {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 12, 0.5));
}
.hud .hud-panel {
  position: absolute;
}
/* .gp e relative: os paineis continuam presos no lugar calculado */
/* botoes da HUD: placa sempre visivel (afunda ao tocar) */
.hud-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--text);
  transition: transform 0.08s ease, color 0.15s;
}
.hud-btn svg {
  width: 20px;
  height: 20px;
  position: relative;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 20, 0.6));
}
.hud-btn::before {
  content: '';
  position: absolute;
  inset: 4px;
  transition: filter 0.15s;
  background: linear-gradient(180deg, rgba(var(--acc-rgb), 0.24), rgba(var(--acc-rgb), 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.hud-btn:hover::before, .hud-btn:focus-visible::before {
  filter: brightness(1.5);
}
.hud-btn:active {
  transform: translateY(1px) scale(0.93);
}
.hud-btn:active::before {
  filter: brightness(1.8);
}
/* selo da fase: octogono de cristal com o numero */
.lvl-badge {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(160deg, var(--badge-1), var(--badge-2) 45%, var(--badge-3));
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}
.lvl-badge::before {
  content: '';
  position: absolute;
  inset: 3px;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.35), transparent 45%), linear-gradient(180deg, var(--badge-2), var(--badge-3));
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}
.lvl-badge b {
  position: relative;
  font-weight: 700;
  font-size: 19px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 30, 0.55), 0 0 10px rgba(var(--acc-rgb), 0.6);
}
.hud-level {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}
.lvl-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}
.lvl-cap {
  font-size: 11px;
  font-weight: 600;
  color: rgba(var(--acc-rgb), 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* cristais restantes e progresso da limpeza */
.hud-stat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}
.hud-stat .lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--hud-soft);
  white-space: nowrap;
}
.gem-ring {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.gem-ring > svg {
  grid-area: 1 / 1;
}
.gem-ring .ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gem-ring .track {
  fill: none;
  stroke: rgba(var(--acc-rgb), 0.22);
  stroke-width: 3.2;
}
.gem-ring .fill {
  fill: none;
  stroke: var(--acc);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 106.8;
  stroke-dashoffset: 106.8;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 0 3px rgba(var(--acc-rgb), 0.8));
}
.gem-ring .gem {
  width: 17px;
  height: 17px;
  color: var(--acc-hi);
  filter: drop-shadow(0 0 5px rgba(var(--acc-rgb), 0.9));
}
.gem-ring .done {
  width: 19px;
  height: 19px;
  color: #fff;
  opacity: 0;
  transform: scale(0.4);
}
.hud-stat.alive.cleared .gem {
  opacity: 0;
  transform: scale(0.4);
  transition: 0.18s;
}
.hud-stat.alive.cleared .done {
  opacity: 1;
  transform: none;
  transition: 0.3s cubic-bezier(0.2, 1.8, 0.4, 1) 0.08s;
  filter: drop-shadow(0 0 6px rgba(var(--acc-rgb), 1));
}
.hud-stat.alive.cleared .gem-ring {
  animation: gemClear 0.6s ease;
}
@keyframes gemClear {
  30% {
    transform: scale(1.35);
    filter: brightness(1.8);
  }
}
.hud-stat.alive .txt {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.hud-stat.alive b {
  font-size: 19px;
  color: var(--text);
}
.hud-stat.alive .bar {
  display: none;
}
/* reforcos a caminho: seta descendo + quantas linhas ainda entram por cima */
.hud-stat.alive .waves {
  display: flex;
  align-items: center;
  gap: 3px;
  font-style: normal;
  color: var(--acc-hi);
}
.hud-stat.alive .waves[hidden] {
  display: none;
}
.hud-stat.alive .waves svg {
  width: 16px;
  height: 16px;
  color: var(--acc);
  filter: drop-shadow(0 0 4px rgba(var(--acc-rgb), 0.7));
}
.hud-stat.alive .waves b {
  font-size: 15px;
  min-width: 0;
  color: var(--acc-hi);
}
.hud-stat.alive .waves.bump svg {
  animation: waveDrop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes waveDrop {
  from {
    transform: translateY(-6px);
    opacity: 0.3;
  }
}
.hud.landscape .hud-stat.alive .waves {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  margin-bottom: 2px;
}
.hud.landscape .hud-stat.alive .waves svg {
  width: 20px;
  height: 20px;
}
.hud.landscape .hud-stat.alive .waves b {
  font-size: 20px;
}
.hud-stat.score {
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1;
}
.hud-stat.score b {
  font-size: 22px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fffbe8 10%, #ffd36e 55%, #ff9f2e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(60, 20, 0, 0.6)) drop-shadow(0 0 8px rgba(255, 170, 60, 0.35));
}
.hud-stat.score.long b {
  font-size: 18px;
}
.hud-stat.best {
  display: none;
}
.hud-hint {
  display: none;
}
.hud-stat.bump {
  animation: bump 0.25s ease;
}
@keyframes bump {
  40% {
    transform: scale(1.14);
  }
}
.hud-stat.alive.bump .gem-ring {
  animation: gemHit 0.35s ease;
}
@keyframes gemHit {
  35% {
    transform: scale(1.25) rotate(-8deg);
    filter: brightness(1.6);
  }
}
/* entrada da HUD a cada fase: barras deslizam da borda (cima/baixo no celular, lados no computador) */
.hud.enter:not(.landscape) .hud-panel.a {
  animation: hudInTop 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}
.hud.enter:not(.landscape) .hud-panel.b > .slot {
  animation: hudInBottom 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}
.hud.enter:not(.landscape) .hud-panel.b > .slot-c {
  animation-delay: 0.06s;
}
.hud.enter:not(.landscape) .hud-panel.b > .slot-r {
  animation-delay: 0.12s;
}
.hud.enter.landscape .hud-panel.a {
  animation: hudInLeft 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
}
.hud.enter.landscape .hud-panel.b {
  animation: hudInRight 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.1) 0.05s both;
}
@keyframes hudInTop {
  from {
    translate: 0 -120%;
    opacity: 0;
  }
}
@keyframes hudInBottom {
  from {
    translate: 0 120%;
    opacity: 0;
  }
}
@keyframes hudInLeft {
  from {
    translate: -40px 0;
    opacity: 0;
  }
}
@keyframes hudInRight {
  from {
    translate: 40px 0;
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hud.enter .hud-panel, .hud.enter .slot {
    animation: none !important;
  }
}
/* ---- celular (retrato): barra de cima em duas faixas ----
   [pausa][ajustes] | [selo] nome da fase ............ placar
                    |        ◆ 13 ▓▓▓▓▓▓▓░░░░░░░░░░░░░ (quanto da fase ja foi limpo) */
.hud:not(.landscape) .hud-panel.a {
  --c: 12px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) 22px;
  column-gap: 0;
  row-gap: 0;
  align-items: center;
  padding: 5px 12px 7px 4px;
}
.hud:not(.landscape) .hud-btns {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 0;
  padding-right: 6px;
  margin-right: 8px;
  position: relative;
}
.hud:not(.landscape) .hud-btns::after {
  content: '';
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(var(--acc-rgb), 0.55), transparent);
}
.hud:not(.landscape) .hud-btn {
  width: 44px;
  height: 52px;
}
/* area de toque 44 x 52 (a placa visivel e menor) */
.hud:not(.landscape) .hud-btn::before {
  inset: 8px 5px;
}
.hud:not(.landscape) .hud-level {
  display: contents;
}
.hud:not(.landscape) .lvl-badge {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  margin-right: 10px;
}
.hud:not(.landscape) .lvl-badge b {
  font-size: 20px;
}
.hud:not(.landscape) .lvl-text {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  padding-right: 6px;
}
.hud:not(.landscape) .lvl-cap {
  display: none;
}
/* nome numa linha so em todas as fases (a letra diminui ate caber, ver fitName) */
.hud:not(.landscape) .hud-name {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hud:not(.landscape) .hud-stats, .hud:not(.landscape) .hud-foot {
  display: contents;
}
.hud:not(.landscape) .hud-stat.score {
  grid-column: 4;
  grid-row: 1;
  width: 76px;
  align-self: center;
}
.hud:not(.landscape) .hud-stat.score .lbl {
  font-size: 11.5px;
}
.hud:not(.landscape) .hud-stat.alive {
  grid-column: 3 / 5;
  grid-row: 2;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 6px;
}
.hud:not(.landscape) .hud-stat.alive .gem-ring {
  width: 18px;
  height: 18px;
}
.hud:not(.landscape) .hud-stat.alive .ring {
  display: none;
}
.hud:not(.landscape) .hud-stat.alive .gem {
  width: 16px;
  height: 16px;
}
.hud:not(.landscape) .hud-stat.alive .done {
  width: 16px;
  height: 16px;
}
.hud:not(.landscape) .hud-stat.alive .lbl {
  display: none;
}
.hud:not(.landscape) .hud-stat.alive b {
  font-size: 16px;
  min-width: 20px;
}
.hud:not(.landscape) .hud-stat.alive .bar {
  display: block;
  height: 7px;
  background: rgba(var(--acc-rgb), 0.28);
  box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), 0.45);
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
}
/* fase limpa: o numero sai (um "0" com visto se contradiz); fica o selo com visto e a barra cheia brilhando */
.hud:not(.landscape) .hud-stat.alive.cleared b {
  display: none;
}
.hud:not(.landscape) .hud-stat.alive.cleared .gem-ring {
  width: 22px;
  height: 22px;
  margin: -2px 0;
}
.hud:not(.landscape) .hud-stat.alive.cleared .done {
  width: 14px;
  height: 14px;
}
.hud-stat.alive .bar i {
  position: relative;
  display: block;
  height: 100%;
  width: 0;
  overflow: hidden;
  background: linear-gradient(90deg, var(--acc-lo), var(--acc), var(--acc-hi));
  box-shadow: 0 0 8px rgba(var(--acc-rgb), 0.8);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hud-stat.alive.cleared .bar {
  filter: drop-shadow(0 0 5px rgba(var(--acc-rgb), 0.9));
}
.hud-stat.alive.cleared .bar i::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  left: -40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  animation: barSweep 0.7s ease-out 0.15s 2;
}
@keyframes barSweep {
  to {
    left: 110%;
  }
}
/* selo de fase limpa: disco na cor do capitulo com visto escuro, entra crescendo */
.hud-stat.alive.cleared .gem-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--acc-hi), var(--acc) 60%);
  box-shadow: 0 0 10px rgba(var(--acc-rgb), 0.9);
  animation: sealIn 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes sealIn {
  from {
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.3);
  }
}
.hud-stat.alive.cleared .done {
  color: #06122e;
  filter: none !important;
  z-index: 1;
}
/* barra de baixo: Pulso | rajada e estrelas | velocidade (larguras fixas: nada pula de lugar) */
/* os cartoes de 60 px encostam no topo da faixa (12 px da arena, igual a barra de cima); a legenda do Pulso fica embaixo do orbe */
.hud-panel.b {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
}
.hud-panel.b .slot-l {
  grid-column: 1;
  justify-self: start;
  display: flex;
}
.hud-panel.b .slot-c {
  grid-column: 2;
  justify-self: center;
  display: grid;
}
.hud-panel.b .slot-c > * {
  grid-area: 1 / 1;
}
.hud-panel.b .slot-r {
  grid-column: 3;
  justify-self: end;
}
.foot-well {
  display: none;
}
/* faixa escura atras da barra de baixo (a lava e os raios do cenario nao passam por tras da legenda do Pulso) */
.hud:not(.landscape)::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--scrim-top, 100%);
  background: linear-gradient(180deg, rgba(2, 2, 16, 0), rgba(2, 2, 16, 0.62) 22%, rgba(2, 2, 16, 0.72));
  pointer-events: none;
}
.hud-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hud:not(.landscape) .hud-panel.b::before, .hud:not(.landscape) .hud-panel.b::after {
  display: none;
}
.hud:not(.landscape) .hud-panel.b {
  filter: none;
}
.volley-info {
  --c: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 186px;
  height: 60px;
  padding: 4px 14px 5px;
  text-align: center;
}
.vi-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}
#hud-volley {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.star-meter {
  display: inline-flex;
  gap: 4px;
  margin: 3px 0 2px;
}
.star-meter .sm {
  width: 19px;
  height: 19px;
  --sf-l: rgba(255, 255, 255, 0.1);
  --sf-d: rgba(255, 255, 255, 0.05);
  --sf-o: rgba(255, 214, 110, 0.32);
}
.star-meter .sm.on {
  --sf-l: #fff1b0;
  --sf-d: #f5a623;
  --sf-o: #6b3a00;
  filter: drop-shadow(0 0 4px rgba(255, 190, 70, 0.6));
}
.star-meter .sm.lose {
  animation: starLose 0.7s cubic-bezier(0.5, 0, 0.8, 0.6);
}
/* estrela pousando: clarao branco-dourado que assenta no ouro (nunca escurece) */
.star-meter .sm.land {
  animation: starLand 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.star-meter {
  position: relative;
}
.star-meter.bump {
  animation: meterBump 0.3s ease;
}
@keyframes meterBump {
  40% {
    transform: scale(1.15);
  }
}
@keyframes starLose {
  0% {
    transform: scale(1.5);
    color: #ff9a8a;
  }
  25% {
    transform: scale(1.3) rotate(-12deg);
    color: #ffd36e;
  }
  100% {
    transform: translateY(14px) rotate(40deg) scale(0.6);
    opacity: 0;
  }
}
@keyframes starLand {
  0% {
    transform: scale(1.45);
    --sf-l: #ffffff;
    --sf-d: #fff6c9;
    --sf-o: #ffe7a0;
    filter: drop-shadow(0 0 12px #ffd36e) drop-shadow(0 0 4px #fff6c9);
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(255, 190, 70, 0.6));
  }
}
/* vitoria: encaixes vazios ate a estrela chegar */
.star-meter.collect .sm:not(.got) {
  --sf-of: rgba(0, 0, 0, 0.35);
  --sf-o: rgba(255, 211, 110, 0.6);
  --sf-l: transparent;
  --sf-d: transparent;
  --sf-h: transparent;
  filter: none;
}
/* encaixe fundo, nao estrela perdida */
.star-burst.mini i {
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  background: #fff6c9;
  transform: rotate(var(--a)) translateY(-10px) rotate(45deg);
  animation: starSparkMini 0.42s ease-out forwards;
}
@keyframes starSparkMini {
  to {
    transform: rotate(var(--a)) translateY(-30px) rotate(45deg) scale(0.2);
    opacity: 0;
  }
}
#hud-par {
  font-size: 12px;
  color: var(--hud-soft);
  font-weight: 700;
}
.vi-hint {
  display: none;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.22;
  color: var(--acc-hi);
  overflow: hidden;
  display: none;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.volley-info.hinting .vi-main {
  display: none;
}
.volley-info.hinting .vi-hint {
  display: -webkit-box;
  animation: fadeIn 0.3s ease;
}
.star-legend {
  display: none;
}
/* perigo: a proxima descida perde — o cartao da rajada fica vermelho */
.hud.danger .volley-info::before {
  background: linear-gradient(180deg, #ffd0da, #ff3d6e 30%, rgba(255, 61, 110, 0.5) 70%, #7a1030);
  animation: dangerRim 0.9s ease-in-out infinite;
}
@keyframes dangerRim {
  50% {
    filter: brightness(1.6);
  }
}
/* velocidade: no 1x a divisa de tras apagada; no 2x as duas acesas, correndo, e o botao aceso */
.speed-btn {
  --c: 10px;
  --chev1: 0.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 62px;
  height: 60px;
  color: var(--text);
  transition: transform 0.08s ease;
}
.speed-btn svg {
  width: 22px;
  height: 22px;
  color: var(--acc-hi);
}
.speed-btn b {
  font-size: 15px;
  line-height: 1;
}
.speed-btn:active {
  transform: translateY(1px) scale(0.94);
}
.speed-btn .auto-tag {
  display: none;
  position: absolute;
  top: 3px;
  right: 3px;
  padding: 1px 5px 2px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.1;
  color: #04122e;
  background: var(--acc-hi);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.speed-btn.auto .auto-tag {
  display: block;
}
.speed-btn.auto {
  padding-top: 6px;
}
.speed-btn[aria-pressed='true'] {
  --chev1: 1;
  color: #fff;
}
.speed-btn[aria-pressed='true']::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 45%), linear-gradient(180deg, rgba(var(--acc-rgb), 0.55), rgba(var(--acc-rgb), 0.22)), linear-gradient(180deg, var(--hud-top), var(--hud-bot));
}
.speed-btn[aria-pressed='true'] svg {
  color: #fff;
  animation: chevrons 0.5s linear infinite;
  filter: drop-shadow(0 0 5px rgba(var(--acc-rgb), 1));
}
@keyframes chevrons {
  50% {
    transform: translateX(2px);
    opacity: 0.75;
  }
}
/* recolher bolas: a acao "agora" e laranja, como Jogar e Proxima; ocupa o lugar do cartao da rajada */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pill.end {
  position: relative;
  width: 186px;
  height: 60px;
  justify-content: center;
  padding: 0 12px;
  color: #2a1205;
  font-weight: 700;
  background: linear-gradient(180deg, #ffe08a, #ffb24a 55%, #ff8a3d);
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.7), inset 0 -4px 0 rgba(150, 50, 10, 0.45);
  animation: slideUp 0.16s ease-out, endGlow 1.6s ease-in-out 0.2s infinite;
}
.pill.end svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.pill.end span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  text-align: left;
}
.pill.end b {
  font-size: 15px;
}
.pill.end small {
  font-size: 11.5px;
  font-weight: 700;
  color: #6b2a08;
}
.pill.end:active {
  transform: translateY(2px) scale(0.97);
}
@keyframes endGlow {
  50% {
    filter: brightness(1.1) drop-shadow(0 0 10px rgba(255, 170, 70, 0.7));
  }
}
@keyframes slideUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}
@keyframes popIn {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
/* Pulso: orbe de vidro; os seis segmentos de carga SAO o aro. Vazio: apagado. Carregado: aceso e respirando.
   Armado: nucleo ciano com raio branco. Legenda embaixo, fora do orbe. */
.pulse-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #7fe9ff;
  transition: transform 0.1s ease;
}
.pulse-btn .orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.16), transparent 40%), radial-gradient(circle at 50% 58%, #183a7a, #0a1540 72%);
  box-shadow: 0 5px 12px rgba(0, 0, 12, 0.55), inset 0 0 0 1px rgba(127, 233, 255, 0.18);
}
.pulse-btn .orb > svg {
  grid-area: 1 / 1;
}
.pulse-ring {
  width: 100%;
  height: 100%;
}
.pulse-ring .trk {
  fill: none;
  stroke: rgba(4, 10, 40, 0.9);
  stroke-width: 5;
}
.pulse-icon {
  position: relative;
  width: 24px;
  height: 24px;
  opacity: 0.45;
}
.pulse-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--hud-soft);
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 16, 0.9);
}
.pulse-lock {
  display: none;
  width: 14px;
  height: 14px;
  margin: 24px 0 0 24px;
  color: #c9c6ef;
}
/* celular: orbe + legenda centrados na altura dos cartoes de 60 px */
.hud:not(.landscape) .pulse-btn {
  margin-top: -3px;
}
.pulse-btn:active {
  transform: scale(0.94);
}
.pulse-btn.locked .orb {
  filter: saturate(0.2) brightness(0.7);
}
.pulse-btn.locked .pulse-icon {
  opacity: 0.4;
}
.pulse-btn.locked .pulse-lock {
  display: block;
}
.pulse-btn.charged {
  animation: chargedBreath 1.4s ease-in-out infinite;
}
.pulse-btn.charged .orb {
  background: radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.4), transparent 40%), radial-gradient(circle at 50% 60%, #3aa8f2, #10408f 74%);
  box-shadow: 0 0 16px 2px rgba(127, 233, 255, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.pulse-btn.charged .pulse-icon {
  opacity: 1;
  color: #fff;
  filter: drop-shadow(0 0 6px rgba(127, 233, 255, 1));
}
.pulse-btn.charged .pulse-label {
  color: #c9f6ff;
}
@keyframes chargedBreath {
  50% {
    transform: scale(1.06);
  }
}
.pulse-btn.armed {
  animation: none;
}
.pulse-btn.armed .orb {
  background: radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.85), transparent 42%), radial-gradient(circle at 50% 60%, #a8f2ff, #2a8fe0 78%);
  box-shadow: 0 0 0 3px #e9fdff, 0 0 22px 6px rgba(127, 233, 255, 0.75);
}
.pulse-btn.armed .pulse-icon {
  opacity: 1;
  color: #fff;
  filter: drop-shadow(0 0 1.5px #04224e) drop-shadow(0 0 1px #04224e);
}
.pulse-btn.armed .pulse-label {
  color: #e9fdff;
}
.pulse-btn.ready-pop {
  animation: readyPop 0.6s ease;
}
.pulse-btn.orb-hit .orb {
  animation: orbHit 0.18s ease;
}
@keyframes orbHit {
  50% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
}
@keyframes readyPop {
  30% {
    transform: scale(1.25);
  }
  60% {
    transform: scale(0.95);
  }
}
/* ---- computador (paisagem): dois cartoes da altura da arena ----
   esquerda: botoes, fase, dica, cristais ........ poco com o placar
   direita:  rajada + estrelas, escada da meta ... (recolher) poco com Pulso e velocidade
   os dois pocos tem a mesma altura: as linhas de cima deles ficam alinhadas entre os cartoes */
.hud.landscape {
  --foot-h: 138px;
}
.hud.landscape .hud-panel {
  --c: 16px;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px 18px 20px;
}
.hud.landscape .hud-btns {
  display: flex;
  gap: 8px;
}
.hud.landscape .hud-btn {
  --c: 8px;
  width: 46px;
  height: 46px;
}
.hud.landscape .hud-btn::before {
  inset: 0;
  background: linear-gradient(180deg, var(--acc-hi), var(--acc) 30%, var(--acc-lo));
  box-shadow: none;
}
.hud.landscape .hud-btn::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 45%), linear-gradient(180deg, var(--hud-top), var(--hud-bot));
  clip-path: polygon(7.4px 0, calc(100% - 7.4px) 0, 100% 7.4px, 100% calc(100% - 7.4px), calc(100% - 7.4px) 100%, 7.4px 100%, 0 calc(100% - 7.4px), 0 7.4px);
}
.hud.landscape .hud-btn svg {
  z-index: 1;
}
.hud.landscape .hud-level {
  flex: none;
  gap: 12px;
  padding-top: 2px;
  min-height: 60px;
}
.hud.landscape .lvl-badge {
  width: 60px;
  height: 60px;
}
.hud.landscape .lvl-badge b {
  font-size: 27px;
}
.hud.landscape .lvl-cap {
  font-size: 12.5px;
}
.hud.landscape .hud-name {
  font-size: 20px;
  line-height: 1.12;
  -webkit-line-clamp: 2;
}
.hud.landscape .hud-hint {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.38;
  color: #e2e0ff;
  background: linear-gradient(90deg, rgba(var(--acc-rgb), 0.16), rgba(var(--acc-rgb), 0.04));
  border-left: 2px solid var(--acc);
}
.hud.landscape .hud-hint svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  color: var(--acc);
}
.hud.landscape .hud-hint.empty {
  display: none;
}
.hud.landscape .hud-stats {
  display: contents;
}
/* cristais logo depois da dica (24 px); o unico vao fica entre eles e o poco do placar */
.hud.landscape .hud-stat.alive {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 10px;
  margin-top: 10px;
}
.hud.landscape .gem-ring {
  width: 42px;
  height: 42px;
}
.hud.landscape .gem-ring .gem {
  width: 19px;
  height: 19px;
}
.hud.landscape .hud-stat .lbl {
  font-size: 12.5px;
}
.hud.landscape .hud-stat.alive b {
  font-size: 26px;
  margin-top: 3px;
}
.hud.landscape .hud-stat.alive .bar {
  display: block;
  grid-column: 1 / -1;
  height: 8px;
  background: rgba(var(--acc-rgb), 0.28);
  box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), 0.45);
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
}
.hud.landscape .hud-stat.alive.cleared .done {
  width: 22px;
  height: 22px;
}
.hud.landscape .hud-stat.alive.cleared b {
  color: var(--acc-hi);
  text-shadow: 0 0 10px rgba(var(--acc-rgb), 0.8);
}
/* faixa do capitulo: as cinco fases dele com as melhores estrelas; a atual acesa */
.hud-chapter {
  display: none;
}
.hud.landscape .hud-chapter {
  display: block;
  margin-top: 10px;
}
.hud.landscape .hud-panel.a.no-ch .hud-chapter {
  display: none;
}
/* com a faixa do capitulo visivel, o nome do capitulo fica so nela (sem repetir em cima do nome da fase) */
.hud.landscape:not(.tight) .hud-panel.a:not(.no-ch) .lvl-cap {
  display: none;
}
.hud.landscape .ch-head small {
  font-size: 13px;
  color: rgba(var(--acc-rgb), 0.95);
}
.hud.landscape .ch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hud-soft);
}
.hud.landscape .ch-head span {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #ffe7a0;
}
.hud.landscape .ch-head span svg {
  margin-right: 4px;
}
.hud.landscape .ch-head svg {
  width: 14px;
  height: 14px;
}
.hud.landscape .ch-head b {
  display: inline-block;
}
.hud.landscape .ch-head b.bump {
  animation: chBump 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes chBump {
  40% {
    transform: scale(1.2);
    color: #fff;
  }
}
.hud.landscape .pips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
/* largura vem da coluna, nunca do conteudo */
.hud.landscape .pip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 7px;
  min-width: 0;
  background: rgba(var(--acc-rgb), 0.09);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
.hud.landscape .pip b {
  font-size: 15px;
  line-height: 1;
  color: var(--text);
}
.hud.landscape .pip i {
  display: flex;
  gap: 1px;
}
.hud.landscape .pip i svg {
  width: 9.5px;
  height: 9.5px;
  --sf-l: rgba(255, 255, 255, 0.16);
  --sf-d: rgba(255, 255, 255, 0.08);
  --sf-o: rgba(255, 214, 110, 0.3);
}
.hud.landscape .pip i svg.on {
  --sf-l: #fff1b0;
  --sf-d: #f5a623;
  --sf-o: #6b3a00;
}
.hud.landscape .pip.now {
  background: linear-gradient(180deg, rgba(var(--acc-rgb), 0.5), rgba(var(--acc-rgb), 0.2));
  box-shadow: inset 0 -2px 0 var(--acc);
}
.hud.landscape .pip.locked {
  opacity: 0.4;
}
/* poco: chanfro 10, fundo na cor do capitulo bem leve e contorno de 1 px (duas camadas recortadas) */
.hud.landscape .well {
  position: relative;
  isolation: isolate;
}
.hud.landscape .well::before, .hud.landscape .well::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.hud.landscape .well::before {
  inset: 0;
  z-index: -2;
  background: rgba(var(--acc-rgb), 0.3);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.hud.landscape .well::after {
  inset: 1px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(var(--acc-rgb), 0.1), rgba(var(--acc-rgb), 0.05)), rgba(4, 4, 24, 0.55);
  clip-path: polygon(9.6px 0, calc(100% - 9.6px) 0, 100% 9.6px, 100% calc(100% - 9.6px), calc(100% - 9.6px) 100%, 9.6px 100%, 0 calc(100% - 9.6px), 0 9.6px);
}
.hud.landscape .hud-foot {
  margin-top: auto;
  height: var(--foot-h);
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
}
.hud.landscape .hud-stat.score {
  align-items: flex-start;
  gap: 4px;
}
.hud.landscape .hud-stat.score b {
  font-size: 38px;
}
.hud.landscape .hud-stat.score.long b {
  font-size: 32px;
}
.hud.landscape .hud-stat.best {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  font-size: 14px;
  color: #d9d6ff;
}
.hud.landscape .hud-stat.best svg {
  width: 15px;
  height: 15px;
  color: #ffd36e;
}
.hud.landscape .hud-stat.best b {
  margin-left: auto;
  font-size: 15px;
  color: #fff3c4;
}
.hud-stat.best .nb {
  display: none;
  font-style: normal;
}
/* passou do recorde durante a fase: a linha vira um selo ambar com o recorde antigo (o novo ja e o placar) */
.hud.landscape .hud-stat.best.beaten {
  isolation: isolate;
  align-self: flex-start;
  height: 28px;
  padding: 0 12px 0 10px;
  color: #ffd36e;
  filter: drop-shadow(0 0 6px rgba(255, 190, 70, 0.45));
  animation: popIn 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}
/* mesmo selo de contorno dourado do cartao de resultado */
.hud.landscape .hud-stat.best.beaten::before, .hud.landscape .hud-stat.best.beaten::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.hud.landscape .hud-stat.best.beaten::before {
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #ffe08a, #e89a3c);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.hud.landscape .hud-stat.best.beaten::after {
  inset: 1.5px;
  z-index: -1;
  background: var(--hud-bot);
  clip-path: polygon(5.4px 0, calc(100% - 5.4px) 0, 100% 5.4px, 100% calc(100% - 5.4px), calc(100% - 5.4px) 100%, 5.4px 100%, 0 calc(100% - 5.4px), 0 5.4px);
}
.hud.landscape .hud-stat.best.beaten .lbl {
  display: none;
}
.hud.landscape .hud-stat.best.beaten .nb {
  display: inline;
  font-size: 13px;
  font-weight: 700;
}
.hud.landscape .hud-stat.best.beaten svg {
  color: #ffd36e;
}
.hud.landscape .hud-stat.best.beaten b {
  display: none;
}
.hud.landscape .hud-stat.best .nb, .hud.landscape .hud-stat.best .lbl {
  white-space: nowrap;
}
/* cartao da direita: grade de 4 colunas (o par Pulso + velocidade fica centrado no poco) */
.hud.landscape .hud-panel.b {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  grid-template-rows: auto auto 1fr var(--foot-h);
  column-gap: 0;
  row-gap: 16px;
  align-items: center;
}
.hud.landscape .hud-panel.b .slot {
  justify-self: auto;
}
.hud.landscape .hud-panel.b .slot-c {
  display: contents;
}
.hud.landscape .volley-info {
  display: contents;
}
.hud.landscape .vi-main {
  grid-area: 1 / 1 / 2 / -1;
}
.hud.landscape .star-legend {
  grid-area: 2 / 1 / 3 / -1;
}
.hud.landscape .volley-info::before, .hud.landscape .volley-info::after {
  display: none;
}
.hud.landscape .vi-hint, .hud.landscape .volley-info.hinting .vi-hint {
  display: none !important;
}
.hud.landscape .volley-info.hinting .vi-main {
  display: flex;
}
.hud.landscape #hud-volley {
  font-size: 24px;
}
.hud.landscape .star-meter {
  gap: 10px;
  margin: 10px 0 2px;
}
.hud.landscape .star-meter .sm {
  width: 44px;
  height: 44px;
}
.hud.landscape #hud-par {
  display: none;
}
/* escada da meta: tres degraus de 44 px com as mesmas estrelas facetadas; o degrau atual aceso */
.hud.landscape .star-legend {
  display: grid;
  gap: 10px;
  width: 100%;
}
.hud.landscape .star-legend .lg {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--hud-soft);
  background: rgba(var(--acc-rgb), 0.06);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  transition: background 0.3s, opacity 0.3s;
}
.hud.landscape .star-legend i {
  display: flex;
  gap: 3px;
}
.hud.landscape .star-legend .ls {
  width: 18px;
  height: 18px;
}
.hud.landscape .star-legend b {
  font-weight: 700;
  text-align: right;
}
.hud.landscape .star-legend .lg.now {
  background: linear-gradient(90deg, rgba(var(--acc-rgb), 0.38), rgba(var(--acc-rgb), 0.14));
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--acc);
}
.hud.landscape .star-legend .lg.gone {
  opacity: 0.4;
}
.hud.landscape .star-legend .lg.gone .ls {
  --sf-l: rgba(255, 255, 255, 0.16);
  --sf-d: rgba(255, 255, 255, 0.08);
  --sf-o: rgba(255, 214, 110, 0.35);
}
.hud.landscape .star-legend .lg.gone b {
  text-decoration: line-through;
}
.hud.danger.landscape .star-legend .lg.now {
  background: linear-gradient(90deg, rgba(255, 61, 110, 0.4), rgba(255, 61, 110, 0.12));
  box-shadow: inset 2px 0 0 #ff3d6e;
}
/* recolher: aparece no vao logo acima do poco (lugar sempre reservado, nada se mexe) */
.hud.landscape #btn-end {
  grid-area: 3 / 1 / 4 / -1;
  align-self: end;
  width: 100%;
  height: 58px;
}
.hud.landscape #btn-end.idle {
  visibility: hidden;
  animation: none;
}
/* poco de baixo: Pulso e velocidade centrados, 24 px entre eles */
.hud.landscape .foot-well {
  display: block;
  grid-area: 4 / 1 / 5 / -1;
  align-self: stretch;
}
.hud.landscape .hud-panel.b .slot-l, .hud.landscape .hud-panel.b .slot-r {
  grid-row: 4;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud.landscape .hud-panel.b .slot-l {
  grid-column: 2;
}
.hud.landscape .hud-panel.b .slot-r {
  grid-column: 3;
  margin-left: 24px;
}
.hud.landscape .pulse-btn .orb {
  width: 84px;
  height: 84px;
}
.hud.landscape .pulse-icon {
  width: 34px;
  height: 34px;
}
.hud.landscape .pulse-lock {
  width: 17px;
  height: 17px;
  margin: 38px 0 0 38px;
}
.hud.landscape .pulse-btn.armed .orb {
  box-shadow: 0 0 0 3px #e9fdff, 0 0 14px 3px rgba(127, 233, 255, 0.75);
}
.hud.landscape .pulse-btn.charged .orb {
  box-shadow: 0 0 12px 1px rgba(127, 233, 255, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.hud.landscape .pulse-label {
  font-size: 13px;
}
.hud.landscape .speed-btn {
  width: 68px;
  height: 62px;
}
.hud.landscape .speed-btn b {
  font-size: 16px;
}
/* tela baixa (celular deitado): sem dica e sem escada, controles menores, pocos mais baixos */
.hud.landscape.tight {
  --foot-h: 104px;
}
.hud.landscape.tight .hud-panel {
  gap: 10px;
  padding: 12px 12px 14px;
}
.hud.landscape.tight .hud-btn {
  width: 40px;
  height: 40px;
}
.hud.landscape.tight .hud-level {
  min-height: 44px;
}
.hud.landscape.tight .lvl-badge {
  width: 44px;
  height: 44px;
}
.hud.landscape.tight .lvl-badge b {
  font-size: 20px;
}
.hud.landscape.tight .hud-name {
  font-size: 15px;
}
.hud.landscape.tight .hud-hint, .hud.landscape.tight .hud-chapter {
  display: none;
}
/* escada compacta (degraus de 26 px); some se o cartao nao tiver altura */
.hud.landscape.tight .star-legend {
  gap: 4px;
}
.hud.landscape.tight .star-legend .lg {
  height: 26px;
  padding: 0 10px;
  font-size: 13px;
}
.hud.landscape.tight .star-legend .ls {
  width: 13px;
  height: 13px;
}
.hud.landscape .hud-panel.b.no-lg .star-legend {
  display: none;
}
.hud.landscape.tight .hud-stat.alive {
  margin-top: 0;
  row-gap: 6px;
}
.hud.landscape.tight .gem-ring {
  width: 34px;
  height: 34px;
}
.hud.landscape.tight .hud-stat.alive b {
  font-size: 20px;
}
.hud.landscape.tight .hud-foot {
  padding: 8px 12px;
  gap: 4px;
}
.hud.landscape.tight .hud-stat.score b {
  font-size: 28px;
}
.hud.landscape.tight .hud-panel.b {
  row-gap: 10px;
}
.hud.landscape.tight #hud-volley {
  font-size: 18px;
}
.hud.landscape.tight .star-meter .sm {
  width: 30px;
  height: 30px;
}
.hud.landscape.tight #btn-end {
  height: 48px;
}
.hud.landscape.tight .pulse-btn .orb {
  width: 64px;
  height: 64px;
}
.hud.landscape.tight .pulse-icon {
  width: 26px;
  height: 26px;
}
.hud.landscape.tight .pulse-lock {
  margin: 28px 0 0 28px;
}
.hud.landscape.tight .hud-panel.b .slot-r {
  margin-left: 14px;
}
.hud.landscape.tight .speed-btn {
  width: 58px;
  height: 54px;
}
/* ---------- telas ---------- */
/* telas grandes: o conteudo dos menus cresce inteiro (o fundo continua cobrindo a tela) */
.screen > * {
  zoom: var(--ui-z, 1);
}
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal));
}
.screen.modal {
  background: rgba(6, 6, 30, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.card {
  --cut: 18px;
  position: relative;
  isolation: isolate;
  width: min(420px, 100%);
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 12, 0.55));
  animation: cardIn 0.32s cubic-bezier(0.2, 1.4, 0.4, 1);
}
/* mesmo vidro facetado da HUD: borda na cor do capitulo + fundo escuro (duas camadas recortadas) */
.card::before, .card::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.card::before {
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--acc-hi), var(--acc) 18%, rgba(var(--acc-rgb), 0.45) 65%, var(--acc-lo));
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.card::after {
  inset: 2px;
  z-index: -1;
  --ci: calc(var(--cut) - 0.8px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 22%),
    radial-gradient(110% 60% at 50% -5%, rgba(var(--acc-rgb), 0.22), transparent 62%),
    linear-gradient(180deg, var(--hud-top), var(--hud-bot));
  clip-path: polygon(var(--ci) 0, calc(100% - var(--ci)) 0, 100% var(--ci), 100% calc(100% - var(--ci)), calc(100% - var(--ci)) 100%, var(--ci) 100%, 0 calc(100% - var(--ci)), 0 var(--ci));
}
@keyframes cardIn {
  from {
    transform: translateY(18px) scale(0.94);
  }
}
.card h2 {
  margin: 0;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
}
.card .sub {
  margin: -4px 0 0;
  text-align: center;
  color: var(--soft);
  font-size: 15px;
}
.card .row {
  display: flex;
  gap: 10px;
}
.card .row .btn {
  flex: 1;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head h2 {
  text-align: left;
  font-size: 26px;
}
.toggle-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}
/* titulo */
.screen.title {
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 32%, rgba(14, 12, 48, 0.7), rgba(6, 6, 30, 0.42) 75%);
}
/* a demo atras fica a meia luz: o titulo manda */
.title-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(520px, 100%);
}
.logo-scrim {
  position: absolute;
  left: -15%;
  right: -15%;
  top: -12%;
  height: clamp(190px, 54vw, 340px);
  background: radial-gradient(ellipse at 50% 52%, rgba(12, 10, 40, 0.92), rgba(12, 10, 40, 0.6) 45%, rgba(12, 10, 40, 0) 75%);
  pointer-events: none;
}
.logo {
  position: relative;
}
body.menu canvas#game, body.menu canvas#post {
  filter: blur(2.5px) saturate(0.85);
}
.logo {
  width: calc(100% - 48px);
  margin-inline: auto;
  height: clamp(140px, 40vw, 270px);
  cursor: pointer;
}
.tagline {
  position: relative;
  margin: -6px 0 14px;
  color: #c9d0ff;
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 8px rgba(8, 8, 36, 0.9);
}
.title-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.title-actions .btn.big {
  min-width: min(300px, 86%);
}
.title-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(300px, 86%);
}
/* tres botoes numa linha so: icone em cima, nome embaixo (nada sobra sozinho numa segunda linha) */
.title-row .btn {
  flex-direction: column;
  gap: 4px;
  min-height: 66px;
  padding: 8px 4px;
  font-size: 14px;
  min-width: 0;
}
.title-row .btn svg {
  width: 22px;
  height: 22px;
}
.title-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-weight: 600;
}
.title-meta svg {
  color: var(--amber);
}
.title-meta svg.tr {
  color: #c9c2ff;
}
.title-meta .sep {
  width: 4px;
  height: 4px;
  background: var(--soft);
  border-radius: 50%;
  opacity: 0.5;
}
.tap-start {
  display: none;
}
.screen.title.splash {
  cursor: pointer;
}
.screen.title.splash .title-actions {
  display: none;
}
.screen.title.splash .tap-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(20px, 5.4vw, 26px);
  font-weight: 700;
  padding: 14px 26px;
  color: #fff3c4;
  animation: tapPulse 1.3s ease-in-out infinite;
}
.screen.title.splash .tap-start svg {
  width: 32px;
  height: 32px;
  color: var(--amber);
  filter: drop-shadow(0 0 8px rgba(255, 180, 60, 0.8));
  animation: tapFinger 1.3s ease-in-out infinite;
}
@keyframes tapPulse {
  50% {
    transform: scale(1.06);
    opacity: 0.78;
  }
}
@keyframes tapFinger {
  40% {
    transform: translateY(5px) scale(0.92);
  }
}
.screen.title.reveal .title-actions > * {
  animation: rise 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.screen.title.reveal .title-actions > *:nth-child(2) {
  animation-delay: 0.06s;
}
.screen.title.reveal .title-actions > *:nth-child(3) {
  animation-delay: 0.12s;
}
@keyframes rise {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
}
.corner-tools {
  position: absolute;
  right: calc(12px + var(--sar));
  bottom: calc(12px + var(--sab));
  display: flex;
  gap: 8px;
  align-items: center;
}
@media (max-aspect-ratio: 1/1) {
  .corner-tools {
    right: 0;
    left: 0;
    justify-content: center;
  }
}
.lang-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 10px;
  background: rgba(30, 34, 96, 0.82);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.lang-pick svg {
  width: 20px;
  height: 20px;
}
.lang-pick select, .select select {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 0;
  outline-offset: 2px;
}
.lang-pick select option, .select select option {
  color: #f4f1ff;
  background: #141748;
}
.lang-pick select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 22px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffc94d' stroke-width='2.2'/%3E%3C/svg%3E") no-repeat right 4px center;
}
/* folha (fases, visuais) */
@keyframes irisIn {
  from {
    clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
  }
  to {
    clip-path: polygon(50% -75%, 175% 50%, 50% 175%, -75% 50%);
  }
}
/* cortina facetada que abre ao entrar numa fase */
#wipe {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  display: none;
}
#wipe.run {
  display: block;
}
#wipe::before, #wipe::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 54%;
  background: linear-gradient(180deg, #1b1f5c, #0d0f33);
}
#wipe::before {
  left: 0;
  clip-path: polygon(0 0, 100% 0, 90% 50%, 100% 100%, 0 100%);
  animation: shutL 0.5s cubic-bezier(0.65, 0, 0.25, 1) 0.05s forwards;
  box-shadow: inset -3px 0 0 #7fe9ff;
}
#wipe::after {
  right: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10% 50%);
  animation: shutR 0.5s cubic-bezier(0.65, 0, 0.25, 1) 0.05s forwards;
  box-shadow: inset 3px 0 0 #7fe9ff;
}
@keyframes shutL {
  to {
    transform: translateX(-105%);
  }
}
@keyframes shutR {
  to {
    transform: translateX(105%);
  }
}
.fly-star {
  position: fixed;
  z-index: 30;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  color: #ffd36e;
  filter: drop-shadow(0 0 8px rgba(255, 190, 70, 0.9));
  pointer-events: none;
}
/* estrelas da vitoria: por cima da HUD, por baixo das telas (pausa no meio do voo nao deixa estrela por cima do cartao) */
.fly-star.hud {
  z-index: 6;
  filter: drop-shadow(0 0 3px #fff6c9) drop-shadow(0 0 12px rgba(255, 200, 80, 0.95));
  will-change: transform;
}
.star-trail {
  position: fixed;
  z-index: 6;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  pointer-events: none;
  background: #fff6c9;
  box-shadow: 0 0 8px 2px rgba(255, 200, 80, 0.9);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: trailFade 0.5s ease-out forwards;
}
@keyframes trailFade {
  to {
    transform: scale(0.2) rotate(90deg);
    opacity: 0;
  }
}
.screen.sheet {
  flex-direction: column;
  justify-content: flex-start;
  background: rgba(8, 8, 34, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: irisIn 0.38s cubic-bezier(0.3, 0, 0.2, 1);
  gap: 14px;
  overflow: auto;
}
.sheet-head {
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
}
/* com 50 fases a lista rola: o titulo, o fechar e as estrelas ficam presos no alto */
#scr-levels {
  --sheet-pad: calc(16px + var(--sat));
}
#scr-levels .sheet-head {
  position: sticky;
  top: calc(-1 * var(--sheet-pad));
  z-index: 3;
  margin: calc(-1 * var(--sheet-pad)) 0 0;
  padding: var(--sheet-pad) 0 18px;
  background: linear-gradient(180deg, rgb(10, 10, 34) 0 78%, rgba(10, 10, 34, 0) 100%);
}
.sheet-head h2 {
  margin: 0;
  flex: 1;
  font-size: 28px;
}
.sheet-stars {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 18px;
}
.sheet-stars svg {
  color: var(--amber);
  width: 20px;
  height: 20px;
}
.level-grid {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, 1.8vw, 12px);
  padding-bottom: 12px;
}
@media (min-aspect-ratio: 5/4) {
  .level-grid {
    width: min(760px, 100%);
  }
  .sheet-head {
    width: min(760px, 100%);
  }
}
/* cabecalho do capitulo: faixa com a cor da gema do capitulo, nome e estrelas dele */
.ch-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 2px;
  padding: 8px 14px 8px 16px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ch) 30%, transparent), color-mix(in srgb, var(--ch) 6%, transparent));
  box-shadow: inset 4px 0 0 var(--ch);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  animation: rise 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  animation-delay: calc(var(--i) * 25ms);
}
.ch-title:first-child {
  margin-top: 2px;
}
.ch-title span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ch-title small {
  font-size: 12px;
  font-weight: 700;
  color: color-mix(in srgb, var(--ch) 70%, #fff);
}
.ch-title em {
  display: flex;
  align-items: center;
  gap: 5px;
  font-style: normal;
  font-size: 15px;
  color: #ffe7a8;
  flex: none;
}
.ch-title em svg {
  width: 16px;
  height: 16px;
  color: #ffd36a;
}
.ch-title .lock {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.55);
  flex: none;
}
.ch-title.locked {
  color: rgba(255, 255, 255, 0.62);
}
.lvl {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  animation: rise 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  animation-delay: calc(var(--i) * 25ms);
  transition: transform 0.1s ease, filter 0.15s;
}
.lvl canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lvl:hover {
  filter: brightness(1.12);
  transform: scale(1.03);
}
.lvl:active {
  transform: scale(0.95);
}
.lvl b {
  position: relative;
  margin-top: -10%;
  font-size: clamp(17px, 5vw, 30px);
  font-weight: 700;
  color: #fff;
  -webkit-text-stroke: 4px #140c2e;
  paint-order: stroke fill;
}
.lvl .stars {
  position: absolute;
  bottom: -4%;
  display: flex;
  gap: 2px;
  padding: 2px 5px;
  background: rgba(10, 8, 40, 0.85);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
}
.lvl .stars svg {
  width: clamp(9px, 2.6vw, 15px);
  height: clamp(9px, 2.6vw, 15px);
  color: transparent;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2px;
}
.lvl .stars svg.on {
  color: #ffd36a;
  stroke: #7a4a10;
  stroke-width: 1px;
  filter: drop-shadow(0 0 3px rgba(255, 200, 80, 0.9));
}
.lvl.locked {
  opacity: 0.6;
}
.lvl.locked canvas {
  filter: saturate(0.15) brightness(0.55);
}
.lvl.perfect canvas {
  filter: drop-shadow(0 0 1px #ffd36e) drop-shadow(0 0 1px #ffd36e);
}
.lvl .play-badge {
  position: absolute;
  top: -4%;
  right: -4%;
  width: clamp(18px, 5vw, 26px);
  height: clamp(18px, 5vw, 26px);
  display: grid;
  place-items: center;
  color: #2a1205;
  background: linear-gradient(180deg, #ffe08a, #ffa64c);
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
}
.lvl .play-badge svg {
  width: 55%;
  height: 55%;
  margin-left: 2px;
}
.lvl.locked b {
  color: #c9cdf0;
  font-size: clamp(15px, 4.4vw, 26px);
}
.lvl.locked svg.lock {
  position: absolute;
  bottom: 8%;
  width: clamp(11px, 3vw, 18px);
  height: clamp(11px, 3vw, 18px);
  color: #e3e9ff;
}
.lvl.current {
  animation: rise 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both, nextPulse 1.3s ease-in-out 0.5s infinite;
}
@keyframes nextPulse {
  0%, 100% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 2px #ffc14d) drop-shadow(0 0 2px #ffc14d);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.15) drop-shadow(0 0 2px #ffe08a) drop-shadow(0 0 14px rgba(255, 190, 70, 0.75));
  }
}
.skin-grid {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .skin-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.skin {
  --cut: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px 12px;
  background: linear-gradient(180deg, rgba(40, 44, 120, 0.95), rgba(22, 24, 74, 0.95));
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.16);
}
.skin canvas {
  width: 100%;
  height: 84px;
}
.skin .in-use {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
  color: #2a1205;
  background: linear-gradient(180deg, #fff3c4, #ffd36e);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.skin .in-use svg {
  width: 18px;
  height: 18px;
}
.skin .bar-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.skin .bar-row span {
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
}
.skin .btn {
  margin-top: auto;
}
.skin b {
  font-size: 17px;
}
.skin small {
  color: var(--soft);
  font-size: 13px;
  text-align: center;
  min-height: 16px;
}
.skin.on {
  background: linear-gradient(180deg, rgba(86, 70, 190, 0.98), rgba(40, 34, 120, 0.98));
}
.skin.on small {
  color: #fff3c4;
  font-weight: 700;
}
.skin .btn {
  width: 100%;
}
.skin .btn.ad {
  --c1: #34349a;
  --c2: #23236e;
  color: #fff;
}
.skin .btn.ad .chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #2a1205;
  background: #ffd36a;
  border-radius: 4px;
}
.skin .bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.skin .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffd36a, #ff9f4a);
}
.skin {
  position: relative;
}
.skin.locked canvas {
  filter: saturate(0.85);
}
.skin.fresh {
  animation: reveal 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) 0.2s both;
}
.skin.fresh::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%) no-repeat;
  background-size: 250% 100%;
  opacity: 0;
  animation: revealShine 1.2s ease 0.5s 2;
  pointer-events: none;
}
@keyframes reveal {
  0% {
    transform: scale(0.6) rotate(-4deg);
    filter: brightness(2.2);
  }
  60% {
    transform: scale(1.06);
    filter: brightness(1.3);
  }
  100% {
    transform: none;
    filter: none;
  }
}
@keyframes revealShine {
  0% {
    background-position: 120% 0;
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    background-position: -120% 0;
    opacity: 0;
  }
}
.skin .new-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #04122e;
  background: linear-gradient(180deg, #b8f4ff, #2fd8ff);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
  animation: popIn 0.3s ease 0.6s both;
}
.skin .lock-badge {
  position: absolute;
  top: 24px;
  right: 20px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: #c9c2ff;
}
.skin.on::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff3c4;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut), 0 var(--cut), 3px calc(var(--cut) + 1px), 3px calc(100% - var(--cut) - 1px), calc(var(--cut) + 1px) calc(100% - 3px), calc(100% - var(--cut) - 1px) calc(100% - 3px), calc(100% - 3px) calc(100% - var(--cut) - 1px), calc(100% - 3px) calc(var(--cut) + 1px), calc(100% - var(--cut) - 1px) 3px, calc(var(--cut) + 1px) 3px, 3px calc(var(--cut) + 1px), 0 var(--cut));
  pointer-events: none;
}
/* resultado */
.results {
  overflow: visible;
  padding-top: 30px;
}
/* espaco em cima para o Rico que espia por cima do cartao (nunca encosta no topo da janela) */
#scr-results {
  padding-top: calc(var(--sat) + 76px * var(--ui-z, 1));
}
/* cartoes do jogo (resultado, pausa) na cor do capitulo: botoes secundarios e subtitulo */
:root, body.th-geode {
  --btn-1: #3d3a9e;
  --btn-2: #262473;
}
body.th-ice {
  --btn-1: #1d5a8a;
  --btn-2: #113a60;
}
body.th-forge {
  --btn-1: #873a26;
  --btn-2: #561f15;
}
body.th-emerald {
  --btn-1: #1c6b57;
  --btn-2: #0f4436;
}
body.th-coral {
  --btn-1: #1d5a6e;
  --btn-2: #103a48;
}
body.th-amber {
  --btn-1: #7a5418;
  --btn-2: #4d330b;
}
body.th-obsidian {
  --btn-1: #6e1a2c;
  --btn-2: #44101b;
}
body.th-neon {
  --btn-1: #5c2380;
  --btn-2: #3a1554;
}
body.th-storm {
  --btn-1: #33475a;
  --btn-2: #1e2b38;
}
body.th-prism {
  --btn-1: #3f3590;
  --btn-2: #272060;
}
#scr-results .btn:not(.primary):not(.use), #scr-pause .btn:not(.primary) {
  --c1: var(--btn-1);
  --c2: var(--btn-2);
}
#scr-results .sub {
  color: var(--hud-soft);
}
/* o Rico espia por cima do cartao, feliz */
.res-rico {
  position: absolute !important;
  left: 50%;
  top: -66px;
  width: 132px;
  height: 72px;
  margin-left: -66px;
  pointer-events: none;
  z-index: -3 !important;
}
/* atras do cartao: a borda corta a base exatamente na linha do aro */
.results.lost .res-rico {
  top: -62px;
}
.results h2 {
  font-size: 28px;
  line-height: 1.12;
  background: linear-gradient(180deg, #fff6c9, #ffc24a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #2a1450);
}
.results.lost h2 {
  background: linear-gradient(180deg, #ffd6e0, #ff8fa8);
  -webkit-background-clip: text;
  background-clip: text;
}
.results.lost .row {
  flex-direction: column;
}
.card .row .btn.big {
  font-size: clamp(16px, 4.6vw, 21px);
  padding: 0 14px;
}
.res-stars {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  margin: 4px 0 20px;
}
.res-stars .slot {
  z-index: 1;
}
.res-stars .slot {
  position: relative;
  width: 78px;
  height: 78px;
}
.res-stars .slot.s2 {
  width: 98px;
  height: 98px;
  margin-bottom: 10px;
}
.res-stars .slot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* contorno fica sempre por baixo: o lugar da estrela nunca some */
.res-stars .bg {
  color: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 214, 110, 0.38);
  stroke-width: 0.9px;
  stroke-linejoin: round;
  transform: scale(0.85);
}
.res-stars .star {
  opacity: 0;
}
.res-stars .star.on {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(255, 190, 70, 0.7));
  animation: starIn 0.3s cubic-bezier(0.3, 0, 0.3, 1) both;
}
#res-title.pop {
  animation: titlePop 0.42s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes titlePop {
  from {
    transform: scale(1.35);
    filter: brightness(1.6) drop-shadow(0 2px 0 #2a1450);
  }
}
@keyframes starIn {
  0% {
    transform: scale(1.9) rotate(-22deg);
    opacity: 0;
  }
  55% {
    transform: scale(0.9) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.star-burst {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}
.star-confetti {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: -1;
}
/* o confete das estrelas passa atras dos textos do cartao (na frente so do fundo) */
.results > * {
  position: relative;
  z-index: 2;
}
.results > .res-stars {
  z-index: 1;
}
.perfect-stamp {
  position: absolute;
  top: 2px;
  right: 0;
  z-index: 3;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #2a1205;
  background: linear-gradient(180deg, #fff1b8, #ffc14d);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  transform: rotate(8deg);
  animation: stampIn 0.34s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  pointer-events: none;
}
/* "Perfeito!": faixa com pontas dobradas passando por baixo das tres estrelas */
.res-stars > .perfect-stamp {
  z-index: 0;
  top: auto;
  right: auto;
  bottom: -19px;
  left: 50%;
  width: 236px;
  margin-left: -118px;
  padding: 3px 0 4px;
  text-align: center;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  clip-path: none;
  transform: none;
  color: #3a1a02;
  background: none;
  animation: bannerIn 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
/* faixa (::after) na frente das pontas dobradas (::before), as duas atras do texto */
.res-stars > .perfect-stamp::before, .res-stars > .perfect-stamp::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.res-stars > .perfect-stamp::after {
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #ffe9a6, #ffc14d 60%, #f0a12e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(150, 70, 10, 0.35);
}
.res-stars > .perfect-stamp::before {
  left: -18px;
  right: -18px;
  top: 7px;
  height: 100%;
  z-index: -2;
  background: linear-gradient(180deg, #e8952a, #a95a16);
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%, 9px 50%);
}
.res-stars > .perfect-stamp svg {
  width: 11px;
  height: 11px;
  margin: 0 9px;
  vertical-align: 1px;
  color: #fffbe8;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9));
}
@keyframes bannerIn {
  from {
    transform: scaleX(0.15);
    opacity: 0;
  }
  60% {
    transform: scaleX(1.05);
    opacity: 1;
  }
  to {
    transform: none;
  }
}
@keyframes stampIn {
  from {
    transform: rotate(-10deg) scale(2.4);
    opacity: 0;
  }
  to {
    transform: rotate(8deg) scale(1);
    opacity: 1;
  }
}
@keyframes stampInC {
  from {
    transform: rotate(-12deg) scale(2.4);
    opacity: 0;
  }
  to {
    transform: rotate(-3deg) scale(1);
    opacity: 1;
  }
}
.star-confetti i {
  position: absolute;
  left: -4px;
  top: -5px;
  width: 8px;
  height: 10px;
  opacity: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: burstUp 1.25s cubic-bezier(0.2, 0.7, 0.4, 1) var(--w) forwards;
}
@keyframes burstUp {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 1;
  }
  40% {
    transform: translate(var(--x), var(--y)) rotate(calc(var(--r) * 0.5));
    opacity: 1;
  }
  100% {
    transform: translate(calc(var(--x) * 1.25), calc(var(--y) + 150px)) rotate(var(--r));
    opacity: 0;
  }
}
.star-burst i {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  background: #ffe7a0;
  box-shadow: 0 0 8px rgba(255, 200, 90, 0.9);
  transform: rotate(var(--a)) translateY(-18px) rotate(45deg);
  animation: starSpark 0.5s ease-out forwards;
}
@keyframes starSpark {
  to {
    transform: rotate(var(--a)) translateY(-52px) rotate(45deg) scale(0.2);
    opacity: 0;
  }
}
/* recorde: selo pequeno so com contorno dourado (o ouro cheio fica com estrelas, placar e Proxima) */
.res-score small.ribbon {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 11px 0 9px;
  color: #ffd36e;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  animation: ribbonIn 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) 0.75s both;
}
.res-score small.ribbon svg {
  width: 13px;
  height: 13px;
}
.res-score small.ribbon::before, .res-score small.ribbon::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.res-score small.ribbon::before {
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #ffe08a, #e89a3c);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.res-score small.ribbon::after {
  inset: 1.5px;
  z-index: -1;
  background: var(--hud-bot);
  clip-path: polygon(5.4px 0, calc(100% - 5.4px) 0, 100% 5.4px, 100% calc(100% - 5.4px), calc(100% - 5.4px) 100%, 5.4px 100%, 0 calc(100% - 5.4px), 0 5.4px);
}
@keyframes ribbonIn {
  from {
    transform: scale(0.2) rotate(-8deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.res-skin {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(var(--acc-rgb), 0.12), rgba(var(--acc-rgb), 0.04)), rgba(4, 4, 24, 0.4);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.res-skin .nm {
  color: var(--hud-soft);
  white-space: nowrap;
}
.res-skin .bar {
  height: 8px;
  background: rgba(4, 4, 24, 0.6);
  box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), 0.45);
  border-radius: 2px;
  overflow: hidden;
}
.res-skin .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffc14d, #ffe08a);
  transition: width 0.6s cubic-bezier(0.3, 0, 0.2, 1);
}
.res-skin b {
  color: var(--amber);
  white-space: nowrap;
}
/* placar centrado embaixo das estrelas; o selo de recorde vem logo abaixo dele */
.res-score {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  row-gap: 6px;
}
.res-score > span {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, #fffbe8 10%, #ffd36e 55%, #ff9f2e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(60, 20, 0, 0.6));
}
.res-score small {
  color: var(--hud-soft);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}
.res-score small:empty {
  display: none;
}
.res-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.res-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: linear-gradient(180deg, rgba(var(--acc-rgb), 0.14), rgba(var(--acc-rgb), 0.04));
  box-shadow: inset 0 1px 0 rgba(var(--acc-rgb), 0.35);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.res-stats small {
  color: var(--hud-soft);
  font-size: 12px;
  font-weight: 600;
}
.res-stats b {
  font-size: 20px;
}
.res-note {
  margin: -2px 0 0;
  text-align: center;
  font-size: 12px;
  color: #9c97c8;
}
/* segunda chance: selo "Anuncio" dentro do botao principal */
.btn.continue {
  gap: 12px;
}
.btn.continue .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff4dc;
  background: rgba(120, 40, 0, 0.55);
  border-radius: 4px;
  text-shadow: none;
}
.btn.continue .chip svg {
  width: 12px;
  height: 12px;
}
/* posicao no ranking: mesmo selo de contorno do recorde, na cor do capitulo, ao lado dele; toca e abre o ranking */
.res-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.res-chips:not(:has(> :not([hidden]):not(:empty))) {
  display: none;
}
.rank-chip {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px 0 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--acc-hi);
  animation: popIn 0.3s ease;
}
.rank-chip::before, .rank-chip::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.rank-chip::before {
  inset: 0;
  z-index: -2;
  background: var(--acc);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.rank-chip::after {
  inset: 1.5px;
  z-index: -1;
  background: var(--hud-bot);
  clip-path: polygon(5.4px 0, calc(100% - 5.4px) 0, 100% 5.4px, 100% calc(100% - 5.4px), calc(100% - 5.4px) 100%, 5.4px 100%, 0 calc(100% - 5.4px), 0 5.4px);
  transition: background 0.15s;
}
.rank-chip:hover::after {
  background: color-mix(in srgb, var(--acc) 22%, var(--hud-bot));
}
.rank-chip i {
  font-style: normal;
  font-size: 15px;
  line-height: 1;
  margin-left: 2px;
}
.rank-chip svg {
  width: 13px;
  height: 13px;
}
/* area de toque maior que o selo */
.rank-chip > span::after {
  content: '';
  position: absolute;
  inset: -9px -4px;
}
.rank-chip.muted {
  background: rgba(30, 34, 96, 0.9);
  color: var(--soft);
}
/* contorno fechado tambem nos chanfros: camada de fora = borda, camada de dentro = fundo (as duas recortadas) */
.unlock-note {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  color: var(--acc-hi);
  font-weight: 600;
  font-size: 14px;
}
.unlock-note::before, .unlock-note::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.unlock-note::before {
  inset: 0;
  z-index: -2;
  background: rgba(var(--acc-rgb), 0.55);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.unlock-note::after {
  inset: 1.5px;
  z-index: -1;
  background: linear-gradient(90deg, rgba(var(--acc-rgb), 0.22), rgba(var(--acc-rgb), 0.07)), var(--hud-bot);
  clip-path: polygon(7.4px 0, calc(100% - 7.4px) 0, 100% 7.4px, 100% calc(100% - 7.4px), calc(100% - 7.4px) 100%, 7.4px 100%, 0 calc(100% - 7.4px), 0 7.4px);
}
.unlock-note .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}
.unlock-note .txt small {
  font-size: 11px;
  font-weight: 700;
  color: var(--hud-soft);
}
.unlock-note .names {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unlock-note .names i {
  font-style: normal;
  color: var(--hud-soft);
}
.unlock-note b {
  color: #fff;
}
.unlock-note .balls {
  display: flex;
  gap: 4px;
  flex: none;
}
.unlock-note canvas.ball {
  width: 22px;
  height: 22px;
}
/* "Usar": botao secundario na cor do capitulo (o laranja fica so para Proxima); 44 px de altura para o dedo */
.unlock-note .btn.use {
  --cut: 8px;
  --c1: var(--acc);
  --c2: var(--acc);
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  color: #fff;
  box-shadow: none;
}
.unlock-note .btn.use::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 50%), var(--acc-lo);
  clip-path: polygon(7.4px 0, calc(100% - 7.4px) 0, 100% 7.4px, 100% calc(100% - 7.4px), calc(100% - 7.4px) 100%, 7.4px 100%, 0 calc(100% - 7.4px), 0 7.4px);
}
.confetti {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}
.confetti.behind {
  position: absolute;
  z-index: 0;
}
.screen.modal > .card {
  position: relative;
  z-index: 1;
}
.confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 12px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: fall var(--d) cubic-bezier(0.3, 0.6, 0.6, 1) var(--w) forwards;
}
@keyframes fall {
  to {
    transform: translate(var(--x), 110vh) rotate(var(--r));
  }
}
/* ranking */
.rank-card {
  width: min(460px, 100%);
}
/* campeao: faixa com o feito em texto claro + dois numeros grandes (total e estrelas) */
.final-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.final-sub {
  --cut: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 16, 0.6);
  background: linear-gradient(90deg, rgba(var(--acc-rgb), 0.1), rgba(var(--acc-rgb), 0.3) 50%, rgba(var(--acc-rgb), 0.1));
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
}
.final-sub svg {
  flex: none;
  width: 24px;
  height: 24px;
  color: #ffd36e;
  filter: drop-shadow(0 0 6px rgba(255, 200, 90, 0.55));
}
.final-stats {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 8px;
}
.final-stats .fs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px 12px;
  background: rgba(0, 0, 18, 0.32);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.final-stats small {
  font-size: 13px;
  font-weight: 700;
  color: var(--acc-hi);
  opacity: 0.85;
}
.final-stats b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 36px;
  line-height: 1.05;
  color: #fff3c4;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(255, 200, 90, 0.35);
}
.final-stats b svg {
  width: 26px;
  height: 26px;
}
.nick-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nick-form label {
  font-size: 14px;
  color: var(--hud-soft);
  font-weight: 700;
}
#btn-nick:disabled {
  filter: saturate(0.4) brightness(0.85);
}
.nick-row {
  display: flex;
  gap: 8px;
}
.nick-row input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  background: rgba(8, 10, 40, 0.8);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  user-select: text;
  -webkit-user-select: text;
}
.nick-row input:focus {
  border-color: var(--amber);
  outline: none;
}
.nick-status {
  margin: 0;
  min-height: 16px;
  font-size: 13px;
  color: var(--mint);
}
.nick-status.error {
  color: #ff9fb4;
}
.nick-form.shake {
  animation: shake 0.35s ease;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
.tabs {
  display: flex;
  gap: 6px;
}
.tab {
  flex: 1;
  height: 40px;
  font-weight: 700;
  color: var(--soft);
  background: rgba(10, 12, 44, 0.6);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.tab.on {
  color: #04122e;
  background: linear-gradient(180deg, #ffd36e, #ffb14d);
}
.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(44vh, 360px);
  overflow-y: auto;
  overflow-x: hidden;
}
.rank-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: rgba(10, 12, 44, 0.55);
  font-weight: 600;
  animation: rise 0.3s ease both;
  animation-delay: calc(var(--i) * 22ms);
}
.rank-row .pos {
  color: var(--soft);
  font-weight: 700;
}
.rank-row:nth-child(1) .pos {
  color: #ffd36e;
}
.rank-row:nth-child(2) .pos {
  color: #dfe6ff;
}
.rank-row:nth-child(3) .pos {
  color: #ffb38a;
}
.rank-row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-row.me {
  background: linear-gradient(90deg, rgba(47, 216, 255, 0.35), rgba(47, 216, 255, 0.12));
  box-shadow: inset 3px 0 0 #7fe9ff;
}
.rank-row.skeleton {
  background: rgba(255, 255, 255, 0.05);
  animation: shimmer 1s ease-in-out infinite alternate;
}
@keyframes shimmer {
  to {
    background: rgba(255, 255, 255, 0.1);
  }
}
.rank-empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--hud-soft);
}
.rank-you {
  margin: 0;
  text-align: center;
  font-weight: 700;
  color: #7fe9ff;
}
.rank-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--hud-soft);
  text-align: center;
}
/* ajustes */
.settings .slider {
  display: grid;
  grid-template-columns: 40px 92px 1fr 42px;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.settings .slider output {
  text-align: right;
  font-size: 14px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.settings .mute {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: #0d1035;
  box-shadow: inset 0 0 0 1.5px #3a4290;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.settings .mute svg {
  width: 20px;
  height: 20px;
}
.settings .mute.muted {
  color: var(--danger);
  box-shadow: inset 0 0 0 1.5px rgba(255, 61, 110, 0.6);
}
.settings .slider:has(.mute.muted) input[type='range'] {
  opacity: 0.45;
}
/* controles proprios (nada de controle nativo do sistema): trilho escuro facetado, cursor ambar */
.settings input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.settings input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(90deg, var(--amber) 0 var(--p, 50%), #0d1035 var(--p, 50%) 100%);
  box-shadow: inset 0 0 0 1px #3a4290;
  border-radius: 2px;
}
.settings input[type='range']::-moz-range-track {
  height: 8px;
  background: #0d1035;
  box-shadow: inset 0 0 0 1px #3a4290;
  border-radius: 2px;
}
.settings input[type='range']::-moz-range-progress {
  height: 8px;
  background: var(--amber);
  border-radius: 2px;
}
.settings input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  background: #ffd36e;
  border: 3px solid #2a1450;
  border-radius: 6px;
  box-shadow: 0 0 0 1.5px rgba(255, 211, 110, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.settings input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ffd36e;
  border: 3px solid #2a1450;
  border-radius: 6px;
}
.settings input[type='range']:focus-visible {
  outline-offset: 0;
}
.settings .check {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}
.settings .check input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  position: relative;
  width: 54px;
  height: 30px;
  margin: 0;
  cursor: pointer;
  background: #3a4290;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  transition: background 0.15s;
}
.settings .check input::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: #0d1035;
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  transition: background 0.15s;
}
.settings .check input::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 20px;
  height: 20px;
  background: #6a72c0;
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  transition: transform 0.15s ease, background 0.15s;
}
.settings .check input:checked, .settings .check input:checked::before {
  background: #ffc94d;
}
.settings .check input:checked::after {
  transform: translateX(24px);
  background: #2a1450;
}
.settings .check:has(input:focus-visible) {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
.settings .select select:focus-visible {
  box-shadow: inset 0 0 0 2px var(--amber);
}
.settings .check input:focus-visible {
  outline: none;
}
.settings .select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  min-height: 44px;
}
.settings .select select {
  -webkit-appearance: none;
  appearance: none;
  min-width: 150px;
  height: 42px;
  padding: 0 36px 0 14px;
  cursor: pointer;
  background: #0d1035 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffc94d' stroke-width='2.2'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 0;
  box-shadow: inset 0 0 0 1.5px #3a4290;
  border-radius: 0;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.settings .select select:focus-visible {
  outline: none;
}
.privacy summary {
  cursor: pointer;
  color: var(--soft);
  font-size: 13px;
}
.privacy p {
  font-size: 13px;
  color: var(--soft);
  margin: 6px 0 0;
}
/* anuncio simulado */
.adcover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
}
.adcover.show {
  display: flex;
}
.ad-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px;
  color: #fff;
}
.ad-count {
  font-size: 46px;
  font-weight: 700;
}
.toast {
  position: fixed;
  left: 50%;
  top: calc(70px + var(--sat));
  z-index: 30;
  transform: translate(-50%, -20px);
  padding: 10px 16px;
  font-weight: 700;
  background: rgba(20, 22, 70, 0.95);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* celular deitado (tela baixa e toque): pede para virar */
.rotate {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px;
  text-align: center;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 30%, #1f3f78, #0b1636 55%, #060a1e);
}
.rotate::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(102, 214, 255, 0.08));
  pointer-events: none;
}
.rotate p {
  margin: 22px 0 0;
  max-width: 460px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}
/* espacos medidos no desenho, nao nas caixas: 20 px do Rico ate a seta, 24 px do celular ate o texto
   (Rico: 6 px vazios em cima e 4 embaixo do canvas; icone: a seta sobe ate a borda de cima e 20 embaixo da caixa de 88) */
.rotate .rot-rico {
  width: 120px;
  height: 66px;
  margin: -6px 0 21px;
}
.rotate .rot-anim {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 2px 0 -20px;
  color: #7fe9ff;
  filter: drop-shadow(0 0 10px rgba(127, 233, 255, 0.55));
}
.rotate .rot-anim svg {
  grid-area: 1 / 1;
}
.rotate .rot-arrow {
  width: 88px;
  height: 88px;
  opacity: 0.85;
  translate: -6px -13px;
}
/* a ponta da seta nao encosta no celular em pe */
.rotate .rot-phone {
  width: 60px;
  height: 60px;
  animation: rotPhone 1.2s cubic-bezier(0.6, 0, 0.3, 1) infinite alternate;
}
@keyframes rotPhone {
  0%, 15% {
    transform: rotate(-90deg);
  }
  85%, 100% {
    transform: rotate(0deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rotate .rot-phone {
    animation: none;
  }
}
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .rotate {
    display: flex;
  }
}
/* menos movimento */
.reduced *, .reduced *::before {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* telas baixas (celular deitado, portal pequeno): cartoes compactos e titulo sem sobreposicao */
@media (max-height: 520px) {
  .card {
    padding: 12px 16px;
    gap: 8px;
    width: min(560px, 100%);
  }
  .card h2 {
    font-size: 24px;
  }
  .results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    align-items: center;
  }
  .results > h2, .results > .sub, .results > .res-stars, .results > .res-score {
    grid-column: 1;
  }
  .results > .res-stats, .results > .rank-chip, .results > .unlock-note, .results > .btn, .results > .row, .results > .res-note {
    grid-column: 2;
  }
  .results > .res-skin {
    grid-column: 1;
    grid-row: 5;
  }
  .results > h2 {
    grid-row: 1;
  }
  .results > .sub {
    grid-row: 2;
  }
  .results > .res-stars {
    grid-row: 3;
  }
  .results > .res-score {
    grid-row: 4;
  }
  .results > .res-stats {
    grid-row: 1 / span 2;
  }
  .results > .btn {
    grid-row: 3;
  }
  .results > .row {
    grid-row: 4;
  }
  .results > .res-note, .results > .rank-chip, .results > .unlock-note {
    grid-row: 5;
  }
  .res-stars .slot {
    width: 44px;
    height: 44px;
  }
  .res-stars .slot.s2 {
    width: 54px;
    height: 54px;
    margin-bottom: 6px;
  }
  .res-rico {
    display: none;
  }
  .results {
    padding-top: 22px;
  }
  #scr-results {
    padding-top: calc(16px + var(--sat));
  }
  .res-stars {
    margin-bottom: 16px;
  }
  .res-stars > .perfect-stamp {
    width: 160px;
    margin-left: -80px;
    font-size: 12px;
    bottom: -14px;
  }
  .res-score > span {
    font-size: 30px;
  }
  .res-stats div {
    padding: 4px;
  }
  .res-stats b {
    font-size: 16px;
  }
  .btn.big {
    min-height: 46px;
    font-size: 18px;
  }
  .btn {
    min-height: 42px;
  }
  .settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
    row-gap: 4px;
  }
  .settings .card-head {
    grid-column: 1 / -1;
  }
  .logo {
    height: clamp(110px, 34vh, 190px);
  }
  .tagline {
    margin: -6px 0 6px;
  }
  .title-actions {
    gap: 8px;
  }
  .corner-tools {
    top: calc(10px + var(--sat));
    bottom: auto;
  }
  .rank-list {
    max-height: 34vh;
  }
}
/* barra estreita (largura da arena abaixo de ~352 px): placar e divisoria mais justos para o nome caber numa linha */
.hud.narrow:not(.landscape) .hud-btns {
  padding-right: 4px;
  margin-right: 5px;
}
.hud.narrow:not(.landscape) .lvl-badge {
  margin-right: 7px;
}
.hud.narrow:not(.landscape) .lvl-text {
  padding-right: 4px;
}
.hud.narrow:not(.landscape) .hud-stat.score {
  width: 64px;
}
.hud.narrow:not(.landscape) .hud-stat.score b {
  font-size: 20px;
}
.hud.narrow:not(.landscape) .hud-stat.score.long b {
  font-size: 16px;
}
@media (max-width: 360px) {
  .btn.big {
    font-size: 19px;
  }
}
