:root{
  --bg: #0b0d10;
  --panel: #12161b;
  --card: #151b21;
  --muted: #a9b4c2;
  --text: #e9eef3;
  --brand: #29b6f6;
  --accent: #64ffda;
  --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --dev-banner-height: 44px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 20% -10%, #10151b 20%, #0b0d10 60%) fixed,
    var(--bg);
  color: var(--text);
  padding-top: var(--dev-banner-height);
}
body.devlog-open{
  overflow:hidden;
}

.dev-banner{
  position:fixed;
  top:0; left:0; right:0;
  height: var(--dev-banner-height);
  background:#b71c1c;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:14px;
  z-index:12;
  text-align:center;
  padding:0 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  gap:12px;
}
.dev-banner-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px;
  border-radius:14px;
  background:linear-gradient(120deg, rgba(255,255,255,.18), rgba(255,255,255,.1));
  color:#fff;
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  border:1px solid rgba(255,255,255,.25);
  box-shadow:0 6px 14px rgba(0,0,0,.25);
}
.dev-banner-link:hover,
.dev-banner-link:focus{
  background:rgba(255,255,255,.22);
  transform:translateY(-1px);
}

.topbar{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:16px; row-gap:12px; padding:18px 20px;
  flex-wrap:wrap;
  position:sticky; top:var(--dev-banner-height); z-index:10;
  background: linear-gradient(180deg, rgba(11,13,16,.95), rgba(11,13,16,.85));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #1a222b;
}
.topbar-left{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:220px;
}
.topbar-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex:1 1 320px;
  flex-wrap:wrap;
}
.topbar h1{ margin:0; font-size:20px; letter-spacing:.3px; }
.topbar .tagline{
  margin:0;
  color:var(--muted);
  font-size:13px;
  max-width:260px;
}
.lang-toggle{
  display:inline-flex;
  background: var(--panel);
  border:1px solid #1f2731;
  border-radius:999px;
  padding:4px;
  gap:4px;
  box-shadow: var(--shadow);
}
.lang-button{
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  padding:6px 12px;
  border-radius:999px;
  cursor:pointer;
  transition:background-color .2s ease,color .2s ease;
}
.lang-button:hover,
.lang-button:focus{
  color:var(--text);
}
.lang-button:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.lang-button.is-active{
  background:var(--brand);
  color:#041b26;
}

.search-wrap{
  display:flex; gap:8px; align-items:center;
  background: var(--panel);
  padding:6px 8px; border-radius: 999px; box-shadow: var(--shadow);
  border:1px solid #1f2731;
  flex:1 1 320px;
}
.search-wrap input{
  flex:1 1 auto;
  min-width:150px;
  width:100%;
  background: transparent; border:0; outline:0; color:var(--text);
  font-size:14px; padding:8px 10px;
}
.search-wrap button{
  border:0; background:#1e2630; color:var(--muted);
  width:28px; height:28px; border-radius:50%; cursor:pointer;
}

.filters{
  display:grid; gap:12px; grid-template-columns: repeat(6, minmax(0,1fr));
  padding:12px 20px; align-items:end;
}
.filters .filter{ display:flex; flex-direction:column; gap:6px; }
.filters .stat-filter{
  grid-column: 1 / -1;
  background: var(--panel);
  border:1px solid #1f2731;
  border-radius:10px;
  padding:10px 12px;
  gap:10px;
}
.filters label{ font-size:12px; color:var(--muted); }
.filters select{
  appearance:none; padding:10px 12px; border-radius:10px;
  background: var(--panel); border:1px solid #1f2731; color:var(--text);
}
.cap-custom{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:6px;
  margin-top:6px;
}
.cap-custom input{
  padding:9px 10px;
  border-radius:10px;
  border:1px solid #1f2731;
  background: var(--panel);
  color:var(--text);
}
.cap-custom button{
  border:1px solid #2a3644;
  background:#17202a;
  color:var(--text);
  border-radius:10px;
  padding:8px 12px;
  cursor:pointer;
}
.filters .reset{
  grid-column: -2 / -1;
  padding:10px 12px; border-radius:10px; border:1px solid #2a3644;
  background:#17202a; color:var(--text); cursor:pointer;
}
.devlog-button{
  border:1px solid #2a3644;
  background:#141c25;
  color:var(--text);
  border-radius:10px;
  padding:8px 12px;
  cursor:pointer;
}
.stat-filter-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.stat-filter-controls{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:8px;
}
.stat-filter-controls select,
.stat-filter-controls input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  background: var(--card);
  border:1px solid #1f2731;
  color:var(--text);
}
.stat-filter-controls input:disabled{
  opacity:.7;
}
.stat-add,
.stat-clear{
  border:1px solid #2a3644;
  background:#17202a;
  color:var(--text);
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  white-space:nowrap;
}
.stat-clear{
  background:#1b232c;
}
.stat-filters-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height:32px;
}
.stat-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#101821;
  border:1px solid #1f2735;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
}
.stat-chip-empty{
  border-style:dashed;
  color:var(--muted);
}
.stat-chip-remove{
  background:transparent;
  border:0;
  color:var(--muted);
  cursor:pointer;
  font-size:14px;
  line-height:1;
}
.stat-chip-remove:hover,
.stat-chip-remove:focus{
  color:var(--text);
}
.games{
  grid-column: 1 / span 3;
  display:flex; flex-wrap:wrap; gap:6px 12px;
  background: var(--panel); border:1px solid #1f2731; border-radius:10px;
  padding:10px 12px;
}
.games legend{ color:var(--muted); font-size:12px; padding:0 4px; }
.games label{ font-size:13px; color:var(--text); }

.meta{
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 20px; color:var(--muted); font-size:13px;
}

.grid{
  display:grid; gap:14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  padding: 12px 20px 40px;
}

.card{
  background: var(--card);
  border:1px solid #1c2530; border-radius: var(--radius);
  overflow:hidden; box-shadow: var(--shadow);
  display:flex; flex-direction:column;
}
.card .thumb{
  position:relative; aspect-ratio: 4 / 3; background:#0e1318;
  display:grid; place-items:center;
}
.card .thumb img{
  max-width: 90%; max-height: 90%; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,.6));
}
.badges{
  position:absolute; top:8px; left:8px; display:flex; gap:6px;
}
.badge{
  background: rgba(0,0,0,.45); padding:6px 8px; border-radius: 999px;
  font-size:11px; backdrop-filter: blur(4px); border:1px solid #2b3642;
}
.info-dot{
  position:absolute; top:8px; right:8px;
  width:26px; height:26px; border-radius:50%;
  background: #1c2631; border:1px solid #2b3642; color:var(--text);
  display:grid; place-items:center; font-weight:800; cursor:pointer;
}
.info-dot:hover .tip,
.info-dot:focus .tip{
  opacity:1; transform: translateY(-6px);
}
.tip{
  position:absolute; top:-6px; right:30px; opacity:0;
  transform: translateY(4px);
  transition:.18s ease;
  background:#0f151b; color:var(--text);
  font-size:11px; padding:6px 8px; border-radius:8px; white-space:nowrap;
  border:1px solid #263140;
  box-shadow: var(--shadow);
}
.tip::after{
  content:""; position:absolute; top:50%; right:-6px; translate:0 -50%;
  width:0; height:0; border-left:6px solid #263140; border-top:6px solid transparent; border-bottom:6px solid transparent;
}

.card .body{ padding:12px; display:flex; flex-direction:column; gap:6px; }
.card h3{ margin:0; font-size:16px; }
.card .sub{ font-size:12px; color:var(--muted); }
.kv{ display:flex; flex-wrap:wrap; gap:6px 10px; font-size:12px; color:#cbd6e2; }
.kv b{ color:#9fd3ff; }
.tags{ display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.tag{ font-size:11px; padding:4px 8px; border-radius:999px; border:1px solid #273243; background:#101821; }

.loadmore-wrap{ display:grid; place-items:center; padding: 0 0 40px; }
.loadmore{
  padding:10px 16px; border-radius:10px; border:1px solid #2b3746;
  background:#141d26; color:var(--text); cursor:pointer;
}

.modal{
  border:0; border-radius: 16px; padding:0; width:min(860px, 96vw);
  background: var(--panel); color:var(--text);
  box-shadow: 0 40px 80px rgba(0,0,0,.5);
}
.modal::backdrop{ background: rgba(0,0,0,.65); }
.modal-close{
  position:absolute; right:12px; top:10px;
  background:#1b232c; border:1px solid #2d3847;
  color:#d3dbe5; border-radius:999px; width:34px; height:34px; cursor:pointer;
}
.modal-body{ padding:18px 18px 22px; }
.modal-head{
  display:flex; gap:16px; align-items:center; margin-bottom:10px;
}
.modal-head img{
  width:96px; height:96px; object-fit:contain; background:#0e141a; border-radius:12px;
  border:1px solid #1c2530; padding:6px;
}
.modal-head .title{ display:flex; flex-direction:column; gap:6px; }
.modal-head .title h2{ margin:0; font-size:22px; }
.modal-head .title .small{ color:var(--muted); font-size:13px; }
.modal-grid{
  display:grid;
  gap:12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items:stretch;
}
.modal-block{
  background:#0f151b; border:1px solid #223042; border-radius:12px; padding:12px;
}
.modal-block h4{ margin:0 0 8px 0; font-size:14px; color:#9fd3ff; }
.modal-block.wide{ grid-column: 1 / -1; }

.modal-actions{
  margin:0 0 12px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}
.modal-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid #2d3847;
  background:#1b232c;
  color:var(--text);
  text-decoration:none;
  font-size:13px;
  transition:background .15s ease, border-color .15s ease;
}
.modal-link:hover,
.modal-link:focus{
  background:#223042;
  border-color:#36516b;
}

.devlog-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.65);
  display:flex;
  justify-content:flex-end;
  z-index:30;
}
.devlog-overlay[hidden]{
  display:none !important;
}
.devlog-panel{
  width:min(380px, 100vw);
  background:#0f151b;
  border-left:1px solid #223042;
  box-shadow:-10px 0 30px rgba(0,0,0,.35);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.devlog-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.devlog-close{
  background:#1b232c;
  color:var(--text);
  border:1px solid #2d3847;
  border-radius:10px;
  width:32px; height:32px;
  cursor:pointer;
}
.devlog-list{
  display:flex;
  flex-direction:column;
  gap:12px;
  max-height:70vh;
  overflow:auto;
  padding-right:4px;
}
.devlog-footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-top:4px;
}
.devlog-footer-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#101821;
  border:1px solid #1f2735;
  border-radius:999px;
  padding:6px 8px 6px 10px;
}
.devlog-label{
  color:var(--muted);
  font-size:12px;
}
.devlog-x{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px; height:32px;
  border-radius:50%;
  background:#111821;
  border:1px solid #1f2735;
  color:#fff;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 4px 12px rgba(0,0,0,.3);
}
.devlog-x:hover,
.devlog-x:focus{
  background:#152033;
  border-color:#294066;
}
.devlog-entry{
  background:#101821;
  border:1px solid #1f2735;
  border-radius:12px;
  padding:12px;
}
.devlog-entry-head{
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px;
}
.devlog-version{
  font-weight:700;
  color:var(--accent);
}
.devlog-entry h4{
  margin:6px 0;
  font-size:15px;
}
.devlog-entry ul{
  margin:0;
  padding-left:18px;
  color:var(--text);
  line-height:1.4;
  font-size:13px;
}
.devlog-empty{
  margin:0;
  color:var(--muted);
  font-size:13px;
}

.modal-lang-toggle{
  display:inline-flex;
  gap:4px;
  padding:4px;
  border-radius:999px;
  background:#101821;
  border:1px solid #1c2735;
}
.modal-lang-button{
  padding:6px 12px;
  border-radius:999px;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.3px;
  cursor:pointer;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.modal-lang-button.is-active{
  background:var(--brand);
  color:#062332;
  border-color:var(--brand);
}
.modal-lang-button:hover,
.modal-lang-button:focus{
  border-color:var(--brand);
}

.stats-block .stats-grid{
  display:grid;
  gap:8px;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}
.stat-item{
  background:#101821;
  border:1px solid #1c2735;
  border-radius:10px;
  padding:8px;
  text-align:center;
}
.stat-label{
  display:block;
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.35px;
}
.stat-value{
  display:block;
  margin-top:4px;
  font-size:16px;
  font-weight:600;
  color:var(--accent);
}
.stat-item.stat-unknown .stat-value{
  color:var(--muted);
}
.stats-note{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
}

.modal-text{
  margin:0;
  line-height:1.6;
  font-size:13px;
}

.modal-viewer{
  background:#0f151b;
  border:1px solid #223042;
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.viewer-title{
  margin:0;
  font-size:14px;
  color:#9fd3ff;
}
.viewer3d{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.viewer3d-canvas{
  background:#0a1016;
  border:1px solid #1c2735;
  border-radius:12px;
  min-height:260px;
  display:grid;
  place-items:center;
  overflow:hidden;
  touch-action:none;
  user-select:none;
}
.viewer3d-canvas img{
  width:100%;
  max-width:320px;
  height:auto;
  object-fit:contain;
  filter:drop-shadow(0 14px 32px rgba(0,0,0,.55));
  pointer-events:none;
}
.viewer3d-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
}
.viewer3d-button{
  background:#1b232c;
  border:1px solid #2b3746;
  color:var(--text);
  border-radius:8px;
  width:38px;
  height:34px;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition:transform .12s ease;
}
.viewer3d-button:active{
  transform:translateY(1px);
}
.viewer3d-hint{
  text-align:center;
  font-size:12px;
  color:var(--muted);
}
.user-auth{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.user-badge{
  background:#0f1821;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #1f2731;
  color:var(--muted);
  font-size:12px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
}
.user-badge img{
  width:28px;
  height:28px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid #243241;
}
.auth-button{
  border:1px solid #2a3644;
  background:#101820;
  color:var(--text);
  border-radius:10px;
  padding:7px 11px;
  cursor:pointer;
  font-size:13px;
}
.auth-link{
  color:var(--accent);
  text-decoration:none;
  font-weight:700;
  font-size:13px;
}
.auth-button.ghost{
  background:transparent;
}
.view-mode{
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:12px;
}
.view-mode select{
  background:var(--panel);
  color:var(--text);
  border:1px solid #1f2731;
  border-radius:10px;
  padding:6px 10px;
}
.share-row{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.share-input{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:8px;
}
.share-input input{
  width:100%;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #1f2731;
  background:var(--panel);
  color:var(--text);
}
.split-layout{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
  padding:0 20px 24px;
}
.split-layout.is-dual{
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}
.split-layout.mode-db{
  grid-template-columns: 1fr;
}
.split-layout.mode-collection{
  grid-template-columns: 1fr;
}
.split-layout.mode-db .pane-collection{
  display:none;
}
.split-layout.mode-collection .pane-db{
  display:none;
}
.split-layout.mode-db .pane-db{ order:1; }
.split-layout.mode-db .pane-collection{ order:2; }
.split-layout.mode-collection .pane-db{ order:2; }
.split-layout.mode-collection .pane-collection{ order:1; }
.pane{
  background: linear-gradient(180deg, rgba(20,26,33,.9), rgba(13,16,20,.92));
  border:1px solid #1a222c;
  border-radius:16px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.pane-db{
  position:relative;
  max-height: calc(100vh - 140px);
  overflow-y:auto;
  display:flex;
  flex-direction:column;
}
.pane-collection,
.pane-settings{
  max-height: calc(100vh - 140px);
  display:flex;
  flex-direction:column;
}
.pane-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid #1f2732;
  position:sticky;
  top:0;
  z-index:2;
  background:inherit;
}
.pane-head h2{ margin:0; }
.pane-subtitle{
  color:var(--muted);
  font-size:12px;
}
.collection-filters{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  font-size:12px;
}
.collection-header-left{
  display:flex;
  align-items:center;
  gap:10px;
}
.collection-search{
  flex:1 1 180px;
  min-width:160px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #1f2731;
  background:var(--panel);
  color:var(--text);
}
.collection-progress{
  padding:8px 12px 0;
  color:var(--muted);
  font-size:12px;
}
.collection-progress .bar{
  position:relative;
  width:100%;
  height:10px;
  border-radius:999px;
  background:#1c2531;
  overflow:hidden;
  margin-top:6px;
}
.collection-progress .fill{
  position:absolute;
  top:0; left:0;
  height:100%;
  background:linear-gradient(90deg, #64ffda, #29b6f6);
  border-radius:999px;
  width:0%;
  transition:width .25s ease;
}
.collection-filters select{
  background:var(--panel);
  border:1px solid #1f2731;
  color:var(--text);
  border-radius:10px;
  padding:8px 10px;
}
.collection-filters label.inline{
  display:flex;
  align-items:center;
  gap:6px;
}
.collection-scroll{
  overflow-y:auto;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1;
}
.collection-list{
  display:grid;
  gap:12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.collection-card{
  background:#0f151c;
  border:1px solid #1e2833;
  border-radius:12px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-start;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.collection-card .thumb{
  position:relative;
  width:100%;
  aspect-ratio: 3 / 2;
  border-radius:12px;
  overflow:hidden;
  background:#0b0f14;
  border:1px solid #1f2c3b;
}
.collection-card .thumb img,
.collection-card .thumb.placeholder{
  width:100%;
  height:100%;
  object-fit:cover;
}
.collection-card .placeholder{
  border-radius:12px;
  border:1px dashed #2a3644;
}
.collection-card .meta{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.collection-card .name{
  margin:0;
  font-size:15px;
}
.collection-card .rarity-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid transparent;
}
.collection-card .tags.compact{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.collection-card .info-dot{
  position:absolute;
  top:8px;
  right:8px;
}
.collection-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin-top:6px;
}
.pane-collection.is-public-view .collection-actions{
  display:none;
}
.pane-collection.is-public-view .ownership-filters{
  display:none;
}
.collection-rarity-select{
  background:var(--panel);
  color:var(--text);
  border:1px solid #1f2731;
  border-radius:8px;
  padding:6px 8px;
}
.collection-save,
.collection-delete{
  padding:6px 10px;
  border-radius:8px;
  border:1px solid #2a3644;
  background:#13202b;
  color:var(--text);
  cursor:pointer;
}
.collection-delete{
  background:#251116;
  border-color:#3a1a22;
  color:#ffb3c0;
}
.pane-collection.is-private .collection-filters,
.pane-collection.is-private .collection-progress,
.pane-collection.is-private .collection-scroll{
  display:none;
}
.collection-empty,
.collection-status{
  background:#0f151c;
  border:1px dashed #2a3644;
  color:var(--muted);
  padding:12px;
  border-radius:12px;
}
.ownership-filters{
  display:flex;
  gap:12px;
  padding:0 20px 12px;
  color:var(--muted);
}
.pane-settings{
  padding:16px;
}
.settings-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
}
.settings-status{
  color:var(--muted);
  font-size:12px;
}
.settings-modal{
  background:#0f151b;
  border:1px solid #1f2735;
  border-radius:16px;
  padding:0;
  width: min(480px, 90vw);
  color:var(--text);
}
.settings-modal::backdrop{
  background:rgba(0,0,0,.55);
}
.settings-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid #1f2735;
}
.settings-modal-body{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.profile-row{
  display:flex;
  align-items:center;
  gap:12px;
}
.profile-avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  border:1px solid #243241;
  object-fit:cover;
}
.profile-username{
  font-weight:700;
}
.profile-note{
  font-size:12px;
  color:var(--muted);
}
.card .card-actions{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.card .add-button{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #2a3644;
  background:#11202f;
  color:var(--text);
  cursor:pointer;
  font-size:12px;
}
.rarity-normal{ background:#0f2a16; color:#b9f6ca; border-color:#1c5230; }
.rarity-growing{ background:#0f2030; color:#64b5f6; border-color:#1e3a57; }
.rarity-advanced{ background:#1b1230; color:#cba4ff; border-color:#3d2c5a; }
.rarity-top{ background:#2b240f; color:#ffeb3b; border-color:#695b19; }
.rarity-legendary{
  background:linear-gradient(120deg, #3b1d0f, #2a180c);
  color:#ffb980;
  border-color:#7a3d12;
}
.rarity-picker{
  margin-top:8px;
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.rarity-picker select{
  background:#101820;
  color:var(--text);
  border:1px solid #2a3644;
  border-radius:8px;
  padding:6px 8px;
}
.rarity-picker button{
  padding:6px 10px;
  border-radius:8px;
  border:1px solid #2a3644;
  background:#13202b;
  color:var(--text);
  cursor:pointer;
}

/* Responsive */
@media (max-width: 1024px){
  .filters{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .games{ grid-column: 1 / -1; }
  .split-layout.is-dual{ grid-template-columns: 1fr; }
}
@media (max-width: 640px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-filter-controls{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cap{ grid-column: 1 / -1; }
  .modal-grid{ grid-template-columns: 1fr; }
.viewer3d-canvas{ min-height:200px; }
}
