:root {
  --ink: #1d2433;
  --muted: #5b6475;
  --paper: #ffffff;
  --soft: #f1f4f9;
  --red: #e3262f;
  --yellow: #ffcd03;
  --blue: #0a6fd6;
  --purple: #7a4fe0;
  --green: #2fa84f;
  --fogo: #ff7a3d; --terra: #6fd36f; --ar: #62c6ff; --agua: #b892ff;
  --shadow: 0 5px 0 rgba(0,0,0,.16), 0 10px 26px rgba(0,0,0,.18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05040f; color: var(--ink); font-family: "Nunito", system-ui, -apple-system, sans-serif; }
button { font-family: inherit; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* rótulos (iguais ao Tijolada) */
.label { position: absolute; left: 0; top: 0; padding: 4px 9px 5px; border-radius: 999px; background: #fff; color: var(--ink);
  font: 800 12px/1.15 "Nunito", system-ui, sans-serif; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.14), 0 3px 10px rgba(0,0,0,.18);
  pointer-events: none; transform-origin: 50% 100%; will-change: transform; user-select: none; }
.label::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #fff; }
.label.hl { background: var(--yellow); color: var(--ink); font-size: 16px; font-weight: 900; padding: 7px 14px 8px; box-shadow: 0 4px 0 rgba(0,0,0,.2), 0 6px 18px rgba(0,0,0,.3); }
.label.hl::after { border-top-color: var(--yellow); }
.label.city { background: var(--ink); color: #fff; font-size: 13px; font-weight: 900; padding: 5px 11px 6px; }
.label.city::after { border-top-color: var(--ink); }
.label.city b { color: var(--yellow); font-weight: 900; }
.label.city.empty { background: rgba(255,255,255,.95); color: var(--muted); }
.label.city.empty b { color: var(--red); }
.label.city.empty::after { border-top-color: rgba(255,255,255,.95); }

/* topo */
.top { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px; z-index: 13; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
.logo { pointer-events: auto; display: flex; align-items: center; gap: 8px; text-decoration: none; height: 48px; font-family: "Lilita One", sans-serif; font-size: 24px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); white-space: nowrap; }
.logo em { font-style: normal; color: var(--yellow); }
.star { width: 30px; height: 30px; flex: none; background: var(--yellow); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); }
.planet { width: 30px; height: 30px; border-radius: 50%; flex: none; position: relative; background: radial-gradient(circle at 35% 30%, #8ff0a0, #2fa84f 55%, #1d6b35 90%); box-shadow: inset -4px -4px 0 rgba(0,0,0,.2), 0 2px 0 rgba(0,0,0,.25); }
.planet::after { content: ""; position: absolute; left: -8px; right: -8px; top: 11px; height: 8px; border-radius: 50%; border: 3px solid var(--yellow); border-top-color: transparent; transform: rotate(-18deg); }
.searchwrap { pointer-events: auto; flex: 1; max-width: 460px; margin-left: auto; position: relative; }
form.search { display: flex; background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); overflow: hidden; height: 48px; }
form.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 4px 0 18px; font: 800 16px "Nunito", sans-serif; color: var(--ink); background: transparent; }
form.search button { border: 0; background: var(--red); color: #fff; font-weight: 900; font-size: 15px; padding: 0 18px; cursor: pointer; white-space: nowrap; }
.suggest { position: absolute; top: 54px; left: 0; right: 0; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: none; }
.suggest.open { display: block; }
.suggest button { display: flex; width: 100%; min-height: 44px; border: 0; background: none; text-align: left; padding: 11px 16px; gap: 10px; align-items: center; cursor: pointer; font-size: 15px; font-weight: 800; color: var(--ink); }
.suggest button + button { border-top: 1px solid #edf0f5; }
.suggest button:hover { background: var(--soft); }
.suggest small { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap; }

/* rodapé */
.bottom { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10; display: flex; gap: 8px; align-items: flex-end; pointer-events: none; }
.bottom > * { pointer-events: auto; }
.counter { background: var(--yellow); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); font-weight: 900; font-size: 13px; line-height: 1.15; display: flex; align-items: center; min-height: 48px; }
.counter b { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 20px; }
.pill { border: 0; cursor: pointer; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-weight: 900; font-size: 14px; background: var(--paper); color: var(--ink); text-decoration: none; white-space: nowrap; min-height: 48px; display: inline-flex; align-items: center; gap: 6px; }
.pill.dark { background: var(--ink); color: #fff; margin-left: auto; white-space: normal; max-width: 46vw; line-height: 1.2; font-weight: 800; }
.pill.dark strong { color: var(--yellow); }
.pill.blue { background: var(--blue); color: #fff; }
.pill.purple { background: var(--purple); color: #fff; }
.pill.yellow { background: var(--yellow); color: var(--ink); }
.toastline { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 9px 14px; font-weight: 800; font-size: 13px; white-space: nowrap; box-shadow: var(--shadow); max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }

/* lateral direita */
.side { position: fixed; right: 16px; top: 50%; transform: translateY(-40%); z-index: 11; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); font-weight: 900; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.round.dark { background: var(--ink); color: #fff; }
@media (max-width: 600px) { .side .pill { display: none; } .side { top: auto; bottom: 90px; transform: none; } }

/* ranking mini */
.mini { position: fixed; z-index: 9; left: 16px; top: calc(max(12px, env(safe-area-inset-top)) + 62px); width: 310px; max-height: calc(100vh - 200px); overflow: auto; background: rgba(255,255,255,.96); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 12px 10px; }
.mini-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 6px; }
.mini-title { font-family: "Lilita One", sans-serif; font-size: 18px; margin-right: auto; border: 0; background: none; padding: 0; color: var(--ink); cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.mini-title i { font-style: normal; font-family: "Nunito", sans-serif; font-weight: 900; font-size: 13px; color: var(--muted); }
.mini-tabs { display: flex; gap: 4px; background: var(--soft); border-radius: 999px; padding: 3px; }
.mini-tabs button { border: 0; background: none; border-radius: 999px; padding: 5px 10px; font-weight: 900; font-size: 12px; color: var(--muted); cursor: pointer; }
.mini-tabs button.on { background: var(--ink); color: #fff; }
.mini-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.mini-list button { display: flex; width: 100%; min-height: 44px; gap: 8px; align-items: center; border: 0; background: none; padding: 6px; border-radius: 10px; text-align: left; cursor: pointer; color: var(--ink); font-weight: 800; font-size: 14px; }
.mini-list button:hover { background: var(--soft); }
.mini-list .md { width: 24px; text-align: center; flex: none; font-size: 16px; }
.mini-list .nm { flex: 1; min-width: 0; }
.mini-list .nm b, .mini-list .nm small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .nm small { font-size: 12px; color: var(--muted); font-weight: 700; }
.mini-list .vl { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 17px; white-space: nowrap; }
.mini-more { width: 100%; border: 0; background: var(--soft); border-radius: 10px; padding: 8px; font-weight: 900; font-size: 13px; cursor: pointer; margin-top: 6px; color: var(--ink); }
.mini.collapsed .mini-list, .mini.collapsed .mini-more, .mini.collapsed .mini-tabs, .mini.collapsed .placar { display: none; }
.mini.collapsed { width: auto; padding: 8px 12px; }
.placar { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; border: 0; cursor: pointer; text-align: left; background: #fff3c4; border-radius: 12px; padding: 8px 10px; color: var(--ink); font-weight: 800; font-size: 13px; }
.placar .pz-flag { font-size: 22px; flex: none; }
.placar .pz-main { flex: 1; min-width: 0; }
.placar .pz-k { display: block; font-size: 10px; letter-spacing: .6px; font-weight: 900; color: #9a6a00; }
.placar .pz-who { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.placar .pz-gap { display: block; font-size: 12px; color: var(--muted); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placar .pz-num { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 17px; }
.bar { height: 6px; background: var(--soft); border-radius: 99px; margin-top: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
@media (max-width: 600px) { .mini { width: auto; left: 16px; right: 16px; max-height: 44vh; } }

/* sheet (card) */
.sheet { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20; width: min(440px, calc(100% - 32px)); transform: translate(-50%, 150%); visibility: hidden;
  transition: transform .35s cubic-bezier(.2,1.25,.4,1), visibility 0s linear .35s; background: var(--paper); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 18px 16px; max-height: 72vh; overflow: auto; }
.sheet.open { transform: translate(-50%, 0); visibility: visible; transition: transform .35s cubic-bezier(.2,1.25,.4,1); }
.sheet .x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); font-weight: 900; cursor: pointer; }
.sheet h2 { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 24px; margin: 0 36px 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet .sub { color: var(--muted); font-weight: 800; font-size: 14px; margin: 0 0 10px; }
.sheet .head { display: flex; gap: 12px; align-items: center; }
.sheet .head canvas { width: 64px; height: 64px; flex: none; border-radius: 16px; background: radial-gradient(circle at 30% 30%, #5a2aa8, #1a0f3a); }
.sheet .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; background: var(--soft); color: var(--ink); }
.chip.gold { background: #fff3c4; color: #7a5300; }
.chip.race { color: #fff; }
.sheet .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.sheet .stat { background: var(--soft); border-radius: 12px; padding: 8px; text-align: center; }
.sheet .stat b { display: block; font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 22px; }
.sheet .stat span { font-size: 11px; color: var(--muted); font-weight: 800; }
.sheet .next { font-size: 13px; color: var(--muted); font-weight: 800; margin: 6px 0 10px; }
.sheet .next b { color: var(--ink); }
.sheet .actions { display: flex; gap: 8px; }
.go { flex: 1; border: 0; border-radius: 14px; padding: 12px 14px; font-weight: 900; font-size: 15px; cursor: pointer; background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.14); }
.ghost { border: 0; border-radius: 14px; padding: 12px 14px; font-weight: 900; font-size: 14px; cursor: pointer; background: var(--soft); color: var(--ink); }
.sheet .rules p { margin: 8px 0; line-height: 1.5; font-size: 14px; font-weight: 700; }
.sheet .rules code { background: #fff3c4; padding: 1px 7px; border-radius: 7px; color: #7a5300; font-weight: 900; }
.sheet .row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #edf0f5; cursor: pointer; font-weight: 800; font-size: 14px; }
.sheet .row .rk { width: 26px; color: var(--muted); text-align: right; }
.sheet .row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet .row .pt { font-family: "Lilita One", sans-serif; color: var(--ink); }
.sheet .feed { padding: 8px 0; border-bottom: 1px solid #edf0f5; font-weight: 800; font-size: 14px; }
.sheet .feed small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* boas-vindas */
.onb { position: fixed; inset: 0; z-index: 30; background: rgba(20,12,50,.6); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); }
.onb-card { width: min(420px, 100%); background: var(--paper); border-radius: 24px; box-shadow: var(--shadow); padding: 22px; text-align: center; }
#mascot { width: 120px; height: 120px; border-radius: 28px; background: radial-gradient(circle at 30% 30%, #5a2aa8, #1a0f3a); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.onb-track h1 { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 26px; margin: 12px 0 6px; }
.onb-track p { color: var(--muted); font-weight: 700; line-height: 1.5; margin: 0; font-size: 15px; }
.onb-track .big { display: inline-block; margin: 14px 0 4px; padding: 10px 16px; border-radius: 12px; background: #fff3c4; color: #7a5300; font-weight: 900; font-size: 17px; }
.onb-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 10px; }
.onb-nav .go { flex: 0 0 auto; }
.onb-dots { display: flex; gap: 6px; }
.onb-dots i { width: 7px; height: 7px; border-radius: 50%; background: #e3e7ef; }
.onb-dots i.on { background: var(--yellow); }

/* carregando */
.loading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 40%, #3a1f7a, #0a0618 60%, #03030a); transition: opacity .4s; }
.loading.off { opacity: 0; pointer-events: none; }
.loading-inner { text-align: center; color: #fff; font-weight: 800; }
.ld-planet { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; background: radial-gradient(circle at 35% 30%, #8ff0a0, #2fa84f 55%, #1d6b35 90%); position: relative; animation: spin 2.2s linear infinite; }
.ld-planet::after { content: ""; position: absolute; left: -14px; right: -14px; top: 20px; height: 14px; border-radius: 50%; border: 4px solid var(--yellow); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.ld-text { font-family: "Lilita One", sans-serif; font-size: 20px; letter-spacing: .5px; }

/* modo cinema (?cinema=1): só o mapa */
body.cinema .top, body.cinema .mini, body.cinema .side, body.cinema .bottom, body.cinema .sheet, body.cinema .onb { display: none !important; }
