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

:root {
  --smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* ---- Backdrop: colorful content behind the glass ---- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* Apple-style deep space backdrop */
.backdrop-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 40% at 50% 100%, rgba(30, 80, 160, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 80% 30% at 50% 105%, rgba(60, 140, 220, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 40% 20% at 50% 100%, rgba(120, 180, 255, 0.1) 0%, transparent 40%);
}

.backdrop-grid {
  display: none;
}

.backdrop-shapes {
  position: absolute;
  inset: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

/* Subtle, muted orbs — like distant nebulae */
.shape-1 {
  width: 500px;
  height: 500px;
  background: rgba(30, 60, 120, 0.3);
  bottom: -10%;
  left: 10%;
  animation: float-1 20s ease-in-out infinite;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: rgba(40, 80, 160, 0.2);
  bottom: -5%;
  right: 15%;
  animation: float-2 18s ease-in-out infinite;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: rgba(80, 120, 200, 0.15);
  bottom: 0%;
  left: 40%;
  animation: float-3 22s ease-in-out infinite;
}

.shape-4 {
  width: 250px;
  height: 250px;
  background: rgba(100, 60, 160, 0.12);
  top: 20%;
  right: 20%;
  animation: float-1 16s ease-in-out infinite reverse;
}

.shape-5 {
  width: 200px;
  height: 200px;
  background: rgba(60, 100, 180, 0.1);
  top: 30%;
  left: 20%;
  animation: float-2 24s ease-in-out infinite reverse;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15px, -20px) scale(1.03); }
  66% { transform: translate(-10px, 10px) scale(0.97); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, -15px) scale(1.04); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(10px, -10px) scale(1.02); }
  75% { transform: translate(-15px, 5px) scale(0.98); }
}

.backdrop-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  user-select: none;
}

.backdrop-text {
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.backdrop-credit {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.45;
  text-decoration: none;
  pointer-events: auto;
  transition: opacity 0.3s var(--smooth);
}

.backdrop-credit:hover {
  opacity: 0.9;
}

.backdrop-credit:hover .backdrop-credit-rose {
  filter: brightness(0) saturate(100%) invert(18%) sepia(95%) saturate(3000%) hue-rotate(348deg) brightness(90%) contrast(95%);
  transform: scale(1.1);
}

.backdrop-credit:hover span {
  color: #CA2323;
}

.backdrop-credit-rose {
  width: 20px;
  height: 20px;
  transition: filter 0.3s var(--smooth), transform 0.3s var(--bounce);
}

.backdrop-credit span {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
  transition: color 0.3s var(--smooth);
}

.backdrop-credit-check {
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: scale(0.5) translateX(-4px);
  transition: opacity 0.3s var(--smooth), transform 0.4s var(--bounce);
  flex-shrink: 0;
}

.backdrop-credit:hover .backdrop-credit-check {
  opacity: 1;
  transform: scale(1) translateX(0);
}

/* ---- Back link ---- */

.back-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s var(--smooth);
}

.back-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

.back-link svg {
  transition: transform 0.2s var(--smooth);
}

.back-link:hover svg {
  transform: translateX(-2px);
}

/* ---- Glass element ---- */

.glass-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.glass-element {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 80px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: grab;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s var(--smooth), box-shadow 0.3s var(--smooth);
  z-index: 10;
}

.glass-element:hover {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-element:active {
  cursor: grabbing;
}

.glass-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  pointer-events: none;
  user-select: none;
}

/* ---- Config panel ---- */

.config-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  z-index: 100;
  overflow: hidden;
  transition: width 0.3s var(--smooth);
}

.config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.config-header h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.config-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--smooth), color 0.2s;
}

.config-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

.config-panel.collapsed .config-toggle {
  transform: rotate(180deg);
}

.config-body {
  padding: 12px 16px 16px;
  max-height: 70vh;
  overflow-y: auto;
  transition: max-height 0.3s var(--smooth), padding 0.3s var(--smooth), opacity 0.2s;
}

.config-panel.collapsed .config-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

/* Custom scrollbar */
.config-body::-webkit-scrollbar {
  width: 4px;
}

.config-body::-webkit-scrollbar-track {
  background: transparent;
}

.config-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.config-group {
  margin-bottom: 12px;
}

.config-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.config-value {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* Range slider styling */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s var(--bounce), box-shadow 0.15s;
}

input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

input[type='range']::-webkit-slider-thumb:active {
  transform: scale(0.95);
}

input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* Advanced toggle */
.config-advanced-toggle {
  width: 100%;
  padding: 7px;
  margin: 4px 0 8px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--smooth);
  letter-spacing: 0.02em;
}

.config-advanced-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

.config-advanced-toggle.open {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
}

.config-advanced {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s var(--smooth), opacity 0.2s;
}

.config-advanced.open {
  max-height: 500px;
  opacity: 1;
}

.config-reset {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--smooth);
}

.config-reset:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.config-reset:active {
  transform: scale(0.98);
}

.browser-notice {
  padding: 12px 16px;
  font-size: 11px;
  color: rgba(251, 146, 60, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.4;
}

/* ---- Code snippet ---- */

.code-snippet {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  max-width: 90vw;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.35);
}

.code-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s var(--smooth);
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.code-copy.copied {
  color: rgba(74, 222, 128, 0.8);
  border-color: rgba(74, 222, 128, 0.2);
}

.code-snippet pre {
  margin: 0;
  padding: 12px 16px;
}

.code-snippet code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  white-space: pre;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  .config-panel {
    top: auto;
    bottom: 80px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .config-panel.collapsed {
    left: auto;
    width: 280px;
  }

  .glass-element {
    width: 280px !important;
    height: 60px !important;
  }

  .code-snippet {
    display: none;
  }
}
