html, body { margin: 0; height: 100%; background: #0a0a0a; overflow: hidden; font-family: Georgia, "Times New Roman", serif; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; color: #f3e6c8; font-size: 15px; letter-spacing: .04em; background: radial-gradient(ellipse at 50% 60%, #2a2438 0%, #0f0d16 70%); transition: opacity .6s ease; pointer-events: none; }
#loading.done { opacity: 0; }
#loading span { opacity: .75; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

#note { position: fixed; left: 16px; top: 14px; padding: 6px 10px; border-radius: 8px; font-size: 12px; color: #f3e6c8; background: rgba(20,16,24,.7); backdrop-filter: blur(6px); }

#timePanel {
  position: fixed; left: 16px; bottom: 16px; width: 300px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(20,16,24,.82); color: #f3e6c8; font-size: 13px;
  backdrop-filter: blur(6px); box-shadow: 0 6px 24px rgba(0,0,0,.4);
  font-family: Georgia, "Times New Roman", serif;
}
#timePanel .row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
#timePanel .row.small { font-size: 11px; opacity: .8; }
#timePanel strong { flex: 1; }
#timePanel input[type=range] { width: 100%; margin: 6px 0; accent-color: #e0a35a; }
#timePanel button { background: #e0a35a; color: #2a1e1a; border: 0; border-radius: 6px; padding: 5px 10px; font-family: inherit; font-size: 12px; cursor: pointer; }
#timePanel button.active { background: #f3d9a0; }
#timePanel #tpInfo { margin-left: auto; font-size: 11px; opacity: .85; white-space: nowrap; }

#credit { position: fixed; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); font-size: 10.5px; color: rgba(243,230,200,.55); text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; pointer-events: auto; }
#credit a { color: inherit; text-decoration: underline dotted; }
#credit:hover { color: rgba(243,230,200,.9); }
@media (max-width: 900px) { #credit { white-space: normal; text-align: center; width: 80%; } }

#tune { position: fixed; right: 16px; top: 16px; width: 340px; max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; padding: 12px 14px; border-radius: 10px; background: rgba(20,16,24,.86); color: #f3e6c8; font-size: 12px; backdrop-filter: blur(6px); box-shadow: 0 6px 24px rgba(0,0,0,.4); }
#tune .row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
#tune strong { flex: 1; }
#tune button { background: #e0a35a; color: #2a1e1a; border: 0; border-radius: 6px; padding: 4px 9px; font-family: inherit; font-size: 12px; cursor: pointer; }
#tune .tr { display: grid; grid-template-columns: 128px 1fr 46px; align-items: center; gap: 8px; margin: 3px 0; cursor: pointer; }
#tune .tr input[type=range] { width: 100%; accent-color: #e0a35a; margin: 0; }
#tune .tr output { text-align: right; font-variant-numeric: tabular-nums; opacity: .85; }
#tune #tuneUrl { flex: 1; min-width: 0; background: rgba(0,0,0,.35); color: #f3e6c8; border: 1px solid rgba(243,230,200,.25); border-radius: 6px; padding: 4px 6px; font-size: 11px; font-family: monospace; }

@media (max-width: 640px) {
  #timePanel { left: 12px; right: 12px; bottom: max(64px, calc(env(safe-area-inset-bottom) + 56px)); width: auto; font-size: 12px; }
  #timePanel #tpInfo { white-space: normal; }
  #tune { left: 12px; right: 12px; top: 12px; width: auto; max-height: 60vh; font-size: 11px; }
  #tune .tr { grid-template-columns: 104px 1fr 40px; }
  #credit { font-size: 9.5px; width: 88%; bottom: auto; top: max(10px, env(safe-area-inset-top)); }
}
