:root {
  --pitch: #009C3B;
  --yellow: #FFDF00;
  --blue: #002776;
  --caramel: #C68642;
  --dusk: #7EA8C0;
  --stucco: #D6886A;
  --teal: #039CB4;
  --wood: #6B3E1F;
  --wood2: #A56E34;
  --sand: #F6E3B0;
  --ink: #1A1208;
  --action: var(--pitch);
  --action-ink: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-weight: 700;
  color: var(--blue);
  background: #16324a url("favela.webp") center / cover no-repeat fixed;
}
body[data-ficha="amarela"] { --action: var(--yellow); --action-ink: var(--blue); }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

#splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(22, 50, 80, .2), rgba(0, 39, 118, .5)),
    url("favela.webp") center / cover no-repeat;
  transition: opacity .2s linear;
}
#splash.gone { opacity: 0; pointer-events: none; }
.mark {
  width: 148px;
  height: 148px;
  border-radius: 36px;
  background: var(--caramel);
  border: 6px solid var(--yellow);
  box-shadow: 0 10px 0 var(--wood);
  position: relative;
}
.mark img:first-child { position: absolute; width: 78px; left: 12px; bottom: 14px; }
.mark img:last-child { position: absolute; width: 68px; right: 10px; top: 12px; }
.splash-title {
  margin: 8px 0 0;
  font-family: "Lilita One", "Trebuchet MS", sans-serif;
  font-size: 52px;
  line-height: .95;
  text-align: center;
  color: var(--yellow);
  text-shadow: 0 4px 0 var(--blue);
}
.splash-sub {
  margin: 0;
  color: #fff;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 13px;
}

#onboard.off, #frame.off, #sheet.off { display: none; }
#onboard {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 22px 16px 28px;
  background:
    linear-gradient(180deg, rgba(0, 39, 118, .28), rgba(26, 18, 8, .42)),
    url("favela.webp") center / cover no-repeat;
}
.on-card {
  width: min(440px, 100%);
  margin: auto;
  background: linear-gradient(#fff8df, var(--sand));
  border: 4px solid var(--wood);
  border-radius: 26px;
  box-shadow: 0 12px 0 var(--caramel);
  padding: 18px 16px 20px;
}
.dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dusk);
  display: block;
}
.dots i.on { background: var(--pitch); }
.dots i.now { background: var(--yellow); box-shadow: 0 0 0 3px var(--blue); }
.on-card h2, .block h2, .hero h2, .gol h2 {
  font-family: "Lilita One", "Trebuchet MS", sans-serif;
  font-weight: 400;
  letter-spacing: .02em;
  margin: 0 0 8px;
}
.on-card h2 { text-align: center; font-size: 32px; }
.lead-copy { text-align: center; margin: 0 0 14px; }
.fichas { display: flex; gap: 14px; justify-content: center; }
.ficha {
  flex: 0 0 auto;
  width: min(136px, calc(50% - 8px));
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  border: 8px dashed rgba(255, 255, 255, .75);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .18), 0 8px 0 rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;
  font-family: "Lilita One", sans-serif;
  font-size: 18px;
}
.ficha img { width: 46px; height: 46px; object-fit: contain; }
.ficha.verde { background: radial-gradient(circle at 35% 30%, #5ad87a, var(--pitch) 58%, #046628); }
.ficha.amarela {
  background: radial-gradient(circle at 35% 30%, #fff6b0, var(--yellow) 55%, #d7a400);
  color: var(--blue);
}
.ficha.on { transform: translateY(2px); box-shadow: inset 0 0 0 6px #fff, 0 4px 0 var(--blue); }
.carta {
  width: 100%;
  min-height: 180px;
  border: 0;
  border-radius: 18px;
  background:
    repeating-linear-gradient(90deg, #8a5a32 0 10px, #c68642 10px 12px, #6b3e1f 12px 22px);
  color: var(--yellow);
  font-family: "Lilita One", sans-serif;
  font-size: 26px;
  box-shadow: inset 0 0 0 4px #3a2412;
}
.carta.open {
  background: linear-gradient(#fff6d2, #f3d48a);
  color: var(--blue);
  text-align: left;
  padding: 12px;
  font-family: "Nunito", sans-serif;
  font-size: 15px;
}
.carta.open strong {
  display: block;
  font-family: "Lilita One", sans-serif;
  font-size: 22px;
  margin: 6px 0;
}
.go, .ghost, .spin, .later, .pinbtn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: "Lilita One", sans-serif;
  letter-spacing: .03em;
}
.go, .spin, .pinbtn, .later {
  background: var(--action);
  color: var(--action-ink);
  box-shadow: 0 5px 0 var(--wood);
}
.go { display: block; width: 100%; margin-top: 14px; font-size: 22px; }
.go:disabled, .spin:disabled { opacity: .45; box-shadow: none; }
.ghost {
  background: transparent;
  color: var(--blue);
  box-shadow: inset 0 0 0 3px var(--blue);
}
.ask { display: flex; gap: 10px; }
.ask button { flex: 1; font-size: 22px; }
.ask .nao { background: var(--stucco); color: var(--ink); }

#frame { min-height: 100dvh; }
#ticker {
  position: sticky;
  top: 0;
  z-index: 9;
  width: min(480px, 100%);
  margin: 0 auto;
  display: block;
  height: 44px;
  overflow: hidden;
  border: 0;
  border-bottom: 4px solid var(--caramel);
  background: var(--yellow);
  color: var(--blue);
  padding: 0;
}
.track {
  display: flex;
  width: max-content;
  animation: run 14s linear infinite;
}
.track span {
  font-family: "Lilita One", sans-serif;
  font-size: 22px;
  line-height: 44px;
  white-space: nowrap;
  padding-right: 8px;
}
#ticker.pause .track { animation-play-state: paused; }
#ticker.pause { box-shadow: inset 0 -4px 0 var(--blue); }
@keyframes run { to { transform: translateX(-50%); } }

.bar {
  position: fixed;
  z-index: 8;
  left: max(0px, calc(50vw - 240px));
  width: min(480px, 100vw);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.bar.top { top: 44px; }
.bar.bot { bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
.corner {
  pointer-events: auto;
  width: 118px;
  height: 82px;
  border: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--yellow);
  background-color: var(--blue);
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 8px 8px;
  font-family: "Lilita One", sans-serif;
  font-size: 22px;
  box-shadow: 0 0 0 3px var(--wood);
}
.corner img { width: 28px; height: 28px; object-fit: contain; }
.corner.rua { border-radius: 0 0 28px 0; }
.corner.tape { border-radius: 0 0 0 28px; }
.corner.quiz { border-radius: 0 28px 0 0; }
.corner.day { border-radius: 28px 0 0 0; }
.corner.on {
  color: var(--blue);
  background-color: var(--yellow);
  background-image: radial-gradient(rgba(0, 39, 118, .16) 1px, transparent 1px);
}
.curb {
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  opacity: 0;
}
.bar.top .curb { bottom: 0; }
.bar.bot .curb { top: 0; }
.corner.on .curb {
  opacity: 1;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 12px, #141414 12px 17px);
  box-shadow: 0 0 0 2px #141414;
}
.reel {
  width: 34px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 5px;
  position: relative;
}
.reel::before, .reel::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.reel::before { left: 4px; }
.reel::after { right: 4px; }
.badge {
  display: none;
  position: absolute;
  top: 8px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pitch);
  box-shadow: 0 0 0 2px var(--yellow);
}
.corner.day .badge.on { display: block; }

main {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 136px 14px 128px;
}
.chip, .later, .go, .spin, .ghost, .pinbtn { scroll-margin: 140px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hero, .block, .card, .tape, .gol, .quiz-box {
  border: 3px solid var(--wood);
  border-radius: 20px;
  box-shadow: 0 8px 0 var(--caramel);
}
.hero {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(0, 39, 118, .78), rgba(0, 100, 40, .62)),
    url("pitch.webp") center / cover no-repeat;
}
.hero img { width: 86px; height: 86px; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.hero h2 { color: var(--yellow); font-size: 34px; margin: 0; }
.hero p { margin: 2px 0; }
.hero .go { width: auto; margin: 8px 0 0; padding: 8px 16px; font-size: 18px; }
.kicker, .tag {
  display: inline-block;
  background: var(--blue);
  color: var(--yellow);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.card, .tape, .block, .gol, .quiz-box {
  background: linear-gradient(#fff8df, var(--sand));
  padding: 12px;
  color: var(--ink);
}
button.card { width: 100%; text-align: left; color: inherit; }
.card .line { margin: 3px 0; line-height: 1.35; }
.card .line.lead {
  font-family: "Lilita One", sans-serif;
  font-size: 22px;
  color: var(--blue);
  margin: 6px 0;
}
.pinflag {
  float: right;
  background: var(--yellow);
  color: var(--blue);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 12px;
}
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slotpin {
  min-height: 64px;
  border-radius: 12px;
  border: 2px dashed var(--wood2);
  background: rgba(255, 255, 255, .35);
  color: var(--blue);
  text-align: left;
  padding: 6px;
  font-size: 13px;
}
button.slotpin { border-style: solid; background: #fff; }
.tape head, .tape .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tape h3 { margin: 6px 0; font-family: "Lilita One", sans-serif; font-size: 22px; color: var(--blue); }
.tape p { margin: 0 0 10px; line-height: 1.4; }
.tape.on { box-shadow: 0 8px 0 var(--yellow); }
.later { font-size: 16px; }

.boards { display: flex; gap: 6px; flex-wrap: wrap; }
.boards button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--wood);
  background: #fff;
  color: var(--blue);
  font-family: "Lilita One", sans-serif;
}
.boards button.on { background: var(--yellow); box-shadow: inset 0 -6px 0 #141414; }
.boards button.done { background: var(--pitch); color: #fff; }
.boards button.fail { background: var(--stucco); }
.quiz-top {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
}
.quiz-top img { width: 72px; height: 88px; object-fit: cover; border-radius: 8px; }
.quiz-top h2 { font-size: 34px; margin: 0; }
.quiz-top p { margin: 0; }
.quiz-box h3 {
  font-family: "Lilita One", "Trebuchet MS", sans-serif;
  font-weight: 400;
  font-size: 24px;
  margin: 12px 0 0;
  color: var(--blue);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.shake { animation: shake .35s linear; }
.slots-q { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.slot {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f0cb6e;
  border: 2px solid var(--wood);
}
.slot b { font-family: "Lilita One", sans-serif; }
.slot.shut em, .slot.shut strong { visibility: hidden; }
.slot.miss { opacity: .7; }
.errs { display: flex; gap: 6px; align-items: center; }
.errs span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--dusk);
  color: transparent;
  font-family: "Lilita One", sans-serif;
}
.errs span.on { background: var(--blue); color: var(--yellow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 2px solid var(--blue);
  background: #fff;
  color: var(--blue);
  border-radius: 999px;
  padding: 8px 12px;
}
.row-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; }
.warn {
  margin: 8px 0 0;
  color: var(--wood);
  font-size: 14px;
}

.gol h2 { font-size: 32px; color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.stats div {
  background: var(--blue);
  color: var(--yellow);
  border-radius: 12px;
  text-align: center;
  padding: 6px 2px;
}
.stats b { display: block; font-family: "Lilita One", sans-serif; font-size: 22px; }
.stats span { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: url("pitch.webp") center / cover no-repeat;
  border: 4px solid var(--wood);
}
.cell {
  aspect-ratio: 1;
  border-radius: 14px;
  background: rgba(0, 90, 36, .55);
  border: 2px solid rgba(255, 223, 0, .85);
  display: grid;
  place-items: center;
  animation: pop .28s ease;
}
.cell img { width: 72%; height: 72%; object-fit: contain; }
.cell span {
  font-family: "Lilita One", sans-serif;
  font-size: 28px;
  color: var(--yellow);
  background: var(--blue);
  border-radius: 10px;
  min-width: 42px;
  text-align: center;
  padding: 2px 6px;
}
.cell.mid { box-shadow: inset 0 0 0 3px var(--yellow); }
.cell.hot { background: rgba(255, 223, 0, .72); }
@keyframes pop { from { transform: scale(.84); } to { transform: none; } }
.note {
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  margin: 8px 0;
  line-height: 1.35;
}
.rules { margin: 0 0 8px; padding-left: 18px; }
.rules li { margin: 2px 0; }
.spin {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: block;
  margin: 8px auto 0;
  font-size: 22px;
  border: 6px solid var(--yellow);
}
.spin.wide { width: auto; height: auto; border-radius: 999px; padding: 14px 22px; }
.back {
  background: transparent;
  border: 0;
  color: var(--blue);
  font-family: "Lilita One", sans-serif;
  padding: 0;
  font-size: 16px;
}

.pips, .week { display: flex; gap: 6px; }
.pips i, .week b {
  flex: 1;
  text-align: center;
  border-radius: 10px;
  background: var(--dusk);
  min-height: 18px;
}
.pips i.on { background: var(--pitch); }
.pips i.full { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--blue); }
.week b {
  padding: 8px 0;
  color: var(--blue);
  font-size: 12px;
}
.week b.ok { background: var(--pitch); color: #fff; }
.week b.skip { background: var(--yellow); }
.week b.hoje { box-shadow: inset 0 0 0 2px var(--blue); }
.pair { display: flex; gap: 8px; }
.pair .go, .pair .ghost { flex: 1; margin: 0; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; min-height: 120px; }
.seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-height: 120px;
  background: linear-gradient(var(--dusk), #d5e6ef);
  border-radius: 12px;
  padding: 6px 2px;
}
.seg i {
  display: block;
  width: 70%;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(var(--yellow), var(--pitch));
  min-height: 8px;
}
.seg b { font-family: "Lilita One", sans-serif; font-size: 16px; }
.seg small { font-size: 10px; text-transform: uppercase; }
.twin { display: flex; flex-direction: column; gap: 8px; }
.barline {
  position: relative;
  height: 36px;
  border-radius: 999px;
  background: var(--dusk);
  overflow: hidden;
  border: 2px solid var(--blue);
}
.barline i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pitch), var(--yellow));
}
.barline b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Lilita One", sans-serif;
  font-size: 20px;
  color: var(--blue);
}
.doce {
  display: flex;
  gap: 10px;
  align-items: center;
}
.doce .candy {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--caramel);
  display: grid;
  place-items: center;
  flex: none;
}
.doce .candy img { width: 40px; height: 40px; object-fit: contain; }
.doce .pulse { box-shadow: 0 0 0 4px var(--yellow); }
.logwrap { max-height: 320px; overflow: auto; border-radius: 12px; border: 2px solid var(--wood); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 6px 8px; text-align: left; }
th { position: sticky; top: 0; background: var(--blue); color: var(--yellow); }
tr:nth-child(even) td { background: rgba(255, 255, 255, .55); }
.big {
  font-family: "Lilita One", sans-serif;
  font-size: 42px;
  margin: 0;
  color: var(--pitch);
}
.muted { margin: 4px 0 8px; color: var(--wood); }

#sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 20, 40, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.panel {
  width: min(480px, 100%);
  max-height: 82dvh;
  overflow: auto;
  background: linear-gradient(#fff8df, var(--sand));
  border: 4px solid var(--wood);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 16px 16px 28px;
  box-shadow: 0 -8px 0 var(--caramel);
}
.panel h3 { font-family: "Lilita One", sans-serif; font-size: 28px; margin: 8px 0; color: var(--blue); }
.panel ul { margin: 0 0 12px; padding-left: 18px; }
.panel li { margin: 6px 0; }
.panel .pinbtn, .panel .ghost { width: 100%; margin-top: 8px; font-size: 20px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%) translateY(12px);
  z-index: 36;
  max-width: min(420px, calc(100% - 24px));
  background: var(--blue);
  color: var(--yellow);
  border-radius: 999px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.noscript {
  position: fixed;
  inset: auto 12px 12px 12px;
  background: var(--yellow);
  color: var(--blue);
  padding: 12px;
  border-radius: 12px;
  z-index: 60;
}
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.mini .cell span { font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
