/* Dungeons & Digraphs — site styles
   Palette and type are taken from the app icon and feature graphic:
   violet night, parchment pages, steel and amber, sparkle yellow.
   Erica One + Outfit, both SIL OFL, self-hosted (see /fonts). */

@font-face {
  font-family: "Erica One";
  src: url("../fonts/EricaOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("../fonts/Outfit-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("../fonts/Outfit-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --night: #14082b;
  --dusk: #2b1259;
  --violet: #45217c;
  --glow: #a86fb8;
  --sparkle: #fde047;
  --amber: #d97706;
  --page: #faf4e3;
  --page-shade: #e6dbb8;
  --ink: #2b1a0c;
  --ink-soft: #5a4630;
  --outline: #503714;
  --violet-ink: #3b1264;
  --link-on-page: #5b21b6;
  --lav: #e9d5ff;
  --lav-soft: #cdb8f0;
  --fighter: #60a5fa;
  --wizard: #c084fc;
  --ranger: #4ade80;
  --wrap: 1080px;
  --display: "Erica One", "Arial Black", Impact, sans-serif;
  --body: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--lav);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--sparkle); text-underline-offset: 0.18em; }
a:hover { color: #fff3a3; }
:focus-visible { outline: 3px solid var(--sparkle); outline-offset: 3px; border-radius: 4px; }
.spread :focus-visible, .doc :focus-visible { outline-color: var(--link-on-page); }

.wrap { width: min(var(--wrap), calc(100% - 2.5rem)); margin-inline: auto; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--sparkle); color: var(--night); padding: .6rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 1rem; }

h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: .005em; }
h2 { font-size: clamp(1.9rem, 4.6vw, 2.75rem); line-height: 1.08; }
h3 { font: 700 1.25rem/1.25 var(--body); margin: 0; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

/* ---------- header ---------- */
.site-header { position: relative; z-index: 5; }
.site-header.over { position: absolute; left: 0; right: 0; top: 0; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem 2rem; padding-block: 1rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand img { width: 46px; height: 46px; border-radius: 11px; display: block; }
.brand span { font-family: var(--display); font-size: 1.35rem; color: var(--sparkle); line-height: 1; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; list-style: none; }
.nav a {
  display: inline-block; padding: .5rem 0; color: var(--lav);
  font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--sparkle); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(20, 8, 43, 0) 72%, var(--night) 100%),
    radial-gradient(120% 95% at 76% 32%, #4a2585 0%, var(--dusk) 40%, var(--night) 82%);
  padding-top: 5.5rem; /* clears the overlaid header */
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.5rem 3rem; align-items: center;
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 8vw, 6rem);
}
.wordmark {
  --o: #3b1264;
  font-size: clamp(2.6rem, 7.2vw, 5rem); line-height: 1; color: var(--sparkle);
  text-shadow:
    .04em 0 0 var(--o), -.04em 0 0 var(--o), 0 .04em 0 var(--o), 0 -.04em 0 var(--o),
    .03em .03em 0 var(--o), -.03em .03em 0 var(--o), .03em -.03em 0 var(--o), -.03em -.03em 0 var(--o),
    0 .09em .12em rgba(0, 0, 0, .35);
}
.wordmark span { display: block; }
.tagline { font: 700 clamp(1.3rem, 3vw, 1.7rem)/1.25 var(--body); color: var(--lav); margin: 1.1rem 0 .9rem; }
.lead { max-width: 34rem; color: var(--lav-soft); font-size: 1.15rem; }
.soon { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin-top: 1.6rem; }
.soon li {
  padding: .5rem 1.1rem; border: 2px solid rgba(253, 224, 71, .55); border-radius: 999px;
  font-weight: 700; font-size: .98rem; color: var(--sparkle);
}
.emblem { position: relative; justify-self: center; width: min(430px, 100%); }
.emblem::before {
  content: ""; position: absolute; inset: 6% -8% 4%;
  background: radial-gradient(closest-side, rgba(168, 111, 184, .75), rgba(168, 111, 184, 0));
  filter: blur(6px); z-index: 0;
}
.emblem svg { position: relative; z-index: 1; display: block; width: 100%; height: auto; overflow: visible; }
.pop { transform-box: fill-box; transform-origin: center; animation: pop .8s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes pop { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- sections ---------- */
.band { padding-block: clamp(3rem, 8vw, 5.5rem); }
.band > .wrap > h2 { max-width: 30ch; }

/* ---------- the book: parchment spreads ---------- */
.spread {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--page); color: var(--ink);
  border: 3px solid var(--outline); border-radius: 10px;
  box-shadow: 0 34px 60px -26px rgba(0, 0, 0, .7), 0 0 0 7px rgba(0, 0, 0, .18);
}
.spread::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 4.5rem; transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(80, 55, 20, 0), rgba(80, 55, 20, .2) 50%, rgba(80, 55, 20, 0));
  pointer-events: none; z-index: 1;
}
.page { padding: clamp(1.5rem, 4vw, 3rem); position: relative; }
.page.l { background: var(--page); border-radius: 7px 0 0 7px; }
.page.r { background: var(--page-shade); border-radius: 0 7px 7px 0; }
.spread h2, .doc h1, .doc h2 { color: var(--violet-ink); }
.spread a, .doc a { color: var(--link-on-page); }

.steps { list-style: none; counter-reset: step; margin-top: 1.5rem; display: grid; gap: 1.25rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3.4rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: .1rem;
  display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  font: 700 1.15rem/1 var(--body); color: var(--page); background: var(--violet-ink);
}
.steps h3 { color: var(--violet-ink); margin-bottom: .15rem; }
.steps p { margin: 0; }
.aside { margin: 1.5rem 0 0; font-size: .95rem; color: var(--ink-soft); }

.facts { list-style: none; display: grid; gap: 0; margin-top: .25rem; }
.facts li { padding: 1rem 0; border-bottom: 1px dotted rgba(80, 55, 20, .55); }
.facts li:last-child { border-bottom: 0; }
.facts b { display: block; color: var(--violet-ink); font-size: 1.1rem; margin-bottom: .1rem; }
.facts span { display: block; }
.page-intro { margin-top: 1.1rem; font-size: 1.15rem; }

/* a note pinned to the page: the real custom-word format */
.note {
  margin: 1.6rem 0 0; padding: 1rem 1.1rem; background: #f1e6c2; border: 1px dashed var(--outline); border-radius: 8px;
  transform: rotate(-1deg);
}
.note p { margin: 0 0 .5rem; font-size: .95rem; color: var(--ink-soft); }
.note pre {
  margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink);
  font: 600 .88rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- the mini battle ---------- */
.stage { display: grid; place-items: center; height: 100%; align-content: center; gap: .75rem; }
.battle {
  width: min(340px, 100%); padding: 1rem 1rem 1.1rem;
  background: linear-gradient(180deg, #2a1552, #170a33);
  border: 2px solid #6d3fb5; border-radius: 22px; color: var(--lav);
  box-shadow: 0 18px 30px -14px rgba(20, 8, 43, .8);
}
.foe { display: flex; align-items: center; gap: .9rem; }
.foe-emoji { font-size: 3.2rem; line-height: 1; display: block; }
.foe-emoji.hit { animation: hit .45s ease; }
.foe-emoji.down { animation: down .7s ease forwards; }
@keyframes hit { 0%, 100% { transform: none; } 20% { transform: translateX(-9px) rotate(-8deg); } 55% { transform: translateX(8px) rotate(6deg); } }
@keyframes down { to { transform: translateY(14px) rotate(-70deg) scale(.7); opacity: .2; } }
.foe-info { flex: 1; }
.foe-name { font-weight: 700; margin-bottom: .3rem; }
.hp { display: flex; gap: 5px; }
.hp i { height: 12px; flex: 1; border-radius: 6px; background: #f43f5e; transition: background .3s, opacity .3s; }
.hp i.gone { background: #3b2a63; }
.clue {
  margin: 1rem 0 .9rem; padding: .7rem .8rem; border-radius: 12px; background: #120826;
  font-style: italic; font-size: .98rem; line-height: 1.45; color: var(--lav);
}
.slots, .tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; }
.slots { margin-bottom: .8rem; }
.slot {
  width: 2.7rem; height: 3.1rem; border-radius: 10px; padding: 0;
  border: 2px dashed #7c3aed; background: #1e0f40; color: #fff;
  font: 800 1.45rem var(--body); text-transform: uppercase; cursor: pointer;
}
.slot.filled { border-style: solid; background: #6b21a8; }
.slot:disabled { cursor: default; }
.tile {
  width: 2.7rem; height: 3.1rem; border-radius: 11px; border: 0; padding: 0; cursor: pointer;
  background: linear-gradient(#fbbf24, #d97706); color: #2b1200;
  font: 800 1.45rem var(--body); text-transform: uppercase;
  box-shadow: 0 4px 0 #92400e;
}
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 #92400e; }
.tile[disabled] { visibility: hidden; }
.tiles { min-height: 3.5rem; }
.status { min-height: 1.6rem; margin: .8rem 0 0; text-align: center; font-weight: 700; font-size: .98rem; color: var(--sparkle); }
.battle.shake .slots { animation: hit .45s ease; }
.mini-btn {
  display: block; margin: .35rem auto 0; padding: .45rem 1rem; border-radius: 999px; cursor: pointer;
  background: transparent; border: 2px solid #6d3fb5; color: var(--lav); font: 700 .9rem var(--body);
}
.mini-btn:hover { border-color: var(--sparkle); color: #fff; }
.stage-note { font-size: .9rem; color: var(--ink-soft); margin: 0; text-align: center; max-width: 30ch; }

/* ---------- heroes ---------- */
.heroes-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 2rem 4rem; align-items: start; margin-top: 2rem; }
.classes { list-style: none; }
.class { display: grid; grid-template-columns: 3.4rem 1fr; gap: 1.1rem; padding: 1.25rem 0; border-top: 1px solid rgba(205, 184, 240, .25); }
.class:first-child { border-top: 0; padding-top: 0; }
.class .ico {
  width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center;
  color: var(--c); border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.class .ico svg { width: 1.7rem; height: 1.7rem; }
.class h3 { color: var(--c); margin-bottom: .2rem; }
.class p { margin: 0; color: var(--lav); }
.class p + p { margin-top: .35rem; color: var(--lav-soft); }
.class.fighter { --c: var(--fighter); }
.class.wizard { --c: var(--wizard); }
.class.ranger { --c: var(--ranger); }
.small { font-size: .95rem; color: var(--lav-soft); }
.collect { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(205, 184, 240, .25); }
.collect h3 { color: var(--sparkle); margin-bottom: .35rem; }
.phone {
  justify-self: center; width: min(270px, 78%); padding: 9px; border-radius: 34px;
  background: #0a0416; border: 2px solid #4b2a86; box-shadow: 0 30px 50px -24px #000, 0 0 60px -10px rgba(168, 111, 184, .5);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 26px; }
.phone-cap { text-align: center; font-size: .9rem; color: var(--lav-soft); margin: .9rem auto 0; max-width: 26ch; }

/* ---------- private + premium ---------- */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 4.5rem; }
.two h2 { margin-bottom: 1rem; font-size: clamp(1.6rem, 3.3vw, 2.25rem); }
.checks { list-style: none; margin: 1rem 0 1rem; }
.checks li { position: relative; padding: .35rem 0 .35rem 1.9rem; }
.checks li::before {
  content: ""; position: absolute; left: .15rem; top: .8rem; width: .75rem; height: .75rem;
  background: var(--sparkle); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.night-band { background: linear-gradient(180deg, var(--night), #1d0d3b); }

/* ---------- long documents (privacy, support) ---------- */
.page-head { padding-block: clamp(1.5rem, 4vw, 2.5rem) 1.5rem; }
.page-head h1 { font-size: clamp(2.4rem, 7vw, 4rem); color: var(--sparkle); line-height: 1; }
.page-head p { margin: .8rem 0 0; color: var(--lav-soft); max-width: 40rem; font-size: 1.15rem; }
.doc {
  background: var(--page); color: var(--ink); border: 3px solid var(--outline); border-radius: 10px;
  box-shadow: 0 34px 60px -26px rgba(0, 0, 0, .7), 0 0 0 7px rgba(0, 0, 0, .18);
  padding: clamp(1.5rem, 5vw, 3.5rem); margin-bottom: 4rem;
}
.doc > * { max-width: 44rem; margin-inline: auto; }
.doc h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 2.4rem auto .7rem; }
.doc h3 { color: var(--violet-ink); margin: 1.5rem auto .3rem; font-size: 1.1rem; }
.doc ul.plain { margin: 0 auto 1em; padding-left: 1.3rem; }
.doc ul.plain li { margin: .35rem 0; }
.doc .updated { color: var(--ink-soft); margin-bottom: 1.5rem; }
.summary {
  background: #fff9e6; border: 2px solid var(--outline); border-radius: 12px; padding: 1.2rem 1.4rem; margin-block: 1rem 1.5rem;
}
.summary h2 { margin: 0 0 .5rem !important; font-size: 1.4rem !important; }
.summary ul { margin: 0; padding-left: 1.2rem; }
.summary li { margin: .3rem 0; }
.quote { border-left: 4px solid var(--amber); padding: .2rem 0 .2rem 1rem; color: var(--ink-soft); font-size: .98rem; }
.doc code, .doc kbd {
  font: 600 .92em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(80, 55, 20, .1); padding: .1em .35em; border-radius: 5px; color: var(--violet-ink); word-break: break-word;
}
details { border-top: 1px dotted rgba(80, 55, 20, .55); padding: .2rem 0; }
details:last-of-type { border-bottom: 1px dotted rgba(80, 55, 20, .55); }
summary {
  cursor: pointer; font-weight: 700; font-size: 1.1rem; color: var(--violet-ink); padding: .8rem 0; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 1.6rem/1 var(--display); color: var(--amber); flex: none; }
details[open] summary::after { content: "\2212"; }
details > :not(summary) { margin-top: 0; }
details p:last-child, details ol:last-child { margin-bottom: 1rem; }
.contact-line { font-size: 1.2rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid rgba(205, 184, 240, .22); padding-block: 2.5rem 3rem; color: var(--lav-soft); font-size: .98rem; }
.foot { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1.5rem 3rem; }
.foot .brand span { font-size: 1.15rem; }
.foot ul { list-style: none; display: grid; gap: .3rem; }
.foot h2 { font: 700 1rem var(--body); color: var(--lav); margin-bottom: .5rem; }
.fine { margin-top: 2rem; font-size: .88rem; color: #a893d0; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero { padding-top: 8.25rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .wordmark { font-size: clamp(2.6rem, 12vw, 4.5rem); }
  .emblem { grid-row: 1; width: min(250px, 62%); justify-self: start; }
  .spread { grid-template-columns: 1fr; }
  .spread::before { display: none; }
  .page.l { border-radius: 7px 7px 0 0; }
  .page.r { border-radius: 0 0 7px 7px; border-top: 3px solid var(--outline); }
  .heroes-grid, .two { grid-template-columns: 1fr; }
  .phone { justify-self: start; }
  .phone-cap { text-align: left; margin-left: 0; }
  .foot { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .slot, .tile { width: 2.45rem; height: 2.9rem; font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pop, .foe-emoji.hit, .foe-emoji.down, .battle.shake .slots { animation: none !important; }
}
