:root {
  --ink: #1d1240;
  --panel: rgba(32, 18, 72, .84);
  --panel-l: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .18);
  --cream: #fff8ec;
  --muted: #cfc6ee;
  --gold: #ffd23f;
  --gold-d: #b8860b;
  --ok: #3ddc84;
  --bad: #ff5d5d;
  --accent: #ffd23f;
  --accent2: #1fa45b;
  --sky1: #2fb6f0;
  --sky2: #bdf0ff;
  --font: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --display: "Lilita One", "Fredoka", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: linear-gradient(var(--sky1), var(--sky2)); color: var(--cream); font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.center-text { text-align: center; }

.screen { position: fixed; inset: 0; z-index: 30; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.center { display: flex; align-items: center; justify-content: center; padding: 16px; }
#loading { background: radial-gradient(ellipse at 50% 30%, #6a3fc4, #22104e 70%); z-index: 90; }
.load-box { text-align: center; }
.load-icon { font-size: 4.5rem; animation: spin 1.6s ease-in-out infinite; }
@keyframes spin { 50% { transform: rotate(180deg) scale(1.15); } 100% { transform: rotate(360deg); } }
.error { color: #ffb3a6; margin-top: 10px; }

/* ---------- botões e campos ---------- */
.btn { appearance: none; border: 0; cursor: pointer; font-weight: 700; font-size: 1.05rem; color: #3a2606; padding: 12px 22px; border-radius: 16px; background: linear-gradient(#ffe777, #ffbf1f); box-shadow: 0 5px 0 var(--gold-d), 0 12px 24px rgba(0, 0, 0, .22); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-d); }
.btn:disabled { filter: grayscale(.7); opacity: .6; cursor: not-allowed; transform: none; }
.btn.big { width: 100%; font-size: 1.35rem; padding: 15px; margin-top: 16px; }
.btn.alt { background: linear-gradient(#7fe0ff, #2fa8e8); color: #06263d; box-shadow: 0 5px 0 #1a6c99, 0 12px 24px rgba(0, 0, 0, .22); }
.btn.ghost { background: rgba(32, 18, 72, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--cream); border: 1.5px solid var(--line); box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.btn.ghost.on { background: var(--ok); color: #053a1c; border-color: transparent; }
.btn.small { font-size: .9rem; padding: 9px 14px; border-radius: 13px; }
.link { background: none; border: 0; color: var(--gold); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link.tiny { font-size: .9rem; opacity: .85; margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.center-row { justify-content: center; margin-top: 16px; }
.round { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 1.1rem; font-weight: 700; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.round.txt { font-size: 1.15rem; }
.round:active { transform: scale(.94); }
.warn { color: #ffc2b8; text-align: center; margin-top: 12px; font-weight: 600; }
.hint { color: var(--muted); font-size: .95rem; line-height: 1.4; margin: 10px 0; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 13px; border-radius: 9px; font-weight: 700; cursor: pointer; font-size: .92rem; min-width: 38px; }
.seg button.on { background: var(--gold); color: #3a2606; }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: .95rem; color: var(--muted); margin-top: 16px; }
.field input, .join-row input, .opt input[type=number] { font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .1); color: var(--cream); outline: none; user-select: text; -webkit-user-select: text; min-width: 0; }
.field input:focus, .join-row input:focus { border-color: var(--gold); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-weight: 600; color: var(--muted); }
.opt input[type=number] { width: 110px; text-align: center; }
.opt input[type=range] { flex: 1; max-width: 240px; accent-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 14px; color: var(--muted); font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); }
.card { background: var(--panel); border: 1.5px solid var(--line); border-radius: 26px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 18px 50px rgba(20, 8, 50, .45), inset 0 1px 0 rgba(255, 255, 255, .08); padding: 22px; }
.kicker { letter-spacing: 3px; font-size: .78rem; color: var(--gold); font-weight: 700; text-transform: uppercase; }

/* ---------- menu ---------- */
#menu { background: linear-gradient(180deg, rgba(29, 18, 64, .3), rgba(29, 18, 64, 0) 40%, rgba(29, 18, 64, .6)); }
.menu-wrap { width: min(1040px, 100%); margin: 0 auto; padding: calc(22px + var(--safe-t)) 16px calc(30px + var(--safe-b)); }
.menu-wrap.narrowish { width: min(720px, 100%); }
#menu .menu-wrap { min-height: 100%; display: flex; flex-direction: column; }
.logo { text-align: center; text-shadow: 0 4px 22px rgba(20, 8, 60, .55); }
.logo-kicker { letter-spacing: 3px; font-size: .78rem; color: #fff; font-weight: 700; opacity: .9; }
.logo h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 9vw, 5.2rem); line-height: .95; margin: 8px 0 10px; letter-spacing: 1px; }
.logo h1 em { font-style: normal; color: var(--gold); display: inline-block; transform: rotate(-3deg); -webkit-text-stroke: 1px rgba(80, 40, 0, .25); }
.tagline { max-width: 560px; margin: 0 auto; font-size: 1.05rem; line-height: 1.4; font-weight: 500; }
.modes { margin-top: auto; padding-top: 30vh; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mode { border: 2px solid rgba(255, 255, 255, .25); background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 24px; padding: 18px 16px; cursor: pointer; text-align: left; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(20, 8, 50, .35); transition: transform .15s, border-color .15s; }
.mode:hover { transform: translateY(-4px) rotate(-.5deg); border-color: var(--gold); }
.mode-ico { grid-row: span 2; font-size: 2.6rem; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }
.mode b { font-family: var(--display); font-weight: 400; font-size: 1.55rem; letter-spacing: .5px; color: var(--gold); }
.mode small { font-size: .9rem; color: var(--muted); line-height: 1.3; }
.menu-row { justify-content: center; margin-top: 18px; }
.back-link { display: block; text-align: center; margin-top: 14px; color: #fff; opacity: .8; font-size: .9rem; text-decoration: none; }

/* ---------- configuração ---------- */
#setup { background: rgba(29, 18, 64, .45); }
.setup-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.setup-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.8rem; text-shadow: 0 3px 12px rgba(0, 0, 0, .4); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.theme { border: 2px solid transparent; border-radius: 16px; padding: 10px 8px 9px; cursor: pointer; background: linear-gradient(160deg, var(--a), var(--b)); color: #1d1240; display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); transition: transform .12s; }
.theme:hover { transform: translateY(-2px); }
.theme.on { border-color: #fff; box-shadow: 0 0 0 3px var(--gold), 0 4px 0 rgba(0, 0, 0, .25); transform: scale(1.04); }
.th-flag { font-size: 1.8rem; line-height: 1.1; }
.theme b { font-size: .92rem; line-height: 1.1; text-align: center; }
.theme small { font-size: .72rem; opacity: .75; font-weight: 600; }
.formats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.formats button { border: 2px solid var(--line); background: rgba(255, 255, 255, .08); border-radius: 18px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.formats button.on { border-color: var(--gold); background: rgba(255, 210, 63, .16); }
.formats b { font-size: 1.05rem; color: var(--cream); }
.formats small { font-size: .8rem; color: var(--muted); }
.fmt-pic { display: block; width: 74px; height: 48px; border-radius: 8px; background-color: #fff; background-image: linear-gradient(90deg, transparent 0 18%, #c9cdd8 18% 20%, transparent 20% 38%, #c9cdd8 38% 40%, transparent 40% 58%, #c9cdd8 58% 60%, transparent 60% 78%, #c9cdd8 78% 80%, transparent 80%); }
.fmt-pic.f75 { width: 52px; height: 52px; background-image: linear-gradient(#e8433a 0 20%, transparent 20%), radial-gradient(circle at 50% 60%, var(--gold) 0 9%, transparent 10%), repeating-linear-gradient(90deg, transparent 0 18%, #c9cdd8 18% 20%), repeating-linear-gradient(transparent 0 18%, #c9cdd8 18% 20%); }
.fmt-pic.f90 { background-image: repeating-linear-gradient(90deg, transparent 0 9.1%, #c9cdd8 9.1% 11.1%), repeating-linear-gradient(transparent 0 31%, #c9cdd8 31% 34%), linear-gradient(90deg, #2d6fd6 0 11%, transparent 11% 22%, #2d6fd6 22% 33%, transparent 33% 55%, #2d6fd6 55% 66%, transparent 66% 88%, #2d6fd6 88%); background-size: auto, auto, 100% 33%; background-repeat: repeat, repeat, no-repeat; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; text-align: left; opacity: .65; }
.chip b { color: var(--cream); font-size: .95rem; }
.chip small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.chip.on { opacity: 1; border-color: var(--gold); background: rgba(255, 210, 63, .14); }
.chip.on b::before { content: '✔ '; color: var(--gold); }
.chip.fixed { cursor: default; }
#setup:not([data-mode=solo]) .solo-only { display: none; }
#setup:not([data-mode=home]) .home-only { display: none; }
#setup:not([data-mode=online]) .online-host-only { display: none; }
#setup[data-mode=online] .not-online { display: none; }
.print-btn { width: 100%; margin-top: 12px; }
.join-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: 4px; font-weight: 700; text-align: center; min-width: 110px; }
#checkModal .join-row input { letter-spacing: 1px; text-transform: none; }
.tiny-label { font-size: .8rem; color: var(--muted); margin-top: 4px; text-align: right; padding-right: 92px; }
.or { text-align: center; color: var(--muted); margin: 14px 0 0; letter-spacing: 4px; }

/* ---------- sala ---------- */
#lobby { background: rgba(29, 18, 64, .4); }
.lobby-card { text-align: center; margin-top: 4vh; }
.room-code { font-family: var(--display); font-size: clamp(3.4rem, 15vw, 5.5rem); letter-spacing: 12px; color: var(--gold); text-shadow: 0 6px 0 rgba(0, 0, 0, .25); margin: 4px 0 10px; }
.lobby-rules { color: var(--muted); margin: 14px 0; line-height: 1.5; }
.lobby-h { font-size: 1rem; color: var(--muted); margin-top: 6px; }
.plist { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.plist li { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 9px 14px; font-weight: 600; }
.plist li.you { outline: 2px solid var(--gold); }
.lobby-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 12px 0 8px; }
.lobby-cards .bcard { pointer-events: none; }

/* ---------- cartela ---------- */
.bcard { --accent: var(--gold); background: #fffdf6; color: #1d1240; border-radius: 18px; padding: 8px; box-shadow: 0 6px 0 rgba(0, 0, 0, .18), 0 14px 30px rgba(20, 8, 50, .3); border: 3px solid var(--accent); position: relative; transition: transform .2s; }
.bcard.ready { animation: readyPulse 1s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 210, 63, .7), 0 14px 30px rgba(20, 8, 50, .3); } }
.bcard.winner { animation: winnerJump .6s ease 3; }
@keyframes winnerJump { 40% { transform: translateY(-14px) rotate(-1.5deg) scale(1.03); } }
.bcard-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; font-weight: 700; font-size: .9rem; }
.bcard-title { opacity: .7; }
.bcard-need { font-size: .8rem; padding: 2px 9px; border-radius: 99px; background: #ece8f7; color: #5a4a8a; }
.bcard-need:empty { display: none; }
.bcard-need.hot { background: #ffe1e1; color: #c22; animation: hot .8s ease-in-out infinite; }
.bcard-need.done { background: var(--ok); color: #053a1c; }
@keyframes hot { 50% { transform: scale(1.1); } }
.bcard-grid { display: grid; gap: 4px; }
.bcard.f75 .bcard-grid { grid-template-columns: repeat(5, 1fr); }
.bcard.f90 .bcard-grid { grid-template-columns: repeat(9, 1fr); gap: 3px; }
.bcell { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px; background: #f0edf9; color: #1d1240; font-weight: 700; font-size: clamp(1rem, 4.6vw, 1.5rem); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .07); overflow: hidden; }
.bcard.f90 .bcell { font-size: clamp(.8rem, 3.2vw, 1.2rem); border-radius: 7px; }
.bcell.letter { background: var(--c, var(--accent2)); color: #fff; font-family: var(--display); font-weight: 400; cursor: default; aspect-ratio: auto; padding: 3px 0; box-shadow: none; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.bcell.blank { background: repeating-linear-gradient(45deg, #f6f4fb 0 5px, #ebe7f5 5px 10px); cursor: default; box-shadow: none; }
.bcell.free { background: #fff3c4; cursor: default; }
.free-star { font-size: 1.4em; }
.bcell .num { position: relative; z-index: 2; }
.bcell .daub { position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); opacity: 0; transform: scale(.2) rotate(-30deg); transition: opacity .15s, transform .25s cubic-bezier(.3, 1.8, .5, 1); z-index: 1; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.bcell.marked .daub { opacity: .92; transform: scale(1) rotate(0); }
.bcell.marked .num { color: #1d1240; }
.bcell.pop { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.18); } }
.bcell.hint:not(.marked) { animation: hint 1s ease-in-out infinite; }
@keyframes hint { 50% { background: #ffe58a; box-shadow: 0 0 0 3px var(--gold); } }
.bcell.win { box-shadow: 0 0 0 3px #ff4fa3 inset; }
.bcell.win .daub { background: radial-gradient(circle at 35% 35%, #ffb3d6, #ff4fa3); }
.wiggle { animation: wiggle .4s ease; }
@keyframes wiggle { 20%, 60% { transform: translateX(-6px) rotate(-3deg); } 40%, 80% { transform: translateX(6px) rotate(3deg); } }

/* ---------- bola grande ---------- */
.ball-show { display: flex; align-items: center; gap: 14px; }
.ball-show.empty .bigball { display: none; }
.bigball { --c: #e8433a; flex: 0 0 auto; width: var(--bs, 120px); height: var(--bs, 120px); border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85) 0 6%, transparent 22%), radial-gradient(circle at 50% 50%, var(--c) 0 58%, color-mix(in srgb, var(--c) 60%, #000) 100%); box-shadow: 0 10px 0 rgba(0, 0, 0, .18), 0 18px 36px rgba(0, 0, 0, .3); }
.bb-face { width: 62%; height: 62%; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #1d1240; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08); }
.bb-letter { font-family: var(--display); font-size: calc(var(--bs, 120px) * .16); line-height: 1; color: var(--c); }
.bb-num { font-family: var(--display); font-size: calc(var(--bs, 120px) * .33); line-height: 1; }
.ball-show.in .bigball { animation: ballIn .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ballIn { 0% { transform: scale(.2) rotate(-200deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.bb-say { display: flex; flex-direction: column; min-width: 0; text-shadow: 0 2px 10px rgba(20, 8, 50, .6); }
.bb-main { font-family: var(--display); font-size: 1.5rem; line-height: 1.05; overflow-wrap: break-word; hyphens: auto; }
.bb-sub { font-size: 1rem; font-weight: 600; opacity: .95; }
.bb-lang { font-size: .78rem; opacity: .8; margin-top: 2px; font-weight: 600; }
.ball-show.in .bb-say { animation: sayIn .6s .25s both; }
@keyframes sayIn { from { opacity: 0; transform: translateX(-12px); } }
.recent { display: flex; gap: 6px; flex-wrap: wrap; }
.mini { --c: #888; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #1d1240; background: radial-gradient(circle, #fff 0 46%, var(--c) 48%); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.recent.big .mini { width: clamp(38px, 4.2vw, 64px); height: clamp(38px, 4.2vw, 64px); font-size: clamp(.95rem, 1.4vw, 1.5rem); }

/* ---------- tela do jogo ---------- */
#game { display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 6px; }
.top-city { font-family: var(--display); font-size: 1.15rem; text-shadow: 0 2px 8px rgba(20, 8, 50, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-chip { margin-left: auto; background: var(--panel); border: 1.5px solid var(--gold); color: var(--gold); border-radius: 99px; padding: 6px 12px; font-weight: 700; white-space: nowrap; font-size: .95rem; }
.stage-chip small { color: var(--muted); font-weight: 600; font-size: .75rem; margin-right: 2px; }
.counter { background: var(--panel); border-radius: 99px; padding: 6px 11px; white-space: nowrap; }
.counter small { opacity: .7; }
.game-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(280px, 34%) 1fr 210px; gap: 10px; padding: 0 10px; }
#game.no-rivals .game-main { grid-template-columns: minmax(280px, 36%) 1fr; }
#game.no-rivals .side-zone { display: none; }
.call-zone { display: flex; flex-direction: column; min-height: 0; }
.cage-spot { flex: 1; min-height: 120px; }
.ball-wrap { padding: 8px 4px 10px; display: flex; flex-direction: column; gap: 10px; }
.cards-zone { min-height: 0; overflow-y: auto; padding: 4px 4px 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-content: start; max-width: 980px; margin: 0 auto; }
.cards[data-count="1"] { max-width: 520px; }
.side-zone { min-height: 0; overflow-y: auto; }
.rivals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rival { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; background: var(--panel); border-radius: 14px; padding: 7px 10px; border: 1.5px solid transparent; }
.rival .av { grid-row: span 2; font-size: 1.6rem; }
.rv-name { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-name small { color: var(--muted); font-weight: 500; }
.rv-need { font-size: .8rem; color: var(--muted); grid-column: 2; }
.rv-wins { grid-row: 1 / span 2; grid-column: 3; font-size: .9rem; }
.rival.you { border-color: var(--gold); }
.rival.hot .rv-need { color: #ff9a9a; font-weight: 700; }
.rival.ready { border-color: #ff4fa3; }
.rival.away { opacity: .5; }
.actions { display: flex; gap: 10px; justify-content: center; align-items: stretch; padding: 8px 10px calc(10px + var(--safe-b)); }
.btn.bingo { font-family: var(--display); font-weight: 400; font-size: 2rem; letter-spacing: 2px; padding: 8px 46px 6px; display: flex; flex-direction: column; align-items: center; line-height: 1; background: linear-gradient(#ff7eb6, #e8336d); color: #fff; box-shadow: 0 6px 0 #8e1442, 0 14px 30px rgba(232, 51, 109, .35); text-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.btn.bingo small { font-family: var(--font); font-size: .78rem; font-weight: 600; letter-spacing: 0; opacity: .9; margin-top: 2px; }
.btn.bingo:active { box-shadow: 0 1px 0 #8e1442; }
.btn.bingo.glow { animation: bingoGlow .7s ease-in-out infinite; }
@keyframes bingoGlow { 50% { transform: scale(1.06); box-shadow: 0 6px 0 #8e1442, 0 0 0 8px rgba(255, 126, 182, .45); } }
.btn.bingo.locked { background: linear-gradient(#9b8fbf, #6b5f92); box-shadow: 0 6px 0 #3b3260; }

/* ---------- telão ---------- */
#tv { display: grid; grid-template-rows: auto 1fr auto auto; overflow: hidden; }
.tv-top { display: flex; align-items: center; gap: 14px; padding: calc(10px + var(--safe-t)) 16px 6px; }
.tv-city { font-family: var(--display); font-size: clamp(1.3rem, 2.4vw, 2.4rem); text-shadow: 0 3px 10px rgba(20, 8, 50, .5); white-space: nowrap; }
.tv-stage { margin-left: auto; background: var(--panel); border: 2px solid var(--gold); border-radius: 99px; padding: 6px 22px; display: flex; align-items: baseline; gap: 10px; }
.tv-stage small { color: var(--muted); font-weight: 600; font-size: clamp(.8rem, 1.1vw, 1.1rem); }
.tv-stage b { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: clamp(1.3rem, 2.6vw, 2.6rem); }
.tv-stage.over { animation: hot 1s ease-in-out infinite; }
.tv-count { background: var(--panel); border-radius: 18px; padding: 6px 16px; display: flex; align-items: baseline; gap: 4px; }
.tv-count b { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.6vw, 2.6rem); }
.tv-count small { opacity: .7; font-size: clamp(.9rem, 1.3vw, 1.3rem); }
.tv-count em { font-style: normal; color: var(--muted); font-size: clamp(.75rem, 1vw, 1rem); margin-left: 8px; }
.tv-room { background: var(--gold); color: #3a2606; border-radius: 16px; padding: 4px 14px; text-align: center; line-height: 1.05; }
.tv-room small { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.tv-room b { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.4vw, 2.4rem); letter-spacing: 4px; }
.tv-main { display: grid; grid-template-columns: 40% 1fr; gap: 16px; padding: 0 16px; min-height: 0; }
.tv-left { display: flex; flex-direction: column; min-height: 0; }
.tv-left .cage-spot { flex: 1; }
.tv-callrow { flex: 1; min-height: 0; display: flex; gap: 18px; align-items: center; }
.tv-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; max-height: 100%; overflow: hidden; }
.ball-show.tv { --bs: clamp(110px, min(13vw, 25vh), 280px); flex: 0 1 46%; min-width: 0; }
.ball-show.tv .bb-say { text-shadow: none; }
.ball-show.tv .bb-main { font-size: clamp(1.3rem, 2.6vw, 3rem); }
.ball-show.tv .bb-sub { font-size: clamp(1rem, 1.8vw, 1.8rem); }
.ball-show.tv .bb-lang { font-size: clamp(.8rem, 1.1vw, 1.1rem); }
.tv-wait { font-family: var(--display); font-size: clamp(1.4rem, 2.8vw, 2.8rem); text-shadow: 0 3px 12px rgba(20, 8, 50, .6); animation: hot 1.6s ease-in-out infinite; }
.tv-right { display: flex; flex-direction: column; gap: 10px; min-height: 0; background: var(--panel); border-radius: 24px; padding: 14px; border: 1.5px solid var(--line); overflow: hidden; }
.board { display: grid; gap: clamp(3px, .35vw, 6px); }
.board.f75 { grid-template-columns: 1.15fr repeat(15, 1fr); }
.board.f90 { grid-template-columns: repeat(10, 1fr); }
.bnum { --c: #888; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: clamp(.7rem, 1.5vw, 1.7rem); color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); transition: background .3s, color .3s, transform .3s; }
.board.f90 .bnum { font-size: clamp(.7rem, min(1.5vw, 2.4vh), 1.7rem); }
.bnum.letter { border-radius: 12px; background: var(--c); color: #fff; font-family: var(--display); font-weight: 400; font-size: clamp(1rem, 2vw, 2.2rem); aspect-ratio: auto; }
.bnum.on { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c)); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.bnum.last { animation: lastPulse 1.2s ease-in-out infinite; z-index: 1; }
@keyframes lastPulse { 50% { transform: scale(1.22); box-shadow: 0 0 0 4px #fff, 0 0 22px var(--c); } }
#tv .board { flex: 0 1 auto; }
#tv.f90 .board { width: min(100%, 46vh * 1.11); margin: 0 auto; }
#tv.f90 .ball-show.tv { --bs: clamp(96px, min(11vw, 18vh), 220px); }
.tv-recent-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.tv-recent-label { color: var(--muted); font-weight: 700; font-size: clamp(.8rem, 1vw, 1.1rem); white-space: nowrap; }
.tv-winners { display: flex; flex-wrap: wrap; gap: 8px; }
.tvw { background: rgba(255, 210, 63, .15); border: 1.5px solid var(--gold); border-radius: 14px; padding: 6px 12px; display: flex; gap: 8px; align-items: baseline; font-size: clamp(.85rem, 1.1vw, 1.2rem); }
.tvw span { color: var(--gold); font-weight: 700; }
.tv-players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; overflow-y: auto; }
.tv-players li { background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 5px 10px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; font-size: clamp(.8rem, 1vw, 1.1rem); }
.tv-players li small { color: var(--muted); }
.tv-players li.hot small { color: #ff9a9a; font-weight: 700; }
.tv-players li.ready { outline: 2px solid #ff4fa3; }
.tv-players li.away { opacity: .45; }
.tv-fact { margin: 8px 16px 0; background: rgba(255, 255, 255, .9); color: #1d1240; border-radius: 16px; padding: 9px 16px; font-size: clamp(.9rem, 1.25vw, 1.35rem); text-align: center; box-shadow: 0 6px 18px rgba(20, 8, 50, .25); }
.tv-fact b { color: #e8336d; margin-right: 6px; }
.tv-fact.in { animation: sayIn .6s both; }
.tv-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px calc(12px + var(--safe-b)); }
.btn.draw { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2.4rem); letter-spacing: 1px; padding: 10px 44px; min-width: 260px; }
.tv-keys { width: 100%; text-align: center; font-size: .78rem; color: rgba(255, 255, 255, .7); text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }

/* ---------- conferência ---------- */
.check-stage { color: var(--muted); margin: 6px 0 10px; text-align: center; }
.check-stage b { color: var(--gold); }
.tabs { display: flex; gap: 6px; background: rgba(255, 255, 255, .08); padding: 4px; border-radius: 14px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 11px; font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--gold); color: #3a2606; }
.check-pane { margin-top: 8px; }
.check-result { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.verdict { font-weight: 700; font-size: 1.2rem; padding: 8px 16px; border-radius: 14px; text-align: center; }
.verdict.ok { background: var(--ok); color: #053a1c; }
.verdict.no { background: #ffd6d6; color: #8a1a1a; }
.check-card { width: min(100%, 420px); }
.check-card.f90 { width: 100%; }
.check-card .bcell { cursor: default; }
.num-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.nchip { min-width: 40px; padding: 6px 8px; border-radius: 99px; font-weight: 700; text-align: center; }
.nchip.ok { background: var(--ok); color: #053a1c; }
.nchip.no { background: #ffd6d6; color: #8a1a1a; text-decoration: line-through; }

/* ---------- fim ---------- */
#over { background: rgba(29, 18, 64, .5); }
.over-card { width: min(520px, 100%); text-align: center; }
.over-ico { font-size: 4rem; animation: winnerJump 1.2s ease infinite; }
.over-card h2 { font-family: var(--display); font-weight: 400; font-size: 2.4rem; color: var(--gold); }
.winners-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.winners-list li { display: flex; justify-content: space-between; gap: 10px; background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 9px 14px; text-align: left; }
.winners-list li b { color: var(--gold); }
.winners-list li.mine { outline: 2px solid var(--gold); }
.over-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.over-stats div { background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 8px 18px; display: flex; flex-direction: column; }
.over-stats b { font-family: var(--display); font-weight: 400; font-size: 1.8rem; }
.over-stats small { color: var(--muted); }
.over-stats .rec { background: var(--gold); color: #3a2606; font-weight: 700; justify-content: center; animation: hot 1s infinite; }

/* ---------- janelas, avisos ---------- */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(15, 6, 40, .6); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal-card { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; text-align: left; }
.modal-card.wide { width: min(760px, 100%); }
.modal-card h2 { font-family: var(--display); font-weight: 400; font-size: 1.8rem; color: var(--gold); margin-bottom: 8px; text-align: center; }
.modal-card > .btn { display: block; margin: 16px auto 0; }
.help-list { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }
#modalBoard { margin: 8px 0; }
#modalBoard .bnum { font-size: clamp(.65rem, 2.6vw, 1.1rem); }
.confirm-text { font-size: 1.2rem; text-align: center; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 30px); z-index: 85; background: rgba(255, 255, 255, .96); color: #1d1240; padding: 10px 18px; border-radius: 16px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s; max-width: min(92vw, 560px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #ffe1e1; color: #8a1a1a; }
.banner { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity .25s; }
.banner.show { opacity: 1; }
.banner-in { background: linear-gradient(135deg, #ff7eb6, #ffb000); border: 5px solid #fff; border-radius: 32px; padding: 18px 40px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); transform: scale(.4) rotate(-8deg); max-width: 92vw; }
.banner.bad .banner-in { background: linear-gradient(135deg, #7d6fd6, #4a3fa8); }
.banner.show .banner-in { animation: bannerIn .6s cubic-bezier(.3, 1.7, .5, 1) forwards; }
@keyframes bannerIn { to { transform: scale(1) rotate(-2deg); } }
.banner-t { font-family: var(--display); font-size: clamp(3rem, 12vw, 7rem); line-height: 1; color: #fff; text-shadow: 0 6px 0 rgba(0, 0, 0, .2); }
.banner-s { font-size: clamp(1.1rem, 3vw, 2rem); font-weight: 700; color: #fff; margin-top: 6px; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }

/* ---------- sem 3D ---------- */
body.no3d { background: radial-gradient(ellipse at 50% 20%, var(--sky2), var(--sky1) 70%); }

/* ---------- celular / retrato ---------- */
@media (max-width: 860px), (orientation: portrait) {
  .modes { grid-template-columns: 1fr; padding-top: 34vh; gap: 10px; }
  .mode { padding: 13px 14px; }
  .mode-ico { font-size: 2.1rem; }
  .mode b { font-size: 1.3rem; }
  .game-main { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; overflow: hidden; }
  .call-zone { flex: 0 0 auto; flex-direction: row; height: clamp(150px, 27dvh, 240px); }
  .cage-spot { flex: 0 0 46%; min-height: 0; }
  .ball-wrap { flex: 1; justify-content: center; padding: 0; min-width: 0; }
  .ball-show { --bs: clamp(78px, 19vw, 120px); flex-direction: column; align-items: flex-start; gap: 6px; }
  .bb-main { font-size: 1.15rem; }
  .bb-sub { font-size: .85rem; }
  .side-zone { flex: 0 0 auto; overflow-x: auto; overflow-y: hidden; }
  .rivals { flex-direction: row; }
  .rival { padding: 4px 9px; flex: 0 0 auto; }
  .rival .av { font-size: 1.2rem; }
  .cards-zone { flex: 1; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .top-city { display: none; }
  .stage-chip { margin-left: 0; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; }
  .btn.bingo { flex: 1; font-size: 1.8rem; padding: 8px 10px 6px; }
  .actions .btn.ghost { padding: 10px 12px; font-size: .9rem; }
  .tiny-label { padding-right: 0; text-align: left; }
  .modal-card h2 { font-size: 1.5rem; }
  /* telão em tela estreita: empilha */
  #tv { grid-template-rows: auto auto 1fr auto auto; overflow-y: auto; }
  .tv-top { flex-wrap: wrap; gap: 8px; }
  .tv-stage { margin-left: 0; }
  .tv-main { grid-template-columns: 1fr; }
  .tv-left { height: 30dvh; }
  .tv-callrow { flex-wrap: wrap; }
  .ball-show.tv { --bs: clamp(90px, 22vw, 160px); flex-basis: 100%; }
  .btn.draw { min-width: 0; flex: 1 1 100%; }
  .tv-keys { display: none; }
}
@media (max-width: 860px) and (orientation: landscape) and (max-height: 520px) {
  .modes { padding-top: 6vh; grid-template-columns: repeat(3, 1fr); }
  .call-zone { height: 34dvh; }
}
