/* ==========================================================================
   LOOK: RAINBOWS
   The white room with moving light. Uses the shared fonts and layout as they
   are. The background itself is drawn by shimmer.js.
   ========================================================================== */
html[data-look="rainbows"] { --color-page: #e9edf3; }

/* Shown only if the browser can't draw the room: a still version of the same idea. */
html[data-look="rainbows"] body.no-webgl {
  background:
    linear-gradient(90deg, rgba(0,0,0,.05), transparent 2px) 62% 0 / 100% 100% no-repeat,
    linear-gradient(118deg, transparent 30%, #ffd9d2 40%, #fff4c4 46%, #cdf5d6 52%, #cfe6ff 58%, #e4d8ff 64%, transparent 74%) fixed,
    #e9edf3;
}

/* The room. Fixed behind everything, and it never intercepts clicks. */
#corner {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100lvh;
  z-index: -1;
  display: block;
  pointer-events: none;
}

/* Light controls, bottom right: a frosted glass panel in the site's fonts.
   Closed, it's a small pill; open, it lists every slider. */
#controls {
  --panel-ink: var(--color-text);
  --panel-soft: rgba(0, 0, 0, 0.55);
  --panel-line: rgba(0, 0, 0, 0.12);
  position: fixed; right: 16px; bottom: 16px; z-index: 10;
  width: 288px; max-height: calc(100svh - var(--nav-height) - 32px); overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.45));
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 18px 48px -18px rgba(17, 17, 20, 0.35);
  color: var(--panel-ink);
  font: 500 13px/1.3 var(--font-body);
  scrollbar-width: thin;
}
#controls button { font: inherit; color: inherit; cursor: pointer; }
#controls .head {
  position: sticky; top: 0; z-index: 1; width: 100%; padding: 12px 16px; border: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; text-align: left;
  font-family: var(--font-display); font-size: 15px; line-height: 1;
}
#controls .sign { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.7); box-shadow: inset 0 0 0 1px var(--panel-line); font-family: var(--font-body); font-size: 15px; line-height: 1; }
#controls .head:hover .sign { background: #ffffff; }
#controls .body { padding: 0 16px 16px; }
#controls[data-closed="true"] { width: auto; border-radius: var(--radius-pill); }
#controls[data-closed="true"] .body { display: none; }
#controls:not([data-closed="true"]) .head {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.6));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
#controls .speed { margin: 0 0 4px; color: var(--panel-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
#controls h4 {
  margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--panel-line);
  font-family: var(--font-display); font-size: 14px; font-weight: 400; line-height: 1;
}
#controls label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 8px; }
#controls output { font-variant-numeric: tabular-nums; color: var(--panel-soft); }

/* Sliders: a thin line and a small glass knob */
#controls input[type="range"] { -webkit-appearance: none; appearance: none; grid-column: 1 / -1; width: 100%; height: 22px; margin: 0; background: none; cursor: pointer; }
#controls input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.16); }
#controls input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.16); }
#controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14), 0 3px 8px -2px rgba(17, 17, 20, 0.4);
}
#controls input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: #ffffff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14), 0 3px 8px -2px rgba(17, 17, 20, 0.4);
}
#controls input[type="range"]:active::-webkit-slider-thumb { scale: 1.15; }

/* Buttons: pills */
#controls .buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--panel-line); }
#controls .buttons button { padding: 9px 8px; border: 1px solid rgba(0, 0, 0, 0.14); border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.6); }
#controls .buttons button:hover { background: #ffffff; }
#controls .buttons .wide { grid-column: 1 / -1; border-color: var(--panel-ink); background: var(--panel-ink); color: #ffffff; }
#controls .buttons .wide:hover { background: #33333a; }
#controls textarea { display: none; width: 100%; height: 118px; margin-top: 8px; padding: 8px; border: 1px solid var(--panel-line); border-radius: 10px; background: rgba(255, 255, 255, 0.7); font: 11px/1.35 ui-monospace, Menlo, monospace; }
#controls button:focus-visible, #controls input:focus-visible { outline: 2px solid var(--panel-ink); outline-offset: 2px; border-radius: 10px; }
