/* ── Reset & base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #1a1a1a;
    font-family: Courier, monospace;
    color: #ccc;
    min-height: 100vh;
}

a {
    color: #aaa;
    text-decoration: none;
}

a:visited {
    color: #888;
}

/* ── Page wrapper ── */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar (left) ── */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background-color: #111;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 20px;
    border-bottom: 1px solid #222;
    margin-bottom: 10px;
    color: #eee;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.sidebar-brand img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
}

.nav-group-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #555;
    padding: 14px 16px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #999;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.nav-link img {
    width: 22px;
    height: 22px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: #1e1e1e;
    border-left-color: #555;
    color: #eee;
    cursor: pointer;
}

.nav-link.active {
    background-color: #1e1e1e;
    border-left-color: #888;
    color: #eee;
}

/* ── Mobile toggle button ── */
.sidebar-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background-color: #111;
    color: #aaa;
    border: none;
    border-bottom: 1px solid #2a2a2a;
    font-family: Courier, monospace;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    letter-spacing: 0.05em;
}

.sidebar-toggle:hover {
    background-color: #1e1e1e;
}

/* ── Main content (right) ── */
.content-area {
    flex: 1 1 0;
    min-width: 0;
    padding: 28px 32px;
    background-color: #1a1a1a;
}

.page-title {
    font-size: 1.4rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #eee;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a2a;
}

.content-card {
    background-color: #111;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 16px;
    color: #bbb;
    line-height: 1.6;
}

.content-card h2 {
    font-size: 1rem;
    color: #eee;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Stat cards grid ── */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

/* ── Pet icon ── */
.pet-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    image-rendering: pixelated;
}

/* ── Stat card ── */
.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #111;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 18px 22px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.stat-card-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.stat-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.stat-card-name {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
}

.stat-card-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #eee;
}

/* ── Difficulty badges ── */
.diff-badge {
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
}
.diff-baby     { background-color: #2a2a2a; color: #666; }
.diff-easy     { background-color: #1a2e1a; color: #5a9e5a; }
.diff-medium   { background-color: #2e2a10; color: #b89030; }
.diff-hard     { background-color: #2e1a0a; color: #c06030; }
.diff-elite    { background-color: #1e1030; color: #9060d0; }
.diff-champion { background-color: #2e2800; color: #c8a020; border: 1px solid #6a5000; }

/* ── Achievement summary ── */
.ach-summary {
    margin-bottom: 14px;
    font-size: 0.9rem;
}

/* ── Quest / status colours ── */
.quest-complete    { color: #5a9e5a; font-weight: bold; }
.quest-in-progress { color: #b89030; font-weight: bold; }
.quest-not-started { color: #555; }

.stat-card.quest-complete    { border-color: #1e3e1e; background-color: #141e14; }
.stat-card.quest-in-progress { border-color: #3e3800; background-color: #1e1c00; }

/* ── Search form ── */
.search-card {
    max-width: 480px;
}

.search-form {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1 1 180px;
    padding: 10px 12px;
    background-color: #181818;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ccc;
    font-family: Courier, monospace;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

.search-input::placeholder {
    color: #555;
}

.search-input:focus {
    border-color: #666;
}

.search-btn {
    padding: 10px 20px;
    background-color: #222;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ccc;
    font-family: Courier, monospace;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.search-btn:hover {
    background-color: #2a2a2a;
    border-color: #555;
}

.search-again {
    margin-top: 16px;
    font-size: 0.85rem;
}

.search-again a {
    color: #666;
}

.search-again a:hover {
    color: #aaa;
}

/* ── Responsive ── */
@media (max-width: 680px) {
    .page-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #2a2a2a;
        padding: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-nav {
        display: none;
        flex-direction: column;
    }

    .sidebar-nav.open {
        display: flex;
    }

    .sidebar-brand {
        display: none;
    }

    .content-area {
        padding: 16px;
    }
}
