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

body {
  background: #07060e;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(34, 211, 238, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 12s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

#root {
  position: relative;
  z-index: 1;
}

/* Glassmorphism card */
.glass {
  background: rgba(20, 19, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.glass-strong {
  background: rgba(20, 19, 42, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Header animated gradient text */
.header-gradient {
  background: linear-gradient(135deg, #a855f7, #22d3ee, #ec4899, #a855f7);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.4));
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Preview dot pattern */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(168, 85, 247, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(20, 19, 42, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

/* Effect card hover */
.effect-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.effect-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.15);
}
.effect-card.active {
  border-color: rgba(168, 85, 247, 0.8);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.1);
}

/* Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(168, 85, 247, 0.2);
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #22d3ee);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Color picker */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: transparent;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}
input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 5px;
}

/* Toast animation */
@keyframes toastIn {
  0% { transform: translateY(20px) scale(0.95); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes toastOut {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(20px) scale(0.95); opacity: 0; }
}
.toast-enter {
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.toast-exit {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Preset scroll */
.preset-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
}

/* Textarea styling */
textarea {
  resize: vertical;
}
textarea:focus, select:focus, input:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* Code block */
.code-block {
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Preview effects — these are the actual text effects */
@keyframes ihtx-rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ihtx-glitch {
  0%, 100% { text-shadow: -2px 0 var(--ihtx-c1), 2px 0 var(--ihtx-c2); transform: translate(0); }
  20% { text-shadow: 2px 0 var(--ihtx-c1), -2px 0 var(--ihtx-c2); transform: translate(-2px, 1px); }
  40% { text-shadow: -1px 0 var(--ihtx-c1), 1px 0 var(--ihtx-c2); transform: translate(1px, -1px); }
  60% { text-shadow: 3px 0 var(--ihtx-c1), -3px 0 var(--ihtx-c2); transform: translate(-1px, 2px); }
  80% { text-shadow: -2px 0 var(--ihtx-c1), 2px 0 var(--ihtx-c2); transform: translate(2px, -2px); }
}

@keyframes ihtx-fire-glow {
  0%, 100% { text-shadow: 0 0 10px var(--ihtx-c1), 0 0 20px var(--ihtx-c1), 0 0 40px var(--ihtx-c2), 0 -5px 60px var(--ihtx-c2); }
  50% { text-shadow: 0 0 15px var(--ihtx-c1), 0 0 30px var(--ihtx-c1), 0 0 50px var(--ihtx-c2), 0 -8px 70px var(--ihtx-c2); }
}

@keyframes ihtx-neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow: 0 0 7px var(--ihtx-c1), 0 0 10px var(--ihtx-c1), 0 0 21px var(--ihtx-c1), 0 0 42px var(--ihtx-c2), 0 0 82px var(--ihtx-c2), 0 0 92px var(--ihtx-c2);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

@keyframes ihtx-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes ihtx-typewriter-cursor {
  0%, 100% { border-right-color: var(--ihtx-c1); }
  50% { border-right-color: transparent; }
}

@keyframes ihtx-frost-shimmer {
  0%, 100% { text-shadow: 0 0 10px var(--ihtx-c1), 0 0 20px var(--ihtx-c2), 1px 1px 2px rgba(255,255,255,0.3); filter: brightness(1); }
  50% { text-shadow: 0 0 15px var(--ihtx-c1), 0 0 30px var(--ihtx-c2), 2px 2px 4px rgba(255,255,255,0.5); filter: brightness(1.1); }
}

/* Tooltip */
.tooltip-wrap {
  position: relative;
}
.tooltip-wrap .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 19, 42, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c4b5fd;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 50;
}
.tooltip-wrap:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a855f7' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  -webkit-appearance: none;
  appearance: none;
}