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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, #0a0a1f 0%, #1a0a2e 50%, #0a0a1f 100%);
  min-height: 100vh;
  color: #ffffff;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, rgba(0,255,255,0.1) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0,255,255,0.2);
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 800;
  background: linear-gradient(90deg, #00ffff, #ff00ff, #00ffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  text-shadow: 0 0 30px rgba(0,255,255,0.5);
}

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

.emoji {
  -webkit-text-fill-color: initial;
}

.subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.main-container {
  display: flex;
  flex: 1;
  gap: 1rem;
  padding: 1rem;
}

.left-panel,
.right-panel {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(0,255,255,0.2);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  color: #00ffff;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sticker-grid,
.shape-grid,
.bg-grid,
.template-grid {
  display: grid;
  gap: 0.5rem;
}

.sticker-grid {
  grid-template-columns: repeat(4, 1fr);
}

.shape-grid {
  grid-template-columns: repeat(4, 1fr);
}

.bg-grid,
.template-grid {
  grid-template-columns: 1fr;
}

.sticker-btn {
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sticker-btn:hover {
  transform: scale(1.15);
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0,255,255,0.4);
}

.sticker-btn.degen {
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255,0,255,0.5); }
  50% { box-shadow: 0 0 20px rgba(255,0,255,0.8); }
}

.shape-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.shape-btn:hover {
  transform: scale(1.15);
  opacity: 1;
  box-shadow: 0 0 20px currentColor;
}

.bg-btn,
.template-btn {
  padding: 0.6rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bg-btn:hover,
.template-btn:hover {
  border-color: #ff00ff;
  box-shadow: 0 0 10px rgba(255,0,255,0.3);
}

.canvas-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.canvas-wrapper {
  background: #000;
  border-radius: 12px;
  padding: 4px;
  border: 2px solid rgba(0,255,255,0.3);
  box-shadow: 0 0 30px rgba(0,255,255,0.2);
  width: 100%;
  max-width: 900px;
}

#canvas {
  width: 100%;
  display: block;
  border-radius: 8px;
  cursor: crosshair;
}

.action-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.action-btn {
  padding: 0.75rem 1.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.action-btn.randomize {
  background: linear-gradient(135deg, #ff00ff, #ff6600);
  color: #fff;
}

.action-btn.download {
  background: linear-gradient(135deg, #00ffff, #00ff00);
  color: #000;
}

.action-btn.clear {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,255,255,0.4);
}

.text-controls,
.event-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.text-field {
  width: 100%;
  padding: 0.6rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(0,255,255,0.3);
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
}

.text-field:focus {
  outline: none;
  border-color: #00ffff;
  box-shadow: 0 0 10px rgba(0,255,255,0.3);
}

.add-text-btn {
  padding: 0.6rem;
  background: linear-gradient(135deg, #00ffff, #00ff88);
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-text-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(0,255,255,0.5);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.control-row label {
  min-width: 40px;
  color: rgba(255,255,255,0.7);
}

.control-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #00ffff;
  border-radius: 50%;
  cursor: pointer;
}

.control-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00ffff;
}

.color-picker {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.color-btn {
  width: 24px;
  height: 24px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-btn:hover,
.color-btn.active {
  transform: scale(1.15);
  border-color: #fff;
}

.element-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.element-btn {
  flex: 1;
  min-width: 60px;
  padding: 0.5rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.element-btn:hover {
  background: rgba(255,255,255,0.2);
}

.element-btn.delete {
  background: rgba(255,0,0,0.2);
  border-color: rgba(255,0,0,0.4);
}

.element-btn.delete:hover {
  background: rgba(255,0,0,0.4);
}

.footer {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 100%);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer a {
  color: #00ffff;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-shadow: 0 0 10px #00ffff;
}

.tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.5rem;
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  animation: fall 3s ease-out forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.loading-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: #00ffff;
  animation: loadPulse 1s ease infinite;
}

@keyframes loadPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.degen-mode .header {
  animation: degenHeader 0.5s ease infinite;
}

@keyframes degenHeader {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(30deg); }
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
  }
  
  .left-panel,
  .right-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .panel-section {
    flex: 1;
    min-width: 200px;
  }
  
  .sticker-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 600px) {
  .header {
    padding: 1rem;
  }
  
  .main-container {
    padding: 0.5rem;
  }
  
  .panel-section {
    min-width: 100%;
  }
  
  .action-bar {
    width: 100%;
  }
  
  .action-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
  }
  
  .sticker-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .sticker-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}