/* ============================================================
   iPod nano 4G replica
   ============================================================ */
:root {
  --body-base: #cfd1d3;
  --body-light: #ededee;
  --body-dark: #a5a9ac;
  --wheel-ring: #e7e8e9;
  --wheel-center: #fafafb;
  --wheel-text: #8b9095;

  --screen-w: 214px;
  --screen-h: 176px; /* nano 4G LCD is landscape-ish 240x180-ish in-body; portrait UI */

  --lcd-1: #f4f6f9;
  --lcd-2: #dfe4ea;
  --sel-1: #7db2ef;
  --sel-2: #2f6fd0;
  --ink: #1c1f24;
  --ink-soft: #6b7178;

  --font: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  background:
    radial-gradient(135% 95% at 50% 12%, #34373d 0%, #212327 46%, #0f1012 100%);
  color: #fff;
  overflow: hidden;
  overscroll-behavior: none;
}
body { display: flex; align-items: center; justify-content: center; }

/* ===================== iPHONE FRAME ===================== */
.phone-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.phone {
  --pw: 414px; --ph: 868px;
  box-sizing: border-box;
  width: var(--pw); height: var(--ph);
  padding: 13px;
  border-radius: 66px;
  position: relative;
  transform-origin: center center;
  background:
    linear-gradient(150deg, #34363b 0%, #101113 38%, #050506 100%);
  box-shadow:
    0 0 0 2px #000,
    0 0 0 3px rgba(255,255,255,0.05),
    0 44px 100px rgba(0,0,0,0.6),
    0 14px 40px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.14) inset;
}
.phone-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 54px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 2px #000, 0 0 0 3px rgba(0,0,0,0.6) inset;
}

/* side buttons */
.pbtn { position: absolute; background: linear-gradient(180deg,#26282c,#111214); border-radius: 3px; box-shadow: -1px 0 1px rgba(0,0,0,0.4) inset, 1px 0 1px rgba(255,255,255,0.05); }
.pbtn-mute { left: -3px; top: 132px; width: 4px; height: 30px; }
.pbtn-volup { left: -3px; top: 186px; width: 4px; height: 56px; }
.pbtn-voldn { left: -3px; top: 256px; width: 4px; height: 56px; }
.pbtn-power { right: -3px; top: 210px; width: 4px; height: 82px; }

/* dynamic island */
.dynamic-island {
  position: absolute; top: 15px; left: 50%;
  transform: translateX(-50%);
  width: 122px; height: 34px;
  background: #000;
  border-radius: 20px;
  z-index: 20;
}
/* home indicator */
.home-indicator {
  position: absolute; bottom: 9px; left: 50%;
  transform: translateX(-50%);
  width: 140px; height: 5px;
  background: rgba(255,255,255,0.55);
  border-radius: 3px;
  z-index: 20;
}

/* app fills the screen */
.app {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background:
    radial-gradient(130% 90% at 50% 8%, #2a2d33 0%, #191b1f 52%, #0e0f12 100%);
  color: #fff;
}

/* iOS status bar */
.ios-status {
  flex: 0 0 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 30px 0;
  font-size: 16px; font-weight: 600;
  color: #fff;
  z-index: 21;
}
.ios-time { letter-spacing: 0.3px; padding-left: 6px; }
.ios-right { display: flex; align-items: center; gap: 6px; }
.ios-ico { height: 12px; fill: #fff; }
.ios-batt {
  width: 25px; height: 12px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.55);
  padding: 1.5px; position: relative;
}
.ios-batt::after { content:""; position:absolute; right:-3px; top:3.5px; width:2px; height:4px; background:rgba(255,255,255,0.55); border-radius:0 1px 1px 0; }
.ios-batt i { display:block; height:100%; width:78%; background:#fff; border-radius:1.5px; }

.stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 4px 16px 34px;
  overflow: hidden;
  user-select: none;
}

/* ===================== DEVICE ===================== */
.device {
  --w: 256px;
  width: var(--w);
  padding: 15px 14px 55px;
  border-radius: 44px;
  background:
    linear-gradient(150deg, var(--body-light) 0%, var(--body-base) 38%, var(--body-dark) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -2px 6px rgba(0, 0, 0, 0.25) inset,
    0 26px 60px rgba(0, 0, 0, 0.55),
    0 6px 18px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: background 0.5s ease;
}
/* subtle brushed-metal edge highlight */
.device::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 34px;
  background: linear-gradient(150deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 30%);
  pointer-events: none;
}

.device-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
}

/* ---- glass front over the screen ---- */
.glass {
  width: 100%;
  border-radius: 30px 30px 16px 16px;
  padding: 18px 14px 20px;
  background: linear-gradient(180deg, #0b0c0e, #17181b 60%, #0d0e10);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.5) inset,
    0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}
.glass-sheen {
  position: absolute;
  top: 0; left: -20%;
  width: 80%; height: 130%;
  background: linear-gradient(115deg, rgba(255,255,255,0.12), rgba(255,255,255,0) 45%);
  transform: rotate(4deg);
  pointer-events: none;
}

/* ---- the LCD ---- */
.screen {
  position: relative;
  width: 100%;
  height: 272px;
  margin: 0 auto;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--lcd-1), var(--lcd-2));
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}
.screen-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0) 22%);
  mix-blend-mode: screen;
}

/* status bar */
.statusbar {
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(180deg, #eef1f5, #cfd6de);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  color: #2a2f36;
}
.sb-title { text-align: center; font-size: 12px; letter-spacing: 0.2px; }
.sb-left { display: flex; align-items: center; }
.sb-left svg { width: 12px; height: 12px; fill: #2a2f36; }
.sb-right { display: flex; justify-content: flex-end; }
.battery {
  width: 22px; height: 11px;
  border: 1px solid #2a2f36;
  border-radius: 2px;
  position: relative;
  padding: 1px;
}
.battery::after {
  content: ""; position: absolute; right: -3px; top: 3px;
  width: 2px; height: 4px; background: #2a2f36; border-radius: 0 1px 1px 0;
}
.battery i {
  display: block; height: 100%;
  width: var(--batt, 78%);
  background: linear-gradient(180deg, #7ac36a, #4f9d3f);
  border-radius: 1px;
}

/* screen body — holds animated layers */
.screen-body {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
}
.layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ===================== MENU / LISTS ===================== */
.menu { display: flex; height: 100%; }
.menu-list {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
}
.menu-list.split { flex: 0 0 58%; }
.list-scroll { position: absolute; inset: 0; transition: transform 0.14s ease; }

.row {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 7px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  white-space: nowrap;
  overflow: hidden;
}
.row .row-ico { width: 15px; height: 15px; flex: 0 0 15px; opacity: 0.8; }
.row .row-ico svg { width: 100%; height: 100%; }
.row .row-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.row .row-sub { font-size: 10px; color: var(--ink-soft); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; text-align: right; }

/* two-line track rows */
.row.two { height: 33px; }
.row .row-text { display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; min-width: 0; overflow: hidden; gap: 1px; }
.row .row-t { font-size: 12.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .row-a { font-size: 10px; line-height: 1.15; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.sel .row-a { color: rgba(255,255,255,0.85); }
.row .chev { margin-left: auto; opacity: 0.4; font-size: 12px; }
.row.sel {
  color: #fff;
  background: linear-gradient(180deg, var(--sel-1), var(--sel-2));
  border-bottom-color: transparent;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.row.sel .row-sub { color: rgba(255,255,255,0.85); }
.row.sel .row-ico { opacity: 1; }
.row.sel .row-ico svg { fill: #fff; }
.row.sel .chev { opacity: 0.9; }
.row .swatch-dot {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset;
}

/* right-side preview pane */
.menu-preview {
  flex: 0 0 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: linear-gradient(180deg, #eef1f5, #d6dde4);
  border-left: 1px solid rgba(0,0,0,0.12);
}
.menu-preview .art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.1);
}
.menu-preview .glyph {
  width: 78%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: radial-gradient(circle at 40% 30%, #ffffff, #c9d2db);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.06);
}
.menu-preview .glyph svg { width: 52%; height: 52%; fill: var(--sel-2); }

/* empty-state message */
.empty {
  margin: auto;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  padding: 0 22px;
  line-height: 1.5;
}
.empty b { color: var(--ink); }

/* ===================== SEARCH ===================== */
.search { display: flex; flex-direction: column; height: 100%; }
.search-bar {
  flex: 0 0 auto;
  padding: 6px;
  background: linear-gradient(180deg, #e7ebf0, #d3dae1);
  border-bottom: 1px solid rgba(0,0,0,0.15);
}
.search-input {
  width: 100%;
  border: 1px solid #9aa3ad;
  border-radius: 12px;
  padding: 4px 10px;
  font: 12px var(--font);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a929b'><path d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/></svg>") no-repeat 8px center;
  padding-left: 26px;
  outline: none;
  color: var(--ink);
}
.search-results { flex: 1 1 auto; position: relative; overflow: hidden; }
.search-status { padding: 14px; text-align: center; color: var(--ink-soft); font-size: 12px; }

/* ===================== NOW PLAYING ===================== */
.np { display: flex; flex-direction: column; height: 100%; padding: 8px 14px 8px; }
.np-top { font-size: 11px; color: var(--ink-soft); text-align: right; margin-bottom: 3px; height: 13px; }
.np-art {
  width: 104px; height: 104px;
  margin: 0 auto 7px;
  border-radius: 5px;
  background-size: cover; background-position: center;
  background-color: #cfd6de;
  box-shadow: 0 5px 14px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.1);
}
.np-meta { text-align: center; margin-bottom: auto; overflow: hidden; }
.np-title { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.np-album { font-size: 11px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-source {
  display: inline-block; margin-top: 5px;
  font-size: 8.5px; letter-spacing: 0.4px; text-transform: uppercase;
  color: #fff; background: #b3bcc6; padding: 1px 6px; border-radius: 8px;
}
.np-source.full { background: #4f9d3f; }

.np-scrub { margin-top: 6px; }
.np-mode { text-align: center; font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; height: 11px; }
.np-bar {
  height: 6px; border-radius: 3px;
  background: linear-gradient(180deg, #c3cad2, #d7dde3);
  box-shadow: 0 1px 1px rgba(0,0,0,0.15) inset;
  position: relative; overflow: hidden;
}
.np-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(180deg, var(--sel-1), var(--sel-2));
}
.np-times { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-soft); margin-top: 3px; }

/* ===================== COVER FLOW ===================== */
.cf { position: relative; height: 100%; overflow: hidden; background: linear-gradient(180deg, #23272e, #0c0d0f); }
.cf-stage { position: absolute; inset: 0; perspective: 620px; }
.cf-cover {
  position: absolute; top: 46%; left: 50%;
  width: 108px; height: 108px; margin: -54px 0 0 -54px;
  border-radius: 4px;
  background-size: cover; background-position: center; background-color: #2b2f36;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.28s;
  will-change: transform;
}
.cf-cover::after { /* reflection */
  content: ""; position: absolute; top: 100%; left: 0; width: 100%; height: 100%;
  background: inherit; background-size: cover;
  transform: scaleY(-1); opacity: 0.28;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 55%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 55%);
}
.cf-label {
  position: absolute; left: 0; right: 0; bottom: 12px;
  text-align: center; color: #fff;
}
.cf-label .t { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 20px; }
.cf-label .a { font-size: 10px; color: #b9c0c8; }

/* ===================== SWATCHES ===================== */
.swatches {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
  max-width: 300px;
}
.swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.12), 0 2px 4px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0,0,0,0.5);
}

.hint { font-size: 12px; color: #8b9198; text-align: center; margin: 0; max-width: 300px; }
.hint b { color: #c7ccd2; }

/* ===================== CLICK WHEEL ===================== */
.wheel {
  --wheel-size: 172px;
  width: var(--wheel-size);
  height: var(--wheel-size);
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 50% 40%,
      color-mix(in srgb, var(--wheel-ring) 84%, #fff),
      var(--wheel-ring) 60%,
      color-mix(in srgb, var(--wheel-ring) 88%, #000) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 -3px 9px rgba(0,0,0,0.14) inset,
    0 2px 6px rgba(0,0,0,0.3);
  touch-action: none;
  cursor: grab;
}
.wheel:active { cursor: grabbing; }
.wheel-label {
  position: absolute;
  color: var(--wheel-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  opacity: 0.9;
  user-select: none;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  text-shadow: 0 1px 1px rgba(0,0,0,0.06);
}
.wheel-label svg { width: 19px; height: 19px; fill: var(--wheel-text); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.06)); }
.wheel-menu { top: 13px; left: 50%; transform: translateX(-50%); }
.wheel-play { bottom: 13px; left: 50%; transform: translateX(-50%); }
.wheel-prev { left: 15px; top: 50%; transform: translateY(-50%); }
.wheel-next { right: 15px; top: 50%; transform: translateY(-50%); }

.wheel-center {
  position: absolute; top: 50%; left: 50%;
  width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border-radius: 50%;
  border: 0;
  background:
    radial-gradient(circle at 50% 40%,
      color-mix(in srgb, var(--wheel-center) 98%, #fff),
      var(--wheel-center) 68%,
      color-mix(in srgb, var(--wheel-center) 86%, #000) 100%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.06),
    0 1px 0 rgba(255,255,255,0.85) inset,
    0 -2px 5px rgba(0,0,0,0.12) inset,
    0 1px 3px rgba(0,0,0,0.22);
  cursor: pointer;
}
.wheel-center:active { box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 0 6px rgba(0,0,0,0.3) inset; }

/* ===================== TOAST ===================== */
.toast {
  position: absolute;
  left: 50%; bottom: 46px;
  transform: translate(-50%, 20px);
  background: rgba(20,22,25,0.92);
  color: #fff;
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* boot / apple logo */
.boot {
  position: absolute; inset: 0;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.boot svg { width: 54px; height: 54px; fill: #fff; opacity: 0.95; }
.boot.fade { animation: bootfade 0.5s ease forwards; }
@keyframes bootfade { to { opacity: 0; visibility: hidden; } }

#yt-host { position: fixed; width: 1px; height: 1px; left: -9999px; top: -9999px; opacity: 0; pointer-events: none; }
