:root {
  --ink: #0f0f0f;
  --paper: #ffffff;
  --mist: #f1f0ed;
  --bg: #f6f4ef;
  --accent: #ff5a3c;
  --muted: rgba(15, 15, 15, .55);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Manrope, system-ui, sans-serif; color: var(--ink); overflow: hidden;
  background: var(--bg);
  /* the Pagii hairline grid */
  background-image: linear-gradient(rgba(0,0,0,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 38px 38px; background-position: center;
}
.stage { position: relative; width: 100%; height: 100dvh; }
#face { position: absolute; inset: 0; width: 100%; height: 100%; }

.top { position: absolute; left: 16px; right: 16px; top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
.badge, .mood {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--paper); box-shadow: 0 6px 20px rgba(0,0,0,.08); font-weight: 700; font-size: 14px;
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255,90,60,.18); }
.mood { transition: transform .3s cubic-bezier(.2,1.6,.4,1); }
.mood.pop { transform: scale(1.12); }

.cam { position: absolute; right: 16px; bottom: 16px; width: min(26vw, 220px); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.cam video, .cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.bars { position: absolute; left: 16px; bottom: 16px; display: grid; gap: 6px; width: min(42vw, 260px); padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,.08); list-style: none; font-size: 12px; font-weight: 600; }
.bars li { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; }
.bars span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars b { display: block; height: 6px; border-radius: 3px; background: var(--mist); overflow: hidden; }
.bars b::after { content: ""; display: block; height: 100%; width: calc(var(--v, 0) * 100%); background: var(--ink); border-radius: 3px; transition: width .08s linear; }

.start { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(246,244,239,.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .4s; }
.start.off { opacity: 0; pointer-events: none; }
.start__card { max-width: 380px; padding: 28px; border-radius: 18px; background: var(--paper); box-shadow: 0 20px 50px rgba(0,0,0,.12); text-align: center; display: grid; gap: 14px; }
.start__card h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.start__card p { color: var(--muted); line-height: 1.45; }
.start__card button { height: 48px; border: 0; border-radius: 12px; background: var(--ink); color: var(--paper); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.start__card button:disabled { opacity: .5; cursor: wait; }
.start__card small { color: var(--muted); }

@media (max-width: 640px) {
  .bars { width: calc(100% - 32px); bottom: auto; top: 64px; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .bars li { grid-template-columns: 70px 1fr; }
  .cam { width: 34vw; }
}
