:root {
    color-scheme: dark;
    --bg: #0e1013;
    --panel: #161a20;
    --panel-2: #1b2028;
    --border: #272c35;
    --text: #e6e3dc;
    --muted: #9a9890;
    --accent: #f2b84b;
    --link: #8fc3ff;
    --alliance: #6fa8ff;
    --horde: #ff6b5e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2 {
    line-height: 1.2;
    text-wrap: balance;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    letter-spacing: -0.01em;
}

h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

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

.topbar {
    border-bottom: 1px solid var(--border);
    background: #0b0d10;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    font-weight: 700;
}

.brand img {
    margin: 0 -2px 0 -6px;
}

.brand-name span,
.site-name span {
    color: var(--accent);
}

.brand:hover,
.site-name:hover,
.nav a:hover {
    text-decoration: none;
}

.site-name {
    padding-left: 18px;
    border-left: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 4px;
}

.nav a {
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 500;
}

.nav a:hover {
    background: var(--panel);
    color: var(--text);
}

.search {
    position: relative;
    margin-left: auto;
    width: min(320px, 100%);
}

input[type="search"],
input[type="number"],
select {
    width: 100%;
    padding: 8px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    padding: 4px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.suggestion {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--text);
}

.suggestion:hover,
.suggestion.active {
    background: var(--panel);
    text-decoration: none;
}

.suggestion .kind {
    flex: none;
    width: 3.6em;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.suggestion .detail {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.suggestion.empty {
    color: var(--muted);
}

/* ---------- page ---------- */

.page {
    flex: 1;
    /* so wide tables scroll in their own box instead of widening the page */
    min-width: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 64px;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.crumbs li + li::before {
    content: "›";
    margin-right: 6px;
    color: var(--muted);
}

.crumbs a {
    color: var(--muted);
}

.hero {
    padding: 40px 0 32px;
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lede {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 1.1rem;
}

.note,
.hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.hero-search {
    position: relative;
    display: flex;
    gap: 8px;
    max-width: 640px;
    margin-bottom: 12px;
}

.hero-search input {
    padding: 12px 14px;
    font-size: 1rem;
}

button {
    padding: 8px 16px;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    color: #1d1305;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.08);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.stats a {
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
}

.stats a:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
    text-decoration: none;
}

.stats strong {
    display: block;
    color: var(--text);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.browse {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chips a,
.chips span {
    display: inline-block;
    padding: 5px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.9rem;
}

.chips a:hover {
    border-color: var(--accent);
    text-decoration: none;
}

/* ---------- entries ---------- */

.entry-head {
    margin-bottom: 20px;
}

.entry-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.entry-icon {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 8px;
}

.entry-sub {
    margin: 0;
    color: var(--muted);
}

.entry-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
    margin-bottom: 32px;
}

.entry-grid > * {
    min-width: 0;
}

.summary {
    margin-top: 0;
    font-size: 1.05rem;
}

.facts {
    padding: 16px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.facts h2 {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.facts dl,
.gains {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 0;
}

.facts dt,
.gains dt {
    color: var(--muted);
}

.facts dd,
.gains dd {
    margin: 0;
    text-align: right;
}

.gains dd {
    text-align: left;
}

.block {
    margin-bottom: 32px;
}

.block p {
    max-width: 72ch;
}

.count {
    margin-left: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.objectives,
.reward-items,
.hits {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.reward-items {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.objectives li::before {
    content: "◆";
    margin-right: 8px;
    color: var(--accent);
    font-size: 0.7em;
    vertical-align: 0.15em;
}

.detail,
.sub {
    color: var(--muted);
    font-size: 0.88rem;
}

.tag {
    padding: 1px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
}

.side-alliance { color: var(--alliance); }
.side-horde { color: var(--horde); }
.side-both { color: var(--muted); }

/* ---------- lists ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 16px 0;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.filters label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.filters select {
    min-width: 150px;
}

.range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.range input {
    width: 72px;
}

.count-line {
    color: var(--muted);
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

table.list {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.list th,
.list td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.list td:first-child {
    white-space: normal;
    min-width: 220px;
}

.list th {
    background: var(--panel);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.list tbody tr:last-child td {
    border-bottom: 0;
}

.list tbody tr:hover {
    background: var(--panel);
}

.list .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.item-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.item-link img,
.item-link .icon-ph {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.pager-pos {
    color: var(--muted);
    font-size: 0.9rem;
}

.empty {
    color: var(--muted);
}

/* ---------- footer ---------- */

.footer {
    border-top: 1px solid var(--border);
    padding: 24px 16px;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

.footer p {
    max-width: 760px;
    margin: 4px auto;
}

.footer a {
    color: var(--muted);
    text-decoration: underline;
}

@media (max-width: 860px) {
    .entry-grid {
        grid-template-columns: 1fr;
    }
    .search {
        margin-left: 0;
        width: 100%;
        order: 5;
    }
    .site-name {
        padding-left: 12px;
    }
}
