/* ViraDuel — identidade da logo "Play × Play"
   Cada duelo repete a logo: rosa (desafiante) × ciano (defensor), com o raio branco no choque.
   Rosa e ciano só aparecem para dizer de que lado algo está; as chamadas usam o branco do raio,
   para nenhum dos dois lados parecer o "botão principal" na hora do voto. */

@font-face {
  font-family: "Unbounded";
  src: url("/static/fonts/unbounded-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/static/fonts/figtree-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/static/fonts/figtree-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/static/fonts/figtree-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paleta */
  --arena: #17122e;      /* fundo */
  --ring: #221b42;       /* superfícies */
  --ring-2: #2c2454;     /* superfícies elevadas / campos */
  --rope: #3e3570;       /* bordas */
  --text: #f4f1ff;
  --text-soft: #b8b0dc;
  --pink: #ff3e6c;       /* canto do desafiante (play rosa da logo) */
  --cyan: #22d3ee;       /* canto do defensor (play ciano da logo) */
  --spark: #ffffff;      /* chamadas e foco (o raio da logo) */
  --spark-ink: #17122e;
  --side-ink: #17122e;   /* texto sobre rosa/ciano: branco não passa no AA */
  --ok: #3ddc97;
  --danger: #ff6b6b;

  /* Tipografia */
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --display-track: -0.02em; /* mesmo tracking do nome na logo */
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala (razão ~1.25) */
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.5rem;
  --fs-xl: 1.75rem;
  --fs-hero: clamp(2rem, 7.4vw, 3.5rem);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --nav-h: 72px;
  --tap: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--arena);
  min-height: 100vh;
  min-height: 100dvh;
}

img,
video {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden],
.hidden {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Foco visível e consistente em tudo que é interativo */
:focus-visible {
  outline: 3px solid var(--spark);
  outline-offset: 3px;
  border-radius: 6px;
}

h1[tabindex="-1"]:focus,
main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--spark);
  color: var(--spark-ink);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Visitante × membro: chamadas diferentes para cada um */
.is-guest .only-member,
.is-member .only-guest {
  display: none !important;
}

/* ---------- Estrutura ---------- */

.app {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--arena) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rope);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: var(--tap);
}

.brand-logo {
  display: block;
  height: 26px;
  width: auto;
}

.user-pill {
  min-height: 40px;
  max-width: 55vw;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--rope);
  background: var(--ring);
  font-weight: 600;
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.user-pill:hover {
  border-color: var(--spark);
}

.viewport {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

/* ---------- Navegação ---------- */

.main-nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--ring) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--rope);
}

.brand-rail {
  display: none;
}

.nav-list {
  list-style: none;
  margin: 0 auto;
  padding: 0 6px;
  max-width: 560px;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 6px 2px;
  border-radius: 14px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
}

.nav-btn .ico {
  width: 24px;
  height: 24px;
}

.nav-btn:hover {
  color: var(--text);
}

.nav-btn[aria-current="page"] {
  color: var(--text);
}

.nav-btn[aria-current="page"] .ico {
  color: var(--spark);
}

/* Aba atual: traço com as duas cores da marca, além do texto mais claro */
.nav-btn {
  position: relative;
}

.nav-btn:not(.nav-cta)[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--pink) 0 50%, var(--cyan) 50% 100%);
}

/* Desafiar: a ação principal do app, sempre ao alcance do polegar */
.nav-cta {
  color: var(--text);
}

.nav-cta .ico {
  width: 48px;
  height: 48px;
  padding: 12px;
  margin-top: -26px;
  border-radius: 50%;
  color: var(--spark-ink);
  background: var(--spark);
  box-shadow: 0 0 0 5px var(--ring), 0 8px 22px rgba(255, 255, 255, 0.16);
}

.nav-cta[aria-current="page"] .ico {
  color: var(--spark-ink);
  box-shadow: 0 0 0 5px var(--ring), 0 0 0 8px var(--spark);
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn .ico {
  width: 20px;
  height: 20px;
}

.btn-gold {
  background: var(--spark);
  color: var(--spark-ink);
}

.btn-gold:hover {
  background: #e6e0ff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--rope);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text-soft);
}

.btn-quiet {
  background: transparent;
  color: var(--text-soft);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 60%, transparent);
  color: var(--danger);
}

.btn-red {
  background: var(--pink);
  color: var(--side-ink);
}

.btn-blue {
  background: var(--cyan);
  color: var(--side-ink);
}

.btn-red:hover,
.btn-blue:hover {
  filter: brightness(1.08);
}

.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--spark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Chamadas ---------- */

.hero {
  padding: 8px 0 28px;
}

.hero-title {
  font-family: var(--display);
  font-size: var(--fs-hero);
  line-height: 1.04;
  letter-spacing: var(--display-track);
}

/* Uma frase por linha: o ritmo do título é parte da mensagem */
.hero-title > span {
  display: block;
}

/* Os dois lados da logo, lado a lado */
.hero-title::after {
  content: "";
  display: block;
  width: 132px;
  height: 6px;
  margin-top: 18px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--pink) 0 50%, var(--cyan) 50% 100%);
}

.hero-lede {
  margin-top: 16px;
  max-width: 46ch;
  color: var(--text-soft);
  font-size: var(--fs-md);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--ring), var(--ring)) padding-box,
    linear-gradient(90deg, var(--pink), var(--cyan)) border-box;
}

.callout p {
  flex: 1 1 240px;
  max-width: 60ch;
}

.callout form {
  flex: 1 1 100%;
}

.empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 22px;
  border-radius: var(--r-md);
  border: 1px dashed var(--rope);
  color: var(--text-soft);
}

.empty strong {
  color: var(--text);
  font-size: var(--fs-md);
}

/* ---------- Títulos de seção e painéis ---------- */

.panel-head {
  margin-bottom: 20px;
}

.panel-head h1 {
  font-family: var(--display);
  font-size: var(--fs-xl);
  letter-spacing: var(--display-track);
}

.panel-lede {
  margin-top: 8px;
  max-width: 56ch;
  color: var(--text-soft);
}

.section-title {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: var(--display-track);
}

.stack {
  display: grid;
  gap: 16px;
}

/* ---------- Filtros da arena ---------- */

.arena-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.arena-controls .section-title {
  flex: 1 0 100%;
}

.segmented {
  display: inline-flex;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--rope);
  border-radius: 999px;
  background: var(--ring);
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.segmented span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-soft);
}

.segmented input:checked + span {
  background: var(--rope);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, transparent);
}

.segmented input:focus-visible + span {
  outline: 3px solid var(--spark);
  outline-offset: 2px;
}

.select-label select,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rope);
  background: var(--ring-2);
  color: var(--text);
}

.select-label {
  flex: 1 1 160px;
}

input::placeholder {
  color: color-mix(in srgb, var(--text-soft) 75%, transparent);
}

input:focus-visible,
select:focus-visible {
  border-color: var(--spark);
  outline-offset: 1px;
}

input[type="file"] {
  padding: 9px 10px;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--arena);
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Cartões e formulários ---------- */

.card {
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--ring);
  border: 1px solid var(--rope);
}

.card h2 {
  font-size: var(--fs-md);
  font-weight: 700;
  margin-bottom: 12px;
}

.form-card {
  display: grid;
  gap: 16px;
}

.form-card label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: var(--fs-sm);
}

.field-hint,
.hint {
  color: var(--text-soft);
  font-weight: 400;
  font-size: var(--fs-sm);
}

.form-foot {
  color: var(--text-soft);
  font-size: var(--fs-sm);
  text-align: center;
}

.row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.grow {
  flex: 1 1 200px;
}

.composer {
  margin-bottom: 18px;
}

.composer summary {
  list-style: none;
  width: fit-content;
}

.composer summary::-webkit-details-marker {
  display: none;
}

.composer[open] summary {
  margin-bottom: 14px;
  background: transparent;
  color: var(--text);
  border-color: var(--rope);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ring-2);
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 600;
}

.chip-live {
  background: color-mix(in srgb, var(--pink) 20%, transparent);
  color: #ffb3ba;
}

.chip-live::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--pink);
}

.chip-gold {
  background: color-mix(in srgb, var(--spark) 18%, transparent);
  color: var(--spark);
}

/* ---------- O cartaz do duelo (o elemento principal) ---------- */

.duel {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--pink) 13%, transparent), transparent 42%, transparent 58%, color-mix(in srgb, var(--cyan) 13%, transparent)),
    var(--ring);
  border: 1px solid var(--rope);
}

.duel-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.duel-theme {
  font-family: var(--display);
  font-size: clamp(1.2rem, 4.6vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: var(--display-track);
  margin-bottom: 16px;
}

.duel-ring {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.corner {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.corner-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.corner-name {
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corner-score {
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1;
}

.corner-red .corner-score {
  color: var(--pink);
}

.corner-blue .corner-score {
  color: var(--cyan);
}

.corner-blue .corner-head {
  flex-direction: row-reverse;
}

.media-box {
  width: 100%;
  aspect-ratio: 9 / 14;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--arena);
  border: 3px solid var(--pink);
}

.corner-blue .media-box {
  border-color: var(--cyan);
}

div.media-box {
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  border-style: dashed;
}

.vs {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  display: block;
  width: 46px;
  height: 78px;
  color: var(--spark);
  pointer-events: none;
}

/* Contorno na cor do fundo = o vão em volta do raio na logo */
.vs .ico {
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: var(--arena);
  stroke-width: 9;
  stroke-linejoin: round;
  paint-order: stroke;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.corner .btn {
  width: 100%;
  padding-inline: 10px;
}

/* Placar em cabo de guerra */
.tug {
  margin-top: 16px;
}

.tug-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--ring-2);
}

.tug-red {
  background: var(--pink);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tug-blue {
  background: var(--cyan);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tug-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--text-soft);
}

.duel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.duel-actions .btn {
  flex: 1 1 200px;
}

/* ---------- Feed ---------- */

.post {
  display: grid;
  gap: 12px;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-author {
  font-weight: 700;
}

.post-author small {
  display: block;
  font-weight: 400;
  color: var(--text-soft);
}

.post-media {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--r-md);
  background: var(--arena);
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-like[aria-pressed="true"] {
  border-color: var(--pink);
  color: var(--pink);
}

/* ---------- Elegibilidade ---------- */

.eligibility-box {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.crit {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--ring-2);
  font-size: var(--fs-sm);
}

.crit-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8125rem;
}

.crit-ok .crit-mark {
  background: var(--ok);
  color: #04281a;
}

.crit-fail .crit-mark {
  background: var(--danger);
  color: #2d0606;
}

/* ---------- Ranking ---------- */

.rank-grid {
  display: grid;
  gap: 16px;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.rank-list li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}

.rank-list li:nth-child(odd) {
  background: color-mix(in srgb, var(--ring-2) 55%, transparent);
}

.rank-pos {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--text-soft);
  text-align: center;
}

.rank-list li:first-child .rank-pos {
  color: var(--spark);
  font-size: 1.45rem;
}

.rank-who {
  min-width: 0;
}

.rank-who strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-who small {
  color: var(--text-soft);
}

.rank-pts {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Perfil e autenticação ---------- */

.auth {
  display: grid;
  gap: 14px;
  max-width: 480px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--rope);
  background: var(--ring);
}

.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-weight: 700;
  cursor: pointer;
}

.auth-tab[aria-pressed="true"] {
  background: var(--rope);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, transparent);
}

/* ---------- Perfil ---------- */

#profile-dashboard {
  max-width: 860px;
}

.profile-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* Avatar com o anel da logo: metade rosa (desafiante), metade ciano (defensor) */
.profile-avatar {
  flex: none;
  width: 60px;
  height: 60px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--pink) 0 50%, var(--cyan) 50% 100%);
}

.profile-avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--ring-2);
  font-family: var(--display);
  letter-spacing: var(--display-track);
  font-size: 1.15rem;
}

.profile-id {
  flex: 1;
  min-width: 0;
}

.profile-id h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  font-family: var(--display);
  letter-spacing: var(--display-track);
  font-size: 1.25rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.profile-id p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.profile-badge {
  font-family: var(--body);
  letter-spacing: 0;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 14px;
  border-width: 1px;
  font-size: var(--fs-sm);
}

.btn-sm .ico {
  width: 18px;
  height: 18px;
}

.profile-logout {
  flex: none;
  color: var(--text-soft);
}

.profile-logout:hover {
  color: var(--text);
}

.profile-hero {
  display: grid;
  gap: 12px;
}

.profile-score,
.profile-league {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--ring-2);
}

.profile-kicker {
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.profile-score-value {
  font-family: var(--display);
  letter-spacing: var(--display-track);
  font-size: clamp(2.25rem, 8vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
}

.profile-note {
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

.profile-league-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 10px;
  margin: 6px 0 2px;
  border-radius: 999px;
  background: var(--rope);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
}

/* Número em cima, rótulo curto embaixo e numa linha só: os valores ficam sempre na mesma altura */
.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

/* Celular: 3 em cima e 2 embaixo, ocupando a linha toda */
.stats > div {
  grid-column: span 2;
}

.stats > div:nth-child(n + 4) {
  grid-column: span 3;
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rope);
  text-align: center;
}

.stats dt {
  color: var(--text-soft);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.stats dd {
  margin: 0;
  font-family: var(--display);
  letter-spacing: var(--display-track);
  font-size: 1.25rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.profile-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px dashed var(--rope);
}

.profile-strip p {
  flex: 1 1 220px;
  margin: 0;
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

.profile-strip strong {
  color: var(--text);
}

@media (min-width: 720px) {
  .profile-card {
    padding: 24px;
  }

  .profile-id h2 {
    font-size: var(--fs-lg);
  }

  .profile-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }

  .profile-league {
    align-content: center;
  }

  .stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .stats > div,
  .stats > div:nth-child(n + 4) {
    grid-column: auto;
  }
}

/* ---------- Como funciona ---------- */

.how {
  margin-top: 36px;
  padding: 22px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--rope);
  display: grid;
  gap: 16px;
  justify-items: start;
}

.steps {
  list-style: none;
  counter-reset: passo;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.steps li {
  counter-increment: passo;
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 12px;
}

.steps li::before {
  content: counter(passo);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--spark);
  color: var(--spark);
  font-family: var(--display);
  font-size: 1.05rem;
}

.steps strong {
  font-size: var(--fs-md);
}

.steps span {
  color: var(--text-soft);
  max-width: 48ch;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  width: min(92vw, 460px);
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--arena);
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Widget Turnstile invisível: só aparece quando a Cloudflare pede interação */
.turnstile-slot {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  transform: translateX(-50%);
}

/* ---------- Telas maiores ---------- */

@media (min-width: 720px) {
  .viewport {
    padding: 28px 24px 8px;
  }

  .arena-controls .section-title {
    flex: 0 0 auto;
    margin-right: auto;
  }

  .select-label {
    flex: 0 0 200px;
  }

  .duel {
    padding: 22px;
  }

  .duel-ring {
    gap: 20px;
  }

  .vs {
    width: 54px;
    height: 92px;
  }

  .rank-grid {
    grid-template-columns: 1fr 1fr;
    /* Os dois quadros com a mesma altura, lado a lado */
    align-items: stretch;
  }
}

/* Desktop: o menu vira trilho lateral fixo, com rótulos sempre visíveis */
@media (min-width: 1000px) {
  .app {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    padding-bottom: 0;
  }

  .topbar {
    display: none;
  }

  .main-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    grid-column: 1;
    grid-row: 1 / span 2;
    padding: 20px 14px;
    border-top: 0;
    border-right: 1px solid var(--rope);
    background: var(--arena);
    backdrop-filter: none;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .brand-rail {
    display: inline-flex;
    padding: 0 10px;
  }

  .nav-list {
    height: auto;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    min-height: 52px;
    padding: 10px 14px;
    font-size: var(--fs-base);
  }

  .nav-btn:hover {
    background: var(--ring);
  }

  .nav-btn[aria-current="page"] {
    background: var(--ring-2);
  }

  .nav-btn:not(.nav-cta)[aria-current="page"]::before {
    top: 50%;
    left: 0;
    width: 3px;
    height: 24px;
    border-radius: 0 3px 3px 0;
    transform: translateY(-50%);
    background: linear-gradient(180deg, var(--pink) 0 50%, var(--cyan) 50% 100%);
  }

  /* No trilho, Desafiar vira um botão-pílula no fim da lista */
  .nav-cta-item {
    order: 10;
    margin-top: 18px;
  }

  .nav-cta {
    justify-content: center;
    border-radius: 999px;
    background: var(--spark);
    color: var(--spark-ink);
  }

  .nav-cta .ico,
  .nav-cta[aria-current="page"] .ico {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    background: none;
    box-shadow: none;
    color: var(--spark-ink);
  }

  .nav-cta:hover,
  .nav-cta[aria-current="page"] {
    background: #e6e0ff;
    color: var(--spark-ink);
  }

  .viewport {
    grid-column: 2;
    max-width: 1080px;
    /* Centraliza no espaço ao lado do trilho (em telas largas sobrava tudo à direita) */
    margin: 0 auto;
    padding: 40px 40px 48px;
  }

  .toast,
  .turnstile-slot {
    left: calc(50% + 124px);
    bottom: 28px;
  }

  /* Entre 1000 e 1279px a arena é uma coluna só, na mesma largura das outras abas */
  .tab-panel {
    max-width: 760px;
  }
}

/* Arena com a explicação ao lado da lista. Só a partir de 1280px: abaixo disso a coluna da
   lista ficava estreita (filtros e botões de voto quebravam linha) e a explicação vai para
   baixo da lista. */
@media (min-width: 1280px) {
  #tab-arena.active {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "hero hero"
      "controls how"
      "list how";
    /* A explicação ocupa duas linhas; sem isto, quando ela é mais alta que filtros + lista, a
       sobra ia para a linha dos filtros e abria um vão acima da lista (ou do aviso de vazio). */
    grid-template-rows: auto auto 1fr;
    column-gap: 32px;
    align-items: start;
  }

  #tab-arena .hero {
    grid-area: hero;
  }

  #tab-arena .arena-controls {
    grid-area: controls;
  }

  #tab-arena #duels-list {
    grid-area: list;
  }

  #tab-arena .how {
    grid-area: how;
    margin-top: 0;
    position: sticky;
    top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
