:root { color-scheme: dark; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; background: #161416; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
main { width: 100%; height: 100vh; height: 100dvh; position: relative; isolation: isolate; background: #08080d; }
canvas { display: block; width: 100%; height: 100%; }
.controls { position: absolute; bottom: 24px; right: 28px; display: flex; align-items: center; gap: 8px; opacity: .18; transition: opacity .25s; }
.scrubber { display: grid; gap: 4px; margin-right: 12px; width: 150px; }
.scrubber input { width: 100%; accent-color: #d8c38e; cursor: pointer; }
.scrubber output { text-align: right; font-size: 9px; letter-spacing: .1em; color: #d8c8a3; font-variant-numeric: tabular-nums; }
.controls:hover, .controls:focus-within { opacity: 1; }
button { border: 1px solid #c6b99128; background: #13121888; color: #e5dcc9; border-radius: 24px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; backdrop-filter: blur(12px); }
button span { font-size: 11px; margin-left: 5px; }
button:hover { background: #a68b4228; border-color: #c6b99177; }
button:focus-visible { outline: 2px solid #e7cf91; outline-offset: 4px; }
@media (max-width: 900px) and (orientation: portrait) {
  .controls { right: 16px; left: 16px; bottom: max(14px, env(safe-area-inset-bottom)); justify-content: center; opacity: .55; flex-wrap: wrap; gap: 8px; }
  .scrubber { flex: 0 0 100%; width: auto; margin: 0 0 3px; }
  .scrubber output { font-size: 10px; }
  .controls button { min-height: 42px; padding: 9px 13px; }
  .music-controls { top: max(12px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
  #music-toggle { min-height: 42px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .controls { bottom: max(8px, env(safe-area-inset-bottom)); right: max(12px, env(safe-area-inset-right)); }
  .music-controls { top: max(8px, env(safe-area-inset-top)); }
}
dialog { width: min(340px, calc(100% - 32px)); padding: 24px; border: 1px solid #c6b99155; border-radius: 18px; background: #211e23; color: #e5dcc9; }
dialog::backdrop { background: #000a; }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
dialog p { font-size: 14px; line-height: 1.8; }
dialog form { text-align: right; }
[hidden] { display: none !important; }
.music-controls { position: absolute; top: max(18px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); max-width: 230px; text-align: right; }
#music-toggle { color: #ebd7a9; }
.music-title { margin: 8px 0 0; color: #c5b89c; font-size: 11px; line-height: 1.5; text-shadow: 0 1px 5px #000; }
#music-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
