/* Capivrum — interface com cara de peça de tabuleiro: cartões de papelão grosso, botões com sombra sólida,
   e a grade listrada vermelha e branca do PitchCar como assinatura. */
:root {
  --rio: #2f8a86; --rio-d: #1d5c59; --grama: #7cad4c; --grama-d: #557d30;
  --terra: #7a5634; --terra-d: #4e3520; --sol: #e8973a; --sol-d: #b2681c;
  --areia: #e5cc8e; --papel: #f7ecd2; --papel-2: #efdfbb; --tinta: #33241a; --tinta-2: #6b5442;
  --pista: #2c2c31; --grade: #d6423a; --branco: #fbf7ee;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --f-title: 'Baloo 2', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --f-text: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --stripe: repeating-linear-gradient(-45deg, var(--grade) 0 12px, var(--branco) 12px 24px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--rio-d); color: var(--tinta); font: 500 16px/1.45 var(--f-text); -webkit-tap-highlight-color: transparent; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#ui, #game-ui { position: fixed; inset: 0; pointer-events: none; }
#ui[hidden] { display: none; }
#ui .panel, #ui .ticket, #ui header, #ui .tabs, #ui form, #ui button, #ui input, #ui select, #ui textarea, #ui .brand,
#game-ui button, #game-ui input, #game-ui .panel, #game-ui .modal-back, #game-ui .hud-card { pointer-events: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sol); outline-offset: 2px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
h1, h2, h3, h4 { font-family: var(--f-title); line-height: 1.1; margin: 0; color: var(--tinta); }
h2 { font-size: 1.75rem; font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 18px 0 8px; }
h4 { font-size: 1rem; margin: 14px 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--tinta-2); }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 16px; }

/* ---------- marca ---------- */
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; }
.brand-kicker { font: 700 1rem/1 var(--f-title); color: var(--branco); background: var(--pista); padding: 5px 10px 3px; border-radius: 8px; transform: rotate(-3deg); margin-bottom: -6px; position: relative; z-index: 1; }
.brand-name { font-size: clamp(3.2rem, 9vw, 5.6rem); font-weight: 800; letter-spacing: -0.02em; color: var(--branco);
  -webkit-text-stroke: 3px var(--terra-d); paint-order: stroke fill; text-shadow: 0 6px 0 var(--terra-d); line-height: 0.95; }
.brand-rail { display: block; width: 100%; height: 14px; border-radius: 4px; background: var(--stripe); box-shadow: 0 4px 0 var(--terra-d); margin-top: 6px; }
.brand.small .brand-name { font-size: clamp(2.4rem, 6vw, 3.4rem); -webkit-text-stroke-width: 2.5px; text-shadow: 0 4px 0 var(--terra-d); }
.brand.small .brand-rail { height: 10px; }
.tagline { max-width: 26ch; background: rgba(44,44,49,0.55); padding: 10px 14px; border-radius: 14px; font: 700 1.15rem/1.35 var(--f-text); color: var(--branco); text-shadow: 0 2px 0 rgba(40, 25, 10, 0.45); margin-top: 18px; }

/* ---------- cartões e campos ---------- */
.panel { background: var(--papel); border: 3px solid var(--terra-d); border-radius: var(--r-lg); box-shadow: 0 7px 0 var(--terra-d); padding: 20px; }
.lbl { display: block; font: 700 0.9rem/1.2 var(--f-text); color: var(--tinta-2); margin: 12px 0 6px; }
.field { width: 100%; font: 700 1.05rem var(--f-text); color: var(--tinta); background: var(--branco); border: 2.5px solid var(--terra); border-radius: var(--r-md); padding: 11px 13px; }
.field:focus { outline: none; border-color: var(--sol); box-shadow: 0 0 0 3px rgba(232, 151, 58, 0.35); }
textarea.field.code { font: 600 0.85rem/1.4 ui-monospace, Menlo, Consolas, monospace; resize: vertical; word-break: break-all; }
select.field { width: auto; min-width: 220px; }
.err { color: #b0322b; font-weight: 800; min-height: 1.4em; margin: 8px 0 0; }
.note { font-size: 0.88rem; color: var(--tinta-2); background: var(--papel-2); border-radius: var(--r-sm); padding: 8px 12px; margin-top: 14px; }
.lead { font-size: 1.05rem; max-width: 62ch; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: 700 1.05rem/1 var(--f-title);
  padding: 12px 18px 10px; border-radius: var(--r-md); background: var(--branco); color: var(--tinta); box-shadow: 0 5px 0 var(--terra-d), inset 0 0 0 2.5px var(--terra-d);
  transition: transform 0.06s, box-shadow 0.06s; user-select: none; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--terra-d), inset 0 0 0 2.5px var(--terra-d); }
.btn.primary { background: var(--sol); color: #2a1606; box-shadow: 0 5px 0 var(--sol-d), inset 0 0 0 2.5px var(--sol-d); }
.btn.primary:active { box-shadow: 0 1px 0 var(--sol-d), inset 0 0 0 2.5px var(--sol-d); }
.btn.green { background: var(--grama); color: #1b2c0d; box-shadow: 0 5px 0 var(--grama-d), inset 0 0 0 2.5px var(--grama-d); }
.btn.danger { background: var(--grade); color: var(--branco); box-shadow: 0 5px 0 #8f2620, inset 0 0 0 2.5px #8f2620; }
.btn.ghost { background: var(--papel); }
.btn.small { font-size: 0.95rem; padding: 9px 12px 7px; box-shadow: 0 4px 0 var(--terra-d), inset 0 0 0 2px var(--terra-d); }
.btn.small.primary { box-shadow: 0 4px 0 var(--sol-d), inset 0 0 0 2px var(--sol-d); }
.btn.small.green { box-shadow: 0 4px 0 var(--grama-d), inset 0 0 0 2px var(--grama-d); }
.btn.wide { width: 100%; margin-top: 14px; font-size: 1.2rem; padding: 15px 18px 13px; }
.btn.like.on { color: var(--grade); }
.link { background: none; border: 0; padding: 0; font-weight: 800; color: var(--rio-d); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; display: inline-grid; place-items: center; background: var(--papel);
  box-shadow: 0 4px 0 var(--terra-d), inset 0 0 0 2.5px var(--terra-d); color: var(--tinta); font: 800 1.3rem var(--f-title); }
.round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--terra-d), inset 0 0 0 2.5px var(--terra-d); }
.round.big { width: 56px; height: 56px; }
.round.small { width: 34px; height: 34px; font-size: 1.1rem; }
.chip { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: 700 0.92rem var(--f-text); padding: 8px 12px; border-radius: 999px;
  background: var(--papel); color: var(--tinta); box-shadow: inset 0 0 0 2px var(--terra); }
.chip.on { background: var(--pista); color: var(--branco); box-shadow: inset 0 0 0 2px var(--pista); }
.chip.danger { box-shadow: inset 0 0 0 2px var(--grade); color: #a3302a; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-block; font: 800 0.78rem/1 var(--f-text); padding: 5px 9px 4px; border-radius: 999px; background: var(--papel-2); color: var(--tinta-2); }
.badge.on { background: var(--pista); color: var(--branco); }
.badge.soon { background: #f6dcb7; color: #8a4b0f; }
.badge.ok { background: #d9ebc4; color: #36561a; }

/* ---------- abas (parecem marcadores de papelão) ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 -3px 14px; position: relative; z-index: 1; }
.tab { border: 3px solid var(--terra-d); border-bottom: 0; background: var(--papel-2); color: var(--tinta-2); font: 700 1rem var(--f-title); padding: 8px 14px 6px;
  border-radius: 14px 14px 0 0; cursor: pointer; }
.tab.on { background: var(--papel); color: var(--tinta); padding-bottom: 9px; }
.panel .tabs { margin: 0 0 14px; }
.panel .tab { border-bottom: 3px solid var(--terra-d); border-radius: 12px; }
.panel .tab.on { background: var(--pista); color: var(--branco); border-color: var(--pista); padding-bottom: 6px; }

/* ---------- login e cadastro ---------- */
.auth { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 400px); align-items: center; gap: 4vw; padding: 5vh 6vw; }
.auth-brand { align-self: start; padding-top: 4vh; }
.auth-card { width: 100%; }
.auth-card h2 { margin-bottom: 6px; }
.swap { margin: 14px 0 0; text-align: center; }
.steps { display: flex; gap: 6px; margin-bottom: 10px; }
.reg .auth-card { max-height: 88vh; overflow: auto; }
.reg { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 8px 0; }
.swatch { display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 10px; border-radius: var(--r-md); background: var(--branco);
  box-shadow: inset 0 0 0 2px var(--papel-2); font: 700 0.95rem var(--f-text); text-align: left; }
.swatch.on { box-shadow: inset 0 0 0 3px var(--sol); background: #fff6e6; }
.sw { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18); }

/* ---------- menu logado ---------- */
.home { position: absolute; inset: 0; padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.home-top, .screen-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 10px; background: var(--papel); border: 3px solid var(--terra-d); border-radius: 999px; padding: 5px 16px 5px 5px; box-shadow: 0 4px 0 var(--terra-d); }
.who b { font: 800 1.1rem/1 var(--f-title); display: block; }
.who small { color: var(--tinta-2); font-weight: 700; }
.home-top .wallet { margin-left: auto; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font: 800 1.2rem var(--f-title); color: var(--branco); background: var(--terra); text-shadow: 0 1px 0 rgba(0,0,0,.3); flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 1rem; }
.wallet { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 800 1.05rem/1 var(--f-title); background: var(--papel); border: 3px solid var(--terra-d); border-radius: 999px; padding: 6px 12px 4px 8px; box-shadow: 0 4px 0 var(--terra-d); }
.pill small { font: 700 0.8rem var(--f-text); color: var(--tinta-2); }
.dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: none; }
.coin .dot, .price .dot { background: radial-gradient(circle at 35% 35%, #ffe08a, #e8a72c 60%, #b2781c); box-shadow: inset 0 0 0 2px #9a6516; }
.credit .dot { background: radial-gradient(circle at 35% 35%, #c9f0ee, #3fa6a0 60%, #1d5c59); box-shadow: inset 0 0 0 2px #17504d; }
.home-main { flex: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; min-height: 0; }
.home-left { display: flex; flex-direction: column; gap: 16px; width: min(380px, 100%); }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 10px 10px; border-radius: var(--r-md); text-align: left; }
.nav-btn:hover { background: var(--papel-2); }
.nav-chip { margin-left: auto; min-width: 1.6em; padding: 3px 7px 2px; border-radius: 999px; background: var(--sol, #f2a33a); color: #2a1606; font: 800 0.8rem/1.2 var(--f-text); text-align: center; flex: none; }   /* [beta 0.93] pedidos de amizade novos */
.nav-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--pista); color: var(--branco); flex: none; }
.nav-btn.hero .nav-ic { background: var(--sol); color: #2a1606; box-shadow: 0 3px 0 var(--sol-d); }
.nav-btn.quiet .nav-ic { background: var(--papel-2); color: var(--tinta-2); }
.nav-txt b { display: block; font: 800 1.2rem/1.1 var(--f-title); }
.nav-txt small { color: var(--tinta-2); font-weight: 700; font-size: 0.86rem; }
.ticket { width: min(320px, 100%); background: var(--branco); border-radius: 18px; padding: 16px; position: relative; border: 3px solid var(--terra-d); box-shadow: 0 7px 0 var(--terra-d); align-self: flex-end;
  background-image: radial-gradient(circle at 0 62%, var(--rio-d) 0 11px, transparent 12px), radial-gradient(circle at 100% 62%, var(--rio-d) 0 11px, transparent 12px); }
.ticket-top { display: flex; justify-content: space-between; align-items: baseline; margin: -16px -16px 12px; padding: 10px 16px 8px; background: var(--stripe); border-radius: 15px 15px 0 0; }
.ticket-top span { white-space: nowrap; font: 800 1rem var(--f-title); background: var(--pista); color: var(--branco); padding: 3px 10px 1px; border-radius: 8px; }
.ticket-top small { white-space: nowrap; font-size: 0.78rem; font-weight: 800; background: var(--branco); padding: 2px 8px; border-radius: 8px; }
.ticket .thumb { width: 100%; height: 120px; background: #e9d2a3; border-radius: 12px; margin-bottom: 8px; }
.ticket-name { display: block; font: 800 1.5rem/1.1 var(--f-title); margin-bottom: 4px; }
.ticket-best { font-weight: 800; color: var(--rio-d); }

/* ---------- telas internas ---------- */
.screen { position: absolute; inset: 0; padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; max-width: 1060px; }
.screen-head h2 { color: var(--branco); -webkit-text-stroke: 2px var(--terra-d); paint-order: stroke fill; text-shadow: 0 3px 0 var(--terra-d); font-size: 2.1rem; }
.screen .panel.scroll { flex: 1; overflow: auto; min-height: 0; }
.screen > .tabs + .panel { border-top-left-radius: 8px; }
.track-row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-md); background: var(--branco); margin-bottom: 8px; box-shadow: inset 0 0 0 2px var(--papel-2); }
.track-row .thumb { width: 92px; height: 64px; background: #e9d2a3; border-radius: 10px; flex: none; }
.track-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.track-info b { font: 800 1.15rem/1.15 var(--f-title); }
.best { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--rio-d); font-size: 0.92rem; }
.track-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }   /* [v14] 3 cards: CapiCaos, Assíncrono, Arena */
.mode-card { border-radius: 18px; padding: 18px; background: var(--branco); box-shadow: inset 0 0 0 2.5px var(--papel-2); }
.mode-card.caos { background-image: linear-gradient(var(--branco), var(--branco)), var(--stripe); background-origin: border-box; background-clip: padding-box, border-box; border: 6px solid transparent; }
.mode-card h3 { margin: 0; font-size: 1.5rem; }
.facts { margin: 6px 0 12px; padding-left: 20px; font-weight: 700; }
.code-in { width: 92px; text-transform: uppercase; text-align: center; letter-spacing: 0.15em; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--papel); margin-top: 6px; flex-wrap: wrap; }
.mini-row > span:first-child { flex: 1; }
.empty { text-align: center; padding: 30px 12px; }
.empty b { font: 800 1.3rem var(--f-title); display: block; margin-bottom: 4px; }
table.rank { width: 100%; border-collapse: collapse; margin-top: 12px; font-weight: 700; }
.rank th { text-align: left; font: 700 0.85rem var(--f-text); color: var(--tinta-2); padding: 6px 10px; border-bottom: 2px solid var(--papel-2); }
.rank td { padding: 9px 10px; border-bottom: 1px solid var(--papel-2); }
.rank tr:nth-child(1) td:first-child { color: var(--sol-d); font-weight: 800; }
.rank tr.me td { background: #fff1d6; }

/* customizar */
.cust-screen { max-width: 640px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item { border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: var(--r-md); background: var(--branco);
  box-shadow: inset 0 0 0 2px var(--papel-2), 0 3px 0 var(--papel-2); text-align: left; font: 700 1rem var(--f-text); }
.item b { font: 800 1.05rem/1.15 var(--f-title); }
.item.using { box-shadow: inset 0 0 0 3px var(--sol), 0 3px 0 var(--sol-d); background: #fff6e6; }
.item .sw { width: 34px; height: 34px; }
/* [v7] miniatura 3D: a capivara-base vestindo o item, num recorte de papelão */
.item .thumb3d { align-self: stretch; height: 84px; border-radius: var(--r-sm); background: var(--papel); box-shadow: inset 0 0 0 2px var(--papel-2);
  display: grid; place-items: center; overflow: hidden; }
.item .thumb3d img { width: 84px; height: 84px; object-fit: contain; display: block; }
.item.using .thumb3d { background: #fff0d6; box-shadow: inset 0 0 0 2px #f3d29f; }
.rar { font: 800 0.74rem var(--f-text); color: var(--tinta-2); margin-top: -4px; }
.rar-incomum { color: var(--rio-d); }
.rar-raro { color: #6b3fa8; }
.rar-epico, .rar-lendario { color: var(--sol-d); }
.tag { font: 800 0.78rem var(--f-text); color: var(--tinta-2); background: var(--papel-2); padding: 3px 8px; border-radius: 999px; }
.tag.on { background: var(--sol); color: #2a1606; }
.tag.evento { background: #4a3a6b; color: #f4ecff; }   /* [v16] recompensa de evento: quanto já fez */
.evento-note { margin: 0 0 12px; }
.price { display: inline-flex; align-items: center; gap: 5px; font: 800 1rem var(--f-title); }
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.set-card { border-radius: 16px; padding: 14px; background: var(--branco); box-shadow: inset 0 0 0 2.5px #bfe3e1; display: flex; flex-direction: column; gap: 8px; }
.set-card b { font: 800 1.25rem var(--f-title); }
.set-card p { margin: 0; }

/* configurações */
.slider { display: grid; grid-template-columns: 1fr 200px 52px; align-items: center; gap: 12px; padding: 12px 0; font-weight: 800; border-bottom: 2px solid var(--papel-2); }
.slider input { accent-color: var(--sol); }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 800; padding: 12px 0; }
.toggle input { width: 22px; height: 22px; accent-color: var(--sol); }
.prose { max-width: 62ch; }
.prose h3 { margin-top: 0; }

/* ---------- jogo ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--f-text); }
.hud-card { position: absolute; top: 14px; left: 14px; background: var(--papel); border: 3px solid var(--terra-d); border-radius: 16px; box-shadow: 0 5px 0 var(--terra-d); padding: 10px 14px; }
.hud-title { font: 800 1.2rem/1.1 var(--f-title); }
.hud-stats { display: flex; gap: 14px; font-weight: 700; margin-top: 2px; flex-wrap: wrap; }
.hud-stats span { display: inline-flex; align-items: center; gap: 3px; }
.hud-stats b { font: 800 1.15rem var(--f-title); }
.hud-right { position: absolute; top: 14px; right: 14px; }
.hud-right button { pointer-events: auto; }
.hud-tools { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; }
.hud-tools button { pointer-events: auto; }
.hud-tools .chip { background: var(--papel); box-shadow: inset 0 0 0 2.5px var(--terra-d), 0 4px 0 var(--terra-d); padding: 12px 14px; }
.hud-tools .chip.on { background: var(--pista); color: var(--branco); }
.meter { position: absolute; right: 22px; bottom: 90px; width: 22px; height: 180px; border-radius: 12px; background: rgba(251, 247, 238, 0.85); border: 3px solid var(--terra-d); overflow: hidden; opacity: 0; transition: opacity .15s; display: flex; align-items: flex-end; }
.meter.show { opacity: 1; }
.meter i { display: block; width: 100%; height: 0; background: var(--grama); }
.hint { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: rgba(44, 44, 49, 0.88); color: var(--branco); border-radius: 14px; padding: 10px 16px; text-align: center; max-width: min(92vw, 460px); transition: opacity .4s; }
.hint b { display: block; font: 800 1.1rem var(--f-title); }
.hint span { font-size: 0.9rem; opacity: 0.85; }
.hint.gone { opacity: 0; }
.banner { position: absolute; top: 22%; left: 50%; transform: translate(-50%, -10px) scale(0.9); opacity: 0; transition: all .25s; text-align: center; pointer-events: none; }
.banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.banner b { display: block; font: 800 clamp(2rem, 6vw, 3.4rem)/1 var(--f-title); color: var(--branco); -webkit-text-stroke: 3px var(--terra-d); paint-order: stroke fill; text-shadow: 0 5px 0 var(--terra-d); }
.banner span { display: inline-block; margin-top: 8px; font-weight: 800; background: var(--papel); border-radius: 999px; padding: 4px 14px; box-shadow: 0 3px 0 var(--terra-d); }
.banner.warn b { color: #ffd9c9; }
.banner.good b { color: #ffe9a8; }

/* ---------- modal e toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(29, 32, 30, 0.45); display: grid; place-items: center; padding: 16px; z-index: 50; pointer-events: auto; }
.modal { width: min(460px, 100%); background: var(--papel); border: 3px solid var(--terra-d); border-radius: var(--r-lg); box-shadow: 0 8px 0 var(--terra-d); padding: 22px; animation: pop .18s ease-out; max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 10px; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.result { text-align: center; }
.result-big b { font: 800 4.5rem/1 var(--f-title); color: var(--sol-d); display: block; }
.result-big span { font: 700 1.1rem var(--f-title); }
.result-line { font-weight: 800; margin-top: 8px; }
.result-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.coin-pill, .rank-pill { display: inline-flex; align-items: center; gap: 4px; font: 800 1rem var(--f-title); padding: 6px 12px 4px; border-radius: 999px; }
.coin-pill { background: #ffe9a8; color: #6d4510; }
.rank-pill { background: #d9ebc4; color: #36561a; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--pista); color: var(--branco); font-weight: 800; padding: 12px 18px; border-radius: 14px;
  box-shadow: 0 5px 0 #121214; transition: all .2s; z-index: 60; pointer-events: none; max-width: min(92vw, 520px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #8f2620; box-shadow: 0 5px 0 #5a1712; }

/* ---------- editor ---------- */
.editor { position: absolute; inset: 0; pointer-events: none; }
.ed-side { position: absolute; top: 14px; left: 14px; bottom: 14px; width: 360px; display: flex; flex-direction: column; gap: 4px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }   /* [beta 1.53] o painel inteiro rola, em vez de espremer a lista de peças */
.ed-head { display: flex; align-items: center; gap: 10px; }
.ed-par { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-weight: 800; }
.ed-par b { font: 800 1.4rem var(--f-title); min-width: 1.2em; text-align: center; }
.ed-palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ed-palette .piece span { display: none; }
.ed-side .lbl { margin: 8px 0 4px; }
.piece { border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 12px; background: var(--pista); color: var(--branco);
  box-shadow: 0 3px 0 #111; font: 700 0.68rem/1.1 var(--f-text); text-align: center; }
.piece:active { transform: translateY(2px); box-shadow: 0 1px 0 #111; }
.ed-size { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 6px; font-weight: 700; font-size: 0.88rem; }
.ed-size .chip, .ed-rails .chip { padding: 6px 10px; }
.ed-size-lbl { flex-basis: 100%; margin-top: 4px; }
.ed-rails { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0 2px; font-weight: 700; font-size: 0.88rem; }
.ed-list { flex: 1 1 170px; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding: 4px 2px; min-height: 170px; }   /* [beta 1.53] antes 80 px (3 peças); agora ~6 peças à vista */
.ed-item { border: 0; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--branco); font: 700 0.92rem var(--f-text); text-align: left; }
.ed-item .n { width: 24px; text-align: right; color: var(--tinta-2); font-size: 0.8rem; }
.ed-item .tag { margin-left: auto; }
.ed-item.sel { background: var(--sol); color: #2a1606; }
.ed-msg { font-weight: 800; font-size: 0.9rem; padding: 8px 10px; border-radius: 10px; margin-top: 6px; }
.ed-msg.good { background: #d9ebc4; color: #36561a; }
.ed-msg.bad { background: #f8d4cc; color: #8f2620; }
.ed-bar { position: absolute; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- abertura ---------- */
#boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--rio-d); color: var(--branco); font-weight: 800; z-index: 100; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: var(--branco); font-weight: 800; }

/* ---------- telas estreitas ---------- */
@media (max-width: 760px) {
  .auth, .reg { grid-template-columns: 1fr; align-content: end; padding: 16px; gap: 10px; overflow: auto; }
  .auth-brand { padding-top: 0; align-self: auto; }
  .tagline { display: none; }
  .reg .auth-card { max-height: 62vh; }
  .home { padding: 12px; overflow: auto; }
  .home-main { flex-direction: column; justify-content: flex-end; }
  .home-left { width: 100%; }
  .home-left .brand { display: none; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; padding: 6px; }
  .nav-btn { min-width: 0; gap: 8px; padding: 8px 6px; }
  .nav-ic { width: 36px; height: 36px; }
  .nav-txt { min-width: 0; }
  .nav-txt b { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-txt small { display: none; }
  .ticket { width: 100%; align-self: stretch; order: -1; }
  .ticket .thumb { height: 80px; }
  .screen { padding: 12px; }
  .screen-head h2 { font-size: 1.6rem; }
  .screen-head .wallet { display: none; }
  .mode-grid { grid-template-columns: 1fr; }
  .track-row { flex-wrap: wrap; }
  .track-row .thumb { width: 72px; height: 52px; }
  .track-acts { width: 100%; }
  .cust-screen { max-width: none; justify-content: flex-end; }
  .cust-screen .panel.scroll { flex: 0 1 46vh; }
  .slider { grid-template-columns: 1fr; }
  .ed-side { top: auto; bottom: 86px; left: 8px; right: 8px; width: auto; height: 46vh; }
  .ed-bar { left: 8px; right: 8px; gap: 6px; padding: 8px; }
  .ed-bar .btn { font-size: 0.85rem; padding: 8px 9px 6px; }
  .ed-side { bottom: 118px; height: 42vh; }
  .ed-palette { grid-template-columns: repeat(6, 1fr); }
  .hud-card { left: 8px; top: 8px; right: 78px; padding: 8px 10px; }
  .hud-title { font-size: 1rem; }
  .hud-tools .chip { padding: 12px; font-size: 0; gap: 0; }
  .hud-tools { gap: 6px; max-width: calc(100vw - 12px); }   /* [beta 1.53] com Câmera fixa e Desencalhar a fileira passava da borda do celular em pé */
  .hud-tools .rea-btn { font-size: 0; padding: 10px 12px; }
  .hint { bottom: 86px; }
  .meter { height: 130px; bottom: 86px; right: 12px; }
}
/* ---------- [0.7] publicação semanal e assíncrono ---------- */
.row.wrap { flex-wrap: wrap; }
.small { font-size: 0.85rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.loading { padding: 18px 4px; }
.week-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; background: var(--branco); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px; box-shadow: inset 0 0 0 2px var(--papel-2); }
.week-head h3 { font-size: 1.35rem; }
.week-head p { margin: 4px 0 0; }
.votes { display: inline-flex; align-items: center; gap: 2px; font: 800 1rem var(--f-title); color: var(--sol-d); }
.match-lists { margin-top: 18px; }
.match-lists h3 { margin-top: 10px; }
.facts.small { font-size: 0.86rem; font-weight: 600; color: var(--tinta-2); }
.mode-card select.field { margin-bottom: 4px; width: 100%; min-width: 0; max-width: 100%; }   /* [v14] cabe no card (3 colunas) */
.match-top { display: flex; gap: 14px; align-items: center; }
.match-top .thumb { width: 120px; height: 84px; background: #e9d2a3; border-radius: 12px; flex: none; }
.match-info { flex: 1; min-width: 0; }
.match-info h3 { font-size: 1.5rem; }
.match-info p { margin: 2px 0; }
.match-clock { text-align: center; background: var(--pista); color: var(--branco); border-radius: var(--r-md); padding: 8px 14px; min-width: 120px; }
.match-clock small { display: block; font-weight: 700; opacity: 0.8; }
.big-left { font: 800 2rem/1.1 var(--f-title); }
.match .row.wrap { margin: 14px 0 4px; }
.match-table .dot, .hud-board .dot { width: 11px; height: 11px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(0,0,0,0.15); }
.warn-ic { color: var(--sol-d); cursor: help; }
.match-pill { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; background: var(--pista); color: var(--branco);
  border-radius: 999px; padding: 7px 14px 6px; font-weight: 800; box-shadow: 0 4px 0 #121214; white-space: nowrap; max-width: calc(100vw - 420px); overflow: hidden; text-overflow: ellipsis; }
.match-pill b { font: 800 1.15rem var(--f-title); }
.match-pill small { font-weight: 700; opacity: 0.85; }
.match-pill.late { background: #8f2620; box-shadow: 0 4px 0 #5a1712; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #7d7d84; display: inline-block; margin-right: 4px; }
.live-dot.live { background: #6bbf59; box-shadow: 0 0 0 3px rgba(107,191,89,0.3); }
.live-dot.poll { background: var(--sol); }
.hud-board { position: absolute; top: 76px; right: 14px; margin: 0; padding: 8px; list-style: none; width: 230px; background: rgba(247, 236, 210, 0.94);
  border: 3px solid var(--terra-d); border-radius: 14px; box-shadow: 0 4px 0 var(--terra-d); font-weight: 700; font-size: 0.9rem; }
.hud-board li { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 8px; }
.hud-board li.me { background: #fff1d6; }
.hud-board li.holed .sc { color: #36561a; }
.hud-board li.capped .sc { color: var(--sol-d); }
.hud-board .pos { width: 16px; text-align: right; color: var(--tinta-2); }
.hud-board .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-board .sc { font: 800 1rem var(--f-title); }
.hud-board .sc small { font: 600 0.72rem var(--f-text); color: var(--tinta-2); }
@media (max-width: 760px) {
  .match-pill { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: 94vw; font-size: 0.85rem; }
  .hud-board { top: auto; bottom: calc(124px + env(safe-area-inset-bottom)); right: 8px; width: 170px; font-size: 0.8rem; padding: 6px; }
  .hud-board .sc small { display: none; }
  .match-top { flex-wrap: wrap; }
  .match-top .thumb { width: 88px; height: 62px; }
  .week-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- [0.9] CapiCaos Total ---------- */
.badge.caos { background: var(--terra, #b85c38); color: #fff; }
.mini-row.caos { box-shadow: inset 4px 0 0 #d6423a; }
.caos-loading { position: absolute; inset: 0; display: grid; place-items: center; font: 800 1.4rem var(--f-title); color: var(--branco); text-shadow: 0 3px 0 rgba(0,0,0,.35); pointer-events: none; }
.caos-hud .match-pill .ping { font-weight: 700; opacity: .85; }
.caos-chip { position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); padding: 7px 16px; border-radius: 999px; font-weight: 800;
  background: rgba(44,44,49,.82); color: #fbf7ee; pointer-events: none; white-space: nowrap; transition: background .2s; }
.caos-chip:empty { display: none; }
.caos-chip.ok { background: rgba(60,120,52,.9); }
.caos-chip.wait { background: rgba(44,44,49,.82); }
.caos-chip.bad { background: #8f2620; box-shadow: 0 0 0 4px rgba(214,66,58,.35); animation: caos-pulse .8s ease-in-out infinite alternate; }
@keyframes caos-pulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.06); } }
.caos-lobby { position: absolute; inset: 0; display: none; place-items: center; background: rgba(30,24,18,.35); }
.caos-lobby.show { display: grid; }
.caos-lobby .box { background: var(--papel, #f7ecd2); border-radius: 18px; padding: 18px 22px; max-width: min(440px, 92vw); box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.caos-lobby .box h3 { margin: 0 0 8px; }
.caos-lobby .box .dot { width: 11px; height: 11px; display: inline-block; border-radius: 50%; vertical-align: middle; }
.caos-lobby .count { text-align: center; color: var(--branco); }
.caos-lobby .count b { display: block; font: 800 clamp(4rem, 14vw, 7rem)/1 var(--f-title); -webkit-text-stroke: 3px var(--terra-d); paint-order: stroke fill; text-shadow: 0 6px 0 var(--terra-d); }
.caos-lobby .count span { font-weight: 800; }
.hud-board li.off { opacity: .55; }
@media (max-width: 700px) { .caos-chip { bottom: 120px; font-size: .9rem; } }

/* ---------- [v14] Arena, seletores de cena e promovidas (docs/MENUS.md) ---------- */
.mode-card.arena { border: 6px dashed #c9a24a; }
.badge.arena { background: #c9a24a; color: var(--tinta); }
.mini-row.arena { box-shadow: inset 4px 0 0 #c9a24a; }
.cena-picker { margin: 8px 0 4px; align-items: flex-end; }
.cena-campo { display: flex; flex-direction: column; gap: 2px; flex: 1 1 140px; min-width: 0; }
.cena-campo[hidden] { display: none; }
.cena-campo .lbl { margin: 0; }
.cena-campo select.field { width: 100%; }
.promovidas { margin: 0 0 12px; padding: 10px 14px; }
.promovidas h3 { margin: 4px 0 6px; display: flex; align-items: center; gap: 6px; }
.promovidas[hidden] { display: none; }

/* [v17] Competir responsivo. A tela usa a largura disponível (até 1320 px); no Multiplayer, à esquerda escolhe-se o
   modo e cria-se a sala num formulário só, com as regras recolhidas; à direita ficam o código e as partidas abertas.
   Abaixo de 980 px vira uma coluna; abaixo de 560 px os blocos de modo ficam compactos. */
.compete-screen { max-width: min(1320px, 100%); }
.compete-screen .panel.scroll { flex: 0 1 auto; }   /* o cartão acompanha o conteúdo e rola se passar da tela */
.multi { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.multi-main { display: grid; gap: 12px; min-width: 0; }
.modo-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.modo-tile { position: relative; text-align: left; border: 3px solid var(--terra-d); border-radius: 16px; background: var(--branco); padding: 14px 14px 12px;
  cursor: pointer; display: grid; gap: 2px; overflow: hidden; box-shadow: 0 4px 0 var(--terra-d); }
.modo-tile::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 7px; }
.modo-tile.caos::before { background: var(--stripe); }
.modo-tile.async::before { background: var(--rio); }
.modo-tile.arena::before { background: repeating-linear-gradient(90deg, #c9a24a 0 14px, transparent 14px 22px); }
.modo-tile b { font: 800 1.2rem/1.15 var(--f-title); }
.modo-tile small { color: var(--tinta-2); font-weight: 700; font-size: 0.85rem; line-height: 1.3; }
.modo-tile:hover { background: #fff; }
.modo-tile.on { background: var(--pista); color: var(--branco); border-color: var(--pista); }
.modo-tile.on small { color: #d9d4c8; }
.modo-form { display: grid; gap: 8px; }
.modo-form.async { border: 6px solid var(--rio); }
.modo-head { gap: 10px; }
.modo-linha { margin: -4px 0 4px; color: var(--tinta-2); font-weight: 700; display: none; }
@media (max-width: 560px) { .modo-linha { display: block; } }
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; align-items: start; }
.campo { display: flex; flex-direction: column; min-width: 0; }
.campo .lbl { margin-top: 6px; }
.campo select.field { width: 100%; min-width: 0; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn.big { font-size: 1.1rem; padding: 12px 22px 10px; }
.regras { border-top: 2px dashed var(--papel-2); padding-top: 8px; margin-top: 4px; }
.regras summary { cursor: pointer; font: 800 1rem var(--f-title); color: var(--tinta-2); }
.regras[open] summary { margin-bottom: 4px; }
.regras .facts { font-weight: 600; margin-bottom: 4px; }
.regras form { margin-top: 6px; }
.multi-side { display: grid; gap: 12px; min-width: 0; }
.entrar-codigo { background: var(--branco); border-radius: 16px; padding: 12px 14px; box-shadow: inset 0 0 0 2.5px var(--papel-2); }
.entrar-codigo .lbl { margin-top: 0; }
.match-lists h3 { margin: 4px 0 2px; }
.match-lists .mini-row { background: var(--branco); }
@media (max-width: 980px) {
  .multi { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .modo-tiles { gap: 6px; }
  .modo-tile { padding: 12px 4px 8px; text-align: center; border-radius: 12px; }
  .modo-tile b { font-size: clamp(0.72rem, 3.4vw, 0.95rem); white-space: nowrap; }
  .modo-tile small { display: none; }
  .campos { grid-template-columns: 1fr; }
  .btn.big { width: 100%; justify-content: center; }
  .screen-head { gap: 8px; }
  .compete-screen .tabs { margin-left: 8px; }
  .compete-screen .tab { padding: 7px 10px 5px; font-size: 0.95rem; }
}

/* ======================================================================================================================
   [beta 0.92] Layout fluido do jogo (mesma ideia da Oficina: larguras e espaços que acompanham a tela, sem rolagem da
   página). Escala por viewport:
     celular em pé (< 561)  ·  celular deitado / tablet em pé (561–760)  ·  tablet e notebook (761–1100)  ·
     desktop (1101–1799)  ·  monitor grande (≥ 1800)  ·  ultrawide (≥ 2200)  ·  celular deitado (altura ≤ 540)
   As regras que só valem acima de 760 px ficam em @media (min-width: 761px) para não desfazer o bloco de celular acima.
   Documentação: docs/MENUS.md §"Layout fluido".
   ====================================================================================================================== */
:root {
  --gutter: clamp(12px, 2vw, 32px);
  --safe-t: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px);
  --hud-board-w: clamp(190px, 17vw, 300px);
}
/* o `font` de html/body fixava 16 px; agora a raiz cresce um pouco em monitor grande (rem acompanha) */
html { font-size: clamp(16px, 0.35vw + 11px, 19px); }
body { font-size: 1rem; }

/* telas e menu: espaçamento fluido e respeito ao recorte (notch) do aparelho */
.home, .screen {
  padding: calc(var(--gutter) * 0.75 + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) calc(var(--gutter) + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
}
.screen { max-width: min(1320px, 100%); }
select.field { min-width: min(220px, 100%); }

/* HUD: recorte do aparelho no celular */
@media (max-width: 760px) {
  .hud-card { left: calc(8px + var(--safe-l)); top: calc(8px + var(--safe-t)); right: calc(78px + var(--safe-r)); }
  .hud-board { right: calc(8px + var(--safe-r)); bottom: calc(124px + var(--safe-b)); }
  .hud-right { top: calc(8px + var(--safe-t)); right: calc(8px + var(--safe-r)); }
}

@media (min-width: 761px) {
  .cust-screen { max-width: min(clamp(640px, 48vw, 980px), 100%); }
  .slider { grid-template-columns: minmax(0, 1fr) minmax(120px, 240px) 52px; }
  .hud-card { top: calc(14px + var(--safe-t)); left: calc(14px + var(--safe-l)); max-width: min(46vw, 460px); }
  .hud-right { top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); }
  .hud-board { top: calc(76px + var(--safe-t)); right: calc(14px + var(--safe-r)); width: var(--hud-board-w); font-size: clamp(0.9rem, 0.2vw + 0.82rem, 1.05rem); }
  .match-pill { top: calc(14px + var(--safe-t)); max-width: calc(100vw - var(--hud-board-w) - 2 * var(--gutter) - 380px); }
}

/* monitor grande */
@media (min-width: 1800px) {
  .screen { max-width: min(1500px, 100%); }
  .compete-screen { max-width: min(1560px, 100%); }
  .home-left { width: min(420px, 100%); }
  .ticket { width: min(360px, 100%); }
  .items { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
/* ultrawide */
@media (min-width: 2200px) {
  .screen { max-width: min(1700px, 100%); }
  .compete-screen { max-width: min(1760px, 100%); }
  .home-left { width: min(460px, 100%); }
  .ticket { width: min(400px, 100%); }
}

/* celular deitado (e qualquer tela baixa): tira o que gasta altura e compacta */
@media (max-height: 540px) and (orientation: landscape) {
  .home, .screen { gap: 8px; padding-top: calc(8px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); }
  .screen-head h2 { font-size: 1.4rem; }
  .panel { padding: 12px; }
  .home-left .brand { display: none; }
  .ticket .thumb { display: none; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; padding: 6px; }
  .nav-txt small { display: none; }
  .nav-ic { width: 36px; height: 36px; }
  .hud-card { max-width: 38vw; padding: 6px 10px; }
  .hud-board { top: calc(56px + var(--safe-t)); width: min(var(--hud-board-w), 180px); font-size: 0.8rem; }
  .hud-board .sc small { display: none; }
  .match-pill { font-size: 0.8rem; padding: 4px 10px 3px; }
  .hud-tools { bottom: calc(8px + var(--safe-b)); }
  .meter { height: 110px; bottom: 70px; }
}

/* toque: alvos de pelo menos 44 px (campos já têm 16 px+, então o iOS não dá zoom ao focar) */
@media (pointer: coarse) {
  .btn, .tab, .chip, .nav-btn, .modo-tile, .swatch { min-height: 44px; }
  .toggle input { width: 26px; height: 26px; }
}
@media (min-width: 761px) {
  .ed-side { width: clamp(280px, 26vw, 460px); left: calc(14px + var(--safe-l)); top: calc(14px + var(--safe-t)); bottom: calc(14px + var(--safe-b)); }
}

/* [beta 0.94] Lobby: duas colunas no desktop, uma no celular (usa os tokens do layout fluido) */
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter, 16px); align-items: start; }
.lobby-main, .lobby-side { display: grid; gap: var(--gutter, 16px); min-width: 0; }
.lb-membros h3 { margin: 0 0 8px; }
.lb-membro { flex-wrap: wrap; gap: 8px; }
.lb-membro .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: #b9b2a3; }
.lb-membro .dot.on { background: #4fa83d; }
.lb-codigo { gap: 10px; align-items: center; }
.lb-codigo .code { font: 800 1.4rem/1 var(--f-display, var(--f-text)); letter-spacing: 0.18em; }
.lb-acoes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lb-pub { gap: 8px; align-items: center; cursor: pointer; }
@media (max-width: 900px) { .lobby-grid { grid-template-columns: minmax(0, 1fr); } }

/* [beta 0.96/0.97] Arena: recarga do peteleco por tempo e vidas */
.cool { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); width: min(220px, 50vw); height: 10px; border-radius: 999px; background: rgba(251, 247, 238, 0.85); border: 2px solid var(--terra-d); overflow: hidden; opacity: 0; transition: opacity .15s; pointer-events: none; }
.cool.show { opacity: 1; }
.cool i { display: block; height: 100%; width: 0; background: var(--agua, #3aa0c8); }
.cool.ready i { background: var(--grama); }
.lives { color: #d2453b; letter-spacing: 1px; }
.lb-opcoes .chips { flex-wrap: wrap; }

/* ======================================================================================================================
   [beta 0.98] Solo: topo com a Pista da semana grande e os destaques menores à direita (XXXXXOOO / YYYYYYYY)
   ====================================================================================================================== */
.solo-topo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0 0 6px; }
.solo-topo.com-destaques { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); }
.solo-semana h3, .solo-destaques h3 { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.solo-destaques { display: flex; flex-direction: column; min-width: 0; }
.solo-destaques[hidden] { display: none; }
.track-row.grande { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; margin-bottom: 0; }
.track-row.grande .thumb { width: 100%; height: clamp(110px, 17vw, 190px); }
.track-row.grande .track-info b { font-size: 1.35rem; }
.track-row.grande .track-acts { align-self: flex-end; }
.track-row.mini { gap: 10px; padding: 8px; margin-bottom: 8px; }
.track-row.mini .thumb { width: 64px; height: 46px; }
.track-row.mini .track-info b { font-size: 1rem; }
.track-row.mini .muted { font-size: 0.82rem; }
.solo-destaques .track-row.mini:last-child { margin-bottom: 0; }
@media (max-width: 820px) {
  .solo-topo.com-destaques { grid-template-columns: minmax(0, 1fr); }
  .track-row.grande .thumb { height: clamp(100px, 32vw, 170px); }
}

/* ======================================================================================================================
   [beta 0.98] Abas coladas ao painel. O `gap` de 14 px do .screen deixava a aba solta, flutuando acima do cartão: a margem negativa
   agora desconta o gap e as abas inativas param na borda do painel (a ativa cobre a borda e "abre" para o conteúdo).
   ====================================================================================================================== */
.tabs { align-items: flex-end; }
.screen > .tabs { margin: 0 0 -17px 14px; flex: none; }
.tab { white-space: nowrap; }
.tab:not(.on):hover { background: var(--papel); }
@media (max-width: 720px) {
  /* uma fileira só, que rola de lado: abas quebradas em duas linhas ficariam com a de baixo longe do painel */
  .screen > .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; margin: 0 0 -17px 6px; flex: none; min-height: 44px; padding-right: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .screen > .tabs::-webkit-scrollbar { display: none; }
  .screen > .tabs .tab { flex: none; }
  .compete-screen .tabs { margin-left: 6px; }
}

/* ======================================================================================================================
   [beta 0.98] Amigos (inspirado no Among Us): três botões grandes no alto, painel da ação escolhida e a lista de amigas embaixo
   ====================================================================================================================== */
.amigos-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.seg-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 12px 8px; cursor: pointer;
  border: 0; border-radius: var(--r-md); background: var(--papel); color: var(--tinta); font: 800 1.05rem var(--f-title);
  box-shadow: 0 4px 0 var(--terra-d), inset 0 0 0 2.5px var(--terra-d); }
.seg-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--terra-d), inset 0 0 0 2.5px var(--terra-d); }
.seg-btn.on { background: var(--pista); color: var(--branco); box-shadow: 0 4px 0 #000, inset 0 0 0 2.5px var(--pista); }
.seg-n { font: 800 0.78rem/1 var(--f-text); font-style: normal; min-width: 20px; padding: 4px 6px 3px; border-radius: 999px; background: var(--grade); color: var(--branco); text-align: center; }
.amigos-painel { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--branco); box-shadow: inset 0 0 0 2px var(--papel-2); }
.amigos-painel h3 { margin: 4px 0 8px; }
.amigos-painel h3:not(:first-child) { margin-top: 14px; }
.amigos-titulo { margin: 6px 0 8px; }
.mini-row.amiga { gap: 10px; flex-wrap: wrap; }
.amiga-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.amiga-info b { overflow-wrap: anywhere; }
.amiga-acts { justify-content: flex-end; }
.ok-txt { color: #36561a; font-weight: 800; }
.avatar.presenca { position: relative; }
.avatar.presenca::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--branco); background: #9a8f80; }
.avatar.presenca.on::after { background: #4aa63a; }
@media (max-width: 560px) {
  .amigos-seg { gap: 6px; }
  .seg-btn { flex-direction: column; gap: 2px; padding: 8px 4px 6px; font-size: 0.9rem; min-height: 56px; }
  .seg-n { position: absolute; top: 4px; right: 6px; }
  .amiga-acts { width: 100%; justify-content: stretch; }
  .amiga-acts .btn { flex: 1; justify-content: center; }
}

/* [beta 1.02] Customizar: painel à esquerda, capivara no espaço livre à direita, com botões de girar.
   `.screen.cust-screen` (mais específico) vence as regras `.screen { max-width }` das telas largas, que deixavam o painel cobrir o palco. */
:root { --cust-w: 100vw; }
@media (min-width: 761px) {
  :root { --cust-w: min(clamp(600px, 50vw, 940px), 100vw); }
  .screen.cust-screen { max-width: var(--cust-w); }
}
.cust-rot { position: fixed; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: center; pointer-events: none;
  left: var(--cust-w); right: 0; bottom: calc(24px + var(--safe-b, 0px)); }
.cust-rot .rot-btn { pointer-events: auto; min-width: 56px; min-height: 56px; padding: 0 18px; font-size: 1.5rem; line-height: 1; touch-action: none; user-select: none; }
.cust-rot .rot-front { font-size: 1.05rem; }
@media (max-width: 760px) {
  /* tela estreita: as setas ladeiam a capivara, na altura do meio do espaço livre (--cust-mid vem do palco) */
  .cust-rot { left: 0; right: 0; bottom: auto; top: var(--cust-mid, 28vh); transform: translateY(-50%); justify-content: space-between; padding: 0 10px; }
  .cust-rot .rot-btn { min-width: 52px; min-height: 52px; padding: 0 14px; }
  .cust-rot .rot-front { display: none; }
}

/* [beta 1.03] sininho de notificações no Menu */
.home-top .bell { position: relative; margin-left: auto; min-width: 48px; min-height: 48px; padding: 0 12px; border-radius: 999px; }
.home-top .bell + .wallet { margin-left: 0; }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--sol, #e8973a); color: #fff; font: 800 0.8rem/22px var(--f-text); text-align: center; border: 2px solid var(--terra-d, #5a3720); }
.bell-badge[hidden] { display: none; }
.notif-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.notif { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--branco, #fff); box-shadow: inset 0 0 0 2px var(--papel-2, #eee); }
.notif.nova { box-shadow: inset 0 0 0 3px var(--sol, #e8973a); background: #fff6e6; }
.notif-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--papel-2, #f1e4cc); }
.notif-txt { display: grid; gap: 2px; min-width: 0; }
.notif-txt b { font: 800 1rem/1.15 var(--f-title); }
.notif-txt small { color: var(--tinta-2); font-weight: 700; }
.notif time { font-size: 0.78rem; color: var(--tinta-2); font-weight: 700; white-space: nowrap; }

/* [beta 1.04] filtro de pistas por tag */
.pf { display: grid; gap: 10px; }
.pf-topo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pf-busca { min-width: 0; }
.pf-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-conta { font-weight: 800; font-size: 0.92rem; }
.pf-limpa { border: 0; background: none; color: #a3302a; font: 800 0.92rem var(--f-text); text-decoration: underline; cursor: pointer; min-height: 40px; padding: 0 6px; }
.pf-rapidos { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pf-rapidos[hidden], .pf-painel[hidden] { display: none; }
.pf .chip { min-height: 40px; flex: none; }
.pf .chip b { font-weight: 800; font-size: 0.78rem; opacity: 0.75; }
.pf .chip.zero { opacity: 0.5; box-shadow: inset 0 0 0 2px var(--papel-2, #d9c7a0); border-style: dashed; }
.pf-painel { display: grid; gap: 10px; background: var(--papel-2, #f6ebd3); border-radius: 14px; padding: 12px; }
.pf-grupo, .pf-opcoes { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: center; }
.pf-opcoes { grid-template-columns: 84px minmax(0, 1fr) 84px minmax(0, 1fr); }
.pf-rot { font: 900 0.78rem var(--f-text); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tinta-2); }
.pf-lista { display: grid; gap: 10px; }
.pf-vazio { padding: 14px; text-align: center; }
@media (max-width: 700px) {
  .pf-topo { grid-template-columns: 1fr; }
  .pf-grupo, .pf-opcoes { grid-template-columns: 1fr; gap: 4px; }
  .pf .chips { flex-wrap: wrap; }
  .pf-rapidos { flex-wrap: nowrap; }
}

/* [beta 1.08] Desafio da semana definido na Oficina */
.ticket-prize { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--terra-d); margin: 4px 0; }
.ticket .btn.ghost { margin-top: 8px; }
.desafio-card { background: var(--branco); border: 3px solid var(--terra-d); border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; }
.desafio-card h3 { margin: 0 0 2px; display: flex; align-items: center; gap: 6px; }
.desafio-premios { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.desafio-premios li { font-size: 0.92rem; }

/* [beta 1.11] mini mapa (esquerda, não captura toques) */
.minimap { position: absolute; left: calc(10px + env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); background: rgba(40,28,18,.55); border-radius: 12px; box-shadow: 0 0 0 2px rgba(255,255,255,.55), 0 3px 0 rgba(0,0,0,.25); pointer-events: none; opacity: .92; z-index: 2; }
.minimap canvas { position: absolute; left: 0; top: 0; }
@media (max-width: 600px) { .minimap { top: 44%; opacity: .85; } }

/* [beta 1.12] abaixo do cartão da fase: a posição exata vem do minimap.js (top/left) */
.minimap { top: 92px; left: calc(16px + env(safe-area-inset-left)); transform: none; }
@media (max-width: 600px) { .minimap { top: 84px; left: calc(10px + env(safe-area-inset-left)); } }

/* [beta 1.16] Provar no celular */
.item.trying { box-shadow: inset 0 0 0 3px var(--laranja, #e8973a), 0 3px 0 var(--terra-d); background: #fff1d6; }
.item.trying .price { color: #a04f00; font-weight: 800; }
.tab { white-space: nowrap; }
.trial-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--papel); border-top: 3px solid var(--terra-d); box-shadow: 0 -4px 14px rgba(0,0,0,.25); }
.trial-bar[hidden] { display: none; }
.trial-info { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.trial-info span { font-size: .9rem; opacity: .85; }
.trial-list .trial-row { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid rgba(0,0,0,.1); }
.trial-list .grow { margin-left: auto; }
.trial-list .bad { color: #b3261e; font-weight: 700; }
.cust-screen .panel.cust { padding-bottom: 110px; }

/* [beta 1.17] medidor de força em arco */
.force-arc { position: absolute; left: 0; top: 0; width: 200px; height: 200px; transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 3; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.force-arc.show { opacity: 1; }
.force-arc svg { position: absolute; left: 0; top: 0; }
.force-arc .fa-pill { position: absolute; left: 172px; top: 100px; transform: translateY(-50%); min-width: 54px; text-align: center; background: #fff; border: 3px solid #6a4a2a; border-radius: 12px; padding: 1px 8px; font: 900 20px/1.25 var(--f-title, system-ui); box-shadow: 0 3px 0 #6a4a2a; }
.force-arc .fa-pill:before { content: ""; position: absolute; left: -10px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-right: 7px solid #6a4a2a; }

/* [beta 1.18] Customizar: barra de ordem (menor preço, maior preço, raridade) */
.ord-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.ord-bar > .muted { font: 700 0.85rem var(--f-text); margin-right: 2px; }
.ord-bar .chip { padding: 6px 10px; min-height: 40px; font-size: .85rem; }
.rar-titulo { margin: 14px 0 8px; font: 800 0.95rem var(--f-text); display: flex; align-items: baseline; gap: 6px; }
.rar-titulo small { font-weight: 600; opacity: .7; }
.cust-grade .rar-titulo:first-child { margin-top: 2px; }

/* [beta 1.18] Janela única de convites para o lobby */
.conv-lista { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.conv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.05); }
.conv-txt { display: grid; gap: 2px; min-width: 0; }
.conv.exp { opacity: .65; }

/* [beta 1.22] Reações: botão "Emojis" na barra (ao lado da Mira assistida) com anel de intervalo, e roda de 4 */
.hud-tools .rea-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; font-weight: 700; touch-action: none; }
.rea-face { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; padding: 3px; box-sizing: border-box;
  background: conic-gradient(rgba(60, 40, 25, .6) var(--rea-p, 0deg), rgba(243, 227, 195, .9) 0); }
.rea-face img { width: 100%; height: 100%; pointer-events: none; border-radius: 50%; } .rea-btn.espera .rea-face img { filter: grayscale(.7) opacity(.7); }
.rea-btn.treme { animation: rea-treme .35s; } @keyframes rea-treme { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (max-width: 700px) { .hud-tools .rea-btn { font-size: .8rem; padding: 6px 10px 6px 6px; gap: 6px; } }
.rea-roda { position: absolute; inset: 0; z-index: 40; pointer-events: auto; touch-action: none; }
.rea-fundo { position: absolute; inset: 0; background: rgba(40, 25, 12, .28); }
.rea-anel { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }   /* o JS posiciona logo acima do botão Emojis */
.rea-op { position: absolute; width: 66px; height: 66px; margin: -33px 0 0 -33px; border-radius: 50%; border: 0; padding: 3px; background: var(--papel); cursor: pointer; touch-action: none;
  box-shadow: inset 0 0 0 2.5px var(--terra-d), 0 4px 0 var(--terra-d); transition: transform .12s; animation: rea-pop .18s backwards; }
.rea-op img { width: 100%; height: 100%; pointer-events: none; }
.rea-op.sel, .rea-op:hover, .rea-op:focus-visible { transform: scale(1.18); background: var(--pista); outline: none; }
.rea-cima { left: 0; top: -78px; } .rea-direita { left: 78px; top: 0; } .rea-baixo { left: 0; top: 78px; } .rea-esquerda { left: -78px; top: 0; }
@keyframes rea-pop { from { transform: scale(.3); opacity: 0; } }
.rea-centro { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; background: rgba(243, 227, 195, .9); display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--terra-d); pointer-events: none; }
.rea-ver { position: absolute; left: -100px; top: -150px; width: 200px; text-align: center; border: 0; border-radius: 999px; padding: 9px 12px; font-size: .85rem; font-weight: 800; cursor: pointer; background: #cfe8c4; color: #1d5a2b; box-shadow: inset 0 0 0 2px #2f7a46; }
.rea-ver.off { background: #f4c9bd; color: #8a2a1a; box-shadow: inset 0 0 0 2px #b3402b; }
@media (prefers-reduced-motion: reduce) { .rea-op, .rea-btn.treme { animation: none; } }

/* ===== [beta 1.32] selos de dificuldade e da Escola; Escola da Capivara ===== */
.selo { display: inline-flex; align-items: center; gap: 5px; border: 2px solid var(--tinta); border-radius: 12px; padding: 1px 9px 1px 4px; background: #fff; font: 800 12px/1.5 var(--f-text); color: var(--tinta); white-space: nowrap; vertical-align: middle; }
.selo-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--tinta); background: #a49a88; display: inline-block; }
.selo-muito-facil .selo-dot { background: #4f9a54; } .selo-facil .selo-dot { background: #7cad4c; } .selo-medio .selo-dot { background: #e8973a; }
.selo-dificil .selo-dot { background: #d6423a; } .selo-expert .selo-dot { background: #4a2b6b; }
.selo-formada .selo-dot { background: #f2c230; } .selo-andamento .selo-dot { background: #7cad4c; } .selo-novo .selo-dot { background: #a49a88; }
.selos { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: 8px; }
.mini-row.amiga .selos { flex: 0 1 auto; }
.escola-card { max-width: 520px; margin: 6vh auto 0; text-align: center; padding: 28px 30px 24px; border: 3px solid var(--tinta); position: relative; }
.escola-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: var(--stripe); border-radius: 8px 8px 0 0; }
.escola-cap { display: flex; justify-content: center; margin: 8px 0 4px; }
.escola-pecas { justify-content: center; margin: 10px 0 18px; }
.chip.static { cursor: default; pointer-events: none; }
.escola-acts { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.link-btn { background: none; border: none; color: var(--tinta-2); text-decoration: underline; font: 700 15px var(--f-text); padding: 8px; cursor: pointer; }
.escola-bloco { margin: 12px 0; } .escola-dots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.escola-dot { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #c9b07a; background: var(--papel-2); font: 800 14px var(--f-text); color: var(--tinta-2); cursor: pointer; }
.escola-dot.on { background: #4f9a54; border-color: #2b6b30; color: #fff; } .escola-dot.cur { background: #f2c230; border-color: #9b7508; color: var(--tinta); }
.escola-screen .escola-acts { flex-direction: row; justify-content: flex-start; margin-top: 16px; gap: 10px; }
.escola-priv { display: block; margin-top: 18px; font-size: 14px; color: var(--tinta-2); }
.tut-card { position: absolute; left: 380px; right: 90px; top: 14px; max-width: 560px; background: var(--papel); border: 3px solid var(--tinta); border-radius: 16px; padding: 10px 14px; box-shadow: 0 4px 0 #0004; pointer-events: auto; z-index: 3; }
.tut-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px; background: var(--stripe); border-radius: 12px 12px 0 0; }
.tut-topo { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 4px; } .tut-n { font: 800 12px var(--f-text); color: var(--tinta-2); text-transform: uppercase; letter-spacing: .04em; }
.tut-novo { font-size: 13px; color: var(--tinta-2); } .tut-dica { margin: 6px 0 0; font-size: 14px; background: #fff3c4; border-radius: 10px; padding: 5px 9px; }
.tut-pula { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 14px; }
@media (max-width: 900px) { .tut-card { left: 12px; right: 12px; top: 120px; max-width: none; } }
.mini-row.amiga > .avatar { flex: none; }   /* o avatar não estica (a regra .mini-row > span:first-child deixava ele oval) */

/* ===== [beta 1.33] Amigos no estilo do mockup ===== */
.amigos-filtros { margin: 8px 0 12px; }
.amigos-lista { display: grid; gap: 8px; }
.amigo { display: flex; align-items: center; gap: 12px; background: var(--papel-2); border-radius: 14px; padding: 9px 12px; flex-wrap: wrap; }
.amigo-av { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--tinta); background: radial-gradient(circle at 40% 35%, #d9a066, var(--terra)); display: grid; place-items: center; font: 800 1.1rem var(--f-title); color: var(--branco); text-shadow: 0 1px 0 #0006; }
.amigo-av i { position: absolute; right: -4px; bottom: -4px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--papel-2); background: #a49a88; }
.amigo-av.presenca-on i { background: #4aa63a; } .amigo-av.presenca-lobby i { background: var(--tape, #f2c230); }
.amigo-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; flex: 1 1 140px; }
.amigo-info b { font: 800 1.05rem var(--f-title); overflow-wrap: anywhere; } .amigo-info small { font-size: 13px; }
.amigo .selos { margin-left: 0; flex: 0 1 auto; }
.amigo-acts { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.btn.icon-only { padding-left: 10px; padding-right: 10px; }
@media (max-width: 560px) { .amigo .selos { order: 3; width: 100%; } .amigo-acts { order: 2; } }

/* [beta 1.34] convite alinhado ao menu (desktop: à esquerda, capivara à vista; celular: cartão compacto embaixo) */
.escola-convite { justify-content: flex-start; }
@media (min-width: 761px) { .escola-convite .escola-card { margin: 12vh 0 0; width: min(400px, 100%); max-width: 400px; padding: 24px 24px 20px; } .escola-convite .escola-pecas { justify-content: center; } }
@media (max-width: 760px) {
  .escola-convite { justify-content: flex-end; }
  .escola-convite .escola-card { margin: 0; padding: 22px 16px 14px; }
  .escola-convite .escola-card h2 { font-size: 1.3rem; }
  .escola-convite .escola-pecas, .escola-convite .escola-cap { display: none; }
}
/* quem sou eu: nome vira botão para a Escola; "?" explica o menu */
button.who { font: inherit; color: inherit; cursor: pointer; text-align: left; }
button.who:hover { filter: brightness(1.04); }
.help-btn { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--terra-d); background: var(--papel); font: 800 1.2rem var(--f-title); color: var(--tinta); cursor: pointer; box-shadow: 0 3px 0 var(--terra-d); }
.guia { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.guia-hl { position: fixed; border: 3px solid #f2c230; border-radius: 12px; box-shadow: 0 0 0 4px rgba(242,194,48,.45), 0 0 0 9999px rgba(30,20,10,.35); animation: guiaPulse 1.2s ease-in-out infinite; }
.guia-card { position: fixed; pointer-events: auto; background: var(--papel); border: 3px solid var(--tinta); border-radius: 12px; padding: 12px 14px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.guia-card.cue { background: #fff6d6; }
.guia-card b { font: 800 1.05rem var(--f-title); display: block; }
.guia-card p { margin: 4px 0 8px; font-weight: 700; color: var(--tinta-2); }
.guia-acts { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@keyframes guiaPulse { 50% { box-shadow: 0 0 0 7px rgba(242,194,48,.25), 0 0 0 9999px rgba(30,20,10,.35); } }
@media (prefers-reduced-motion: reduce) { .guia-hl { animation: none; } }

/* [beta 1.35] Faixa de anúncio no Menu (Oficina › Avisos) e link de alerta no sininho */
.anuncio { display: flex; align-items: center; gap: 10px; background: var(--papel); border: 3px solid var(--tinta); border-radius: 12px; padding: 6px 8px 6px 10px; box-shadow: 0 3px 0 rgba(0,0,0,.25); max-width: 720px; }
.anuncio-tipo { background: var(--tape); border: 2px solid var(--tinta); border-radius: 999px; padding: 1px 9px; font: 800 0.75rem var(--f-title); white-space: nowrap; }
.anuncio.pesquisa .anuncio-tipo { background: #9fd8d3; } .anuncio.promocao .anuncio-tipo { background: #f4a79a; }
.anuncio-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.anuncio-txt b { font: 800 0.98rem var(--f-title); } .anuncio-txt small { color: var(--tinta-2); font-weight: 700; }
.anuncio .btn.small { white-space: nowrap; text-decoration: none; }
.anuncio-x { border: 0; background: transparent; font: 800 1.4rem/1 var(--f-title); color: var(--tinta-2); cursor: pointer; padding: 0 6px; }
.notif-link { display: inline-block; margin-top: 2px; font-weight: 800; color: var(--rio); }
@media (max-width: 760px) { .anuncio { max-width: none; flex-wrap: wrap; } .anuncio-txt { flex-basis: 60%; } }

/* [beta 1.37] Sala do lobby: cabeçalho de informações, Turma no estilo Amigos, criação enxuta */
.lb-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0 0 10px; }
.lb-info-item { background: var(--papel-2); border-radius: 12px; padding: 7px 11px; display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.lb-info-item b { font: 800 1.05rem var(--f-title); overflow-wrap: anywhere; }
.lb-membros { display: grid; gap: 8px; }
.lb-membros h3 { margin: 0 0 2px; }
.lb-membro.amigo { flex-wrap: wrap; }
.lb-novo .campos { display: grid; gap: 12px; }
.lb-pub-row .grow { flex: 1; }

/* [beta 1.38] Cadastro: Termos com rolagem; tela de conta bloqueada */
.reg-remoto { max-width: 520px; }
.termos-box { max-height: min(42vh, 360px); overflow-y: auto; padding: 10px 14px; background: var(--branco, #fff); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--papel-2); text-align: left; margin: 4px 0 10px; }
.termos-box h3 { margin: 4px 0 2px; } .termos-box h4 { margin: 12px 0 4px; font: 800 0.98rem var(--f-title); } .termos-box p { margin: 0 0 6px; font-size: 14px; line-height: 1.4; }
.termos-ok { gap: 10px; align-items: flex-start; font-size: 14px; } .termos-ok input { margin-top: 3px; flex: none; }
.bloqueio h2 { margin-top: 0; }
.termos-ok { flex-wrap: nowrap; } .termos-ok span { flex: 1; }
@media (max-width: 700px) { .termos-box { max-height: 28vh; } .auth-card.reg-remoto { max-height: calc(100dvh - 16px); overflow-y: auto; } }
.doc-rodape { margin-top: 14px; font-size: 13px; } .termos-leitura { max-height: 40vh; overflow: auto; padding: 4px 2px; }

/* ---------- [beta 1.43] editor de pistas: celular ----------
   Computador: .ed-headbox/.ed-body/.ed-sec somem como caixa (display: contents) e as abas/faixa de seleção/“Mais” ficam escondidas.
   Celular (largura até 760 px, ou altura até 540 px, que pega o celular deitado): topo fino, folha com abas embaixo (recolhível),
   faixa da peça selecionada e barra de ações de uma linha. Em pé a folha fica embaixo; deitado ela vai para a direita. */
.ed-body, .ed-sec { display: contents; }
.ed-headbox { display: block; position: sticky; top: -16px; z-index: 3; background: var(--papel); margin: -16px -16px 0; padding: 16px 16px 4px; border-radius: 18px 18px 0 0; }   /* [beta 1.53] computador: nome e par ficam fixos no topo do painel que rola */
.ed-tabs, .ed-sel, .ed-more { display: none; }
@media (max-width: 760px), (max-height: 540px) {
  .editor { --ed-bar: calc(58px + var(--safe-b, 0px)); --ed-sheet: 38vh; }
  .editor.min { --ed-sheet: 52px; }
  .editor > * { pointer-events: auto; }
  .ed-headbox { margin: 0; display: flex; align-items: center; gap: 8px; position: absolute; top: calc(8px + var(--safe-t, 0px)); left: calc(8px + var(--safe-l, 0px)); right: calc(8px + var(--safe-r, 0px));
    padding: 6px 8px; background: var(--papel); border: 3px solid var(--terra-d); border-radius: 16px; box-shadow: 0 4px 0 var(--terra-d); }
  .ed-headbox .ed-head h2, .ed-headbox .ed-lbl-txt { display: none; }
  .ed-headbox .ed-head { flex: none; }
  .ed-headbox label.lbl { flex: 1; margin: 0; min-width: 0; }
  .ed-headbox .field { padding: 6px 10px; font-size: 1rem; }
  .ed-headbox .ed-par { margin: 0; gap: 6px; flex: none; }
  .ed-headbox .ed-par > span:first-child { display: none; }
  .ed-headbox .ed-par b { font-size: 1.2rem; }
  .ed-headbox .ed-par .muted { display: none; }
  .ed-side { top: auto; left: calc(8px + var(--safe-l, 0px)); right: calc(8px + var(--safe-r, 0px)); width: auto; bottom: calc(var(--ed-bar) + 14px); height: var(--ed-sheet);
    padding: 8px 10px; gap: 6px; overflow: hidden; }
  .ed-tabs { display: flex; gap: 6px; flex: none; align-items: center; }
  .ed-tabs .chip { flex: 1; justify-content: center; padding: 6px 8px; }
  .ed-tabs .ed-fold { flex: none; }
  .editor.min .ed-fold svg { transform: rotate(180deg); }
  .ed-body { display: block; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .editor.min .ed-body { display: none; }
  .ed-sec { display: none; }
  .ed-side[data-tab="pecas"] .ed-sec-pecas, .ed-side[data-tab="ajustes"] .ed-sec-ajustes, .ed-side[data-tab="lista"] .ed-sec-lista { display: block; }
  .ed-sec .lbl { margin: 2px 0 4px; font-size: .85rem; }
  .ed-palette { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
  .ed-palette .piece { padding: 10px 2px 8px; }
  .ed-list { min-height: 0; max-height: none; overflow: visible; }
  .ed-item { min-height: 42px; }
  .ed-rails { margin: 0; }
  .ed-msg { font-size: .8rem; padding: 6px 8px; margin-top: 6px; }
  .ed-sel { display: flex; align-items: center; gap: 8px; position: absolute; left: calc(8px + var(--safe-l, 0px)); right: calc(8px + var(--safe-r, 0px)); bottom: calc(var(--ed-bar) + var(--ed-sheet) + 26px);
    padding: 6px 8px; border-radius: 16px; box-shadow: 0 4px 0 var(--terra-d); }
  .ed-sel-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
  .ed-sel-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ed-sel-txt small { font-size: .7rem; }
  .ed-sel-tirar { flex: none; }
  .ed-bar { left: calc(8px + var(--safe-l, 0px)); right: calc(8px + var(--safe-r, 0px)); bottom: calc(6px + var(--safe-b, 0px)); flex-wrap: nowrap; gap: 6px; padding: 6px; }
  .ed-bar .btn { flex: 1; justify-content: center; padding: 8px 6px 6px; font-size: .85rem; min-width: 0; gap: 4px; }
  .ed-bar .ed-sec2 { display: none; }
  .ed-more { display: inline-flex; }
}
/* celular deitado: folha à direita, o resto livre para ver a pista.
   [beta 1.53] min-width: com o teclado aberto, o celular EM PÉ fica mais baixo que largo e parecia "deitado": o topo encolhia e o nome da pista sumia. */
@media (max-height: 540px) and (min-width: 560px) and (orientation: landscape) {
  .editor { --ed-sheet: auto; }
  .ed-headbox { right: calc(50vw + 4px); }
  .ed-side { top: calc(8px + var(--safe-t, 0px)); left: auto; right: calc(8px + var(--safe-r, 0px)); width: calc(48vw - 12px); height: auto; bottom: calc(8px + var(--safe-b, 0px)); }
  .editor.min .ed-side { top: auto; bottom: calc(8px + var(--safe-b, 0px)); }
  .ed-sel { right: calc(50vw + 4px); bottom: calc(var(--ed-bar) + 14px); }
  .ed-bar { right: calc(50vw + 4px); }
}
.note:empty { display: none; }   /* [beta 1.45] avisos de status vazios não ocupam espaço */
.btn.danger:not(:disabled) { color: #fff; }   /* [beta 1.45] texto legível sobre o vermelho */

.faixa-manut { position: fixed; top: 0; left: 0; right: 0; z-index: 60; padding: 6px 12px; text-align: center; font-weight: 700; background: #ffd25e; color: #4a3200; border-bottom: 2px solid #8a5d00; }   /* [beta 1.46] aviso prévio de manutenção */

/* [beta 1.49] idiomas: tela de primeira abertura e fontes para o chinês */
.idioma-back { position: fixed; inset: 0; z-index: 200; background: rgba(29, 32, 30, 0.72); display: grid; place-items: center; padding: 16px; }
.idioma-box { width: min(440px, 100%); background: var(--papel); border: 3px solid var(--terra-d); border-radius: var(--r-lg); box-shadow: 0 8px 0 var(--terra-d); padding: 22px; text-align: center; max-height: 92vh; overflow: auto; }
.idioma-sub { margin: 6px 0 14px; color: var(--tinta); opacity: .75; font-size: .92rem; }
.idioma-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.idioma-op { min-height: 54px; font-size: 1.15rem; }
html[lang^="zh"] body, html[lang^="zh"] .btn, html[lang^="zh"] h1, html[lang^="zh"] h2, html[lang^="zh"] h3 { font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', system-ui, sans-serif; }

/* [beta 1.52] Espectador do CapiCaos */
.spec-bar { position: absolute; top: calc(64px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 5; }
.spec-bar[hidden] { display: none; }
.spec-bar .spec-t { white-space: nowrap; background: var(--papel); border-radius: 999px; padding: 6px 16px; font-weight: 800; box-shadow: inset 0 0 0 2.5px var(--terra-d), 0 3px 0 var(--terra-d); }
.spec-bar .spec-sel { display: flex; gap: 8px; align-items: center; background: var(--papel); border-radius: 999px; padding: 3px 6px; box-shadow: 0 3px 0 var(--terra-d); }
.spec-bar .spec-sel button { pointer-events: auto; padding: 6px 12px; }

/* [beta 1.53] celular em pé: o aviso do espectador vai para a direita, longe do minimapa e do cartão da partida */
@media (max-width: 760px) and (orientation: portrait) {
  .spec-bar { left: auto; right: calc(8px + var(--safe-r, 0px)); transform: none; top: calc(72px + env(safe-area-inset-top)); align-items: flex-end; }
  .spec-bar .spec-t { font-size: .85rem; padding: 4px 12px; }
}

/* ---------- [beta 1.53] rolagem mais agradável e alvos de toque ---------- */
/* barras no tema (finas, cor de terra, só onde há rolagem); a opção "none" das abas do celular continua valendo mais abaixo */
html { scrollbar-width: thin; scrollbar-color: var(--terra) transparent; }
@supports not (scrollbar-width: thin) {
  ::-webkit-scrollbar { width: 9px; height: 9px; }
  ::-webkit-scrollbar-thumb { background: var(--terra); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-track { background: transparent; }
}
/* faixa que rola de lado: esmaece a borda onde ainda há conteúdo (CapiRola marca data-rola) */
[data-rola="r"]  { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
[data-rola="l"]  { -webkit-mask-image: linear-gradient(to left,  #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left,  #000 calc(100% - 28px), transparent); }
[data-rola="lr"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.tabs, .pf-rapidos, .ed-tabs { scroll-snap-type: x proximity; }
.tabs > *, .pf-rapidos > *, .ed-tabs > * { scroll-snap-align: center; }
/* caixas e controles não encolhem dentro de linhas apertadas; deslizantes mais fáceis de pegar com o dedo */
.toggle input, .escola-priv input, label > input[type="checkbox"], label > input[type="radio"] { flex: none; min-width: 22px; min-height: 22px; }
input[type="range"] { min-height: 28px; touch-action: pan-y; }
@media (pointer: coarse) { .toggle, label.escola-priv { min-height: 44px; align-items: center; } }
/* área baixa (celular com teclado ou deitado): a dica de início não passa da tela */
@media (max-height: 420px) { .hint { max-height: calc(100vh - 140px); overflow: auto; padding: 6px 12px; } .hint b { font-size: 1rem; } .hint span { font-size: .8rem; } }
/* [beta 1.54] computador com pouca altura: o topo fixo do editor perde o título e o rótulo "Nome" para sobrar espaço às peças */
@media (min-width: 761px) and (min-height: 541px) and (max-height: 820px) {
  .ed-headbox .ed-head h2, .ed-headbox .ed-lbl-txt { display: none; }
  .ed-headbox .ed-par { margin: 6px 0 0; }
}
