:root {
    --cover-size: 200px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --transition: 180ms ease;
    color-scheme: dark;
}

html[data-ui-theme="cinematic"], html:not([data-ui-theme]) {
    --bg: #08111d;
    --bg-soft: #0d1826;
    --surface: #111e2d;
    --surface-raised: #172638;
    --surface-muted: #1b2a3b;
    --text: #f4f7fb;
    --text-muted: #91a1b5;
    --border: rgba(255, 255, 255, .09);
    --accent: #625cff;
    --accent-strong: #7771ff;
    --accent-soft: rgba(98, 92, 255, .18);
    --danger: #ff6471;
    --shadow: 0 18px 50px rgba(0, 0, 0, .28);
    color-scheme: dark;
}

html[data-ui-theme="editorial"] {
    --bg: #f0ece3;
    --bg-soft: #e9e3d8;
    --surface: #faf7f0;
    --surface-raised: #ffffff;
    --surface-muted: #eae4d9;
    --text: #211f1c;
    --text-muted: #746f67;
    --border: rgba(39, 34, 29, .13);
    --accent: #df6e55;
    --accent-strong: #c95741;
    --accent-soft: rgba(223, 110, 85, .14);
    --danger: #b94043;
    --shadow: 0 18px 45px rgba(58, 45, 32, .14);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: background var(--transition), color var(--transition);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .game-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(240px, 520px) 1fr;
    align-items: center;
    gap: 24px;
    padding: 12px 26px;
    background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: block; flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px; object-fit: contain; }
.topbar-search { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 13px; }
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-icon { flex: 0 0 auto; color: var(--text-muted); line-height: 1; pointer-events: none; }
.topbar-search > #filterText { flex: 1 1 auto; min-width: 0; width: 100%; min-height: 42px; height: 42px; padding: 0; color: var(--text); background: transparent; border: 0; border-radius: 0; box-shadow: none; outline: 0; }
.topbar-search > #filterText:focus { border: 0; box-shadow: none; outline: 0; }
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 9px; }
.icon-button, .profile-button, .primary-action, .secondary-action, .danger-action, .text-button, .quick-chip {
    border: 0;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.icon-button { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); }
.icon-button:hover { background: var(--surface-raised); transform: translateY(-1px); }
.primary-action, .secondary-action, .danger-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 17px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.primary-action { color: #fff; background: var(--accent); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent); }
.primary-action:hover { color: #fff; background: var(--accent-strong); transform: translateY(-1px); }
.secondary-action { color: var(--text); background: var(--surface-muted); border: 1px solid var(--border); }
.danger-action { color: #fff; background: var(--danger); }
.deku-action { color: #fff; background: #287f56; border-color: #287f56; white-space: nowrap; }
.deku-action:hover { color: #fff; background: #216a48; border-color: #216a48; transform: translateY(-1px); }
.profile-button { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 4px 12px 4px 5px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: var(--surface); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: linear-gradient(140deg, var(--accent), #39a6a0); font-weight: 800; }

.app-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.filter-panel { position: sticky; top: 72px; align-self: start; height: calc(100vh - 72px); overflow-y: auto; background: var(--bg-soft); border-right: 1px solid var(--border); }
.filter-panel-content { padding: 24px 18px; }
.sidebar-nav { display: grid; gap: 7px; padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.sidebar-nav a, .sidebar-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; color: var(--text-muted); background: transparent; text-align: left; text-decoration: none; cursor: pointer; }
.sidebar-nav a:hover, .sidebar-nav button:hover, .sidebar-nav .active { color: var(--text); background: var(--accent-soft); }
.filter-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 16px; }
.filter-heading h2 { margin: 2px 0 0; font-size: 1.15rem; }
.eyebrow, .section-kicker { color: var(--accent-strong); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.text-button { padding: 3px 0; color: var(--text-muted); background: transparent; font-size: .78rem; }
.text-button:hover { color: var(--accent-strong); }
.filter-fields { display: grid; gap: 14px; }
.filter-fields label, .account-settings > label, .editor-grid label, .igdb-search-fields label { display: grid; gap: 7px; color: var(--text-muted); font-size: .78rem; font-weight: 700; }
input:not([type="range"]):not([type="radio"]):not([type="checkbox"]), select {
    width: 100%;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
}
input:not([type="range"]):not([type="radio"]):not([type="checkbox"]):focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }

.collection-main { min-width: 0; max-width: 1720px; width: 100%; margin: 0 auto; padding: 42px clamp(22px, 3vw, 52px) 80px; }
.collection-header { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.collection-header h1 { margin: 4px 0 4px; font-size: clamp(2rem, 3vw, 3.4rem); line-height: 1; letter-spacing: -.045em; }
.collection-header p { margin: 0; color: var(--text-muted); }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 10px; }
.summary-card { min-width: 120px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.summary-card span { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: .72rem; }
.summary-card strong { font-size: 1.35rem; }
.quick-filters { display: flex; gap: 8px; margin-bottom: 28px; overflow-x: auto; scrollbar-width: none; }
.quick-filters::-webkit-scrollbar { display: none; }
.quick-chip { flex: 0 0 auto; min-height: 37px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); background: var(--surface); font-size: .84rem; }
.quick-chip:hover, .quick-chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.collection-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.collection-toolbar h2 { margin: 2px 0 0; font-size: 1.45rem; letter-spacing: -.025em; }
.toolbar-controls { display: flex; align-items: end; gap: 16px; }
.toolbar-controls label { display: grid; gap: 5px; color: var(--text-muted); font-size: .7rem; }
.sort-control select { min-width: 175px; }
.size-control input { width: 110px; accent-color: var(--accent); }

.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cover-size), 1fr)); gap: clamp(15px, 1.7vw, 25px); padding: 24px 0; }
.game-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); background: var(--surface); cursor: pointer; box-shadow: 0 3px 16px rgba(0, 0, 0, .08); transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.game-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.cover-frame { position: relative; overflow: hidden; }
.game-cover { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; transition: transform 300ms ease; }
.game-card:hover .game-cover { transform: scale(1.025); }
.status-badge { position: absolute; top: 10px; left: 10px; z-index: 4; max-width: calc(100% - 54px); padding: 5px 8px; overflow: hidden; border-radius: 999px; color: #fff; background: rgba(7, 12, 19, .72); backdrop-filter: blur(8px); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.cinematic-overlay { position: absolute; inset: 35% 0 0; display: flex; align-items: end; padding: 16px 14px; background: linear-gradient(transparent, rgba(3, 8, 14, .96)); }
.cinematic-overlay h3 { margin: 0; color: #fff; font-size: .96rem; line-height: 1.25; }
.game-card-body { display: none; padding: 12px; }
.game-card-body h3 { margin: 0 0 8px; overflow: hidden; font-size: .9rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.game-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: .7rem; }
.game-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-meta strong { flex: 0 0 auto; color: #e3a71e; }
.platform-icons { position: absolute; top: 10px; right: 10px; z-index: 5; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.platform-icon-badge { display: grid; place-items: center; width: 27px; height: 27px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; color: #fff; background: rgba(8,15,24,.82); box-shadow: 0 2px 6px rgba(0,0,0,.42); }
.platform-icon { grid-area: 1 / 1; width: 25px; height: 25px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .85)); }
.platform-icon-label { grid-area: 1 / 1; padding: 1px; font-size: .48rem; font-weight: 850; line-height: 1; text-align: center; letter-spacing: -.02em; }
.platform-icon-badge.has-image { overflow: visible; border-color: transparent; background: transparent; box-shadow: none; }
.platform-icon-badge.has-image .platform-icon-label { display: none; }
.empty-state { grid-column: 1 / -1; display: grid; justify-items: center; padding: 90px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); text-align: center; background: var(--surface); }
.empty-state > span { font-size: 3rem; }.empty-state h2 { margin: 14px 0 5px; }.empty-state p { color: var(--text-muted); }.empty-state button { margin-top: 8px; }

/* Editorial Shelf: ein luftigeres, cover-orientiertes Layout ohne Seitenleiste. */
html[data-ui-theme="editorial"] body { background-image: radial-gradient(circle at 15% 0%, rgba(255,255,255,.9), transparent 34%); }
html[data-ui-theme="editorial"] .app-topbar { grid-template-columns: 260px minmax(280px, 500px) 1fr; background: rgba(34, 32, 29, .97); border-color: rgba(255,255,255,.08); }
html[data-ui-theme="editorial"] .app-topbar .brand, html[data-ui-theme="editorial"] .app-topbar .icon-button, html[data-ui-theme="editorial"] .app-topbar .profile-button { color: #fff; }
html[data-ui-theme="editorial"] .app-topbar .topbar-search, html[data-ui-theme="editorial"] .app-topbar .icon-button, html[data-ui-theme="editorial"] .app-topbar .profile-button { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
html[data-ui-theme="editorial"] .app-topbar .topbar-search input { color: #fff; }
html[data-ui-theme="editorial"] .app-topbar .topbar-search input::placeholder, html[data-ui-theme="editorial"] .app-topbar .search-icon { color: rgba(255,255,255,.62); }
html[data-ui-theme="editorial"] .app-layout { display: block; }
html[data-ui-theme="editorial"] .filter-panel { position: static; height: auto; max-width: 1560px; margin: 24px auto 0; overflow: visible; border: 0; background: transparent; }
html[data-ui-theme="editorial"] .filter-panel-content { padding: 15px clamp(22px, 3vw, 52px); }
html[data-ui-theme="editorial"] .sidebar-nav, html[data-ui-theme="editorial"] .filter-heading { display: none; }
html[data-ui-theme="editorial"] .filter-fields { grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 10px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 82%, transparent); }
html[data-ui-theme="editorial"] .collection-main { padding-top: 28px; }
html[data-ui-theme="editorial"] .collection-header h1, html[data-ui-theme="editorial"] .collection-toolbar h2, html[data-ui-theme="editorial"] .modal-title { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
html[data-ui-theme="editorial"] .summary-grid { display: none; }
html[data-ui-theme="editorial"] .quick-filters { margin-bottom: 34px; }
html[data-ui-theme="editorial"] .game-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
html[data-ui-theme="editorial"] .game-card:hover { border: 0; box-shadow: none; }
html[data-ui-theme="editorial"] .cover-frame { border-radius: var(--radius-sm); box-shadow: 0 8px 18px rgba(48, 37, 27, .16); }
html[data-ui-theme="editorial"] .cinematic-overlay { display: none; }
html[data-ui-theme="editorial"] .game-card-body { display: block; }
html[data-ui-theme="editorial"] .status-badge { display: none; }
html[data-ui-theme="editorial"] .platform-icons { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 25px; margin: -4px 3px 0; padding-top: 7px; border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent); }
html[data-ui-theme="editorial"] .platform-icon-badge { width: 24px; height: 24px; color: #28231e; background: rgba(255,255,255,.92); border-color: rgba(42,35,29,.18); box-shadow: 0 2px 5px rgba(48,37,27,.18); }
html[data-ui-theme="editorial"] .platform-icon-badge.has-image { border-color: transparent; background: transparent; box-shadow: none; }
html[data-ui-theme="editorial"] .platform-icon { width: 22px; height: 22px; padding: 3px; filter: none; }

.app-modal { color: var(--text); background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.modal-header, .modal-footer { padding: 20px 24px; border-color: var(--border); }
.modal-header .modal-title { margin-top: 2px; font-size: 1.35rem; }
.modal-body { padding: 24px; }
.btn-close { filter: none; }
html[data-ui-theme="cinematic"] .btn-close { filter: invert(1) grayscale(100%); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.chart-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.chart-card h3 { margin: 0 0 12px; font-size: .9rem; }
.game-editor-head { display: grid; grid-template-columns: minmax(0, 1fr) 145px; gap: 22px; }
.editor-fields { position: relative; min-width: 0; }
.igdb-search-fields { display: grid; grid-template-columns: minmax(0, 1fr) 135px; gap: 12px; }
.editor-fields small, .editor-grid small, .account-settings small { color: var(--text-muted); font-weight: 500; }
#searchResults { left: 0; z-index: 10; display: none; width: 100%; max-height: 230px; overflow-y: auto; }
.metadata-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--border); }
.metadata-panel div { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface); }
.metadata-panel strong { color: var(--text-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.metadata-panel span { min-width: 0; overflow-wrap: anywhere; font-size: .83rem; }
.cover-preview-wrap { display: grid; place-items: center; align-self: start; overflow: hidden; aspect-ratio: 3/4; border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); background: var(--surface); text-align: center; }
.cover-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 16px; margin-top: 20px; }
.editor-primary-fields { display: grid; align-content: start; gap: 16px; }
.editor-primary-fields > label { display: grid; gap: 7px; color: var(--text-muted); font-size: .78rem; font-weight: 700; }
.platform-select { grid-template-rows: auto auto minmax(0, 1fr); }
.platform-select select { height: 100%; min-height: 0; }
.modal-footer { display: flex; justify-content: space-between; }
.modal-footer > div { display: flex; gap: 9px; }
.theme-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; border: 0; }
.theme-picker legend { grid-column: 1 / -1; margin-bottom: 4px; font-size: .82rem; font-weight: 750; }
.theme-option { position: relative; display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option > span:last-child { display: grid; gap: 2px; }.theme-option small { font-size: .68rem; }
.theme-swatch { width: 54px; height: 40px; border-radius: 7px; border: 1px solid rgba(127,127,127,.25); }
.cinematic-swatch { background: linear-gradient(90deg, #0d1826 0 30%, #625cff 30% 38%, #172638 38%); }
.editorial-swatch { background: linear-gradient(90deg, #211f1c 0 25%, #df6e55 25% 33%, #f5f0e7 33%); }
.setting-status { grid-column: 1 / -1; min-height: 18px; margin: 0; color: var(--text-muted); font-size: .75rem; }
.account-settings { display: grid; gap: 14px; }
.account-settings hr { width: 100%; margin: 2px 0; border-color: var(--border); }
.install-setting { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface) 72%, transparent); }
.install-setting > div { display: grid; gap: 3px; }.install-setting small { color: var(--text-muted); font-size: .72rem; }.install-setting .setting-status { min-height: 0; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 5px; padding: 14px; border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--border)); border-radius: 12px; }
.danger-zone > div { display: grid; }.danger-zone small { font-size: .72rem; }
.account-logout-action { justify-self: start; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 34%, var(--border)); }
.mobile-nav, .mobile-add { display: none; }

/* Authentifizierung nutzt denselben visuellen Unterbau. */
body.vh-100 { background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 42%), var(--bg); }
body.vh-100 > .card { border-color: var(--border) !important; border-radius: var(--radius-lg); background: var(--surface-raised) !important; box-shadow: var(--shadow) !important; }
body.vh-100 .form-check { display: flex; align-items: center; gap: 9px; padding-left: 0; }
body.vh-100 .form-check-input { flex: 0 0 auto; float: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 5px; background-color: var(--surface); cursor: pointer; }
body.vh-100 .form-check-input:checked { border-color: var(--accent); background-color: var(--accent); }
body.vh-100 .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body.vh-100 .form-check-label { cursor: pointer; }

@media (min-width: 992px) {
    .filter-panel.collapse { display: block !important; }
}

@media (max-width: 1199.98px) {
    .app-topbar { grid-template-columns: 210px minmax(220px, 1fr) auto; gap: 14px; padding-inline: 18px; }
    .profile-name { display: none; }.profile-button { padding-right: 5px; }
    .app-layout { grid-template-columns: 235px minmax(0, 1fr); }
    .filter-panel-content { padding-inline: 14px; }
}

@media (max-width: 991.98px) {
    body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .app-topbar, html[data-ui-theme="editorial"] .app-topbar { grid-template-columns: 1fr auto; min-height: 64px; padding: 10px 14px; }
    .brand { font-size: .92rem; }.brand-mark { width: 36px; height: 36px; }
    .topbar-search { grid-column: 1 / -1; grid-row: 2; }
    .topbar-actions .icon-button, .desktop-action, .profile-button { display: none; }
    .app-layout, html[data-ui-theme="editorial"] .app-layout { display: block; min-height: 0; }
    .filter-panel, html[data-ui-theme="editorial"] .filter-panel { position: static; width: auto; height: auto; margin: 0; overflow: visible; border: 0; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
    .filter-panel-content, html[data-ui-theme="editorial"] .filter-panel-content { padding: 18px; }
    .filter-panel.collapsing, html[data-ui-theme="editorial"] .filter-panel.collapsing { height: 0; overflow: hidden; transition: height .35s ease; }
    html[data-ui-theme="editorial"] .filter-panel { background: var(--surface); }
    .sidebar-nav, html[data-ui-theme="editorial"] .sidebar-nav { display: none; }
    .filter-heading, html[data-ui-theme="editorial"] .filter-heading { display: flex; }
    .filter-fields, html[data-ui-theme="editorial"] .filter-fields { grid-template-columns: repeat(2, 1fr); padding: 0; border: 0; background: transparent; }
    .collection-main { padding: 28px 16px 50px; }
    .collection-header { align-items: start; }.collection-header h1 { font-size: 2.1rem; }
    .summary-grid { grid-template-columns: repeat(3, 1fr); width: 100%; }
    .summary-card { min-width: 0; padding: 11px; }.summary-card strong { font-size: 1.1rem; }
    .collection-toolbar { align-items: start; }.size-control { display: none !important; }
    .grid-container { --cover-size: 150px !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .account-logout-action { width: 100%; }
    .mobile-nav { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 1030; display: grid; grid-template-columns: repeat(4, 1fr); width: min(460px, calc(100% - 24px)); min-height: 50px; padding: 4px 5px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--border) 78%, var(--accent) 22%); border-radius: 19px; background: color-mix(in srgb, var(--surface-raised) 88%, transparent); box-shadow: 0 14px 38px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.14); backdrop-filter: saturate(145%) blur(22px); transform: translateX(-50%); }
    .mobile-nav a, .mobile-nav button { display: grid; min-height: 42px; place-items: center; gap: 1px; padding: 2px 5px; border: 0; border-radius: 14px; color: var(--text-muted); background: transparent; text-decoration: none; font-size: .58rem; line-height: 1; transition: color var(--transition), background var(--transition), transform var(--transition); }
    .mobile-nav a:active, .mobile-nav button:active { transform: scale(.96); }
    .mobile-nav span { font-size: 1rem; }.mobile-nav .active { color: var(--accent-strong); background: var(--accent-soft); }
    .mobile-add { position: fixed; right: max(18px, calc((100vw - 460px) / 2 + 12px)); bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 1031; display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid color-mix(in srgb, #fff 24%, transparent); border-radius: 50%; color: #fff; background: var(--accent); box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 42%, transparent); font-size: 1.6rem; }
}

@media (max-width: 680px) {
    .collection-header { display: block; }.summary-grid { margin-top: 20px; }
    .quick-filters { margin-bottom: 22px; }
    .collection-toolbar h2 { font-size: 1.25rem; }.sort-control > span { display: none; }.sort-control select { min-width: 155px; }
    .grid-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
    .game-card { border-radius: 12px; }.cinematic-overlay { padding: 13px 10px; }.cinematic-overlay h3 { font-size: .8rem; }
    .status-badge { font-size: .58rem; }.platform-icon-badge { width: 23px; height: 23px; }.platform-icon { width: 21px; height: 21px; }
    html[data-ui-theme="editorial"] .game-card-body { padding: 9px 3px; }
    .stats-grid { grid-template-columns: 1fr; }
    .game-editor-head { grid-template-columns: 1fr 92px; gap: 12px; }
    .igdb-search-fields { grid-template-columns: 1fr; }
    .metadata-panel { grid-template-columns: 1fr; max-height: 215px; overflow-y: auto; }
    #searchResults { width: calc(100% + 104px); }
    .editor-grid { grid-template-columns: 1fr; }.platform-select select { height: auto; min-height: 132px; }
    .theme-picker { grid-template-columns: 1fr; }.setting-status { grid-column: 1; }
    .install-setting { align-items: stretch; flex-direction: column; }
    .danger-zone { align-items: stretch; flex-direction: column; }
    .modal-dialog { margin: 10px; }.modal-body, .modal-header, .modal-footer { padding: 17px; }
    .mobile-grid-footer { align-items: stretch; flex-direction: column; }
    .mobile-grid-footer > div { display: grid; width: 100%; }
    .mobile-grid-footer .external-actions { grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(112px, 1.2fr); }
    .mobile-grid-footer .save-actions { grid-template-columns: repeat(2, 1fr); }
    .mobile-grid-footer .primary-action, .mobile-grid-footer .secondary-action, .mobile-grid-footer .danger-action { padding-inline: 8px; font-size: .82rem; }
    #adminUserList .d-flex { flex-wrap: wrap !important; }
    #adminUserList input { flex: 1 1 100% !important; width: 100% !important; }
}

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

/* Discovery is an independent view; collection filters never target its cards. */
[hidden] { display: none !important; }
.discovery-tabs { display: flex; gap: 24px; padding: 0 clamp(22px, 3vw, 52px); background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.discovery-tabs a { padding: 13px 0; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; }
.discovery-tabs .active { color: var(--accent-strong); border-color: var(--accent); }
.discovering .app-layout { display: block; }
.discovering .filter-panel, .discovering .mobile-add, .discovering .desktop-action { display: none !important; }
.discovering .topbar-search { visibility: hidden; }
.discovery-main { max-width: 1560px; margin: auto; padding: 32px clamp(22px, 3vw, 52px) 100px; }
.discovery-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.discovery-heading h1 { margin: 6px 0 12px; font-size: clamp(1.65rem, 3vw, 2.4rem); }
.discovery-heading p, #discoverStatus, .discovery-credit { color: var(--text-muted); font-size: .85rem; }
.discovery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 28px 20px; padding: 18px 0; }
.discovery-card { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.discovery-cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 14px; background: var(--surface-muted); }
.discovery-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.discovery-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); }
.discovery-rank { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 7px; color: #fff; background: rgba(8,17,29,.88); font-size: .8rem; }
.discovery-card h2 { font-size: 1rem; line-height: 1.4; margin: 3px 0 0; overflow-wrap: anywhere; }
.discovery-card p { font-size: .78rem; color: var(--text-muted); margin: 0; }
.discovery-card .discovery-rating { margin-top: auto; padding-top: 4px; }
.discovery-card button, .discovery-owned { margin-top: 4px; min-height: 42px; }
.discovery-owned { color: var(--accent-strong); font-size: .85rem; display: flex; align-items: center; }
.discovery-credit { text-align: right; }
.discovery-credit a { color: var(--accent-strong); }
html[data-ui-theme="editorial"] .discovery-heading h1 { font-family: Georgia, serif; }
@media(max-width: 991.98px) {
    .discovery-tabs { display: none; }
    .mobile-nav { grid-template-columns: repeat(5, 1fr); }
    .discovery-main { padding: 24px 16px 100px; }
    .discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
    .discovering .topbar-search { display: none; }
}
@media(min-width: 992px) {
    .discovery-tabs { position: sticky; top: 72px; z-index: 1010; }
    .discovery-main { scroll-margin-top: 124px; }
}
