* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #8B5CF6 #15151f;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #15151f; }
::-webkit-scrollbar-thumb { background: #8B5CF6; border-radius: 3px; }

body { font-family: 'Bricolage Grotesque', sans-serif; overflow-x: hidden; }

@keyframes headerFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pulseGlow { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes rainbowCycle {
  0% { color: #ff0000; } 16% { color: #ff8800; } 33% { color: #ffff00; }
  50% { color: #00ff00; } 66% { color: #0088ff; } 83% { color: #8800ff; } 100% { color: #ff0000; }
}
@keyframes glitch {
  0%, 100% { transform: translate(0); } 10% { transform: translate(-2px, 1px); } 20% { transform: translate(2px, -1px); }
  30% { transform: translate(-1px, 2px); } 40% { transform: translate(1px, -2px); } 50% { transform: translate(-2px, 0); }
  60% { transform: translate(2px, 1px); } 70% { transform: translate(0, -1px); } 80% { transform: translate(-1px, 0); } 90% { transform: translate(1px, 1px); }
}
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes floating { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: 0.8; } }
@keyframes rainbowExplosion {
  0% { filter: hue-rotate(0deg) brightness(1) saturate(1); transform: scale(1); }
  25% { filter: hue-rotate(90deg) brightness(1.5) saturate(2); transform: scale(1.2); }
  50% { filter: hue-rotate(180deg) brightness(2) saturate(3); transform: scale(1.1); }
  75% { filter: hue-rotate(270deg) brightness(1.5) saturate(2); transform: scale(1.3); }
  100% { filter: hue-rotate(360deg) brightness(1) saturate(1); transform: scale(1); }
}

@keyframes recBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.rec-badge {
  background: #ef4444;
  animation: recBlink 1s infinite;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

@keyframes countPop { 0% { transform: scale(0.4); opacity: 0; } 40% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0.85; } }
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 6rem;
  color: #fff;
  text-shadow: 0 0 30px #06B6D4, 0 0 60px #8B5CF6;
  background: rgba(0,0,0,0.35);
  animation: countPop 0.6s ease;
  pointer-events: none;
}

.header-letter { display: inline-block; transition: all 0.2s ease; cursor: default; }
.header-letter:hover { animation: bounce 0.4s ease; color: #06B6D4; text-shadow: 0 0 20px rgba(6, 182, 212, 0.6); }

.panel-glass {
  background: rgba(21, 21, 31, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(42, 42, 61, 0.6);
}

.control-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: #8B5CF6; margin-bottom: 4px;
  display: block;
}

.btn-action { transition: all 0.2s ease; position: relative; overflow: hidden; }
.btn-action::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.btn-action:hover::after { opacity: 1; }
.btn-action:active { transform: scale(0.96); }
.btn-action:disabled { opacity: 0.6; cursor: not-allowed; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; width: 100%; height: 20px; }
input[type="range"]::-webkit-slider-track { height: 4px; background: #2a2a3d; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #8B5CF6; margin-top: -6px; box-shadow: 0 0 8px rgba(139, 92, 246, 0.5); }
input[type="range"]::-moz-range-track { height: 4px; background: #2a2a3d; border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #8B5CF6; border: none; box-shadow: 0 0 8px rgba(139, 92, 246, 0.5); }

input[type="color"] { -webkit-appearance: none; border: 2px solid #2a2a3d; border-radius: 8px; cursor: pointer; padding: 0; overflow: hidden; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

.toast-enter { animation: toastIn 0.3s ease forwards; }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.preview-canvas { border: 2px dashed rgba(139, 92, 246, 0.3); transition: border-color 0.3s; }
.preview-canvas:hover { border-color: rgba(139, 92, 246, 0.6); }

.code-block { font-family: 'Fira Code', monospace; font-size: 0.75rem; line-height: 1.5; tab-size: 2; white-space: pre-wrap; word-break: break-all; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B5CF6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 28px;
}

.preset-chip { transition: all 0.15s ease; }
.preset-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2); }