:root {
  --bg: #05040b;
  --bg-alt: #0b0820;
  --neon-cyan: #45f9ff;
  --neon-magenta: #ff3df0;
  --neon-purple: #8b5bff;
  --neon-green: #39ff14;
  --text: #f1f1ff;
  --muted: #b8b3d9;
  --glow: 0 0 12px rgba(69, 249, 255, 0.4), 0 0 28px rgba(255, 61, 240, 0.25);

  /* VHS/Terminal fonts */
  --font-vhs: 'VT323', monospace;
  --font-terminal: 'IBM Plex Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace;
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-terminal);
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* WebGL canvas - main background layer */
#glCanvas,
#fallbackCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hidden {
  display: none;
}

/* Overlay effects */
.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Extra vignette to ensure text readability over shader */
.vignette-extra {
  background: radial-gradient(
    circle at center,
    transparent 25%,
    rgba(3, 2, 8, 0.35) 60%,
    rgba(3, 2, 8, 0.7) 100%
  );
}

/* ==================== RETRO UI ELEMENTS ==================== */

/* Corner borders (90s style) */
.retro-border {
  position: fixed;
  width: 80px;
  height: 80px;
  border: 2px solid rgba(69, 249, 255, 0.4);
  z-index: 2;
  pointer-events: none;
}

.retro-border.top-left {
  top: 20px;
  left: 20px;
  border-right: none;
  border-bottom: none;
}

.retro-border.top-right {
  top: 20px;
  right: 20px;
  border-left: none;
  border-bottom: none;
}

.retro-border.bottom-left {
  bottom: 20px;
  left: 20px;
  border-right: none;
  border-top: none;
}

.retro-border.bottom-right {
  bottom: 20px;
  right: 20px;
  border-left: none;
  border-top: none;
}

/* Status bar (VHS recording style) */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 20px;
  background: rgba(5, 4, 11, 0.85);
  border-bottom: 2px solid rgba(69, 249, 255, 0.3);
  font-family: var(--font-vhs);
  font-size: 1.2rem;
  letter-spacing: 0.1rem;
  display: flex;
  justify-content: space-between;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.status-item {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(69, 249, 255, 0.6);
}

.status-online {
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.8);
}

.blink {
  animation: blink-anim 1.5s infinite;
  color: #ff0000;
}

@keyframes blink-anim {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0.3;
  }
}

/* Main content container */
.content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
  padding: 80px 32px 32px;
  max-width: 800px;
}

.title-wrap {
  display: grid;
  gap: 20px;
}

/* VHS-style title */
.vhs-title {
  position: relative;
  font-family: var(--font-vhs);
  font-size: clamp(4rem, 12vw, 8rem);
  letter-spacing: 0.3rem;
  text-transform: uppercase;
  color: var(--text);
  text-shadow:
    3px 3px 0 var(--neon-cyan),
    -2px -2px 0 var(--neon-magenta),
    0 0 20px rgba(69, 249, 255, 0.4);
  font-weight: 400;
  line-height: 0.9;
  animation: vhs-flicker 3s infinite;
}

@keyframes vhs-flicker {
  0%, 100% {
    text-shadow:
      3px 3px 0 var(--neon-cyan),
      -2px -2px 0 var(--neon-magenta),
      0 0 20px rgba(69, 249, 255, 0.4);
  }
  25% {
    text-shadow:
      2px 3px 0 var(--neon-cyan),
      -3px -2px 0 var(--neon-magenta),
      0 0 25px rgba(69, 249, 255, 0.5);
  }
  50% {
    text-shadow:
      4px 2px 0 var(--neon-cyan),
      -2px -3px 0 var(--neon-magenta),
      0 0 15px rgba(69, 249, 255, 0.3);
  }
  75% {
    text-shadow:
      3px 4px 0 var(--neon-cyan),
      -3px -2px 0 var(--neon-magenta),
      0 0 22px rgba(69, 249, 255, 0.45);
  }
}

/* Terminal-style subtitle container */
.terminal-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(5, 4, 11, 0.75);
  border: 2px solid rgba(57, 255, 20, 0.4);
  border-radius: 0;
  font-family: var(--font-terminal);
  box-shadow:
    inset 0 0 20px rgba(57, 255, 20, 0.1),
    0 0 15px rgba(57, 255, 20, 0.2);
}

.terminal-prompt {
  color: var(--neon-green);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

.terminal-text {
  color: var(--neon-green);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
  min-height: 1.5rem;
}

.terminal-cursor {
  color: var(--neon-green);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  animation: cursor-blink 1s step-end infinite;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

@keyframes cursor-blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Retro Discord button */
.retro-button {
  position: relative;
  text-decoration: none;
  color: var(--text);
  padding: 16px 32px;
  border: 3px solid var(--neon-cyan);
  border-radius: 0;
  background: linear-gradient(
    135deg,
    rgba(5, 4, 11, 0.9) 0%,
    rgba(69, 249, 255, 0.15) 50%,
    rgba(5, 4, 11, 0.9) 100%
  );
  font-family: var(--font-vhs);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  letter-spacing: 0.2rem;
  font-weight: 400;
  transition: all 0.2s ease;
  box-shadow:
    0 0 20px rgba(69, 249, 255, 0.4),
    inset 0 0 20px rgba(69, 249, 255, 0.1);
  text-transform: uppercase;
}

.button-brackets {
  color: var(--neon-magenta);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 61, 240, 0.8);
}

.button-text {
  padding: 0 8px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(69, 249, 255, 0.8);
}

.retro-button:hover {
  transform: translateY(-3px);
  border-color: var(--neon-magenta);
  box-shadow:
    0 0 30px rgba(255, 61, 240, 0.6),
    inset 0 0 30px rgba(255, 61, 240, 0.2);
  background: linear-gradient(
    135deg,
    rgba(5, 4, 11, 0.9) 0%,
    rgba(255, 61, 240, 0.2) 50%,
    rgba(5, 4, 11, 0.9) 100%
  );
}

.retro-button:hover .button-text {
  color: var(--neon-magenta);
  text-shadow: 0 0 15px rgba(255, 61, 240, 1);
}

.retro-button:active {
  transform: translateY(-1px);
}

/* Retro panel for messages */
.retro-panel {
  width: 100%;
  max-width: 500px;
  border: 2px solid rgba(139, 91, 255, 0.5);
  background: rgba(5, 4, 11, 0.85);
  box-shadow:
    0 0 20px rgba(139, 91, 255, 0.3),
    inset 0 0 30px rgba(139, 91, 255, 0.1);
  backdrop-filter: blur(8px);
}

.panel-header {
  padding: 10px 16px;
  background: rgba(139, 91, 255, 0.2);
  border-bottom: 2px solid rgba(139, 91, 255, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-terminal);
}

.panel-title {
  color: var(--neon-purple);
  font-size: 0.85rem;
  letter-spacing: 0.1rem;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(139, 91, 255, 0.6);
}

.panel-decoration {
  color: rgba(139, 91, 255, 0.4);
  font-size: 0.75rem;
}

.message-content {
  padding: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-family: var(--font-terminal);
}

.message-prompt {
  color: var(--neon-purple);
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(139, 91, 255, 0.8);
}

#message-text {
  color: var(--neon-cyan);
  font-size: 0.95rem;
  line-height: 1.5;
  text-shadow: 0 0 8px rgba(69, 249, 255, 0.5);
  flex: 1;
}

/* Visitor counter (90s webring style) */
.visitor-counter {
  margin-top: 8px;
  padding: 8px 20px;
  border: 2px solid rgba(69, 249, 255, 0.3);
  background: rgba(5, 4, 11, 0.8);
  font-family: var(--font-vhs);
  font-size: 1.1rem;
  letter-spacing: 0.15rem;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 0 15px rgba(69, 249, 255, 0.2);
}

.counter-label {
  color: var(--muted);
}

.counter-number {
  color: var(--neon-green);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
  font-family: 'Courier New', monospace;
  background: rgba(57, 255, 20, 0.1);
  padding: 2px 8px;
  border: 1px solid rgba(57, 255, 20, 0.3);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .retro-border {
    width: 50px;
    height: 50px;
  }

  .status-bar {
    font-size: 1rem;
    padding: 6px 12px;
  }

  .content {
    padding: 60px 20px 20px;
    gap: 24px;
  }

  .vhs-title {
    letter-spacing: 0.2rem;
  }

  .terminal-container {
    padding: 10px 14px;
    gap: 6px;
  }

  .retro-button {
    padding: 14px 24px;
    font-size: 1.2rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .panel-decoration {
    display: none;
  }

  .visitor-counter {
    font-size: 0.9rem;
    padding: 6px 14px;
  }
}

@media (max-width: 480px) {
  .retro-border {
    display: none;
  }

  .status-bar {
    font-size: 0.85rem;
  }

  .status-item:last-child {
    margin-left: auto;
  }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .terminal-cursor {
    animation: none;
    opacity: 1;
  }

  .blink {
    animation: none;
    opacity: 1;
  }
}
