:root {
    /* Owlman theme — "not black, not gold — a silver-violet dusk between them" */
    --bg: #f4f1f8;
    --panel: #ffffff;
    --ink: #171222;
    --muted: #6d6480;
    --line: #e3ddf0;
    --accent: #6d4fa3;
    --accent-soft: #e8e0f6;
    --green: #2fbf8f;
    --danger: #b91c1c;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Header — matched to logo-brand.png background (#1a2737 / #222f3c / #162130) */
.site-header {
    background: linear-gradient(90deg, #162130 0%, #1a2737 40%, #202e40 70%, #172332 100%);
    color: #d8e2f0;
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 1px 0 rgba(143, 111, 209, .35), 0 14px 34px -20px rgba(10, 18, 28, .95);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 68px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}
.brand:hover { text-decoration: none; }
.brand-logo {
    width: 130px;
    height: auto;
    display: block;
    background: transparent;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: .5px; }
.brand-tag {
    font-size: 12px;
    letter-spacing: .06em;
    color: #9bb7dc;
}
.site-nav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.site-nav a { color: #b0c4de; font-size: 15px; }
.site-nav a:hover { color: #ffffff; text-decoration: none; }
.account { display: flex; gap: 14px; align-items: center; color: #b0c4de; font-size: 14px; }
.account a { color: #dce7f5; }
.account a:hover { color: #ffffff; }

/* Banners (Centralised advertising slots) */
.banner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 18px auto;
    text-align: center;
    width: 100%;
    max-width: 1180px;
    padding: 0 20px;
}
.banner a {
    display: inline-block;
    line-height: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px -4px rgba(10, 18, 28, .5);
    border: 1px solid rgba(143, 111, 209, .3);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.banner a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px -4px rgba(109, 79, 163, .45);
    border-color: rgba(143, 111, 209, .7);
}
.banner img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Hero banner (Home — left image, centralised, right caption overlay) */
.hero-banner {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin: 20px auto 24px;
    max-width: 1180px;
    border: 1px solid rgba(143, 111, 209, .35);
    box-shadow: 0 18px 44px -26px rgba(10, 18, 28, .9);
    background: #00030e;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: cover;
    object-position: left center;
}
.hero-caption {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 58%;
    padding: 34px 38px;
    background: linear-gradient(270deg, rgba(0, 3, 14, .96) 0%, rgba(0, 3, 14, .88) 55%, rgba(0, 3, 14, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    text-align: left;
}
.hero-kicker {
    font-size: 11px;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: #2fbf8f;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(47, 191, 143, .4);
}
.hero-slogan {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: .2px;
    line-height: 1.25;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .8);
}
.hero-sub {
    font-size: 13.5px;
    color: #b5cced;
    margin-top: 4px;
    letter-spacing: .02em;
    line-height: 1.4;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
}

/* Flash */
.flash {
    margin: 18px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid transparent;
}
.flash-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 240px;
    gap: 26px;
    padding-top: 28px;
    padding-bottom: 40px;
    align-items: start;
}
.col-side { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .col-side { order: 2; }
}

/* Blocks */
.block {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.block h3 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
.block-body { font-size: 14px; }
.block-wide { margin-bottom: 18px; }
.block-list { list-style: none; margin: 0; padding: 0; }
.block-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed var(--line);
}
.block-list li:last-child { border-bottom: 0; }
.count {
    background: var(--accent-soft);
    color: #115e59;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
}

/* Stories */
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.4px; }

.story-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 18px;
}
.story-card h2 { margin: 6px 0 8px; font-size: 22px; line-height: 1.3; }
.story-card h2 a { color: var(--ink); }
.story-card h2 a:hover { color: var(--accent); text-decoration: none; }
.story-summary { margin: 0 0 10px; color: #374151; }
.story-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
}
.chip {
    background: #f1f5f9;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.read-more { font-weight: 600; font-size: 14px; }

.pager { display: flex; gap: 18px; align-items: center; margin: 26px 0; font-size: 14px; }

/* Article */
.article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 32px;
}
.article h1 { margin: 8px 0 12px; font-size: 32px; line-height: 1.2; letter-spacing: -.5px; }
.article-summary { font-size: 18px; color: #374151; margin: 0 0 18px; }
.article-body { font-size: 16.5px; }
.article-body h2, .article-body h3 { margin-top: 28px; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.article-body pre, .article-body code {
    background: #0b1220;
    color: #e5e7eb;
    border-radius: 6px;
}
.article-body code { padding: 1px 6px; font-size: 14px; }
.article-body pre { padding: 14px 16px; overflow: auto; }
.article-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--line);
    margin-top: 26px;
    padding-top: 16px;
    flex-wrap: wrap;
}
.rating { display: flex; gap: 12px; align-items: center; }

/* Comments */
.comments { margin-top: 26px; }
.comments h2 { font-size: 20px; }
.comment {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 12px;
}
.comment-head { display: flex; gap: 12px; align-items: baseline; font-size: 14px; }
.comment p { margin: 6px 0 0; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=search], .form input[type=number], .form input[type=datetime-local],
.form select, .form textarea {
    font: inherit;
    font-weight: 400;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.form legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: end; gap: 10px; }
.form-inline label { font-size: 13px; }
.form-actions { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.checkbox { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.narrow { max-width: 110px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: #543c82; text-decoration: none; color: #fff; }
.btn-small { padding: 5px 12px; font-size: 13px; }
.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 14px;
    color: var(--accent);
    cursor: pointer;
}
.link-button.danger { color: var(--danger); }
.link-button:hover { text-decoration: underline; }

/* Search / archive */
.search-form { display: flex; gap: 10px; margin-bottom: 22px; }
.search-form input { flex: 1; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; }
.result-head { font-size: 17px; margin: 26px 0 8px; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.month-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
.month-nav a {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    color: #334155;
}
.month-nav a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty {
    background: var(--panel);
    border: 1px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 26px;
    text-align: center;
    color: var(--muted);
}

/* Auth */
.auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 30px;
    max-width: 440px;
    margin: 20px auto;
}
.auth-card.wide { max-width: 620px; }
.auth-card h1 { margin-top: 0; font-size: 26px; }

/* Admin */
body.admin { background: #f3f4f6; }
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-nav {
    background: #100a1a;
    color: #b7aed0;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.admin-brand a { color: #fff; font-weight: 700; font-size: 18px; }
.admin-brand span { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.admin-nav nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav nav a {
    color: #cbd5e1;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 14.5px;
}
.admin-nav nav a:hover { background: #1d1430; color: #fff; text-decoration: none; }
.admin-nav nav a.active { background: var(--accent); color: #fff; }
.admin-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.admin-foot a { color: #e5e7eb; }
.admin-main { padding: 26px 32px 48px; min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.admin-topbar h1 { margin: 0; font-size: 26px; letter-spacing: -.3px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.stat-label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 22px;
}
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}
.table td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.actions-col { width: 210px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #334155;
}
.badge-published { background: #ecfdf5; color: #065f46; }
.badge-queued { background: #fffbeb; color: #92400e; }
.badge-draft { background: #f3f4f6; color: #4b5563; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; }
.tabs a {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13.5px;
    color: #334155;
    background: #e5e7eb;
}
.tabs a.active { background: var(--accent); color: #fff; }
.tabs a:hover { text-decoration: none; }

.mod-item { border-top: 1px solid #f1f5f9; padding: 12px 0; }
.mod-item:first-of-type { border-top: 0; }
.mod-item p { margin: 6px 0 8px; }

.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 18px 0; }
.pagination li a, .pagination li span {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 13.5px;
    background: #fff;
}
.pagination li.active span { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Footer — matched to logo-footer-brand.png background (#1b2838 / #162130) */
.site-footer {
    border-top: 1px solid #253549;
    background: linear-gradient(180deg, #162130 0%, #1b2838 100%);
    color: #9cb2cf;
    padding: 28px 0;
    font-size: 14px;
}
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-logo { width: 130px; height: auto; display: block; background: transparent; }
.site-footer p { margin: 2px 0; }
.site-footer .muted { color: #768da7; }
.site-footer a { color: #a4c2ea; }
.site-footer a:hover { color: #ffffff; }

/* Directories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cat-card {
    position: relative;
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: #fbfcfd;
    color: var(--ink);
}
.cat-card:hover { border-color: var(--accent); text-decoration: none; }
.cat-card .count { position: absolute; top: 12px; right: 12px; }
.cat-card strong { display: block; margin-bottom: 2px; }

/* Polls */
.poll-question { font-weight: 600; font-size: 13.5px; margin: 0 0 8px; }
.radio-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    font-size: 13.5px;
    margin-bottom: 4px;
}
.result-bars { list-style: none; margin: 0; padding: 0; }
.result-bars li { margin-bottom: 10px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 3px; }
.bar { background: #eef2f6; border-radius: 999px; height: 9px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* Encyclopedia / FAQ / leaderboards */
.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.alpha-strip { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; }
.alpha-strip a, .alpha-strip .off {
    min-width: 28px;
    text-align: center;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}
.alpha-strip a:hover { border-color: var(--accent); text-decoration: none; }
.alpha-strip a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.alpha-strip .off { color: #cbd5e1; border-style: dashed; }

.jump-nav { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; font-size: 13.5px; }
.faq-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
.faq-answer { margin-top: 10px; color: var(--ink); font-size: 14px; }
.faq-answer p { margin: 0 0 10px; }

.rank-list { margin: 0; padding-left: 22px; }
.rank-list li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.rank-list li:last-child { border-bottom: 0; }

/* keep pill badges from being squashed by long labels in sidebar blocks */
.block-list .count { flex: 0 0 auto; align-self: center; white-space: nowrap; }

/* Global message box */
.flash-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 14px 0 0;
    font-size: 14px;
}
.flash-notice strong { display: block; margin-bottom: 2px; }
