:root { color-scheme: light dark; --bg: #fff; --text: #515158; --star: #85858b; --control: #73737b; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #080808; --text: #d4d4d8; --star: #93939b; --control: #a2a2aa; }
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; -webkit-font-smoothing: antialiased; }
main { position: fixed; z-index: 1; inset: 0; height: 100dvh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: clamp(20px, 5dvh, 48px); padding: max(20px, env(safe-area-inset-top)) 0 max(60px, env(safe-area-inset-bottom)); }
.profile { display: flex; align-items: center; flex-direction: column; gap: 16px; flex-shrink: 0; }
.avatar { display: block; width: 56px; height: 56px; object-fit: cover; object-position: 50% 43%; border-radius: 50%; background: #fff; }
.protected-content, .protected-content * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.avatar-frame { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; }
.avatar { pointer-events: none; -webkit-user-drag: none; }
h1 { margin: 0; font-size: 13px; line-height: 1.8; font-weight: 400; letter-spacing: .1em; }
.stars { position: fixed; inset: 0; overflow: hidden; pointer-events: none; mask-image: radial-gradient(ellipse 340px 350px at 50% 48%, transparent 55%, #000 100%); }
.star { position: absolute; top: -16px; left: var(--x); width: var(--size); height: var(--size); background: var(--star); opacity: var(--opacity); clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%); animation: fall var(--duration) linear var(--delay) infinite; }
@keyframes fall { from { transform: translate3d(0, -16px, 0) rotate(0deg); } to { transform: translate3d(var(--drift), calc(100dvh + 32px), 0) rotate(100deg); } }
body.paused .star, body.away .star { animation-play-state: paused; }
.motion { position: fixed; z-index: 2; bottom: max(20px, env(safe-area-inset-bottom)); right: max(20px, env(safe-area-inset-right)); width: 44px; height: 44px; padding: 12px; border: 0; border-radius: 50%; background: transparent; color: var(--control); cursor: pointer; }
.motion[hidden] { display: none; }
.motion svg { width: 20px; height: 20px; display: block; }
.motion .play-icon, body.paused .pause-icon { display: none; }
body.paused .play-icon { display: block; }
.motion:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.motion:focus-visible { outline: 2px solid var(--control); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .star { animation-play-state: paused; } }

.cursor-stars { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.cursor-star { position: absolute; left: var(--left); top: var(--top); width: var(--size); height: var(--size); background: var(--star); clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%); animation: cursor-fall var(--life) ease-in forwards; }
@keyframes cursor-fall {
  0% { opacity: .65; transform: translate(-50%, -50%) rotate(0deg) scale(.7); }
  18% { opacity: .65; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift)), var(--drop)) rotate(var(--turn)) scale(.3); }
}
body.paused .cursor-star, body.away .cursor-star { display: none; }
@media (prefers-reduced-motion: reduce) { .cursor-star { display: none; } }

.music { --cover-size: min(180px, 35vw, 24dvh); --step: calc(var(--cover-size) * .83); width: min(100%, 740px); flex-shrink: 0; text-align: center; }
.music h2 { margin: 0 0 10px; font-size: 10px; line-height: 1.5; letter-spacing: .24em; font-weight: 400; color: var(--control); }
.covers { position: relative; height: calc(var(--cover-size) * 9 / 16 + 12px); width: 100%; perspective: 900px; overflow: hidden; touch-action: pan-y pinch-zoom; }
.cover { position: absolute; left: 50%; top: 50%; width: var(--cover-size); height: calc(var(--cover-size) * 9 / 16); border: 0; border-radius: 0; padding: 0; color: rgba(75, 67, 87, .5); font: inherit; cursor: pointer; background: transparent; transform: translate(-50%, -50%); transition: transform 420ms cubic-bezier(.22,.7,.22,1), opacity 420ms ease, filter 420ms ease; -webkit-tap-highlight-color: transparent; }
/* Keep the slot stable; only the artwork paints a background. */
.cover-artwork { display: block; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 100%; aspect-ratio: 1; border: 0; border-radius: 3px; background: transparent; pointer-events: none; }
.cover[data-format="video"] .cover-artwork { aspect-ratio: 16 / 9; }
.cover-artwork img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; pointer-events: none; -webkit-user-drag: none; }
.cover[data-position="0"] { z-index: 3; opacity: 1; transform: translate(-50%, -50%); cursor: pointer; }
.cover[data-position="-1"] { z-index: 2; opacity: .24; transform: translate(calc(-50% - var(--step)), -50%) translateZ(-65px) rotateY(24deg) scale(.84); }
.cover[data-position="1"] { z-index: 2; opacity: .24; transform: translate(calc(-50% + var(--step)), -50%) translateZ(-65px) rotateY(-24deg) scale(.84); }
.cover[data-position="-2"] { opacity: 0; pointer-events: none; transform: translate(calc(-50% - var(--step) * 1.55), -50%) translateZ(-130px) scale(.65); }
.cover[data-position="2"] { opacity: 0; pointer-events: none; transform: translate(calc(-50% + var(--step) * 1.55), -50%) translateZ(-130px) scale(.65); }
.track-info { margin: 8px auto 0; width: min(88%, 360px); min-height: 44px; }
.track-title { font-size: 12px; font-weight: 400; letter-spacing: .04em; margin: 0; line-height: 1.7; }
.track-note { margin: 3px 0 0; font-size: 10px; letter-spacing: .04em; color: var(--control); line-height: 1.6; }
.cover:focus-visible { outline: none; }
.cover:focus-visible .cover-artwork { outline: 2px solid var(--control); outline-offset: 3px; }
@media (prefers-color-scheme: dark) {
  .cover { color: #c2b7cd; }
  .cover[data-position="-1"], .cover[data-position="1"] { opacity: .32; }
}
@media (max-height: 600px) {
  main { gap: 14px; padding-top: 12px; padding-bottom: 40px; }
  .profile { gap: 8px; }
  .avatar-frame, .avatar { width: 40px; height: 40px; }
  .music h2 { margin-bottom: 6px; }
  .track-info { margin-top: 6px; }
}
@media (max-height: 420px) {
  main { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .profile { flex-direction: row; gap: 12px; }
  .avatar-frame, .avatar { width: 32px; height: 32px; }
  .track-note { margin-top: 2px; }
  .track-info { margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) { .cover { transition: none; } }
