@scope ([data-project="ipod"]) {
  :scope {
    --ipod-bg: #f5f2ed;
    --device-top: #939295;
    --device-bottom: #262527;
    --screen-bg: #121212;
    --wheel-bg: #212122;
    --center-top: #282829;
    --center-bottom: #676467;
    --white-90: rgba(255, 255, 255, 0.9);
    --body-noise:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.16) 0%,
        rgba(255, 255, 255, 0.02) 22%,
        rgba(0, 0, 0, 0.08) 72%,
        rgba(0, 0, 0, 0.28) 100%
      ),
      radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.28), transparent 42%),
      radial-gradient(circle at 50% 118%, rgba(0, 0, 0, 0.34), transparent 38%),
      linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.12) 0%,
        transparent 10%,
        transparent 90%,
        rgba(0, 0, 0, 0.18) 100%
      ),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.72'/%3E%3C/svg%3E");
    --body-speckle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.35' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.08'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='96' height='96' filter='url(%23s)'/%3E%3C/svg%3E");
    --wheel-noise:
      radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.04), transparent 42%),
      radial-gradient(circle at 50% 78%, rgba(0, 0, 0, 0.22), transparent 48%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
    --screen-glow:
      radial-gradient(circle at 30% 30%, rgba(141, 216, 255, 0.12), transparent 30%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 55%);
    font-family:
      'SF Pro Text',
      'SF Pro Display',
      -apple-system,
      BlinkMacSystemFont,
      'Segoe UI',
      sans-serif;
  }

  * {
    box-sizing: border-box;
  }

  button {
    font: inherit;
  }

  .stage {
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0;
    perspective: 1400px;
  }

  .ipod {
    position: relative;
    width: 377px;
    padding-bottom: 10px;
    transform-style: preserve-3d;
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .ipod::after {
    content: '';
    position: absolute;
    top: 16px;
    right: -9px;
    width: 18px;
    height: 596px;
    border-radius: 0 24px 24px 0;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(220, 220, 224, 0.92) 12%,
      rgba(124, 124, 128, 0.95) 48%,
      rgba(72, 72, 75, 0.98) 100%
    );
    box-shadow:
      inset 1px 0 0 rgba(255, 255, 255, 0.35),
      inset -3px 0 6px rgba(0, 0, 0, 0.16);
    opacity: 0.22;
    transform-origin: left center;
    transform: rotateY(68deg) scaleX(0.78);
    transition:
      opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
      right 420ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
  }

  .device-shadow {
    position: absolute;
    left: 10px;
    bottom: 5px;
    width: 356px;
    height: 6px;
    background: rgba(0, 0, 0, 0.96);
    filter: blur(3px);
    border-radius: 999px;
    transform-origin: center center;
    transition:
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
      filter 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .ipod-body {
    position: relative;
    width: 377px;
    height: 630px;
    overflow: hidden;
    border-radius: 38px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.15), transparent 28%),
      linear-gradient(180deg, #9b9a9d 0%, #7d7c7f 16%, #575658 54%, #2a292b 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      inset 16px 0 24px rgba(255, 255, 255, 0.06),
      inset -18px 0 28px rgba(0, 0, 0, 0.14),
      inset 0 -18px 28px rgba(0, 0, 0, 0.36);
  }

  .ipod:hover,
  .ipod:focus-within {
    transform: rotateY(-14deg) rotateX(1.5deg) translateZ(0);
  }

  .ipod:hover::after,
  .ipod:focus-within::after {
    right: -13px;
    opacity: 0.9;
    transform: rotateY(52deg) scaleX(1);
  }

  .ipod:hover .device-shadow,
  .ipod:focus-within .device-shadow {
    transform: translateX(16px) scaleX(1.05) scaleY(1.12);
    opacity: 0.82;
    filter: blur(5px);
  }

  .ipod-body::before,
  .ipod-body::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
  }

  .ipod-body::before {
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08),
        transparent 14%,
        transparent 82%,
        rgba(0, 0, 0, 0.16) 100%
      ),
      radial-gradient(circle at 14% 30%, rgba(255, 255, 255, 0.08), transparent 24%),
      radial-gradient(circle at 86% 34%, rgba(0, 0, 0, 0.12), transparent 28%);
    mix-blend-mode: screen;
    opacity: 0.65;
  }

  .ipod-body::after {
    inset: 1px;
    border-radius: 37px;
    box-shadow:
      inset 1px 0 0 rgba(255, 255, 255, 0.12),
      inset -1px 0 0 rgba(0, 0, 0, 0.22),
      inset 0 -24px 36px rgba(0, 0, 0, 0.18);
    opacity: 0.8;
  }

  .body-noise,
  .wheel-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: soft-light;
  }

  .body-noise {
    border-radius: inherit;
    background-image: var(--body-noise);
    background-size:
      cover,
      cover,
      cover,
      100% 100%,
      180px 180px;
    opacity: 0.48;
  }

  .body-noise::before,
  .body-noise::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
  }

  .body-noise::before {
    background-image: var(--body-speckle);
    background-size: 96px 96px;
    mix-blend-mode: overlay;
    opacity: 0.28;
  }

  .body-noise::after {
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08),
        transparent 18%,
        transparent 72%,
        rgba(0, 0, 0, 0.22) 100%
      ),
      linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.06),
        transparent 16%,
        transparent 84%,
        rgba(0, 0, 0, 0.12)
      );
    mix-blend-mode: soft-light;
    opacity: 0.85;
  }

  .screen-shell {
    position: absolute;
    top: 24px;
    left: 30px;
    width: 318px;
    height: 242px;
  }

  .screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(46, 46, 46, 0.82), rgba(10, 10, 10, 0.94) 58%), var(--screen-bg);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.03),
      inset 0 -18px 22px rgba(0, 0, 0, 0.3);
  }

  .screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--screen-glow);
    opacity: 0.55;
    pointer-events: none;
  }

  .screen-refraction {
    position: absolute;
    top: 0;
    right: -10px;
    z-index: 2;
    width: 156px;
    height: 242px;
    border-radius: 0 18px 18px 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 100%);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(196, 196, 196, 0) 52%);
    opacity: 0.7;
    pointer-events: none;
  }

  .screen-ui {
    position: relative;
    z-index: 0;
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: 20px 1fr;
    padding: 4px;
  }

  .screen-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(rgb(254, 255, 255) 0%, rgb(177, 182, 185) 100%);
    border-bottom: 1px solid rgb(121, 149, 163);
    border-radius: 4px 4px 0 0;
    padding: 0 6px;
    height: 20px;
    min-width: 0;
  }

  .screen-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: rgb(16, 24, 29);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-transform: capitalize;
    min-width: 0;
    flex: 1 1 0%;
  }

  .battery-container {
    display: flex;
    align-items: center;
    gap: 0;
  }

  .playback-state {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    margin-top: 1px;
    color: #6aaedd;
  }

  .playback-state svg {
    display: block;
    width: 10px;
    height: 10px;
    fill: currentColor;
  }

  .playback-state .icon-play {
    transform: translateX(0.5px);
  }

  .playback-state .icon-pause {
    transform: translateX(0.25px);
  }

  .playback-state .icon-pause {
    display: none;
  }

  .screen-header.is-playing .playback-state .icon-play {
    display: block;
  }

  .screen-header.is-playing .playback-state .icon-pause {
    display: none;
  }

  .screen-header.is-paused .playback-state .icon-play {
    display: none;
  }

  .screen-header.is-paused .playback-state .icon-pause {
    display: block;
  }

  .battery-inner {
    width: fit-content;
    height: 12px;
    display: flex;
    align-items: center;
    margin-left: 8px;
  }

  .battery-inner .body {
    height: 100%;
    width: 24px;
    position: relative;
    display: flex;
    border: 1px solid rgb(98, 98, 98);
    background:
      linear-gradient(transparent 25%, rgba(255, 255, 255, 0.5) 65%, rgba(255, 255, 255, 0.5)),
      rgb(84, 88, 91);
  }

  .battery-inner .body .inner {
    position: absolute;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }

  .battery-inner .body .charge {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 99%;
    background:
      linear-gradient(
        transparent 10%,
        rgba(255, 255, 255, 0.5) 20%,
        rgba(255, 255, 255, 0.5) 35%,
        transparent 40%,
        rgba(0, 0, 0, 0.2) 55%,
        rgba(0, 0, 0, 0.3) 65%,
        rgba(0, 0, 0, 0.4) 80%
      ),
      rgb(165, 224, 127);
  }

  .battery-inner .end {
    width: 2px;
    height: 4px;
    border-width: 1px 1px 1px 0;
    border-style: solid solid solid none;
    border-color: rgb(98, 98, 98) rgb(98, 98, 98) rgb(98, 98, 98) currentcolor;
    border-radius: 0 1.5px 1.5px 0;
    background: rgb(196, 196, 196);
  }

  .screen-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 68%, #f2f2f2 100%);
    color: #111;
    padding: 0;
    overflow: hidden;
    border-radius: 0 0 4px 4px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      inset 0 -8px 18px rgba(0, 0, 0, 0.025);
  }

  .now-playing-main {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    min-width: 0;
    padding: 17px 20px 0;
    flex: 1 1 auto;
  }

  .album-artwork {
    position: relative;
    width: 122px;
    height: 122px;
    overflow: hidden;
    background: #f3f3f3;
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.12),
      0 1px 2px rgba(0, 0, 0, 0.12);
    clip-path: polygon(0 0, 100% 10px, 100% calc(100% - 10px), 0 100%);
  }

  .album-artwork img {
    display: block;
    width: 109%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: skewX(-4.7deg) translateX(-6px);
    transform-origin: center;
  }

  .album-artwork::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.18), transparent 30%),
      linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.1),
        transparent 36%,
        rgba(0, 0, 0, 0.08) 78%,
        rgba(0, 0, 0, 0.14)
      );
  }

  .album-artwork::after {
    content: none;
  }

  .track-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    padding-top: 6px;
  }

  .screen-content.is-seeking .track-copy {
    opacity: 0.78;
  }

  .screen-content.is-seeking .track-title::after {
    content: '  [Seek]';
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    color: #6a6a6a;
  }

  .track-title,
  .track-artist,
  .track-album {
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .track-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
    color: #111;
  }

  .track-artist {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.16;
    margin-bottom: 1px;
    color: #5b5b5b;
  }

  .track-album {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.16;
    margin-top: 2px;
    color: #5b5b5b;
  }

  .track-progress {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-top: 32px;
    margin-right: 20px;
    margin-bottom: 19px;
    margin-left: 20px;
  }

  .track-time {
    display: inline-block;
    width: 32px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  #remaining-time {
    text-align: right;
  }

  .progress-rail {
    position: relative;
    height: 15px;
    background: linear-gradient(180deg, #f2f1f2 0%, #fcfdfd 10%, #f5f5f5 90%, #dcdbdb 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.78),
      inset 0 -1px 0 rgba(0, 0, 0, 0.015);
    overflow: hidden;
    border-radius: 1px;
  }

  .progress-current {
    position: absolute;
    top: 1px;
    left: 1px;
    bottom: 1px;
    width: 63%;
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.28) 0%,
        rgba(255, 255, 255, 0.08) 24%,
        rgba(255, 255, 255, 0) 26%,
        rgba(0, 0, 0, 0.06) 100%
      ),
      linear-gradient(180deg, #86a1d2 0%, #6794c8 48%, #6794c8 52%, #7bb8e3 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      inset 0 -1px 0 rgba(0, 0, 0, 0.035);
    border-radius: 1px;
  }

  .click-wheel {
    position: absolute;
    left: 74px;
    bottom: 70px;
    width: 230px;
    height: 230px;
    border: 0;
    border-radius: 50%;
    background: var(--wheel-bg);
    overflow: hidden;
  }

  .click-wheel::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 230px;
    height: 20px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
    filter: blur(10px);
  }

  .click-wheel::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -40px;
    width: 230px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    filter: blur(10px);
  }

  .wheel-noise {
    border-radius: 50%;
    background-image: var(--wheel-noise);
    background-size:
      cover,
      cover,
      120px 120px;
    opacity: 0.2;
  }

  .wheel-button,
  .wheel-center {
    position: absolute;
    z-index: 1;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0;
    cursor: default;
    transition:
      transform 150ms ease,
      opacity 150ms ease,
      filter 150ms ease;
  }

  .wheel-button-prev,
  .wheel-button-next,
  .wheel-button-play,
  .wheel-center {
    cursor: pointer;
  }

  .wheel-button-menu {
    cursor: default;
  }

  .wheel-button:hover,
  .wheel-button:focus-visible,
  .wheel-center:hover,
  .wheel-center:focus-visible {
    transform: scale(1.04);
    filter: brightness(1.16);
    outline: none;
  }

  .wheel-button:active,
  .wheel-center:active {
    transform: scale(0.98);
  }

  .wheel-button-menu {
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--white-90);
  }

  .wheel-button-menu:hover,
  .wheel-button-menu:focus-visible,
  .wheel-button-menu:active {
    transform: translateX(-50%) scale(1.04);
  }

  .wheel-button-prev,
  .wheel-button-next,
  .wheel-button-play {
    display: grid;
    place-items: center;
  }

  .wheel-button-prev {
    left: 10px;
    top: 110px;
    width: 20px;
    height: 10px;
  }

  .wheel-button-next {
    right: 10px;
    top: 110px;
    width: 20px;
    height: 10px;
  }

  .wheel-button-play {
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    width: 26px;
    height: 12px;
  }

  .wheel-button-play:hover,
  .wheel-button-play:focus-visible,
  .wheel-button-play:active {
    transform: translateX(-50%) scale(1.04);
  }

  .wheel-center {
    top: 74px;
    left: 74px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    border: 1px solid #000;
    background:
      radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.06), transparent 34%),
      linear-gradient(180deg, var(--center-top) 0%, var(--center-bottom) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 1px 2px rgba(0, 0, 0, 0.26);
    transition:
      background 140ms ease,
      box-shadow 140ms ease,
      filter 140ms ease;
  }

  .wheel-center::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image:
      radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.08), transparent 34%),
      radial-gradient(circle at 50% 88%, rgba(0, 0, 0, 0.18), transparent 38%), var(--body-speckle);
    background-size:
      cover,
      cover,
      72px 72px;
    mix-blend-mode: soft-light;
    opacity: 0.5;
    pointer-events: none;
  }

  .wheel-center:hover,
  .wheel-center:focus-visible {
    transform: none;
    filter: none;
  }

  .wheel-center:active,
  .wheel-center.is-pressed {
    transform: none;
    filter: brightness(0.98);
    background:
      radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.03), transparent 30%),
      linear-gradient(180deg, #2b2b2c 0%, #626063 100%);
    box-shadow:
      inset 0 0 0 rgba(255, 255, 255, 0),
      inset 0 1px 3px rgba(0, 0, 0, 0.35),
      0 0 0 rgba(0, 0, 0, 0);
  }

  .wheel-center:active::before,
  .wheel-center.is-pressed::before {
    opacity: 0.32;
  }

  .wheel-button svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  :scope .artwork-frame {
    background: transparent;
    aspect-ratio: auto;
    overflow: visible;
  }
  .stage {
    width: 377px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(var(--device-scale, 0.8));
    transform-origin: center center;
    color: #fff;
  }
  .device-space {
    width: 100%;
    min-width: 0;
    position: relative;
    height: calc(650px * var(--device-scale, 0.8));
    display: grid;
    place-items: center;
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      transition: none !important;
      animation: none !important;
    }
  }
}

@scope ([data-project="ipod"]) {
  .wheel-button:focus-visible,
  .wheel-center:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
  }
  .wheel-button:disabled {
    cursor: default;
  }
}
