@font-face { font-family: "Space Grotesk"; font-weight: 400; src: url(fonts/SpaceGrotesk_400Regular.ttf); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 500; src: url(fonts/SpaceGrotesk_500Medium.ttf); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 600; src: url(fonts/SpaceGrotesk_600SemiBold.ttf); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 700; src: url(fonts/SpaceGrotesk_700Bold.ttf); font-display: swap; }

:root {
  --bg: #111317;
  --panel-low: #1a1c1f;
  --panel: #1e2023;
  --panel-high: #282a2d;
  --panel-lowest: #0c0e11;
  --border: #2d3440;
  --text: #e2e2e6;
  --text-dim: #ddc1b1;
  --muted: #a58c7d;
  --fire: #ff8a2b;
  --fire-soft: #ffb787;
  --green: #43e188;
  --danger: #ffb4ab;
  --rec: #ff3b30;
  --on-fire: #502400;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

#app { max-width: 560px; margin: 0 auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body.focus .header, body.focus #panel { display: none; }

.header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 16px 10px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-icon { width: 34px; height: 34px; object-fit: contain; }
.brand-name { color: var(--fire); font-weight: 700; font-size: 10px; letter-spacing: 1.4px; }
.title { font-weight: 700; font-size: 20px; line-height: 24px; }
.header-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pill { color: var(--muted); font-weight: 500; font-size: 11px; border: 1px solid var(--border); background: var(--panel-low); border-radius: 999px; padding: 4px 10px; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lang { appearance: none; background: var(--panel-low); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--text-dim); text-align: center; }

.body { padding: 0 16px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
body.focus .body { padding: calc(8px + env(safe-area-inset-top)) 0 0; gap: 12px; }

.toast { width: 100%; display: flex; align-items: center; gap: 8px; background: var(--panel-low); border: 1px solid var(--border); border-radius: 14px; padding: 9px 12px; color: var(--text-dim); font-size: 12.5px; font-weight: 500; }
.toast span { flex: 1; }
.toast-btn { background: var(--fire); color: var(--on-fire); font-weight: 700; border-radius: 999px; padding: 6px 14px; font-size: 13px; }

/* o palco tem a proporção do vídeo e cabe na tela */
.stage-frame { padding: 6px; background: var(--panel-low); border: 1px solid var(--border); border-radius: 24px; max-width: 100%; }
body.focus .stage-frame { padding: 0; background: none; border: 0; border-radius: 0; }
.stage { position: relative; background: #000; overflow: hidden; border-radius: 18px; width: min(calc(100vw - 46px), calc(var(--maxh, 70dvh) * var(--ar, 0.5625)), 520px); aspect-ratio: var(--ar, 0.5625); }
body.focus .stage { width: min(100vw, calc((100dvh - 110px) * var(--ar, 0.5625))); border-radius: 0; --maxh: 100dvh; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video { object-fit: fill; }
.stage video.mirror { transform: scaleX(-1); }
.hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; padding: 8px; background: rgba(0, 0, 0, .55); font-size: 13px; font-weight: 500; color: #fff; }
.hint:empty { display: none; }
.rec { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .55); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 13px; color: #fff; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: blink 1s infinite; }
.countdown { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); pointer-events: none; }
.countdown-num { font-weight: 700; font-size: min(40vw, 160px); line-height: 1; color: #fff; text-shadow: 0 0 12px rgba(0, 0, 0, .6); }
.countdown-label { color: #ffb02b; font-weight: 700; font-size: 18px; letter-spacing: 2px; }

.focus-bar { width: 100%; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); }
.stop-big { width: 100%; height: 72px; border-radius: 28px; background: var(--rec); color: #fff; font-weight: 700; font-size: 20px; letter-spacing: 1.2px; }

#panel { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; gap: 8px; }
.label { color: var(--text-dim); font-weight: 600; font-size: 11px; letter-spacing: 1.1px; }
.label-accent { color: var(--fire-soft); font-weight: 500; font-size: 11px; }
.live { color: var(--green); font-weight: 700; font-size: 11px; letter-spacing: .8px; }
.grid { display: flex; gap: 8px; }
.spacer { flex: 1; }

.chip { flex: 1; height: 44px; border-radius: 16px; border: 1px solid var(--border); background: var(--panel-low); color: var(--text-dim); font-weight: 600; font-size: 13px; }
.chip.on { background: var(--panel); border: 1.5px solid var(--fire); color: var(--fire-soft); font-weight: 700; }
.toggle { flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 16px; border: 1px solid var(--border); background: var(--panel-low); color: var(--text-dim); font-weight: 600; font-size: 11.5px; line-height: 14px; padding: 4px 8px; text-align: center; }
.toggle::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.toggle.on { border-color: var(--fire); background: var(--panel); color: var(--text); }
.toggle.on::before { background: var(--fire); }

.btn { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 18px; border: 1px solid var(--border); background: var(--panel-low); color: var(--text); font-weight: 600; font-size: 14px; }
.btn.primary { background: var(--fire); border-color: var(--fire); color: var(--on-fire); font-weight: 700; }
.btn:disabled, .icon-btn:disabled, .icon-btn.disabled { opacity: .4; cursor: default; }
.icons { gap: 8px; }
.icon-btn { flex: 1; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px; border: 1px solid var(--border); background: var(--panel-low); color: var(--text-dim); font-weight: 500; font-size: 10px; letter-spacing: .4px; cursor: pointer; }
.icon-btn .ic { font-size: 22px; line-height: 1; color: var(--text); font-weight: 400; }
.icon-btn .rec-ic { color: var(--rec); }
.btn:active, .icon-btn:active, .chip:active { transform: scale(.97); }

.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { flex: 1 1 calc(50% - 10px); min-height: 96px; background: var(--panel-low); border: 1px solid var(--border); border-radius: 22px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile.hot { border-color: var(--fire); }
.tile-k { color: var(--text-dim); font-weight: 500; font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase; }
.tile-row { display: flex; align-items: baseline; gap: 6px; }
.tile-v { font-weight: 700; font-size: 28px; line-height: 36px; font-variant-numeric: tabular-nums; }
.tile.hot .tile-v { color: var(--fire); }
.tile-u { color: var(--text-dim); font-weight: 500; font-size: 11px; letter-spacing: .6px; }
.tile-sub { color: var(--muted); font-weight: 500; font-size: 11px; }
.tile-bar { height: 4px; border-radius: 2px; background: var(--panel-high); overflow: hidden; margin: 2px 0; }
.tile-bar i { display: block; height: 100%; background: var(--fire); border-radius: 2px; }

.weight-card { background: var(--panel-low); border: 1px solid var(--border); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.weight-row { display: flex; align-items: center; justify-content: space-between; }
.weight-label { font-weight: 600; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 4px 6px; }
.stepper button { width: 34px; height: 34px; color: var(--text-dim); font-weight: 700; font-size: 20px; }
.stepper span { color: var(--fire-soft); font-weight: 700; font-size: 14px; min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.note { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 16px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.foot a { color: var(--fire-soft); }

@keyframes blink { 50% { opacity: .3; } }

.install { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--fire); border-radius: 16px; padding: 10px 12px; }
body.focus .install { display: none; }
.install-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-dim); line-height: 17px; }
.install-text b { color: var(--text); font-size: 13.5px; }
.install-btn { background: var(--fire); color: var(--on-fire); font-weight: 700; border-radius: 999px; padding: 8px 16px; }
.install-x { color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 6px; }

.stage video.cover { object-fit: cover; }

/* sem câmera/vídeo: some com o ícone de play que alguns WebViews desenham sobre um <video> vazio */
.stage.idle video { visibility: hidden; }
