:root {
  --bg: #14110c;
  --panel: #211b12;
  --edge: #3a2f1f;
  --gold: #c8a24a;
  --text: #e8ddc7;
  --muted: #a8987a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  border-bottom: 1px solid var(--edge);
}

header h1 {
  margin: 0;
  font-size: 2.4rem;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.subtitle { color: var(--muted); margin-top: 0.5rem; }

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.hero p { font-size: 1.1rem; }

.downloads h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.card-head h3 { margin: 0; font-size: 1.3rem; }

.count { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }

.platform-note { color: var(--muted); margin: 0.3rem 0 1rem; font-size: 0.95rem; }

.btn {
  display: inline-block;
  background: linear-gradient(180deg, #d9b45c, #a67f2e);
  color: #201a10;
  text-decoration: none;
  font-weight: bold;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  border: 1px solid #7c5f20;
}

.btn:hover { filter: brightness(1.08); }

.stats {
  text-align: center;
  margin-top: 2.5rem;
  color: var(--muted);
}

.stats strong { color: var(--gold); }

.updated { font-size: 0.85rem; }

.donate {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
  text-align: center;
}

.donate h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
  text-align: left;
}

.donate-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}

.btn-donate { min-width: 120px; }

.donate .eth {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  word-break: break-all;
}

.donate .eth code {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  color: var(--text);
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem 3rem;
  border-top: 1px solid var(--edge);
  margin-top: 2rem;
}

/* ---- Screenshot carousel ---- */
.screenshots {
  margin: 2rem 0 2.5rem;
}

.carousel {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid var(--edge);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.slide {
  min-width: 100%;
  margin: 0;
}

.slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 477;   /* reserves space -> no layout shift */
  object-fit: cover;
}

.slide figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem;
  background: var(--panel);
}

.carousel-btn {
  position: absolute;
  top: calc(50% - 1.5rem);
  transform: translateY(-50%);
  background: rgba(20, 17, 12, 0.7);
  color: var(--gold);
  border: 1px solid var(--edge);
  border-radius: 6px;
  font-size: 1.6rem;
  line-height: 1;
  width: 2.4rem;
  height: 2.8rem;
  cursor: pointer;
}

.carousel-btn:hover { background: rgba(20, 17, 12, 0.9); }
.carousel-btn.prev { left: 0.5rem; }
.carousel-btn.next { right: 0.5rem; }

.carousel-dots {
  position: absolute;
  bottom: 2.4rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.carousel-dots .dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.carousel-dots .dot[aria-selected="true"] {
  background: var(--gold);
}

/* ---- GOG (original game files) ---- */
.gog {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
  text-align: center;
}

.gog h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
  text-align: left;
}

.gog-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
  text-align: left;
}

.cd-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid var(--edge);
}

.gog-text p { margin: 0 0 0.75rem; }
.gog-text p:last-child { margin-bottom: 0; }

.gog-text a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gog-text a:hover { filter: brightness(1.15); }

@media (max-width: 520px) {
  .gog-body { flex-direction: column; text-align: center; }
  .gog-text { text-align: center; }
}

/* ---- Features / what's new ---- */
.features {
  margin-top: 2.5rem;
}

.features h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.feature-list > li {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}

.feature-list strong { color: var(--gold); }

.mods-list {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 1.5rem;
}

.mods-list li {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  break-inside: avoid;
}

@media (max-width: 520px) {
  .mods-list { columns: 1; }
}

/* ---- Installation videos ---- */
.install-videos {
  margin-top: 2.5rem;
}

.install-videos h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .video-grid { grid-template-columns: 1fr; }
}

.video-card h3 {
  margin: 0 0 0.5rem;
  color: var(--text);
}

/* Responsive 16:9 wrapper for embedded iframes */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--edge);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--edge);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem;
}

/* ---- Inline GOG links ---- */
.gog-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gog-link:hover { filter: brightness(1.15); }

/* ---- Devlog / socials ---- */
.thankyou {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
  text-align: center;
}

.thankyou h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
  text-align: left;
}

.thankyou li {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  break-inside: avoid;
}



/* ---- Devlog / socials ---- */
.devlog {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
  text-align: center;
}

.devlog h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
  text-align: left;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn-social {
  color: #fff;
  border: 1px solid rgba(0,0,0,0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-social img { display: block; }

.btn-youtube { background: #ff0000; }
.btn-youtube:hover { filter: brightness(1.08); }

.btn-reddit { background: #ff4500; }
.btn-reddit:hover { filter: brightness(1.08); }

/* ---- Brand badge links (Ko-fi, PayPal) ---- */
.badge-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 6px;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.badge-link:hover { filter: brightness(1.04); transform: translateY(-1px); }

.badge-link img { display: block; }

/* Ko-fi badge is a complete image button — no extra background. */

/* PayPal: monogram on a white pill with a label, per brand usage. */
.paypal-badge {
  background: #ffffff;
  color: #003087;
  font-weight: bold;
  padding: 0.55rem 1.1rem;
  gap: 0.5rem;
  border: 1px solid #d0d7e2;
  height: 48px;
  box-sizing: border-box;
}

/* ---- Footer bug-reports email + copyright ---- */
.bug-reports {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.email-img {
  display: inline-block;
  vertical-align: middle;
}

.copyright {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.copyright a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.copyright a:hover { filter: brightness(1.15); }

/* ---- Download requirement note (Windows VC++ runtime) ---- */
.req-note {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.req-label {
  color: var(--gold);
  font-weight: bold;
}

.req-note a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.req-note a:hover { filter: brightness(1.15); }

.req-sep { opacity: 0.5; margin: 0 0.15rem; }

/* ---- FAQ / troubleshooting ---- */
.faq {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
}

.faq h2 {
  color: var(--gold);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.4rem;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.faq-item h3 {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 1.1rem;
}

.faq-body {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.faq-img {
  flex-shrink: 0;
  width: 160px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--edge);
  border-radius: 6px;
  image-rendering: auto;
}

.faq-text p { margin: 0 0 0.75rem; }
.faq-text p:last-child { margin-bottom: 0; }

.faq-text code {
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.9em;
  color: var(--text);
}

.faq-text strong { color: var(--gold); }

@media (max-width: 560px) {
  .faq-body { flex-direction: column; }
  .faq-img { width: 160px; }
}

/* ---- Document links (release notes, license) ---- */
.doc-links {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.doc-links a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.doc-links a:hover { filter: brightness(1.15); }

.doc-sep { opacity: 0.5; margin: 0 0.3rem; }
