@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      min-height: 100vh;
      background: #b8b8b8;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-family: 'Inter', sans-serif;
      user-select: none;
      -webkit-user-select: none;
      padding: 40px 20px;
    }

    .back-link {
      position: fixed;
      top: 20px; left: 20px;
      font-size: 14px;
      color: #777;
      text-decoration: none;
      letter-spacing: 0.5px;
      z-index: 10;
    }
    .back-link:hover { color: #333; }

    .track-display {
      position: relative;
      z-index: 3;
      text-align: center;
      margin-bottom: 28px;
      min-height: 44px;
    }
    .track-name   { font-size: 16px; font-weight: 500; color: #1a1a1a; line-height: 1.3; }
    .track-artist { font-size: 13px; color: #777; margin-top: 3px; }
    .track-time   { font-size: 12px; color: #777; margin-top: 3px; letter-spacing: 0.8px; }


    .flip-stage {
      position: relative;
      z-index: 3;
      perspective: 1000px;
      width: 95px;
      height: 344px;
    }

    .flip-card {
      width: 100%;
      height: 100%;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.65s cubic-bezier(0.4, 0.0, 0.2, 1);
    }

    .flip-card.is-flipped { transform: rotateY(180deg); }

    .face {
      position: absolute;
      inset: 0;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
    }

    .face-back  { transform: rotateY(0deg); }
    .face-front { transform: rotateY(180deg); }

    .shell {
      width: 24.9mm;
      height: 83.8mm;
      border-radius: 12px;
      background: #f0efee;
      border: 1px solid #d0cece;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.9),
        inset 1px 0 0 rgba(255,255,255,0.5),
        inset -1px 0 0 rgba(0,0,0,0.03),
        0 2px 4px rgba(0,0,0,0.1),
        0 8px 24px rgba(0,0,0,0.16),
        0 24px 60px rgba(0,0,0,0.1);
      position: relative;
      overflow: hidden;
    }

   
    .shell::after {
      content: "";
      position: absolute;
      left: 0; right: 0;
      bottom: 10mm;
      height: 1px;
      background: rgba(0,0,0,0.07);
    }

  

    .slider-area {
      position: absolute;
      top: 5mm;
      left: 5mm;
      right: 5mm;
      height: 22.2mm;
      border-radius: 6px;
      background: linear-gradient(180deg, #5ecf5e 0%, #44bb44 100%);
      border: 1px solid #c0c0be;
      box-shadow: inset 0 1px 4px rgba(0,0,0,0.18), inset 0 -1px 2px rgba(0,0,0,0.08);
      overflow: hidden;
      cursor: pointer;
    }

  
    .slider-area::after {
      content: "";
      position: absolute;
      bottom: 0; left: 0; right: 0;
      height: 10mm;
      background: #f0efed;
      pointer-events: none;
    }

    .slider-knob {
      position: absolute;
      left: 0; right: 0;
      height: 19mm;
      top: 0;
      background: linear-gradient(180deg, #fafaf8 0%, #edecea 100%);
      border-radius: 6px;
      border: 1px solid rgba(0,0,0,0.06);
      box-shadow: 0 1px 5px rgba(0,0,0,0.16);
      transition: top 0.22s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 1;
    }

    .slider-icons {
      position: absolute;
      top: 5mm;
      left: 0mm;
      width: 18px;
      height: calc(22.2mm + 8.3mm);
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      align-items: center;
      padding: 8px 0;
      pointer-events: none;
    }

    .s-icon {
      font-size: 14px;
      color: #a0a0a0;
      line-height: 1;
      text-align: center;
    }

   
    .battery-pill {
      position: absolute;
      top: 109px;
      left: 5mm;
      right: 5mm;
      height: 3mm;
      border: 1px solid #c8c6c4;
      border-radius: 10px;
      display: flex;
      align-items: center;
      padding: 0 1mm;
      cursor: pointer;
      gap: 5px;
    }

    .batt-dot {
      width: 3px; height: 3px;
      border-radius: 50%;
      background: #ccc;
      transition: background 0.3s, box-shadow 0.3s;
    }
    .batt-dot.green  { background: #4caf50; box-shadow: 0 0 4px rgba(76,175,80,0.7); }
    .batt-dot.orange { background: #ff9800; box-shadow: 0 0 4px rgba(255,152,0,0.7); }
    .batt-dot.red    { background: #e53935; box-shadow: 0 0 5px rgba(229,57,53,0.9); }

    .apple-logo {
      position: absolute;
      bottom: 104px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 30px;
      color: #d0cece;
      line-height: 1;
    }

    .ipod-word {
      position: absolute;
      bottom: 79px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 22px;
      font-weight: 500;
      color: #c8c6c4;
      letter-spacing: -0.2px;
      white-space: nowrap;
    }

    .front-led {
      position: absolute;
      top: 26px;
      left: 50%;
      transform: translateX(-50%);
      width: 5px; height: 5px;
      border-radius: 50%;
      transition: background 0.25s, box-shadow 0.25s;
    }
    .front-led.green  { background: #4caf50; box-shadow: 0 0 5px rgba(76,175,80,0.9); border-color: #3d9140; }
    .front-led.orange { background: #ff9800; box-shadow: 0 0 5px rgba(255,152,0,0.9);  border-color: #e08800; }
    .front-led.red    { background: #e53935; box-shadow: 0 0 5px rgba(229,57,53,0.9);  border-color: #c62828; }
    .front-led.blink  { animation: led-blink 1.1s ease-in-out infinite; }
    @keyframes led-blink { 0%,100%{opacity:1} 50%{opacity:0.12} }

    
    .wheel-wrap {
      position: absolute;
      top: 36px;
      left: 50%;
      transform: translateX(-50%);
      width: 88px;
      height: 88px;
    }

    .wheel-ring {
      width: 88px;
      height: 88px;
      border-radius: 50%;
      background: linear-gradient(145deg, #f2f2f0 0%, #cfcfcf 60%, #dcdad8 100%);
      border: 1px solid #c8c6c4;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.8),
        0 1px 4px rgba(0,0,0,0.1);
      position: relative;
    }

    .wlabel {
      position: absolute;
      font-size: 15px;
      font-weight: 400;
      color: #7d7b78;
      pointer-events: none;
      line-height: 1;
    }
    .wlabel-top    { left: 50%; transform: translateX(-50%); }
    .wlabel-bottom { bottom: 0.4mm; left: 50%; transform: translateX(-50%); }
    .wlabel-left   { left: 0.2mm; top: 50%; transform: translateY(-50%); font-size: 10px; letter-spacing: -2px; }
    .wlabel-right  { right: 0.5mm; top: 50%; transform: translateY(-50%); font-size: 10px; letter-spacing: -2px; }

    .wheel-btn {
      position: absolute;
      cursor: pointer;
      border-radius: 50%;
      z-index: 2;
    }

    .wbtn-vol-up   { top: 0;   left: 50%; transform: translateX(-50%); width: 44px; height: 30px; }
    .wbtn-vol-down { bottom: 0; left: 50%; transform: translateX(-50%); width: 44px; height: 30px; }
    .wbtn-prev     { left: 0;  top: 50%; transform: translateY(-50%); width: 30px; height: 44px; }
    .wbtn-next     { right: 0; top: 50%; transform: translateY(-50%); width: 30px; height: 44px; }

    .wheel-center {
      position: absolute;
      left: 50%; top: 50%;
      transform: translate(-50%, -50%);
      width: 15mm; height: 15mm;
      border-radius: 50%;
      background: linear-gradient(145deg, #f4f3f1, #e8e7e5);
      border: 1px solid #ababab;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.85),
        0 1px 3px rgba(0,0,0,0.08);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 3;
      transition: filter 0.1s;
    }
    .wheel-center:active { filter: brightness(0.92); }
    .wheel-center svg { width: 15px; height: 15px; fill: #b0aeac; margin-left: 1px; }
    .wheel-center.playing svg { margin-left: 0; }

    .hint {
      position: relative;
      z-index: 3;
      margin-top: 20px;
      font-size: 13px;
      color: #888;
      text-align: center;
      min-height: 16px;
    }
    .error-msg {
      position: relative;
      z-index: 3;
      margin-top: 6px;
      font-size: 13px;
      color: #c0392b;
      text-align: center;
      min-height: 14px;
    }

    .setting-select {
      width: 100%;
      font-size: 11px;
      color: #444;
      background: #f8f8f8;
      border: 1px solid #ddd;
      border-radius: 4px;
      padding: 4px 6px;
      cursor: pointer;
      margin-top: 2px;
      font-family: 'Inter', sans-serif;
    }
    .settings-btn {
      position: fixed;
      top: 20px; right: 20px;
      font-size: 14px;
      background: none;
      border: none;
      cursor: pointer;
      color: #888;
      line-height: 1;
      padding: 2px;
      transition: color 0.15s;
      z-index: 10;
    }
    .settings-btn:hover { color: #333; }

    .settings-panel {
      position: fixed;
      top: 44px; right: 14px;
      background: rgba(255,255,255,0.92);
      border: 1px solid #ddd;
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 12px;
      color: #333;
      box-shadow: 0 4px 16px rgba(0,0,0,0.12);
      opacity: 0;
      pointer-events: none;
      transform: translateY(-4px);
      transition: opacity 0.15s, transform 0.15s;
      min-width: 130px;
      z-index: 50;
    }

    .settings-panel.is-open {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    .settings-title {
      font-size: 9px;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      color: #aaa;
      margin-bottom: 8px;
    }

   
    .settings-title + .settings-title,
    .settings-title.mt {
      margin-top: 10px;
    }

    .setting-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 0;
      cursor: pointer;
      font-size: 12px;
      color: #444;
    }

    .setting-row input { cursor: pointer; accent-color: #555; }

    #bgCanvas {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      opacity: 0;
      transition: opacity 1s;
    }

    #strobeFlash {
      position: fixed;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.05s;
    }

    #ytContainer {
      position: fixed;
      left: -9999px;
      top: -9999px;
      width: 1px;
      height: 1px;
      overflow: hidden;
    }

   
    .bg-swatch-list {
      display: flex;
      flex-direction: column;
      gap: 3px;
      margin-top: 2px;
    }

    .bg-swatch-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 6px;
      border-radius: 5px;
      cursor: pointer;
      border: 1.5px solid transparent;
      transition: background 0.12s, border-color 0.12s;
    }
    .bg-swatch-row:hover  { background: #f0f0f0; }
    .bg-swatch-row.active { border-color: #333; background: #f5f5f5; }

    .bg-swatch-dot {
      width: 14px; height: 14px;
      border-radius: 50%;
      flex-shrink: 0;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }

    .bg-swatch-name {
      font-size: 11px;
      color: #444;
      font-family: 'Inter', sans-serif;
    }
    .bg-swatch-row.active .bg-swatch-name { font-weight: 500; color: #222; }

   
    .anim-list {
      display: flex;
      flex-direction: column;
      gap: 3px;
      margin-top: 2px;
    }

    .anim-row {
      display: flex;
      align-items: center;
      padding: 4px 6px;
      border-radius: 5px;
      cursor: pointer;
      border: 1.5px solid transparent;
      transition: background 0.12s, border-color 0.12s;
    }
    .anim-row:hover  { background: #f0f0f0; }
    .anim-row.active { border-color: #333; background: #f5f5f5; }

    .anim-name {
      font-size: 11px;
      color: #444;
      font-family: 'Inter', sans-serif;
    }
    .anim-row.active .anim-name { font-weight: 500; color: #222; }
