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

body {
  background: #0d0d12;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(249, 115, 22, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(234, 179, 8, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(239, 68, 68, 0.03) 0%, transparent 65%),
    radial-gradient(ellipse at 90% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 10s ease-in-out infinite alternate;
}

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

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

/* Glassmorphism card - forge themed */
.glass {
  background: rgba(26, 24, 40, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(249, 115, 22, 0.12);
}

.glass-strong {
  background: rgba(26, 24, 40, 0.88);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(249, 115, 22, 0.18);
}

/* Header animated gradient text - forge colors */
.header-gradient {
  background: linear-gradient(135deg, #f97316, #eab308, #ef4444, #f97316);
  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 25px rgba(249, 115, 22, 0.5));
}

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

/* Preview anvil dot pattern */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(249, 115, 22, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(26, 24, 40, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 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(249, 115, 22, 0.45);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.12);
}
.effect-card.active {
  border-color: rgba(249, 115, 22, 0.7);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.2), inset 0 0 20px rgba(249, 115, 22, 0.05);
  background: rgba(249, 115, 22, 0.08);
}
.effect-card.signature {
  position: relative;
}
.effect-card.signature::after {
  content: '★';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 8px;
  color: #f97316;
}

/* Forge border on textarea */
.forge-border {
  border: 1px solid rgba(249, 115, 22, 0.2);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.05);
  background-image: 
    linear-gradient(rgba(249, 115, 22, 0.03), transparent),
    radial-gradient(circle at 0 0, rgba(249, 115, 22, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 100% 0, rgba(249, 115, 22, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 0 100%, rgba(249, 115, 22, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 100% 100%, rgba(249, 115, 22, 0.04) 1px, transparent 1px);
}

/* Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(249, 115, 22, 0.15);
  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, #f97316, #eab308);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(249, 115, 22, 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(249, 115, 22, 0.25);
  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(249, 115, 22, 0.3) transparent;
}

/* Textarea styling */
textarea {
  resize: vertical;
}
textarea:focus, select:focus, input:focus {
  outline: none;
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.08);
}

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

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

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

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

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

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

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

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

@keyframes tcf-emboss-pulse {
  0%, 100% { filter: brightness(1) contrast(1); }
  50% { filter: brightness(1.05) contrast(1.02); }
}

@keyframes tcf-runic-glow {
  0%, 100% { 
    text-shadow: 0 0 8px var(--tcf-c1), 0 0 16px var(--tcf-c2), 0 0 32px var(--tcf-c1);
    letter-spacing: 0.05em;
  }
  50% { 
    text-shadow: 0 0 16px var(--tcf-c1), 0 0 32px var(--tcf-c2), 0 0 48px var(--tcf-c1), 0 0 64px var(--tcf-c2);
    letter-spacing: 0.12em;
  }
}

/* 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(26, 24, 40, 0.95);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: #fbbf24;
  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='%23f97316' 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;
}

/* Preset card metallic look */
.preset-card {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), rgba(234, 179, 8, 0.04));
  border: 1px solid rgba(249, 115, 22, 0.15);
  transition: all 0.2s;
}
.preset-card:hover {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 2px 12px rgba(249, 115, 22, 0.1);
  transform: translateY(-1px);
}

/* Palette presets */
.palette-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.15s;
}
.palette-btn:hover {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.3);
}

/* Ember particle hints on header */
@keyframes emberFloat {
  0% { transform: translateY(0) scale(1); opacity: 0.6; }
  50% { opacity: 1; }
  100% { transform: translateY(-30px) scale(0.3); opacity: 0; }
}