@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(../fonts/barlow-condensed-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); }

:root {
  --fundo: #11140f; --painel: rgba(17, 20, 15, .86); --painel-solido: #181c14;
  --texto: #ece9e1; --mudo: #b4b1a4; --linha: rgba(236, 233, 225, .16);
  --acento: #ff6a45; --acento-texto: #1c0c06; --ok: #9fb38a;
  --r: 10px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif; --corpo: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fundo); color: var(--texto); font-family: var(--corpo); font-size: 16px; line-height: 1.4; overflow: hidden; -webkit-tap-highlight-color: transparent; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
[hidden] { display: none !important; }

#ui { position: fixed; inset: 0; pointer-events: none; display: grid; grid-template-rows: auto auto 1fr auto; padding: max(10px, env(safe-area-inset-top)) 12px 0; gap: 8px; }
#ui > * { pointer-events: auto; }
.topo { display: grid; gap: 8px; }
.marca { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.marca-nome { white-space: nowrap; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.dia { white-space: nowrap; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; background: var(--acento); color: var(--acento-texto); padding: 2px 10px; border-radius: var(--r); }

.busca { position: relative; background: var(--painel); border: 1px solid var(--linha); border-radius: var(--r); padding: 8px 10px 10px; backdrop-filter: blur(8px); }
.busca label { display: block; font-size: 13px; color: var(--mudo); }
.busca-rotulo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.meu { font: 600 13px var(--corpo); color: var(--acento); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.busca-linha { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.busca input { min-width: 0; font: inherit; font-size: 16px; color: var(--texto); background: #0b0d09; border: 1px solid var(--linha); border-radius: var(--r); padding: 10px 12px; }
.busca input::placeholder { color: #9a978b; }
.busca input:focus-visible, .btn:focus-visible, .abas button:focus-visible, .linha:focus-visible, .sugestoes li:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.aviso { margin: 8px 0 0; font-size: 15px; color: var(--texto); border-left: 3px solid var(--acento); padding-left: 10px; }
.sugestoes { position: absolute; left: 10px; right: 10px; top: calc(100% - 4px); margin: 0; padding: 4px; list-style: none; background: var(--painel-solido); border: 1px solid var(--linha); border-radius: var(--r); z-index: 5; max-height: 40vh; overflow: auto; }
.sugestoes li { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.sugestoes li:hover, .sugestoes li[aria-selected="true"] { background: rgba(255, 106, 69, .16); }
.sugestoes small { color: var(--mudo); }

.btn { font: 600 15px var(--corpo); color: var(--texto); background: transparent; border: 1px solid var(--linha); border-radius: var(--r); padding: 10px 14px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s ease, background .12s ease; }
.btn:hover { background: rgba(236, 233, 225, .08); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primario { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.btn-primario:hover { background: #ff7d5c; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.contagem { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--painel); border: 1px solid var(--linha); border-radius: var(--r); backdrop-filter: blur(8px); align-self: start; }
.contagem div { padding: 6px 10px; display: flex; flex-direction: column; border-left: 1px solid var(--linha); min-width: 0; }
.contagem div:first-child { border-left: 0; }
.contagem b { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.contagem span { font-size: 13px; color: var(--mudo); }
.contagem .alerta b { color: var(--acento); }

.painel { background: var(--painel); border: 1px solid var(--linha); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; backdrop-filter: blur(8px); margin: 0 -12px; padding: 0 12px; max-height: 32dvh; display: flex; flex-direction: column; align-self: end; }
.abas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--linha); }
.abas button { font: 600 14px var(--corpo); color: var(--mudo); background: transparent; border: 0; border-radius: 6px; padding: 8px 4px; cursor: pointer; }
.abas button[aria-selected="true"] { color: var(--acento-texto); background: var(--texto); }
.painel-corpo { overflow: auto; padding: 8px 0 max(12px, env(safe-area-inset-bottom)); }

.linha { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--linha); padding: 8px 2px; cursor: pointer; }
.linha:last-child { border-bottom: 0; }
.linha:hover { background: rgba(236, 233, 225, .05); }
.linha .nome { font-weight: 600; }
.linha .num { font-family: var(--display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; text-align: right; }
.linha .sub { font-size: 14px; color: var(--mudo); }
.linha .sub.risco { color: var(--acento); }
.linha .sub.segura { color: var(--ok); }
.medidor { grid-column: 1 / -1; height: 5px; background: rgba(236, 233, 225, .14); border-radius: 3px; overflow: hidden; }
.medidor i { display: block; height: 100%; background: var(--ok); }
.medidor i.risco { background: var(--acento); }
.vazio { color: var(--mudo); margin: 10px 0; }
.esq { display: grid; gap: 10px; padding: 6px 0; }
.esq i { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, rgba(236, 233, 225, .08), rgba(236, 233, 225, .18), rgba(236, 233, 225, .08)); background-size: 200% 100%; animation: brilho 1.4s linear infinite; }
@keyframes brilho { to { background-position: -200% 0; } }
.regras { margin: 4px 0; padding-left: 22px; display: grid; gap: 8px; }
.regras li::marker { font-family: var(--display); font-weight: 800; color: var(--acento); }
.nota { color: var(--mudo); font-size: 13px; margin: 10px 0 0; }

.cartao { background: var(--painel-solido); border: 1px solid var(--linha); border-radius: var(--r); padding: 14px; align-self: end; margin-bottom: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.cartao-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cartao h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: .01em; overflow-wrap: anywhere; }
.cartao .onde { color: var(--mudo); margin: 4px 0 0; }
.selo { display: inline-block; font-family: var(--display); font-weight: 800; letter-spacing: .08em; font-size: 14px; text-transform: uppercase; background: var(--texto); color: var(--acento-texto); border-radius: 6px; padding: 1px 8px; vertical-align: middle; margin-left: 6px; }
.selo.queda { background: var(--acento); }
.selo.classe { background: transparent; color: var(--texto); box-shadow: inset 0 0 0 1px var(--texto); }
.selo.retomada { background: #f2b84b; color: #211708; }
.linha.estatico { cursor: default; }
.linha.estatico:hover { background: transparent; }
.linha .nome small { color: var(--mudo); font-weight: 400; }
.muro-linha, .classes-linha { margin: 8px 0 0; font-size: 14px; }
.muro-linha span { color: var(--mudo); font-size: 13px; margin-left: 4px; }
.medidor i.ok { background: var(--ok); }
.fechar { font-size: 22px; line-height: 1; padding: 6px 12px; }
.dados { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.dados div { border-top: 1px solid var(--linha); padding-top: 6px; }
.dados b { display: block; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.dados span { font-size: 13px; color: var(--mudo); }
.noite { border: 1px solid var(--linha); border-radius: var(--r); padding: 10px; margin: 0 0 12px; }
.noite p { margin: 0 0 6px; font-size: 14px; }
.noite strong { font-family: var(--display); font-weight: 800; font-size: 20px; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.alerta-texto { color: var(--acento); }

.carregando { position: fixed; inset: 0; z-index: 20; background: var(--fundo); display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 20px; transition: opacity .5s; }
.carregando.fim { opacity: 0; pointer-events: none; }
.carregando-marca { font-family: var(--display); font-weight: 800; font-size: 40px; letter-spacing: .05em; text-transform: uppercase; }
.barra { width: min(280px, 70vw); height: 4px; background: rgba(236, 233, 225, .16); border-radius: 2px; overflow: hidden; }
.barra i { display: block; height: 100%; width: 5%; background: var(--acento); transition: width .3s ease; }
.carregando p { margin: 0; color: var(--mudo); }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--texto); color: var(--acento-texto); font-weight: 600; padding: 10px 16px; border-radius: var(--r); z-index: 30; }

body.video #ui, body.video .carregando { display: none; }
body.video #c { position: fixed; left: 0; top: 0; width: 1080px; height: 1920px; }

.relogio { flex-basis: 100%; order: 3; margin-top: -2px; font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--texto); text-shadow: 0 1px 6px rgba(0, 0, 0, .7); white-space: nowrap; }
.relogio.perto { color: var(--acento); font-weight: 800; }
.nota.destaque { color: var(--texto); font-size: 14px; margin-top: 4px; }
.nota.destaque b { color: var(--acento); }
.pino { position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; background: rgba(12, 13, 10, .9); border: 2px solid var(--acento); border-radius: 10px; padding: 5px 12px 6px; text-align: center; white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); transition: opacity .2s; will-change: transform; }
.pino::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; background: inherit; border: inherit; border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
.pino b { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.05; }
.pino span { display: block; font-size: 13px; font-weight: 600; }
.pino .queda { color: var(--acento); }
.pino .ok { color: var(--ok); }
body.video .pino { display: none !important; }

@media (min-width: 900px) {
  #ui { grid-template-columns: 340px 1fr 380px; grid-template-rows: auto 1fr; padding: 14px 16px 16px; gap: 12px; }
  .topo { grid-column: 1; grid-row: 1; }
  .contagem { grid-column: 3; grid-row: 1; align-self: start; }
  .cartao { grid-column: 1; grid-row: 2; align-self: start; margin: 0; }
  .painel { grid-column: 3; grid-row: 2; max-height: none; margin: 0; border: 1px solid var(--linha); border-radius: var(--r); padding: 0 14px; align-self: stretch; min-height: 0; }
  .painel-corpo { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .esq i { animation: none; } .carregando, .btn { transition: none; } }
@media (prefers-reduced-transparency: reduce) { .busca, .contagem, .painel { backdrop-filter: none; background: var(--painel-solido); } }
@media (max-width: 899px) {
  body.com-cartao .painel { display: none; }
  .cartao { margin: 0 -4px max(10px, env(safe-area-inset-bottom)); padding: 12px; }
  .cartao h2 { font-size: 28px; }
  .dados { margin: 8px 0; }
  .dados b { font-size: 20px; }
}
