:root {
  --bg-dark: #0d0d1a;
  --bg-medium: #1a1a2e;
  --bg-card: #252542;
  --neon-cyan: #00fff5;
  --neon-magenta: #ff00ff;
  --neon-lime: #00ff00;
  --neon-orange: #ff6b35;
  --neon-purple: #bf00ff;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.bg-effects {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(191, 0, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 255, 245, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 0, 255, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header */
.header {
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--bg-medium) 0%, transparent 100%);
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
}

.title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(1rem, 4vw, 1.8rem);
  color: var(--neon-cyan);
  text-shadow: 
    0 0 10px var(--neon-cyan),
    0 0 20px var(--neon-cyan),
    0 0 40px var(--neon-cyan);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  line-height: 1.5;
}

.title:hover {
  color: var(--neon-magenta);
  text-shadow: 
    0 0 10px var(--neon-magenta),
    0 0 20px var(--neon-magenta),
    0 0 40px var(--neon-magenta);
}

.title-icon {
  display: inline-block;
  animation: bounce 1s ease-in-out infinite;
}

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

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.chaos-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 1rem;
  background: linear-gradient(90deg, var(--neon-orange), var(--neon-magenta));
  border-radius: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

/* Main content */
.main-content {
  flex: 1;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Slot Machine */
.slot-machine {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid rgba(0, 255, 245, 0.3);
  box-shadow: 
    0 0 30px rgba(0, 255, 245, 0.1),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.slots-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.slot-column {
  flex: 1;
  min-width: 120px;
  max-width: 180px;
}

.slot-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--neon-cyan);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.slot-window {
  height: 48px;
  overflow: hidden;
  background: var(--bg-dark);
  border-radius: 8px;
  border: 2px solid var(--neon-purple);
  position: relative;
}

.slot-window::before,
.slot-window::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 15px;
  pointer-events: none;
  z-index: 2;
}

.slot-window::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-dark), transparent);
}

.slot-window::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-dark), transparent);
}

.slot-reel {
  transition: transform 0.3s ease-out;
}

.slot-reel.spinning {
  animation: spin 0.1s linear infinite;
}

@keyframes spin {
  0% { transform: translateY(0); }
  100% { transform: translateY(-480px); }
}

.slot-item {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  padding: 0 0.5rem;
}

.generate-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(0.6rem, 2vw, 0.9rem);
  color: var(--bg-dark);
  background: linear-gradient(180deg, var(--neon-cyan) 0%, #00cccc 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  box-shadow: 
    0 4px 0 #008888,
    0 0 20px rgba(0, 255, 245, 0.5);
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 0 #008888,
    0 0 30px rgba(0, 255, 245, 0.7);
}

.generate-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #008888,
    0 0 15px rgba(0, 255, 245, 0.5);
}

.generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.generate-btn.spinning {
  animation: buttonPulse 0.3s ease-in-out infinite alternate;
}

@keyframes buttonPulse {
  from { box-shadow: 0 4px 0 #008888, 0 0 20px rgba(0, 255, 245, 0.5); }
  to { box-shadow: 0 4px 0 #008888, 0 0 40px rgba(0, 255, 245, 0.8); }
}

/* Game Display */
.game-display {
  margin-bottom: 2rem;
}

.game-display.legendary {
  animation: legendaryGlow 2s ease-in-out infinite alternate;
}

@keyframes legendaryGlow {
  from { box-shadow: 0 0 30px rgba(255, 215, 0, 0.3); }
  to { box-shadow: 0 0 60px rgba(255, 215, 0, 0.6); }
}

.game-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 0, 255, 0.3);
}

.game-image-container {
  position: relative;
  aspect-ratio: 1;
  max-height: 300px;
  overflow: hidden;
  background: var(--bg-dark);
}

.game-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}

.game-info {
  padding: 1.5rem;
}

.game-title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(0.8rem, 3vw, 1.2rem);
  color: var(--neon-magenta);
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
  line-height: 1.4;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.tag.genre {
  background: rgba(0, 255, 245, 0.2);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
}

.tag.theme {
  background: rgba(255, 0, 255, 0.2);
  color: var(--neon-magenta);
  border: 1px solid var(--neon-magenta);
}

.tag.twist {
  background: rgba(0, 255, 0, 0.2);
  color: var(--neon-lime);
  border: 1px solid var(--neon-lime);
}

.game-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.vibe-meter {
  margin-bottom: 1.5rem;
}

.vibe-label-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--neon-orange);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.vibe-bar-container {
  height: 12px;
  background: var(--bg-dark);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.vibe-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-lime), var(--neon-magenta));
  border-radius: 6px;
  transition: width 1s ease-out;
  box-shadow: 0 0 10px var(--neon-cyan);
}

.vibe-score-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vibe-number {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
  color: var(--neon-lime);
  text-shadow: 0 0 10px var(--neon-lime);
}

.vibe-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.stat-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.scope-low { color: var(--neon-lime); }
.scope-medium { color: var(--neon-cyan); }
.scope-high { color: var(--neon-orange); }
.scope-danger { color: #ff3333; animation: blink 0.5s infinite; }

@keyframes blink {
  50% { opacity: 0.5; }
}

/* Share Panel */
.share-panel {
  padding: 1rem;
  background: var(--bg-medium);
  border-radius: 0 0 16px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.share-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(180deg, var(--neon-magenta) 0%, #cc00cc 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Space Grotesk', sans-serif;
}

.share-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

.share-cta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* History */
.history-toggle {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s;
  margin-bottom: 1rem;
}

.history-toggle:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.history-panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: var(--neon-purple);
  margin-bottom: 1rem;
}

.history-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  cursor: pointer;
  transition: transform 0.2s;
}

.history-item:hover {
  transform: translateX(5px);
}

.game-card-compact {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.compact-thumbnail {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  image-rendering: pixelated;
}

.compact-info {
  flex: 1;
  min-width: 0;
}

.compact-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.compact-score .vibe-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 255, 0, 0.2);
  border-radius: 4px;
  color: var(--neon-lime);
}

/* Easter egg popup */
.easter-egg-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-cyan));
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  z-index: 1000;
  animation: popIn 0.3s ease-out;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 0, 255, 0.5);
}

@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}

/* Footer */
.footer {
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
  background: linear-gradient(0deg, var(--bg-medium) 0%, transparent 100%);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.footer-link {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: all 0.3s;
}

.footer-link:hover {
  color: var(--neon-magenta);
  text-shadow: 0 0 10px var(--neon-magenta);
}

.footer-divider {
  color: var(--text-secondary);
}

.footer-powered {
  color: var(--text-secondary);
}

.pixel-decorations {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.pixel-star {
  color: var(--neon-cyan);
  animation: twinkle 2s ease-in-out infinite;
}

.pixel-star.delay-1 {
  animation-delay: 0.5s;
}

.pixel-star.delay-2 {
  animation-delay: 1s;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--neon-purple);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-magenta);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .slots-container {
    flex-direction: column;
    align-items: center;
  }
  
  .slot-column {
    width: 100%;
    max-width: 100%;
  }
  
  .share-panel {
    flex-direction: column;
    text-align: center;
  }
  
  .share-btn {
    width: 100%;
  }
  
  .quick-stats {
    grid-template-columns: 1fr;
  }
}