:root {
    --accent: #b45309;
    --highlight: #fbbf24;
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 20, 10, 0.85);
    --gold: #f59e0b;
    --border-color: #78350f;
    --text-main: #fef3c7;
    --gem-slot: #1a120b;
    --success: #2ecc71;
    --danger: #e74c3c;
}

* { box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background: #111;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
}

.page-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --- SEARCH BAR --- */
.search-box {
    padding: 5px 5px 15px 5px;
    border-bottom: 1px solid #444;
    margin-bottom: 10px;
}
.search-box input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: #222;
    color: var(--text-main);
    font-size: 0.9em;
}

/* --- LEFT SIDEBAR --- */
.sidebar-left {
    width: 240px;
    background: #181818;
    border-right: 2px solid var(--border-color);
    overflow-y: auto;
    padding: 15px 10px;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.sidebar-heading {
    font-size: 1.05em;
    font-weight: bold;
    color: var(--highlight);
    margin: 18px 0 6px 5px;
    text-transform: uppercase;
    border-bottom: 1px solid #444;
    padding-bottom: 3px;
}
.sidebar-heading:first-child { margin-top: 0; }

.sidebar-subheading {
    font-size: 0.8em;
    font-weight: bold;
    color: var(--highlight);
    margin: 12px 0 4px 8px;
    padding-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #bbb;
    text-align: left;
    padding: 6px 10px;
    margin: 2px 0;
    font-size: 0.88em;
    cursor: pointer;
    border-radius: 4px;
    box-sizing: border-box;
}
.nav-btn:hover { background: #2a2a2a; color: #fff; }
.nav-btn.active {
    border-left: 3px solid var(--highlight);
    background: #222;
    color: #fff;
}

/* Quest list buttons show a small status dot */
.quest-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}
.quest-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    flex-shrink: 0;
}
.quest-status-dot.done { background: var(--success); }

/* --- LANGUAGE SELECTOR --- */
.lang-selector-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 16px 0;
}
.lang-btn {
    background: var(--gem-slot);
    color: var(--highlight);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: 0.2s;
}
.lang-btn:hover { filter: brightness(1.2); }
.lang-btn.active {
    background: var(--accent);
    color: white;
    border: 1px solid var(--highlight);
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-right: 280px;
}
.main-content h1 {
    margin-top: 0;
    color: #fff;
    width: 100%;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* --- RIGHT SIDEBAR (fixed site navigation) --- */
.sidebar-right {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--panel-bg);
    border-left: 2px solid var(--border-color);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: -5px 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 100;
}
.sidebar-right h3 {
    color: var(--highlight);
    text-transform: uppercase;
    font-size: 18px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-top: 0;
    text-align: center;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-nav button {
    width: 100%;
    background: var(--gem-slot);
    border: 1px solid var(--highlight);
    color: var(--highlight);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.2s;
    text-align: left;
}
.sidebar-nav button:hover {
    background: var(--accent);
    color: white;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 6px;
}

/* --- QUEST CARD --- */
.quest-card {
    border: 2px solid var(--border-color);
    margin: 0 0 24px 0;
    padding: 24px;
    border-radius: 8px;
    background: var(--panel-bg);
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    line-height: 1.7;
}

.quest-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 16px;
}
.quest-banner h2 {
    margin: 0 0 4px 0;
    color: var(--highlight);
    font-size: 1.7em;
}
.quest-meta-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.quest-tag {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(180,83,9,0.25);
    border: 1px solid var(--border-color);
    color: var(--highlight);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Quest giver portrait, shown inside the quest body (not the header) */
.quest-giver-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.quest-giver-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--gem-slot);
    padding: 4px;
    cursor: zoom-in;
    flex-shrink: 0;
}
.quest-giver-name {
    color: var(--highlight);
    font-weight: bold;
    font-size: 1.05em;
}
.quest-giver-sub {
    color: #bbb;
    font-size: 0.85em;
    margin-top: 2px;
}

/* Lets wide tables (long German/French labels, 4+ columns) scroll
   horizontally instead of squashing or overflowing on small screens */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}
.table-scroll .stat-table { margin-bottom: 0; }

.quest-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.9em;
}
.quest-info-table td {
    padding: 6px 10px;
    border: 1px solid #444;
}
.quest-info-table td.label {
    font-weight: bold;
    width: 30%;
    background: rgba(255,255,255,0.05);
    color: var(--highlight);
}

.quest-intro {
    font-style: italic;
    color: #ffd8a8;
    margin-bottom: 14px;
    font-size: 0.95em;
}

.quest-card h3 {
    color: var(--gold);
    font-size: 1.15em;
    margin: 22px 0 8px 0;
    border-left: 3px solid var(--accent);
    padding-left: 10px;
}
.quest-card h4 {
    color: #ffd8a8;
    font-size: 0.95em;
    margin: 14px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.quest-card p { margin: 0 0 10px 0; color: var(--text-main); }

/* Walkthrough step blocks */
.step-block {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(120,53,15,0.4);
    border-radius: 6px;
    padding: 14px 18px;
    margin: 10px 0;
}
.step-block strong { color: var(--highlight); }

/* Numbered quick guide */
.quick-guide-list {
    counter-reset: quickstep;
    list-style: none;
    margin: 6px 0 12px 0;
    padding-left: 0;
}
.quick-guide-list li {
    counter-increment: quickstep;
    position: relative;
    padding: 8px 10px 8px 42px;
    margin-bottom: 6px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(120,53,15,0.3);
    border-radius: 6px;
}
.quick-guide-list li::before {
    content: counter(quickstep);
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: #fff;
    font-weight: bold;
    font-size: 0.8em;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scout / NPC location cards */
.scout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 10px 0 16px 0;
}
.scout-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.scout-card .scout-name {
    color: var(--highlight);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.05em;
}
.scout-thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}
.scout-thumbs img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: zoom-in;
    transition: transform 0.15s, opacity 0.15s;
}
.scout-thumbs img:hover { transform: scale(1.04); opacity: 0.9; }
.scout-thumb-label {
    font-size: 0.7em;
    color: #aaa;
    text-transform: uppercase;
    margin-top: 2px;
}
.scout-desc { font-size: 0.85em; color: #ddd; text-align: left; }

/* Rewards */
.reward-list {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 18px 0;
}
.reward-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(120,53,15,0.25);
    font-size: 0.92em;
}
.reward-list li:last-child { border-bottom: none; }
.reward-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gem-slot);
    border: 1px solid var(--highlight);
    border-radius: 4px;
    color: var(--highlight);
    font-size: 0.85em;
    flex-shrink: 0;
}
.reward-list a { color: var(--highlight); text-decoration: none; }
.reward-list a:hover { text-decoration: underline; }

/* Item reward card (reused for the Guard Cloak style item) */
.item-reward-card {
    border: 2px solid var(--border-color);
    margin: 10px 0 18px 0;
    padding: 18px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
}
.item-reward-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.item-reward-header img {
    width: 30px;
    height: 30px;
    cursor: zoom-in;
}
.item-reward-header .item-name {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--highlight);
}
.item-reward-header .item-slot { color: #888; font-size: 0.85em; }

.stat-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.85em;
}
.stat-table th, .stat-table td {
    padding: 5px;
    border: 1px solid #444;
}
.stat-table th { background: rgba(255,255,255,0.05); font-weight: bold; }
.stat-section-title {
    font-size: 0.85em;
    font-weight: bold;
    margin: 10px 0 4px 0;
}
.stat-section-title.combat { color: #fbbf24; }
.stat-section-title.profession { color: #10a1fa; }
.stat-section-title.defence { color: #71E6F5; }
.stat-section-title.economy { color: #00FF36; }
.item-flavor {
    color: #4ade80;
    font-style: italic;
    font-size: 0.9em;
    margin-top: 6px;
}

/* Boss encounter card (matches enemies.css layout) */
.boss-card {
    border: 2px solid var(--danger);
    background: rgba(231, 76, 60, 0.06);
    margin: 10px 0 18px 0;
    padding: 18px;
    border-radius: 8px;
}
.boss-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.boss-header img {
    width: 120px;
    border-radius: 4px;
    border: 1px solid #444;
    cursor: zoom-in;
    flex-shrink: 0;
}
.boss-header .boss-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--danger);
}
.boss-header .boss-level { color: #888; }
.boss-mechanics {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(120,53,15,0.4);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 0.85em;
}
.boss-mechanics h4 { margin: 8px 0 4px 0; color: var(--highlight); }

.tip-box {
    background: rgba(180, 83, 9, 0.12);
    border-left: 3px solid var(--gold);
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
    font-size: 0.9em;
    color: #ffd8a8;
}
.warn-box {
    background: rgba(231, 76, 60, 0.12);
    border-left: 3px solid var(--danger);
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
    font-size: 0.9em;
    color: #f5b7b1;
}

/* --- LIGHTBOX --- */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    cursor: default;
}
.lightbox-close {
    position: absolute;
    top: 18px;
    right: 24px;
    font-size: 2em;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* --- HAMBURGER --- */
.hamburger {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 200;
    background: var(--gem-slot);
    border: 2px solid var(--highlight);
    color: var(--highlight);
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.hamburger-left { top: 64px; }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 140;
}
.nav-overlay.open { display: block; }

/* --- THEMED SCROLLBARS --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--gold); }

/* --- RESPONSIVE --- */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .hamburger-left { display: flex; }
    .hamburger { display: flex; }
    .main-content { margin-right: 0; }
    .sidebar-left {
        position: fixed;
        top: 0;
        left: 0;
        width: 80vw;
        max-width: 300px;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 150;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }
    .sidebar-left.open { transform: translateX(0); }
    .sidebar-right {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 75vw;
        max-width: 300px;
        height: 100vh;
        z-index: 150;
    }
    .sidebar-right.open { display: flex; }
}

@media (max-width: 900px) {
    body { overflow: auto; height: auto; }
    .page-wrapper { flex-direction: column; height: auto; overflow: visible; }
    .sidebar-left { max-height: none; }
    .main-content { height: auto; overflow: visible; padding: 60px 16px 16px; }
    .quest-card { padding: 14px; margin-bottom: 14px; }
    .boss-header img { width: 90px; }
}

@media (max-width: 600px) {
    .main-content { padding: 64px 6px 10px; }
    .main-content h1 { font-size: 1.3em; }
    .quest-card { padding: 10px; }
    .nav-btn { font-size: 0.82em; padding: 5px 8px; }
    .quest-banner h2 { font-size: 1.3em; }
    .quest-giver-img { width: 52px; height: 52px; }
    .boss-header { flex-direction: column; align-items: center; text-align: center; }
    .boss-header .boss-name { font-size: 1.05em; }
    .scout-thumbs img { width: 80px; height: 80px; }
}

@media (max-width: 420px) {
    .stat-table { font-size: 0.78em; }
    .quest-giver-img { width: 44px; height: 44px; }
    .quest-giver-block { gap: 10px; }
    .item-reward-header img { width: 26px; height: 26px; }
    .boss-header img { width: 90px; }
    .scout-thumbs { flex-direction: column; align-items: center; }
    .scout-thumbs img { width: 100px; height: 100px; }
    .quest-tag { font-size: 0.68em; padding: 2px 6px; }
    .step-block { padding: 10px 12px; }
}

/* ======================================================================
   SITE-WIDE VISUAL UNIFICATION
   Brings this page's background in line with the rest of the Winds of
   Valen wiki (background art) without altering any existing structure,
   classes, or JS-driven behaviour (hamburgers, .open/.active toggles).
   ====================================================================== */

body {
    background-color: #0b0704;
    background-image:
        linear-gradient(rgba(5, 3, 1, 0.72), rgba(5, 3, 1, 0.72)),
        url('https://clan.fastly.steamstatic.com/images/45839267/03b12df3673aa383564485d8a8a5df92c57bc7a9.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
}
