:root {
  --bg: #12100e;
  --bg-2: #1a1714;
  --panel: #211d19;
  --line: #3a322a;
  --text: #e8e0d2;
  --muted: #a89c8a;
  --accent: #d9a441;
  --accent-ink: #1a1305;
  --it: #d9a441;
  --rnr: #8fbf5a;
  --coah: #d2553f;
  --ab: #c4743a;
  --ap: #4fb8e8;
  --sort: #e0453a;
  --radius: 10px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

body.mod-it { --accent: var(--it); }
body.mod-rnr { --accent: var(--rnr); --accent-ink: #10190a; }
body.mod-coah { --accent: var(--coah); --accent-ink: #1c0906; }
body.mod-ab { --accent: var(--ab); --accent-ink: #1c0f06; }
body.mod-ap { --accent: var(--ap); --accent-ink: #06141c; }
body.mod-sort { --accent: var(--sort); --accent-ink: #1c0806; }

/* language switch: only the active language is shown */
[data-lang="en"] [lang="pl"],
[data-lang="pl"] [lang="en"] { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 2.2em; padding-top: .2em; }
h3 { font-size: 1.15rem; margin-top: 1.6em; color: var(--accent); }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; margin: 0 0 1em; }
li { margin-bottom: .35em; }

code, kbd {
  font: .88em/1.4 Consolas, "Cascadia Mono", monospace;
  background: #0c0a09;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1em .4em;
  white-space: nowrap;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 16, 14, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 60px; flex-wrap: wrap;
}
.brand {
  font-family: Georgia, serif; font-weight: 700; font-size: 1.2rem;
  color: var(--text); letter-spacing: .04em;
}
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  color: var(--muted); padding: 6px 10px; border-radius: 6px; font-size: .95rem;
}
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }
.lang {
  display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.lang button {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 5px 10px; font: inherit; font-size: .85rem; font-weight: 600;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 56px;
  /* the picture itself is set inline on each page (a url() inside a custom property
     would be resolved against this stylesheet's folder, not the page) */
  background: var(--bg-2) center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.hero .lead { font-size: 1.2rem; max-width: 46em; color: #f1eadc; }
.hero-row { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.hero-row > div { flex: 1 1 420px; min-width: 0; }
.hero-icon {
  width: 168px; height: 168px; border-radius: 16px;
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.badge {
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 99px;
  border: 1px solid var(--accent); color: var(--accent);
}
.badge.muted { border-color: var(--line); color: var(--muted); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px;
  font-weight: 600; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.disabled {
  background: transparent; border-color: var(--line); color: var(--muted);
  cursor: default; pointer-events: none;
}

/* ---------- content ---------- */
main { padding-bottom: 72px; }

.cards {
  display: grid; gap: 20px; margin-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  --accent: var(--c, #d9a441);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius); overflow: hidden; color: var(--text);
}
.card:hover { text-decoration: none; border-color: var(--accent); }
.card-img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: #0c0a09; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-top: 0; font-size: 1.3rem; }
.card-body p { color: var(--muted); font-size: .97rem; }
.card-more { margin-top: auto; color: var(--accent); font-weight: 600; }

.stats {
  display: grid; gap: 12px; margin: 22px 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat b {
  display: block; font: 700 1.7rem/1.1 Georgia, serif; color: var(--accent);
}
.stat span { color: var(--muted); font-size: .9rem; }

.note {
  border-left: 3px solid var(--accent);
  background: var(--panel); padding: 12px 16px; margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.note p:last-child { margin-bottom: 0; }

.toc {
  display: flex; gap: 6px 14px; flex-wrap: wrap; margin: 26px 0 0;
  padding: 12px 16px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: .93rem;
}

.table-scroll { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-2); color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }

figure { margin: 24px 0; }
figure img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
figcaption { color: var(--muted); font-size: .88rem; margin-top: 6px; }

.gallery {
  display: grid; gap: 12px; margin: 18px 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.gallery.wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.gallery a, .gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.gallery figcaption { text-align: center; }

details {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 16px; margin: 0 0 12px; background: var(--bg-2);
}
summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details[open] { padding-bottom: 14px; }
details h3:first-of-type { margin-top: .4em; }

.cols { display: grid; gap: 0 36px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-2);
  padding: 28px 0 36px; color: var(--muted); font-size: .9rem;
}
.site-footer .wrap { display: flex; gap: 12px 32px; flex-wrap: wrap; justify-content: space-between; }
.site-footer p { margin: 0 0 .4em; max-width: 46em; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 44px 0 36px; }
  .hero-icon { width: 112px; height: 112px; }
  .nav { margin-left: 0; order: 3; width: 100%; padding-bottom: 8px; }
  .lang { margin-left: auto; }
}

/* ---------- logos ---------- */
.brand img { height: 44px; width: auto; border-radius: 6px; display: block; }
.home-logo {
  width: min(640px, 100%); border-radius: 14px; margin: 0 0 26px;
  border: 1px solid var(--line); box-shadow: 0 12px 48px rgba(0,0,0,.65);
}
.hero-logo {
  width: min(400px, 100%); height: auto; border-radius: 14px;
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.6);
}

/* ---------- ImmersiveTrader <-> Roots & Remedies link ---------- */
.duo {
  margin: 34px 0; padding: 22px;
  border: 1px solid var(--line); border-radius: 14px;
  border: 2px solid transparent;
  background:
    linear-gradient(120deg, #2b2416, #1f2a17) padding-box,
    linear-gradient(90deg, var(--it), var(--rnr)) border-box;
}
.duo-head {
  display: flex; align-items: center; justify-content: center; gap: 14px 22px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.duo-head img { height: 96px; width: auto; border-radius: 10px; }
.duo-plus { font: 700 2.4rem/1 Georgia, serif; color: var(--text); }
.duo h2 { margin: 0 0 .5em; padding: 0; text-align: center; }
.duo-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: center; }
.duo-grid img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.duo .it { color: var(--it); }
.duo .rnr { color: var(--rnr); }
.duo .actions { margin-top: 14px; }

.tag-link {
  display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 99px;
  font-size: .82rem; font-weight: 700; letter-spacing: .04em;
  background: rgba(217,164,65,.15); color: var(--it); border: 1px solid var(--it);
}
.tag-link.rnr { background: rgba(143,191,90,.15); color: var(--rnr); border-color: var(--rnr); }

@media (max-width: 640px) {
  .brand img { height: 36px; }
  .duo { padding: 16px; }
  .duo-head img { height: 64px; }
}

/* ---------- promo block (the very bottom of every page) ---------- */
.promo { margin: 56px 0 0; padding: 22px 0 34px; border-top: 1px solid var(--line); text-align: center; }
.promo-label { margin: 0 0 10px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.promo a { display: inline-block; line-height: 0; }
.promo a:hover { text-decoration: none; filter: brightness(1.08); }
.promo img { width: min(420px, 100%); height: auto; margin: 0 auto; border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.55); }

/* ---------- Discord logo (an inline SVG at the start of every Discord link) ---------- */
.dc-ico { width: 1.2em; height: 1.2em; margin-right: .45em; vertical-align: -.22em; fill: currentColor; flex: none; }

/* ---------- support panel (home page, under the mod cards) ---------- */
.support {
  margin: 44px auto 0; max-width: 640px; padding: 26px 28px 30px; text-align: center;
  background: linear-gradient(180deg, var(--bg-2), var(--panel));
  border: 1px solid var(--line); border-top: 3px solid #e66605; border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.support h2 { margin: 0 0 10px; font-size: 1.35rem; color: var(--text); }
.support h2::before { content: "\2615\00a0"; color: #e66605; }
.support p { margin: 0 auto 16px; max-width: 520px; color: var(--muted); }
.support .kofi { display: inline-block; line-height: 0; border-radius: 8px; transition: transform .15s ease, filter .15s ease; }
.support .kofi:hover { transform: translateY(-2px); filter: brightness(1.08); text-decoration: none; }
.support .kofi img { height: 36px; width: auto; border: 0; }

/* ---------- "Mods" drop-down in the top bar ---------- */
.nav-drop { position: relative; }
.nav-drop-btn {
  background: none; border: 0; cursor: pointer; font: inherit; font-size: .95rem;
  color: var(--muted); padding: 6px 10px; border-radius: 6px;
}
.nav-drop-btn .caret { font-size: .8em; margin-left: 2px; }
.nav-drop-btn.current { color: var(--accent); }
.nav-drop:hover .nav-drop-btn, .nav-drop:focus-within .nav-drop-btn, .nav-drop.open .nav-drop-btn { color: var(--text); background: var(--panel); }
.nav-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 244px; padding: 6px; margin-top: 2px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.55); z-index: 30;
}
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* no gap to fall through on the way down */
.nav-drop:hover .nav-menu, .nav-drop:focus-within .nav-menu, .nav-drop.open .nav-menu { display: block; }
.nav-menu a {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px;
  color: var(--text); font-size: .96rem; box-shadow: inset 3px 0 0 transparent;
}
.nav-menu a img {
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none;
  border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--panel); box-shadow: inset 3px 0 0 var(--c, var(--accent)); text-decoration: none; }
.nav-menu a:hover img, .nav-menu a:focus-visible img { transform: scale(1.14); filter: brightness(1.12); box-shadow: 0 0 12px var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.nav-menu a[aria-current="page"] { color: var(--c, var(--accent)); }
@media (max-width: 720px) {
  .nav-drop { width: 100%; }
  .nav-menu { position: static; box-shadow: none; margin: 4px 0 0; min-width: 0; }
  .nav-menu::before { display: none; }
  .nav-drop:hover .nav-menu { display: none; }                      /* a tap opens it on a phone, hover does not */
  .nav-drop.open .nav-menu, .nav-drop:focus-within .nav-menu { display: block; }
}

/* ---------- "Back" button above the Ko-fi button ---------- */
.back-btn {
  position: fixed; left: 18px; bottom: 82px; z-index: 40;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  font-size: .9rem; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.45);
  transition: transform .15s ease, border-color .15s ease, color .15s ease;
}
.back-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateX(-2px); text-decoration: none; }

/* "Download on" before the Thunderstore and Nexus Mods buttons */
.dl-label { display: inline-flex; align-items: center; color: var(--muted); font-size: .95rem; padding-right: 2px; }

/* ---------- hover highlight, same language as the "Mods" menu: panel background, accent bar, soft glow ---------- */
.btn, .stat, .card { transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, transform .15s ease, filter .15s ease; }
.btn:hover, .btn:focus-visible { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn.ghost:hover, .btn.ghost:focus-visible { background: var(--panel); color: var(--text); filter: none; border-color: var(--accent); }
.btn.disabled:hover { transform: none; box-shadow: none; filter: none; }
.stat:hover { background: #2a251f; border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent), 0 0 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.card:hover, .card:focus-visible { background: #2a251f; transform: translateY(-3px); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent); }
@media (prefers-reduced-motion: reduce) { .btn:hover, .card:hover { transform: none; } }

/* ---------- support panel: shaded like the IT + RnR "belong together" panel; on hover its gradient itself slowly turns and brightens to orange ---------- */
/* registered properties are what lets the browser animate the gradient's own colours and angle */
@property --sp-a  { syntax: "<angle>"; inherits: false; initial-value: 120deg; }
@property --sp-c1 { syntax: "<color>"; inherits: false; initial-value: #2e1c0e; }
@property --sp-c2 { syntax: "<color>"; inherits: false; initial-value: #241a14; }
.support {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--sp-a), var(--sp-c1), var(--sp-c2)) padding-box,
    linear-gradient(90deg, #e66605, #ffa24a) border-box;
  transition: --sp-a 1s ease, --sp-c1 1s ease, --sp-c2 1s ease, box-shadow 1s ease, transform 1s ease;
}
.support:hover {
  --sp-a: 240deg; --sp-c1: #ff9a3c; --sp-c2: #e66605;
  box-shadow: 0 8px 30px rgba(230,102,5,.4); transform: translateY(-2px);
  transition: --sp-a 5s ease, --sp-c1 5s ease, --sp-c2 5s ease, box-shadow 5s ease, transform .4s ease;
}
.support h2, .support p, .support h2::before { transition: color 1s ease; }
.support:hover h2, .support:hover p, .support:hover h2::before { color: #1a0e05; transition: color 5s ease; }
.support .kofi img { transition: box-shadow 1s ease; }
.support:hover .kofi img { box-shadow: 0 0 0 2px #1a0e05; border-radius: 8px; transition: box-shadow 5s ease; }
@media (prefers-reduced-motion: reduce) { .support:hover { transform: none; } }

/* ---------- Dreadborne Dungeon ad: floating card above the Ko-fi button, bottom-left ---------- */
.ad-float {
  position: fixed; left: 14px; bottom: 76px; z-index: 40; width: 230px;
  background: linear-gradient(120deg, #2e1c0e, #241a14); border: 1px solid #7a2a1c; border-radius: 12px;
  box-shadow: 0 8px 26px rgba(0,0,0,.6); padding: 6px; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.ad-float a { display: block; line-height: 0; border-radius: 8px; overflow: hidden; }
.ad-float a:hover { text-decoration: none; }
.ad-float:hover { transform: translateY(-3px); border-color: #d2553f; box-shadow: 0 0 18px rgba(210,85,63,.5), 0 8px 26px rgba(0,0,0,.6); }
.ad-float img { width: 100%; height: auto; border-radius: 8px; }
.ad-label { position: absolute; left: 12px; top: 10px; z-index: 1; padding: 1px 7px; border-radius: 6px; background: rgba(18,16,14,.78); color: var(--muted); font-size: .62rem; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; }
.ad-close {
  position: absolute; right: -8px; top: -8px; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font: 16px/1 sans-serif; cursor: pointer;
}
.ad-close:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 720px) { .ad-float { width: 150px; bottom: 70px; left: 10px; } .ad-label { display: none; } }
@media (prefers-reduced-motion: reduce) { .ad-float:hover { transform: none; } }
