/* Bingo Jaepel — componentes do bingo (cartela, bolas, console, portal). Complementa app.css. */
:root {
  --lB: #0b5cd5; --lI: #e0464b; --lN: #7c3aed; --lG: #109a64; --lO: #e08a00;
  --ev1: var(--accent); --ev2: var(--accent-2);
}
.lB { --l: var(--lB); } .lI { --l: var(--lI); } .lN { --l: var(--lN); } .lG { --l: var(--lG); } .lO { --l: var(--lO); }

[hidden] { display: none !important; }
.warn-text { color: var(--warn); font-weight: 600; }
.gold { color: var(--gold) !important; }
.eyebrow { font-size: 12.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.eyebrow.gold { color: var(--gold); } .eyebrow.warn { color: var(--warn); }
.hair { border: 0; border-top: 1px solid var(--hair); margin: 22px 0; }
.seq { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }
.day-title { margin: 26px 0 10px; font-size: 17px; display: flex; align-items: baseline; gap: 10px; }
.day-title:first-child { margin-top: 0; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 12px; }
.prize-photo { width: 160px; height: 160px; object-fit: cover; border-radius: var(--r-lg); margin-bottom: 18px; }
.btn-xl { min-height: 60px; font-size: 17px; padding-left: 26px; padding-right: 26px; border-radius: 18px; }
.input-lg { height: 56px; font-size: 19px; }
.check.inline { display: inline-flex; padding: 10px 14px; align-items: center; }
.check.inline input { margin-top: 0; }
.stage-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 10px; }
.stage-row:has(input[type=time]) { grid-template-columns: 34px 140px auto 140px 1fr; }
.stage-row > b { color: var(--muted); font-size: 14px; }
.event-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.event-card { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: var(--r-xl); color: inherit; text-decoration: none; transition: transform .2s; }
.event-card:hover { transform: translateY(-3px); }
.event-card h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.02em; }
.slot-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 18px 0; }
.slot-days h4 { margin: 0 0 8px; }
.slot-list { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
.slot.exists { background: rgba(13,27,46,.05); color: var(--faint); text-decoration: line-through; }
.row-next td { background: rgba(11,92,213,.05); }
.live-strip { display: flex; align-items: center; gap: 16px; flex-direction: row; }
.dot-live { width: 14px; height: 14px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(224,70,75,.5); animation: live 1.6s infinite; flex: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(224,70,75,.5); } 70% { box-shadow: 0 0 0 14px rgba(224,70,75,0); } 100% { box-shadow: 0 0 0 0 rgba(224,70,75,0); } }
.op-live { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); background: #fff; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); }
.op-live strong { display: block; } .op-live .grow span { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ bolas e cartela */
.ball { --l: var(--accent); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.55), rgba(255,255,255,0) 32%), radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--l) 80%, #fff), var(--l) 72%); color: #fff; font-weight: 800; font-size: 20px; line-height: 1;
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.18), 0 8px 18px -8px color-mix(in srgb, var(--l) 70%, transparent); font-variant-numeric: tabular-nums; flex: none; }
.ball small { font-size: .5em; opacity: .9; font-weight: 700; }
.ball.sm { width: 40px; height: 40px; font-size: 15px; }
.ball.lg { width: 84px; height: 84px; font-size: 32px; }
.ball.xl { width: 132px; height: 132px; font-size: 52px; }
.ball.voided { --l: #9aa7b8; opacity: .55; text-decoration: line-through; }
.ball-row { display: flex; flex-wrap: wrap; gap: 8px; }

.bcard { --c: var(--ev1, var(--accent)); width: min(100%, 360px); border-radius: 22px; overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid rgba(11,92,213,.12); }
.bcard-head, .bcard-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.bcard-head span { text-align: center; padding: 10px 0; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--c), var(--ev2, var(--accent-2))); }
.bcard-grid { gap: 5px; padding: 8px; }
.bcard-grid span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; font-size: clamp(17px, 5vw, 24px); font-weight: 700; color: var(--ink); background: rgba(13,27,46,.04); font-variant-numeric: tabular-nums; transition: background .3s, color .3s, transform .3s; }
.bcard-grid span.hit { background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--c); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); }
.bcard-grid span.free { color: var(--gold); font-size: 22px; }
.bcard-grid span.win { background: linear-gradient(135deg, #f7c948, #e8a317); color: #fff; box-shadow: none; transform: scale(1.04); }
.bcard.sm { width: 230px; border-radius: 16px; }
.bcard.sm .bcard-head span { padding: 5px 0; font-size: 14px; }
.bcard.sm .bcard-grid span { font-size: 15px; border-radius: 8px; }

.board { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.board-row { display: grid; grid-template-columns: 34px repeat(15, minmax(0, 1fr)); gap: 4px; align-items: center; }
.board-row b { font-size: 18px; color: var(--muted); text-align: center; }
.board-row span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--faint); background: rgba(13,27,46,.04); font-variant-numeric: tabular-nums; }
.board-row span.on { background: var(--accent); color: #fff; }
.board-row span.last { background: var(--gold); color: #fff; box-shadow: 0 0 0 3px rgba(214,160,52,.3); }

/* ------------------------------------------------------------ console do operador */
.operator .main { padding-top: 24px; }
.op-head { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-xl); margin-bottom: 18px; }
.op-head h1 { margin: 2px 0; font-size: 26px; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.op-conn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 8px 12px; border-radius: 99px; background: rgba(255,255,255,.6); }
.op-conn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.op-conn.ok .dot { background: var(--ok); } .op-conn.bad .dot { background: var(--bad); } .op-conn.bad { color: var(--bad); font-weight: 650; }
.op-offline { display: flex; gap: 14px; align-items: center; padding: 16px 20px; margin-bottom: 18px; border-radius: var(--r-lg); background: var(--bad-soft); color: var(--bad); }
.op.is-offline .op-main button, .op.is-offline .op-side button, .op.is-busy [data-act], .op.is-busy [data-act-submit] { pointer-events: none; opacity: .55; }
.op-toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 14px 22px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 18px 40px -14px rgba(0,0,0,.4); max-width: min(92vw, 640px); }
.op-toast.ok { background: var(--ok); } .op-toast.bad { background: var(--bad); }
.op-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.op-main { padding: 28px; border-radius: var(--r-xl); min-height: 520px; }
.op-side { display: flex; flex-direction: column; gap: 18px; }
.op-side h3 { margin: 0 0 12px; font-size: 16px; }
.op-ctrls { display: flex; flex-direction: column; gap: 10px; }
.op-ctrls .btn { justify-content: flex-start; }
.op-before { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.op-before h2 { margin: 10px 0 0; font-size: 28px; }
.op-last { display: flex; align-items: center; gap: 26px; }
.op-count { font-size: 18px; } .op-count strong { font-size: 30px; letter-spacing: -.02em; }
.op-entry { display: flex; gap: 12px; align-items: center; margin-top: 26px; flex-wrap: wrap; }
.op-input::placeholder { font-size: 17px; font-weight: 500; letter-spacing: 0; }
.op-input { width: 200px; height: 72px; font-size: 38px; font-weight: 800; text-align: center; letter-spacing: .05em; border-radius: 18px; }
.op-preview { min-width: 92px; height: 72px; display: grid; place-items: center; font-weight: 700; color: var(--faint); }
.op-preview em { display: block; font-size: 12px; color: var(--bad); font-style: normal; }
.op-preview .ball { width: 64px; height: 64px; font-size: 24px; }
.op-preview.dup .ball { opacity: .5; }
.op-winner h2 { font-size: 40px; margin: 8px 0 4px; letter-spacing: -.03em; }
.op-winner-meta { font-size: 17px; color: var(--ink-2); margin-bottom: 22px; }
.op-winner-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
.op-tie { margin-top: 26px; padding: 22px; border-radius: var(--r-lg); background: var(--warn-soft); }
.op-tie h2 { margin: 6px 0; }
.op-cands { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.op-cand { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.7); }
.op-cand strong, .op-cand span { display: block; } .op-cand span { font-size: 13px; color: var(--muted); }
.op-stages { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.op-stage { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.5); }
.op-stage small { display: block; color: var(--muted); }
.op-stage.concluida { opacity: .55; } .op-stage.aberta, .op-stage.desempate, .op-stage.em_validacao { box-shadow: inset 0 0 0 2px var(--accent); }
.op-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.op-hist li > button, .op-hist li > div { width: 100%; display: flex; gap: 12px; align-items: center; padding: 6px 8px; border: 0; border-radius: 12px; background: transparent; text-align: left; font: inherit; color: inherit; cursor: default; }
.op-hist li > button { cursor: pointer; } .op-hist li > button:hover { background: rgba(11,92,213,.07); }
.op-hist small { display: block; font-size: 12px; color: var(--muted); }
.op-hist li.voided { opacity: .5; }
dialog.confirm .field { margin-top: 12px; }

/* ------------------------------------------------------------ entregas */
.deliv-list { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.deliv { display: flex; gap: 18px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); background: rgba(255,255,255,.55); flex-wrap: wrap; }
.deliv-prize { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--gold); }
.deliv-prize strong { color: var(--ink); }
.deliv-form { display: flex; gap: 8px; flex-wrap: wrap; }
.deliv-form .input { height: 44px; width: 150px; }
.deliv-form .input[name=received_by] { width: 220px; }

/* ------------------------------------------------------------ folha de contingência */
.print-sheet { max-width: 900px; margin: 0 auto; padding: 32px; background: #fff; border-radius: 18px; }
.print-sheet h1 { font-size: 22px; } .print-sheet h2 { font-size: 16px; margin: 0 0 4px; }
.sheet-round { page-break-inside: avoid; border-top: 2px solid #000; padding-top: 12px; margin-top: 20px; }
.sheet-grid { width: 100%; border-collapse: collapse; }
.sheet-grid td { border: 1px solid #555; height: 34px; vertical-align: top; padding: 2px 4px; width: 10%; }
.sheet-grid small { font-size: 9px; color: #666; }
@media print { .no-print { display: none !important; } .print-sheet { padding: 0; } body::before, body::after { display: none; } body { background: #fff; } }

/* ------------------------------------------------------------ portal do colaborador (celular primeiro) */
body.portal { padding-bottom: 92px; }
.pt-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(255,255,255,.72); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--hair); }
.pt-logo { height: 30px; width: auto; }
.pt-head strong { display: block; font-size: 15px; } .pt-head span { display: block; font-size: 12px; color: var(--muted); }
.pt-main { max-width: 560px; margin: 0 auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.pt-h1 { font-size: 24px; margin: 6px 0 0; letter-spacing: -.02em; }
.pt-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.85); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-top: 1px solid var(--hair); }
.pt-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 14px; }
.pt-nav a svg { width: 24px; height: 24px; }
.pt-nav a.on { color: var(--accent); background: var(--accent-soft); }
.pt-badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; }
.pt-live { display: flex; flex-direction: column; gap: 16px; }
.pt-status { padding: 18px 20px; border-radius: var(--r-lg); }
.pt-status-line { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.pt-status p { margin: 6px 0 0; }
.pt-status.win { background: linear-gradient(135deg, #f7c948, #e8a317); color: #fff; } .pt-status.win p { color: #fff; }
.pt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; animation: live 2s infinite; }
.pt-dot.bad { background: var(--bad); animation: none; }
.pt-cardbox { padding: 18px; border-radius: var(--r-xl); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pt-cardbox > .row { width: 100%; } .pt-cardbox h2 { margin: 0; font-size: 17px; }
.pt-cardbox .bcard { width: 100%; max-width: 420px; }
.pt-progress { font-size: 16px; text-align: center; }
.pt-progress.hot { color: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.pt-cardbox p { margin: 0; text-align: center; }
.pt-lastbox { padding: 18px 20px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 14px; }
.pt-last { display: flex; align-items: center; gap: 16px; } .pt-last strong { display: block; font-size: 17px; }
.pt-recent { display: flex; gap: 6px; margin-top: 6px; } .pt-recent span { --l: var(--accent); min-width: 32px; height: 32px; padding: 0 4px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--l); opacity: .75; }
.pt-prize { display: flex; align-items: center; gap: 12px; } .pt-prize img { width: 56px; height: 56px; object-fit: cover; border-radius: 14px; }
.pt-prize span { display: block; font-size: 12px; color: var(--muted); }
.pt-wins { padding: 18px 20px; border-radius: var(--r-lg); } .pt-wins h3 { margin: 0 0 10px; font-size: 15px; }
.pt-w { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair); }
.pt-w b { min-width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-size: 13px; }
.pt-w strong, .pt-w span { display: block; } .pt-w span { font-size: 12px; color: var(--muted); }
.pt-cardrow { border-radius: var(--r-lg); padding: 0; overflow: hidden; }
.pt-cardrow summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.pt-cardrow summary::-webkit-details-marker { display: none; }
.pt-cardrow summary strong, .pt-cardrow summary span { display: block; } .pt-cardrow summary .grow span { font-size: 12px; color: var(--muted); }
.pt-cardrow-body { padding: 0 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pt-prizecard img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--r-lg); margin-bottom: 12px; }
.pt-prizecard h2 { margin: 6px 0 12px; }
.pt-code { display: flex; flex-direction: column; align-items: center; padding: 16px; border-radius: var(--r-lg); background: #fff; border: 2px dashed var(--gold); margin-bottom: 12px; }
.pt-code span { font-size: 12px; color: var(--muted); } .pt-code strong { font-size: 34px; letter-spacing: .12em; }
.pt-info { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.pt-info li { display: flex; gap: 8px; align-items: center; }
.pt-notice.unread { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-sm); }
.pt-rules p { margin: 0 0 12px; }
.pt-login { max-width: 440px; text-align: center; }
.pt-login .form { text-align: left; }
.pt-login-logo { width: 170px; height: auto; margin: 0 auto 14px; display: block; }
.pt-login h1 { margin: 10px 0 4px; font-size: 30px; letter-spacing: -.03em; }
.pt-balls { display: flex; justify-content: center; gap: 8px; }
.pt-balls span { --l: var(--accent); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.55), rgba(255,255,255,0) 34%), var(--l); box-shadow: inset 0 -5px 10px rgba(0,0,0,.18); animation: bounce 2.4s infinite; }
.pt-balls span:nth-child(2) { animation-delay: .15s; } .pt-balls span:nth-child(3) { animation-delay: .3s; } .pt-balls span:nth-child(4) { animation-delay: .45s; } .pt-balls span:nth-child(5) { animation-delay: .6s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

@media (max-width: 1080px) {
  .op-grid { grid-template-columns: 1fr; }
  .op-winner-body { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .stage-row, .stage-row:has(input[type=time]) { grid-template-columns: 28px 1fr; }
  .board-row { grid-template-columns: 24px repeat(15, minmax(0, 1fr)); gap: 2px; }
  .board-row span { font-size: 10px; border-radius: 5px; }
  .ball.xl { width: 100px; height: 100px; font-size: 40px; }
  .op-input { width: 140px; }
  .deliv-form .input, .deliv-form .input[name=received_by] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .pt-balls span, .dot-live, .pt-dot, .pt-progress.hot { animation: none; } }
