/* Tischbande Designsystem 2.0 – verbindliche helle und dunkle Mockup-Optik */
:root {
  --bg: #f5f1e9;
  --surface: #fffdf9;
  --surface-soft: #f7f3eb;
  --surface-raised: #ffffff;
  --text: #20251f;
  --muted: #73796f;
  --primary: #1f563f;
  --primary-hover: #174733;
  --primary-soft: #e4eee8;
  --accent: #d5a43b;
  --border: #e5dfd4;
  --border-strong: #d8d0c3;
  --danger: #a65145;
  --shadow-sm: 0 2px 10px rgba(52, 57, 43, .045);
  --shadow-md: 0 16px 42px rgba(52, 57, 43, .09);
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
}

html[data-theme="dark"] {
  --bg: #101512;
  --surface: #171d19;
  --surface-soft: #1c231e;
  --surface-raised: #202822;
  --text: #f0f1e9;
  --muted: #a4aa9f;
  --primary: #9eb37d;
  --primary-hover: #b1c58f;
  --primary-soft: #24372d;
  --accent: #d5a43b;
  --border: #303830;
  --border-strong: #404940;
  --danger: #d47f70;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .18);
  --shadow-md: 0 18px 54px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #101512;
    --surface: #171d19;
    --surface-soft: #1c231e;
    --surface-raised: #202822;
    --text: #f0f1e9;
    --muted: #a4aa9f;
    --primary: #9eb37d;
    --primary-hover: #b1c58f;
    --primary-soft: #24372d;
    --accent: #d5a43b;
    --border: #303830;
    --border-strong: #404940;
    --danger: #d47f70;
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, .18);
    --shadow-md: 0 18px 54px rgba(0, 0, 0, .35);
  }
}

body,
body.signed-in {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button, .button, input, select, textarea { font: inherit; }
button, .button { transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease; }
button:hover, .button:hover { background: var(--primary-hover); transform: translateY(-1px); }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sidebar {
  width: 232px;
  padding: 27px 17px 18px;
  background: var(--surface);
  border-color: var(--border);
}

.app-content { margin-left: 232px; background: var(--bg); }
.brand { gap: 11px; color: var(--text); letter-spacing: -.02em; }
.brand-mark {
  width: 38px;
  height: 42px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, var(--surface-soft), var(--primary-soft));
  color: var(--primary);
}
.brand-mark img { display: block; width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.placeholder img { width: 46% !important; height: 46% !important; object-fit: contain !important; opacity: .82; }
.game-media .placeholder {
  position: relative;
  display: grid !important;
  place-items: center !important;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb,var(--primary) 15%,transparent), transparent 42%),
    linear-gradient(145deg,var(--surface-soft),color-mix(in srgb,var(--primary-soft) 72%,var(--surface)));
}
.game-media .placeholder::before,
.game-media .placeholder::after {
  content: '';
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb,var(--primary) 16%,transparent);
  border-radius: 50%;
}
.game-media .placeholder::after { width: 50%; border-color: color-mix(in srgb,var(--accent) 20%,transparent); }
.game-media .placeholder img {
  position: relative;
  z-index: 1;
  display: block;
  width: 54% !important;
  height: 54% !important;
  margin: 0 !important;
  padding: 0 !important;
  object-position: center !important;
  filter: drop-shadow(0 8px 14px color-mix(in srgb,var(--primary) 15%,transparent));
}
.mini-placeholder img { width: 72%; height: 72%; object-fit: contain; }
.hero .brand-hero-symbol { display: block; width: 86px; height: 86px; margin-left: auto; object-fit: contain; }
.brand small { color: var(--muted); letter-spacing: 0; }

.side-nav { gap: 4px; margin-top: 34px; }
.side-nav a {
  min-height: 41px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .82rem;
  font-weight: 560;
}
.side-nav a:hover { background: var(--surface-soft); border-color: var(--border); }
.side-nav a.active { background: var(--primary-soft); color: var(--text); border-color: transparent; }
.side-nav a span { display: grid; place-items: center; width: 20px; color: var(--primary); }
.side-nav .side-add { margin-bottom: 12px; background: var(--primary); color: #fff; border: 0; }
.side-nav .side-add:hover { background: var(--primary-hover); }
.side-nav .side-add span { color: #fff; }

.ui-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .ui-icon { width: 23px; height: 27px; }

.side-profile { padding: 15px 5px 4px; border-color: var(--border); }
.profile-link { border: 1px solid transparent; }
.profile-link:hover, .profile-link:focus-visible, .profile-link.active { background: var(--surface-soft); border-color: var(--border); }
.avatar { background: var(--primary); color: #fff; }
.logout-button { border-color: var(--border); color: var(--muted); }

.topbar {
  height: 70px;
  padding: 0 30px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-color: var(--border);
  backdrop-filter: blur(16px);
}
.topbar > div strong { font-size: 1.22rem; letter-spacing: -.02em; }

.signed-in main { max-width: 1160px; padding: 24px 28px 64px; }
h1 { font-size: clamp(1.55rem, 2.3vw, 2.05rem); letter-spacing: -.035em; }
h2 { color: var(--text); }
.eyebrow { color: var(--primary); font-weight: 700; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 23px 27px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(108deg, var(--surface), color-mix(in srgb,var(--primary-soft) 72%,var(--surface-soft)));
  box-shadow: var(--shadow-sm);
}
.hero::after {
  content: '';
  position: absolute;
  right: 4%;
  bottom: -68px;
  width: 260px;
  height: 150px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--primary) 12%, transparent), transparent 68%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 1.35rem; }
.hero p { color: var(--muted); }
.hero .shelf { color: var(--primary); filter: saturate(.7); }
.welcome-gathering { display: block; width: min(240px,100%); height: auto; margin-left: auto; filter: drop-shadow(0 12px 18px color-mix(in srgb,var(--primary) 18%,transparent)); }

.dashboard-stats { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 11px; }
.dashboard-stats a { position: relative; min-height: 108px; overflow: hidden; padding: 15px; box-shadow: var(--shadow-sm); isolation: isolate; }
.dashboard-stats a::before { content: ''; position: absolute; z-index: -1; right: -34px; bottom: -42px; width: 105px; height: 105px; border: 1px solid color-mix(in srgb,var(--primary) 18%,transparent); border-radius: 50%; background: radial-gradient(circle,color-mix(in srgb,var(--primary) 9%,transparent),transparent 68%); transition: transform .25s ease,opacity .25s ease; }
.dashboard-stats a:hover::before { transform: scale(1.18); opacity: .9; }
.dashboard-stats a:hover { border-color: var(--border-strong); background: var(--surface-raised); transform: translateY(-2px); }
.dashboard-stats strong { margin: 7px 0 3px; font-size: 1.65rem; font-weight: 650; }
.dashboard-stats em { color: var(--primary); }
.dashboard-add-card { border-color: var(--primary) !important; background: var(--primary) !important; color: #fff !important; }
.dashboard-add-card:hover { border-color: var(--primary-hover) !important; background: var(--primary-hover) !important; }
.dashboard-add-card small, .dashboard-add-card em { color: #f4f7ef !important; opacity: 1; }
.dashboard-add-card strong { max-width: calc(100% - 33px); color: #fff !important; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.dashboard-add-card .stat-icon { background: #ffffff22 !important; color: #fff !important; }
.stat-icon { right: 14px; top: 13px; color: var(--accent); }
.stat-icon img { display: block; width: 35px; height: 35px; object-fit: contain; }

.dashboard-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 11px; }
.dashboard-list { min-width: 0; padding: 14px; box-shadow: none; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-title h2 { margin: 0; font-size: .83rem; }
.panel-title a { color: var(--primary); font-size: .65rem; text-decoration: none; }
.mini-game { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); }
.mini-game:last-child { border-bottom: 0; }
.mini-game img, .mini-placeholder { width: 34px; height: 38px; border-radius: 5px; object-fit: cover; }
.mini-placeholder { display: grid; place-items: center; background: var(--surface-soft); font-size: 1rem; }
.mini-game > span:not(.mini-placeholder) { display: grid; min-width: 0; }
.mini-game strong { overflow: hidden; color: var(--text); font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }
.mini-game small, .mini-game time { color: var(--muted); font-size: .58rem; }
.panel-empty { margin: 18px 0; color: var(--muted); font-size: .72rem; }

.dashboard-library { margin-top: 27px; }
.dashboard-library > .section-heading { margin-bottom: 12px; }
.section-heading h1, .section-heading h2 { letter-spacing: -.025em; }
.info-button { color: var(--primary); }

.filters {
  grid-template-columns: minmax(210px, 2fr) repeat(3, minmax(82px, 1fr)) auto auto auto;
  gap: 10px;
  padding: 13px;
  background: var(--surface);
  box-shadow: none;
}
.filters label { color: var(--muted); font-size: .72rem; font-weight: 650; }
.filters input, .filters select { min-height: 38px; background: var(--surface-soft); }

input, select, textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }

.games { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; margin-top: 15px; }
.game {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-width: 1px;
  border-color: var(--border);
  border-radius: 15px;
  background: var(--surface);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.game:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.game img, .game .placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-bottom: 1px solid var(--border);
}
.game-body { display: flex; flex: 1; flex-direction: column; padding: 10px; }
.game h3 { margin: 7px 0 4px; font-size: .91rem; line-height: 1.25; }
.game p { margin: 3px 0; color: var(--muted); font-size: .69rem; line-height: 1.5; }
.game-body small { margin-top: auto; padding-top: 5px; color: var(--muted); }
.game-body form, .game-body > p:last-child { margin: 8px 0 0; }
.game-body .button, .game-body button { width: 100%; text-align: center; }
.location-badge { align-self: flex-start; background: var(--primary-soft); color: var(--primary); font-size: .65rem; }

.game-media { position: relative; overflow: hidden; aspect-ratio: 1 / 1; background: linear-gradient(145deg,var(--surface-soft),color-mix(in srgb,var(--primary-soft) 38%,var(--surface))); }
.game-media > img { width: 100%; height: 100%; padding: 7px; object-fit: contain; object-position: center; }
.game-media > img { display: block; border-bottom: 1px solid var(--border); }
.game-media .placeholder { display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.game-body > h3 { margin: 8px 0 7px; }
.game-facts { display: grid; gap: 4px; color: var(--muted); font-size: .66rem; }
.game-facts > span { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; }
.game-facts > span:first-child { align-items: flex-start; white-space: normal; }
.game-info-icon { flex: 0 0 13px; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.game-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: auto; padding-top: 10px; }
.game-card-footer .location-badge { min-width: 0; }
.game-owner-chip { position: absolute; z-index: 2; left: 8px; top: 8px; max-width: calc(100% - 52px); overflow: hidden; padding: 5px 8px 5px 20px; border: 1px solid color-mix(in srgb,var(--border) 70%,transparent); border-radius: 999px; background: color-mix(in srgb,var(--surface-raised) 84%,transparent); color: var(--text); font-size: .62rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(12px); }
.game-owner-chip::before { content: ''; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px color-mix(in srgb,var(--primary) 60%,transparent); transform: translateY(-50%); }
.state-other-available .game-owner-chip::before,.state-other-unavailable .game-owner-chip::before { background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb,var(--accent) 60%,transparent); }
.state-borrowed-by-us .game-owner-chip::before { background: #6f9fae; box-shadow: 0 0 8px #6f9fae88; }
.game-like-button { position: absolute; z-index: 3; right: 8px; top: 8px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid color-mix(in srgb,var(--border) 70%,transparent); border-radius: 50%; background: color-mix(in srgb,var(--surface-raised) 86%,transparent); color: var(--primary); box-shadow: 0 5px 16px #0002; backdrop-filter: blur(12px); }
.game-like-button:hover { background: var(--surface-raised); transform: scale(1.06); }
.game-like-button .game-info-icon { width: 18px; height: 18px; transition: fill .18s ease,transform .18s ease; }
.game-like-button.is-liked { color: #c65f56; }
.game-like-button.is-liked .game-info-icon { fill: currentColor; transform: scale(1.08); }
.game-like-button.is-saving { opacity: .55; cursor: wait; }
.game-like-label { color: var(--muted); font-size: .64rem; }
.game:has(.game-like-button.is-liked) .game-like-label { color: #c65f56; font-weight: 700; }
.liked-filter { white-space: nowrap; }
.game-card-action { margin-top: 7px !important; }
.game-card-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(82px,1fr)); gap: 7px; margin-top: auto; }
.game-card-actions .game-card-action { width: 100%; }
.game-card-actions .game-card-action.button, .game-card-actions .game-card-action button { width: 100%; }
.game-card-actions .return-button { background: #4f86b5; border-color: #4f86b5; color: #fff; }
.game-card-actions .return-button:hover { background: #3f739f; border-color: #3f739f; color: #fff; }
.statistics-heading { margin-bottom: 18px; }
.statistics-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.statistics-summary .card { display: grid; align-content: center; min-height: 118px; }
.statistics-summary small, .statistics-summary span { color: var(--muted); }
.statistics-summary strong { margin-top: 6px; font-size: clamp(1.35rem,2.5vw,2.2rem); }
.statistics-summary .newest-summary strong { font-size: clamp(1.05rem,1.8vw,1.45rem); }
.statistics-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.statistics-panel h2 { margin-top: 0; }
.stat-bar { display: grid; gap: 6px; margin-top: 15px; }
.stat-bar > span { display: flex; justify-content: space-between; gap: 15px; font-size: .86rem; }
.stat-bar b { color: var(--primary); }
.stat-bar > i { display: block; height: 9px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.stat-bar > i > em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),var(--primary2)); }
.category-filter-empty { grid-column: 1/-1; margin: 10px 0; color: var(--muted); text-align: center; }
@media (max-width:700px){.statistics-summary{grid-template-columns:1fr 1fr}.statistics-summary .newest-summary{grid-column:1/-1}.statistics-grid{grid-template-columns:1fr}}
.game-body > .game-card-action.button, .game-card-action button { min-height: 31px; padding: 6px 9px; border-radius: 8px; font-size: .69rem; }
.game-card-action input { display: none; }
.category-picker { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-soft); }
.category-picker legend { padding: 0 5px; color: var(--text); font-size: .82rem; font-weight: 750; }
.category-chip { position: relative; display: inline-flex; cursor: pointer; }
.category-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.category-chip span { display: inline-flex; align-items: center; min-height: 31px; padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .73rem; font-weight: 600; transition: .16s ease; }
.category-chip input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-hover); }
.category-chip input:focus-visible + span { outline: 3px solid color-mix(in srgb,var(--primary) 30%,transparent); outline-offset: 2px; }
.filter-category-picker { position: relative; align-self: end; }
.filter-category-picker summary { display: flex; align-items: center; min-height: 38px; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text); cursor: pointer; font-size: .78rem; font-weight: 500; list-style: none; }
.filter-category-picker summary::-webkit-details-marker { display: none; }
.filter-category-picker summary::after { content: '⌄'; margin-left: auto; color: var(--muted); }
.category-filter-options { position: absolute; z-index: 25; left: 0; top: calc(100% + 7px); display: flex; flex-wrap: wrap; gap: 7px; width: min(430px,calc(100vw - 30px)); padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-md); }
.category-filter-title, .category-filter-done, .category-filter-cancel { display: none; }
.busy-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 24px; background: color-mix(in srgb,var(--bg) 68%,transparent); color: var(--text); text-align: center; opacity: 0; backdrop-filter: blur(8px); transition: opacity .18s ease; }
.busy-overlay[hidden] { display: none; }
.busy-overlay.is-visible { opacity: 1; }
.busy-overlay strong { font-size: .95rem; }
.busy-overlay small { color: var(--muted); font-size: .72rem; }
.busy-spinner { position: relative; display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 5px; border-radius: 50%; background: radial-gradient(circle at 50% 48%,#8da56e 0,#1f563f 54%,#163d2d 100%); box-shadow: 0 0 0 1px #ffffff24,0 0 32px color-mix(in srgb,#8da56e 48%,transparent),0 18px 38px #0003; }
.busy-spinner::before,.busy-spinner::after { content: ''; position: absolute; inset: -8px; border: 1px solid color-mix(in srgb,#d5a43b 58%,transparent); border-radius: 50%; animation: busy-hologram 1.5s ease-in-out infinite; }
.busy-spinner::after { inset: -15px; border-color: color-mix(in srgb,#d77d62 38%,transparent); animation-delay: -.75s; }
.busy-spinner img { display: block; width: 68px; height: 68px; animation: busy-spin 1.45s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-hologram { 0%,100% { transform: scale(.94); opacity: .28; } 50% { transform: scale(1.04); opacity: .78; } }

.auth-tischbande { position: relative; overflow: hidden; padding-top: 126px; }
.auth-tischbande::before { content: ''; position: absolute; inset: 0 0 auto; height: 112px; background: linear-gradient(135deg,color-mix(in srgb,var(--primary) 13%,var(--surface)),color-mix(in srgb,var(--accent) 12%,var(--surface))); border-bottom: 1px solid var(--border); }
.auth-brand-art { position: absolute; z-index: 1; top: 14px; left: 50%; width: 205px; height: 94px; transform: translateX(-50%); filter: drop-shadow(0 8px 16px color-mix(in srgb,var(--primary) 16%,transparent)); }

@media (prefers-reduced-motion: reduce) {
  .busy-spinner img { animation-duration: 3s; }
  .busy-spinner::before,.busy-spinner::after { animation: none; }
}
.delete-game-form { max-width: 480px; margin: 14px auto 5vh; padding: 16px; border: 1px solid color-mix(in srgb,var(--danger) 42%,var(--border)); border-radius: 13px; background: var(--surface); }
.delete-game-form small { color: var(--muted); }
.danger-button { background: var(--danger); }
.danger-button:hover { background: color-mix(in srgb,var(--danger) 82%,#000); }

.game.state-own-home { border-color: #8ba476; background: var(--surface); }
.game.state-own-lent { border-color: #bd8650; background: color-mix(in srgb, var(--surface) 96%, #c67f38); }
.game.state-other-available { border-color: #c5aa68; background: color-mix(in srgb, var(--surface) 96%, #d7b354); }
.game.state-borrowed-by-us { border-color: #789ead; background: color-mix(in srgb, var(--surface) 96%, #6f9fae); }
.game.state-other-unavailable { border-color: var(--border-strong); background: var(--surface-soft); opacity: .72; }

.secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.secondary:hover { background: var(--primary-soft); color: var(--text); }
.flash { border: 1px solid currentColor; box-shadow: var(--shadow-sm); }

.settings { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.settings > .card { padding: 18px; }
.member-invite, .notification-option, .connected-family { background: var(--surface-soft); border-color: var(--border); }
.notification-channels { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 0 0 17px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; }
.notification-channels legend { padding: 0 6px; font-size: .78rem; font-weight: 750; }
.notification-option.is-disabled { opacity: .55; }
.push-device-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 17px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--primary-soft); }
.push-device-card > div { display: grid; gap: 3px; }
.push-device-card strong { font-size: .78rem; }
.push-device-card small { color: var(--muted); font-size: .68rem; }
.push-device-card button { flex: 0 0 auto; }
.push-device-card button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; cursor: wait; opacity: .9; }
.push-device-card button.is-loading::before { content: ""; width: 1rem; height: 1rem; flex: 0 0 1rem; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; animation: push-button-spin .75s linear infinite; }
@keyframes push-button-spin { to { transform: rotate(360deg); } }
.notification-events-title { margin: 8px 0; font-size: .88rem; }

.add-drawer[open] { background: var(--surface); border-color: var(--border); box-shadow: -20px 0 65px rgba(0, 0, 0, .2); }
.add-drawer[open] > summary { background: var(--surface); border-color: var(--border); }
.form-step { background: var(--primary-soft); }
fieldset[data-game-details] { background: var(--surface-soft); border-color: var(--border); }
.lookup-dialog, .legend-dialog { background: var(--surface-raised); border-color: var(--border); }

.bottom-nav { background: color-mix(in srgb, var(--surface) 94%, transparent); border-color: var(--border); }
.bottom-nav a { color: var(--muted); }
.bottom-nav a.active { color: var(--primary); }

.notification-center { position: relative; z-index: 5; margin-left: auto; }
.notification-bell { position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--text); }
.notification-bell:hover { border-color: var(--border); background: var(--surface-soft); transform: none; }
.notification-bell b { position: absolute; right: -1px; top: -2px; min-width: 17px; height: 17px; padding: 1px 4px; border: 2px solid var(--surface); border-radius: 999px; background: #c96755; color: #fff; font-size: .56rem; line-height: 12px; text-align: center; }
.notification-panel { position: absolute; right: 0; top: 46px; width: min(380px, calc(100vw - 28px)); overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-raised); box-shadow: var(--shadow-md); }
.notification-panel > header { position: static; display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid var(--border); background: transparent; }
.notification-panel > header button { padding: 4px; background: transparent; color: var(--primary); font-size: .65rem; }
.notification-list { max-height: min(520px, 70vh); overflow: auto; }
.notification-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: start; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.notification-item:hover { background: var(--surface-soft); }
.notification-item.is-unread { background: color-mix(in srgb, var(--primary-soft) 62%, var(--surface)); }
.notification-item i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-style: normal; }
.notification-item > span { display: grid; min-width: 0; }
.notification-item strong { font-size: .72rem; }
.notification-item small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: .62rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.notification-item time { color: var(--muted); font-size: .58rem; }
.notification-empty { padding: 22px 14px; color: var(--muted); text-align: center; }
.toast-stack { position: fixed; z-index: 300; right: 20px; top: 82px; display: grid; gap: 9px; width: min(360px, calc(100vw - 28px)); }
.app-toast { position: relative; display: grid; gap: 3px; padding: 13px 42px 13px 14px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-md); color: var(--text); opacity: 0; transform: translateX(18px); transition: opacity .2s ease, transform .2s ease; }
.app-toast.is-visible { opacity: 1; transform: translateX(0); }
.app-toast strong { font-size: .78rem; }
.app-toast span { color: var(--muted); font-size: .67rem; }
.app-toast button { position: absolute; right: 8px; top: 7px; padding: 3px 7px; background: transparent; color: var(--muted); font-size: 1rem; }

@media (max-width: 1180px) {
  .games { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .sidebar { width: 200px; }
  .app-content { margin-left: 200px; }
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: 2fr 1fr 1fr; }
}

@media (max-width: 760px) {
  .app-content { margin-left: 0; }
  .topbar { height: 62px; padding: 0 14px; }
  .signed-in main { padding: 16px 13px 28px; }
  .hero { padding: 18px; }
  .hero .eyebrow { margin-top: 0; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dashboard-stats a { min-height: 96px; padding: 12px; }
  .dashboard-stats .dashboard-add-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 54px 12px 18px; text-align: center; }
  .dashboard-add-card small, .dashboard-add-card em { display: none; }
  .dashboard-add-card strong { margin: 0; font-size: .88rem; }
  .dashboard-add-card .stat-icon { right: 14px; top: 50%; transform: translateY(-50%); }
  .topbar .top-add { display: none !important; }
  .filter-category-picker[open]::before { content: ''; position: fixed; z-index: 210; inset: 0; background: #1119; backdrop-filter: blur(2px); }
  .filter-category-picker .category-filter-options { position: fixed; z-index: 220; left: 50%; top: 50%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(430px,calc(100vw - 26px)); max-height: min(620px,82dvh); padding: 18px 15px 15px; overflow-y: auto; border-radius: 17px; transform: translate(-50%,-50%); }
  .category-filter-title { display: block; grid-column: 1 / -1; margin: 0 0 4px; font-size: 1rem; }
  .category-filter-cancel { position: absolute; right: 12px; top: 11px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 1.35rem; }
  .category-filter-title { padding-right: 38px; }
  .filter-category-picker .category-chip, .filter-category-picker .category-chip span { width: 100%; min-width: 0; }
  .filter-category-picker .category-chip span { justify-content: center; min-height: 39px; padding: 7px 5px; text-align: center; white-space: normal; }
  .category-filter-done { display: block; grid-column: 1 / -1; width: 100%; margin-top: 5px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 11px; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .game { display: flex; }
  .game img, .game .placeholder { min-height: 0; aspect-ratio: 1 / 1; }
  .game-body { padding: 9px; }
  .game h3 { font-size: .86rem; }
  .game p { font-size: .65rem; }
  .settings { grid-template-columns: 1fr; }
  .dashboard-panels { grid-template-columns: 1fr; }
  .notification-panel { position: fixed; right: 12px; top: 58px; }
  .notification-channels { grid-template-columns: 1fr; }
  .push-device-card { align-items: stretch; flex-direction: column; }
  .toast-stack { left: 14px; right: 14px; top: 72px; width: auto; }
  .bottom-nav { height: 68px; }
  .bottom-nav .ui-icon { width: 20px; height: 20px; }
}

@media (max-width: 390px) {
  .games { gap: 7px; }
  .game-body { padding: 8px; }
  .location-badge { font-size: .59rem; }
}

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

/* Desktop-Skalierung: Die Anwendung soll große Browserfenster sichtbar ausfüllen. */
@media (min-width: 761px) {
  body.signed-in { font-size: 15.5px; }
  .sidebar { width: 244px; padding: 31px 20px 21px; }
  .app-content { margin-left: 244px; }
  .brand { font-size: 1.18rem; }
  .brand-mark { width: 42px; height: 47px; }
  .brand small { font-size: .64rem; }
  .side-nav { margin-top: 39px; }
  .side-nav a { min-height: 45px; padding: 10px 13px; font-size: .88rem; }
  .side-nav a span { width: 22px; }
  .side-nav .ui-icon { width: 20px; height: 20px; }
  .topbar { height: 78px; padding: 0 38px; }
  .topbar > div strong { font-size: 1.38rem; }
  .signed-in main { width: 100%; max-width: 1480px; padding: 32px 38px 76px; }
  .hero { min-height: 154px; padding: 29px 33px; }
  .hero h1 { font-size: 1.58rem; }
  .hero p { font-size: .9rem; }
  .hero .shelf { font-size: 3.8rem; }
  .dashboard-stats { gap: 14px; margin-top: 16px; }
  .dashboard-stats a { min-height: 123px; padding: 19px; }
  .dashboard-stats small { font-size: .8rem; }
  .dashboard-stats strong { font-size: 2rem; }
  .dashboard-stats em { font-size: .76rem; }
  .stat-icon .ui-icon { width: 22px; height: 22px; }
  .dashboard-panels { gap: 14px; margin-top: 14px; }
  .dashboard-list { padding: 18px; }
  .panel-title h2 { font-size: .94rem; }
  .mini-game { grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; padding: 8px 2px; }
  .mini-game img, .mini-placeholder { width: 42px; height: 47px; }
  .mini-game strong { font-size: .79rem; }
  .mini-game small, .mini-game time { font-size: .66rem; }
  .dashboard-library { margin-top: 34px; }
  .dashboard-library > .section-heading h2 { font-size: 1.4rem; }
  .filters { grid-template-columns: minmax(210px,2fr) minmax(175px,1.4fr) repeat(3,minmax(80px,1fr)) auto auto; gap: 13px; padding: 16px; }
  .filters label { font-size: .78rem; }
  .filters input, .filters select { min-height: 44px; }
  .filter-category-picker summary { min-height: 44px; }
  .games { grid-template-columns: repeat(auto-fill,minmax(205px,1fr)); gap: 15px; margin-top: 19px; }
  .game-body { padding: 13px; }
  .game h3, .game-body > h3 { margin: 10px 0 8px; font-size: 1.02rem; }
  .game-facts { gap: 6px; font-size: .76rem; }
  .game-info-icon { flex-basis: 15px; width: 15px; height: 15px; }
  .game-card-footer { padding-top: 13px; }
  .location-badge { padding: 4px 9px; font-size: .7rem; }
  .game-body > .game-card-action.button, .game-card-action button { min-height: 37px; font-size: .76rem; }
  .notification-bell { width: 42px; height: 42px; }
}

@media (min-width: 1700px) {
  .signed-in main { max-width: 1580px; }
  .games { grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .sidebar { width: 210px; padding-inline: 16px; }
  .app-content { margin-left: 210px; }
  .signed-in main { padding: 25px; }
  .games { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Begrüßung und Kennzahlen nach der freigegebenen Dashboard-Vorlage. */
.hero { grid-template-columns: minmax(0,1fr) 250px; }
.hero .welcome-title { margin: 0 0 6px; color: var(--text); font-size: 1.05rem; font-weight: 750; text-transform: none; }
.hero .welcome-title::after { content: ' 👋'; }
.hero .shelf { display: grid; place-items: center; font-size: 0; }
.welcome-art { width: min(100%,210px); height: auto; overflow: visible; color: #cbb68d; }
.welcome-art rect { fill: #d9c8a7; stroke: #b8a47e; stroke-width: 1; }
.welcome-art rect:nth-of-type(2), .welcome-art rect:nth-of-type(5) { fill: #bdc4a3; }
.welcome-art rect:nth-of-type(3) { fill: #e1c5a9; }
.welcome-art .welcome-shelf { fill: #bca27b; }
.welcome-art .welcome-plant { fill: none; stroke: #758f62; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.welcome-art .welcome-pot { fill: #cbb18b; }
.dashboard-stats a { padding-right: 70px; }
.stat-icon { display: grid; place-items: center; right: 17px; top: 50%; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); transform: translateY(-50%); }
.dashboard-stats a:nth-child(2) .stat-icon { background: color-mix(in srgb,#d99449 16%,var(--surface)); color: #c1782e; }
.dashboard-stats a:nth-child(3) .stat-icon { background: color-mix(in srgb,#c77c47 16%,var(--surface)); color: #b66b37; }
.dashboard-stats a:nth-child(4) .stat-icon { background: color-mix(in srgb,#759668 18%,var(--surface)); color: #67865b; }
.dashboard-stats a:nth-child(5) .stat-icon { background: #ffffff22; color: #fff; }
.stat-icon .ui-icon { width: 25px; height: 25px; stroke-width: 1.9; }

@media (min-width: 761px) {
  .hero { min-height: 116px; padding: 20px 25px; }
  .hero .welcome-title { font-size: 1.08rem; }
  .hero p { margin: 0; font-size: .78rem; }
  .dashboard-stats a { min-height: 112px; }
}

@media (max-width: 760px) {
  .hero { display: block; padding: 17px 16px; }
  .hero .welcome-title { font-size: 1rem; }
  .hero p { margin: 0; font-size: .76rem; }
  .dashboard-stats a { padding-right: 58px; }
  .stat-icon { right: 10px; width: 37px; height: 37px; border-radius: 10px; }
  .stat-icon .ui-icon { width: 22px; height: 22px; }
  html, body { max-width: 100%; overflow-x: hidden; }
  .category-picker { display: grid; grid-template-columns: 1fr 1fr; width: 100%; min-width: 0; overflow: visible; }
  .category-picker .category-chip, .category-picker .category-chip span { width: 100%; min-width: 0; }
  .category-picker .category-chip span { justify-content: center; padding-inline: 6px; text-align: center; white-space: normal; }
  fieldset[data-game-details], .auth form { min-width: 0; }
}

.game-footer-icons { display: inline-flex; align-items: center; gap: 2px; }
.game-history-button { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--primary); }
.game-history-button:hover { background: var(--primary-soft); transform: none; }
.game-history-button .game-info-icon { width: 17px; height: 17px; }
.clear-dashboard-filter { display: block; margin-top: 3px; color: var(--primary); font-size: .7rem; text-decoration: none; }
.history-dialog { width: min(560px,calc(100% - 26px)); max-height: min(720px,88dvh); padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 17px; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-md); }
.history-dialog::backdrop { background: #111a; backdrop-filter: blur(2px); }
.history-dialog-content { position: relative; padding: 22px; }
.history-dialog-content h2 { margin: 2px 38px 18px 0; font-size: 1.25rem; }
.history-close { position: absolute; right: 12px; top: 10px; width: 34px; height: 34px; padding: 0; background: transparent; color: var(--muted); font-size: 1.4rem; }
.history-list { display: grid; gap: 9px; }
.history-entry { display: grid; grid-template-columns: 13px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.history-entry > div { display: grid; gap: 2px; }
.history-entry strong { font-size: .82rem; }
.history-entry small { color: var(--muted); font-size: .69rem; }
.history-entry form { margin: 0; }
.history-entry button { padding: 7px 10px; font-size: .7rem; }
.history-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.history-dot.is-active { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb,var(--accent) 18%,transparent); }
.history-empty { color: var(--muted); }
.mobile-more-sheet { width: 100%; max-width: none; margin: auto 0 0; padding: 0; overflow: visible; border: 0; border-radius: 20px 20px 0 0; background: transparent; color: var(--text); }
.mobile-more-sheet::backdrop { background: #1119; backdrop-filter: blur(2px); }
.mobile-more-panel { display: grid; gap: 12px; padding: 8px 15px max(20px,env(safe-area-inset-bottom)); border: 1px solid var(--border); border-bottom: 0; border-radius: 20px 20px 0 0; background: var(--surface-raised); box-shadow: 0 -14px 45px #0003; }
.mobile-more-handle { justify-self: center; width: 42px; height: 4px; border-radius: 999px; background: var(--border-strong); }
.mobile-more-heading { display: flex; align-items: center; justify-content: space-between; min-height: 35px; }
.mobile-more-heading > strong { font-size: 1.05rem; }
.mobile-more-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 1.35rem; }
.mobile-more-profile { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); color: var(--text); text-decoration: none; }
.mobile-more-profile .avatar { width: 42px; height: 42px; }
.mobile-more-profile > span:nth-child(2) { display: grid; gap: 2px; }
.mobile-more-profile strong { font-size: .86rem; }
.mobile-more-profile small { color: var(--muted); font-size: .68rem; }
.mobile-more-arrow { color: var(--primary); font-size: 1.6rem; }
.mobile-more-logout { margin: 0; }
.mobile-more-logout .logout-button { width: 100%; min-height: 46px; border-color: var(--border); background: transparent; color: var(--muted); }

/* Kompaktes Scannerfenster: sichtbar ist nur der Barcode-Ausschnitt. */
.scanner-shell { background: #090d0b; }
.scanner-shell .scanner { position: absolute; inset: auto; left: 50%; top: 50%; width: min(92vw,640px); height: auto; aspect-ratio: 2.45 / 1; border: 1px solid #ffffff55; border-radius: 17px; object-fit: cover; transform: translate(-50%,-50%); }
.scanner-guide { width: min(84vw,580px); aspect-ratio: 2.7 / 1; border-width: 2px; border-radius: 12px; box-shadow: inset 0 0 20px #0005; }
.scanner-hint { bottom: max(24px,env(safe-area-inset-bottom)); }
.scanner-zoom { bottom: max(78px,calc(env(safe-area-inset-bottom) + 62px)); }

@media (max-width: 520px) {
  .scanner-shell .scanner { width: 94vw; aspect-ratio: 2.25 / 1; }
  .scanner-guide { width: 86vw; aspect-ratio: 2.55 / 1; }
  .scanner-hint { font-size: .78rem; }
  .history-dialog-content { padding: 18px 15px; }
  .history-entry { grid-template-columns: 12px minmax(0,1fr); }
  .history-entry form { grid-column: 2; }
}

/* 4.1 – sichtbar neuer Aufbau für Bibliothek und Suche */
.modern-game-filter { display:grid; grid-template-columns:minmax(230px,2fr) minmax(150px,1.15fr) repeat(3,minmax(90px,.7fr)) auto; align-items:end; gap:12px; margin:16px 0 22px; padding:18px; border:1px solid var(--border); border-radius:18px; background:linear-gradient(135deg,var(--surface-raised),color-mix(in srgb,var(--primary-soft) 18%,var(--surface-raised))); box-shadow:0 14px 38px #18251b0b; }
.modern-game-filter .filter-intro { grid-column:1/-1; display:flex; align-items:baseline; gap:9px; padding-bottom:2px; }
.filter-intro strong { color:var(--text); font-size:1rem; }
.filter-intro span { color:var(--muted); font-size:.72rem; }
.modern-game-filter label { gap:6px; color:var(--muted); font-size:.7rem; }
.modern-game-filter input[type="text"],.modern-game-filter input[type="number"],.modern-game-filter input:not([type]) { min-height:45px; border-radius:11px; background:var(--surface); }
.modern-game-filter .filter-search { position:relative; }
.modern-game-filter .filter-search input { padding-left:39px; }
.modern-game-filter .filter-search::after { content:'⌕'; position:absolute; left:13px; bottom:9px; color:var(--primary); font-size:1.35rem; line-height:1; }
.modern-game-filter .filter-category-picker { align-self:end; }
.modern-game-filter .filter-category-picker summary { min-height:45px; border-radius:11px; background:var(--surface); }
.filter-toggles { display:flex; align-items:center; gap:7px; min-height:45px; }
.modern-game-filter .filter-pill { display:inline-flex; cursor:pointer; }
.modern-game-filter .filter-pill input { position:absolute; width:1px; height:1px; opacity:0; }
.modern-game-filter .filter-pill span { display:flex; align-items:center; min-height:38px; padding:7px 11px; border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--muted); white-space:nowrap; }
.modern-game-filter .filter-pill input:checked + span { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-hover); font-weight:750; }
.modern-game-filter .filter-submit { min-height:45px; padding-inline:17px; border-radius:11px; white-space:nowrap; }
.modern-game-filter .filter-reset { grid-column:1/-1; justify-self:end; margin-top:-4px; color:var(--muted); font-size:.7rem; text-decoration:none; }
.modern-game-filter .filter-reset:hover { color:var(--primary); }
.games { gap:16px; }
.game { border:1px solid var(--border)!important; border-radius:18px; box-shadow:0 10px 30px #1a281d0b; }
.game-media { margin:7px 7px 0; border-radius:13px; aspect-ratio:1.05/1; }
.game-media > img,.game-media .placeholder { border:0; border-radius:inherit; }
.game-body { padding:10px 13px 13px; }
.game-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:7px; }
.game-title-row h3 { flex:1; }
.game-family-dot { flex:0 0 8px; width:8px; height:8px; margin-top:14px; border-radius:50%; background:var(--primary); box-shadow:0 0 0 4px var(--primary-soft); }
.state-other-available .game-family-dot,.state-other-unavailable .game-family-dot { background:var(--accent); box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 15%,transparent); }
.game-facts { padding:8px 0 4px; border-top:1px solid var(--border); }
.game-card-footer { justify-content:flex-end; min-height:29px; padding-top:4px; }
.game-like-label { display:none!important; }
@media (max-width:1100px) {
  .modern-game-filter { grid-template-columns:1fr 1fr; }
  .modern-game-filter .filter-intro,.modern-game-filter .filter-search,.modern-game-filter .filter-category-picker,.modern-game-filter .filter-submit,.modern-game-filter .filter-reset { grid-column:1/-1; }
  .filter-toggles { grid-column:1/-1; }
}
@media (max-width:600px) {
  .modern-game-filter { grid-template-columns:1fr 1fr; gap:10px; padding:13px; border-radius:15px; }
  .modern-game-filter .filter-intro { flex-direction:column; gap:1px; }
  .modern-game-filter .filter-submit { width:100%; }
  .modern-game-filter .filter-reset { justify-self:center; }
  .game { display:flex; }
  .game-media { aspect-ratio:1.18/1; }
}

/* Eigene Tablet-Zwischenstufe: großzügige mobile Anordnung mit Seitenleiste. */
@media (min-width: 761px) and (max-width: 1100px), (min-width: 761px) and (max-width: 1600px) and (pointer: coarse) {
  html { scroll-padding-top: 94px; }
  .sidebar { width: 184px; padding: 25px 13px 18px; }
  .app-content { margin-left: 184px; }
  .brand { gap: 8px; font-size: 1rem; }
  .brand-mark { width: 37px; height: 42px; }
  .brand small { font-size: .56rem; }
  .side-nav { margin-top: 28px; }
  .side-nav a { min-height: 41px; padding: 8px 10px; font-size: .78rem; }
  .side-profile { padding-inline: 4px; }
  .side-profile strong { font-size: .78rem; }
  .topbar { height: 70px; padding: 0 24px; }
  .topbar .top-add { display: none !important; }
  .signed-in main { padding: 24px 22px 64px; }
  .hero { display: grid; grid-template-columns: minmax(0,1fr) 150px; min-height: 108px; padding: 18px 21px; }
  .welcome-art { width: 145px; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dashboard-stats a { min-height: 100px; padding: 15px 64px 14px 15px; }
  .dashboard-stats .dashboard-add-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 60px 12px 18px; text-align: center; }
  .dashboard-add-card small, .dashboard-add-card em { display: none; }
  .dashboard-add-card strong { margin: 0; font-size: .9rem; }
  .dashboard-add-card .stat-icon { right: 15px; }
  .dashboard-panels { grid-template-columns: 1fr; }
  .dashboard-library { scroll-margin-top: 94px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 11px; padding: 13px; }
  .filters > label:first-of-type, .filters > .filter-category-picker, .filters > button { grid-column: 1 / -1; }
  .filters > button { width: 100%; }
  .games { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-category-picker[open]::before { content: ''; position: fixed; z-index: 210; inset: 0; background: #1119; backdrop-filter: blur(2px); }
  .filter-category-picker .category-filter-options { position: fixed; z-index: 220; left: 50%; top: 50%; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; width: min(500px,calc(100vw - 42px)); max-height: min(650px,82dvh); padding: 20px 17px 17px; overflow-y: auto; border-radius: 17px; transform: translate(-50%,-50%); }
  .category-filter-title { display: block; grid-column: 1 / -1; margin-bottom: 4px; font-size: 1.05rem; }
  .category-filter-cancel { position: absolute; right: 13px; top: 12px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 1.4rem; }
  .category-filter-title { padding-right: 42px; }
  .filter-category-picker .category-chip, .filter-category-picker .category-chip span { width: 100%; min-width: 0; }
  .filter-category-picker .category-chip span { justify-content: center; min-height: 41px; text-align: center; white-space: normal; }
  .category-filter-done { display: block; grid-column: 1 / -1; width: 100%; margin-top: 5px; }
}

/* 4.2 – Karten und Filter entsprechend der freigegebenen Vorlage */
.modern-game-filter { display:block; margin:14px 0 21px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.filter-search-row { display:flex; gap:10px; }
.modern-game-filter .filter-search { flex:1; }
.modern-game-filter .filter-search input { min-height:46px; padding:11px 15px 11px 43px; border:1px solid var(--border); border-radius:12px; background:var(--surface); box-shadow:0 5px 18px #1b281d08; }
.modern-game-filter .filter-search::after { left:15px; bottom:10px; }
.filter-search-row .filter-category-picker { flex:0 0 175px; margin:0; align-self:auto; }
.filter-search-row .filter-category-picker summary { min-height:46px; padding:10px 13px; border-radius:12px; background:var(--surface); }
.modern-game-filter .filter-toggles { display:flex; flex-wrap:wrap; gap:7px; min-height:0; margin-top:10px; }
.modern-game-filter .filter-pill span,.filter-link-pill { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:6px 14px; border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--muted); font-size:.7rem; font-weight:650; text-decoration:none; white-space:nowrap; }
.modern-game-filter .filter-pill input:checked + span,.filter-link-pill.is-active { border-color:var(--primary); background:var(--primary); color:#fff; }
.advanced-filter-panel { margin-top:10px; border-top:1px solid var(--border); }
.advanced-filter-panel summary { width:max-content; padding:10px 2px 4px; color:var(--primary); cursor:pointer; font-size:.72rem; font-weight:700; list-style:none; }
.advanced-filter-panel summary::before { content:'＋ '; }
.advanced-filter-panel[open] summary::before { content:'− '; }
.advanced-filter-fields { display:grid; grid-template-columns:repeat(3,minmax(100px,160px)); gap:9px; padding:8px 0 2px; }
.advanced-filter-fields label { color:var(--muted); font-size:.68rem; }
.advanced-filter-fields input { min-height:39px!important; background:var(--surface)!important; }
.filter-actions { display:flex; align-items:center; gap:12px; margin-top:10px; }
.modern-game-filter .filter-submit { min-height:38px; padding:8px 15px; border-radius:9px; font-size:.72rem; }
.modern-game-filter .filter-reset { margin:0; color:var(--muted); font-size:.7rem; }

.games { grid-template-columns:repeat(5,minmax(145px,1fr)); gap:14px; }
.game { display:flex!important; flex-direction:column; overflow:hidden; border:1px solid var(--border)!important; border-radius:13px; background:var(--surface); box-shadow:none; }
.game:hover { transform:translateY(-3px); box-shadow:0 12px 30px #1a281d12; }
.game-media { width:100%; margin:0; aspect-ratio:4/5; overflow:hidden; border-radius:0; background:var(--surface-soft); }
.game-media > img { width:100%; height:100%; padding:6px; border:0; object-fit:contain; }
.game-media .placeholder { width:100%; height:100%; aspect-ratio:auto; border:0; border-radius:0; }
.game-body { display:flex; flex:1; flex-direction:column; padding:9px 10px 10px; }
.game-owner-chip { position:static; display:flex; align-items:center; align-self:flex-start; gap:5px; max-width:100%; margin:0 0 3px; padding:0; border:0; border-radius:0; background:transparent; color:var(--muted); box-shadow:none; font-size:.57rem; font-weight:600; backdrop-filter:none; }
.game-owner-chip::before { display:none; }
.game-owner-chip i { flex:0 0 6px; width:6px; height:6px; border-radius:50%; background:var(--primary); }
.state-other-available .game-owner-chip i,.state-other-unavailable .game-owner-chip i { background:var(--accent); }
.game-title-row { min-height:29px; }
.game-title-row h3,.game h3 { margin:3px 0 6px; font-size:.82rem; line-height:1.25; }
.game-facts { gap:4px; padding:7px 0 3px; border-top:1px solid var(--border); font-size:.62rem; }
.game-info-icon { flex-basis:12px; width:12px; height:12px; }
.game-card-footer { min-height:31px; margin-top:auto; padding-top:7px; justify-content:space-between; }
.game-status-pill { padding:3px 8px; border-radius:999px; background:var(--primary-soft); color:var(--primary-hover); font-size:.57rem; font-weight:750; }
.state-own-lent .game-status-pill { background:#f6dfc9; color:#89562e; }
.state-borrowed-by-us .game-status-pill { background:#d9eaf1; color:#35667c; }
.state-other-unavailable .game-status-pill { background:var(--surface-soft); color:var(--muted); }
.game-footer-icons { gap:3px; }
.game-like-button { position:static; width:27px; height:27px; border:0; background:transparent; color:var(--primary); box-shadow:none; backdrop-filter:none; }
.game-like-button:hover { background:var(--primary-soft); }
.game-like-button .game-info-icon { width:18px; height:18px; }
.game-history-button { width:27px; height:27px; }
.game-card-actions { margin-top:7px; }

@media (max-width:1100px) { .games { grid-template-columns:repeat(3,minmax(145px,1fr)); } }
@media (max-width:760px) {
  .games { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .advanced-filter-fields { grid-template-columns:1fr 1fr; }
  .filter-search-row { display:grid; }
  .filter-search-row .filter-category-picker { width:100%; }
  .filter-search-row .filter-category-picker summary { width:100%; }
  .game-body { padding:8px; }
  .game-owner-chip { font-size:.54rem; }
  .game-title-row h3,.game h3 { font-size:.78rem; }
  .game-facts { font-size:.59rem; }
}
@media (max-width:390px) { .games { grid-template-columns:1fr; } .game-media { aspect-ratio:5/4; } }
