/* byte-core.css — base visual comum a todos os Templates Byte.
   As cores e a fonte vêm do config (Byte.applyTheme) através das variáveis abaixo. */

:root {
  --c-bg: #f4f4f2;
  --c-surface: #ffffff;
  --c-text: #1d1d1f;
  --c-muted: #6b6b70;
  --c-primary: #1f7a5c;
  --c-on-primary: #ffffff;
  --c-accent: #e2574c;
  --c-line: rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --dur: 220ms;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { overflow: hidden; user-select: none; -webkit-user-select: none; }

.byte-app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  gap: 10px;
}

/* ---------- Barra superior ---------- */
.byte-topbar {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.byte-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.byte-brand img { height: 32px; width: auto; display: block; }
.byte-brand-name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.byte-topbar-actions { display: flex; gap: 6px; }

/* ---------- Botões ---------- */
.byte-btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  min-height: 44px;
  cursor: pointer;
  background: var(--c-primary);
  color: var(--c-on-primary);
  transition: transform var(--dur), opacity var(--dur);
}
.byte-btn:active { transform: scale(0.96); }
.byte-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.byte-btn:focus-visible, .byte-icon-btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.byte-btn--ghost { background: transparent; color: var(--c-text); border: 1.5px solid var(--c-line); }
.byte-btn--block { width: 100%; }

.byte-icon-btn {
  font: inherit;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 1.1rem;
}

/* ---------- Placar ---------- */
.byte-stats { width: 100%; max-width: 520px; display: flex; gap: 8px; }
.byte-stat {
  flex: 1;
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow);
  text-align: center;
}
.byte-stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-muted); font-weight: 700; }
.byte-stat-value { font-size: 1.35rem; font-weight: 800; line-height: 1.2; transition: transform var(--dur); }
.byte-stat-value.bump { transform: scale(1.2); color: var(--c-primary); }

/* ---------- Telas (início e fim) ---------- */
.byte-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--c-bg) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.byte-screen.is-open { display: flex; animation: byte-fade var(--dur) ease-out; }
.byte-card {
  width: 100%;
  max-width: 380px;
  background: var(--c-surface);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 28px 24px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.byte-card img.byte-logo { max-height: 72px; max-width: 70%; margin: 0 auto; display: block; }
.byte-card h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.byte-card p { margin: 0; color: var(--c-muted); line-height: 1.45; }
.byte-big-number { font-size: 3rem; font-weight: 800; color: var(--c-primary); line-height: 1; }
.byte-card-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.byte-how { text-align: left; font-size: 0.9rem; color: var(--c-muted); margin: 0; padding-left: 1.1em; }
.byte-how li + li { margin-top: 4px; }

/* ---------- Selo e toast ---------- */
.byte-badge {
  font-size: 0.7rem;
  color: var(--c-muted);
  text-decoration: none;
  opacity: 0.8;
}
.byte-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--c-text);
  color: var(--c-bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur);
}
.byte-toast.is-visible { opacity: 1; }

.byte-fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

@keyframes byte-fade { from { opacity: 0; } to { opacity: 1; } }

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