/* Ídolos 26/27 · visual inspirado na capa, saqueta e booklet da coleção:
   azul-ardósia escuro, dourado champanhe, creme, riscas em leque e pontilhado. */
:root {
  --bg: #16152b;
  --bg-2: #1e1d3a;
  --surf: #26244a;
  --surf-2: #302e58;
  --linha: #403e72;
  --ouro: #d9b56b;
  --ouro-claro: #f1dca0;
  --ouro-esc: #9c7a33;
  --creme: #f5ecd7;
  --texto-2: #a8a5cb;
  --verde: #7fd1a3;
  --perigo: #ff8a7a;
  --raio: 14px;
  --topo-h: 54px;
  --barra-h: 64px;
  --raios: repeating-conic-gradient(from 0deg at 50% 125%, rgba(217,181,107,.11) 0 1.6deg, transparent 1.6deg 5deg);
  --pontos: radial-gradient(rgba(217,181,107,.22) 1px, transparent 1.6px) 0 0 / 13px 13px;
  font-family: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--creme); }
body { min-height: 100vh; padding-bottom: calc(var(--barra-h) + env(safe-area-inset-bottom) + 16px); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
.display { font-family: "Abril Fatface", "Playfair Display", serif; font-weight: 400; }

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(env(safe-area-inset-top) + var(--topo-h)); padding: env(safe-area-inset-top) 16px 0;
  background: var(--bg-2); border-bottom: 1px solid var(--linha);
  background-image: var(--raios);
}
.marca { display: flex; align-items: baseline; gap: 10px; line-height: 1; }
.marca-t { font-family: "Abril Fatface", serif; font-size: 30px; color: var(--creme); letter-spacing: .5px; text-shadow: 0 1px 0 var(--ouro-esc), 0 0 14px rgba(217,181,107,.25); }
.marca-s { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 17px; color: var(--ouro); letter-spacing: 2px; }
.entrar, .perfil {
  border: 1px solid var(--ouro); background: transparent; color: var(--ouro-claro);
  border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.perfil img { width: 24px; height: 24px; border-radius: 50%; }

/* ---------- layout ---------- */
#vista { max-width: 760px; margin: 0 auto; padding: 16px; }
.cartao {
  background: var(--surf); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin-bottom: 14px;
  box-shadow: 0 10px 24px -16px rgba(0,0,0,.7);
}
.titulo { font-family: "Abril Fatface", serif; font-size: 28px; margin: 4px 0 12px; color: var(--creme); letter-spacing: .3px; }
.cartao .titulo { font-size: 22px; color: var(--ouro-claro); }
.sub { color: var(--texto-2); font-size: 14px; margin: 0 0 12px; line-height: 1.45; }
.sub b { color: var(--creme); }
.mini { color: var(--texto-2); font-size: 12px; }

/* ---------- barra inferior ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--barra-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #100f22; border-top: 1px solid var(--linha);
}
.barra button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--texto-2); font-size: 12px; font-weight: 600; letter-spacing: .3px; }
.barra svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.barra button.on { color: var(--ouro); }
.barra button.on svg { stroke-width: 2.6; filter: drop-shadow(0 0 6px rgba(217,181,107,.45)); }

/* ---------- início ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--raio); padding: 22px 18px 18px;
  background: var(--raios), var(--pontos), linear-gradient(160deg, #2d2b55 0%, #1d1c3b 70%);
  border: 1px solid var(--ouro-esc);
  box-shadow: inset 0 0 0 1px rgba(241,220,160,.12), 0 16px 30px -18px rgba(0,0,0,.8);
}
.hero .pct { font-family: "Abril Fatface", serif; font-size: 84px; line-height: .95; color: var(--creme); text-shadow: 0 2px 0 var(--ouro-esc), 0 0 24px rgba(217,181,107,.3); }
.hero .pct small { font-size: 36px; color: var(--ouro); margin-left: 2px; text-shadow: none; }
.hero .de { color: var(--texto-2); font-size: 15px; margin: 4px 0 12px; }
.barra-prog { height: 10px; background: rgba(0,0,0,.35); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--linha); }
.barra-prog > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ouro-esc), var(--ouro-claro), var(--ouro)); border-radius: 99px; transition: width .35s; }
.contadores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.contadores div { background: rgba(10,9,28,.45); border: 1px solid var(--linha); border-radius: 10px; padding: 10px 6px; text-align: center; }
.contadores b { display: block; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 32px; line-height: 1; color: var(--ouro-claro); }
.contadores span { font-size: 11.5px; color: var(--texto-2); text-transform: uppercase; letter-spacing: 1px; }

.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; font-size: 14px; }
.sw { position: relative; width: 46px; height: 26px; flex: none; }
.sw input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.sw i { position: absolute; inset: 0; background: var(--linha); border-radius: 99px; transition: .2s; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--creme); border-radius: 50%; transition: .2s; }
.sw input:checked + i { background: var(--ouro-esc); }
.sw input:checked + i::after { transform: translateX(20px); background: var(--ouro-claro); }

.extra-lin { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linha); }
.extra-lin:first-of-type { border-top: 0; }
.extra-lin .n { flex: 1; font-weight: 600; }
.extra-lin .v { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 20px; color: var(--ouro-claro); }
.mini-barra { width: 70px; height: 6px; background: rgba(0,0,0,.35); border-radius: 9px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--linha); }
.mini-barra > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ouro-esc), var(--ouro)); }
.extra-lin.ouro .n { color: var(--ouro-claro); }

.grelha-clubes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.clube-lin { font-size: 13px; }
.clube-lin .l { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--creme); }
.clube-lin .l b { font-family: "Barlow Condensed", sans-serif; font-size: 15px; color: var(--ouro-claro); }
.clube-lin .completo b { color: var(--verde); }

/* ---------- inserir ---------- */
.ferr { position: sticky; top: calc(env(safe-area-inset-top) + var(--topo-h)); z-index: 10; background: var(--bg); padding: 10px 0 8px; }
.pesq { width: 100%; padding: 11px 14px; border: 1px solid var(--linha); border-radius: 10px; font: inherit; font-size: 16px; background: var(--surf); color: var(--creme); }
.pesq::placeholder { color: var(--texto-2); }
.pesq:focus { outline: 0; border-color: var(--ouro); box-shadow: 0 0 0 3px rgba(217,181,107,.2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--linha); background: var(--surf); border-radius: 99px; padding: 6px 13px; font-size: 14px; font-weight: 600; color: var(--texto-2); }
.chip.on { background: linear-gradient(135deg, var(--ouro-esc), var(--ouro) 60%, var(--ouro-claro)); border-color: var(--ouro-claro); color: #1b1a33; }
.chips.sec .chip { font-size: 13px; padding: 4px 11px; background: transparent; }

.seccao { margin: 6px 0 20px; scroll-margin-top: 160px; }
.seccao-cab { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 2px 10px; border-bottom: 1px solid var(--linha); margin-bottom: 10px; }
.seccao-cab h3 { font-family: "Abril Fatface", serif; font-size: 21px; text-transform: uppercase; letter-spacing: .8px; color: var(--creme); }
.seccao-cab span { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 17px; color: var(--ouro); }
.seccao-cab.completa span { color: var(--verde); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(5, 1fr); } }
.tile {
  position: relative; text-align: left; border: 1px solid var(--linha); background: var(--surf); border-radius: 10px;
  padding: 7px 8px 8px; min-height: 64px; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: transform .08s, background .15s; overflow: hidden;
}
.tile::before { content: ""; position: absolute; inset: 0; background: var(--raios); opacity: .7; pointer-events: none; }
.tile:active { transform: scale(.97); }
.tile > * { position: relative; }
.tile .num { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 23px; line-height: 1; color: var(--ouro); }
.tile .nome { font-size: 12px; line-height: 1.15; margin-top: 3px; color: var(--creme); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .eq { display: block; font-size: 10.5px; color: var(--texto-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.tenho { background: linear-gradient(135deg, #b78d3f 0%, #f1dca0 48%, #c79d4b 100%); border-color: var(--ouro-claro); box-shadow: 0 0 0 1px rgba(241,220,160,.25), 0 6px 14px -8px rgba(217,181,107,.6); }
.tile.tenho::before { opacity: .25; }
.tile.tenho .num, .tile.tenho .nome { color: #1b1a33; }
.tile.tenho .eq { color: #4a3a12; }
.tile .qt { position: absolute; top: 6px; right: 6px; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 99px; background: #1b1a33; color: var(--ouro-claro); border: 1px solid var(--ouro-esc); font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.tile:not(.tenho) .qt { background: var(--ouro); color: #1b1a33; }
.tile.emblema .nome { font-style: italic; }
.tile.aut { border-color: var(--ouro-esc); background: #2a2650; }
.tile.aut .num { color: var(--ouro-claro); }
.tile .tir { display: block; font-size: 10.5px; font-weight: 700; color: var(--ouro); margin-top: 1px; letter-spacing: .2px; }
.tile.aut.tenho { background: linear-gradient(135deg, #a9822f, #fff0b8 45%, #d4a84a 70%, #f1dca0); box-shadow: 0 0 0 1px #fff0b8, 0 0 18px rgba(241,220,160,.45); }
.tile.aut.tenho .num, .tile.aut.tenho .nome { color: #1b1a33; }
.tile.aut.tenho .eq, .tile.aut.tenho .tir { color: #3a2a00; }
.dica { font-size: 13px; color: var(--texto-2); margin: 2px 0 10px; }
.vazio { text-align: center; color: var(--texto-2); padding: 30px 10px; }

/* ---------- listas (faltas, repetidos, trocas) ---------- */
.lista-sec { margin-bottom: 16px; }
.lista-sec h4 { font-family: "Abril Fatface", serif; font-size: 17px; text-transform: uppercase; letter-spacing: .8px; color: var(--creme); margin: 0 0 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: var(--surf); border: 1px solid var(--linha); border-radius: 8px; padding: 4px 8px; font-size: 13px; line-height: 1.2; color: var(--creme); }
.pill b { font-family: "Barlow Condensed", sans-serif; font-size: 16px; color: var(--ouro); margin-right: 4px; }
.pill i { font-style: normal; color: var(--ouro-claro); font-weight: 700; margin-left: 4px; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; align-items: center; }
.btn { border: 0; background: linear-gradient(135deg, var(--ouro-esc), var(--ouro) 55%, var(--ouro-claro)); color: #1b1a33; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 15px; }
.btn.sec { background: transparent; color: var(--ouro-claro); border: 1.5px solid var(--ouro); }
.btn.peq { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.perigo { background: transparent; color: var(--perigo); border: 1.5px solid var(--perigo); }
.btn[disabled] { opacity: .5; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--texto-2); }
.chk input { accent-color: var(--ouro); width: 18px; height: 18px; }

.codigo { font-family: "Abril Fatface", serif; font-size: 44px; letter-spacing: 8px; color: var(--ouro-claro); text-shadow: 0 0 20px rgba(217,181,107,.3); }
.linha-input { display: flex; gap: 8px; }
.linha-input input { flex: 1; text-transform: uppercase; letter-spacing: 3px; }
.amigo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--linha); }
.amigo:first-child { border-top: 0; }
.amigo .nm { font-weight: 600; }
.troca-res { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.troca-res div { background: var(--surf); border: 1px solid var(--linha); border-radius: 10px; padding: 12px; text-align: center; }
.troca-res b { display: block; font-family: "Abril Fatface", serif; font-size: 36px; line-height: 1; color: var(--ouro-claro); }
.troca-res span { font-size: 12px; color: var(--texto-2); text-transform: uppercase; letter-spacing: 1px; }
.aviso { background: rgba(217,181,107,.12); border: 1px solid var(--ouro-esc); color: var(--ouro-claro); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.4; margin-bottom: 14px; }
.rodape { text-align: center; color: var(--texto-2); font-size: 12px; margin: 24px 0 0; line-height: 1.5; }

/* ---------- modal e toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(8,7,22,.7); display: grid; place-items: center; padding: 20px; }
.modal[hidden], .toast[hidden] { display: none; }
.modal .caixa { background: var(--surf); border: 1px solid var(--ouro-esc); border-radius: 16px; padding: 20px; max-width: 380px; width: 100%; }
.modal h3 { font-family: "Abril Fatface", serif; font-size: 24px; margin-bottom: 8px; color: var(--ouro-claro); }
.modal p { color: var(--texto-2); line-height: 1.45; margin: 0 0 14px; }
.modal .bt { display: flex; flex-direction: column; gap: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--barra-h) + env(safe-area-inset-bottom) + 16px); z-index: 70; background: var(--ouro-claro); color: #1b1a33; font-weight: 600; padding: 10px 16px; border-radius: 99px; font-size: 14px; box-shadow: 0 8px 20px -8px rgba(0,0,0,.7); max-width: 90vw; text-align: center; }
