:root {
  /* Cores da logo */
  --primary: #011a4d;
  --primary-dark: #000f2e;
  --primary-soft: #e8edf7;
  --orange: #fe6900;
  /* Verde só para status positivo (confirmado, finalizada, aviso de sucesso) */
  --green: #1f6f43;
  --green-dark: #174f31;
  --green-soft: #e9f3ed;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e3e3e3;
  --border: #cfcfcf;
  --red: #8a2c12;
  --warn: #a14a00;
  --warn-soft: #fff4e5;
  --bg: #f6f6f4;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.4;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { margin: 0; }

.shell { max-width: 480px; min-height: 100vh; margin: 0 auto; background: #fff; display: flex; flex-direction: column; }
/* Nada pode deixar a página mais larga que a tela (no iOS isso faz a tela "sambar" para os lados).
   clip (e não hidden) para não quebrar o topo e os botões fixos (position: sticky). */
.shell { overflow-x: clip; }
.shell > main { min-width: 0; }
img, video, canvas { max-width: 100%; }
.page { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.page-narrow { padding: 32px 24px; }

/* App bar */
.appbar { position: sticky; top: 0; z-index: 5; height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 8px; border-bottom: 1px solid var(--line); background: #fff; }
.appbar-side { display: flex; align-items: center; min-width: 0; }
.appbar-end { justify-content: flex-end; }
.appbar-back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.appbar-logo { display: flex; align-items: center; }
.logo-name { height: 30px; width: auto; display: block; }
.page-title { font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: -10px; overflow-wrap: anywhere; }
.logo { display: block; height: auto; margin: 0 auto; }
.logo-md { width: 220px; }
.logo-sm { width: 150px; }
.appbar a.appbar-action, .appbar .appbar-action { font-size: 14px; font-weight: 600; padding: 12px; text-decoration: none; background: none; border: 0; color: var(--primary); cursor: pointer; font-family: inherit; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; border: none; font-family: inherit; cursor: pointer; width: 100%; text-align: center; }
.btn-lg { min-height: 50px; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-secondary:hover { background: #f2f2f2; color: var(--ink); }
.btn-google { background: #fff; color: #1f1f1f; border: 1.5px solid #c4c7c5; gap: 10px; }
.btn-google:hover { background: #f6f8fc; color: #1f1f1f; }
.btn-google svg { flex-shrink: 0; }
.btn-ghost { background: none; color: var(--primary); width: auto; min-height: 36px; padding: 0 8px; }
.btn-danger-text { background: none; border: 0; color: var(--red); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px; }
.btn-small { min-height: 36px; width: auto; padding: 0 10px; border-radius: 8px; border: 1.5px solid #bdbdbd; background: #fff; font-size: 12px; font-weight: 600; color: var(--ink); font-family: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-small.danger { color: var(--red); }
/* Capitão: braçadeira com "C" */
.captain { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 4px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.keeper { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; font-size: 14px; line-height: 1; vertical-align: 1px; }
.captain-btn { width: 32px; height: 32px; border-radius: 8px; border: 1.5px dashed #bdbdbd; background: #fff; color: #9a9a9a; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.captain-btn:hover { border: 1.5px solid var(--orange); color: var(--orange); }
.team-tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.team-tally-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 10px; background: #fff; border: 1px solid var(--line); border-bottom: 4px solid transparent; color: var(--ink); text-decoration: none; }
.team-tally-item strong { font-size: 20px; line-height: 1; }
.team-tally-item.next { border-bottom-color: var(--orange); }
[id^=board_team_] { scroll-margin-top: 70px; }
.pick-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--orange); color: #fff; cursor: pointer; }
.pick-btn:active { transform: scale(.94); }
.captain-btn.on { display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--orange); background: var(--orange); color: #fff; cursor: default; }
form.button_to { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }

/* Text */
.sect { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.center { text-align: center; }
.brand { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.brand span { color: var(--orange); }

/* Cards */
.card { border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-strong { border: 2px solid var(--ink); border-radius: 14px; }
.card-soft { background: var(--green-soft); border-color: transparent; color: var(--green-dark); }
.card-link { text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--ink); color: inherit; }
.big-number { font-size: 22px; font-weight: 700; }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > div { height: 8px; background: var(--primary); }
.badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: #eee; color: #333; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green-dark); }
.badge-dark { background: var(--ink); color: #fff; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.linkbox { border: 1.5px dashed #9a9a9a; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #333; font-family: ui-monospace, monospace; word-break: break-all; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-num { width: 20px; font-size: 13px; color: var(--muted); text-align: right; flex-shrink: 0; }
.list-title { font-size: 14px; font-weight: 600; }
.list-sub { font-size: 12px; color: var(--muted); }

/* Avatar */
.av { border-radius: 50%; background: #e6e6e3; border: 1.5px solid #c4c4c0; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #555; object-fit: cover; }
.av-md { width: 36px; height: 36px; }
.av-lg { width: 72px; height: 72px; font-size: 22px; }
.av-sm { width: 28px; height: 28px; font-size: 10px; }

/* Forms */
/* iOS dá zoom ao focar campo com letra menor que 16px: nenhum campo fica abaixo disso. */
input, select, textarea { font-size: 16px; }
/* Seletor com opção longa não pode empurrar a largura (o Safari mede pelo maior texto). */
select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.field, .field > * { min-width: 0; max-width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: #333; }
.input, .field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field input[type=number], .field input[type=datetime-local], .field input[type=date], .field select, .field textarea {
  width: 100%; min-height: 46px; border: 1.5px solid #bdbdbd; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink);
}
/* Data e hora no iOS: sem o estilo nativo o campo fica centralizado e sem altura quando vazio. */
.field input[type=date], .field input[type=datetime-local], .field input[type=time] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
.field input::-webkit-date-and-time-value { text-align: left; min-height: 1.5em; }
.field textarea { min-height: 160px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.hint { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, a.chip-link { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid #bdbdbd; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); text-decoration: none; white-space: nowrap; }
.chip input:checked + span, a.chip-link.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--primary); flex-shrink: 0; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper input { width: 80px !important; text-align: center; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Flash */
.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 12px 20px 0; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-notice { background: var(--green-soft); color: var(--green-dark); }
.alert-error { background: #fdecea; color: var(--red); margin: 0; }
.alert-alert { background: var(--warn-soft); color: var(--warn); }

/* Scoreboard */
.score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.score-num { font-size: 38px; font-weight: 700; letter-spacing: .02em; }
.score-team { font-size: 15px; font-weight: 700; }
/* Cronômetro da partida (acima do placar) */
.clock { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.clock-time { font-size: 76px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--primary); }
.clock-paused .clock-time { color: var(--muted); }
.clock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 4px; }
.clock-actions form { display: contents; }
.btn:disabled { opacity: .4; cursor: default; }
.adj { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid #9a9a9a; background: #fff; font: inherit; font-size: 18px; cursor: pointer; color: var(--ink); }
.player-btn { width: 100%; min-height: 46px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); text-align: left; padding: 6px 10px; }
.player-btn:hover { border-color: var(--ink); }
.player-btn:active { background: var(--primary-soft); }
.col-head { font-size: 12px; font-weight: 700; color: var(--muted); }

/* Escalação: vagas e modal de escolher jogador */
.lineup-slot { padding: 8px 0; }
.lineup-empty { display: flex; align-items: center; width: 100%; min-height: 46px; margin: 6px 0 2px; padding: 0 12px; border: 1.5px dashed #bdbdbd; border-radius: 10px; background: #fafaf8; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.lineup-empty:hover { border-color: var(--ink); color: var(--ink); }
.sheet { width: min(480px, 100vw); max-width: 100vw; max-height: 80dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 16px 16px 0 0; background: #fff; color: var(--ink); }
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); }
.sheet-body { overflow-y: auto; padding: 0 16px 16px; }
.pick-row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pick-row:hover { background: #f6f6f4; }
.pick-row[hidden], .empty[hidden], .field[hidden] { display: none; }
@media (min-width: 600px) { .sheet { margin: auto; border-radius: 16px; } }
.sheet-close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.sheet-close:hover { background: #f2f2f2; }
.next-result { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.next-result strong { font-size: 18px; }

/* Team picker */
.team-pick { position: relative; }
.team-pick input { position: absolute; opacity: 0; }
.team-pick > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; padding: 4px; border-radius: 10px; border: 1.5px solid #bdbdbd; font-size: 14px; font-weight: 600; cursor: pointer; }
.team-pick small { font-weight: 400; display: inline-flex; align-items: center; }
.team-pick input:checked + span { border: 2px solid var(--primary); background: var(--primary-soft); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { font-size: 11px; color: var(--muted); font-weight: 700; text-align: center; padding: 6px 2px; border-bottom: 1.5px solid var(--ink); }
.table td { padding: 9px 2px; text-align: center; border-bottom: 1px solid var(--line); }
.table th:nth-child(2), .table td:nth-child(2) { text-align: left; }
.table td.pts { font-weight: 700; }
.table tr.me { background: var(--green-soft); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.podium > div, .podium > a { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

.empty { border: 1.5px dashed var(--border); border-radius: 12px; padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
/* Tab bar fixa embaixo, estilo iPhone */
.shell:has(> .tabbar) { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 6; display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar .tab-form { flex: 1; display: flex; margin: 0; }
.tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0; background: none; border: 0; font: inherit; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tabbar .tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .tab.is-active { color: var(--primary); font-weight: 600; }
.tabbar .tab.is-active svg { stroke-width: 2.2; }
/* Ação principal grudada no rodapé (acima da tab bar); no fim da página fica no lugar normal. */
.sticky-action { position: sticky; bottom: 0; z-index: 4; margin: -12px -20px -20px; padding: 16px 20px 20px; background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)); }
.shell:has(> .tabbar) .sticky-action { bottom: calc(58px + env(safe-area-inset-bottom)); padding-bottom: 12px; margin-bottom: -12px; }
.sticky-action .btn { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }

/* Resenha */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.gallery-item { position: relative; aspect-ratio: 1; background: #ececea; border-radius: 6px; overflow: hidden; }
.gallery-item a, .gallery-item button.tile { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.gallery-play span { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; padding-left: 3px; }
.gallery-remove { position: absolute; top: 4px; right: 4px; margin: 0; }
.gallery-remove button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.strip .gallery-item { border-radius: 8px; }

.lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(0,0,0,.94); color: #fff; }
.lightbox::backdrop { background: rgba(0,0,0,.94); }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 14px; }
.lightbox-bar a, .lightbox-bar button { color: #fff; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; padding: 8px; text-decoration: none; }
.lightbox-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.lightbox-media { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-nav { display: flex; justify-content: space-between; padding: 10px 12px 18px; }
.lightbox-nav button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.4); background: none; color: #fff; font-size: 20px; cursor: pointer; }
.gallery-item span.tile { display: block; width: 100%; height: 100%; }

/* Recorte da foto de perfil */
.cropper { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: #111; color: #fff; }
.cropper::backdrop { background: #111; }
.cropper[open] { display: flex; flex-direction: column; }
.cropper-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 15px; }
.cropper-bar button { color: #fff; background: none; border: 0; font: inherit; cursor: pointer; padding: 8px; }
.cropper-bar .strong { font-weight: 700; color: var(--orange); }
.cropper-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 16px; min-height: 0; }
.cropper-stage canvas { touch-action: none; cursor: grab; display: block; }
.cropper-stage canvas:active { cursor: grabbing; }
.cropper-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); color: #bbb; text-align: center; }
.cropper-zoom { display: flex; align-items: center; gap: 12px; width: min(100%, 420px); font-size: 20px; }
.cropper-zoom input { flex: 1; accent-color: var(--orange); }

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

/* Confirmar/desconfirmar a si mesmo, acima da lista do racha */
.me-bar { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--primary-soft); }
.btn-auto { width: auto; flex-shrink: 0; }

/* Card do jogador */
.av-xl { width: 88px; height: 88px; font-size: 28px; border: 3px solid rgba(255,255,255,.85); }
.player-card { border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, var(--primary) 0%, #0b3a8c 100%); color: #fff; box-shadow: 0 6px 18px rgba(1,26,77,.18); }
.player-card-top { display: flex; align-items: center; gap: 16px; padding: 20px 18px 16px; }
.player-card-name { font-size: 22px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.player-card-sub { font-size: 13px; opacity: .8; }
.player-card-rank { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 10px; background: var(--orange); color: #fff; }
.player-card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: rgba(255,255,255,.08); border-top: 1px solid rgba(255,255,255,.14); }
.player-card-stats > div { display: flex; flex-direction: column; align-items: center; padding: 12px 4px; }
.player-card-stats > div + div { border-left: 1px solid rgba(255,255,255,.14); }
.player-card-stats strong { font-size: 22px; }
.player-card-stats span, .stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border: 1.5px solid var(--border); border-radius: 12px; }
.stat strong { font-size: 24px; }
.stat-win { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.stat-loss { border-color: #e7b48a; background: var(--warn-soft); color: var(--warn); }

/* Escalação da partida rolando */
.live-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 46px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.live-slot:hover { border-color: var(--ink); }
.live-slot-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.live-slot-action { font-size: 11px; font-weight: 600; color: var(--primary); }

/* Modal de comemoração do lance (Stimulus celebrate) */
.celebrate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(1, 26, 77, .55); animation: celebrate-in .18s ease-out; cursor: pointer; }
.celebrate-out { animation: celebrate-fade .2s ease-in forwards; }
.celebrate-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebrate-card { position: relative; width: 100%; max-width: 320px; background: #fff; border-radius: 20px; padding: 24px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); animation: celebrate-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.celebrate-emoji { font-size: 44px; line-height: 1; }
.celebrate-title { font-size: 38px; font-weight: 700; line-height: 1.1; color: var(--orange); margin-top: 6px; overflow-wrap: anywhere; }
.celebrate-bad .celebrate-title { color: var(--ink); font-size: 30px; }
.celebrate-player { font-size: 20px; font-weight: 700; color: var(--primary); }
.celebrate-score { margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.celebrate-card .tiny { margin-top: 10px; }
@keyframes celebrate-in { from { opacity: 0; } }
@keyframes celebrate-fade { to { opacity: 0; } }
@keyframes celebrate-pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .celebrate, .celebrate-card { animation: none; }
}

/* Câmera do racha (/matchdays/:id/camera) e painel de câmeras na partida */
.camera-preview { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.camera-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 14px; }
.camera-placeholder[hidden] { display: none; }
.camera-rec { background: #c62828; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.camera-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.camera-flash.on { animation: camera-flash .5s ease-out; }
@keyframes camera-flash { from { opacity: .8; } to { opacity: 0; } }
.camera-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.camera-stats div { border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.camera-stats small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.camera-stats strong { font-size: 14px; overflow-wrap: anywhere; }
.camera-input { font: inherit; font-size: 16px; padding: 10px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; width: 100%; }
.camera-captures { margin: 0; padding: 0; list-style: none; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.camera-captures:empty::before { content: "Nenhum lance ainda."; color: var(--muted); }
.camera-captures .fail { color: var(--red); }
.camera-toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: calc(100% - 32px); max-width: 448px; background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 14px; font-size: 14px; font-weight: 600; text-align: center; z-index: 40; }
.cameras-panel { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.cameras-panel .dot { width: 10px; height: 10px; border-radius: 50%; background: #bbb; flex-shrink: 0; }
.cameras-panel.on .dot { background: var(--green); }
.cameras-panel .btn { width: auto; flex-shrink: 0; }
.gallery-replay { position: absolute; left: 6px; top: 6px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; pointer-events: none; }
.replay-chip { flex-shrink: 0; border: 0; background: var(--orange); color: #fff; font: inherit; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.camera-preview.portrait { aspect-ratio: 9 / 16; width: min(100%, calc(60vh * 9 / 16)); margin: 0 auto; }
.camera-warning { margin: 0; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.camera-warning[hidden] { display: none; }
/* Câmera ligada: ocupa a tela toda, com as informações por cima e só o botão de parar. */
.camera-hud { display: none; }
.camera-preview.live { position: fixed; inset: 0; z-index: 30; width: auto; aspect-ratio: auto; margin: 0; border-radius: 0; touch-action: none; overscroll-behavior: contain; }
.camera-preview.live video { object-fit: contain; }
.camera-preview.live .camera-hud { display: flex; position: absolute; inset: 0; flex-direction: column; justify-content: space-between; gap: 12px; pointer-events: none;
  padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }
.camera-hud-top { display: flex; align-items: flex-start; gap: 10px; }
.camera-hud-info { display: flex; flex-direction: column; min-width: 0; color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.camera-hud-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.camera-hud-last { margin: 0; max-width: 100%; background: rgba(0,0,0,.65); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; text-align: center; }
.camera-hud-last[hidden] { display: none; }
.camera-stop { pointer-events: auto; width: auto; min-width: 200px; background: rgba(255,255,255,.92); color: var(--ink); }
.camera-stop:hover { background: #fff; color: var(--ink); }
