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

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0d0d1a;
}
::-webkit-scrollbar-thumb {
  background: #a855f7;
  border-radius: 3px;
}

@keyframes portalSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4), 0 0 40px rgba(34, 211, 238, 0.2); }
  50% { box-shadow: 0 0 30px rgba(168, 85, 247, 0.7), 0 0 60px rgba(34, 211, 238, 0.4); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(168, 85, 247, 0.5), 0 0 40px rgba(236, 72, 153, 0.3); }
  50% { text-shadow: 0 0 30px rgba(168, 85, 247, 0.8), 0 0 60px rgba(236, 72, 153, 0.5), 0 0 80px rgba(34, 211, 238, 0.3); }
}

.portal-spinner {
  animation: portalSpin 3s linear infinite;
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.float-anim {
  animation: float 3s ease-in-out infinite;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

.title-glow {
  animation: titleGlow 3s ease-in-out infinite;
}

.glass {
  background: rgba(20, 20, 40, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.glass-hover:hover {
  background: rgba(30, 30, 60, 0.8);
  border-color: rgba(168, 85, 247, 0.4);
}

.neon-border {
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.1), inset 0 0 10px rgba(168, 85, 247, 0.05);
}

.portal-border {
  position: relative;
  overflow: hidden;
}
.portal-border::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: conic-gradient(from 0deg, #a855f7, #22d3ee, #ec4899, #a855f7);
  border-radius: inherit;
  animation: portalSpin 4s linear infinite;
  z-index: -1;
}
.portal-border::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  background: #0d0d1a;
  border-radius: inherit;
  z-index: -1;
}

.scene-canvas {
  background: radial-gradient(ellipse at center, rgba(26, 26, 62, 0.8) 0%, rgba(13, 13, 26, 0.95) 70%);
  position: relative;
}

.char-sprite {
  cursor: grab;
  transition: transform 0.15s, filter 0.15s;
  image-rendering: pixelated;
}
.char-sprite:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6));
}
.char-sprite:active {
  cursor: grabbing;
}

.parchment {
  background: linear-gradient(135deg, #1a1a3e 0%, #141428 50%, #1a1a3e 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.05), inset 0 0 30px rgba(0,0,0,0.3);
}

.btn-generate {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.btn-generate::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.5), 0 0 60px rgba(236, 72, 153, 0.3);
}

.chip {
  transition: all 0.2s;
}
.chip:hover {
  transform: translateY(-1px);
}

.tooltip-rivalry {
  animation: fadeInUp 0.3s ease-out;
}

.header-bg {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a0a2e 30%, #0d1a2e 60%, #1a0d2e 100%);
}

body {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .scene-canvas {
    min-height: 250px;
  }
}

/* Modal / Modifier styles */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #a855f7;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
  transition: box-shadow 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.8);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #a855f7;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}