/* Layout: noite de jogo na Baixada. Coluna central: título de placar,
   botão verde gigante e a janela do grupo do WhatsApp logo abaixo. */
:root {
  --noite: #0d0a0b;        /* fundo do estádio */
  --listra: #1a0f11;       /* listra rubro-negra escura */
  --rubro: #d7192f;        /* vermelho Furacão */
  --verde: #25d366;        /* botão do WhatsApp */
  --verde-fundo: #0f7a5f;  /* sombra do botão */
  --giz: #f4efe9;          /* texto claro */
  --giz-fraco: #a99da0;    /* texto secundário */
  --chat: #0b141a;         /* fundo do chat (WhatsApp escuro) */
  --chat-topo: #202c33;
  --bolha: #202c33;
  --bolha-texto: #e9edef;
  --hora: #8696a0;
  --nome: #ff6fb5;
  --aviso: #182229;
  --aviso-texto: #ffd279;

  --f-display: "Bungee", "Impact", "Arial Black", sans-serif;
  --f-texto: "Figtree", "Segoe UI", Helvetica, Arial, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--f-texto);
  color: var(--giz);
  background-color: var(--noite);
  /* Arquibancada rubro-negra: listras diagonais bem discretas + holofote */
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(215, 25, 47, 0.28), transparent 70%),
    repeating-linear-gradient(135deg, var(--noite) 0 38px, var(--listra) 38px 76px);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding-block: max(28px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  text-align: center;
}

/* ---------- Título ---------- */

.topo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.selo {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--noite);
  background: var(--aviso-texto);
  padding: 5px 10px;
  border-radius: 3px;
  transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--rubro);
}

.titulo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  text-wrap: balance;
}

.titulo-nome {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 13vw, 4.2rem);
  color: var(--giz);
  text-shadow: 4px 4px 0 var(--rubro), 8px 8px 0 #000;
  letter-spacing: 0.01em;
}

.titulo-versao {
  margin-top: 12px;
  font-family: var(--f-display);
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  color: var(--rubro);
  background: var(--giz);
  padding: 4px 12px 2px;
  border-radius: 999px;
  transform: rotate(3deg);
}

.sub {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--giz-fraco);
  letter-spacing: 0.04em;
}

/* ---------- Botão ---------- */

.palco {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px;
}

/* Foto do Nano colada como figurinha, ao lado do botão */
.figurinha {
  position: absolute;
  z-index: 2;
  left: calc(50% + 66px);
  bottom: -22px;
  margin: 0;
  width: clamp(84px, 26vw, 120px);
  transform: rotate(8deg);
  animation: joinha 3s ease-in-out infinite;
}

.figurinha img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--giz);
  box-shadow: 4px 4px 0 var(--rubro), 0 10px 20px rgba(0, 0, 0, 0.5);
}

.figurinha figcaption {
  position: absolute;
  top: -12px;
  right: -14px;
  font-family: var(--f-display);
  font-size: 0.8rem;
  color: var(--noite);
  background: var(--aviso-texto);
  padding: 3px 8px 1px;
  border-radius: 4px;
  transform: rotate(12deg);
  box-shadow: 2px 2px 0 #000;
}

@keyframes joinha {
  0%, 100% { transform: rotate(8deg); }
  50% { transform: rotate(3deg) translateY(-4px); }
}

.botao {
  position: relative;
  width: min(64vw, 230px);
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 6px solid var(--giz);
  cursor: pointer;
  background: radial-gradient(circle at 35% 28%, #6cf09c, var(--verde) 42%, #149e55 100%);
  color: #fff;
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 5.4vw, 1.4rem);
  line-height: 1.1;
  padding: 26px;
  text-shadow: 2px 2px 0 var(--verde-fundo);
  box-shadow:
    0 12px 0 var(--verde-fundo),
    0 12px 0 6px var(--giz),
    0 30px 50px rgba(0, 0, 0, 0.6);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  animation: respira 2.6s ease-in-out infinite;
}

.botao-texto { position: relative; z-index: 1; display: block; }

/* Anel pulsando em volta, chamando o clique */
.botao-anel {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 3px dashed var(--rubro);
  animation: gira 14s linear infinite;
  pointer-events: none;
}

.botao:hover { filter: brightness(1.06) saturate(1.1); }

.botao:active,
.botao.apertado {
  animation: none;
  transform: translateY(10px) scale(0.98);
  box-shadow:
    0 2px 0 var(--verde-fundo),
    0 2px 0 6px var(--giz),
    0 10px 20px rgba(0, 0, 0, 0.5);
}

.botao:focus-visible {
  outline: 4px solid var(--aviso-texto);
  outline-offset: 22px;
}

/* ---------- Chat ---------- */

.chat {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--chat);
  box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--rubro), 0 24px 50px rgba(0, 0, 0, 0.55);
  text-align: left;
}

.chat.tremendo { animation: treme 0.35s ease; }

.chat-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--chat-topo);
}

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-size: 1.1rem;
  color: var(--giz);
  background: repeating-linear-gradient(90deg, var(--rubro) 0 8px, #000 8px 16px);
  border: 2px solid var(--giz);
  position: relative;
  overflow: hidden;
}

/* Foto ampliada e centrada no rosto, para caber na bolinha do grupo */
.avatar img {
  position: absolute;
  left: -49%;
  top: -8%;
  width: 180%;
  height: 180%;
  max-width: none;
}

.chat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.chat-info strong {
  font-size: 1rem;
  color: var(--bolha-texto);
}

.status {
  font-size: 0.78rem;
  color: var(--hora);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status.ativo { color: var(--verde); }

.chat-icones { color: var(--hora); font-size: 1.3rem; }

.chat-fundo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 14px 18px;
  min-height: 170px;
  background-color: var(--chat);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.035) 2px, transparent 3px),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.03) 3px, transparent 4px),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.035) 1.5px, transparent 2.5px);
  background-size: 60px 60px, 90px 90px, 45px 45px;
}

.aviso {
  margin: 0 auto;
  max-width: 92%;
  font-size: 0.74rem;
  line-height: 1.35;
  text-align: center;
  color: var(--aviso-texto);
  background: var(--aviso);
  padding: 6px 10px;
  border-radius: 8px;
}

.bolha {
  position: relative;
  align-self: flex-start;
  max-width: 88%;
  margin-left: 8px;
  background: var(--bolha);
  color: var(--bolha-texto);
  border-radius: 0 10px 10px 10px;
  padding: 6px 10px 8px;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.4);
  animation: entrar 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}

/* O "rabinho" da mensagem recebida */
.bolha::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  border-right: 8px solid var(--bolha);
  border-bottom: 10px solid transparent;
}

.bolha.vazia .texto { color: var(--hora); font-style: italic; }

.remetente {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--nome);
  margin-bottom: 2px;
}

.texto {
  font-size: 1.05rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rodape {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.hora {
  font-size: 0.7rem;
  color: var(--hora);
  font-variant-numeric: tabular-nums;
}

.digitando .texto {
  display: flex;
  gap: 4px;
  padding: 6px 2px;
}

.digitando .texto span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hora);
  animation: pulo 1s infinite ease-in-out;
}
.digitando .texto span:nth-child(2) { animation-delay: 0.15s; }
.digitando .texto span:nth-child(3) { animation-delay: 0.3s; }

/* ---------- Contador ---------- */

.contador {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--giz-fraco);
  font-variant-numeric: tabular-nums;
}

.contador strong {
  font-family: var(--f-display);
  font-weight: 400;
  color: var(--aviso-texto);
  font-size: 1.1em;
}

/* ---------- Compartilhar ---------- */

.compartilhar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border: 2px dashed rgba(244, 239, 233, 0.25);
  border-radius: 14px;
  background: rgba(13, 10, 11, 0.6);
}

.compartilhar h2 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 4.8vw, 1.3rem);
  color: var(--giz);
  text-shadow: 2px 2px 0 var(--rubro);
  text-wrap: balance;
}

.compartilhar-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--giz-fraco);
  text-wrap: balance;
}

.link-linha {
  width: 100%;
  display: flex;
  gap: 8px;
}

.link-campo {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px; /* evita o zoom automático do iPhone */
  font-weight: 600;
  color: var(--giz);
  background: var(--chat);
  border: 2px solid rgba(244, 239, 233, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
}

.link-campo:focus-visible {
  outline: none;
  border-color: var(--aviso-texto);
}

.copiar {
  flex: none;
  font-family: var(--f-display);
  font-size: 0.9rem;
  color: var(--noite);
  background: var(--aviso-texto);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b8892f;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

.copiar:active { transform: translateY(4px); box-shadow: 0 0 0 #b8892f; }
.copiar.ok { background: var(--verde); box-shadow: 0 4px 0 var(--verde-fundo); }
.copiar:focus-visible { outline: 3px solid var(--giz); outline-offset: 3px; }

.whats {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--verde);
  text-decoration: none;
  padding: 6px 4px;
}

.whats:hover, .whats:focus-visible { text-decoration: underline; }

.copiado {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--verde);
}

/* ---------- Celular ---------- */

@media (max-width: 480px) {
  .app { gap: 22px; }
  .selo { font-size: 0.64rem; letter-spacing: 0.08em; }
  .chat-fundo { min-height: 150px; padding: 12px 10px 16px; }
  .texto { font-size: 1rem; }
}

/* Telas bem estreitas (iPhone SE, Androids pequenos) */
@media (max-width: 360px) {
  .titulo-nome { text-shadow: 3px 3px 0 var(--rubro), 6px 6px 0 #000; }
  .sub { font-size: 0.76rem; }
  .botao { border-width: 5px; padding: 20px; }
  .figurinha { left: calc(50% + 52px); width: 80px; }
  .link-linha { flex-direction: column; }
  .copiar { width: 100%; }
}

/* ---------- Animações ---------- */

@keyframes respira {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes gira { to { transform: rotate(360deg); } }

@keyframes entrar {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

@keyframes pulo {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes treme {
  0%, 100% { transform: none; }
  20% { transform: translateX(-4px) rotate(-0.4deg); }
  40% { transform: translateX(4px) rotate(0.4deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .botao, .botao-anel, .bolha, .chat.tremendo, .digitando .texto span, .figurinha { animation: none; }
}
