/* ── Colours: charcoal, with orange-gold for everything that is picked out ─────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&display=swap");

:root {
  --re-gold: #e8a33d;
  --re-gold-light: #f4bf6a;
  --re-gold-dim: rgba(232, 163, 61, .28);
  --re-ink: #1b191d;
}
[data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--re-ink);
  --md-primary-fg-color--light: #2a272c;
  --md-primary-fg-color--dark: #121013;
  --md-primary-bg-color: #f3e7d2;
  --md-primary-bg-color--light: rgba(243, 231, 210, .7);
}
[data-md-color-accent="custom"] {
  --md-accent-fg-color: var(--re-gold-light);
  --md-accent-fg-color--transparent: rgba(232, 163, 61, .12);
  --md-accent-bg-color: var(--re-ink);
}
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #17151a;
  --md-typeset-a-color: var(--re-gold);
}
[data-md-color-scheme="default"] {
  --md-typeset-a-color: #b0661a;
}

/* ── The game's own look: grain over everything, warm light in two corners ─────────────────────────────── */
body[data-md-color-scheme="slate"]::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("../assets/ui/noise.webp") repeat,
    url("../assets/ui/glow_rightup.webp") right top / min(60vw, 900px) auto no-repeat,
    url("../assets/ui/glow_leftdown.webp") left bottom / min(40vw, 560px) auto no-repeat,
    var(--md-default-bg-color);
}
body[data-md-color-scheme="slate"],
[data-md-color-scheme="slate"] .md-container,
[data-md-color-scheme="slate"] .md-main { background: transparent; }
.md-header, .md-tabs { background-color: var(--re-ink); }
.md-tabs { border-bottom: 1px solid var(--re-gold-dim); }
.md-tabs__link--active, .md-tabs__link:hover { color: var(--re-gold-light); }

/* titles in a period serif, the section heads on a brush stroke as the game sets its own */
.md-typeset h1, .md-typeset h2, .md-typeset h3 {
  font-family: "Cormorant Garamond", Georgia, serif; letter-spacing: .01em;
}
.md-typeset h1 { font-weight: 700; color: var(--re-gold-light); }
[data-md-color-scheme="default"] .md-typeset h1 { color: #9a5a17; }
.md-typeset h2 {
  font-weight: 600; padding: .15em 1.2em .15em .5em; margin-left: -.5em;
  background: linear-gradient(to right, rgba(232, 163, 61, .16), rgba(232, 163, 61, 0) 70%);
  border-left: 3px solid var(--re-gold);
}
.md-typeset h3 { font-weight: 600; color: var(--re-gold); }
[data-md-color-scheme="default"] .md-typeset h3 { color: #b0661a; }

/* the Home page's banner: the shop on the login screen, the wordmark over it */
.re-hero {
  position: relative; margin: -.6rem 0 1.6rem; padding: 3.2rem 1rem 2.4rem; text-align: center;
  background: linear-gradient(to bottom, rgba(23, 21, 26, .15), rgba(23, 21, 26, .85)),
              url("../assets/ui/hero.webp") center 35% / cover no-repeat;
  border: 1px solid var(--re-gold-dim); border-radius: 4px; overflow: hidden;
}
.re-hero img { width: min(440px, 80%); image-rendering: pixelated; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .9)); }
/* the wordmark in the header, kept sharp */
.md-header__button.md-logo img { height: 1.9rem; width: auto; image-rendering: pixelated; }

/* cards on the game's brushed panel */
[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li {
  background: linear-gradient(rgba(23, 21, 26, .55), rgba(23, 21, 26, .55)),
              url("../assets/ui/panel.webp") center / cover no-repeat;
  border: 1px solid var(--re-gold-dim);
}
.md-typeset .grid.cards > ul > li:hover { border-color: var(--re-gold); }

/* tables: a gold rule under the head */
.md-typeset table:not([class]) th { border-bottom: 2px solid var(--re-gold-dim); }

.md-footer, .md-footer-meta { background-color: var(--re-ink); }

/* pixel art stays sharp */
.re-icon, .re-icon-sm, .re-cell img { image-rendering: pixelated; }

.re-item { display: flex; gap: 1em; align-items: flex-start; }
.re-item > div { flex: 1; min-width: 0; }
.re-icon { width: 64px; height: 64px; flex: none; background: rgba(127,127,127,.12); border-radius: 6px; padding: 4px; }
.re-icon-sm { width: 32px; height: 32px; }

.re-recipe { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; margin: .4em 0 1em; }
.re-kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; width: 100%; }
.re-grid { display: grid; gap: 3px; }
.re-grid.re-loose { grid-template-columns: repeat(3, 2.6rem); }
.re-cell {
  width: 2.6rem; height: 2.6rem; display: flex; align-items: center; justify-content: center; position: relative;
  background: rgba(127,127,127,.15); border: 1px solid rgba(127,127,127,.35); border-radius: 3px; overflow: hidden;
}
.re-cell img { width: 80%; height: 80%; }
.re-text { font-size: .5rem; line-height: 1.1; text-align: center; padding: 2px; word-break: break-word; }
.md-typeset a.re-vanilla { color: inherit; }
.re-arrow { font-size: 1.6em; opacity: .6; }
.re-result { width: 3.2rem; height: 3.2rem; border-color: var(--re-gold); }
.re-count { position: absolute; right: 3px; bottom: 1px; font-weight: 700; font-size: .7rem; text-shadow: 1px 1px 0 #000; color: #fff; }

/* an item icon inside a line of text */
.re-inline { width: 1.5em; height: 1.5em; vertical-align: -0.35em; margin-right: .1em; }
/* numbered steps, each its own block */
.re-steps p { margin: 0 0 1em; }

/* ── Entity pages: the infobox, screenshots, window callouts ─────────────── */
.md-typeset .re-infobox {
  float: right; width: 17rem; margin: 0 0 1.2rem 1.6rem;
  border: 1px solid var(--re-gold-dim); border-radius: 4px; overflow: hidden;
  background: rgba(27, 25, 29, .72); font-size: .68rem;
}
.md-typeset .re-infobox .re-ib-title {
  margin: 0; padding: .45rem .7rem; background: var(--re-ink); color: var(--re-gold-light);
  font-weight: 700; font-size: .85rem; border-bottom: 1px solid var(--re-gold-dim);
}
.md-typeset .re-infobox img.re-ib-pic { display: block; width: 100%; image-rendering: pixelated; }
.md-typeset .re-infobox .re-ib-cap { padding: .3rem .7rem; color: var(--md-default-fg-color--light); font-style: italic; }
.md-typeset .re-infobox table { display: table; width: 100%; margin: 0; font-size: .68rem; border: 0; }
.md-typeset .re-infobox table th, .md-typeset .re-infobox table td {
  padding: .3rem .7rem; border-top: 1px solid rgba(232, 163, 61, .14); vertical-align: top;
}
.md-typeset .re-infobox table th { width: 38%; color: var(--re-gold); font-weight: 600; text-align: left; background: none; }
.md-typeset .re-infobox .re-ib-head th { color: var(--re-gold-light); background: rgba(232, 163, 61, .08); text-align: center; }
.md-typeset .re-infobox .re-inline { width: 1.3em; height: 1.3em; }
@media screen and (max-width: 44.9em) {
  .md-typeset .re-infobox { float: none; width: auto; margin: 0 0 1.2rem; }
}
.md-typeset .re-shot { margin: 1rem 0; }
.md-typeset .re-shot img { display: block; width: 100%; border: 1px solid var(--re-gold-dim); border-radius: 4px; }
.md-typeset .re-shot figcaption { margin-top: .35rem; font-size: .7rem; color: var(--md-default-fg-color--light); }
.md-typeset .re-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; }
.md-typeset .re-shots .re-shot { margin: 0; }
.md-typeset ol.re-callouts { list-style: none; padding-left: 0; margin-left: 0; counter-reset: co; }
.md-typeset ol.re-callouts > li { counter-increment: co; position: relative; padding-left: 2rem; margin-left: 0; }
.md-typeset ol.re-callouts > li::before {
  content: counter(co); position: absolute; left: 0; top: .05rem; width: 1.35rem; height: 1.35rem;
  border-radius: 50%; background: var(--re-gold); color: var(--re-ink); font-weight: 700;
  font-size: .7rem; line-height: 1.35rem; text-align: center; box-shadow: 0 0 0 2px var(--re-ink);
}
.md-typeset .keys kbd { border-color: var(--re-gold-dim); }
.md-typeset .re-clear { clear: both; }

/* ── Section grids: a card per item page ─────────────────────────────────── */
.md-typeset .re-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .6rem; margin: 1rem 0;
}
.md-typeset a.re-card {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem .4rem .6rem;
  border: 1px solid var(--re-gold-dim); border-radius: 4px; background: rgba(27, 25, 29, .55);
  color: var(--md-default-fg-color); text-align: center; font-size: .66rem; line-height: 1.25;
  transition: border-color .15s, transform .15s;
}
.md-typeset a.re-card:hover { border-color: var(--re-gold); color: var(--re-gold-light); transform: translateY(-2px); }
.md-typeset a.re-card img { width: 64px; height: 64px; image-rendering: pixelated; }
.md-typeset a.re-card small { color: var(--md-default-fg-color--light); font-size: .58rem; }
.md-typeset .re-infobox img.re-ib-icon {
  width: 9rem; height: 9rem; margin: .8rem auto; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6));
}
.md-typeset .re-infobox .md-typeset__scrollwrap, .md-typeset .re-infobox .md-typeset__table {
  display: block; width: 100%; margin: 0; padding: 0; overflow: visible;
}

/* ── A model's gallery: renders, a caption under each (Regulus's 3D model) ── */
.md-typeset img.re-turnaround { display: block; width: 100%; height: auto; margin: 1rem 0; image-rendering: pixelated; }
.md-typeset .re-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .8rem; margin: 1rem 0;
}
.md-typeset .re-gallery.re-faces { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .5rem; }
.md-typeset .re-gallery.re-one { grid-template-columns: minmax(0, 18rem); }
.md-typeset .re-gallery figure {
  display: flex; flex-direction: column; align-items: stretch; width: auto; margin: 0; overflow: hidden;
  border: 1px solid var(--re-gold-dim); border-radius: 4px; background: #1a1a1e;
}
.md-typeset .re-gallery figure.re-wide { grid-column: span 2; }
.md-typeset .re-gallery img { display: block; width: 100%; height: auto; margin: 0; image-rendering: pixelated; }
.md-typeset .re-gallery figcaption {
  max-width: none; margin: auto 0 0; padding: .45rem .6rem .55rem; font-size: .66rem; font-style: normal;
  line-height: 1.4; text-align: left; background: rgba(27, 25, 29, .85);
}
.md-typeset .re-gallery figcaption b { color: var(--re-gold-light); }
@media screen and (max-width: 44.9375em) { .md-typeset .re-gallery figure.re-wide { grid-column: auto; } }
