/* ══════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════ */

:root {
  --font-heading: 'Libre Franklin', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.2s ease;
  --max-width: 1140px;
  --gap: 16px;
  --pad-x: 24px;
}

@media (max-width: 640px) {
  :root { --pad-x: 16px; }
}

/* ══════════════════════════════════════
   WRAPPER
   ══════════════════════════════════════ */

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ── Dark theme (default) ── */
[data-theme="dark"] {
  --bg-page: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-hover: #1c2129;
  --bg-nav: rgba(13, 17, 23, 0.85);
  --border: #30363d;
  --border-hover: #484f58;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-tertiary: #6e7681;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-subtle: rgba(99, 102, 241, 0.12);

  --tag-bg: rgba(99, 102, 241, 0.15);
  --tag-text: #a5b4fc;
  --tag-red-bg: rgba(239, 68, 68, 0.15);
  --tag-red-text: #fca5a5;

  --danger: #f87171;
  --danger-hover: #ef4444;
  --warning: #f59e0b;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-nav: 0 1px 0 var(--border);
}

/* ── Light theme ── */
[data-theme="light"] {
  --bg-page: #f6f8fa;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f3f4f6;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --border: #d0d7de;
  --border-hover: #afb8c1;

  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-tertiary: #8b949e;

  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-subtle: rgba(79, 70, 229, 0.08);

  --tag-bg: rgba(79, 70, 229, 0.1);
  --tag-text: #4f46e5;
  --tag-red-bg: rgba(239, 68, 68, 0.1);
  --tag-red-text: #dc2626;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #d97706;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-nav: 0 1px 0 var(--border);
}

/* ══════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border-hover) transparent;
  scrollbar-width: thin;
}

/* Webkit scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

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

::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
}

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

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

/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  30% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ══════════════════════════════════════
   NAV
   ══════════════════════════════════════ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-nav);
  transition: background var(--transition);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
}

.nav-logo {
  justify-self: start;
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 22px;
  width: auto;
}

[data-theme="light"] .nav-logo-img {
  content: url('/css/header.light.svg');
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links {
  justify-self: center;
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

.nav-auth {
  display: flex;
  align-items: center;
  justify-self: end;
}

.nav-auth-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-profile-link:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
  cursor: pointer;
}

.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-surface);
}

.nav-avatar:not([src]),
.nav-avatar[src=""],
.nav-avatar[src="null"] {
  display: none;
}

.nav-user {
  color: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ── User dropdown ── */
.nav-user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-hover);
  padding: 6px 0;
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.nav-dropdown-item:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

.nav-dropdown-item--danger {
  color: var(--danger);
}

.nav-dropdown-item--danger:hover {
  background: var(--tag-red-bg);
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════
   HERO
   ══════════════════════════════════════ */

.hero {
  padding-top: 64px;
  padding-bottom: 32px;
  text-align: center;
}

.hero-logo {
  max-width: 666px;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

[data-theme="light"] .hero-logo {
  content: url('/css/full.light.svg');
}

/* Localized hero logo (German). Two-attribute rule wins for de+light over the single-attribute rules. */
[data-lang="de"] .hero-logo {
  content: url('/css/full_de.svg');
}

[data-theme="light"][data-lang="de"] .hero-logo {
  content: url('/css/full_de.light.svg');
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 440px;
  margin: 12px auto 0;
}

/* ══════════════════════════════════════
   TAGS
   ══════════════════════════════════════ */

/* ══════════════════════════════════════
   GAME SECTION (hub)
   ══════════════════════════════════════ */

.game-section {
  padding-top: 8px;
  padding-bottom: 32px;
}

.game-section-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════
   ARTICLE LINKS (in game hub)
   ══════════════════════════════════════ */

.article-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-link {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.article-link:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
}

.article-link-title {
  font-weight: 600;
  font-size: 0.875rem;
}

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}

.btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

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

/* Scroll to top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.scroll-top:active {
  transform: scale(0.95);
}

@media screen and (max-width: 640px) {
  .scroll-top {
    bottom: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Button press feedback ── */
.btn:active,
.btn-fav:active,
.btn-collection:active,
.nav-btn:active {
  transform: scale(0.96);
  transition-duration: 0.05s;
}

/* ── Focus ring (keyboard accessibility) ── */
.btn:focus-visible,
.nav-btn:focus-visible,
.btn-fav:focus-visible,
.btn-collection:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-input:focus-visible,
.modal-note-input:focus-visible,
.wall-input:focus-visible,
.profile-bio-textarea:focus-visible,
.profile-fav-note-input:focus-visible,
.disc-filter-search:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

/* ══════════════════════════════════════
   FAVORITE & COLLECTION BUTTONS
   ══════════════════════════════════════ */

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ══════════════════════════════════════
   CUSTOM SELECT
   ══════════════════════════════════════ */

.custom-select {
  position: relative;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition);
}

.custom-select-trigger:hover {
  border-color: var(--border-hover);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--accent);
}

.custom-select-arrow {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card-hover);
  z-index: 50;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  max-height: 200px;
  overflow-y: auto;
}

.custom-select.open .custom-select-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.custom-select-option {
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s ease;
}

.custom-select-option:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

.custom-select-option.selected {
  color: var(--accent);
  font-weight: 500;
}

.btn-fav,
.btn-collection {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-fav:hover,
.btn-collection:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-fav-active,
.btn-collection-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.btn-fav-active:hover,
.btn-collection-active:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--tag-red-bg);
}



/* ══════════════════════════════════════
   MODAL (global)
   ══════════════════════════════════════ */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

.modal-bg[hidden] {
  display: none;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 380px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalEnter 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.modal h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-note-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-style: italic;
  field-sizing: content;
  min-height: 36px;
  resize: none;
  transition: border-color 0.15s ease;
}

.modal-note-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal--wide {
  width: 480px;
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-input::placeholder {
  color: var(--text-tertiary);
}

/* Modal chips */
.modal-chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.modal-chip { padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 500; background: var(--bg-page); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: all 0.15s ease; }
.modal-chip:hover { border-color: var(--accent); color: var(--text-primary); }
.modal-chip.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }

.license-chip-caption { font-size: 0.75rem; color: var(--text-tertiary); line-height: 1.5; min-height: 1.5em; margin-top: 6px; }

/* Upload tiles */
.upload-tiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 100px; gap: 8px; max-height: 216px; overflow-y: auto; }
.upload-tile { position: relative; border-radius: var(--radius-sm); overflow: hidden; height: 100px; background: var(--bg-page); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: border-color 0.15s ease; }
.upload-tile:hover { border-color: var(--accent); }
.upload-tile--empty { gap: 6px; }
.upload-tile--empty .upload-tile-icon { font-size: 1.25rem; color: var(--text-tertiary); }
.upload-tile--empty .upload-tile-label { font-size: 0.6875rem; color: var(--text-tertiary); text-align: center; padding: 0 8px; }
.upload-tile--filled img { width: 100%; height: 100%; object-fit: cover; }
.upload-tile--filled .upload-tile-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; opacity: 0; transition: opacity 0.15s ease; }
.upload-tile--filled:hover .upload-tile-overlay { opacity: 1; }
.upload-tile--filled .upload-tile-overlay .btn { font-size: 0.6875rem; padding: 3px 10px; }
.upload-tile--filled .upload-tile-name { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 6px; font-size: 0.625rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.7)); text-align: center; }

/* Modal sections & grid */
.modal-section { border-top: 1px solid var(--border); padding-top: 14px; }
.modal-section-title { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 10px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-grid .modal-label.full { grid-column: 1 / -1; }
.modal-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-provider-row { display: flex; gap: 10px; align-items: flex-end; }
.modal-provider-row .modal-label:first-child { flex: 0 0 140px; }
.modal-provider-row .modal-label:last-child { flex: 1; }

/* Image picker modal */
.image-picker-desc { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 12px; }
.image-picker-type-label { font-size: 0.75rem; font-weight: 600; color: var(--text-tertiary); margin-bottom: 6px; margin-top: 12px; }
.image-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.image-picker-tile { border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: all 0.15s ease; }
.image-picker-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.image-picker-tile img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.image-picker-tile-label { padding: 4px 6px; font-size: 0.625rem; color: var(--text-secondary); text-align: center; background: var(--bg-surface); }
.image-picker-footer { margin-top: 16px; }

/* Contribute modal */
.contribute-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contribute-slot-label {
  font-size: 0.8125rem;
  min-width: 100px;
  color: var(--text-secondary);
}

.contribute-slot-status {
  font-size: 0.75rem;
  flex: 1;
  color: var(--text-tertiary);
}

.contribute-slot-status--done {
  color: var(--accent);
}

.contribute-footer {
  margin-top: 16px;
}

/* ══════════════════════════════════════
   CARD NO IMAGE (global)
   ══════════════════════════════════════ */

.card-no-image {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  padding-top: 12px;
  background: url('/css/noimage.png') center bottom / 55% no-repeat;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  cursor: pointer;
  bottom: -2px;
}

/* Canonical class for animation frame imgs (added by core/animation.js
   createFrameImgs). Per-container width overrides below where needed. */
.anim-frame {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: auto;
  display: none;
  pointer-events: none;
}

/* ==  */

.disc-home {
  padding-bottom: 32px;
}

/* ══════════════════════════════════════
   ENTITY CARD (shared base for disc/audio/game/collection cards)
   Entity-specific overrides live in disc-card.css / audio-card.css /
   game-card.css / profile.css under .disc-card / .audio-card / .game-card /
   .profile-collection-item.
   ══════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
  padding-bottom: 32px;
}

.entity-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text-primary);
  animation: fadeInUp 0.6s ease both;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.entity-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.entity-card-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-surface-hover);
}

/* Direct child img only (the cover image). Animation frames inside
   .card-no-image are descendants — they use .anim-frame styling instead. */
.entity-card-img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.entity-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.entity-card-title a {
  color: inherit;
  font-weight: inherit;
}

.entity-card-title a:hover {
  color: var(--accent);
}

.entity-card-line {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.entity-card-line--meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.entity-card-line--meta:empty { display: none; }

.entity-card-line--accent {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

@media screen and (max-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding-bottom: 24px;
  }
}

/* ══════════════════════════════════════
   ENTITY DETAIL (shared base for disc/audio/game detail pages)
   ══════════════════════════════════════ */

.entity-detail {
  padding-top: 48px;
  padding-bottom: 64px;
  max-width: 800px;
  animation: fadeIn 0.5s ease;
}

/* Card wrapper around header + meta + desc + tags-row. */
.entity-detail-info {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}

.entity-detail-header-row {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.entity-detail-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.entity-detail-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  line-height: 1.15;
}

/* Subtitle rendered as inline <span> inside <h1>. */
.entity-detail-header h1 .entity-detail-subtitle {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  vertical-align: baseline;
  margin-left: 0.5rem;
}

.entity-detail-featured {
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  width: 160px;
  height: 160px;
  align-self: flex-start;
}

.entity-detail-featured:empty { display: none; }

.entity-detail-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* "Also known as: ..." line below h1. */
/* Definition-list grid. Items populated by per-entity JS. */
.entity-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px 20px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.entity-detail-meta:empty { display: none; }

.entity-detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.entity-detail-meta-key {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  font-weight: 600;
}

.entity-detail-meta-val {
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.entity-detail-desc {
  line-height: 1.7;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

.entity-detail-desc:empty { display: none; }

/* tag-pills on left, detail-actions (Fav/Coll) on right. */
.entity-detail-tags-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}

.entity-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.entity-detail-tags-row .detail-actions {
  margin-top: 0;
  flex-shrink: 0;
}

.disc-detail .entity-detail-meta {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.game-detail .entity-detail-meta {
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

/* Audio meta item count varies — auto-fit collapses empty tracks. */
.audio-detail .entity-detail-meta {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.entity-detail-section { margin-bottom: 28px; }
.entity-detail-section:last-child { margin-bottom: 0; }

.entity-detail-section h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
}

@media screen and (max-width: 640px) {
  .entity-detail {
    padding-top: 32px;
    padding-bottom: 48px;
  }
  .entity-detail-info {
    padding: 16px;
  }
  .entity-detail-header-row {
    flex-direction: column;
  }
  .entity-detail-featured {
    align-self: center;
  }
  .entity-detail-header h1 {
    font-size: 1.5rem;
  }
  .entity-detail-meta,
  .disc-detail .entity-detail-meta,
  .game-detail .entity-detail-meta {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .entity-detail-tags-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .entity-detail-tags-row .detail-actions {
    align-self: stretch;
  }
  .entity-detail-desc {
    font-size: 0.875rem;
  }
}

/* ══════════════════════════════════════
   SCAN LIGHTBOX (opened by features/scan-lightbox.js)
   ══════════════════════════════════════ */

.scan-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.2s ease;
}

.scan-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.scan-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

.scan-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.scan-lightbox-nav:hover { opacity: 1; }

.scan-lightbox-prev { left: 12px; }
.scan-lightbox-next { right: 12px; }

.scan-lightbox-label {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.875rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 4px;
}

.scan-lightbox-download {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.75rem;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  text-decoration: none;
}

.scan-lightbox-download:hover {
  opacity: 1;
  color: #fff;
}

.entity-detail-featured img { cursor: zoom-in; }

/* ══════════════════════════════════════
   RELATED GAMES (end of disc/audio detail pages)
   ══════════════════════════════════════ */

.related-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.related-row {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.related-row:hover { background: var(--bg-surface-hover); }

/* Single related game — span full width instead of leaving an empty column. */
.related-row:only-child { grid-column: 1 / -1; }

.related-row-cover {
  width: 48px;
  height: 48px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-surface);
}

.related-row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-row-info {
  flex: 1;
  min-width: 0;
}

.related-row-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-row-meta {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}

@media (max-width: 640px) {
  .related-list { grid-template-columns: 1fr; }
}

/* Replacement for <img> that failed both webp and original load — see setImgFallback / img-fallback action. */
.img-not-found {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 60px;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-style: italic;
  opacity: 0.6;
  padding: 8px;
  text-align: center;
  background: var(--bg-surface-hover);
}

/* ══════════════════════════════════════
   EMPTY STATE (global)
   ══════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  max-width: 300px;
  line-height: 1.5;
}

.empty-state .btn {
  margin-top: 8px;
}

/* ══════════════════════════════════════
   NOTIFICATIONS
   ══════════════════════════════════════ */

.notif-wrap { position: relative; }

.notif-bell {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.notif-bell:hover { color: var(--text-primary); background: var(--bg-surface-hover); }

.nav-settings-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-settings-btn:hover { color: var(--text-primary); background: var(--bg-surface-hover); }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; border-radius: 99px;
  background: var(--danger); color: #fff;
  font-size: 0.5625rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; pointer-events: none;
}

.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-height: 420px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card-hover);
  display: none; flex-direction: column; z-index: 200;
  animation: fadeIn 0.15s ease;
}
.notif-dropdown.open { display: flex; }

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.notif-header-title { font-family: var(--font-heading); font-size: 0.875rem; font-weight: 700; }

.notif-mark-read {
  background: transparent; border: none;
  color: var(--text-tertiary); font-family: var(--font-body);
  font-size: 0.6875rem; cursor: pointer; transition: color 0.15s ease;
}
.notif-mark-read:hover { color: var(--accent); }

.notif-list {
  overflow-y: auto; overflow-x: hidden; flex: 1;
  border-radius: 0 0 var(--radius) var(--radius);
}

.notif-item {
  display: flex; gap: 10px; padding: 10px 32px 10px 16px;
  text-decoration: none; color: var(--text-primary);
  transition: background 0.1s ease; position: relative;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child, .notif-item:last-child:hover { border-bottom: none; }
.notif-item:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.notif-item--unread { background: var(--accent-subtle); }
.notif-item--unread:hover { background: rgba(99, 102, 241, 0.06); }

.notif-item-icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.notif-item-icon--accent { background: var(--accent-subtle); color: var(--accent); }
.notif-item-icon--success { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.notif-item-icon--danger { background: var(--tag-red-bg); color: var(--danger); }
.notif-item-icon--warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-message { font-size: 0.8125rem; font-weight: 500; line-height: 1.4; }
.notif-item-detail { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time { font-size: 0.625rem; color: var(--text-tertiary); margin-top: 3px; }
.notif-item-dot { position: absolute; top: 0; right: 0; margin: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.notif-empty { padding: 32px 16px; text-align: center; font-size: 0.8125rem; color: var(--text-tertiary); }

/* ══════════════════════════════════════
   SETTINGS PAGE
   ══════════════════════════════════════ */

.settings-page {
  max-width: 600px;
  padding-top: 48px;
  padding-bottom: 64px;
  animation: fadeIn 0.5s ease;
}

.settings-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 900;
  margin-bottom: 24px;
}

.settings-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-option-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.settings-option-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.settings-option-desc--inline {
  margin-bottom: 0;
}

.settings-btns {
  display: flex;
  gap: 8px;
}

.settings-format-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.settings-format-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.settings-format-btn.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.settings-format-btn-label {
  font-weight: 600;
  font-size: 0.875rem;
}

.settings-format-btn-example {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

.settings-format-btn.active .settings-format-btn-example {
  color: var(--accent);
  opacity: 0.7;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.settings-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: transform 0.2s ease, background 0.2s ease;
}

.settings-toggle.active {
  background: var(--accent);
}

.settings-toggle.active::after {
  transform: translateX(18px);
  background: #fff;
}

.settings-toggle-label {
  font-size: 0.8125rem;
  color: var(--text-primary);
}

/* Theme preview — mini page mockup on the right side of the theme card.
   Shows the OPPOSITE theme (what you'd get if you toggled). Achieved by
   overriding theme vars on .theme-preview itself based on parent [data-theme] —
   children inherit the flipped vars, page stays as-is. */
.theme-preview {
  width: 140px;
  height: 90px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-page);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}

/* In dark mode → preview shows light theme colors */
[data-theme="dark"] .theme-preview {
  --bg-page: #f6f8fa;
  --bg-surface: #ffffff;
  --border: #d0d7de;
  --text-primary: #1f2328;
  --text-tertiary: #8b949e;
  --accent: #4f46e5;
}

/* In light mode → preview shows dark theme colors */
[data-theme="light"] .theme-preview {
  --bg-page: #0d1117;
  --bg-surface: #161b22;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-tertiary: #6e7681;
  --accent: #6366f1;
}

.theme-preview-bar {
  height: 10px;
  background: var(--bg-surface);
  border-radius: 2px;
  border: 1px solid var(--border);
}

.theme-preview-card {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.theme-preview-line {
  height: 3px;
  background: var(--text-tertiary);
  border-radius: 1px;
  width: 90%;
}

.theme-preview-line--short {
  width: 60%;
}

.theme-preview-line--accent {
  background: var(--accent);
  width: 40%;
  height: 4px;
}

.settings-card-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-card-text {
  flex: 1;
  min-width: 0;
}

.lang-toggle {
  display: flex;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.lang-toggle .slide-bg {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc(50% - 4px);
  background: var(--accent);
  border-radius: 7px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.lang-toggle[data-active="1"] .slide-bg {
  transform: translateX(calc(100% + 2px));
}

.lang-pill {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
  z-index: 1;
  user-select: none;
}

.lang-pill:hover { color: var(--text-primary); }
.lang-pill.active { color: #fff; font-weight: 600; }

.lang-pill .flag-icon {
  width: 24px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .settings-card-inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Horizontal row layout — text-block on left, controls on right.
   Used for Date Format / Date Style cards. */
.settings-card--row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.settings-card--anim {
  overflow: hidden;
}

.settings-card--anim .settings-toggle-row {
  position: relative;
  z-index: 2;
}

.settings-card-anim-preview-box {
  position: absolute;
  bottom: -1px;
  right: -20px;
  width: 180px;
  height: 180px;
  z-index: 1;
  pointer-events: none;
}

/* Settings preview img styling lives in .anim-frame (global). End-pose img
   stays visible after animation via inline display:block (set by playAnimation
   tick) — no separate .visible class needed. */

/* ══════════════════════════════════════
   DISC FILTER BAR
   ══════════════════════════════════════ */

.disc-filter-bar {
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.disc-filter-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.disc-filter-panel-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.disc-filter-panel-bottom {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-wrap: wrap;
}

.disc-filter-panel-bottom > div {
  flex: 1;
  min-width: 200px;
}

.disc-filter-search-wrap {
  position: relative;
  flex: 1;
}

.disc-filter-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  pointer-events: none;
  line-height: 0.8;
}

.disc-filter-search {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
}

.disc-filter-search:focus {
  outline: none;
  border-color: var(--accent);
}

.disc-filter-search::placeholder {
  color: var(--text-tertiary);
}

.disc-filter-result-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 8px;
}

.disc-filter-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.disc-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.disc-filter-tag {
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.disc-filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.disc-filter-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Year range slider */
.disc-filter-year-slider {
  position: relative;
  height: 20px;
}

.disc-filter-year-track-bg {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.disc-filter-year-track-fill {
  position: absolute;
  top: 8px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.disc-filter-year-slider input[type="range"] {
  position: absolute;
  width: 100%;
  top: 0;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  margin: 0;
}

.disc-filter-year-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.disc-filter-year-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  pointer-events: auto;
}

.disc-filter-year-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* Clear filter button */
.disc-filter-clear {
  display: inline-flex;
  align-items: center;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.disc-filter-clear svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.disc-filter-clear:hover {
  color: var(--danger);
  background: var(--tag-red-bg);
}

/* Tag pills (on cards and detail) */
.disc-tag-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  margin-right: 4px;
  margin-bottom: 2px;
}

.disc-tag-pill:hover {
  background: var(--accent);
  color: #fff;
}

.disc-tag-more {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-left: 2px;
}

@media screen and (max-width: 768px) {
  .disc-filter-bar { padding-bottom: 16px; }
  .disc-filter-panel-bottom { flex-direction: column; }
  .disc-filter-panel { padding: 12px 14px; gap: 10px; }
  .disc-filter-panel-top { flex-wrap: wrap; }
  .disc-filter-tags { gap: 4px; }
  .disc-filter-tag { padding: 5px 10px; font-size: 0.6875rem; }
}

/* ══════════════════════════════════════
   TOAST (global)
   ══════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-hover);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  animation: toastSlideIn 0.35s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.toast--info { border-left: 3px solid var(--accent); }
.toast--warn { border-left: 3px solid var(--warning); }

/* ══════════════════════════════════════
   DETAIL BACK LINK
   ══════════════════════════════════════ */

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.detail-back:hover {
  color: var(--accent);
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--border);
  padding-top: 40px;
  padding-bottom: 32px;
  margin-top: 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logos {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
}

.footer-logo-dej-img {
  height: 24px;
  width: auto;
}

.footer-logo-linkid-img {
  height: 22px;
  width: auto;
}

[data-theme="light"] .footer-logo-linkid-img {
  filter: invert(1);
}

.footer-copy {
  font-size: 0.75rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.footer-links a {
  color: var(--text-tertiary);
  font-weight: 400;
}

.footer-links a:hover {
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
  }

  .footer-links {
    text-align: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
}

/* ══════════════════════════════════════
   THEME TOGGLE
   ══════════════════════════════════════ */

.theme-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  font-family: var(--font-body);
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* ══════════════════════════════════════
   STAGGERED CARD ENTRANCE
   ══════════════════════════════════════ */

.disc-grid > *:nth-child(1) { animation-delay: 0s; }
.disc-grid > *:nth-child(2) { animation-delay: 0.04s; }
.disc-grid > *:nth-child(3) { animation-delay: 0.08s; }
.disc-grid > *:nth-child(4) { animation-delay: 0.12s; }
.disc-grid > *:nth-child(5) { animation-delay: 0.16s; }
.disc-grid > *:nth-child(6) { animation-delay: 0.2s; }
.disc-grid > *:nth-child(7) { animation-delay: 0.24s; }
.disc-grid > *:nth-child(8) { animation-delay: 0.28s; }
.disc-grid > *:nth-child(n+9) { animation-delay: 0.3s; }

.game-grid > *:nth-child(1) { animation-delay: 0s; }
.game-grid > *:nth-child(2) { animation-delay: 0.05s; }
.game-grid > *:nth-child(3) { animation-delay: 0.1s; }
.game-grid > *:nth-child(n+4) { animation-delay: 0.15s; }

.article-grid > *:nth-child(1) { animation-delay: 0s; }
.article-grid > *:nth-child(2) { animation-delay: 0.05s; }
.article-grid > *:nth-child(n+3) { animation-delay: 0.1s; }

/* ══════════════════════════════════════
   HOVER GLOW (main card grids only)
   ══════════════════════════════════════ */

.disc-card:hover,
.game-card:hover,
.article-card:hover {
  box-shadow: var(--shadow-card-hover), 0 0 20px rgba(99, 102, 241, 0.12);
}

/* ══════════════════════════════════════
   SHARED — section header, downloads list, pending review, types gallery
   Used across disc/audio/game pages.
   ══════════════════════════════════════ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header :is(h2, h3) {
  margin-bottom: 0;
}

.section-header > div {
  display: flex;
  gap: 6px;
}

.disc-downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disc-dl-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  animation: fadeInUp 0.5s ease both;
  transition: border-color var(--transition);
}

.disc-dl-item:hover {
  border-color: var(--border-hover);
}

/* Name takes remaining space; meta and link sit at consistent right edge
   regardless of name length (replaces former justify-content: space-between
   which let meta position drift with varying name widths). */
.disc-dl-name {
  font-weight: 600;
  font-size: 0.875rem;
  flex: 1;
  min-width: 0;
}

.disc-dl-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.disc-dl-link {
  font-size: 0.8125rem;
  font-weight: 500;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   DOWNLOAD CARD (author, mirrors, OS compat)
   Separate from .disc-dl-item/-name/-meta/-link above — those stay as-is,
   still shared with the Manuals list (disc-scan-manual.json). This is its
   own card type, used only for the Downloads list.
   ══════════════════════════════════════ */
.disc-dl-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeInUp 0.5s ease both;
  transition: border-color var(--transition);
}
.disc-dl-card:hover { border-color: var(--border-hover); }

.disc-dl-main-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  /* Reserves space for the 2-line author case (name + author line) so the
     row is the same height whether author is present or not — see the
     approved mockup for why. */
  min-height: 68px;
}
.disc-dl-card-name { font-weight: 600; font-size: 0.875rem; flex: 1; min-width: 0; }

.disc-dl-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.disc-dl-info .disc-dl-card-name { flex: none; }
.disc-dl-author-row { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--text-tertiary); }
.disc-dl-author-row svg { width: 12px; height: 12px; flex-shrink: 0; }
/* Existing site user (dl.by) — same treatment as .wall-mention (accent +
   bold). Free text (dl.author) stays plain, no link. */
.disc-dl-author-row a { color: var(--accent); font-weight: 600; }
.disc-dl-author-row a:hover { color: var(--accent-hover); }
.disc-dl-author-row--details { display: none; }

/* Mirror + Download fused into one accent element, split by a divider
   line — not two separate buttons with a gap. Shown only when the
   download has mirrors; otherwise Download is a plain .btn.btn-accent. */
.disc-dl-mirror-wrap { position: relative; display: flex; flex-shrink: 0; }
.disc-dl-mirror-wrap::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; }
.disc-dl-mirror-wrap.flip-down::before { bottom: auto; top: 100%; }
.disc-dl-split {
  display: flex;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.disc-dl-split-toggle {
  display: flex; align-items: center; justify-content: center;
  min-height: 1.4em;
  padding: 5px 10px;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.3);
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--transition);
}
.disc-dl-split-toggle:hover, .disc-dl-split-toggle.open { background: var(--accent-hover); }
.disc-dl-split-toggle svg { width: 13px; height: 13px; }
.disc-dl-split-main {
  display: flex; align-items: center;
  min-height: 1.4em;
  padding: 5px 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: background var(--transition);
}
.disc-dl-split-main:hover { background: var(--accent-hover); color: #fff; }
.disc-dl-split-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 150px;
  padding: 6px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card-hover);
}
.disc-dl-mirror-wrap.flip-down .disc-dl-split-menu { bottom: auto; top: calc(100% + 8px); }
.disc-dl-split-menu.open { display: block; }
.disc-dl-split-menu-title {
  padding: 6px 14px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.disc-dl-split-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.1s ease;
}
.disc-dl-split-menu-item:hover { color: var(--text-primary); background: var(--accent-subtle); }
.disc-dl-split-menu-item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--text-tertiary); }

.disc-dl-details-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.disc-dl-detail { display: flex; align-items: center; gap: 5px; }
.disc-dl-detail svg { width: 13px; height: 13px; flex-shrink: 0; }

/* OS compatibility — hover reveals confirmed/probably/unsupported.
   Status colors: green = confirmed (same literal as .notif-item-icon--success),
   amber = probably (--warning), red = unsupported (--danger). */
.disc-dl-detail--os { position: relative; cursor: default; }
.disc-dl-detail--os::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; }
.disc-dl-detail--os.flip-down::before { bottom: auto; top: 100%; }
.disc-dl-os-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: -10px;
  z-index: 20;
  min-width: 140px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card-hover);
  font-size: 0.75rem;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.disc-dl-detail--os.flip-down .disc-dl-os-tooltip { bottom: auto; top: calc(100% + 8px); }
.disc-dl-detail--os:hover .disc-dl-os-tooltip { visibility: visible; opacity: 1; }
.disc-dl-os-tooltip::before, .disc-dl-os-tooltip::after { content: ''; position: absolute; border: 6px solid transparent; }
.disc-dl-os-tooltip::before { left: 9px; top: 100%; border-top-color: var(--border); }
.disc-dl-os-tooltip::after { left: 10px; top: calc(100% - 1px); border-width: 5px; border-top-color: var(--bg-surface); }
.disc-dl-detail--os.flip-down .disc-dl-os-tooltip::before { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--border); }
.disc-dl-detail--os.flip-down .disc-dl-os-tooltip::after { top: auto; bottom: calc(100% - 1px); border-top-color: transparent; border-bottom-color: var(--bg-surface); }
.disc-dl-os-tooltip-row { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0; }
.disc-dl-os-tooltip-row svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }
.disc-dl-os-tooltip-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.disc-dl-os-tooltip-value { color: var(--text-secondary); margin-top: 1px; }
.disc-dl-os-tooltip-row--confirmed svg, .disc-dl-os-tooltip-row--confirmed .disc-dl-os-tooltip-label { color: #22c55e; }
.disc-dl-os-tooltip-row--probably svg, .disc-dl-os-tooltip-row--probably .disc-dl-os-tooltip-label { color: var(--warning); }
.disc-dl-os-tooltip-row--unsupported svg, .disc-dl-os-tooltip-row--unsupported .disc-dl-os-tooltip-label { color: var(--danger); }

/* Desktop: author moves from under the name to the right end of the
   Details row instead (same element, different slot — see author-row
   above and .disc-dl-author-row--details). */
@media (min-width: 640px) {
  .disc-dl-main-row { min-height: 0; }
  .disc-dl-info .disc-dl-author-row:not(.disc-dl-author-row--details) { display: none; }
  .disc-dl-details-row .disc-dl-author-row--details { display: flex; margin-left: auto; }
}

.disc-types-gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Pending submissions */
.disc-pending-heading {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.disc-pending-badge {
  display: inline-block;
  background: var(--warning);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.disc-pending-card {
  background: var(--bg-surface);
  border: 1px dashed var(--warning);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.disc-pending-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.875rem;
}

.disc-pending-actions {
  display: flex;
  gap: 8px;
}

/* C3 physical edition scans — shared between disc-detail and audio-detail
   (audio reuses the disc-type-group component via engine.load) */

.disc-type-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
}

.disc-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface-hover);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.disc-type-header-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
}

.disc-type-header-count {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

.disc-type-submission {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.disc-type-submission:last-child {
  border-bottom: none;
}

.disc-submission-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.disc-submission-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.disc-submission-bar-left a {
  color: var(--accent);
  text-decoration: none;
}

.disc-submission-bar-left a:hover {
  text-decoration: underline;
}

.disc-submission-bar-images {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

/* License pill */
.license-pill {
  position: relative;
  padding: 2px 8px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 99px;
  font-size: 0.625rem;
  font-weight: 600;
  cursor: help;
}

.license-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 10;
  line-height: 1.4;
}

.license-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.license-pill:hover .license-tooltip {
  display: block;
}

/* Source button */
.source-btn {
  padding: 2px 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

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

.source-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.disc-scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.disc-scan-item {
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
  aspect-ratio: 1;
  position: relative;
}

.disc-scan-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
}

.disc-scan-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Label overlays at bottom of the square tile with a dark gradient so the
   text remains readable regardless of the underlying image. */
.disc-scan-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 8px 6px;
  font-size: 0.6875rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
  pointer-events: none;
}

/* ══════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media screen and (max-width: 640px) {
  .nav-inner {
    height: 48px;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .nav-user {
    display: none;
  }

  .nav-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .hero {
    padding-top: 32px;
    padding-bottom: 20px;
  }

  .hero-subtitle {
    font-size: 0.875rem;
  }

  .game-section {
    padding-top: 8px;
    padding-bottom: 24px;
  }

  .footer {
    padding-top: 24px;
    padding-bottom: 16px;
    margin-top: 40px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Buttons: bigger touch targets on mobile */
  .btn {
    padding: 10px 16px;
    font-size: 0.8125rem;
  }

  .btn-sm {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  /* Modals full-width on mobile */
  .modal {
    width: 100%;
    max-width: calc(100vw - 32px);
    padding: 20px;
    border-radius: var(--radius);
  }

  .modal--wide {
    width: 100%;
  }

  .modal-grid, .modal-grid-3 { grid-template-columns: 1fr; }
  .upload-tiles-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-provider-row { flex-direction: column; }
  .modal-provider-row .modal-label:first-child { flex: unset; }

  /* Contribute slots compact */
  .contribute-slot-label {
    min-width: 70px;
    font-size: 0.75rem;
  }

  .contribute-slot-row {
    gap: 6px;
  }

  /* Toast wider on mobile */
  .toast {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(20px);
    text-align: center;
  }

  .toast.show {
    transform: translateX(0) translateY(0);
  }

  /* Notification dropdown full-width */
  .notif-dropdown {
    position: fixed;
    top: 48px;
    left: 8px;
    right: 8px;
    width: auto;
  }

  /* Custom select dropdown */
  .custom-select-dropdown {
    max-height: 180px;
  }

  /* Empty state compact */
  .empty-state {
    padding: 32px 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .disc-dl-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px;
  }

  .disc-pending-card {
    padding: 12px;
  }

  .disc-pending-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .disc-scan-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .disc-type-group {
    padding: 12px;
  }
}
