/* Myrridon website. Design notes and tokens: web/DESIGN.md. */

@font-face {
  font-family: "Cinzel";
  src: url("../fonts/Cinzel-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/AlegreyaSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/AlegreyaSans-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/AlegreyaSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/AlegreyaSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #14110d;
  --ink-deep: #0f0d0a;
  --panel: #1c1813;
  --panel-glass: rgba(15, 13, 10, 0.92);
  --slot-bg: #1e1a14;
  --line: rgba(221, 194, 128, 0.18);
  --line-soft: rgba(221, 194, 128, 0.12);
  --line-strong: rgba(221, 194, 128, 0.35);
  --gilt: #ddc280;
  --gilt-hover: #f0dba6;
  --text: #eae0c8;
  --text-bright: #f1eada;
  --text-body: #d9d0ba;
  --text-dim: #b8ae97;
  --online: #5bc17a;
  --ember: #26150f;
  /* News post colour spans, as the client's NewsMarkdown.gd draws them */
  --news-green: #7fd49b;
  --news-red: #e58a7c;
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 4px;
  --radius-panel: 6px;
  --page-max: 1280px;
  --gutter: 24px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
img { max-width: 100%; }
a { color: var(--gilt); }
a:hover { color: var(--gilt-hover); }
:focus-visible { outline: 2px solid var(--gilt); outline-offset: 3px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.site-main { flex: 1; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--gilt);
  color: var(--ink);
  font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header { background: var(--ink-deep); border-bottom: 1px solid var(--line); }
.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 36px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text-bright); }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 26px; flex: 1 1 240px; }
.site-nav a, .footer-nav a { padding: 10px 0; color: var(--text); font-weight: 500; text-decoration: none; }
.site-nav a:hover, .footer-nav a:hover { color: var(--gilt); }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.header-form { display: flex; margin: 0; }

/* Buttons */
.button {
  display: inline-block;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  /* The same look on <a> and on <button> (sign-out is a form button). */
  font-family: inherit;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.button--gilt { background: var(--gilt); color: var(--ink); }
.button--gilt:hover { background: var(--gilt-hover); color: var(--ink); }
.button--line { border-color: rgba(234, 224, 200, 0.55); color: var(--text); font-weight: 500; }
.button--line:hover { background: rgba(221, 194, 128, 0.12); color: var(--text); }
.button--small { padding: 10px 16px; font-size: 0.9375rem; }

/* Hero: a muted loop from the intro cinematic behind the text (site.js
   starts it), its still for phones and reduced motion, darkened for reading. */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink) url("../video/hero-poster.jpg") center / cover no-repeat;
}
.hero__media { position: absolute; inset: 0; }
.hero__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(10, 8, 6, 0.45) 0%, rgba(10, 8, 6, 0.75) 70%),
    linear-gradient(rgba(10, 8, 6, 0.2), rgba(20, 17, 13, 0.9));
}
.hero__inner { position: relative; z-index: 1; }
.hero__pause {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(15, 13, 10, 0.75);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
.hero__pause:hover { background: rgba(221, 194, 128, 0.16); }
.hero__pause[hidden] { display: none; }
.hero__inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 72px var(--gutter) 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.hero__title {
  max-width: 20ch;
  text-wrap: balance;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.02em;
  color: var(--text-bright);
}
.hero__lead { max-width: 60ch; font-size: 1.1875rem; color: var(--text-body); }
.hero__features {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  max-width: 760px;
}
.hero__features li {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(15, 13, 10, 0.7);
  color: var(--text-bright);
  font-size: 0.9375rem;
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 4px; }
.online { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.online__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--online); }
.hero__note { margin-top: -8px; color: var(--text-dim); }

/* Chapters: the front page's titled sections (layout draft A) */
.chapter { padding: 64px 0 72px; background: var(--ink); }
.chapter__head { margin-bottom: 40px; text-align: center; }
.chapter__title {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 9vw, 7rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--gilt);
}
.chapter__rule { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.chapter__rule span { width: min(140px, 28vw); height: 1px; background: rgba(221, 194, 128, 0.5); }
.chapter__rule .chapter__diamond {
  width: 9px;
  height: 9px;
  background: none;
  border: 1px solid var(--gilt);
  transform: rotate(45deg);
}
.chapter__lead { margin-top: 20px; font-size: 1.3125rem; font-style: italic; color: var(--text-body); }
.chapter__subtitle {
  margin: 48px 0 20px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-bright);
}
.chapter .sample-note { text-align: center; }
.sample-note { margin: -8px 0 20px; color: var(--text-dim); font-style: italic; }

/* Armory */
.chapter--armory { background: var(--panel); }
.armory { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.armory__copy { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.armory__line {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 3vw, 2.125rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-bright);
}
.armory__text { max-width: 52ch; color: var(--text-body); }

/* Example character sheet */
.sheet {
  flex: 1 1 520px;
  min-width: 0;
  padding: 28px;
  background: var(--ink-deep);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
}
.sheet__head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sheet__name { font-family: var(--font-display); font-size: 1.625rem; font-weight: 700; color: var(--text-bright); }
.sheet__meta { color: var(--text-dim); }
.sheet__body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; margin-top: 20px; }
.sheet__body .doll { flex: 0 1 240px; }
.sheet__stats { flex: 1 1 160px; min-width: 0; display: grid; gap: 10px; }
.sheet__stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.sheet__stat dt { color: var(--text-dim); }
.stats__blank::before { content: ""; display: block; width: 18px; height: 2px; background: var(--line-strong); }

/* How sharing a build works: a real sequence, so it is numbered */
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.steps__step { counter-increment: step; display: flex; flex-direction: column; gap: 8px; }
.steps__step::before {
  content: counter(step);
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gilt);
}
.steps__title { font-weight: 700; color: var(--text-bright); }
.steps__text { color: var(--text-body); }

/* Shared builds */
.build-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.build-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.build-card__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-bright);
  overflow-wrap: anywhere;
}
.build-card__meta { margin-bottom: 8px; color: var(--text-dim); }
.chapter__more { margin-top: 28px; text-align: center; }

/* Trailers: Steam's trailers, played on the page when pressed, and screenshots */
.chapter--trailers { background: var(--ink-deep); }
.trailers {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 24px;
}
.trailer { display: flex; flex-direction: column; gap: 10px; }
.trailer__play, .trailer__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  background: #000;
}
.trailer__play { display: block; padding: 0; overflow: hidden; cursor: pointer; color: var(--text-bright); font: inherit; }
.trailer__poster { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.trailer__play:hover .trailer__poster { transform: scale(1.03); }
.trailer__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 13, 10, 0.8);
  border: 2px solid var(--gilt);
  color: var(--gilt);
}
.trailer__play:hover .trailer__icon { background: var(--gilt); color: var(--ink); }
.trailer__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 12px;
  background: linear-gradient(transparent, rgba(10, 8, 6, 0.9));
  font-weight: 700;
  text-align: left;
}
@media (prefers-reduced-motion: reduce) {
  .trailer__poster { transition: none; }
  .trailer__play:hover .trailer__poster { transform: none; }
}
.screenshots {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.screenshots__open {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  cursor: zoom-in;
}
.screenshots__open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox {
  max-width: min(1280px, 94vw);
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  background: var(--ink-deep);
}
.lightbox::backdrop { background: rgba(5, 4, 3, 0.85); }
.lightbox__image { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto 12px; }
.lightbox form { text-align: right; }

/* Shared builds page: filters, then one build per row */
.build-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; }
.build-filters__search { flex: 1 1 280px; }
.build-filters__actions { display: flex; align-items: center; gap: 16px; }
.build-filters__clear { font-weight: 500; }
.build-rows { list-style: none; padding: 0; display: grid; gap: 16px; }
.build-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.build-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.build-row__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; }
.build-row__names { min-width: 0; }
.build-row__title { font-size: 1.375rem; font-weight: 700; line-height: 1.25; color: var(--text-bright); overflow-wrap: anywhere; }
.build-row__title a { color: inherit; text-decoration: none; }
.build-row__title a:hover { color: var(--gilt); }
.build-row__date { font-size: 0.9375rem; color: var(--text-dim); }
.build-row__description { max-width: 80ch; color: var(--text-body); overflow-wrap: anywhere; }
.build-row__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.build-row__attributes { flex: 0 1 380px; }
.build-row__gear { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.build-row .build-row__slot { position: relative; left: auto; top: auto; width: 52px; height: 52px; }
.build-row__open { flex: none; align-self: center; }
@media (max-width: 720px) {
  .build-row { flex-direction: column; align-items: center; text-align: center; }
  .build-row__body { width: 100%; align-items: center; }
  .build-row__head { justify-content: center; }
  .build-row__stats { justify-content: center; }
  .build-row__attributes { flex-basis: 100%; }
  .build-row__gear { justify-content: center; }
}

/* Form fields (sharing a build, its notes, the build filters) */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 700; color: var(--text-bright); }
.field__hint { font-size: 0.875rem; font-weight: 400; color: var(--text-dim); }
.field__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink-deep);
  color: var(--text-bright);
  font: inherit;
}
textarea.field__input { resize: vertical; }
select.field__input { min-width: 180px; }
input.field__input, select.field__input { height: 44px; }
/* Doubled class: the general .share__form rule comes later in this file. */
.share__form.share__form--stacked { flex-direction: column; flex-wrap: nowrap; align-items: stretch; max-width: 720px; }
.share__subtitle { font-size: 1.0625rem; font-weight: 700; color: var(--text-bright); }
.build-notes { flex: 1 1 100%; }
.build-notes__text { max-width: 80ch; color: var(--text-body); overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 12px; }
.pager__where { color: var(--text-dim); }

/* Records: leaderboards and world firsts over the map */
.chapter--records {
  background: linear-gradient(rgba(23, 20, 15, 0.45), rgba(23, 20, 15, 0.45)),
              var(--ink) url("../images/map-bg.jpg") center / cover no-repeat;
}
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.board {
  padding: 28px;
  background: rgba(15, 13, 10, 0.82);
  border: 1px solid rgba(221, 194, 128, 0.25);
  border-radius: var(--radius);
}
.board__title {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-bright);
}
.ranks { list-style: none; padding: 0; }
.ranks__row { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.ranks__rank { flex: none; width: 1.4em; font-family: var(--font-display); font-weight: 700; color: var(--gilt); }
.ranks__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ranks__score { color: var(--text-dim); white-space: nowrap; }
.firsts { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.firsts__card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(15, 13, 10, 0.82);
  border: 1px solid rgba(221, 194, 128, 0.2);
  border-radius: var(--radius);
}
.firsts__icon {
  flex: none;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(221, 194, 128, 0.3);
  border-radius: var(--radius);
  background: var(--slot-bg);
}
.firsts__text { min-width: 0; }
.firsts__item { font-weight: 700; overflow-wrap: anywhere; }
.firsts__by { font-size: 0.9375rem; color: var(--text-dim); }

/* Guilds */
.chapter--guilds { background: var(--ember); }
.carousel { display: flex; align-items: center; gap: 16px; }
.carousel__track {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  /* Three cards to a view, as in draft A; the rest scroll. */
  grid-auto-columns: max(220px, calc((100% - 48px) / 3));
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scrollbar-color: rgba(221, 194, 128, 0.35) transparent;
}
.carousel__step {
  flex: none;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(234, 224, 200, 0.55);
  border-radius: 50%;
  background: var(--ink);
  color: var(--text);
  cursor: pointer;
}
.carousel__step:hover { background: rgba(221, 194, 128, 0.12); }
.carousel__step:disabled { opacity: 0.35; cursor: default; }
.carousel__step[hidden] { display: none; }
.guild-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  background: rgba(15, 13, 10, 0.6);
  border: 1px solid rgba(221, 194, 128, 0.22);
  border-radius: var(--radius);
  text-align: center;
}
.guild-card__pennant {
  width: 96px;
  height: 120px;
  padding-top: 8px;
  display: flex;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px 4px 48px 48px;
  background: var(--ink-deep);
}
.guild-card__banner { width: 80px; height: 80px; image-rendering: pixelated; }
.guild-card__name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.guild-card__meta { font-size: 0.9375rem; color: var(--text-dim); }
/* The whole card opens the guild's page; the focus ring stays on the name. */
.guild-card { position: relative; }
.guild-card__name a { color: inherit; text-decoration: none; }
.guild-card__name a::after { content: ""; position: absolute; inset: 0; }
.guild-card:hover .guild-card__name a { color: var(--gilt); }
@media (max-width: 560px) {
  .sheet { padding: 20px; }
  .carousel__step { display: none; }
  .carousel__track { grid-auto-columns: minmax(220px, 80%); }
}

/* News */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.news-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.news-card__meta { font-size: 0.9375rem; color: var(--text-dim); }
.news-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-bright);
  overflow-wrap: anywhere;
}
.news-card__title a { color: inherit; text-decoration: none; }
.news-card__title a:hover { color: var(--gilt); }
.news-card__preview { color: var(--text-body); }

/* Sign-in and the signed-in player's pages */
.account { padding-top: 72px; padding-bottom: 104px; display: flex; flex-direction: column; gap: 20px; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text-bright);
}
.account__lead { max-width: 60ch; color: var(--text-body); }
.account__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.notice {
  max-width: 60ch;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-bright);
}
.notice__detail { font-size: 0.875rem; color: var(--text-dim); overflow-wrap: anywhere; }
.characters {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.character-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.character-card__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-bright);
  overflow-wrap: anywhere;
}
.character-card__meta { color: var(--text-dim); overflow-wrap: anywhere; }
.character-card__name a { color: inherit; text-decoration: none; }
.characters { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.character-card { flex-direction: row; align-items: flex-start; gap: 18px; }
.character-card__portrait {
  flex: none;
  width: 96px;
  height: 96px;
  border: 2px solid rgba(221, 194, 128, 0.55);
  border-radius: 50%;
  background: var(--ink-deep);
}
.character-card__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.character-card__stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 0; }
.character-card__stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--ink-deep);
}
.character-card__stats dt { font-size: 0.75rem; color: var(--text-dim); }
.character-card__stats abbr { text-decoration: none; }
.character-card__stats dd { font-weight: 700; color: var(--text-bright); }
.character-card__vitals, .character-card__mastery { font-size: 0.9375rem; color: var(--text-body); }
@media (max-width: 560px) {
  .character-card { flex-direction: column; align-items: center; text-align: center; }
  .character-card__body { align-items: center; width: 100%; }
  .character-card__stats { width: 100%; }
}
.character-card__name a:hover { color: var(--gilt); }

/* A character's page */
.back-link { font-weight: 500; }
.char-head { display: flex; flex-direction: column; gap: 8px; }
.char-head--portrait { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.char-head__portrait {
  flex: none;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(221, 194, 128, 0.6);
  border-radius: 50%;
  background: var(--ink-deep);
}
.char-head__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 280px; }
.char-head__meta { font-size: 1.1875rem; color: var(--text-dim); }
.char-head__desc { max-width: 70ch; margin-top: 8px; color: var(--text-body); overflow-wrap: anywhere; }
.char-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }
.char-panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.char-panel--equipment { flex: 0 1 340px; min-width: 0; }
.char-stats {
  flex: 1 1 480px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-items: start;
  gap: 20px;
}
.char-panel__title {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-bright);
}
/* The equipment paper doll: the client look popup's 250 x 480 layout of
   60 px slots, with its slot background and empty-slot silhouettes. */
.doll { display: flex; flex-direction: column; gap: 14px; }
.doll__board {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 250 / 480;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.doll__slot {
  position: absolute;
  width: 24%;
  height: 12.5%;
  border-radius: 4px;
  background: url("../images/doll/SlotBG.png") center / cover;
}
.doll__slot:focus-visible { outline-offset: 2px; }
/* An empty slot's image is baked by tools/sync_website_art.py exactly as the
   client's slot skin draws it, so it fills the slot as it is. */
.doll__empty { position: absolute; inset: 0; width: 100%; height: 100%; }
.doll__icon { position: absolute; inset: 7%; width: 86%; height: 86%; border-radius: 3px; }
.doll__slot.is-set { box-shadow: inset 0 0 8px 2px rgba(51, 255, 51, 0.8); }
.doll__slot.is-enchanted { box-shadow: inset 0 0 8px 2px rgba(255, 204, 0, 0.8); }

.stat-list__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}
.stat-list__row dt { color: var(--text-dim); }
.stat-list__row dd { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.char-head__shared { color: var(--text-dim); }

/* Mastery tree: drawn like the client's Mastery panel (web/website/mastery.py) */
.char-panel--mastery { flex: 1 1 100%; min-width: 0; }
.mastery-view {
  --mt-learned-outer: #000;
  --mt-learned-mid: #a67f4d;
  --mt-learned-fill: #fff;
  --mt-outer: #616161;
  --mt-mid: #38260f;
  --mt-fill: #1c1205;
  position: relative;
  overflow: hidden;
  height: min(78vh, 760px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(rgba(10, 8, 6, 0.35), rgba(10, 8, 6, 0.35)),
              var(--ink-deep) url("../images/map-bg.jpg") center / cover no-repeat;
}
.mastery-view__svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.mastery-view.is-dragging .mastery-view__svg { cursor: grabbing; }
.mastery-view__tools { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; gap: 6px; }
.mastery-view__tool {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(15, 13, 10, 0.85);
  color: var(--text-bright);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.mastery-view__tool--text { font-size: 0.9375rem; }
.mastery-view__tool:hover { background: rgba(221, 194, 128, 0.16); }
.mt-links path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mt-links--outer path { stroke: var(--mt-outer); stroke-width: 28; }
.mt-links--mid path { stroke: var(--mt-mid); stroke-width: 23; }
.mt-links--fill path { stroke: var(--mt-fill); stroke-width: 13; }
.mt-links--outer path.is-learned { stroke: var(--mt-learned-outer); }
.mt-links--mid path.is-learned { stroke: var(--mt-learned-mid); }
.mt-links--fill path.is-learned { stroke: var(--mt-learned-fill); }
.mt-glow-1 { fill: rgba(255, 217, 77, 0.03); }
.mt-glow-2 { fill: rgba(255, 224, 92, 0.06); }
.mt-glow-3 { fill: rgba(255, 230, 107, 0.10); }
.mt-glow-4 { fill: rgba(255, 237, 128, 0.09); }
.mt-node image { pointer-events: none; }
.mt-hit { fill: transparent; cursor: pointer; }
.mt-washes circle { pointer-events: none; }

/* The page's one tooltip (site.js siteTip) */
.tip {
  position: fixed;
  z-index: 50;
  max-width: min(340px, calc(100vw - 16px));
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(15, 13, 10, 0.96);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.tip p + p { margin-top: 4px; }
.tip__title { font-weight: 700; color: var(--text-bright); }
.tip__text { font-size: 0.9375rem; color: var(--text-body); }
.tip__kind { font-size: 0.875rem; color: var(--text-dim); }
.tip__learned { font-size: 0.875rem; color: var(--gilt); }
.tip__grant { margin-top: 8px; font-weight: 700; color: var(--gilt); }

/* An item's tooltip as the client draws it (TooltipManager): Godot's default
   font and label colour on a 250 px panel, rows of "Label:" and a value
   pushed right, green headers over a rule. Each line's colour and size
   come from utils/item_tooltip.py; the header green and rule here are its
   HEADER_GREEN and HEADER_RULE. */
.tip.tip--item {
  width: max-content;
  min-width: 250px;
  max-width: calc(100vw - 16px);
  padding: 8px;
  border: 2px solid #808080;
  border-radius: 5px;
  background: rgba(38, 38, 38, 0.95);
  box-shadow: none;
  color: #dfdfdf;
  font-family: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.36;
}
.tip.tip--item > * + * { margin-top: 2px; }
.tip.tip--item > .it-head:not(:first-child) { margin-top: 8px; }
.it { margin: 0; white-space: pre; }
.it--wrap { width: 0; min-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.it--11 { font-size: 11px; }
.it--12 { font-size: 12px; }
.it--13 { font-size: 13px; }
.it--14 { font-size: 14px; }
.it--16 { font-size: 16px; }
.it-head {
  margin: 0;
  padding-bottom: 3px;
  border-bottom: 1px solid #666666;
  color: #33cc33;
  font-size: 14px;
}
.it-row { display: flex; gap: 4px; }
.it-row__label { flex: none; min-width: 100px; white-space: pre; }
.it-row__value { flex: 1 1 auto; text-align: right; white-space: pre; }
.it-sep { margin: 4px 0 2px; border: 0; border-top: 1px solid #808080; }
.mastery-tree__caption { margin-top: 12px; color: var(--text-dim); }
.learned { display: flex; flex-wrap: wrap; gap: 16px 48px; margin-top: 20px; }
.learned__group { flex: 1 1 260px; min-width: 0; }
.learned__title { margin-bottom: 8px; font-size: 1.0625rem; font-weight: 700; color: var(--text-bright); }
.learned__list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.learned__list li {
  cursor: help;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
}
.learned__none { color: var(--text-dim); }

/* Sharing a build, and the owner's controls */
.share {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
}
.share__title { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; color: var(--text-bright); }
.share__text { max-width: 70ch; color: var(--text-body); }
.share__form, .share__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.share__actions form { margin: 0; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gilt); }
.copy-field { display: flex; flex-wrap: wrap; gap: 10px; }
.copy-field__input {
  flex: 1 1 320px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink-deep);
  color: var(--text-bright);
  font: inherit;
}
.my-builds { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.my-builds__list { list-style: none; padding: 0; }
.my-builds__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.my-builds__text { display: flex; flex-direction: column; min-width: 0; }
.my-builds__name { font-weight: 700; overflow-wrap: anywhere; }
.my-builds__meta { font-size: 0.9375rem; color: var(--text-dim); }
.my-builds__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.my-builds__actions form { margin: 0; }

/* News, leaderboards, guilds and guide pages */
.page-title--long {
  font-family: var(--font-body);
  font-size: clamp(1.875rem, 4vw, 2.625rem);
  font-weight: 700;
  line-height: 1.2;
}
.news-list { display: grid; gap: 20px; max-width: 860px; }
.boards--full { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.movers { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.movers__list { list-style: none; padding: 0; display: grid; gap: 8px; color: var(--text-body); }
.guild-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.guild-head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.guild-head__pennant { width: 152px; height: 190px; padding-top: 12px; border-radius: 6px 6px 76px 76px; }
.guild-head__pennant .guild-card__banner { width: 128px; height: 128px; }
.guild-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 32px;
  max-width: 860px;
}
.guild-facts__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.guild-facts__row dt { color: var(--text-dim); }
.guild-facts__row dd { font-weight: 700; text-align: right; }
.guide-contents { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px 48px; }
.guide-category { display: flex; flex-direction: column; gap: 10px; }
.guide-category__text { color: var(--text-body); }
.guide-topics { list-style: none; padding: 0; display: grid; gap: 8px; }
.guide-topics li { display: flex; flex-direction: column; }
.guide-topics__text { font-size: 0.9375rem; color: var(--text-dim); }
.guide-page__body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px 56px; }
.guide-page__body .prose { flex: 1 1 520px; }
.guide-more { flex: 0 1 260px; min-width: 0; padding-top: 6px; }
.guide-more__title { margin-bottom: 10px; font-size: 1.0625rem; font-weight: 700; color: var(--text-bright); }
.guide-more [aria-current="page"] { color: var(--text-bright); font-weight: 700; }

/* Text written in the game's Markdown (guide pages, news posts) */
.prose { max-width: 72ch; min-width: 0; color: var(--text-body); }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin-top: 1.6em;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-bright);
}
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4, .prose h5, .prose h6 { font-size: 1.0625rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.3em; }
.prose li > ul, .prose li > ol { margin-top: 0.3em; }
.prose strong { color: var(--text-bright); }
.prose hr { border: 0; border-top: 1px solid var(--line); }
.prose blockquote {
  margin: 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--line-strong);
  font-style: italic;
}
.prose code {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--ink-deep);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  color: var(--text-bright);
}
.prose pre { overflow-x: auto; padding: 14px 16px; border-radius: var(--radius); background: var(--ink-deep); }
.prose pre code { padding: 0; background: none; }
.guide-table { overflow-x: auto; }
.prose table { border-collapse: collapse; min-width: 50%; }
.prose th, .prose td { padding: 6px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--text-bright); }
.guide-tip { border-bottom: 1px dotted var(--gilt); cursor: help; }
.guide-image { font-style: italic; color: var(--text-dim); }
.news-gold { color: var(--gilt); }
.news-green { color: var(--news-green); }
.news-red { color: var(--news-red); }

/* Error pages */
.message { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.message__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text-bright);
}

/* Footer */
.site-footer { padding: 40px 0; background: var(--ink-deep); border-top: 1px solid var(--line); }
.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
}
.site-footer__brand { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 0.9375rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 0.9375rem; }
