/* ==========================================================================
   Racha de Sábado — tema gramado noturno (mobile-first)
   ========================================================================== */

:root {
  --bg: #06120b;
  --bg-2: #0a1c11;
  --surface: #0e2417;
  --surface-2: #133020;
  --surface-3: #1a3d29;
  --line: rgba(198, 255, 61, 0.1);
  --line-strong: rgba(198, 255, 61, 0.22);
  --text: #eef6ef;
  --muted: #8ea898;
  --faint: #5f7a69;
  --neon: #c6ff3d;
  --neon-ink: #0b1a05;
  --neon-glow: rgba(198, 255, 61, 0.35);
  --gold: #f2c14e;
  --danger: #ff6464;
  --danger-bg: rgba(255, 100, 100, 0.1);

  --t1: #c6ff3d;
  --t2: #f2c14e;
  --t3: #4fc3ff;
  --t4: #ff6b6b;
  --t5: #f4f4f4;
  --t6: #b98cff;
  --t7: #ff9f43;
  --t8: #c08a5b;
  --t9: #7d8b84;

  --radius: 20px;
  --radius-sm: 12px;
  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg);
  /* faixas do gramado cortado */
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(198, 255, 61, 0.12), transparent 60%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0 72px, transparent 72px 144px),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
}

/* linhas do campo (meio-campo + círculo central) */
.pitch-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.pitch-lines::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 58%;
  border-top: 2px solid rgba(255, 255, 255, 0.045);
}
.pitch-lines::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--neon);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

/* ---------- Layout ---------- */

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
}

.app.no-tabs {
  padding-bottom: 32px;
}

.stack > * + * {
  margin-top: 16px;
}

.boot {
  min-height: 80dvh;
  display: grid;
  place-items: center;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 0 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-ball {
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 0 10px rgba(198, 255, 61, 0.35));
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text em {
  color: var(--neon);
  font-style: inherit;
}

.hello {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.hello b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Cards ---------- */

.card {
  background: linear-gradient(180deg, rgba(26, 61, 41, 0.55), rgba(14, 36, 23, 0.85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
}
.card-title small {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  margin-left: 4px;
}

.card-sub {
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Hero do racha ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 18px;
  border-color: var(--line-strong);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(198, 255, 61, 0.14), transparent 60%),
    linear-gradient(160deg, #18412a 0%, #0e2618 70%);
}
.hero::after {
  /* grande área estilizada */
  content: '';
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.countdown {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
  font-size: 1rem;
}
.countdown.today {
  color: var(--neon);
  text-shadow: 0 0 14px var(--neon-glow);
}

.hero-date {
  margin: 10px 0 2px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-date .dow {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.4rem;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-date .day {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(3.4rem, 18vw, 4.6rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.hero-meta {
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
}

.scoreboard {
  margin: 18px 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.score {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.score b {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.score.me b {
  color: var(--neon);
}

/* ---------- Chips de status ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.25);
}
.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.chip.open {
  color: var(--neon);
}
.chip.open i {
  animation: pulse 1.8s ease-in-out infinite;
}
.chip.closed {
  color: var(--gold);
}
.chip.drawn {
  color: var(--t3);
}
.chip.small {
  padding: 2px 8px;
  font-size: 0.68rem;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--neon-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.2s ease, opacity 0.15s;
  user-select: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn.block {
  width: 100%;
}
.btn.xl {
  min-height: 60px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 16px;
}
.btn.primary {
  background: var(--neon);
  color: var(--neon-ink);
  border-color: transparent;
  box-shadow: 0 8px 26px -6px var(--neon-glow), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}
.btn.primary:hover {
  box-shadow: 0 10px 32px -4px var(--neon-glow), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}
.btn.gold {
  background: var(--gold);
  color: #1d1503;
  border-color: transparent;
}
.btn.whats {
  background: #25d366;
  color: #062b14;
  border-color: transparent;
}
.btn.ghost {
  background: transparent;
}
.btn.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(255, 100, 100, 0.35);
}
.btn.sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}
.btn .ico {
  font-size: 1.15em;
  line-height: 1;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-row > .btn {
  flex: 1 1 140px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--danger-bg);
  color: var(--danger);
}

.hint {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(242, 193, 78, 0.1);
  border: 1px solid rgba(242, 193, 78, 0.35);
  color: #f7dc9a;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

/* ---------- Lista de confirmados ---------- */

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.roster li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 8px 6px 6px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid transparent;
  animation: rowIn 0.35s ease both;
}
.roster li.me {
  border-color: var(--line-strong);
  background: rgba(198, 255, 61, 0.07);
}
.roster .num {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.roster li.me .num {
  background: var(--neon);
  color: var(--neon-ink);
}
.roster .name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.tag.you {
  background: var(--neon);
  color: var(--neon-ink);
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.empty {
  text-align: center;
  padding: 26px 12px;
  color: var(--muted);
}
.empty .big {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 6px;
}

/* ---------- Times ---------- */

.teams {
  display: grid;
  gap: 12px;
}
@media (min-width: 480px) {
  .teams {
    grid-template-columns: 1fr 1fr;
  }
}

.team {
  --tc: var(--t1);
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 14px 14px 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tc) 18%, transparent), transparent 55%),
    rgba(0, 0, 0, 0.3);
  border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent);
}
.team:nth-child(9n + 2) { --tc: var(--t2); }
.team:nth-child(9n + 3) { --tc: var(--t3); }
.team:nth-child(9n + 4) { --tc: var(--t4); }
.team:nth-child(9n + 5) { --tc: var(--t5); }
.team:nth-child(9n + 6) { --tc: var(--t6); }
.team:nth-child(9n + 7) { --tc: var(--t7); }
.team:nth-child(9n + 8) { --tc: var(--t8); }
.team:nth-child(9n + 9) { --tc: var(--t9); }

.team-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.shirt {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--tc);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--tc) 50%, transparent));
}
.team-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.45rem;
  text-transform: uppercase;
  line-height: 1;
}
.team-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
}
.team ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: p;
}
.team li {
  counter-increment: p;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-weight: 600;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}
.team li::before {
  content: counter(p);
  width: 22px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--tc);
  font-variant-numeric: tabular-nums;
}
.team li:first-child {
  border-top: 0;
}

.teams.reveal .team {
  animation: teamIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 140ms);
}
.teams.reveal .team li {
  animation: rowIn 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 140ms + 220ms + var(--j, 0) * 60ms);
}
@keyframes teamIn {
  from { opacity: 0; transform: translateY(18px) scale(0.94) rotate(-1.5deg); }
  to { opacity: 1; transform: none; }
}

.draw-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

details.prev {
  border-radius: var(--radius);
}
details.prev summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  color: var(--muted);
}
details.prev summary::-webkit-details-marker {
  display: none;
}
details.prev summary::after {
  content: '▾';
  transition: transform 0.2s;
}
details.prev[open] summary::after {
  transform: rotate(180deg);
}
details.prev[open] summary {
  margin-bottom: 14px;
}

/* ---------- Formulários ---------- */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.input,
.select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder {
  color: var(--faint);
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(198, 255, 61, 0.18);
}
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.select option {
  background: var(--surface);
}

.inline-form {
  display: flex;
  gap: 8px;
}
.inline-form .input,
.inline-form .select {
  flex: 1;
  min-width: 0;
}
.inline-form .btn {
  flex: none;
  min-height: 50px;
}

.pw-wrap {
  position: relative;
}
.pw-wrap .input {
  padding-right: 52px;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- Segmentos / abas ---------- */

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}
.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  transition: background-color 0.15s, color 0.15s;
}
.segmented button[aria-pressed='true'],
.segmented button[aria-selected='true'] {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.segmented.neon button[aria-pressed='true'] {
  background: var(--neon);
  color: var(--neon-ink);
}

/* ---------- Seleção de formato ---------- */

.formats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.format {
  position: relative;
  display: block;
  cursor: pointer;
}
.format input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.format .face {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
.format .big {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 2rem;
  line-height: 1;
}
.format .lbl {
  font-size: 0.8rem;
  color: var(--muted);
}
.format .calc {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
}
.format input:checked + .face {
  border-color: var(--neon);
  background: rgba(198, 255, 61, 0.1);
  box-shadow: 0 0 0 3px rgba(198, 255, 61, 0.12);
}
.format input:checked + .face .big {
  color: var(--neon);
}
.format input:focus-visible + .face {
  outline: 3px solid var(--neon);
  outline-offset: 2px;
}
.format:active .face {
  transform: scale(0.98);
}

/* ---------- Gestão de jogadores ---------- */

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}
.player-list li.inactive {
  opacity: 0.5;
}
.player-list .who {
  flex: 1;
  min-width: 0;
}
.player-list .who b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-list .who span {
  font-size: 0.82rem;
  color: var(--muted);
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.history-list li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}
.history-list .h-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}
.history-list .h-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
  border: 0;
}

.creds {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--line-strong);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Login ---------- */

.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}
.login-hero {
  text-align: center;
  margin-bottom: 26px;
}
.login-hero .ball {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 0 26px rgba(198, 255, 61, 0.4));
  animation: bounce 2.6s ease-in-out infinite;
}
.login-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(2.8rem, 14vw, 3.6rem);
  line-height: 0.9;
  text-transform: uppercase;
}
.login-hero h1 em {
  display: block;
  color: var(--neon);
  font-style: inherit;
  text-shadow: 0 0 24px var(--neon-glow);
}
.login-hero p {
  margin: 12px 0 0;
  color: var(--muted);
}
.login .segmented {
  margin-bottom: 18px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-10px) rotate(180deg); }
}

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 8px 12px calc(8px + var(--safe-b));
  background: rgba(6, 18, 11, 0.88);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.tabbar-inner {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: 100%;
  max-width: 560px;
  gap: 6px;
}
.tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s, background-color 0.15s;
}
.tab .ico {
  font-size: 1.35rem;
  line-height: 1.1;
  filter: grayscale(1) brightness(1.4);
  opacity: 0.7;
  transition: filter 0.15s, opacity 0.15s;
}
.tab[aria-current='page'] {
  color: var(--neon);
  background: rgba(198, 255, 61, 0.08);
}
.tab[aria-current='page'] .ico {
  filter: none;
  opacity: 1;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  transform: translateX(-50%);
  width: min(92vw, 420px);
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #f4fbe8;
  color: #0b1a05;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.toast.error {
  background: #ffe1e1;
  color: #5c0b0b;
}
.toast.leaving {
  animation: toastOut 0.25s ease both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease both;
}
@media (min-width: 560px) {
  .modal-backdrop {
    align-items: center;
  }
}
.modal {
  width: 100%;
  max-width: 440px;
  padding: 22px 18px calc(18px + var(--safe-b));
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: sheetIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  text-transform: uppercase;
  line-height: 1.05;
}
.modal p {
  margin: 0 0 18px;
  color: var(--muted);
}
.modal .btn-row {
  margin-top: 18px;
}
@keyframes fadeIn {
  from { opacity: 0; }
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(40px); }
}

/* ---------- Sorteio (overlay) ---------- */

.draw-overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 40% at 50% 45%, rgba(198, 255, 61, 0.18), transparent 70%),
    rgba(4, 12, 7, 0.94);
  animation: fadeIn 0.2s ease both;
}
.draw-stage {
  text-align: center;
  padding: 24px;
}
.draw-title {
  margin: 22px 0 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 2.4rem;
  text-transform: uppercase;
  color: var(--neon);
  text-shadow: 0 0 24px var(--neon-glow);
}
.draw-ticker {
  margin: 0;
  min-height: 2em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: uppercase;
  color: var(--text);
}

.ball-spin {
  width: 44px;
  height: 44px;
  background: url('/favicon.svg') center / contain no-repeat;
  animation: spin 0.9s linear infinite;
}
.ball-spin.big {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  animation: spin 0.6s linear infinite, hop 0.6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 30px var(--neon-glow));
}
@keyframes spin {
  to { rotate: 360deg; }
}
@keyframes hop {
  from { translate: 0 0; }
  to { translate: 0 -18px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Regras do grupo: quórum, suplentes, presença, frequência, elenco
   ========================================================================== */

.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

.chip.cancelled { color: var(--danger); }

.notice.danger {
  background: var(--danger-bg);
  border-color: rgba(255, 100, 100, 0.4);
  color: #ffc9c9;
}

.hint.up {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  text-align: left;
}

/* Quórum */
.quorum {
  display: grid;
  gap: 10px;
  margin: -4px 0 16px;
}
.meter-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.meter-top b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.meter-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.meter-bar i {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(var(--s, 0));
  transform-origin: left center;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ffd978);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.meter.ok .meter-bar i {
  background: linear-gradient(90deg, #8fdc1f, var(--neon));
  box-shadow: 0 0 10px var(--neon-glow);
}
.quorum-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.ok-text { color: var(--neon); font-weight: 600; }

/* Tags extras */
.tag.guest { background: rgba(79, 195, 255, 0.14); color: #9fdcff; }
.tag.member { background: rgba(198, 255, 61, 0.12); color: var(--neon); }
.tag.board { background: rgba(242, 193, 78, 0.16); color: var(--gold); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }

.sub-title {
  margin: 20px 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sub-title small { color: var(--muted); }

.roster.reserve .num {
  background: transparent;
  border: 1.5px dashed var(--line-strong);
  color: var(--muted);
}
.roster li.att-present { background: rgba(198, 255, 61, 0.06); }
.roster li.att-justified { background: rgba(242, 193, 78, 0.07); }
.roster li.att-absent { background: var(--danger-bg); opacity: 0.75; }
.roster li.att-absent .name { text-decoration: line-through; text-decoration-color: rgba(255, 100, 100, 0.6); }
.roster.compact li { min-height: 44px; }

/* Botões de presença */
.att {
  display: flex;
  gap: 3px;
  flex: none;
}
.att-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.95rem;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.55;
  transition: filter 0.15s, opacity 0.15s, background-color 0.15s, transform 0.1s;
}
.att-btn:active { transform: scale(0.92); }
.att-btn[aria-pressed='true'] { filter: none; opacity: 1; }
.att-btn.present[aria-pressed='true'] { background: rgba(198, 255, 61, 0.18); border-color: var(--neon); }
.att-btn.justified[aria-pressed='true'] { background: rgba(242, 193, 78, 0.18); border-color: var(--gold); }
.att-btn.absent[aria-pressed='true'] { background: var(--danger-bg); border-color: var(--danger); }

/* Formulário de convidado (ADM) */
.guest-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 420px) {
  .guest-form { grid-template-columns: 1fr 1fr; }
  .guest-form .btn { grid-column: 1 / -1; }
}

.card.slim { padding: 14px 16px; }
.muted-line { margin: 0; color: var(--muted); font-size: 0.92rem; }

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--neon);
}
.toggle-list {
  margin: 10px 0 4px;
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
}

/* Abas do ADM */
.segmented.tabs4 {
  margin-bottom: 16px;
}
.segmented.tabs4 button {
  font-size: 0.82rem;
  padding: 0 4px;
}
@media (max-width: 380px) {
  .segmented.tabs4 button span { display: none; }
}

/* Elenco */
.player-list li { padding: 0; }
.player-row,
.freq-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
}
.player-row:hover,
.freq-row:hover { background: rgba(255, 255, 255, 0.03); }
.player-row .who { flex: 1; min-width: 0; }
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 50%;
}
.freq-mini {
  flex: none;
  width: 44px;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--neon);
}

/* Frequência */
.freq-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.freq-list li {
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}
.rank {
  flex: none;
  width: 28px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--muted);
  text-align: center;
}
.freq-list li:nth-child(1) .rank { color: var(--gold); }
.freq-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.freq-top { display: flex; justify-content: space-between; gap: 8px; }
.freq-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.freq-pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--neon);
}
.freq-sub { font-size: 0.8rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .tag { font-size: 0.8rem; padding: 4px 9px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 6px 0 4px;
}
.stat-grid div {
  padding: 10px 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
}
.stat-grid b {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
}
.stat-grid span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.modal .modal-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* Histórico */
.history-list details > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 2px;
}
.history-list details > summary::-webkit-details-marker { display: none; }
.history-list details[open] > summary { margin-bottom: 10px; }
.history-list .h-top { align-items: center; }

/* Regras */
.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.rules li {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}
.rule-num {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-3);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--neon);
}
.rules h3 {
  margin: 2px 0 4px;
  font-size: 1rem;
}
.rules p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}
.rules p b { color: var(--text); }

.tabbar .tab { font-size: 0.68rem; }

/* Ajustes finos de layout mobile */
.roster li { min-width: 0; gap: 10px; }
.roster li .att + .icon-btn,
.roster li .att { margin-left: -2px; }
.roster li .icon-btn { width: 32px; height: 32px; flex: none; }
.teams + .btn-row .btn.whats { flex-basis: 100%; }
@media (max-width: 400px) {
  .brand-text { font-size: 1.3rem; }
  .brand-ball { width: 28px; height: 28px; }
  .hello { font-size: 0.8rem; }
  .att-btn { width: 31px; height: 31px; font-size: 0.85rem; }
  .roster li { gap: 8px; }
}

/* Convidado: "Fulano - Convidado de Fulano" */
.guest-of {
  font-weight: 500;
  font-size: 0.86em;
  color: #9fdcff;
}
.roster .name {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.team li .name { min-width: 0; line-height: 1.25; }
