/* Poppet handheld virtual-pet egg toy stylesheet
   All colors, shadows, and typography resolve via tokens.css custom properties. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--poppet-page);
  color: var(--poppet-ink);
  font-family: var(--poppet-font-ui);
  font-weight: var(--poppet-weight-ui);
  -webkit-font-smoothing: antialiased;
}

html.poppet-is-lean-in,
body.poppet-is-lean-in {
  overflow: hidden;
  overscroll-behavior: none;
}

/* ------------------------------------------------------------------ */
/* Calm theme-tinted page stage with faint dot pattern                */
/* ------------------------------------------------------------------ */

.poppet-page {
  position: relative;
  min-height: 100dvh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 1.4vw, 16px) clamp(12px, 2vw, 24px)
    calc(10px + env(safe-area-inset-bottom, 0px));
  gap: 6px;
  background-color: var(--poppet-page);
  background-image:
    radial-gradient(circle, var(--poppet-page-pattern) 1.5px, transparent 1.7px),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--poppet-surface) 38%, var(--poppet-page)) 0%,
      var(--poppet-page) 62%,
      color-mix(in srgb, var(--poppet-shell-top-hi) 24%, var(--poppet-page)) 100%
    );
  background-size: 24px 24px, 100% 100%;
  transition: background-color 240ms var(--poppet-ease);
}

/* Adjustable Realistic Urban & Landscape Photo Backgrounds (CC0 Public Domain) */
.poppet-page[data-bg="urban"] {
  background-color: #161420;
  background-image:
    radial-gradient(ellipse at 50% 42%, rgba(10, 10, 16, 0.14) 36%, rgba(8, 8, 14, 0.56) 100%),
    url("/assets/bg-urban.jpg");
  background-size: cover;
  background-position: center;
}

.poppet-page[data-bg="landscape"] {
  background-color: #1e2d34;
  background-image:
    radial-gradient(ellipse at 50% 42%, rgba(10, 16, 20, 0.1) 38%, rgba(8, 14, 18, 0.48) 100%),
    url("/assets/bg-landscape.jpg");
  background-size: cover;
  background-position: center;
}

.poppet-page[data-bg="custom"] {
  background-color: #161820;
  background-image:
    radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0.14) 35%, rgba(0, 0, 0, 0.52) 100%),
    var(--poppet-custom-bg, none);
  background-size: cover;
  background-position: center;
}

.poppet-header,
.poppet-main,
.poppet-footer {
  width: 100%;
  max-width: 1200px;
}

.poppet-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.poppet-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.poppet-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--poppet-ink-soft);
  transition: background-color 200ms var(--poppet-ease), border-color 200ms var(--poppet-ease);
}

.poppet-page:not([data-bg="default"]) .poppet-brand {
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--poppet-surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--poppet-ink) 16%, transparent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  color: var(--poppet-ink);
}

.poppet-page:not([data-bg="default"]) .poppet-wordmark {
  color: var(--poppet-ink);
}

.poppet-logo-badge {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(
    180deg,
    var(--poppet-shell-top-hi) 0%,
    var(--poppet-shell-top) 54%,
    var(--poppet-shell-bottom) 100%
  );
  border: 1px solid color-mix(in srgb, var(--poppet-ink) 20%, transparent);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--poppet-ink) 16%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.poppet-logo-sprite {
  --pet-sprite-size: 16px;
  width: var(--pet-sprite-size);
  height: var(--pet-sprite-size);
  background-image: url("/assets/pets/pip.png");
  background-repeat: no-repeat;
  background-size: calc(8 * var(--pet-sprite-size)) var(--pet-sprite-size);
  background-position-x: 0;
  background-position-y: 0;
  image-rendering: pixelated;
}

.poppet-wordmark {
  margin: 0;
  font-family: var(--poppet-font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--poppet-ink-soft);
}

.poppet-header-customize-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--poppet-ink) 18%, transparent);
  background: color-mix(in srgb, var(--poppet-surface) 82%, transparent);
  color: var(--poppet-ink-soft);
  font-family: var(--poppet-font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms var(--poppet-ease), color 140ms var(--poppet-ease);
}

.poppet-header-customize-btn:hover,
.poppet-header-customize-btn[aria-expanded="true"] {
  background: var(--poppet-surface);
  color: var(--poppet-ink);
}

.poppet-header-customize-btn:focus-visible {
  outline: 3px solid var(--poppet-ink);
  outline-offset: 2px;
}

.poppet-header-customize-btn .poppet-icon {
  width: 14px;
  height: 14px;
}

.poppet-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 4px;
}

.poppet-player {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Soft radial backdrop vignette when Lean-in View is active */
.poppet-lean-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 26%,
    color-mix(in srgb, var(--poppet-page) 45%, rgba(0, 0, 0, 0.56)) 78%,
    rgba(0, 0, 0, 0.68) 100%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 18;
  transition: opacity 420ms var(--poppet-ease);
}

.poppet-player[data-view="lean-in"] .poppet-lean-backdrop {
  opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Dolly Anchor + Device (strict 0.88:1 taller-than-wide egg ratio)   */
/* Desktop ~78vh (max ~720px), Mobile ~68vh, zero horizontal stretch  */
/* ------------------------------------------------------------------ */

/* Intro Logo overlay (appears on boot, shatters when the falling egg hits it) */
.poppet-intro-logo {
  position: fixed;
  inset: 0;
  z-index: 19;
  display: grid;
  place-items: center;
  pointer-events: none;
  user-select: none;
}

.poppet-intro-logo[hidden] {
  display: none;
}

.poppet-intro-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}

.poppet-intro-logo-word {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--poppet-font-ui);
  font-size: clamp(54px, 12vw, 92px);
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1;
  color: var(--poppet-wordmark-fill, var(--poppet-accent));
  -webkit-text-stroke: 10px var(--poppet-egg-bezel);
  paint-order: stroke fill;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.24));
}

.poppet-intro-shard {
  display: inline-block;
  transform-origin: 50% 65%;
  will-change: transform, opacity;
}

.poppet-intro-debris {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.poppet-intro-debris > i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--poppet-wordmark-fill, var(--poppet-accent));
  border: 2px solid var(--poppet-egg-bezel);
  opacity: 0;
  will-change: transform, opacity;
}

.poppet-intro-debris > i:nth-child(even) {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--poppet-egg-bezel);
  border-color: var(--poppet-wordmark-fill, var(--poppet-accent));
}

.poppet-dolly-anchor {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: var(--lean-origin-x, 50%) var(--lean-origin-y, 50%);
  transform: translate(var(--lean-tx, 0px), var(--lean-ty, 0px))
    scale(var(--lean-scale, 1));
  transition: transform 650ms var(--poppet-dolly-ease);
}

.poppet-player[data-measuring-lean] .poppet-dolly-anchor,
.poppet-player[data-measuring-lean] .poppet-device,
.poppet-player[data-measuring-lean] .poppet-tilt-stage {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

.poppet-player[data-view-fading] .poppet-dolly-anchor {
  opacity: 0;
  transition: opacity 100ms ease;
}

.poppet-player[data-view="lean-in"] {
  --lean-inv: calc(1 / var(--lean-scale, 1));
}

.poppet-device {
  position: relative;
  width: min(calc(100vw - 24px), calc(78dvh * 0.88), calc(720px * 0.88));
  aspect-ratio: 0.88 / 1;
  height: auto;
  flex-shrink: 0;
  transform-origin: 50% -26vh;
  animation: poppet-sway 4s ease-in-out infinite;
  will-change: transform;
  backface-visibility: hidden;
}

@keyframes poppet-sway {
  0%,
  50%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(1.5deg);
  }
  75% {
    transform: rotate(-1.5deg);
  }
}

.poppet-player[data-view="lean-in"] .poppet-device {
  animation: none;
  transform: none;
}

.poppet-device[data-steady],
.poppet-device[data-physics-active],
.poppet-player[data-intro="running"] .poppet-device {
  animation: none;
}

.poppet-device:not([data-steady]):not([data-view="lean-in"]):not([data-fullscreen]) {
  cursor: grab;
}

.poppet-device[data-dragging] {
  cursor: grabbing !important;
  user-select: none;
}

.poppet-device[data-physics-active],
.poppet-player[data-intro="running"] .poppet-device {
  will-change: translate, rotate;
}

/* Pre-paint gate: hold egg above viewport until intro.js measures & starts (4s failsafe) */
html[data-poppet-intro="pending"] .poppet-device {
  animation: poppet-intro-failsafe 0s 4s forwards;
  translate: 0 -150vh;
}

@keyframes poppet-intro-failsafe {
  to {
    translate: 0 0;
  }
}

.poppet-tilt-stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform: perspective(1000px) rotateX(var(--egg-tilt-x, 0deg))
    rotateY(var(--egg-tilt-y, 0deg));
  transition: transform 140ms ease-out;
}

.poppet-device[data-steady] .poppet-tilt-stage {
  transition: transform 300ms linear(0, 0.25 10%, 0.7 25%, 1.02 45%, 1.01 60%, 1);
}

.poppet-player[data-view="lean-in"] .poppet-tilt-stage {
  transform: none;
}

/* Ball chain hanging from top center off-screen */
.poppet-ball-chain {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  width: 34px;
  height: 100vh;
  transform: translateX(-50%);
  transform-origin: bottom center;
  pointer-events: none;
  z-index: 0;
  transition: opacity 260ms var(--poppet-ease);
}

.poppet-player[data-view="lean-in"] .poppet-ball-chain {
  opacity: 0.15;
}

.poppet-ball-chain::before,
.poppet-ball-chain::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background-image:
    radial-gradient(
      circle at 36% 32%,
      var(--poppet-chain-hi) 0%,
      var(--poppet-chain-mid) 46%,
      var(--poppet-chain-lo) 76%,
      transparent 79%
    ),
    linear-gradient(
      90deg,
      transparent 2.5px,
      var(--poppet-chain-lo) 3.5px,
      var(--poppet-chain-mid) 4.5px,
      transparent 5.5px
    );
  background-size: 8px 9px, 8px 9px;
  background-repeat: repeat-y;
}

.poppet-ball-chain::before {
  left: 8px;
  transform: rotate(-1.5deg);
  transform-origin: bottom center;
  transition: transform 280ms var(--poppet-ease);
}

.poppet-ball-chain::after {
  right: 8px;
  transform: rotate(1.5deg);
  transform-origin: bottom center;
  transition: transform 280ms var(--poppet-ease);
}

.poppet-device[data-steady] .poppet-ball-chain::before,
.poppet-device[data-steady] .poppet-ball-chain::after {
  transform: rotate(0deg);
}

/* Small metallic clip on chain when steady is active */
.poppet-chain-clip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  width: 18px;
  height: 7px;
  transform: translateX(-50%) scaleY(0.6);
  border-radius: 2px;
  border: 1.5px solid var(--poppet-chain-lo);
  background: linear-gradient(180deg, var(--poppet-chain-hi), var(--poppet-chain-mid));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--poppet-ink) 28%, transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 180ms var(--poppet-ease), transform 220ms var(--poppet-ease);
}

.poppet-device[data-steady] .poppet-chain-clip {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

/* Steady pushpin toggle on the chain anchor / keyring loop (36px visual, >=44px hit area) */
.poppet-steady-pin {
  position: absolute;
  left: 50%;
  top: -32px;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--poppet-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--poppet-ease);
}

.poppet-steady-pin::before {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--poppet-surface) 84%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--poppet-ink) 32%, transparent);
  box-shadow: 0 2px 5px color-mix(in srgb, var(--poppet-ink) 20%, transparent);
  backdrop-filter: blur(4px);
  transition: background-color 140ms var(--poppet-ease), border-color 140ms var(--poppet-ease), transform 140ms var(--poppet-ease);
}

.poppet-steady-pin:hover::before {
  transform: scale(1.06);
  border-color: var(--poppet-ink);
}

.poppet-steady-pin[aria-pressed="true"]::before {
  background: var(--poppet-accent);
  border-color: var(--poppet-ink);
}

.poppet-steady-pin:focus-visible {
  outline: 3px solid var(--poppet-ink);
  outline-offset: 2px;
}

.poppet-steady-pin-icon {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.poppet-pin-outline {
  fill: var(--poppet-ink);
}

.poppet-pin-fill {
  fill: var(--poppet-surface);
  transition: fill 140ms var(--poppet-ease);
}

.poppet-pin-shine {
  fill: #ffffff;
}

.poppet-steady-pin[aria-pressed="true"] .poppet-pin-fill {
  fill: var(--poppet-on-accent);
}

/* Pixel tooltip for steady pin ("Hold steady" / "Let it swing") */
.poppet-steady-pin::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%) translateX(-2px);
  padding: 2px 6px;
  background: var(--poppet-lcd-bg);
  color: var(--poppet-lcd-ink);
  border: 1.5px solid var(--poppet-lcd-ink);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--poppet-ink) 26%, transparent);
  font-family: var(--poppet-font-time);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.poppet-steady-pin:hover::after,
.poppet-steady-pin:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.poppet-player[data-view="lean-in"] .poppet-steady-pin,
.poppet-player[data-view="lean-in"] .poppet-chain-clip,
.poppet-steady-pin[hidden] {
  display: none;
}

/* Intro impact pixel sparkles around the keyring loop */
.poppet-intro-sparkles {
  position: absolute;
  left: 50%;
  top: -6px;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

.poppet-intro-sparkles > i {
  position: absolute;
  left: -2px;
  top: -2px;
  width: 4px;
  height: 4px;
  background: var(--poppet-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--poppet-ink) 45%, transparent);
  image-rendering: pixelated;
  opacity: 0;
}

/* Soft grounded contact shadow under the egg */
.poppet-egg-shadow {
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 66%;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--poppet-ink) 28%, transparent) 0%,
    color-mix(in srgb, var(--poppet-ink) 12%, transparent) 48%,
    transparent 74%
  );
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
  transition: opacity 260ms var(--poppet-ease);
}

[data-theme="midnight"] .poppet-egg-shadow {
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.28) 52%,
    transparent 76%
  );
}

.poppet-player[data-view="lean-in"] .poppet-egg-shadow {
  opacity: 0;
}

/* Metallic keyring eyelet loop at top center */
.poppet-egg-loop {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 18px;
  border-radius: 999px;
  border: 3.5px solid var(--poppet-chain-mid);
  background: transparent;
  box-shadow:
    inset 0 1.5px 0 var(--poppet-chain-hi),
    0 2px 5px color-mix(in srgb, var(--poppet-ink) 22%, transparent);
  pointer-events: none;
  z-index: 3;
}

.poppet-egg-loop::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  width: 8px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid var(--poppet-chain-mid);
  box-shadow: inset 0 1px 0 var(--poppet-chain-hi);
}

/* Lazy-loaded 3D Three.js glossy egg canvas (clipped inside .poppet-egg-shell) */
.poppet-egg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 220ms var(--poppet-ease);
}

.poppet-device[data-egg-mode="webgl"] .poppet-egg-canvas {
  opacity: 1;
}

/* Unified egg shell overlay clipped to exact 0.88:1 silhouette */
.poppet-egg-shell {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: url(#poppet-egg-clip);
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
  transition: filter 420ms var(--poppet-ease);
}

.poppet-player[data-view="lean-in"] .poppet-egg-shell,
.poppet-player[data-view="lean-in"] .poppet-crack-svg,
.poppet-player[data-view="lean-in"] .poppet-abc-row {
  filter: blur(1.4px);
}

/* Solid continuous egg shell base gradient + glitter always stays rendered top-to-bottom */
.poppet-egg-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 1;
}

.poppet-egg-gradient {
  position: absolute;
  inset: 0;
  background: var(--poppet-shell-gradient);
}

.poppet-egg-glitter {
  position: absolute;
  inset: 0;
  opacity: calc(0.45 * var(--poppet-shell-glitter, 0));
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0.6px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.68) 0.5px, transparent 0.9px);
  background-size: 29px 29px, 19px 19px;
  background-position: 3px 7px, 11px 14px;
}

/* Inline SVG per-theme full-wrap artwork patterns */
.poppet-print-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.poppet-print-layer {
  display: none;
}

[data-theme="candy"] .poppet-print-layer--candy,
[data-theme="mint"] .poppet-print-layer--mint,
[data-theme="midnight"] .poppet-print-layer--midnight,
[data-theme="mono"] .poppet-print-layer--mono {
  display: block;
}

/* Specular highlight top-left, edge rim highlight & inner seam shadow */
.poppet-shell-gloss {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(
      46% 32% at 28% 18%,
      rgba(255, 255, 255, calc(var(--poppet-gloss, 0.45) * 0.85)) 0%,
      rgba(255, 255, 255, calc(var(--poppet-gloss, 0.45) * 0.2)) 48%,
      transparent 75%
    ),
    radial-gradient(
      85% 92% at 50% 48%,
      transparent 66%,
      rgba(255, 255, 255, 0.3) 89%,
      color-mix(in srgb, var(--poppet-ink) 20%, transparent) 100%
    );
  pointer-events: none;
}

/* Arched hand-lettered style "Poppet" wordmark along upper crown */
.poppet-shell-wordmark {
  position: absolute;
  top: 4.5%;
  left: 0;
  width: 100%;
  height: 25%;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px color-mix(in srgb, var(--poppet-ink) 28%, transparent));
}

.poppet-shell-wordmark-text {
  font-family: var(--poppet-font-ui);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 0.025em;
  fill: var(--poppet-wordmark-fill, var(--poppet-accent));
  stroke: var(--poppet-egg-bezel);
  stroke-width: 11px;
  stroke-linejoin: round;
  paint-order: stroke fill;
}

/* ------------------------------------------------------------------ */
/* Cracked eggshell window + square-ish 1:0.95 LCD bezel (50% width)  */
/* ------------------------------------------------------------------ */

.poppet-crack-svg {
  position: absolute;
  left: 50%;
  top: 23.6%;
  transform: translateX(-50%);
  width: 66%;
  aspect-ratio: 640 / 540;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
  transition: filter 420ms var(--poppet-ease);
}

.poppet-crack-shadow {
  fill: color-mix(in srgb, var(--poppet-ink) 38%, transparent);
  transform: translate(0, 3px);
}

.poppet-crack-rim {
  fill: url(#poppet-crack-cavity-grad);
  stroke: var(--poppet-crack-wall);
  stroke-width: 4px;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 color-mix(in srgb, var(--poppet-ink) 40%, transparent));
}

.poppet-crack-lines path {
  stroke: rgba(0, 0, 0, 0.24);
  stroke-width: 1.4px;
}

.poppet-lcd-bezel {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  width: 50%;
  aspect-ratio: 1 / 0.95;
  padding: clamp(3px, 0.7%, 5px);
  border-radius: 10px;
  background: var(--poppet-lcd-bg);
  border: 2px solid var(--poppet-lcd-border);
  box-shadow:
    inset 0 2px 6px color-mix(in srgb, var(--poppet-lcd-ink) 28%, transparent),
    0 1px 0 rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  z-index: 4;
  overflow: hidden;
  contain: layout style paint;
  transition: filter 85ms ease;
}

/* Tiny tactile LCD flash on A / B / C button press */
.poppet-lcd-bezel[data-lcd-flash] {
  filter: brightness(1.09) contrast(1.06);
}

.poppet-lcd-grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      color-mix(in srgb, var(--poppet-lcd-ink) 6%, transparent) 0 1px,
      transparent 1px 3px
    ),
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--poppet-lcd-ink) 6%, transparent) 0 1px,
      transparent 1px 3px
    );
  pointer-events: none;
  z-index: 0;
}

/* ------------------------------------------------------------------ */
/* 1-bit pixel LCD icon rows (top 4 + bottom 4) + Handheld Cursor     */
/* ------------------------------------------------------------------ */

.poppet-lcd-icons {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.poppet-lcd-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-width: 28px;
  min-height: 24px;
  padding: 2px 3px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--poppet-lcd-ink);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 90ms var(--poppet-ease),
    color 90ms var(--poppet-ease),
    opacity 90ms var(--poppet-ease);
}

.poppet-lcd-icon-btn:hover:not(:disabled):not([data-cursor-selected="true"]) {
  background: color-mix(in srgb, var(--poppet-lcd-ink) 14%, transparent);
}

.poppet-lcd-icon-btn:active:not(:disabled) {
  transform: scale(0.93);
}

.poppet-lcd-icon-btn:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: -2px;
}

/* Subtle 1-bit underline only when an LCD panel (volume/speed/help) is open on a non-selected icon */
.poppet-lcd-icon-btn:not([data-cursor-selected="true"])[aria-expanded="true"] {
  background: color-mix(in srgb, var(--poppet-lcd-ink) 14%, transparent);
}

/* Inverted LCD cursor state + blinking pixel arrow ▸ */
.poppet-lcd-icon-btn[data-cursor-selected="true"] {
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
  border-color: var(--poppet-lcd-ink);
}

.poppet-lcd-cursor-arrow {
  display: none;
  width: 6px;
  height: 8px;
  flex-shrink: 0;
  pointer-events: none;
}

.poppet-lcd-icon-btn[data-cursor-selected="true"] .poppet-lcd-cursor-arrow {
  display: block;
  animation: poppet-cursor-blink 820ms steps(2, start) infinite;
}

@keyframes poppet-cursor-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.18;
  }
}

.poppet-lcd-icon-btn:disabled,
.poppet-lcd-icon-btn[aria-disabled="true"] {
  opacity: 0.36;
  cursor: default;
}

.poppet-lcd-icon-btn[data-cursor-selected="true"]:disabled,
.poppet-lcd-icon-btn[data-cursor-selected="true"][aria-disabled="true"] {
  opacity: 0.68;
}

.poppet-pixel-icon {
  display: block;
  width: clamp(13px, 1.95vh, 16px);
  height: clamp(13px, 1.95vh, 16px);
  pointer-events: none;
  flex-shrink: 0;
}

/* Toggle play/pause and muted icons inside LCD rows */
.poppet-lcd-icon-btn[data-lcd-action="play"] .icon-lcd-pause,
.poppet-lcd-icon-btn[data-lcd-action="play"][aria-pressed="true"] .icon-lcd-play {
  display: none;
}

.poppet-lcd-icon-btn[data-lcd-action="play"][aria-pressed="true"] .icon-lcd-pause {
  display: block;
}

.poppet-lcd-icon-btn[data-lcd-action="sound"] .icon-lcd-muted,
.poppet-lcd-icon-btn[data-lcd-action="sound"][data-muted] .icon-lcd-sound {
  display: none;
}

.poppet-lcd-icon-btn[data-lcd-action="sound"][data-muted] .icon-lcd-muted {
  display: block;
}

.poppet-lcd-speed-badge {
  font-family: var(--poppet-font-time);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.poppet-lcd-speed-badge[hidden] {
  display: none;
}

/* ------------------------------------------------------------------ */
/* Clean In-Bezel Video Screen (object-fit: cover, zero clutter)      */
/* ------------------------------------------------------------------ */

.poppet-lcd-screen {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--poppet-lcd-ink) 34%, transparent);
  background: var(--poppet-scrim);
  overflow: hidden;
  box-shadow: inset 0 1px 4px color-mix(in srgb, var(--poppet-lcd-ink) 28%, transparent);
}

.poppet-stage {
  container-type: inline-size;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: var(--poppet-scrim);
  cursor: pointer;
}

.poppet-stage:focus-visible {
  outline: none;
  box-shadow: var(--poppet-focus);
}

.poppet-stage mux-video,
.poppet-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--media-object-fit, cover);
  background: var(--poppet-scrim);
  filter: sepia(0.18) contrast(1.08) saturate(0.86) brightness(0.97);
}

/* Nostalgic retro LCD / CRT overlay on every video */
.poppet-nostalgia-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 2px,
      rgba(0, 0, 0, 0.085) 2px 3px
    ),
    radial-gradient(
      ellipse at center,
      transparent 56%,
      rgba(16, 24, 12, 0.34) 100%
    );
  box-shadow: inset 0 0 18px rgba(16, 24, 12, 0.22);
}

.poppet-stage[data-video-fullscreen] .poppet-nostalgia-overlay,
.poppet-stage:fullscreen .poppet-nostalgia-overlay,
.poppet-stage:-webkit-full-screen .poppet-nostalgia-overlay {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 3px,
      rgba(0, 0, 0, 0.05) 3px 4px
    ),
    radial-gradient(
      ellipse at center,
      transparent 64%,
      rgba(12, 18, 10, 0.28) 100%
    );
}

.poppet-stage[data-video-fullscreen],
.poppet-stage:fullscreen,
.poppet-stage:-webkit-full-screen {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #000000;
}

.poppet-stage[data-video-fullscreen] mux-video,
.poppet-stage[data-video-fullscreen] video,
.poppet-stage:fullscreen mux-video,
.poppet-stage:fullscreen video,
.poppet-stage:-webkit-full-screen mux-video,
.poppet-stage:-webkit-full-screen video {
  object-fit: contain;
}

/* Double-tap seek ripples */
.poppet-tap-zones {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.poppet-tap-ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poppet-tap-ripple--left {
  left: 0;
}

.poppet-tap-ripple--right {
  right: 0;
}

.poppet-tap-ripple[hidden] {
  display: none;
}

.poppet-tap-wave {
  position: absolute;
  width: 120%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--poppet-surface) 30%, transparent);
  transform: scale(0.45);
  opacity: 0;
}

.poppet-tap-ripple[data-active] .poppet-tap-wave {
  animation: poppet-ripple-wave 480ms var(--poppet-ease) forwards;
}

@keyframes poppet-ripple-wave {
  0% {
    opacity: 0.72;
    transform: scale(0.45);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

.poppet-tap-badge {
  position: relative;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--poppet-lcd-bg);
  color: var(--poppet-lcd-ink);
  border: 1px solid var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 10px;
  font-weight: 700;
}

/* Top-right screen actions (Video Folder, Video-only Fullscreen, Exit Lean-in) */
.poppet-screen-top-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 9;
}

.poppet-screen-action-btn,
.poppet-zoom-out-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px solid var(--poppet-lcd-ink);
  background: color-mix(in srgb, var(--poppet-lcd-bg) 88%, transparent);
  color: var(--poppet-lcd-ink);
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 150ms var(--poppet-ease), transform 110ms var(--poppet-ease),
    background-color 110ms var(--poppet-ease);
}

.poppet-screen-action-btn .poppet-pixel-icon,
.poppet-zoom-out-btn .poppet-pixel-icon {
  width: 13px;
  height: 13px;
}

.poppet-screen-action-btn:hover,
.poppet-zoom-out-btn:hover {
  opacity: 1;
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
}

.poppet-screen-action-btn:focus-visible,
.poppet-zoom-out-btn:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 2px;
}

/* Toy View: show Video Folder (+) & Zoom Egg (Lean-in); hide Video-only FS */
.poppet-video-fs-btn {
  display: none;
}

/* Lean-in View: show Folder + Video-only Fullscreen + Exit Lean-in */
.poppet-player[data-view="lean-in"] .poppet-video-fs-btn {
  display: inline-flex;
}

.poppet-zoom-out-btn .icon-zoom-out,
.poppet-player[data-view="lean-in"] .poppet-zoom-out-btn .icon-zoom-in,
.poppet-video-fs-btn .icon-video-fs-exit {
  display: none;
}

.poppet-zoom-out-btn .icon-zoom-in,
.poppet-player[data-view="lean-in"] .poppet-zoom-out-btn .icon-zoom-out {
  display: block;
}

/* Video-only Fullscreen: show only the exit fullscreen button */
.poppet-stage[data-video-fullscreen] .poppet-screen-top-actions,
.poppet-stage:fullscreen .poppet-screen-top-actions,
.poppet-stage:-webkit-full-screen .poppet-screen-top-actions {
  top: 14px;
  right: 14px;
}

.poppet-stage[data-video-fullscreen] .poppet-folder-btn,
.poppet-stage[data-video-fullscreen] .poppet-zoom-out-btn,
.poppet-stage:fullscreen .poppet-folder-btn,
.poppet-stage:fullscreen .poppet-zoom-out-btn,
.poppet-stage:-webkit-full-screen .poppet-folder-btn,
.poppet-stage:-webkit-full-screen .poppet-zoom-out-btn {
  display: none;
}

.poppet-stage[data-video-fullscreen] .poppet-video-fs-btn,
.poppet-stage:fullscreen .poppet-video-fs-btn,
.poppet-stage:-webkit-full-screen .poppet-video-fs-btn {
  display: inline-flex;
  width: 34px;
  height: 34px;
}

.poppet-stage[data-video-fullscreen] .poppet-video-fs-btn .icon-video-fs-enter,
.poppet-stage:fullscreen .poppet-video-fs-btn .icon-video-fs-enter,
.poppet-stage:-webkit-full-screen .poppet-video-fs-btn .icon-video-fs-enter {
  display: none;
}

.poppet-stage[data-video-fullscreen] .poppet-video-fs-btn .icon-video-fs-exit,
.poppet-stage:fullscreen .poppet-video-fs-btn .icon-video-fs-exit,
.poppet-stage:-webkit-full-screen .poppet-video-fs-btn .icon-video-fs-exit {
  display: block;
}

/* Video-only Fullscreen Standard Control Bar (hover / active only) */
.poppet-fs-controls {
  display: none;
}

.poppet-stage[data-video-fullscreen] .poppet-fs-controls,
.poppet-stage:fullscreen .poppet-fs-controls,
.poppet-stage:-webkit-full-screen .poppet-fs-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 40px clamp(16px, 3vw, 32px) clamp(14px, 2.4vw, 24px);
  background: linear-gradient(
    to top,
    rgba(10, 14, 12, 0.88) 0%,
    rgba(10, 14, 12, 0.48) 58%,
    rgba(10, 14, 12, 0) 100%
  );
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 200ms var(--poppet-ease), transform 200ms var(--poppet-ease);
}

.poppet-stage[data-video-fullscreen]:hover .poppet-fs-controls,
.poppet-stage[data-video-fullscreen]:focus-within .poppet-fs-controls,
.poppet-stage[data-video-fullscreen][data-fs-active] .poppet-fs-controls,
.poppet-stage:fullscreen:hover .poppet-fs-controls,
.poppet-stage:fullscreen:focus-within .poppet-fs-controls,
.poppet-stage:fullscreen[data-fs-active] .poppet-fs-controls,
.poppet-stage:-webkit-full-screen:hover .poppet-fs-controls,
.poppet-stage:-webkit-full-screen:focus-within .poppet-fs-controls,
.poppet-stage:-webkit-full-screen[data-fs-active] .poppet-fs-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.poppet-stage[data-video-fullscreen] .poppet-screen-top-actions,
.poppet-stage:fullscreen .poppet-screen-top-actions,
.poppet-stage:-webkit-full-screen .poppet-screen-top-actions {
  opacity: 0;
  transition: opacity 200ms var(--poppet-ease);
}

.poppet-stage[data-video-fullscreen]:hover .poppet-screen-top-actions,
.poppet-stage[data-video-fullscreen]:focus-within .poppet-screen-top-actions,
.poppet-stage[data-video-fullscreen][data-fs-active] .poppet-screen-top-actions,
.poppet-stage:fullscreen:hover .poppet-screen-top-actions,
.poppet-stage:fullscreen:focus-within .poppet-screen-top-actions,
.poppet-stage:fullscreen[data-fs-active] .poppet-screen-top-actions,
.poppet-stage:-webkit-full-screen:hover .poppet-screen-top-actions,
.poppet-stage:-webkit-full-screen:focus-within .poppet-screen-top-actions,
.poppet-stage:-webkit-full-screen[data-fs-active] .poppet-screen-top-actions {
  opacity: 1;
}

.poppet-fs-seek-row {
  position: relative;
  width: 100%;
  padding-top: 42px;
  display: flex;
  align-items: center;
}

.poppet-fs-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--poppet-accent) 0%,
    var(--poppet-accent) var(--poppet-fs-progress, 0%),
    color-mix(in srgb, var(--poppet-lcd-bg) 34%, transparent) var(--poppet-fs-progress, 0%),
    color-mix(in srgb, var(--poppet-lcd-bg) 34%, transparent) 100%
  );
  border: 1px solid color-mix(in srgb, var(--poppet-lcd-bg) 55%, transparent);
  cursor: pointer;
  outline: none;
}

.poppet-fs-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--poppet-lcd-bg);
  border: 2.5px solid var(--poppet-lcd-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.poppet-fs-seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--poppet-lcd-bg);
  border: 2.5px solid var(--poppet-lcd-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.poppet-fs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.poppet-fs-left,
.poppet-fs-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poppet-fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1.5px solid var(--poppet-lcd-ink);
  background: color-mix(in srgb, var(--poppet-lcd-bg) 92%, transparent);
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 130ms ease, color 130ms ease, transform 110ms ease;
}

.poppet-fs-btn:hover {
  background: var(--poppet-accent);
  color: var(--poppet-on-accent);
}

.poppet-fs-btn:active {
  transform: scale(0.95);
}

.poppet-fs-btn .poppet-pixel-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.poppet-fs-play .icon-fs-pause,
.poppet-fs-play[aria-pressed="true"] .icon-fs-play {
  display: none;
}

.poppet-fs-play[aria-pressed="true"] .icon-fs-pause {
  display: block;
}

.poppet-fs-mute .icon-fs-muted,
.poppet-fs-mute[aria-pressed="true"] .icon-fs-vol {
  display: none;
}

.poppet-fs-mute[aria-pressed="true"] .icon-fs-muted {
  display: block;
}

.poppet-fs-time {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--poppet-lcd-bg) 45%, transparent);
  background: color-mix(in srgb, var(--poppet-lcd-bg) 88%, transparent);
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 12px;
  letter-spacing: 0.03em;
  user-select: none;
  white-space: nowrap;
}

.poppet-fs-pet {
  --fs-pet-size: 40px;
  position: absolute;
  bottom: 14px;
  left: clamp(20px, var(--poppet-fs-progress, 0%), calc(100% - 20px));
  transform: translateX(-50%);
  width: var(--fs-pet-size);
  height: var(--fs-pet-size);
  pointer-events: none;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: calc(8 * var(--fs-pet-size)) var(--fs-pet-size);
  background-position: 0 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.poppet-fs-pet[hidden] {
  display: none;
}

.poppet-fs-pet[data-playing="true"] {
  animation: poppet-fs-pet-walk 0.46s steps(1) infinite;
}

.poppet-fs-pet[data-playing="false"] {
  animation: poppet-fs-pet-sleep 1.4s steps(1) infinite;
}

@keyframes poppet-fs-pet-walk {
  0% {
    background-position-x: 0;
  }
  50% {
    background-position-x: calc(-1 * var(--fs-pet-size));
  }
}

@keyframes poppet-fs-pet-sleep {
  0% {
    background-position-x: calc(-2 * var(--fs-pet-size));
  }
  50% {
    background-position-x: calc(-3 * var(--fs-pet-size));
  }
}

.poppet-fs-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 74px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--poppet-accent) 0%,
    var(--poppet-accent) var(--poppet-fs-vol, 100%),
    color-mix(in srgb, var(--poppet-lcd-bg) 34%, transparent) var(--poppet-fs-vol, 100%),
    color-mix(in srgb, var(--poppet-lcd-bg) 34%, transparent) 100%
  );
  border: 1px solid color-mix(in srgb, var(--poppet-lcd-bg) 55%, transparent);
  cursor: pointer;
}

.poppet-fs-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--poppet-lcd-bg);
  border: 2px solid var(--poppet-lcd-ink);
  cursor: pointer;
}

.poppet-fs-vol::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--poppet-lcd-bg);
  border: 2px solid var(--poppet-lcd-ink);
  cursor: pointer;
}

.poppet-fs-quality-wrap {
  position: relative;
}

.poppet-fs-quality-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 112px;
  padding: 5px;
  border-radius: 10px;
  border: 1.5px solid var(--poppet-lcd-ink);
  background: color-mix(in srgb, var(--poppet-lcd-bg) 96%, #0000);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 25;
}

.poppet-fs-quality-menu[hidden] {
  display: none;
}

.poppet-fs-quality-item {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.poppet-fs-quality-item:hover {
  background: color-mix(in srgb, var(--poppet-lcd-ink) 12%, transparent);
}

.poppet-fs-quality-item[aria-checked="true"] {
  background: var(--poppet-accent);
  color: var(--poppet-on-accent);
  border-color: var(--poppet-lcd-ink);
}

.poppet-fs-cc[aria-pressed="true"] {
  background: var(--poppet-accent);
  color: var(--poppet-on-accent);
}

@media (max-width: 600px) {
  .poppet-fs-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .poppet-fs-vol {
    width: 54px;
  }
}

/* 1-bit LCD Video Folder / First-Screen Picker */
.poppet-folder-panel {
  inset: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 20;
}

.poppet-folder-panel[hidden] {
  display: none;
}

.poppet-folder-list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.poppet-folder-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 5px;
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 8px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.poppet-folder-item:hover,
.poppet-folder-item[aria-current="true"] {
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
}

.poppet-folder-item:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 1px;
}

.poppet-folder-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poppet-folder-item-meta {
  flex-shrink: 0;
  opacity: 0.75;
  font-size: 7px;
}

.poppet-folder-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  flex-shrink: 0;
}

.poppet-folder-pick-btn {
  padding: 3px 4px;
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 7.5px;
  font-weight: 700;
  cursor: pointer;
}

.poppet-folder-pick-btn:hover {
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
}

.poppet-folder-pick-btn:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 1px;
}

/* Ended / Buffering minimal overlays */
.poppet-center-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.poppet-center-state {
  display: none;
  align-items: center;
  justify-content: center;
}

[data-playback="ended"] .poppet-center-ended,
[data-playback="buffering"] .poppet-center-buffering {
  display: flex;
}

.poppet-center-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1.5px solid var(--poppet-lcd-ink);
  background: var(--poppet-lcd-bg);
  color: var(--poppet-lcd-ink);
  cursor: pointer;
}

.poppet-center-btn .poppet-icon {
  width: 20px;
  height: 20px;
}

.poppet-center-btn:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 2px;
}

.poppet-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--poppet-accent);
  animation: poppet-spin 0.8s linear infinite;
}

@keyframes poppet-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* PART 2: THE PET IS THE HERO                                        */
/* Dedicated LCD Pet Strip (~22% bezel height) between video & bottom */
/* ------------------------------------------------------------------ */

.poppet-pet-strip {
  position: relative;
  z-index: 5;
  flex: 0 0 24.5%;
  min-height: 54px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
  border-top: 1px dashed color-mix(in srgb, var(--poppet-lcd-ink) 24%, transparent);
  border-bottom: 1px dashed color-mix(in srgb, var(--poppet-lcd-ink) 24%, transparent);
  overflow: visible;
}

.poppet-pet-track-area {
  position: relative;
  flex: 1 1 0;
  min-width: 60px;
  height: 100%;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  overflow: visible;
}

.poppet-pet-track-area:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 1px;
  border-radius: 3px;
}

/* Dotted pixel path + walked solid ink fill along the pet stage */
.poppet-pet-path {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 3px;
  pointer-events: none;
}

.poppet-pet-path-dotted {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    var(--poppet-lcd-ink) 0 3px,
    transparent 3px 7px
  );
  opacity: 0.46;
}

.poppet-pet-path-walked {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pet-progress, 0%);
  height: 3px;
  background: var(--poppet-lcd-ink);
}

/* 3x Hero Pet Actor container positioned at current time along path */
.poppet-pet-actor {
  position: absolute;
  bottom: 2px;
  left: clamp(24px, var(--pet-progress, 0%), calc(100% - 24px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 6;
}

/* Small pixel ground shadow directly under the pet */
.poppet-pet-ground-shadow {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(22px, 3.8vh, 32px);
  height: 3px;
  background: color-mix(in srgb, var(--poppet-lcd-ink) 28%, transparent);
  z-index: 0;
}

[data-pet="none"] .poppet-pet-ground-shadow {
  display: none;
}

/* 3x (~52px on desktop) crisp pixel pet sprite with 1px ink outline + soft drop shadow */
.poppet-pet-sprite {
  --pet-sprite-size: clamp(40px, 6.6vh, 52px);
  position: relative;
  z-index: 1;
  display: block;
  width: var(--pet-sprite-size);
  height: var(--pet-sprite-size);
  margin-bottom: -10px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: calc(8 * var(--pet-sprite-size)) var(--pet-sprite-size);
  background-position-x: calc(-1 * var(--frame, 0) * var(--pet-sprite-size));
  background-position-y: 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, 0.28));
  transition: transform 120ms var(--poppet-ease);
}

[data-pet="pip"] .poppet-pet-sprite {
  background-image: url("/assets/pets/pip.png");
  margin-bottom: -10px;
}

[data-pet="miso"] .poppet-pet-sprite {
  background-image: url("/assets/pets/miso.png");
  margin-bottom: -12px;
}

[data-pet="wisp"] .poppet-pet-sprite {
  background-image: url("/assets/pets/wisp.png");
  margin-bottom: -12px;
}

/* "None" pet option: simple crisp 1-bit pixel dot playhead */
[data-pet="none"] .poppet-pet-sprite {
  width: 11px;
  height: 11px;
  margin-bottom: 0;
  background-image: none;
  background-color: var(--poppet-lcd-ink);
  border: 2px solid var(--poppet-lcd-bg);
  outline: 1.5px solid var(--poppet-lcd-ink);
  filter: none;
}

/* Paused state: pet lies down grounded on the dotted path */
.poppet-pet-sprite[data-pose^="sleep"] {
  transform: translateY(4px);
}

[data-pet="miso"] .poppet-pet-sprite[data-pose^="sleep"] {
  transform: translateY(8px);
}

[data-pet="wisp"] .poppet-pet-sprite[data-pose^="sleep"] {
  transform: translateY(5px);
}

/* Button A reaction: pet looks toward the selected icon */
.poppet-pet-strip[data-look-dir="left"] .poppet-pet-sprite {
  transform: scaleX(-1);
}

.poppet-pet-strip[data-pet-look="up-left"] .poppet-pet-sprite {
  transform: scaleX(-1) translateY(-3px) rotate(5deg);
}

.poppet-pet-strip[data-pet-look="up-right"] .poppet-pet-sprite {
  transform: translateY(-3px) rotate(5deg);
}

.poppet-pet-strip[data-pet-look="down-left"] .poppet-pet-sprite {
  transform: scaleX(-1) translateY(2px) rotate(-4deg);
}

.poppet-pet-strip[data-pet-look="down-right"] .poppet-pet-sprite {
  transform: translateY(2px) rotate(-4deg);
}

/* Button B reaction: big readable hop */
.poppet-pet-strip[data-pet-hop] .poppet-pet-sprite {
  animation: poppet-hero-hop 360ms var(--poppet-ease);
}

@keyframes poppet-hero-hop {
  0%,
  100% {
    transform: translateY(0);
  }
  42% {
    transform: translateY(-11px) scale(1.05);
  }
}

/* Button C reaction: shrug wiggle + "?" mark */
.poppet-pet-strip[data-pet-shrug] .poppet-pet-sprite {
  animation: poppet-hero-shrug 420ms var(--poppet-ease);
}

@keyframes poppet-hero-shrug {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-8deg);
  }
  75% {
    transform: translateY(-3px) rotate(8deg);
  }
}

.poppet-pet-shrug-mark {
  position: absolute;
  bottom: calc(100% - 8px);
  right: -2px;
  padding: 1px 3px;
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
  font-family: var(--poppet-font-time);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  z-index: 8;
}

.poppet-pet-shrug-mark[hidden] {
  display: none;
}

/* Ended state: joyful jump + pixel confetti burst */
[data-playback="ended"] .poppet-pet-sprite {
  animation: poppet-ended-jump 620ms var(--poppet-ease) infinite;
}

@keyframes poppet-ended-jump {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

/* 3 Pixel Hearts pop when fed (+10s) */
.poppet-pet-hearts {
  position: absolute;
  bottom: calc(100% - 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 26px;
  pointer-events: none;
  z-index: 9;
}

.poppet-pet-hearts[hidden] {
  display: none;
}

.poppet-pixel-heart {
  position: absolute;
  width: 10px;
  height: 9px;
  color: var(--poppet-heart, var(--poppet-lcd-ink));
  filter: drop-shadow(0 1px 0 var(--poppet-lcd-ink));
  opacity: 0;
}

.poppet-pet-hearts[data-active] .poppet-pixel-heart--1 {
  left: 2px;
  bottom: 0;
  animation: poppet-heart-pop 850ms var(--poppet-ease) forwards;
}

.poppet-pet-hearts[data-active] .poppet-pixel-heart--2 {
  left: 21px;
  bottom: 4px;
  animation: poppet-heart-pop 850ms 90ms var(--poppet-ease) forwards;
}

.poppet-pet-hearts[data-active] .poppet-pixel-heart--3 {
  right: 2px;
  bottom: 1px;
  animation: poppet-heart-pop 850ms 180ms var(--poppet-ease) forwards;
}

@keyframes poppet-heart-pop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translateY(-5px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.9);
  }
}

/* Pixel Confetti on video ended */
.poppet-pet-confetti {
  display: none;
  position: absolute;
  bottom: calc(100% - 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 28px;
  pointer-events: none;
  z-index: 9;
}

[data-playback="ended"] .poppet-pet-confetti {
  display: block;
}

.poppet-pet-confetti i {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--poppet-lcd-ink);
  animation: poppet-confetti-fall 900ms linear infinite;
}

.poppet-pet-confetti .c1 { left: 4px; top: 2px; background: var(--poppet-heart); animation-delay: 0ms; }
.poppet-pet-confetti .c2 { left: 16px; top: -4px; background: var(--poppet-accent); animation-delay: 150ms; }
.poppet-pet-confetti .c3 { left: 28px; top: 0px; background: var(--poppet-lcd-ink); animation-delay: 300ms; }
.poppet-pet-confetti .c4 { left: 40px; top: -3px; background: var(--poppet-heart); animation-delay: 100ms; }
.poppet-pet-confetti .c5 { left: 50px; top: 2px; background: var(--poppet-accent); animation-delay: 250ms; }
.poppet-pet-confetti .c6 { left: 58px; top: -2px; background: var(--poppet-lcd-ink); animation-delay: 400ms; }

@keyframes poppet-confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(16px) rotate(90deg);
  }
}

/* Pixel speech bubble above the pet's head ("zzz", "Hungry !", "Yay!", "Shh"),
   kept inside the pet strip with clear headroom above the pet and its sleep Z */
.poppet-mood-bubble {
  position: absolute;
  bottom: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4px;
  border-radius: 0;
  background: var(--poppet-lcd-bg);
  color: var(--poppet-lcd-ink);
  border: 1px solid var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
  box-shadow: 1px 1px 0 var(--poppet-lcd-ink);
  z-index: 7;
}

.poppet-pet-strip[data-pet-state="paused"] .poppet-mood-bubble {
  transform: translateX(-68%);
}

.poppet-mood-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 2.5px solid transparent;
  border-top-color: var(--poppet-lcd-ink);
}

.poppet-pet-strip[data-pet-state="paused"] .poppet-mood-bubble::after {
  left: 62%;
}

/* Hide mood bubble whenever seek tooltip (0:23) or feed pip (+10s) is visible so they never overlap */
.poppet-mood-bubble[hidden],
[data-pet="none"] .poppet-mood-bubble,
.poppet-pet-strip[data-tooltip-active] .poppet-mood-bubble,
.poppet-pet-strip[data-pet-nom] .poppet-mood-bubble {
  display: none !important;
}

/* +10s pip & hover/drag seek tooltip (kept inside the top of the pet strip with clear headroom) */
.poppet-pip,
.poppet-seek-tooltip {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4px;
  border-radius: 0;
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
  border: 1px solid var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}

.poppet-seek-tooltip {
  top: 2px;
  bottom: auto;
  left: clamp(22px, var(--seek-tooltip-x, 50%), calc(100% - 22px));
}

.poppet-pip[data-active],
.poppet-seek-tooltip[data-active] {
  opacity: 1;
}

.poppet-pip[hidden],
.poppet-seek-tooltip[hidden] {
  display: none;
}

/* Silkscreen time at the right end of the pet strip */
.poppet-pet-strip-time {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  flex-shrink: 0;
  padding: 2px 3px;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: clamp(8px, 1.2vh, 9.5px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.poppet-time-sep {
  opacity: 0.65;
}

/* ------------------------------------------------------------------ */
/* PART 1: 3 BUTTONS = CLASSIC HANDHELD NAVIGATION (NEXT / OK / BACK) */
/* Embossed pixel icon on cap, engraved Silkscreen label below        */
/* ------------------------------------------------------------------ */

.poppet-abc-row {
  position: absolute;
  left: 50%;
  top: 80.2%;
  transform: translateX(-50%);
  width: 64%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(12px, 4.5%, 26px);
  z-index: 6;
  transition: filter 420ms var(--poppet-ease);
}

.poppet-abc-b-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.poppet-abc-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: 2px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--poppet-ink);
  font-family: var(--poppet-font-ui);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.poppet-abc-btn--a,
.poppet-abc-btn--c {
  transform: translateY(-4px);
}

.poppet-abc-btn--b {
  transform: translateY(4px);
}

.poppet-abc-cap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(30px, 5.8%, 36px);
  min-width: 30px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--poppet-ink) 32%, transparent);
  background:
    radial-gradient(
      62% 50% at 34% 26%,
      var(--poppet-abc-btn-hi) 0%,
      var(--poppet-abc-btn) 52%,
      var(--poppet-abc-btn-deep) 100%
    );
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--poppet-ink) 11%, transparent),
    0 0 0 4px rgba(255, 255, 255, 0.25),
    0 3px 0 color-mix(in srgb, var(--poppet-ink) 28%, transparent),
    0 4px 8px color-mix(in srgb, var(--poppet-ink) 22%, transparent),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.75);
  transition:
    transform 80ms var(--poppet-ease),
    box-shadow 110ms var(--poppet-ease),
    background 110ms var(--poppet-ease);
}

/* Embossed / debossed pixel glyph moulded into the plastic cap:
   ink at ~55% opacity with a 1px light bevel below */
.poppet-abc-glyph {
  display: block;
  width: 14px;
  height: 14px;
  color: color-mix(in srgb, var(--poppet-abc-btn-ink) 56%, transparent);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.68));
  pointer-events: none;
  flex-shrink: 0;
}

/* Button B dynamic cap glyph:
   When cursor is on Play -> shows ▶ or ❚❚ matching playback state;
   Otherwise -> shows filled pixel OK dot */
.poppet-abc-btn--b[data-cursor-on-play="true"] .glyph-b-ok {
  display: none;
}

.poppet-abc-btn--b[data-cursor-on-play="true"][data-paused] .glyph-b-pause,
.poppet-abc-btn--b[data-cursor-on-play="true"][data-ended] .glyph-b-pause {
  display: none;
}

.poppet-abc-btn--b[data-cursor-on-play="true"]:not([data-paused]):not([data-ended]) .glyph-b-play {
  display: none;
}

.poppet-abc-btn--b[data-cursor-on-play="false"] .glyph-b-play,
.poppet-abc-btn--b[data-cursor-on-play="false"] .glyph-b-pause {
  display: none;
}

/* Desktop hover: slight glow ring in the accent colour */
@media (hover: hover) {
  .poppet-abc-btn:hover .poppet-abc-cap {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--poppet-accent) 46%, transparent),
      0 3px 0 color-mix(in srgb, var(--poppet-ink) 28%, transparent),
      0 4px 8px color-mix(in srgb, var(--poppet-ink) 22%, transparent),
      inset 0 1.5px 1px rgba(255, 255, 255, 0.78);
  }
}

/* Pressed state: sinks 2px, highlight shrinks, inner shadow */
.poppet-abc-btn:active .poppet-abc-cap,
.poppet-abc-btn[data-pressed] .poppet-abc-cap {
  transform: translateY(2px);
  background:
    radial-gradient(
      36% 30% at 38% 32%,
      var(--poppet-abc-btn-hi) 0%,
      var(--poppet-abc-btn) 46%,
      var(--poppet-abc-btn-deep) 100%
    );
  box-shadow:
    inset 0 2px 4px color-mix(in srgb, var(--poppet-ink) 42%, transparent),
    0 1px 0 color-mix(in srgb, var(--poppet-ink) 22%, transparent);
}

/* Focus: 3px focus ring offset 3px */
.poppet-abc-btn:focus-visible {
  outline: 3px solid var(--poppet-ink);
  outline-offset: 3px;
}

/* First-visit gentle pulse on Button B */
.poppet-abc-btn--b[data-b-pulse] .poppet-abc-cap {
  animation: poppet-b-pulse 1.1s var(--poppet-ease) 2;
}

.poppet-abc-btn--b[data-b-pulse="once"] .poppet-abc-cap {
  animation-iteration-count: 1;
}

@keyframes poppet-b-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.13);
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--poppet-accent) 55%, transparent),
      0 3px 0 color-mix(in srgb, var(--poppet-ink) 28%, transparent),
      inset 0 1.5px 1px rgba(255, 255, 255, 0.8);
  }
}

/* Engraved Silkscreen label below each button ("NEXT", "OK", "BACK") */
.poppet-abc-label {
  font-family: var(--poppet-font-time);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--poppet-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

[data-theme="midnight"] .poppet-abc-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* First-visit pixel hint bubble ("press OK to play", dismissible) */
.poppet-ok-hint {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 5px 3px 7px;
  border-radius: 0;
  background: var(--poppet-lcd-bg);
  color: var(--poppet-lcd-ink);
  border: 1.5px solid var(--poppet-lcd-ink);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--poppet-ink) 28%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--poppet-font-time);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  z-index: 16;
}

.poppet-ok-hint::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: var(--poppet-lcd-ink);
}

.poppet-ok-hint[hidden],
.poppet-player[data-view="lean-in"] .poppet-ok-hint {
  display: none;
}

.poppet-ok-hint-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.poppet-ok-hint-close:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 1px;
}

/* ------------------------------------------------------------------ */
/* Floating Unscaled Customize Popover                                */
/* ------------------------------------------------------------------ */

.poppet-customize-popover {
  position: fixed;
  z-index: 50;
  width: min(336px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: var(--poppet-radius-card);
  background: var(--poppet-surface);
  color: var(--poppet-ink);
  border: var(--poppet-hairline);
  box-shadow: var(--poppet-shadow-shell);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.poppet-customize-popover[hidden] {
  display: none;
}

.poppet-custom-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poppet-custom-label {
  margin: 0;
  font-size: 12px;
  font-weight: var(--poppet-weight-ui-bold);
  color: var(--poppet-ink);
}

.poppet-radio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.poppet-choice-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--poppet-ink) 18%, transparent);
  background: color-mix(in srgb, var(--poppet-page) 45%, var(--poppet-surface));
  color: var(--poppet-ink);
  font-family: var(--poppet-font-ui);
  font-size: 11px;
  font-weight: var(--poppet-weight-ui-bold);
  line-height: 1.1;
  cursor: pointer;
}

.poppet-choice-btn:focus-visible {
  outline: none;
  box-shadow: var(--poppet-focus);
}

.poppet-choice-btn[aria-checked="true"] {
  border: 2px solid var(--poppet-ink);
  background: color-mix(in srgb, var(--poppet-button-alt) 48%, var(--poppet-surface));
  box-shadow: var(--poppet-shadow-pet);
}

[data-theme="midnight"] .poppet-choice-btn[aria-checked="true"] {
  border-color: var(--poppet-accent);
  background: var(--poppet-accent);
  color: var(--poppet-on-accent);
}

.poppet-pet-thumb {
  --pet-sprite-size: 26px;
  display: inline-block;
  width: var(--pet-sprite-size);
  height: var(--pet-sprite-size);
  background-repeat: no-repeat;
  background-size: calc(8 * var(--pet-sprite-size)) var(--pet-sprite-size);
  image-rendering: pixelated;
}

.poppet-pet-thumb[data-pet="pip"] {
  background-image: url("/assets/pets/pip.png");
}

.poppet-pet-thumb[data-pet="miso"] {
  background-image: url("/assets/pets/miso.png");
}

.poppet-pet-thumb[data-pet="wisp"] {
  background-image: url("/assets/pets/wisp.png");
}

.poppet-pet-thumb[data-pet="none"] {
  width: 14px;
  height: 14px;
  margin: 6px;
  border-radius: 50%;
  background: var(--poppet-accent);
  border: 2px solid var(--poppet-ink);
}

.poppet-swatch,
.poppet-accent-dot {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--poppet-ink);
}

.poppet-swatch {
  background: linear-gradient(
    135deg,
    var(--poppet-shell-top) 0% 50%,
    var(--poppet-shell-bottom) 50% 100%
  );
}

.poppet-accent-dot--default {
  background: linear-gradient(135deg, var(--poppet-shell-top) 0% 50%, var(--poppet-abc-btn) 50% 100%);
}

.poppet-accent-dot--berry {
  background: var(--poppet-accent-berry);
}

.poppet-accent-dot--sun {
  background: var(--poppet-accent-sun);
}

.poppet-accent-dot--sky {
  background: var(--poppet-accent-sky);
}

.poppet-bg-swatch {
  width: 22px;
  height: 15px;
  border-radius: 5px;
  border: 1.5px solid color-mix(in srgb, var(--poppet-ink) 35%, transparent);
  flex-shrink: 0;
}

.poppet-bg-swatch--default {
  background: radial-gradient(circle, var(--poppet-page-pattern) 1px, transparent 1.2px) 0 0 / 6px 6px,
    var(--poppet-page);
}

.poppet-bg-swatch--urban {
  background: url("/assets/bg-urban.jpg") center / cover no-repeat;
}

.poppet-bg-swatch--landscape {
  background: url("/assets/bg-landscape.jpg") center / cover no-repeat;
}

.poppet-bg-swatch--custom {
  background: repeating-conic-gradient(
      color-mix(in srgb, var(--poppet-ink) 16%, transparent) 0% 25%,
      transparent 0% 50%
    )
    50% / 8px 8px;
}

/* ------------------------------------------------------------------ */
/* Nostalgic 1-Bit LCD Overlays Inside Screen (Volume, Speed, Help)   */
/* Sharp 1px border, zero rounded pills, zero blur, zero drop shadows */
/* ------------------------------------------------------------------ */

.poppet-lcd-panel {
  position: absolute;
  z-index: 12;
  background: var(--poppet-lcd-bg);
  color: var(--poppet-lcd-ink);
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  font-family: var(--poppet-font-time);
  line-height: 1.1;
  user-select: none;
}

.poppet-lcd-panel[hidden] {
  display: none;
}

.poppet-lcd-panel-icon {
  display: block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.poppet-lcd-panel-label {
  font-family: var(--poppet-font-time);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--poppet-lcd-ink);
}

/* Volume LCD Overlay: bottom-left inside video */
.poppet-lcd-panel--volume {
  left: 6px;
  bottom: 6px;
  padding: 4px 6px;
}

.poppet-lcd-vol-slider {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  touch-action: none;
}

.poppet-lcd-vol-slider:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 2px;
}

.poppet-lcd-vol-slider .icon-lcd-vol-muted,
.poppet-lcd-vol-slider[data-muted] .icon-lcd-vol-on {
  display: none;
}

.poppet-lcd-vol-slider[data-muted] .icon-lcd-vol-muted {
  display: block;
}

.poppet-lcd-vol-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.poppet-lcd-vol-bar {
  display: block;
  width: 5px;
  border: 1px solid var(--poppet-lcd-ink);
  background: transparent;
  cursor: pointer;
}

.poppet-lcd-vol-bar[data-vol-step="1"] {
  height: 4px;
}
.poppet-lcd-vol-bar[data-vol-step="2"] {
  height: 7px;
}
.poppet-lcd-vol-bar[data-vol-step="3"] {
  height: 10px;
}
.poppet-lcd-vol-bar[data-vol-step="4"] {
  height: 13px;
}
.poppet-lcd-vol-bar[data-vol-step="5"] {
  height: 16px;
}

.poppet-lcd-vol-bar[data-filled] {
  background: var(--poppet-lcd-ink);
}

/* Speed & Quality LCD Picker Overlay */
.poppet-lcd-panel--speed {
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 4px 5px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3px 5px;
  width: max-content;
  max-width: calc(100% - 12px);
  box-sizing: border-box;
}

.poppet-lcd-speed-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.poppet-lcd-rate-btn {
  padding: 2px 4px;
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.poppet-lcd-rate-btn[aria-checked="true"] {
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
}

.poppet-lcd-rate-btn:focus-visible,
.poppet-lcd-rate-btn[data-panel-cursor="true"] {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 1px;
  box-shadow: 0 0 0 1px var(--poppet-lcd-bg);
}

/* Shortcuts / Help LCD Overlay */
.poppet-lcd-panel--help {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 12px);
  max-height: calc(100% - 12px);
  padding: 5px 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poppet-lcd-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--poppet-lcd-ink);
  padding-bottom: 2px;
}

.poppet-lcd-help-close {
  padding: 1px 4px;
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.poppet-lcd-help-close:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 1px;
}

.poppet-lcd-help-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5px 5px;
  font-size: 7.5px;
}

.poppet-lcd-help-list li {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.poppet-lcd-help-list li > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poppet-lcd-help-list kbd {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 2.5px;
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.poppet-kbd-arrow {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
}

.poppet-lcd-help-replay-item {
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: 2px;
}

.poppet-lcd-help-replay {
  padding: 2px 6px;
  border: 1px solid var(--poppet-lcd-ink);
  border-radius: 0;
  background: transparent;
  color: var(--poppet-lcd-ink);
  font-family: var(--poppet-font-time);
  font-size: 7.5px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.poppet-lcd-help-replay:hover {
  background: var(--poppet-lcd-ink);
  color: var(--poppet-lcd-bg);
}

.poppet-lcd-help-replay:focus-visible {
  outline: 2px solid var(--poppet-lcd-ink);
  outline-offset: 1px;
}

/* Intro LCD boot overlay (flicker + top→bottom scanline wipe) */
.poppet-lcd-boot {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  overflow: hidden;
}

.poppet-lcd-boot[hidden] {
  display: none;
}

.poppet-lcd-boot-cover {
  position: absolute;
  inset: 0;
  background: var(--poppet-lcd-bg);
  transform-origin: bottom center;
}

.poppet-lcd-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--poppet-lcd-ink);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--poppet-lcd-ink) 35%, transparent);
  opacity: 0;
}

/* Intro pixel hatch egg in pet strip */
.poppet-hatch-egg {
  position: relative;
  z-index: 2;
  width: clamp(28px, 4.6vh, 36px);
  height: clamp(32px, 5.2vh, 42px);
  margin-bottom: -4px;
  pointer-events: none;
  image-rendering: pixelated;
}

.poppet-hatch-egg[hidden] {
  display: none;
}

.poppet-hatch-egg svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.poppet-hatch-fill {
  fill: var(--poppet-lcd-bg);
}

.poppet-hatch-spot {
  fill: var(--poppet-accent);
}

.poppet-hatch-ink,
.poppet-hatch-crack {
  fill: var(--poppet-lcd-ink);
}

/* Native Fullscreen hides egg hardware completely */
.poppet-device[data-fullscreen] {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  animation: none;
  transform: none;
}

.poppet-device[data-fullscreen] .poppet-ball-chain,
.poppet-device[data-fullscreen] .poppet-chain-clip,
.poppet-device[data-fullscreen] .poppet-steady-pin,
.poppet-device[data-fullscreen] .poppet-intro-sparkles,
.poppet-device[data-fullscreen] .poppet-egg-shadow,
.poppet-device[data-fullscreen] .poppet-egg-canvas,
.poppet-device[data-fullscreen] .poppet-egg-loop,
.poppet-device[data-fullscreen] .poppet-egg-shell,
.poppet-device[data-fullscreen] .poppet-crack-svg,
.poppet-device[data-fullscreen] .poppet-lcd-icons,
.poppet-device[data-fullscreen] .poppet-abc-row,
.poppet-device[data-fullscreen] .poppet-ok-hint {
  display: none;
}

.poppet-device[data-fullscreen] .poppet-lcd-bezel {
  position: static;
  transform: none;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.poppet-device[data-fullscreen] .poppet-lcd-screen {
  border: 0;
  border-radius: 0;
}

/* Error dialog */
media-error-dialog:not([data-open]) media-dialog-popup {
  display: none;
}

media-error-dialog[data-open] media-dialog-popup {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--poppet-scrim);
  z-index: 30;
}

.poppet-error-card {
  width: 100%;
  max-width: 280px;
  padding: 14px;
  border-radius: 16px;
  background: var(--poppet-surface);
  color: var(--poppet-ink);
  border: var(--poppet-hairline);
  text-align: center;
}

.poppet-error-card media-dialog-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.poppet-error-card media-dialog-description {
  display: block;
  font-size: 12px;
  color: var(--poppet-ink-soft);
  margin-bottom: 10px;
}

.poppet-error-close {
  min-width: 72px;
  min-height: 36px;
  border-radius: 999px;
  border: var(--poppet-hairline);
  background: var(--poppet-button);
  color: var(--poppet-ink);
  font-family: var(--poppet-font-ui);
  font-weight: 600;
  cursor: pointer;
}

/* Quiet single-line footer */
.poppet-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--poppet-ink-soft);
}

.poppet-footer-line {
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

.poppet-page:not([data-bg="default"]) .poppet-footer-line {
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--poppet-surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--poppet-ink) 16%, transparent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  color: var(--poppet-ink);
}

.poppet-page:not([data-bg="default"]) .poppet-footer a {
  color: var(--poppet-ink);
}

.poppet-footer a {
  color: var(--poppet-ink-soft);
  text-underline-offset: 2px;
}

.poppet-footer a:hover {
  color: var(--poppet-ink);
}

.poppet-footer a:focus-visible {
  outline: none;
  box-shadow: var(--poppet-focus);
  border-radius: 4px;
}

.poppet-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ */
/* Responsive Mobile (<= 600px): same 0.88:1 egg at ~68vh, >=44px hits*/
/* ------------------------------------------------------------------ */

/* Mobile Bottom Sheets (Folder, Volume, Speed/Quality, Keys) */
.poppet-folder-panel[data-mobile-sheet="true"],
.poppet-lcd-panel[data-mobile-sheet="true"] {
  position: fixed;
  inset: auto 12px calc(14px + env(safe-area-inset-bottom, 0px)) 12px;
  top: auto;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: none;
  max-height: 62dvh;
  transform: none;
  z-index: 60;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--poppet-lcd-ink);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  gap: 8px;
}

.poppet-folder-panel[data-mobile-sheet="true"] .poppet-lcd-panel-label,
.poppet-folder-panel[data-mobile-sheet="true"] .poppet-lcd-help-close,
.poppet-lcd-panel[data-mobile-sheet="true"] .poppet-lcd-panel-label,
.poppet-lcd-panel[data-mobile-sheet="true"] .poppet-lcd-help-close {
  font-size: 11px;
}

.poppet-folder-panel[data-mobile-sheet="true"] .poppet-lcd-help-close,
.poppet-lcd-panel[data-mobile-sheet="true"] .poppet-lcd-help-close {
  min-width: 32px;
  min-height: 32px;
}

.poppet-lcd-panel--volume[data-mobile-sheet="true"] {
  top: calc(10px + env(safe-area-inset-top, 0px));
  bottom: auto;
  padding: 14px 16px;
}

.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-slider {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
}

.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-panel-icon {
  width: 20px;
  height: 20px;
}

.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-bars {
  height: 30px;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-bar {
  width: 16px;
}

.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-bar[data-vol-step="1"] {
  height: 8px;
}
.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-bar[data-vol-step="2"] {
  height: 13px;
}
.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-bar[data-vol-step="3"] {
  height: 18px;
}
.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-bar[data-vol-step="4"] {
  height: 24px;
}
.poppet-lcd-panel--volume[data-mobile-sheet="true"] .poppet-lcd-vol-bar[data-vol-step="5"] {
  height: 30px;
}

.poppet-lcd-panel--speed[data-mobile-sheet="true"] {
  top: calc(10px + env(safe-area-inset-top, 0px));
  bottom: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  padding: 14px 16px;
}

.poppet-lcd-panel--speed[data-mobile-sheet="true"] .poppet-lcd-speed-grid {
  gap: 6px;
}

.poppet-lcd-panel--speed[data-mobile-sheet="true"] .poppet-lcd-rate-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 6px;
}

.poppet-lcd-panel--help[data-mobile-sheet="true"] .poppet-lcd-help-head {
  padding-bottom: 6px;
}

.poppet-lcd-panel--help[data-mobile-sheet="true"] .poppet-lcd-help-list {
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 11px;
}

.poppet-lcd-panel--help[data-mobile-sheet="true"] .poppet-lcd-help-list kbd {
  padding: 3px 6px;
  font-size: 10px;
}

.poppet-lcd-panel--help[data-mobile-sheet="true"] .poppet-kbd-arrow {
  width: 9px;
  height: 9px;
}

.poppet-lcd-panel--help[data-mobile-sheet="true"] .poppet-lcd-help-replay {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 6px;
}

.poppet-folder-panel[data-mobile-sheet="true"] .poppet-folder-list {
  gap: 6px;
}

.poppet-folder-panel[data-mobile-sheet="true"] .poppet-folder-item {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.poppet-folder-panel[data-mobile-sheet="true"] .poppet-folder-pick-btn {
  min-height: 42px;
  font-size: 11px;
  border-radius: 6px;
}

@media (max-width: 600px) {
  .poppet-page {
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .poppet-device {
    width: min(calc(100vw - 12px), calc(74dvh * 0.88));
    aspect-ratio: 0.88 / 1;
  }

  /* Guarantee >= 44x44px hit boxes on mobile LCD & screen icons while keeping exact desktop proportions */
  .poppet-lcd-icons {
    min-height: 18px;
    padding: 1px 2px;
  }

  .poppet-lcd-icon-btn {
    min-height: 18px;
    z-index: 4;
  }

  .poppet-lcd-icon-btn::before {
    content: "";
    position: absolute;
    inset: -11px -4px;
  }

  .poppet-pet-strip {
    flex: 0 0 auto;
    min-height: 36px;
    height: 38px;
    padding: 0 3px;
  }

  .poppet-pet-sprite {
    --pet-sprite-size: 28px;
    filter: none;
  }

  .poppet-player[data-view="lean-in"] .poppet-egg-shell,
  .poppet-player[data-view="lean-in"] .poppet-crack-svg,
  .poppet-player[data-view="lean-in"] .poppet-abc-row {
    filter: none;
  }

  [data-pet] .poppet-pet-sprite {
    margin-bottom: 0;
  }

  .poppet-screen-action-btn,
  .poppet-zoom-out-btn {
    position: relative;
    width: 19px;
    height: 19px;
    border-radius: 2px;
  }

  .poppet-screen-action-btn .poppet-pixel-icon,
  .poppet-zoom-out-btn .poppet-pixel-icon {
    width: 11px;
    height: 11px;
  }

  .poppet-screen-action-btn::before,
  .poppet-zoom-out-btn::before {
    content: "";
    position: absolute;
    inset: -6px;
  }

  .poppet-player[data-view="lean-in"] .poppet-screen-top-actions {
    top: 4px;
    right: 4px;
    gap: 3px;
  }

  .poppet-player[data-view="lean-in"] .poppet-screen-action-btn,
  .poppet-player[data-view="lean-in"] .poppet-zoom-out-btn {
    width: 17px;
    height: 17px;
    border-radius: 2px;
  }

  .poppet-player[data-view="lean-in"] .poppet-screen-action-btn .poppet-pixel-icon,
  .poppet-player[data-view="lean-in"] .poppet-zoom-out-btn .poppet-pixel-icon {
    width: 10px;
    height: 10px;
  }

  .poppet-player[data-view="lean-in"] .poppet-screen-action-btn::before,
  .poppet-player[data-view="lean-in"] .poppet-zoom-out-btn::before {
    inset: -5px;
  }

  .poppet-pixel-icon {
    width: 12px;
    height: 12px;
  }

  .poppet-shell-wordmark-text {
    font-size: 62px;
  }

  .poppet-abc-btn {
    position: relative;
  }

  .poppet-abc-btn::before {
    content: "";
    position: absolute;
    inset: -10px;
  }

  .poppet-header-customize-btn,
  .poppet-steady-pin {
    min-height: 40px;
  }

  .poppet-custom-popover {
    width: min(340px, calc(100vw - 16px));
    max-height: 75dvh;
    overflow-y: auto;
    contain: layout style;
    backdrop-filter: none;
    background: color-mix(in srgb, var(--poppet-surface) 96%, transparent);
  }

  .poppet-page:not([data-bg="default"]) .poppet-brand,
  .poppet-page:not([data-bg="default"]) .poppet-footer-line,
  .poppet-header-customize-btn,
  .poppet-steady-pin {
    backdrop-filter: none;
    background: color-mix(in srgb, var(--poppet-surface) 94%, transparent);
  }

  .poppet-choice-btn {
    min-height: 40px;
  }

  .poppet-fs-btn {
    min-width: 42px;
    height: 42px;
  }

  .poppet-fs-seek::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }

  .poppet-fs-seek::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }

  .poppet-footer {
    font-size: 9.5px;
    letter-spacing: -0.015em;
  }
}

/* ------------------------------------------------------------------ */
/* Reduced motion: disable sway, tilt, dolly, spin, & sprite bounce   */
/* ------------------------------------------------------------------ */

[data-motion="reduced"] html[data-poppet-intro="pending"] .poppet-device,
html[data-motion="reduced"][data-poppet-intro="pending"] .poppet-device,
html[data-motion="off"][data-poppet-intro="pending"] .poppet-device {
  translate: 0 0;
  opacity: 0;
  animation: poppet-intro-fade-failsafe 0s 4s forwards;
}

@keyframes poppet-intro-fade-failsafe {
  to {
    opacity: 1;
  }
}

[data-motion="reduced"] .poppet-steady-pin,
[data-motion="reduced"] .poppet-chain-clip,
[data-motion="off"] .poppet-steady-pin,
[data-motion="off"] .poppet-chain-clip {
  display: none;
}

[data-motion="reduced"] .poppet-device,
[data-motion="reduced"] .poppet-spinner,
[data-motion="reduced"] .poppet-lcd-icon-btn[data-cursor-selected="true"] .poppet-lcd-cursor-arrow,
[data-motion="reduced"] .poppet-abc-btn--b[data-b-pulse] .poppet-abc-cap,
[data-motion="reduced"] .poppet-pet-strip[data-pet-hop] .poppet-pet-sprite,
[data-motion="reduced"] .poppet-pet-strip[data-pet-shrug] .poppet-pet-sprite,
[data-motion="reduced"] [data-playback="ended"] .poppet-pet-sprite,
[data-motion="reduced"] .poppet-tap-ripple[data-active] .poppet-tap-wave,
[data-motion="off"] .poppet-device,
[data-motion="off"] .poppet-spinner,
[data-motion="off"] .poppet-lcd-icon-btn[data-cursor-selected="true"] .poppet-lcd-cursor-arrow,
[data-motion="off"] .poppet-abc-btn--b[data-b-pulse] .poppet-abc-cap,
[data-motion="off"] .poppet-pet-strip[data-pet-hop] .poppet-pet-sprite,
[data-motion="off"] .poppet-pet-strip[data-pet-shrug] .poppet-pet-sprite,
[data-motion="off"] [data-playback="ended"] .poppet-pet-sprite,
[data-motion="off"] .poppet-tap-ripple[data-active] .poppet-tap-wave {
  animation: none;
}

[data-motion="reduced"] .poppet-dolly-anchor,
[data-motion="reduced"] .poppet-tilt-stage,
[data-motion="reduced"] .poppet-egg-shell,
[data-motion="reduced"] .poppet-crack-svg,
[data-motion="reduced"] .poppet-abc-row,
[data-motion="reduced"] .poppet-lean-backdrop,
[data-motion="off"] .poppet-dolly-anchor,
[data-motion="off"] .poppet-tilt-stage,
[data-motion="off"] .poppet-egg-shell,
[data-motion="off"] .poppet-crack-svg,
[data-motion="off"] .poppet-abc-row,
[data-motion="off"] .poppet-lean-backdrop {
  transition: opacity 200ms ease;
}

[data-motion="reduced"] .poppet-tilt-stage,
[data-motion="off"] .poppet-tilt-stage {
  transform: none;
}

[data-motion="reduced"] .poppet-player[data-view-fading] .poppet-dolly-anchor,
[data-motion="off"] .poppet-player[data-view-fading] .poppet-dolly-anchor {
  opacity: 0;
  transition: opacity 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html[data-poppet-intro="pending"] .poppet-device {
    translate: 0 0;
    opacity: 0;
    animation: poppet-intro-fade-failsafe 0s 4s forwards;
  }

  .poppet-steady-pin,
  .poppet-chain-clip {
    display: none;
  }

  .poppet-device,
  .poppet-spinner,
  .poppet-lcd-icon-btn[data-cursor-selected="true"] .poppet-lcd-cursor-arrow,
  .poppet-abc-btn--b[data-b-pulse] .poppet-abc-cap,
  .poppet-pet-strip[data-pet-hop] .poppet-pet-sprite,
  .poppet-pet-strip[data-pet-shrug] .poppet-pet-sprite,
  [data-playback="ended"] .poppet-pet-sprite,
  .poppet-tap-ripple[data-active] .poppet-tap-wave {
    animation: none;
  }

  .poppet-dolly-anchor,
  .poppet-tilt-stage,
  .poppet-egg-shell,
  .poppet-crack-svg,
  .poppet-abc-row,
  .poppet-lean-backdrop {
    transition: opacity 200ms ease;
  }

  .poppet-tilt-stage {
    transform: none;
  }

  .poppet-player[data-view-fading] .poppet-dolly-anchor {
    opacity: 0;
    transition: opacity 200ms ease;
  }
}
