/* ==========================================================================
   GameDB — app.css
   Ein einziges Stylesheet. Design-Tokens, Light/Dark, responsive.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    /* Light (Default) */
    --bg:            #eef1f7;
    --bg-elevated:   rgba(255, 255, 255, .88);
    --surface:       rgba(255, 255, 255, .70);
    --surface-2:     rgba(255, 255, 255, .48);
    --surface-3:     rgba(15, 23, 42, .07);
    --bar:           rgba(255, 255, 255, .62);

    /* Glas */
    --glass-edge:    rgba(255, 255, 255, .85);
    --glass-sheen:   linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 42%);
    --blur:          blur(16px) saturate(180%);

    /* Farbband oben */
    --wash-a:        rgba(37, 99, 235, .16);
    --wash-b:        rgba(13, 148, 136, .13);
    --wash-c:        rgba(236, 72, 153, .11);

    --grad-accent:   linear-gradient(135deg, #2563eb, #0d9488);
    --grad-text:     linear-gradient(100deg, #1d4ed8, #0f766e 60%, #be185d);

    --fg:            #101828;
    --fg-muted:      #5b6478;
    --fg-subtle:     #98a0b0;

    --border:        rgba(15, 23, 42, .09);
    --border-strong: rgba(15, 23, 42, .18);

    --accent:        #2563eb;
    --accent-hover:  #1d4ed8;
    --accent-fg:     #ffffff;
    --accent-soft:   rgba(37, 99, 235, .10);
    --accent-ring:   rgba(37, 99, 235, .28);

    --ok:            #0f9d63;
    --ok-soft:       rgba(15, 157, 99, .12);
    --warn:          #c77a08;
    --warn-soft:     rgba(199, 122, 8, .12);
    --danger:        #d92d20;
    --danger-soft:   rgba(217, 45, 32, .10);
    --info:          #0f766e;
    --info-soft:     rgba(15, 118, 110, .12);
    --star:          #f5a524;

    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-full: 999px;

    --sh-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
    --sh-2: 0 4px 12px rgba(16, 24, 40, .08);
    --sh-3: 0 18px 48px rgba(16, 24, 40, .18);

    --ease: cubic-bezier(.4, 0, .2, 1);
    --t: .16s var(--ease);

    --bar-h: 60px;
    --maxw: 1440px;

    color-scheme: light;
}

html[data-theme="dark"] {
    --bg:            #070910;
    --bg-elevated:   rgba(20, 25, 36, .88);
    --surface:       rgba(28, 34, 48, .52);
    --surface-2:     rgba(255, 255, 255, .05);
    --surface-3:     rgba(255, 255, 255, .10);
    --bar:           rgba(10, 13, 21, .60);

    --glass-edge:    rgba(255, 255, 255, .12);
    --glass-sheen:   linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 42%);

    --wash-a:        rgba(37, 99, 235, .34);
    --wash-b:        rgba(13, 148, 136, .26);
    --wash-c:        rgba(236, 72, 153, .20);

    --grad-accent:   linear-gradient(135deg, #4f8ff7, #2bbfae);
    --grad-text:     linear-gradient(100deg, #7db4ff, #3fd8c4 55%, #ff8fc0);

    --fg:            #e9ecf3;
    --fg-muted:      #9aa4b8;
    --fg-subtle:     #6a7386;

    --border:        rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .18);

    --accent:        #5ea3fb;
    --accent-hover:  #8bc0ff;
    --accent-fg:     #08101f;
    --accent-soft:   rgba(94, 163, 251, .14);
    --accent-ring:   rgba(94, 163, 251, .32);

    --ok:            #3ddc97;
    --ok-soft:       rgba(61, 220, 151, .13);
    --warn:          #f5b544;
    --warn-soft:     rgba(245, 181, 68, .13);
    --danger:        #ff6b63;
    --danger-soft:   rgba(255, 107, 99, .13);
    --info:          #34d3c0;
    --info-soft:     rgba(52, 211, 192, .13);
    --star:          #ffc857;

    --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
    --sh-2: 0 6px 18px rgba(0, 0, 0, .45);
    --sh-3: 0 24px 60px rgba(0, 0, 0, .6);

    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset & Basis
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

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

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

/* Farbband am oberen Seitenrand — eine gerichtete Tönung, kein Nebel.
   Statisch, keine Animation, kein Filter. */
body::before {
    content: '';
    position: fixed;
    inset: 0 0 auto;
    height: 340px;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(100deg, var(--wash-a), var(--wash-b) 46%, var(--wash-c)),
        linear-gradient(180deg, #000 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000, transparent);
    mask-image: linear-gradient(180deg, #000, transparent);
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button { background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

::selection { background: var(--accent-soft); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--fg-subtle); background-clip: content-box; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 20px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

[hidden], .is-hidden { display: none !important; }

/* --------------------------------------------------------------------------
   3. Buttons & Form-Controls
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:hover { border-color: var(--border-strong); box-shadow: var(--sh-1); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary {
    background: var(--grad-accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 14px -3px var(--accent-ring);
}
.btn--primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px -4px var(--accent-ring); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--fg); border-color: transparent; }

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

.btn--sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    flex: none;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    color: var(--fg-muted);
    transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.is-active { background: var(--accent-soft); color: var(--accent); }

.input, .select, textarea.input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-elevated);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    color: var(--fg);
    font-size: 14px;
    transition: border-color var(--t), box-shadow var(--t);
}
.input::placeholder { color: var(--fg-subtle); }
.input:focus, .select:focus, textarea.input:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
textarea.input { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.5; }

.select {
    appearance: none;
    padding-right: 32px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label:not(.switch), .label {
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-muted);
    letter-spacing: .01em;
}

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    width: 40px; height: 22px; flex: none;
    border-radius: var(--r-full);
    background: var(--surface-3);
    border: 1px solid var(--border);
    position: relative;
    transition: background var(--t), border-color var(--t);
}
.switch .track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--sh-1);
    transition: transform var(--t);
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }

/* --------------------------------------------------------------------------
   4. Topbar
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--bar);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border-bottom: 1px solid transparent;
    transition: border-color var(--t), box-shadow var(--t);
}
.topbar[data-elevated="1"] { border-bottom-color: var(--border); box-shadow: var(--sh-2); }
/* Farbiger Haarstrich unter der Leiste */
.topbar::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--info), transparent);
    opacity: 0;
    transition: opacity var(--t);
}
.topbar[data-elevated="1"]::after { opacity: .55; }

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--bar-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -.02em;
    flex: none;
}
.brand img { width: 28px; height: 28px; border-radius: var(--r-xs); object-fit: contain; }
.brand-name {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Suche */
.search {
    position: relative;
    flex: 1 1 auto;
    max-width: 480px;
    min-width: 0;
}
.search svg {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--fg-subtle);
    pointer-events: none;
}
.search input {
    width: 100%;
    height: 38px;
    padding: 0 34px 0 36px;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    font-size: 14px;
    transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.search input::placeholder { color: var(--fg-subtle); }
.search input:focus {
    outline: 0;
    background: var(--bg-elevated);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.search-clear {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--fg-subtle);
}
.search-clear:hover { background: var(--surface-3); color: var(--fg); }
.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: none;
}

/* Segmented view switcher */
.segmented {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--surface-2);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.segmented button {
    display: grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: var(--r-xs);
    color: var(--fg-subtle);
    transition: background var(--t), color var(--t);
}
.segmented button svg { width: 16px; height: 16px; }
.segmented button:hover { color: var(--fg); }
.segmented button.is-active {
    background: var(--grad-accent);
    color: #fff;
    box-shadow: 0 2px 10px -2px var(--accent-ring);
}

/* User */
.user {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 6px 0 4px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    font-size: 13px;
    font-weight: 500;
    max-width: 190px;
}
.user img { width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover; }
.user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user a { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--fg-subtle); flex: none; }
.user a:hover { background: var(--danger-soft); color: var(--danger); }
.user a svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   5. Menü / Dropdown
   -------------------------------------------------------------------------- */
.menu { position: relative; }
.menu-drop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    padding: 6px;
    background: var(--bg-elevated);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-edge);
    border-radius: var(--r-md);
    box-shadow: var(--sh-3);
    z-index: 80;
    animation: pop .13s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

.menu-label {
    padding: 8px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--r-xs);
    font-size: 14px;
    text-align: left;
    color: var(--fg);
    transition: background var(--t);
}
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 16px; height: 16px; flex: none; color: var(--fg-muted); }
.menu-item .chev { margin-left: auto; width: 13px; height: 13px; transition: transform var(--t); }
.menu-item[aria-expanded="true"] .chev { transform: rotate(180deg); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.menu-sub { padding-left: 8px; }
.menu-sub .menu-item { font-size: 13px; color: var(--fg-muted); }

/* --------------------------------------------------------------------------
   6. Filterleiste
   -------------------------------------------------------------------------- */
.filters {
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
}
.filters-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding-block: 14px;
    align-items: end;
}
.filters-inner .field.actions { justify-content: flex-end; }

/* Plattform-Combobox */
.combo { position: relative; }
.combo-input-wrap { position: relative; }
.combo-clear {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--fg-subtle);
    font-size: 16px;
    line-height: 1;
}
.combo-clear:hover { background: var(--surface-3); color: var(--fg); }
.combo-drop {
    position: fixed;
    z-index: 90;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    background: var(--bg-elevated);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-edge);
    border-radius: var(--r-md);
    box-shadow: var(--sh-3);
}
.combo-sect-label {
    padding: 8px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}
.combo-opt {
    padding: 8px 10px;
    border-radius: var(--r-xs);
    font-size: 14px;
    cursor: pointer;
}
.combo-opt:hover { background: var(--accent-soft); color: var(--accent); }
.combo-more {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    color: var(--accent);
}
.combo-empty { padding: 12px 10px; font-size: 13px; color: var(--fg-subtle); text-align: center; }

/* --------------------------------------------------------------------------
   7. Stats
   -------------------------------------------------------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding-block: 20px 4px;
}
.stat {
    --tone: var(--accent);
    --tone-soft: var(--accent-soft);
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    background:
        linear-gradient(135deg, var(--tone-soft), transparent 58%),
        var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    text-align: left;
    transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
/* Glanzkante oben */
.stat::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 50%;
    background: var(--glass-sheen);
    pointer-events: none;
}
.stat[data-filter]:hover {
    border-color: var(--tone);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px -12px var(--tone);
}
.stat--ok   { --tone: var(--ok);     --tone-soft: var(--ok-soft); }
.stat--warn { --tone: var(--warn);   --tone-soft: var(--warn-soft); }
.stat--info { --tone: var(--info);   --tone-soft: var(--info-soft); }
.stat--rose { --tone: var(--danger); --tone-soft: var(--danger-soft); }

.stat-icon {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    flex: none;
    border-radius: var(--r-sm);
    background: var(--tone-soft);
    box-shadow: inset 0 0 0 1px var(--tone-soft);
    color: var(--tone);
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; position: relative; }
.stat-val { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--tone); }
.stat-label { font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* --------------------------------------------------------------------------
   8. Section-Kopf
   -------------------------------------------------------------------------- */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-block: 24px 14px;
}
.section-head h2 {
    font-size: 17px;
    position: relative;
    padding-left: 12px;
}
.section-head h2::before {
    content: '';
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: 3px;
    border-radius: var(--r-full);
    background: var(--grad-accent);
}
.section-head .count { font-size: 13px; color: var(--fg-subtle); }

/* --------------------------------------------------------------------------
   9. Spiele — Grid
   -------------------------------------------------------------------------- */
.games { padding-bottom: 40px; }

.games[data-view="grid"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

/* --tone kommt pro Karte aus dem Genre (PHP setzt --gc / --gcd inline).
   Ohne Genre fällt sie auf die Akzentfarbe zurück. */
.game-card {
    --tone: var(--gc, var(--accent));
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    /* innere Lichtkante oben = Glas, ohne das Cover aufzuhellen */
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--sh-1);
    transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
html[data-theme="dark"] .game-card { --tone: var(--gcd, var(--accent)); }

.game-card:hover {
    border-color: var(--tone);
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 var(--glass-edge), 0 16px 34px -16px var(--tone), var(--sh-2);
}

.card-media {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--surface-3);
    overflow: hidden;
}
.card-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.game-card:hover .card-media img { transform: scale(1.04); }

.score {
    position: absolute;
    top: 8px; right: 8px;
    min-width: 30px; height: 24px;
    display: grid; place-items: center;
    padding: 0 6px;
    border-radius: var(--r-xs);
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(6px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.score[data-tier="high"] { background: linear-gradient(135deg, #10b981, #059669); }
.score[data-tier="mid"]  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.score[data-tier="low"]  { background: linear-gradient(135deg, #f43f5e, #e11d48); }

.owned-flag {
    position: absolute;
    left: 8px; bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #0d9488);
    box-shadow: 0 2px 10px -3px rgba(16, 185, 129, .9);
}
.owned-flag svg { width: 12px; height: 12px; }

.wish-btn {
    position: absolute;
    top: 8px; left: 8px;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity var(--t), color var(--t), background var(--t);
}
.game-card:hover .wish-btn, .wish-btn.is-active { opacity: 1; }
.wish-btn svg { width: 15px; height: 15px; }
.wish-btn:hover { background: rgba(0, 0, 0, .72); }
.wish-btn.is-active { color: #ff6b81; }

.card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px 13px 13px;
    flex: 1;
    min-width: 0;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--tone) 8%, transparent), transparent 58%),
        var(--glass-sheen);
}
/* Genre-Linie oben am Textteil */
.card-body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--tone), transparent 85%);
}
.card-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--fg-muted);
    min-width: 0;
}
/* kompakter MP-Chip, damit dem Genre mehr Platz bleibt */
.card-meta .chip--mp { height: 19px; padding: 0 6px; font-size: 10.5px; letter-spacing: .02em; }
/* Nur das Genre schrumpft und kürzt; alles andere behält seine volle Breite,
   sonst wird aus "2016" ein "20…". */
.card-meta .meta-genre {
    color: var(--tone);
    font-weight: 500;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-meta .meta-year { flex: none; white-space: nowrap; color: var(--fg-subtle); }
.card-meta .sep { flex: none; opacity: .5; }
.card-meta .chip { flex: none; overflow: visible; }

.card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 5px; overflow: hidden; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 21px;
    padding: 0 8px;
    border-radius: var(--r-full);
    background: var(--accent-soft);
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
}
.chip--owned { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip--tag { background: transparent; border-color: var(--border); color: var(--fg-subtle); }
.chip--mp { background: var(--info-soft); border-color: transparent; color: var(--info); }
.chip--more { background: transparent; border-style: dashed; color: var(--fg-subtle); }
.chip .qty { font-weight: 700; opacity: .8; }

/* Kein hartes Abschneiden mehr: die Anzahl wird serverseitig begrenzt und der
   Rest als "+N"-Chip angezeigt. Sonst verschwanden Tags je nach Chipbreite
   scheinbar willkürlich. */

/* Sterne (Durchschnitt) */
.avg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--fg-muted);
}
.stars { display: inline-flex; gap: 1px; }
.star {
    position: relative;
    font-size: 13px;
    line-height: 1;
    color: var(--border-strong);
}
.star.full { color: var(--star); }
.star.half::after {
    content: '★';
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
    color: var(--star);
}

.edit-btn {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 28px; height: 28px;
    border-radius: var(--r-xs);
    color: var(--fg-subtle);
    transition: background var(--t), color var(--t);
}
.edit-btn:hover { background: var(--accent-soft); color: var(--accent); }
.edit-btn svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   10. Spiele — Reihen-Ansicht
   -------------------------------------------------------------------------- */
.games[data-view="rows"] {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.games[data-view="rows"] .game-card {
    flex-direction: row;
    align-items: stretch;
}
.games[data-view="rows"] .card-media {
    width: 96px;
    flex: none;
    aspect-ratio: 3 / 4;
    border-right: 1px solid var(--border);
}
.games[data-view="rows"] .game-card:hover .card-media img { transform: none; }
.games[data-view="rows"] .score { top: 6px; right: 6px; height: 20px; min-width: 26px; font-size: 11px; }
.games[data-view="rows"] .wish-btn { width: 24px; height: 24px; top: 6px; left: 6px; }
.games[data-view="rows"] .owned-flag { left: 6px; bottom: 6px; height: 19px; font-size: 10px; padding: 0 6px; }
.games[data-view="rows"] .card-body { padding: 13px 15px; gap: 6px; }
.games[data-view="rows"] .card-title { font-size: 15.5px; -webkit-line-clamp: 1; }

/* --------------------------------------------------------------------------
   11. Spiele — Listen-Ansicht (kompakt)
   -------------------------------------------------------------------------- */
.games[data-view="list"] {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--sh-1);
}
/* Liste: Genre-Farbe als Balken links statt als Linie oben */
.games[data-view="list"] .game-card { box-shadow: inset 3px 0 0 var(--tone); }
.games[data-view="list"] .card-body { background: none; }
.games[data-view="list"] .card-body::before { display: none; }
.games[data-view="list"] .game-card {
    flex-direction: row;
    align-items: center;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
}
.games[data-view="list"] .game-card:last-child { border-bottom: 0; }
.games[data-view="list"] .game-card:hover { transform: none; box-shadow: none; background: var(--surface-2); }
.games[data-view="list"] .card-media {
    width: 34px; height: 44px;
    aspect-ratio: auto;
    margin: 8px 0 8px 12px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border);
    flex: none;
}
.games[data-view="list"] .game-card:hover .card-media img { transform: none; }
.games[data-view="list"] .score,
.games[data-view="list"] .owned-flag,
.games[data-view="list"] .wish-btn { display: none; }
.games[data-view="list"] .card-body {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 8px 14px;
}
.games[data-view="list"] .card-title {
    -webkit-line-clamp: 1;
    font-size: 14px;
    flex: 1 1 34%;
    min-width: 120px;
}
.games[data-view="list"] .card-meta { flex: 1 1 22%; }
.games[data-view="list"] .chips { flex: 1 1 26%; max-height: 21px; }
.games[data-view="list"] .chips[data-kind="tags"] { display: none; }
.games[data-view="list"] .card-foot { margin: 0; padding: 0; flex: none; }
.games[data-view="list"] .list-score {
    display: grid; place-items: center;
    min-width: 30px; height: 22px;
    padding: 0 6px;
    border-radius: var(--r-xs);
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.list-score { display: none; }
.list-score[data-tier="high"] { color: var(--ok); }
.list-score[data-tier="mid"]  { color: var(--warn); }
.list-score[data-tier="low"]  { color: var(--danger); }

/* --------------------------------------------------------------------------
   12. Leerzustand
   -------------------------------------------------------------------------- */
.empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 70px 20px;
    text-align: center;
    color: var(--fg-muted);
}
.empty svg { width: 40px; height: 40px; color: var(--fg-subtle); }
.empty strong { font-size: 16px; color: var(--fg); font-weight: 600; }

/* --------------------------------------------------------------------------
   13. Pagination
   -------------------------------------------------------------------------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 48px;
}
.page-btn {
    min-width: 36px; height: 36px;
    display: grid; place-items: center;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    color: var(--fg-muted);
    transition: background var(--t), color var(--t), border-color var(--t);
}
.page-btn:hover { background: var(--surface-2); color: var(--fg); }
.page-btn.active {
    background: var(--grad-accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px -3px var(--accent-ring);
}
.page-btn.disabled { opacity: .4; pointer-events: none; }
.pagination .ellipsis { padding: 0 4px; color: var(--fg-subtle); }
.page-info { width: 100%; text-align: center; font-size: 12.5px; color: var(--fg-subtle); margin-top: 6px; }

/* --------------------------------------------------------------------------
   14. Modal
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(8, 11, 20, .55);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    /* Kein Scrollen auf dieser Ebene — gescrollt wird ausschließlich .modal-body.
       Sonst wandern Kopf- und Fußzeile beim Scrollen über den Inhalt. */
    overflow: hidden;
}
.modal.is-open { display: flex; }
.modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: 100%;
    min-height: 0;
    background: var(--bg-elevated);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-edge);
    border-radius: var(--r-lg);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--sh-3);
    animation: modal-in .18s var(--ease);
}
.modal-panel--wide { max-width: 860px; }
.modal-panel--narrow { max-width: 460px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }

/* Das Formular liegt zwischen Panel und Kopf/Körper/Fuß — muss die Flex-Kette fortsetzen */
.modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

.modal-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-head h2 { font-size: 16px; flex: 1; min-width: 0; }
.modal-close {
    display: grid; place-items: center;
    width: 32px; height: 32px;
    flex: none;
    border-radius: var(--r-xs);
    color: var(--fg-subtle);
    font-size: 20px;
    line-height: 1;
}
.modal-close:hover { background: var(--surface-2); color: var(--fg); }
.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
}
.modal-foot {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--bar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-foot .spacer { flex: 1; }

/* --------------------------------------------------------------------------
   15. QuickView
   -------------------------------------------------------------------------- */
#quickViewBody { --tone: var(--gc, var(--accent)); }
html[data-theme="dark"] #quickViewBody { --tone: var(--gcd, var(--accent)); }

.qv { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.qv-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.qv-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.qv-title {
    font-size: 21px;
    letter-spacing: -.02em;
    position: relative;
    padding-left: 13px;
}
.qv-title::before {
    content: '';
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 3px;
    border-radius: var(--r-full);
    background: var(--tone);
}
.qv-cover { box-shadow: 0 12px 30px -14px var(--tone); }
.facts .k { color: var(--tone); opacity: .85; }

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px 16px;
    padding: 13px 15px;
    background: var(--surface-2);
    border-radius: var(--r-md);
}
.fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-subtle); font-weight: 600; }
.fact .v { font-size: 13.5px; overflow-wrap: anywhere; }

.qv-block { display: flex; flex-direction: column; gap: 7px; }
.qv-block > .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; color: var(--fg-subtle); }
.qv-desc { font-size: 14px; line-height: 1.62; color: var(--fg-muted); white-space: pre-line; }
.qv-links { display: flex; flex-wrap: wrap; gap: 8px; }

.qv-user {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface-2);
}
.qv-user-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qv-user-row .label { flex: none; min-width: 108px; }
.wish-btn-inline.is-on { color: #e5566f; border-color: currentColor; }
html[data-theme="dark"] .wish-btn-inline.is-on { color: #ff8095; }

.note-box { display: flex; flex-direction: column; gap: 6px; }
.note-saved { font-size: 12px; color: var(--ok); }

.public-note {
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--accent-soft);
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-line;
}

/* Interaktive Sterne */
.rating { display: inline-flex; gap: 2px; }
.rating .star-wrap { position: relative; width: 22px; height: 22px; }
.rating .star-glyph {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: 19px; line-height: 1;
    color: var(--border-strong);
    pointer-events: none;
}
.rating .star-wrap.full .star-glyph { color: var(--star); }
.rating .star-wrap.half .star-glyph::after {
    content: '★';
    position: absolute;
    left: 0; top: 0;
    width: 50%;
    overflow: hidden;
    color: var(--star);
}
.rating .star-wrap.half .star-glyph { position: absolute; }
.rating .star-btn { position: absolute; top: 0; width: 50%; height: 100%; z-index: 1; }
.rating .star-btn.left { left: 0; }
.rating .star-btn.right { right: 0; }
.rating-reset {
    display: grid; place-items: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    color: var(--fg-subtle);
    font-size: 13px;
}
.rating-reset:hover { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------------------
   16. Formular (Admin)
   -------------------------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-hint { font-size: 12px; color: var(--fg-subtle); }
.form-note {
    font-size: 12.5px;
    line-height: 1.45;
    padding: 8px 11px;
    border-radius: var(--r-sm);
    border-left: 3px solid var(--warn);
    background: var(--warn-soft);
    color: var(--fg-muted);
}

.form-section {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg-subtle);
}
.form-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }

input[type="file"].input {
    padding: 6px 10px;
    line-height: 24px;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 10px;
    height: 24px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    background: var(--surface-2);
    color: var(--fg);
    font-size: 12px;
    cursor: pointer;
}

/* Multiselect Plattformen */
.multiselect {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
}
.options-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2px;
    max-height: 190px;
    overflow-y: auto;
    padding-right: 4px;
}
.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 7px;
    border-radius: var(--r-xs);
    font-size: 13px;
    cursor: pointer;
}
.option-item:hover { background: var(--surface-3); }
.option-item.select-all { font-weight: 500; border-bottom: 1px solid var(--border); border-radius: 0; padding-bottom: 8px; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex: none; }

/* Ownership-Zeilen */
.own-rows { display: flex; flex-direction: column; gap: 8px; }
.own-row { display: flex; gap: 8px; align-items: center; }
.own-row .select { flex: 1; min-width: 0; }
.own-row .own-qty { width: 68px; flex: none; text-align: center; }
.own-remove {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    flex: none;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    color: var(--fg-subtle);
    font-size: 16px;
}
.own-remove:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* Tag-Input */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    min-height: 44px;
    max-height: 170px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-elevated);
}
.tags-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tags-input input {
    flex: 1;
    min-width: 130px;
    height: 26px;
    border: 0;
    background: transparent;
    font-size: 13px;
    outline: 0;
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 6px 0 10px;
    border-radius: var(--r-full);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 500;
}
.tag-pill.is-marked { background: var(--danger-soft); color: var(--danger); }
.tag-pill .x { cursor: pointer; font-size: 14px; line-height: 1; opacity: .7; }
.tag-pill .x:hover { opacity: 1; }

/* Suchergebnis-Liste (IGDB) */
.result-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: border-color var(--t), background var(--t);
}
.result-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.result-item img {
    width: 76px; height: 102px;
    flex: none;
    object-fit: cover;
    border-radius: var(--r-sm);
    background: var(--surface-2);
}
.result-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.result-item h3 {
    font-size: 14.5px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.result-id {
    flex: none;
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    padding: 1px 7px;
    border-radius: var(--r-full);
    background: var(--accent-soft);
    color: var(--accent);
}
.result-item p {
    font-size: 12.5px;
    color: var(--fg-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.result-sep { text-align: center; font-size: 12px; color: var(--fg-subtle); padding: 4px 0; }

/* Import-Dropzone */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 20px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface-2);
    text-align: center;
    font-size: 13.5px;
    color: var(--fg-muted);
    transition: border-color var(--t), background var(--t);
}
.dropzone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--fg-subtle); }
.import-result {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    font-size: 13.5px;
}
.import-result pre { font-size: 11.5px; overflow: auto; max-height: 180px; margin-top: 6px; }

/* --------------------------------------------------------------------------
   17. Overlay, Toast, Spinner
   -------------------------------------------------------------------------- */
#loadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(10, 12, 18, .6);
    backdrop-filter: blur(3px);
    color: #fff;
    font-size: 13px;
}
#loadingOverlay.is-open { display: flex; }
.spinner {
    width: 34px; height: 34px;
    border: 3px solid rgba(255, 255, 255, .22);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-spinner {
    width: 13px; height: 13px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}
.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    border-radius: var(--r-full);
    background: var(--grad-accent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 10px 30px -8px var(--accent-ring), var(--sh-3);
    animation: toast-in .25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .qv { grid-template-columns: 160px 1fr; gap: 16px; }
}

@media (max-width: 860px) {
    :root { --bar-h: 56px; }
    .container { padding-inline: 14px; }

    /* Zeile 1: Logo + Suche · Zeile 2: Aktionen über die volle Breite */
    .topbar-inner { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 8px; }
    .brand { order: 1; }
    .search { order: 2; flex: 1 1 auto; min-width: 120px; max-width: none; }
    .topbar-actions { order: 3; flex-basis: 100%; margin-left: 0; justify-content: space-between; gap: 4px; }
    .brand-name { display: none; }
    .user span { display: none; }
    .user { padding: 0 4px; }
    .btn-text { display: none; }
    .topbar-actions .btn { width: 38px; padding: 0; }

    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stat { padding: 11px 12px; gap: 9px; }
    .stat-icon { width: 30px; height: 30px; }
    .stat-val { font-size: 17px; }

    .games[data-view="grid"] { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    /* Schmale Karten: Trennpunkt weg, der Platz gehört dem Genre.
       Genre und Jahr trennen sich über die Textfarbe. */
    .games[data-view="grid"] .card-meta .sep { display: none; }
    .games[data-view="grid"] .card-meta { gap: 6px; }

    .qv { grid-template-columns: 1fr; }
    .qv-cover { max-width: 190px; margin-inline: auto; }

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

    /* Listen-Ansicht wird auf Mobile zur Reihen-Ansicht */
    .games[data-view="list"] .card-meta,
    .games[data-view="list"] .chips { display: none; }
    .games[data-view="list"] .card-title { flex: 1; }
}

@media (max-width: 560px) {
    .games[data-view="rows"] .card-media { width: 72px; }
    .games[data-view="rows"] .chips[data-kind="tags"] { display: none; }
    .modal { padding: 0; }
    .modal-panel { border-radius: 0; border: 0; height: 100%; max-height: 100%; }
    .modal-head, .modal-foot { border-radius: 0; }
    .toast { left: 14px; right: 14px; bottom: 14px; transform: none; justify-content: center; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
}

@media (max-width: 400px) {
    .games[data-view="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .topbar, .filters, .stats, .pagination, .modal, #loadingOverlay { display: none !important; }
}
