/* Project Lage website. One stylesheet for every page. */

@font-face {
  font-family: "Cinzel";
  src: url("/assets/fonts/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0d0a13;
  --bg-logo: #140f1f;
  --surface: #17121f;
  --surface-2: #1f1829;
  --line: #2f2540;
  --line-soft: #241c31;
  --text: #efe6d6;
  --muted: #aa9d8a;
  --faint: #776c5e;
  --flame: #ff8a2a;
  --flame-2: #ffb347;
  --ember: #d4482c;
  --gold: #e6bd6a;
  --good: #7fcf8a;
  --bad: #ff7a6b;
  --magic: #8c9cff;
  --rare: #f2e05c;
  --unique: #c8a26b;
  --set: #4fd364;
  --rune: #ff9f3a;
  --radius: 10px;
  --radius-sm: 6px;
  --wrap: 1160px;
  --heading: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--flame-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffd08a; }
:focus-visible { outline: 2px solid var(--flame-2); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--heading); font-weight: 700; line-height: 1.2; letter-spacing: .02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
code, kbd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; }
kbd {
  background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--flame); color: #1a0d00;
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 10, 19, .86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--heading); font-weight: 700; letter-spacing: .06em; }
.brand img { width: 34px; height: 34px; border-radius: 6px; }
.brand span small { display: block; font-family: var(--body); font-weight: 500; font-size: .68rem; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-top: -2px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nav [hidden] { display: none; }
.nav a:hover, .nav a[aria-current] { color: var(--text); background: var(--surface-2); }
.nav .btn { margin-left: 8px; }
.menu-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; cursor: pointer;
}
@media (max-width: 1120px) {
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1rem; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem/1 var(--body); letter-spacing: .01em;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  color: #1d0d00 !important; background: linear-gradient(180deg, var(--flame-2), var(--flame));
  box-shadow: 0 6px 24px rgba(255, 138, 42, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 138, 42, .4), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-ghost { color: var(--text) !important; border-color: var(--line); background: rgba(255, 255, 255, .02); }
.btn-ghost:hover { border-color: var(--flame); background: rgba(255, 138, 42, .06); }
.btn-small { padding: 9px 16px; font-size: .88rem; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; text-align: center; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 55% at 50% 38%, rgba(255, 110, 30, .18), transparent 70%),
    radial-gradient(80% 60% at 50% 100%, rgba(212, 72, 44, .16), transparent 70%),
    linear-gradient(180deg, var(--bg-logo), var(--bg));
}
.embers { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--flame-2); box-shadow: 0 0 8px 2px rgba(255, 150, 50, .7);
  animation: rise linear infinite; opacity: 0;
}
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: .9; }
  100% { transform: translate(var(--drift, 20px), -520px); opacity: 0; }
}
.hero .logo {
  margin: 0 auto; width: min(760px, 100%);
  -webkit-mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 72%, transparent 100%);
}
.status-badge {
  display: inline-flex; align-items: center; gap: 10px; margin: 6px 0 18px;
  padding: 7px 16px; border-radius: 999px; font-size: .85rem; font-weight: 600; letter-spacing: .04em;
  color: var(--flame-2); background: rgba(255, 138, 42, .08); border: 1px solid rgba(255, 138, 42, .35);
}
.status-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flame); box-shadow: 0 0 0 0 rgba(255, 138, 42, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 138, 42, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 138, 42, 0); } }
.hero h1 { font-size: clamp(1.5rem, 1rem + 2.4vw, 2.6rem); margin: 0 auto 14px; max-width: 22ch; }
.hero .lead { color: var(--muted); font-size: clamp(1rem, .95rem + .4vw, 1.2rem); max-width: 62ch; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 34px auto 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; }
.hero .facts li::before { content: "◆"; color: var(--ember); margin-right: 8px; font-size: .7em; vertical-align: 2px; }

/* Sections */
section { padding: 84px 0; }
section + section { border-top: 1px solid var(--line-soft); }
.section-alt { background: linear-gradient(180deg, rgba(255, 255, 255, .012), rgba(255, 255, 255, 0)); }
.eyebrow { font: 600 .78rem/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--flame); margin-bottom: 14px; display: block; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.06rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  position: relative; transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: #463758; }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p, .card li { color: var(--muted); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.icon {
  flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 138, 42, .1); border: 1px solid rgba(255, 138, 42, .3); color: var(--flame-2);
}
.icon svg { width: 20px; height: 20px; }
.tag {
  display: inline-block; font: 600 .7rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 5px; vertical-align: middle; white-space: nowrap;
}
.tag-alpha { color: var(--good); background: rgba(127, 207, 138, .1); border: 1px solid rgba(127, 207, 138, .3); }
.tag-next { color: var(--magic); background: rgba(140, 156, 255, .1); border: 1px solid rgba(140, 156, 255, .3); }
.card .tag { position: absolute; top: 18px; right: 18px; }
.card.has-tag h3 { padding-right: 86px; }

/* About */
.about { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 28px; } }
.quote {
  border-left: 3px solid var(--flame); padding: 6px 0 6px 22px; margin: 0;
  font-family: var(--heading); font-size: 1.25rem; line-height: 1.5; color: var(--text);
}
.quote footer { font-family: var(--body); font-size: .9rem; color: var(--muted); margin-top: 12px; }
.pillars { display: grid; gap: 12px; }
.pillar { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.pillar strong { display: block; color: var(--text); }
.pillar span { color: var(--muted); font-size: .94rem; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font: 600 .76rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.c-unique { color: var(--unique); }
.c-rune { color: var(--rune); }
.c-magic { color: var(--magic); }
.c-rare { color: var(--rare); }
.c-set { color: var(--set); }
.c-map { color: var(--gold); }

/* Map tiers */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 760px) { .tiers { grid-template-columns: 1fr; } }
.tier { text-align: center; padding: 28px 20px; }
.tier .level { font: 700 2.8rem/1 var(--heading); color: var(--flame-2); text-shadow: 0 0 24px rgba(255, 138, 42, .35); margin: 6px 0; }
.tier .label { color: var(--muted); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.flow li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; color: var(--text); font-size: .93rem; }
.flow li.arrow { background: none; border: 0; padding: 0; color: var(--flame); }

.rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
@media (max-width: 900px) { .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .rules { grid-template-columns: 1fr; } }
.rule { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.rule .big { font: 700 2rem/1 var(--heading); color: var(--gold); }
.rule p { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 16px; list-style: none; padding: 0; margin: 0; }
.steps > li {
  counter-increment: step; position: relative; padding: 20px 22px 20px 74px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.steps > li::before {
  content: counter(step); position: absolute; left: 20px; top: 18px; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%; font: 700 1rem/1 var(--heading);
  color: #1d0d00; background: linear-gradient(180deg, var(--flame-2), var(--flame));
}
.steps h3 { margin-bottom: 4px; font-size: 1.08rem; }
.steps p { color: var(--muted); margin: 0; }

.callout {
  display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius); padding: 16px 18px; margin-top: 22px;
  background: rgba(255, 138, 42, .06); border: 1px solid rgba(255, 138, 42, .3); color: var(--text);
}
.callout p { margin: 0; color: var(--muted); }
.callout strong { color: var(--text); }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 54px 18px 20px; font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font: 400 1.5rem/1 var(--body); color: var(--flame);
}
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 20px 18px; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

/* Sign-up */
.signup { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .signup { grid-template-columns: 1fr; gap: 28px; } }
.signup-card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label, .label { font-weight: 600; font-size: .9rem; }
.optional { color: var(--faint); font-weight: 500; }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #120e19; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(255, 138, 42, .18); }
input[aria-invalid="true"] { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .92rem; color: var(--muted); }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--flame); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { color: var(--faint); font-size: .85rem; margin: 14px 0 0; }
.form-status { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); display: none; }
.form-status.ok { display: block; color: var(--good); background: rgba(127, 207, 138, .08); border: 1px solid rgba(127, 207, 138, .3); }
.form-status.error { display: block; color: var(--bad); background: rgba(255, 122, 107, .08); border: 1px solid rgba(255, 122, 107, .3); }
.perks { list-style: none; padding: 0; display: grid; gap: 12px; margin: 22px 0 0; }
.perks li { display: flex; gap: 12px; color: var(--muted); }
.perks li::before { content: "✓"; color: var(--good); font-weight: 700; }

/* Leaderboard */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 18px; }
.toolbar .field { min-width: 160px; }
.toolbar .grow { flex: 1 1 220px; }
.segmented { display: inline-flex; min-height: 46px; align-items: center; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.segmented button {
  white-space: nowrap; flex: none;
  font: 600 .88rem/1 var(--body); color: var(--muted); background: none; border: 0; border-radius: 999px;
  padding: 9px 14px; cursor: pointer;
}
.segmented button[aria-pressed="true"] { color: #1d0d00; background: var(--flame-2); }
.board td { vertical-align: middle; }
.board td.rank { font: 700 1rem/1 var(--heading); color: var(--faint); width: 56px; }
.board tr.top1 td.rank { color: #ffd36b; }
.board tr.top2 td.rank { color: #d9dde4; }
.board tr.top3 td.rank { color: #d9925b; }
.board tr.dead td { color: var(--faint); }
.board tr.dead .char { text-decoration: line-through; }
.char { font-weight: 600; color: var(--text); }
.badge { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.pill { display: inline-block; font: 700 .66rem/1 var(--body); letter-spacing: .08em; padding: 4px 6px; border-radius: 4px; margin-left: 8px; vertical-align: 2px; }
.pill-hc { color: #ffb3a8; background: rgba(212, 72, 44, .2); border: 1px solid rgba(212, 72, 44, .45); }
.pill-dead { color: var(--faint); border: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px !important; }
.meta-line { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 18px; }
.page-hero { padding: 56px 0 28px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, var(--bg-logo), var(--bg)); }
.page-hero h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); }
.page-hero p { color: var(--muted); max-width: 70ch; }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose p, .prose li { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line-soft); padding: 48px 0 40px; color: var(--faint); font-size: .9rem; background: #0a0810; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font: 600 .78rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.legal { border-top: 1px solid var(--line-soft); margin-top: 32px; padding-top: 22px; font-size: .82rem; line-height: 1.6; }

.to-top {
  position: fixed; right: 16px; bottom: calc(16px + var(--chat-bar, 0px)); z-index: 40; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  text-decoration: none; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Galleries and lightbox */
.muted { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
@media (max-width: 980px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }
.gallery:empty { display: none; }
.gallery-empty { display: none; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }
.gallery:empty + .gallery-empty { display: block; }
.shot { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s ease, transform .2s ease; }
.shot:hover { border-color: rgba(255, 138, 42, .5); transform: translateY(-2px); }
.shot a { display: block; background: #0b0a0d; cursor: zoom-in; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.gallery-maps .shot img { aspect-ratio: 16 / 9; object-fit: contain; padding: 6px; }
.shot figcaption { padding: 14px 16px 16px; display: grid; gap: 4px; font-size: .9rem; }
.shot figcaption strong { color: var(--text); font-family: var(--heading); font-size: 1rem; letter-spacing: .02em; }
.shot figcaption em { font-style: normal; font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.shot figcaption span { color: var(--muted); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; color: var(--text); }
.lightbox::backdrop { background: rgba(5, 4, 8, .97); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; max-width: min(1400px, 92vw); display: grid; gap: 12px; }
.lightbox img { max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: var(--radius-sm); }
.lightbox figcaption { text-align: center; display: grid; gap: 4px; }
.lightbox figcaption strong { font-family: var(--heading); font-size: 1.15rem; }
.lightbox figcaption span { color: var(--muted); max-width: 70ch; margin: 0 auto; }
.lightbox-close, .lightbox-nav {
  position: fixed; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(23, 18, 31, .85); color: var(--text); font: 400 1.6rem/1 var(--body); cursor: pointer;
}
.lightbox-close { top: 16px; right: 16px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-close:hover, .lightbox-nav:hover { border-color: var(--flame); }

/* Impressum */
.legal-page dl { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 8px 20px; margin: 0 0 1em; }
.legal-page dt { color: var(--text); font-weight: 600; }
.legal-page dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.legal-page { overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 560px) { .legal-page dl { grid-template-columns: 1fr; gap: 2px; } .legal-page dd { margin-bottom: 10px; } }
.legal-divider { text-align: center; color: var(--ember); margin: 40px 0; }

/* Support */
.support { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .support { grid-template-columns: 1fr; gap: 28px; } }
.donate-card { text-align: center; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid rgba(255, 138, 42, .35); border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow); }
.donate-card .price { font: 700 3.4rem/1 var(--heading); color: var(--flame-2); text-shadow: 0 0 28px rgba(255, 138, 42, .35); }
.donate-card .per { color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; margin: 8px 0 22px; }
.donate-card .btn { width: 100%; }
.donate-card .form-note { margin-top: 16px; }
.costs { list-style: none; padding: 0; display: grid; gap: 12px; margin: 22px 0 0; }
.costs li { display: flex; gap: 14px; align-items: flex-start; color: var(--muted); }
.costs li strong { color: var(--text); }

/* Donation pool */
.pool { text-align: left; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.pool-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .85rem; color: var(--muted); letter-spacing: .04em; }
.pool-head strong { color: var(--flame-2); font: 700 1.6rem/1 var(--heading); }
.pool-bar { height: 12px; border-radius: 999px; background: #120e19; border: 1px solid var(--line); overflow: hidden; margin: 10px 0; }
.pool-bar span { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--ember), var(--flame), var(--flame-2)); box-shadow: 0 0 12px rgba(255, 138, 42, .5); }
.pool-line { margin: 0 0 8px; font-size: .9rem; color: var(--muted); }
.pool-line strong { color: var(--text); }
.pool-costs { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 4px; font-size: .85rem; color: var(--faint); }
.pool-costs li { display: flex; justify-content: space-between; gap: 12px; }
.pool-total { font-size: .82rem; color: var(--faint); }
.support-hint { margin: 22px auto 0; font-size: .88rem; color: var(--faint); }
.support-hint a { color: var(--muted); }
.support-hint a:hover { color: var(--flame-2); }
.footer-pool { margin-top: 12px; font-size: .82rem; color: var(--faint); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-pool a { color: var(--muted); }
.footer-pool a:hover { color: var(--flame-2); }
.footer-pool-bar { display: inline-block; width: 90px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.footer-pool-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--flame), var(--flame-2)); }

/* Admin page (/admin) */
.admin [hidden] { display: none !important; }
.admin-flag > .btn { justify-self: start; }
input[type="password"], input[type="number"], input[type="datetime-local"], input:not([type]) { width: 100%; padding: 11px 13px; color: var(--text); background: #120e19; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
.admin-login { max-width: 460px; margin: 0 auto; display: grid; gap: 14px; }
.admin-login h3, .admin-login p { margin: 0; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.admin-bar .segmented button[aria-selected="true"] { color: #1d0d00; background: var(--flame-2); }
.admin-who { margin-left: auto; color: var(--muted); font-size: .9rem; }
.admin-legend { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.cert { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cert-proof { color: #2a0703; background: var(--bad); }
.cert-suspect { color: #2a1a00; background: var(--gold); }
.admin-flag { margin-bottom: 16px; display: grid; gap: 10px; }
.admin-flag p { margin: 0; }
.admin-flag.is-closed { opacity: .7; }
.admin-flag-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-flag-head h3 { margin: 0; }
.admin-status { margin-left: auto; color: var(--muted); font-size: .85rem; }
.admin-meta { color: var(--faint) !important; font-size: .88rem; overflow-wrap: anywhere; }
.admin-evidence pre { margin: 8px 0 0; padding: 12px; overflow-x: auto; font-size: .82rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.admin-evidence summary { cursor: pointer; color: var(--flame-2); }
.admin-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.admin-actions .btn { white-space: nowrap; }
.admin-signup-actions .btn { white-space: nowrap; margin: 2px 6px 2px 0; }
.admin-danger { color: #fff !important; background: var(--ember); border-color: var(--ember); }
.admin-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.admin-ban-form { display: grid; gap: 14px; margin-bottom: 20px; }
.admin-ban-form h3 { margin: 0; }
.admin-row { display: grid; grid-template-columns: 1fr 160px 2fr; gap: 12px; }
.admin-hash { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.admin-table .btn { white-space: nowrap; }
.admin [type="datetime-local"] { color-scheme: dark; }
.admin-season-row { grid-template-columns: 1fr 1fr 1fr; }
.admin-suggest td { background: rgba(255, 170, 60, .06); }
.admin-plugin-form { display: grid; grid-template-columns: 1fr 2fr 1fr auto; gap: 8px; }
.admin-flag > .admin-plugin-form + .btn { justify-self: start; }
.admin-check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; }
.admin-check input { width: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .admin-actions { grid-template-columns: minmax(0, 1fr); }
  .admin-actions .btn { white-space: normal; }
  .admin-row, .admin-plugin-form { grid-template-columns: 1fr 1fr; }
  .admin-row .field:last-child { grid-column: 1 / -1; }
  .admin-who { margin-left: 0; }
  .admin-bar .segmented { flex-wrap: wrap; border-radius: var(--radius-sm); }
  .admin-season-row { grid-template-columns: 1fr; }
  #l-list .admin-table th:nth-child(2), #l-list .admin-table td:nth-child(2), #l-list .admin-table th:nth-child(3), #l-list .admin-table td:nth-child(3) { display: none; }
}

/* Wiki (/wiki, pages written by tools/make_wiki.py) */
.wk-hero { padding-bottom: 32px; }
.wk-crumbs { font-size: .88rem; color: var(--faint); margin-bottom: 14px; }
.wk-crumbs a { color: var(--muted); text-decoration: none; }
.wk-crumbs a:hover { color: var(--flame-2); }
.wk-crumbs span { margin: 0 6px; }
.wk-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding-top: 32px; padding-bottom: 72px; }
@media (max-width: 900px) { .wk-layout { grid-template-columns: 1fr; gap: 20px; } }
.wk-side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }

.wk-side h4 { font: 600 .74rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 22px 0 10px; }
.wk-nav, .wk-toc, .wk-subnav { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.wk-subnav { padding-left: 12px; border-left: 1px solid var(--line-soft); margin: 2px 0 4px 10px; }
.wk-nav a, .wk-toc a { display: block; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: .92rem; }
.wk-nav a:hover, .wk-toc a:hover { color: var(--text); background: var(--surface-2); }
.wk-nav a[aria-current] { color: var(--flame-2); background: rgba(255, 138, 42, .08); font-weight: 600; }
.wk-toc a { font-size: .86rem; padding: 4px 10px; }
.wk-search { position: relative; }
.wk-search svg { position: absolute; left: 12px; top: 15px; color: var(--faint); pointer-events: none; }
.wk-search input { width: 100%; font: inherit; color: var(--text); background: #120e19; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px 10px 36px; }
.wk-search input:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(255, 138, 42, .18); }
.wk-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow-y: auto; }
@media (max-width: 900px) { .wk-results { width: 100%; } }
.wk-results a { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; }
.wk-results a:hover, .wk-results a:focus { background: rgba(255, 138, 42, .1); outline: none; }
.wk-results strong { color: var(--text); font-size: .92rem; }
.wk-results span { color: var(--faint); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-results .none { color: var(--muted); padding: 8px 10px; font-size: .9rem; }
.wk-main { min-width: 0; }
.wk-section { padding: 0 0 44px; border: 0; }
.wk-section + .wk-section { border-top: 0; }
.wk-section h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.wk-section h2 a { color: var(--text); text-decoration: none; }
.wk-section h2 a:hover::after { content: " #"; color: var(--faint); }
.wk-section > p, .wk-section li { color: var(--muted); }
.wk-section h3 { margin-top: 0; }
.wk-section .table-wrap { margin: 0 0 16px; }
.wk-section .callout { margin: 0 0 16px; }
.wk-section .rules { margin: 0 0 16px; }
.wk-table td { vertical-align: middle; }
.wk-table td:first-child:has(> .wk-icon) { width: 56px; padding-right: 0; }
.wk-icon { image-rendering: auto; border-radius: 6px; background: #0b0910; border: 1px solid var(--line-soft); flex: none; }
.wk-badge { display: inline-block; font: 600 .68rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 5px; white-space: nowrap; vertical-align: middle; }
.wk-live { color: var(--good); background: rgba(127, 207, 138, .1); border: 1px solid rgba(127, 207, 138, .3); }
.wk-test { color: var(--magic); background: rgba(140, 156, 255, .1); border: 1px solid rgba(140, 156, 255, .3); }
.wk-next { color: var(--gold); background: rgba(230, 189, 106, .1); border: 1px solid rgba(230, 189, 106, .3); }
.wk-section > .wk-badge { margin-bottom: 16px; }
.wk-sub { color: var(--faint); font-size: .85rem; margin: 2px 0 0; font-weight: 500; }
.wk-card { display: block; text-decoration: none; color: inherit; }
.wk-card:hover { border-color: rgba(255, 138, 42, .5); transform: translateY(-2px); }
.wk-card h3 { color: var(--text); }
.wk-glyph { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; font: 700 1.3rem/1 var(--heading); color: var(--flame-2); background: rgba(255, 138, 42, .08); border: 1px solid rgba(255, 138, 42, .3); }
.wk-boss-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.wk-boss-head > div { flex: 1; min-width: 0; }
.wk-boss-head h3 { margin: 0; }
.wk-boss p strong, .wk-orb p strong { color: var(--text); }
.tier .wk-icon { margin: 0 auto 10px; }
.tier p { margin: 10px 0 0; font-size: .9rem; }
/* Item tooltips, drawn like the game's */
.wk-tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wk-tip { background: rgba(8, 7, 10, .96); border: 1px solid #3a3242; border-radius: 4px; padding: 18px 16px; text-align: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), var(--shadow); scroll-margin-top: 84px; }
.wk-tip:target { border-color: var(--flame); }
.wk-tip h3 { font-family: var(--heading); font-size: 1.1rem; margin: 0; display: block; }
.wk-tip-base { color: var(--unique); margin: 2px 0 8px; font-size: .92rem; }
.wk-tip-req { display: grid; gap: 1px; color: #d8d2c6; font-size: .85rem; margin-bottom: 8px; }
.wk-tip-props { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; color: #8c9cff; font-size: .92rem; }
.wk-tip-note { color: var(--faint); font-size: .8rem; margin: 10px 0 0; }
.wk-tip-runes { margin-bottom: 8px; }
.wk-tip-pic { display: block; margin: 0 auto 10px; padding: 6px; }
.wk-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.wk-chip { display: inline-block; font-size: .85rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.wk-chip.c-rune { color: var(--rune); border-color: rgba(255, 159, 58, .4); }
.wk-chip.wk-new { color: var(--good); border-color: rgba(127, 207, 138, .4); }
.wk-chip.wk-gone { color: var(--faint); text-decoration: line-through; }
.wk-pools h3 { font-size: 1rem; margin: 8px 0 10px; }
.wk-pools { gap: 4px 18px; }
/* Skills */
.wk-skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; scroll-margin-top: 84px; }
.wk-skill:target { border-color: var(--flame); }
.wk-skill h3 { font-size: 1.08rem; margin-bottom: 6px; }
.wk-skill p { color: var(--muted); margin-bottom: 8px; }
.wk-skill p:last-child { margin-bottom: 0; }
.wk-syn { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; color: var(--muted); font-size: .92rem; }
.wk-syn strong { color: var(--text); margin-right: 6px; }
.wk-syn .wk-chip { margin: 2px 4px 2px 0; }
.wk-dmg { font-size: .92rem; }
.wk-dmg strong { color: var(--text); }
.wk-dmg .good { color: var(--good); }
.wk-dmg .bad { color: var(--bad); }
.wk-raw summary { cursor: pointer; color: var(--flame-2); font-size: .88rem; }
.wk-raw .table-wrap { margin-top: 10px; }
.wk-raw td { font-size: .82rem; overflow-wrap: anywhere; }
/* Patch notes */
.wk-section h4 { font: 600 .8rem/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--flame); margin: 18px 0 8px; }
.wk-section h5 { font: 700 1rem/1.2 var(--heading); color: var(--text); margin: 14px 0 6px; }
.wk-section > h3 { font-size: 1.15rem; margin: 30px 0 4px; padding-top: 18px; border-top: 1px solid var(--line-soft); scroll-margin-top: 84px; }
.wk-main .grid > * { min-width: 0; }
.wk-boss-head { flex-wrap: wrap; }
.c-bad { color: var(--bad); }
/* Item database (/wiki/items, drawn by wiki-items.js) */
.wk-items-filter { display: grid; gap: 10px; margin-bottom: 16px; }
.wk-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-pill { font: 500 .85rem/1 var(--body); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.wk-pill:hover { color: var(--text); border-color: rgba(255, 138, 42, .5); }
.wk-pill[aria-pressed="true"] { color: #1a0f05; background: var(--flame-2); border-color: var(--flame-2); }
.wk-pill-big { font: 600 .95rem/1 var(--heading); padding: 10px 18px; border-radius: 8px; }
.wk-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.wk-tab { font: 600 .9rem/1 var(--body); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; margin-bottom: -1px; cursor: pointer; }
.wk-tab:hover { color: var(--text); }
.wk-tab[aria-pressed="true"] { color: var(--flame-2); border-bottom-color: var(--flame); }
.wk-items-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.wk-items-tools input[type="search"], .wk-items-tools select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }
.wk-items-tools input[type="search"] { flex: 1 1 240px; width: auto; min-width: 0; }
.wk-items-tools select { flex: 0 0 auto; width: auto; }
.wk-items-tools select[hidden] { display: none; }
.wk-only { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; cursor: pointer; }
.wk-only input { accent-color: var(--flame); width: 16px; height: 16px; margin: 0; }
.wk-items-wait { margin: 0 0 14px; }
.wk-items-count { color: var(--faint); font-size: .85rem; margin: 10px 0 14px; }
.wk-items-sub { margin: 28px 0 12px; }
.wk-items-none, .wk-items-wait { color: var(--muted); }
.wk-lage { color: var(--flame-2); background: rgba(255, 138, 42, .1); border: 1px solid rgba(255, 138, 42, .35); text-decoration: none; }
.wk-tip-set { margin-top: 8px; font-size: .9rem; }
.wk-tip-set p { margin: 2px 0; }
.wk-tip-setname { margin-top: 8px !important; font-family: var(--heading); }
.wk-bases td:last-child { min-width: 160px; font-size: .85rem; }
.wk-bases td { white-space: nowrap; }
.wk-bases td:last-child { white-space: normal; }
.wk-about { margin-top: 18px; max-width: 46ch; }
.wk-about p { color: var(--muted); font-size: .95rem; margin: 0; }
.wk-about .footer-pool { margin-top: 12px; }
@media (max-width: 900px) {
  .wk-side { position: static; max-height: none; overflow: visible; padding: 0; }
  .wk-side nav + nav, .wk-subnav, .wk-side h4 { display: none; }
  .wk-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
  .wk-nav li:empty, .wk-nav li:has(> .wk-subnav) { display: none; }
  .wk-nav a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; }
}
/* Market (/market, assets/market.js) */
.mk-signin { max-width: 640px; margin: 0 auto 28px; }
.mk-signin-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.mk-signin-row .field { flex: 1 1 180px; }
.mk-who { margin: 0 0 0 auto; color: var(--muted); font-size: .9rem; align-self: center; }
.mk-link { background: none; border: 0; padding: 0; color: var(--flame); cursor: pointer; font: inherit; text-decoration: underline; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 28px; }
.mk-grid > .empty { grid-column: 1 / -1; }
.mk-listing { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mk-listing .mk-tip { border: 0; border-radius: 0; box-shadow: none; flex: 1; }
.mk-closed { opacity: .65; }
.mk-deal { padding: 12px 14px 14px; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; font-size: .9rem; }
.mk-deal p { margin: 0; }
.mk-price strong { color: var(--gold); }
.mk-note { color: var(--muted); overflow-wrap: anywhere; }
.mk-faint { color: var(--faint); font-size: .85rem; }
.mk-tag { display: inline-block; justify-self: start; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.mk-agreed { border-color: var(--good); color: var(--good); }
.mk-status { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; color: var(--faint); font-weight: 600; }
.mk-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.mk-status-online { color: var(--good); }
.mk-status-away, .mk-status-busy { color: var(--gold); }
.mk-offer .mk-status { font-size: .8rem; }
.mk-contact { margin-top: 2px; }
.mk-instant-note { margin: 0; }
.mk-offer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.mk-offer > span:first-child { flex: 1 1 100%; }
.mk-answered { color: var(--faint); }
.mk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-form { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-form input { flex: 1 1 140px; min-width: 0; }
.mk-h { font-size: 1.15rem; margin: 8px 0 14px; }
.mk-hint { color: var(--muted); font-size: .9rem; }
.mk-crafted { color: #ffa94d; }
.mk-misc { color: var(--rune); }
/* Market: My items as the game's inventory, stash and paperdoll */
.mk-hint-inline { margin: 0; align-self: end; flex: 1 1 260px; }
.mk-inv { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; margin-bottom: 28px; }
.mk-panels { display: grid; gap: 18px; min-width: 0; justify-items: start; }
.mk-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: start; }
.mk-panel { background: #0b090e; min-width: 0; border: 1px solid #3a3242; border-radius: 4px; padding: 10px 12px 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); max-width: 100%; }
.mk-panel-h { font: 600 .8rem/1 var(--heading); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; text-align: center; }
.mk-side { position: sticky; top: 84px; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
/* Taller than the window (an item with many properties, the rune list open): it scrolls on its
   own, above the docked website chat, so the price and List it button stay reachable. */
.mk-side { max-height: calc(100vh - 148px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4a4054 transparent; }
.mk-side > .mk-hint { margin: 0; padding: 18px 16px; }
.mk-side .mk-tip { border: 0; border-radius: 0; box-shadow: none; }
.mk-tabs { margin-bottom: -6px; }
.mk-board { --cell: min(44px, calc((100vw - 74px) / var(--cols))); display: grid; width: calc(var(--cell) * var(--cols) + 1px); grid-template-columns: repeat(var(--cols), var(--cell)); grid-template-rows: repeat(var(--rows), var(--cell)); }
.mk-cells { background-color: #141019; background-image: linear-gradient(#2b2433 1px, transparent 1px), linear-gradient(90deg, #2b2433 1px, transparent 1px); background-size: var(--cell) var(--cell); border-right: 1px solid #2b2433; border-bottom: 1px solid #2b2433; }
.mk-doll { gap: 0; }
.mk-slot { margin: 2px; border: 1px dashed #2f2838; border-radius: 3px; background: #120e17; color: #4e4558; font-size: .62rem; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px; line-height: 1.1; }
.mk-item { position: relative; margin: 1px; padding: 3px; border: 1px solid #3c3347; border-radius: 2px; background: rgba(40, 34, 52, .9); color: #d8d2c6; font: 600 .62rem/1.1 var(--body); cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; min-width: 0; }
.mk-doll .mk-item { margin: 2px; }
.mk-item:hover, .mk-item:focus-visible { border-color: var(--flame); outline: none; background: rgba(60, 48, 72, .95); }
.mk-item-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; hyphens: auto; }
.mk-item-qty { position: absolute; right: 3px; bottom: 2px; font-size: .58rem; color: var(--text); }
.mk-item-sockets { position: absolute; left: 3px; bottom: 3px; display: flex; gap: 2px; }
.mk-item-sockets i { width: 5px; height: 5px; border-radius: 50%; border: 1px solid #8a8094; }
.mk-item-sockets i.full { background: #8a8094; }
.mk-item.q-unique { color: var(--unique); background: rgba(70, 52, 30, .55); border-color: #6b5634; }
.mk-item.q-set { color: var(--set); background: rgba(25, 70, 32, .5); border-color: #2f6a3a; }
.mk-item.q-rare { color: var(--rare); background: rgba(70, 64, 20, .45); border-color: #6b6230; }
.mk-item.q-crafted { color: #ffa94d; background: rgba(80, 45, 15, .5); border-color: #7a4a20; }
.mk-item.q-magic { color: var(--magic); background: rgba(30, 36, 90, .5); border-color: #3c4790; }
.mk-item.q-runeword { color: var(--unique); background: rgba(60, 50, 40, .55); border-color: #6b5c48; }
.mk-item.q-misc { color: var(--rune); }
.mk-item.q-superior, .mk-item.q-normal, .mk-item.q-low { color: #e8e2d6; }
.mk-eth { opacity: .7; }
.mk-listed::after { content: ""; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px #0b090e; }
.mk-picked { box-shadow: 0 0 0 2px var(--flame); border-color: var(--flame); }
.mk-float { position: fixed; z-index: 60; width: max-content; max-width: min(340px, calc(100vw - 16px)); pointer-events: none; }
/* Market: shared stash tabs, one at a time with arrows like the game's */
#mk-holder-field[hidden] { display: none; }
.mk-tabbar { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 10px; }
.mk-arrow { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid #6b5634; background: radial-gradient(circle at 50% 40%, #2a2219, #120e0a); color: var(--gold); font: 700 1.6rem/1 var(--heading); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 4px; }
.mk-arrow:hover:not(:disabled), .mk-arrow:focus-visible { border-color: var(--flame); color: var(--flame); outline: none; }
.mk-arrow:disabled { opacity: .35; cursor: default; }
.mk-tabname { font: 600 .95rem/1.2 var(--heading); color: var(--text); text-align: center; min-width: 0; }
/* Market: the game's own panel art and item pictures, when the server has them */
.mk-real { position: relative; max-width: calc(100vw - 60px); background: #0b090e; }
.mk-real-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.mk-real-bg[hidden], .mk-pic[hidden], .mk-card-pic[hidden] { display: none; }
.mk-real .mk-item.mk-abs { position: absolute; margin: 0; padding: 0; }
.mk-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.mk-pic:not([hidden]) ~ .mk-item-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mk-item.mk-has-pic { background: rgba(20, 16, 26, .35); border-color: transparent; }
.mk-real .mk-item.mk-has-pic { background: transparent; }
.mk-item.mk-has-pic:hover, .mk-item.mk-has-pic:focus-visible { background: rgba(120, 110, 160, .22); border-color: var(--flame); }
.mk-item.mk-has-pic.mk-picked { border-color: var(--flame); }
.mk-card-pic { display: block; margin: 14px auto 0; max-width: 100%; max-height: 196px; }
@media (max-width: 900px) {
  .mk-inv { grid-template-columns: 1fr; }
  .mk-side { position: static; max-height: none !important; overflow: visible; }
}
/* Market: search suggestions and stat filters */
.mk-search { position: relative; }
.mk-suggest { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 360px; overflow-y: auto; }
.mk-suggest-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 4px; cursor: pointer; font-size: .92rem; }
.mk-suggest-item:hover, .mk-suggest-item.active { background: var(--surface-2); }
.mk-sg-name { font-weight: 600; }
.mk-filters { display: grid; gap: 10px; margin: -8px 0 20px; }
.mk-pair { display: flex; gap: 6px; }
.mk-pair input { width: 77px; min-width: 0; }
.mk-sg-range { white-space: nowrap; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-chips:empty, .mk-stats:empty { display: none; }
.mk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .92rem; }
.mk-chip-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 6px; border-radius: 999px; }
.mk-chip-x:hover { color: var(--text); background: var(--surface-2); }
.mk-stats { display: grid; gap: 6px; max-width: 620px; }
.mk-stat { display: grid; grid-template-columns: minmax(0, 1fr) 74px 74px auto; gap: 8px; align-items: center; padding: 6px 8px 6px 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.mk-stat-label { color: var(--magic); font-size: .92rem; overflow-wrap: anywhere; }
.mk-stat input { min-width: 0; padding: 6px 8px; }
.mk-stat.mk-stat-any { grid-template-columns: minmax(0, 1fr) auto; }
.mk-addstat { max-width: 420px; }
.mk-form.mk-form-list { display: grid; gap: 8px; }
#mk-focus[hidden] { display: none; }
.mk-focus-head { display: flex; align-items: baseline; gap: 14px; }
#mk-focus .mk-listing { border-color: var(--flame); }
.mk-form-list > .btn-primary { justify-self: start; }
.mk-field-label { font-weight: 600; font-size: .85rem; color: var(--text); margin-top: 4px; }
.mk-price-runes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mk-price-words { flex: 1 1 100%; color: var(--gold); overflow-wrap: anywhere; }
.mk-rune-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border: 1px solid #6b5634; border-radius: 999px; background: rgba(70, 52, 30, .35); color: var(--gold); font-weight: 600; }
.btn[data-needs][disabled] { cursor: not-allowed; }
.mk-rune-tag.mk-rune-missing { border-color: var(--bad); background: rgba(255, 122, 107, .12); color: var(--bad); }
.mk-rune-pic { width: 22px; height: 22px; object-fit: contain; flex: none; }
.mk-rune-pic[hidden] { display: none; }
.mk-rune-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-rune-chosen > p { margin: 0; }
.mk-rune-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 6px; border: 1px solid #6b5634; border-radius: 999px; background: rgba(70, 52, 30, .35); }
.mk-rune-chip .mk-rune-name { color: var(--gold); font-weight: 600; margin: 0 4px 0 2px; }
.mk-rune-count { min-width: 1.4em; text-align: center; font-weight: 600; }
.mk-rune-overview { display: grid; gap: 6px; padding: 10px; background: #0b090e; border: 1px solid #3a3242; border-radius: 4px; }
.mk-rune-overview[hidden] { display: none; }
.mk-rune-overview > p { margin: 0; }
.mk-rune-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.mk-rune { position: relative; display: grid; justify-items: center; gap: 1px; padding: 4px 2px 3px; border: 1px solid #3c3347; border-radius: 3px; background: rgba(40, 34, 52, .9); color: var(--rune); font: 600 .66rem/1.1 var(--body); cursor: pointer; min-width: 0; }
.mk-rune .mk-rune-pic { width: 28px; height: 28px; }
.mk-rune:hover, .mk-rune:focus-visible { border-color: var(--flame); outline: none; background: rgba(60, 48, 72, .95); }
.mk-rune-on { border-color: #6b5634; background: rgba(70, 52, 30, .55); }
.mk-rune-rank { color: var(--faint); font-size: .56rem; font-weight: 400; }
.mk-rune-badge { position: absolute; top: 1px; right: 2px; color: var(--gold); font-size: .6rem; }
@media (max-width: 560px) { .mk-item { font-size: .52rem; padding: 2px; } .mk-slot { font-size: .55rem; } }
/* The account's rune stash on top of the Market page: 3 rows of 11. */
.mk-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: end; }
.mk-runestash { display: grid; gap: 6px; padding: 10px 12px; background: rgba(11, 9, 14, .85); border: 1px solid #3a3242; border-radius: 4px; }
.mk-runestash[hidden] { display: none; }
.mk-runestash-h { margin: 0; font-size: .95rem; color: var(--gold); }
.mk-runestash-grid { display: grid; grid-template-columns: repeat(11, 40px); gap: 3px; }
.mk-rs { display: grid; justify-items: center; align-content: start; gap: 1px; padding: 3px 1px 2px; border: 1px solid #3c3347; border-radius: 3px; background: rgba(40, 34, 52, .9); min-width: 0; }
.mk-rs .mk-rune-pic { width: 26px; height: 26px; }
.mk-rs-name { color: var(--rune); font: 600 .58rem/1.1 var(--body); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-rs-count { color: var(--gold); font: 700 .72rem/1.1 var(--body); }
.mk-rs-none { opacity: .38; }
.mk-runestash-note { margin: 0; color: var(--muted); font-size: .8rem; }
.mk-runestash-note:empty { display: none; }
@media (max-width: 980px) { .mk-hero { grid-template-columns: 1fr; } .mk-runestash { justify-self: start; } }
@media (max-width: 560px) {
  .mk-runestash { justify-self: stretch; padding: 8px; }
  .mk-runestash-grid { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 2px; }
  .mk-rs .mk-rune-pic { width: 100%; height: auto; max-width: 24px; }
  .mk-rs-name { display: none; }
  .mk-rs-count { font-size: .62rem; }
}
.mk-empty-stash { margin: 0 0 12px; padding: 12px 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); }
