/* Legends of Thorn: one stylesheet for the whole site. Night blue, brass and lamplight. */
@font-face { font-family: "Cinzel"; src: url("../fonts/Cinzel.woff2") format("woff2"), url("../fonts/Cinzel.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/AlegreyaSans-Regular.woff2") format("woff2"), url("../fonts/AlegreyaSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/AlegreyaSans-Bold.woff2") format("woff2"), url("../fonts/AlegreyaSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --night: #0b1320;
  --night-2: #101b2c;
  --slate: #16243a;
  --slate-2: #1d2e48;
  --line: #2b3f5e;
  --brass: #d6a54a;
  --brass-hi: #f3cf7a;
  --brass-lo: #8a6326;
  --lamp: #ffb347;
  --ember: #e0662d;
  --text: #e9e1cf;
  --muted: #a9b2c3;
  --faint: #7a869b;
  --ok: #7ccf8a;
  --danger: #ff8a6b;
  --radius: 6px;
  --wrap: 1180px;
  --heading: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--night); color: var(--text);
  font: 400 1.075rem/1.6 var(--body);
  background-image: radial-gradient(ellipse at 50% -10%, rgba(255, 179, 71, 0.08), transparent 55%), url("../img/ui/panel.jpg");
  background-size: auto, 900px; background-attachment: fixed, scroll;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brass-hi); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff3cf; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--heading); font-weight: 700; line-height: 1.2; color: var(--brass-hi); letter-spacing: 0.02em; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin-top: 0; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
kbd { font: 700 0.85em var(--body); background: var(--slate-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.45em; color: var(--text); white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--brass); color: #1a1205; padding: 0.6rem 1rem; z-index: 100; border-radius: var(--radius); font-weight: 700; }
.skip:focus { top: 1rem; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* ---- header ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(9, 15, 26, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(214, 165, 74, 0.35); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 42px; width: auto; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 0.15rem; }
.nav a { font: 600 0.82rem/1 var(--heading); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); text-decoration: none; padding: 0.7rem 0.55rem; border-radius: 4px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brass-hi); background: rgba(214, 165, 74, 0.09); }
.nav .btn { margin-left: 0.5rem; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 0.5rem 0.7rem; font: 700 0.85rem var(--heading); letter-spacing: 0.06em; cursor: pointer; }
@media (max-width: 1080px) {
  .js .menu-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: #0a111d; border-bottom: 1px solid var(--brass-lo); padding: 0.5rem 16px 1rem; gap: 0; max-height: calc(100vh - 64px); overflow-y: auto; }
  .js .nav.open { display: flex; }
  .js .nav a { padding: 0.9rem 0.5rem; font-size: 0.95rem; border-bottom: 1px solid rgba(43, 63, 94, 0.6); }
  .js .nav .btn { margin: 0.8rem 0 0; justify-content: center; }
  .nav { flex-wrap: wrap; }
}

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font: 700 0.9rem/1 var(--heading); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 0.85rem 1.4rem; border-radius: var(--radius); border: 1px solid var(--brass); color: var(--brass-hi); background: rgba(12, 20, 33, 0.6); cursor: pointer; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.btn:hover { background: rgba(214, 165, 74, 0.14); color: #fff3cf; }
.btn-primary { color: #23170a; border-color: #f6d488; background: linear-gradient(180deg, #f6d27e 0%, #d9a447 55%, #b07c2c 100%); box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 6px 22px rgba(255, 170, 60, 0.25), inset 0 1px 0 rgba(255,255,255,0.45); }
.btn-primary:hover { color: #1a1005; background: linear-gradient(180deg, #ffe39e 0%, #e7b356 55%, #bf8a35 100%); box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 8px 30px rgba(255, 170, 60, 0.4), inset 0 1px 0 rgba(255,255,255,0.5); }
.nav .btn { padding: 0.65rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1rem; }

/* ---- hero ---- */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--brass-lo); }
.hero picture, .hero > img { position: absolute; inset: 0; }
.hero picture img, .hero > img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 13, 22, 0.15) 0%, rgba(8, 13, 22, 0.25) 45%, rgba(8, 13, 22, 0.94) 100%), linear-gradient(90deg, rgba(8, 13, 22, 0.7) 0%, transparent 60%); }
.hero .wrap { position: relative; z-index: 1; padding-top: 6rem; padding-bottom: clamp(2.5rem, 7vh, 5rem); }
.hero-logo { width: min(560px, 88vw); filter: drop-shadow(0 6px 24px rgba(0,0,0,0.7)); }
.hero h1.tagline { font-size: clamp(1.35rem, 3vw, 2rem); color: var(--text); margin: 0.6rem 0 0.4rem; font-weight: 600; text-shadow: 0 2px 12px rgba(0,0,0,0.8); }
.hero p { max-width: 36rem; color: #d8d2c4; font-size: 1.15rem; text-shadow: 0 1px 8px rgba(0,0,0,0.9); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; }
.badge { display: inline-block; font: 700 0.72rem/1 var(--heading); letter-spacing: 0.12em; text-transform: uppercase; color: var(--lamp); border: 1px solid rgba(255, 179, 71, 0.5); padding: 0.4rem 0.65rem; border-radius: 99px; background: rgba(10, 16, 26, 0.6); }

/* ---- page head ---- */
.page-head { position: relative; padding: 3.2rem 0 2.2rem; border-bottom: 1px solid rgba(214, 165, 74, 0.25); overflow: hidden; }
.page-head.has-art { padding: 9rem 0 2.6rem; }
.page-head .art { position: absolute; inset: 0; }
.page-head .art img { width: 100%; height: 100%; object-fit: cover; object-position: right center; opacity: 0.9; }
.page-head .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,19,32,0.88) 0%, rgba(11,19,32,0.35) 45%, rgba(11,19,32,0) 70%), linear-gradient(180deg, rgba(11,19,32,0) 55%, var(--night) 100%); }
.page-head .wrap { position: relative; }
.page-head p { color: var(--muted); max-width: 46rem; font-size: 1.15rem; margin: 0; }
.crumbs { font-size: 0.9rem; color: var(--faint); margin-bottom: 0.6rem; }
.crumbs a { color: var(--muted); }

main { display: block; padding-bottom: 4rem; }
section { margin-top: 2.6rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-title h2 { margin: 0 0 0.8rem; }
.lead { font-size: 1.2rem; color: #ddd5c3; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.prose { max-width: 50rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.draft-note { border: 1px dashed var(--ember); color: #ffcfb5; background: rgba(224, 102, 45, 0.08); padding: 0.8rem 1rem; border-radius: var(--radius); margin: 1.6rem 0 0; font-size: 0.95rem; }
.notice { border-left: 3px solid var(--brass); background: rgba(22, 36, 58, 0.8); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; }

/* ---- panels and cards ---- */
.panel { background: linear-gradient(180deg, rgba(29, 46, 72, 0.92), rgba(18, 29, 46, 0.94)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 30px rgba(0,0,0,0.25); }
.panel.brass { border-color: rgba(214, 165, 74, 0.55); }
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit; }
.card .media { aspect-ratio: 16 / 9; overflow: hidden; background: #070c14; border-bottom: 1px solid var(--line); }
.card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
a.card:hover .media img { transform: scale(1.04); }
a.card:hover { border-color: rgba(214, 165, 74, 0.6); }
.card .body { padding: 1.1rem 1.2rem 1.25rem; }
.card h3 { margin: 0 0 0.4rem; }
.card p { color: var(--muted); margin: 0; }
.kicker { font: 700 0.72rem/1 var(--heading); letter-spacing: 0.12em; text-transform: uppercase; color: var(--lamp); margin-bottom: 0.55rem; display: block; }

/* ---- home ---- */
.pitch { padding-top: 3.5rem; display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pitch { grid-template-columns: 1.1fr 0.9fr; } }
.pitch .lead { font-size: 1.3rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.stat { padding: 1rem; text-align: center; }
.stat b { display: block; font: 700 2rem/1.1 var(--heading); color: var(--brass-hi); }
.stat span { color: var(--muted); font-size: 0.95rem; }
.features { display: grid; gap: 2.4rem; }
.feature { display: grid; gap: 1.4rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .feature { grid-template-columns: 1.25fr 1fr; } .feature:nth-child(even) .shot { order: 2; } }
.shot { border: 1px solid rgba(214, 165, 74, 0.45); border-radius: var(--radius); overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,0.45); background: #070c14; }
.shot img { width: 100%; }
.feature h3 { font-size: 1.45rem; margin-top: 0; }
.feature p { color: #d6cfbf; }
.news-list { display: grid; gap: 1rem; }
.news-item { padding: 1.2rem 1.3rem; }
.news-item h3 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.news-item h3 a { color: var(--brass-hi); text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; }
.meta { color: var(--faint); font-size: 0.9rem; display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.4rem; }
.tag { font: 700 0.68rem/1 var(--heading); letter-spacing: 0.1em; text-transform: uppercase; color: var(--lamp); border: 1px solid rgba(255,179,71,0.4); padding: 0.3rem 0.5rem; border-radius: 99px; }
.cta { text-align: center; padding: 3rem 1.5rem; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.cta > * { position: relative; }
.cta::before { content: ""; position: absolute; inset: 0; background: rgba(8, 13, 22, 0.72); }
.cta h2 { margin-top: 0; }
.gallery { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: 0.9rem; color: var(--muted); padding: 0.45rem 0.1rem 0; }

/* ---- articles (news, patch notes) ---- */
.article { padding: 1.6rem 1.6rem 1.2rem; margin-bottom: 1.4rem; }
.article h2 { margin-top: 0; }
.article h3 { color: var(--lamp); font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 1.3em 0 0.5em; }
.article ul { padding-left: 1.2rem; margin: 0 0 0.6rem; }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1.6rem; }
.tabs a { text-decoration: none; padding: 0.55rem 0.9rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 600 0.82rem/1 var(--heading); letter-spacing: 0.05em; }
.tabs a[aria-current="page"], .tabs a:hover { color: #23170a; background: var(--brass); border-color: var(--brass); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16, 27, 44, 0.9); }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid rgba(43, 63, 94, 0.7); vertical-align: middle; }
thead th { font: 700 0.78rem/1.2 var(--heading); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); background: rgba(29, 46, 72, 0.9); position: sticky; top: 0; }
tbody tr:hover { background: rgba(214, 165, 74, 0.05); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.keys th { width: 32%; color: var(--brass-hi); font-weight: 700; }
.words { font-style: italic; color: var(--lamp); white-space: nowrap; }
.icon { width: 32px; height: 32px; image-rendering: pixelated; flex: 0 0 32px; }
.icon-2x { width: 64px; height: 64px; image-rendering: pixelated; }
.with-icon { display: flex; align-items: center; gap: 0.6rem; }
.parts { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.order-pill { display: inline-block; font-size: 0.82rem; padding: 0.1rem 0.5rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.order-Bulwark { color: #9cc2ff; border-color: #36598f; }
.order-Strider { color: #a8e09a; border-color: #3f6d36; }
.order-Kindler { color: #ffb37a; border-color: #8a4a22; }
.order-Thornspeaker { color: #d6b0ff; border-color: #5c3f86; }

/* ---- filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1.2rem; }
.filters input[type="search"], .filters select, .lookup input { background: #0a121f; border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 0.65rem 0.8rem; font: inherit; min-width: 0; }
.filters input[type="search"] { flex: 1 1 220px; }
.chip { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 0.45rem 0.85rem; font: 600 0.85rem var(--body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brass); color: #23170a; border-color: var(--brass); }

/* ---- bestiary ---- */
.beasts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.beast { display: grid; grid-template-columns: 96px 1fr; gap: 0.9rem; align-items: center; padding: 0.9rem; text-decoration: none; color: inherit; }
.beast:hover { border-color: rgba(214, 165, 74, 0.6); }
.beast .sprite { width: 96px; height: 96px; display: grid; place-items: center; background: radial-gradient(circle at 50% 70%, rgba(255,179,71,0.12), transparent 65%); border-radius: var(--radius); }
.sprite img { image-rendering: pixelated; max-width: 96px; max-height: 96px; width: auto; height: auto; }
.beast h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.beast .meta { margin: 0; font-size: 0.85rem; }
.threat { display: inline-flex; gap: 2px; vertical-align: middle; }
.threat i { width: 8px; height: 8px; border-radius: 50%; background: #2a3a55; display: inline-block; }
.threat i.on { background: var(--ember); box-shadow: 0 0 6px rgba(224,102,45,0.7); }
.boss-tag { color: #ffcf6e; font-weight: 700; }
.monster-hero { display: grid; gap: 1.6rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 800px) { .monster-hero { grid-template-columns: 300px 1fr; } }
.monster-portrait { display: grid; place-items: center; padding: 1.4rem; min-height: 260px; background: radial-gradient(circle at 50% 70%, rgba(255,179,71,0.18), transparent 60%), linear-gradient(180deg, rgba(29,46,72,0.92), rgba(18,29,46,0.94)); }
.monster-portrait img { image-rendering: pixelated; width: auto; max-width: 100%; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; margin: 0; }
dl.facts div { background: rgba(10, 18, 31, 0.6); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.85rem; }
dt { font: 700 0.72rem/1.2 var(--heading); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
dd { margin: 0.25rem 0 0; font-size: 1.1rem; color: var(--text); }
.loot { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); list-style: none; padding: 0; margin: 0; }
.loot li { display: flex; align-items: center; gap: 0.6rem; background: rgba(10,18,31,0.6); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.6rem; }
.loot small { display: block; color: var(--faint); }
.r-common { color: var(--muted); } .r-uncommon { color: #9fd38f; } .r-rare { color: #7fb6ff; } .r-very-rare { color: #d4a6ff; } .r-always { color: var(--text); }
.places { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.places li { background: rgba(10,18,31,0.6); border: 1px solid var(--line); border-radius: 99px; padding: 0.3rem 0.8rem; font-size: 0.95rem; }

/* ---- orders ---- */
.order { display: grid; gap: 1.6rem; padding: 1.6rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 1.6rem; }
@media (min-width: 900px) { .order { grid-template-columns: 220px minmax(0, 1fr); } }
.order .crest { width: 180px; margin: 0 auto; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.6)); }
.order h2 { margin: 0 0 0.2rem; }
.order .role { color: var(--lamp); font: 700 0.85rem var(--heading); letter-spacing: 0.1em; text-transform: uppercase; }
.order .outfit { display: flex; justify-content: center; margin-top: 1rem; }
.order .outfit img { image-rendering: pixelated; height: 120px; width: auto; }
.bars { display: grid; gap: 0.45rem; margin: 1rem 0; max-width: 30rem; }
.bar { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.6rem; align-items: center; font-size: 0.95rem; }
.bar .track { display: block; height: 8px; background: #0a121f; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi)); }
.ticks { list-style: none; padding: 0; margin: 0.6rem 0 1rem; display: grid; gap: 0.35rem; }
.ticks li::before { content: "\2726"; color: var(--brass); margin-right: 0.55rem; }

/* ---- world ---- */
.map-figure { margin: 0; }
.map-figure img { border: 1px solid rgba(214,165,74,0.5); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,0.45); }
.map-figure figcaption { color: var(--faint); font-size: 0.9rem; margin-top: 0.5rem; }
.town { padding: 1.1rem 1.2rem; }
.town h3 { margin: 0 0 0.35rem; }

/* ---- guide ---- */
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding-left: 3.4rem; margin-bottom: 1.4rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0.1rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; font: 700 1.1rem var(--heading); color: #23170a; background: linear-gradient(180deg, #f6d27e, #b07c2c); }
.steps h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }

/* ---- faq ---- */
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(22, 36, 58, 0.85); margin-bottom: 0.7rem; }
.faq summary { cursor: pointer; padding: 1rem 1.2rem; font: 700 1.02rem var(--heading); color: var(--brass-hi); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brass); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 1.2rem 1rem; margin: 0; color: #d6cfbf; }

/* ---- highscores and lookup ---- */
.rank { color: var(--faint); width: 3rem; }
.lookup { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.lookup input { flex: 1 1 260px; font-size: 1.1rem; }
.character { padding: 1.4rem; }
.character h2 { margin: 0 0 0.3rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* ---- download ---- */
.download-box { padding: 2rem; display: grid; gap: 1.6rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .download-box { grid-template-columns: 1fr 1fr; } }

/* ---- footer ---- */
.site-footer { border-top: 1px solid rgba(214, 165, 74, 0.3); background: rgba(6, 10, 17, 0.92); padding: 2.6rem 0 2rem; color: var(--muted); font-size: 0.95rem; }
.site-footer .cols { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.site-footer h2 { font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); margin: 0 0 0.7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brass-hi); text-decoration: underline; }
.site-footer .legal { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(43, 63, 94, 0.6); display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; justify-content: space-between; color: var(--faint); font-size: 0.88rem; }
.footer-logo { width: 180px; margin-bottom: 0.8rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .hero::after { display: none; } body { background: #fff; color: #000; } }
.js-only { display: none !important; }
.js .js-only { display: flex !important; }
section.wrap { margin-top: 4.5rem; }
section.wrap.pitch { margin-top: 0; }
@media (max-width: 700px) { .hero picture img, .hero > img { object-position: 78% 40%; } }
@media (min-width: 900px) { .map-figure { position: sticky; top: 90px; } }
@media (max-width: 600px) { .order { padding: 1.1rem; } .article { padding: 1.2rem 1.1rem 0.8rem; } }
table.wide { min-width: 760px; }
.article ul.loot { padding-left: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; }
/* painted pieces: a town's postcard on its card, the round store emblems beside their text */
.town-view { margin: -1.1rem -1.2rem 0.9rem; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); }
.town-view img { width: 100%; height: 100%; object-fit: cover; }
.emblem { float: right; width: 112px; height: 112px; margin: 0 0 0.8rem 1.4rem; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6)); }
@media (max-width: 560px) { .emblem { width: 80px; height: 80px; } }
a.media { display: block; }
main { flex: 1 0 auto; }

/* Painted portraits on the Orders page */
.order .portrait { width: 100%; height: auto; border-radius: 6px; border: 1px solid rgba(214, 165, 74, 0.35); margin-bottom: 0.8rem; display: block; }
.page-head.has-art h1 { text-shadow: 0 2px 12px rgba(0,0,0,0.8); }
.page-head.has-art p { color: #e8e2d2; text-shadow: 0 1px 8px rgba(0,0,0,0.9); }

/* ---- the home page as a portal: quick links, news, the world's state (the classic online-game layout) ---- */
.hero-short { min-height: min(58vh, 520px); }
.portal { display: grid; gap: 1.4rem; grid-template-columns: 1fr; margin-top: 2rem; align-items: start; }
@media (min-width: 980px) { .portal { grid-template-columns: 240px minmax(0, 1fr) 260px; } }
.portal .side { display: grid; gap: 1.1rem; }
.portal .box { padding: 1rem 1.1rem; }
.portal .box h2 { font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-hi); margin: 0 0 0.7rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.linklist, .rows, .toplist { list-style: none; margin: 0; padding: 0; }
.linklist li { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.linklist li:last-child { border-bottom: 0; }
.linklist a { display: block; padding: 0.42rem 0.1rem; text-decoration: none; }
.linklist a::before { content: "\203A"; color: var(--brass); margin-right: 0.5rem; }
.rows li, .toplist li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.32rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.rows li:last-child, .toplist li:last-child { border-bottom: 0; }
.toplist li { justify-content: flex-start; align-items: baseline; }
.toplist .rank { width: 1.4rem; color: var(--brass); font-weight: 700; }
.toplist a { flex: 1; text-decoration: none; }
.toplist .num, .rows .num { color: var(--brass-hi); font-variant-numeric: tabular-nums; }
.status-line { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-weight: 700; }
.status-line .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #6fd08a; box-shadow: 0 0 8px rgba(111, 208, 138, 0.8); }
.portal .news-list { display: grid; gap: 1rem; grid-template-columns: 1fr; }

/* ---- every other page: the same side column on a wide screen, the page beside it (hidden where there is no room) ---- */
.rail { display: none; }
@media (min-width: 1280px) {
  .with-rail { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.6rem; max-width: calc(var(--wrap) + 262px); margin: 0 auto; padding: 0 16px; align-items: start; }
  .rail { display: grid; gap: 1.1rem; margin-top: 2rem; position: sticky; top: 5rem; }
  .rail .box { padding: 1rem 1.1rem; }
  .rail .box h2 { font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-hi); margin: 0 0 0.7rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
  .rail .linklist a[aria-current="page"] { color: var(--brass-hi); font-weight: 700; }
  .rail-body > .wrap, .rail-body .wrap { padding-left: 0; padding-right: 0; }
}
