:root {
  /* Color Variables */
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --accent-blue: #00d4ff;
  --accent-purple: #9d4edd;
  --accent-orange: #ff6b35;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 4rem;
  
  /* Typography */
  --font-primary: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-display: 'JetBrains Mono', monospace;
  
  /* Animations */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.6s ease;
}

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

body {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: var(--font-primary);
  color: var(--text-primary);
  overflow: hidden;
  position: relative;
}

/* Animated background particles */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 23px 17px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 89px 134px, rgba(0, 212, 255, 0.3), transparent),
    radial-gradient(1px 1px at 156px 73px, rgba(157, 78, 221, 0.4), transparent),
    radial-gradient(1px 1px at 67px 188px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 201px 45px, rgba(0, 212, 255, 0.4), transparent),
    radial-gradient(1px 1px at 12px 99px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 178px 156px, rgba(157, 78, 221, 0.3), transparent),
    radial-gradient(2px 2px at 145px 23px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 34px 167px, rgba(0, 212, 255, 0.4), transparent),
    radial-gradient(1px 1px at 123px 89px, rgba(157, 78, 221, 0.4), transparent);
  background-repeat: repeat;
  background-size: 250px 220px, 320px 280px, 400px 350px;
  animation: sparkle 25s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes sparkle {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-200px); }
}

/* Header Text */
.text {
  position: fixed;
  top: var(--space-lg);
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.text h1 {
  font-size: clamp(1rem, 4vw, 2rem);
  font-weight: 300;
  margin-bottom: var(--space-xs);
}

.text span {
  display: block;
  font-size: clamp(1.5rem, 6vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-orange));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Modern Start Button */
.modern-start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--space-md) var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 2px solid var(--glass-border);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 
    0 8px 32px rgba(0, 212, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modern-start-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 12px 40px rgba(0, 212, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: var(--accent-blue);
}

.modern-start-button:active {
  transform: translateY(0) scale(0.98);
}

/* Start Button Container */
#start-rocket {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: none;
  border: none;
  cursor: pointer;
}

#start-rocket img {
  transition: all var(--transition-normal);
}

/* Rocket - verschiedene Animationsstates */
.rocket {
  position: fixed;
  left: 50%;
  z-index: 15;
  transition: all 1s ease-in-out;
}

/* Rocket reset state - no transition for instant disappearing */
.rocket.initial {
  transition: none;
}

/* Initial position - off screen bottom */
.rocket.initial {
  bottom: -200px;
  transform: translateX(-50%);
}

/* Flying in position */
.rocket.flying-in {
  bottom: -30px;
  transform: translateX(-50%);
  animation: rocketFlyIn 2s ease-out;
}

/* Engine ignition position */
.rocket.ignition {
  bottom: -30px;
  transform: translateX(-50%);
  animation: rocketShake 0.5s ease-in-out infinite;
}

/* Flying to center */
.rocket.flying-center {
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 50%);
  animation: rocketFlyCenter 1.5s ease-in-out;
}

/* Explosion state - rocket disappears */
.rocket.exploded {
  opacity: 0;
  transform: translate(-50%, 50%) scale(0);
  transition: opacity 0.1s ease;
}

.rocket.returning-under-quote {
  bottom: 25%;
  left: 50%;
  opacity: 1;
  transform: translateX(-50%) scale(0.8);
  animation: rocketReturnFromBehind 1.5s ease-out;
}

/* Rocket hovering above quote - final position */
.rocket.hovering-above-quote {
  bottom: 25%;
  left: 50%;
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
  animation: rocketFadeInAndHover 2s ease-in-out forwards, rocketHover 3s ease-in-out infinite 2s;
}

/* Lottie Rocket Animation */
.rocket-lottie {
  width: 200px;
  height: 200px;
  transition: all var(--transition-normal);
}

.rocket img {
  width: auto;
  height: 120px;
  filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.6));
  transition: all var(--transition-normal);
}

/* Rocket animations */
@keyframes rocketFlyIn {
  0% {
    bottom: -200px;
    transform: translateX(-50%) rotate(-5deg);
  }
  100% {
    bottom: -30px;
    transform: translateX(-50%) rotate(0deg);
  }
}

@keyframes rocketShake {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  25% { transform: translateX(-50%) translateY(-2px); }
  75% { transform: translateX(-50%) translateY(2px); }
}

@keyframes rocketFlyCenter {
  0% {
    bottom: -30px;
    transform: translateX(-50%) rotate(0deg);
  }
  50% {
    transform: translateX(-50%) rotate(var(--random-rotation, -10deg)) scale(var(--random-scale, 1.1));
  }
  100% {
    bottom: 50%;
    transform: translate(-50%, 50%) rotate(calc(var(--random-rotation, 0deg) * 0.5)) scale(var(--random-scale, 1.2));
  }
}

@keyframes rocketReturnFromBehind {
  0% {
    opacity: 1;
    bottom: 50%;
    transform: translateX(-50%) scale(0.8);
    z-index: 30;
  }
  50% {
    bottom: 35%;
    transform: translateX(-50%) scale(0.8);
  }
  100% {
    opacity: 1;
    bottom: 25%;
    transform: translateX(-50%) scale(0.8);
  }
}

@keyframes rocketFadeInAndHover {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(0.8);
  }
}

@keyframes rocketHover {
  0%, 100% {
    transform: translateX(-50%) scale(0.8) translateY(0px);
  }
  50% {
    transform: translateX(-50%) scale(0.85) translateY(-5px);
  }
}

/* Clouds positioned left and right */
.cloud-large {
  position: fixed;
  bottom: 0;
  left: -10%;
  z-index: 5;
}

.cloud {
  position: fixed;
  bottom: 0;
  right: -10%;
  z-index: 5;
}

.cloud-large img {
  width: min(60vw, 600px);
  opacity: 0.8;
  animation: floatCloudLeft 4s ease-in-out infinite;
}

.cloud img {
  width: min(50vw, 400px);
  opacity: 0.6;
  animation: floatCloudRight 3s ease-in-out infinite reverse;
}

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

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

/* Quote Section - Initially hidden, appears in center */
.quote {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 600px);
  text-align: center;
  z-index: 25;
  opacity: 0;
  visibility: hidden;
  transform-origin: center;
  transition: all 0.8s ease;
}

.quote.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Animation for quote appearance */
.quote {
  transform: translate(-50%, -50%) scale(0.8);
}

.quote.visible {
  animation: quoteAppear 0.8s ease-out;
}

@keyframes quoteAppear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.quote blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  line-height: 1.4;
  padding: var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-sm);
  position: relative;
}

.quote blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 3rem;
  color: var(--accent-blue);
  font-family: serif;
}

.quote blockquote::after {
  content: '"';
  position: absolute;
  bottom: -20px;
  right: 20px;
  font-size: 3rem;
  color: var(--accent-blue);
  font-family: serif;
}

.stats {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}

/* Action Buttons */
#addQuote, #backToTop {
  position: fixed;
  width: 50px;
  height: 50px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 30;
}


#addQuote:hover, #backToTop:hover {
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
  border-color: var(--accent-blue);
  transform: scale(1.1);
}

#addQuote {
  top: 60%;
  left: calc(50% - 120px);
}

#addQuote:hover {
  transform: translateX(0) scale(1.1);
}

#backToTop {
  top: 60%;
  right: calc(50% - 120px);
}

#backToTop:hover {
  transform: translateX(0) scale(1.1);
}

/* Stars */
.star {
  position: fixed;
  z-index: 1;
  animation: twinkle 2s infinite alternate;
}

.star img {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.star-top-left { top: 10vh; left: 10vw; }
.star-top-right { top: 15vh; right: 15vw; animation-delay: 0.5s; }
.star-bottom-left { bottom: 20vh; left: 20vw; animation-delay: 1s; }
.star-bottom-right { bottom: 25vh; right: 10vw; animation-delay: 1.5s; }

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

/* Footer */
.footer {
  position: fixed;
  bottom: var(--space-xs);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--accent-blue);
}

/* Konami Code Special Effects */
.konami-activated {
  animation: konamiGlow 1s ease-in-out;
}

.konami-activated .text span {
  animation: konamiRainbow 0.5s linear infinite;
}

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

@keyframes konamiRainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes konamiSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.5); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Shake animations (keeping from original) */
.shake {
  animation-duration: 100ms;
  animation-fill-mode: both;
}

.shake.shake-constant {
  animation-iteration-count: infinite;
}

.shake-little {
  animation-name: shake-little;
}

.shake-slow {
  animation-name: shake-slow;
  animation-duration: 3s;
}

.shake-hard {
  animation-name: shake-hard;
}

.shake-crazy {
  animation-name: shake-crazy;
  animation-duration: 50ms;
}

@keyframes shake-little {
  2%, 24%, 46%, 68%, 90% { transform: translate3d(-1px, 0, 0); }
  4%, 26%, 48%, 70%, 92% { transform: translate3d(1px, 0, 0); }
  6%, 28%, 50%, 72%, 94% { transform: translate3d(-1px, 0, 0); }
}

@keyframes shake-slow {
  2%, 24%, 46%, 68%, 90% { transform: translate3d(-4px, 0, 0); }
  4%, 26%, 48%, 70%, 92% { transform: translate3d(4px, 0, 0); }
}

@keyframes shake-hard {
  2%, 24%, 46%, 68%, 90% { transform: translate3d(-8px, 0, 0); }
  4%, 26%, 48%, 70%, 92% { transform: translate3d(8px, 0, 0); }
}

@keyframes shake-crazy {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --space-sm: 0.75rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 2.5rem;
  }
  
  .text {
    top: var(--space-md);
  }
  
  .rocket img {
    height: 80px;
  }
  
  .quote {
    width: 95vw;
  }
  
  .quote blockquote {
    font-size: 1rem;
    padding: var(--space-sm);
  }
  
  #addQuote, #backToTop {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .text h1 {
    font-size: 0.9rem;
  }
  
  .text span {
    font-size: 1.8rem;
  }
  
  .modern-start-button {
    padding: var(--space-xs) var(--space-sm);
    font-size: 1rem;
  }
}

/* Countdown Display */
.countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  font-family: var(--font-display);
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 900;
  color: var(--text-primary);
  text-shadow: 
    0 0 40px rgba(0, 212, 255, 0.8),
    0 0 80px rgba(0, 212, 255, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.countdown.visible {
  opacity: 1;
  visibility: visible;
  animation: countdownPulse 1s ease-in-out;
}

.countdown.go {
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-orange));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: countdownGO 1s ease-in-out, gradientShift 0.5s ease-in-out infinite;
}

@keyframes countdownPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes countdownGO {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
  }
  100% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
}

/* Canvas for fireworks */
#firework {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 16;
}

/* Modern Quote Form Panel */
.quote-form-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(500px, 90vw);
  height: 100vh;
  background: linear-gradient(135deg, 
    rgba(13, 27, 42, 0.98) 0%,
    rgba(27, 38, 59, 0.95) 100%);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.quote-form-panel.active {
  right: 0;
}

.form-panel-content {
  padding: var(--space-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.form-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.close-panel {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.close-panel:hover {
  color: var(--accent-blue);
  background: rgba(0, 212, 255, 0.1);
  transform: scale(1.1);
}

.modern-quote-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: var(--space-md);
  color: white;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  transition: all var(--transition-normal);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.char-counter {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--space-xs);
}

.char-counter.warning {
  color: var(--accent-yellow);
}

.char-counter.warning .current {
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: auto;
}

.btn {
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  justify-content: center;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0099cc 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.loading {
  background: var(--accent-yellow);
  color: var(--bg-primary);
}

.btn-primary.success {
  background: var(--accent-green);
}

.btn-primary.error {
  background: #ff4444;
}

.form-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hint {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  font-style: italic;
}

.hint i {
  color: var(--accent-yellow);
}

/* Body class when form panel is open */
body.form-panel-open {
  overflow: hidden;
}

/* Mobile responsiveness for form panel */
@media (max-width: 768px) {
  .quote-form-panel {
    width: 100vw;
    right: -100vw;
  }
  
  .form-panel-content {
    padding: var(--space-md);
  }
  
  .form-header h3 {
    font-size: 1.2rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    padding: var(--space-md);
  }
}

.rocket.mini-game-mode {
  transition: none !important;
}

.rocket.mini-game-mode .rocket-lottie {
  transition: transform 0.1s ease-out;
  transform-origin: center center;
}
