/* =============================================================
   Minhas Figurinhas · Copa 2026 — estilos
   Paleta extraída do logo (Brasil): verde, amarelo, azul.
   Mobile-first, cartões arredondados, energia esportiva.
   ============================================================= */

:root {
  --green: #009C3B;
  --green-d: #007a2e;
  --yellow: #FFCC00;
  --yellow-d: #f0b400;
  --blue: #1E40AF;
  --blue-light: #2563EB;
  --ink: #0f1b2d;
  --muted: #6b7a90;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --line: #e2e9f2;
  --danger: #e23b3b;
  --shadow: 0 6px 20px rgba(16, 38, 73, 0.08);
  --shadow-lg: 0 14px 40px rgba(16, 38, 73, 0.16);
  --radius: 20px;
  --radius-sm: 14px;
  --nav-h: 68px;
  --maxw: 560px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --ink: #eaf1fb;
  --muted: #9fb0c6;
  --bg: #0c1320;
  --surface: #141d2e;
  --surface-2: #1c2740;
  --line: #263247;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: url('../assets/bglight.png');
  background-repeat: repeat;
  background-size: 380px auto;
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
/* o padrão claro não combina com o modo escuro */
[data-theme="dark"] body { background-image: none; }

h1, h2, h3, .stat-value, .hero-pct, .mini-value, .nav-fab {
  font-family: 'Nunito', sans-serif;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }

/* Ícones SVG (estilo linha) */
.ic {
  width: 1.45em; height: 1.45em; flex-shrink: 0; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}

/* ---------------- Cabeçalho ---------------- */
.app-header {
  position: sticky; top: 0; z-index: 40; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 16px 14px; color: #fff;
  background: linear-gradient(115deg, #00A94F 0%, #00A39B 38%, #0090D6 68%, #1E5BD6 100%);
  box-shadow: 0 6px 22px rgba(0, 90, 80, .3);
}
/* brilho decorativo */
.app-header::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 120% at 86% -25%, rgba(255,255,255,.38), transparent 60%),
    radial-gradient(55% 140% at 8% 130%, rgba(255,221,0,.28), transparent 62%);
}
/* faixa de brilho na base */
.app-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--yellow), #fff 50%, var(--yellow)); opacity: .9;
}
.header-brand { position: relative; display: flex; align-items: center; gap: 11px; min-width: 0; }
.header-logo {
  width: 56px; height: 56px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.3));
}
.header-titles { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.header-title { font-size: 1.18rem; font-weight: 900; margin: 0; letter-spacing: -.3px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.18); }
.header-sub { font-size: .68rem; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: #FFE57A; }
.avatar-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.6); color: #fff;
  display: grid; place-items: center; overflow: hidden;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn .ic { width: 22px; height: 22px; }

/* ---------------- Telas ---------------- */
.screen { display: none; padding: 18px 16px 8px; animation: fade .25s ease; }
.screen.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.screen-title { font-size: 1.4rem; font-weight: 900; margin: 4px 0 2px; letter-spacing: -.4px; display: flex; align-items: center; gap: 10px; }
.title-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green), var(--blue)); color: #fff; }
.title-ico .ic { width: 20px; height: 20px; }
.screen-desc { color: var(--muted); font-size: .9rem; margin: 8px 2px 16px; line-height: 1.4; }
.section-heading { font-size: 1.05rem; font-weight: 800; margin: 22px 4px 12px; position: relative; padding-left: 13px; }
.section-heading::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 19px; border-radius: 99px; background: linear-gradient(var(--green), var(--blue)); }

/* ---------------- Dashboard ---------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  text-align: center; padding: 24px 16px 18px; margin-bottom: 14px;
  border-radius: 28px; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 34px rgba(8,18,50,.34);
  background: #15317e; color: #fff;
}
/* capa do álbum por trás (levemente desfocada, bem visível) */
.hero::before {
  content: ''; position: absolute; inset: -16px; z-index: -2;
  background: url('../assets/album.png') center/cover;
  filter: blur(5px) saturate(1.2); transform: scale(1.08);
  opacity: .96;
}
/* véu leve nas cores da capa + escurecimento radial atrás do anel (legibilidade) */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(85% 65% at 50% 44%, rgba(8,16,46,.66), rgba(8,16,46,.22) 68%, transparent 100%),
    linear-gradient(155deg, rgba(20,42,112,.40) 0%, rgba(13,92,120,.30) 50%, rgba(78,40,120,.44) 100%);
}
.hero-ring-wrap { position: relative; width: 184px; height: 184px; margin: 0 auto; }
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring .ring-bg { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 12; }
.progress-ring .ring-fg {
  fill: none; stroke-width: 12; stroke-linecap: round;
  stroke: #2EE06A;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 6px rgba(46,224,106,.55));
  transition: stroke-dashoffset 1s cubic-bezier(.3,1,.4,1);
}
.hero-ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.hero-pct { font-size: 2.8rem; font-weight: 900; line-height: 1; letter-spacing: -1px;
  background: linear-gradient(120deg, #8CF5B6, #9CC7FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-pct-label { font-size: .8rem; color: rgba(255,255,255,.82); font-weight: 700; margin-top: 2px; }
.hero-tagline { font-weight: 800; margin: 12px 0 4px; font-size: 1rem; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.25); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 14px 0; }
.stat-card {
  background: var(--surface); border-radius: var(--radius-sm); padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.stat-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 3px; }
.stat-icon .ic { width: 18px; height: 18px; }
.stat-value { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .66rem; color: var(--muted); font-weight: 600; text-align: center; }
.stat-have .stat-icon { background: rgba(0,156,59,.12); color: var(--green); }
.stat-have .stat-value { color: var(--green); }
.stat-missing .stat-icon { background: rgba(37,99,235,.12); color: var(--blue-light); }
.stat-missing .stat-value { color: var(--blue-light); }
.stat-total .stat-icon { background: rgba(30,64,175,.1); color: var(--blue); }
.stat-dupes .stat-icon { background: rgba(240,180,0,.16); color: var(--yellow-d); }
.stat-dupes .stat-value { color: var(--yellow-d); }

.progress-bar-big { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 4px 0 18px; }
.progress-bar-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width .9s cubic-bezier(.3,1,.4,1);
}

.cta-primary {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--blue), var(--blue-light));
  color: #fff; box-shadow: 0 10px 24px rgba(30,64,175,.32);
  font-size: .98rem; transition: transform .12s;
}
.cta-primary:active { transform: scale(.98); }
.cta-emoji { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex-shrink: 0; }
.cta-emoji .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.cta-primary small { opacity: .85; font-size: .78rem; }

.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.mini-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: var(--shadow);
}
.mini-value { font-size: 1.5rem; font-weight: 800; color: var(--green); display: flex; align-items: center; justify-content: center; }
.mini-value .ic { width: 26px; height: 26px; }
.mini-action .mini-value { color: var(--blue-light); }
.shiny-value { color: #c09010 !important; }
.mini-label { font-size: .74rem; color: var(--muted); font-weight: 600; text-align: center; }

.packet-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); margin-top: 9px;
}
.packet-img { width: 54px; height: 54px; object-fit: contain; flex-shrink: 0; }
.packet-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.packet-label { font-size: .78rem; font-weight: 700; color: var(--ink); }
.packet-formula { font-size: .67rem; color: var(--muted); }
.packet-numbers { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; gap: 1px; }
.packet-value { font-size: 1.9rem; font-weight: 800; color: #1D6FB0; font-family: 'Nunito', sans-serif; line-height: 1; }
.packet-cost { font-size: .8rem; font-weight: 700; color: var(--green); white-space: nowrap; }

.near-complete { display: flex; flex-direction: column; gap: 9px; }

/* ---------------- Cards de seleção ---------------- */
.team-card {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; box-shadow: var(--shadow); transition: transform .12s;
}
.team-card:active { transform: scale(.985); }
.team-card.is-done { border-color: var(--green); background: linear-gradient(120deg, var(--surface), rgba(0,156,59,.06)); }
.flag {
  width: 42px; height: 30px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: var(--surface-2); box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.flag-fallback {
  width: 42px; height: 30px; border-radius: 6px; flex-shrink: 0;
  display: grid; place-items: center; font-size: .62rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green)); letter-spacing: .3px;
}
.team-info { flex: 1; min-width: 0; }
.team-name { font-weight: 700; font-size: .98rem; display: flex; align-items: center; gap: 6px; }
.team-name .done-badge { color: var(--green); }
.team-sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.team-sub b { color: var(--blue-light); font-weight: 700; }
.team-bar { height: 6px; background: var(--surface-2); border-radius: 99px; margin-top: 7px; overflow: hidden; }
.team-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--yellow)); border-radius: 99px; }
.ring-mini { width: 38px; height: 38px; flex-shrink: 0; }
.ring-mini text { font: 800 30px 'Nunito'; fill: var(--ink); }

.group-block { margin-bottom: 22px; }
.group-title {
  display: flex; align-items: center; gap: 8px; margin: 6px 4px 11px; font-size: .95rem; font-weight: 800;
}
.group-badge {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green), var(--blue)); color: #fff; font-size: .85rem; font-weight: 800;
}
.team-list { display: flex; flex-direction: column; gap: 9px; }

/* ---------------- Toolbar / busca ---------------- */
.toolbar { display: flex; flex-direction: column; gap: 11px; margin-bottom: 16px; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 4px; gap: 2px; }
.seg-btn {
  flex: 1; padding: 8px 14px; border-radius: 99px; font-size: .85rem; font-weight: 700; color: var(--muted);
  white-space: nowrap; transition: all .18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg-btn .ic { width: 16px; height: 16px; }
.seg-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.search-box { position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 12px; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.search-ico .ic { width: 18px; height: 18px; }
.search-box input {
  width: 100%; padding: 12px 14px 12px 40px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: .92rem;
  -webkit-appearance: none; appearance: none;
}
.search-box input:focus { outline: 2px solid var(--green); }

.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty-state .big { font-size: 2.4rem; display: block; margin-bottom: 8px; }

/* ---------------- Cadastro Rápido ---------------- */
.field-label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 4px 2px 6px; text-transform: uppercase; letter-spacing: .4px; }
.section-pill {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 14px; margin-bottom: 14px;
  border-radius: 14px; background: var(--surface); border: 2px solid var(--green); box-shadow: var(--shadow);
}
.section-pill .sp-flag { display: inline-flex; }
.section-pill .sp-flag .flag, .section-pill .sp-flag .flag-fallback { width: 34px; height: 24px; }
.section-pill .sp-name { font-weight: 800; font-size: 1rem; }
.section-pill .sp-range { font-size: .78rem; color: var(--muted); font-weight: 600; }
.section-pill .sp-caret { margin-left: auto; color: var(--green); font-weight: 800; font-size: 1.1rem; }

.section-picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; margin-bottom: 6px; }
.sp-group-label { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 12px 4px 4px; }
.sp-row { display: flex; align-items: center; gap: 11px; padding: 10px 10px; border-radius: 12px; width: 100%; text-align: left; }
.sp-row:active { background: var(--surface-2); }
.sp-row.is-current { background: rgba(0,156,59,.1); }
.sp-row .flag, .sp-row .flag-fallback { width: 32px; height: 23px; }
.sp-row .sp-row-name { flex: 1; font-weight: 600; font-size: .95rem; }
.sp-row .sp-row-code { font-size: .72rem; font-weight: 800; color: var(--muted); background: var(--surface-2); padding: 3px 8px; border-radius: 99px; }
.sp-row .sp-row-stat { font-size: .72rem; color: var(--muted); margin-left: 6px; }
.sp-row.is-done .sp-row-code { color: var(--green); }

.mode-toggle { width: 100%; margin-bottom: 6px; }
.mode-hint { font-size: .82rem; color: var(--muted); margin: 2px 4px 14px; }
.cadastro-input {
  width: 100%; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); padding: 16px; font-size: 1.3rem;
  font-weight: 700; letter-spacing: .5px; resize: vertical; line-height: 1.5;
}
.cadastro-input:focus { outline: none; border-color: var(--green); }
.cadastro-preview { margin: 14px 0; display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 11px; border-radius: 99px; font-weight: 700; font-size: .85rem;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip-new { background: rgba(0,156,59,.14); color: var(--green-d); }
.chip-dupe { background: rgba(240,180,0,.18); color: #9a7400; }
.chip-bad { background: rgba(226,59,59,.14); color: var(--danger); text-decoration: line-through; }
.preview-summary { width: 100%; font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

.cadastro-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-primary {
  flex: 1; padding: 15px; border-radius: 14px; font-weight: 800; font-size: 1rem; color: #fff;
  background: linear-gradient(120deg, var(--green), var(--green-d)); box-shadow: 0 8px 20px rgba(0,156,59,.3);
  transition: transform .12s, opacity .2s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-blue {
  flex: 1; padding: 15px; border-radius: 14px; font-weight: 800; font-size: 1rem; color: #fff;
  background: linear-gradient(120deg, #1D6FB0, #0B4A8A); box-shadow: 0 8px 20px rgba(13,74,138,.28);
  transition: transform .12s, opacity .2s;
}
.btn-blue:active { transform: scale(.98); }
.btn-blue:disabled { opacity: .45; box-shadow: none; }
.btn-ghost { padding: 15px 20px; border-radius: 14px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.btn-block { width: 100%; }

.result-card {
  margin-top: 18px; padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-card .r-big { font-size: 2.2rem; font-weight: 900; color: var(--green); }
.result-card .r-line { font-size: .92rem; color: var(--muted); margin-top: 4px; }
.result-card .r-line b { color: var(--ink); }

/* ---------------- Impressão (tela) ---------------- */
.print-options { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.opt-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.opt-label { font-weight: 700; font-size: .9rem; }
.opt-group .segmented { flex: 1; max-width: 260px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-weight: 600; font-size: .92rem; cursor: pointer; }
.switch-row input { display: none; }
.switch { width: 46px; height: 27px; border-radius: 99px; background: var(--surface-2); position: relative; transition: background .2s; flex-shrink: 0; border: 1px solid var(--line); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(19px); }

.preview-heading { font-size: 1rem; font-weight: 800; margin: 22px 4px 10px; }
.print-preview-frame { background: #6b7280; border-radius: var(--radius); padding: 16px; overflow: auto; box-shadow: inset 0 2px 12px rgba(0,0,0,.25); }
.print-sheet { background: #fff; color: #111; margin: 0 auto; box-shadow: 0 6px 24px rgba(0,0,0,.4); border-radius: 4px; }

/* ---------------- Navegação inferior ---------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw); height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-around; z-index: 50;
  box-shadow: 0 -6px 24px rgba(16,38,73,.1);
}
/* faixa tricolor no topo da barra (fica atrás do FAB) */
.bottom-nav::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 0;
  background: linear-gradient(90deg, var(--green) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--blue) 66.6% 100%);
}
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 8px 4px; color: var(--muted); transition: color .15s; flex: 1; }
.nav-ico { display: grid; place-items: center; width: 50px; height: 30px; border-radius: 99px; transition: background .2s, transform .15s; }
.nav-ico .ic { width: 24px; height: 24px; }
.nav-lbl { font-size: .66rem; font-weight: 800; }
.nav-btn.is-active { color: var(--green); }
.nav-btn.is-active .nav-ico { background: rgba(0,156,59,.16); transform: translateY(-1px); }
.nav-fab {
  position: relative; z-index: 2;
  width: 62px; height: 62px; border-radius: 50%; margin-top: -30px; flex-shrink: 0;
  background: linear-gradient(135deg, #00C062 0%, #00A39B 55%, #0090D6 100%); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(0,140,100,.5); border: 4px solid var(--surface);
  transition: transform .15s;
}
.nav-fab .ic { width: 30px; height: 30px; stroke-width: 2.6; }
.nav-fab:active { transform: scale(.92); }

/* ---------------- Sheets / Modais ---------------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(8,16,30,.5);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px); animation: fade .2s;
}
/* hidden tem que vencer o display:flex acima, senão os modais abrem sozinhos */
.sheet-overlay[hidden] { display: none; }
.sheet {
  background: var(--surface); width: 100%; max-width: var(--maxw);
  border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + var(--safe-b));
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp .3s cubic-bezier(.3,1,.4,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 14px; }
.sheet-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 16px; }
.sheet-header { margin-bottom: 14px; }
.sheet-team-top { display: flex; align-items: center; gap: 13px; }
.sheet-team-top .team-name { font-size: 1.15rem; }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip-btn { padding: 8px 14px; border-radius: 99px; background: var(--surface-2); font-weight: 700; font-size: .82rem; }
.chip-btn:active { transform: scale(.96); }
.sheet-hint { font-size: .72rem; color: var(--muted); margin-left: auto; }

.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; padding-bottom: 10px; }
.st-num { line-height: 1; }
/* grade com nomes dos jogadores */
.sticker-grid.with-names { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.with-names .sticker {
  aspect-ratio: auto; min-height: 62px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; padding: 7px 5px;
}
.with-names .st-num { font-size: 1.05rem; font-weight: 800; }
.with-names .st-name {
  font-size: .58rem; font-weight: 700; line-height: 1.08; text-align: center; opacity: .92; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sticker.squad { border-color: var(--blue-light); }
.sticker {
  position: relative; aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface-2); display: grid; place-items: center;
  font-weight: 800; font-size: 1rem; color: var(--muted); transition: all .15s; user-select: none;
}
.sticker.has {
  background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; border-color: var(--green-d);
  box-shadow: 0 3px 8px rgba(0,156,59,.35);
}
.sticker:active { transform: scale(.9); }
/* figurinha brilhosa (nº 1) e do time inteiro (nº 13) */
.sticker.shiny { border-color: var(--yellow-d); background-image: linear-gradient(135deg, #fff7d6, #ffe9a8); color: #8a6d00; }
.sticker.shiny.has { background-image: linear-gradient(135deg, #1ec05a, #00a23e); color: #fff; border-color: var(--yellow-d); box-shadow: 0 0 0 2px var(--yellow), 0 3px 8px rgba(0,156,59,.4); }
.sticker .mark { position: absolute; top: 2px; left: 4px; font-size: .6rem; line-height: 1; opacity: .9; }
.sticker .dupe-tag {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 99px; background: var(--yellow); color: var(--ink); font-size: .72rem;
  display: grid; place-items: center; box-shadow: 0 2px 5px rgba(0,0,0,.25); font-weight: 800;
}
.sticker .dupe-add {
  position: absolute; bottom: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--green); color: var(--green); font-size: .85rem;
  display: grid; place-items: center; font-weight: 800; line-height: 1;
}

.sheet-close { width: 100%; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); font-weight: 700; color: var(--ink); }

/* ---------------- Configurações ---------------- */
.settings-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings-section:last-of-type { border-bottom: none; }
.settings-h { font-size: .98rem; font-weight: 800; margin: 0 0 4px; }
.settings-p { font-size: .82rem; color: var(--muted); margin: 0 0 12px; line-height: 1.4; }
.profile-edit { display: flex; align-items: center; gap: 14px; }
.profile-photo { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 1.8rem; overflow: hidden; border: 2px dashed var(--line); flex-shrink: 0; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.text-input { flex: 1; padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .95rem; }
.text-input:focus { outline: 2px solid var(--green); }
.btn-pair { display: flex; gap: 10px; }
.btn-secondary { flex: 1; padding: 13px; border-radius: 12px; background: var(--surface-2); font-weight: 700; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:active { transform: scale(.98); }
.btn-danger { padding: 14px; border-radius: 12px; background: rgba(226,59,59,.1); color: var(--danger); font-weight: 800; border: 1px solid rgba(226,59,59,.3); }
.btn-whatsapp { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; padding: 13px 16px; border-radius: 12px; background: #25D366; color: #fff; font-weight: 800; font-size: .95rem; border: none; cursor: pointer; }
.btn-whatsapp:active { transform: scale(.97); }
.btn-whatsapp .ic { width: 18px; height: 18px; stroke: #fff; }
.btn-whatsapp.btn-block { width: 100%; margin-top: 8px; }
.share-textarea { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: .82rem; font-family: monospace; resize: none; line-height: 1.5; }

/* ---------------- Aba Trocas ---------------- */
.trade-block { background: var(--surface); border-radius: 18px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.trade-block-title { font-weight: 800; font-size: .95rem; margin: 0 0 2px; display: flex; align-items: center; gap: 6px; color: var(--ink); }
.trade-block-title .ic-sm { width: 15px; height: 15px; color: var(--green); }

.trade-code-block { margin-top: 14px; text-align: center; }
.trade-code-display {
  font-size: 2.6rem; font-weight: 900; letter-spacing: .22em; color: var(--green);
  background: var(--surface-2); border-radius: 16px; padding: 14px 20px;
  font-family: 'Courier New', monospace; border: 2px solid var(--green);
  margin-bottom: 8px; text-shadow: 0 0 18px rgba(0,156,59,.35);
}
.trade-code-hint { font-size: .73rem; color: var(--muted); margin: 0 0 12px; }

.trade-compare-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.trade-code-input {
  flex: 1; min-width: 140px; padding: 14px 10px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 1.3rem; font-weight: 900;
  letter-spacing: .22em; text-transform: uppercase; font-family: 'Courier New', monospace;
  text-align: center;
}
.trade-code-input:focus { outline: 2px solid var(--green); border-color: var(--green); }
.trade-compare-row .btn-blue { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 380px) {
  .trade-compare-row { flex-direction: column; }
  .trade-compare-row .btn-blue { width: 100%; }
}

.trade-result { margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.trade-result-header { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.trade-friend-name { font-weight: 800; font-size: .92rem; display: flex; align-items: center; gap: 6px; }
.trade-balance { font-weight: 800; color: var(--green); font-size: .95rem; background: rgba(0,156,59,.1); padding: 3px 10px; border-radius: 99px; }
.trade-section { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.trade-section:last-of-type { border-bottom: none; }
.trade-section-title { font-weight: 800; font-size: .85rem; padding: 5px 10px; border-radius: 8px; margin-bottom: 8px; display: inline-block; }
.trade-section-title.give { background: rgba(0,156,59,.12); color: #009C3B; }
.trade-section-title.want { background: rgba(30,64,175,.1); color: #1E5BD6; }
.trade-chips { display: flex; flex-direction: column; gap: 4px; }
.trade-group { display: flex; align-items: baseline; gap: 7px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: .83rem; }
.trade-group:last-child { border-bottom: none; }
.trade-group-em { font-size: 1rem; flex-shrink: 0; }
.trade-group-name { font-weight: 700; color: var(--ink); flex-shrink: 0; min-width: 90px; }
.trade-group-nums { color: var(--muted); font-size: .78rem; }
.trade-empty { text-align: center; color: var(--muted); padding: 18px 14px; font-size: .88rem; line-height: 1.5; }
.trade-shiny-note { font-size: .74rem; color: #7a5700; background: #fff8e6; border: 1px solid #f0d060; border-radius: 7px; padding: 5px 9px; margin-top: 7px; line-height: 1.4; }

.counts-list { display: flex; flex-direction: column; gap: 8px; }
.count-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.count-row .cr-name { flex: 1; font-weight: 600; font-size: .9rem; }
.count-row .cr-range { font-size: .72rem; color: var(--muted); }
.count-stepper { display: flex; align-items: center; gap: 6px; }
.count-stepper button { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); font-weight: 800; font-size: 1.1rem; }
.count-stepper input { width: 46px; text-align: center; padding: 7px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; }

/* ---------------- Sync badge no avatar ---------------- */
#avatarBtn { position: relative; }
#avatarBtn[data-sync="pending"]::after,
#avatarBtn[data-sync="ok"]::after,
#avatarBtn[data-sync="error"]::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg);
}
#avatarBtn[data-sync="pending"]::after { background: #f59e0b; animation: pulse 1.4s infinite; }
#avatarBtn[data-sync="ok"]::after      { background: #22c55e; }
#avatarBtn[data-sync="error"]::after   { background: #ef4444; }

/* ---------------- Modal de sync (primeiro acesso) ---------------- */
.sync-id-display {
  font-size: 1.9rem; font-weight: 900; letter-spacing: .18em; color: var(--green);
  background: #f0faf4; border: 2px solid var(--green); border-radius: 14px;
  padding: 14px; text-align: center; font-family: 'Courier New', monospace;
  margin: 14px 0 10px; word-break: break-all;
}
.sync-warning {
  background: #fff8e6; border: 1px solid #f0b400; border-radius: 10px;
  padding: 10px 14px; font-size: .82rem; line-height: 1.5; color: #7a5700;
}

/* ---------------- Seção sync nas configurações ---------------- */
.sync-id-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.sync-id-label { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.sync-id-value { font-family: 'Courier New', monospace; font-weight: 700; font-size: .88rem; color: var(--ink); flex: 1; letter-spacing: .05em; }
.btn-icon-sm { padding: 5px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }

/* ---------------- Rodapé de autoria ---------------- */
.app-footer {
  text-align: center; font-size: .68rem; color: var(--muted); line-height: 1.5;
  padding: 14px 20px calc(var(--nav-h) + var(--safe-b) + 20px);
  border-top: 1px solid var(--line); margin-top: 8px;
}
.app-footer strong { color: var(--ink); font-weight: 700; }
.app-version { display: block; margin-top: 6px; font-size: .62rem; opacity: .6; letter-spacing: .03em; }
@media print { .app-footer { display: none; } }

/* ---------------- Toast + confete ---------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + var(--safe-b)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 99px; font-weight: 700; font-size: .9rem;
  z-index: 200; box-shadow: var(--shadow-lg); animation: toastIn .3s; max-width: 90%; text-align: center;
}
[data-theme="dark"] .toast { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
@keyframes toastIn { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.confetti { position: fixed; inset: 0; z-index: 150; pointer-events: none; }

/* ---------------- Banner de aba (mascote + descrição) ---------------- */
.tab-banner {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--surface);
}
/* variantes de cor — gradiente suave da camisa de cada mascote */
.tb-red  { background: linear-gradient(120deg, rgba(210,35,35,.11) 0%, var(--surface) 65%); border-color: rgba(210,35,35,.22); }
.tb-green{ background: linear-gradient(120deg, rgba(0,156,59,.11) 0%, var(--surface) 65%); border-color: rgba(0,156,59,.22); }
.tb-blue { background: linear-gradient(120deg, rgba(30,91,214,.11) 0%, var(--surface) 65%); border-color: rgba(30,91,214,.22); }
.tb-mascot {
  width: 46px; height: auto; flex-shrink: 0;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.18));
}
.tb-text { display: flex; flex-direction: column; gap: 2px; }
.tb-text strong { font-size: .9rem; font-weight: 800; color: var(--ink); }
.tb-text span { font-size: .74rem; color: var(--muted); line-height: 1.4; }

/* ---------------- Mascotes ---------------- */
.mascot-img { display: block; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }

/* Torcida no rodapé do dashboard */
.cheer-squad {
  display: flex; align-items: flex-end; justify-content: center; gap: 4px;
  margin: 26px 0 6px; padding-top: 8px;
}
/* mascotes no topo da tela inicial */
.cheer-squad.cheer-top { margin: 0 0 6px; padding-top: 0; }
.cheer-squad .cheer { width: 86px; height: auto; }
.cheer-squad .cheer.mid { width: 104px; margin: 0 -6px; z-index: 1; }
/* imagem unificada dos três mascotes com o álbum */
.cheer-top { text-align: center; margin: 0 0 6px; }
.mascotes-album-img { width: 220px; height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.18)); }
.cheer-bubble {
  text-align: center; font-weight: 800; font-size: .92rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 16px; padding: 9px 16px; margin: 0 auto 2px; max-width: 280px; position: relative;
}
.cheer-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: var(--surface); filter: drop-shadow(0 2px 1px rgba(0,0,0,.04));
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.cheer-squad .cheer { animation: bob 2.8s ease-in-out infinite; }
.cheer-squad .cheer.mid { animation-delay: .4s; }
.cheer-squad .cheer:last-child { animation-delay: .8s; }

/* Mascote decorativo no canto de telas */
.screen-mascot {
  position: absolute; top: 4px; right: 8px; width: 66px; height: auto;
  pointer-events: none; opacity: .96; animation: bob 3.2s ease-in-out infinite;
}
.screen { position: relative; }
/* impede o texto de passar por baixo do mascote no canto */
#screen-cadastro .screen-title, #screen-cadastro .screen-desc { padding-right: 78px; }

/* Mascote em empty states */
.empty-state .mascot { width: 116px; height: auto; margin: 0 auto 10px; display: block; }

/* Mascote no card de resultado do cadastro */
.result-card { position: relative; padding-top: 56px; }
.result-mascot {
  position: absolute; top: -46px; left: 50%; transform: translateX(-50%);
  width: 92px; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2));
}

/* ---------------- Ajustes finos dos ícones SVG ---------------- */
.flag-icon { background: linear-gradient(135deg, var(--blue), var(--green)); }
.flag-icon .ic { width: 62%; height: 62%; }
.section-pill .sp-caret { margin-left: auto; color: var(--green); display: grid; place-items: center; }
.section-pill .sp-caret .ic { width: 20px; height: 20px; }
.sticker .mark .ic { width: 12px; height: 12px; }
.lbl-ico { display: inline-flex; align-items: center; gap: 7px; }
.lbl-ico .ic { width: 18px; height: 18px; }
.settings-h { display: flex; align-items: center; gap: 7px; }
.settings-h .lbl-ico .ic, .switch-row .lbl-ico .ic { color: var(--green); }
.btn-primary, .btn-blue, .btn-secondary, .btn-danger, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary .ic, .btn-blue .ic, .btn-danger .ic, .btn-secondary .ic { width: 18px; height: 18px; stroke: currentColor; }
.group-badge .ic { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media (min-width: 480px) {
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
}
