/* ============================================================
   BAGOSH – Main Stylesheet
   Theme: Desaturated dark crimson with green command accents
   Aesthetic: Retro pixel-art RPG manual
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg:          #1a1210;
  --bg-section:  #1f1614;
  --bg-card:     #261a17;
  --bg-card-alt: #2c1f1b;
  --border:      #4a2e28;
  --border-light:#5a3830;

  --red:         #7a3028;
  --red-mid:     #9c3c30;
  --red-bright:  #c04838;
  --red-glow:    #e05840;

  --green:       #4a8a40;
  --green-bright:#6ab858;
  --green-glow:  #8fd870;

  --gold:        #b8923a;
  --gold-bright: #d4aa50;

  --text:        #d4c4b8;
  --text-dim:    #8a7068;
  --text-muted:  #5a4840;
  --text-bright: #f0e0d0;

  --font-pixel:  'Press Start 2P', monospace;
  --font-mono:   'Share Tech Mono', monospace;
  --font-body:   'Libre Baskerville', Georgia, serif;

  --px: 2px;  /* pixel border unit */
}

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

html { scroll-behavior: smooth; }

body {

  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  /* Subtle scanline texture */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.08) 2px,
      rgba(0,0,0,0.08) 4px
    );
}

/* ── Pixel border mixin (box-shadow trick) ───────────────── */
.pixel-box {
  box-shadow:
    0 0 0 var(--px) var(--border),
    0 0 0 calc(var(--px)*2) var(--bg),
    0 0 0 calc(var(--px)*3) var(--border-light);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--red-bright); }

/* ── Navigation ──────────────────────────────────────────── */
#topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #110d0c;
  border-bottom: 3px solid var(--red);
  box-shadow: 0 2px 0 var(--red-mid), 0 0 20px rgba(192,72,56,0.3);
box-shadow: 0 6px 8px rgba(0,0,0,0.8), 0 2px 3px rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 52px;
}

.nav-logo {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--red-glow);
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px var(--red-bright);
  white-space: nowrap;
  padding: 0.5rem 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.15s, background 0.15s;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.nav-links a:first-child { border-left: 1px solid var(--border); }
.nav-links a:hover,
.nav-links a:focus { color: var(--red-glow); background: rgba(192,72,56,0.1); }

/* Language switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}
.lang-switch a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.lang-switch a:hover,
.lang-switch a.active {
  color: var(--green-bright);
  border-color: var(--green);
  background: rgba(74,138,64,0.12);
}

/* ── Hero Section ────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 3rem 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(122,48,40,0.18) 0%, transparent 70%),
    var(--bg);
}

/* Pixel-grid overlay */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74,46,40,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,46,40,0.15) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-screenshot {
}

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--red-glow);
  text-shadow:
    4px 4px 0 var(--red),
    0 0 30px rgba(224,88,64,0.5),
    0 0 60px rgba(224,88,64,0.2);
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero-story {
  max-width: 640px;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}
.hero-story strong { color: var(--red-glow); }

.hero-question {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold-bright);
  margin-bottom: 2.5rem;
}

.btn-download {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  padding: 0.9rem 2rem;
  background: var(--red);
  color: var(--text-bright);
  text-decoration: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow:
    4px 4px 0 var(--red-mid),
    0 0 20px rgba(192,72,56,0.3);
  position: relative;
}
.btn-download:hover {
  background: var(--red-bright);
  box-shadow: 6px 6px 0 var(--red-mid), 0 0 30px rgba(224,88,64,0.5);
  transform: translate(-1px, -1px);
}
.btn-download:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--red-mid); }

/* ── Section commons ─────────────────────────────────────── */
.section {
  padding: 4rem 1.5rem;
  border-top: 2px solid var(--border);
}
.section:nth-child(even) { background: var(--bg-section); }

.container { max-width: 1000px; margin: 0 auto; }

.section-header {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  color: var(--red-glow);
  text-shadow: 2px 2px 0 var(--red), 0 0 15px rgba(224,88,64,0.3);
  letter-spacing: 0.1em;
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* Pixel-style section divider */
.section-rule {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--border) 60%, transparent 100%);
  margin: 0.6rem 0 2rem;
}

/* ── Overview / Presentation ─────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 680px;) { .overview-grid { grid-template-columns: 1fr; } }

.overview-screenshot {
  width: auto;
  border: 2px solid var(--red);
  box-shadow: 4px 4px 0 var(--red-mid), 0 0 20px rgba(192,72,56,0.2);
  image-rendering: pixelated;
}

.overview-text p {
  margin-bottom: 1.2rem;
  color: var(--text);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0;
}
.feature-list li {
  padding: 0.45rem 0 0.45rem 1.6rem;
  position: relative;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.feature-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--red-bright);
}

/* ── Characters ──────────────────────────────────────────── */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.char-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  padding: 1.5rem 1.2rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.char-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--red-mid);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.char-card:hover { border-color: var(--red-bright); box-shadow: 0 0 20px rgba(192,72,56,0.2); }
.char-card:hover::after { transform: scaleX(1); }

.char-sprite {
  image-rendering: pixelated;
  width: 120px;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 0 6px rgba(224,88,64,0.4));
}

.char-name {
  font-family: var(--font-pixel);
  font-size: 1.00rem;
  color: var(--red-glow);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.char-desc {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Levels ──────────────────────────────────────────────── */
.level-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.level-item {
	
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  padding: 1rem 1.5rem 1rem 1rem;
  transition: border-left-color 0.2s;
}
.level-item:hover { border-left-color: var(--red-glow); }

@media (max-width: 600px) {
  .level-item { grid-template-columns: 1fr; }
}

.level-screenshot {
  width: auto;
  max-width: 640px;
  image-rendering: pixelated;
  border: 1px solid var(--border);
}

.level-name {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--gold-bright);
  margin-bottom: 0.4rem;
  letter-spacing: 0.08em;
}

.level-desc {
  font-family: var(--font-mono);	font-size: 0.8rem; color: var(--text); }

/* ── Monsters ────────────────────────────────────────────── */
.monster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.monster-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}
.monster-card:hover {
  border-color: var(--red-mid);
  background: var(--bg-card);
}

.monster-sprite {
  image-rendering: pixelated;
  width: 90px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(224,88,64,0.3));
}

.monster-info {}
.monster-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--red-bright);
  font-weight: bold;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.monster-desc { font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; var(--font-mono); }

/* ── Help / Controls ─────────────────────────────────────── */
.controls-block {
  margin-bottom: 2rem;
}

.controls-heading {

  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--gold-bright);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.controls-screenshot-wrap {
  display: inline-block;
  position: relative;
  border-right: 3px solid var(--red-mid);
  padding-right: 20px;
}

.controls-screenshot-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: -12px;
  width: 12px;
  height: 100%;
  background: linear-gradient(90deg, rgba(156,60,48,0.5), transparent);
  pointer-events: none;
}

.controls-screenshot {
  width: auto;
  image-rendering: pixelated;
  display: block;
  filter: none;
}

.screenshot-legend-wrap {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin: 1.5rem 0 2rem;
  flex-wrap: wrap;
}

.screenshot-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: legend;
}

.screenshot-legend li {
  counter-increment: legend;
  padding: 0.2rem 0 0.2rem 2rem;
  position: relative;
  color: var(--text);
  border-bottom: 1px solid rgba(74,46,40,0.25);
  font-size: 0.9rem;
  line-height: 1.6;
left: -0.5rem;
}

.screenshot-legend li::before {
  content: counter(legend) ")";
  position: absolute;
  left: 0rem;
    color: #4d8c7a;
  font-family: var(--font-mono);
  font-size: 0.8rem;

}

.controls-table {
  width: 100%;
  border-collapse: collapse;
}
.controls-table tr {
  border-bottom: 1px solid var(--border);
}
.controls-table tr:last-child { border-bottom: none; }

.controls-table td {
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  vertical-align: top;
}

.controls-table td:first-child {
  width: 220px;
  white-space: nowrap;
}

.controls-table .joystick-row td:first-child::after {
  content: ' ✦';
  color: var(--green-bright);
  font-size: 0.7rem;
}

kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 0.15em 0.45em;
  background: #0e0a09;
  color: var(--green-bright);
  border: 1px solid var(--green);
  box-shadow:
    1px 1px 0 var(--green),
    inset 0 1px 0 rgba(106,184,88,0.15);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.controls-note {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--border-light);
  background: rgba(0,0,0,0.2);
}
.controls-note .green { color: var(--green-bright); }
.controls-note .warn { color: var(--gold); }

.help-intro {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

/* ── Download ────────────────────────────────────────────── */
#download {
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(122,48,40,0.12) 0%, transparent 70%),
    var(--bg-section);
}

.download-box {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 2px solid var(--red);
  box-shadow:
    0 0 0 1px var(--bg),
    0 0 0 3px var(--border-light),
    0 0 40px rgba(192,72,56,0.15);
  padding: 2.5rem;
  text-align: center;
}

.download-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  text-align: left;
}
.download-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
.download-table td:first-child {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  width: 40%;
}
.download-table td:last-child { color: var(--text-bright); }

.download-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 1rem;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 2px solid var(--border);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: #110d0c;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.footer-lang a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.footer-lang a:hover,
.footer-lang a.active {
  color: var(--green-bright);
  border-color: var(--green);
  background: rgba(74,138,64,0.1);
}

/* ── Anchor offset (sticky nav) ──────────────────────────── */
.anchor-offset {
  display: block;
  height: 60px;
  margin-top: -60px;
  visibility: hidden;
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  #topnav { padding: 0 0.75rem; }
  .nav-links a { padding: 0.5rem 0.5rem; font-size: 0.65rem; }
  .section { padding: 2.5rem 1rem; }
  .download-box { padding: 1.5rem; }
}

/* ── Fade-in animation ───────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease forwards; opacity: 0; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.45s; }
