:root {
  --night: #0c111a;
  --slate-raised: #222d40;
  --light: #f0dfb6;
  --side-muted: #c4cbd7;
  --brass: #937345;
  --brass-light: #dfb879;
  --gold: #f3d288;
  --paper: #f0e2c3;
  --paper-raised: #f6eacc;
  --paper-shade: #e6d3ad;
  --paper-line: #b89a6b;
  --ink: #32261e;
  --muted: #625044;
  --wine: #762f22;
  --display: Georgia, "Times New Roman", serif;
  --body: "Trebuchet MS", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background:
    repeating-linear-gradient(130deg, #9cb1d204 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 50% 5%, #283447 0, var(--night) 58rem);
  color: var(--light);
  font: 1rem/1.55 var(--body);
}

a { color: var(--gold); text-underline-offset: .17em; }
a:hover { color: #fff0bc; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; }
img, video { max-width: 100%; height: auto; }
iframe, object, embed { max-width: 100%; }

.site-width { width: min(74rem, calc(100% - 2 * clamp(.5rem, 3vw, 2.5rem))); margin-inline: auto; }

.site-shell {
  margin-block: clamp(.5rem, 3vw, 2rem);
  border: 1px solid var(--brass);
  background: #141b27;
  box-shadow: 0 0 0 3px #0e131d, 0 0 0 4px #5a4833, 0 1.4rem 5rem #0009;
}

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: absolute;
  z-index: 1;
  inset: .5rem auto auto .5rem;
  padding: .5rem 1rem;
  color: #281910;
  background: var(--gold);
}

.masthead {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(13rem, 24vw, 18rem);
  padding: 1.5rem clamp(1.25rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--brass-light);
  isolation: isolate;
  background:
    linear-gradient(90deg, #170e15ed 0%, #211018c2 34%, #130d1517 70%),
    #241722 url("../../images/materia-demon-header.jpg") 65% 42% / cover no-repeat;
}

.masthead::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: .4rem;
  border: 1px solid #deb17863;
  box-shadow: inset 0 0 0 1px #150f19ad;
  pointer-events: none;
}

.masthead-copy { text-shadow: 0 2px 3px #130a11, 0 0 .65rem #130a11; }

.masthead-kicker, .masthead-caption {
  margin: 0;
  color: #efd6a4;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.masthead-kicker span { padding: 0 .25em; font-size: .7em; color: var(--brass-light); }
.masthead-caption { color: #f4e3bf; }

.masthead-name {
  display: block;
  width: fit-content;
  margin: .2em 0;
  color: #ffe198;
  font: 700 clamp(2.6rem, 7vw, 6rem)/.95 var(--display);
  font-variant: small-caps;
  letter-spacing: .025em;
  text-decoration: none;
  filter: drop-shadow(0 2px 0 #703b26);
}

.masthead-edition {
  display: block;
  margin-top: .13em;
  color: #f1c47d;
  font-size: .64em;
  letter-spacing: .075em;
}

.header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .7rem;
  padding: .35rem clamp(.35rem, 1.2vw, .7rem);
  border-bottom: 1px solid var(--brass);
  background:
    repeating-linear-gradient(135deg, #eeb98b09 0 1px, transparent 1px 5px),
    linear-gradient(#46262b, #261820);
  box-shadow: inset 0 1px #100a11, inset 0 -2px #100a11;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a, .header-account {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: .5rem clamp(.62rem, 1.5vw, 1.05rem);
  border: 1px solid #a16a514f;
  color: #f3ddb5;
  background: linear-gradient(#583132, #39242a);
  box-shadow: inset 0 1px #efbd8e2b, inset 0 -2px #1b1017, 0 1px 2px #110c14;
  font: 700 .95rem/1.2 var(--display);
  letter-spacing: .025em;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 2px #180b10;
}

.primary-nav .nav-discord { gap: .4rem; }

.header-account {
  gap: .5rem;
  margin-inline-start: auto;
  border-color: #9c744b;
  color: #ffe5ad;
  background: linear-gradient(#6c4231, #412626);
}

.header-account::before {
  content: "";
  width: .38rem;
  height: .38rem;
  border: 1px solid var(--brass-light);
  transform: rotate(45deg);
}

.header-row a:is(:hover, :focus-visible, [aria-current="page"]) {
  border-color: var(--brass-light);
  color: #fff0c7;
  background: linear-gradient(#794438, #50292a);
}

.header-row [aria-current="page"] {
  box-shadow: inset 0 1px #ffe2af5e, inset 0 -2px var(--brass-light), 0 1px 2px #110c14;
}

.header-row a:focus-visible { outline-offset: -4px; }

.page-grid {
  display: grid;
  grid-template-columns: minmax(9.5rem, .79fr) minmax(0, 3fr);
  align-items: start;
  gap: clamp(.75rem, 1.4vw, 1.15rem);
  padding: clamp(.75rem, 1.6vw, 1.25rem);
  background: linear-gradient(180deg, #222b3b, #151d2a 36rem);
}

.page-grid:has(.sidebar) { grid-template-columns: minmax(9.5rem, .79fr) minmax(0, 3fr) minmax(13.25rem, 1.2fr); }
.page-grid > * { min-width: 0; }

.content-panel {
  min-height: 20rem;
  padding: clamp(.9rem, 2.4vw, 1.7rem);
  border: 1px solid var(--brass-light);
  background:
    repeating-linear-gradient(72deg, #68431b08 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 22% 10%, #fcf1d8 0%, var(--paper) 60%, #e8d2a7 100%);
  box-shadow: inset 0 0 0 3px #e5cca46b, inset 0 0 1.75rem #8e592c34, 0 2px 4px #08080bb0;
  color: var(--ink);
  color-scheme: light;
}

.content-panel a { color: #6b2b1d; }
.content-panel a:hover { color: #8c2514; }

.page-title {
  margin: 0 0 1.2rem;
  padding-bottom: .65rem;
  border-bottom: 3px double var(--paper-line);
  color: #54281d;
  font: 700 clamp(1.75rem, 3.2vw, 2.55rem)/1.1 var(--display);
  overflow-wrap: anywhere;
}

.page-content { overflow-x: auto; overflow-wrap: anywhere; }
.page-content :focus-visible { outline-offset: -2px; }
.page-content :is(h2, h3) { font-family: var(--display); }

.news-actions, .account-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.news-actions { margin-bottom: 1.1rem; }
.news-card { padding: clamp(.85rem, 2vw, 1.3rem); border: 1px solid var(--paper-line); background: #f9edd2a8; }
.news-card + .news-card { margin-top: 1rem; }
.news-card h3 { margin: 0; color: #54281d; font: 700 clamp(1.25rem, 2.6vw, 1.6rem)/1.2 var(--display); }
.news-meta { display: grid; gap: .35rem; padding-bottom: .6rem; border-bottom: 1px solid var(--paper-line); }
.news-meta time { color: var(--muted); font-size: .875rem; }
.news-article { margin-top: 1rem; }
.news-article > :first-child { margin-top: 0; }
.news-article > :last-child { margin-bottom: 0; }
.news-empty p { margin: .5rem 0 1rem; color: var(--muted); }

.sidebar { display: grid; gap: .75rem; color-scheme: dark; }

.side-card {
  --panel-edge: #4a7774;
  --panel-highlight: #91b9a2;
  --panel-heading-top: #285154;
  --panel-heading-bottom: #142d32;
  --panel-surface: #173a40;
  --panel-shadow: #0e222a;
  --panel-line: #83b1ac33;
  min-width: 0;
  padding: .7rem;
  border: 1px solid var(--panel-edge);
  background:
    repeating-linear-gradient(135deg, #fff05a06 0 1px, transparent 1px 5px),
    linear-gradient(150deg, var(--panel-surface), var(--panel-shadow));
  box-shadow: inset 0 0 0 2px #080e14a6, 0 0 0 1px #0a111a, 0 3px 6px #08080b80;
}

.side-heading {
  position: relative;
  margin: -.7rem -.7rem .65rem;
  padding: .48rem 1.65rem .48rem .7rem;
  border-bottom: 1px solid var(--panel-edge);
  color: #ffe4b2;
  background: linear-gradient(var(--panel-heading-top), var(--panel-heading-bottom));
  box-shadow: inset 0 1px #fff3cc33, inset 0 -2px #060e1566;
  font: 700 1.03rem/1.25 var(--display);
  text-shadow: 0 1px 2px #070d13;
}

.side-heading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: .78rem;
  width: .46rem;
  height: .46rem;
  border: 1px solid var(--panel-highlight);
  box-shadow: inset 0 0 0 1px #091419, inset 0 0 0 3px var(--brass-light);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.world-nav {
  --panel-edge: #976048;
  --panel-highlight: #e5b276;
  --panel-heading-top: #723b32;
  --panel-heading-bottom: #3a1c24;
  --panel-surface: #3a2027;
  --panel-shadow: #21151e;
  padding: .45rem;
}

.world-nav .side-heading { margin: -.45rem -.45rem .45rem; }
.world-nav ul { display: grid; gap: .24rem; margin: 0; padding: 0; list-style: none; }

.world-nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.25rem;
  padding: .32rem .5rem;
  border: 1px solid #a965453d;
  background: linear-gradient(#4b282c, #332027);
  box-shadow: inset 0 1px #f4a27019, 0 1px 1px #0c0812a6;
  color: #f3d9b7;
  text-decoration: none;
  font-size: .9rem;
  overflow-wrap: anywhere;
}

.world-nav a::before {
  content: "";
  flex: 0 0 .32rem;
  height: .32rem;
  border: 1px solid #dfa877;
  transform: rotate(45deg);
}

.world-nav a:hover, .world-nav a:focus-visible, .world-nav [aria-current="page"] {
  color: #fff0c7;
  border-color: #b57d53;
  background: linear-gradient(#703a30, #47242a);
}

.world-nav [aria-current="page"] {
  font-weight: 700;
  box-shadow: inset 2px 0 var(--brass-light), inset 0 1px #f4a27033;
}

.world-nav [aria-current="page"]::before { background: var(--brass-light); }
.world-nav a:focus-visible { outline-offset: -2px; }

.status-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .3rem .5rem;
  margin-bottom: 0;
  padding-right: .7rem;
}
.status-heading::after { display: none; }
.status-heading h2 { margin: 0; font: inherit; }
.status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .42rem;
  border: 1px solid currentColor;
  border-radius: 2rem;
  background: #071519ad;
  font: 700 .875rem/1.3 var(--body);
}
.status::before { content: ""; width: .35rem; height: .35rem; border-radius: 50%; background: currentColor; }
.status-online { color: #b6e4a6; }
.status-offline { color: #f8b5a2; }
.status-details { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .65rem; margin-top: .65rem; }
.side-card:has(.status-heading):not(:has(.status-details)) { padding-bottom: 0; }
.side-list, .side-note, .status-details { color: #d3e2dd; font-size: .9rem; overflow-wrap: anywhere; }
.side-list { margin: 0; padding: 0; list-style: none; }
.side-list li + li { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--panel-line); }
.side-note { margin: 0; }
.ranked-list { counter-reset: player-rank; }
.ranked-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .4rem; counter-increment: player-rank; }
.ranked-list li::before, .ranked-list span {
  padding: 0 .3rem;
  border: 1px solid var(--panel-line);
  background: #07151980;
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}
.ranked-list li::before { content: counter(player-rank); min-width: 1.35rem; color: var(--gold); text-align: center; }

.button, input[type="submit"], input[type="button"], input[type="reset"], button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.3rem;
  max-width: 100%;
  padding: .4rem .75rem;
  border: 1px solid #a87d45;
  background: linear-gradient(#ffe1a0, #cd994e);
  box-shadow: inset 0 0 0 1px #fff3b65c, 0 1px 2px #3a251a49;
  color: #351e14;
  font: 700 .875rem/1.25 var(--body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.content-panel .button { color: #351e14; }
.button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover, button:hover {
  background: linear-gradient(#ffeab6, #e1b368);
  color: #351e14;
}

.button-outline { background: var(--slate-raised); color: var(--gold); border-color: var(--brass); box-shadow: none; }
.content-panel .button-outline { background: #f9ebce; color: #702d20; }
.content-panel .button-outline:hover { background: #e6c997; }

input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="image"]),
select, textarea {
  min-height: 2.3rem;
  max-width: 100%;
  padding: .35rem .5rem;
  border: 1px solid #66748a;
  background: #111824;
  color: #f3e7d0;
  font: inherit;
}

.content-panel :is(input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="image"]), select, textarea) {
  border-color: #9e805a;
  background: #fff5df;
  color: var(--ink);
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--wine); }
input::placeholder { color: #b4bfd0; opacity: 1; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem; }
.search-form input { width: 100%; font-size: .9rem; }
.sidebar :is(.search-form, .login-form) input:not([type="hidden"]) {
  border-color: var(--panel-edge);
  background: #0b1c23;
  box-shadow: inset 0 1px 3px #070d13;
}
.sidebar input::placeholder { color: #b9cfca; }
.search-form button {
  padding-inline: .5rem;
  border-color: var(--panel-edge);
  background: linear-gradient(var(--panel-heading-top), var(--panel-heading-bottom));
  box-shadow: inset 0 1px #fff3cc33;
}
.search-form button:hover { border-color: var(--brass-light); background: #34585a; color: #fff0c7; }
.side-card:has(.search-form) { container-type: inline-size; }

@container (max-width: 13.25rem) {
  .search-form { grid-template-columns: minmax(0, 1fr); }
}

.account-card:target { outline: 2px solid var(--gold); outline-offset: 3px; }
.login-form { display: grid; gap: .3rem; }
.login-form label { color: #d3e2dd; font-size: .875rem; }
.login-form input + label { margin-top: .2rem; }
.login-form button, .account-links { margin-top: .5rem; }
.account-links { justify-content: space-between; font-size: .875rem; }

.page-content table { width: 100%; max-width: 100%; border-collapse: collapse; color: var(--ink); }
.page-content td, .page-content th { min-width: 0; padding: .5rem .55rem; border-bottom: 1px solid #c9ad7e; }
.page-content .tableHead > :is(td, th), .page-content thead th {
  background: linear-gradient(#6f3c2b, #55271f);
  color: #fff0c8;
  font-weight: 700;
}
.page-content > table + table { margin-top: 1rem; }
.page-content .table-compact { width: 1%; white-space: nowrap; }
.page-content .table-number { text-align: right; font-variant-numeric: tabular-nums; }
.character-info th[scope="row"] { width: 33%; text-align: left; }
.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shop-items li {
  display: flex;
  flex-direction: column;
  padding: .8rem;
  border: 1px solid #c9ad7e;
  background: var(--paper-raised);
}
.shop-items h2 { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: 1.1rem; }
.shop-items img { flex: 0 0 32px; object-fit: contain; }
.shop-items p { margin: .4rem 0; }
.shop-items p + p { margin-top: auto; padding-top: .35rem; }
.shop-items form { display: grid; gap: .35rem; margin-top: .35rem; }
.shop-error {
  padding: .5rem;
  border: 1px solid #b66753;
  background: #fae7df;
  color: #842b1d;
}
.character-list th, .top-killers th:not(.table-number) { text-align: left; }
.task-table :is(th, td) { text-align: left; vertical-align: top; }
.task-table td:last-child { width: 30%; }
.task-table p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.page-content .c0 { background: #f5e7c7; }
.page-content .c1 { background: #ebd7b1; }
.bold { font-weight: 700; }

/* Tie the presentation attributes used by older PHP pages into the parchment palette. */
.page-content :is([style*="background: #EEE" i], [style*="background: #FFF" i]) { background: var(--paper-raised) !important; }
.page-content :is([color="red" i], [style*="color: red" i], [style*="color: darkred" i], [style*="color: #C00" i]) { color: #8c241a !important; }
.page-content :is([color="green" i], [style*="color: green" i], [style*="color: #0A0" i]) { color: #25562b !important; }
.page-content [color="black" i] { color: var(--ink); }

.launcher-panel {
  border: 1px solid var(--brass);
  background: #192a30;
  color: #f0dfc0;
  box-shadow: 0 2px 6px #38271852;
}

.launcher-hero {
  padding: clamp(1rem, 3vw, 2rem);
  background:
    linear-gradient(90deg, #121b22fa, #121b22eb 46%, #121b2240),
    #192a30 url("../../images/materia-hero.jpg") 78% center / cover no-repeat;
  box-shadow: inset 0 0 0 3px #090f1766, inset 0 0 0 4px #d6ad6654;
}

.launcher-hero h2 {
  margin: 0 0 .65rem;
  max-width: 17ch;
  color: #ffe2a5;
  font-size: clamp(1.7rem, 3.2vw, 2.45rem);
  text-wrap: balance;
  text-shadow: 0 2px 4px #101016;
}

.launcher-hero > p { max-width: 34ch; margin: 0 0 1.15rem; }
.launcher-release { width: fit-content; max-width: 100%; }

.launcher-status {
  display: grid;
  gap: .15rem;
  margin: 0;
  padding: .55rem .8rem;
  border: 1px solid #a87d45;
  border-inline-start: 3px solid var(--brass-light);
  background: linear-gradient(#3c3029, #241f22);
  box-shadow: inset 0 1px #ffd99232;
  font-size: .9rem;
}

.launcher-status strong { color: #ffe2a5; font: 700 1.15rem/1.2 var(--display); }
.launcher-platform { margin: .55rem 0 0; color: #e1cfad; font-size: .875rem; }

.launcher-worlds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--brass);
  background: #806442;
  list-style: none;
}

.launcher-worlds li {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  padding: .55rem .3rem;
  background: linear-gradient(#2c3b42, #1a2a31);
  color: #f3deb6;
  font: 700 .95rem/1.25 var(--display);
}

.launcher-worlds li::before {
  content: "";
  flex: 0 0 .35rem;
  height: .35rem;
  border: 1px solid var(--brass-light);
  transform: rotate(45deg);
}

.launcher-guide { margin-top: 1.4rem; }
.launcher-guide h2 { margin: 0 0 .75rem; color: #54281d; font-size: 1.5rem; }

.launcher-guide ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: launcher-step;
}

.launcher-guide li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: .45rem;
  padding: .7rem;
  border: 1px solid var(--paper-line);
  background: #f9edd2a8;
  counter-increment: launcher-step;
}

.launcher-guide li::before {
  content: counter(launcher-step);
  padding: .06rem .38rem;
  border: 1px solid #ae8150;
  background: linear-gradient(#794337, #542a26);
  color: #ffe5b2;
  font: 700 .9rem/1.4 var(--display);
  text-align: center;
}

.launcher-guide h3 { margin: 0; color: #54281d; font-size: 1.03rem; }
.launcher-guide li p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }

.quest-gallery + .quest-gallery { margin-top: 1.75rem; }
.quest-gallery h2 { margin: 0 0 .75rem; }
.quest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .65rem; margin: 0; padding: .2rem; list-style: none; }
.quest-grid a { display: block; border: 1px solid var(--brass); }
.quest-grid a:hover { border-color: var(--wine); }
.quest-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--night); }

.highscores th { text-align: left; }
.highscores td:first-child, .highscores th:first-child { width: 4rem; }
.highscores td:last-child, .highscores th:last-child { text-align: right; }
.highscores td { font-variant-numeric: tabular-nums; }
.highscores td[colspan] { text-align: left; }
.highscores .highscore-outfit { width: 1%; padding-inline: .35rem; text-align: center; white-space: nowrap; }

.outfit-preview {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  aspect-ratio: 1;
  vertical-align: middle;
  border: 1px solid #b89a6b80;
  background: radial-gradient(ellipse at 60% 65%, #fff1d2, #cca97654);
}

.outfit-preview img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.character-outfit { width: 5rem; border-color: var(--paper-line); }

.tabberlive .tabbertabhide, .tabberlive .tabbertab > :is(h2, h3) { display: none; }
.tabbernav, .skill-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.tabbernav a, .skill-nav a { display: block; padding: .3rem .55rem; border: 1px solid var(--paper-line); background: var(--paper-raised); text-decoration: none; font-size: .875rem; }
.tabbernav a:hover, .skill-nav a:hover { background: var(--paper-shade); }
.tabberactive a, .skill-nav [aria-current="page"] { border-color: #744230; color: #fff0c8; background: #652f25; }
.tabberactive a:hover, .skill-nav [aria-current="page"]:hover { color: #fff0c8; background: #74382d; }
.pagination { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .9rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--brass);
  color: var(--side-muted);
  background: #111823;
  font-size: .875rem;
}
.site-footer p { margin: 0; }

@media (max-width: 58rem) {
  .page-grid:has(.sidebar) { grid-template-columns: minmax(9.5rem, .8fr) minmax(0, 3fr); }
  .sidebar { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); align-items: start; }
}

@media (max-width: 38rem) {
  .page-grid, .page-grid:has(.sidebar) { grid-template-columns: minmax(0, 1fr); }
  .masthead { background-position: 70% 42%; }
  .masthead-kicker, .masthead-caption { letter-spacing: .1em; }
  .header-row { gap: .35rem; }
  .primary-nav { flex: 1 1 12rem; }
  .primary-nav li { flex: 1 0 auto; }
  .primary-nav a, .header-account { padding-inline: .5rem; font-size: .875rem; }
  .world-nav ul { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); }
  .world-nav a { height: 100%; }
  .content-panel { min-height: 0; }
  .page-content .kill-marks { white-space: normal; }
}

/* ==========================================================================
   15-year comeback edition
   ========================================================================== */

:root {
  --display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --ember: #ff9a3c;
  --ember-hot: #ffd27a;
}

body {
  background:
    radial-gradient(ellipse 60rem 30rem at 50% -6rem, #7a2c1a2e, transparent 70%),
    repeating-linear-gradient(130deg, #9cb1d204 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 50% 5%, #283447 0, var(--night) 58rem);
}

.site-shell {
  box-shadow: 0 0 0 3px #0e131d, 0 0 0 4px #5a4833, 0 0 4rem #b4561e1f, 0 1.4rem 5rem #0009;
  animation: shell-in .7s ease-out both;
}

/* ---- Masthead ---------------------------------------------------------- */

.masthead { overflow: hidden; }

/* torch flicker over the brazier on the right */
.masthead::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 96% 46%, #ffb04a66, transparent 9rem),
    radial-gradient(ellipse at 75% 100%, #ff5a1a2e, transparent 55%);
  mix-blend-mode: screen;
  animation: torch 3.2s ease-in-out infinite;
  pointer-events: none;
}

.masthead-embers { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.masthead-embers span {
  position: absolute;
  bottom: -.5rem;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--ember-hot);
  box-shadow: 0 0 6px 2px var(--ember), 0 0 14px 4px #ff5a1a66;
  opacity: 0;
  animation: ember var(--t) linear var(--d) infinite;
}
.masthead-embers span:nth-child(3n) { background: #fff1c4; }
.masthead-embers span:nth-child(4n) { animation-name: ember-alt; }

.masthead-name {
  background: linear-gradient(100deg, #ffe7a6 0%, #f4c463 30%, #fff6d4 45%, #f0b552 55%, #ffe29b 75%, #d9963d 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 0 #5c2a17) drop-shadow(0 3px 4px #130a11) drop-shadow(0 0 1.2rem #ff8a3a3d);
  animation: shimmer 7s ease-in-out infinite;
}
.masthead-edition { color: transparent; }
.masthead-caption span { padding: 0 .3em; font-size: .7em; color: var(--brass-light); }

/* anniversary seal */
.anniversary-seal {
  position: absolute;
  top: 50%;
  left: calc(clamp(1.25rem, 5vw, 4.5rem) + min(25.5rem, 34vw));
  width: clamp(5.5rem, 9vw, 7.5rem);
  aspect-ratio: 1;
  transform: translateY(-50%) rotate(-8deg);
  filter: drop-shadow(0 .4rem .8rem #000a);
  animation: seal-in .9s cubic-bezier(.2, 1.4, .4, 1) .3s both;
}
.seal-ring {
  position: absolute;
  inset: 0;
  overflow: visible;
  animation: spin 40s linear infinite;
}
.seal-ring text { fill: #ffe2a3; font: 700 9px/1 var(--body); }
.anniversary-seal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #5a1d17 0 52%, #3a1414 53% 100%);
  box-shadow: inset 0 0 0 2px #e0b06a, inset 0 0 0 5px #3a1414, inset 0 0 0 6px #b8874a, 0 0 1.5rem #ff7a2a55;
}
.seal-core {
  position: absolute;
  inset: 22%;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe8a8, #d69a45 55%, #8d5a26);
  box-shadow: inset 0 -3px 6px #5a3214, inset 0 2px 3px #fff4c8, 0 0 0 2px #3a1414;
  color: #4a1f12;
  text-align: center;
  line-height: 1;
}
.seal-core strong { font: 700 clamp(1.4rem, 2.6vw, 2rem)/.9 var(--display); }
.seal-core span { font: 700 .55rem/1.2 var(--body); letter-spacing: .18em; text-transform: uppercase; }
.seal-core span:first-child { font-size: .42rem; letter-spacing: .08em; }

/* ---- Navigation -------------------------------------------------------- */

.header-row {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 1px #100a11, inset 0 -2px #100a11, 0 .4rem 1rem #0007;
}
.header-row::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .7;
}
.primary-nav a, .header-account {
  position: relative;
  overflow: hidden;
  transition: color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.primary-nav a::after, .header-account::after {
  content: "";
  position: absolute;
  inset: auto 15% 3px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transition: transform .25s ease-out;
}
.header-row a:is(:hover, :focus-visible)::after, .header-row [aria-current="page"]::after { transform: scaleX(1); }
.header-row a:is(:hover, :focus-visible) { transform: translateY(-1px); }
.header-row [aria-current="page"] {
  box-shadow: inset 0 1px #ffe2af5e, inset 0 -2px var(--brass-light), 0 0 .9rem #ff9a3c40, 0 1px 2px #110c14;
}
.nav-discord:hover { color: #c9d0ff !important; }

/* ---- Panels ------------------------------------------------------------ */

.page-grid > * { animation: rise-in .6s ease-out both; }
.page-grid > :nth-child(2) { animation-delay: .08s; }
.page-grid > :nth-child(3) { animation-delay: .16s; }

/* brass corner brackets on the parchment */
.content-panel { position: relative; }
.content-panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  --c: #9a6c37;
  background:
    linear-gradient(var(--c), var(--c)) top left / 1.4rem 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px 1.4rem,
    linear-gradient(var(--c), var(--c)) top right / 1.4rem 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px 1.4rem,
    linear-gradient(var(--c), var(--c)) bottom left / 1.4rem 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 1.4rem,
    linear-gradient(var(--c), var(--c)) bottom right / 1.4rem 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 1.4rem;
  background-repeat: no-repeat;
  pointer-events: none;
}

.page-title {
  position: relative;
  background: linear-gradient(90deg, #54281d, #8a3a22 60%, #54281d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-title::after {
  content: "◆";
  position: absolute;
  left: 50%;
  bottom: -.62rem;
  padding: 0 .5rem;
  transform: translateX(-50%);
  background: #f4e6c8;
  color: #9a6c37;
  font-size: .75rem;
  -webkit-text-fill-color: #9a6c37;
}

.side-card { transition: border-color .25s, box-shadow .25s, transform .25s; }
.side-card:hover {
  border-color: #8fc2b8;
  box-shadow: inset 0 0 0 2px #080e14a6, 0 0 0 1px #0a111a, 0 .5rem 1.2rem #0009, 0 0 1rem #5fb3a62b;
}
.world-nav:hover { border-color: #c98a5c; box-shadow: inset 0 0 0 2px #080e14a6, 0 0 0 1px #0a111a, 0 .5rem 1.2rem #0009, 0 0 1rem #ff8a3a26; }
.world-nav a { transition: padding .2s, background .2s, color .2s; }
.world-nav a:hover, .world-nav a:focus-visible { padding-inline-start: .8rem; }
.world-nav a:hover::before { background: var(--gold); box-shadow: 0 0 6px var(--ember); }

.status-online::before { animation: pulse 1.8s ease-out infinite; box-shadow: 0 0 0 0 #b6e4a6; }
.status-offline::before { animation: blink 2.4s ease-in-out infinite; }

.ranked-list li:nth-child(1)::before { color: #3a2408; background: linear-gradient(#ffe79a, #d4a03e); border-color: #ffd77a; }
.ranked-list li:nth-child(2)::before { color: #1d2328; background: linear-gradient(#f1f4f6, #a9b3bb); border-color: #dfe6eb; }
.ranked-list li:nth-child(3)::before { color: #2a160a; background: linear-gradient(#f0b27a, #a8642f); border-color: #e3a06b; }

/* ---- Buttons ----------------------------------------------------------- */

.button, button, input[type="submit"] { position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s, filter .2s; }
.button::after, button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, #ffffff8c 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
.button:hover::after, button:hover::after { transform: translateX(120%); transition: transform .6s ease; }
.button:hover, button:hover { transform: translateY(-1px); }
.button:active, button:active { transform: translateY(1px); }

.button-glow {
  padding-inline: 1.15rem;
  box-shadow: inset 0 0 0 1px #fff3b65c, 0 0 0 1px #3a1a10, 0 0 1.1rem #ff9a3c88;
  animation: glow 2.6s ease-in-out infinite;
}
.content-panel .button-ghost {
  border-color: #e0b06a;
  background: #120d0e8c;
  color: #ffe2a5;
  box-shadow: none;
  backdrop-filter: blur(2px);
}
.content-panel .button-ghost:hover { background: #2a1a14cc; color: #fff2cf; }

/* ---- Comeback hero ----------------------------------------------------- */

.comeback-hero {
  position: relative;
  display: grid;
  margin: 0 0 1.25rem;
  border: 1px solid #b8874a;
  color: #f3e3c2;
  background:
    linear-gradient(90deg, #0d1210f5 0%, #0d1210d9 42%, #0d121033 78%, #0d121000),
    linear-gradient(0deg, #0d1210e0, transparent 45%),
    #1a2420 url("../../images/materia-hero.jpg") 85% 30% / cover no-repeat;
  box-shadow: inset 0 0 0 3px #090f1766, inset 0 0 0 4px #d6ad6654, 0 .5rem 1.2rem #3a271866;
  overflow: hidden;
  isolation: isolate;
}
.comeback-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 92% 30%, #ffb04a40, transparent 14rem);
  animation: torch 4s ease-in-out infinite;
}
.comeback-copy { padding: clamp(1.1rem, 3vw, 2.1rem) clamp(1.1rem, 3vw, 2.1rem) 1.25rem; }
.comeback-kicker {
  margin: 0 0 .5rem;
  color: var(--brass-light);
  font: 700 .78rem/1.3 var(--body);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.comeback-kicker span { font-size: .8em; }
.comeback-hero h3 {
  margin: 0 0 .7rem;
  color: #fff0cc;
  font: 700 clamp(2rem, 4.4vw, 3.1rem)/1.02 var(--display);
  text-shadow: 0 2px 4px #000, 0 0 1.5rem #ff8a3a40;
}
.comeback-hero h3 em {
  display: block;
  font-style: italic;
  background: linear-gradient(90deg, #ffd27a, #ff9a3c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 3px #000);
  padding-right: .15em;
}
.comeback-copy > p:not(.comeback-kicker) { max-width: 38ch; margin: 0 0 1.15rem; color: #e6d6b6; text-shadow: 0 1px 2px #000; }
.comeback-hero .news-actions { margin: 0; }

.comeback-worlds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  border-top: 1px solid #b8874a99;
  list-style: none;
  background: #0b0f0ecc;
}
.comeback-worlds li {
  display: grid;
  place-content: center;
  gap: .1rem;
  padding: .6rem .3rem;
  color: #c9bba0;
  font: 700 .95rem/1.2 var(--display);
  text-align: center;
  letter-spacing: .04em;
}
.comeback-worlds li + li { border-left: 1px solid #b8874a55; }
.comeback-worlds .is-featured {
  color: #ffe2a5;
  background: linear-gradient(#6a2a1fcc, #3a1714cc);
  box-shadow: inset 0 2px var(--gold);
}
.comeback-worlds small {
  color: #ffb764;
  font: 700 .65rem/1 var(--body);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.news-card { transition: transform .2s, box-shadow .2s; border-left: 3px solid #9a6c37; }
.news-card:hover { transform: translateY(-2px); box-shadow: 0 .4rem 1rem #5a3a1a33; }

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
  align-items: center;
  background: linear-gradient(#141b27, #0c111a);
  box-shadow: inset 0 1px #dfb87926;
}
.footer-mark {
  margin-inline-end: .5rem;
  color: var(--gold);
  font: 700 1rem var(--display);
  font-variant: small-caps;
  letter-spacing: .05em;
}
.footer-links { display: flex; gap: 1rem; }

/* ---- Keyframes --------------------------------------------------------- */

@keyframes ember {
  0%   { opacity: 0; transform: translate(0, 0) scale(1); }
  10%  { opacity: 1; }
  60%  { opacity: .8; transform: translate(1.5rem, -10rem) scale(.8); }
  100% { opacity: 0; transform: translate(-.5rem, -19rem) scale(.3); }
}
@keyframes ember-alt {
  0%   { opacity: 0; transform: translate(0, 0) scale(1); }
  10%  { opacity: 1; }
  55%  { opacity: .7; transform: translate(-1.8rem, -9rem) scale(.7); }
  100% { opacity: 0; transform: translate(.8rem, -18rem) scale(.2); }
}
@keyframes torch {
  0%, 100% { opacity: .85; }
  20% { opacity: 1; }
  35% { opacity: .7; }
  50% { opacity: .95; }
  70% { opacity: .75; }
}
@keyframes shimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes seal-in { from { opacity: 0; transform: translateY(-50%) rotate(-40deg) scale(.4); } }
@keyframes shell-in { from { opacity: 0; transform: translateY(.6rem); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(.9rem); } }
@keyframes glow {
  0%, 100% { box-shadow: inset 0 0 0 1px #fff3b65c, 0 0 0 1px #3a1a10, 0 0 .6rem #ff9a3c55; }
  50% { box-shadow: inset 0 0 0 1px #fff3b65c, 0 0 0 1px #3a1a10, 0 0 1.4rem #ff9a3caa; }
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #b6e4a6aa; } 100% { box-shadow: 0 0 0 .4rem #b6e4a600; } }
@keyframes blink { 50% { opacity: .35; } }

@media (max-width: 58rem) {
  .anniversary-seal { left: auto; right: 1.25rem; top: 1.25rem; transform: rotate(-8deg); width: 5.5rem; }
  @keyframes seal-in { from { opacity: 0; transform: rotate(-40deg) scale(.4); } }
}
@media (max-width: 38rem) {
  .anniversary-seal { width: 4.5rem; top: .9rem; right: .9rem; }
  .comeback-worlds li { font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .masthead-embers { display: none; }
}
