/* Dungeonia - fantasy theme: night purples, old gold, parchment and a little arcane teal */
:root {
  --night: #120d1a;
  --night-2: #1c1428;
  --night-3: #2a1e3b;
  --gold: #d8ab4c;
  --gold-light: #f3d488;
  --parchment: #efe2c2;
  --parchment-dim: #c9b994;
  --ember: #e0703a;
  --arcane: #5fd3c4;
  --violet: #9b7bd8;
  --shadow: rgba(0, 0, 0, 0.55);
  --radius: 10px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at top, #2c1d44 0%, var(--night) 55%) fixed, var(--night);
  color: var(--parchment);
  font-family: "Crimson Text", Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.6;
}
a { color: var(--gold-light); }
a:hover { color: var(--arcane); }
img { max-width: 100%; display: block; }

h1, h2, h3, .brand, nav a, .btn {
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.04em;
}
h2 {
  color: var(--gold);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.6em;
  text-align: center;
}
h2::after {
  content: "";
  display: block;
  width: 140px;
  height: 2px;
  margin: 0.45em auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
h3 { color: var(--gold-light); margin: 0 0 0.4em; font-size: 1.25rem; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
section { padding: 72px 0; }
section.alt { background: linear-gradient(180deg, rgba(28, 20, 40, 0.9), rgba(18, 13, 26, 0.9)); border-block: 1px solid rgba(216, 171, 76, 0.18); }
.lead { text-align: center; max-width: 760px; margin: 0 auto 2em; color: var(--parchment-dim); }

/* ---- Header ---- */
header.site {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 13, 26, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(216, 171, 76, 0.25);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.brand img { height: 44px; width: auto; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav a {
  color: var(--parchment); text-decoration: none; font-size: 0.85rem; text-transform: uppercase;
  padding: 8px 12px; border-radius: 6px; border: 1px solid transparent;
}
nav a:hover, nav a.active { border-color: rgba(216, 171, 76, 0.5); color: var(--gold-light); background: rgba(216, 171, 76, 0.08); }

/* ---- Hero ---- */
.hero { text-align: center; padding: 64px 0 80px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(155, 123, 216, 0.28), transparent 55%), radial-gradient(circle at 20% 80%, rgba(95, 211, 196, 0.12), transparent 40%);
  pointer-events: none;
}
.hero img.logo { width: min(640px, 92%); margin: 0 auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.7)); position: relative; }
.hero .tagline { font-family: "Cinzel", serif; color: var(--gold-light); font-size: clamp(1.1rem, 2.4vw, 1.5rem); margin: 18px 0 8px; position: relative; }
.hero p { max-width: 720px; margin: 0 auto 26px; color: var(--parchment-dim); position: relative; }
.btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.95rem;
  color: #1b1206; background: linear-gradient(180deg, var(--gold-light), var(--gold)); border: 1px solid #a57d2b;
  box-shadow: 0 4px 14px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn:hover { color: #1b1206; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--gold-light); border-color: rgba(216, 171, 76, 0.6); box-shadow: none; }
.btn.ghost:hover { background: rgba(216, 171, 76, 0.1); color: var(--gold-light); }

/* ---- Cards ---- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(42, 30, 59, 0.85), rgba(28, 20, 40, 0.85));
  border: 1px solid rgba(216, 171, 76, 0.25); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 8px 22px var(--shadow);
}
.card .icon { font-size: 1.8rem; line-height: 1; margin-bottom: 10px; }
.card p { margin: 0; color: var(--parchment-dim); font-size: 1.02rem; }

/* ---- Screenshots ---- */
.shots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.shot {
  margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--night-3);
  border: 1px solid rgba(216, 171, 76, 0.25); cursor: zoom-in; position: relative; aspect-ratio: 16 / 9;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.shot:hover img { transform: scale(1.04); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; font-size: 0.95rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent);
}
.shot.empty { display: grid; place-items: center; cursor: default; color: var(--parchment-dim); text-align: center; padding: 16px;
  background: repeating-linear-gradient(45deg, rgba(216, 171, 76, 0.05) 0 12px, transparent 12px 24px), var(--night-3); }
.shot.empty span { font-size: 0.95rem; }

.lightbox { position: fixed; inset: 0; background: rgba(5, 3, 8, 0.92); display: none; place-items: center; z-index: 50; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px #000; }

/* ---- Videos ---- */
.videos { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.video { background: var(--night-3); border: 1px solid rgba(216, 171, 76, 0.25); border-radius: var(--radius); overflow: hidden; }
.video .frame { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .frame.empty { display: grid; place-items: center; color: var(--parchment-dim); text-align: center; padding: 16px;
  background: radial-gradient(circle, rgba(155, 123, 216, 0.18), transparent 70%), var(--night-3); }
.video .frame.empty .play { font-size: 3rem; color: var(--gold); }
.video h3 { padding: 12px 16px 14px; margin: 0; font-size: 1.05rem; }

/* ---- Guide page ---- */
.guide { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; padding: 40px 0 80px; }
.guide aside { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto;
  background: rgba(28, 20, 40, 0.85); border: 1px solid rgba(216, 171, 76, 0.25); border-radius: var(--radius); padding: 14px; }
.guide aside h3 { font-size: 1rem; margin: 4px 6px 10px; }
.guide aside a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--parchment); text-decoration: none; font-size: 0.98rem; }
.guide aside a:hover { background: rgba(216, 171, 76, 0.1); color: var(--gold-light); }
.guide article {
  background: linear-gradient(180deg, rgba(239, 226, 194, 0.06), rgba(239, 226, 194, 0.02));
  border: 1px solid rgba(216, 171, 76, 0.22); border-radius: var(--radius); padding: 26px 30px; margin-bottom: 22px; scroll-margin-top: 90px;
}
.guide article h2 { text-align: left; font-size: 1.6rem; }
.guide article h2::after { margin-left: 0; }
.guide article p { margin: 0 0 1em; }
.guide .keys { font-family: Consolas, "Courier New", monospace; font-size: 0.92rem; background: rgba(0, 0, 0, 0.3); padding: 12px 14px; border-radius: 8px; color: var(--parchment); white-space: pre-wrap; }

/* ---- Footer ---- */
footer { text-align: center; padding: 34px 16px 44px; color: var(--parchment-dim); font-size: 0.95rem; border-top: 1px solid rgba(216, 171, 76, 0.2); }
footer img { height: 48px; margin: 0 auto 10px; opacity: 0.9; }

@media (max-width: 860px) {
  .guide { grid-template-columns: 1fr; }
  .guide aside { position: static; max-height: none; }
  body { font-size: 18px; }
}

/* Footer links (managed on the hub: Overseer -> Dungeonia website) */
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { color: var(--gold-light); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* Download page (download.php) */
.download-page { padding: 70px 0 80px; min-height: 55vh; }
.download-page h2 { text-align: center; }
.dl-box { max-width: 460px; margin: 26px auto 0; display: grid; gap: 12px; text-align: center; }
.dl-box label { font-family: "Cinzel", Georgia, serif; color: var(--gold-light); letter-spacing: 0.06em; }
.dl-box input { font: inherit; font-size: 1.2rem; padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(216, 171, 76, 0.45);
  background: rgba(10, 8, 16, 0.7); color: inherit; text-align: center; letter-spacing: 0.12em; }
.dl-box input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.dl-small { font-size: 0.9rem; opacity: 0.75; margin: 0; }
.dl-error { max-width: 560px; margin: 18px auto 0; padding: 12px 16px; border-radius: 8px; text-align: center;
  background: rgba(160, 40, 40, 0.25); border: 1px solid rgba(220, 90, 90, 0.5); }
.dl-files { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 26px; }
.dl-file { display: grid; gap: 10px; align-content: start; }
.dl-file h3, .dl-file p { margin: 0; }
.dl-file .btn { justify-self: start; }
.dl-lock { text-align: center; margin-top: 30px; }

/* Bugs and fixes (report.php) */
.bug-board { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 10px 0 40px; }
.bug-col h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.bug-count { font-family: "Crimson Text", Georgia, serif; font-size: 0.95rem; min-width: 1.8em; text-align: center; padding: 1px 8px;
  border-radius: 999px; background: rgba(216, 171, 76, 0.15); color: var(--gold-light); }
.bug-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bug-col li { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid rgba(216, 171, 76, 0.35); }
.bug-col li span { color: var(--parchment-dim); }
.bug-col li small { opacity: 0.65; }
.bug-working li { border-left-color: #d8ab4c; }
.bug-fixed li { border-left-color: #6fbf73; }
.bug-known li { border-left-color: #9a87c9; }
.bug-form-title { text-align: center; margin-top: 10px; }
.bug-form { max-width: 640px; margin: 20px auto 0; display: grid; gap: 14px; }
.bug-form label { display: grid; gap: 6px; font-family: "Cinzel", Georgia, serif; color: var(--gold-light); letter-spacing: 0.04em; font-size: 0.95rem; }
.bug-form input, .bug-form select, .bug-form textarea { font: inherit; font-family: "Crimson Text", Georgia, serif; font-size: 1.08rem; letter-spacing: 0;
  padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(216, 171, 76, 0.45); background: rgba(10, 8, 16, 0.7); color: var(--parchment, #f1e6cf); }
.bug-form select option { background: #1a1424; }
.bug-form input:focus, .bug-form select:focus, .bug-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.bug-form .btn { justify-self: start; }
.bug-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dl-ok { max-width: 640px; margin: 18px auto 0; padding: 12px 16px; border-radius: 8px; text-align: center;
  background: rgba(60, 140, 70, 0.22); border: 1px solid rgba(110, 190, 115, 0.5); }
.dl-report { text-align: center; margin-top: 18px; }
