* {
  box-sizing: border-box;
}

html,
body {
  overscroll-behavior: none;
}

body {
  margin: 0;
  font-family: "Chicago", monospace;
  color: #2e2e30;
  background: radial-gradient(circle at top, #fafafa, #dddddf 75%);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.app {
  width: min(420px, 90vw);
  margin: 1rem auto 1.6rem;
  text-align: center;
}

.subtitle {
  margin: 0.25rem 0 1rem;
  color: #66686d;
  font-size: 0.95rem;
}

h1 {
  margin: 0;
  letter-spacing: 0.02em;
}

.ipod-shell {
  position: relative;
  width: min(400px, 84vw);
  margin: 0 auto;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  border-radius: 42px;
  padding: 1.35rem 0.9rem 1.85rem;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.7), transparent 34%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 1px,
      rgba(210, 211, 215, 0.08) 1px,
      rgba(210, 211, 215, 0.08) 2px
    ),
    linear-gradient(180deg, #f5f6f8 0%, #d9dbdf 55%, #c9cbd1 100%);
  box-shadow:
    inset 0 2px 14px rgba(255, 255, 255, 0.92),
    inset 0 -10px 18px rgba(103, 104, 112, 0.12),
    inset 0 0 0 1px rgba(144, 146, 154, 0.42),
    0 18px 30px rgba(40, 40, 50, 0.11);
}

.ipod-shell::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 34px;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 38%),
    radial-gradient(circle at bottom right, rgba(120, 121, 128, 0.18), transparent 45%);
  mix-blend-mode: screen;
}

.ipod-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 42px;
  pointer-events: none;
  box-shadow:
    inset 12px 0 18px rgba(255, 255, 255, 0.16),
    inset -12px 0 18px rgba(118, 120, 126, 0.14);
}

.screen-frame {
  position: relative;
  width: 88%;
  margin: 0 auto;
  border-radius: 14px;
  padding: 0.75rem;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.1), transparent 35%),
    linear-gradient(160deg, #585960, #2a2b31);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 -2px 6px rgba(0, 0, 0, 0.35);
}

.screen-frame::after {
  content: none;
}

.player-host {
  width: 100%;
  aspect-ratio: 3 / 2.4;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(150deg, #1f2025 0%, #292a2f 56%, #18191c 100%);
  position: relative;
}

.player-host audio,
.player-host video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

.player-host audio {
  opacity: 0;
}

.audio-visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 160ms ease-out;
}

.audio-visualizer.active {
  opacity: 1;
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  color: #d5d7dc;
  font-weight: 600;
  font-family: monospace;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 35%);
}

.placeholder-note {
  font-size: 2.7rem;
  line-height: 1;
  color: rgba(232, 238, 248, 0.72);
  text-shadow:
    0 1px 1px rgba(255, 255, 255, 0.35),
    0 6px 14px rgba(20, 24, 35, 0.22);
}

.wheel-wrap {
  margin: 1.9rem auto 0.15rem;
  width: min(280px, 72%);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: radial-gradient(circle at 0% 0%, #fafbfd 0%, #eceff3 80%, #dde1e8 100%);
  position: relative;
  box-shadow:
    inset 0 3px 8px rgba(255, 255, 255, 0.95),
    inset 0 -11px 16px rgba(142, 147, 157, 0.28),
    inset 0 0 0 2px rgba(181, 185, 193, 0.7),
    0 10px 18px rgba(86, 91, 102, 0.2);
}

.wheel-wrap::before {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 999px;
  background: radial-gradient(circle at 48% 35%, #f5f7fa, #e7ebf0 72%, #dde2e9 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    inset 0 -6px 10px rgba(156, 161, 172, 0.22),
    inset 0 0 0 2px rgba(149, 153, 163, 0.5);
  pointer-events: none;
}

.wheel-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 84%, rgba(124, 129, 139, 0.2), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.4), transparent 32%);
}

.wheel-core {
  position: absolute;
  width: 33%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #a3a7af;
  background:
    linear-gradient(132deg, rgba(255, 255, 255, 0.72), transparent 50%),
    radial-gradient(circle at 52% 26%, #f3f5f8, #dce0e7 62%, #ccd1da 100%);
  box-shadow:
    inset 0 1px 4px rgba(255, 255, 255, 0.9),
    inset 0 -5px 10px rgba(150, 155, 164, 0.26),
    0 1px 1px rgba(255, 255, 255, 0.7);
}

.wheel-label {
  position: absolute;
  border: 0;
  background: transparent;
  color: #9a9ba0;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
}

.menu-btn {
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
}

.prev-btn {
  left: 0%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.96rem;
}

.next-btn {
  right: 0%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.96rem;
}

.play-btn {
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
}

.wheel-label:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ring-divider {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 17%;
  border-radius: 999px;
  transform-origin: center center;
  background: linear-gradient(
    180deg,
    rgba(87, 92, 101, 0.92),
    rgba(115, 121, 131, 0.82)
  );
  box-shadow:
    inset 0 1px 1px rgba(244, 247, 252, 0.62),
    inset 0 -1px 1px rgba(64, 68, 77, 0.45);
}

.cut-a {
  transform: translate(-50%, -50%) rotate(45deg) translateY(-39%);
}

.cut-b {
  transform: translate(-50%, -50%) rotate(135deg) translateY(-39%);
}

.cut-c {
  transform: translate(-50%, -50%) rotate(225deg) translateY(-39%);
}

.cut-d {
  transform: translate(-50%, -50%) rotate(315deg) translateY(-39%);
}

.controls {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: auto;
  margin-top: 0;
  text-align: left;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(240, 241, 236, 0.96), rgba(229, 230, 224, 0.96)),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.02) 0px,
      rgba(0, 0, 0, 0.02) 1px,
      rgba(255, 255, 255, 0.05) 1px,
      rgba(255, 255, 255, 0.05) 2px
    );
  font-family: "Chicago", monospace;
  --settings-font-size: 0.74rem;
  font-size: var(--settings-font-size);
}

.menu-topbar {
  min-height: 1.5rem;
  display: grid;
  grid-template-columns: 24px 1fr 30px;
  align-items: center;
  border-bottom: 2px solid rgba(56, 56, 58, 0.75);
  padding: 0 0.35rem;
  background: linear-gradient(180deg, #d7d8d4, #cecfcb);
  color: #1f1f20;
  justify-items: left;
}

.menu-top-title {
  text-align: center;
  font-size: var(--settings-font-size);
  font-weight: 700;
}

.menu-top-icon {
  font-size: var(--settings-font-size);
}

.battery-icon {
  width: 23px;
  height: 12px;
  border: 2px solid #2a2a2c;
  position: relative;
  border-radius: 2px;
}

.battery-icon::before {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 2px;
  height: 4px;
  background: #2a2a2c;
}

.battery-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 15px;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    #1f1f22 0 3px,
    transparent 3px 4px
  );
}

.menu-item {
  min-height: 1.8rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: left;
  padding: 0 0.38rem;
  border-bottom: 1px solid rgba(74, 74, 76, 0.5);
  color: #1f1f23;
  text-align: left;
}

.menu-item.active {
  background: linear-gradient(180deg, #47484b, #3e3f42);
  color: #f2f2f3;
}

.menu-label {
  font-size: var(--settings-font-size);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.menu-chevron {
  justify-self: end;
  font-size: 0.9rem;
}

.menu-control {
  padding: 0.22rem 0.38rem 0.34rem;
  border-bottom: 1px solid rgba(74, 74, 76, 0.35);
  display: grid;
  place-items: left;
}

input[type="file"],
select,
input[type="range"] {
  width: 100%;
  border-radius: 2px;
  border: 1px solid #8b8d8d;
  background: #f3f4ef;
  color: #1e1f22;
  font-family: "Chicago", monospace;
  font-size: var(--settings-font-size);
  text-align: left;
}

select,
input[type="file"] {
  min-height: 21px;
  font-size: var(--settings-font-size);
}

input[type="range"] {
  height: 16px;
}

input[type="file"]::file-selector-button {
  font-family: "Chicago", monospace;
  font-size: var(--settings-font-size);
}

input[type="file"]::-webkit-file-upload-button {
  font-family: "Chicago", monospace;
  font-size: var(--settings-font-size);
}

@media (max-width: 520px) {
  .ipod-shell {
    width: min(390px, 90vw);
    min-height: 680px;
    border-radius: 32px;
    padding: 1rem 0.8rem 1.2rem;
  }

  .screen-frame {
    width: 90%;
  }

  .wheel-wrap {
    width: min(260px, 76%);
    margin-top: 1.45rem;
  }
}
