/* ==========================================================================
   MYSTORYFORGE.GAMES — RETRO CRT TERMINAL STYLESHEET
   ========================================================================== */

/* --- THEME PALETTES (CSS VARIABLES) --- */
:root {
  --font-mono: "Fira Code", "Courier New", "Lucida Console", "Liberation Mono", monospace;
  
  /* Default: Matrix / VT100 Phosphor Green */
  --color-primary: #33ff33;
  --color-primary-dim: #1e991e;
  --color-glow: rgba(51, 255, 51, 0.4);
  --color-glow-strong: rgba(51, 255, 51, 0.7);
  --color-bg: #070c08;
  --color-bg-alt: #0a140c;
  --color-surface: #0f1c12;
  --color-border: #1a3320;
  --color-border-bright: #33ff33;
  --color-text-dim: #70b370;
  --color-accent: #ffea00;
  --color-danger: #ff3344;
}

[data-theme="amber"] {
  --color-primary: #ffb000;
  --color-primary-dim: #996a00;
  --color-glow: rgba(255, 176, 0, 0.4);
  --color-glow-strong: rgba(255, 176, 0, 0.7);
  --color-bg: #0c0905;
  --color-bg-alt: #140f08;
  --color-surface: #1d160c;
  --color-border: #3b2c18;
  --color-border-bright: #ffb000;
  --color-text-dim: #b38b4d;
  --color-accent: #00ffcc;
  --color-danger: #ff2255;
}

[data-theme="cyan"] {
  --color-primary: #00f0ff;
  --color-primary-dim: #008f99;
  --color-glow: rgba(0, 240, 255, 0.4);
  --color-glow-strong: rgba(0, 240, 255, 0.7);
  --color-bg: #050b0e;
  --color-bg-alt: #081217;
  --color-surface: #0c1c24;
  --color-border: #163645;
  --color-border-bright: #00f0ff;
  --color-text-dim: #66b3cc;
  --color-accent: #ff0077;
  --color-danger: #ff2255;
}

[data-theme="red"] {
  --color-primary: #ff3366;
  --color-primary-dim: #991f3d;
  --color-glow: rgba(255, 51, 102, 0.4);
  --color-glow-strong: rgba(255, 51, 102, 0.7);
  --color-bg: #0e0508;
  --color-bg-alt: #17080d;
  --color-surface: #240c14;
  --color-border: #451624;
  --color-border-bright: #ff3366;
  --color-text-dim: #cc6680;
  --color-accent: #00ffea;
  --color-danger: #ff1100;
}

/* --- BASE & RESET --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--color-bg);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--color-bg);
  text-shadow: 0 0 4px var(--color-glow);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- CRT MONITOR OVERLAYS (SCANLINES & VIGNETTE) --- */
.crt-scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%,
    rgba(0, 0, 0, 0.28) 50%
  );
  background-size: 100% 4px;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.85;
}

.crt-scanlines.hidden {
  display: none;
}

.crt-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85), inset 0 0 200px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  pointer-events: none;
}

/* --- HEADER BAR --- */
.retro-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 12, 8, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-primary);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.brand-text {
  font-size: 1.1rem;
}

.brand-text .tld {
  color: var(--color-text-dim);
}

.version-badge {
  font-size: 0.7rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  color: var(--color-text-dim);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  border-bottom-color: var(--color-primary);
  text-shadow: 0 0 8px var(--color-glow-strong);
}

.github-btn {
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-surface);
}

.github-btn:hover {
  background: var(--color-border);
  border-color: var(--color-primary);
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.retro-btn-icon {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.retro-btn-icon:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-glow);
}

.theme-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.45rem;
  border-radius: 3px;
}

.theme-pill {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.theme-pill:hover {
  transform: scale(1.2);
}

.theme-pill.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}

.theme-pill-green { background: #33ff33; }
.theme-pill-amber { background: #ffb000; }
.theme-pill-cyan { background: #00f0ff; }
.theme-pill-red { background: #ff3366; }

/* --- PAGE CONTENT CONTAINER --- */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem 1.5rem;
}

/* --- HERO SECTION --- */
.hero-section {
  text-align: center;
  margin-bottom: 5rem;
}

.hero-ascii-banner {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.ascii-art {
  display: inline-block;
  font-size: clamp(0.45rem, 1.2vw, 0.85rem);
  line-height: 1.1;
  color: var(--color-primary);
  text-shadow: 0 0 10px var(--color-glow-strong);
}

.hero-badge-tagline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.tagline-chip {
  font-size: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  color: var(--color-text-dim);
}

.hero-title {
  font-size: clamp(1.6rem, 3.8vw, 2.7rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  text-shadow: 0 0 15px var(--color-glow-strong);
}

.hero-description {
  max-width: 780px;
  margin: 0 auto 2.5rem auto;
  font-size: 1.05rem;
  color: var(--color-text-dim);
}

.hero-description strong {
  color: var(--color-primary);
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

/* --- RETRO BUTTONS --- */
.retro-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  border: 2px solid var(--color-primary);
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  position: relative;
}

.retro-btn-primary {
  background: var(--color-primary);
  color: var(--color-bg);
  box-shadow: 0 0 20px var(--color-glow);
}

.retro-btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

.retro-btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
}

.retro-btn-secondary:hover {
  background: var(--color-border);
  box-shadow: 0 0 15px var(--color-glow);
  transform: translateY(-2px);
}

.retro-btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-dim);
}

.retro-btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-glow);
}

.full-width {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}

/* --- TERMINAL LIVE SANDBOX --- */
.terminal-sandbox-wrapper {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.terminal-frame {
  background: #020503;
  border: 2px solid var(--color-border-bright);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px var(--color-glow);
  overflow: hidden;
}

.terminal-titlebar {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-controls {
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  letter-spacing: 0.5px;
}

.terminal-badge {
  font-size: 0.65rem;
  background: var(--color-primary);
  color: var(--color-bg);
  padding: 0.1rem 0.4rem;
  font-weight: 700;
  border-radius: 2px;
}

.terminal-screen {
  padding: 1.25rem;
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

.term-line {
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-banner {
  color: var(--color-text-dim);
}

.term-prompt-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.prompt-prefix {
  color: var(--color-primary);
  font-weight: 700;
  user-select: none;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  caret-color: var(--color-primary);
}

.terminal-shortcuts {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sc-label {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  font-weight: 700;
}

.chip-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: var(--color-primary);
  color: var(--color-bg);
  box-shadow: 0 0 10px var(--color-glow);
}

/* --- SECTIONS SHARED STYLES --- */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.section-subtitle {
  color: var(--color-text-dim);
  font-size: 0.95rem;
}

/* --- FEATURES GRID --- */
.features-section {
  margin-bottom: 5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1.75rem;
  border-radius: 4px;
  position: relative;
  transition: all 0.25s ease;
}

.feature-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--color-glow);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-text {
  color: var(--color-text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.feature-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-accent);
  background: rgba(255, 234, 0, 0.08);
  border: 1px solid rgba(255, 234, 0, 0.25);
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

/* --- STORIES SECTION --- */
.stories-section {
  margin-bottom: 5rem;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2rem;
}

.story-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  padding: 2rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.story-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px var(--color-glow);
  transform: translateY(-4px);
}

.story-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.story-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  background: rgba(51, 255, 51, 0.12);
  border: 1px solid var(--color-primary);
  border-radius: 2px;
}

.cyberpunk-badge {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--color-primary);
}

.story-duration {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.story-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.story-author {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-bottom: 1rem;
}

.story-desc {
  font-size: 0.92rem;
  color: var(--color-text-dim);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.story-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font-size: 0.7rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  color: var(--color-text-dim);
}

/* --- DOWNLOADS SECTION --- */
.download-section {
  margin-bottom: 3rem;
}

.download-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.os-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1.75rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.os-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.web-card {
  border-color: var(--color-border-bright);
}

.os-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.os-icon {
  font-size: 1.5rem;
}

.os-name {
  font-size: 1.15rem;
  font-weight: 700;
  flex: 1;
}

.os-tag {
  font-size: 0.65rem;
  color: var(--color-text-dim);
  border: 1px solid var(--color-border);
  padding: 0.1rem 0.35rem;
}

.os-desc {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-bottom: 1rem;
}

.code-box {
  background: #020503;
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}

.code-box code {
  color: #ffffff;
  word-break: break-all;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-primary);
  padding: 0.2rem;
  transition: transform 0.1s ease;
}

.copy-btn:hover {
  transform: scale(1.2);
}

.os-note {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

/* --- FOOTER --- */
.retro-footer {
  border-top: 2px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 2.5rem 1.5rem;
  font-size: 0.85rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-copy {
  color: var(--color-text-dim);
  font-size: 0.8rem;
  max-width: 600px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-link {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.sep {
  color: var(--color-border);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-links {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .hero-cta-group {
    flex-direction: column;
  }
  
  .retro-btn {
    width: 100%;
    justify-content: center;
  }
}

