:root {
    /* Playra v2: deep navy surfaces with an indigo→violet accent. */
    --color-bg: #0a0e1a;
    --color-bg-elevated: #0e1324;
    --color-surface: #141a2e;
    --color-surface-raised: #1c2440;
    --color-border: rgba(148, 163, 255, .10);
    --color-border-strong: rgba(148, 163, 255, .18);
    --color-text: #eef1ff;
    --color-text-muted: #8b93b3;
    --color-accent: #6d6cff;
    --color-accent-hover: #5b5bf0;
    --color-accent-2: #a855f7;
    --color-accent-soft: rgba(109, 108, 255, .16);
    --color-on-accent: #ffffff;
    --color-success: #34d399;
    --color-danger: #f87171;
    --color-warning: #fbbf24;
    --color-info: #38bdf8;

    --gradient-accent: linear-gradient(135deg, #4f7cff 0%, #6d6cff 45%, #a855f7 100%);
    --gradient-brand: linear-gradient(135deg, #38bdf8 0%, #6d6cff 50%, #c084fc 100%);

    --font-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;

    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --shadow-card: 0 8px 24px rgba(3, 6, 20, .45);
    --sidebar-width: 240px;
    --content-max: 1120px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(109, 108, 255, .10), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(168, 85, 247, .07), transparent 60%),
        var(--color-bg);
    background-attachment: fixed;
    min-height: 100vh;
}

h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 var(--space-3); }
h1:focus { outline: none; }
h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--space-2); }
small, .text-muted { font-size: 0.875rem; color: var(--color-text-muted); }

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

/* .app-shell / .top-bar / .body-row / .content are owned by MainLayout.razor.css (scoped) */

/* Bottom nav (mobile) / full sidebar (desktop) */
.main-nav {
    display: flex;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(14, 19, 36, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--color-border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: 10;
}

.main-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 64px;
    color: var(--color-text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 6px var(--space-2);
    border-radius: var(--radius-md);
    position: relative;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease;
}

.main-nav .nav-item:hover { color: var(--color-text); }
.main-nav .nav-item.active { color: var(--color-accent); }
.main-nav .nav-item.active i { color: var(--color-accent); }

.main-nav .nav-item i { font-size: 1.25rem; line-height: 1; }

/* Items only shown in the desktop sidebar; on mobile they live on the "Mehr" page. */
.main-nav .nav-desktop-only,
.main-nav .nav-section-label,
.main-nav .nav-brand { display: none; }

.nav-icon-wrap { position: relative; display: inline-flex; }

.nav-badge {
    position: absolute;
    top: -5px;
    right: -9px;
    min-width: 16px;
    background: var(--gradient-accent);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0 5px;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--color-bg-elevated);
}

@media (min-width: 768px) {
    .main-nav {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        overflow-y: auto;
        flex-direction: column;
        justify-content: flex-start;
        width: var(--sidebar-width);
        flex-shrink: 0;
        background: var(--color-bg-elevated);
        backdrop-filter: none;
        border-top: none;
        border-right: 1px solid var(--color-border);
        padding: var(--space-3) var(--space-3) var(--space-4);
        gap: 2px;
    }

    .main-nav .nav-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: var(--space-1) var(--space-2) var(--space-4);
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 1.35rem;
        letter-spacing: -0.02em;
        color: var(--color-text);
        text-decoration: none;
    }

    .main-nav .nav-desktop-only { display: flex; }
    .main-nav .nav-mobile-only { display: none; }

    .main-nav .nav-section-label {
        display: block;
        margin: var(--space-3) var(--space-2) var(--space-1);
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--color-text-muted);
        opacity: .7;
    }

    .main-nav .nav-item {
        flex-direction: row;
        gap: 12px;
        min-width: 0;
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .main-nav .nav-item i { font-size: 1.1rem; width: 20px; text-align: center; }

    .main-nav .nav-item:hover { background: rgba(148, 163, 255, .06); }

    .main-nav .nav-item.active {
        color: #fff;
        background: var(--gradient-accent);
        box-shadow: 0 6px 18px rgba(109, 108, 255, .35);
    }

    .main-nav .nav-item.active i { color: #fff; }

    .main-nav .nav-item .nav-badge {
        position: static;
        margin-left: auto;
        box-shadow: none;
    }

    .main-nav .nav-item .nav-icon-wrap { position: static; }
    .main-nav .nav-item .nav-icon-wrap .nav-badge { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); }
    .main-nav .nav-item.active .nav-badge { background: rgba(255, 255, 255, .25); }
}

/* Gradient gamepad brand mark (bi-controller clipped to the brand gradient). */
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    line-height: 1;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 4px 12px rgba(109, 108, 255, .45));
}


/* More page - same visual language as .main-nav (icon + label pill) */
.more-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 14px var(--space-3);
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

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

.more-menu-item::after {
    content: "\F285";
    font-family: "bootstrap-icons";
    margin-left: auto;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.more-menu-item:hover {
    background-color: var(--color-surface-raised, var(--color-surface));
    color: var(--color-accent);
}

.more-menu-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: 1.05rem;
}

@media (min-width: 768px) {
    .more-menu { max-width: 520px; }
}

/* Cards & list items */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.list-item .thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--color-border);
    object-fit: cover;
    flex-shrink: 0;
}

.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .actions { display: flex; gap: var(--space-2); flex-shrink: 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    border-radius: var(--radius-md);
    padding: 11px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, filter .15s ease;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--gradient-accent);
    color: var(--color-on-accent);
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(109, 108, 255, .35);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); color: var(--color-on-accent); }
.btn-outline { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
.btn-outline:hover:not(:disabled) { border-color: var(--color-accent); color: var(--color-text); background: var(--color-surface-raised); }
.btn-danger { background: transparent; color: var(--color-danger); border-color: transparent; }
.btn-danger:hover { text-decoration: underline; }
.btn-link { background: transparent; color: var(--color-accent); border-color: transparent; }
.btn-link:hover { color: #a5a4ff; }
.btn-sm { padding: 6px 10px; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* Forms */
label { display: block; margin-bottom: var(--space-1); font-size: 0.875rem; color: var(--color-text-muted); }

input, select, textarea {
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder, textarea::placeholder { color: var(--color-text-muted); opacity: .8; }

input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-accent-soft);
    border-color: var(--color-accent);
}

.field { margin-bottom: var(--space-3); }

/* Status boxes */
.status-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    margin-bottom: var(--space-3);
}

.status-box.success { border-left-color: var(--color-success); }
.status-box.danger { border-left-color: var(--color-danger); }
.status-box.warning { border-left-color: var(--color-warning); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(148, 163, 255, .10);
    color: var(--color-text-muted);
    border: 1px solid transparent;
}

.badge.status-backlog { color: #c7cbe0; background: rgba(148, 163, 255, .12); }
.badge.status-playing { color: #b9b8ff; background: rgba(109, 108, 255, .22); border-color: rgba(109, 108, 255, .35); }
.badge.status-completed { color: var(--color-success); background: rgba(52, 211, 153, .15); border-color: rgba(52, 211, 153, .3); }
.badge.status-abandoned { color: var(--color-danger); background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .3); }
.badge.status-paused { color: var(--color-warning); background: rgba(251, 191, 36, .15); border-color: rgba(251, 191, 36, .3); }

/* Segmented pill toggle (tabs like "Alle Spiele | Spiele ich gerade | Verliehen"). */
.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: var(--space-3);
}

.segmented::-webkit-scrollbar { display: none; }

.segmented-item {
    flex: 1 0 auto;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.segmented-item:hover { color: var(--color-text); }

.segmented-item.active {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(109, 108, 255, .35);
}

/* Auth */
.auth-card {
    max-width: 420px;
    margin: var(--space-5) auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-4);
    box-shadow: var(--shadow-card);
}

/* Chat - docked directly to the bottom nav/composer instead of relying on page-level
   scrolling: the message list gets its own bounded, internally-scrolling box, so there's no
   document scroll for the back link/name/composer to be scrolled away from, and no way for a
   message to render underneath them (matches Ludothek's app.css .chat-page fix). */
.chat-page {
    position: fixed;
    top: 3.5rem;
    bottom: 4.5rem;
    left: 0;
    right: 0;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--space-3);
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .chat-page {
        top: 4rem;
        left: var(--sidebar-width);
        bottom: 0;
    }
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2) 0;
}

.chat-bubble {
    align-self: flex-start;
    max-width: 75%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px 16px 16px 4px;
    padding: var(--space-2) var(--space-3);
    overflow-wrap: anywhere;
}
.chat-bubble-mine { align-self: flex-end; background: var(--gradient-accent); border-color: transparent; color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-bubble-time { display: block; font-size: 0.7rem; opacity: .7; margin-top: 2px; }

.chat-footer {
    flex-shrink: 0;
    padding: var(--space-2) 0;
    background-color: transparent;
    border-top: 1px solid var(--color-border);
}

.chat-footer-context {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    min-width: 0;
}

.chat-footer-name {
    font-weight: 600;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.chat-footer-topic {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.chat-composer { display: flex; gap: var(--space-2); }
.chat-composer input { flex: 1; }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; }
.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

/* Quick-check search */
.quickcheck-search { position: relative; }
.quickcheck-search::before {
    content: "\F52A";
    font-family: "bootstrap-icons";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}
.quickcheck-search input { height: 52px; font-size: 1.05rem; padding-left: 44px; border-radius: var(--radius-lg); }

.quickcheck-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.hero-scanner {
    margin-top: var(--space-2);
}

/* Barcode scanner start/stop - full width, accent-coloured so it reads as a primary action. */
.btn-scan, .btn-scan-stop, .btn-scan-hero {
    width: 100%;
    margin-bottom: var(--space-2);
}

/* Scanning is the Schnellcheck's main action on a phone - the one filled, tall button there. */
.btn-scan-hero {
    min-height: 52px;
    font-size: 1.05rem;
    gap: var(--space-2);
}

.btn-scan-hero .bi { font-size: 1.3rem; }

.btn-accent-outline { border-color: rgba(109, 108, 255, .55); color: #c4c3ff; }

.btn-scan { border-color: rgba(109, 108, 255, .55); color: #c4c3ff; }
.btn-scan-stop { border-color: var(--color-danger); color: var(--color-danger); }

.scanner-video {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    box-shadow: 0 0 0 1px rgba(109, 108, 255, .25), 0 12px 32px rgba(3, 6, 20, .5);
    margin-bottom: var(--space-2);
}

#blazor-error-ui {
    background: var(--color-danger);
    color: #0f0f10;
    display: none;
    left: 0;
    padding: var(--space-2);
    position: fixed;
    width: 100%;
    bottom: 0;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; float: right; }

.badge-group {
    display: inline-block;
    margin-left: var(--space-2);
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #c4c3ff;
    background-color: var(--color-accent-soft);
    border-radius: 999px;
    vertical-align: middle;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    min-width: 0;
}

.section-head h2 {
    margin-bottom: 0;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-head .section-see-all {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-left: var(--space-2);
}

.rail-wrap {
    position: relative;
    min-width: 0;
    max-width: 100%;
    margin-bottom: var(--space-4);
}

.rail {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    overflow-y: visible;
    padding: 2px 2px var(--space-2);
    scrollbar-width: none;
    cursor: grab;
    min-width: 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
    display: none;
}

.rail.rail-dragging {
    cursor: grabbing;
    user-select: none;
}

/* No `.rail.rail-dragging a { pointer-events: none }` here on purpose - rail.js sets
   .rail-dragging synchronously on every mousedown, before it's known whether the user is
   actually dragging or just clicking. Disabling pointer-events on the link at that point makes
   the browser's own mouseup hit-test land on this container instead of the link, so the
   resulting click event never reaches the link at all - breaking every single click, not just
   ones that turn into drags. rail.js's own capture-phase click handler already suppresses
   navigation correctly for actual drags (checks a `moved` distance threshold), so this CSS rule
   was redundant on top of being broken. */

.rail-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-surface-raised);
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.rail-wrap:hover .rail-nav {
    opacity: 1;
}

.rail-nav-prev {
    left: -8px;
}

.rail-nav-next {
    right: -8px;
}

@media (max-width: 640px) {
    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .section-head .section-see-all {
        margin-left: 0;
    }

    .rail-nav {
        display: none;
    }
}

.poster-card {
    position: relative;
    flex: 0 0 140px;
    display: block;
    text-decoration: none;
    color: inherit;
}

.poster-lent-stamp {
    position: absolute;
    top: 14px;
    left: -30px;
    width: 130px;
    padding: 3px 0;
    text-align: center;
    background: linear-gradient(90deg, #f97316, #f59e0b);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transform: rotate(-35deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 1;
}

.drag-handle-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(12, 12, 14, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.poster-card .poster-img {
    width: 140px;
    height: 196px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: linear-gradient(160deg, var(--color-surface-raised), var(--color-surface));
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 24px rgba(3, 6, 20, .5);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.poster-card:hover .poster-img {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(3, 6, 20, .6), 0 0 0 1px rgba(109, 108, 255, .45);
}

.poster-card .poster-title {
    margin-top: var(--space-2);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poster-card .poster-meta {
    margin-top: 2px;
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.poster-card .poster-meta-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.poster-grid .drag-handle-btn {
    cursor: grab;
    touch-action: none;
}

.wishlist-item-dragging {
    opacity: 0.85;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.wishlist-item-placeholder {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    box-shadow: none;
}

@media (max-width: 640px) {
    .poster-grid {
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
    }

    .poster-grid .poster-card {
        flex: none;
        width: 100%;
    }

    .poster-grid .poster-img {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .poster-grid .poster-title {
        font-size: 1.05rem;
    }

    .poster-grid .poster-meta {
        font-size: 0.85rem;
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(5, 8, 20, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-3);
}

.modal-box {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: 0 24px 60px rgba(3, 6, 20, .6);
    max-width: 360px;
    width: 100%;
}

.modal-box-lg {
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
}

.progress-track {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    height: 10px;
    overflow: hidden;
    width: 100%;
}

.progress-fill {
    background: var(--gradient-accent);
    height: 100%;
    transition: width 0.3s ease;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: flex-end;
    margin-top: var(--space-3);
}

.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-4);
    margin: 0 0 var(--space-4);
    background: radial-gradient(120% 100% at 0% 0%, rgba(109, 108, 255, 0.28), transparent 55%),
                radial-gradient(90% 90% at 100% 100%, rgba(168, 85, 247, 0.22), transparent 60%),
                var(--color-surface);
    border: 1px solid var(--color-border);
}


.hero-glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.4;
    pointer-events: none;
    background: var(--gradient-accent);
    animation: hero-float 14s ease-in-out infinite;
}

.hero-glow-1 { width: 200px; height: 200px; top: -70px; left: -50px; }
.hero-glow-2 { width: 160px; height: 160px; bottom: -60px; right: -30px; animation-delay: -7s; }
.hero-glow-3 { width: 140px; height: 140px; top: 40%; right: 10%; opacity: 0.25; animation-delay: -3s; }

@keyframes hero-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(18px, -14px) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-glow { animation: none; }
}

.hero-cover-grid {
    position: absolute;
    inset: -10% -10%;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: 165px;
    align-content: start;
    gap: 6px;
    transform: rotate(-3deg) scale(1.15);
}

.hero-cover-tile {
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    filter: saturate(1.05);
}

.hero-cover-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, rgba(10, 14, 26, 0.55) 0%, rgba(10, 14, 26, 0.86) 60%, var(--color-surface) 100%);
}

@media (min-width: 768px) {
    .hero-cover-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        grid-auto-rows: 235px;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c4c3ff;
    margin-bottom: var(--space-2);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin-bottom: var(--space-1);
}

.hero-subtitle {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
    max-width: 480px;
}

.hero-cta-row {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.hero-cta-row .btn {
    border-radius: var(--radius-pill);
}

.hero-content-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-4) 0;
}

.hero-content-centered .hero-subtitle { margin-left: auto; margin-right: auto; }
.hero-content-centered .hero-cta-row { flex-direction: column; width: 100%; max-width: 340px; }
.hero-content-centered .hero-cta-row .btn { width: 100%; border-radius: var(--radius-md); }

.hero-logo { font-size: 3.2rem; margin-bottom: var(--space-1); }

.hero-wordmark {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.6rem, 8vw, 3.6rem);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: var(--space-3);
}

.hero-content-centered .hero-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    color: #c9cff0;
    letter-spacing: -0.01em;
}

.feature-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: var(--space-3) var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.feature-item i {
    font-size: 1.8rem;
    margin-bottom: var(--space-1);
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature-item strong { font-family: var(--font-display); font-size: 0.9rem; }
.feature-item span { font-size: 0.78rem; color: var(--color-text-muted); }

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

.validation-message { color: var(--color-danger); font-size: 0.875rem; }

/* Ported from Ludothek's app.css for Friends/Profile/Groups parity (Bootstrap-based .list-row
   layout, distinct from this app's older .list-item pattern used elsewhere - both coexist until
   the rest of the app is migrated). */
.list-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
}

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

a.list-row { color: inherit; text-decoration: none; }
a.list-row:hover .info { color: var(--color-text); }

.list-row .info {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
}

.bar-track {
    flex: 1;
    background-color: var(--color-surface);
    border-radius: var(--radius-sm);
    height: 0.9rem;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--gradient-accent);
    border-radius: var(--radius-sm);
}

.bar-value {
    width: 2.5rem;
    text-align: right;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.achievement-icon {
    font-size: 1.6rem;
    width: 2.2rem;
    flex-shrink: 0;
    text-align: center;
    color: var(--color-text-muted);
    opacity: 0.4;
}

.achievement-icon-unlocked {
    color: #a5a4ff;
    opacity: 1;
}

.achievement-title {
    font-weight: 600;
}

.list-row .meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.list-row-lent {
    opacity: 0.55;
}

.thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--color-surface);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.avatar-tile {
    position: relative;
    flex: 0 0 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.avatar-tile .avatar {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.avatar-tile-name {
    font-size: 0.78rem;
    font-weight: 600;
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-tile-meta {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--space-3);
}

.profile-header .profile-header-name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    margin-bottom: var(--space-1);
}

.profile-header-edit {
    font-size: 0.8em;
}

.profile-achievement-strip {
    display: flex;
    gap: var(--space-2);
    font-size: 1.3rem;
    color: var(--color-accent);
    margin-top: var(--space-1);
    text-decoration: none;
}

.profile-friend-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.btn-icon-edit {
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding: 0 var(--space-1);
    font-size: 0.85em;
    cursor: pointer;
    vertical-align: middle;
    text-decoration: none;
    display: inline-flex;
}

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

.rsvp-toggle {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    border-radius: var(--radius-pill);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.rsvp-option {
    flex: 1 1 auto;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rsvp-option.active {
    background: var(--gradient-accent);
    color: #fff;
}

.compare-row-game {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.compare-header-game {
    font-weight: 600;
    padding-bottom: var(--space-2);
}

.compare-title-cell {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.compare-title-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compare-check-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    text-align: center;
}

.rsvp-table-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.rsvp-table-header {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.badge-lent {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, .5);
    background: rgba(251, 146, 60, .12);
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.badge-pill {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gradient-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.compare-row-highlight {
    background-color: color-mix(in srgb, var(--color-accent) 15%, transparent);
    border-radius: var(--radius-sm);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}

.group-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--color-surface);
}

.invite-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
}

.staged-chip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-1) 0;
}

/* Metascore-style rating: a colored score badge (green/yellow/red by tier) plus 0-100 sliders
   per category - deliberately loud (shadow, bold, larger than a normal .badge) since the whole
   point was for this to visually stand out rather than blend into everything else on the page. */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    font-family: var(--font-display, inherit);
    font-weight: 800;
    font-size: 1.3rem;
    color: #0f0f10;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.score-badge-sm {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
}

.score-high { background: var(--color-success); }
.score-mid { background: var(--color-warning); }
.score-low { background: var(--color-danger); color: #fff; }

.rating-slider-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rating-slider-row .rating-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.rating-slider-row .rating-slider-label strong {
    color: var(--color-text);
}

.rating-slider-row input[type="range"] {
    width: 100%;
    accent-color: var(--color-accent);
}

.cover {
    display: block;
    margin: 0 auto;
    max-width: 240px;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 16px 40px rgba(3, 6, 20, .6);
}

/* ---- Redesign v2: collection filters, dense poster grid ---- */
.filter-bar {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.filter-bar select { width: auto; flex: 0 0 auto; min-width: 150px; }

.search-field {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
}

.search-field > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-field input { padding-left: 40px; }

.poster-card .poster-status {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background-color: rgba(10, 14, 26, .72);
}

.poster-grid.poster-grid-dense {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-4) var(--space-3);
}

.poster-grid-dense .poster-card { width: 100%; flex: none; }

.poster-grid-dense .poster-card .poster-img {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
}

@media (max-width: 640px) {
    .poster-grid.poster-grid-dense {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-3) var(--space-2);
    }

    .poster-grid-dense .poster-title { font-size: 0.78rem; }
    .poster-grid-dense .poster-meta { font-size: 0.68rem; }
    .poster-grid-dense .poster-status { font-size: 0.6rem; padding: 2px 6px; top: 6px; right: 6px; }
    .filter-bar select { flex: 1 1 40%; min-width: 0; }
}

/* ---- Game detail hero ---- */
.game-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-4);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.game-hero-backdrop {
    position: absolute;
    inset: -40px;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(40px) saturate(1.2);
    opacity: .28;
}

.game-hero-cover { display: flex; flex-direction: column; gap: var(--space-2); }

.game-hero-cover img,
.game-hero-cover-placeholder {
    width: 100%;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    box-shadow: 0 16px 40px rgba(3, 6, 20, .6);
}

.game-hero-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--color-text-muted);
    background: linear-gradient(160deg, var(--color-surface-raised), var(--color-bg));
}

.game-hero-info h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: var(--space-2); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); }

.chip {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: rgba(148, 163, 255, .10);
    border: 1px solid var(--color-border-strong);
    font-size: 0.78rem;
    font-weight: 600;
    color: #d6daf5;
}

.meta-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px var(--space-4);
    margin: 0;
    font-size: 0.9rem;
}

.meta-grid dt { color: var(--color-text-muted); font-weight: 500; }
.meta-grid dd { margin: 0; }

.game-description { color: #c9cff0; line-height: 1.6; margin: 0; }

@media (max-width: 640px) {
    .game-hero { grid-template-columns: 120px 1fr; gap: var(--space-3); padding: var(--space-3); }
    .meta-grid { grid-template-columns: 1fr; gap: 0; }
    .meta-grid dd { margin-bottom: 6px; }
}

/* ---- Card-style rows (lists on Freunde, Gruppen, Verleih, Wunschliste, ...) ---- */
.list-row {
    padding: 12px var(--space-3);
    margin-bottom: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: border-color .15s ease, background-color .15s ease;
}

.list-row:last-child { border-bottom: 1px solid var(--color-border); }

a.list-row:hover { border-color: rgba(109, 108, 255, .45); background: var(--color-surface-raised); }

.list-row .thumb { width: 48px; height: 64px; border-radius: var(--radius-sm); }

/* Rows nested inside a card stay flat. */
.card .list-row {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    margin-bottom: 0;
    padding-left: 0;
    padding-right: 0;
}

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

/* ---- Events ---- */
.event-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px var(--space-3);
    margin-bottom: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.event-card:hover { border-color: rgba(109, 108, 255, .45); background: var(--color-surface-raised); color: inherit; }
.event-card-past { opacity: .55; }
.event-card .info { flex: 1; min-width: 0; }
.event-card-title { font-weight: 600; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.event-card .meta { font-size: 0.8rem; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.date-block {
    flex-shrink: 0;
    width: 54px;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    border: 1px solid rgba(109, 108, 255, .3);
}

.date-block-month { font-size: 0.65rem; font-weight: 700; letter-spacing: .08em; color: #b9b8ff; }
.date-block-day { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; line-height: 1.1; }

/* ---- Schnellcheck dashboard ---- */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

@media (min-width: 1024px) {
    .dashboard { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
}

.dash-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.dash-tile {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    aspect-ratio: 4 / 3;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: linear-gradient(160deg, var(--color-surface-raised), var(--color-surface));
    color: var(--color-text);
    text-decoration: none;
}

.dash-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, transparent 30%, rgba(10, 14, 26, .92) 100%);
}

.dash-tile-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: transform .3s ease;
}

.dash-tile:hover { color: var(--color-text); border-color: rgba(109, 108, 255, .45); }
.dash-tile:hover .dash-tile-bg { transform: scale(1.05); }
.dash-tile-text strong { display: block; font-family: var(--font-display); font-size: 0.95rem; }
.dash-tile-text span { font-size: 0.78rem; color: #c9cff0; }

.dash-friends h2 { font-size: 1rem; }

.dash-friend {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 0;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.dash-friend small { color: var(--color-text-muted); font-size: 0.75rem; }
.dash-friend:hover { color: var(--color-accent); }

@media (max-width: 640px) {
    .dash-tiles { gap: var(--space-2); }
    .dash-tile { aspect-ratio: 3 / 4; padding: var(--space-2); }
    .dash-tile-text strong { font-size: 0.8rem; }
}

.dash-friends .section-see-all { display: inline-block; margin-top: var(--space-2); font-size: 0.82rem; }

@media (max-width: 640px) {
    .meta-grid { font-size: 0.82rem; }
    .meta-grid dd { margin-bottom: 4px; }
}
