/* Shared design system for every site page: tokens, fonts, page frame, header, menu, footer, frames,
   buttons, links, fields, rules, tabs, accordions, badges, sheets and feedback states. Look and sizes come
   from the pixel-art mockups in output/website-pixel-tibia-v3. Desktop lengths are mockup px at the 1086 px
   wide mockups (1 mockup px = 1 CSS px); phone lengths are half the 724 px phone mockups. Colours are
   sampled from the mockups where they differ from the handoff's hex values. */

/* Manrope's weight range starts at 500, so the mockups' medium body text is what a rule asking for 400
   gets: a variable font renders the requested weight clamped to the face's range. */
@font-face { font-family: 'Manrope'; font-weight: 500 800; font-display: swap; src: url(/assets/fonts/Manrope-variable.ttf) format('truetype'); }
/* Headings: Bitter at weight 900, the closest existing font to the mockups' heavy slab lettering. The face
   is declared at 900 only, so every heading rule renders Black whatever weight it asks for. */
@font-face { font-family: 'Bitter'; font-weight: 900; font-display: swap; src: url(/assets/fonts/Bitter-variable.ttf) format('truetype'); }

:root {
  --navy: #081a35;
  --navy-2: #0b2142;
  --navy-line: #1c3358;
  --parchment: #fbe9c5;
  --parchment-2: #f3dcb4;
  --surface: #fdf3df;
  --ink: #22180f;
  --ink-2: #3a2c21;
  --muted: #5d4a3a;
  --cream: #fff4dd;
  --cream-muted: #d9ccb4;
  --wordmark: #13213f;
  --burgundy: #7d1f2c;
  --burgundy-top: #932536;
  --burgundy-bottom: #66172a;
  --burgundy-hover: #9b303d;
  --link: #8a1c2c;
  --link-navy: #c22f43;
  --bronze: #d08641;
  --bronze-light: #f2b060;
  --bronze-dark: #8a5228;
  --line: #c9a06a;
  --field-line: #5b4636;
  --placeholder: #66707f;
  --focus: #e6c98b;

  --display: 'Bitter', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --page: 1320px;
  --zoom: 1;
  --gap: 12px;
  --hover: 150ms;

  /* Two-step corner notches matching frame.svg (4 px steps) and frame-sm.svg (2 px steps). */
  --notch: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px), 0 8px, 4px 8px, 4px 4px, 8px 4px);
  --notch-sm: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 2px 4px, 2px 2px, 4px 2px);
  --parchment-bg: radial-gradient(ellipse at 50% 45%, transparent 55%, rgb(176 118 52 / 0.22) 100%), url(/assets/art/parchment.svg) 0 0 / 320px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--navy); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: var(--ink);
  font: 400 18px/1.5 var(--sans);
  letter-spacing: 0.02em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body > main { flex: 1 0 auto; }
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
:where(ul, ol)[role="list"] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--burgundy); outline-offset: 3px; }
.on-navy :focus-visible, .site-footer :focus-visible { outline-color: var(--focus); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; } }

/* The page column: the mockups' 1086 px canvas, 10 px of navy either side of the panels. */
/* The column fills the window up to --page, and wider windows draw everything a little larger (--zoom),
   so the page keeps the mockups' full-width composition instead of floating in navy. Pages lay out
   fluidly between 1086 px (the mockups' canvas) and --page. */
.container, .page { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: 10px; zoom: var(--zoom); }
.sheet { zoom: var(--zoom); }
@media (min-width: 1200px) { :root { --zoom: 1.05; } }
@media (min-width: 1360px) { :root { --zoom: 1.1; } }
@media (min-width: 1500px) { :root { --zoom: 1.15; } }
@media (min-width: 1600px) { :root { --zoom: 1.2; } }
@media (min-width: 1750px) { :root { --zoom: 1.25; } }
@media (min-width: 1900px) { :root { --zoom: 1.3; } }
@media (min-width: 2200px) { :root { --zoom: 1.4; } }
@media (min-width: 2600px) { :root { --zoom: 1.6; } }
.page { display: flex; flex-direction: column; gap: var(--gap); }
/* The phone mockups leave about 5 px of navy beside the panels and 7 px between them. */
@media (max-width: 767px) {
  :root { --gap: 7px; }
  .container, .page { padding-inline: 5px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 100; padding: 10px 16px; background: var(--burgundy); color: var(--cream); font-weight: 700; }
.skip-link:focus { top: 12px; }
@media (min-width: 768px) { .phone-only { display: none !important; } }
@media (max-width: 767px) { .wide-only { display: none !important; } }

/* Type. Headings use Bitter Black (closer to the mockups' lettering than the handoff's Pixelify Sans);
   readable copy uses Manrope. Headings on navy carry the mockups' hard dark drop shadow. */
.display, .h1, .h2, .h3, .title { font-family: var(--display); font-weight: 700; letter-spacing: 0; color: var(--ink); }
.display { font-size: 60px; line-height: 1.05; }
.h1 { font-size: 48px; line-height: 1.08; }
.h2 { font-size: 40px; line-height: 1.15; }
.h3 { font-size: 24px; line-height: 1.25; }
.lede { font-size: 22px; line-height: 1.35; }
.muted { color: var(--muted); }
.label { font: 700 14px/1.4 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
.on-navy { color: var(--cream); }
.on-navy :is(.display, .h1, .h2, .h3, .title) { color: var(--cream); }
@media (max-width: 767px) {
  body { font-size: 15px; }
  .display { font-size: 30px; }
  .h1 { font-size: 28px; }
  .h2 { font-size: 24px; }
  .h3 { font-size: 18px; }
  .lede { font-size: 15px; }
}

/* A mask icon (single colour, follows currentColor): <span class="icon" style="--icon: url(...svg)">. */
.icon { display: inline-block; flex: none; width: 1.1em; height: 1.1em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; vertical-align: -0.15em; }
/* A pixel-art raster icon from the design package's atlases. */
.pix { display: inline-block; flex: none; object-fit: contain; image-rendering: auto; }

/* Frames: the bronze pixel border with notched corners. The border and fill live on ::before so the
   element itself is not clipped (focus rings and overflowing art stay visible). */
.panel, .frame-navy, .plate, .btn--primary, .btn--plain, .site-header__bar, .site-footer__bar {
  position: relative;
  isolation: isolate;
}
.panel::before, .frame-navy::before, .site-header__bar::before, .site-footer__bar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 6px solid transparent;
  border-image: url(/assets/art/frame.svg) 20 / 20px;
  clip-path: var(--notch);
  background: var(--parchment-bg);
  background-origin: border-box;
  background-clip: border-box;
  pointer-events: none;
}
.frame-navy::before { background: var(--navy); }
.panel { padding: 32px 40px; color: var(--ink); }
.frame-navy { color: var(--cream); }
.frame-navy :is(.display, .h1, .h2, .h3, .title) { color: var(--cream); }
.frame-navy :focus-visible { outline-color: var(--focus); }
/* Art that fills a navy frame sits inside the band. */
.frame-navy > .frame__art, .panel > .frame__art { position: absolute; z-index: -1; inset: 6px; overflow: hidden; clip-path: var(--notch); }
.frame__art img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .panel { padding: 16px 16px; } }

/* A small plate with the thin bronze frame (labels, name plates, tiles). */
.plate::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 4px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 8px; clip-path: var(--notch-sm); background: var(--surface); background-origin: border-box; pointer-events: none; }

/* Title rule: a bronze line with the ornament in the middle, under section titles. */
.rule { display: flex; align-items: center; gap: 8px; height: 18px; margin-block: 6px 14px; color: var(--line); }
.rule::before, .rule::after { content: ''; flex: 1; height: 2px; background: linear-gradient(var(--bronze), var(--bronze-dark)); opacity: 0.75; }
.rule > i, .ornament { display: block; flex: none; width: 18px; height: 18px; background: url(/assets/art/ornament.svg) center / 18px no-repeat; image-rendering: pixelated; }
.rule--narrow { width: min(810px, 100%); margin-inline: auto; }

/* Buttons. The primary button is burgundy inside the small bronze frame. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 28px;
  border: 0;
  background: none;
  font: 700 22px/1.15 var(--sans);
  text-align: center;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.btn--primary { color: var(--cream); text-shadow: 0 1px 0 rgb(60 8 18 / 0.6); }
.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 7px solid transparent;
  border-image: url(/assets/art/frame-btn.svg) 20 / 20px;
  clip-path: var(--notch);
  background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom));
  background-origin: border-box;
  box-shadow: inset 0 3px 0 rgb(255 255 255 / 0.12), inset 0 -3px 0 rgb(0 0 0 / 0.18);
  transition: filter var(--hover);
  pointer-events: none;
}
.btn--primary:hover::before { filter: brightness(1.16); }
.btn--primary:active::before { filter: brightness(0.92); }
.btn--sm { min-height: 38px; padding: 4px 18px; font-size: 18px; }
.btn--lg { min-height: 56px; padding: 8px 34px; font-size: 24px; }
.btn--block { display: flex; width: 100%; }
/* Outlined button on parchment: burgundy outline and text. */
.btn--secondary { min-height: 42px; padding: 4px 18px; border: 2px solid var(--burgundy); border-radius: 3px; background: var(--surface); color: var(--burgundy); font-size: 20px; transition: background var(--hover); }
.btn--secondary:hover { background: #fff8ea; }
/* Parchment plate button with the bronze frame (Clear all, Close on sheets). */
.btn--plain { color: var(--ink); font-weight: 600; }
.btn--plain::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 4px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 8px; clip-path: var(--notch-sm); background: var(--surface); background-origin: border-box; pointer-events: none; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.55; }
.btn[aria-busy="true"] { cursor: progress; }
.btn .icon { width: 1em; height: 1em; }
.btn .pix { height: 1.1em; width: auto; }
@media (max-width: 767px) {
  .btn--primary::before { border-width: 4px; border-image: url(/assets/art/frame-sm.svg) 8 / 8px; clip-path: var(--notch-sm); }
  .btn { min-height: 40px; padding: 4px 18px; font-size: 16px; }
  .btn--sm { min-height: 30px; padding: 2px 12px; font-size: 13px; }
  .btn--lg { min-height: 46px; font-size: 18px; }
  .btn--secondary { min-height: 36px; font-size: 15px; }
}

/* Links: bold burgundy text over a burgundy underline (cream text on navy). */
.link { display: inline; color: var(--link); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: currentColor; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { color: var(--burgundy-hover); }
.on-navy .link, .frame-navy .link { color: var(--cream); font-weight: 600; text-decoration-color: var(--link-navy); text-decoration-thickness: 3px; }
.on-navy .link:hover, .frame-navy .link:hover { color: #fff; }
.link--chevron::after { content: ''; display: inline-block; width: 0.55em; height: 0.55em; margin-left: 0.4em; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg) translateY(-0.1em); }
.link--back::before { content: ''; display: inline-block; width: 0.55em; height: 0.55em; margin-right: 0.4em; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg) translateY(-0.1em); }

/* Badges and chips (card kinds, elements, filters). */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 12px; border: 2px solid var(--field-line); border-radius: 3px; background: var(--surface); color: var(--ink); font: 600 15px/1.2 var(--sans); }
.chip[aria-pressed="true"], .chip--on { border-color: var(--bronze); background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); color: var(--cream); }
.chip .pix { width: 20px; height: 20px; }

/* Fields: dark-brown outlined boxes on a pale surface. */
.field { display: grid; gap: 6px; }
.field__label { font: 700 20px/1.25 var(--sans); color: var(--ink); }
.field__hint { font-size: 15px; color: var(--muted); }
.field__error { display: flex; gap: 6px; align-items: center; font-size: 15px; font-weight: 600; color: var(--burgundy); }
.input {
  width: 100%;
  min-height: 46px;
  padding: 8px 14px;
  border: 2px solid var(--field-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 400 18px/1.3 var(--sans);
  box-shadow: inset 0 2px 0 rgb(80 50 20 / 0.08);
}
.input::placeholder { color: var(--placeholder); opacity: 1; }
.input:focus { outline: none; border-color: var(--burgundy); box-shadow: 0 0 0 3px rgb(125 31 44 / 0.25); }
.input[aria-invalid="true"] { border-color: var(--burgundy); color: var(--burgundy); }
select.input {
  min-height: 38px;
  padding: 4px 40px 4px 12px;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 17px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' shape-rendering='crispEdges'%3E%3Cpath fill='%237d1f2c' d='M0 0h16v2h-2v2h-2v2h-2v2H8v2H8V8H6V6H4V4H2V2H0z'/%3E%3C/svg%3E") right 14px center / 16px 10px no-repeat;
  cursor: pointer;
}
@media (max-width: 767px) {
  .field__label { font-size: 15px; }
  .input { min-height: 40px; font-size: 16px; }
  select.input { min-height: 34px; font-size: 14px; }
}

/* Radio: a burgundy ring with a burgundy dot. */
.radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.radio input { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--field-line); border-radius: 50%; background: var(--surface); display: grid; place-content: center; cursor: pointer; }
.radio input::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--burgundy); transform: scale(0); transition: transform var(--hover); }
.radio input:checked { border-color: var(--burgundy); }
.radio input:checked::before { transform: scale(1); }

/* Tabs: framed parchment cells; the selected one is burgundy. */
.tabs { display: flex; border-bottom: 3px solid var(--burgundy); }
.tabs > :is(a, button) { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 6px 16px; border: 2px solid var(--line); border-bottom: 0; margin-right: -2px; background: var(--surface); color: var(--ink); font: 700 20px/1.2 var(--sans); cursor: pointer; }
.tabs > [aria-selected="true"], .tabs > [aria-current="page"] { background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); border-color: var(--bronze); color: var(--cream); }

/* Accordion rows on <details>. */
.accordion { border: 2px solid var(--line); background: var(--surface); }
.accordion + .accordion { margin-top: 10px; }
.accordion > summary { display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 8px 18px; list-style: none; font: 700 20px/1.25 var(--sans); color: var(--ink); cursor: pointer; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::before { content: ''; flex: none; width: 10px; height: 10px; border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(-45deg); transition: transform var(--hover); }
.accordion[open] > summary { background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); color: var(--cream); }
.accordion[open] > summary::before { transform: rotate(45deg) translate(-2px, -2px); }
.accordion__body { padding: 14px 18px 18px; }

/* Pagination squares. */
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination > :is(a, button, span) { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border: 2px solid var(--field-line); border-radius: 3px; background: var(--surface); font: 600 18px/1 var(--sans); color: var(--ink); }
.pagination > [aria-current="page"] { background: var(--burgundy); border-color: var(--burgundy); color: var(--cream); }

/* Breadcrumb: "Cards / Dragon". */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font: 600 16px/1.4 var(--sans); color: var(--cream-muted); }
.breadcrumb a { color: var(--cream); text-decoration: underline; text-decoration-color: var(--link-navy); text-underline-offset: 4px; }
.breadcrumb li + li::before { content: '/'; margin-right: 8px; }
.breadcrumb ol { display: contents; list-style: none; }

/* Headings on navy carry the mockups' hard dark drop shadow. */
:is(.on-navy, .frame-navy, .band) :is(.display, .h1, .h2, .h3, .title, h1, h2, h3) { text-shadow: 0.05em 0.05em 0 rgb(2 6 15 / 0.85); }

/* Scene art never ends in a hard edge against the navy: it fades out over --fade-l/-r/-t/-b (lengths or
   percentages, default none). */
.art-fade {
  --fade-l: 0%; --fade-r: 0%; --fade-t: 0%; --fade-b: 0%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent), linear-gradient(to bottom, transparent, #000 var(--fade-t), #000 calc(100% - var(--fade-b)), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent), linear-gradient(to bottom, transparent, #000 var(--fade-t), #000 calc(100% - var(--fade-b)), transparent);
  mask-composite: intersect;
}

/* A navy hero band: copy on the left, the scene filling the rest and melting into the navy behind the
   copy. The scene runs to the bottom with no fade and on through the page gap, under the next panel's
   frame, as the mockups draw it, so no navy strip shows beneath it. The scene grows with the window. Set
   --art-w (share of the band), --art-pos (object-position) and --band-h on the page. */
.band { position: relative; isolation: isolate; display: flex; align-items: center; min-height: var(--band-h, 270px); color: var(--cream); }
/* The small right fade hides the art's edge where the column stops short of a very wide window. */
.band__art { position: absolute; z-index: -1; inset: 0 0 calc(-1 * var(--gap)) auto; width: var(--art-w, 62%); --fade-l: 34%; --fade-r: 3%; --fade-t: 4%; --fade-b: 0%; }
.band__art img { width: 100%; height: 100%; object-fit: cover; object-position: var(--art-pos, 50% 50%); }
.band__body { position: relative; max-width: min(46%, 520px); padding: 24px 0 24px 38px; }
.band :is(.display, .h1, .h2) { color: var(--cream); }
.band :focus-visible { outline-color: var(--focus); }
@media (max-width: 767px) {
  .band { flex-direction: column; align-items: stretch; min-height: 0; }
  .band__art { position: relative; inset: auto; width: auto; height: var(--band-art-h, 180px); min-height: 0; order: 2; margin-bottom: calc(-1 * var(--gap)); --fade-l: 0%; --fade-t: 22%; --fade-b: 0%; }
  .band__body { max-width: none; padding: 14px 12px 4px; }
}

/* A picture in the small bronze frame: art inside parchment panels is always framed, never a bare box. */
.pic { position: relative; isolation: isolate; display: block; padding: 4px; }
.pic::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 4px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 8px; clip-path: var(--notch-sm); background: var(--navy); background-origin: border-box; }
.pic > img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Monster card tile (mockups 01 and 02). Lengths are shares of the card's width (cqw), measured on the
   mockups' 205 px cards: the cream-gold frame with stepped corner blocks and the burgundy card
   (card-frame.svg), a golden parchment plaque at 79% width, the portrait, and a foot with a short gold
   line through a gem. Painted portraits fill the window; game sprites (.mcard--sprite) sit pixel-sharp
   on a dark stage. Pages set only the aspect ratio. */
.mcard { position: relative; isolation: isolate; display: flex; flex-direction: column; aspect-ratio: 190 / 226; container-type: inline-size; color: var(--ink); transition: transform var(--hover), filter var(--hover); }
.mcard::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 12.2cqw solid transparent; border-image: var(--card-frame, url(/assets/art/card-frame.svg)) 20 fill / 12.2cqw; }
a.mcard:hover { transform: translateY(-3px); filter: brightness(1.07); }
/* Long names shrink with their length (set --n to the name's character count), then wrap onto a second
   line, so the plaque never cuts a name. */
.mcard__name { position: relative; isolation: isolate; align-self: center; display: grid; place-items: center; flex: none; width: 79%; height: 15.1cqw; margin-top: 8.8cqw; padding: 0 4cqw; font: 900 max(9px, clamp(6cqw, 104cqw / var(--n, 9), 8.8cqw))/0.96 var(--display); color: var(--ink); text-align: center; text-wrap: balance; overflow: hidden; }
.mcard__name::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 3.9cqw solid transparent; border-image: url(/assets/art/card-plaque.svg) 8 fill / 3.9cqw; }
/* The portrait runs to the frame's inner gold line at the sides; thin gold lines close it above and below. */
.mcard__art { position: relative; flex: 1; min-height: 0; margin: 2.4cqw 4.9cqw 0; overflow: hidden; border-block: 0.7cqw solid var(--card-color, #d99b4c); background: radial-gradient(ellipse at 50% 60%, #2a3d63, #0b1530 75%); }
/* The zoom centres on the portrait's focus point (--art-pos), so close-ups keep the monster's head. */
.mcard__art img { width: 100%; height: 100%; object-fit: cover; object-position: var(--art-pos, 50% 45%); transform: scale(var(--art-zoom, 1.12)); transform-origin: var(--art-pos, 50% 45%); }
.mcard--sprite .mcard__art img { position: absolute; inset: 0; margin: auto; width: 58%; height: auto; aspect-ratio: 1; object-fit: contain; transform: none; image-rendering: pixelated; }
.mcard__foot { display: flex; align-items: center; justify-content: center; gap: 1.2cqw; flex: none; height: 12.7cqw; margin: 0 4.9cqw 4.9cqw; padding-inline: 22.6cqw; }
.mcard__foot::before, .mcard__foot::after { content: ''; flex: 1; height: max(1px, 0.8cqw); background: var(--card-color, #dfa66a); box-shadow: 0 max(1px, 0.4cqw) 0 rgb(43 20 8 / 0.55); }
.mcard__foot > i { flex: none; width: 8.8cqw; height: 8.8cqw; background: url(/assets/art/card-gem.svg) center / contain no-repeat; image-rendering: pixelated; }
/* A card entry names its kind on the foot in place of the gem: <span class="mcard__kind">Enchanted</span>. */
.mcard__kind { flex: none; color: var(--cream); font: 700 max(9px, 5.4cqw)/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
/* How each painted portrait fills a card window, the same on every page: zoom and focus point. */
.mcard__art img[src$="/portraits/dragon.webp"] { --art-zoom: 1.45; --art-pos: 56% 46%; }
.mcard__art img[src$="/portraits/demon.webp"] { --art-zoom: 1.12; --art-pos: 50% 42%; }
.mcard__art img[src$="/portraits/giant-spider.webp"] { --art-zoom: 1.45; --art-pos: 50% 62%; }
.mcard__art img[src$="/portraits/rat.webp"] { --art-zoom: 1.5; --art-pos: 45% 56%; }
.mcard__art img[src$="/portraits/cyclops.webp"] { --art-zoom: 1.55; --art-pos: 45% 30%; }
.mcard__art img[src$="/portraits/orc.webp"] { --art-zoom: 1.5; --art-pos: 55% 32%; }
.mcard__art img[src$="/portraits/troll.webp"] { --art-zoom: 1.4; --art-pos: 50% 35%; }
.mcard__art img[src$="/portraits/water-elemental.webp"] { --art-zoom: 1.3; --art-pos: 50% 45%; }
.mcard__art img[src$="/portraits/elf-arcanist.webp"] { --art-zoom: 1.4; --art-pos: 50% 35%; }

/* Caption under promotional art ("World illustration"). */
.caption { font: italic 600 13px/1.2 var(--sans); color: var(--cream); text-shadow: 0 1px 2px rgb(0 0 0 / 0.8); }

/* Feedback states: illustration, title, text, action (empty, loading, offline, success, missing). */
.state { display: grid; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.state__art { width: 120px; height: auto; }
.state__title { font: 700 26px/1.2 var(--display); color: var(--ink); }
.state__text { max-width: 36ch; color: var(--ink-2); }
.state .btn { margin-top: 6px; }
.skeleton { display: block; height: 14px; border-radius: 3px; background: linear-gradient(90deg, #ead6b0, #f5e6c8, #ead6b0); }

/* ---- Header ---- */
.site-header { padding: 12px 0 0; }
.site-header__bar { display: flex; align-items: center; min-height: 76px; padding: 0 26px 0 35px; }
.brand { display: flex; align-items: center; gap: 30px; flex: none; color: var(--wordmark); }
.brand__crest { width: 67px; height: 82px; margin-block: 2px -10px; align-self: flex-start; filter: drop-shadow(0 2px 0 rgb(0 0 0 / 0.35)); }
.brand__name { font: 700 28px/1 var(--display); letter-spacing: 0; white-space: nowrap; }
.site-nav { display: flex; gap: 41px; margin-left: auto; padding-right: 30px; }
.site-nav a { position: relative; padding: 6px 0; font: 600 17px/1.2 var(--sans); color: #1c1a24; transition: color var(--hover); }
.site-nav a:hover { color: var(--burgundy); }
.site-nav a[aria-current="page"]::after { content: ''; position: absolute; left: -9px; right: -9px; bottom: -6px; height: 3px; background: var(--burgundy); }
.site-header__divider { width: 2px; height: 34px; background: var(--bronze); }
.site-account { display: flex; align-items: center; gap: 22px; padding-left: 22px; }
.site-signin { min-width: 105px; }
.site-signin[aria-current="page"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 3px; background: var(--burgundy); }
.site-logout { padding: 6px 0; border: 0; background: none; font: 600 17px/1.2 var(--sans); color: #1c1a24; cursor: pointer; }
.site-logout:hover { color: var(--burgundy); }
.site-menu-button { display: none; }
.site-nav, .site-account, .site-logout { flex: none; white-space: nowrap; }
/* Signed in, "My account" and "Log out" need the room "Sign in" leaves free (mockup 12-account). */
[data-signed-in] .brand { gap: 17px; }
[data-signed-in] .site-nav { gap: 31px; padding-right: 24px; }
[data-signed-in] .site-account { gap: 20px; padding-left: 20px; }
[data-signed-in] .site-signin { padding-inline: 16px; }
/* Signed in, the header needs about 100 px more, so it folds into the menu earlier. */
@media (max-width: 1120px) {
  [data-signed-in] :is(.site-nav, .site-account) { display: none; }
  [data-signed-in] .site-header__divider { margin: 0 24px 0 auto; }
  [data-signed-in] .site-menu-button { display: inline-flex; }
}
@media (max-width: 1080px) {
  .site-nav, .site-account { display: none; }
  .site-header__divider { margin: 0 24px 0 auto; }
  .site-menu-button { display: inline-flex; }
}
@media (max-width: 767px) {
  .site-header { padding-top: 6px; }
  .site-header__bar { min-height: 50px; padding: 0 12px 0 17px; }
  .brand { gap: 14px; }
  .brand__crest { width: 33px; height: 41px; margin-block: 1px -6px; }
  .brand__name { font-size: 15.5px; }
  .site-menu-button { position: relative; gap: 8px; min-width: 86px; min-height: 27px; padding: 2px 14px; font-size: 14px; }
  .site-menu-button::after { content: ''; position: absolute; inset: -9px -4px; }
  .site-menu-button .icon { width: 14px; height: 12px; }
  .site-header__divider { height: 18px; margin-right: 16px; }
}
@media (max-width: 359px) {
  .site-header__bar { padding-inline: 12px 8px; }
  .brand { gap: 8px; }
  .brand__name { font-size: 14px; }
  .site-header__divider { margin-right: 10px; }
  .site-menu-button { min-width: 0; padding-inline: 10px; }
}

/* ---- Menu sheet and filter sheets (phones and narrow windows) ---- */
.sheet { width: 100%; max-width: 390px; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.sheet::backdrop { background: rgb(4 12 26 / 0.72); }
.sheet[open] { display: flex; animation: sheet-in 170ms ease-out; }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
.sheet__inner { position: relative; isolation: isolate; display: flex; flex-direction: column; width: 100%; min-height: 100%; overflow: auto; padding: 0 0 0; }
.sheet__inner::before { content: ''; position: fixed; inset: 0 0 0 auto; width: min(390px, 100%); z-index: -1; border: 6px solid transparent; border-image: url(/assets/art/frame.svg) 20 / 20px; background: var(--parchment-bg); background-origin: border-box; }
.sheet__bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px 16px; border-bottom: 2px solid var(--line); }
.sheet__bar .brand { gap: 10px; }
.sheet__bar .brand__crest { width: 30px; height: 37px; margin: 0; }
.sheet__bar .brand__name { font-size: 16px; }
.sheet__close { margin-left: auto; min-height: 30px; padding: 2px 12px; font-size: 14px; }
.sheet__title { margin: 22px 20px 0; text-align: center; font: 700 30px/1.1 var(--display); color: var(--ink); }
.sheet .rule { margin: 8px 20px 14px; }
.sheet__body { display: grid; gap: 14px; padding: 4px 22px 18px; }
.sheet__actions { display: flex; gap: 12px; padding: 12px 22px 18px; margin-top: auto; }
.sheet__actions > * { flex: 1; }
.sheet__art { margin: auto 6px 6px; height: 150px; overflow: hidden; }
.sheet__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 78%; }

.site-menu__links { display: grid; padding: 0 20px; }
.site-menu__links a, .site-menu__links button { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 6px 4px; border: 0; border-bottom: 2px solid rgb(176 128 70 / 0.45); background: none; font: 700 18px/1.2 var(--sans); color: var(--ink); text-align: left; cursor: pointer; }
.site-menu__links :is(a, button)::after { content: ''; width: 9px; height: 9px; margin-right: 6px; border: solid var(--burgundy); border-width: 3px 3px 0 0; transform: rotate(45deg); }
.site-menu__links a[aria-current="page"] { color: var(--burgundy); }
.site-menu__cta { margin: 22px 20px 0; }

/* ---- Footer ---- */
.site-footer { padding: var(--gap) 0 16px; }
.site-footer__bar { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 78px; font: 600 16px/1.3 var(--sans); color: var(--ink); }
.site-footer__bar > .rule-line { display: block; flex: 1; height: 2px; background: var(--bronze); opacity: 0.8; }
.site-footer__text { flex: none; text-align: center; }
@media (max-width: 767px) {
  .site-footer { padding-bottom: 8px; }
  .site-footer__bar { min-height: 26px; gap: 8px; padding: 2px 16px; font-size: 11px; }
  .site-footer__bar .ornament { width: 10px; height: 10px; background-size: 10px; }
}
