:root {
  --bg: #08090c;
  --card: #14161c;
  --ink: #f3f1ec;
  --soft: rgba(243, 241, 236, 0.56);
  --line: rgba(243, 241, 236, 0.1);
  --accent: #ff8a5c;
  --mid: #e8c27a;
  --tone: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.bm { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; width: min(352px, 100%); padding: 16px; border-radius: 26px; background: var(--card); box-shadow: inset 0 0 0 1.500px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 50px -30px #000000; transition: box-shadow 0.5s ease; }
.bm.is-stir { --tone: var(--mid); }
.bm.is-cry { --tone: var(--accent); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 60px -28px color-mix(in srgb, var(--accent) 45%, #000000); }
.bm__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 2px; }
.bm__what { display: grid; gap: 1px; min-width: 0; }
.bm__what strong { font-size: 16px; line-height: 20px; font-weight: 720; letter-spacing: -0.01em; white-space: nowrap; }
.bm__what span { font-size: 12px; line-height: 16px; font-weight: 560; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm__clip { display: block; height: 16px; line-height: 16px; overflow: hidden; white-space: nowrap; }
.bm__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }
.bm__pill { flex: none; height: 26px; padding: 5px 11px; border-radius: 13px; background: color-mix(in srgb, var(--tone) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 26%, transparent); font-size: 12px; font-weight: 680; color: var(--tone); transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease; }

/* the strip: the bars are built and moved by the script, the newest on the right */
.bm__strip { position: relative; height: 96px; border-radius: 16px; background: rgba(0, 0, 0, 0.32); box-shadow: inset 0 0 0 1px rgba(243, 241, 236, 0.05); overflow: hidden; cursor: crosshair; touch-action: pan-y; }
.bm__svg { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%); mask-image: linear-gradient(90deg, transparent 0, #000 16%); }
.bm__svg rect { fill: rgba(243, 241, 236, 0.78); }
.bm__svg rect.is-mid { fill: var(--mid); }
.bm__svg rect.is-over { fill: var(--accent); }
.bm__limit { stroke: rgba(243, 241, 236, 0.2); stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.bm__hair { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity 0.2s ease; }
.bm__strip.is-read .bm__hair { opacity: 0.7; }
.bm__tip { position: absolute; left: 0; top: 7px; display: flex; gap: 6px; align-items: baseline; height: 22px; padding: 0 8px; border-radius: 11px; background: rgba(243, 241, 236, 0.14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(243, 241, 236, 0.16); font-size: 11px; line-height: 22px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; }
.bm__tip b { font-weight: 720; }
.bm__tip i { font-style: normal; font-weight: 560; color: var(--soft); }
.bm__strip.is-read .bm__tip { opacity: 1; }

.bm__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 3px; font-size: 12.500px; font-weight: 600; }
.bm__since { min-width: 0; color: var(--tone); transition: color 0.4s ease; }
.bm__room { flex: none; display: flex; align-items: center; gap: 7px; color: var(--soft); white-space: nowrap; }
.bm__room i { display: block; width: 1px; height: 10px; background: rgba(243, 241, 236, 0.22); }

.bm__btn { position: relative; display: flex; justify-content: center; align-items: center; gap: 9px; height: 44px; border-radius: 22px; background: var(--ink); color: #14161c; font-size: 14px; font-weight: 720; white-space: nowrap; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 12px 18px -12px rgba(0, 0, 0, 0.9); transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease; }
.bm__btn[aria-pressed="true"] { background: rgba(243, 241, 236, 0.1); color: var(--ink); box-shadow: inset 0 0 0 1.500px rgba(243, 241, 236, 0.2); }
.bm__btn:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.bm__clip--btn { height: 18px; line-height: 18px; }
/* three small bars that play while the lullaby does */
.bm__eq { display: flex; align-items: center; gap: 2.500px; width: 14px; height: 14px; }
.bm__eq i { display: block; width: 3px; height: 14px; border-radius: 1.500px; background: currentColor; transform: scaleY(0.3); }
.bm__btn[aria-pressed="true"] .bm__eq i { animation: bm-eq 0.9s ease-in-out infinite alternate; }
.bm__btn[aria-pressed="true"] .bm__eq i:nth-child(2) { animation-duration: 0.62s; animation-delay: -0.3s; }
.bm__btn[aria-pressed="true"] .bm__eq i:nth-child(3) { animation-duration: 0.78s; animation-delay: -0.5s; }
@keyframes bm-eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #f3f1ec; stroke: #08090c; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); z-index: 6; }

@media (max-width: 350px) { .bm { padding: 14px 12px; } .bm__row { font-size: 12px; } }
@media (max-height: 400px) { .bm { gap: 11px; } .bm__strip { height: 84px; } }
@media (prefers-reduced-motion: reduce) { .bm, .bm__pill, .bm__since, .bm__btn, .bm__hair, .bm__tip { transition: none; } .bm__btn[aria-pressed="true"] .bm__eq i { animation: none; transform: scaleY(0.7); } }
