:root {
  color-scheme: dark;
  --bg: #0e0e14;
  --accent: #5999ff;
  --accent-secondary: #73cca6;
  --panel-bg: rgba(18, 18, 26, 0.72);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-blur: 16px;
  --text-muted: rgba(255, 255, 255, 0.45);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.construction-title-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  pointer-events: none;
}

.leo-title {
  font-size: clamp(4.5rem, 22vw, 14rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
  user-select: none;
}

/* —— Control panels —— */
.particle-panel {
  position: fixed;
  z-index: 10;
  bottom: clamp(12px, 3vw, 28px);
  width: min(340px, calc(100vw - 24px));
  padding: 18px 18px 16px;
  pointer-events: auto;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow:
    0 0 0 1px rgba(89, 153, 255, 0.06) inset,
    0 24px 48px rgba(0, 0, 0, 0.45);
}

.particle-panel-bg {
  right: clamp(12px, 3vw, 28px);
}

.particle-panel-leo {
  left: clamp(12px, 3vw, 28px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(calc(-100% - 28px), 0, 0);
  transition:
    opacity 0.42s ease,
    transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.48s;
}

body.leo-mode .particle-panel-leo {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.45s ease 0.05s,
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s,
    visibility 0s linear 0s;
}

.particle-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.particle-panel-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.particle-panel-reset {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(89, 153, 255, 0.35);
  background: linear-gradient(
    135deg,
    rgba(89, 153, 255, 0.15) 0%,
    rgba(115, 204, 166, 0.12) 100%
  );
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.particle-panel-reset:hover {
  border-color: rgba(115, 204, 166, 0.55);
  box-shadow: 0 0 20px rgba(89, 153, 255, 0.2);
}

.particle-panel-reset:active {
  transform: scale(0.97);
}

.particle-panel-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: 14px;
}

body.leo-mode .leo-title {
  display: none;
}

.particle-row-toggle {
  grid-template-columns: 1fr auto;
  grid-template-rows: auto;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.particle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.particle-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.particle-switch-track {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.particle-switch-track::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6aa6ff 0%, #7fd4b8 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.particle-switch-input:checked + .particle-switch-track {
  background: linear-gradient(
    90deg,
    rgba(89, 153, 255, 0.35) 0%,
    rgba(115, 204, 166, 0.3) 100%
  );
  border-color: rgba(89, 153, 255, 0.45);
  box-shadow: 0 0 16px rgba(89, 153, 255, 0.2);
}

.particle-switch-input:checked + .particle-switch-track::after {
  transform: translateX(20px);
}

.particle-switch-input:focus-visible + .particle-switch-track {
  box-shadow: 0 0 0 2px rgba(89, 153, 255, 0.45);
}

.particle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 14px;
}

.particle-row:last-child {
  margin-bottom: 0;
}

.particle-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.particle-value {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-secondary);
  text-align: right;
}

.particle-range {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  margin: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: linear-gradient(
    90deg,
    rgba(89, 153, 255, 0.22) 0%,
    rgba(115, 204, 166, 0.22) 100%
  );
  outline: none;
}

.particle-range:focus-visible {
  box-shadow: 0 0 0 2px rgba(89, 153, 255, 0.45);
}

/* WebKit thumb */
.particle-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, #6aa6ff 0%, #7fd4b8 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 4px 14px rgba(89, 153, 255, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.particle-range:hover::-webkit-slider-thumb {
  transform: scale(1.06);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 6px 20px rgba(89, 153, 255, 0.55);
}

.particle-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

/* Firefox */
.particle-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, #6aa6ff 0%, #7fd4b8 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 4px 14px rgba(89, 153, 255, 0.45);
}

.particle-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(89, 153, 255, 0.22) 0%,
    rgba(115, 204, 166, 0.22) 100%
  );
}

@media (max-width: 520px) {
  .particle-panel-bg {
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(48vh, 400px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .particle-panel-leo {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: auto;
    top: clamp(12px, 3vw, 24px);
    max-height: min(40vh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translate3d(0, calc(-100% - 20px), 0);
  }

  body.leo-mode .particle-panel-leo {
    transform: translate3d(0, 0, 0);
  }
}
