@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/baloo2-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("fonts/nunito-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/nunito-latin-italic.woff2") format("woff2");
}

:root {
  /* Roco Kingdom in-game UI palette: parchment, ink, gold leaf */
  --bg: #ede4cf;
  --bg-soft: #e3d7bd;
  --paper: #f8f2e4;
  --paper-2: #fffaf1;
  --ink: #2b2620;
  --ink-soft: #6b604f;
  --line: #cdbd9c;
  --line-strong: #2b2620;
  --gold: #ffc65f;
  --gold-deep: #e0a23a;
  --gold-wash: #ffe9b8;
  --orange: #d56c1f;
  --red: #b03b3a;
  --green: #4f7d4a;
  --teal: #2f6f7e;
  --purple: #6a4a86;
  --accent: var(--orange);
  --accent-wash: var(--gold-wash);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 0 rgba(43, 38, 32, .10), 0 10px 24px rgba(43, 38, 32, .07);
  --shadow-hard: 5px 5px 0 rgba(43, 38, 32, .14);
  --wrap: 1080px;
  --font-display: "Baloo 2", "Trebuchet MS", "Segoe UI", sans-serif;
  --font: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
  --grain: rgba(43, 38, 32, .025);
}

[data-theme="dark"] {
  --bg: #191612;
  --bg-soft: #211c16;
  --paper: #292219;
  --paper-2: #332a20;
  --ink: #f6edda;
  --ink-soft: #c0ad90;
  --line: #4b3d2c;
  --line-strong: #8a7452;
  --gold: #ffc65f;
  --gold-deep: #e0a23a;
  --gold-wash: #3a2d17;
  --orange: #ff9a52;
  --red: #e2706e;
  --green: #86b47c;
  --teal: #74b3c0;
  --purple: #b394d0;
  --shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 10px 24px rgba(0, 0, 0, .35);
  --shadow-hard: 5px 5px 0 rgba(0, 0, 0, .40);
  --grain: rgba(255, 255, 255, .02);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 4%, rgba(255, 198, 95, .20), transparent 40%),
    radial-gradient(circle at 92% 0%, rgba(47, 111, 126, .10), transparent 36%),
    repeating-linear-gradient(0deg, var(--grain) 0 1px, transparent 1px 4px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

::selection { background: var(--gold); color: var(--line-strong); }

:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: .6rem 1rem;
  border: 2px solid var(--line-strong);
  border-radius: 0 0 12px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header: parchment bar with ink rule ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 3px solid var(--line-strong);
  box-shadow: 0 3px 0 rgba(43, 38, 32, .07);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border: 2px solid var(--line-strong);
  color: var(--line-strong);
  box-shadow: 2px 2px 0 rgba(43, 38, 32, .22);
  transform: rotate(-4deg);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: .01em;
}
.brand-sub { font-size: .7rem; color: var(--ink-soft); }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  margin-left: auto;
}
.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: .82rem;
  padding: .38rem .68rem;
  border: 2px solid transparent;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.main-nav a:hover {
  background: var(--gold-wash);
  border-color: var(--line);
  color: var(--ink);
  text-decoration: none;
}
.main-nav a[aria-current="page"] {
  background: var(--gold);
  border-color: var(--line-strong);
  color: var(--line-strong);
  font-weight: 800;
  box-shadow: 1px 1px 0 rgba(43, 38, 32, .2);
}

.header-actions { display: flex; gap: .4rem; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(43, 38, 32, .18);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover {
  background: var(--gold);
  color: var(--line-strong);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(43, 38, 32, .22);
}
.menu-btn { display: none; }

/* ---------- hero ---------- */
.hero { padding: 3.2rem 0 1.6rem; max-width: 780px; }
.eyebrow {
  display: inline-block;
  margin: 0 0 .9rem;
  padding: .16rem .62rem;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: var(--gold);
  color: var(--line-strong);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 rgba(43, 38, 32, .18);
  transform: rotate(-1.2deg);
}
h1, h2, h3 { line-height: 1.28; letter-spacing: 0; }
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.95rem, 4vw, 2.85rem);
  margin: 0 0 .9rem;
}
.hero h1::after {
  content: "";
  display: block;
  width: 96px;
  height: 7px;
  margin-top: .55rem;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  box-shadow: 1px 1px 0 rgba(43, 38, 32, .22);
}
h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 1rem;
}
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 .4rem;
}
.lede { font-size: 1.06rem; color: var(--ink-soft); margin: 0 0 1.2rem; }

.btn {
  display: inline-block;
  padding: .55rem 1.25rem;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: var(--line-strong);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .92rem;
  box-shadow: 3px 3px 0 rgba(43, 38, 32, .22);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(43, 38, 32, .24);
}

/* ---------- cards: stitched parchment panels ---------- */
.card-group {
  padding: 2rem 0 2.2rem;
  border-top: 2px dashed var(--line);
}
.card-group > h2 {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.card-group > h2::before {
  content: "";
  width: .62rem;
  height: .62rem;
  flex-shrink: 0;
  background: var(--gold);
  border: 2px solid var(--line-strong);
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 1px 1px 0 rgba(43, 38, 32, .2);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.15rem;
}
.card {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 1.15rem 1.2rem 1.3rem;
  border: 2px solid var(--line-strong);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-hard);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  pointer-events: none;
}
.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(43, 38, 32, .16);
  text-decoration: none;
}
.card p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.card-tag {
  align-self: flex-start;
  margin-bottom: .55rem;
  padding: .1rem .55rem;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: var(--gold);
  color: #2b2620;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 1px 1px 0 rgba(43, 38, 32, .2);
  transform: rotate(-1.6deg);
}
.card-group[data-group="jinies"] .card-tag { background: #c3e3b6; }
.card-group[data-group="combat"] .card-tag { background: #f2b8b3; }
.card-group[data-group="world"] .card-tag { background: #b9dde5; }
.card-group[data-group="resources"] .card-tag { background: #f8cfa2; }
.card-group[data-group="systems"] .card-tag { background: #d8c4ec; }

/* ---------- article head ---------- */
.article-head { padding: 2rem 0 1.25rem; max-width: 780px; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  color: var(--ink-soft);
  font-size: .82rem;
}
.badge {
  padding: .1rem .55rem;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--gold-wash);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 700;
}

/* ---------- keybox: ledger card ---------- */
.keybox {
  position: relative;
  margin: 1.35rem 0;
  padding: 1.15rem 1.35rem 1.25rem;
  border: 2px solid var(--line-strong);
  border-radius: 18px;
  background: var(--paper-2);
  box-shadow:
    inset 0 0 0 5px var(--paper-2),
    inset 0 0 0 6px var(--line),
    var(--shadow-hard);
}
.keybox h2 {
  display: inline-block;
  margin: 0 0 .8rem;
  padding: .08rem .6rem;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: var(--gold);
  color: var(--line-strong);
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(-1deg);
  box-shadow: 1px 1px 0 rgba(43, 38, 32, .2);
}
.keybox dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .5rem 1rem;
  margin: 0;
  font-size: .93rem;
}
.keybox dt { color: var(--ink-soft); }
.keybox dd { margin: 0; font-weight: 600; }

/* ---------- prose ---------- */
.prose { max-width: 780px; padding-bottom: 2.5rem; }
.prose h2 {
  margin-top: 2.3rem;
  padding: .15rem 0 .15rem .85rem;
  border-left: 7px solid var(--gold);
  font-size: 1.32rem;
}
.prose h3 { margin-top: 1.6rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: .32rem 0; }
.prose li::marker { color: var(--orange); font-weight: 700; }
.prose blockquote {
  margin: 1.2rem 0;
  padding: .7rem 1rem;
  border-left: 5px solid var(--gold-deep);
  border-radius: 0 12px 12px 0;
  background: var(--gold-wash);
  color: var(--ink);
}
.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.1rem 0;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  font-size: .9rem;
}
.prose th, .prose td {
  padding: .55rem .7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.prose th {
  background: var(--gold-wash);
  font-family: var(--font-display);
  font-weight: 700;
}
.prose tr:last-child td { border-bottom: 0; }
.prose code {
  padding: .1rem .35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  font-size: .88em;
}

.ad-slot {
  display: grid;
  place-items: center;
  margin: 1.5rem 0;
  min-height: 90px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  color: var(--ink-soft);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- breadcrumb ---------- */
.breadcrumb { padding: 1.1rem 0 0; font-size: .82rem; color: var(--ink-soft); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { display: inline-flex; align-items: center; gap: .3rem; }
.breadcrumb li + li::before { content: "\203A"; color: var(--gold-deep); font-weight: 800; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* ---------- footer: ink block with gold rule ---------- */
.site-footer {
  margin-top: 3rem;
  border-top: 4px solid var(--gold);
  background: #2b2620;
  color: #f5ecd9;
}
[data-theme="dark"] .site-footer { background: #14110e; border-top-color: var(--gold-deep); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  padding-top: 2.2rem;
  padding-bottom: 1.6rem;
}
.footer-brand { max-width: 340px; }
.footer-brand .brand-name { color: #fff7e6; font-size: 1.1rem; }
.footer-note { color: #c9baa0; font-size: .82rem; margin: .45rem 0 0; }
.footer-cols { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.footer-cols a {
  display: block;
  color: #c9baa0;
  text-decoration: none;
  font-size: .86rem;
  padding: .14rem 0;
}
.footer-cols a:hover { color: var(--gold); }
.footer-head {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
}
.footer-base {
  padding-top: 1rem;
  padding-bottom: 1.7rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  color: #a8987e;
  font-size: .78rem;
}
.footer-base p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .main-nav {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + .5rem);
    padding: .55rem;
    border: 2px solid var(--line-strong);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 5px 5px 0 rgba(43, 38, 32, .18);
    flex-direction: column;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { border-radius: 10px; }
  .header-inner { position: relative; }
  .keybox dl { grid-template-columns: 1fr; gap: .1rem; }
  .keybox dd { margin-bottom: .6rem; }
  .prose table { display: block; overflow-x: auto; }
}

@media (max-width: 520px) {
  .brand-sub { display: none; }
  .hero { padding-top: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* AdSense-ready slots.
   Sizes follow the standard AdSense units: 970x90 / 728x90 leaderboard and
   336x280 / 300x250 rectangle. Heights are reserved so a filled unit does not
   shift the page (CLS). To go live, replace the inner label with the AdSense
   <ins class="adsbygoogle"> block and add the loader script. */
.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 970px;
  min-height: 90px;
  margin: 1.6rem auto 2rem;
  border: 2px dashed rgba(43, 38, 32, .22);
  border-radius: 14px;
  background: rgba(255, 255, 255, .28);
  color: rgba(43, 38, 32, .5);
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-align: center;
  text-transform: uppercase;
}
.ad-slot--rectangle {
  max-width: 336px;
  min-height: 280px;
}
.ad-slot .ad-label {
  position: absolute;
  top: .5rem;
  left: .8rem;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .16em;
  opacity: .65;
}
/* Applied after the real ad markup is inserted: drop the placeholder chrome. */
.ad-slot.is-filled {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
}
.ad-slot.is-filled .ad-label {
  position: static;
  display: block;
  margin-bottom: .35rem;
  opacity: .5;
}
[data-theme="dark"] .ad-slot {
  border-color: rgba(255, 198, 95, .25);
  background: rgba(255, 255, 255, .04);
  color: rgba(244, 238, 225, .5);
}
@media (max-width: 520px) {
  .ad-slot--leaderboard { min-height: 100px; }
  .ad-slot--rectangle { min-height: 250px; }
}

.page-figure {
  margin: 1.8rem 0;
  border: 2px solid var(--ink, #2b2620);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper, #f8f2e4);
  box-shadow: 5px 5px 0 rgba(43, 38, 32, .14);
}
.page-figure img { display: block; width: 100%; height: auto; }
.page-figure figcaption {
  padding: .6rem .9rem;
  border-top: 2px dashed rgba(43, 38, 32, .28);
  font-size: .82rem;
  line-height: 1.5;
  color: rgba(43, 38, 32, .72);
}
@media (max-width: 520px) { .page-figure { border-radius: 12px; box-shadow: 3px 3px 0 rgba(43, 38, 32, .14); } }

.notice-bar { margin: 0 0 1.8rem; }
.notice-bar a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.1rem;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: var(--gold-wash);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 4px 4px 0 rgba(43, 38, 32, .14);
  transition: transform .16s ease, box-shadow .16s ease;
}
.notice-bar a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(43, 38, 32, .18);
  text-decoration: none;
}
.notice-bar .notice-tag {
  flex: none;
  padding: .18rem .5rem;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--orange);
  color: #fff8ea;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
[data-theme="dark"] .notice-bar a { background: #3a3122; color: #f4eee1; }
[data-theme="dark"] .notice-bar .notice-tag { color: #2b2620; }
@media (max-width: 520px) { .notice-bar a { font-size: .9rem; } }
