:root {
  color-scheme: light;
  --yellow: #f6d224;
  --selection-blue: #1c57b5;
  --ink: #141519;
  --quiet: #53565d;
  --line: #e4e5e7;
  --sans: Arial, Helvetica, sans-serif;
  --mono: "Courier New", monospace;
  color: var(--ink);
  font-family: var(--sans);
  background: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 240px; margin: 0; background: #fff; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid #735900;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-content: center;
  justify-items: center;
  gap: 11px;
  padding: clamp(16px, 4.5vw, 46px) 14px;
}
.embed .stage { min-height: 0; padding: 10px 12px 15px; }
.stage-title {
  margin: 0 0 6px;
  color: #000;
  font-size: clamp(1.5rem, 5vw, 3.125rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-align: center;
  text-wrap: balance;
}
.listening-notice {
  max-width: 378px;
  margin: 0;
  text-align: center;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.4;
}

.device {
  width: min(100%, 378px);
  padding: 23px 21px 13px;
  border: 1px solid #151619;
  border-radius: 37px 37px 40px 40px;
  background:
    repeating-linear-gradient(2deg, #0000000e 0 1px, #ffffff04 1px 3px),
    linear-gradient(145deg, #383a40, #24262b 38%, #25262b 67%, #1e1f24);
  box-shadow: inset 0 2px 2px #ffffff2b, inset 3px 0 6px #f7f7fa15,
    inset -4px -5px 8px #0005, 0 2px 1px #17171a, 0 10px 25px #10101520;
}
.device.is-video { width: min(100%, 566px); }

.display {
  padding: 7px;
  border: 1px solid #131415;
  border-radius: 16px;
  background: #07080a;
  box-shadow: 0 1px 0 #ffffff28, inset 0 1px 4px #0009;
}
.screen {
  overflow: hidden;
  min-width: 0;
  min-height: 205px;
  border-radius: 9px;
  background: #fff;
}

.screen-header {
  min-height: 35px;
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}
.screen-header h2 {
  margin: 0;
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.screen-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--quiet);
  font: 700 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: .045em;
}
.signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}
.signal i { width: 2px; height: 4px; border-radius: 1px; background: #a0a1a7; }
.signal i:nth-child(2) { height: 8px; }
.signal i:nth-child(3) { height: 6px; }
.is-playing .signal i { background: #a57600; animation: signal .54s alternate infinite ease-in-out; }
.is-playing .signal i:nth-child(2) { animation-delay: -.2s; }
.is-playing .signal i:nth-child(3) { animation-delay: -.4s; }
@keyframes signal { from { transform: scaleY(.45); } to { transform: scaleY(1); } }

.menu-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 9px 11px;
  min-height: 170px;
}
.menu-list {
  list-style: none;
  padding: 0 2px 0 0;
  margin: 0;
  overflow-y: auto;
  max-height: 154px;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: #c3c4c7 transparent;
}
.menu-row {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  padding: 4px 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
}
.menu-row::after {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-width: 1.5px 1.5px 0 0;
  border-style: solid;
  transform: rotate(45deg);
  color: #797c83;
  margin-right: 2px;
}
.menu-row:hover { background: #f1f1f2; }
.menu-row:focus-visible { outline-offset: -2px; }
.menu-row[aria-current="true"] { background: var(--selection-blue); color: #fff; }
.menu-row[aria-current="true"]::after { color: currentColor; }
.menu-row[aria-current="true"]:focus-visible { outline-color: #fff; }
.menu-row:disabled { opacity: .48; cursor: default; }
.menu-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row .menu-scope { flex: 0 0 auto; margin-left: auto; font-size: 10px; font-weight: 500; }
.menu-preview {
  padding-left: 9px;
  border-left: 1px solid var(--line);
  min-width: 0;
  font-size: 11px;
}
.menu-preview img {
  display: block;
  width: 100%;
  max-width: 116px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 5px;
  background: #24252a;
  margin-bottom: 7px;
}
#preview-title, #preview-detail {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#preview-title { font-weight: 800; }
#preview-detail { color: var(--quiet); margin-top: 3px; font-size: 10px; }

.now-playing { padding: 10px 11px 9px; }
.track-display {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.track-cover {
  display: block;
  width: 74px;
  height: 74px;
  border-radius: 5px;
  object-fit: cover;
  background: #24252a;
}
#track-position { display: block; color: var(--quiet); font: 700 10px var(--mono); }
.track-info h2 {
  margin: 4px 0;
  font-size: 17px;
  letter-spacing: -.04em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.track-info p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--quiet);
  font-size: 11px;
}
.seek {
  --progress: 0%;
  appearance: none;
  display: block;
  width: 100%;
  height: 19px;
  margin: 6px 0 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.seek:disabled { cursor: default; }
.seek::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, #a57600 var(--progress), #dfe0e2 var(--progress));
  border-radius: 2px;
}
.seek::-moz-range-track {
  height: 4px;
  background: linear-gradient(90deg, #a57600 var(--progress), #dfe0e2 var(--progress));
  border-radius: 2px;
}
.seek::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -3.5px;
  border: 1px solid #8a6b06;
  border-radius: 50%;
  background: var(--yellow);
}
.seek::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 1px solid #8a6b06;
  border-radius: 50%;
  background: var(--yellow);
}
.time-readout {
  display: flex;
  justify-content: space-between;
  color: var(--quiet);
  font: 700 10px var(--mono);
}
.track-actions, .video-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 6px;
}
.screen-action {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #36363b;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.share-url {
  width: 100%;
  margin-top: 6px;
  padding: 5px 6px;
  border: 1px solid #a0a2a5;
  border-radius: 3px;
  font-size: 10px;
}

.video-panel { padding: 8px; }
.video-slot video, .video-slot iframe {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 4px;
  background: #151519;
  aspect-ratio: 16 / 9;
}
.video-slot iframe { min-height: 200px; min-width: 200px; }
.video-actions { justify-content: space-between; padding: 2px 1px 0; font-size: 11px; }
#video-title { font-weight: 700; overflow-wrap: anywhere; }
.screen-notice {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 6px 9px;
  background: #f6f6f7;
  color: #41434a;
  font-size: 11px;
  line-height: 1.35;
}

.wheel {
  position: relative;
  width: min(67%, 198px);
  aspect-ratio: 1;
  margin: 18px auto 0;
  border: 1px solid #121316;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 15px, #fff1 15px 15.5px, transparent 16px),
    linear-gradient(145deg, #33353b, #26272c 50%, #202126);
  box-shadow: inset 0 1px 2px #efeff72c, inset 0 -2px 4px #0007, 0 1px 2px #0006;
  color: #f2f2f5;
  touch-action: none;
  user-select: none;
}
.wheel-key, .wheel-center {
  position: absolute;
  display: grid;
  place-content: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: inherit;
}
.wheel button:focus-visible { outline-color: var(--yellow); outline-offset: 1px; }
.wheel button:disabled { cursor: default; opacity: .4; }
.wheel-key { border: 0; background: transparent; }
.wheel-key:hover:not(:disabled) { background: #ffffff12; }
.wheel-key:active:not(:disabled), .wheel-center:active:not(:disabled) { filter: brightness(1.32); }
.menu-key, .playback-key {
  left: 28%;
  width: 44%;
  height: 23%;
  min-height: 30px;
}
.menu-key { top: 1.5%; font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.playback-key { bottom: 1.5%; display: flex; align-items: center; justify-content: center; gap: 5px; }
.previous-key, .next-key { top: 36%; width: 25%; height: 28%; }
.previous-key { left: 2%; }
.next-key { right: 2%; }

.wheel-center {
  top: 28%;
  left: 28%;
  width: 44%;
  height: 44%;
  border: 1px solid #111215;
  background: linear-gradient(149deg, #303137 1%, #222328 82%);
  box-shadow: inset 0 2px 5px #0008, 0 1px 0 #b6b5be35;
}
.play-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}
.pause-icon {
  width: 7px;
  height: 10px;
  border-width: 0 2px;
  border-style: solid;
}
.skip-icon {
  position: relative;
  width: 15px;
  height: 11px;
  border-right: 2px solid currentColor;
}
.previous-key .skip-icon { transform: rotate(180deg); }
.skip-icon::before, .skip-icon::after {
  content: "";
  position: absolute;
  top: 0;
  border-top: 5.5px solid transparent;
  border-bottom: 5.5px solid transparent;
  border-left: 7px solid currentColor;
}
.skip-icon::before { left: 0; }
.skip-icon::after { left: 6px; }

.device-mark {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  margin-top: 11px;
  color: var(--yellow);
  line-height: 1;
}
.device-mark b { font-size: 18px; font-weight: 900; letter-spacing: -.09em; }
.device-mark span { font: 800 9px var(--mono); letter-spacing: .12em; }

dialog {
  width: min(90vw, 360px);
  border: 1px solid #d4d5d8;
  padding: 20px;
  border-radius: 12px;
  color: var(--ink);
  box-shadow: 0 14px 40px #0003;
}
dialog::backdrop { background: #12121870; }
dialog h2 { font-size: 18px; margin: 0 0 14px; }
dialog p { font-size: 13px; line-height: 1.45; margin: 10px 0; }
dialog label { display: block; margin: 12px 0 4px; font-size: 12px; font-weight: 700; }
dialog label span { font-weight: 400; color: var(--quiet); }
dialog input { display: block; width: 100%; border: 1px solid #a0a2a5; border-radius: 5px; padding: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog-actions button { border: 1px solid #a0a2a5; padding: 8px 11px; border-radius: 5px; background: #fff; cursor: pointer; }
.dialog-actions button[type="submit"] { background: var(--yellow); border-color: #ae8b12; font-weight: 700; }
.dialog-actions button:disabled { cursor: wait; opacity: .6; }
.form-error { color: #8c2518; font-size: 12px; }
#upload-error { white-space: pre-line; overflow-wrap: anywhere; }

@media (max-width: 355px) {
  .stage { padding-inline: 9px; }
  .device { padding-inline: 13px; }
  .menu-layout { gap: 6px; }
  .menu-row { padding-inline: 5px; }
  .menu-preview { padding-left: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; }
}
