@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
}

:root {
  --day: #f7f2e9;
  --night: #0b3a67;
  --accent: #6fd2ff;
  --day-rgb: 247, 242, 233;
  --night-rgb: 11, 58, 103;
  --accent-rgb: 111, 210, 255;
  --ink: #0c1224;
  --muted: #9aa3b2;
  --panel: rgba(8, 12, 22, 0.78);
  --frost: rgba(255, 255, 255, 0.08);
  --frost-strong: rgba(255, 255, 255, 0.12);
  --radius: 16px;
  --glow: 0 16px 44px rgba(0, 0, 0, 0.5);
  --chrome-panel: rgba(26, 20, 32, 0.92);
  --chrome-panel-highlight: rgba(255, 255, 255, 0.05);
  --chrome-wash: rgba(255, 255, 255, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(120% 120% at 12% 10%, #0c1526, #050911 55%, #03070f 100%);
  color: #e9edf5;
  overflow: hidden;
}

body.cursor-hidden,
body.cursor-hidden * {
  cursor: none !important;
}

.chrome-controls {
  position: fixed;
  top: 16px;
  right: 18px;
  display: flex;
  gap: 10px;
  z-index: 10;
  align-items: center;
  padding: 8px 10px;
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  transition: opacity 160ms ease, transform 180ms ease, box-shadow 200ms ease;
}

.chrome-controls::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(14, 16, 28, 0.78), rgba(10, 8, 20, 0.64));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px) saturate(125%);
  pointer-events: none;
  z-index: 0;
}

.chrome-controls::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.chrome-controls>* {
  position: relative;
  z-index: 1;
}

.chrome-controls.hidden,
.chrome-controls.auto-hide {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.chrome-controls.is-revealed {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.is-immersive .chrome-controls {
  right: 8px;
  top: 8px;
  padding: 12px 14px 12px 18px;
  gap: 8px;
  backdrop-filter: blur(12px) saturate(120%);
}

.is-immersive .glass-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.is-immersive .icon-svg {
  width: 18px;
  height: 18px;
}

.is-immersive .score-notch {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 28px;
  width: 420px;
  max-width: 420px;
  background: rgba(10, 14, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 14px 24px;
  backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.is-immersive .score-notch__labels {
  display: none;
}

.is-immersive .score-notch__bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 0;
}

.shell {
  display: grid;
  place-items: start;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

.is-immersive .shell {
  align-items: start;
  justify-items: start;
}

.canvas-frame {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 420px;
  min-height: 420px;
  max-width: 100vw;
  max-height: 100vh;
  isolation: isolate;
}

.canvas-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -68px;
  width: 340px;
  height: 68px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.95), rgba(6, 10, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px) saturate(130%);
  pointer-events: none;
  z-index: 0;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: crisp-edges;
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
}

.score-notch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -54px;
  width: 300px;
  background: transparent;
  border: none;
  padding: 10px 20px;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 5;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.score-notch.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.score-notch::before {
  display: none;
}

.score-notch.overlay {
  left: 12px;
  right: 12px;
  transform: none;
  bottom: 12px;
  width: auto;
  border-radius: 18px;
}

.score-notch.overlay.is-hidden {
  transform: translateY(8px);
}

.score-notch.overlay::before {
  display: none;
}

.is-immersive .canvas-frame {
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.is-immersive .canvas-frame::after {
  display: none;
}

.is-immersive canvas {
  border-radius: 0;
}

.is-immersive .score-notch {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  width: min(860px, 86vw);
  max-width: none;
  border-radius: 20px;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.45);
}

.is-immersive .score-notch.is-hidden {
  transform: translateX(-50%) translateY(8px);
}

.is-immersive .score-notch::before {
  display: none;
}

.is-immersive .score-notch.overlay {
  bottom: 16px;
}

/* Removed .is-immersive .score-notch__labels and .is-immersive .score-notch__bar overrides as they are handled above */

.score-notch__bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.score-notch__day,
.score-notch__night {
  position: absolute;
  top: 0;
  bottom: 0;
}

.score-notch__day {
  left: 0;
  background: linear-gradient(90deg, var(--day), rgba(255, 255, 255, 0.4));
}

.score-notch__night {
  right: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.2), var(--accent));
}

.score-notch__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.score {
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 13px;
  color: #f5f8ff;
}

.score-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pill {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.pill--day {
  background: var(--day);
}

.pill--night {
  background: var(--night);
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #f9fbff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  white-space: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
}

.chip--accent {
  background: var(--accent);
  color: #0d0f1a;
  border: none;
}

.glass-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));
  color: #f6f8ff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px) saturate(125%);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.glass-icon--accent {
  background: linear-gradient(150deg, rgba(111, 210, 255, 0.6), rgba(255, 255, 255, 0.08));
  border-color: rgba(111, 210, 255, 0.7);
  color: #0f0c11;
}

.glass-icon.is-active {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.glass-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

.glass-icon:active {
  transform: translateY(0);
}

.icon-svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  opacity: 0.94;
}

#playPauseBtn[data-state="playing"] .icon-play {
  display: none;
}

#playPauseBtn[data-state="paused"] .icon-pause {
  display: none;
}

body.drawer-open #chromeControls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 320px;
  height: 100vh;
  max-height: 100vh;
  padding: 18px 18px 22px;
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(120%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: right 0.18s ease-out;
  z-index: 9;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
  z-index: 8;
}

.drawer-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.drawer__quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 10px;
  align-items: stretch;
}

.drawer.open {
  right: 0;
}

.drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 4px;
}

h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field+.field {
  margin-top: 6px;
}

.field span {
  color: #f4f5f7;
  font-weight: 600;
}

.field small {
  color: var(--muted);
}

.field.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field.grid label {
  gap: 10px;
  padding-top: 6px;
}

input[type="color"],
select,
input[type="range"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f8f9fb;
  padding: 10px;
  font: inherit;
}

input[type="color"] {
  padding: 4px;
  height: 44px;
}

select {
  cursor: pointer;
}

.picker {
  position: relative;
}

.picker__selected {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  color: #f8f9fb;
  padding: 10px 12px;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: 64px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.22);
  text-align: left;
  justify-content: flex-start;
}

.picker__swatches {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
}

.picker__swatches span,
.picker__swatches div {
  width: 22px;
  height: 22px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.22);
}

.picker__chevron {
  opacity: 0.7;
  font-size: 13px;
  margin-left: auto;
}

.picker__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(10, 14, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px) saturate(120%);
  z-index: 12;
  max-height: 60vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
  padding-right: 6px;
}

.picker.open .picker__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.picker__option {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
  min-height: 68px;
}

.picker__option:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.24);
}

.picker__option.is-active {
  border-color: rgba(111, 210, 255, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  background: linear-gradient(140deg, rgba(111, 210, 255, 0.08), rgba(255, 255, 255, 0.03));
  transform: translateY(-1px);
}

.picker__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: whitesmoke;
  flex: 1;
}

.picker__swatch-row {
  display: flex;
  gap: 6px;
}

.picker__swatch {
  flex: 1;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ball-preview {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.ball-preview__canvas {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: radial-gradient(120% 120% at 20% 20%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 14px rgba(0, 0, 0, 0.22);
}

.slider-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0;
}

.slider-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0c1224;
  cursor: pointer;
}

.slider-field input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0c1224;
  cursor: pointer;
}

.speed-dial {
  gap: 12px;
}

.speed-dial__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.speed-dial__header strong {
  font-size: 16px;
  letter-spacing: 0.2px;
}

.speed-dial__rail {
  position: relative;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 26px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

.speed-dial__fill {
  position: absolute;
  inset: 0;
  width: 28%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(111, 210, 255, 0.65), rgba(255, 255, 255, 0.12));
  box-shadow: 0 8px 24px rgba(111, 210, 255, 0.35);
  pointer-events: none;
}

.speed-dial__thumb {
  position: absolute;
  top: 50%;
  left: 28%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #0c1224;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.speed-dial__ticks {
  position: absolute;
  inset: 10px 12px 8px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2px;
  pointer-events: none;
}

.speed-dial__ticks span {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.speed-dial__ticks span:last-child {
  transform: translate(-100%, -50%);
}

.speed-dial__rail:focus-visible {
  outline: 2px solid rgba(111, 210, 255, 0.7);
  outline-offset: 3px;
}

.drawer__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
  position: relative;
}

.toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle__visual {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.toggle__visual::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0c1224;
  border: 2px solid var(--accent);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.toggle input:checked+.toggle__visual {
  background: linear-gradient(120deg, rgba(111, 210, 255, 0.7), rgba(255, 255, 255, 0.14));
  border-color: rgba(111, 210, 255, 0.82);
}

.toggle input:checked+.toggle__visual::after {
  transform: translateX(18px);
  background: #0a0d18;
  border-color: rgba(255, 255, 255, 0.9);
}

.toggle__labels span {
  display: block;
}

.toggle input:focus-visible+.toggle__visual {
  outline: 2px solid rgba(111, 210, 255, 0.8);
  outline-offset: 3px;
}

.has-tooltip:focus-within::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* Tooltip styles */
.has-tooltip {
  position: relative;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: max-content;
  max-width: 260px;
  padding: 8px 12px;
  background: rgba(10, 14, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e9edf5;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.has-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
  transition-delay: 0.05s;
}

.toggle__labels small {
  color: var(--muted);
  display: block;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f9fafc;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.drag-handle {
  position: absolute;
  background: transparent;
  z-index: 5;
}

.corner-handle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
}

.corner-handle::after {
  content: "";
  display: none;
}

.corner-handle--tl {
  top: -12px;
  left: -12px;
  cursor: nwse-resize;
}

.corner-handle--tr {
  top: -12px;
  right: -12px;
  cursor: nesw-resize;
}

.corner-handle--bl {
  bottom: -12px;
  left: -12px;
  cursor: nesw-resize;
}

.corner-handle--br {
  bottom: -12px;
  right: -12px;
  cursor: nwse-resize;
}

.field span {
  padding-bottom: 2px;
  line-height: 1.25;
}

@media (max-width: 900px) {
  .shell {
    padding: 12px;
  }

  .is-immersive .shell {
    padding: 0;
  }

  .canvas-frame {
    max-width: 95vw;
    max-height: 70vh;
  }

  .drawer {
    width: 100%;
    right: -100%;
  }

  .drawer__quick {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* ---- Two stacked canvases: tiles below, balls above ---- */
#ballCanvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
}

.is-immersive .canvas-frame {
  min-width: 0;
  min-height: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:where(button, [role="slider"], a):focus-visible {
  outline: 2px solid rgba(111, 210, 255, 0.8);
  outline-offset: 2px;
}

.picker__option:focus-visible {
  outline: 2px solid rgba(111, 210, 255, 0.8);
  outline-offset: 1px;
}

.glass-icon[aria-pressed="true"] {
  border-color: var(--accent);
}

/* ---- Toggles as one grouped list instead of a stack of separate cards ---- */
.toggle-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.toggle {
  border: none;
  border-radius: 0;
  background: none;
  padding: 9px 12px;
}

.toggle+.toggle {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.toggle:first-child {
  border-radius: 14px 14px 0 0;
}

.toggle:last-child {
  border-radius: 0 0 14px 14px;
}

.toggle:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.03);
}

/* ---- Clock overlay (opt-in). Difference blending keeps it legible on
   both territories without picking a color per palette. ---- */
.clock {
  position: absolute;
  top: clamp(20px, 5vh, 56px);
  left: clamp(20px, 4vw, 64px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  mix-blend-mode: difference;
  opacity: 0.82;
  pointer-events: none;
  user-select: none;
}

.clock[hidden] {
  display: none;
}

.clock__time {
  font-size: clamp(44px, 8vw, 132px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.clock__date {
  font-size: clamp(13px, 1.3vw, 22px);
  font-weight: 400;
  letter-spacing: 0.02em;
  padding-left: 0.2em;
}

/* ---- Drawer extras ---- */
.drawer__keys {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 2;
}

.drawer__keys kbd {
  font: inherit;
  font-size: 11px;
  color: #e9edf5;
  padding: 1px 6px;
  margin-right: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.drawer__keys kbd:not(:first-child) {
  margin-left: 8px;
}

.drawer__credit {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.drawer__credit a {
  color: #e9edf5;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -8px);
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(10, 14, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f5f8ff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---- Screensaver mode: chrome only appears while the pointer moves ---- */
body.saver .canvas-frame {
  will-change: transform;
}

body.saver .drag-handle {
  display: none;
}

/* Kiosk (#saver in the URL, used by the macOS screen saver): no UI at all */
body.kiosk,
body.kiosk * {
  cursor: none !important;
}

body.kiosk .chrome-controls,
body.kiosk .drawer,
body.kiosk .drawer-overlay,
body.kiosk .drag-handle {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
