:root {
  --black: #000000;
  --graphite: #141518;
  --graphite-2: #1c1d21;
  --grey: #6b6d71;
  --grey-2: #9a9ca0;
  --off: #ece8e1;
  --line: rgba(236, 232, 225, 0.14);
  --xp: #6fd0f5;
  --hp: #ef5b4c;
  --shield: #9cc2ff;
  --amber: #ffc46b;
  --sans: "Helvetica Neue", "Neue Haas Grotesk Text", "SF Pro Text", Inter, Roboto, "Segoe UI", Arial, 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; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--black);
  color: var(--off);
  font-family: var(--sans);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus { outline: none; }
button:focus-visible { outline: 1px solid var(--off); outline-offset: 3px; }

/* ---------- arena ---------- */
#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: var(--black);
}

#vignette, #hurt, #fade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#vignette {
  background: radial-gradient(ellipse 75% 65% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.7) 100%);
  transition: opacity 1.2s ease;
  opacity: 0.8;
}
body.boss-near #vignette { opacity: 1; background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.88) 100%); }
#hurt {
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 50%, rgba(239, 91, 76, 0.42) 100%);
  opacity: 0;
  will-change: opacity;
}
#fade {
  background: var(--black);
  opacity: 0;
  transition: opacity 0.7s ease;
}
#fade.on { opacity: 0.93; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  padding: calc(var(--sat) + 10px) calc(var(--sar) + 10px) 0 calc(var(--sal) + 16px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  color: var(--grey-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}
#hud.show { opacity: 1; }
#hud .xp {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--sat);
  height: 2px;
  background: rgba(236, 232, 225, 0.06);
}
#hud .xp i {
  display: block;
  height: 100%;
  background: var(--xp);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.12s linear;
  box-shadow: 0 0 8px rgba(127, 224, 196, 0.6);
}
.hud-row {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
}
.hud-hp { display: flex; align-items: center; gap: 9px; }
.hud-hp .bar {
  position: relative;
  width: 88px;
  height: 3px;
  background: rgba(236, 232, 225, 0.1);
  overflow: hidden;
}
.hud-hp .bar i {
  position: absolute;
  inset: 0;
  background: var(--hp);
  transform-origin: 0 50%;
  transition: transform 0.15s ease-out;
}
.hud-hp.hit .bar { animation: hpHit 0.35s ease-out; }
.hud-hp.heal .bar i { animation: hpHeal 0.6s ease-out; }
@keyframes hpHit { 0% { background: rgba(255, 255, 255, 0.85); } 100% { background: rgba(236, 232, 225, 0.1); } }
@keyframes hpHeal { 0% { background: #c9f2bd; } 100% { background: var(--hp); } }
#hpText { color: var(--off); min-width: 2.2em; }

#timer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--off);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.hud-r { display: flex; align-items: center; gap: 2px; }
#lvl { margin-right: 6px; color: var(--off); }

.icon-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--grey-2);
  border-radius: 50%;
}
.icon-btn:active { color: var(--off); background: rgba(236, 232, 225, 0.08); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ic-off { display: none; }
body.muted .icon-btn .ic-on { display: none; }
body.muted .icon-btn .ic-off { display: block; }
.icon-btn.corner {
  position: absolute;
  right: calc(var(--sar) + 10px);
  bottom: calc(var(--sab) + 10px);
}

/* ---------- boss bar ---------- */
#bossbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sab) + 26px);
  width: min(64vw, 340px);
  transform: translate(-50%, 6px);
  display: grid;
  gap: 7px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#bossbar.show { opacity: 1; transform: translate(-50%, 0); }
#bossName { font-size: 11px; letter-spacing: 0.32em; color: var(--grey-2); text-align: center; }
#bossbar .track { height: 2px; background: rgba(236, 232, 225, 0.12); overflow: hidden; }
#bossbar .track i { display: block; height: 100%; background: var(--off); transform-origin: 0 50%; transition: transform 0.1s linear; }
#bossbar.p2 .track i { background: var(--hp); }
/* marcas dos damage gates (70% e 35%) */
#bossbar .track { position: relative; }
#bossbar .track::before, #bossbar .track::after { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--black); z-index: 1; }
#bossbar .track::before { left: 35%; }
#bossbar .track::after { left: 70%; }
#bossbar.p3 #bossName { color: var(--warn); }
/* teto do capítulo: XP cheia e guardada */
#hud.gated #xpFill { background: var(--grey-2); animation: gatePulse 1.4s ease-in-out infinite alternate; }
@keyframes gatePulse { from { opacity: 0.55; } to { opacity: 1; } }
.dbg-balance {
  position: fixed; left: 6px; top: 58px; z-index: 40; margin: 0; padding: 6px 8px; max-width: calc(100vw - 12px);
  font: 10px/1.45 ui-monospace, Menlo, Consolas, monospace; color: var(--grey-2);
  background: rgba(0, 0, 0, 0.6); pointer-events: none; white-space: pre-wrap;
}

/* ---------- toast / hint ---------- */
#toast {
  position: fixed;
  left: 50%;
  top: calc(var(--sat) + 70px);
  transform: translate(-50%, -4px);
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  width: max-content;
  max-width: 86vw;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  z-index: 20;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toastA { font-size: 11px; color: var(--grey-2); letter-spacing: 0.06em; }
#toastB { font-size: 15px; color: var(--off); letter-spacing: 0.28em; padding-left: 0.28em; }
#toast.syn #toastB { color: var(--amber); }
#toastC { display: block; }

#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--sab) + 18vh);
  text-align: center;
  font-size: 13px;
  color: var(--grey-2);
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#hint.show { opacity: 1; }

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sat) + 24px) calc(var(--sar) + 22px) calc(var(--sab) + 24px) calc(var(--sal) + 22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  overflow-y: auto;
  touch-action: pan-y;
}
.screen.show { opacity: 1; visibility: visible; transition: opacity 0.25s ease; }

.btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 19px 20px;
  border: 1px solid var(--off);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--off);
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.btn::before, .btn::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 1px;
  background: var(--off);
}
.btn::before { left: -8px; }
.btn::after { right: -8px; }
.btn:active, .btn.pressed { background: var(--off); color: var(--black); }
@media (hover: hover) { .btn:hover { background: rgba(236, 232, 225, 0.08); } .btn:hover:active { background: var(--off); } }
.btn.ghost { border-color: var(--line); color: var(--grey-2); margin-top: 12px; }
.btn.ghost::before, .btn.ghost::after { display: none; }
.btn.link {
  border: 0;
  margin-top: 14px;
  padding: 12px;
  width: auto;
  color: var(--grey);
  letter-spacing: 0.06em;
  text-indent: 0;
  font-size: 13px;
}
.btn.link::before, .btn.link::after { display: none; }
.btn.link:active { background: none; color: var(--off); }

/* wordmark */
.wordmark { display: block; width: min(76vw, 340px); height: auto; margin: 0 auto; overflow: visible; }
.wordmark.small { width: min(48vw, 200px); }
.wm-strokes { fill: none; stroke: var(--off); stroke-width: 1.05; stroke-linecap: square; stroke-linejoin: miter; }
.wordmark.small .wm-strokes { stroke-width: 1.15; }

/* ---------- menu ---------- */
/* v17: o menu rola como uma página curta — a PRIMEIRA DOBRA (.menu-fold, altura da tela) tem só o menu, o crédito e
   o botão de som; o texto sobre o jogo (.about) vem logo abaixo, ao rolar. Nada se sobrepõe. */
#menu { background: rgba(0, 0, 0, 0.45); display: block; padding: 0; overscroll-behavior: contain; }
.menu-fold {
  position: relative; display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--sat) + 24px) calc(var(--sar) + 22px) calc(var(--sab) + 54px) calc(var(--sal) + 22px);
}
/* centraliza com margens automáticas: se o conteúdo não couber (telas baixas), rola a partir do topo em vez de
   cortar o começo (flex + align-items: center corta o topo quando há overflow) */
.menu-inner { width: 100%; max-width: 380px; text-align: center; margin: auto 0; }
.menu-inner .wordmark .wm-strokes path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.9s cubic-bezier(.6, 0, .2, 1) forwards; }
.menu-inner .wordmark .wm-strokes path:nth-child(2) { animation-delay: 0.05s; }
.menu-inner .wordmark .wm-strokes path:nth-child(3) { animation-delay: 0.1s; }
.menu-inner .wordmark .wm-strokes path:nth-child(4) { animation-delay: 0.15s; }
.menu-inner .wordmark .wm-strokes path:nth-child(5) { animation-delay: 0.2s; }
.menu-inner .wordmark .wm-strokes path:nth-child(6) { animation-delay: 0.25s; }
.menu-inner .wordmark .wm-strokes path:nth-child(7) { animation-delay: 0.3s; }
.menu-inner .wordmark .wm-strokes path:nth-child(8) { animation-delay: 0.35s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.line {
  position: relative;
  width: min(76vw, 340px);
  height: 14px;
  margin: 30px auto 0;
}
.line .rail { position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: rgba(236, 232, 225, 0.28); }
.line .st {
  position: absolute;
  top: 3px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(236, 232, 225, 0.5);
  background: var(--black);
  border-radius: 50%;
  transform: translateX(-50%);
}
.line .st:nth-of-type(2) { left: 0%; }
.line .st:nth-of-type(3) { left: 25%; }
.line .st:nth-of-type(4) { left: 50%; }
.line .st:nth-of-type(5) { left: 75%; }
.line .st.last { left: 100%; width: 11px; height: 11px; top: 1px; border-color: var(--off); background: var(--off); box-shadow: 0 0 0 3px var(--black), 0 0 0 4px rgba(236, 232, 225, 0.4); }
.line .runner {
  position: absolute;
  top: 5px;
  left: 0;
  width: 14px;
  height: 3px;
  background: var(--xp);
  box-shadow: 0 0 10px rgba(127, 224, 196, 0.8);
  animation: run 5.5s cubic-bezier(.55, 0, .35, 1) infinite;
}
@keyframes run {
  0% { left: 0; opacity: 0; }
  6% { opacity: 1; }
  22% { left: calc(25% - 7px); }
  30% { left: calc(25% - 7px); }
  46% { left: calc(50% - 7px); }
  54% { left: calc(50% - 7px); }
  70% { left: calc(75% - 7px); }
  78% { left: calc(75% - 7px); }
  94% { left: calc(100% - 14px); opacity: 1; }
  100% { left: calc(100% - 14px); opacity: 0; }
}
.tag { margin: 26px 0 46px; font-size: 14px; color: var(--grey-2); letter-spacing: 0.01em; }
.best { margin-top: 30px; display: flex; justify-content: center; align-items: baseline; gap: 12px; font-size: 12px; color: var(--grey); }
.best b { font-weight: 400; color: var(--off); font-size: 15px; letter-spacing: 0.06em; }

/* ---------- level up ---------- */
#levelup { background: rgba(0, 0, 0, 0.72); }
.lu-inner { width: 100%; max-width: 420px; }
.lu-head { font-size: 13px; color: var(--grey-2); margin-bottom: 18px; display: flex; align-items: baseline; gap: 10px; }
.lu-head b { color: var(--xp); font-weight: 400; font-size: 26px; letter-spacing: 0.02em; }
#cards { display: grid; gap: 10px; }
#cards.locked { pointer-events: none; }
.card {
  --acc: var(--off);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 14px;
  width: 100%;
  min-height: 84px;
  padding: 15px 16px 15px 18px;
  text-align: left;
  background: rgba(20, 21, 24, 0.94);
  border: 1px solid var(--line);
  position: relative;
  opacity: 0;
  transform: translateY(8px);
  animation: cardIn 0.28s cubic-bezier(.2, .7, .2, 1) forwards;
  animation-delay: var(--d, 0ms);
}
.card::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--acc); }
@keyframes cardIn { to { opacity: 1; transform: none; } }
.card:active { background: var(--off); color: var(--black); }
.card:active .c-desc, .card:active .c-cat { color: #333; }
@media (hover: hover) { .card:hover { border-color: rgba(236, 232, 225, 0.4); } }
.c-body { display: grid; gap: 6px; min-width: 0; }
.c-top { display: flex; align-items: baseline; gap: 10px; }
.c-name { font-size: 17px; font-weight: 500; letter-spacing: 0.01em; }
.c-lvl { font-size: 13px; color: var(--acc); letter-spacing: 0.08em; }
.card:active .c-lvl { color: var(--black); }
.c-desc { font-size: 13px; line-height: 1.4; color: var(--grey-2); }
.c-sci { font-size: 11.5px; line-height: 1.35; color: var(--grey); font-style: italic; margin-top: 2px; }
.c-syn { font-size: 12px; color: var(--amber); }
.c-new { font-size: 11px; color: var(--acc); border: 1px solid currentColor; padding: 2px 5px; letter-spacing: 0.05em; }
.c-pips { display: flex; gap: 3px; align-self: center; }
.c-pips i { width: 6px; height: 6px; border: 1px solid rgba(236, 232, 225, 0.3); }
.c-pips i.on { background: var(--acc); border-color: var(--acc); }
.c-pips i.new { border-color: var(--acc); animation: pip 0.9s ease-in-out infinite alternate; }
@keyframes pip { to { background: var(--acc); } }

/* ---------- pause ---------- */
#pause { background: rgba(0, 0, 0, 0.78); }
.panel { width: 100%; max-width: 340px; text-align: center; }
.panel-title { font-size: 15px; letter-spacing: 0.3em; text-indent: 0.3em; margin-bottom: 22px; }
.panel .build { margin-bottom: 30px; }

.build { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.build span { font-size: 12px; padding: 5px 8px; border: 1px solid var(--line); color: var(--grey-2); }
.build span b { font-weight: 400; color: var(--off); margin-left: 4px; }
.build span.syn { border-color: rgba(255, 196, 107, 0.5); color: var(--amber); }
.build .empty { border: 0; color: var(--grey); }

/* ---------- results ---------- */
#over { background: transparent; align-items: flex-start; }
.over-inner { width: 100%; max-width: 340px; text-align: center; margin: auto 0; }
.run { margin: 14px 0 22px; font-size: 12px; color: var(--grey); }
.stats { text-align: left; border-top: 1px solid var(--line); }
.stats > div { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.stats dt { font-size: 13px; color: var(--grey-2); }
.stats dd { font-size: 15px; color: var(--off); letter-spacing: 0.04em; }
.stats .score dt { color: var(--off); }
.stats .score dd { font-size: 24px; color: var(--off); }
.stats .rec dd { color: var(--grey-2); }
#newRec { display: none; font-style: normal; font-size: 11px; color: var(--black); background: var(--xp); padding: 2px 6px; margin-left: 8px; vertical-align: 1px; }
#newRec.on { display: inline-block; }
.sub { margin: 12px 0 18px; font-size: 12px; color: var(--grey); text-align: left; }
#overBuild { margin-bottom: 26px; justify-content: flex-start; }

/* ---------- tema: última linha de defesa ---------- */
.subtitle { margin: 22px 0 -12px; font-size: 11px; letter-spacing: 0.32em; text-indent: 0.32em; text-transform: uppercase; color: #c6ea6a; opacity: 0.75; }
.tag { line-height: 1.55; }

/* ---------- Adaptação Extrema (escolha em dois passos) ---------- */
/* lista longa no celular: fundo quase opaco e acima do aviso (toast), para nada do jogo vazar por trás do texto */
#levelup.extreme { align-items: flex-start; background: rgba(0, 0, 0, 0.93); z-index: 21; }
#levelup.extreme .lu-inner { margin: auto 0; }
.lu-x { margin-bottom: 16px; }
.lu-x-title { font-size: 13px; letter-spacing: 0.3em; color: var(--amber); }
.lu-x-text { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--grey-2); }
.lu-x-step { margin-top: 14px; font-size: 12px; letter-spacing: 0.16em; color: var(--off); display: grid; gap: 4px; }
.lu-x-up { font-size: 12px; letter-spacing: 0.04em; color: var(--xp); }
.card.xup .c-lvl { white-space: nowrap; }
.c-dim { font-style: normal; color: var(--grey); }
#cards.xsac-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.xsac {
  --acc: var(--off);
  display: grid; align-content: start; gap: 3px; min-height: 64px; min-width: 0; padding: 10px 10px 10px 12px;
  text-align: left; background: rgba(20, 21, 24, 0.94); border: 1px solid var(--line); position: relative; color: var(--off);
}
.xsac::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--acc); }
.xsac:active { background: var(--off); color: var(--black); }
@media (hover: hover) { .xsac:hover { border-color: rgba(236, 232, 225, 0.4); } }
.xs-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.xs-name { font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.xs-lvl { font-size: 12px; letter-spacing: 0.06em; color: var(--acc); white-space: nowrap; }
.xs-desc { font-size: 11.5px; line-height: 1.35; color: var(--grey-2); }
.xs-warn { font-size: 11px; line-height: 1.35; color: var(--amber); }
.xsac:active .xs-lvl, .xsac:active .xs-desc, .xsac:active .xs-warn { color: #333; }
.xsac.back { grid-column: 1 / -1; min-height: 46px; align-content: center; text-align: center; border-style: dashed;
  font-size: 12px; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--grey-2); }
.xsac.back::before { display: none; }
#cards.locked .xsac { pointer-events: none; }
.build span.over b { color: var(--amber); }
.build span.xtr { letter-spacing: 0.12em; }
@media (max-width: 340px) { #cards.xsac-grid { grid-template-columns: 1fr; } }
/* v17 · seleção pelo TECLADO (desktop): sem o contorno azul padrão do navegador — borda clara, fundo um tom acima
   e o marcador lateral mais largo. Mouse e toque não mostram nada disso. */
.card:focus, .xsac:focus { outline: none; }
.card.kb, .xsac.kb { border-color: rgba(236, 232, 225, 0.72); background: rgba(34, 35, 40, 0.97); box-shadow: 0 0 0 1px rgba(236, 232, 225, 0.22); }
.card.kb::before, .xsac.kb::before { width: 4px; }
.xsac.back.kb { color: var(--off); border-style: solid; }
/* v17 · ESGOTAMENTO (só −1) e adaptações dominadas (VIII alguma vez) */
#levelup.exhaust .lu-x-title { color: var(--hp); }
#levelup.exhaust .xs-warn { color: #f08a7e; }
#toast.exh #toastB { color: var(--hp); }
.build span.xtr.exh { border-color: rgba(239, 91, 76, 0.5); color: var(--hp); }
.build span.m { border-color: rgba(255, 196, 107, 0.38); }
.xs-m { font-style: normal; font-size: 10px; font-weight: 400; letter-spacing: 0.08em; color: var(--amber); margin-left: 3px; }

/* ---------- resultado: trecho e compartilhar ---------- */
.sub.stage { margin: 10px 0 6px; color: var(--grey-2); letter-spacing: 0.04em; }
.share-msg { min-height: 1.4em; margin-top: 4px; font-size: 12px; color: var(--grey-2); text-align: center; }

/* ---------- links do site (menu) e sem-JS ---------- */
.wm-h1 { margin: 0; font-size: inherit; line-height: 0; }
/* texto real do H1 (o logo SVG é decorativo): técnica padrão "sr-only", lido por leitores de tela */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.menu-links {
  margin-top: 18px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px;
  font-size: 12px; letter-spacing: 0.04em;
}
.menu-links a { color: var(--grey-2); text-decoration: none; padding: 6px 2px; border-bottom: 1px solid transparent; }
.menu-links a:hover, .menu-links a:focus-visible { color: var(--off); border-bottom-color: rgba(236, 232, 225, 0.35); outline: none; }
/* SOBRE O JOGO (homepage, logo abaixo da primeira dobra): conteúdo real e visível, discreto — largura controlada,
   tipografia menor que o botão principal, muito respiro, sem cartão nem faixa; um traço curto como no trilho do menu */
.about {
  position: relative; max-width: 460px; margin: 0 auto; text-align: center;
  padding: 64px calc(var(--sar) + 30px) calc(var(--sab) + 96px) calc(var(--sal) + 30px);
}
.about::before { content: ""; display: block; width: 28px; height: 1px; margin: 0 auto 26px; background: rgba(198, 234, 106, 0.55); }
.about-kicker { font-size: 10.5px; letter-spacing: 0.34em; text-indent: 0.34em; text-transform: uppercase; color: var(--grey); }
.about-title { margin: 14px 0 0; font-size: 14px; font-weight: 400; letter-spacing: 0.16em; text-indent: 0.16em; color: var(--off); }
.about-text { margin: 18px auto 0; max-width: 380px; font-size: 12.5px; line-height: 1.75; color: var(--grey-2); letter-spacing: 0.01em; }
.about-text strong { font-weight: 500; color: var(--off); letter-spacing: 0.04em; }
.about-facts { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px;
  font-size: 11px; letter-spacing: 0.05em; color: #c6ea6a; opacity: 0.8; }
.about-facts span { white-space: nowrap; }
.about-facts .sep { color: var(--grey); }
.noscript { position: fixed; inset: auto 0 0 0; z-index: 50; padding: 18px 20px; background: #0b0c10; color: #ece8e1; font: 14px/1.6 system-ui, sans-serif; text-align: center; }
.noscript a { color: #c6ea6a; }

/* ---------- assinatura de autoria (menu) ---------- */
.credit {
  position: absolute; /* no pé da PRIMEIRA dobra (.menu-fold), nunca sobre o texto do jogo */
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
  max-width: calc(100% - 140px); /* não encosta no botão de som do canto */
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--grey);
  pointer-events: none;
}
.credit a {
  display: inline-block;
  padding: 10px 2px; /* área de toque confortável sem aumentar o texto */
  margin: -10px 0;
  color: var(--grey-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  pointer-events: auto;
}
.credit a:hover, .credit a:focus-visible { color: var(--off); border-bottom-color: rgba(236, 232, 225, 0.35); outline: none; }

/* ---------- fim da linha (continuação) ---------- */
#offer { background: transparent; }
.offer-stats { font-size: 15px; letter-spacing: 0.08em; color: var(--off); margin: -6px 0 10px; }
.offer-sub { font-size: 12px; line-height: 1.5; color: var(--grey); margin-bottom: 28px; }
.btn small { display: block; margin-top: 6px; font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-indent: 0; color: var(--grey-2); }
.btn:active small { color: #333; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.offer-msg { min-height: 1.5em; margin-top: 16px; font-size: 12px; color: var(--grey-2); }
.sub.note { margin-top: -8px; color: var(--grey-2); line-height: 1.5; }
.ad-mock {
  position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 12px; padding: 24px;
  background: var(--graphite); text-align: center; font-size: 13px; color: var(--grey-2);
}

/* ---------- ranking global ---------- */
.menu-rank { margin: 14px auto 0; }
#menuRank { color: var(--grey-2); }

.over-links { display: flex; justify-content: center; gap: 6px; }
.over-links .btn.link { margin-left: 0; margin-right: 0; }

.net { margin: 0 0 22px; text-align: left; }
.net-status { display: flex; align-items: baseline; gap: 9px; font-size: 12px; line-height: 1.5; color: var(--grey-2); }
.net-status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--grey);
  transform: translateY(-1px);
}
.net-status[data-tone="busy"]::before { border-color: var(--grey-2); animation: netBlink 0.9s ease-in-out infinite alternate; }
.net-status[data-tone="ok"]::before { background: var(--off); border-color: var(--off); }
.net-status[data-tone="best"] { color: var(--off); }
.net-status[data-tone="best"]::before { background: var(--xp); border-color: var(--xp); box-shadow: 0 0 8px rgba(127, 224, 196, 0.7); }
.net-status[data-tone="warn"]::before { border-color: var(--amber); }
@keyframes netBlink { to { background: var(--grey-2); } }
#netAction .btn.ghost { margin-top: 14px; }

.name-form { margin-top: 14px; text-align: left; }
.name-label { display: block; font-size: 12px; color: var(--grey-2); margin-bottom: 8px; }
.name-input {
  display: block;
  width: 100%;
  padding: 14px 14px;
  font: inherit;
  font-size: 16px; /* 16px evita zoom automático no iOS */
  letter-spacing: 0.06em;
  color: var(--off);
  background: var(--graphite);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: text;
  user-select: text;
  caret-color: var(--xp);
}
.name-input:focus { border-color: rgba(236, 232, 225, 0.55); }
.name-input[aria-invalid="true"] { border-color: rgba(239, 91, 76, 0.7); }
.name-hint { margin: 8px 0 16px; font-size: 11px; color: var(--grey); line-height: 1.4; }
.name-hint.err { color: var(--hp); }
.name-form .btn { max-width: none; }
.name-form .btn.link { display: block; margin: 6px auto 0; }

#ranking { background: var(--black); align-items: flex-start; z-index: 12; }
.rk-inner { width: 100%; max-width: 400px; margin: auto 0; text-align: center; }
.rk-head { margin-bottom: 18px; }
.rk-head .panel-title { font-weight: 400; margin-bottom: 8px; outline: none; }
.rk-sub { font-size: 12px; color: var(--grey); letter-spacing: 0.06em; }

.rk-state { padding: 34px 0 30px; display: grid; gap: 6px; }
.rk-state-a { font-size: 13px; letter-spacing: 0.2em; text-indent: 0.2em; text-transform: uppercase; color: var(--grey-2); }
.rk-state-b { font-size: 12px; color: var(--grey); }
.rk-note { margin-top: 12px; font-size: 12px; color: var(--grey); }

/* a lista é uma linha de metrô: cada posição é uma estação */
.rk-list { position: relative; list-style: none; text-align: left; border-top: 1px solid var(--line); }
.rk-list:empty { display: none; }
.rk-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(236, 232, 225, 0.16);
}
.rk-list.solo::before { display: none; }
.rk-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 4px;
  padding: 12px 0 12px 22px;
  border-bottom: 1px solid var(--line);
}
.rk-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(236, 232, 225, 0.4);
  background: var(--black);
  box-sizing: border-box;
}
.rk-row.top::before { border-color: var(--off); background: var(--off); }
.rk-row.me { background: linear-gradient(90deg, rgba(127, 224, 196, 0.07), rgba(127, 224, 196, 0) 80%); }
.rk-row.me::before { border-color: var(--xp); background: var(--xp); box-shadow: 0 0 8px rgba(127, 224, 196, 0.7); }
.rk-pos { min-width: 3.1ch; font-size: 12px; color: var(--grey); letter-spacing: 0.04em; }
.rk-row.top .rk-pos { color: var(--off); }
.rk-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rk-n {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--off);
}
.rk-row:not(.top):not(.me) .rk-n { color: #d4d0c9; }
.rk-you-tag { flex: none; font-size: 10px; color: var(--xp); letter-spacing: 0.08em; }
.rk-score { font-size: 15px; color: var(--off); letter-spacing: 0.04em; }
.rk-meta { grid-column: 2 / -1; font-size: 11px; color: var(--grey); letter-spacing: 0.02em; line-height: 1.5; }

.rk-me { margin-top: 26px; text-align: left; }
.rk-label { font-size: 12px; color: var(--grey-2); margin-bottom: 8px; }

.rk-you { margin: 26px 0 6px; font-size: 12px; color: var(--grey); text-align: center; }
.rk-you-line { color: var(--grey-2); }
.rk-you-name { font-weight: 400; color: var(--off); letter-spacing: 0.08em; text-transform: uppercase; margin-left: 4px; }
.rk-you-note { margin-top: 4px; line-height: 1.5; }
.rk-you .btn.ghost { margin-top: 14px; }
.btn.link.rk-small { margin: 2px auto 0; padding: 10px 12px; font-size: 12px; }
.rk-you .name-form { max-width: 300px; margin: 6px auto 0; }
#rkRefresh { margin-top: 18px; }

@media (max-width: 360px) {
  .rk-row { column-gap: 10px; padding-left: 20px; }
  .rk-n { font-size: 13px; letter-spacing: 0.06em; }
  .rk-score { font-size: 14px; }
}

@media (max-height: 700px) {
  .tag { margin: 18px 0 32px; }
  .stats > div { padding: 8px 0; }
  .run { margin: 10px 0 14px; }
  .card { min-height: 74px; padding-top: 12px; padding-bottom: 12px; }
}

@media (max-height: 660px) {
  /* telas baixas: o crédito entra no fluxo, abaixo do conteúdo, em vez de flutuar sobre ele */
  .menu-fold { padding-bottom: calc(var(--sab) + 18px); }
  .credit { position: static; max-width: none; margin: 18px auto 0; flex: none; }
}
@media (max-height: 600px) {
  .tag { margin: 14px 0 22px; }
  .best { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .line .runner { animation: none; left: calc(100% - 14px); }
  .menu-inner .wordmark .wm-strokes path { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; }
  .card { animation-duration: 0.01s; }
  .net-status[data-tone="busy"]::before { animation: none; }
  #hud.gated #xpFill { animation: none; }
}

/* ---------- multiplayer (etapa 1) ---------- */
.btn.mp-entry { margin-top: 12px; letter-spacing: 0.32em; }
.mp-panel { max-width: 340px; }
.mp-sub { margin: -12px 0 18px; font-size: 13px; color: var(--grey-2); }
.mp-msg { min-height: 1.3em; margin: 0 0 12px; font-size: 13px; color: var(--grey-2); }
.mp-msg[data-tone="warn"] { color: var(--amber); }
.mp-code { margin: 18px 0 6px; text-align: left; }
.mp-label { display: block; font-size: 12px; letter-spacing: 0.08em; color: var(--grey-2); margin-bottom: 6px; }
.mp-code-row { display: flex; gap: 8px; align-items: stretch; }
.mp-code-row .btn { margin: 0; flex: 0 0 auto; width: auto; padding: 0 16px; }
.mp-input { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 12px; background: transparent; border: 1px solid var(--line); color: var(--off);
  font-size: 20px; letter-spacing: 0.3em; text-transform: uppercase; border-radius: 0; }
.mp-input:focus { outline: none; border-color: var(--off); }
.mp-code-big { margin: -6px 0 18px; font-size: 34px; letter-spacing: 0.32em; text-indent: 0.32em; color: var(--off); }
.mp-list { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px solid var(--line); text-align: left; }
.mp-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mp-list li.empty { color: var(--grey); font-style: italic; justify-content: center; }
.mp-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--off); }
.mp-n small { margin-left: 8px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey-2); }
.mp-s { flex: 0 0 auto; font-size: 11px; letter-spacing: 0.16em; color: var(--grey-2); }
.mp-s[data-tone="on"] { color: #c6ea6a; }
.mp-s[data-tone="off"] { color: var(--amber); }
.mp-hint { min-height: 1.3em; margin: 0 0 6px; font-size: 12.5px; color: var(--grey-2); word-break: break-all; }
.mp-status { min-height: 1.2em; margin: 10px 0 0; font-size: 11.5px; letter-spacing: 0.06em; color: var(--grey); }
.mp-status[data-tone="warn"] { color: var(--amber); }
.mp-count { margin: 4px 0 10px; font-size: 56px; line-height: 1; color: var(--off); }
#mpLobby .btn + .btn { margin-top: 10px; }
.mp-hud { position: fixed; inset: 0 0 auto 0; z-index: 4; pointer-events: none; display: none;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) calc(env(safe-area-inset-right, 0px) + 14px) 0 calc(env(safe-area-inset-left, 0px) + 14px); }
.mp-hud.show { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mp-hud-leave { pointer-events: auto; margin: 0; padding: 8px 2px; font-size: 13px; }
/* selo discreto de beta (só aparece em quem abriu ?multiplayer ou um convite) */
.mp-beta { display: inline-block; margin: 0 0 10px; padding: 2px 9px; font-size: 10px; line-height: 1.5; letter-spacing: 0.26em;
  text-indent: 0.26em; color: var(--amber); border: 1px solid currentColor; border-radius: 999px; opacity: 0.8; }
.mp-beta-tag { margin-left: 6px; font-size: 0.72em; letter-spacing: 0.18em; color: var(--amber); opacity: 0.85; vertical-align: 1px; }
.mp-beta-hud { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 18px); transform: translateX(-50%);
  margin: 0; font-size: 9px; opacity: 0.55; pointer-events: none; }
.mp-hud-msg { margin: 8px 0 0; font-size: 12px; letter-spacing: 0.04em; color: var(--amber); text-align: right; }
.dbg-mp { position: fixed; left: 8px; bottom: 8px; z-index: 50; margin: 0; padding: 8px 10px; max-width: calc(100vw - 16px);
  font: 11px/1.45 ui-monospace, Menlo, monospace; color: #cfe; background: rgba(0,0,0,0.72); pointer-events: none; white-space: pre-wrap; }

/* ---------- multiplayer co-op (v18) ---------- */
.fx-toggle { font-size: 12px; letter-spacing: 0.08em; }
#pause .fx-toggle { margin-top: 6px; }
/* arena: a barra do solo vira a barra da Colônia (sem pausa no online) */
body.in-arena #btnPause { display: none; }
body.in-arena .mp-hud.show { display: block; inset: 0; padding: 0; }
.mp-hud .mp-hud-leave { position: absolute; right: calc(var(--sar) + 14px); top: calc(var(--sat) + 50px); }
.mp-hud .mp-beta-hud { top: calc(var(--sat) + 52px); }
.mp-hud .mp-hud-msg { position: absolute; right: calc(var(--sar) + 14px); top: calc(var(--sat) + 80px); max-width: 60vw; }
.mp-allies { position: absolute; left: calc(var(--sal) + 14px); top: calc(var(--sat) + 52px); list-style: none; display: grid; gap: 5px; pointer-events: none; }
.mp-allies li { display: grid; grid-template-columns: 14px auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; font-size: 10.5px; color: var(--grey-2); letter-spacing: 0.03em; }
.mp-allies li .mp-ri { grid-row: 1 / span 2; }
.mp-a-n { color: var(--off); max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-a-bar { display: block; width: 64px; height: 2px; background: rgba(236, 232, 225, 0.12); overflow: hidden; }
.mp-a-bar i { display: block; height: 100%; background: #c6ea6a; transform-origin: 0 50%; }
.mp-allies li small { grid-column: 2; font-size: 9.5px; color: var(--grey-2); }
.mp-allies li.down .mp-a-n, .mp-allies li.down small { color: var(--hp); }
.mp-allies li.off { opacity: 0.55; }
.mp-spec { position: absolute; left: 50%; bottom: calc(var(--sab) + 72px); transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; text-align: center;
  pointer-events: auto; cursor: pointer; padding: 10px 16px; background: rgba(8, 10, 14, 0.55); border: 1px solid var(--line); }
.mp-spec b { font-size: 12px; letter-spacing: 0.3em; color: var(--hp); font-weight: 600; }
.mp-spec span { font-size: 12px; color: var(--off); }
.mp-spec small { font-size: 10.5px; color: var(--grey-2); }
.mp-offer { position: absolute; left: 50%; bottom: calc(var(--sab) + 58px); transform: translateX(-50%); width: min(96vw, 580px); pointer-events: auto;
  padding: 8px; background: rgba(8, 10, 14, 0.82); border: 1px solid var(--line); }
.mp-offer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 2px 6px; font-size: 10.5px; letter-spacing: 0.18em; color: var(--off); }
.mp-offer-head small { font-size: 9.5px; letter-spacing: 0.04em; color: var(--grey-2); }
.mp-offer-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mp-card { display: grid; gap: 4px; align-content: start; text-align: left; padding: 8px; min-height: 64px; background: rgba(236, 232, 225, 0.04); border: 1px solid var(--line);
  color: var(--off); font: inherit; cursor: pointer; touch-action: manipulation; }
.mp-card:hover, .mp-card.kb, .mp-card:focus-visible { border-color: #c6ea6a; outline: none; background: rgba(198, 234, 106, 0.08); }
.mp-card-top { display: flex; justify-content: space-between; gap: 4px; align-items: baseline; }
.mp-card-top b { font-size: 11.5px; font-weight: 600; }
.mp-card-top em { font-style: normal; font-size: 10px; color: var(--grey-2); white-space: nowrap; }
.mp-card-d { font-size: 10.5px; line-height: 1.3; color: var(--grey-2); }
.mp-card small { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: #c6ea6a; }
.mp-offer-time { display: block; height: 2px; margin-top: 7px; background: rgba(236, 232, 225, 0.1); overflow: hidden; }
.mp-offer-time i { display: block; height: 100%; background: #c6ea6a; transform-origin: 0 50%; }
/* lobby: funções, troca e skins */
.mp-lobby-panel { max-width: 380px; }
.mp-roles-title { margin: -4px 0 12px; font-size: 11px; letter-spacing: 0.24em; color: #c6ea6a; }
.mp-roles-title.drawing { animation: mpDraw 0.5s ease-in-out infinite alternate; }
@keyframes mpDraw { from { opacity: 0.45; } to { opacity: 1; } }
.mp-list li { gap: 8px; }
.mp-list li canvas.mp-prev { flex: 0 0 auto; width: 40px; height: 40px; }
.mp-mid { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.mp-role { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; letter-spacing: 0.14em; color: var(--off); }
.mp-motto { font-size: 10.5px; color: var(--grey-2); letter-spacing: 0.02em; }
.mp-right { flex: 0 0 auto; display: grid; justify-items: end; gap: 3px; }
.mp-swap-btn { margin: 0; padding: 2px 0; font-size: 10.5px; }
.mp-glyph { font-style: normal; color: var(--grey-2); font-size: 10px; }
.mp-swap { margin: -4px 0 12px; padding: 10px; border: 1px solid #c6ea6a; display: grid; gap: 8px; }
.mp-swap p { font-size: 12px; color: var(--off); }
.mp-swap .btn { margin: 0; }
.mp-skins { margin: 0 0 12px; text-align: left; }
.mp-skin-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.mp-skin { display: grid; justify-items: center; gap: 2px; padding: 4px 0 5px; background: transparent; border: 1px solid var(--line); color: var(--grey-2); font: inherit; cursor: pointer; }
.mp-skin canvas { width: 36px; height: 36px; }
.mp-skin small { font-size: 7.5px; letter-spacing: 0.06em; }
.mp-skin.on { border-color: #c6ea6a; color: var(--off); }
/* ícones de função (forma; a cor só reforça) */
.mp-ri { display: inline-flex; gap: 1px; vertical-align: -2px; }
.mp-ri svg { width: 13px; height: 13px; }
.mp-ri.sm svg { width: 11px; height: 11px; }
.mp-ri-atk { color: #f3c78f; } .mp-ri-def { color: #a8d9c6; } .mp-ri-sup { color: #b9f2a6; } .mp-ri-ctl { color: #cbdb8c; }
/* resultado */
.mp-results { max-width: 560px; }
.mp-res-mode { margin: -10px 0 14px; font-size: 11px; letter-spacing: 0.2em; color: var(--grey-2); }
.mp-res-team { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0 0 14px; text-align: left; }
.mp-res-team dt { font-size: 10px; letter-spacing: 0.08em; color: var(--grey-2); }
.mp-res-team dd { font-size: 15px; color: var(--off); }
.mp-res-wrap { overflow-x: auto; margin: 0 0 12px; }
.mp-res-table { width: 100%; border-collapse: collapse; font-size: 11px; color: var(--off); }
.mp-res-table th { font-weight: 500; font-size: 9.5px; letter-spacing: 0.06em; color: var(--grey-2); text-align: right; padding: 4px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mp-res-table td { text-align: right; padding: 5px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mp-res-table th:nth-child(2), .mp-res-table td:nth-child(2) { text-align: left; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.mp-res-note { font-size: 11px; color: var(--grey-2); margin: 0 0 14px; }
@media (max-width: 400px) {
  .mp-card { padding: 6px; min-height: 58px; }
  .mp-card-top b { font-size: 10.5px; }
  .mp-card-d { font-size: 9.5px; }
  .mp-offer-head small { display: none; }
}
