/* Identidade própria do cliente Fran Silva: tema escuro roxo + laranja, cabeçalho tipo placar,
   painel lateral de escolha. Compartilhado por fran-silva e fran-silva-e-renata-abreu. */
:root {
  --noite: #1a0930;
  --noite-2: #26103f;
  --roxo: #6e2689;
  --roxo-claro: #a45bc4;
  --laranja: #f56e2c;
  --laranja-escuro: #c94d12;
  --texto: #f6eefc;
  --suave: #b9a5cc;
  --linha: rgba(255, 255, 255, .1);
  --zap: #1faa53;
  --alerta: #ffb46b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(90% 50% at 100% 0%, rgba(245, 110, 44, .22), transparent 70%),
    radial-gradient(70% 40% at 0% 30%, rgba(110, 38, 137, .45), transparent 70%),
    var(--noite);
  background-attachment: fixed;
  line-height: 1.4;
  min-height: 100vh;
}

/* ---------- cabeçalho placar ---------- */
.topo { max-width: 520px; margin: 0 auto; padding: 18px 16px 6px; }
.placar { display: grid; gap: 8px; }
.placar-linha {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border-radius: 16px;
  overflow: hidden;
  background: var(--noite-2);
  border: 1px solid var(--linha);
}
.placar-nome { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; }
.placar-nome small { font-size: .62rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--laranja); }
.placar-nome strong { font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.placar-num {
  min-width: 108px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  background: var(--laranja);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%);
}
.chamada { margin: 18px 0 0; }
.chamada h1 { margin: 0; font-size: 1.55rem; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.chamada h1 span { color: var(--laranja); }
.chamada p { margin: 6px 0 0; color: var(--suave); font-size: .92rem; text-wrap: balance; }
.chamada p strong { color: var(--texto); }

main { max-width: 520px; margin: 0 auto; padding: 14px 16px 40px; }

/* ---------- colinha ---------- */
.colinha {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--linha), 0 18px 40px rgba(0, 0, 0, .45);
}
.colinha canvas { display: block; width: 100%; height: auto; }

.alvo {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.alvo:hover, .alvo:focus-visible { background: rgba(245, 110, 44, .12); outline: 3px solid var(--laranja); outline-offset: -3px; }
.alvo.vazio::after {
  content: "Toque para escolher";
  position: absolute;
  left: var(--dica-x);
  top: var(--dica-y);
  transform: translateY(-50%);
  font-size: clamp(.72rem, 3.3vw, .95rem);
  font-weight: 800;
  font-style: italic;
  white-space: nowrap;
  line-height: 1;
  color: var(--roxo);
  animation: pulsar 1.8s ease-in-out infinite;
}
@keyframes pulsar { 50% { opacity: .5; } }

/* ---------- ações ---------- */
.acoes { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 16px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 0;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-zap { background: var(--zap); color: #fff; white-space: nowrap; font-size: 1.1rem; }
.btn-baixar { background: transparent; color: var(--texto); border: 2px solid var(--laranja); padding: 10px 14px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.limpar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px auto 0;
  border: 0;
  background: none;
  color: var(--suave);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}
.limpar svg { width: 18px; height: 18px; color: var(--laranja); }
.limpar:active svg { transform: rotate(-40deg); }

/* ---------- painel lateral de escolha ---------- */
dialog {
  padding: 0;
  border: 0;
  margin: 0 0 0 auto;
  width: min(100%, 460px);
  max-width: none;
  height: 100dvh;
  max-height: none;
  background: var(--noite);
  color: var(--texto);
  box-shadow: -20px 0 40px rgba(0, 0, 0, .5);
}
dialog[open] { animation: entrar .22s ease-out; }
@keyframes entrar { from { transform: translateX(40px); opacity: 0; } }
dialog::backdrop { background: rgba(10, 3, 20, .7); }
.sheet { display: flex; flex-direction: column; height: 100%; }
.sheet-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--linha);
}
.fechar {
  order: -1;
  width: 44px; height: 44px; flex: none;
  border: 1px solid var(--linha);
  border-radius: 12px;
  background: var(--noite-2);
  color: var(--texto);
  font-size: 1.4rem;
  cursor: pointer;
}
.sheet-topo h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.sheet-topo h2::before { content: "Escolha · "; color: var(--laranja); }
#busca {
  margin: 12px 16px 6px;
  padding: 13px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--texto);
  background: var(--noite-2);
  border: 1px solid var(--linha);
  border-radius: 12px;
}
#busca::placeholder { color: var(--suave); }
#busca:focus { outline: 2px solid var(--laranja); border-color: transparent; }
.lista { list-style: none; margin: 0; padding: 4px 10px 16px; overflow-y: auto; flex: 1; }
.lista button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  margin: 2px 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.lista button:hover, .lista button:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.lista button[aria-pressed="true"] { background: rgba(245, 110, 44, .16); box-shadow: inset 0 0 0 1px var(--laranja); }
.lista button[disabled] { opacity: .4; cursor: not-allowed; }
.lista .numero {
  order: -1;
  min-width: 64px;
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--laranja);
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.lista img, .lista .sem-foto { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: var(--noite-2); flex: none; }
.lista .info { display: flex; flex-direction: column; min-width: 0; }
.lista .nome { font-weight: 800; font-size: .92rem; }
.lista .partido { font-size: .78rem; color: var(--suave); }
.lista .tag { font-size: .7rem; font-weight: 700; color: var(--alerta); }
.lista .vazia { padding: 24px 8px; text-align: center; color: var(--suave); }
.sheet-rodape { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linha); }
.sheet-rodape .btn-link { background: none; border: 0; color: var(--suave); font: inherit; font-weight: 700; min-height: 44px; cursor: pointer; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--laranja);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.visivel { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .alvo.vazio::after, dialog[open] { animation: none; }
  .toast { transition: none; }
}
