:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #111114;
  --panel-2: #17171b;
  --panel-3: #1d1d22;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f0;
  --muted: #97979f;
  --muted-2: #6f6f78;
  --lime: #b8f34d;
  --lime-2: #d7ff87;
  --lime-soft: rgb(var(--accent-rgb) / 0.12);
  --accent-rgb: 184 243 77;
  --on-accent: #111827;
  --purple: #8e5bff;
  --purple-text: #8e5bff;
  --secondary-rgb: 142 91 255;
  --purple-soft: rgb(var(--secondary-rgb) / 0.15);
  --red: #ff646e;
  --yellow: #ffd166;
  --blue: #72a7ff;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --topbar: 72px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f0f3f9;
  --panel-3: #e8edf5;
  --line: rgba(31, 47, 73, 0.13);
  --line-strong: rgba(31, 47, 73, 0.24);
  --text: #182333;
  --muted: #52627a;
  --muted-2: #68788d;
  --shadow: 0 16px 45px rgba(28, 42, 66, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 75% -10%, rgb(var(--secondary-rgb) / 0.1), transparent 33rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

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

.demo-strip {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: #cfd1c7;
  background: #1a1a1e;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.1);
}

.strip-button {
  border: 0;
  padding: 2px 0;
  margin-left: 5px;
  color: var(--lime);
  background: none;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  border-bottom: 1px solid rgb(var(--accent-rgb) / 0.45);
}

.app-shell {
  min-height: 100vh;
  padding-top: 0;
}
.app-shell[hidden], .auth-screen[hidden] { display: none; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 430px); display: grid; gap: 16px; padding: 30px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--panel); box-shadow: 0 24px 70px rgba(0,0,0,.18); }
.auth-card h1 { margin: 0; font-size: 28px; }
.auth-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.auth-card label { display: grid; gap: 7px; color: var(--text); font-size: 14px; }
.auth-card input, .auth-card select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: var(--panel-2); }
.auth-card .form-error { color: var(--red); }
.auth-card .auth-note { font-size: 13px; }
.signed-in-name { color: var(--text); font-size: 14px; font-weight: 700; }
.user-switcher[hidden] { display: none; }
.signed-in-name { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: relative; z-index: 20; }
.account-menu summary { display: flex; align-items: center; gap: 7px; min-height: 41px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { border-color: var(--line-strong); background: var(--panel-2); }
.account-popover { position: absolute; top: calc(100% + 6px); right: 0; display: none; min-width: 155px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--panel); box-shadow: 0 16px 35px rgba(0,0,0,.24); }
.account-menu:hover .account-popover, .account-menu:focus-within .account-popover, .account-menu[open] .account-popover { display: block; }
.account-popover button { width: 100%; padding: 10px 12px; border: 0; border-radius: 7px; color: var(--text); background: transparent; text-align: left; font-size: 14px; cursor: pointer; }
.account-popover button:hover, .account-popover button:focus-visible { background: var(--panel-2); }

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(9, 9, 11, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.brand > span:last-child span {
  color: var(--lime);
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--lime);
  box-shadow: 0 0 24px rgb(var(--accent-rgb) / 0.14);
}

.brand-mark svg {
  width: 29px;
  fill: var(--on-accent);
}

.brand-mark .mark-line {
  fill: none;
  stroke: var(--lime);
  stroke-width: 2.3;
  stroke-linecap: round;
}

.brand-mark .mark-dot {
  fill: var(--lime);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 166px;
  height: 43px;
  padding: 4px 33px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.avatar {
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #0b0b0d;
  background: var(--avatar-color, var(--lime));
  font-size: 10px;
  font-weight: 850;
}

.user-switcher select {
  position: relative;
  z-index: 2;
  width: 100%;
  border: 0;
  color: var(--text);
  background: transparent;
  appearance: none;
  font-size: 13px;
  font-weight: 650;
}

.user-switcher select option,
.select-control option,
.app-dialog option {
  color: var(--text);
  background: var(--panel-2);
}

.chevron {
  position: absolute;
  right: 13px;
  top: 10px;
  color: var(--muted);
  pointer-events: none;
}

.icon-button,
.close-button {
  position: relative;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  transition: 160ms ease;
}

.icon-button:hover,
.close-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 99px;
  color: var(--on-accent);
  background: var(--lime);
  font-size: 9px;
  font-weight: 900;
}

.layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
  padding-top: var(--topbar);
}

.sidebar {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  width: 224px;
  display: flex;
  flex-direction: column;
  padding: 25px 16px 18px;
  background: #0d0d10;
  border-right: 1px solid var(--line);
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: 150ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--text);
  background: var(--lime-soft);
  border-color: rgb(var(--accent-rgb) / 0.12);
}

.nav-item.active svg {
  color: var(--lime);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item span:nth-child(2) {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.nav-count {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.nav-count.alert {
  color: var(--on-accent);
  background: var(--lime);
  font-weight: 850;
}

.sidebar-card {
  position: relative;
  overflow: hidden;
  margin-top: auto;
  padding: 17px;
  border: 1px solid rgb(var(--accent-rgb) / 0.14);
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgb(var(--accent-rgb) / 0.14), transparent 65%),
    #141419;
}

.sidebar-card-icon {
  position: absolute;
  right: 14px;
  top: 11px;
  color: var(--lime);
  font-size: 18px;
}

.sidebar-card p {
  max-width: 120px;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.sidebar-card > span:not(.sidebar-card-icon) {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.sidebar-card button {
  margin-top: 14px;
  padding: 0;
  border: 0;
  color: var(--lime);
  background: none;
  font-size: 11px;
  font-weight: 750;
}

#main-content {
  grid-column: 2;
  min-width: 0;
  padding: 38px clamp(24px, 4vw, 58px) 80px;
}

.view {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  animation: view-in 260ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-heading {
  margin-bottom: 30px;
}

.page-heading h1,
.hero-copy h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(30px, 4.1vw, 51px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 760;
}

.page-heading p,
.hero-copy p {
  max-width: 590px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 30px;
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgb(var(--accent-rgb) / 0.07), transparent 48%),
    #121216;
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
}

.hero::before {
  width: 350px;
  height: 350px;
  top: -235px;
  right: -60px;
  border: 1px solid rgb(var(--accent-rgb) / 0.17);
  box-shadow: 0 0 0 45px rgb(var(--accent-rgb) / 0.025), 0 0 0 90px rgb(var(--accent-rgb) / 0.018);
}

.hero::after {
  width: 210px;
  height: 210px;
  right: 21%;
  bottom: -180px;
  background: rgb(var(--secondary-rgb) / 0.09);
  filter: blur(30px);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-copy h1 em {
  color: var(--lime);
  font-style: normal;
}

.hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hero-stat {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.028);
}

.hero-stat strong {
  color: var(--text);
  font-size: 25px;
  letter-spacing: -0.04em;
}

.hero-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-heading {
  margin: 34px 0 17px;
}

.section-heading h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 9px;
  align-items: center;
  min-width: 0;
}
.filters .search-control { flex: 1 1 180px; min-width: 105px; }
.filters .select-control { flex: 0 1 135px; min-width: 95px; width: auto; }
.filters .owned-filter { flex: 0 0 auto; }

.owned-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 41px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.owned-filter input { width: 17px; height: 17px; margin: 0; accent-color: var(--lime); }

.search-control {
  position: relative;
  min-width: 225px;
}

.search-control svg {
  position: absolute;
  left: 13px;
  top: 12px;
  width: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.search-control input,
.select-control,
.app-dialog input,
.app-dialog select,
.app-dialog textarea,
.admin-form input,
.admin-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transition: 150ms ease;
}

.search-control input {
  height: 41px;
  padding: 0 13px 0 38px;
}

.select-control {
  height: 41px;
  min-width: 135px;
  padding: 0 30px 0 12px;
}

.search-control input:hover,
.select-control:hover,
.app-dialog input:hover,
.app-dialog select:hover,
.app-dialog textarea:hover,
.admin-form input:hover,
.admin-form select:hover {
  border-color: var(--line-strong);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.game-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.game-cover {
  position: relative;
  overflow: hidden;
  height: 226px;
  display: flex;
  align-items: flex-end;
  padding: 17px;
  background: var(--cover-bg, linear-gradient(135deg, #1d2c52, #6c5ce7));
}

.cover-button {
  width: 100%;
  border: 0;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}

.game-cover::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -45px;
  top: -64px;
  border: 24px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.game-cover::after {
  content: attr(data-monogram);
  position: absolute;
  right: 12px;
  bottom: -18px;
  color: rgba(255, 255, 255, 0.1);
  font-size: 82px;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.game-cover.has-image {
  background: #171a23;
  isolation: isolate;
}

.game-cover.has-image::after,
.game-cover.has-image .cover-grid {
  display: none;
}

.game-cover.has-image::before {
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(9, 10, 14, 0.08), rgba(9, 10, 14, 0.45));
  transform: none;
  pointer-events: none;
}

.cover-backdrop-image {
  position: absolute;
  inset: -14%;
  width: 128%;
  height: 128%;
  object-fit: cover;
  filter: blur(28px) saturate(0.9) brightness(0.62);
  transform: scale(1.08);
}

.cover-image {
  position: absolute;
  z-index: 2;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: auto;
  max-width: 72%;
  height: calc(100% - 24px);
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.58));
  transform: translateX(-50%);
}

.cover-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to right, black, transparent 75%);
}

.platform-chip,
.status-chip {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  color: #fff;
  background: rgba(8, 8, 10, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.17);
  backdrop-filter: blur(10px);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-chip {
  color: var(--lime);
  background: rgba(8, 8, 10, 0.74);
}

.cover-top {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 13px;
}

.game-card-body {
  padding: 16px;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.game-card h3 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-button {
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-button:hover { color: var(--lime); }

.edition-owners {
  overflow: hidden;
  margin: 11px 0 8px;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-state {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.copy-state.available { color: var(--lime); border-color: rgb(var(--accent-rgb) / 0.25); background: var(--lime-soft); }
.copy-state.playing { color: var(--yellow); border-color: rgba(255, 209, 102, 0.25); background: rgba(255, 209, 102, 0.08); }
.copy-state.pending { color: var(--blue); border-color: rgba(114, 167, 255, 0.25); background: rgba(114, 167, 255, 0.08); }
.copy-state.loaned { color: var(--purple-text); border-color: rgb(var(--secondary-rgb) / 0.25); background: var(--purple-soft); }

.review-badge { display: inline-flex; margin-top: 8px; color: var(--yellow); font-size: 14px; font-weight: 700; line-height: 1.4; }
.review-badge.empty { color: var(--muted); font-weight: 500; }
.edition-card .review-badge { display: block; }
.edition-card .copy-state { display: table; margin-top: 10px; }
.profile-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.profile-summary { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile-summary h2 { margin: 0 0 4px; font-size: 20px; }
.profile-summary p { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.profile-avatar { display: grid; place-items: center; width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; overflow: hidden; background: var(--avatar-color); color: #111; font-weight: 800; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 680px) { .profile-panel { align-items: stretch; flex-direction: column; } }

.availability-control {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.availability-control select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel-2);
}

.availability-control select:disabled { opacity: 0.55; cursor: not-allowed; }
.game-card-body > .copy-state { margin-top: 12px; }

.loan-attribution {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.game-genre {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.owner-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.mini-avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #09090b;
  background: var(--mini-color, var(--lime));
  font-size: 7px;
  font-weight: 900;
}

.owner-line strong {
  color: #d9d9d3;
  font-weight: 650;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  transition: 160ms ease;
}

.button.primary {
  color: var(--on-accent);
  background: var(--lime);
}

.button.primary:hover {
  background: var(--lime-2);
  box-shadow: 0 7px 24px rgb(var(--accent-rgb) / 0.15);
}

.button.secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.button.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.button.danger {
  color: var(--red);
  border-color: rgba(255, 100, 110, 0.2);
  background: rgba(255, 100, 110, 0.07);
}

.button.small {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 10px;
}

.button:disabled {
  cursor: default;
  opacity: 0.48;
  box-shadow: none;
}

.card-actions .button {
  flex: 1;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 230px;
  display: grid;
  place-items: center;
  padding: 35px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 15px;
  color: var(--lime);
  background: var(--lime-soft);
  font-size: 24px;
}

.empty-state h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 16px;
}

.empty-state p {
  max-width: 370px;
  margin: 0 0 17px;
  font-size: 12px;
  line-height: 1.55;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.summary-card {
  min-height: 105px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}

.summary-card span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 7px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.summary-card.lime strong { color: var(--lime); }
.summary-card.purple strong { color: var(--purple-text); }

.loan-sections {
  display: grid;
  gap: 28px;
}

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

.loan-section-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.loan-section-header span {
  color: var(--muted);
  font-size: 11px;
}

.loan-list,
.user-list {
  display: grid;
  gap: 8px;
}

.loan-row,
.user-row {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.loan-art {
  flex: 0 0 auto;
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.9);
  background: var(--cover-bg);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.06em;
  overflow: hidden;
}

.loan-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loan-copy,
.user-copy {
  min-width: 0;
  flex: 1;
}

.loan-copy h3,
.user-copy h3 {
  overflow: hidden;
  margin: 0 0 5px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loan-copy p,
.user-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.pending { color: var(--yellow); background: rgba(255, 209, 102, 0.08); }
.status-pill.active { color: var(--lime); background: var(--lime-soft); }
.status-pill.returned { color: var(--blue); background: rgba(114, 167, 255, 0.09); }
.status-pill.declined,
.status-pill.cancelled { color: var(--muted); }

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
  gap: 18px;
}

.admin-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.admin-panel h2 {
  margin: 0 0 5px;
  font-size: 16px;
}

.admin-panel > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.cover-panel {
  margin-top: 18px;
}

.cover-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.cover-panel-heading h2 {
  font-size: 20px;
}

.cover-panel-heading p {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.cover-counter {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgb(var(--accent-rgb) / 0.23);
  border-radius: 8px;
  color: var(--lime);
  background: var(--lime-soft);
  font-size: 13px;
  font-weight: 750;
}

.cover-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 14px;
}

.cover-tab {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 14px;
}

.cover-tab.active {
  border-color: rgb(var(--accent-rgb) / 0.42);
  color: var(--lime);
  background: var(--lime-soft);
}

.cover-admin-list {
  display: grid;
  gap: 10px;
}

.cover-admin-row {
  display: flex;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.cover-admin-preview {
  flex: 0 0 68px;
  width: 68px;
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  color: white;
  background: var(--cover-bg);
  font-size: 22px;
  font-weight: 850;
}

.admin-cover-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #101115;
}

.cover-admin-details {
  flex: 1;
  min-width: 0;
}

.cover-admin-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.cover-admin-title h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.cover-admin-title small {
  color: var(--muted);
  font-size: 12px;
}

.edition-badge {
  padding: 4px 7px;
  border-radius: 6px;
  color: #d8d8de;
  background: #2b2b33;
  font-size: 12px;
  font-weight: 750;
}

.cover-form {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.cover-source-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.cover-source-fields { min-width: 0; }

.cover-form select {
  width: 100%;
  height: 43px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 14px;
}

.cover-form input {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 14px;
}

.cover-form .button {
  height: 43px;
  min-width: 76px;
}

.cover-remove {
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 13px;
  text-decoration: underline;
}

.cover-remove:hover { color: var(--red); }

.cover-form input[type="file"],
.app-dialog input[type="file"] {
  height: auto;
  min-height: 43px;
  padding: 8px;
  font-size: 14px;
}

.cover-form input[type="file"]::file-selector-button,
.app-dialog input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  color: var(--on-accent);
  background: var(--lime);
  cursor: pointer;
}

.cover-form-feedback {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.cover-empty {
  padding: 25px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.user-row .avatar {
  width: 38px;
  height: 38px;
}

.role-badge {
  margin-left: 7px;
  padding: 3px 6px;
  border-radius: 5px;
  color: #ba9cff;
  background: var(--purple-soft);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
  vertical-align: 2px;
}

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #34343b;
  transition: 160ms ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #9d9da4;
  transition: 160ms ease;
}

.toggle.on { background: var(--lime); }
.toggle.on::after { left: 19px; background: #0a0a0c; }
.toggle:disabled { cursor: not-allowed; opacity: 0.4; }

.admin-form {
  display: grid;
  gap: 13px;
}

.admin-form label,
.app-dialog label {
  display: grid;
  gap: 7px;
  color: #c9c9c3;
  font-size: 11px;
  font-weight: 650;
}

.admin-form input,
.admin-form select,
.app-dialog input,
.app-dialog select {
  height: 43px;
  padding: 0 12px;
}

.admin-form .button {
  margin-top: 3px;
}

.platform-panel { margin-top: 18px; }
.platform-panel p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.platform-form { display: flex; gap: 10px; margin-top: 16px; }
.platform-form input {
  flex: 1;
  min-width: 0;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 14px;
}
.platform-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.platform-list .platform-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 5px 4px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--panel-2); font-size: 13px; }
.platform-item button { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 20px; line-height: 1; }
.platform-item button:hover { color: var(--red); background: rgba(255, 100, 110, 0.1); }
.platform-item button:disabled { opacity: 0.4; cursor: not-allowed; }

.credential-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgb(var(--accent-rgb) / 0.35);
  border-radius: 10px;
  background: var(--lime-soft);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.credential-result p { margin: 8px 0; }
.credential-result code { user-select: all; color: var(--lime); }
.credential-result small { color: var(--muted); }
.user-row > .button { flex: 0 0 auto; }

.info-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  color: var(--muted);
  background: rgb(var(--secondary-rgb) / 0.08);
  font-size: 10px;
  line-height: 1.5;
}

.info-note span:first-child {
  color: var(--purple-text);
  font-size: 14px;
}

.notification-panel {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  padding: 27px;
  background: #111115;
  border-left: 1px solid var(--line-strong);
  box-shadow: -20px 0 70px rgba(0, 0, 0, 0.42);
  transform: translateX(105%);
  transition: transform 220ms ease;
}

.notification-panel.open {
  transform: translateX(0);
}

.panel-header,
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.dialog-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.close-button {
  width: 35px;
  height: 35px;
  font-size: 21px;
  line-height: 1;
}

.panel-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.notification-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.notification-item.unread .notification-copy p {
  color: #ededE8;
}

.notification-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--lime);
  background: var(--lime-soft);
}

.notification-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.48;
}

.notification-copy time {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-dialog {
  width: min(520px, calc(100vw - 30px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--text);
  background: #141418;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.67);
  backdrop-filter: blur(6px);
}

.app-dialog form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.game-title-field { display: grid; gap: 7px; }
.game-title-field > label { color: var(--text); font-size: 14px; font-weight: 650; }
.game-suggestion-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.game-suggestions { display: grid; max-height: 256px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-2); }
.game-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
}
.game-suggestion:last-child { border-bottom: 0; }
.game-suggestion:hover:not(:disabled), .game-suggestion:focus-visible { background: var(--lime-soft); }
.game-suggestion:disabled { cursor: default; opacity: 0.6; }
.suggestion-copy { display: grid; min-width: 0; gap: 3px; }
.suggestion-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-copy span { color: var(--muted); font-size: 13px; }

.form-hint { margin: -6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.game-detail-dialog { width: min(620px, calc(100vw - 30px)); max-height: min(85vh, 850px); overflow-y: auto; }
#game-detail-content { padding: 24px; }
.detail-intro { margin: 17px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.copy-list { display: grid; gap: 11px; max-height: 40vh; overflow-y: auto; }
.copy-row { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.copy-owner { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.copy-owner .mini-avatar { width: 32px; height: 32px; font-size: 10px; flex: 0 0 auto; }
.copy-owner strong { margin-right: auto; font-size: 15px; }
.copy-name { font-size: 15px; font-weight: 700; }
.copy-row p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.copy-row p.loan-attribution { color: var(--text); font-weight: 600; }
.copy-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.copy-action { display: flex; justify-content: flex-end; }
.copy-action:empty { display: none; }
.profile-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.profile-link:hover, .profile-link:focus-visible { color: var(--accent, var(--text)); text-decoration-color: currentColor; }
.profile-back { border: 0; background: none; padding: 0 0 18px; color: var(--muted); font: inherit; cursor: pointer; }
.profile-back:hover, .profile-back:focus-visible { color: var(--text); text-decoration: underline; }
.owner-hint { color: var(--muted); font-size: 13px; line-height: 1.4; }

.review-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.review-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.review-heading h3 { margin: 0; font-size: 20px; letter-spacing: -0.025em; }
.review-heading .review-badge { margin: 0; }
.review-scope { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
#game-detail-content .review-form { display: grid; gap: 14px; padding: 18px 0 20px; }
.rating-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.rating-picker legend { margin-bottom: 8px; color: var(--text); font-size: 14px; font-weight: 650; }
.rating-options { display: flex; gap: 7px; flex-wrap: wrap; }
.app-dialog .rating-option { position: relative; display: block; color: var(--text); cursor: pointer; }
.rating-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rating-option span { min-width: 46px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--muted); background: var(--panel-2); font-size: 18px; }
.rating-option small { font-size: 13px; }
.rating-option input:checked + span { border-color: var(--purple); color: var(--purple-text); background: var(--purple-soft); }
.rating-option:focus-within span { outline: 2px solid var(--lime); outline-offset: 2px; }
.review-form > label { color: var(--text); font-size: 14px; }
.review-form textarea { width: 100%; min-height: 88px; }
.review-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.review-list { display: grid; gap: 10px; }
.review-item { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.review-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 14px; }
.review-meta span { color: var(--yellow); letter-spacing: 0.02em; }
.review-meta time { margin-left: auto; color: var(--muted); font-size: 13px; }
.review-edit { width: 31px; height: 31px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: var(--panel); font-size: 19px; cursor: pointer; }
.review-edit:hover { border-color: var(--lime); }
.review-delete { border: 0; padding: 5px 0; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.review-delete:hover { color: var(--red); }
.library-review { margin-top: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.library-review span { color: var(--yellow); font-size: 15px; }
.library-review p { margin: 6px 0; color: var(--text); font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-edit-link { margin-top: 6px; padding: 0; border: 0; color: var(--lime); background: transparent; font-size: 13px; cursor: pointer; }
.form-error { margin: 0; color: var(--red); font-size: 14px; line-height: 1.4; }
.form-error:empty { display: none; }
.review-item p { margin: 9px 0 0; color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-empty { margin: 0; color: var(--muted); font-size: 14px; }

.appearance-content { display: grid; gap: 18px; padding: 24px; }
.appearance-content label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.appearance-content select { height: 43px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: var(--panel-2); }
.secondary-picker { display: grid; gap: 13px; }
.secondary-picker > label { color: var(--text); font-weight: 700; }
.secondary-picker-row { display: flex; align-items: center; gap: 23px; }
.color-wheel {
  --picked-color: #8e5bff;
  --marker-x: 50%;
  --marker-y: 8%;
  position: relative;
  width: 168px;
  height: 168px;
  flex: 0 0 168px;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  appearance: none;
  overflow: hidden;
  background: radial-gradient(circle closest-side, #fff 0%, rgba(255,255,255,0) 100%), conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  background-clip: padding-box;
  box-shadow: 0 9px 24px rgba(0,0,0,0.24);
  cursor: crosshair;
  touch-action: none;
}
.color-wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  width: 34px; height: 34px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--picked-color);
  box-shadow: 0 2px 9px rgba(0,0,0,0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.color-wheel-marker {
  position: absolute;
  top: var(--marker-y); left: var(--marker-x);
  width: 16px; height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--picked-color);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.secondary-picker-copy { display: grid; gap: 8px; min-width: 0; color: var(--muted); font-size: 14px; }
.secondary-picker-copy output { color: var(--text); font: 700 18px ui-monospace, SFMono-Regular, Consolas, monospace; }
.appearance-content .native-color-label { display: flex; align-items: center; gap: 9px; color: var(--text); }
.native-color-label input[type="color"] { width: 48px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.secondary-picker-copy p { margin: 0; line-height: 1.45; }
.appearance-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.appearance-button { font-size: 24px; line-height: 1; }

.app-dialog .dialog-header {
  margin-bottom: 3px;
}

.app-dialog textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

.add-game-cover { display: grid; gap: 12px; }
.dialog-intro { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.cover-field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.optional {
  color: var(--muted-2);
  font-weight: 400;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 5px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: #1a1a1f;
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 220ms ease both;
}

.toast::before {
  content: "✓";
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--on-accent);
  background: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

:root[data-theme="light"] body {
  background: radial-gradient(circle at 75% -10%, rgba(76, 105, 185, 0.1), transparent 33rem), var(--bg);
}

:root[data-theme="light"] .demo-strip { color: #40516c; background: #e8edf6; }
:root[data-theme="light"] .topbar { background: rgba(249, 251, 255, 0.91); }
:root[data-theme="light"] .sidebar { background: #ecf1f8; }
:root[data-theme="light"] .sidebar-card { background: radial-gradient(circle at 100% 0, rgb(var(--accent-rgb) / 0.11), transparent 65%), #ffffff; }
:root[data-theme="light"] .hero { background: linear-gradient(120deg, rgb(var(--accent-rgb) / 0.07), transparent 48%), #ffffff; }
:root[data-theme="light"] .hero-stat,
:root[data-theme="light"] .cover-admin-row,
:root[data-theme="light"] .user-switcher,
:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .close-button,
:root[data-theme="light"] .button.secondary { background: rgba(31, 47, 73, 0.035); }
:root[data-theme="light"] .icon-button:hover,
:root[data-theme="light"] .close-button:hover,
:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .button.secondary:hover { background: rgba(31, 47, 73, 0.075); }
:root[data-theme="light"] .notification-panel,
:root[data-theme="light"] .app-dialog,
:root[data-theme="light"] .toast { background: #ffffff; }
:root[data-theme="light"] .notification-item.unread .notification-copy p { color: var(--text); }
:root[data-theme="light"] .edition-badge { color: var(--text); background: var(--panel-3); }
:root[data-theme="light"] .sidebar { border-color: var(--line); }
:root[data-theme="light"] .info-note { background: rgba(111, 77, 197, 0.08); }
:root[data-theme="light"] .review-badge:not(.empty),
:root[data-theme="light"] .review-meta span { color: #805000; }
:root[data-theme="light"] .role-badge { color: #58389c; }
:root[data-theme="light"] .pulse-dot { box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.1); }
:root[data-theme="light"] .app-dialog input,
:root[data-theme="light"] .app-dialog select,
:root[data-theme="light"] .app-dialog textarea,
:root[data-theme="light"] .admin-form input,
:root[data-theme="light"] .admin-form select,
:root[data-theme="light"] .select-control,
:root[data-theme="light"] .search-control input { background: var(--panel-2); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-add {
  display: none;
}

@media (max-width: 1050px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .hero-stat { min-height: 78px; padding: 13px; }
  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --topbar: 62px; }

  .demo-strip {
    justify-content: flex-start;
    padding: 0 12px;
    font-size: 9px;
  }

  .strip-button { margin-left: auto; }
  .topbar { padding: 0 13px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark svg { width: 26px; }
  .user-switcher { min-width: 0; width: 47px; padding-right: 4px; border: 0; background: none; }
  .user-switcher select { position: absolute; inset: 0; opacity: 0; }
  .chevron { display: none; }
  .icon-button { width: 39px; height: 39px; }

  .layout {
    display: block;
    padding-bottom: 67px;
  }

  .sidebar {
    z-index: 55;
    top: auto;
    right: 0;
    bottom: 0;
    width: auto;
    height: 67px;
    display: block;
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(13, 13, 16, 0.95);
    backdrop-filter: blur(18px);
  }

  .sidebar nav {
    display: flex;
    height: 100%;
    justify-content: space-around;
  }

  .nav-item {
    width: auto;
    min-width: 62px;
    height: 52px;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px;
  }

  .nav-item span:nth-child(2) {
    flex: 0;
    font-size: 9px;
  }

  .nav-count {
    position: absolute;
    top: 2px;
    margin-left: 28px;
  }

  .nav-item { position: relative; }
  .sidebar-card { display: none; }
  .cover-form { grid-template-columns: minmax(0, 1fr) auto; }
  .cover-form select { grid-column: 1 / -1; }
  .cover-form .button { width: auto; }
  #main-content { padding: 24px 14px 54px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1, .hero-copy h1 { font-size: clamp(29px, 9.5vw, 42px); }
  .page-heading .button { flex: 0 0 auto; }
  .hero { min-height: 0; padding: 27px 22px; border-radius: 19px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .filters { width: 100%; }
  .search-control { min-width: 0; flex: 1; }
  .select-control { min-width: 118px; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .game-cover { height: 184px; padding: 12px; }
  .game-card-body { padding: 12px; }
  .game-card h3 { font-size: 13px; }
  .game-genre { display: none; }
  .owner-line { font-size: 9px; }
  .card-actions { margin-top: 12px; }
  .card-actions .button { padding: 0 8px; font-size: 9px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:last-child { grid-column: 1 / -1; }
  .loan-row, .user-row { align-items: flex-start; flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-end; }
  .status-pill { margin-left: auto; }
  .notification-panel { padding: 22px; }
}

@media (max-width: 460px) {
  .brand > span:last-child { display: none; }
  .game-grid { grid-template-columns: 1fr; }
  .game-cover { height: 238px; }
  .copy-footer { align-items: stretch; flex-direction: column; }
  .copy-footer .copy-state, .copy-action .button { width: 100%; justify-content: center; }
  .hero-stats { gap: 7px; }
  .hero-stat { min-height: 70px; padding: 11px; }
  .hero-stat strong { font-size: 21px; }
  .hero-stat span { font-size: 8px; }
  .filters { align-items: center; flex-direction: row; gap: 5px; }
  .filters .search-control { flex: 1 1 30%; min-width: 0; }
  .filters .select-control { flex: 0 1 88px; min-width: 0; padding: 0 16px 0 5px; font-size: 12px; }
  .filters .owned-filter { gap: 4px; padding: 0 5px; font-size: 11px; }
  .filters .owned-filter input { width: 14px; height: 14px; }
  .search-control input { padding-left: 29px; font-size: 12px; }
  .search-control svg { left: 8px; }
  .form-row { grid-template-columns: 1fr; }
  .secondary-picker-row { flex-direction: column; align-items: flex-start; }
  .color-wheel { width: 150px; height: 150px; flex-basis: 150px; align-self: center; }
  .platform-form { flex-direction: column; }
  .dialog-actions .button { flex: 1; }
  .cover-panel-heading { flex-direction: column; gap: 10px; }
  .cover-admin-row { gap: 10px; padding: 10px; }
  .cover-admin-preview { flex-basis: 54px; width: 54px; height: 74px; }
  .toast-region { right: 12px; bottom: 80px; left: 12px; }
  .toast { min-width: 0; }
}

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

/* Favoris, votes et achats personnels */
.avatar, .mini-avatar, #header-avatar { overflow: hidden; }
.account-menu summary .mini-avatar { width: 27px; height: 27px; flex-basis: 27px; }
.avatar img, .mini-avatar img, #header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mini-avatar { flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%; font-size: 9px; }
.owner-line { font-size: 14px; }
.edition-owners { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; overflow: visible; white-space: normal; }
.owner-inline { display: inline-flex; align-items: center; gap: 5px; }
.owner-inline .mini-avatar { width: 24px; height: 24px; flex-basis: 24px; }
.card-actions { flex-wrap: wrap; }
.favorite-button { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: var(--panel-2); font-size: 13px; font-weight: 700; cursor: pointer; }
.favorite-button:hover, .favorite-button.selected { border-color: var(--purple); color: var(--purple-text); background: var(--purple-soft); }
.detail-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 6px; }
.vote-counts { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 13px; }
.game-card-body .vote-counts { margin-top: 10px; }
.vote-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.vote-section .review-heading { align-items: center; }
.vote-section .review-heading h3 { margin: 0; font-size: 20px; }
.vote-form { display: grid; gap: 14px; margin-top: 16px; }
.vote-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.vote-form legend { margin-bottom: 9px; font-size: 14px; font-weight: 700; }
.vote-options { display: flex; flex-wrap: wrap; gap: 8px; }
.vote-option { position: relative; cursor: pointer; }
.vote-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.vote-option span { display: inline-flex; align-items: center; min-height: 41px; padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: var(--panel-2); font-size: 14px; }
.vote-option input:checked + span { border-color: var(--text); background: var(--panel-3); font-weight: 700; }
.vote-option:focus-within span { outline: 2px solid var(--lime); outline-offset: 2px; }
.my-vote { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 15px; font-size: 14px; }
.my-vote > span { margin-right: auto; }
.profile-tabs { display: flex; gap: 8px; margin: -8px 0 26px; border-bottom: 1px solid var(--line); }
.profile-tabs { overflow-x: auto; scrollbar-width: thin; }
.profile-tabs button { flex: 0 0 auto; white-space: nowrap; }
.profile-tabs button { min-height: 44px; padding: 8px 13px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 14px; font-weight: 700; cursor: pointer; }
.profile-tabs button.active { color: var(--text); border-color: var(--lime); }
.profile-tabs span { margin-left: 5px; color: var(--purple-text); }
.favorite-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 23px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.favorite-heading .eyebrow { color: var(--muted); }
.favorite-form label { display: grid; gap: 6px; font-size: 14px; }
.favorite-form input, .favorite-form select { width: 100%; min-height: 41px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: var(--panel-2); }
.favorite-empty .game-card-body p { color: var(--muted); font-size: 14px; line-height: 1.4; }
.favorite-version-label { margin: 12px 0 7px; color: var(--muted); font-size: 13px; }
.favorite-editions { display: flex; flex-wrap: wrap; gap: 7px; }
.favorite-editions button { min-height: 33px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: var(--panel-2); font-size: 13px; cursor: pointer; }
.favorite-editions button:hover, .favorite-editions button:focus-visible { border-color: var(--lime); }
.spending-panel { margin: 0 0 29px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.spending-panel .section-heading { margin-bottom: 14px; }
.spending-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.spending-totals > div { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.spending-totals span { display: block; color: var(--muted); font-size: 13px; }
.spending-totals strong { display: block; margin-top: 5px; color: var(--text); font-size: clamp(17px, 2.5vw, 24px); }
.spending-note { margin: 12px 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.spending-table-wrap { overflow-x: auto; }
.spending-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.spending-table caption { padding: 10px 0; color: var(--text); font-weight: 700; text-align: left; }
.spending-table th, .spending-table td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.spending-table thead { color: var(--muted); }
.purchase-snippet { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.purchase-snippet button { width: fit-content; padding: 0; border: 0; color: var(--lime); background: transparent; text-decoration: underline; cursor: pointer; }
.billing-view .page-heading, .detailed-spending .page-heading { margin-bottom: 22px; }
.billing-list { display: grid; gap: 10px; margin-top: 18px; }
.billing-row { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.billing-game { display: grid; gap: 5px; min-width: 0; }
.billing-game strong { overflow-wrap: anywhere; font-size: 16px; }
.billing-game span { color: var(--muted); font-size: 14px; }
.billing-price { display: grid; gap: 4px; }
.billing-price span { color: var(--muted); font-size: 13px; }
.billing-price strong { font-size: 14px; }
.billing-dlcs { grid-column: 1 / -1; display: grid; gap: 5px; margin: 0; padding: 11px 0 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.billing-dlcs li { padding-left: 2px; }
.billing-dlcs span { margin-left: 7px; color: var(--text); }
.detailed-spending { padding: 0; border: 0; background: transparent; }
.spending-charts { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(0, 1.3fr); gap: 14px; margin: 22px 0; }
.chart-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.chart-card h3, .top-spending h3 { margin: 0 0 16px; font-size: 18px; }
.donut-layout { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 160px; height: 160px; flex: 0 0 160px; }
.donut-wrap svg { width: 100%; height: 100%; }
.donut-wrap > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
.chart-legend { display: grid; gap: 10px; min-width: 120px; }
.chart-legend > span { display: grid; grid-template-columns: 11px auto; gap: 3px 8px; align-items: center; color: var(--muted); font-size: 14px; }
.chart-legend strong { grid-column: 2; color: var(--text); }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--lime); }
.chart-legend .legend-dlcs { background: var(--purple); }
.platform-chart { display: grid; gap: 15px; }
.platform-chart-row > div:first-child { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.platform-chart-row strong { overflow-wrap: anywhere; }
.platform-chart-row > div:first-child span { flex: 0 0 auto; color: var(--muted); }
.platform-track { display: flex; width: 100%; height: 15px; overflow: hidden; border-radius: 999px; background: var(--panel-2); }
.platform-track span { height: 100%; }
.platform-track .bar-games { background: var(--lime); }
.platform-track .bar-dlcs { background: var(--purple); }
.chart-empty { margin: 20px 0; padding: 26px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; font-size: 14px; }
.chart-empty p { margin: 0 0 13px; }
.detailed-spending .spending-table-wrap, .top-spending { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.top-spending ol { display: grid; gap: 0; margin: 0; padding-left: 25px; }
.top-spending li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.top-spending li:last-child { border-bottom: 0; }
.top-spending li > small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.top-spending li span { overflow-wrap: anywhere; }
.top-spending li span small { margin-left: 5px; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) {
  .spending-charts { grid-template-columns: 1fr; }
  .billing-row { grid-template-columns: minmax(0, 1.5fr) minmax(95px, 1fr) auto; }
  .billing-price:nth-of-type(3) { grid-column: 2; }
  .billing-row > .button { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 560px) {
  .billing-row { grid-template-columns: minmax(0, 1fr) auto; }
  .billing-game { grid-column: 1; }
  .billing-price, .billing-price:nth-of-type(3) { grid-column: 1; }
  .billing-row > .button { grid-column: 2; grid-row: 1; }
  .billing-dlcs { grid-column: 1 / -1; }
}
.app-dialog { max-height: min(90vh, 900px); overflow-y: auto; }
.purchase-fields { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.purchase-fields legend { padding: 0 6px; color: var(--text); font-size: 15px; font-weight: 700; }
.purchase-fields p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.purchase-fields > label, .dlc-row label { display: grid; gap: 6px; color: var(--text); font-size: 14px; }
.purchase-fields > button { justify-self: start; }
.dlc-rows { display: grid; gap: 10px; }
.dlc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .65fr) 32px; gap: 9px; align-items: end; }
.dlc-row .close-button { width: 32px; height: 42px; }
.optional { color: var(--muted); font-size: 13px; font-weight: 400; }
@media (max-width: 680px) {
  .filters { flex-wrap: wrap; }
  .filters .search-control { flex: 1 1 100%; }
  .filters .select-control { flex: 1 1 43%; min-width: 0; font-size: 14px; }
  .filters .owned-filter { flex: 1 1 100%; }
  .favorite-form { grid-template-columns: 1fr; }
  .favorite-form .button { width: 100%; }
  .spending-totals { grid-template-columns: 1fr 1fr; }
  .spending-totals > div:last-child { grid-column: 1 / -1; }
  .dlc-row { grid-template-columns: 1fr 32px; }
  .dlc-row label:nth-child(2) { grid-column: 1; }
  .dlc-row .close-button { grid-column: 2; grid-row: 1; }
  .card-actions .favorite-button { font-size: 25px; }
}

/* Cartes cliquables et sections de la collection */
.game-card[data-open-game] { cursor: pointer; display: flex; flex-direction: column; }
.game-card[data-open-game]:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.game-card-body { display: flex; flex: 1; flex-direction: column; }
.game-card-body .card-actions { margin-top: auto; padding-top: 16px; }
.card-actions .button { min-width: 0; }
.digital-library { margin-top: 34px; padding-top: 25px; border-top: 1px solid var(--line-strong); }
.digital-library .section-heading { margin-top: 0; }
.favorite-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 46px; width: 46px; min-height: 44px; padding: 0; font-size: 25px; line-height: 1; }
.card-actions .favorite-button { font-size: 25px; }
.detail-tools .favorite-button { flex: 0 0 46px; }

/* Vote compact sur une seule rangée */
.app-dialog .vote-form { display: flex; align-items: flex-end; flex-wrap: nowrap; gap: 7px; overflow-x: auto; padding-bottom: 3px; }
.vote-form fieldset { flex: 0 0 auto; }
.vote-form legend { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.vote-form .vote-options, .vote-form .review-actions { flex-wrap: nowrap; gap: 5px; }
.vote-form .review-actions { flex: 0 0 auto; }
.vote-form .vote-option span { min-height: 39px; padding: 7px 9px; white-space: nowrap; font-size: 12px; }
.vote-form .button { min-height: 39px; padding: 0 10px; white-space: nowrap; font-size: 12px; }
@media (max-width: 520px) {
  .vote-form .vote-option span { padding: 6px 7px; font-size: 11px; }
  .vote-form .button { padding: 0 7px; font-size: 11px; }
  .game-card .card-actions .button { font-size: 11px; }
}
.game-card .card-actions .remove-favorite-button { width: 100%; min-height: 44px; padding: 0 14px; white-space: nowrap; font-size: 14px; }

.expenses-heading { align-items: center; gap: 16px; }
.expenses-heading .button { flex: 0 0 auto; }
.expenses-view .spending-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.expenses-subheading, .removed-history h3 { margin: 27px 0 13px; color: var(--text); font-size: 19px; }
.removed-history { margin-top: 27px; padding-top: 8px; border-top: 1px solid var(--line); }
.removed-history .spending-note { margin-top: -5px; }
.removed-list { display: grid; gap: 9px; }
.removed-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(95px, 1fr) minmax(95px, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.removed-row > div { display: grid; gap: 4px; min-width: 0; }
.removed-row strong { overflow-wrap: anywhere; color: var(--text); font-size: 14px; }
.removed-row span { color: var(--muted); font-size: 12px; }
.removed-row .button { white-space: nowrap; }
@media (max-width: 760px) {
  .expenses-view .spending-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .removed-row { grid-template-columns: minmax(0, 1fr) minmax(100px, auto); }
  .removed-row > div:first-child { grid-column: 1 / -1; }
  .removed-row .button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 460px) {
  .expenses-heading { align-items: flex-start; }
  .expenses-heading .button { width: 100%; }
}

/* Un seul catalogue, avec les mêmes grandes cartes pour les deux types de jeux. */
.catalogue-switch { display: inline-flex; gap: 4px; max-width: 100%; margin-top: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.catalogue-switch button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.catalogue-switch button[aria-pressed="true"] { color: var(--on-accent); background: var(--lime); }
.catalogue-switch button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.catalogue-switch ~ .section-heading { margin-top: 24px; }
.edition-card .copy-state.digital { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.digital-match-message { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.digital-match-message.matched { color: var(--lime); font-weight: 650; }
.edition-card .card-actions .button { font-size: 14px; line-height: 1.2; }
.card-actions > .favorite-button { margin-left: auto; }
.card-actions:has(> .favorite-button) { flex-wrap: nowrap; }
.card-actions:has(> .favorite-button) > .owner-hint { min-width: 0; }
@media (max-width: 460px) { .catalogue-switch { display: flex; } .catalogue-switch button { flex: 1 1 0; min-width: 0; padding: 0 9px; font-size: 13px; } }
