header { z-index: 4; }
header .original-scene { color: inherit; text-decoration: none; padding: 8px; border-top: 1px dotted currentColor; }
header .original-scene:hover { color: white; }
.water-settings.lil-gui.lil-root { position: fixed; top: 76px; right: 12px; z-index: 5; width: 272px;
  --font-size: 13px; --input-font-size: 13px; --number-color: #52d4fc; --background-color: #202223;
  --widget-color: #393d40; --widget-height: 23px; --title-background-color: #111719;
  max-height: calc(100dvh - 182px); overflow: auto; }
#performance { position: fixed; top: 76px; left: 12px; z-index: 4; min-width: 244px; width: max-content;
  box-sizing: border-box; padding: 11px 13px; border-radius: 9px; color: #e8f4ff;
  background: #060c16d9; font: 13px/1.35 system-ui, sans-serif; }
#performance[hidden] { display: none; }
#gpu { font-weight: 650; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#render-size { opacity: .73; }
.performance-row { display: flex; align-items: baseline; gap: 5px; }
.performance-row strong { font-size: 34px; font-variant-numeric: tabular-nums; }
.performance-row > span, #frame-mode { color: #36cff7; font-weight: 700; }
.performance-row > div { margin-left: auto; text-align: right; font-size: 11px; }
#frame-mode { letter-spacing: 1.3px; }
#fps-graph { width: 100%; height: 23px; display: block; }
#performance button { display: block; width: 100%; padding: 6px 9px; border: 0; border-radius: 5px;
  background: #36cff7; color: #02121a; font: 650 12px/1.2 system-ui,sans-serif; cursor: pointer; margin-top: 6px; }
#performance button[aria-pressed='true'] { background: #254a5a; color: white; }
#performance #benchmark { background: transparent; color: #36cff7; box-shadow: inset 0 0 0 1px #36cff7; }
#performance button:disabled { opacity: .60; cursor: default; }
#pass-timers, #benchmark-result { font: 11px/1.35 ui-monospace, monospace; white-space: pre; margin-top: 7px; color: #bfdde8; }
#benchmark-result:empty, #pass-timers:empty { display: none; }
#water-status { position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 6; padding: 8px 12px;
  background: #081322e8; color: #fff; font: 13px/1.4 system-ui, sans-serif; }
#water-status:empty { display: none; }
@media (max-width: 620px), (pointer: coarse) {
  .water-settings.lil-gui.lil-root { top: 92px; width: min(250px, 71vw); max-height: 57dvh; right: 7px; }
  #performance { top: auto; bottom: 88px; left: 7px; min-width: 138px; padding: 6px 8px; font-size: 10px; }
  .performance-row strong { font-size: 23px; }
  #gpu, #pass-timers { display: none; }
  #fps-graph { height: 12px; }
  #performance button { padding: 4px; font-size: 10px; }
}

.water-settings .lil-title, .water-settings .lil-controller button, #performance button { min-height: 0; }
.water-settings .lil-controller .lil-name { white-space: normal; }
body:not(.main-pavilion) #fps, body:not(.main-pavilion) #triangles { display: none; }

.main-pavilion {
  --panel-font: 'IBM Plex Mono', ui-monospace, monospace;
  --panel-text: #cccac3;
  --panel-number: #ddd9ce;
  --panel-surface: #252724f5;
  --panel-control: #343733;
  --panel-hover: #444741;
  --panel-line: #b6b5aa36;
  --panel-focus: #c7c3b4;
  --panel-shadow: 0 10px 24px #0e100f4d;
}

.main-pavilion #performance {
  left: var(--edge-x);
  max-width: calc(100vw - 2 * var(--edge-x));
  padding: 10px 12px;
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  color: var(--panel-text);
  font: 12px/1.35 var(--panel-font);
}
.main-pavilion #gpu { font-weight: 400; }
.main-pavilion #performance .performance-row > strong {
  color: var(--panel-number);
  font-weight: 400;
}
.main-pavilion #performance :is(.performance-row > span, #frame-mode) {
  color: var(--panel-text);
  font-weight: 400;
}
.main-pavilion #frame-mode { letter-spacing: .05em; }
.main-pavilion #fps-graph {
  --fps-graph-color: #bcbcaf;
  margin: 3px 0 7px;
  background: #1c1e1b80;
  border-block: 1px solid var(--panel-line);
}
.main-pavilion #performance :is(button, #benchmark) {
  min-height: 27px;
  padding: 4px 7px;
  background: var(--panel-control);
  border: 1px solid var(--panel-line);
  border-radius: 3px;
  box-shadow: none;
  color: var(--panel-text);
  font: inherit;
}
.main-pavilion #performance button:not(:disabled):hover,
.main-pavilion #performance button[aria-pressed='true'] { background: var(--panel-hover); }
.main-pavilion #performance button:focus-visible {
  outline: 1px solid var(--panel-focus);
  outline-offset: -2px;
}
.main-pavilion #performance :is(#pass-timers, #benchmark-result) {
  color: var(--panel-text);
  font: inherit;
  white-space: pre-wrap;
}
.main-pavilion #benchmark-result {
  padding: 7px;
  border: 1px solid var(--panel-line);
  background: var(--panel-control);
}

.main-pavilion .water-settings.lil-root {
  right: var(--edge-x);
  width: min(308px, calc(100vw - 2 * var(--edge-x)));
  border: 1px solid var(--panel-line);
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  color-scheme: dark;
}
.main-pavilion :is(.water-settings.lil-root, .water-settings .lil-gui) {
  --font-family: var(--panel-font);
  --font-family-mono: var(--font-family);
  --font-size: 12px;
  --input-font-size: 12px;
  --text-color: var(--panel-text);
  --title-text-color: #d7d4cb;
  --title-background-color: #242624;
  --background-color: var(--panel-surface);
  --widget-color: var(--panel-control);
  --hover-color: var(--panel-hover);
  --focus-color: #50534c;
  --number-color: var(--panel-number);
  --string-color: var(--panel-number);
  --padding: 7px;
  --spacing: 4px;
  --widget-height: 25px;
  --title-height: 30px;
  --widget-border-radius: 3px;
}

.main-pavilion .water-settings .lil-title {
  font-weight: 400;
  border-bottom: 1px solid var(--panel-line);
}
.main-pavilion .water-settings .lil-title:hover { background: #30322e; }
.main-pavilion .water-settings select { font: inherit; }
.main-pavilion .water-settings :is(.lil-title, button, input, select):focus-visible {
  outline: 1px solid var(--panel-focus);
  outline-offset: -2px;
}
.scene-presets {
  display: grid;
  gap: 6px;
  padding: 7px var(--padding);
  margin-bottom: 3px;
  border-bottom: 1px solid var(--panel-line);
}
.scene-preset-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.scene-presets :is(button, input, select) {
  background: var(--widget-color);
  border: 1px solid var(--panel-line);
  border-radius: var(--widget-border-radius);
  color: var(--text-color);
  min-width: 0;
  min-height: 27px;
  padding: 4px 7px;
  font: inherit;
}
.scene-presets :is(select, button) { cursor: pointer; }
.scene-presets :is(button, select):hover { background: var(--hover-color); }
.scene-preset-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.main-pavilion .scene-preset-actions button { width: auto; flex: 1 1 auto; }
.scene-presets .preset-name-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(348px, calc(100vw - 2 * var(--edge-x)));
  height: fit-content;
  padding: 16px;
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  color: var(--panel-text);
  font: 12px/1.4 var(--panel-font);
}
.preset-name-dialog::backdrop { background: #11131090; }
.preset-name-dialog form { display: grid; gap: 7px; }
.preset-name-dialog h2 {
  margin: 0 0 6px;
  color: var(--panel-number);
  font: inherit;
}
.scene-presets .preset-name-dialog input {
  width: 100%;
  min-height: 33px;
  color: var(--panel-number);
}
#preset-name-error { color: #e2c3ad; }
.preset-name-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}
.main-pavilion .preset-name-actions button { width: auto; }
.main-pavilion .preset-name-actions button[type='submit'] { border-color: #b6b5aa80; }
.main-pavilion #water-status {
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: 4px;
  color: var(--panel-number);
  font: 12px/1.35 var(--panel-font);
  max-width: calc(100vw - 2 * var(--edge-x));
}

@media (max-width: 680px), (pointer: coarse) {
  .main-pavilion .water-settings.lil-root {
    top: max(102px, calc(var(--edge-y) + 72px));
    max-height: 57dvh;
  }
  .main-pavilion :is(.water-settings.lil-root, .water-settings .lil-gui) {
    --widget-height: 32px;
    --title-height: 36px;
  }
  .scene-presets :is(button, input, select), .main-pavilion #performance button { min-height: 36px; }
}
