/* plopx overlay — transparent, OBS-ready. Warm "fill it up" energy.
   Standalone for now; folds into strmrx-core chrome in a later milestone. */
:root {
  --accent: #ff9f1c;
  --accent-soft: #ffd199;
  --ink: #fff;
  --panel: rgba(14, 16, 22, 0.78);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: transparent;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

#jar {
  display: block;
  width: 100%;
  height: 100%;
}

/* Celebration FX ---------------------------------------------------------- */
/* celebrate.js owns these; it creates them at boot and appends them to #stage.
   Both sit above the jar + HUD (the goal moment is momentary and takes over),
   and never catch pointer events so they can't interfere with OBS. */
#fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#celebrate-text {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 6;
  pointer-events: none;
  max-width: 92vw;
  text-align: center;
  font-weight: 800;
  font-size: clamp(42px, 7.5vw, 128px);
  line-height: 1.02;
  letter-spacing: 0.5px;
  color: #fff;
  --glow: #ff9f1c;
  text-shadow:
    0 2px 2px rgba(0, 0, 0, 0.45),
    0 0 18px var(--glow),
    0 0 44px var(--glow);
  will-change: transform, opacity;
}

/* HUD -------------------------------------------------------------------- */
/* Layout stays here; the per-element knobs (font / color / size / bar look)
   come in as CSS custom properties set by overlay.js from the URL params, and
   the HUD's position/transform is set inline by overlay.js from ?hudAnchor. */
#hud {
  --label-font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --label-color: #fff;
  --label-size: 34px;
  --num-font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --num-color: rgba(255, 255, 255, 0.92);
  --num-size: 18px;
  --bar-fill: linear-gradient(90deg, var(--accent-soft), var(--accent));
  --bar-glow: var(--accent);
  --bar-track: rgba(255, 255, 255, 0.16);
  --bar-h: 10px;
  --bar-radius: 999px;

  position: fixed;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  width: min(420px, 60vw);
  text-align: center;
  color: var(--ink);
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

/* Hidden elements collapse out of the stack so order + spacing stay clean. */
#hud [data-hud][hidden] { display: none; }

#hud-label {
  order: 1;
  font-family: var(--label-font);
  font-size: var(--label-size);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0.2px;
  color: var(--label-color);
}

#hud-meter {
  order: 2;
  margin: 10px 0 8px;
  height: var(--bar-h);
  width: 100%;
  border-radius: var(--bar-radius);
  background: var(--bar-track);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

#hud-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--bar-fill);
  box-shadow: 0 0 16px var(--bar-glow);
  transition: width 0.45s var(--ease-out);
}

#hud-count {
  order: 3;
  font-family: var(--num-font);
  font-size: var(--num-size);
  font-weight: 700;
  opacity: 0.92;
  color: var(--num-color);
  font-variant-numeric: tabular-nums;
}

#hud.pop #hud-label {
  animation: pop 0.5s var(--ease-out);
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* Demo panel ------------------------------------------------------------- */
#demo[hidden] { display: none; }

#demo {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.demo-row {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

#demo-color {
  width: 34px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

#demo button {
  appearance: none;
  border: 0;
  padding: 9px 14px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.14s var(--ease-out), background 0.14s var(--ease-out);
}
#demo button:hover { background: rgba(255, 255, 255, 0.18); }
#demo button:active { transform: scale(0.96); }
#demo .demo-modes button.on,
#demo .demo-overflow button.on,
#demo .demo-styles button.on,
#demo .demo-vessels button.on,
#demo #demo-steam.on {
  background: linear-gradient(180deg, var(--accent), #e8860f);
  box-shadow: 0 4px 14px rgba(255, 159, 28, 0.4);
}

.demo-tag {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  padding: 0 4px;
}

.demo-slider { align-items: center; }
#demo-bounce, #demo-visc {
  width: 150px;
  accent-color: var(--accent);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  #hud-fill, #demo button { transition: none; }
  #hud.pop #hud-label { animation: none; }
}
