:root {
  --panel-bg: rgba(18, 20, 24, 0.62);
  --panel-border: rgba(255, 255, 255, 0.10);
  --text: #eef1f4;
  --text-dim: #9aa3ad;
  --accent: #e07856;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow: hidden; height: 100%; background: #0b0d10; }
body { font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif; color: var(--text); }
#app { position: fixed; inset: 0; }
#app canvas { display: block; }

#titlebar {
  position: absolute; top: 18px; left: 22px; pointer-events: none;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}
#titlebar h1 {
  margin: 0; font-size: 21px; font-weight: 600; letter-spacing: 0.14em;
}
#titlebar h1 span { font-weight: 400; color: var(--text-dim); letter-spacing: 0.08em; font-size: 14px; }
#fps {
  margin-top: 6px; font-size: 12px; color: var(--text-dim);
  font-variant-numeric: tabular-nums; letter-spacing: 0.05em;
}
.hidden { display: none !important; }

#hint {
  position: absolute; bottom: 14px; left: 22px; font-size: 11.5px; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45); pointer-events: none; text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  transition: opacity 1.2s; }
#hint.fade { opacity: 0; }

#panel {
  position: absolute; top: 16px; right: 16px; width: 264px;
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  border-radius: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  max-height: calc(100vh - 32px); overflow: hidden;
  transition: max-height 0.35s ease;
  z-index: 10;
}
#panel.collapsed { max-height: 44px; }
#panel-toggle {
  width: 100%; text-align: left; background: none; border: none; color: var(--text);
  font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1.2; letter-spacing: 0.12em; padding: 14px 16px; cursor: pointer;
}
#panel-toggle:hover { color: var(--accent); }
#panel-body { padding: 0 16px 14px; overflow-y: auto; max-height: calc(100vh - 90px); }
#panel-body::-webkit-scrollbar { width: 6px; }
#panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

section { margin-bottom: 14px; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 10px; }
section h2 {
  margin: 0 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent);
}
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 7px 0; font-size: 12.5px; color: var(--text-dim);
}
.row > span { flex: 0 0 44%; }
.row input[type="range"] { flex: 1; accent-color: var(--accent); height: 18px; }
.row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.row select {
  flex: 1; background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12px;
}
.row .val { color: var(--text); font-variant-numeric: tabular-nums; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btnrow button {
  flex: 1 1 30%; background: rgba(255,255,255,0.08); border: 1px solid var(--panel-border);
  color: var(--text); border-radius: 7px; padding: 6px 4px; font-family: inherit; font-weight: 600; font-size: 11px; line-height: 1.1;
  letter-spacing: 0.05em; cursor: pointer; transition: background 0.15s;
}
.btnrow button:hover { background: rgba(224,120,86,0.35); }
.btnrow button.active { background: var(--accent); color: #14161a; }
