/* ============================================
   Base & Reset
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a3e;
  --text-primary: #e0e0ff;
  --text-secondary: #8888aa;
  --accent: #ffcc00;
  --accent-glow: rgba(255, 204, 0, 0.3);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --transition-speed: 0.6s;
}

body {
  font-family: 'Courier New', 'Consolas', monospace;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-speed) ease;
}

/* ============================================
   Time-based themes
   ============================================ */
body.theme-morning {
  --bg-primary: #ffecd2;
  --bg-secondary: #fcb69f;
  --text-primary: #4a3728;
  --text-secondary: #7a6558;
  --accent: #e67e22;
  --accent-glow: rgba(230, 126, 34, 0.3);
  --card-bg: rgba(255, 255, 255, 0.3);
  --card-border: rgba(255, 255, 255, 0.5);
}

body.theme-day {
  --bg-primary: #a1c4fd;
  --bg-secondary: #c2e9fb;
  --text-primary: #1a2a3a;
  --text-secondary: #4a5a6a;
  --accent: #2980b9;
  --accent-glow: rgba(41, 128, 185, 0.3);
  --card-bg: rgba(255, 255, 255, 0.4);
  --card-border: rgba(255, 255, 255, 0.6);
}

body.theme-evening {
  --bg-primary: #a18cd1;
  --bg-secondary: #fbc2eb;
  --text-primary: #2d1b4e;
  --text-secondary: #5d4b7e;
  --accent: #e74c3c;
  --accent-glow: rgba(231, 76, 60, 0.3);
  --card-bg: rgba(255, 255, 255, 0.15);
  --card-border: rgba(255, 255, 255, 0.25);
}

body.theme-night {
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a3e;
  --text-primary: #e0e0ff;
  --text-secondary: #8888aa;
  --accent: #ffcc00;
  --accent-glow: rgba(255, 204, 0, 0.3);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Particle Canvas
   ============================================ */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* ============================================
   Greeting Banner
   ============================================ */
.greeting-banner {
  text-align: center;
  padding: 1rem;
  font-size: 1.4rem;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: relative;
  z-index: 10;
}

.greeting-banner.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Main Content
   ============================================ */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 10;
}

/* ============================================
   ASCII Hero
   ============================================ */
.ascii-hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.ascii-art {
  font-size: 0.55rem;
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
  display: inline-block;
  user-select: none;
}

.ascii-art:hover {
  text-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
  transform: scale(1.02);
}

.ascii-art.clicked {
  animation: ascii-pulse 0.4s ease;
}

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

/* ============================================
   Fun Facts
   ============================================ */
.fun-fact-section {
  margin-bottom: 3rem;
}

.fun-fact-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.fun-fact-card p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  min-height: 3.2rem;
}

.fun-fact-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.fun-fact-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.fun-fact-btn:active {
  transform: scale(0.96);
}

/* ============================================
   Demo Section
   ============================================ */
.demo-section {
  margin-bottom: 3rem;
}

.demo-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.demo-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #1b1b1b;
  font-weight: 600;
}

.demo-subtitle {
  color: #4a4a4a;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.demo-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.demo-btn {
  display: inline-block;
  background: #0067b8;
  color: #ffffff;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.1s ease;
  min-width: 180px;
}

.demo-btn:hover {
  background: #005a9e;
  transform: translateY(-1px);
}

.demo-btn:active {
  transform: translateY(0);
}

@media (max-width: 500px) {
  .demo-btn {
    width: 100%;
  }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 2rem 0;
}

.hint {
  opacity: 0.5;
  font-size: 0.75rem;
}

/* ============================================
   Konami Overlay
   ============================================ */
.konami-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
}

.konami-overlay.hidden {
  display: none;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 1;
}

/* ============================================
   Stars (night theme)
   ============================================ */
.star {
  position: fixed;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes twinkle {
  from { opacity: 0.2; }
  to   { opacity: 1; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  .ascii-art {
    font-size: 0.35rem;
  }

  .greeting-banner {
    font-size: 1.1rem;
  }

  .fun-fact-card {
    padding: 1.5rem 1rem;
  }

  main {
    padding: 1.5rem 1rem;
  }
}

@media (min-width: 900px) {
  .ascii-art {
    font-size: 0.7rem;
  }
}
