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

:root {
  --bg: #0e141b;
  --bg-raised: #151f2e;
  --surface-1: rgba(255,255,255,.035);
  --surface-2: rgba(255,255,255,.065);
  --surface-3: rgba(255,255,255,.1);
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.16);
  --text: #c6d4df;
  --text-2: #8a9ba8;
  --text-3: rgba(255,255,255,.35);
  --accent: #66c0f4;
  --accent-bright: #8fd4ff;
  --accent-glow: rgba(102,192,244,.15);
  --danger: #e85d5d;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --text-xs: 0.7rem; --text-sm: 0.82rem; --text-base: 0.92rem;
  --text-lg: 1.05rem; --text-xl: 1.25rem;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-xl: 18px;
  --dur: 180ms; --ease: cubic-bezier(.4,0,.2,1);
}

body {
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  display: flex; flex-direction: column;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px;
  flex: 1;
}

/* ── Header ────────────────────────────────────────────────── */
.header-bar {
  background: linear-gradient(180deg, rgba(102,192,244,.06) 0%, var(--bg) 80%);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px) saturate(1.4);
}

.header-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-logo-img {
  height: 30px; width: auto;
  filter: brightness(0) invert(1);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  display: block;
}
.header-logo-img:hover { transform: scale(1.1) rotate(-6deg); }
.header-title-link { text-decoration: none; color: inherit; }
.header-logo h1 {
  font-size: 1.15em; font-weight: 700; letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Nav ───────────────────────────────────────────────────── */
nav {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
}
.nav-link {
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--font);
  font-weight: 500;
  transition: all var(--dur) var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent-bright); background: var(--accent-glow); }

.auth-toggle {
  padding: 5px; margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur); display: flex; align-items: center;
}
.auth-toggle:hover { background: var(--surface-2); color: var(--text); }
.auth-toggle svg { width: 20px; height: 20px; }

.header-home {
  display: flex; align-items: center;
  margin-left: 4px; padding: 5px;
  color: var(--text-3); text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--dur), background var(--dur);
}
.header-home:hover { color: var(--text-2); background: var(--surface-2); }
.header-home svg { width: 28px; height: 28px; display: block; }

/* ── Auth panel ────────────────────────────────────────────── */
.auth-panel {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s var(--ease);
}
.auth-panel.open { max-height: 300px; }
.auth-panel-inner { padding: 20px; max-width: 360px; margin: 0 auto; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.auth-tab {
  flex: 1; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-3);
  cursor: pointer; font-family: var(--font); font-size: var(--text-sm);
  transition: all var(--dur);
}
.auth-tab.active { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.auth-form input {
  width: 100%; padding: 9px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--text);
  font-size: var(--text-sm); font-family: var(--font);
}
.auth-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-form input::placeholder { color: var(--text-3); }
.auth-submit {
  width: 100%; padding: 9px; border: none;
  border-radius: var(--radius-sm); background: var(--accent);
  color: #fff; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background var(--dur);
}
.auth-submit:hover { background: var(--accent-bright); }
#authUser { align-items: center; justify-content: space-between; }
#authUser:not([hidden]) { display: flex; }
.auth-username { color: var(--text); font-weight: 600; font-size: var(--text-sm); }
.auth-logout {
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--text-3); cursor: pointer; font-family: var(--font);
  font-size: var(--text-xs); transition: all var(--dur);
}
.auth-logout:hover { background: var(--surface-2); color: var(--text); }
.auth-error { color: var(--danger); font-size: var(--text-xs); margin-bottom: 6px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--font);
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn-danger { background: transparent; border-color: rgba(239,68,68,.3); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.08); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { color: #f87171; }
.btn-sm { padding: 4px 9px; font-size: var(--text-xs); }
.btn-full { width: 100%; justify-content: center; padding: 10px; }
.btn-new-list { width: 100%; margin-bottom: 6px; justify-content: center; }
.btn-filter-active {
  background: var(--accent-glow); border-color: rgba(102,192,244,.3);
  color: var(--accent-bright);
}

/* ── Toolbar ───────────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.search-wrap {
  flex: 1; min-width: 140px; position: relative;
}
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.search-wrap input {
  width: 100%; padding: 8px 12px 8px 34px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--text);
  font-size: var(--text-sm); font-family: var(--font);
}
.search-wrap input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-wrap input::placeholder { color: var(--text-3); }

.view-toggle {
  display: flex; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.view-toggle button {
  padding: 7px 9px; border: none;
  background: var(--surface-1); color: var(--text-3);
  cursor: pointer; transition: all var(--dur);
  display: flex; align-items: center; justify-content: center;
}
.view-toggle button.active { background: var(--accent); color: #fff; }
.view-toggle button:not(:last-child) { border-right: 1px solid var(--border); }

/* ── Lists panel ───────────────────────────────────────────── */
.lists-panel { display: flex; gap: 20px; min-height: calc(100vh - 240px); }
.lists-sidebar {
  width: 220px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.list-item {
  padding: 9px 11px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--surface-1);
  cursor: pointer; transition: all var(--dur) var(--ease);
  display: flex; align-items: center; gap: 9px;
}
.list-item:hover { background: var(--surface-2); border-color: var(--border); }
.list-item.active { border-color: var(--accent); background: var(--accent-glow); }
.list-item-color { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.list-item-name {
  flex: 1; font-size: var(--text-sm); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-count {
  font-size: var(--text-xs); color: var(--text-3);
  font-family: var(--mono); min-width: 16px; text-align: right;
}

/* ── List header ──────────────────────────────────────────── */
.list-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.list-header-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.list-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.list-title {
  font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-count { font-size: var(--text-xs); color: var(--text-3); font-family: var(--mono); flex-shrink: 0; }
.list-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Category chips ───────────────────────────────────────── */
.category-filter-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.category-chip {
  padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-2); cursor: pointer;
  font-size: var(--text-xs); font-family: var(--font);
  transition: all var(--dur); display: inline-flex; align-items: center; gap: 4px;
}
.category-chip:hover { background: var(--surface-2); }
.category-chip.selected { border-color: var(--accent); background: var(--accent-glow); color: var(--text); }
.category-chip.disabled { opacity: 0.4; cursor: default; }
.category-chip-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.category-badge {
  display: inline-block; padding: 1px 6px;
  border-radius: 99px; font-size: 0.62rem; font-weight: 500;
}

/* ── Steam tag chips ─────────────────────────────────────── */
.steam-tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px;
  background: rgba(102,192,244,.08); border: 1px solid rgba(102,192,244,.15);
  color: var(--accent); font-size: 0.65rem; font-weight: 500;
  cursor: default;
}
.steam-tag-chip svg { flex-shrink: 0; opacity: 0.6; }

/* ── Tag filter row (combined custom + steam) ────────────── */
.tag-filter-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.tag-chip-steam {
  padding: 3px 9px; border-radius: 99px;
  border: 1px solid rgba(102,192,244,.2); background: rgba(102,192,244,.06);
  color: var(--accent); cursor: pointer;
  font-size: var(--text-xs); font-family: var(--font);
  transition: all var(--dur); display: inline-flex; align-items: center; gap: 4px;
}
.tag-chip-steam:hover { background: rgba(102,192,244,.1); }
.tag-chip-steam.selected { border-color: var(--accent); background: var(--accent-glow); color: var(--accent-bright); }
.tag-chip-steam svg { flex-shrink: 0; opacity: 0.6; }

/* ── Game grid ─────────────────────────────────────────────── */
.games-content { flex: 1; min-width: 0; }
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.games-grid.list-view { grid-template-columns: 1fr; gap: 4px; }

.game-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur);
  cursor: pointer; position: relative;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.game-card-cover {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block;
  background: var(--surface-1);
}
.game-card-cover-placeholder {
  width: 100%; aspect-ratio: 2/3;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
}
.placeholder-initial {
  font-size: 2rem; font-weight: 700; color: var(--text-3);
  font-family: var(--mono);
}
.game-card-info { padding: 9px 10px; }
.game-card-name {
  font-size: var(--text-sm); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-card-notes {
  font-size: var(--text-xs); color: var(--text-3); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.game-card-price {
  font-size: var(--text-xs); font-weight: 600; color: var(--text-2);
  margin-top: 3px; font-family: var(--mono);
}
.game-card-price.free { color: #5ee6a8; }
.game-card-price.discount { color: #5ee6a8; }
.game-card-price .price-discount {
  display: inline-block; margin-left: 4px;
  background: rgba(34,197,94,.15); color: #5ee6a8;
  font-size: 0.65rem; padding: 1px 4px; border-radius: 3px;
}
.game-card-store {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--text-xs); color: var(--text-3);
  text-decoration: none; margin-top: 3px;
  transition: color var(--dur);
}
.game-card-store:hover { color: var(--accent-bright); }
.game-card-store svg { flex-shrink: 0; }

/* ── Price summary bar ───────────────────────────────────── */
.price-summary-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  margin: 12px 0; font-size: var(--text-sm);
}
.price-summary-sale {
  color: #34d399; font-weight: 600;
  background: rgba(34,197,94,.1); padding: 2px 8px; border-radius: 4px;
}
.price-summary-free { color: var(--accent-bright); font-weight: 500; }
.price-summary-total { color: var(--text-2); font-family: var(--mono); font-size: var(--text-xs); }
.price-summary-sep {
  width: 1px; height: 14px; background: var(--border);
}
.game-card-categories { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 2px; }
.steam-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.7); border-radius: 99px;
  padding: 3px 5px; color: var(--text-3);
  backdrop-filter: blur(4px);
}

/* List view cards */
.games-grid.list-view .game-card { display: flex; flex-direction: row; }
.games-grid.list-view .game-card:hover { transform: none; }
.games-grid.list-view .game-card-cover,
.games-grid.list-view .game-card-cover-placeholder { width: 48px; height: 48px; aspect-ratio: 1; flex-shrink: 0; }
.games-grid.list-view .game-card-info {
  padding: 6px 12px; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.games-grid.list-view .game-card-name { flex: 1; }
.games-grid.list-view .game-card-notes {
  margin: 0; max-width: 180px; white-space: nowrap;
  display: block; -webkit-line-clamp: unset;
}
.games-grid.list-view .game-card-categories { margin: 0; flex-shrink: 0; }
.games-grid.list-view .steam-badge { display: none; }

/* ── Categories view ──────────────────────────────────────── */
.categories-view { max-width: 480px; }
.section-title { font-size: var(--text-xl); font-weight: 700; margin-bottom: 4px; letter-spacing: -0.3px; }
.section-desc { font-size: var(--text-sm); color: var(--text-3); margin-bottom: 18px; }
.category-add-row {
  display: flex; gap: 6px; margin-bottom: 18px; align-items: center;
}
.category-add-row input[type="text"] {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--text);
  font-size: var(--text-sm); font-family: var(--font);
}
.category-add-row input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.category-add-row input[type="text"]::placeholder { color: var(--text-3); }
.color-input {
  width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); cursor: pointer; padding: 2px;
}
.category-list { display: flex; flex-direction: column; gap: 4px; }
.category-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-1);
}
.category-row-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.category-row-name { flex: 1; font-size: var(--text-sm); }
.category-defaults { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.category-defaults-label { font-size: var(--text-xs); color: var(--text-3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.category-defaults-chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── Profile view ─────────────────────────────────────────── */
.profile-view { max-width: 480px; }
.profile-banner {
  height: 120px; border-radius: var(--radius-lg);
  position: relative; margin-bottom: 40px;
  display: flex; align-items: flex-end; justify-content: center;
}
.profile-avatar-wrap {
  position: absolute; bottom: -28px;
  background: var(--bg); border-radius: 50%;
  padding: 5px; border: 3px solid var(--bg);
}
.profile-info { text-align: center; margin-bottom: 16px; }
.profile-name { font-size: var(--text-xl); font-weight: 700; margin-bottom: 4px; }
.profile-bio { font-size: var(--text-sm); color: var(--text-2); max-width: 300px; margin: 0 auto; }
.profile-bio-empty { color: var(--text-3); font-style: italic; }
.profile-stats { display: flex; justify-content: center; gap: 16px; margin-top: 12px; }
.profile-stat { font-size: var(--text-xs); color: var(--text-3); }
.profile-stat strong { color: var(--text); font-weight: 600; margin-right: 2px; }

/* ── Auth-only nav items ──────────────────────────────────── */
body:not(.logged-in) .auth-only { display: none; }

/* ── Carousel ────────────────────────────────────────────── */
.carousel-section { margin-bottom: 28px; }
.carousel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.carousel-title {
  font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.3px;
}
.carousel-nav { display: flex; gap: 6px; }
.carousel-arrow {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: all var(--dur) var(--ease);
}
.carousel-arrow:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.carousel-track-wrap { overflow: hidden; margin: 0 -4px; padding: 0 4px; }
.carousel-track {
  display: flex; gap: 14px; overflow-x: auto;
  scroll-behavior: smooth; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 4px;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-card {
  flex: 0 0 280px; scroll-snap-align: start;
  border-radius: var(--radius-lg); overflow: hidden;
  position: relative; height: 180px;
  cursor: pointer; border: 1px solid var(--border);
  transition: all 250ms var(--ease);
}
.carousel-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(102,192,244,.15);
}
.carousel-card-covers {
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: 100%; width: 100%;
}
.carousel-card-covers img {
  width: 100%; height: 100%; object-fit: cover;
}
.carousel-card-covers img:only-child { grid-column: 1 / -1; }
.carousel-card-covers img:nth-child(2):last-child,
.carousel-card-covers img:first-child:nth-last-child(2) { grid-column: span 2; }
.carousel-card-covers img:nth-child(3):last-child { grid-column: span 2; }
.carousel-card-covers img:first-child:nth-last-child(3),
.carousel-card-covers img:first-child:nth-last-child(3) ~ img:nth-child(2) { grid-column: span 1; }

.carousel-card-empty {
  grid-column: 1 / -1;
  background: var(--surface-1);
  display: flex; align-items: center; justify-content: center;
}
.carousel-card-empty span {
  font-size: 2.5rem; font-weight: 700; color: var(--text-3); opacity: 0.5;
}

.carousel-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.4) 70%, transparent 100%);
  padding: 14px 16px 12px;
}
.carousel-card-owner {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); color: rgba(255,255,255,.7); margin-bottom: 2px;
}
.carousel-card-owner svg { flex-shrink: 0; }
.carousel-card-name { font-size: var(--text-base); font-weight: 600; color: #fff; }
.carousel-card-meta { font-size: var(--text-xs); color: rgba(255,255,255,.5); margin-top: 2px; font-family: var(--mono); }

/* ── Hero section (logged-out landing) ────────────────────── */
.hero-section {
  text-align: center;
  padding: 44px 20px 36px;
  margin-bottom: 8px;
  position: relative;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse at center, rgba(102,192,244,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  background: var(--accent-glow); border: 1px solid rgba(102,192,244,.2);
  color: var(--accent); font-size: var(--text-xs); font-weight: 600;
  margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px;
}
.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  line-height: 1.15;
}
.hero-title span {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 60%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: var(--text-base);
  color: var(--text-2);
  max-width: 440px;
  margin: 0 auto 22px;
  line-height: 1.55;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #0e141b; font-weight: 700;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  font-family: var(--font); font-size: var(--text-sm);
  transition: all var(--dur) var(--ease);
}
.hero-cta:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(102,192,244,.25);
}
.hero-cta-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-2); font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font); font-size: var(--text-sm);
  transition: all var(--dur) var(--ease);
  margin-left: 8px;
}
.hero-cta-secondary:hover {
  background: var(--surface-2); color: var(--text);
  border-color: var(--border-strong);
}
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

/* ── Section header ───────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-header-title {
  font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 8px;
}
.section-header-title::before {
  content: '';
  display: block; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--accent), var(--accent-bright));
  border-radius: 2px;
}
.section-header-link {
  font-size: var(--text-xs); color: var(--text-3);
  text-decoration: none; transition: color var(--dur);
}
.section-header-link:hover { color: var(--accent-bright); }

/* ── Discover grid ────────────────────────────────────────── */
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.discover-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 200px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 250ms var(--ease);
  background: var(--bg-raised);
}
.discover-card:hover {
  border-color: rgba(102,192,244,.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(102,192,244,.06);
}
.discover-card-covers {
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: 100%; width: 100%;
}
.discover-card-covers img {
  width: 100%; height: 100%; object-fit: cover;
}
.discover-card-covers img:only-child { grid-column: 1 / -1; }
.discover-card-covers img:nth-child(2):last-child,
.discover-card-covers img:first-child:nth-last-child(2) { grid-column: span 2; }
.discover-card-covers img:nth-child(3):last-child { grid-column: span 2; }
.discover-card-covers img:first-child:nth-last-child(3),
.discover-card-covers img:first-child:nth-last-child(3) ~ img:nth-child(2) { grid-column: span 1; }
.discover-card-empty {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
  display: flex; align-items: center; justify-content: center;
}
.discover-card-empty span {
  font-size: 2.5rem; font-weight: 700; color: var(--text-3); opacity: 0.5;
}
.discover-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.5) 60%, transparent 100%);
  padding: 16px 16px 14px;
}
.discover-card-owner {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); color: rgba(255,255,255,.65); margin-bottom: 3px;
}
.discover-card-owner svg { flex-shrink: 0; }
.discover-card-name { font-size: var(--text-base); font-weight: 600; color: #fff; }
.discover-card-meta {
  font-size: var(--text-xs); color: rgba(255,255,255,.45); margin-top: 3px; font-family: var(--mono);
}
.discover-card-likes {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 99px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  font-size: var(--text-xs); color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.1);
}

/* ── Discover view ────────────────────────────────────────── */
.discover-view { }

/* ── Toggle row ──────────────────────────────────────────── */
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--text-sm); color: var(--text-2);
  cursor: pointer; margin: 12px 0;
}
.toggle-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--accent);
  cursor: pointer;
}

/* ── Shared view ──────────────────────────────────────────── */
.shared-back {
  color: var(--text-3); text-decoration: none; font-size: var(--text-sm);
  margin-bottom: 14px; display: inline-flex; align-items: center; gap: 4px;
  transition: color var(--dur);
}
.shared-back:hover { color: var(--text); }
.shared-banner {
  border-radius: var(--radius-lg); padding: 20px 24px;
  margin-bottom: 20px; display: flex; align-items: center;
  justify-content: space-between;
}
.shared-banner-content { display: flex; align-items: center; gap: 12px; }
.shared-banner-avatar { flex-shrink: 0; }
.shared-banner-user { font-size: var(--text-xs); color: var(--text-3); }
.shared-banner-list { font-size: var(--text-lg); font-weight: 700; }
.shared-likes {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface-1);
  cursor: pointer; font-size: var(--text-sm); color: var(--text-2);
  transition: all var(--dur);
}
.shared-likes:hover { background: var(--surface-2); }
.shared-likes.liked { border-color: rgba(236,72,153,.4); background: rgba(236,72,153,.08); color: #ec4899; }
.shared-banner-actions { display: flex; align-items: center; gap: 8px; }
.shared-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-3); }

/* ── Sale badge ──────────────────────────────────────────── */
.sale-badge {
  position: absolute; top: 6px; left: 6px;
  background: #22c55e; color: #fff;
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
  z-index: 2; letter-spacing: -0.3px;
}

/* ── Vote indicator on cards ─────────────────────────────── */
.game-card-votes {
  font-size: var(--text-xs); font-weight: 600;
  font-family: var(--mono); margin-top: 2px;
}
.game-card-votes.positive { color: #34d399; }
.game-card-votes.negative { color: #f87171; }

/* ── Detail modal ────────────────────────────────────────── */
.modal-detail { max-width: 380px; text-align: center; }
.detail-cover {
  width: 100%; max-height: 280px; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: 14px;
}
.detail-name { font-size: var(--text-lg); margin-bottom: 8px; }
.detail-price {
  font-size: var(--text-sm); font-weight: 600; color: var(--text-2);
  font-family: var(--mono); margin-bottom: 6px;
}
.detail-price.free { color: #5ee6a8; }
.detail-price.discount { color: #5ee6a8; }
.detail-discount {
  display: inline-block; margin-left: 6px;
  background: rgba(34,197,94,.15); color: #34d399;
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
}
.detail-notes {
  font-size: var(--text-sm); color: var(--text-2);
  margin-bottom: 10px; line-height: 1.5;
}
.detail-section-label {
  display: block; font-size: var(--text-xs); color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  margin-bottom: 6px;
}
.detail-tags-wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.detail-steam-tags { margin-bottom: 12px; }
.detail-tags-loading { color: var(--text-3); font-size: var(--text-xs); }
.detail-categories { margin-bottom: 12px; }
.detail-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.detail-store-btn { text-decoration: none; }

/* ── Sort bar ────────────────────────────────────────────── */
.sort-bar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.sort-bar-label {
  font-size: var(--text-xs); color: var(--text-3);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.sort-chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-2);
  font-size: var(--text-xs);
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.sort-chip:hover { border-color: var(--accent); color: var(--text); }
.sort-chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* ── Vote controls ───────────────────────────────────────── */
.vote-controls {
  display: flex; align-items: center; gap: 6px;
}
.vote-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-3);
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.vote-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.vote-btn.active.vote-up { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.4); color: #34d399; }
.vote-btn.active.vote-down { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.4); color: #f87171; }
.vote-score {
  font-size: var(--text-sm); font-weight: 700; font-family: var(--mono);
  min-width: 20px; text-align: center; color: var(--text-2);
}
.vote-score.positive { color: #34d399; }
.vote-score.negative { color: #f87171; }
.vote-score-readonly {
  font-size: var(--text-xs); font-weight: 600; font-family: var(--mono);
  color: var(--text-3);
}

/* ── Voter management ────────────────────────────────────── */
.modal-desc { font-size: var(--text-sm); color: var(--text-3); margin: -8px 0 14px; }
.voter-add-row { display: flex; gap: 6px; }
.voter-add-row input { flex: 1; }
.voter-list { display: flex; flex-direction: column; gap: 4px; }
.voter-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-1);
}
.voter-name { font-size: var(--text-sm); font-weight: 500; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.12s ease-out;
}
.modal {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 22px;
  width: 90%; max-width: 440px; max-height: 85vh; overflow-y: auto;
  animation: modalIn 0.2s ease-out;
}
.modal-add-game { max-width: 480px; }
.modal-profile { max-width: 460px; }
.modal h2 { font-size: var(--text-lg); margin-bottom: 16px; font-weight: 700; letter-spacing: -0.3px; }
.modal-close {
  float: right; background: none; border: none;
  color: var(--text-3); cursor: pointer; font-size: 1.3em;
  padding: 2px 6px; border-radius: var(--radius-sm);
  transition: all var(--dur);
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.modal-game-preview {
  width: 100%; max-height: 120px; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: 14px; opacity: 0.85;
}

.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: var(--text-xs); color: var(--text-2);
  margin-bottom: 4px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--text);
  font-size: var(--text-sm); font-family: var(--font);
}
.form-group textarea { resize: vertical; min-height: 56px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-3); }

.color-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.color-picker-item {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform var(--dur), border-color var(--dur);
}
.color-picker-item:hover { transform: scale(1.15); }
.color-picker-item.selected { border-color: #fff; transform: scale(1.1); }

.category-selector { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }

/* ── Steam search ─────────────────────────────────────────── */
.steam-search-wrap { position: relative; }
.steam-search-wrap input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--text);
  font-size: var(--text-sm); font-family: var(--font);
}
.steam-search-wrap input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.steam-search-wrap input::placeholder { color: var(--text-3); }
.steam-search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); margin-top: 4px;
  max-height: 240px; overflow-y: auto; z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.steam-result-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; cursor: pointer;
  transition: background var(--dur);
  font-size: var(--text-sm);
}
.steam-result-item:hover { background: var(--surface-2); }
.steam-result-thumb { width: 40px; height: 18px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }

.steam-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; margin-top: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1);
}
.steam-preview img { width: 80px; height: 38px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.steam-preview-info { flex: 1; min-width: 0; }
.steam-preview-info div:first-child { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steam-preview-info div:last-child { font-size: var(--text-xs); color: var(--text-3); }

/* ── Avatar & Banner pickers ──────────────────────────────── */
.avatar-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar-option {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur); background: var(--surface-1);
}
.avatar-option:hover { border-color: var(--border-strong); }
.avatar-option.selected { border-color: var(--accent); background: var(--accent-glow); }
.banner-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.banner-option {
  width: 52px; height: 28px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  transition: all var(--dur);
}
.banner-option:hover { border-color: var(--border-strong); }
.banner-option.selected { border-color: var(--accent); }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-state-icon { margin-bottom: 12px; display: flex; justify-content: center; }
.empty-state-title { font-size: var(--text-base); font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state-text { font-size: var(--text-sm); margin-bottom: 16px; color: var(--text-3); max-width: 300px; margin-left: auto; margin-right: auto; }

/* ── Landing stats row ────────────────────────────────────── */
.landing-stats {
  display: flex; justify-content: center; gap: 32px;
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.landing-stat { text-align: center; }
.landing-stat-value {
  font-size: 1.4rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-stat-label { font-size: var(--text-xs); color: var(--text-3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── How it works ─────────────────────────────────────────── */
.hiw-section { margin: 36px 0 24px; }
.hiw-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.hiw-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
  text-align: center;
  transition: all var(--dur) var(--ease);
}
.hiw-card:hover {
  background: var(--surface-2);
  border-color: rgba(102,192,244,.15);
  transform: translateY(-2px);
}
.hiw-icon {
  width: 40px; height: 40px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--accent-glow);
  color: var(--accent);
}
.hiw-title { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin-bottom: 4px; }
.hiw-desc { font-size: var(--text-xs); color: var(--text-3); line-height: 1.5; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 9px 16px;
  font-size: var(--text-sm); color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  pointer-events: none;
  transform: translateY(6px); opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.toast.visible { opacity: 1; transform: translateY(0); }

/* ── Footer ────────────────────────────────────────────────── */
.info-footer {
  text-align: center; padding: 18px 24px 24px;
  color: var(--text-3); font-size: var(--text-xs);
  border-top: 1px solid var(--border); margin-top: 40px;
}
.footer-link { color: var(--text-3); text-decoration: none; transition: color var(--dur); }
.footer-link:hover { color: var(--text-2); text-decoration: underline; }

/* ── Focus ─────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 1000;
  padding: 6px 14px; background: var(--accent); color: #fff;
  font-weight: 600; font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none; transition: top var(--dur);
}
.skip-link:focus { top: 0; }

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

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-bar { padding: 0 14px; }
  .container { padding: 18px 14px; }
  .lists-panel { flex-direction: column; gap: 14px; }
  .lists-sidebar {
    width: 100%; flex-direction: row;
    overflow-x: auto; gap: 4px; padding-bottom: 6px;
  }
  .list-item { white-space: nowrap; flex-shrink: 0; }
  .btn-new-list { width: auto; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); }
  .nav-link { padding: 5px 8px; font-size: var(--text-xs); }
  .discover-grid { grid-template-columns: 1fr; }
  .hiw-grid { grid-template-columns: 1fr; }
  .hero-section { padding: 28px 16px 24px; }
  .landing-stats { gap: 20px; }
  .hero-cta-secondary { margin-left: 0; }
}
@media (max-width: 480px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .list-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .list-actions { width: 100%; }
  .hero-actions { flex-direction: column; align-items: center; }
}
