/* MU Unity public page: the project's design system ("Crimson Ember" tokens in tokens.css) in plain CSS. No game graphics in this file.
   css/skin-s21.css (optional, local only) swaps panels, buttons and the stone background for the game client's own sprites. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }   /* anchors (and the news post opened from a link) land below the sticky 68 px header */
body {
  margin: 0; color: var(--text); font: 16px/1.65 var(--font-body); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 500px at 50% 0%, rgba(90, 20, 10, .35), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, var(--stone-900), var(--stone-950));
}
img { max-width: 100%; display: block; }
a { color: var(--gold-300); text-decoration: none; transition: color .2s; }
a:hover { color: var(--mana-300); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; margin: 0 0 .5em; color: var(--gold-200); line-height: 1.2; }
p { margin: 0 0 1em; }
.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 170px; height: 48px; padding: 0 26px; cursor: pointer;
  border: 1px solid var(--bronze-500); border-radius: 2px;
  background: linear-gradient(180deg, var(--stone-600), var(--stone-800) 55%, var(--stone-950));
  box-shadow: inset 0 1px 0 rgba(217,168,118,.28), inset 0 0 0 1px rgba(0,0,0,.65), 0 4px 10px rgba(0,0,0,.5);
  font: 700 .9rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-200); text-shadow: 0 1px 2px #000;
  transition: filter .2s var(--ease), transform .1s, box-shadow .2s;
}
.btn:hover { color: #fff; background: linear-gradient(180deg, var(--bronze-500), var(--bronze-700) 55%, var(--stone-800)); box-shadow: inset 0 1px 0 rgba(255,220,170,.35), inset 0 0 0 1px rgba(0,0,0,.65), 0 0 16px rgba(217,168,118,.35); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--mana-300); outline-offset: 3px; }
.btn--primary { color: #fff; border-color: var(--gold-400); background: linear-gradient(180deg, var(--ember-400), var(--ember-500) 50%, var(--ember-700)); box-shadow: inset 0 1px 0 rgba(255,200,160,.4), inset 0 0 0 1px rgba(0,0,0,.55), var(--shadow-ember); }
.btn--primary:hover { filter: brightness(1.18); background: linear-gradient(180deg, var(--ember-400), var(--ember-500) 50%, var(--ember-700)); }
.btn--sm { min-width: 110px; height: 40px; padding: 0 18px; font-size: .78rem; }

/* ---------- Window panel with a title bar ---------- */
.panel {
  position: relative; padding: 58px 26px 22px; border: 2px solid var(--bronze-500);
  background: linear-gradient(180deg, rgba(28,24,22,.97), rgba(19,17,16,.97));
  box-shadow: inset 0 0 0 1px #000, inset 0 0 44px rgba(0,0,0,.5), var(--shadow-panel);
}
.panel::before {   /* small crest on the title bar: a diamond */
  content: ""; position: absolute; left: 50%; top: -9px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg);
  background: var(--ember-500); border: 1px solid var(--gold-400); box-shadow: var(--shadow-ember); z-index: 2;
}
.panel > .panel__title {
  position: absolute; left: -2px; right: -2px; top: -2px; height: 44px; margin: 0; padding: 4px 8px 0;
  display: grid; place-items: center; border: 2px solid var(--bronze-500); border-bottom-color: var(--bronze-700);
  background: linear-gradient(180deg, var(--stone-600), #1f1713);
  font: 700 .92rem/1 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-200);
  text-shadow: 0 1px 3px #000, 0 0 8px rgba(232,50,31,.6); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(11,9,8,.96), rgba(19,17,16,.92));
  border-bottom: 2px solid var(--bronze-500); box-shadow: 0 6px 20px rgba(0,0,0,.6), inset 0 -1px 0 var(--bronze-700); backdrop-filter: blur(6px);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--gold-200); }
.brand .brand__logo { height: 54px; width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.7)); }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { padding: 10px 16px; font: 700 .8rem var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid transparent; transition: .2s; }
.nav a:hover, .nav a.is-active { color: var(--gold-200); border-bottom-color: var(--ember-500); text-shadow: 0 0 10px rgba(232,50,31,.6); }
.header-cta { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--bronze-500); color: var(--gold-300); padding: 8px 12px; font: 700 .8rem var(--font-display); letter-spacing: .12em; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; text-align: center; padding: 110px 0 150px; min-height: min(720px, 88vh); display: grid; align-items: center;
  background:
    radial-gradient(60% 45% at 50% 18%, rgba(232,50,31,.28), transparent 70%),
    radial-gradient(90% 60% at 80% 0%, var(--dusk-violet), transparent 70%),
    radial-gradient(90% 60% at 10% 10%, var(--dusk-indigo), transparent 70%),
    linear-gradient(180deg, #120d22 0%, var(--dusk-sea) 48%, var(--stone-900) 100%);
  border-bottom: 3px solid var(--bronze-500);
}
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 160px; z-index: -1; background: linear-gradient(180deg, transparent, var(--stone-950)); }
.hero canvas#embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,9,8,.55) 0%, rgba(11,9,8,.1) 30%, rgba(11,9,8,.35) 70%, var(--stone-950) 100%), radial-gradient(70% 80% at 28% 50%, rgba(11,9,8,.6), transparent 75%);
}
.hero h1 { font-size: clamp(1.3rem, 2.8vw, 2rem); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-200); text-shadow: 0 2px 10px #000; margin-top: 8px; }
.hero p.lead { max-width: 640px; margin: 0 auto 32px; font-size: 1.12rem; color: var(--text); text-shadow: 0 1px 6px #000; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero__badge { display: inline-block; margin-bottom: 18px; padding: 4px 14px; border: 1px solid var(--bronze-500); background: rgba(32,4,0,.7); color: var(--gold-300); font: 700 .72rem var(--font-display); letter-spacing: .24em; text-transform: uppercase; }
.hero__logo { width: min(420px, 62vw); height: auto; margin: 0 0 10px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.7)); }
@media (min-width: 861px) {   /* the knight sits on the right, the text on the left */
  .hero { text-align: left; padding: 62px 0 100px; }
  .hero__logo { width: min(270px, 62vw); }
  .hero h1 { font-size: clamp(1rem, 1.5vw, 1.3rem); letter-spacing: .26em; margin-bottom: .7em; }
  .hero p.lead { font-size: 1.02rem; margin-bottom: 24px; margin-left: 0; }
  .hero .container > * { max-width: 470px; }
  .hero__actions { justify-content: flex-start; }
}
@media (max-width: 860px) { .hero__logo { margin-inline: auto; width: min(260px, 62vw); } }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); text-transform: uppercase; letter-spacing: .14em; }
.section-head p { color: var(--text-muted); max-width: 620px; margin-inline: auto; }
.divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px auto 0; color: var(--bronze-500); }
.divider::before, .divider::after { content: ""; width: 90px; height: 1px; background: linear-gradient(90deg, transparent, var(--bronze-500)); }
.divider::after { transform: scaleX(-1); }
.divider i { width: 10px; height: 10px; transform: rotate(45deg); background: var(--ember-500); box-shadow: var(--shadow-ember); border: 1px solid var(--gold-400); }

.grid { display: grid; gap: 40px 28px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.features .card { text-align: center; }
.rune {
  width: 64px; height: 64px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--bronze-500);
  background: radial-gradient(circle at 35% 30%, var(--ember-400), var(--ember-700) 60%, var(--ember-900));
  box-shadow: inset 0 0 14px rgba(0,0,0,.7), var(--shadow-ember); font: 900 1.5rem var(--font-display); color: var(--gold-200); text-shadow: 0 1px 3px #000;
}

/* ---------- Lists ---------- */
.stats { list-style: none; margin: 0; padding: 0; }
.stats li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--bronze-700); }
.stats li:last-child { border: 0; }
.stats span { color: var(--text-muted); }
.stats b { color: var(--gold-300); font-family: var(--font-display); letter-spacing: .06em; text-align: right; }
.checks { list-style: none; padding: 0; margin: 0 0 1em; }
.checks li { padding: 5px 0 5px 28px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 9px; height: 9px; transform: rotate(45deg); background: var(--ember-500); border: 1px solid var(--gold-400); box-shadow: var(--shadow-ember); }
.checks li.todo { color: var(--text-muted); }
.checks li.todo::before { background: transparent; border-color: var(--bronze-500); box-shadow: none; }

/* ---------- Live server status ---------- */
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 7px 18px; border: 1px solid var(--bronze-700); background: rgba(5,4,3,.7); font: 700 .8rem var(--font-display); letter-spacing: .18em; text-transform: uppercase; }
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); }
.pill[data-state="online"] { color: var(--ok); border-color: var(--ok); }
.pill[data-state="online"] .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pill[data-state="maintenance"] { color: var(--warn); border-color: var(--warn); }
.pill[data-state="maintenance"] .dot { background: var(--warn); }
.pill[data-state="offline"] { color: var(--bad); border-color: var(--bad); }
.pill[data-state="offline"] .dot { background: var(--bad); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; padding: 48px 0 32px; border-top: 3px solid var(--bronze-500); background: linear-gradient(180deg, var(--stone-900), var(--stone-950)); font-size: .88rem; color: var(--text-muted); }
.site-footer .cols { display: grid; gap: 32px; grid-template-columns: 2fr 1fr; margin-bottom: 32px; }
.site-footer h4 { font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-300); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 3px 0; }
.site-footer .legal { border-top: 1px solid var(--bronze-700); padding-top: 18px; margin: 0; font-size: .78rem; color: var(--text-dim); }

@media (max-width: 860px) {
  section { padding: 56px 0; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; padding: 8px 16px 16px; background: var(--stone-900); border-bottom: 2px solid var(--bronze-500); }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .header-cta { display: none; }
  .grid--2 { grid-template-columns: 1fr; }
}

/* ---------- News ---------- */
.page-title { font-size: clamp(1.5rem, 3vw, 2.1rem); text-transform: uppercase; letter-spacing: .14em; }
.news-page { padding-top: 64px; }
.posts { display: grid; gap: 22px; }
.post {
  position: relative; padding: 20px 26px 8px; border: 2px solid var(--bronze-500);
  background: linear-gradient(180deg, rgba(28,24,22,.97), rgba(19,17,16,.97));
  box-shadow: inset 0 0 0 1px #000, inset 0 0 44px rgba(0,0,0,.5), var(--shadow-panel);
}
.post:target { border-color: var(--gold-400); box-shadow: inset 0 0 0 1px #000, inset 0 0 44px rgba(0,0,0,.5), 0 0 26px rgba(224,169,58,.28); }
.post__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: .85rem; color: var(--text-muted); }
.post h3 { margin: 0 0 .6em; font-size: 1.3rem; letter-spacing: .05em; }
.post h3 a { color: inherit; }
.post h3 a:hover { color: var(--mana-300); }
.post p, .post ul { margin: 0 0 1em; }
.post ul { padding-left: 1.3em; }
.post li { padding: 2px 0; }
.post__teaser { color: var(--text-muted); }
.post__none { text-align: center; }
.tag { padding: 5px 8px; border: 1px solid; font: 700 .68rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.tag--patch { color: #ff9b88; background: rgba(185,11,0,.28); border-color: var(--ember-600); }
.tag--news { color: var(--bronze-300); background: rgba(157,107,71,.2); border-color: var(--bronze-700); }
.tag--event { color: var(--gold-300); background: rgba(224,169,58,.14); border-color: var(--gold-600); }

/* ---------- Download ---------- */
.download-page { padding-top: 64px; }
.download-page .grid { margin-top: 56px; }
.download-page p b { color: var(--gold-200); }
a:not([href]) { color: inherit; }   /* a link whose address is not known (yet), such as the Discord link before news.json has been read */
.btn:disabled { opacity: .55; filter: grayscale(.6); cursor: default; pointer-events: none; }
.steps .card { text-align: center; }
.steps p { text-wrap: balance; }

.setup__version { margin: 0 0 20px; font: 700 .85rem/1.4 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); }
.setup__version[data-state="none"] { color: var(--text-muted); }
.setup__label { display: block; margin-bottom: 8px; font: 700 .78rem var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.setup__row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.setup__row .btn { flex: 0 0 auto; }
.setup__field {
  flex: 1 1 260px; min-width: 0; min-height: 48px; padding: 0 16px; border: 1px solid var(--bronze-500); border-radius: 2px;
  background: rgba(5,4,3,.7); box-shadow: inset 0 2px 8px rgba(0,0,0,.6); color: var(--gold-200); color-scheme: dark;
  font: 600 1rem/1 Consolas, "Cascadia Mono", "Courier New", monospace; letter-spacing: .08em; text-transform: uppercase;
}
.setup__field::placeholder { color: var(--text-dim); }
.setup__field:focus-visible { outline: 2px solid var(--mana-300); outline-offset: 2px; }
.setup__field:read-only { opacity: .6; }
.setup__note, .setup__help { margin: 12px 0 0; font-size: .9rem; }
.setup__help a[href], .setup__done a[href] { text-decoration: underline; text-underline-offset: 3px; }
.setup__status { margin: 0; }
.setup__status:not(:empty) { margin-top: 18px; }   /* an empty live region stays in the page (screen readers only announce regions that were already there) */
.setup__numbers:empty { display: none; }
.setup__status[data-state="ok"] { color: var(--ok); }
.setup__status[data-state="error"] { color: var(--ember-300); }
.setup__progress { margin-top: 14px; }
.setup__bar { height: 14px; overflow: hidden; border: 1px solid var(--bronze-700); background: rgba(5,4,3,.7); box-shadow: inset 0 1px 4px rgba(0,0,0,.7); }
.setup__fill { display: block; width: 0; height: 100%; background: linear-gradient(180deg, var(--ember-400), var(--ember-500) 50%, var(--ember-700)); box-shadow: var(--shadow-ember); transition: width .2s linear; }
.setup__bar[data-state="ok"] .setup__fill { background: var(--ok); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 14px rgba(98,192,90,.45); }
.setup__bar[data-state="wait"] .setup__fill { width: 30%; transition: none; animation: setup-wait 1.1s ease-in-out infinite alternate; }
@keyframes setup-wait { to { margin-left: 70%; } }
.setup__numbers { margin: 8px 0 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.setup__done { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--bronze-700); }
@media (min-width: 861px) and (max-width: 960px) { .nav a { padding: 10px 9px; } }   /* five links and the Join button: tighter just above the point where the menu takes over, so that no link wraps */
@media (max-width: 520px) { .setup__row .btn { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) {
  .setup__fill { transition: none; }
  .setup__bar[data-state="wait"] .setup__fill { width: 100%; opacity: .4; animation: none; }
}

/* ---------- Moving between pages (js/site.js adds .leaving before it goes to the next page) ---------- */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
main, .site-footer { animation: page-in .3s ease-out; }
html.leaving main, html.leaving .site-footer { opacity: 0; transition: opacity .16s ease-in; }
@media (prefers-reduced-motion: reduce) { main, .site-footer { animation: none; } }

/* the status card has no title bar: less room at the top */
#statusCard.panel { padding-top: 26px; }
