/* ============================================================
   PONTO A PONTO — app (dark + neon) · responsivo (desktop + mobile)
   Reestilização visual mantendo todas as classes do app.
   ============================================================ */
:root {
  /* superfícies */
  --bg: #0b100d;
  --surf: #121b16;
  --surf2: #17231c;
  --surf3: #1f2f26;
  --card: #121b16;
  --line: rgba(255,255,255,.09);
  --ink: #eef5f0;
  --muted: #93a99d;

  /* marca */
  --lime: #d4f70a;
  --teal: #12d6b5;
  --green: #19c37d;

  /* aliases legados (usados em estilos inline do app) */
  --court: #2fe0a0;        /* acento de texto/links em fundo escuro */
  --court-dark: #d4f70a;   /* títulos de destaque (vira lima no dark) */
  --clay: #ff7a4d;
  --ball: #d4f70a;
  --ball-soft: rgba(212,247,10,.14);

  --ok: #19c37d;
  --warn: #f0c23a;
  --danger: #ff5a5a;

  --shadow: none;          /* nada de sombra em repouso (só no que flutua) */
  --shadow-float: 0 20px 60px rgba(0,0,0,.55);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .page-title, .menu-hero h2 { font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: -.02em; }
a { color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
.tnum, .pts, .pos, .num, .cd-unit b, .cd-mini, .mv { font-variant-numeric: tabular-nums; }
::selection { background: rgba(212,247,10,.25); }

/* ---------- Cabeçalho ---------- */
.app-header {
  background: rgba(11,16,13,.9);
  backdrop-filter: blur(12px);
  color: var(--ink);
  padding: 12px 18px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand .ball {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #eaff5a, var(--ball) 60%, #9ac400);
  position: relative; flex: 0 0 auto;
  box-shadow: 0 0 14px rgba(212,247,10,.4);
}
.brand .ball::before, .brand .ball::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(11,16,13,.55);
}
.brand .ball::before { clip-path: inset(0 55% 0 0); transform: translateX(-5px); }
.brand .ball::after  { clip-path: inset(0 0 0 55%); transform: translateX(5px); }
.brand h1 { font-size: 1.05rem; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.brand small { display: block; font-size: .68rem; color: var(--muted); font-weight: 500; margin-top: -1px; }
.header-spacer { flex: 1; }

/* Seletor de perfil */
.role-box { display: flex; align-items: center; gap: 8px; }
.role-box label { font-size: .72rem; color: var(--muted); }
.role-select {
  background: var(--surf2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: .82rem; font-weight: 600; min-height: 38px;
}
.role-select option { color: #14201a; }

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 18px; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.page-title { font-size: 1.6rem; margin: 6px 0 2px; font-weight: 700; }
.page-sub { color: var(--muted); font-size: .95rem; margin: 0 0 18px; }
.breadcrumb { font-size: .84rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { text-decoration: none; color: var(--court); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Cartões de classe ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.class-card {
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer;
  transition: transform .14s ease, border-color .14s ease; position: relative; overflow: hidden;
}
.class-card:hover { transform: translateY(-3px); border-color: rgba(18,214,181,.5); }
.class-card .num {
  font-family: "Space Grotesk"; font-size: 1.9rem; font-weight: 700; color: var(--lime);
  background: var(--ball-soft); width: 54px; height: 54px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.class-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.class-card .meta { color: var(--muted); font-size: .82rem; }
.class-card.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-style: dashed; color: var(--lime); background: var(--surf); text-align: center;
}
.class-card.add .plus { font-size: 2rem; line-height: 1; }

/* ---------- Botões ---------- */
.btn {
  border: none; background: var(--lime); color: #06120a;
  padding: 11px 18px; border-radius: 10px; font-weight: 700; font-size: .9rem;
  font-family: "Space Grotesk", Inter, sans-serif; min-height: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .12s ease, background .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--surf2); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surf3); filter: none; }
.btn.small { padding: 7px 12px; font-size: .82rem; border-radius: 9px; min-height: 36px; }
.btn.subtle { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.subtle:hover { background: var(--surf2); color: var(--ink); filter: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; overflow-x: auto; }
.tab {
  background: none; border: none; padding: 12px 16px; font-size: .9rem; font-weight: 600;
  color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px;
}
.tab.active { color: var(--lime); border-bottom-color: var(--lime); }
.tab:hover { color: var(--ink); }

/* ---------- Cronômetro ---------- */
.countdown-card {
  background: var(--surf2);
  color: var(--ink); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
  display: block; border: 1px solid var(--line);
}
.countdown-card .cd-info { flex: 1; min-width: 180px; }
.countdown-card .cd-info .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.countdown-card .cd-info .rname { font-size: 1.2rem; font-weight: 700; font-family: "Space Grotesk"; }
.countdown-card .cd-info .dates { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.cd-timer { display: flex; gap: 8px; }
.cd-unit { background: var(--surf3); border-radius: 10px; padding: 8px 10px; text-align: center; min-width: 54px; }
.cd-unit b { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; font-family: "Space Grotesk"; color: var(--lime); }
.cd-unit span { font-size: .62rem; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.cd-expired { background: rgba(255,90,90,.15); }
.cd-badge { font-size: .72rem; padding: 4px 11px; border-radius: 999px; font-weight: 700; }
.cd-badge.open { background: var(--lime); color: #06120a; }
.cd-badge.closed { background: var(--surf3); color: var(--muted); }

/* cronômetro por grupo */
.cd-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.cd-head .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.cd-head .rname { font-size: 1.3rem; font-weight: 700; font-family: "Space Grotesk"; }
.cd-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.cd-grow { background: var(--surf3); border-radius: 12px; padding: 12px 14px; }
.cd-gname { font-weight: 700; font-size: 1rem; font-family: "Space Grotesk"; }
.cd-gdates { font-size: .74rem; color: var(--muted); margin: 2px 0 8px; }
.cd-gright { display: flex; align-items: center; gap: 8px; }
.cd-mini { font-size: 1.05rem; font-weight: 700; font-family: "Space Grotesk"; color: var(--lime); background: rgba(212,247,10,.12); padding: 5px 11px; border-radius: 8px; }
.cd-mini.cd-late { background: rgba(255,90,90,.18); color: #ff8e8e; }
.cd-sub { font-size: .72rem; color: var(--muted); }

/* ---------- Tabelas / cartões ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card h3 .tag { font-size: .68rem; background: var(--ball-soft); color: var(--lime); padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
tbody tr:hover { background: var(--surf2); }
td.num, th.num { text-align: center; }
.pos { font-weight: 700; color: var(--lime); font-family: "Space Grotesk"; }
.pos.p1 { color: #ffd84d; } /* líder */
.player-name { font-weight: 600; }
.pts { font-weight: 700; font-family: "Space Grotesk"; }

/* Placar / jogos */
.match {
  display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.match:last-child { border-bottom: none; }
.match .players { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.match .p { display: flex; align-items: center; gap: 8px; }
.match .p .nm { font-weight: 600; }
.match .p.win .nm { color: var(--lime); }
.match .p .sc { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-family: "Space Grotesk"; }
.match .p.win .sc { color: var(--lime); }
.match .status { font-size: .74rem; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.status.played { background: rgba(25,195,125,.16); color: #4fe3a3; }
.status.pending { background: rgba(240,194,58,.16); color: #f3cf5c; }
.status.late { background: rgba(255,90,90,.16); color: #ff8e8e; }
.match .act { display: flex; gap: 6px; }

/* ---------- Formulários / modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,7,5,.72); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.modal {
  background: var(--surf); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 460px; padding: 22px;
  box-shadow: var(--shadow-float); max-height: 90vh; overflow-y: auto; color: var(--ink);
}
.modal h3 { margin: 0 0 14px; font-size: 1.2rem; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .92rem;
  background: var(--surf2); color: var(--ink); min-height: 44px;
}
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.set-inputs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.set-row input { width: 60px; text-align: center; background: var(--surf2); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 10px; min-height: 44px; }
.set-row .vs { color: var(--muted); font-weight: 700; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }

/* cabeça de chave */
.seed-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--teal); color: #06120a;
  font-size: .68rem; font-weight: 800; margin-right: 7px; vertical-align: middle;
}
/* movimentação */
.mv { font-weight: 700; font-size: .82rem; font-family: "Space Grotesk"; }
.mv.up { color: var(--green); }
.mv.down { color: #ff6b6b; }
.mv.same { color: var(--muted); }

/* modal largo + caixas de agenda/sorteio */
.modal.wide { max-width: 640px; }
.sched-box { border: 1px solid var(--line); background: var(--surf2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.sched-box > b { display: block; margin-bottom: 6px; color: var(--lime); }
.drawsel { flex: 1; min-width: 0; padding: 10px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surf2); color: var(--ink); min-height: 44px; }

/* header actions */
#headerActions { margin-right: 6px; }
#headerActions .btn.ghost { background: var(--surf2); color: var(--ink); border-color: var(--line); }

/* sorteio ao vivo */
.live-overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 18%, #13311f, #07110b 72%);
}
.live-inner { width: 92%; max-width: 560px; text-align: center; color: #fff; }
.live-title { font-size: 1.6rem; font-weight: 700; font-family: "Space Grotesk"; letter-spacing: -.01em; margin-bottom: 18px; color: var(--lime); }
.live-list { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.live-group { font-size: 1.05rem; font-weight: 700; color: var(--lime); margin-top: 10px; text-transform: uppercase; letter-spacing: 1px; }
.live-match {
  background: var(--surf2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 1.15rem; font-weight: 700;
}
.live-match b { color: var(--lime); }
.live-bye { font-size: .95rem; color: var(--muted); }
.reveal { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }

/* seed inline (estilo eventos grandes) */
.seed-in { color: var(--muted); font-weight: 700; font-size: .82rem; }
.player-name .seed-in { color: var(--teal); }

/* zona de classificação */
tr.qualify { background: rgba(212,247,10,.08) !important; }
tr.qualify:hover { background: rgba(212,247,10,.13) !important; }
.qbox { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: rgba(212,247,10,.25); border: 1px solid rgba(212,247,10,.5); vertical-align: middle; }

/* listas de participantes/grupos */
.plist-ul { list-style: none; margin: 0; padding: 0; }
.plist { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.plist:last-child { border-bottom: none; }
.seed-select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: .78rem; color: var(--ink); background: var(--surf2); min-height: 36px; }
.p-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* menu inicial */
.menu-hero { text-align: center; padding: 22px 10px 6px; }
.menu-hero h2 { margin: 0 0 4px; font-size: 1.7rem; }
.menu-hero p { color: var(--muted); margin: 0 0 8px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: 760px; margin: 10px auto; }
.menu-card { background: var(--surf); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px; cursor: pointer; text-align: center; transition: transform .14s ease, border-color .14s ease; }
.menu-card:hover { transform: translateY(-4px); border-color: rgba(18,214,181,.5); }
.menu-card.alt { background: var(--surf2); border-color: rgba(212,247,10,.3); }
.menu-card.alt p { color: var(--muted); }
.menu-card.alt .tag { background: var(--ball-soft); color: var(--lime); }
.mc-ico { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.menu-card h3 { margin: 4px 0 6px; font-size: 1.25rem; }
.menu-card p { font-size: .9rem; margin: 0 0 12px; color: var(--muted); }

/* chaveamento (bracket) */
.bracket-wrap { overflow-x: auto; padding-bottom: 10px; }
.bracket { display: flex; gap: 26px; min-width: min-content; padding: 6px; }
.br-col { display: flex; flex-direction: column; justify-content: space-around; gap: 16px; min-width: 190px; }
.br-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; text-align: center; margin-bottom: 2px; }
.br-match { background: var(--surf2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; position: relative; }
.br-p { padding: 7px 8px; border-radius: 7px; font-weight: 600; font-size: .9rem; display: flex; align-items: center; }
.br-p + .br-p { margin-top: 4px; }
.br-p.win { background: var(--lime); color: #06120a; font-weight: 700; }
.br-meta { font-size: .72rem; color: var(--muted); margin-top: 6px; }
.br-edit { position: absolute; top: 6px; right: 8px; background: none; border: none; color: var(--teal); font-size: .72rem; font-weight: 700; cursor: pointer; }

/* W.O. / eliminação */
.wo-warn { color: #f3cf5c; font-weight: 700; }
.wo-red { color: #ff8e8e; font-weight: 800; }
.player-name.eliminated { color: #ff8e8e !important; font-weight: 800; text-decoration: line-through; text-decoration-color: rgba(255,142,142,.5); }
.elim-tag { display: inline-block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; background: rgba(255,90,90,.18); color: #ff8e8e; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; text-decoration: none; }
.elim-row { background: rgba(255,90,90,.06); }
.elim-row:hover { background: rgba(255,90,90,.1); }

/* auth header */
.auth-name { color: var(--ink); font-size: .82rem; font-weight: 600; margin-right: 8px; }
#authBox { display: flex; align-items: center; gap: 4px; }

/* banners patrocinador */
.spon-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.spon { display: flex; align-items: center; justify-content: center; min-height: 74px; border-radius: 12px; overflow: hidden; text-decoration: none; border: 1px solid var(--line); background: var(--surf); }
.spon img { width: 100%; height: 100%; max-height: 110px; object-fit: cover; }
.spon.empty { flex-direction: column; border-style: dashed; color: var(--muted); background: var(--surf); }
.spon.empty span { font-weight: 700; color: var(--lime); }
.spon.empty small { font-size: .74rem; }

/* rodapé */
.foot-social { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.foot-soc { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .82rem; font-weight: 600; }
.foot-soc:hover { color: var(--lime); }
.foot-sup { text-align: center; margin-bottom: 14px; }
.foot-sup-t { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.foot-sup-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; align-items: center; }
.foot-sup-row img { height: 40px; width: auto; border-radius: 6px; }
.foot-credit { text-align: center; }
.foot-credit a { color: var(--court); text-decoration: none; }
.foot-credit a:hover { text-decoration: underline; }

.spon-row-3 { grid-template-columns: 1fr 1fr 1fr; max-width: 760px; margin: 0 auto 20px; }
.spon-row-3 .spon { min-height: 64px; }
@media (max-width: 640px) { .spon-row, .spon-row-3 { grid-template-columns: 1fr; } }

.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty .big { font-size: 2rem; }
.hint { font-size: .82rem; color: var(--ink); background: var(--surf2); border-left: 3px solid var(--lime); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }

/* ---------- Rodapé ---------- */
.app-footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); margin-top: 24px; }

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
  .container { padding: 14px; }
  .brand h1 { font-size: .95rem; }
  .role-box label { display: none; }
  .page-title { font-size: 1.35rem; }
  .match .players { min-width: 100%; }
  .match .act { width: 100%; }
  .match .act .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
