:root {
    --color-bg: #0b0d12;
    --color-bg-elevated: #0f1218;
    --color-surface: #151923;
    --color-surface-alt: #1c2230;
    --color-surface-hover: #202739;
    --color-border: #262d3d;
    --color-border-soft: #1e2432;
    --color-text: #eef0f6;
    --color-text-muted: #8992a8;
    --color-text-faint: #5b6478;

    /* Main/accent/secondary are the three user-tunable brand colors (see
       Profile -> Theme). Every other token below derives from these three
       plus the dark/light surface set, so a user's picks propagate through
       buttons, gradients, badges and the nav brand without per-component
       overrides. */
    --color-primary: #6366f1;
    --color-primary-hover: #7880f5;
    --color-primary-soft: rgba(99, 102, 241, 0.14);
    --color-accent: #22d3ee;
    --color-accent-soft: rgba(34, 211, 238, 0.14);
    --color-secondary: #ec4899;
    --color-secondary-soft: rgba(236, 72, 153, 0.14);

    --color-danger: #f0596b;
    --color-danger-soft: rgba(240, 89, 107, 0.13);
    --color-success: #34d399;
    --color-success-soft: rgba(52, 211, 153, 0.13);
    --color-warning: #f5b862;
    --color-warning-soft: rgba(245, 184, 98, 0.13);
    --color-pink: #ff5ca8;
    --color-pink-soft: rgba(255, 92, 168, 0.13);
    --color-orange: #ff9257;
    --color-orange-soft: rgba(255, 146, 87, 0.13);

    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    --gradient-hero: linear-gradient(120deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);

    --font-heading: "Lexend", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --header-height: 64px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 48px -16px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 8px 24px -6px rgba(99, 102, 241, 0.35);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    --header-bg: rgba(15, 18, 24, 0.78);
    --header-bg-solid: rgba(15, 18, 24, 0.97);
}

/* Light mode — same token names, inverted surface/text/shadow scale. The
   three brand colors (primary/accent/secondary) and status colors stay as
   set above; only the neutral scale flips, so a user's custom palette looks
   right in either mode without being defined twice. */
:root[data-theme="light"] {
    --color-bg: #f4f5f9;
    --color-bg-elevated: #ffffff;
    --color-surface: #ffffff;
    --color-surface-alt: #eef0f6;
    --color-surface-hover: #e5e8f1;
    --color-border: #dde1eb;
    --color-border-soft: #e8eaf2;
    --color-text: #14161f;
    --color-text-muted: #565f74;
    --color-text-faint: #8992a8;

    --shadow-sm: 0 1px 2px rgba(20, 22, 31, 0.06);
    --shadow-md: 0 8px 24px -10px rgba(20, 22, 31, 0.16);
    --shadow-lg: 0 20px 48px -18px rgba(20, 22, 31, 0.22);

    --header-bg: rgba(255, 255, 255, 0.78);
    --header-bg-solid: rgba(255, 255, 255, 0.97);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Background presets (Profile -> Background) — pure CSS, no images, so
   there's nothing to upload/store beyond the chosen preset's name. */

body.bg-default {
    background:
        radial-gradient(1100px 480px at 12% -10%, var(--color-primary-soft), transparent 60%),
        radial-gradient(900px 420px at 100% 0%, var(--color-accent-soft), transparent 55%),
        var(--color-bg);
    background-attachment: fixed;
}

body.bg-nebula {
    background:
        radial-gradient(900px 600px at 15% 0%, var(--color-secondary-soft), transparent 55%),
        radial-gradient(800px 500px at 85% 20%, var(--color-primary-soft), transparent 55%),
        radial-gradient(700px 700px at 50% 100%, var(--color-accent-soft), transparent 60%),
        var(--color-bg);
    background-attachment: fixed;
}

body.bg-cyber-grid {
    background-image:
        linear-gradient(var(--color-border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-border-soft) 1px, transparent 1px),
        radial-gradient(1000px 500px at 50% -10%, var(--color-primary-soft), transparent 60%);
    background-size: 42px 42px, 42px 42px, 100% 100%;
    background-color: var(--color-bg);
    background-attachment: fixed;
}

body.bg-aurora {
    background:
        radial-gradient(60% 40% at 20% 0%, var(--color-accent-soft), transparent 60%),
        radial-gradient(50% 40% at 80% 10%, var(--color-secondary-soft), transparent 60%),
        radial-gradient(60% 50% at 50% 100%, var(--color-primary-soft), transparent 60%),
        var(--color-bg);
    background-attachment: fixed;
    animation: aurora-drift 18s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    from { background-position: 0% 0%, 100% 0%, 50% 100%; }
    to { background-position: 10% 5%, 90% 10%, 55% 95%; }
}

body.bg-bloodmoon {
    background:
        radial-gradient(700px 500px at 50% -5%, rgba(240, 89, 107, 0.16), transparent 60%),
        radial-gradient(900px 600px at 50% 110%, rgba(0, 0, 0, 0.5), transparent 60%),
        var(--color-bg);
    background-attachment: fixed;
}

body.bg-matrix {
    background-image:
        repeating-linear-gradient(0deg, var(--color-success-soft) 0px, transparent 1px, transparent 26px),
        radial-gradient(1000px 600px at 50% -10%, var(--color-success-soft), transparent 65%);
    background-color: var(--color-bg);
    background-attachment: fixed;
}

body.bg-sunset {
    background:
        radial-gradient(900px 500px at 20% -5%, rgba(251, 146, 60, 0.22), transparent 60%),
        radial-gradient(800px 500px at 85% 15%, rgba(236, 72, 153, 0.2), transparent 55%),
        radial-gradient(700px 600px at 50% 110%, rgba(139, 92, 246, 0.18), transparent 60%),
        var(--color-bg);
    background-attachment: fixed;
}

body.bg-ocean {
    background:
        radial-gradient(900px 550px at 15% -10%, rgba(34, 211, 238, 0.2), transparent 60%),
        radial-gradient(800px 500px at 90% 10%, rgba(59, 130, 246, 0.18), transparent 55%),
        radial-gradient(900px 600px at 50% 115%, rgba(13, 148, 136, 0.16), transparent 60%),
        var(--color-bg);
    background-attachment: fixed;
}

body.bg-forest {
    background:
        radial-gradient(800px 500px at 20% -5%, rgba(52, 211, 153, 0.16), transparent 60%),
        radial-gradient(900px 600px at 80% 110%, rgba(0, 0, 0, 0.5), transparent 65%),
        var(--color-bg);
    background-attachment: fixed;
}

body.bg-monochrome {
    background:
        radial-gradient(1000px 550px at 50% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
        var(--color-bg);
    background-attachment: fixed;
}

/* --most-played-bg is set inline per-request (app/Views/layout/app.php) —
   the user's own most-played Steam game's hero art. The dark scrim keeps
   page text readable over any art, same purpose as the other presets'
   translucent overlays. */
body.bg-most_played {
    background:
        linear-gradient(180deg, rgba(11, 13, 18, 0.55) 0%, rgba(11, 13, 18, 0.86) 55%, var(--color-bg) 100%),
        var(--most-played-bg, none) center 18% / cover no-repeat,
        var(--color-bg);
    background-attachment: fixed;
}

::selection {
    background: rgba(99, 102, 241, 0.35);
    color: var(--color-text);
}

a {
    color: var(--color-primary-hover);
    text-decoration: none;
    transition: color 0.15s var(--ease);
}

a:hover {
    color: var(--color-accent);
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin: 0 0 16px;
    color: var(--color-text);
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p {
    color: var(--color-text-muted);
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 24px 72px;
}

/* Header / navigation */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--color-border-soft);
}

.site-header__bar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px;
}

.site-header__brand {
    flex-shrink: 0;
    white-space: nowrap;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-header__brand:hover {
    filter: brightness(1.15);
}

/* Guest (logged-out) header — deliberately separate from .site-nav's
   JS-driven mobile dropdown, since it's short enough to just wrap instead. */

.guest-nav {
    flex-wrap: wrap;
    row-gap: 8px;
}

.guest-nav__links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.guest-nav__links > a:not(.btn) {
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.guest-nav__links > a:not(.btn):hover {
    color: var(--color-text);
    background: var(--color-surface-alt);
}

.guest-nav__links > a.active:not(.btn) {
    color: var(--color-text);
    background: var(--color-primary-soft);
}

@media (max-width: 480px) {
    .guest-nav {
        height: auto;
        padding: 14px 20px;
    }
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1px;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: block;
    white-space: nowrap;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.site-nav a:hover {
    color: var(--color-text);
    background: var(--color-surface-alt);
}

.site-nav a.active {
    color: var(--color-text);
    background: var(--color-primary-soft);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown summary {
    display: block;
    white-space: nowrap;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary:hover,
.nav-dropdown[open] summary {
    color: var(--color-text);
    background: var(--color-surface-alt);
}

.nav-dropdown summary.active {
    color: var(--color-text);
    background: var(--color-primary-soft);
}

.nav-dropdown > ul {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    flex-direction: column;
    background: var(--header-bg-solid);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 4px;
    min-width: 180px;
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.2));
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    /* Was overflow-x: auto (with a hidden scrollbar) from when this row held
       18 flat links. Grouping most of them into the Collections/Steam
       dropdowns shrank it enough that horizontal scrolling is no longer
       needed — and overflow-x: auto also forces overflow-y to clip, which
       would cut off the dropdown panels below their <summary>. */
    overflow: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.site-nav::-webkit-scrollbar {
    display: none;
}

.site-nav ul {
    flex-shrink: 0;
}

.site-nav__logout {
    flex-shrink: 0;
}

.site-nav__logout button {
    background: none;
    border: none;
    white-space: nowrap;
    color: var(--color-text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.site-nav__logout button:hover {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}

/* App shell — sidebar navigation (authed pages only; guest pages keep .site-header) */

.app-shell {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

.app-shell__main {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-soft);
    box-shadow: 6px 0 24px -12px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
}

.sidebar__brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--color-border-soft);
    margin-bottom: 8px;
}

.sidebar__brand {
    white-space: nowrap;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    background: var(--gradient-hero);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: brand-shimmer 6s ease-in-out infinite;
}

@keyframes brand-shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.sidebar__nav {
    flex: 1;
    padding: 0 12px;
}

.sidebar__list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__list a {
    position: relative;
    display: block;
    padding: 9px 11px 9px 15px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}

.sidebar__list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 60%;
    border-radius: 2px;
    background: var(--gradient-accent);
    transform: translateY(-50%) scaleY(0);
    transition: transform 0.18s var(--ease);
}

.sidebar__list a:hover {
    color: var(--color-text);
    background: var(--color-surface-alt);
    transform: translateX(2px);
}

.sidebar__list a:hover::before {
    transform: translateY(-50%) scaleY(0.6);
}

.sidebar__list a.active {
    color: var(--color-text);
    font-weight: 600;
    background: linear-gradient(90deg, var(--color-primary-soft), transparent);
}

.sidebar__list a.active::before {
    transform: translateY(-50%) scaleY(1);
    box-shadow: 0 0 10px 1px var(--color-primary-soft);
}

.sidebar__section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-faint);
    padding: 10px 11px 4px;
    margin: 0;
}

.sidebar__section-label::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gradient-accent);
    flex-shrink: 0;
}

.sidebar__profile {
    border-top: 1px solid var(--color-border-soft);
    padding: 12px;
    flex-shrink: 0;
}

.sidebar__profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s var(--ease);
}

.sidebar__profile-link:hover,
.sidebar__profile-link.active {
    background: var(--color-surface-alt);
}

.sidebar__profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar__profile-info strong {
    font-size: 0.85rem;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__profile-info small {
    font-size: 0.72rem;
    color: var(--color-text-faint);
}

.sidebar__logout {
    width: 100%;
    margin-top: 8px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px;
    color: var(--color-text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.sidebar__logout:hover {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: var(--color-danger-soft);
}

.mobile-topbar {
    display: none;
}

/* Stat grid (dashboard) */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin: 24px 0 32px;
}

.stat-card {
    position: relative;
    background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-bg-elevated) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: var(--shadow-md);
}

.stat-card__value {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.stat-card__label {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Dashboard redesign — top bar, summary cards, 2-col panel grids, donut chart, quick actions */

.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dash-topbar__search {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}

.dash-topbar__search input {
    flex: 1;
}

.dash-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-topbar__steam-status {
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-success-soft);
    background: var(--color-success-soft);
    color: var(--color-success);
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.dash-topbar__steam-status i {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

/* Summary cards — 6 across, icon + real count + real "N this month" delta */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}

.summary-card:hover {
    transform: translateY(-2px);
    background: var(--color-surface-alt);
}

.summary-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.summary-title {
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.summary-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.summary-icon.c-purple { background: var(--color-primary-soft); color: var(--color-primary); }
.summary-icon.c-cyan { background: var(--color-accent-soft); color: var(--color-accent); }
.summary-icon.c-pink { background: var(--color-pink-soft); color: var(--color-pink); }
.summary-icon.c-yellow { background: var(--color-warning-soft); color: var(--color-warning); }
.summary-icon.c-green { background: var(--color-success-soft); color: var(--color-success); }
.summary-icon.c-orange { background: var(--color-orange-soft); color: var(--color-orange); }

.summary-number {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.summary-change {
    color: var(--color-success);
    font-size: 0.68rem;
    margin-top: 5px;
}

.summary-change--muted {
    color: var(--color-text-faint);
}

/* Two-column panel grids */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.dashboard-grid-wide {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dash-card-subtitle {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    margin-top: 3px;
}

/* Recent Additions / Steam Library rows */

.dash-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.dash-recent-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-soft);
}

.dash-recent-list li:last-child {
    border-bottom: none;
}

.dash-recent-list img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.dash-recent-list__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.dash-recent-list__info strong {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-recent-list__info small {
    color: var(--color-text-faint);
    font-size: 0.72rem;
}

.dash-recent-list__value {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Collection Overview donut — conic-gradient, degrees computed inline from real percentages */

.overview {
    display: flex;
    align-items: center;
    gap: 28px;
}

.donut {
    width: 145px;
    height: 145px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.donut::after {
    content: "";
    position: absolute;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--color-surface);
    left: 26px;
    top: 26px;
}

.donut-center {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.donut-total {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 750;
}

.donut-label {
    font-size: 0.6rem;
    color: var(--color-text-muted);
}

.legend {
    flex: 1;
    min-width: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 9px 0;
    font-size: 0.78rem;
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-value {
    font-weight: 700;
    white-space: nowrap;
}

/* Value Overview */

.value-number {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 6px 0 0;
}

/* Most Valuable Items (Wishlist Highlights' real substitute) */

.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.wish-card {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.wish-cover {
    height: 70px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    width: 100%;
    margin-bottom: 8px;
    display: block;
}

.wish-name {
    font-size: 0.75rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wish-price {
    color: var(--color-text-muted);
    font-size: 0.7rem;
    margin-top: 3px;
}

/* Collection Stats mini-grid */

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-box {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.stat-box-label {
    color: var(--color-text-muted);
    font-size: 0.68rem;
}

.stat-box-number {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 750;
    margin-top: 6px;
}

/* Quick Actions */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.quick-action {
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    padding: 13px;
    color: var(--color-text);
    text-decoration: none;
    display: block;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.quick-action:hover {
    border-color: var(--color-primary-soft);
    background: var(--color-surface-hover);
}

.quick-action__title {
    font-size: 0.78rem;
    font-weight: 650;
}

.quick-action__desc {
    color: var(--color-text-muted);
    font-size: 0.68rem;
    margin-top: 3px;
}

@media (max-width: 1400px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .dashboard-grid,
    .dashboard-grid-wide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 750px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wishlist-grid,
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Acquisitions — real spending-by-month bar chart, plain CSS, no library */

.spend-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 140px;
    margin-top: 12px;
    padding: 0 4px;
    border-bottom: 1px solid var(--color-border);
}

.spend-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.spend-bar {
    width: 100%;
    max-width: 32px;
    min-height: 2px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: linear-gradient(to top, var(--color-primary), var(--color-accent));
}

.spend-bar__label {
    margin-top: 6px;
    font-size: 0.66rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Cards (catalogue / collection / steam) */

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.game-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-primary-soft), 0 12px 32px -8px var(--color-primary-soft);
}

.game-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: var(--color-surface-alt);
    display: block;
    transition: transform 0.35s var(--ease);
}

.game-card:hover img {
    transform: scale(1.06);
}

.game-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.game-card__body strong {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
}

.game-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.game-card__no-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    background:
        linear-gradient(160deg, var(--color-surface-alt) 0%, var(--color-bg-elevated) 100%);
    color: var(--color-text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    text-align: center;
    padding: 12px;
}

.game-card__meta {
    font-size: 0.83rem;
    color: var(--color-text-muted);
}

/* Discover section */

.discover__header {
    margin-bottom: 18px;
}

.discover__header h2 {
    margin-bottom: 4px;
}

#discoverLoadMore[disabled] {
    opacity: 0.6;
    cursor: wait;
}

/* Search form (catalogue) */

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 32px;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius);
    padding: 11px 14px;
    font: inherit;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.search-form select {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius);
    padding: 11px 14px;
    font: inherit;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Pagination */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
}

.pagination__page {
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

/* Game details */

.game-details {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 36px;
    margin-top: 20px;
}

.game-details__cover img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.game-details__list {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px 16px;
    margin: 20px 0;
}

.game-details__list dt {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-details__list dd {
    margin: 0;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gallery img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: transform 0.2s var(--ease);
}

.gallery img:hover {
    transform: scale(1.03);
}

.trailer-carousel {
    margin-top: 16px;
}

.trailer-carousel__track {
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.trailer-carousel__slide video {
    display: block;
    width: 100%;
    max-height: 480px;
    background: #000;
}

.trailer-carousel__caption {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.trailer-carousel__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
}

.trailer-carousel__counter {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Store links (sidebar) */

.store-links {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.store-links h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.store-links__item {
    width: 100%;
    justify-content: flex-start;
}

/* System requirements */

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 16px 0;
}

.requirements-col {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
}

.requirements-col h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.requirements-col p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}

/* Achievements */

.achievement-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.achievement-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px;
}

.achievement-item img,
.achievement-item__no-image {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.achievement-item__no-image {
    background: var(--color-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.achievement-item__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.achievement-item__percent {
    font-size: 0.78rem;
    color: var(--color-accent);
    font-weight: 600;
}

/* DLC / series (related games) */

.related-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.related-game {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--color-text);
}

.related-game img,
.related-game .game-card__no-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.related-game:hover img,
.related-game:hover .game-card__no-image {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.related-game span {
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .game-details {
        grid-template-columns: 1fr;
    }

    .game-details__cover {
        max-width: 240px;
    }

    .requirements-grid {
        grid-template-columns: 1fr;
    }
}

/* Panels / sections */

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.panel__hint {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    margin-top: -8px;
}

/* Forms */

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
}

.form-inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    max-width: none;
}

.form label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.form input,
.form select,
.form textarea {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius);
    padding: 11px 14px;
    font: inherit;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    color: var(--color-text);
    border-radius: var(--radius);
    padding: 10px 18px;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.12s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.btn:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.55);
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 20px -4px rgba(99, 102, 241, 0.65);
}

.btn-danger {
    color: var(--color-danger);
}

.btn-danger:hover {
    border-color: var(--color-danger);
    background: var(--color-danger-soft);
}

.btn-small {
    padding: 7px 12px;
    font-size: 0.82rem;
}

/* Alerts */

.alert {
    padding: 13px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.alert-error {
    background: var(--color-danger-soft);
    border: 1px solid rgba(240, 89, 107, 0.4);
    color: #ff8a97;
}

.alert-success {
    background: var(--color-success-soft);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: var(--color-success);
}

/* Empty states */

.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

/* Auth pages */

.page-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(900px 500px at 50% 0%, rgba(99, 102, 241, 0.16), transparent 60%),
        radial-gradient(700px 400px at 100% 100%, rgba(34, 211, 238, 0.08), transparent 55%),
        var(--color-bg);
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: none;
    -webkit-text-fill-color: initial;
}

.auth-card h2 {
    margin-bottom: 22px;
    font-size: 1.5rem;
}

.auth-card__footer {
    margin-top: 18px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

/* Platform list */

.platform-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.platform-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px 16px;
    transition: border-color 0.15s var(--ease);
}

.platform-list li:hover {
    border-color: var(--color-border);
    background: var(--color-surface-hover);
}

.platform-list small {
    color: var(--color-text-muted);
}

/* Modals */

dialog {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 26px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

dialog::backdrop {
    background: rgba(5, 6, 10, 0.72);
    backdrop-filter: blur(2px);
}

dialog h2 {
    margin-top: 0;
}

dialog .form {
    max-width: none;
}

dialog .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

/* Ownership badges */

.badge-owned {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--color-success);
    margin: 4px 0;
}

.badge-owned__platform {
    background: var(--color-success-soft);
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 0.78rem;
}

/* Achievement progress bar */

.achievement-bar {
    height: 6px;
    background: var(--color-surface-alt);
    border-radius: 999px;
    overflow: hidden;
    margin: 3px 0;
}

.achievement-bar__fill {
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 999px;
}

/* Backlog */

.backlog-tiles {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 20px 0 24px;
}

.backlog-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--color-text);
    transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.backlog-tile:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--color-text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.backlog-tile.active {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.backlog-tile__value {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--color-text);
}

.backlog-tile__label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge,
.priority-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.status-badge--not_played { background: rgba(137, 146, 168, 0.14); color: var(--color-text-muted); border-color: var(--color-border); }
.status-badge--playing { background: var(--color-primary-soft); color: #a5a8f8; border-color: rgba(99, 102, 241, 0.4); }
.status-badge--completed { background: var(--color-success-soft); color: var(--color-success); border-color: rgba(52, 211, 153, 0.4); }
.status-badge--completed_100 { background: rgba(52, 211, 153, 0.28); color: var(--color-success); border-color: rgba(52, 211, 153, 0.55); }
.status-badge--on_hold { background: var(--color-warning-soft); color: var(--color-warning); border-color: rgba(245, 184, 98, 0.4); }
.status-badge--abandoned { background: var(--color-danger-soft); color: var(--color-danger); border-color: rgba(240, 89, 107, 0.4); }

.priority-badge--low { background: rgba(137, 146, 168, 0.14); color: var(--color-text-muted); border-color: var(--color-border); }
.priority-badge--normal { background: rgba(137, 146, 168, 0.14); color: var(--color-text-muted); border-color: var(--color-border); }
.priority-badge--high { background: var(--color-warning-soft); color: var(--color-warning); border-color: rgba(245, 184, 98, 0.4); }
.priority-badge--must_play { background: var(--color-danger-soft); color: var(--color-danger); border-color: rgba(240, 89, 107, 0.4); }

@media (max-width: 1024px) {
    .backlog-tiles {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .backlog-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Statistics */

.stat-grid--three {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
}

.stat-list {
    list-style: none;
    counter-reset: stat-list;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-list li {
    counter-increment: stat-list;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid var(--color-border-soft);
}

.stat-list li:last-child {
    border-bottom: none;
}

.stat-list li::before {
    content: counter(stat-list) '. ';
    color: var(--color-text-faint);
    font-weight: 600;
    margin-right: 6px;
}

.stat-list__value {
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.genre-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.genre-bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    align-items: center;
    gap: 10px;
}

.genre-bar-row__label {
    font-size: 0.88rem;
}

.genre-bar {
    height: 14px;
    background: var(--color-surface-alt);
    border-radius: 999px;
    overflow: hidden;
}

.genre-bar__fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 999px;
}

.genre-bar-row__value {
    text-align: right;
    color: var(--color-text-muted);
    font-size: 0.83rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
    .stat-grid--three {
        grid-template-columns: 1fr;
    }

    .genre-bar-row {
        grid-template-columns: 90px 1fr 50px;
    }
}

/* Game picker */

.picker-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin: 20px 0 12px;
}

.picker-filters__group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.picker-filters__group label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.picker-filters__group select {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius);
    padding: 10px 14px;
    font: inherit;
}

.pick-result {
    max-width: 320px;
    margin: 28px auto 0;
    text-align: center;
}

.pick-result__card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: left;
    box-shadow: var(--shadow-lg);
}

.pick-result__card img {
    width: 100%;
    display: block;
}

.pick-result__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pick-result__body strong {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-text);
}

.pick-result__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.pick-result__breakdown {
    margin-top: 18px;
    text-align: left;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.pick-result__breakdown summary {
    cursor: pointer;
    color: var(--color-text);
    font-weight: 600;
}

.pick-result__breakdown ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

/* Steam/TheGamesDB match candidates */

.match-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.match-option {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.match-option:hover {
    border-color: var(--color-border);
    background: var(--color-surface-hover);
}

.match-option:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.match-option img,
.match-option .game-card__no-image {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 0.6rem;
}

.match-option__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Guides & Tips (Fandom wiki content) — sanitized third-party HTML, styled
   to read like the rest of the app rather than like a wiki page. */

.guide-article__body {
    margin-top: 20px;
    line-height: 1.75;
}

.guide-article__body h2,
.guide-article__body h3,
.guide-article__body h4 {
    margin-top: 28px;
}

.guide-article__body p {
    margin: 0 0 14px;
}

.guide-article__body ul,
.guide-article__body ol {
    margin: 0 0 14px;
    padding-left: 22px;
    color: var(--color-text-muted);
}

.guide-article__body li {
    margin-bottom: 4px;
}

.guide-article__body a {
    text-decoration: underline;
}

.guide-article__body blockquote {
    margin: 0 0 14px;
    padding: 10px 16px;
    border-left: 3px solid var(--color-primary);
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
}

.guide-article__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 0.9rem;
}

.guide-article__body th,
.guide-article__body td {
    border: 1px solid var(--color-border);
    padding: 8px 10px;
    text-align: left;
}

.guide-article__body th {
    background: var(--color-surface-alt);
}

/* Collection page toolbar */

.collection-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 20px 0 12px;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0 12px;
}

.toolbar-row .collection-toolbar {
    margin: 0;
    flex: 1;
}

.collection-toolbar input[type="text"],
.collection-toolbar select {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius);
    padding: 10px 14px;
    font: inherit;
}

.collection-toolbar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 3px;
}

.view-toggle a {
    padding: 7px 14px;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid transparent;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.view-toggle a.active {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.collection-summary {
    color: var(--color-text-muted);
    margin: -8px 0 4px;
}

/* Collection list view */

.collection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.collection-list__row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.collection-list__row:hover {
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateX(2px);
}

.collection-list__row img,
.collection-list__row .game-card__no-image {
    width: 48px;
    height: 64px;
    aspect-ratio: auto;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 0.6rem;
}

.collection-list__info {
    flex: 1;
    min-width: 0;
}

.collection-list__info strong {
    display: block;
    font-weight: 600;
}

.collection-list__meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.collection-list__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Scrollbar polish (WebKit) */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-alt);
    border: 3px solid var(--color-bg);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border);
}

/* Responsive */

@media (max-width: 1024px) {
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--header-bg-solid);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 20px 20px;
        display: none;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav ul {
        flex-direction: column;
    }

    .nav-dropdown > ul {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 12px;
        min-width: 0;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform 0.2s var(--ease);
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
    }

    /* Lives outside .sidebar (app.php, not nav.php) so the button that opens
       the sidebar is never itself hidden along with it. */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 20;
        height: var(--header-height);
        padding: 0 20px;
        background: var(--header-bg-solid);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--color-border-soft);
    }

    .collection-list__row {
        flex-wrap: wrap;
    }

    .collection-list__actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   Avatars
   ========================================================================== */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--color-border);
}

.avatar--sm { width: 28px; height: 28px; font-size: 0.75rem; }
.avatar--md { width: 40px; height: 40px; font-size: 1rem; }
.avatar--lg { width: 96px; height: 96px; font-size: 2.4rem; border-width: 3px; }

.avatar--preset {
    font-size: 1.15em;
    line-height: 1;
}

.avatar--lg.avatar--preset {
    font-size: 2.6rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-tone-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); border-color: rgba(99, 102, 241, 0.4); }
.avatar-tone-2 { background: linear-gradient(135deg, #ec4899, #f97316); border-color: rgba(236, 72, 153, 0.4); }
.avatar-tone-3 { background: linear-gradient(135deg, #22d3ee, #6366f1); border-color: rgba(34, 211, 238, 0.4); }
.avatar-tone-4 { background: linear-gradient(135deg, #34d399, #22d3ee); border-color: rgba(52, 211, 153, 0.4); }
.avatar-tone-5 { background: linear-gradient(135deg, #f5b862, #ec4899); border-color: rgba(245, 184, 98, 0.4); }
.avatar-tone-6 { background: linear-gradient(135deg, #f0596b, #8b5cf6); border-color: rgba(240, 89, 107, 0.4); }

.site-nav a.nav-account {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 10px 4px 4px;
}

.nav-account span {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================================================
   Dashboard hero
   ========================================================================== */

.hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 48px 40px;
    margin-bottom: 28px;
    background:
        radial-gradient(600px 300px at 15% 20%, var(--color-primary-soft), transparent 65%),
        radial-gradient(500px 260px at 90% 0%, var(--color-secondary-soft), transparent 60%),
        var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.hero__eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    max-width: 26ch;
}

.hero p {
    max-width: 56ch;
    margin-bottom: 22px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 28px;
}

@media (max-width: 1024px) {
    .hero { padding: 36px 28px; }
    .hero__stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .hero { padding: 28px 20px; }
    .hero__stats { grid-template-columns: repeat(2, 1fr); }
    .hero__actions { flex-direction: column; align-items: stretch; }
}

/* ==========================================================================
   Discussions (Reddit/Steam-forum style)
   ========================================================================== */

.thread-composer {
    margin-bottom: 24px;
}

.thread-composer summary {
    cursor: pointer;
    list-style: none;
}

.thread-composer summary::-webkit-details-marker {
    display: none;
}

.thread-composer summary .btn {
    pointer-events: none;
}

.thread-composer .form {
    max-width: none;
    margin-top: 16px;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.thread-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.thread-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.thread-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.thread-row + .thread-row { border-top: none; }

.thread-row:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: var(--color-surface-hover);
}

.thread-row__body {
    flex: 1;
    min-width: 0;
}

.thread-row__title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.thread-row__title:hover {
    color: var(--color-accent);
}

.thread-row__meta {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.match-elsewhere-badge {
    color: var(--color-accent);
}

.thread-row__replies {
    flex-shrink: 0;
    text-align: center;
    min-width: 64px;
    padding: 8px 14px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
}

.thread-row__replies strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.thread-row__replies span {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.thread-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 8px;
}

.thread-header form {
    flex-shrink: 0;
}

.pin-badge {
    display: inline-block;
    font-size: 0.85em;
    transform: rotate(-10deg);
    margin-right: 2px;
}

.thread-header__meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.thread-body {
    white-space: pre-wrap;
    line-height: 1.7;
}

.reply-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 24px 0;
}

.reply {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.reply__body {
    flex: 1;
    min-width: 0;
}

.reply__meta {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.reply__meta strong {
    color: var(--color-text);
}

.reply__text {
    white-space: pre-wrap;
    line-height: 1.6;
}

.reply-form textarea {
    min-height: 100px;
}

.board-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.board-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.board-badge.active,
.board-badge:hover {
    background: var(--color-primary-soft);
    color: var(--color-text);
}

.sort-tabs {
    display: flex;
    gap: 4px;
    margin: 12px 0;
}

.sort-tabs a {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.sort-tabs a:hover {
    background: var(--color-surface-alt);
}

.sort-tabs a.active {
    background: var(--color-primary-soft);
    color: var(--color-text);
}

.thread-row__votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.thread-row__votes form {
    line-height: 0;
}

.vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1;
}

.vote-btn:hover {
    color: var(--color-accent);
}

.vote-btn.active {
    color: var(--color-accent);
}

.reply__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
}

.reply-children {
    border-left: 2px solid var(--color-border);
    padding-left: 12px;
    margin-top: 12px;
}

.reply-inline-form {
    margin-top: 8px;
}

.reply-inline-form textarea {
    min-height: 60px;
}

.guest-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--color-surface-alt);
    border-style: dashed;
}

.guest-prompt p {
    margin: 0;
    color: var(--color-text);
}

.guest-prompt__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ==========================================================================
   Profile & theme picker
   ========================================================================== */

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.avatar-preset-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 12px 0;
}

.avatar-preset-option {
    position: relative;
    cursor: pointer;
}

.avatar-preset-option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.avatar-preset-option .avatar {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    font-size: 1.6rem;
    border-radius: var(--radius);
    border-width: 2px;
    transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.avatar-preset-option input:checked + .avatar {
    border-color: var(--color-text);
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-primary);
}

.bg-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.bg-preset-option {
    position: relative;
    cursor: pointer;
}

.bg-preset-option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.bg-preset-option__swatch {
    height: 64px;
    border-radius: var(--radius);
    border: 2px solid var(--color-border);
    margin-bottom: 6px;
    transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.bg-preset-option input:checked + .bg-preset-option__swatch {
    border-color: var(--color-primary);
    transform: scale(1.03);
    box-shadow: 0 0 0 2px var(--color-primary-soft);
}

.bg-preset-option__label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    display: block;
}

.bg-swatch-default { background: linear-gradient(135deg, #0b0d12, #1c2230); }
.bg-swatch-nebula { background: linear-gradient(135deg, #ec4899, #6366f1, #22d3ee); }
.bg-swatch-cyber-grid { background-image: linear-gradient(#2b3040 1px, transparent 1px), linear-gradient(90deg, #2b3040 1px, transparent 1px); background-size: 12px 12px; background-color: #0b0d12; }
.bg-swatch-aurora { background: linear-gradient(135deg, #22d3ee, #ec4899, #6366f1); }
.bg-swatch-bloodmoon { background: radial-gradient(circle at 50% 30%, #f0596b, #0b0d12); }
.bg-swatch-matrix { background: repeating-linear-gradient(0deg, #34d399 0px, transparent 1px, transparent 6px), #0b0d12; }
.bg-swatch-sunset { background: radial-gradient(circle at 30% 20%, #fb923c, #ec4899 55%, #0b0d12); }
.bg-swatch-ocean { background: radial-gradient(circle at 30% 20%, #22d3ee, #3b82f6 55%, #0b0d12); }
.bg-swatch-forest { background: radial-gradient(circle at 30% 20%, #34d399, #0b0d12 70%); }
.bg-swatch-monochrome { background: radial-gradient(circle at 30% 20%, #6b7280, #0b0d12 70%); }
.bg-swatch-most_played {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent) 55%, #0b0d12);
    position: relative;
}
.bg-swatch-most_played::after {
    content: "\1F3AE";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.theme-mode-toggle {
    display: flex;
    gap: 8px;
    margin: 12px 0 20px;
}

.theme-mode-toggle label {
    flex: 1;
}

.theme-mode-toggle input {
    position: absolute;
    opacity: 0;
}

.theme-mode-toggle span {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.theme-mode-toggle input:checked + span {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-text);
}

.color-picker-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 12px 0 20px;
}

.color-picker-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-picker-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.color-picker-field input[type="color"] {
    width: 100%;
    height: 48px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-alt);
    cursor: pointer;
}

@media (max-width: 768px) {
    .avatar-preset-grid { grid-template-columns: repeat(4, 1fr); }
    .color-picker-row { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; align-items: flex-start; }
}
