/* Bingo ao Vivo: layout 5 "cartelas em foco" -- royal-blue ground, white
   panels and cards, yellow highlights, navy floating bar. Single look by
   design (the game screen inside the operator's iframe). */
:root {
  --ground: #1747C7; --on-ground: #DCE6FF; --on-ground-strong: #FFD23F;
  --navy: #0B1E4A; --ink: #0A1433; --muted: #4A5C8C; --line: #D6E0F7;
  --panel: #FFFFFF; --soft: #F3F6FD; --soft2: #EEF3FF;
  --blue: #1747C7; --yellow: #FFD23F; --yellow-deep: #F5B700;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html, body { margin: 0; background: var(--ground); color: var(--navy); font-family: var(--body); font-size: 15px; }
/* touch-action: no double-tap-to-zoom on buttons, so tapping Comprar
   twice in a row buys twice instead of the second tap being taken as a zoom
   (iOS ignores maximum-scale=1). */
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
p { margin: 0; }

#splash { position: fixed; inset: 0; z-index: 60; background: var(--ground); display: grid; place-content: center; gap: 18px; justify-items: center; }
#splash.done { display: none; }
.splash-logo { font-family: var(--display); font-size: 3.2rem; color: var(--yellow); }
.splash-logo span { color: #FFFFFF; font-size: 1.6rem; }
.splash-bar { width: 180px; height: 6px; border-radius: 6px; background: #ffffff33; overflow: hidden; }
.splash-bar-fill { height: 100%; width: 0; background: var(--yellow); animation: fill 1.2s ease-out forwards; }
@keyframes fill { to { width: 100%; } }

.live { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(100px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.lv-top { background: var(--panel); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 0 #0B1E4A33; }
.lv-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lv-brand { font-family: var(--display); font-size: 1.4rem; line-height: 1; color: var(--blue); white-space: nowrap; }
.lv-brand span { color: #C98F00; }
.lv-small { font-size: .76rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.lv-saldo { font-family: var(--display); font-size: 1rem; background: var(--blue); color: #FFFFFF; border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lbl { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }

.ball { --c: var(--yellow); display: grid; place-items: center; border-radius: 50%; font-family: var(--display); color: var(--ink); font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at 32% 28%, #fff9 0 18%, transparent 19%), radial-gradient(circle, var(--c) 60%, color-mix(in srgb, var(--c) 70%, #000) 100%); }
.ball.c0 { --c: #FFD23F; } .ball.c1 { --c: #FF6B6B; } .ball.c2 { --c: #3DDC97; } .ball.c3 { --c: #5B9BFF; } .ball.c4 { --c: #B98BFF; }
.ball.pop { animation: pop .22s ease-out; }
@keyframes pop { from { transform: scale(.3); } to { transform: scale(1); } }
.lv-strip { display: flex; align-items: center; gap: 6px; min-height: 46px; }
.lv-ball { width: 44px; height: 44px; font-size: 1.25rem; box-shadow: 0 0 0 3px var(--blue); flex-shrink: 0; }
.lv-ball.empty { background: none; box-shadow: none; border: 2px dashed #C6D2EC; color: #9AA8CC; }
.lv-recent { display: flex; gap: 5px; overflow: hidden; min-width: 0; flex: 1; }
.lv-recent .ball { width: 32px; height: 32px; font-size: .86rem; flex-shrink: 0; }
.lv-count { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; white-space: nowrap; flex-shrink: 0; }
.lv-count span { font-size: .7rem; font-weight: 800; color: var(--muted); }
.lv-count b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.lv-prog { height: 5px; border-radius: 5px; background: #E1E8F8; overflow: hidden; }
.lv-prog div { height: 100%; width: 0; background: var(--yellow-deep); transition: width .3s linear; }
.lv-prog div.sale { background: var(--blue); }
.lv-stage { display: flex; flex-direction: column; gap: 2px; font-size: .84rem; font-weight: 700; color: var(--muted); min-height: 1.3em; }
.lv-stage b { color: var(--blue); }
.lv-clock { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--blue); font-variant-numeric: tabular-nums; }

.grant-banner { background: var(--yellow); color: var(--ink); border-radius: 12px; padding: 8px 12px; font-weight: 800; text-align: center; }
.lv-buy { background: var(--panel); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.seg { display: flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { flex: 1 1 0; background: none; border: 0; border-radius: 7px; padding: 7px 4px; font-weight: 800; font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--blue); color: #FFFFFF; }
.seg button:disabled { opacity: 1; color: #8E9BBF; }
.seg button[aria-pressed="true"]:disabled { background: #5C7BD6; color: #FFFFFF; }

.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cards.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card { background: var(--panel); border-radius: 16px; padding: 8px 10px; border: 2px solid transparent; display: flex; flex-direction: column; gap: 6px; }
.card.won { border-color: var(--blue); }
.card.pending { border-style: dashed; border-color: #C6D2EC; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cell { height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); font-family: var(--display); font-size: 1rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.cell.hit { background: var(--yellow); }
.cell.win { background: var(--blue); color: #FFFFFF; }
.cards.compact .card { padding: 6px; border-radius: 12px; }
.cards.compact .grid { gap: 2px; }
.cards.compact .cell { height: 24px; font-size: .82rem; border-radius: 6px; }
.cards.compact .card-h { font-size: .66rem; gap: 3px; }
.lv-tag { border-radius: 999px; padding: 1px 9px; font-size: .72rem; font-weight: 800; background: var(--soft2); color: var(--muted); white-space: nowrap; }
.cards.compact .lv-tag { font-size: .62rem; padding: 0 6px; }
.lv-tag.win { background: var(--blue); color: #FFFFFF; }
.lv-tag.near { background: var(--yellow); color: var(--ink); }
.lv-empty { background: var(--panel); border: 2px dashed #C6D2EC; border-radius: 16px; padding: 16px 18px; text-align: center; font-size: .88rem; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px; align-items: center; }
.lv-empty strong { font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: var(--navy); }
.lv-empty b { color: var(--blue); }
.lv-hint { text-align: center; font-size: .84rem; font-weight: 700; color: var(--on-ground); }
.lv-hint b { color: var(--on-ground-strong); }
.lv-status { min-height: 1em; text-align: center; font-size: .84rem; font-weight: 700; color: var(--on-ground); }
/* Same 8px between every block: the hint and status lines take no room
   (no margins, no empty line) unless they have something to say. */
.lv-hint, .lv-status { margin: 0; }
.lv-status:empty { display: none; }

.lv-toggle { align-self: center; background: #FFFFFF; color: var(--blue); border: 0; border-radius: 999px; padding: 10px 18px; min-height: 44px; font-weight: 800; font-size: .86rem; box-shadow: 0 2px 0 #0B1E4A44; }
.lv-toggle::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.lv-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.lv-below { display: flex; flex-direction: column; gap: 8px; }
.box { background: var(--panel); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
summary { cursor: pointer; font-weight: 800; color: var(--blue); }
/* Closed, the hidden board must not add the flex gap under the summary:
   same space above and below "Ver todas as bolas" (.board keeps its margin). */
details.box { gap: 0; }
.board { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 2px; margin-top: 8px; }
.board i { font-style: normal; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-size: .56rem; font-weight: 800; color: #7D8DB8; background: var(--soft2); }
.board i.on { color: var(--ink); }
.board i.on.c0 { background: #FFD23F; } .board i.on.c1 { background: #FF6B6B; } .board i.on.c2 { background: #3DDC97; } .board i.on.c3 { background: #5B9BFF; } .board i.on.c4 { background: #B98BFF; }
.lad { display: flex; flex-direction: column; gap: 8px; }
.lad-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 8px; }
.lad-name { font-family: var(--display); font-size: .92rem; line-height: 1.1; }
.lad-steps { display: flex; align-items: center; gap: 3px; min-width: 0; }
.lad-step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; background: var(--soft); border-radius: 9px; padding: 4px 2px; }
.lad-step b { font-family: var(--display); font-weight: 400; font-size: .98rem; color: var(--blue); line-height: 1.1; }
.lad-step small { font-size: .6rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.lad-step.now { background: var(--yellow); } .lad-step.now b, .lad-step.now small { color: var(--ink); }
.lad-step.past { opacity: .38; }
.lad-step.got { background: var(--blue); } .lad-step.got b, .lad-step.got small { color: #FFFFFF; }
.lad-sep { color: #9AA8CC; font-size: .8rem; }
.lv-note { font-size: .74rem; color: var(--muted); }

.mbar { display: flex; align-items: center; gap: 8px; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(456px, calc(100% - 32px)); z-index: 15; background: var(--navy); border-radius: 20px; padding: 8px; box-shadow: 0 10px 24px rgba(11, 30, 74, .45); }
.mbar-info { display: flex; flex-direction: column; min-width: 0; flex: 1; padding-left: 8px; }
.mbar-info span { order: -1; font-size: .72rem; color: #C6D8FF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar-info b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--yellow); font-variant-numeric: tabular-nums; line-height: 1.1; }
.play { background: var(--yellow); color: var(--ink); border: 0; border-radius: 14px; padding: 10px 18px; min-height: 44px; font-family: var(--display); font-size: 1.05rem; }
.btn2 { background: var(--blue); color: #FFFFFF; border: 0; border-radius: 14px; padding: 10px 14px; min-height: 44px; font-weight: 800; }
.btn2.on { background: var(--yellow); color: var(--ink); }
.lv-row .btn2 { background: var(--soft2); color: var(--blue); }

.modal { position: fixed; inset: 0; z-index: 40; background: #041311cc; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
/* Results/round popups: centered on the game area above the bottom buy bar
   (.mbar, ~64px + 16px off the bottom), not on the whole window. */
#modal { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.modal-card { background: var(--navy); color: #F2F5FF; border-radius: 18px; padding: 20px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; box-shadow: 0 18px 50px #000a; }
.modal-card h3 { font-size: 1.4rem; }
.modal-card .lbl { color: #A9BBE6; }
.modal-count { font-family: var(--display); font-size: 5rem; line-height: 1; color: var(--yellow); font-variant-numeric: tabular-nums; }
.modal-total { font-family: var(--display); font-size: 2.2rem; color: var(--yellow); line-height: 1.1; }
.modal-list { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: .85rem; max-height: 40vh; overflow-y: auto; }
.modal-list div { display: flex; justify-content: space-between; gap: 8px; background: #132B63; border-radius: 8px; padding: 5px 9px; }
.modal-list b { color: var(--yellow); white-space: nowrap; }
.modal-muted { color: #A9BBE6; font-size: .82rem; }

.sheet-back { position: fixed; inset: 0; z-index: 25; background: #041311b3; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); max-height: 85vh; overflow-y: auto; background: var(--panel); border-radius: 20px 20px 0 0;
  box-shadow: 0 -14px 40px #000a; display: flex; flex-direction: column; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet-grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 2px; }
.autobox { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.autobox .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.autobox .ctl { display: flex; flex-direction: column; gap: 4px; }
.autobox .stop { background: #5c1d14; color: #ffd5cc; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 800; }
.autobox .go { background: var(--blue); color: #FFFFFF; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--yellow); color: var(--ink); font-weight: 800;
  padding: 10px 18px; border-radius: 12px; box-shadow: 0 8px 24px #0008; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition: none !important; } }
