/* LUMBRE Web test. Palette from /branding/palette.md: ember on near-black. */
:root {
  --ember: #FF6B2C;
  --ink: #F5F2EF;
  --muted: #8A8A93;
  --bg: #0B0B0D;
  --panel: rgba(11, 11, 13, 0.86);
  --line: rgba(255, 255, 255, 0.14);
  --ok: #5BD68A;
  --warn: #FFC24B;
  --bad: #FF5A5A;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--ink); }
body.stage { overflow: hidden; overscroll-behavior: none; touch-action: none; }
body.stage.clean { cursor: none; }
a { color: var(--ember); }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }

.overlay { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 12px;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  background: radial-gradient(circle at 50% 40%, #1A1210, #0B0B0D); }
.overlay[hidden] { display: none; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: 3px; }
.brand span { color: var(--ember); }
h1 { font-size: clamp(26px, 7vw, 48px); font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
h1 em { color: var(--ember); font-style: normal; }
.lead { color: var(--muted); max-width: 440px; line-height: 1.5; }

button { font: inherit; color: inherit; }
.big { background: var(--ember); color: #0B0B0D; border: 0; font-weight: 700; font-size: 17px;
  padding: 15px 26px; border-radius: 12px; cursor: pointer; min-width: 240px;
  box-shadow: 0 8px 30px rgba(255, 107, 44, 0.3); }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 12px; cursor: pointer; font-size: 15px; min-width: 240px; }
.big:disabled, .ghost:disabled { opacity: .45; cursor: wait; }
.chip { background: #17171C; border: 1px solid var(--line); color: var(--ink);
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--ember); color: #0B0B0D; border-color: transparent; font-weight: 700; }
.chip.danger.on { background: var(--bad); color: #fff; }

/* HUD: fades out after a few seconds, a tap brings it back. */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; transition: opacity .3s; }
#hud.hidden { opacity: 0; }
#hud.hidden * { pointer-events: none !important; }
.bar { position: absolute; left: 0; right: 0; pointer-events: auto; background: var(--panel);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 10px 14px; }
.bar.top { top: 0; padding-top: calc(10px + var(--safe-top)); border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bar.bottom { bottom: 0; padding-bottom: calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row + .row { margin-top: 10px; }
.scroll { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.grow { flex: 1; }

.bpm b { font-size: 22px; font-variant-numeric: tabular-nums; }
.bpm span { font-size: 11px; color: var(--muted); margin-left: 3px; }
.pill { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 3px 9px; }
.pill.good { color: var(--ok); border-color: rgba(91,214,138,.4); }
.pill.warn { color: var(--warn); border-color: rgba(255,194,75,.4); }
.pill.bad { color: var(--bad); border-color: rgba(255,90,90,.45); }
.meter { width: 70px; height: 7px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ember); }
label.ctl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
input[type=range] { accent-color: var(--ember); width: 120px; }
select { background: #17171C; color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px; font-size: 13px; max-width: 220px; }

/* Pairing card */
.card { background: #141417; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
#pair { position: fixed; z-index: 20; right: 16px; top: calc(70px + var(--safe-top));
  width: min(320px, calc(100vw - 32px)); text-align: center; }
#pair[hidden] { display: none; }
#pair .qr { background: #fff; border-radius: 10px; padding: 10px; margin: 10px auto; width: 220px; }
#pair .qr svg { display: block; width: 100%; height: auto; }
#pair .code { font-size: 26px; font-weight: 800; letter-spacing: 4px; }
#packs { position: fixed; z-index: 20; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 190px); overflow-y: auto; touch-action: pan-y; }
#packs[hidden] { display: none; }
.packgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pack { position: relative; background: #0f0f12; border: 1px solid var(--line); border-radius: 10px; padding: 0;
  overflow: hidden; cursor: pointer; text-align: left; }
.pack img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #1a1a1f; }
.pack span { display: block; padding: 6px 7px 7px; font-size: 11.5px; line-height: 1.25; }
.pack small { color: var(--muted); display: block; }
.pack.on { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember); }
.pack .prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--ember); }
.small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.url { font-size: 11px; word-break: break-all; color: var(--muted); }

#toast { position: fixed; z-index: 40; left: 50%; bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%); background: #1d1d22; border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .25s;
  pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }

/* Plain pages: lab, export, remote, home */
body.page { padding: calc(20px + var(--safe-top)) 16px calc(28px + var(--safe-bottom)); }
.wrap { max-width: 760px; margin: 0 auto; }
.page h1 { margin: 6px 0 6px; }
.page h2 { font-size: 17px; margin: 0 0 8px; }
.page section { margin-top: 16px; }
.page p { line-height: 1.5; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { font-variant-numeric: tabular-nums; word-break: break-word; }
.yes { color: var(--ok); } .no { color: var(--bad); } .meh { color: var(--warn); }
canvas.chart { width: 100%; height: 120px; background: #0f0f12; border: 1px solid var(--line); border-radius: 10px; display: block; }
textarea, input[type=text] { width: 100%; background: #17171C; color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; font-size: 14px; }
progress { width: 100%; height: 10px; accent-color: var(--ember); }
.tiles a { display: block; text-decoration: none; color: var(--ink); }
.tiles .card b { display: block; font-size: 17px; margin-bottom: 4px; }
