:root {
    --bg-dark: #121212;
    --window-bg: #e8dbc3;
    --sidebar-bg: #dccaa5;
    --border-color: #4a3b2a;
    --gold-accent: #b89548;
    --ink: #2b2018;
    --ink-muted: #665243;
    --tab-bg: #3d2f24;
    --tab-text: #a89582;
    --tab-hover: #4f3d2f;
    --r-common: #a0a0a0;
    --r-uncommon: #3bd26f;
    --r-rare: #0070dd;
    --r-epic: #a335ee;
    --r-legendary: #ff8000;
    --font-title: "Cinzel", serif;
    --font-body: "Lato", sans-serif;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at center, #1f1f1f 0%, #050505 100%);
    color: var(--ink);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

.layout-anchor {
    position: relative;
    width: 1200px;
    height: calc(94vh - 73px);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px auto 0;
}

.main-window {
    width: 100%;
    height: 100%;
    background: var(--window-bg);
    border: 6px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 0 0 2px #2a2118, 0 30px 80px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 20;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="3" stitchTiles="stitch"/></filter><rect width="200" height="200" filter="url(%23n)" opacity="0.04"/></svg>');
}

/* Nav bar */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 40px;
    background: var(--tab-bg);
    border-bottom: 3px solid #2a2118;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(0,0,0,0.2));
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}
.nav-bar a {
    color: var(--tab-text);
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 0.95rem;
    padding: 6px 16px;
    border-radius: 4px;
    transition: all 0.2s;
}
.nav-bar a:hover { background: var(--tab-hover); color: #dccaa5; }
.nav-bar a.active { color: var(--gold-accent); font-weight: 700; }
.nav-title {
    color: var(--gold-accent);
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.nav-bar a.nav-title { color: var(--gold-accent); font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; padding: 0; background: none; }
.nav-bar a.nav-title:hover { background: none; color: #dccaa5; }

/* Header */
.content-header {
    padding: 30px 50px 20px 50px;
    border-bottom: 2px solid rgba(74, 59, 42, 0.1);
    background: rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.content-header h1 {
    font-family: var(--font-title);
    margin: 0;
    font-size: 2.4rem;
    color: #2b1b00;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

/* Filters */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}
.filter-btn {
    font-family: var(--font-title);
    font-size: 0.8rem;
    padding: 5px 14px;
    border: 1px solid rgba(74, 59, 42, 0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.3);
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.6); }
.filter-btn.active {
    background: var(--tab-bg);
    color: var(--gold-accent);
    border-color: var(--tab-bg);
}

/* Scroll area */
.scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px 50px;
}
.scroll-container::-webkit-scrollbar { width: 10px; }
.scroll-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); }
.scroll-container::-webkit-scrollbar-thumb {
    background: #c4b08b;
    border: 2px solid var(--window-bg);
    border-radius: 6px;
}

/* Timeline */
.day-group {
    margin-bottom: 30px;
}
.day-header {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: #2b1b00;
    border-bottom: 2px solid rgba(74, 59, 42, 0.12);
    padding-bottom: 6px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.day-count {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--ink-muted);
}

.tl-line {
    position: relative;
    padding-left: 40px;
}
.tl-line::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(74, 59, 42, 0.15);
}

.tl-entry {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    margin-bottom: 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.35);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    transition: background 0.2s;
}
.tl-entry:hover {
    background: rgba(255,255,255,0.65);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Dot on timeline */
.tl-entry::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--window-bg);
}
.tl-entry.r-common::before { background: var(--r-common); }
.tl-entry.r-uncommon::before { background: var(--r-uncommon); }
.tl-entry.r-rare::before { background: var(--r-rare); }
.tl-entry.r-epic::before { background: var(--r-epic); }
.tl-entry.r-legendary::before { background: var(--r-legendary); }

.tl-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold-accent);
    object-fit: cover;
    background: #000;
    flex-shrink: 0;
}

.tl-icon {
    width: 44px;
    height: 44px;
    background: #2a2118;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-icon img {
    width: 40px;
    height: 40px;
    border-radius: 2px;
}

.tl-info {
    flex: 1;
    min-width: 0;
}
.tl-ach-name {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.95rem;
}
.tl-flavor {
    font-size: 0.8rem;
    color: var(--ink-muted);
    font-style: italic;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tl-user {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-top: 2px;
}

.tl-right {
    text-align: right;
    flex-shrink: 0;
    min-width: 80px;
}
.tl-points {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.1rem;
}
.tl-time {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: 2px;
}

.rarity-tag {
    font-size: 0.65rem;
    font-family: var(--font-title);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.06);
}

.tl-entry.is-loot {
    border-left: 4px solid rgba(184, 149, 72, 0.55);
    background: rgba(184, 149, 72, 0.10);
}

.tl-entry.is-loot:hover {
    background: rgba(184, 149, 72, 0.18);
}

.tl-loot-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    font-family: var(--font-title);
    color: #2a1c00;
    background: rgba(184, 149, 72, 0.45);
    border: 1px solid rgba(74, 59, 42, 0.35);
    vertical-align: middle;
}

.tl-ach-name-loot {
    font-weight: 900;
}

.tl-points-loot {
    letter-spacing: 0.8px;
}

.tl-entry.is-quest {
    border-left: 4px solid rgba(76, 175, 80, 0.55);
    background: rgba(76, 175, 80, 0.10);
}

.tl-entry.is-quest:hover {
    background: rgba(76, 175, 80, 0.18);
}

.tl-quest-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    font-family: var(--font-title);
    color: #1a3a1a;
    background: rgba(76, 175, 80, 0.45);
    border: 1px solid rgba(74, 59, 42, 0.35);
    vertical-align: middle;
}

.tl-ach-name-quest {
    font-weight: 700;
}

.tl-points-quest {
    letter-spacing: 0.6px;
}.loader {
    text-align: center;
    padding: 60px;
    color: var(--ink-muted);
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--ink-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        overflow: auto;
        align-items: flex-start;
    }
    .layout-anchor {
        width: 100%;
        height: auto;
        min-height: 100vh;
    }
    .main-window {
        border: none;
        border-radius: 0;
        box-shadow: none;
        height: auto;
        min-height: 100vh;
    }

    /* Nav bar */
    .nav-bar {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .nav-title { font-size: 0.9rem; }
    .nav-bar a { font-size: 0.8rem; padding: 4px 10px; }

    /* Header */
    .content-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .content-header h1 { font-size: 1.5rem; }

    /* Filter bar */
    .filter-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .filter-btn {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    /* Scroll area */
    .scroll-container {
        padding: 15px 12px;
    }

    /* Timeline entries */
    .tl-line {
        padding-left: 25px;
    }
    .tl-line::before {
        left: 8px;
    }
    .tl-entry {
        gap: 10px;
        padding: 8px 10px;
    }
    .tl-entry::before {
        left: -22px;
        width: 8px;
        height: 8px;
    }

    /* Hide avatar on mobile to save space */
    .tl-avatar {
        width: 28px;
        height: 28px;
    }

    .tl-icon {
        width: 36px;
        height: 36px;
    }
    .tl-icon img {
        width: 32px;
        height: 32px;
    }

    .tl-ach-name { font-size: 0.82rem; }
    .tl-flavor {
        font-size: 0.7rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .tl-user { font-size: 0.72rem; }

    .tl-right { min-width: 50px; }
    .tl-points { font-size: 0.9rem; }
    .tl-time { font-size: 0.65rem; }

    /* Day header */
    .day-header { font-size: 0.9rem; }
    .day-count { font-size: 0.7rem; }

    /* Tooltip mobile */
    .tt {
        position: fixed;
        top: auto !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%);
        max-width: 280px;
    }
}


