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

:root {
  --hero-primary: #0066cc;
  --hero-secondary: #ffd700;
  --villain-primary: #8b00ff;
  --villain-secondary: #00ff88;
  --bg-dark: #0a0a0f;
  --bg-panel: #151520;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --accent-red: #ff3366;
  --accent-yellow: #ffcc00;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px) rotate(-1deg); }
  75% { transform: translateX(5px) rotate(1deg); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px currentColor; }
  50% { box-shadow: 0 0 40px currentColor, 0 0 60px currentColor; }
}

@keyframes actionLines {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
  100% { transform: scale(0.8) rotate(360deg); opacity: 0.5; }
}

@keyframes toastSlide {
  from { transform: translateY(-100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.app-container {
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(139, 0, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 102, 204, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a0f 0%, #15151f 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.halftone-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 8px 8px;
  pointer-events: none;
  z-index: 1;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-red));
  color: #000;
  padding: 16px 32px;
  border-radius: 8px;
  font-family: 'Bangers', cursive;
  font-size: 1.2rem;
  letter-spacing: 2px;
  z-index: 1000;
  animation: toastSlide 0.5s ease-out;
  box-shadow: 0 4px 20px rgba(255, 204, 0, 0.5);
}

/* Header */
.header-section {
  position: relative;
  padding: 40px 20px;
  text-align: center;
  z-index: 10;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.main-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(3rem, 10vw, 6rem);
  background: linear-gradient(180deg, #ff3366 0%, #ffcc00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  letter-spacing: 4px;
  line-height: 1;
}

.sub-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--text-primary);
  letter-spacing: 8px;
  text-shadow: 3px 3px 0 var(--villain-primary);
}

.tagline {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.lightning-accent {
  width: 40px;
  height: 60px;
  background: var(--accent-yellow);
  clip-path: polygon(50% 0%, 100% 25%, 50% 50%, 100% 100%, 0% 50%, 50% 25%);
  animation: pulse 2s ease-in-out infinite;
}

.lightning-accent.left {
  transform: rotate(-15deg);
}

.lightning-accent.right {
  transform: rotate(15deg);
}

/* Main Content */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Search Section */
.search-section {
  margin-bottom: 40px;
  animation: slideIn 0.5s ease-out;
}

.speech-bubble {
  position: relative;
  background: var(--bg-panel);
  border: 4px solid var(--accent-yellow);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto 20px;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: var(--accent-yellow);
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 16px 24px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  background: #1a1a2e;
  border: 3px solid #333;
  border-radius: 10px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--hero-primary);
  box-shadow: 0 0 20px rgba(0, 102, 204, 0.5);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-btn {
  padding: 16px 32px;
  font-family: 'Bangers', cursive;
  font-size: 1.3rem;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-yellow));
  border: none;
  border-radius: 10px;
  color: #000;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 51, 102, 0.6);
}

.search-btn:active {
  animation: shake 0.3s ease;
}

/* Filter Toggles */
.filter-toggles {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 30px 0 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 24px;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  background: var(--bg-panel);
  border: 2px solid #444;
  border-radius: 30px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: #666;
  color: var(--text-primary);
}

.filter-btn.active {
  background: #222;
  color: var(--text-primary);
  border-color: #666;
}

.filter-btn.active.hero {
  border-color: var(--hero-primary);
  color: var(--hero-primary);
  box-shadow: 0 0 15px rgba(0, 102, 204, 0.4);
}

.filter-btn.active.villain {
  border-color: var(--villain-primary);
  color: var(--villain-primary);
  box-shadow: 0 0 15px rgba(139, 0, 255, 0.4);
}

/* Quick Picks */
.quick-picks {
  text-align: center;
  margin-top: 30px;
}

.quick-picks-label {
  font-family: 'Oswald', sans-serif;
  color: var(--text-secondary);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.quick-picks-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.quick-pick-btn {
  padding: 10px 20px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--bg-panel);
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.quick-pick-btn.hero {
  border-color: var(--hero-primary);
  color: var(--hero-primary);
}

.quick-pick-btn.villain {
  border-color: var(--villain-primary);
  color: var(--villain-primary);
}

.quick-pick-btn:hover {
  transform: translateY(-3px);
}

.quick-pick-btn.hero:hover {
  background: var(--hero-primary);
  color: #fff;
  box-shadow: 0 5px 20px rgba(0, 102, 204, 0.5);
}

.quick-pick-btn.villain:hover {
  background: var(--villain-primary);
  color: #fff;
  box-shadow: 0 5px 20px rgba(139, 0, 255, 0.5);
}

/* Deadpool Easter Egg */
.deadpool-easter-egg {
  background: linear-gradient(135deg, #c00, #000);
  border: 3px solid #ff0;
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  max-width: 600px;
  text-align: center;
  animation: shake 0.5s ease;
}

.deadpool-easter-egg p {
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 1px;
}

/* Character Panel */
.character-panel {
  margin: 40px 0;
  animation: slideIn 0.5s ease-out;
}

.character-card {
  background: var(--bg-panel);
  border: 4px solid;
  border-radius: 20px;
  padding: 30px;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.character-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

.character-card.hero {
  border-color: var(--hero-primary);
}

.character-card.hero::before {
  background: linear-gradient(90deg, var(--hero-primary), var(--hero-secondary));
}

.character-card.villain {
  border-color: var(--villain-primary);
}

.character-card.villain::before {
  background: linear-gradient(90deg, var(--villain-primary), var(--villain-secondary));
}

.character-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.character-name {
  font-family: 'Bangers', cursive;
  font-size: 2.5rem;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.alignment-badge {
  padding: 8px 16px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 20px;
  letter-spacing: 1px;
}

.alignment-badge.hero {
  background: rgba(0, 102, 204, 0.2);
  color: var(--hero-primary);
  border: 2px solid var(--hero-primary);
  animation: glow 2s ease-in-out infinite;
}

.alignment-badge.villain {
  background: rgba(139, 0, 255, 0.2);
  color: var(--villain-primary);
  border: 2px solid var(--villain-primary);
  animation: glow 2s ease-in-out infinite;
}

.character-desc {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.loading-dots {
  color: var(--text-secondary);
  font-family: 'Oswald', sans-serif;
  margin-top: 10px;
}

/* Customization Section */
.customization-section {
  margin: 40px 0;
  animation: slideIn 0.5s ease-out 0.1s both;
}

.section-title {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 25px;
  letter-spacing: 3px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  max-width: 900px;
  margin: 0 auto 30px;
}

.style-card {
  background: var(--bg-panel);
  border: 3px solid #333;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.style-card:hover {
  border-color: var(--accent-yellow);
  transform: translateY(-5px);
}

.style-card.selected {
  border-color: var(--accent-yellow);
  background: rgba(255, 204, 0, 0.1);
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.style-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.style-desc {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Tagline Section */
.tagline-section {
  max-width: 600px;
  margin: 0 auto 30px;
}

.tagline-label {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.tagline-input {
  width: 100%;
  padding: 16px 20px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  background: #1a1a2e;
  border: 3px solid #333;
  border-radius: 10px;
  color: var(--text-primary);
  outline: none;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.tagline-input:focus {
  border-color: var(--accent-yellow);
}

.randomize-btn {
  padding: 10px 20px;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  background: transparent;
  border: 2px solid var(--text-secondary);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.randomize-btn:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

/* Generate Button */
.generate-btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 24px 48px;
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-yellow));
  border: none;
  border-radius: 15px;
  color: #000;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.generate-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.generate-btn:hover::before {
  width: 400px;
  height: 400px;
}

.generate-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 40px rgba(255, 51, 102, 0.5);
}

.generate-btn:active {
  animation: shake 0.3s ease;
}

.generate-btn.generating {
  background: #333;
  cursor: wait;
}

.generating-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.action-lines {
  width: 30px;
  height: 30px;
  background: var(--accent-yellow);
  animation: actionLines 1s linear infinite;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.pow-effect {
  position: relative;
}

/* Poster Display */
.poster-display {
  margin: 50px 0;
  animation: slideIn 0.5s ease-out;
}

.poster-frame {
  max-width: 500px;
  margin: 0 auto 30px;
}

.poster-container {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.poster-container.hero-glow {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 102, 204, 0.4);
}

.poster-container.villain-glow {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(139, 0, 255, 0.4);
}

.poster-image {
  width: 100%;
  display: block;
}

.poster-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  text-align: center;
}

.poster-title {
  font-family: 'Bangers', cursive;
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
  letter-spacing: 3px;
}

.poster-tagline {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  color: var(--accent-yellow);
  margin-top: 8px;
  font-style: italic;
}

.watermark {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-top: 15px;
  letter-spacing: 1px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.action-btn {
  padding: 14px 28px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border: 3px solid;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-panel);
}

.action-btn.download {
  border-color: var(--hero-primary);
  color: var(--hero-primary);
}

.action-btn.download:hover {
  background: var(--hero-primary);
  color: #fff;
}

.action-btn.save {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.action-btn.save:hover {
  background: var(--accent-yellow);
  color: #000;
}

.action-btn.regenerate {
  border-color: var(--villain-primary);
  color: var(--villain-primary);
}

.action-btn.regenerate:hover {
  background: var(--villain-primary);
  color: #fff;
}

.action-btn.new {
  border-color: var(--villain-secondary);
  color: var(--villain-secondary);
}

.action-btn.new:hover {
  background: var(--villain-secondary);
  color: #000;
}

/* Gallery Section */
.gallery-section {
  margin: 60px 0;
  padding-top: 40px;
  border-top: 2px solid #333;
}

.gallery-title {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 30px;
  letter-spacing: 3px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.gallery-item:hover {
  transform: scale(1.05);
  border-color: var(--accent-yellow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gallery-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.gallery-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  color: #fff;
  text-align: center;
}

/* Footer */
.footer-section {
  background: #0a0a0f;
  border-top: 4px solid #222;
  padding: 30px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.footer-credits {
  font-family: 'Oswald', sans-serif;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-link {
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  color: var(--accent-red);
  text-decoration: none;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  padding: 10px 25px;
  border: 3px solid var(--accent-red);
  border-radius: 10px;
}

.footer-link:hover {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  .main-title {
    font-size: 3rem;
  }
  
  .sub-title {
    font-size: 2rem;
    letter-spacing: 4px;
  }
  
  .lightning-accent {
    display: none;
  }
  
  .speech-bubble {
    padding: 15px;
  }
  
  .search-input {
    width: 100%;
    font-size: 1rem;
    padding: 14px 18px;
  }
  
  .search-btn {
    width: 100%;
    padding: 14px;
  }
  
  .quick-pick-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
  
  .character-name {
    font-size: 1.8rem;
  }
  
  .style-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .style-card {
    padding: 15px;
  }
  
  .generate-btn {
    font-size: 1.5rem;
    padding: 20px 30px;
  }
  
  .poster-title {
    font-size: 1.8rem;
  }
  
  .action-buttons {
    gap: 8px;
  }
  
  .action-btn {
    padding: 12px 18px;
    font-size: 0.9rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .style-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-toggles {
    gap: 8px;
  }
  
  .filter-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}