/* ==========================================================================
   Ascalon Awaken — design system
   One stylesheet for the whole site: static wiki pages (generated by
   tools/asca_build_site.py) and the Flask account/highscore pages share it.
   No external requests: the display font is self-hosted (OFL license).
   ========================================================================== */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/cinzel-latin-var.woff2") format("woff2");
}

:root {
  --bg0: #070510;
  --bg1: #0d0918;
  --panel: #131022;
  --panel2: #1a142c;
  --panel3: #221a38;
  --gold: #d4af37;
  --gold-hi: #f0c75e;
  --gold-dim: #9c7f2c;
  --ember: #ff7a3d;
  --purple: #8a6fc8;
  --purple-hi: #ab8fe8;
  --text: #e6e0d0;
  --muted: #968da6;
  --border: #2e2544;
  --border-hi: #4a3a6e;
  --ok: #7fd88a;
  --ok-bg: #12281a;
  --err: #e8a0b4;
  --err-bg: #2c1220;
  --r-common: #b8b2c0;
  --r-uncommon: #7fd88a;
  --r-rare: #6fa8e8;
  --r-epic: #ab8fe8;
  --r-legendary: #f0c75e;
  --font-display: "Cinzel", "Palatino Linotype", Georgia, serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-lore: Georgia, "Times New Roman", serif;
  --nav-h: 62px;
  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 10px 40px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 2px var(--bg0), 0 0 0 4px var(--gold);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  background: var(--bg0);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle fixed backdrop: night gradient + vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(138, 111, 200, 0.14), transparent 60%),
    radial-gradient(900px 420px at 12% 8%, rgba(212, 175, 55, 0.07), transparent 55%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 42%);
}

::selection { background: rgba(212, 175, 55, 0.32); color: #fff; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
main a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }

:focus { outline: none; }
:focus-visible { box-shadow: var(--ring); border-radius: 3px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 300;
  background: var(--panel3);
  color: var(--gold-hi);
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--gold-dim);
}
.skip-link:focus { left: 12px; }

h1, h2, h3, .brand, .btn, th, .stat b, .navlinks a {
  font-family: var(--font-display);
}

h1 {
  color: var(--gold);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin: 4px 0 18px;
}
h2 {
  color: var(--purple-hi);
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 34px 0 12px;
}
h3 {
  color: var(--gold-dim);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 22px 0 8px;
}
p { margin: 10px 0; }
ul, ol { margin: 10px 0 10px 26px; }
li { margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
code, kbd {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.88em;
  color: var(--gold-hi);
}
kbd { color: var(--purple-hi); font-family: var(--font-body); font-size: 12px; }
pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  margin: 14px 0;
}
pre code { background: none; border: 0; padding: 0; }
blockquote, .lore {
  font-family: var(--font-lore);
  font-style: italic;
  color: var(--muted);
  border-left: 3px solid var(--gold-dim);
  padding: 6px 0 6px 18px;
  margin: 16px 0;
  font-size: 17px;
}

/* --------------------------------------------------------------- header/nav */

.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 clamp(14px, 3vw, 34px);
  background: rgba(10, 7, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(46, 37, 68, 0.7);
  transition: background 0.25s, box-shadow 0.25s;
}
.site-head.scrolled { background: rgba(8, 6, 14, 0.94); box-shadow: var(--shadow-1); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold);
  white-space: nowrap;
}
.brand:hover { color: var(--gold-hi); text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }

.navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-wrap: nowrap;
}
.navlinks a {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 6px;
  position: relative;
}
.navlinks a:hover { color: var(--gold-hi); background: rgba(212, 175, 55, 0.07); text-decoration: none; }
.navlinks a.on { color: var(--gold); }
.navlinks a.on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.navlinks .nav-cta {
  margin-left: 8px;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.16), rgba(212, 175, 55, 0.05));
  color: var(--gold-hi);
}
.navlinks .nav-cta:hover { border-color: var(--gold); }

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding: 7px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font: 13px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
}
.search-btn:hover { border-color: var(--border-hi); color: var(--text); }
.search-btn kbd { padding: 0 5px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 42px;
  height: 38px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--gold);
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle span { top: 18px; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(-90deg) translateX(-6px); }
.nav-toggle[aria-expanded="true"] span::after { opacity: 0; }

/* ------------------------------------------------------------------ layout */

main {
  max-width: 1140px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 34px) clamp(16px, 3vw, 24px) 90px;
}
main.wide { max-width: 1280px; }
main.landing { max-width: none; padding: 0 0 0; }

.crumb { color: var(--muted); font-size: 13px; margin-bottom: 16px; letter-spacing: 0.02em; }
.crumb a { color: var(--purple-hi); }

.section {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(44px, 7vw, 84px) clamp(16px, 3vw, 24px);
}
.section-head { text-align: center; margin-bottom: clamp(24px, 4vw, 44px); }
.section-head .kicker {
  color: var(--ember);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}
.section-head h2 { margin: 0 0 10px; font-size: clamp(24px, 3.4vw, 32px); color: var(--gold); }
.section-head p { color: var(--muted); max-width: 640px; margin: 0 auto; }

.site-foot {
  border-top: 1px solid var(--border);
  background: rgba(9, 6, 16, 0.6);
  padding: 40px clamp(16px, 3vw, 24px) 46px;
  margin-top: 20px;
}
.foot-grid {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}
.foot-grid h4 {
  font-family: var(--font-display);
  color: var(--gold-dim);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.foot-grid ul { list-style: none; margin: 0; }
.foot-grid li { margin: 7px 0; }
.foot-grid a { color: var(--muted); font-size: 14px; }
.foot-grid a:hover { color: var(--gold-hi); }
.foot-brand p { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 340px; }
.foot-note {
  max-width: 1140px;
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(46, 37, 68, 0.5);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.hero {
  position: relative;
  min-height: clamp(560px, 92vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  perspective: 900px;
}
.hero-layer { position: absolute; inset: -4%; will-change: transform; }
.hero-img {
  background: url("../banner.jpg") center 30% / cover no-repeat;
  filter: saturate(1.05) brightness(0.62);
}
.hero-fog {
  background:
    radial-gradient(60% 46% at 50% 62%, rgba(7, 5, 16, 0) 0%, rgba(7, 5, 16, 0.55) 78%, rgba(7, 5, 16, 0.96) 100%),
    linear-gradient(180deg, rgba(7, 5, 16, 0.55) 0%, rgba(7, 5, 16, 0.12) 34%, rgba(7, 5, 16, 0.94) 92%, var(--bg0) 100%);
}
#embers { position: absolute; inset: 0; pointer-events: none; }
.hero-inner { position: relative; z-index: 3; padding: 90px 18px 60px; max-width: 860px; }
.hero-eyebrow {
  display: inline-block;
  color: var(--gold-hi);
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(12, 8, 20, 0.55);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 26px;
  backdrop-filter: blur(4px);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(42px, 8.5vw, 96px);
  line-height: 1.02;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
  background: linear-gradient(180deg, #fff8e2 4%, var(--gold-hi) 38%, var(--gold) 62%, #8a6b1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 26px rgba(212, 175, 55, 0.28));
}
.hero-sub {
  font-family: var(--font-display);
  color: var(--purple-hi);
  font-size: clamp(15px, 2.2vw, 21px);
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero-tag {
  font-family: var(--font-lore);
  font-style: italic;
  color: var(--text);
  font-size: clamp(16px, 2vw, 19px);
  max-width: 560px;
  margin: 0 auto 34px;
  opacity: 0.92;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 30px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, #3a2b5e, #241a3d);
  color: var(--gold-hi);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover {
  border-color: var(--gold);
  color: #ffe9a8;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(212, 175, 55, 0.22);
  text-decoration: none;
}
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #a8871f);
  color: #241a06;
  border-color: #f5d97a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { color: #140e02; box-shadow: 0 10px 32px rgba(212, 175, 55, 0.4); }
.btn-ghost { background: rgba(12, 8, 20, 0.4); backdrop-filter: blur(4px); }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }

/* ------------------------------------------------------------- cards/stats */

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.stat {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}
.stat b { color: var(--gold); display: block; font-size: 26px; font-weight: 800; letter-spacing: 0.02em; }
.stat span { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.14em; }

.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; margin: 22px 0; }
.card {
  background: linear-gradient(165deg, var(--panel2) 0%, var(--panel) 60%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 26px 24px;
  position: relative;
  transform-style: preserve-3d;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.card:hover { border-color: var(--border-hi); box-shadow: var(--shadow-2); }
.card h3 { margin: 0 0 4px; color: var(--gold); font-size: 20px; }
.card .sub { color: var(--purple-hi); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.card p { color: var(--muted); font-size: 14.5px; }
.card .glyph { font-size: 30px; margin-bottom: 12px; display: block; filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.35)); }
.card ul { margin: 10px 0 0 18px; font-size: 14px; color: var(--muted); }
.tilt .glare {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(240, 199, 94, 0.1), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s;
}
.tilt:hover .glare { opacity: 1; }

.linkrow { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

/* ------------------------------------------------------------------ tables */

.tablewrap { overflow-x: auto; margin: 14px 0; border-radius: 10px; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tablewrap table { margin: 0; }
table:not(.tablewrap table) { margin: 14px 0; }
th {
  background: var(--panel3);
  color: var(--gold);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-hi);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--gold-hi); }
th.sortable::after { content: " ↕"; color: var(--muted); font-size: 11px; }
th.sorted-asc::after { content: " ↑"; color: var(--ember); }
th.sorted-desc::after { content: " ↓"; color: var(--ember); }
td { padding: 8px 12px; border-bottom: 1px solid rgba(46, 37, 68, 0.55); background: var(--panel); }
tbody tr:nth-child(odd) td { background: rgba(26, 20, 44, 0.5); }
tbody tr:hover td { background: var(--panel3); }
tbody tr:last-child td { border-bottom: 0; }

input.filter, .search-input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 16px;
  width: 100%;
  max-width: 420px;
  margin: 10px 0;
  border-radius: 8px;
  font: 15px var(--font-body);
}
input.filter:focus, .search-input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15); }
input.filter::placeholder { color: var(--muted); }

/* ------------------------------------------------------------- tags/badges */

.tag {
  display: inline-block;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--purple-hi);
  margin: 2px 3px 2px 0;
  letter-spacing: 0.03em;
}
.tag.boss { color: var(--ember); border-color: rgba(255, 122, 61, 0.4); background: rgba(255, 122, 61, 0.08); }
.tag.gold { color: var(--gold-hi); border-color: rgba(212, 175, 55, 0.4); }
.tag.ok { color: var(--ok); border-color: rgba(127, 216, 138, 0.35); }

.chip-common { color: var(--r-common); }
.chip-uncommon { color: var(--r-uncommon); }
.chip-rare { color: var(--r-rare); }
.chip-epic { color: var(--r-epic); }
.chip-legendary { color: var(--r-legendary); text-shadow: 0 0 12px rgba(240, 199, 94, 0.35); }

.bar {
  height: 8px;
  background: var(--panel3);
  border-radius: 99px;
  overflow: hidden;
  min-width: 90px;
  border: 1px solid rgba(46, 37, 68, 0.8);
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-dim), var(--ember));
}

/* ------------------------------------------------------------------- forms */

form.box {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 30px;
  max-width: 480px;
  margin: 18px 0;
}
form.box label {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 15px 0 5px;
}
form.box input[type="text"], form.box input[type="password"], form.box input[type="email"], form.box select {
  background: var(--bg1);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  width: 100%;
  border-radius: 7px;
  font: 15px var(--font-body);
}
form.box input:focus, form.box select:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.13); }
form.box button { margin-top: 22px; width: 100%; }

.msg-err, .msg-ok {
  padding: 12px 18px;
  border-radius: 8px;
  margin: 14px 0;
  max-width: 640px;
  font-size: 14.5px;
}
.msg-err { background: var(--err-bg); border: 1px solid #7a2b45; color: var(--err); }
.msg-ok { background: var(--ok-bg); border: 1px solid #2b7a45; color: var(--ok); }

.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0 14px; }
.tabs a {
  display: inline-block;
  padding: 7px 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple-hi);
  font-weight: 600;
}
.tabs a:hover { border-color: var(--border-hi); text-decoration: none; }
.tabs a.on { border-color: var(--gold); color: var(--gold); background: rgba(212, 175, 55, 0.07); }

/* ----------------------------------------------------------- search overlay */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(5, 3, 10, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  padding: min(14vh, 130px) 16px 16px;
}
.search-overlay.open { display: block; }
.search-panel {
  max-width: 640px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.search-panel .search-input { margin: 0; max-width: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 17px 20px; font-size: 17px; background: var(--panel); }
.search-panel .search-input:focus { box-shadow: none; }
.search-results { max-height: min(52vh, 480px); overflow-y: auto; }
.search-results .group {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px 20px 4px;
}
.search-results a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  color: var(--text);
  font-size: 14.5px;
}
.search-results a .meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.search-results a:hover, .search-results a.sel { background: var(--panel3); text-decoration: none; color: var(--gold-hi); }
.search-empty { color: var(--muted); padding: 22px 20px; font-size: 14px; }
.search-hint { border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 10px 20px; display: flex; gap: 16px; }

/* ---------------------------------------------------------------- reveal fx */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

/* ------------------------------------------------------------------- extras */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 4vw, 48px); align-items: center; }
.split .art { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-2); }
.split .art img { display: block; width: 100%; height: auto; }

.connect-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
}
.connect-box code { font-size: 16px; padding: 6px 14px; }
.copy-btn { border: 1px solid var(--border); background: var(--panel2); color: var(--muted); border-radius: 7px; padding: 7px 14px; font: 13px var(--font-body); cursor: pointer; }
.copy-btn:hover { color: var(--gold-hi); border-color: var(--gold-dim); }
.copy-btn.done { color: var(--ok); border-color: rgba(127, 216, 138, 0.5); }

.event-now { border-left: 3px solid var(--ember); }
.event-next { border-left: 3px solid var(--gold); }
.countdown { color: var(--ember); font-weight: 700; font-variant-numeric: tabular-nums; }

.chart { width: 100%; height: auto; display: block; margin: 16px 0; }
.chart text { font: 12px var(--font-body); fill: var(--muted); }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .line { stroke: var(--gold); stroke-width: 2.5; fill: none; }
.chart .area { fill: url(#chartgrad); opacity: 0.5; }
.chart .dot { fill: var(--ember); }

.toc { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; margin: 18px 0; font-size: 14px; }
.toc b { color: var(--gold-dim); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.toc ul { list-style: none; margin: 8px 0 0; columns: 2; gap: 26px; }
.toc a { color: var(--purple-hi); }

.notice {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  padding: 14px 20px;
  margin: 16px 0;
  font-size: 14.5px;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .navlinks {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(8, 6, 14, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 8px 14px 16px;
    display: none;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .navlinks.open { display: flex; }
  .navlinks a { padding: 13px 12px; font-size: 14px; border-radius: 8px; }
  .navlinks .nav-cta { margin: 8px 0 0; text-align: center; }
  .nav-toggle { display: block; }
  .search-btn { margin-left: auto; }
  .search-btn .label, .search-btn kbd { display: none; }
  .split { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .toc ul { columns: 1; }
}

@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-scroll { animation: none; }
}

/* ------------------------------------------------------------ bestiary grid */

.mon-grid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
}
.mon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 10px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  color: var(--text);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.mon-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  box-shadow: var(--shadow-1);
  text-decoration: none;
}
.mon-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  background: radial-gradient(circle at 50% 42%, rgba(212, 175, 55, 0.10), transparent 68%);
}
.mon-thumb {
  max-width: 84px;
  max-height: 84px;
  width: auto;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
}
.mon-noimg {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, var(--panel3), var(--panel3) 6px, var(--panel) 6px, var(--panel) 12px);
}
.mon-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.mon-tier { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.tier-trivial { color: var(--r-common); }
.tier-minor { color: var(--r-uncommon); }
.tier-seasoned { color: var(--r-rare); }
.tier-dangerous { color: var(--purple-hi); }
.tier-fearsome { color: var(--ember); }
.tier-legendary { color: var(--gold-hi); }
.tier-boss { color: var(--ember); }

/* ---------------------------------------------------------- monster detail */

.mon-head {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.mon-portrait {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 168px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 42%, rgba(212, 175, 55, 0.12), var(--panel) 70%);
}
.mon-hero {
  max-width: 136px;
  max-height: 136px;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.55));
}
.mon-headtext { flex: 1 1 240px; min-width: 220px; }
.tier-badge {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 700;
}

.lootwrap { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.loot {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--panel);
}

/* ------------------------------------------------------------- spell icons */

.spell-ico {
  display: inline-block;
  width: 32px;
  height: 32px;
  vertical-align: middle;
  background-image: url(spell-icons.png);
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.spell-ico.no-ico {
  background-image: none;
  border: 1px dashed var(--border-hi);
  border-radius: 6px;
  opacity: .45;
}

/* --------------------------------------------------------- vocation cards */

.voc-card { text-align: center; }
.voc-portrait {
  width: 116px;
  height: 116px;
  object-fit: contain;
  margin: 0 auto 6px;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.5));
  background: radial-gradient(circle at 50% 40%, rgba(212, 175, 55, 0.10), transparent 70%);
}
.sw {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
  margin: 12px 0;
}
.sw h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 4px; }
.sw > div:first-child h4 { color: var(--ok); }
.sw > div:last-child h4 { color: var(--err); }
.sw ul { margin: 0; padding-left: 16px; font-size: 13px; color: var(--muted); }
.sw li { margin: 3px 0; }

@media (max-width: 560px) {
  .sw { grid-template-columns: 1fr; }
  .mon-head { gap: 16px; }
}

@media print {
  .site-head, .site-foot, .hero-scroll, .search-btn, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
  main { padding-top: 0; }
}

/* ========================================================================
   Portal skin — three-column classic fantasy layout
   ======================================================================== */

:root {
  --portal-red: #8d2d28;
  --portal-red-hi: #b9493e;
  --portal-bronze: #9b7650;
  --portal-line: #4a382b;
  --portal-ink: #080604;
  --portal-paper: #17100d;
}

body {
  background:
    radial-gradient(900px 520px at 50% 140px, rgba(21, 47, 75, .42), transparent 68%),
    linear-gradient(90deg, #020303 0%, #070b11 20%, #080b10 80%, #020303 100%);
  color: #d8d0c4;
  font-size: 14px;
}

body::before {
  background:
    linear-gradient(180deg, rgba(5, 15, 28, .72), rgba(0, 0, 0, .95) 62%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 1px, transparent 1px 5px);
}

.site-wrap { width: min(1110px, calc(100% - 28px)); margin: 14px auto 0; }

.site-head {
  position: relative;
  inset: auto;
  z-index: 200;
  height: 76px;
  padding: 7px 34px;
  display: flex;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(42,29,22,.96), rgba(9,7,6,.98)),
    var(--portal-ink);
  border: 2px solid #6d5138;
  border-radius: 48% 48% 18px 18px / 36% 36% 14px 14px;
  box-shadow:
    inset 0 0 0 3px #17110d,
    inset 0 0 0 4px #3b2a20,
    0 5px 18px #000;
}

.site-head::before,
.site-head::after {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  width: 22px;
  border: solid var(--portal-bronze);
  opacity: .75;
}
.site-head::before { left: 18px; border-width: 1px 0 1px 1px; transform: skewX(-22deg); }
.site-head::after { right: 18px; border-width: 1px 1px 1px 0; transform: skewX(22deg); }

.navlinks { margin: 0; width: 100%; justify-content: center; gap: 0; }
.navlinks a {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  color: #c7b49c;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .045em;
  padding: 16px 10px;
  border-left: 1px solid #4b382a;
  border-radius: 0;
  text-shadow: 0 2px 2px #000;
}
.navlinks a:last-child { border-right: 1px solid #4b382a; }
.navlinks a:hover,
.navlinks a.on { color: #f1d0a5; background: linear-gradient(180deg, rgba(133,45,38,.2), rgba(133,45,38,.04)); }
.navlinks a.on::after { left: 15%; right: 15%; bottom: 8px; background: linear-gradient(90deg, transparent, #b94439, transparent); }

.portal-grid {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr) 184px;
  gap: 12px;
  align-items: start;
  margin-top: 22px;
}

.portal-center {
  min-width: 0;
  background: linear-gradient(90deg, rgba(13,9,8,.88), rgba(31,21,17,.96) 50%, rgba(13,9,8,.88));
  border: 1px solid #3c2b22;
  box-shadow: 0 12px 32px rgba(0,0,0,.7), inset 0 0 60px rgba(0,0,0,.25);
}

.portal-brand {
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(2,5,9,.72), rgba(2,5,9,.06) 30%, rgba(2,5,9,.06) 70%, rgba(2,5,9,.72)),
    linear-gradient(180deg, rgba(2,5,9,.08), rgba(2,5,9,.72)),
    url("../banner.jpg") center / cover no-repeat;
  border-bottom: 1px solid #4a3528;
  text-decoration: none;
  overflow: hidden;
}
.portal-brand:hover { text-decoration: none; }
.portal-brand-title,
.portal-brand-sub { display: none; }
.portal-brand-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 67px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #ad3e30;
  -webkit-text-stroke: 1px #efd19f;
  text-shadow: 0 3px 0 #3a0d09, 0 8px 18px #000;
}
.portal-brand-sub {
  margin-top: 7px;
  color: #d8b88d;
  font: 700 13px var(--font-display);
  letter-spacing: .58em;
  text-transform: uppercase;
  text-shadow: 0 2px 4px #000;
}

.realm-strip {
  margin: 12px 10px 0;
  padding: 7px 12px;
  text-align: center;
  color: #92867c;
  background: linear-gradient(180deg, #211712, #0d0907);
  border: 1px solid #4b3528;
  border-radius: 3px;
  box-shadow: inset 0 0 12px #000;
}
.realm-strip b { color: #cab9a6; }
.realm-strip .realm-online { color: #50a152; margin-left: 8px; font-weight: 700; }

main,
main.wide,
main.landing {
  max-width: none;
  margin: 0;
  padding: 12px 10px 34px;
}
main:not(.landing) {
  margin: 12px 8px 18px;
  padding: 18px 20px 34px;
  background: rgba(20,13,10,.82);
  border: 1px solid #493126;
  border-radius: 7px;
}

.crumb {
  margin: 0 0 16px;
  padding: 10px 12px;
  color: #9e8d7b;
  background: rgba(8,6,5,.72);
  border: 1px solid #3c2b23;
  border-left: 3px solid var(--portal-red);
  border-radius: 4px;
}
.crumb a { color: #c99772; }

.portal-side { min-width: 0; }
.side-block { margin: 0 0 17px; }
.side-block h2 {
  position: relative;
  margin: 0 0 8px;
  padding: 8px 10px 8px 40px;
  color: #f0ccb0;
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .055em;
  background: linear-gradient(90deg, #8e2c26, #3d1513 72%, transparent);
  border: 1px solid #5e3c2a;
  border-radius: 50% 12px 12px 50%;
  text-shadow: 0 2px 2px #000;
}
.side-block h2::before {
  content: "◆";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  transform: translateY(-50%) rotate(45deg);
  color: #c7a775;
  background: #17100c;
  border: 1px solid #9b7650;
  font-size: 8px;
}
.side-block h2::before { line-height: 1; }
.side-block ul { list-style: none; margin: 0; }
.side-block li { margin: 0; border-bottom: 1px solid #3b3029; }
.side-block li a,
.side-link {
  display: block;
  padding: 7px 7px 7px 18px;
  color: #bba68f;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.side-block li a::before,
.side-link::before { content: "›"; color: #a43c34; margin-right: 6px; font-weight: 900; }
.side-block li a:hover,
.side-link:hover { color: #ebc99f; text-decoration: none; background: rgba(145,45,38,.08); }

.account-block { padding-top: 3px; }
.side-btn {
  display: block;
  width: 100%;
  padding: 9px 8px;
  margin: 7px 0;
  color: #f6e8d8;
  text-align: center;
  text-transform: uppercase;
  font: 700 11px var(--font-display);
  letter-spacing: .06em;
  background: linear-gradient(180deg, #a3483d, #70231f);
  border: 1px solid #be6659;
  border-radius: 4px;
  box-shadow: inset 0 1px rgba(255,255,255,.14), 0 2px 5px #000;
}
.side-btn:hover { color: #fff; text-decoration: none; filter: brightness(1.12); }
.side-btn-hot { background: linear-gradient(180deg, #8e3ff0, #5b13aa); border-color: #a55cf0; }
.premium-link { color: #9a6bc8; padding-left: 10px; }

.world-card,
.status-card,
.ranking-card,
.discord-card {
  display: block;
  margin-bottom: 13px;
  padding: 12px 10px;
  color: #cdbda9;
  background: linear-gradient(180deg, #241713, #0f0a08);
  border: 1px solid #5a402f;
  border-radius: 6px;
  box-shadow: inset 0 0 18px rgba(0,0,0,.55), 0 3px 9px #000;
  text-align: center;
}
.world-card span,
.status-card span,
.ranking-card span {
  display: block;
  color: #cfb89e;
  font: 700 10px var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.world-card b { display: block; margin: 8px 0 2px; color: #f1d3ad; font: 800 18px var(--font-display); }
.world-card small,
.status-card small { color: #84786e; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.status-card strong { display: block; color: #65b665; font: 800 30px var(--font-display); line-height: 1.25; }
.realm-info dl { margin: 0; }
.realm-info dl div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 3px; border-bottom: 1px solid #342a24; }
.realm-info dt { color: #897d72; }
.realm-info dd { color: #d3b48d; font-weight: 700; }
.ranking-card { text-align: left; padding: 13px; }
.ranking-card b { display: block; margin-top: 5px; color: #d5af70; font: 700 13px var(--font-display); }
.ranking-card:hover { text-decoration: none; border-color: #8b6545; }
.discord-card { min-height: 165px; background: linear-gradient(180deg, #333a91 0 38px, #24262c 38px); text-align: left; padding: 13px 10px; }
.discord-card strong { display: block; color: white; margin-bottom: 26px; }
.discord-card span { display: block; color: #a9abb3; margin-bottom: 20px; }

.site-foot {
  margin: 14px 0 0;
  padding: 10px 28px 22px;
  background: transparent;
  border: 0;
}
.footer-nav {
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, #2a1d17, #090706);
  border: 2px solid #6d5138;
  border-radius: 45% 45% 14px 14px / 32% 32% 12px 12px;
  box-shadow: inset 0 0 0 3px #17110d, 0 4px 14px #000;
}
.footer-nav a {
  flex: 1 1 0;
  padding: 16px 8px;
  color: #c7b49c;
  text-align: center;
  text-transform: uppercase;
  font: 700 12px var(--font-display);
  border-left: 1px solid #4b382a;
}
.footer-nav a:last-child { border-right: 1px solid #4b382a; }
.footer-nav a:hover { color: #f1d0a5; text-decoration: none; }
.foot-note { max-width: none; margin: 18px 0 0; padding-top: 12px; border-color: #29221d; color: #6f6862; }

/* Registration page mirrors classic three-step AAC flow. */
.register-page { margin: -6px -10px 0; }
.register-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.register-steps span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 9px 10px;
  color: #9d9085;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(49,37,30,.82), rgba(23,16,13,.82));
  border: 1px solid #3e2d24;
  border-radius: 6px;
}
.register-steps span.active { color: #f0dfc9; border-color: #70532f; background: linear-gradient(180deg, rgba(101,77,34,.52), rgba(31,22,14,.9)); }
.register-steps b { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #5d4620; color: #f6e7c9; font-family: var(--font-display); }
.register-intro,
.register-card {
  margin-bottom: 14px;
  padding: 22px 22px;
  background: linear-gradient(135deg, rgba(61,20,18,.92), rgba(22,13,10,.96) 70%);
  border: 1px solid #553127;
  border-radius: 12px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.25);
}
.register-intro h1 { margin: 13px 0 8px; color: #f0e3d1; font-size: clamp(25px, 4vw, 32px); }
.register-intro p { color: #d0c6bc; }
.step-kicker,
.form-kicker {
  display: inline-block;
  color: #f0b6ad;
  font: 700 11px var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.step-kicker { padding: 7px 12px; border-radius: 999px; background: rgba(163,58,51,.23); border: 1px solid #6c302b; }
.register-perks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.register-perks span { padding: 7px 12px; color: #e8dcc9; background: rgba(12,8,6,.55); border: 1px solid #402820; border-radius: 999px; font-weight: 700; }
.register-card { background: linear-gradient(180deg, #1c120e, #100b09); }
.register-card h2 { margin: 4px 0 5px; padding-bottom: 9px; color: #eee0ca; border-bottom: 1px solid #503128; }
.register-card > p { color: #a99e94; }
.register-card form.box { max-width: none; margin: 0; padding: 4px 0 0; background: none; border: 0; }
.register-card form.box label:not(.terms-check) { color: #e6d4bd; font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; }
.register-card form.box input[type="text"],
.register-card form.box input[type="password"],
.register-card form.box input[type="email"],
.register-card form.box select {
  height: 42px;
  color: #ddd5cd;
  background: #0c0908;
  border-color: #3e2c24;
  border-radius: 7px;
}
.register-card .terms-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 19px; color: #d0c5ba; text-transform: none; letter-spacing: 0; font-size: 14px; }
.register-card .terms-check input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--portal-red); }
.register-card form.box button { background: linear-gradient(180deg, #aa473e, #742520); border-color: #c2665a; }

/* Existing landing content, compressed into portal center. */
main.landing .hero { min-height: 500px; border: 1px solid #3c2b22; }
main.landing .hero-inner { padding: 70px 18px 54px; }
main.landing .hero-title { font-size: clamp(42px, 7vw, 72px); }
main.landing .section { padding: 48px 18px; }
main.landing .cardgrid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

@media (max-width: 980px) {
  .site-wrap { width: min(760px, calc(100% - 20px)); margin-top: 8px; }
  .site-head { height: 58px; padding: 6px 14px; justify-content: flex-end; border-radius: 16px; }
  .nav-toggle { display: block; margin-left: auto; }
  .navlinks { position: absolute; top: calc(100% + 3px); max-height: 80vh; background: #0b0807; border: 1px solid #5a402f; }
  .navlinks a { flex: none; border: 0; padding: 13px 15px; text-align: left; }
  .portal-grid { grid-template-columns: 1fr; margin-top: 10px; }
  .portal-left, .portal-right { display: none; }
  .portal-brand { height: 142px; }
  .site-foot { padding-left: 0; padding-right: 0; }
}

@media (max-width: 560px) {
  .site-wrap { width: calc(100% - 10px); }
  .portal-brand { height: 118px; }
  .portal-brand-title { font-size: 38px; }
  .portal-brand-sub { font-size: 10px; }
  main:not(.landing) { margin: 8px 4px 12px; padding: 14px 12px 26px; }
  .register-page { margin: 0; }
  .register-steps { grid-template-columns: 1fr; gap: 6px; }
  .register-steps span { min-height: 44px; }
  .register-steps span:not(.active) { display: none; }
  .register-intro, .register-card { padding: 18px 14px; }
  .footer-nav { flex-wrap: wrap; border-radius: 12px; }
  .footer-nav a { flex-basis: 33%; padding: 12px 6px; }
  .foot-note { display: block; text-align: center; }
  .foot-note span { display: block; margin: 5px 0; }
}

@media print {
  .portal-side, .portal-brand, .realm-strip, .footer-nav { display: none; }
  .portal-grid { display: block; }
}
