:root { --bg: rgba(18, 22, 28, 0.82); --fg: #e9eef3; --muted: #9aa7b4; --accent: #f4b400; --line: rgba(255,255,255,0.12); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1117; font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--fg); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#panel { position: fixed; top: 14px; left: 14px; width: 340px; max-height: calc(100% - 28px); overflow: auto; background: var(--bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.35); font-size: 13px; }
#panel h1 { font-size: 15px; margin: 0 0 10px; font-weight: 650; letter-spacing: 0.2px; }
#panel h1 span { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.row { padding: 8px 0; border-top: 1px solid var(--line); }
.row label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.row label b { color: var(--fg); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 2px 0 4px; }
.controls { display: flex; align-items: center; gap: 8px; }
.speeds { display: flex; gap: 4px; }
.btn { background: rgba(255,255,255,0.08); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: rgba(255,255,255,0.16); }
.btn.active { background: rgba(244,180,0,0.22); border-color: rgba(244,180,0,0.7); color: #ffe08a; }
.btn.primary { background: var(--accent); color: #1a1400; font-weight: 700; width: 38px; }
.btn.primary:hover { background: #ffc61a; }
.toggles, .cams { display: flex; flex-wrap: wrap; gap: 6px; }
.cams { margin-top: 4px; }
.phase { margin-top: 6px; font-size: 12px; color: #ffe08a; min-height: 16px; }
.credits { margin-top: 8px; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.credits a { color: var(--muted); }
#hint { position: fixed; bottom: 12px; right: 14px; font-size: 11px; color: rgba(255,255,255,0.55); background: rgba(0,0,0,0.35); padding: 5px 9px; border-radius: 8px; pointer-events: none; }
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 50% 40%, #1c2a3a, #0b0f14); z-index: 10; transition: opacity .6s; }
#loading.hide { opacity: 0; pointer-events: none; }
#loading .box { width: 360px; text-align: center; }
#loading .title { font-size: 20px; font-weight: 650; margin-bottom: 10px; }
#loading-text { color: var(--muted); font-size: 13px; min-height: 18px; }
.bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin-top: 12px; overflow: hidden; }
#loading-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
@media (max-width: 700px) { #panel { width: calc(100% - 28px); font-size: 12px; } #hint { display: none; } }

#panel { position: fixed; }
.collapse { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; padding: 0; line-height: 1; font-size: 16px; }
#panel.collapsed { width: auto; }
#panel.collapsed .row, #panel.collapsed .credits, #panel.collapsed h1 span { display: none; }
#panel.collapsed h1 { margin: 0; padding-right: 36px; }

.phases { margin-top: 8px; }
.phases select { flex: 1; min-width: 0; background: rgba(255,255,255,0.08); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font-size: 12px; }
.phases select option { background: #1b2028; color: var(--fg); }

#site-select { width: 100%; background: rgba(255,255,255,0.08); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font-size: 12px; }
#site-select option { background: #1b2028; }
#panel h1 span:first-child { display: inline; font-size: 15px; color: var(--fg); }

#site-select { flex: 1; }
#add-site { width: 34px; padding: 5px 0; font-size: 15px; }
#add-dialog[hidden] { display: none; }
#add-dialog { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 20; }
#add-dialog .box { width: min(520px, calc(100% - 32px)); background: var(--bg); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; font-size: 13px; }
#add-dialog h2 { margin: 0 0 8px; font-size: 16px; }
#add-dialog p { color: var(--muted); margin: 0 0 12px; line-height: 1.4; }
#add-dialog p a { color: #ffe08a; }
#add-dialog input[type=file] { display: block; margin-bottom: 10px; color: var(--fg); }
#add-dialog .inline { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; color: var(--muted); }
#add-dialog .inline input { flex: 1; background: rgba(255,255,255,0.08); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
#add-dialog .primary.wide { width: auto; padding: 6px 14px; }
#add-log { margin: 12px 0 0; max-height: 220px; overflow: auto; background: rgba(0,0,0,0.35); border-radius: 8px; padding: 8px 10px; font-size: 11px; line-height: 1.45; white-space: pre-wrap; color: #cfe3c8; }
#add-log:empty { display: none; }
a.btn { text-decoration: none; line-height: 1.2; }
