/* Bundle alvo <30KB. Sem reset moderno — TVs legacy não precisam.
   Tipografia gigante (legibilidade a 6m) e contraste alto p/ painéis OLED. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #0b0d12; color: #f4f6fa;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden; }
body { font-size: 18px; }

/* ===== Pair screen ===== */
#view-pair { display: flex; align-items: center; justify-content: center; height: 100vh; }
.pair-card { background: #14181f; border: 1px solid #232a36; border-radius: 12px;
  padding: 48px 56px; width: min(640px, 90vw); text-align: center; }
.pair-card h1 { font-size: 36px; margin-bottom: 12px; }
.pair-help { color: #aab1c2; margin-bottom: 32px; }
.pin-inputs { display: flex; gap: 16px; justify-content: center; margin-bottom: 32px; }
.pin-inputs input { width: 80px; height: 110px; border-radius: 12px;
  background: #0b0d12; border: 2px solid #2a3140; color: #f4f6fa;
  font-size: 56px; text-align: center; font-weight: 600; }
.pin-inputs input:focus { outline: none; border-color: #4c8aff; }
#btn-claim { background: #4c8aff; color: #fff; border: 0; border-radius: 10px;
  padding: 16px 36px; font-size: 20px; font-weight: 600; cursor: pointer; }
#btn-claim:disabled { background: #2a3140; cursor: not-allowed; }
.pair-error { color: #ff6b6b; margin-top: 16px; min-height: 1.2em; }
.pair-hint { color: #6c7488; margin-top: 24px; font-size: 14px; }
.pair-hint kbd { background: #232a36; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ===== Display screen ===== */
#view-display { display: grid; grid-template-rows: 56px 1fr; height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px; background: #14181f; border-bottom: 1px solid #232a36; }
.brand { color: #aab1c2; font-size: 14px; letter-spacing: 0.05em; }
.brand #client-id { color: #f4f6fa; font-weight: 600; }
.chips { display: flex; gap: 8px; }
.chip { background: #0b0d12; border: 1px solid #2a3140; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: #aab1c2; font-variant-numeric: tabular-nums; }
.chip#chip-stale { background: #5b1a1a; border-color: #8b2a2a; color: #ffb4b4; font-weight: 600; }

.board { display: grid; grid-template-columns: 70fr 30fr; gap: 16px; padding: 16px; min-height: 0; }
.calls, .side { display: flex; flex-direction: column; min-height: 0; }
.calls h2, .side h2 { color: #aab1c2; font-size: 14px; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 12px; }
.side h2.ads-title { margin-top: 16px; }

.calls-list { list-style: none; display: flex; flex-direction: column; gap: 12px;
  overflow: hidden; flex: 1; }
.calls-list .empty { color: #6c7488; font-size: 24px; text-align: center;
  padding: 80px 0; }
.calls-list li.call { display: grid; grid-template-columns: 1fr auto;
  align-items: center; background: linear-gradient(90deg, #1a4dff22 0%, #14181f 100%);
  border-left: 6px solid #4c8aff; border-radius: 12px; padding: 24px 28px; min-height: 120px; }
.calls-list li.call.first { background: linear-gradient(90deg, #1a4dff44 0%, #14181f 100%);
  border-left-color: #ffd84c; }
.calls-list .nf-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calls-list .driver { font-size: 48px; font-weight: 700; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calls-list .meta { color: #aab1c2; font-size: 18px; }
.calls-list .doca { font-size: 96px; font-weight: 800; color: #ffd84c;
  margin-left: 32px; padding: 0 24px; line-height: 1; min-width: 180px; text-align: center;
  font-variant-numeric: tabular-nums; }
.calls-list li.call:not(.first) .doca { color: #4c8aff; font-size: 72px; }

.queue-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.queue-list .empty { color: #6c7488; padding: 8px 0; }
.queue-list li.queued { background: #14181f; border-radius: 6px; padding: 10px 12px;
  font-size: 16px; display: flex; justify-content: space-between; gap: 8px; }
.queue-list .q-driver { color: #f4f6fa; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.queue-list .q-numero { color: #6c7488; font-size: 12px; }

.ads-stage { flex: 1; min-height: 200px; background: #14181f; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ads-stage .empty { color: #6c7488; }
.ads-stage img, .ads-stage video { width: 100%; height: 100%; object-fit: cover; }

/* ===== Debug overlay ===== */
.debug-overlay { position: fixed; right: 8px; bottom: 8px; max-width: 480px;
  max-height: 60vh; overflow: auto; background: #0b0d12ee; border: 1px solid #2a3140;
  border-radius: 6px; padding: 10px; font-size: 11px; color: #aab1c2; z-index: 100; }
.debug-overlay pre { white-space: pre-wrap; word-break: break-all;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ===== Boot blanket ===== */
.boot { display: flex; align-items: center; justify-content: center; height: 100vh; }
.boot-msg { color: #aab1c2; font-size: 24px; }

/* ===== State driven visibility ===== */
body.state-init #view-boot, body.state-claiming #view-boot { display: flex; }
body.state-pair #view-pair, body.state-pair-error #view-pair { display: flex; }
body.state-displaying #view-display { display: grid; }
.view[hidden] { display: none !important; }
