/* Coin Maker Simulator Guide — dungeon mint visual (see DESIGN-BRIEF.md)
   palette: ink #150e08 · stone #201610 · wood #2c1f14 · gold #e0a63c · royal red #a63a2a */

:root {
  --ink: #150e08;
  --bg: #201610;
  --surface: #2c1f14;
  --surface2: #3a2a1b;
  --gold: #e0a63c;
  --gold-bright: #fbe194;
  --red: #a63a2a;
  --red-bright: #c9503a;
  --parchment: #f2e3c1;
  --parchment-dark: #e2cd9f;
  --text: #efe4cd;
  --muted: #bfa987;
  --line: #4a3722;
  --font: "Spectral", Georgia, "Times New Roman", serif;
  --display: "Alfa Slab One", "Rockwell", Georgia, serif;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(224, 166, 60, .07), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(0, 0, 0, .14) 46px 48px),
    repeating-linear-gradient(90deg, transparent 0 96px, rgba(0, 0, 0, .1) 96px 98px);
  color: var(--text);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--gold-bright); text-decoration: underline; text-decoration-color: rgba(224,166,60,.55); text-underline-offset: 3px; }
a:hover { color: var(--gold); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--gold); color: var(--ink); padding: 10px 16px; font-weight: 600;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- ribbon (royal red decree band) ---------- */
.ribbon {
  background: linear-gradient(180deg, var(--red-bright), var(--red));
  border-bottom: 3px solid var(--ink);
  color: #fff5e6;
  font-size: 14px;
  letter-spacing: .04em;
  text-align: center;
  padding: 7px 0;
}
.ribbon strong { color: var(--gold-bright); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(21, 14, 8, .96);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .45);
}
.bar { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 19px; color: var(--parchment);
  text-decoration: none; line-height: 1.1; padding: 6px 0; margin-right: auto;
}
.brand img { width: 34px; height: 34px; border: 2px solid var(--gold); border-radius: 50%; background: var(--surface2); }
.brand:hover { color: var(--gold-bright); }
.nav { display: flex; align-items: center; gap: 14px; }
.nav > ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav > ul > li { position: relative; }
.nav a {
  display: block; padding: 9px 12px; color: var(--text); font-weight: 600; font-size: 15.5px;
  text-decoration: none; border-radius: var(--radius); white-space: nowrap;
}
.nav a:hover, .nav a.active { background: var(--surface2); color: var(--gold-bright); }
.nav a.active { box-shadow: inset 0 -3px 0 var(--gold); }
.caret { display: inline-block; margin-left: 5px; font-style: normal; font-size: 11px; color: var(--gold); transition: transform .18s; }
.nav li.has-kids:hover .caret, .nav li.has-kids:focus-within .caret { transform: rotate(180deg); }
.nav > ul > li > a { white-space: nowrap; }

.kids {
  position: absolute; top: 100%; left: 0; z-index: 40;
  min-width: 250px; margin: 0; padding: 8px; list-style: none;
  background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
}
.nav li.has-kids:hover > .kids, .nav li.has-kids:focus-within > .kids { display: block; }
/* hover bridge: no dead zone between parent and panel */
.nav li.has-kids::after {
  content: ""; position: absolute; left: -10px; right: -10px; top: 100%; height: 12px; z-index: 39;
}
.kids a { padding: 9px 12px; border-radius: 4px; }
.kids a:hover { background: var(--surface2); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--bg) var(--hero) 60% top / cover no-repeat;
  border-bottom: 4px solid var(--ink);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(21,14,8,.94) 0%, rgba(21,14,8,.86) 34%, rgba(21,14,8,.4) 62%, rgba(21,14,8,.15) 100%);
}
.hero-in { position: relative; padding: 74px 20px 66px; max-width: 1080px; margin: 0 auto; }
.hero .eyebrow {
  margin: 0 0 10px; color: var(--gold); font-weight: 600; font-size: 14px;
  letter-spacing: .22em; text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 16px; font-family: var(--display); font-weight: 400;
  font-size: clamp(38px, 6.4vw, 68px); line-height: 1.04; color: var(--parchment);
  text-shadow: 4px 4px 0 var(--ink), 0 0 42px rgba(224, 166, 60, .28);
  max-width: 14ch;
}
.hero .lead { margin: 0 0 26px; max-width: 54ch; font-size: 19px; color: #e9dcc2; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }


/* ---------- buttons ---------- */
.btn, .cta {
  display: inline-block; cursor: pointer;
  font-family: var(--display); font-size: 16px; letter-spacing: .02em;
  padding: 13px 22px; border-radius: var(--radius);
  border: 3px solid var(--ink); background: var(--gold); color: var(--ink);
  box-shadow: var(--shadow); text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover, .cta:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); background: var(--gold-bright); color: var(--ink); }
.btn:active, .cta:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost, .cta.ghost { background: rgba(21, 14, 8, .55); color: var(--gold-bright); border-color: var(--gold); }
.btn.ghost:hover, .cta.ghost:hover { background: rgba(21,14,8,.8); color: var(--gold-bright); }

/* ---------- facts strip (gold band) ---------- */
.facts-strip {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-bottom: 4px solid var(--ink);
  color: var(--ink);
}
.facts { display: flex; flex-wrap: wrap; gap: 10px 34px; padding: 16px 20px; justify-content: center; }
.fact { display: flex; align-items: baseline; gap: 8px; }
.fact-k { font: 600 12.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: #6b4a12; }
.fact-v { font-family: var(--display); font-size: 18px; color: var(--ink); }

/* ---------- sections & grids ---------- */
.section-head { margin: 46px 0 20px; }
.section-head .overline {
  display: block; margin-bottom: 6px; color: var(--red-bright);
  font-weight: 600; font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
}
.section-head h2 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(26px, 3.6vw, 36px); color: var(--parchment); line-height: 1.15;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 8px;
  background: radial-gradient(circle at 32% 30%, var(--gold-bright), var(--gold) 70%);
  border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--display); font-size: 17px; color: var(--ink);
  transform: rotate(-4deg);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.grid.sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: var(--text);
  transition: transform .14s, box-shadow .14s;
}
.card::before { content: ""; height: 6px; background: linear-gradient(90deg, var(--gold), var(--red)); display: block; }
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); color: var(--text); }
.card .thumb { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-bottom: 3px solid var(--ink); background: var(--surface2); }
.card-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.25; color: var(--parchment); }
.card:hover h3 { color: var(--gold-bright); }
.card-body p { margin: 0; font-size: 15px; color: var(--muted); }
.card .go { margin-top: auto; color: var(--gold); font-weight: 600; font-size: 14.5px; letter-spacing: .05em; }

.pill-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--red); color: #fff5e6; border: 2px solid var(--ink);
  border-radius: 999px; box-shadow: 2px 2px 0 var(--ink);
  font: 600 12px/1 var(--font); letter-spacing: .06em; padding: 6px 11px;
  transform: rotate(-3deg); text-transform: uppercase;
}

/* ---------- article layout ---------- */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 40px; align-items: start; }
.article-grid > div { min-width: 0; overflow-wrap: anywhere; }
.crumb { margin: 26px 0 8px; font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb .sep { margin: 0 7px; color: var(--gold); }
article h1 {
  margin: 6px 0 18px; font-family: var(--display); font-weight: 400;
  font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; color: var(--parchment);
  text-shadow: 3px 3px 0 var(--ink);
}
article h2 {
  margin: 42px 0 14px; font-family: var(--display); font-weight: 400; font-size: 27px;
  color: var(--gold-bright); line-height: 1.25;
  border-bottom: 2px dashed var(--line); padding-bottom: 8px;
  scroll-margin-top: 84px;
}
article h3 { margin: 28px 0 10px; font-size: 20px; color: var(--parchment); font-weight: 600; }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 18px; padding-left: 26px; }
article li { margin-bottom: 8px; }
article li::marker { color: var(--gold); font-weight: 700; }
article strong { color: var(--gold-bright); font-weight: 600; }
article img, .zoom {
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 8px 0 6px; cursor: zoom-in;
}
figcaption, .imgcap { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }

/* quick answer parchment scroll */
.quick-answer {
  position: relative; background: linear-gradient(180deg, var(--parchment), var(--parchment-dark));
  color: #33240f; border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 22px 18px; margin: 20px 0 26px;
}
.quick-answer p { margin: 0; font-size: 17.5px; }
.quick-answer .qa-stamp {
  position: absolute; top: -14px; left: 18px;
  background: var(--red); color: #fff5e6; border: 2px solid var(--ink);
  border-radius: 999px; box-shadow: 2px 2px 0 var(--ink);
  font: 600 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase;
  padding: 7px 13px; transform: rotate(-2deg);
}
.quick-answer::after {
  content: ""; position: absolute; right: 16px; bottom: -10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--red-bright), var(--red) 72%);
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
}

/* callout */
.callout {
  background: var(--surface); border: 3px solid var(--ink); border-left: 6px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin: 20px 0;
}
.callout.note { border-left-color: var(--red); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

blockquote {
  margin: 20px 0; padding: 14px 18px 14px 40px; position: relative;
  background: rgba(242, 227, 193, .08); border: 2px solid var(--line); border-radius: var(--radius);
  color: #ded0b4; font-style: italic;
}
blockquote::before {
  content: ""; position: absolute; left: 14px; top: 18px;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--red-bright), var(--red) 72%);
  border: 2px solid var(--ink);
}

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 0 20px; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 15px;
  text-align: left; padding: 11px 14px; border-bottom: 3px solid var(--ink);
  white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:nth-child(even) td { background: rgba(58, 42, 27, .45); }
tr:last-child td { border-bottom: 0; }

/* toc sidebar */
.toc {
  position: sticky; top: 84px;
  background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 16px 14px; font-size: 14.5px;
}
.toc strong { display: block; font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--gold-bright); margin-bottom: 8px; letter-spacing: .04em; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0 0 7px; }
.toc-list a { color: var(--muted); text-decoration: none; border-left: 3px solid var(--line); padding-left: 9px; display: block; }
.toc-list a:hover { color: var(--gold-bright); border-left-color: var(--gold); }

.all-guides { margin: 44px 0 10px; }
.stamp { font-size: 12.5px; color: #8a795d; letter-spacing: .04em; }

/* lead & misc */
.lead { font-size: 19px; color: #e5d7bb; }
.muted { color: var(--muted); }
.eyebrow { color: var(--gold); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: 13px; }

/* ads */
.ad-slot { display: none; margin: 26px auto; }
.ad-label { position: absolute; top: 5px; left: 10px; font: 600 10px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); opacity: .6; }
.ad-inner { min-height: 90px; position: relative; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface2); overflow: hidden; }
.ad-inner-banner { min-height: 58px; }
.ad-banner-box { display: flex; align-items: center; justify-content: center; }
.ad-banner-box iframe { border: 0; display: block; }
@media (hover: hover) and (pointer: fine) { .ad-slot-native { display: block; } }
@media not all and (hover: hover) and (pointer: fine) { .ad-slot-mobile { display: block; } }
@media print { .ad-slot { display: none !important; } }

/* ---------- footer ---------- */
.foot {
  margin-top: 60px; background: var(--ink); border-top: 4px solid var(--gold);
  padding: 36px 0 30px; font-size: 14.5px; color: var(--muted);
}
.foot .wrap { display: grid; gap: 14px; }
.foot-brand { font-family: var(--display); font-size: 20px; color: var(--parchment); }
.foot-links { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.foot-links .sep { color: var(--line); }
.disclaimer { font-size: 13px; color: #8a795d; max-width: 76ch; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 90px 20px; }
.notfound h1 { font-family: var(--display); font-size: 54px; color: var(--parchment); text-shadow: 4px 4px  var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .article-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .hero { background-position: 70% top; }
  .hero::before { background: linear-gradient(160deg, rgba(21,14,8,.93) 0%, rgba(21,14,8,.8) 55%, rgba(21,14,8,.5) 100%); }
}
@media (max-width: 640px) {
  .bar { gap: 6px 8px; }
  .nav { width: 100%; order: 3; }
  .nav > ul { gap: 2px; }
  .nav a { padding: 7px 9px; font-size: 14.5px; }
  .brand { margin-right: 0; }
  .kids { position: static; display: none; box-shadow: none; border: 0; border-left: 3px solid var(--gold); margin: 4px 0 8px; min-width: 0; }
  .nav li.has-kids:hover > .kids, .nav li.has-kids:focus-within > .kids { display: block; }
  .nav li.has-kids::after { display: none; }
  .hero-in { padding: 54px 20px 46px; }
  .facts { gap: 8px 18px; }
}

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