/* The Red Wyrm website: dark, warm and gold, like the game's board. */
:root {
  --bg: #170b08;
  --bg2: #22110c;
  --panel: #2a1610;
  --line: #5a3a22;
  --text: #ecdcc4;
  --muted: #b9a58c;
  --gold: #ecc46c;
  --gold-dark: #96682a;
  --red: #8c2614;
  --red-dark: #4e1009;
  --red-hover: #b23a1c;
  /* aspect frames (src/py/wyrm_gfx.py ASPECT) */
  --O: #deb648;
  --W: #4678d2;
  --N: #50a046;
  --R: #c43022;
  --D: #b03aa8;
  --C: #8a8a96;
  --max: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg) radial-gradient(ellipse at 50% -10%, #3a1a10 0%, transparent 60%) no-repeat;
  color: var(--text);
  font: 400 1.125rem/1.6 Alegreya, Georgia, serif;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); }
a:hover { color: #fff0c0; }
h1, h2, h3 { font-family: Cinzel, Georgia, serif; font-weight: 700; color: var(--gold); line-height: 1.2; letter-spacing: 0.02em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0.5em 0 0.2em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 0.5em; }
h3 { font-size: 1.15rem; margin: 0 0 0.3em; }
code { font-family: ui-monospace, monospace; font-size: 0.9em; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.35em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.sub { color: var(--muted); margin-top: 0; max-width: 60ch; }

/* ---- header ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 20px;
  background: rgba(23, 11, 8, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.15rem Cinzel, serif; color: var(--gold); }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { color: var(--text); text-decoration: none; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--gold); }
.top nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
.menu { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--gold); font-size: 1.3rem; border-radius: 6px; padding: 2px 10px; cursor: pointer; }

/* ---- buttons (the game's red and gold) ---- */
.button {
  display: inline-block;
  padding: 0.6em 1.4em;
  font: 700 1.05rem Cinzel, serif;
  color: #fff3d6;
  text-decoration: none;
  background: linear-gradient(#8c2614, #4e1009);
  border: 2px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 0 0 1px #000, 0 4px 14px rgba(0, 0, 0, 0.5);
}
.button:hover { color: #fff; background: linear-gradient(#b23a1c, #681a0c); box-shadow: 0 0 18px rgba(236, 196, 108, 0.35); }
.button.quiet { background: rgba(20, 10, 6, 0.6); border-color: var(--gold-dark); }

/* ---- home ---- */
.hero-banner { position: relative; min-height: min(78vh, 760px); display: flex; align-items: flex-end; overflow: hidden; }
.hero-banner picture, .banner-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.hero-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 2%, rgba(23, 11, 8, 0.45) 40%, transparent 70%); }
.banner-text { position: relative; z-index: 1; max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 16px 48px; }
.banner-text h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin: 0; text-shadow: 0 3px 18px #000, 0 0 2px #000; }
.tagline { font-size: clamp(1.15rem, 2.2vw, 1.45rem); margin: 0.2em 0 1.2em; max-width: 34ch; text-shadow: 0 2px 10px #000; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

.intro { padding-top: 32px; padding-bottom: 24px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.facts div { text-align: center; padding: 14px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.facts b { display: block; font: 700 2rem Cinzel, serif; color: var(--gold); }
.facts span { color: var(--muted); }
.lede { font-size: 1.3rem; max-width: 62ch; }

section.wrap { margin-top: 56px; }
.aspect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.aspect { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--ac); border-radius: 10px; }
.aspect h3 { color: var(--ac); }
.aspect-sym { font-size: 1.8rem; line-height: 1; margin-bottom: 8px; }
.aspect .motto { font-style: italic; margin: 0 0 0.4em; }
.aspect p { margin: 0; color: var(--muted); font-size: 1rem; }
.a-O { --ac: var(--O); } .a-W { --ac: var(--W); } .a-N { --ac: var(--N); }
.a-R { --ac: var(--R); } .a-D { --ac: var(--D); } .a-C { --ac: var(--C); } .a-- { --ac: #c8b89c; }

.split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: center; }
.shot { margin: 0; }
.shot img { border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.points { padding-left: 1.1em; }
.points li { margin-bottom: 0.7em; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.three > div { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.three p { margin: 0; color: var(--muted); }
.download { padding: 28px; background: var(--panel); border: 1px solid var(--gold-dark); border-radius: 12px; }
.download ol li { margin-bottom: 0.4em; }

/* ---- How to Play ---- */
.guide { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding-top: 24px; }
.toc { position: sticky; top: 76px; align-self: start; }
.toc ol { padding-left: 1.3em; margin: 0; color: var(--muted); }
.toc li { margin-bottom: 0.35em; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--gold); }
.guide-page { padding: 8px 0 28px; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.guide-page:last-child { border-bottom: 0; }
.guide-body { display: flex; gap: 28px; align-items: flex-start; }
.guide-text { flex: 1; min-width: 0; }
.guide-text ul { padding-left: 1.2em; }
.guide-text li { margin-bottom: 0.35em; }
.guide-cards { display: flex; flex-direction: column; gap: 12px; flex: 0 0 200px; }

/* ---- Cards ---- */
.filters { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.filters input[type="search"] { font: inherit; padding: 0.5em 0.8em; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; max-width: 480px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 1rem Alegreya, serif; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--ac); border-radius: 999px; padding: 0.25em 0.9em; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ac); color: #120804; border-color: var(--ac); font-weight: 700; }
.selects { display: flex; flex-wrap: wrap; gap: 14px; }
.selects label { color: var(--muted); font-size: 1rem; }
.selects select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 0.2em 0.4em; margin-left: 4px; }
.count { color: var(--muted); margin: 0 0 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding-bottom: 40px; }
.card-tile { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; transition: transform 0.15s; }
.card-tile img { width: 100%; height: auto; border-radius: 10px; }
.card-tile:hover, .card-tile:focus-visible { transform: translateY(-4px) scale(1.03); outline: none; filter: drop-shadow(0 0 12px rgba(236, 196, 108, 0.45)); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--gold-dark); border-radius: 14px; padding: 24px; max-width: min(760px, 94vw); }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.dialog-body { display: flex; gap: 24px; align-items: flex-start; }
.dialog-body img { width: 300px; flex: 0 0 auto; border-radius: 12px; }
.card-info h2 { margin-top: 0; }
.card-info .meta, .card-info .stats { color: var(--muted); margin: 0 0 0.5em; }
.card-info .rules { white-space: pre-line; }
.card-info .help { white-space: pre-line; color: var(--muted); font-size: 1rem; }
.card-info .flavor { font-style: italic; color: var(--muted); }
.close { position: absolute; right: 10px; top: 6px; background: none; border: 0; color: var(--gold); font-size: 1.8rem; cursor: pointer; }

/* ---- Heroes ---- */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 18px; padding: 8px 0 40px; }
.hero-card { display: flex; gap: 20px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.portrait { flex: 0 0 150px; height: 150px; border-radius: 50%; padding: 5px; }
.portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.no-portrait { display: grid; place-items: center; height: 100%; border-radius: 50%; background: var(--bg2); font-size: 3rem; }
.hero-info h2 { margin: 0; font-size: 1.35rem; }
.hero-info p { margin: 0 0 0.5em; }
.hero-title { font-style: italic; color: var(--muted); }
.hero-aspects { font-weight: 500; }
.skill { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.skill img { width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--gold-dark); }
.skill h3 { font-size: 1rem; margin: 0; }
.skill p { font-size: 1rem; margin: 0; }
.skill-meta { color: var(--muted); }

/* ---- prose, footer ---- */
.prose { max-width: 760px; padding-bottom: 40px; }
footer { margin-top: 64px; padding: 28px 16px 40px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 0.95rem; }
footer p { max-width: 70ch; margin: 0.4em auto; }
.credit { font-size: 0.85rem; }

/* ---- narrow screens ---- */
@media (max-width: 900px) {
  .split, .three, .guide { grid-template-columns: 1fr; }
  .aspect-grid { grid-template-columns: 1fr 1fr; }
  .toc { position: static; }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 1.05rem; }
  .menu { display: block; }
  .top { flex-wrap: wrap; }
  .top nav { display: none; width: 100%; flex-direction: column; gap: 4px; }
  .nav-open .top nav { display: flex; }
  .facts { grid-template-columns: 1fr 1fr; }
  .aspect-grid { grid-template-columns: 1fr; }
  .guide-body { flex-direction: column; }
  .guide-cards { flex-direction: row; flex-basis: auto; }
  .guide-cards img { width: 45%; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-card { flex-direction: column; align-items: center; text-align: center; }
  .skill { text-align: left; }
  .dialog-body { flex-direction: column; align-items: center; }
  .dialog-body img { width: 240px; }
}
