/* JustChug demo — chrome + layout. The glass itself is painted on <canvas> by demo.js. */
:root {
  --bg: #fffaf3;
  --text: #1a1410;
  --muted: #6b5e52;
  --accent: #ff6b35;
  --accent-hot: #ff8f5a;
  --accent2: #b45309;
  --blob1: #ffb088;
  --blob2: #ffe0a3;
  --frost: rgba(255, 250, 243, 0.74);
  font-family: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Same soft orange blobs as the landing page (visible in Shot mode). */
.bg-blob {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}
.blob-1 { top: -120px; right: -80px; background: var(--blob1); }
.blob-2 { bottom: 10%; left: -120px; background: var(--blob2); }

/* ---------- Glass canvas ---------- */
.stage {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  margin: 0;
}
#glass {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Frosted chrome (keeps the pour immersive) ---------- */
.pill {
  font: 600 0.88rem/1.2 Inter, system-ui, sans-serif;
  color: var(--text);
  text-decoration: none;
  background: var(--frost);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  box-shadow: 0 6px 20px rgba(26, 20, 16, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
button.pill { cursor: pointer; }
button.pill:active, .back:active { transform: scale(0.97); }

.bar {
  position: fixed;
  z-index: 5;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.9rem, env(safe-area-inset-right)) 0 max(0.9rem, env(safe-area-inset-left));
  pointer-events: none; /* empty space passes drags through to the glass */
}
.bar > * { pointer-events: auto; }
.logo { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }

.seg { display: flex; gap: 0.15rem; padding: 0.2rem; }
.mode {
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: 700 0.82rem Inter, system-ui, sans-serif;
  cursor: pointer;
}
.mode.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  color: #111;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}

.hint {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: calc(max(0.75rem, env(safe-area-inset-top)) + 3rem);
  transform: translateX(-50%);
  max-width: min(88vw, 24rem);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.hint.quiet { opacity: 0; }

.dock {
  position: fixed;
  z-index: 5;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem max(0.8rem, env(safe-area-inset-bottom));
  pointer-events: none;
}
.dock > * { pointer-events: auto; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.9rem;
  min-height: 2.4rem;
}
.meter {
  width: min(34vw, 130px);
  height: 8px;
  border-radius: 999px;
  background: rgba(26, 20, 16, 0.12);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: var(--fill, 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
}
body.refilling .meter-fill { transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.status { margin: 0; font-size: 0.82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

.refill-inline {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  color: #111;
  font: 700 0.82rem Inter, system-ui, sans-serif;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.refill-inline[hidden], .enable[hidden] { display: none; }
body.is-empty .refill-inline { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge {
  0%, 55%, 100% { transform: rotate(0); }
  62% { transform: rotate(-4deg); }
  70% { transform: rotate(4deg); }
  78% { transform: rotate(-3deg); }
  86% { transform: rotate(2deg); }
}

/* Primary pill CTA — same recipe as the landing page's .btn-primary. */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.35rem;
  font: 700 0.95rem Inter, system-ui, sans-serif;
  color: #111;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: pointer;
}
.cta:active { transform: scale(0.98); }
.fine {
  margin: 0;
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 380px) {
  .back .logo { display: none; }
  .meter { width: 22vw; }
}
@media (prefers-reduced-motion: reduce) {
  body.is-empty .refill-inline { animation: none; }
  body.refilling .meter-fill { transition: none; }
}
