/* ==========================================================================
   GLSL Shader Playground — Styles
   Dark theme, retro-futurist aesthetic with cyan/magenta accents.
   All classes namespaced with glsl-pg__ to avoid collisions.
   ========================================================================== */

/* ==========================================================================
   Canvas & Layout
   ========================================================================== */

.glsl-pg__canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: #000;
  cursor: crosshair;
}

.glsl-pg__back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.glsl-pg__back:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(10, 10, 10, 0.8);
}

.glsl-pg__back svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ==========================================================================
   Utility Bar — Top right (FPS, fullscreen, share)
   ========================================================================== */

.glsl-pg__utility {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.glsl-pg__utility-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  font-size: 0;
}

.glsl-pg__utility-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(10, 10, 10, 0.8);
}

.glsl-pg__utility-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.glsl-pg__fps {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  padding: 6px 10px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  min-width: 52px;
  text-align: center;
}

/* ==========================================================================
   Panel — Shared panel styles (editor, controls, presets)
   ========================================================================== */

.glsl-pg__panel {
  position: fixed;
  z-index: 100;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.glsl-pg__panel--hidden {
  pointer-events: none;
  opacity: 0;
}

/* Panel header */
.glsl-pg__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.glsl-pg__panel-title {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
}

.glsl-pg__panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.glsl-pg__panel-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.glsl-pg__panel-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ==========================================================================
   Editor Panel — Left side
   ========================================================================== */

.glsl-pg__editor-panel {
  top: 0;
  left: 0;
  bottom: 0;
  width: 480px;
  border-radius: 0;
  border-left: none;
  border-top: none;
  border-bottom: none;
}

.glsl-pg__editor-panel.glsl-pg__panel--hidden {
  transform: translateX(-100%);
}

.glsl-pg__editor-wrap {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

/* CodeMirror overrides */
.glsl-pg__editor-wrap .cm-editor {
  height: 100%;
  background: transparent;
  font-size: 13px;
}

.glsl-pg__editor-wrap .cm-editor .cm-scroller {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  line-height: 1.6;
}

.glsl-pg__editor-wrap .cm-editor .cm-gutters {
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.glsl-pg__editor-wrap .cm-editor .cm-activeLine {
  background: rgba(90, 200, 250, 0.06);
}

.glsl-pg__editor-wrap .cm-editor .cm-selectionBackground {
  background: rgba(90, 200, 250, 0.15) !important;
}

/* Fallback textarea */
.glsl-pg__editor-fallback {
  width: 100%;
  height: 100%;
  background: transparent;
  color: #e0e0e0;
  border: none;
  outline: none;
  resize: none;
  padding: 16px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 4;
  -moz-tab-size: 4;
}

/* Error line decoration */
.glsl-pg__error-line {
  background: rgba(255, 60, 60, 0.12);
}

.glsl-pg__error-gutter {
  color: #ff3c3c;
  font-size: 11px;
}

/* Error banner */
.glsl-pg__error-banner {
  flex-shrink: 0;
  padding: 8px 16px;
  background: rgba(255, 60, 60, 0.1);
  border-top: 1px solid rgba(255, 60, 60, 0.3);
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  color: #ff6b6b;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}

.glsl-pg__error-banner:empty {
  display: none;
}

.glsl-pg__error-item {
  padding: 2px 0;
}

.glsl-pg__error-item .line-num {
  color: #ff3cac;
  font-weight: 600;
}

.glsl-pg__error-item .hint {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Editor toolbar */
.glsl-pg__editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.glsl-pg__editor-toolbar-btn {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.glsl-pg__editor-toolbar-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.glsl-pg__compile-status {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
}

.glsl-pg__compile-status--ok {
  color: #30d158;
}

.glsl-pg__compile-status--error {
  color: #ff3c3c;
}

/* ==========================================================================
   Controls Panel — Right side
   ========================================================================== */

.glsl-pg__controls-panel {
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  border-radius: 0;
  border-right: none;
  border-top: none;
  border-bottom: none;
}

.glsl-pg__controls-panel.glsl-pg__panel--hidden {
  transform: translateX(100%);
}

.glsl-pg__controls-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Control group */
.glsl-pg__control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glsl-pg__control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.glsl-pg__control-value {
  color: #5ac8fa;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* Slider */
.glsl-pg__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.glsl-pg__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5ac8fa;
  border: 2px solid rgba(10, 10, 10, 0.8);
  cursor: grab;
  transition: transform 0.1s;
}

.glsl-pg__slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

.glsl-pg__slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5ac8fa;
  border: 2px solid rgba(10, 10, 10, 0.8);
  cursor: grab;
}

/* Control section dividers */
.glsl-pg__control-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.glsl-pg__control-section + .glsl-pg__control-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.glsl-pg__control-section-label {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 2px;
}

/* Audio slider accent (magenta instead of cyan) */
.glsl-pg__slider--audio::-webkit-slider-thumb {
  background: #ff3cac;
}

.glsl-pg__slider--audio::-moz-range-thumb {
  background: #ff3cac;
}

/* Randomize button */
.glsl-pg__randomize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 0;
  background: rgba(90, 200, 250, 0.08);
  border: 1px solid rgba(90, 200, 250, 0.2);
  border-radius: 6px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5ac8fa;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.glsl-pg__randomize-btn:hover {
  background: rgba(90, 200, 250, 0.15);
  border-color: rgba(90, 200, 250, 0.4);
}

.glsl-pg__randomize-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ==========================================================================
   Preset Browser Panel — Overlay
   ========================================================================== */

.glsl-pg__presets-panel {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 720px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  border-radius: 12px;
  z-index: 150;
}

.glsl-pg__presets-panel.glsl-pg__panel--hidden {
  transform: translate(-50%, -50%) scale(0.95);
}

.glsl-pg__presets-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 140;
  opacity: 1;
  transition: opacity 0.2s;
}

.glsl-pg__presets-overlay--hidden {
  opacity: 0;
  pointer-events: none;
}

/* Search input */
.glsl-pg__presets-search {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  outline: none;
  transition: border-color 0.15s;
}
.glsl-pg__presets-search:focus {
  border-color: rgba(90, 200, 250, 0.5);
}
.glsl-pg__presets-search::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Category filter bar */
.glsl-pg__category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.glsl-pg__category-pill {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  text-transform: lowercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.glsl-pg__category-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}
.glsl-pg__category-pill--active {
  background: rgba(90, 200, 250, 0.15);
  border-color: rgba(90, 200, 250, 0.4);
  color: #5ac8fa;
}

/* Difficulty filter bar */
.glsl-pg__difficulty-bar {
  display: flex;
  gap: 6px;
  padding: 8px 16px 0;
}

.glsl-pg__diff-pill {
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.glsl-pg__diff-pill:hover {
  color: rgba(255, 255, 255, 0.6);
}
.glsl-pg__diff-pill--active {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.glsl-pg__diff-pill--beginner.glsl-pg__diff-pill--active {
  border-color: rgba(48, 209, 88, 0.5);
  color: #30d158;
}
.glsl-pg__diff-pill--intermediate.glsl-pg__diff-pill--active {
  border-color: rgba(90, 200, 250, 0.5);
  color: #5ac8fa;
}
.glsl-pg__diff-pill--advanced.glsl-pg__diff-pill--active {
  border-color: rgba(255, 60, 172, 0.5);
  color: #ff3cac;
}

/* Difficulty dot on cards */
.glsl-pg__diff-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}
.glsl-pg__diff-dot--beginner { background: #30d158; }
.glsl-pg__diff-dot--intermediate { background: #5ac8fa; }
.glsl-pg__diff-dot--advanced { background: #ff3cac; }

.glsl-pg__preset-name-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.glsl-pg__presets-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.glsl-pg__preset-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.glsl-pg__preset-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(90, 200, 250, 0.3);
  transform: translateY(-2px);
}

.glsl-pg__preset-card--active {
  border-color: #5ac8fa;
  background: rgba(90, 200, 250, 0.08);
}

.glsl-pg__preset-name {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.glsl-pg__preset-category {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
}

.glsl-pg__preset-author {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
  margin-top: 2px;
}

/* Attribution badge (canvas overlay for authored presets) */
.glsl-pg__attribution {
  position: fixed;
  bottom: 60px;
  right: 16px;
  z-index: 100;
  padding: 5px 12px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  cursor: pointer;
}

.glsl-pg__attribution:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Mini Player — Bottom bar (Winamp-style)
   ========================================================================== */

.glsl-pg__player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 120;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glsl-pg__player--collapsed {
  height: 48px;
}

.glsl-pg__player--expanded {
  height: 400px;
}

/* Collapsed transport bar */
.glsl-pg__player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 48px;
}

.glsl-pg__player-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.glsl-pg__player-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.glsl-pg__player-btn--play {
  width: 36px;
  height: 36px;
  border-color: #5ac8fa;
  color: #5ac8fa;
}

.glsl-pg__player-btn--play:hover {
  background: rgba(90, 200, 250, 0.1);
  border-color: #5ac8fa;
  color: #5ac8fa;
}

.glsl-pg__player-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.glsl-pg__player-btn--play svg {
  width: 16px;
  height: 16px;
}

.glsl-pg__player-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.glsl-pg__player-track-name {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glsl-pg__player-time {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}

/* Progress bar */
.glsl-pg__player-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.glsl-pg__player-progress-fill {
  height: 100%;
  background: #5ac8fa;
  width: 0%;
  transition: width 0.1s linear;
}

.glsl-pg__player-progress:hover {
  height: 4px;
}

.glsl-pg__player-progress:hover .glsl-pg__player-progress-fill {
  background: #ff3cac;
}

/* Volume slider */
.glsl-pg__player-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.glsl-pg__player-volume svg {
  width: 14px;
  height: 14px;
  stroke: rgba(255, 255, 255, 0.5);
  fill: none;
  stroke-width: 2;
}

.glsl-pg__player-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
}

.glsl-pg__player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.glsl-pg__player-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* Expand toggle */
.glsl-pg__player-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.glsl-pg__player-expand:hover {
  color: #fff;
}

.glsl-pg__player-expand svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.3s;
}

.glsl-pg__player--expanded .glsl-pg__player-expand svg {
  transform: rotate(180deg);
}

/* Expanded player body */
.glsl-pg__player-body {
  display: none;
  padding: 16px;
  flex: 1;
  overflow: hidden;
}

.glsl-pg__player--expanded .glsl-pg__player-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Spectrum bars */
.glsl-pg__player-spectrum {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 60px;
  padding: 0 4px;
}

.glsl-pg__player-spectrum-bar {
  flex: 1;
  background: linear-gradient(to top, #5ac8fa, #ff3cac);
  border-radius: 1px 1px 0 0;
  min-height: 2px;
  transition: height 0.08s ease-out;
}

/* Playlist */
.glsl-pg__playlist {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glsl-pg__playlist-header {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  padding: 4px 0 8px;
}

.glsl-pg__playlist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.glsl-pg__playlist-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

.glsl-pg__playlist-item--active {
  background: rgba(90, 200, 250, 0.08);
  color: #5ac8fa;
}

.glsl-pg__playlist-item--active::before {
  content: "\25B8";
  color: #5ac8fa;
  font-size: 10px;
}

/* Drop zone overlay */
.glsl-pg__dropzone {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 10, 10, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.glsl-pg__dropzone--active {
  opacity: 1;
  pointer-events: all;
}

.glsl-pg__dropzone-icon {
  width: 64px;
  height: 64px;
  stroke: #5ac8fa;
  fill: none;
  stroke-width: 1.5;
}

.glsl-pg__dropzone-text {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Toast / Messages
   ========================================================================== */

.glsl-pg__toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 300;
  padding: 10px 20px;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.glsl-pg__toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* ==========================================================================
   Keyboard hint overlay
   ========================================================================== */

.glsl-pg__hints {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  gap: 12px;
  opacity: 0.4;
  transition: opacity 0.3s;
  pointer-events: none;
}

.glsl-pg__hints:hover {
  opacity: 0.8;
}

.glsl-pg__hint {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 4px;
}

.glsl-pg__hint kbd {
  display: inline-block;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  font-size: 10px;
  line-height: 1;
  font-family: inherit;
}

/* ==========================================================================
   Loading / WebGL Missing States
   ========================================================================== */

.glsl-pg__loading {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.5s;
}

.glsl-pg__loading--hidden {
  opacity: 0;
  pointer-events: none;
}

.glsl-pg__loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #5ac8fa;
  border-radius: 50%;
  animation: glsl-pg-spin 0.8s linear infinite;
}

@keyframes glsl-pg-spin {
  to { transform: rotate(360deg); }
}

.glsl-pg__loading-text {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.glsl-pg__no-webgl {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  text-align: center;
}

.glsl-pg__no-webgl-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.glsl-pg__no-webgl-msg {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  max-width: 40ch;
  line-height: 1.6;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .glsl-pg__editor-panel {
    width: 100%;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .glsl-pg__editor-panel.glsl-pg__panel--hidden {
    transform: translateY(100%);
  }

  .glsl-pg__controls-panel {
    width: 100%;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .glsl-pg__controls-panel.glsl-pg__panel--hidden {
    transform: translateY(100%);
  }

  .glsl-pg__presets-panel {
    width: 100%;
    height: 70vh;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 12px 12px 0 0;
    max-width: none;
    max-height: none;
  }

  .glsl-pg__presets-panel.glsl-pg__panel--hidden {
    transform: translateY(100%);
  }

  .glsl-pg__hints {
    display: none;
  }

  .glsl-pg__attribution {
    bottom: 52px;
    right: 10px;
    font-size: 10px;
    padding: 4px 10px;
  }

  .glsl-pg__player-volume {
    display: none;
  }

  .glsl-pg__player--expanded {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .glsl-pg__utility {
    top: 10px;
    right: 10px;
    gap: 4px;
  }

  .glsl-pg__back {
    top: 10px;
    left: 10px;
    font-size: 0;
    padding: 8px;
  }

  .glsl-pg__back svg {
    width: 16px;
    height: 16px;
  }
}

/* ==========================================================================
   Hub Card Preview — animated gradient orbs + GLSL code overlay
   ========================================================================== */

.preview-glsl {
  background: #050508;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-glsl__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
  will-change: transform;
}

.preview-glsl__orb--1 {
  width: 200px;
  height: 200px;
  background: #5ac8fa;
  top: 10%;
  left: 20%;
  animation: glslOrb1 8s ease-in-out infinite;
}

.preview-glsl__orb--2 {
  width: 160px;
  height: 160px;
  background: #ff3cac;
  bottom: 15%;
  right: 15%;
  animation: glslOrb2 10s ease-in-out infinite;
}

.preview-glsl__orb--3 {
  width: 120px;
  height: 120px;
  background: #30d158;
  top: 50%;
  left: 55%;
  animation: glslOrb3 12s ease-in-out infinite;
}

@keyframes glslOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.9); }
}

@keyframes glslOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 20px) scale(0.85); }
  66% { transform: translate(25px, -15px) scale(1.15); }
}

@keyframes glslOrb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15px, 25px) scale(1.05); }
  66% { transform: translate(-25px, -10px) scale(0.95); }
}

/* Code overlay */
.preview-glsl__code {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.preview-glsl__line {
  opacity: 0;
  animation: glslCodeFade 6s ease-in-out infinite;
}

.preview-glsl__line:nth-child(1) { animation-delay: 0s; }
.preview-glsl__line:nth-child(2) { animation-delay: 0.8s; }
.preview-glsl__line:nth-child(3) { animation-delay: 1.6s; }

@keyframes glslCodeFade {
  0%, 10% { opacity: 0; transform: translateY(4px); }
  20%, 70% { opacity: 1; transform: translateY(0); }
  85%, 100% { opacity: 0; transform: translateY(-4px); }
}

.preview-glsl__line .kw {
  color: #ff3cac;
}

.preview-glsl__line .fn {
  color: #5ac8fa;
}

/* Blinking cursor */
.preview-glsl__cursor {
  position: absolute;
  z-index: 3;
  bottom: 38%;
  left: 58%;
  width: 2px;
  height: 16px;
  background: #5ac8fa;
  animation: glslCursorBlink 1s step-end infinite;
}

@keyframes glslCursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Vignette */
.preview-glsl__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 4;
}
