/* Alurian theme: shell (from prototype/index.html) */
/* Alurian: painted citadel behind carved-stone panels with bronze knotwork, lit by torch fire. */
:root {
  --stone-0: #101315;
  --stone-1: #1a1f22;
  --stone-2: #252b2f;
  --stone-3: #343b40;
  --stone-edge: #4b545a;
  --bronze-0: #5a3a17;
  --bronze-1: #8c5f2a;
  --bronze-2: #c08a43;
  --bronze-3: #e8bd73;
  --bronze-4: #fbe2a6;
  --ember-0: #8e2d10;
  --ember-1: #cf4a17;
  --ember-2: #f07a24;
  --ember-3: #ffb13d;
  --blood: #7e1f1f;
  --text: #ece6da;
  --text-dim: #bdb4a4;
  --text-faint: #958c7d;
  --title: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --gap: clamp(14px, 1.4vw, 22px);
  --radius: 6px;
  --knot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14' viewBox='0 0 48 14'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fbe2a6'/%3E%3Cstop offset='.5' stop-color='%23c08a43'/%3E%3Cstop offset='1' stop-color='%235a3a17'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 7C6 0 18 0 24 7S42 14 48 7' fill='none' stroke='%23120c06' stroke-width='5'/%3E%3Cpath d='M0 7C6 0 18 0 24 7S42 14 48 7' fill='none' stroke='url(%23g)' stroke-width='2.6'/%3E%3Cpath d='M0 7C6 14 18 14 24 7S42 0 48 7' fill='none' stroke='%23120c06' stroke-width='5'/%3E%3Cpath d='M0 7C6 14 18 14 24 7S42 0 48 7' fill='none' stroke='url(%23g)' stroke-width='2.6'/%3E%3Cpath d='M18 2.6C21 3.6 23 5 24 7S27 10.4 30 11.4' fill='none' stroke='%23120c06' stroke-width='5'/%3E%3Cpath d='M18 2.6C21 3.6 23 5 24 7S27 10.4 30 11.4' fill='none' stroke='url(%23g)' stroke-width='2.6'/%3E%3C/svg%3E");
  color-scheme: dark;
}
/* ---- day / night themes --------------------------------------------------
   Day is the base (:root); night overrides.
   Night: carved dark stone, moonlight from above, torch embers.
   Day: sunlit limestone and parchment panels, warm haze, drifting dust.
   Dark surfaces (main bar, feature banner, footer) keep night ink in both. */
:root, [data-time="day"] {
  --panel: rgba(234, 222, 196, .96);
  --panel-head: #d5c099;
  --panel-line: rgba(140, 95, 42, .5);
  --edge: #4e3719;
  --text: #2a1e12;
  --text-dim: #574330;
  --text-faint: #6c5639;
  --title-c: #6b3d10;
  --title-shadow: 0 1px 0 rgba(255, 246, 225, .7);
  --accent: #8a4a10;
  --ic: #8a5a20;
  --link: #87470f;
  --link-hover: #b0561a;
  --warn: #a3341a;
  --rule: rgba(110, 70, 25, .22);
  --field-bg: #f7f0e1;
  --field-edge: #a88a5c;
  --placeholder: #74603f;
  --tile-a: #f5ecd9;
  --tile-b: #d8c49c;
  --soft-btn-a: #f5ecd9;
  --soft-btn-b: #cfb98e;
  --soft-btn-text: #2a1e12;
  --tab-bg: #f3ead8;
  --chip-bg: rgba(247, 240, 225, .88);
  --chip-text: #2a1e12;
  --shadow: 0 16px 30px rgba(45, 28, 10, .38);
}
[data-time="night"], .msheet {
  --panel: rgba(22, 27, 31, .95);
  --panel-head: #2c3338;
  --panel-line: rgba(192, 138, 67, .32);
  --edge: #0b0d0e;
  --text: #ece6da;
  --text-dim: #bdb4a4;
  --text-faint: #958c7d;
  --title-c: var(--bronze-3);
  --title-shadow: 0 2px 0 rgba(0, 0, 0, .6);
  --accent: var(--bronze-4);
  --ic: var(--bronze-2);
  --link: var(--bronze-3);
  --link-hover: var(--bronze-4);
  --warn: #f08a6e;
  --rule: rgba(192, 138, 67, .18);
  --field-bg: rgba(8, 10, 11, .7);
  --field-edge: var(--stone-edge);
  --placeholder: #8d8576;
  --tile-a: var(--stone-3);
  --tile-b: var(--stone-1);
  --soft-btn-a: var(--stone-3);
  --soft-btn-b: var(--stone-1);
  --soft-btn-text: var(--text);
  --tab-bg: rgba(8, 10, 11, .6);
  --chip-bg: rgba(16, 19, 21, .78);
  --chip-text: #ece6da;
  --shadow: 0 16px 30px rgba(0, 0, 0, .5);
}
/* surfaces that stay dark in both themes */
.mainbar, .feature, footer.site {
  --text: #ece6da; --text-dim: #bdb4a4; --text-faint: #958c7d;
  --link: var(--bronze-3); --link-hover: var(--bronze-4);
  --soft-btn-a: var(--stone-3); --soft-btn-b: var(--stone-1); --soft-btn-text: #ece6da;
}
.panel, .panel > header, .field input, .btn.stone, .news .date, .tabs button, .systems .ring, .pill, .time-toggle, .langs {
  transition: background-color .9s ease, color .9s ease, border-color .9s ease;
}

* { box-sizing: border-box; }
html { background: var(--stone-0); scrollbar-color: var(--bronze-1) var(--stone-0); }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 16px/1.55 var(--body);
  color: var(--text);
  caret-color: var(--bronze-3);
}
::selection { background: var(--ember-1); color: #fff8ec; }
:focus-visible { outline: 2px solid var(--bronze-3); outline-offset: 3px; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
img, svg { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---- painted scene ------------------------------------------------------ */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.scene .art {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transition: opacity 1.4s ease;
}
.scene .day { background-image: url("../images/layout/bg-day.jpg"); }
.scene .night { background-image: url("../images/layout/bg-night.jpg"); opacity: 0; }
[data-time="night"] .scene .night { opacity: 1; }
.scene .veil { position: absolute; inset: 0; transition: opacity 1.4s ease; }
.scene .veil.v-day { opacity: 0; }
[data-time="day"] .scene .veil.v-day { opacity: 1; }
[data-time="day"] .scene .veil.v-night { opacity: 0; }
.scene .veil.v-day {
  background:
    radial-gradient(ellipse 55% 50% at 82% -8%, rgba(255, 214, 140, .4), transparent 70%),
    radial-gradient(ellipse 50% 60% at 50% 60%, rgba(60, 38, 16, .28), transparent 75%),
    linear-gradient(180deg, rgba(255, 236, 200, .08) 0, rgba(70, 45, 20, .2) 60%, rgba(40, 26, 12, .7) 100%);
}
.scene .veil.v-night {
  background:
    radial-gradient(ellipse 60% 45% at 18% -5%, rgba(140, 170, 225, .22), transparent 70%),
    radial-gradient(ellipse 46% 60% at 50% 58%, rgba(8, 11, 18, .7), rgba(8, 11, 18, .3) 70%, transparent),
    linear-gradient(180deg, rgba(10, 14, 24, .3) 0, rgba(10, 12, 18, .45) 60%, rgba(8, 9, 12, .86) 100%);
}
/* sun disc glow / moon glow behind the crest corner */
.scene .orb {
  position: absolute; top: -140px; width: 420px; height: 420px; border-radius: 50%;
  transition: opacity 1.4s ease, transform 1.8s ease;
}
.scene .sun-orb { right: 6%; background: radial-gradient(circle, rgba(255, 228, 160, .55), rgba(255, 190, 90, .18) 40%, transparent 68%); }
.scene .moon-orb { left: 8%; background: radial-gradient(circle, rgba(215, 228, 255, .35), rgba(130, 160, 220, .12) 38%, transparent 66%); opacity: 0; transform: translateY(40px); }
[data-time="night"] .scene .sun-orb { opacity: 0; transform: translateY(40px); }
[data-time="night"] .scene .moon-orb { opacity: 1; transform: none; }
.embers { position: absolute; inset: 0; pointer-events: none; }

/* ---- top strip ----------------------------------------------------------- */
.strip {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 1320px; margin: 0 auto; padding: 10px max(16px, 2vw) 0;
  font-size: 14px; color: var(--text-dim);
}
.strip .left, .strip .right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pill, .langs {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid rgba(192, 138, 67, .5);
  color: var(--chip-text); font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #e05b3c; box-shadow: 0 0 0 3px rgba(224, 91, 60, .25); }
.pill.on .dot { background: #6fcf74; box-shadow: 0 0 0 3px rgba(111, 207, 116, .25); }
.langs a { color: var(--chip-text); opacity: .72; text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.langs a:hover { opacity: 1; color: var(--chip-text); }
.langs a[aria-current="true"] { opacity: 1; color: var(--link); }
.time-toggle {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center;
  width: 132px; height: 34px; padding: 3px; border-radius: 999px; cursor: pointer;
  font: 700 13px var(--body); color: var(--chip-text);
  background: var(--chip-bg); border: 1px solid rgba(192, 138, 67, .5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.time-toggle .knob {
  position: absolute; top: 3px; left: 3px; width: calc(50% - 3px); height: 26px; border-radius: 999px;
  background: linear-gradient(180deg, #ffe7a8, #f0b347 60%, #c97f22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 14px rgba(255, 196, 90, .55);
  transition: transform .5s cubic-bezier(.6, .1, .2, 1), background .5s, box-shadow .5s;
}
[data-time="night"] .time-toggle .knob {
  transform: translateX(100%);
  background: linear-gradient(180deg, #e6ecf7, #9fb0cf 60%, #5d6f94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 14px rgba(160, 185, 235, .5);
}
.time-toggle span { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: color .5s; }
.time-toggle svg { width: 14px; height: 14px; }
[data-time="day"] .time-toggle .t-day, [data-time="night"] .time-toggle .t-night { color: #1c1006; }

/* ---- logo + main bar ----------------------------------------------------- */
.crest { display: flex; justify-content: center; padding: 6px 16px 0; }
.crest img { width: clamp(260px, 30vw, 430px); height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .7)); }
.mainbar {
  position: relative;
  max-width: 1320px; margin: 4px auto 0; padding: 0 max(16px, 2vw);
}
.mainbar nav {
  position: relative;
  display: flex; justify-content: center; align-items: center; gap: clamp(4px, 1vw, 14px);
  min-height: 58px; padding: 6px 70px;
  background: linear-gradient(180deg, var(--stone-3), var(--stone-1));
  border: 1px solid #0b0d0e; border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 28px rgba(0, 0, 0, .55);
}
.mainbar nav::before, .mainbar nav::after {
  content: ""; position: absolute; left: 12px; right: 12px; height: 14px; background: var(--knot) repeat-x center / 48px 14px;
}
.mainbar nav::before { top: -8px; }
.mainbar nav::after { bottom: -8px; }
.mainbar .medal {
  position: absolute; top: 50%; width: 62px; height: 62px; transform: translateY(-50%);
  border-radius: 50%; overflow: hidden; border: 3px solid var(--bronze-2);
  box-shadow: 0 0 0 3px #0b0d0e, 0 8px 16px rgba(0, 0, 0, .6); z-index: 2;
}
.mainbar .medal img { width: 100%; height: 100%; object-fit: cover; }
.mainbar .medal.l { left: calc(max(16px, 2vw) - 6px); }
.mainbar .medal.r { right: calc(max(16px, 2vw) - 6px); }
.mainbar a {
  font: 700 14px/1 var(--title); letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
  padding: 11px clamp(8px, 1vw, 14px); border-radius: 4px;
  transition: color .2s, background .2s;
}
.mainbar a:hover { color: var(--bronze-4); background: rgba(192, 138, 67, .12); }
.mainbar a[aria-current="page"] {
  color: #1c1006;
  background: linear-gradient(180deg, var(--bronze-4), var(--bronze-2) 55%, #a87436);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 6px rgba(0, 0, 0, .5);
}
.menu-toggle { display: none; }

/* ---- layout --------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 270px;
  gap: var(--gap);
  max-width: 1320px; margin: 0 auto;
  padding: calc(var(--gap) + 10px) max(16px, 2vw) 50px;
}
.side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* carved panel: stone head with bronze knot rule, dark stone body */
.panel {
  position: relative;
  background-color: var(--panel);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .1));
  border: 1px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--panel-line), var(--shadow);
}
.panel > header {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 8px 16px 12px;
  background-color: var(--panel-head);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(0, 0, 0, .08));
  border-radius: var(--radius) var(--radius) 0 0;
}
.panel > header::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -7px; height: 14px;
  background: var(--knot) repeat-x center / 48px 14px;
}
.panel > header h2, .panel > header h3 {
  margin: 0; font: 700 18px/1.1 var(--title); letter-spacing: .1em; text-transform: uppercase;
  color: var(--title-c); text-shadow: var(--title-shadow);
}
.panel > header svg { width: 18px; height: 18px; color: var(--ic); flex: none; }
.panel .body { padding: 20px 18px 18px; }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  font: 700 14px/1 var(--title); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  padding: 13px 14px; border-radius: 5px; cursor: pointer;
  color: #1c1006;
  background: linear-gradient(180deg, var(--bronze-4), var(--bronze-2) 52%, #a87436);
  border: 1px solid #2a1a08;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 6px 14px rgba(0, 0, 0, .45);
  transition: filter .2s, transform .15s;
}
.btn:hover { filter: brightness(1.08); color: #1c1006; }
.btn:active { transform: translateY(1px); }
.btn.fire {
  color: #fff8ec;
  background: linear-gradient(180deg, #b8441a, #a0360f 55%, #74230b);
  border-color: #3d1405; text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}
.btn.fire:hover { color: #fff; }
.btn.stone {
  color: var(--soft-btn-text);
  background: linear-gradient(180deg, var(--soft-btn-a), var(--soft-btn-b));
  border-color: var(--edge); box-shadow: inset 0 0 0 1px rgba(192, 138, 67, .35), 0 6px 14px rgba(0, 0, 0, .3);
}
.btn.stone:hover { color: var(--link-hover); }

/* login */
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 14px; font-weight: 700; color: var(--text-dim); }
.field input {
  font: 500 16px var(--body); color: var(--text);
  background: var(--field-bg); border: 1px solid var(--field-edge); border-radius: 4px;
  padding: 10px 12px; transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--placeholder); }
.field input:focus { outline: none; border-color: var(--bronze-2); box-shadow: 0 0 0 3px rgba(192, 138, 67, .2); }
.stack { display: grid; gap: 10px; }
.aux { display: flex; justify-content: space-between; font-size: 14px; margin-top: 12px; }

/* download */
.download {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: var(--radius); text-decoration: none; color: #fff8ec;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 190, 110, .22), transparent 55%),
    linear-gradient(180deg, #b8441a, #a0360f 55%, #74230b);
  border: 1px solid #3d1405;
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, .5), inset 0 0 0 1px rgba(255, 200, 120, .25), 0 16px 30px rgba(0, 0, 0, .55);
  transition: filter .2s, transform .15s;
}
.download:hover { filter: brightness(1.07); color: #fff; }
.download:active { transform: translateY(1px); }
.download .ico {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(20, 8, 2, .35); border: 1px solid rgba(255, 220, 160, .45);
}
.download .ico svg { width: 17px; height: 17px; }
.download strong { display: block; font: 800 14px/1.15 var(--title); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.download span { font-size: 13px; line-height: 1.3; color: #fff3e2; }

/* menu */
.menu details + details { border-top: 1px solid var(--rule); }
.menu summary {
  display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none;
  padding: 12px 16px; font: 700 15px var(--title); letter-spacing: .06em; color: var(--text);
  transition: background .2s, color .2s;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: rgba(192, 138, 67, .1); color: var(--link-hover); }
.menu summary .ic { width: 20px; height: 20px; color: var(--ic); flex: none; }
.menu summary .chev { margin-left: auto; width: 14px; height: 14px; color: var(--text-faint); transition: transform .25s; }
.menu details[open] summary { color: var(--title-c); }
.menu details[open] .chev { transform: rotate(180deg); }
.menu ul { list-style: none; margin: 0; padding: 2px 16px 12px 48px; }
.menu li a { display: block; padding: 6px 0; color: var(--text-dim); text-decoration: none; font-size: 15.5px; transition: color .2s, transform .2s; }
.menu li a:hover { color: var(--link-hover); transform: translateX(3px); }
.menu .body { padding: 10px 0 6px; }

/* ---- center ---------------------------------------------------------------- */
.center { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.feature {
  position: relative; overflow: hidden; border-radius: var(--radius);
  min-height: 300px; display: flex; align-items: flex-end;
  border: 1px solid #0b0d0e;
  box-shadow: inset 0 0 0 1px rgba(192, 138, 67, .45), 0 18px 36px rgba(0, 0, 0, .55);
  background: var(--stone-1);
}
.feature .pic {
  position: absolute; inset: 0;
  background: url("../images/layout/bg-night.jpg") 62% 48% / 190% auto no-repeat;
  transition: transform 6s ease, opacity 1.4s ease;
}
.feature .pic.p-day { background-image: url("../images/layout/bg-day.jpg"); opacity: 0; }
[data-time="day"] .feature .pic.p-day { opacity: 1; }
.feature:hover .pic { transform: scale(1.04); }
.feature::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 12, 14, .94) 0, rgba(10, 12, 14, .78) 42%, rgba(10, 12, 14, .1) 80%);
}
.feature .copy { position: relative; z-index: 1; padding: 30px 34px 32px; max-width: 560px; }
.feature .tag {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font: 700 13px var(--body); letter-spacing: .1em; text-transform: uppercase;
  color: #fff8ec; background: var(--blood); padding: 5px 10px; border-radius: 4px;
  border: 1px solid rgba(255, 200, 150, .3);
}
.feature h1 { margin: 0 0 10px; font: 800 clamp(28px, 3vw, 42px)/1.08 var(--title); color: var(--bronze-4); text-shadow: 0 3px 0 rgba(0, 0, 0, .55); text-wrap: balance; }
.feature p { margin: 0 0 18px; font-size: 18px; color: var(--text); max-width: 46ch; }
.feature .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.feature .actions .btn { width: auto; padding: 13px 20px; }
.dots { position: absolute; right: 22px; bottom: 20px; z-index: 1; display: flex; gap: 8px; }
.dots button { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--bronze-2); background: transparent; padding: 0; cursor: pointer; }
.dots button[aria-current="true"] { background: var(--bronze-3); }

/* systems strip */
.systems { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.systems a {
  display: grid; justify-items: center; gap: 10px; text-align: center; text-decoration: none;
  padding: 20px 10px 18px; color: var(--text);
  transition: background .25s;
}
.systems a + a { border-left: 1px solid var(--rule); }
.systems a:hover { background: rgba(192, 138, 67, .1); }
.systems .ring {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--tile-a), var(--tile-b));
  border: 2px solid var(--bronze-2); box-shadow: 0 0 0 3px var(--edge), 0 8px 14px rgba(0, 0, 0, .35);
  color: var(--title-c); transition: transform .25s, border-color .25s;
}
.systems a:hover .ring { transform: translateY(-3px); border-color: var(--bronze-3); }
.systems .ring svg { width: 26px; height: 26px; }
.systems strong { font: 700 15px var(--title); letter-spacing: .04em; }
.systems span { font-size: 14px; color: var(--text-dim); line-height: 1.35; }

/* news */
.news article { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 18px; padding: 18px 20px; }
.news article + article { border-top: 1px solid var(--rule); }
.news .date {
  display: grid; place-items: center; align-content: center; height: 74px; border-radius: 5px;
  background: linear-gradient(180deg, var(--tile-a), var(--tile-b));
  border: 1px solid var(--edge); box-shadow: inset 0 0 0 1px rgba(192, 138, 67, .35);
}
.news .date b { font: 800 28px/1 var(--title); color: var(--title-c); }
.news .date span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.news h3 { margin: 0 0 6px; font: 700 22px/1.2 var(--title); color: var(--text); text-wrap: balance; }
.news h3 a { color: inherit; text-decoration: none; }
.news h3 a:hover { color: var(--link-hover); }
.news p { margin: 0; color: var(--text-dim); max-width: 70ch; }
.news .cat { display: inline-block; margin-bottom: 6px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }

/* ---- right column ------------------------------------------------------------ */
.status .big { display: flex; align-items: baseline; gap: 10px; }
.status .big b { font: 800 48px/1 var(--title); color: var(--accent); }
.status .big span { color: var(--text-dim); font-weight: 700; }
.status .state { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-weight: 800; color: var(--warn); }
.status .state i { width: 10px; height: 10px; border-radius: 50%; background: #e05b3c; }
.status dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0; font-size: 15px; }
.status dt { color: var(--text-dim); }
.status dd { margin: 0; font-weight: 700; }

.store .coin { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.store .coin .ring {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--bronze-4), var(--bronze-1));
  border: 2px solid #2a1a08; box-shadow: 0 6px 12px rgba(0, 0, 0, .45); color: #3a2208;
}
.store .coin .ring svg { width: 26px; height: 26px; }
.store .coin strong { display: block; font: 700 17px/1.15 var(--title); color: var(--title-c); }
.store .coin span { font-size: 14px; color: var(--text-dim); }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin-bottom: 14px; }
.podium div { display: grid; justify-items: center; gap: 6px; text-align: center; }
.podium .step {
  width: 100%; border-radius: 4px 4px 0 0; display: grid; place-items: center;
  font: 800 18px var(--title); color: #1c1006;
  background: linear-gradient(180deg, var(--bronze-4), #a87436); border: 1px solid #2a1a08;
}
.podium .p1 .step { height: 62px; }
.podium .p2 .step { height: 44px; background: linear-gradient(180deg, #e7e5e0, #8e9196); }
.podium .p3 .step { height: 34px; background: linear-gradient(180deg, #f0c3a0, #b5784a); }
.podium a { font-size: 13.5px; font-weight: 700; color: var(--text); text-decoration: none; line-height: 1.2; }
.podium small { font-size: 12.5px; color: var(--text-dim); }
/* ranking box (boxes/ranking.php): five tabs, 3 + 2 stone keys in the
   column; one row when the box is wide. Without JS only Level shows. */
.rank .body { container: rank / inline-size; }
.tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-bottom: 16px; }
.tabs button {
  grid-column: span 2; min-width: 0; min-height: 34px; padding: 6px 3px;
  font: 700 11.5px/1.1 var(--title); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  border-radius: 4px; color: var(--text-dim);
  background: var(--tab-bg); border: 1px solid var(--field-edge);
  transition: color .2s, background-color .2s, border-color .2s;
}
.tabs button:nth-child(n+4) { grid-column: span 3; }
.tabs button:hover { color: var(--link-hover); border-color: var(--bronze-2); }
.tabs button[aria-selected="true"] {
  color: #1c1006; background: linear-gradient(180deg, var(--bronze-4), var(--bronze-2)); border-color: #2a1a08;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 5px rgba(0, 0, 0, .3);
}
html:not(.js) .rank .tabs { display: none; }
@media (pointer: coarse) { .tabs button { min-height: 42px; } }
@container rank (min-width: 400px) {
  .tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tabs button, .tabs button:nth-child(n+4) { grid-column: auto; }
}

/* With JS every pane sits in one grid cell, so the box keeps the tallest
   pane's height and nothing below it jumps when the tab changes; the
   inactive ones (.is-off) are invisible, out of the Tab order and of the
   accessibility tree. (A class, not [hidden]: the base styles force
   [hidden] to display: none !important.) */
.rank-panes { display: grid; }
.rank-pane { display: flex; flex-direction: column; min-width: 0; }
.rank-pane.is-off { display: none; }
.js .rank-pane { grid-area: 1 / 1; }
.js .rank-pane.is-off { display: flex; visibility: hidden; }
@keyframes rank-in { from { opacity: .15; transform: translateY(5px); } }
.rank[data-switched] .rank-pane:not(.is-off) { animation: rank-in .32s cubic-bezier(.16, 1, .3, 1); }
@media (prefers-reduced-motion: reduce) { .rank[data-switched] .rank-pane:not(.is-off) { animation: none; } }

.rank-head {
  display: flex; justify-content: space-between; gap: 10px; margin: 0 0 2px;
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint);
}
.rank-rows { list-style: none; margin: 0; padding: 0; }
.rank-rows li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  min-height: 38px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.3;
}
.rank-rows a { color: var(--text); font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-rows a:hover { color: var(--link-hover); }
.rank-rows .val { color: var(--text-dim); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.rank-rows .no { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 800 12px/1 var(--title); color: var(--text-faint); }
/* 1st to 3rd: the podium's gold, silver and copper */
.rank-rows:not([start]) li:nth-child(-n+3) .no { color: #1c1006; border: 1px solid #2a1a08; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.rank-rows:not([start]) li:nth-child(1) .no { background: linear-gradient(180deg, var(--bronze-4), #a87436); }
.rank-rows:not([start]) li:nth-child(2) .no { background: linear-gradient(180deg, #e7e5e0, #8e9196); }
.rank-rows:not([start]) li:nth-child(3) .no { background: linear-gradient(180deg, #f0c3a0, #b5784a); }
.rank-rows.guilds li { grid-template-columns: 22px 26px minmax(0, 1fr) auto; }
.rank-rows .who { display: grid; min-width: 0; }
.rank-rows .who small { font-size: 12.5px; color: var(--text-dim); }
.rank-rows .logo { width: 26px; height: 26px; object-fit: contain; }
.shield { width: 30px; height: 34px; display: grid; place-items: center; font: 800 13px var(--title); color: #fff8ec; background: var(--blood); clip-path: path("M15 0L30 4V16C30 26 23 31 15 34C7 31 0 26 0 16V4Z"); }
.rank-rows .shield { width: 24px; height: 28px; justify-self: center; font-size: 10.5px; clip-path: path("M12 0L24 3.2V12.8C24 20.8 18.4 24.8 12 27.2C5.6 24.8 0 20.8 0 12.8V3.2Z"); }

.discord p { margin: 0 0 14px; color: var(--text-dim); font-size: 15px; }
.btn.discord-btn { color: #fff; background: linear-gradient(180deg, #5865d6, #4450c0 55%, #343da0); border-color: #232a6e; }

footer.site {
  max-width: 1320px; margin: 0 auto; padding: 22px max(16px, 2vw) 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  color: var(--text-dim); font-size: 14px;
  border-top: 1px solid rgba(192, 138, 67, .3); text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}

/* motion: embers rise from the scene's braziers (canvas, off under reduced motion) */
@media (prefers-reduced-motion: reduce) { .embers { display: none; } .feature .pic { transition: none; } }

/* ---- responsive ---------------------------------------------------------------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .side.right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .systems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .systems a:nth-child(3) { border-left: 0; }
  .systems a:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 860px) {
  .strip .langs { display: none; }
  .mainbar nav { justify-content: space-between; padding: 6px 12px; }
  .mainbar nav a:not(.menu-toggle) { display: none; }
  .mainbar .medal { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
    font: 700 14px var(--title); letter-spacing: .1em; text-transform: uppercase;
    color: var(--bronze-3); background: transparent; border: 1px solid rgba(192, 138, 67, .5); border-radius: 4px; padding: 9px 12px; cursor: pointer;
  }
  .mainbar .brand-mini { display: flex !important; align-items: center; gap: 10px; font: 700 15px var(--title); letter-spacing: .1em; color: var(--bronze-3); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .center { order: -1; }
  .feature { min-height: 0; }
  .feature .pic { background-size: cover; background-position: 60% 30%; }
  .strip .pill-long { display: none; }
  .feature::after { background: linear-gradient(180deg, rgba(10, 12, 14, .35), rgba(10, 12, 14, .92) 55%); }
  .feature .copy { padding: 140px 20px 24px; }
  .news article { grid-template-columns: 60px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .news .date { height: 60px; }
}
.mainbar .brand-mini { display: none; }

/* ---- phones: sticky top bar + menu drawer + account panel (parts/mobile.php) ----
   Only with JS (html.js, set in the head before first paint): without it the
   desktop shell stays, stacked in one column. Both drawers wear the dark main
   bar stone in day and night. */
.mbar, .msheet:not([open]) { display: none; }
@media (max-width: 860px) {
  .js .strip, .js .crest, .js .mainbar, .js .side.left { display: none; }
  .js { scroll-padding-top: calc(76px + env(safe-area-inset-top)); }
  .js .layout { padding-top: 22px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .js footer.site { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(40px, calc(20px + env(safe-area-inset-bottom))); }

  .js .mbar {
    position: sticky; top: 0; z-index: 40;
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px;
    padding: calc(6px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    background: linear-gradient(180deg, var(--stone-3), var(--stone-1));
    border-bottom: 1px solid #0b0d0e;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 22px rgba(0, 0, 0, .5);
  }
  .js .mbar::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: -8px; height: 14px;
    background: var(--knot) repeat-x center / 48px 14px; pointer-events: none;
  }
}
.mbar-btn {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 5px; cursor: pointer;
  font: 700 13px/1 var(--title); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--bronze-3); background: rgba(8, 10, 11, .28); border: 1px solid rgba(192, 138, 67, .5);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: color .2s, background-color .2s, border-color .2s;
}
.mbar-btn svg { width: 18px; height: 18px; flex: none; }
.mbar-btn.acc { justify-self: end; }
.mbar-btn:hover, .mbar-btn[aria-expanded="true"] { color: var(--bronze-4); background: rgba(192, 138, 67, .14); border-color: var(--bronze-2); }
.mbar-btn:active { background: rgba(192, 138, 67, .22); }
.mbar-logo { display: block; padding: 3px 0; }
.mbar-logo img { width: auto; height: 38px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .7)); }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  font: 800 14px/1 var(--title); color: #1c1006;
  background: radial-gradient(circle at 35% 30%, var(--bronze-4), var(--bronze-2) 60%, #a87436);
  border: 1px solid #2a1a08; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 5px rgba(0, 0, 0, .5);
}
.mbar-btn.in { padding-left: 7px; }
@media (max-width: 374px) {
  .mbar-btn { padding: 0 9px; letter-spacing: .05em; }
  .mbar-btn.in { padding-left: 6px; }
}

/* drawers: native modal <dialog> (focus stays inside, Esc closes) */
.msheet {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden;
  color: var(--text); font: 400 16px/1.55 var(--body);
}
.msheet::backdrop { background: transparent; }
.msheet-scrim {
  position: absolute; inset: 0; background: rgba(5, 6, 8, .66);
  opacity: 0; transition: opacity .3s ease-out;
}
.msheet-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(90vw, 380px);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left);
  background:
    radial-gradient(ellipse 90% 40% at 20% 0, rgba(192, 138, 67, .12), transparent 70%),
    linear-gradient(180deg, var(--stone-2), var(--stone-0));
  border-right: 1px solid #0b0d0e;
  box-shadow: inset -1px 0 0 rgba(192, 138, 67, .35), 18px 0 40px rgba(0, 0, 0, .55);
  transform: translateX(-104%); transition: transform .38s cubic-bezier(.16, 1, .3, 1);
}
.msheet.acc .msheet-panel {
  left: auto; right: 0; padding-left: 0; padding-right: env(safe-area-inset-right);
  border-right: 0; border-left: 1px solid #0b0d0e;
  box-shadow: inset 1px 0 0 rgba(192, 138, 67, .35), -18px 0 40px rgba(0, 0, 0, .55);
  transform: translateX(104%);
}
.msheet.is-open .msheet-scrim { opacity: 1; }
.msheet.is-open .msheet-panel { transform: none; }
.msheet-panel:focus { outline: none; }

.msheet-head {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 8px 8px 10px 16px;
  background: linear-gradient(180deg, var(--stone-3), var(--stone-1));
}
.msheet-head::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -7px; height: 14px;
  background: var(--knot) repeat-x center / 48px 14px;
}
.msheet-head h2 {
  flex: 1; min-width: 0; margin: 0;
  font: 700 17px/1.1 var(--title); letter-spacing: .1em; text-transform: uppercase;
  color: var(--bronze-3); text-shadow: 0 2px 0 rgba(0, 0, 0, .6);
}
.msheet-head .medal {
  width: 38px; height: 38px; flex: none; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--bronze-2); box-shadow: 0 0 0 2px #0b0d0e, 0 4px 10px rgba(0, 0, 0, .6);
}
.msheet-head .medal img { width: 100%; height: 100%; object-fit: cover; }
.msheet-head .avatar { width: 38px; height: 38px; font-size: 18px; }
.msheet-close {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; cursor: pointer;
  color: var(--text-dim); background: transparent; border: 1px solid transparent; border-radius: 5px;
  transition: color .2s, background-color .2s, border-color .2s;
}
.msheet-close svg { width: 20px; height: 20px; }
.msheet-close:hover { color: var(--bronze-4); background: rgba(192, 138, 67, .12); border-color: rgba(192, 138, 67, .35); }

.msheet-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
  scrollbar-color: var(--bronze-1) transparent;
}
.msheet.nav .msheet-body { padding-bottom: 18px; }
.msheet-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(192, 138, 67, .28); background: rgba(8, 10, 11, .4);
}
.msheet-foot .langs { gap: 0; padding: 0 2px; }
.msheet-foot .langs a { display: grid; place-items: center; min-width: 34px; min-height: 40px; padding: 0 2px; }
.msheet-foot .time-toggle { height: 40px; width: 116px; font-size: 12.5px; }
.msheet-foot .time-toggle .knob { height: 32px; }

/* server status row + quick sections */
.mstat {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px;
  border-radius: 5px; text-decoration: none; color: var(--text);
  background: rgba(8, 10, 11, .45); border: 1px solid rgba(192, 138, 67, .3);
}
.mstat .dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #e05b3c; box-shadow: 0 0 0 3px rgba(224, 91, 60, .25); }
.mstat.on .dot { background: #6fcf74; box-shadow: 0 0 0 3px rgba(111, 207, 116, .25); }
.mstat span { font-weight: 800; }
.mstat small { margin-left: auto; font-size: 14px; color: var(--text-dim); }
.mstat:hover { color: var(--text); border-color: var(--bronze-2); }
.go { width: 14px; height: 14px; flex: none; color: var(--bronze-2); }
.msheet .download { padding: 10px 12px; box-shadow: inset 0 1px 0 rgba(255, 230, 180, .5), inset 0 0 0 1px rgba(255, 200, 120, .25), 0 8px 18px rgba(0, 0, 0, .45); }

.mquick { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mquick a {
  display: flex; align-items: center; min-height: 46px; padding: 0 12px; border-radius: 5px;
  font: 700 13px/1.15 var(--title); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  color: var(--text); background: rgba(8, 10, 11, .3); border: 1px solid rgba(192, 138, 67, .26);
  transition: color .2s, background-color .2s, border-color .2s;
}
.mquick a:hover { color: var(--bronze-4); background: rgba(192, 138, 67, .12); border-color: rgba(192, 138, 67, .5); }
.mquick a[aria-current="page"] {
  color: #1c1006; border-color: #2a1a08;
  background: linear-gradient(180deg, var(--bronze-4), var(--bronze-2) 55%, #a87436);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 6px rgba(0, 0, 0, .5);
}

/* the menu categories, roomier for fingers */
.mmenu { margin: 0 -16px; border-top: 1px solid var(--rule); }
.mmenu details { border-bottom: 1px solid var(--rule); }
.mmenu details + details { border-top: 0; }
.mmenu summary { min-height: 50px; padding: 0 16px; }
.mmenu ul { padding: 0 16px 10px 48px; }
.mmenu li a { padding: 11px 0; }
.mmenu li a:hover { transform: none; }
.mmenu li a[style] { color: var(--text-dim) !important; }
.mmenu li a[aria-current="page"] { color: var(--bronze-3) !important; font-weight: 700; }

/* account panel */
.mhello { margin: 0; font: 700 18px/1.3 var(--title); color: var(--bronze-4); overflow-wrap: anywhere; }
.mrows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.mrows li { border-bottom: 1px solid var(--rule); }
.mrows a {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 4px;
  color: var(--text); text-decoration: none; font-weight: 700;
  transition: color .2s, background-color .2s;
}
.mrows a > svg:first-child { width: 20px; height: 20px; flex: none; color: var(--ic); }
.mrows a span { flex: 1; min-width: 0; }
.mrows a b { font-weight: 800; color: var(--accent); }
.mrows a:hover { color: var(--link-hover); background: rgba(192, 138, 67, .08); }
.mlogin .field input { min-height: 46px; }
.mlogin .aux a { display: inline-flex; align-items: center; min-height: 44px; }
.mlogin .aux { margin-top: 4px; }

/* account dashboard (account/manage): one column on phones, the quick actions keep three per row */
@media (max-width: 640px) {
  .account-dashboard .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .msheet-scrim, .msheet-panel { transition: none; }
}
