/* ═══════════════════════════════════════════════════════════
   styles.css — Estilos globais da aplicação
   Analogia R: tema/tema.R (paleta e estilos visuais)
═══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

/* Seleção de texto com indigo — igual ao BRL */
::selection {
  background-color: rgba(99,102,241,0.18);
  color: #4f46e5;
}

/* Focus visible — acessibilidade */
*:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Scrollbar personalizada (webkit) */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Grupo de botões CTA no hero ────────────────────────── */
.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-hero-ghost {
  display: inline-block;
  padding: 15px 32px;
  background: transparent;
  color: #4f46e5;
  border: 2px solid rgba(79,70,229,0.3);
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
}
.btn-hero-ghost:hover {
  background: rgba(79,70,229,0.07);
  border-color: rgba(79,70,229,0.55);
  transform: translateY(-1px);
}

/* Botão voltar no jogo */
.btn-back-teoria {
  display: block;
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 14px 20px;
  transition: color 0.18s;
  font-family: inherit;
}
.btn-back-teoria:hover { color: #6366f1; }

/* Divisor visual entre seções da página longa */
.section-page-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
  margin: 0;
}

/* ── Footer estilo BRL ──────────────────────────────────── */
.site-footer {
  background: #0f172a;
  color: #64748b;
  text-align: center;
  font-size: 0.82rem;
  font-family: inherit;
}
.site-footer-wave {
  display: block;
  line-height: 0;
  margin-bottom: -2px;
}
.site-footer-wave svg {
  width: 100%;
  height: 72px;
  display: block;
}
.site-footer-inner {
  padding: 8px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.site-footer-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475569;
  font-size: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-footer-sep { color: #334155; }
.site-footer-credit {
  color: #64748b;
  font-size: 0.82rem;
}
.site-footer-credit strong { color: #94a3b8; font-weight: 600; }
.site-footer-heart {
  color: #ec4899;
  font-size: 1rem;
  margin: 0 2px;
}
.site-footer-doi {
  color: #475569;
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.18s;
}
.site-footer-doi:hover { color: #c7d2fe; }
.site-footer-name {
  color: #94a3b8;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s;
}
.site-footer-name:hover { color: #c7d2fe; text-decoration: underline; }
.site-footer-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.18s;
}
.site-footer-link:hover { color: #c7d2fe; }

/* ── Seções ──────────────────────────────────────────────── */
.section        { display: none; }
.section.active { display: block; }

/* ══════════════════════════════════════════════════════════
   TEORIA — Hero + Cards
══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 45%, #faf5ff 100%);
  text-align: center;
  padding: 88px 24px 96px;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Grid pattern overlay — mesmo SVG do BRL */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
}

/* Partículas flutuantes */
.hero-particle {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(99,102,241,0.22);
  animation: heroFloat linear infinite;
  pointer-events: none;
}
@keyframes heroFloat {
  0%   { transform: translateY(0) scale(1);   opacity: 0.2; }
  50%  { opacity: 0.75; }
  100% { transform: translateY(-280px) scale(0.4); opacity: 0; }
}

/* Wrapper do conteúdo */
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

/* Ícone do app */
.hero-icon-wrap {
  position: relative;
  display: inline-flex;
  margin-bottom: 36px;
}
.hero-app-icon {
  width: 96px; height: 96px;
  border-radius: 28px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 60px rgba(99,102,241,0.35);
}
.hero-icon-ring {
  position: absolute;
  inset: -9px;
  border: 2px dashed rgba(99,102,241,0.4);
  border-radius: 37px;
  animation: heroRingSpin 20s linear infinite;
}
@keyframes heroRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.hero-icon-badge {
  position: absolute;
  top: -6px; right: -6px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 4px 12px rgba(236,72,153,0.4);
  z-index: 2;
}

/* Título */
.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}
.hero-title-gradient {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title-lab {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 600;
  color: #334155;
  margin-top: 2px;
}

/* Divisória estilo BRL */
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}
.hero-div-line {
  height: 1px; width: 48px;
  background: linear-gradient(90deg, transparent, #6366f1);
}
.hero-div-line:last-child {
  background: linear-gradient(90deg, #6366f1, transparent);
}
.hero-div-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6366f1;
}

/* Descrição e autor */
.hero-desc {
  max-width: 560px;
  margin: 0 auto 12px;
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.7;
}
.hero-author {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 36px;
}

/* Botão CTA */
.btn-hero {
  display: inline-block;
  padding: 15px 40px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(99,102,241,0.35);
  transition: all 0.25s;
  letter-spacing: 0.01em;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(99,102,241,0.45); }

/* Indicador de scroll */
.hero-scroll {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 40px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6px;
}
.hero-scroll-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #94a3b8;
  animation: heroScrollBounce 2s ease-in-out infinite;
}
@keyframes heroScrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(12px); }
}

.teoria-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}
.teoria-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 20px;
}
.teoria-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.tcard {
  background: white;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  border-left: 4px solid #1d4ed8;
}
.tcard.green  { border-left-color: #059669; }
.tcard.orange { border-left-color: #f97316; }
.tcard.purple { border-left-color: #7c3aed; }

.tcard-icon { font-size: 1.6rem; margin-bottom: 10px; }
.tcard h3   { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; color: #1e293b; }
.tcard p    { font-size: 0.84rem; color: #475569; line-height: 1.7; }
.tcard .formula {
  margin: 12px 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Georgia', serif;
  font-size: 0.88rem;
  color: #1e293b;
  text-align: center;
  line-height: 1.9;
}
.tcard ul { margin: 8px 0 0 4px; padding-left: 16px; font-size: 0.83rem; color: #475569; line-height: 1.8; }

.teoria-full {
  background: white;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 32px;
}
.teoria-full h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; color: #1e293b; }
.teoria-full p  { font-size: 0.85rem; color: #475569; line-height: 1.75; margin-bottom: 10px; }
.teoria-full p:last-child { margin-bottom: 0; }

.teoria-cta {
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 14px;
  border: 1px solid #bfdbfe;
}
.teoria-cta p { font-size: 0.9rem; color: #1e40af; margin-bottom: 16px; font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   ATIVIDADE — Dataset tabs + App
══════════════════════════════════════════════════════════ */
.dataset-tabs { display: flex; gap: 4px; padding: 16px 24px 0; flex-wrap: wrap; }

.dataset-tab {
  padding: 8px 16px;
  border-radius: 10px 10px 0 0;
  border: none;
  background: #dde3ee;
  color: #64748b;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
}
.dataset-tab:hover  { background: #e8edf7; color: #334155; }
.dataset-tab.active { background: white; color: #1d4ed8; font-weight: 700; box-shadow: 0 -2px 6px rgba(0,0,0,0.06); }

.main-card {
  background: white;
  margin: 0 24px;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  overflow: hidden;
}
.dataset-description {
  padding: 10px 20px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  font-size: 0.82rem;
  color: #1e40af;
  line-height: 1.5;
}
.main-content {
  display: grid;
  grid-template-columns: 1fr 270px;
}
.plot-area          { padding: 16px; border-right: 1px solid #e2e8f0; }
.plot-area svg      { width: 100%; height: auto; display: block; }
.drag-hint          { text-align: center; font-size: 0.72rem; color: #94a3b8; margin-top: 4px; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar { padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }

.stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}
.stat-card h3 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin-bottom: 8px;
}
.coef-row        { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.coef-label      { font-size: 0.78rem; color: #64748b; }
.coef-value      { font-size: 0.92rem; font-weight: 600; font-family: monospace; color: #1e293b; }
.rss-value       { font-size: 1.6rem; font-weight: 800; color: #1e293b; line-height: 1.1; }
.rss-sub         { font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }

.prog-wrap  { margin-top: 8px; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; display: none; }
.prog-bar   { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #10b981, #3b82f6); transition: width 0.3s; }
.prog-label { display: none; justify-content: space-between; font-size: 0.68rem; color: #94a3b8; margin-top: 2px; }

/* ── Botões ──────────────────────────────────────────────── */
.btn {
  width: 100%; padding: 9px 12px; border: none; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.18s; text-align: center;
}
.btn-primary      { background: #1d4ed8; color: white; }
.btn-primary:hover{ background: #1e40af; }
.btn-outline      { background: transparent; color: #1d4ed8; border: 1.5px solid #1d4ed8; }
.btn-outline:hover{ background: #eff6ff; }
.btn-outline.active { background: #059669; color: white; border-color: #059669; }
.btn-red          { background: #dc2626; color: white; }
.btn-red:hover    { background: #b91c1c; }
.btn-ghost        { background: #f1f5f9; color: #64748b; }
.btn-ghost:hover  { background: #e2e8f0; }

/* ── Painel da solução ───────────────────────────────────── */
.solution-panel {
  display: none; background: #f0fdf4; border: 1px solid #86efac;
  border-radius: 8px; padding: 10px 12px;
}
.solution-panel h4 {
  font-size: 0.72rem; color: #059669; font-weight: 700;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em;
}
.sol-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: #166534; margin-top: 2px; }

/* ── Modo Desafio ────────────────────────────────────────── */
.challenge-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: #94a3b8; font-weight: 600; }
.timer-display   { font-size: 2.2rem; font-weight: 900; color: #1d4ed8; text-align: center; line-height: 1; margin: 6px 0 4px; }
.timer-display.urgent { color: #dc2626; animation: blink 0.6s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

.timer-bar-wrap { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.timer-bar      { height: 100%; background: #1d4ed8; transition: width 1s linear; border-radius: 3px; }
.score-live     { text-align: center; font-size: 0.82rem; color: #059669; font-weight: 600; margin-top: 4px; }

.result-box     { text-align: center; padding: 10px 8px; background: #fafafa; border-radius: 8px; border: 1px solid #e2e8f0; }
.result-emoji   { font-size: 2rem; }
.result-score   { font-size: 1.1rem; font-weight: 800; color: #1e293b; margin: 4px 0 2px; }
.result-msg     { font-size: 0.75rem; color: #64748b; line-height: 1.4; }

/* ── Heatmap ─────────────────────────────────────────────── */
.heatmap-section {
  margin: 12px 24px 24px; background: white;
  border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); overflow: hidden;
}
.heatmap-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; cursor: pointer; user-select: none;
  border-bottom: 1px solid transparent; transition: background 0.15s;
}
.heatmap-header:hover { background: #f8fafc; }
.heatmap-header.open  { border-bottom-color: #e2e8f0; }
/* Travado durante round ativo — heatmap revelaria a solução OLS */
.heatmap-header.game-locked {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}
.heatmap-header h2    { font-size: 0.88rem; font-weight: 600; color: #1e293b; }
.heatmap-toggle       { font-size: 0.75rem; color: #94a3b8; }

.heatmap-body          { display: none; padding: 14px 20px 18px; }
.heatmap-body.open     { display: block; }
.heatmap-explain       { font-size: 0.78rem; color: #64748b; line-height: 1.5; margin-bottom: 12px; }
.heatmap-canvas-wrap   { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#heatmapCanvas         { border-radius: 8px; display: block; max-width: 100%; }
.heatmap-legend        { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; color: #64748b; }
#legendCanvas          { border-radius: 4px; }
.heatmap-axis-labels   {
  display: flex; justify-content: space-between; font-size: 0.7rem; color: #94a3b8;
  width: 100%; max-width: 420px; margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════
   COMO USAR
══════════════════════════════════════════════════════════ */
.como-usar-body  { max-width: 720px; margin: 0 auto; padding: 36px 24px 56px; }
.como-usar-body h2    { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; color: #1e293b; }
.como-usar-body .page-sub { font-size: 0.88rem; color: #64748b; margin-bottom: 32px; }

.steps { display: flex; flex-direction: column; gap: 16px; }
.step  { display: flex; gap: 16px; background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); align-items: flex-start; }
.step-num {
  min-width: 36px; height: 36px; background: #1d4ed8; color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
}
.step-icon            { font-size: 1.6rem; flex-shrink: 0; }
.step-content h4      { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; color: #1e293b; }
.step-content p       { font-size: 0.83rem; color: #475569; line-height: 1.65; }

.tip-box    { margin-top: 28px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 20px; }
.tip-box h4 { font-size: 0.88rem; font-weight: 700; color: #92400e; margin-bottom: 10px; }
.tip-box ul { padding-left: 18px; font-size: 0.83rem; color: #78350f; line-height: 1.8; }

.como-usar-cta { margin-top: 28px; text-align: center; }
.btn-cta-blue  {
  display: inline-block; padding: 12px 30px; background: #1d4ed8; color: white;
  border: none; border-radius: 50px; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-cta-blue:hover { background: #1e40af; transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════════
   CRÉDITOS
══════════════════════════════════════════════════════════ */
.creditos-body  { max-width: 620px; margin: 0 auto; padding: 48px 24px 64px; text-align: center; }
.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(29,78,216,0.25);
}
.profile-name { font-size: 1.5rem; font-weight: 800; color: #1e293b; margin-bottom: 4px; }
.profile-role { font-size: 0.9rem; color: #64748b; margin-bottom: 24px; }

.profile-links { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin: 0 auto 32px; }
.profile-link  {
  display: flex; align-items: center; gap: 12px; background: white;
  border-radius: 10px; padding: 12px 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  text-decoration: none; color: #1e293b; font-size: 0.86rem; font-weight: 500; transition: all 0.2s;
}
.profile-link:hover   { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-1px); color: #1d4ed8; }
.profile-link .link-icon  { font-size: 1.1rem; }
.profile-link .link-label { color: #94a3b8; font-size: 0.72rem; display: block; }
.profile-link .link-value { font-weight: 600; }

.divider    { border: none; border-top: 1px solid #e2e8f0; margin: 24px 0; }
.about-app  { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); text-align: left; }
.about-app h4 { font-size: 0.88rem; font-weight: 700; margin-bottom: 10px; color: #1e293b; }
.about-app p  { font-size: 0.82rem; color: #64748b; line-height: 1.7; margin-bottom: 8px; }
.about-app p:last-child { margin-bottom: 0; }
.tech-badges  { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tech-badge   { background: #f1f5f9; color: #475569; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVO
══════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  header          { padding: 10px 16px; gap: 8px; }
  .nav-link       { padding: 6px 10px; font-size: 0.75rem; }
  .dataset-tabs   { padding: 12px 12px 0; }
  .main-card      { margin: 0 12px; }
  .main-content   { grid-template-columns: 1fr; }
  .plot-area      { border-right: none; border-bottom: 1px solid #e2e8f0; }
  .heatmap-section{ margin: 12px 12px 20px; }
  .hero-title     { font-size: 1.5rem; }
  .teoria-cards   { grid-template-columns: 1fr; }
}

/* ── D3 axis ──────────────────────────────────────────────── */
.tick line  { stroke: #e2e8f0; }
.tick text  { fill: #94a3b8; font-size: 10px; }
.domain     { stroke: #e2e8f0; }

/* ── Resíduos (segmentos laranjas) ───────────────────────── */
/* Estilos estáticos definidos aqui em vez de via JS a cada frame */
.residual-line {
  stroke:            #f97316;
  stroke-width:      1.5;
  stroke-dasharray:  3 2;
  opacity:           0.65;
}

/* ══════════════════════════════════════════════════════════
   LIGA DE REGRESSÃO — TELAS DO JOGO
══════════════════════════════════════════════════════════ */

/* Cada tela do jogo fica oculta por padrão */
.game-screen          { display: none; }
.game-screen.active   { display: block; }

/* Botão principal do jogo */
.btn-liga-start {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(29,78,216,0.35);
  transition: all 0.2s;
  letter-spacing: 0.01em;
  margin-top: 20px;
}
.btn-liga-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(29,78,216,0.4);
}

/* ── TELA: HOME ───────────────────────────────────────────── */
.liga-home {
  max-width: 640px;
  margin: 0 auto;
  padding: 52px 24px 64px;
  text-align: center;
}
.liga-logo       { font-size: 3.6rem; margin-bottom: 12px; }
.liga-home-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.liga-home-sub {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.65;
  margin-bottom: 28px;
}

.liga-rounds-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin-bottom: 20px;
}
.liga-round-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #1d4ed8;
}
.liga-round-item:nth-child(2) { border-left-color: #059669; }
.liga-round-item:nth-child(3) { border-left-color: #f97316; }
.liga-round-item:nth-child(4) { border-left-color: #7c3aed; }
.liga-round-item:nth-child(5) { border-left-color: #dc2626; }
.liga-round-item:nth-child(6) { border-left-color: #0891b2; }
.liga-round-item:nth-child(7) { border-left-color: #db2777; }

.lri-icon  { font-size: 1.7rem; flex-shrink: 0; }
.lri-info  { display: flex; flex-direction: column; gap: 2px; }
.lri-title { font-size: 0.88rem; font-weight: 700; color: #1e293b; }
.lri-meta  { font-size: 0.75rem; color: #94a3b8; }

.liga-scoring-tip {
  font-size: 0.8rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 4px;
}

/* ── TELA: BRIEFING ──────────────────────────────────────── */
.liga-briefing {
  max-width: 580px;
  margin: 0 auto;
  padding: 44px 24px 56px;
  text-align: center;
}
.brief-round-badge {
  display: inline-block;
  background: #1d4ed8;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.brief-icon  { font-size: 3rem; margin-bottom: 10px; }
.brief-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 12px;
}
.brief-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 20px;
}
.brief-meta-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 16px;
}
.brief-meta-item { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.bmi-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: #94a3b8; font-weight: 700; }
.bmi-value { font-size: 1rem; font-weight: 700; color: #1e293b; }

.brief-hint {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: #92400e;
  margin-bottom: 14px;
  text-align: left;
}
.brief-score-so-far {
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
  margin-bottom: 4px;
  min-height: 1rem;
}

/* ── TELA: JOGO — play-header ────────────────────────────── */
.play-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  color: white;
}
.play-round-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}
.play-timer-center  { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.play-timer-num {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.play-timer-num.urgent { color: #fca5a5; animation: blink 0.6s infinite; }
/* @keyframes blink já definido acima — não duplicar */

.play-timer-bar-bg {
  width: 120px;
  height: 5px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
}
.play-timer-bar {
  height: 100%;
  background: white;
  border-radius: 3px;
  transition: width 1s linear;
}
.play-pct-live {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
#play-pct-live      { font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.play-pct-label     { font-size: 0.68rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── TELA: RESULTADO DO ROUND ────────────────────────────── */
.liga-round-result {
  max-width: 480px;
  margin: 0 auto;
  padding: 44px 24px 56px;
  text-align: center;
}
.rr-emoji       { font-size: 3.6rem; margin-bottom: 8px; }
.rr-round-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: #94a3b8; font-weight: 700; margin-bottom: 8px; }
.rr-pct         { font-size: 1.8rem; font-weight: 800; color: #1e293b; margin-bottom: 20px; }

.rr-score-card {
  background: white;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  text-align: left;
}
.rr-score-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #475569;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
}
.rr-score-row:last-child { border-bottom: none; }
.rr-score-row.bonus  { color: #059669; }
.rr-score-row.total  { font-weight: 700; color: #1d4ed8; font-size: 0.92rem; padding-top: 10px; }
.rr-score-row.accum  { font-size: 0.9rem; padding-top: 6px; color: #1e293b; }

.rr-msg {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ── TELA: QUIZ ──────────────────────────────────────────── */
.liga-quiz {
  max-width: 620px;
  margin: 0 auto;
  padding: 44px 24px 56px;
}
.quiz-header { text-align: center; margin-bottom: 24px; }
.quiz-transition-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 4px;
}
.quiz-q-counter {
  font-size: 0.82rem;
  color: #1d4ed8;
  font-weight: 700;
}
.quiz-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.5;
  margin-bottom: 22px;
  text-align: center;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.88rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.45;
}
.quiz-option:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.quiz-option.correct {
  border-color: #059669;
  background: #f0fdf4;
  color: #065f46;
  font-weight: 600;
}
.quiz-option.wrong {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}
.quiz-letter {
  min-width: 26px;
  height: 26px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.quiz-option.correct .quiz-letter { background: #059669; color: white; }
.quiz-option.wrong   .quiz-letter { background: #dc2626; color: white; }

.quiz-feedback {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  min-height: 1.5rem;
}
.quiz-feedback.correct { color: #059669; background: #f0fdf4; }
.quiz-feedback.wrong   { color: #dc2626; background: #fef2f2; }

/* ── TELA: PLACAR FINAL ──────────────────────────────────── */
.liga-final {
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  text-align: center;
}
.final-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 16px;
}
.final-score-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
}
.final-score-big span:first-child {
  font-size: 2rem;
  font-weight: 900;
  color: #1d4ed8;
}
.final-pct {
  font-size: 1rem;
  color: #64748b;
  font-weight: 600;
}

.final-breakdown {
  background: white;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  margin-bottom: 20px;
  text-align: left;
}
.final-round-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #475569;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}
.final-round-row:last-child { border-bottom: none; }
.final-round-pts { font-weight: 700; color: #1e293b; }

.final-badge-box {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 4px;
}
.final-badge     { font-size: 1.1rem; font-weight: 800; color: #1e40af; margin-bottom: 6px; }
.final-badge-msg { font-size: 0.85rem; color: #1e40af; line-height: 1.55; }

/* ══════════════════════════════════════════════════════════
   EASTER EGG — Modal "O Número da Sorte"
══════════════════════════════════════════════════════════ */

#liga-logo-7 { cursor: pointer; user-select: none; }

.ee-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}
.ee-overlay.open { display: flex; }

.ee-modal {
  background: #fff;
  border-radius: 18px;
  max-width: 680px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
  position: relative;
  overflow: hidden;
  margin: auto;
}

.ee-close {
  position: absolute;
  top: 16px; right: 20px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  font-size: 1.2rem;
  color: #64748b;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  z-index: 1;
}
.ee-close:hover { background: #e2e8f0; color: #1e293b; }

.ee-header {
  background: linear-gradient(160deg, #1e3a8a 0%, #1d4ed8 60%, #3b82f6 100%);
  color: white;
  text-align: center;
  padding: 44px 40px 36px;
}
.ee-logo     { font-size: 3rem; margin-bottom: 12px; }
.ee-title    { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.ee-subtitle { font-size: 0.9rem; opacity: 0.82; line-height: 1.55; }

.ee-body { padding: 32px 40px 8px; }

.ee-section { margin-bottom: 30px; }
.ee-section h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1d4ed8;
  margin-bottom: 10px;
}
.ee-section p {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.78;
  margin-bottom: 10px;
}
.ee-section p:last-child { margin-bottom: 0; }

.ee-math {
  font-family: 'Georgia', serif;
  font-size: 1.05rem;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 18px;
  text-align: center;
  margin: 12px 0;
  letter-spacing: 0.03em;
}

.ee-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 20px 40px 24px;
  font-size: 0.84rem;
  color: #64748b;
  font-style: italic;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 700px) {
  .ee-modal      { border-radius: 14px; }
  .ee-header     { padding: 36px 24px 28px; }
  .ee-body       { padding: 24px 24px 4px; }
  .ee-footer     { padding: 16px 24px 20px; }
  .ee-title      { font-size: 1.25rem; }
}

/* ── Lucky 7 badge na home ───────────────────────────────── */
.lucky7 {
  display: inline-block;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

/* ── Botão Confirmar ajuste (play screen) ────────────────── */
.play-confirm-wrap {
  text-align: center;
  padding: 10px 24px 0;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
}
.btn-confirm-round {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 28px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50px;
  color: white;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}
.btn-confirm-round:hover {
  background: rgba(255,255,255,0.25);
  border-color: white;
  transform: translateY(-1px);
}
.btn-confirm-sub {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 2px;
}

/* ── Quiz — feedback expandido + botão continuar ─────────── */
.quiz-feedback.shown {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 4px;
  text-align: left;
}
.qfb-status {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.qfb-status.correct { color: #059669; }
.qfb-status.wrong   { color: #dc2626; }
.qfb-explain {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.65;
}

.quiz-continue-wrap {
  text-align: center;
  margin-top: 14px;
}
.btn-quiz-continue {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(29,78,216,0.3);
  transition: all 0.18s;
}
.btn-quiz-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(29,78,216,0.38);
}

/* ── Responsive para telas do jogo ──────────────────────── */
@media (max-width: 700px) {
  .play-header         { padding: 8px 12px; gap: 8px; }
  .play-timer-num      { font-size: 2rem; }
  .play-timer-bar-bg   { width: 80px; }
  #play-pct-live       { font-size: 1.2rem; }
  .liga-home-title     { font-size: 1.5rem; }
  .brief-title         { font-size: 1.3rem; }
  .btn-confirm-round   { font-size: 0.82rem; padding: 8px 20px; }
}
