:root {
  --yellow-sickly: #F2E6A0;
  --yellow-dark: #D4C36A;
  --yellow-muted: #B8A94E;
  --green-eerie: #00FF41;
  --green-glow: #CCFF00;
  --green-dim: #4a6b2a;
  --black-deep: #0a0a0a;
  --black-card: #1a1a1a;
  --black-lighter: #2a2a2a;
  --gray-muted: #666;
  --amber: #FFB000;
}

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

body {
  background-color: var(--yellow-sickly);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  color: var(--black-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  opacity: 0.3;
}

/* Scanline effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* Wallpaper texture pattern */
#root {
  position: relative;
}

#root::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Glitch animation for title */
@keyframes glitch {
  0% { text-shadow: 2px 0 #ff0000, -2px 0 #00ff00; }
  10% { text-shadow: -2px 0 #ff0000, 2px 0 #00ff00; }
  20% { text-shadow: 2px 2px #ff0000, -2px -2px #00ff00; clip-path: inset(20% 0 30% 0); }
  25% { clip-path: inset(0); }
  30% { text-shadow: -3px 0 #ff0000, 3px 0 #00ff00; }
  40% { text-shadow: 0 0 #ff0000, 0 0 #00ff00; }
  50% { text-shadow: 1px -1px #ff0000, -1px 1px #00ff00; clip-path: inset(60% 0 10% 0); }
  55% { clip-path: inset(0); }
  60% { text-shadow: -2px 0 #ff0000, 2px 0 #00ff00; }
  70% { text-shadow: 0 2px #ff0000, 0 -2px #00ff00; }
  80% { text-shadow: 3px 0 #ff0000, -3px 0 #00ff00; clip-path: inset(40% 0 20% 0); }
  85% { clip-path: inset(0); text-shadow: -1px 0 #ff0000, 1px 0 #00ff00; }
  100% { text-shadow: 2px 0 #ff0000, -2px 0 #00ff00; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.6; }
  97% { opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.4), 0 0 20px rgba(204, 255, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.6), 0 0 40px rgba(204, 255, 0, 0.3), 0 0 60px rgba(204, 255, 0, 0.1);
  }
}

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

@keyframes loading-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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

@keyframes hum {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  75% { transform: translateX(1px); }
}

.glitch-title {
  animation: glitch 3s infinite, flicker 5s infinite;
  font-family: 'VT323', monospace;
}

.btn-generate {
  animation: pulse-glow 2s ease-in-out infinite;
  transition: all 0.3s ease;
}

.btn-generate:hover {
  box-shadow: 0 0 30px rgba(204, 255, 0, 0.8), 0 0 60px rgba(204, 255, 0, 0.4), 0 0 90px rgba(204, 255, 0, 0.2) !important;
  transform: scale(1.02);
}

.btn-generate:active {
  transform: scale(0.98);
}

.loading-text {
  animation: loading-flicker 1.5s ease-in-out infinite;
}

.result-card {
  animation: fadeIn 0.5s ease-out;
}

.hum-effect {
  animation: hum 0.1s infinite;
}

.history-card {
  transition: all 0.3s ease;
}

.history-card:hover {
  background-color: var(--black-lighter) !important;
}

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

::-webkit-scrollbar-track {
  background: var(--black-deep);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--green-eerie);
}

/* Input styling */
.backrooms-input {
  border: 2px solid var(--yellow-dark);
  border-style: solid;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.1);
  background: #ede4c4;
  font-family: 'Share Tech Mono', monospace;
  transition: all 0.3s ease;
}

.backrooms-input:focus {
  border-color: var(--green-glow);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 10px rgba(204, 255, 0, 0.3);
  outline: none;
}

.backrooms-input::placeholder {
  color: #8a7f5a;
  font-size: 0.85em;
}

/* Terminal window */
.terminal-header {
  background: linear-gradient(180deg, #333 0%, #222 100%);
  border-bottom: 1px solid #444;
}

.terminal-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* Copy notification */
@keyframes copyFlash {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

.copy-flash {
  animation: copyFlash 1.5s ease-out forwards;
}

/* Backrooms image container styles */
.backrooms-image-container {
  animation: fadeIn 0.8s ease-out;
  transition: all 0.3s ease;
}

.backrooms-image-container:hover {
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.15), 0 0 30px rgba(0, 0, 0, 0.5);
}

.backrooms-image-container img {
  transition: filter 0.5s ease;
}

.backrooms-image-container:hover img {
  filter: sepia(0.05) contrast(1.15) brightness(0.95);
}