/* MCbN XP Tracker — Dark theme styling */

:root {
    --vtm-red: #8b0000;
    --vtm-red-light: #b22222;
    --vtm-gold: #c5a55a;
    --sidebar-width: 220px;
}

body {
    background-color: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Typography ─────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', 'Segoe UI', serif;
    letter-spacing: 0.02em;
}

.navbar-brand {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.05em;
}

/* ── Login page ─────────────────────────────────────────────────── */
body.login-page {
    background-image:
        linear-gradient(rgba(10, 10, 20, 0.70), rgba(10, 10, 20, 0.88)),
        url('/static/images/music.png');
    background-size: cover;
    background-position: center 40%;
    background-attachment: fixed;
    min-height: 100vh;
}

.login-card {
    max-width: 420px;
    margin: 80px auto;
    background-color: rgba(22, 33, 62, 0.92);
    border: 1px solid var(--vtm-red);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(139, 0, 0, 0.25);
    border-radius: 8px;
    overflow: hidden;
}

.login-card .card-header {
    background: linear-gradient(135deg, var(--vtm-red) 0%, #4a0000 100%);
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.login-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0;
}

.login-logo {
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center 55%;
    display: block;
    opacity: 0.85;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background-color: #16213e !important;
}

@media (min-width: 768px) {
    .sidebar {
        height: 100vh;
        overflow-y: auto;
    }
}

.sidebar-logo-img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    object-position: center 50%;
    display: block;
    border-bottom: 1px solid rgba(139, 0, 0, 0.4);
}

.sidebar .nav-link {
    color: #a0a0b0;
    border-radius: 6px;
    margin: 2px 0;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(139, 0, 0, 0.2);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--vtm-red);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 8px;
}

/* ── Player navbar ──────────────────────────────────────────────── */
.player-navbar {
    background-image:
        linear-gradient(rgba(22, 33, 62, 0.88), rgba(22, 33, 62, 0.95)),
        url('/static/images/music.png');
    background-size: cover;
    background-position: center 45%;
    border-bottom: 1px solid rgba(139, 0, 0, 0.5) !important;
}

.player-navbar .navbar-brand img {
    height: 28px;
    width: auto;
    margin-right: 8px;
    filter: brightness(0.9);
}

/* ── Stat cards (dashboard) ─────────────────────────────────────── */
.stat-card {
    border-top: 3px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background-color: #16213e;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.stat-card .stat-icon {
    font-size: 2.2rem;
    opacity: 0.65;
    line-height: 1;
}

.stat-card-characters { border-top-color: #4a9eff; }
.stat-card-claims      { border-top-color: #ff9800; }
.stat-card-spends      { border-top-color: var(--vtm-red-light); }

/* ── Tables ─────────────────────────────────────────────────────── */
.table {
    font-size: 0.9rem;
}

.table th {
    color: var(--vtm-gold);
    border-color: #333;
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    border-color: #2a2a3e;
    vertical-align: middle;
}

/* Clickable rows */
tr[data-href] {
    cursor: pointer;
}

tr[data-href]:hover td {
    background-color: rgba(139, 0, 0, 0.12);
}

/* ── XP colors ──────────────────────────────────────────────────── */
.xp-positive { color: #4caf50; }
.xp-negative { color: #f44336; font-weight: bold; }
.xp-zero { color: #999; }

/* ── Status badges ──────────────────────────────────────────────── */
.badge-pending   { background-color: #ff9800; color: #000; }
.badge-approved  { background-color: #4caf50; }
.badge-denied    { background-color: #f44336; }
.badge-duplicate { background-color: #9e9e9e; }

/* ── Claim category cards ───────────────────────────────────────── */
.claim-category {
    border-left: 3px solid #333;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: #1e1e30;
    border-radius: 0 4px 4px 0;
}

.claim-category.claimed {
    border-left-color: #4caf50;
}

.claim-category.not-claimed {
    border-left-color: #555;
    opacity: 0.6;
}

/* ── Cost validation ────────────────────────────────────────────── */
.cost-match    { color: #4caf50; font-weight: bold; }
.cost-mismatch { color: #f44336; font-weight: bold; }

/* ── Empty states ───────────────────────────────────────────────── */
.empty-state {
    padding: 3.5rem 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ── Clan identity ──────────────────────────────────────────────── */
.clan-brujah      { --clan-color: #e53935; }
.clan-gangrel     { --clan-color: #8d6e63; }
.clan-hecata      { --clan-color: #ab47bc; }
.clan-lasombra    { --clan-color: #5c6bc0; }
.clan-malkavian   { --clan-color: #00acc1; }
.clan-nosferatu   { --clan-color: #66bb6a; }
.clan-ravnos      { --clan-color: #ef6c00; }
.clan-salubri     { --clan-color: #1e88e5; }
.clan-toreador    { --clan-color: #e91e8c; }
.clan-tremere     { --clan-color: #c62828; }
.clan-tzimisce    { --clan-color: #795548; }
.clan-ventrue     { --clan-color: #3949ab; }
.clan-banu-haqim  { --clan-color: #f9a825; }
.clan-the-ministry { --clan-color: #8e24aa; }
.clan-thin-blood  { --clan-color: #78909c; }
.clan-caitiff     { --clan-color: #757575; }
.clan-mortal      { --clan-color: #a1887f; }
.clan-ghoul       { --clan-color: #ad1457; }

/* Clan left-border accent — roster rows */
tr.has-clan-color {
    border-left: 3px solid var(--clan-color, #444);
}

/* Clan left-border accent — list group items (my characters) */
.has-clan-color.list-group-item {
    border-left: 3px solid var(--clan-color, #444) !important;
    padding-left: calc(1rem - 3px);
}

/* Clan badge — outlined, colored text */
.clan-badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--clan-color, #555);
    color: var(--clan-color, #888);
    background: transparent;
    white-space: nowrap;
}

/* Hero top border */
.char-hero.has-clan-color {
    border-top: 3px solid var(--clan-color, var(--vtm-red));
    border-left: 3px solid var(--clan-color, var(--vtm-red));
}

/* ── Dashboard action strip ──────────────────────────────────────── */
.action-strip {
    background: rgba(255, 152, 0, 0.08);
    border: 1px solid rgba(255, 152, 0, 0.25);
    border-radius: 8px;
}

/* ── Character hero ─────────────────────────────────────────────── */
.char-hero {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 65%, rgba(139,0,0,0.25) 100%);
    border: 1px solid rgba(139, 0, 0, 0.35);
    border-radius: 8px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.char-hero::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 180px; height: 100%;
    background: linear-gradient(to left, rgba(139,0,0,0.12), transparent);
    pointer-events: none;
}

.char-hero-name {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
    line-height: 1.15;
}

.char-hero-meta {
    color: #8888a8;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.char-stat-val {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
    color: #e0e0e0;
}

.char-stat-lbl {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    margin-top: 1px;
}

.char-hero-xp-num {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.char-hero-xp-lbl {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-top: 4px;
}

.xp-progress-bar {
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.6rem;
    max-width: 320px;
}

.xp-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #2e7d32, #4caf50);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ── Clan / Sect symbols ─────────────────────────────────────────── */

/* Large ghost watermark in the character hero */
.char-hero {
    position: relative;
    overflow: hidden;
}

.char-hero-clan-symbol {
    position: absolute;
    right: -1rem;
    top: -1rem;
    width: 160px;
    height: 160px;
    object-fit: contain;
    opacity: 0.06;
    filter: invert(1);
    pointer-events: none;
    user-select: none;
}

/* Age category symbol in the hero right column */
.char-hero-age-symbol {
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: 0.5;
    filter: invert(1);
    display: block;
}

/* Sect symbol inline in the meta line */
.hero-sect-symbol {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: invert(1);
    opacity: 0.7;
    vertical-align: middle;
    margin-right: 2px;
}

/* Small clan icon in the character list */
.char-list-clan-symbol {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: invert(1);
    opacity: 0.55;
    flex-shrink: 0;
}

/* ── Wish List ───────────────────────────────────────────────────── */
.wl-add-form {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
}

.wl-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.wl-item:last-child { border-bottom: none; }

.wl-item-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.wl-item-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wl-item-trait {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-item-cat {
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
}

.wl-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.wl-item-dots {
    font-size: 0.78rem;
    color: #888;
    white-space: nowrap;
}

.wl-item-cost {
    font-size: 0.75rem;
    font-weight: 600;
    color: #f87171;
    white-space: nowrap;
}

.wl-item-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.wl-summary-bar {
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.06);
}

/* ── Chronicle Calendar widget ──────────────────────────────────── */
.cal-widget {
    border: 1px solid rgba(197, 165, 90, 0.2);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
}

.cal-widget-header {
    padding: 0.6rem 1rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c5a55a;
    border-bottom: 1px solid rgba(197, 165, 90, 0.15);
    background: rgba(197, 165, 90, 0.05);
    font-family: 'Cinzel', serif;
}

.cal-hero {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cal-hero-current {
    background: rgba(139, 0, 0, 0.12);
    border-left: 3px solid #8b0000;
}

.cal-hero-upcoming {
    background: rgba(197, 165, 90, 0.07);
    border-left: 3px solid rgba(197, 165, 90, 0.5);
}

.cal-hero-eyebrow {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: 0.15rem;
}

.cal-hero-label {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    line-height: 1.2;
}

.cal-hero-note {
    font-size: 0.75rem;
    color: #c5a55a;
    margin-top: 0.1rem;
}

.cal-hero-dates {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.cal-hero-days {
    text-align: right;
    flex-shrink: 0;
    padding-left: 0.75rem;
}

.cal-days-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: #c5a55a;
}

.cal-days-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
}

.cal-timeline {
    padding: 0.25rem 0;
}

.cal-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 1rem;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    flex-wrap: wrap;
}

.cal-row:last-child { border-bottom: none; }

.cal-row-past {
    opacity: 0.38;
}

.cal-row-current {
    background: rgba(139, 0, 0, 0.08);
    color: #e88;
    font-weight: 600;
}

.cal-row-upcoming {
    color: #bbb;
}

.cal-row-now-icon {
    font-size: 0.65rem;
    color: #dc3545;
    flex-shrink: 0;
}

.cal-row-label {
    font-weight: 500;
    min-width: 6rem;
}

.cal-row-dates {
    color: #666;
    font-size: 0.75rem;
}

.cal-row-note {
    font-size: 0.68rem;
    color: #c5a55a;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    background: rgba(197, 165, 90, 0.1);
}

.cal-show-more {
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #666;
    font-size: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    text-align: center;
}

.cal-show-more:hover { color: #c5a55a; }

/* ── Open period banner (player landing) ────────────────────────── */
.open-period-banner {
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-left: 3px solid #4caf50;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #a5d6a7;
}

.open-period-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6); }
    70%  { box-shadow: 0 0 0 7px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.open-period-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15em 0.6em;
    border-radius: 20px;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #81c784;
}

/* ── Period status pills ─────────────────────────────────────────── */
.period-pill {
    font-size: 0.7rem;
    padding: 0.25em 0.6em;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    border: 1px solid transparent;
}

.period-pill.claimed {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.4);
    color: #81c784;
}

.period-pill.unclaimed {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    color: #666;
}

.period-pill.pending {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
    color: #ffb74d;
}

/* ── Player bottom nav (mobile only) ────────────────────────────── */
.player-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(16, 24, 48, 0.97);
    border-top: 1px solid rgba(139, 0, 0, 0.4);
    display: flex;
    z-index: 1050;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-bottom: env(safe-area-inset-bottom);
}

.player-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.25rem;
    color: #666;
    text-decoration: none;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    gap: 0.2rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.player-bottom-nav-item i {
    font-size: 1.35rem;
    line-height: 1;
}

.player-bottom-nav-item:hover,
.player-bottom-nav-item.active {
    color: #fff;
    text-decoration: none;
}

.player-bottom-nav-item.active {
    color: var(--vtm-red-light);
}

/* ── Form submit spinner ────────────────────────────────────────── */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

/* ── Dot pips (character sheet) ─────────────────────────────────── */
.dot-pips {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.dot-pip {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--vtm-gold);
    display: inline-block;
    flex-shrink: 0;
}

.dot-pip.filled {
    background-color: var(--vtm-gold);
}

/* Spend history grouped by category */
.spend-category-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--vtm-gold);
    border-bottom: 1px solid rgba(197, 165, 90, 0.2);
    padding-bottom: 0.4rem;
    margin-bottom: 0.6rem;
    margin-top: 1.25rem;
}

.spend-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    flex-wrap: wrap;
}

.spend-entry:last-child {
    border-bottom: none;
}

.spend-trait-name {
    font-weight: 500;
    flex: 1;
    min-width: 120px;
}

.spend-cost-badge {
    font-size: 0.72rem;
    color: #f44336;
    white-space: nowrap;
}

.spend-date {
    font-size: 0.72rem;
    color: #555;
    white-space: nowrap;
}

/* ── Review page ─────────────────────────────────────────────────── */
.review-sticky {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.evidence-card {
    border-left: 3px solid #2a2a3e;
    border-radius: 0 6px 6px 0;
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.4rem;
    background: #1a1a2e;
    transition: border-color 0.15s;
}

.evidence-card.claimed {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.06);
}

.evidence-card.not-claimed {
    opacity: 0.45;
}

.evidence-card .evidence-label {
    font-size: 0.85rem;
    font-weight: 500;
}

.evidence-link {
    display: inline-block;
    font-size: 0.75rem;
    color: #5b9cf6;
    word-break: break-all;
    margin-top: 0.2rem;
}

.evidence-link:hover {
    color: #89b4fa;
}

/* ── Wiki ────────────────────────────────────────────────────────── */

.wiki-body {
    background-color: #12121f;
}

/* Navbar */
.wiki-navbar {
    background:
        linear-gradient(rgba(10, 10, 20, 0.94), rgba(16, 21, 40, 0.97)),
        url('/static/images/music.png');
    background-size: cover;
    background-position: center 42%;
    border-bottom: 1px solid rgba(197, 165, 90, 0.2) !important;
    padding: 0.6rem 0;
}

.wiki-brand {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: #e0e0e0 !important;
}

.wiki-nav-link {
    color: #9898b0 !important;
    font-size: 0.88rem;
    padding: 0.35rem 0.75rem !important;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.wiki-nav-link:hover {
    color: #e0e0e0 !important;
    background: rgba(255, 255, 255, 0.06);
}

.wiki-nav-active {
    color: var(--vtm-gold) !important;
    background: rgba(197, 165, 90, 0.1) !important;
}

.wiki-btn-new {
    background: rgba(139, 0, 0, 0.5);
    border: 1px solid rgba(139, 0, 0, 0.8);
    color: #e8a0a0 !important;
    font-size: 0.82rem;
}

.wiki-btn-new:hover {
    background: var(--vtm-red);
    color: #fff !important;
}

.wiki-btn-login {
    background: rgba(88, 101, 242, 0.25);
    border: 1px solid rgba(88, 101, 242, 0.55);
    color: #b9bcf8 !important;
    font-size: 0.82rem;
}

.wiki-btn-login:hover {
    background: #5865f2;
    color: #fff !important;
}

.wiki-btn-edit {
    background: rgba(197, 165, 90, 0.15);
    border: 1px solid rgba(197, 165, 90, 0.4);
    color: var(--vtm-gold);
    width: 100%;
    padding: 0.4rem;
}

.wiki-btn-edit:hover {
    background: rgba(197, 165, 90, 0.25);
    color: #e8d585;
}

.wiki-btn-save {
    background: var(--vtm-red);
    border: 1px solid #a00000;
    color: #fff;
    padding: 0.5rem 1.5rem;
}

.wiki-btn-save:hover {
    background: var(--vtm-red-light);
    color: #fff;
}

/* Hero sections */
.wiki-index-hero {
    background:
        linear-gradient(rgba(10, 10, 20, 0.55), rgba(18, 18, 31, 1)),
        url('/static/images/music.png');
    background-size: cover;
    background-position: center 40%;
    padding: 4.5rem 0 3rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(197, 165, 90, 0.15);
}

.wiki-index-title {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.wiki-index-subtitle {
    color: var(--vtm-gold);
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.85;
    margin: 0;
}

.wiki-cat-hero {
    background:
        linear-gradient(rgba(10, 10, 20, 0.6), rgba(18, 18, 31, 1)),
        url('/static/images/music.png');
    background-size: cover;
    background-position: center 40%;
    padding: 2.5rem 0 1.75rem;
    border-bottom: 1px solid rgba(197, 165, 90, 0.12);
    margin-bottom: 0;
}

.wiki-cat-hero-icon {
    font-size: 2.2rem;
    color: var(--vtm-gold);
    opacity: 0.8;
}

.wiki-cat-hero-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.wiki-cat-hero-count {
    font-size: 0.85rem;
    margin: 0;
}

.wiki-page-hero {
    position: relative;
    background:
        linear-gradient(rgba(10, 10, 20, 0.55), rgba(18, 18, 31, 1)),
        var(--cover-url, url('/static/images/music.png'));
    background-size: cover;
    background-position: center 40%;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid rgba(197, 165, 90, 0.12);
    margin-bottom: 0;
}

.wiki-page-hero--plain {
    background:
        linear-gradient(rgba(10, 10, 20, 0.7), rgba(18, 18, 31, 1)),
        url('/static/images/music.png');
    padding: 2rem 0 1.5rem;
}

.wiki-page-title {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Breadcrumbs */
.wiki-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.wiki-breadcrumb .breadcrumb-item a {
    color: var(--vtm-gold);
    opacity: 0.8;
    text-decoration: none;
}

.wiki-breadcrumb .breadcrumb-item a:hover { opacity: 1; }

.wiki-breadcrumb .breadcrumb-item.active { color: #888; }

.wiki-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: #555; }

/* Section heading */
.wiki-section-heading {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--vtm-gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(197, 165, 90, 0.2);
}

/* Category cards (index) */
.wiki-category-card {
    background: #16213e;
    border: 1px solid rgba(197, 165, 90, 0.12);
    border-top: 3px solid var(--vtm-red);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    transition: border-top-color 0.15s, transform 0.15s, box-shadow 0.15s;
    display: block;
    color: inherit;
    height: 100%;
}

.wiki-category-card:hover {
    border-top-color: var(--vtm-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    color: inherit;
}

.wiki-category-card .cat-icon {
    font-size: 1.75rem;
    color: var(--vtm-gold);
    opacity: 0.75;
    margin-bottom: 0.6rem;
    display: block;
}

.wiki-category-card h3 {
    font-size: 0.95rem;
    color: #ddd;
    margin: 0 0 0.2rem;
}

.wiki-category-card .count {
    font-size: 0.75rem;
    color: #666;
}

/* Page cards (grid) */
.wiki-page-card {
    background: #16213e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    display: block;
    color: inherit;
    height: 100%;
    transition: border-color 0.15s, transform 0.12s;
}

.wiki-page-card:hover {
    border-color: rgba(197, 165, 90, 0.35);
    transform: translateY(-2px);
    color: inherit;
}

.wiki-card-cover {
    height: 100px;
    background-size: cover;
    background-position: center 40%;
    filter: brightness(0.75);
}

.wiki-card-body {
    padding: 0.875rem 1rem;
}

.wiki-card-body h5 {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #e0e0e0;
    margin: 0 0 0.3rem;
    line-height: 1.3;
}

.wiki-card-body .meta {
    font-size: 0.75rem;
    color: #666;
}

/* Category badge */
.wiki-cat-badge {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--vtm-gold);
    background: rgba(197, 165, 90, 0.1);
    border: 1px solid rgba(197, 165, 90, 0.25);
    border-radius: 3px;
    padding: 0.1em 0.5em;
    margin-bottom: 0.4rem;
    text-decoration: none;
}

a.wiki-cat-badge:hover {
    background: rgba(197, 165, 90, 0.2);
}

/* Separator */
.wiki-sep {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(197, 165, 90, 0.3), transparent);
    margin: 2.5rem 0;
}

/* Article body */
.wiki-article {
    font-size: 0.97rem;
    line-height: 1.8;
    color: #c8c8d8;
}

.wiki-article h1 {
    font-size: 1.9rem;
    color: #fff;
    margin-bottom: 0.5rem;
    margin-top: 2rem;
}

.wiki-article h2 {
    font-size: 1.3rem;
    color: var(--vtm-gold);
    border-bottom: 1px solid rgba(197, 165, 90, 0.25);
    padding-bottom: 0.35rem;
    margin-top: 2.25rem;
    margin-bottom: 0.9rem;
}

.wiki-article h3 {
    font-size: 1.05rem;
    color: #d4c5a0;
    margin-top: 1.75rem;
    margin-bottom: 0.6rem;
}

.wiki-article h4, .wiki-article h5, .wiki-article h6 {
    color: #bbb;
    margin-top: 1.25rem;
}

.wiki-article p { margin-bottom: 1rem; }

.wiki-article a {
    color: var(--vtm-gold);
    text-decoration: underline;
    text-decoration-color: rgba(197, 165, 90, 0.4);
}

.wiki-article a:hover {
    color: #e8d585;
    text-decoration-color: rgba(197, 165, 90, 0.8);
}

.wiki-article blockquote {
    border-left: 3px solid var(--vtm-red);
    padding: 0.75rem 1.25rem;
    background: rgba(139, 0, 0, 0.08);
    margin: 1.25rem 0;
    font-style: italic;
    color: #aaa;
    border-radius: 0 4px 4px 0;
}

.wiki-article ul, .wiki-article ol {
    color: #c0c0d0;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.wiki-article li { margin-bottom: 0.35rem; }

.wiki-article hr {
    border: none;
    border-top: 1px solid rgba(197, 165, 90, 0.2);
    margin: 2rem 0;
}

.wiki-article table {
    width: 100%;
    margin: 1.25rem 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.wiki-article table th {
    color: var(--vtm-gold);
    border-bottom: 2px solid rgba(197, 165, 90, 0.3);
    padding: 0.5rem 0.75rem;
    text-align: left;
    background: rgba(197, 165, 90, 0.05);
}

.wiki-article table td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #c0c0d0;
}

.wiki-article code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    padding: 0.15em 0.4em;
    font-size: 0.85em;
    color: #a8d8a8;
}

.wiki-article pre code {
    display: block;
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.6;
}

.wiki-article img {
    max-width: 100%;
    border-radius: 6px;
    margin: 0.75rem 0;
}

/* Sidebar panel */
.wiki-sidebar-panel {
    position: sticky;
    top: 1rem;
}

.wiki-portrait-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(197, 165, 90, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.wiki-portrait-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.wiki-portrait-card--faded .wiki-portrait-img {
    filter: grayscale(60%) opacity(0.75);
}

.wiki-portrait-card { position: relative; }

.wiki-status-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 10, 10, 0.82);
    color: #c0a0a0;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-align: center;
    padding: 0.35rem 0.5rem;
}

.wiki-status-overlay--retired {
    color: #999;
    background: rgba(20, 20, 30, 0.82);
}

.wiki-status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.08em;
}

.wiki-status-badge--deceased {
    background: rgba(80, 20, 20, 0.5);
    color: #c0a0a0;
    border: 1px solid rgba(150, 50, 50, 0.4);
}

.wiki-status-badge--retired {
    background: rgba(40, 40, 50, 0.5);
    color: #999;
    border: 1px solid rgba(80, 80, 100, 0.4);
}

.wiki-page-card--inactive { opacity: 0.75; }

.wiki-card-status-badge {
    font-size: 0.65rem;
    vertical-align: middle;
    margin-left: 0.4rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.06em;
}

.wiki-card-status-badge--deceased {
    background: rgba(80, 20, 20, 0.5);
    color: #c0a0a0;
}

.wiki-card-status-badge--retired {
    background: rgba(40, 40, 50, 0.5);
    color: #888;
}

.wiki-meta-card {
    background: #16213e;
    border: 1px solid rgba(197, 165, 90, 0.15);
    border-radius: 8px;
    padding: 1rem;
}

.wiki-meta-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}

.wiki-meta-row:last-child { border-bottom: none; }

.wiki-meta-label {
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-width: 60px;
    flex-shrink: 0;
}

.wiki-meta-value { color: #c0c0d0; }

.wiki-sidebar-heading {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--vtm-gold);
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.wiki-sidebar-link {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #8888a8;
    text-decoration: none;
    transition: color 0.12s, background 0.12s;
}

.wiki-sidebar-link:hover { color: #e0e0e0; background: rgba(255, 255, 255, 0.05); }
.wiki-sidebar-link--active { color: var(--vtm-gold) !important; background: rgba(197, 165, 90, 0.08) !important; }

/* Edit form */
.wiki-form-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 0.35rem;
}

.wiki-form-input {
    background: #0d1117 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0 !important;
    border-radius: 6px;
}

.wiki-form-input:focus {
    border-color: rgba(197, 165, 90, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(197, 165, 90, 0.1) !important;
    color: #e0e0e0 !important;
    background: #0d1117 !important;
}

.wiki-cover-preview {
    max-height: 160px;
    border-radius: 6px;
    opacity: 0.85;
}

/* Footer */
.wiki-footer {
    border-top: 1px solid rgba(197, 165, 90, 0.12);
    background: rgba(0, 0, 0, 0.25);
}

/* ── Responsive — mobile (<768px) ───────────────────────────────── */
@media (max-width: 767.98px) {
    /* Player: compact XP summary cards */
    .xp-summary .card-body {
        padding: 0.5rem;
    }
    .xp-summary .card-title {
        font-size: 1.4rem;
    }
    .xp-summary .card-subtitle {
        font-size: 0.75rem;
    }

    /* Staff: tighter main content padding */
    main.flex-grow-1 {
        padding: 1rem !important;
    }

    /* Tables: more compact on mobile */
    .table {
        font-size: 0.82rem;
    }
    .table th, .table td {
        padding: 0.4rem 0.5rem;
    }

    /* Staff sidebar: offcanvas overlay */
    .sidebar.offcanvas-md {
        width: var(--sidebar-width);
    }

    .login-card {
        margin: 40px auto;
    }

    /* Bottom nav padding so content isn't hidden behind it */
    .has-bottom-nav {
        padding-bottom: 72px;
    }

    .char-hero {
        padding: 1.25rem;
    }

    .char-hero-name {
        font-size: 1.5rem;
    }

    .char-hero-xp-num {
        font-size: 2.5rem;
    }
}

/* ── Wiki Search ──────────────────────────────────────────────────────────── */

/* Navbar search box */
/* ── Wiki XP snapshot ───────────────────────────────────────────────────── */

.wiki-xp-stats {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.wiki-xp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.wiki-xp-val {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: #d4c5a9;
}

.wiki-xp-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-top: 0.1rem;
}

.wiki-xp-toggle {
    background: none;
    border: none;
    padding: 0.25rem 0;
    font-size: 0.78rem;
    color: #8888a8;
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
}

.wiki-xp-toggle:hover { color: var(--vtm-gold); }

.wiki-xp-chevron {
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.wiki-xp-toggle:not(.collapsed) .wiki-xp-chevron {
    transform: rotate(90deg);
}

.wiki-xp-list {
    list-style: none;
    padding: 0.4rem 0 0;
    margin: 0;
}

.wiki-xp-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.8rem;
}

.wiki-xp-item:last-child { border-bottom: none; }

.wiki-xp-trait { color: #b0a898; }

.wiki-xp-cost {
    color: #888;
    white-space: nowrap;
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

/* ── Wiki search ────────────────────────────────────────────────────────── */

.wiki-nav-search { width: 200px; }

.wiki-nav-search-input {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e0e0e0;
    font-size: 0.82rem;
}

.wiki-nav-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(197, 165, 90, 0.4);
    color: #e0e0e0;
    box-shadow: 0 0 0 2px rgba(197, 165, 90, 0.15);
}

.wiki-nav-search-input::placeholder { color: #666; }

.wiki-nav-search-btn {
    background: rgba(197, 165, 90, 0.15);
    border: 1px solid rgba(197, 165, 90, 0.25);
    color: var(--vtm-gold);
    font-size: 0.82rem;
}

.wiki-nav-search-btn:hover {
    background: rgba(197, 165, 90, 0.25);
    color: var(--vtm-gold);
}

/* Search page form */
.wiki-search-bar .wiki-search-input {
    background: #16213e;
    border: 1px solid rgba(197, 165, 90, 0.2);
    color: #e0e0e0;
    font-size: 1rem;
    padding: 0.6rem 1rem;
}

.wiki-search-bar .wiki-search-input:focus {
    background: #16213e;
    border-color: rgba(197, 165, 90, 0.5);
    color: #e0e0e0;
    box-shadow: 0 0 0 3px rgba(197, 165, 90, 0.12);
}

.wiki-btn-search {
    background: rgba(197, 165, 90, 0.15);
    border: 1px solid rgba(197, 165, 90, 0.3);
    color: var(--vtm-gold);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
}

.wiki-btn-search:hover {
    background: rgba(197, 165, 90, 0.25);
    color: var(--vtm-gold);
}

/* Search results */
.wiki-search-results { display: flex; flex-direction: column; gap: 0.5rem; }

.wiki-search-result {
    display: block;
    padding: 1rem 1.1rem;
    background: #16213e;
    border: 1px solid rgba(197, 165, 90, 0.12);
    border-radius: 8px;
    transition: border-color 0.12s, background 0.12s;
}

.wiki-search-result:hover {
    background: #1a2a52;
    border-color: rgba(197, 165, 90, 0.35);
}

.wiki-search-result-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #e8dfc0;
}

.wiki-search-result-excerpt {
    font-size: 0.83rem;
    color: #8888a8;
    margin-top: 0.3rem;
    line-height: 1.5;
}
