/* ==========================================================================
   POLLY POCKET HARDWARE SHELL
   Opened clamshell compact: decorative lid up top (heart + brand + mirror),
   hinge across the middle, real player UI in the base, latch at the bottom.
   ========================================================================== */

body.pollypocket-active #player.has-hardware {
  position: relative;
  padding: 200px 34px 54px 34px;
  background:
    radial-gradient(ellipse at 30% 10%, #fff4f9 0%, #ffb6d1 35%, #ff7aad 70%, #d84090 100%);
  border: 4px solid #c02878;
  border-radius: 80px / 54px;
  box-shadow:
    inset 0 8px 20px #ffffffb0,
    inset 0 -12px 24px #d8409060,
    inset 10px 0 16px #ffffff50,
    inset -10px 0 16px #c0287830,
    0 12px 40px #d8409070;
  overflow: visible;
}

/* ---- Lid (upper half) ---- */
body.pollypocket-active .hw-pp-lid {
  position: absolute;
  top: 10px;
  left: 20px;
  right: 20px;
  height: 170px;
  background:
    radial-gradient(ellipse at 35% 25%, #ffffff 0%, #ffd0e4 30%, #ff9ec4 70%, #ff7aad 100%);
  border: 3px solid #c02878;
  border-radius: 60px / 38px;
  box-shadow:
    inset 0 10px 20px #ffffff,
    inset 0 -6px 14px #d8409060,
    0 4px 10px #00000030;
  overflow: hidden;
  pointer-events: none;
}

/* Glossy highlight band */
body.pollypocket-active .hw-pp-lid::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 10%;
  right: 10%;
  height: 30px;
  background: linear-gradient(180deg, #ffffffd0, #ffffff00);
  border-radius: 50%;
  filter: blur(4px);
}

/* Heart logo on lid */
body.pollypocket-active .hw-pp-heart {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 48px;
}
body.pollypocket-active .hw-pp-heart::before,
body.pollypocket-active .hw-pp-heart::after {
  content: '';
  position: absolute;
  top: 0;
  width: 30px;
  height: 44px;
  background:
    radial-gradient(ellipse at 30% 30%, #ff6a9a 0%, #e02874 60%, #8a0a40 100%);
  border-radius: 20px 20px 0 0;
  box-shadow:
    inset 0 3px 4px #ffb0c8,
    inset 0 -3px 4px #6a0830;
}
body.pollypocket-active .hw-pp-heart::before {
  left: 4px;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}
body.pollypocket-active .hw-pp-heart::after {
  right: 4px;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}
body.pollypocket-active .hw-pp-heart span {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 10px;
  height: 8px;
  background: #ffffff90;
  border-radius: 50%;
  filter: blur(1px);
  z-index: 2;
}

/* Brand text */
body.pollypocket-active .hw-pp-brand {
  position: absolute;
  top: 92px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
body.pollypocket-active .hw-pp-brand-main {
  font-family: 'Brush Script MT', 'Comic Sans MS', cursive;
  font-size: 32px;
  font-weight: bold;
  color: #ffffff;
  text-shadow:
    1px 1px 0 #c02878,
    2px 2px 0 #c02878,
    3px 3px 6px #8a0a4080;
  letter-spacing: 1px;
  line-height: 1;
}
body.pollypocket-active .hw-pp-brand-sub {
  font-family: 'Georgia', serif;
  font-size: 8px;
  letter-spacing: 0.25em;
  color: #c02878;
  font-weight: bold;
  margin-top: 4px;
  text-shadow: 0 1px 0 #ffffff80;
}

/* Small round mirror bubble */
body.pollypocket-active .hw-pp-mirror {
  position: absolute;
  top: 40px;
  right: 30px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, #ffd6e8 50%, #ffc0d8 100%);
  border: 2px solid #c02878;
  box-shadow:
    inset 0 2px 2px #ffffff,
    inset 0 -2px 2px #d8409060,
    0 2px 4px #00000030;
}
body.pollypocket-active .hw-pp-mirror::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 6px;
  width: 8px;
  height: 10px;
  background: #ffffffc0;
  border-radius: 50%;
  filter: blur(1px);
}

/* Sparkles scattered around the lid */
body.pollypocket-active .hw-pp-sparkle {
  position: absolute;
  color: #ffffff;
  font-size: 18px;
  text-shadow:
    0 0 4px #ffee4a,
    0 0 8px #ffffff,
    0 1px 2px #c02878;
  pointer-events: none;
  animation: pp-twinkle 2.4s ease-in-out infinite;
}
body.pollypocket-active .hw-pp-sp-1 { top: 18px; left: 40px; font-size: 22px; animation-delay: 0s; }
body.pollypocket-active .hw-pp-sp-2 { top: 72px; left: 28px; font-size: 14px; animation-delay: 0.8s; }
body.pollypocket-active .hw-pp-sp-3 { top: 120px; right: 70px; font-size: 16px; animation-delay: 1.4s; }

@keyframes pp-twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.85) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.1) rotate(20deg); }
}

/* ---- Hinge between lid and base ---- */
body.pollypocket-active .hw-pp-hinge {
  position: absolute;
  top: 182px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 14px;
  background:
    linear-gradient(180deg, #f4f4f4 0%, #a8a8a8 50%, #707070 100%);
  border: 1px solid #505050;
  border-radius: 7px;
  box-shadow:
    inset 0 2px 1px #ffffff,
    inset 0 -1px 1px #00000080,
    0 2px 4px #00000060;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 14px;
  pointer-events: none;
  z-index: 4;
}
body.pollypocket-active .hw-pp-hinge-pin {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, #808080 60%, #2a2a2a 100%);
  box-shadow: inset 0 0 0 1px #2a2a2a;
}

/* Latch clasp at bottom center */
body.pollypocket-active .hw-pp-latch {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 24px;
  background:
    radial-gradient(ellipse at 50% 30%, #ffd0e4 0%, #ff7aad 60%, #c02878 100%);
  border: 2px solid #8a0a40;
  border-radius: 0 0 16px 16px;
  box-shadow:
    inset 0 2px 2px #ffffff80,
    inset 0 -2px 2px #8a0a4080,
    0 4px 8px #00000040;
  pointer-events: none;
}
body.pollypocket-active .hw-pp-latch::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 5px;
  background: #8a0a40;
  border-radius: 3px;
  box-shadow: inset 0 1px 1px #00000080;
}

/* Glitter dots inside the base */
body.pollypocket-active .hw-pp-glitter {
  position: absolute;
  color: #ffffff;
  text-shadow: 0 0 4px #ffee4a, 0 0 6px #ffffff;
  font-size: 16px;
  pointer-events: none;
  animation: pp-twinkle 3s ease-in-out infinite;
}
body.pollypocket-active .hw-pp-gl-1 { top: 220px; left: 30px; animation-delay: 0.2s; }
body.pollypocket-active .hw-pp-gl-2 { top: 240px; right: 40px; animation-delay: 1.1s; }
body.pollypocket-active .hw-pp-gl-3 { bottom: 80px; left: 50px; animation-delay: 0.6s; }
body.pollypocket-active .hw-pp-gl-4 { bottom: 70px; right: 60px; animation-delay: 1.8s; }

/* ---- Real UI lives in the "base" (below the hinge) ---- */
body.pollypocket-active #player.has-hardware .title-bar {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

body.pollypocket-active #player.has-hardware .lcd-section {
  margin: 10px 10px 6px;
  background: linear-gradient(180deg, #fff0f7 0%, #ffe0eb 100%);
  border: 2px solid #c02878;
  border-radius: 10px;
  box-shadow:
    inset 0 2px 3px #ffffffc0,
    inset 0 -2px 3px #d8409040,
    0 2px 6px #00000020;
  padding: 10px 12px;
  position: relative;
  z-index: 5;
}

body.pollypocket-active #player.has-hardware .lcd-time-digits,
body.pollypocket-active #player.has-hardware .lcd-marquee,
body.pollypocket-active #player.has-hardware .lcd-samplerate,
body.pollypocket-active #player.has-hardware .lcd-bitrate {
  color: #c02878;
  text-shadow: 0 1px 0 #ffffff, 0 0 6px #ff7aad40;
}

body.pollypocket-active #player.has-hardware .viz-container,
body.pollypocket-active #player.has-hardware .seek-bar-container,
body.pollypocket-active #player.has-hardware .controls-section,
body.pollypocket-active #player.has-hardware .feature-bar {
  position: relative;
  z-index: 5;
  margin-left: 10px;
  margin-right: 10px;
}

/* Reduced motion: stop the twinkle */
@media (prefers-reduced-motion: reduce) {
  body.pollypocket-active .hw-pp-sparkle,
  body.pollypocket-active .hw-pp-glitter {
    animation: none;
    opacity: 0.8;
  }
}

@media (max-width: 560px) {
  body.pollypocket-active #player.has-hardware {
    padding: 170px 20px 48px 20px;
    border-radius: 60px / 44px;
  }
  body.pollypocket-active .hw-pp-lid { height: 140px; border-radius: 50px / 32px; }
  body.pollypocket-active .hw-pp-heart { top: 22px; width: 44px; height: 40px; }
  body.pollypocket-active .hw-pp-heart::before,
  body.pollypocket-active .hw-pp-heart::after { width: 24px; height: 36px; border-radius: 16px 16px 0 0; }
  body.pollypocket-active .hw-pp-brand { top: 74px; }
  body.pollypocket-active .hw-pp-brand-main { font-size: 24px; }
  body.pollypocket-active .hw-pp-hinge { top: 152px; width: 110px; }
}
