/* ZONK website — shared styles for every page.
   Layout: a torch-lit stone hall. Pages are one centered column of "rooms",
   separated by riveted iron bands like the ones on the door in the main picture. */
:root {
  --stone: #191815;      /* page ground: dark mortar */
  --stone-2: #24221d;    /* raised stone panels */
  --stone-3: #2f2c25;    /* panel edges, inputs */
  --mortar: #47433a;     /* hairlines */
  --bone: #ece2cb;       /* main text */
  --ash: #a89f8b;        /* quiet text */
  --flame: #f3a73b;      /* torchlight accent */
  --ember: #c9561f;      /* hot accent, hover */
  --oak: #6e4627;        /* door wood */
  --iron: #0f0e0c;       /* iron bands */
  --rivet: #6d675b;
  --ok: #8fbf6a;
  --bad: #e07a5a;

  --display: "Pirata One", "Luminari", "Papyrus", Georgia, serif;
  --body: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --label: "Alegreya Sans SC", "Gill Sans", "Trebuchet MS", sans-serif;

  --step--1: .88rem;
  --step-0: 1.08rem;
  --step-1: 1.35rem;
  --step-2: 1.8rem;
  --step-3: 2.6rem;
  --step-4: clamp(3.4rem, 9vw, 6.5rem);

  --wrap: 72rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--stone); }
body {
  margin: 0;
  background:
    radial-gradient(60rem 30rem at 50% -8rem, rgba(243, 167, 59, .10), transparent 70%),
    var(--stone);
  color: var(--bone);
  font: 400 var(--step-0)/1.62 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--flame); text-underline-offset: .18em; }
a:hover { color: #ffc36a; }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; text-wrap: balance; margin: 0; letter-spacing: .01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); color: var(--bone); }
h3 { font-size: var(--step-2); }
.h-natural { text-wrap: pretty; }
p { margin: 0; }
.eyebrow {
  font: 500 var(--step--1)/1.2 var(--label);
  letter-spacing: .14em;
  text-transform: lowercase;
  color: var(--flame);
}
.lede { font-size: var(--step-1); color: var(--bone); max-width: 38em; }
.quiet { color: var(--ash); }
.measure { max-width: 40em; }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(20, 19, 16, .94);
  backdrop-filter: blur(6px);
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 21; background: var(--iron);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; flex-wrap: wrap; padding-block: 10px;
}
.mark {
  font: 400 2.3rem/1 var(--display);
  color: var(--flame);
  text-decoration: none;
  letter-spacing: .04em;
  text-shadow: 0 0 18px rgba(243, 167, 59, .45), 0 2px 0 var(--iron);
}
.mark:hover { color: #ffc36a; }
/* the logo (wwwroot/img/logo-sm.png, from Creative/4000 WIDE LOGO PNG.png) */
.mark img { display: block; height: 46px; width: auto; transition: filter .2s; }
.mark:hover img { filter: brightness(1.12) drop-shadow(0 0 10px rgba(243, 167, 59, .45)); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: block;
  padding: 8px 14px;
  font: 500 1.05rem/1 var(--label);
  letter-spacing: .08em;
  text-transform: lowercase;
  color: var(--ash);
  text-decoration: none;
  border-radius: 3px;
}
.nav a:hover { color: var(--bone); background: var(--stone-3); }
.nav a[aria-current="page"] { color: var(--iron); background: var(--flame); }
.nav a.nav-play { color: var(--flame); box-shadow: inset 0 0 0 1px var(--flame); }
.nav a.nav-play[aria-current="page"] { color: var(--iron); }

/* the iron band: a strap of black iron with rivets, as on the door */
.band {
  height: 14px;
  background:
    radial-gradient(circle at 50% 50%, var(--rivet) 0 2.6px, #2b2924 3px, transparent 3.6px) 0 50% / 64px 14px repeat-x,
    linear-gradient(#2a2823, var(--iron) 45%, #050504);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 6px 14px rgba(0, 0, 0, .55);
}

main { flex: 1; }
.room { padding-block: clamp(48px, 8vw, 96px); }
.room + .band { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-lg { display: flex; flex-direction: column; gap: 36px; }

/* ---------- buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px;
  font: 500 1.15rem/1 var(--label);
  letter-spacing: .08em;
  text-transform: lowercase;
  text-decoration: none;
  border: 0; border-radius: 3px; cursor: pointer;
  color: var(--bone);
  background: linear-gradient(#3a372f, #2a2822);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px var(--iron), 0 4px 10px rgba(0, 0, 0, .5);
}
.btn:hover { color: #fff; background: linear-gradient(#47433a, #322f28); }
.btn-flame {
  color: #1b1004;
  background: linear-gradient(#ffc061, var(--flame) 55%, #d9831f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 1px #5a3108, 0 0 26px rgba(243, 167, 59, .35);
}
.btn-flame:hover { color: #000; background: linear-gradient(#ffd08a, #ffb24a 55%, #e38f2a); }

/* ---------- hero (home) ---------- */
.hero { position: relative; background: var(--stone); }
.hero-frame {
  position: relative; width: min(100%, 1448px, 120vh); margin-inline: auto; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.hero-frame > img { width: 100%; height: auto; aspect-ratio: 1448 / 1086; }
.hero-frame::after {     /* fade into the page at the foot */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, var(--stone) 0%, rgba(25, 24, 21, .86) 22%, rgba(25, 24, 21, 0) 52%),
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0, 0, 0, .55));
}
.torch {                 /* living glow laid over the painted torches */
  position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 176, 70, .42), rgba(255, 140, 40, .12) 40%, transparent 68%);
  mix-blend-mode: screen; pointer-events: none;
  animation: flicker 2.6s infinite steps(1, end);
}
.torch.t1 { left: 30%; top: 32%; }
.torch.t2 { left: 73.5%; top: 32%; animation-delay: -1.3s; animation-duration: 3.1s; }
@keyframes flicker {
  0% { opacity: .9; } 12% { opacity: .65; } 20% { opacity: 1; } 34% { opacity: .78; }
  48% { opacity: .95; } 61% { opacity: .7; } 75% { opacity: 1; } 88% { opacity: .82; }
}
.door-link {             /* the painted door is a real link into the game */
  position: absolute; left: 41.5%; top: 21%; width: 20.5%; height: 46%;
  border-radius: 48% 48% 4px 4px / 30% 30% 4px 4px;
  z-index: 2;
}
.door-link span {
  position: absolute; left: 50%; bottom: -2.4rem; transform: translateX(-50%);
  white-space: nowrap; padding: 6px 12px; border-radius: 3px;
  font: 500 .95rem/1 var(--label); letter-spacing: .08em; text-transform: lowercase;
  color: #1b1004; background: var(--flame);
  opacity: 0; transition: opacity .2s;
}
.door-link:hover, .door-link:focus-visible { box-shadow: 0 0 0 2px rgba(243, 167, 59, .8), 0 0 40px rgba(243, 167, 59, .45); }
.door-link:hover span, .door-link:focus-visible span { opacity: 1; }
/* overlap is a share of the frame's width (same min() as .hero-frame) so the copy
   always starts below the door and its "open the door" label */
.hero-copy {
  position: relative; z-index: 3; margin-top: calc(min(100vw, 1448px, 120vh) * -.17);
  padding-bottom: 8px; text-align: center; pointer-events: none;
}
.hero-copy a { pointer-events: auto; }
/* the logo (wwwroot/img/logo.png) sits on the wall above the door, centered on it */
.hero-logo {
  position: absolute; left: 51.75%; top: 2%; transform: translateX(-50%); z-index: 3;
  margin: 0; line-height: 0; pointer-events: none;
}
.hero-logo img { display: block; width: clamp(13rem, 44.6vw, 30.8rem); height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .8)); }
.hero-copy .tag { font: 400 var(--step-2)/1.15 var(--display); color: var(--bone); }
.hero-copy .lede { margin: 16px auto 0; }
.hero-copy .btns { margin-top: 26px; justify-content: center; }

/* page heads on inner pages */
.page-head { padding-block: clamp(40px, 7vw, 80px) clamp(24px, 4vw, 40px); }
.page-head h1 { font-size: clamp(3rem, 8vw, 5.4rem); color: var(--flame); text-shadow: 0 0 30px rgba(243, 167, 59, .3); }
.page-head .lede { margin-top: 14px; }

/* stone panels */
.slab {
  background: linear-gradient(170deg, var(--stone-2), #1e1c18);
  border: 1px solid var(--mortar);
  border-radius: 4px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 24px rgba(0, 0, 0, .35);
  min-width: 0;
}
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 24px; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr)); gap: 16px; }
.slab h3 { color: var(--flame); margin-bottom: 8px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: clamp(24px, 5vw, 56px); align-items: center; }
.split > * { min-width: 0; }

/* framed screenshots */
.shot {
  margin: 0;
  background: var(--iron);
  border: 1px solid var(--mortar);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.shot img { width: 100%; height: auto; }
.shot figcaption { padding: 10px 14px 12px; font-size: var(--step--1); color: var(--ash); border-top: 1px solid var(--stone-3); }
.shot figcaption b { color: var(--bone); font-weight: 700; }
button.shot { padding: 0; text-align: left; cursor: zoom-in; color: inherit; font: inherit; display: block; width: 100%; }
button.shot:hover { border-color: var(--flame); }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 14px; }

/* stat lines in the bestiary and party cards */
.stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 10px 0 0; font-size: var(--step--1); }
.stats dt { font-family: var(--label); letter-spacing: .08em; text-transform: lowercase; color: var(--ash); }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font: 500 .85rem/1.2 var(--label); letter-spacing: .08em; text-transform: lowercase;
  color: var(--flame); box-shadow: inset 0 0 0 1px rgba(243, 167, 59, .55);
}
.chip.undead { color: #c8d4ff; box-shadow: inset 0 0 0 1px rgba(200, 212, 255, .45); }
.chip.boss { color: var(--iron); background: var(--ember); box-shadow: none; }

/* the descent: an ordered list of levels */
.descent { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: lvl; }
.descent li {
  counter-increment: lvl;
  display: grid; grid-template-columns: 3.2rem 1fr; gap: 4px 16px; align-items: baseline;
  padding: 14px 16px; background: var(--stone-2); border-left: 3px solid var(--oak);
}
.descent li::before { content: counter(lvl); font: 400 2rem/1 var(--display); color: var(--flame); grid-row: span 2; }
.descent li:last-child { border-left-color: var(--ember); }
.descent b { font-family: var(--display); font-weight: 400; font-size: var(--step-1); }
.descent span { color: var(--ash); font-size: var(--step--1); grid-column: 2; }

/* key caps on the play page */
.keys { width: 100%; border-collapse: collapse; }
.keys td, .keys th { padding: 10px 8px; border-bottom: 1px solid var(--stone-3); text-align: left; vertical-align: middle; }
.keys th { font: 500 var(--step--1)/1.2 var(--label); letter-spacing: .1em; text-transform: lowercase; color: var(--ash); }
kbd {
  display: inline-block; min-width: 2rem; padding: 4px 8px; margin: 2px 3px 2px 0;
  font: 600 .9rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  text-align: center; color: var(--bone);
  background: linear-gradient(#3b3830, #2a2721); border-radius: 4px;
  box-shadow: inset 0 -2px 0 var(--iron), 0 0 0 1px var(--iron);
}

/* the play gate */
.gate {
  position: relative; overflow: hidden; border-radius: 4px; border: 1px solid var(--mortar);
  background: var(--iron);
}
.gate img { width: 100%; height: auto; opacity: .55; }
.gate-copy {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 55%, rgba(0, 0, 0, .25), rgba(0, 0, 0, .7));
}
.gate-copy h2 { color: var(--flame); font-size: clamp(2.4rem, 6vw, 4rem); text-shadow: 0 0 26px rgba(243, 167, 59, .4); }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font: 500 1rem/1.2 var(--label); letter-spacing: .08em; text-transform: lowercase; color: var(--ash); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  font: 400 var(--step-0)/1.4 var(--body); color: var(--bone);
  background: var(--stone); border: 1px solid var(--mortar); border-radius: 3px;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(243, 167, 59, .2); }
.field .err { color: var(--bad); font-size: var(--step--1); min-height: 1.2em; }
.field .err.hint { color: var(--ash); }
.field [aria-invalid="true"] { border-color: var(--bad); }
.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 18px; }
.notice { padding: 16px 18px; border-radius: 3px; background: var(--stone-3); border-left: 3px solid var(--flame); }
.notice.ok { border-left-color: var(--ok); }
.notice pre { white-space: pre-wrap; word-break: break-word; font: 400 .92rem/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--ash); margin: 10px 0 0; max-height: 14rem; overflow: auto; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--stone-2); border: 1px solid var(--mortar); border-radius: 3px; padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin-top: 8px; color: var(--ash); }

/* lightbox */
dialog.lightbox {
  padding: 0; border: 1px solid var(--mortar); border-radius: 4px; background: var(--iron); color: var(--bone);
  max-width: min(1200px, 94vw); width: 100%;
}
dialog.lightbox::backdrop { background: rgba(5, 5, 4, .85); }
dialog.lightbox img { width: 100%; height: auto; }
dialog.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
dialog.lightbox .lb-bar p { color: var(--ash); font-size: var(--step--1); }

/* ---------- footer ---------- */
.site-foot { background: #121110; padding-bottom: env(safe-area-inset-bottom, 0px); }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-block: 26px; color: var(--ash); font-size: var(--step--1); }
.site-foot .mark { font-size: 1.7rem; }
.site-foot .mark img { height: 36px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--ash); text-decoration: none; }
.foot-links a:hover { color: var(--flame); }

@media (max-width: 640px) {
  .site-head .wrap { justify-content: center; }
  .nav a { padding: 7px 10px; font-size: .98rem; }
  .door-link span { display: none; }
  .hero-copy { margin-top: -3rem; }
  .hero-frame { -webkit-mask-image: none; mask-image: none; }
}
@media (prefers-reduced-motion: reduce) {
  .torch { animation: none; opacity: .85; }
  * { transition: none !important; }
}

/* ---------- accounts (Zonk.Web) ---------- */
.nav li.nav-acct { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--mortar); }
.flash { padding-top: 22px; }
.notice.bad { border-left-color: var(--bad); }
.notice p + p { margin-top: 8px; }
code { font: 400 .92em/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--bone); background: var(--stone-3); padding: 1px 5px; border-radius: 3px; word-break: break-word; }

/* login, register, forgot, reset: one narrow panel */
.auth { max-width: 32rem; margin-inline: auto; width: 100%; }
.auth .page-sub { color: var(--ash); margin-top: 6px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-row a { font-size: var(--step--1); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--bone); cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .25rem; accent-color: var(--flame); flex: none; }
.btn-full { width: 100%; }
.btn-link { background: none; box-shadow: none; color: var(--flame); padding-inline: 0; }
.btn-link:hover { background: none; color: #ffc36a; }
.captcha .g-recaptcha { min-height: 78px; }

/* profile */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
.facts dt { font: 500 1rem/1.5 var(--label); letter-spacing: .08em; text-transform: lowercase; color: var(--ash); }
.facts dd { margin: 0; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--stone); border: 1px solid var(--mortar); border-radius: 3px; }
.mini-list .meta { color: var(--ash); font-size: var(--step--1); }
.foot-note { display: grid; gap: 4px; }
.foot-note .credit { font-size: .8rem; color: #6f6a5d; }
.foot-note .credit a { color: var(--ash); }
.foot-note .credit a:hover { color: var(--flame); }

/* ---------- admin pages ---------- */
.admin-name { font-size: clamp(1.8rem, 5vw, 3rem); overflow-wrap: anywhere; }
.admin-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 18px; align-items: end; }
.admin-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { font: 500 1rem/1.2 var(--label); letter-spacing: .08em; text-transform: lowercase; color: var(--ash); text-align: left; }
.admin-table th, .admin-table td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--mortar); white-space: nowrap; vertical-align: middle; }
.admin-table td form { margin: 0; }
.admin-table .wraps { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .admin-table .wide-only { display: none; }
}
