/* ==========================================================================
   WEBGL PARTICLE SCULPTURE STYLES — EXPERIMENT 01
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-primary: #050608;
  --panel-bg: rgba(14, 16, 22, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-border-hover: rgba(255, 255, 255, 0.25);
  --accent-gold: #F2BD76;
  --accent-gold-glow: rgba(242, 189, 118, 0.5);
  --accent-gold-bg: rgba(216, 130, 54, 0.22);
  --text-pure: #FFFFFF;
  --text-muted: rgba(255, 255, 255, 0.65);
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  background-color: var(--bg-primary);
  font-family: var(--font-heading);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: default;
}

/* Vignette Ambient Depth */
.vignette-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(2, 3, 5, 0.75) 80%, #010203 100%);
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  touch-action: none;
  cursor: grab;
}

#canvas-container:active {
  cursor: grabbing;
}

/* ── TOP HEADER BAR ──────────────────────────────────────────────────────── */

.top-nav-bar {
  position: fixed;
  top: max(1.6rem, env(safe-area-inset-top));
  left: max(1.8rem, env(safe-area-inset-left));
  right: max(1.8rem, env(safe-area-inset-right));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.top-hint {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  pointer-events: none;
}

.hint-title {
  font-size: clamp(0.78rem, 2vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
}

.hint-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 1.6vw, 0.68rem);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

.back-lab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: rgba(14, 16, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
  transition: all 0.3s var(--ease-cinematic);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.back-lab-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.back-lab-btn:hover {
  background: var(--accent-gold-bg);
  border-color: var(--accent-gold-glow);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(216, 130, 54, 0.4);
  transform: translateY(-2px);
}

.back-lab-btn:hover svg {
  transform: translateX(-3px);
}

/* ── FLOATING SHAPE SELECTOR DOCK ────────────────────────────────────────── */

.shape-dock {
  position: fixed;
  left: max(1.8rem, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 0.85rem 0.65rem;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.shape-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.65rem 1rem 0.65rem 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: all 0.3s var(--ease-cinematic);
  position: relative;
  white-space: nowrap;
  min-height: 42px;
}

.shape-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

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

.shape-label {
  font-weight: 500;
  transition: color 0.3s ease;
}

.shape-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--panel-border-hover);
  color: #ffffff;
  transform: translateX(4px);
}

.shape-btn:hover .shape-icon {
  color: var(--accent-gold);
  transform: scale(1.12);
}

/* Active Selected Shape */
.shape-btn.is-active {
  background: var(--accent-gold-bg);
  border-color: var(--accent-gold-glow);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(216, 130, 54, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.shape-btn.is-active .shape-icon {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 6px rgba(242, 189, 118, 0.8));
}

.shape-btn.is-active::before {
  content: '';
  position: absolute;
  left: -0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

/* ── CREATE YOUR OWN: MINIMAL FLOATING INPUT PANEL ───────────────────────── */

.custom-text-panel {
  position: fixed;
  bottom: max(2.4rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-cinematic), transform 0.4s var(--ease-cinematic);
}

.custom-text-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.custom-panel-inner {
  background: rgba(14, 16, 22, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 0.85rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(242, 189, 118, 0.15);
  min-width: 320px;
  max-width: 90vw;
}

.custom-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-panel-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.custom-status-pill {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(242, 189, 118, 0.15);
  border: 1px solid rgba(242, 189, 118, 0.35);
  color: var(--accent-gold);
  transition: all 0.3s ease;
}

.custom-input-form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.25rem 0.35rem 0.25rem 0.85rem;
  transition: border-color 0.3s ease;
}

.custom-input-form:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(242, 189, 118, 0.25);
}

.custom-text-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.custom-text-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  text-transform: none;
}

.custom-form-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-gold);
  color: #0b0d11;
  border: none;
  border-radius: 9px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.25s var(--ease-cinematic);
}

.custom-form-btn svg {
  width: 12px;
  height: 12px;
}

.custom-form-btn:hover {
  background: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* ── MOBILE OPTIMIZATIONS ────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .top-hint {
    text-align: left;
  }

  .custom-text-panel {
    bottom: max(6.2rem, calc(env(safe-area-inset-bottom) + 5rem));
    width: calc(100% - 2rem);
  }

  .custom-panel-inner {
    min-width: unset;
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .shape-dock {
    left: 50%;
    top: auto;
    bottom: max(1.4rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    flex-direction: row;
    padding: 0.5rem 0.65rem;
    gap: 0.45rem;
    border-radius: 18px;
    width: calc(100% - 2rem);
    max-width: 480px;
    justify-content: space-between;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .shape-dock::-webkit-scrollbar {
    display: none;
  }

  .shape-btn {
    flex: 1;
    min-width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
  }

  .shape-label {
    display: none;
  }

  .shape-btn.is-active::before {
    left: 50%;
    top: auto;
    bottom: -0.45rem;
    transform: translateX(-50%);
    width: 14px;
    height: 3px;
  }
}
