@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Rajdhani:wght@600;700&display=swap');

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

:root {
  --bg:       #0b0602;
  --panel:    #160904;
  --border:   rgba(134,114,94,0.22);
  --border2:  rgba(134,114,94,0.45);
  --heading:  #f0d888;
  --green:    #6abf40;
  --red:      #c84020;
  --muted:    #7a8599;
  --text:     #c8b49c;
  --btn:      #1e0e06;
  --sec:      #1e0d05;
  --detail-w: 300px;
  --radius:   10px;
  --radius-sm:6px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: #0d0805;
  background-image:
    radial-gradient(ellipse 80% 55% at 8% 0%,    rgba(240,216,136,0.13) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 92% 100%,  rgba(106,191,64,0.09)  0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%,   rgba(180,120,40,0.04)  0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Crect width='64' height='64' fill='%230e0906'/%3E%3Crect x='1' y='1' width='28' height='18' fill='%23150d07' stroke='%23241508' stroke-width='1'/%3E%3Crect x='31' y='1' width='32' height='18' fill='%23120b06' stroke='%23241508' stroke-width='1'/%3E%3Crect x='1' y='21' width='13' height='19' fill='%23160e07' stroke='%23241508' stroke-width='1'/%3E%3Crect x='16' y='21' width='30' height='19' fill='%23110a05' stroke='%23241508' stroke-width='1'/%3E%3Crect x='48' y='21' width='15' height='19' fill='%23150d07' stroke='%23241508' stroke-width='1'/%3E%3Crect x='1' y='42' width='28' height='20' fill='%23130c06' stroke='%23241508' stroke-width='1'/%3E%3Crect x='31' y='42' width='32' height='20' fill='%23120b05' stroke='%23241508' stroke-width='1'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 0;   /* top + side space (ads live in body bg) */
}

/* ── Page layout ────────────────────────────────── */
.page-layout {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

/* Ad rails — reserve space, user fills with Google Ad units */
.ad-rail {
  width: 160px;
  flex-shrink: 0;
}

/* ── App container ──────────────────────────────── */
#app {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: rgba(14,7,2,0.85);
  backdrop-filter: blur(8px);
}

/* ── Header ─────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(12,6,1,0.98);
  flex-shrink: 0;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-feather {
  flex-shrink: 0;
  margin-right: 2px;
  filter: drop-shadow(0 0 4px rgba(240,208,96,0.35));
}

.title {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.8px;
  background: linear-gradient(135deg, #f8e89a 0%, #f0d060 50%, #c8980a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  line-height: 1;
}

.version {
  font-size: 10px;
  color: rgba(122,133,153,0.5);
  background: rgba(134,114,94,0.1);
  border: 1px solid rgba(134,114,94,0.15);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.lang-select {
  background: rgba(30,14,6,0.9);
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .3px;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: color .15s, border-color .15s;
  max-width: 90px;
}
.lang-select:hover, .lang-select:focus {
  color: var(--heading);
  border-color: rgba(240,216,136,0.35);
  outline: none;
}
.lang-select option { background: #1a0e06; color: #d4b878; }

/* ── Tabs ───────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(10,5,1,0.95);
  flex-shrink: 0;
  padding: 0 4px;
}

.tab {
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .3px;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.tab.spinning { color: var(--heading); }

/* ── Controls ───────────────────────────────────── */
.controls {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(12,6,1,0.8);
  flex-shrink: 0;
}

.search-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}
.search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
  line-height: 1;
}
.controls input,
.controls select {
  background: rgba(20,10,3,0.9);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.controls select { cursor: pointer; flex-shrink: 0; }
#search-input { padding-left: 30px; }
.controls input:focus,
.controls select:focus {
  border-color: rgba(106,191,64,0.5);
  box-shadow: 0 0 0 3px rgba(106,191,64,0.07);
}

/* ── Compare bar ────────────────────────────────── */
.compare-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(32,16,4,0.95);
  border-bottom: 1px solid rgba(106,191,64,0.18);
  flex-shrink: 0;
}
.compare-bar.hidden { display: none; }
#compare-label { flex: 1; font-size: 12px; color: var(--muted); }

.btn-cmp {
  background: linear-gradient(135deg, #75cc38, #52a822);
  color: #0a1a04;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s;
}
.btn-cmp:hover { filter: brightness(1.12); }

.btn-clr {
  background: rgba(200,64,32,0.1);
  color: #c86050;
  border: 1px solid rgba(200,64,32,0.28);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.btn-clr:hover { background: rgba(200,64,32,0.2); color: #e07060; border-color: rgba(200,64,32,0.5); }

/* ── Status bar ─────────────────────────────────── */
.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 2px 10px;
  font-size: 10px;
  color: rgba(122,133,153,0.55);
  background: rgba(8,4,1,0.6);
  border-bottom: 1px solid rgba(134,114,94,0.08);
  flex-shrink: 0;
}

/* ── Main layout ────────────────────────────────── */
.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.list-wrap {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
  padding: 0 0 16px;
}
.list-wrap::-webkit-scrollbar { width: 4px; }
.list-wrap::-webkit-scrollbar-track { background: transparent; }
.list-wrap::-webkit-scrollbar-thumb { background: rgba(134,114,94,0.25); border-radius: 2px; }
.list-wrap::-webkit-scrollbar-thumb:hover { background: rgba(134,114,94,0.5); }

/* ── Item rows ──────────────────────────────────── */
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 0;
  border-bottom: 1px solid rgba(134,114,94,0.07);
  border-left: 3px solid var(--rc, rgba(134,114,94,0.18));
  cursor: pointer;
  transition: background .12s, border-left-color .12s;
  position: relative;
}
.item-row:hover {
  background: rgba(26,12,4,0.95);
  border-left-color: var(--rc, var(--border2));
}
.item-row.active {
  background: rgba(30,14,4,0.98);
  border-left-color: var(--green);
  box-shadow: inset 3px 0 14px -6px rgba(106,191,64,0.15);
}

.item-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 10px;
}
.item-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.item-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  text-shadow: 0 0 12px color-mix(in srgb, var(--rc, transparent) 40%, transparent);
}
.item-meta { font-size: 11px; color: var(--muted); }

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.item-price { color: var(--green); font-weight: 700; font-size: 15px; }

/* ── Checkbox ───────────────────────────────────── */
.chk-wrap {
  width: 18px; height: 18px;
  position: relative; cursor: pointer; display: block;
}
.chk-wrap input { opacity:0; position:absolute; inset:0; cursor:pointer; margin:0; }
.chk-box {
  width:18px; height:18px;
  border: 1.5px solid rgba(134,114,94,0.4);
  border-radius: 4px;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none;
  transition: background .15s, border-color .15s;
}
.chk-wrap:hover .chk-box { border-color: var(--green); }
.chk-wrap input:checked + .chk-box { background: var(--green); border-color: var(--green); }
.chk-wrap input:checked + .chk-box::after {
  content:'\2713'; color:#0a1a04; font-size:11px; font-weight:800; line-height:1;
}

/* ── Detail panel ───────────────────────────────── */
.detail-panel {
  width: var(--detail-w);
  border-left: 1px solid var(--border);
  background: rgba(12,6,1,0.97);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow: hidden;
}
.detail-panel.hidden { display: none; }

.detail-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  gap: 8px; flex-shrink: 0;
  background: rgba(16,8,2,0.9);
}
.detail-name {
  font-weight: 700; font-size: 13px;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-x {
  background: rgba(255,255,255,0.04); border: 1px solid transparent;
  color: var(--muted); cursor: pointer; font-size: 13px;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border-radius: 5px; flex-shrink: 0;
  transition: color .15s, background .15s;
}
.detail-x:hover { color: var(--text); background: rgba(255,255,255,0.09); }

.detail-body {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.detail-body::-webkit-scrollbar { width: 3px; }
.detail-body::-webkit-scrollbar-thumb { background: rgba(134,114,94,0.25); border-radius: 2px; }

.detail-top { display: flex; align-items: center; gap: 12px; }
.detail-icon-wrap {
  width: 60px; height: 60px; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.detail-icon { width:60px; height:60px; object-fit:contain; image-rendering:pixelated; }
.detail-top-info { display:flex; flex-direction:column; gap:4px; }
.detail-type { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.8px; font-weight:600; }
.detail-lcount { font-size:12px; }

/* ── Stat sections ──────────────────────────────── */
.stat-section {
  background: rgba(8,4,1,0.7);
  border: 1px solid rgba(134,114,94,0.14);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.section-lbl {
  font-size:10px; font-weight:700; color:rgba(122,133,153,0.7);
  text-transform:uppercase; letter-spacing:.9px;
  padding:6px 10px 5px; border-bottom:1px solid rgba(134,114,94,0.08);
}
.stat-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:7px 10px; border-bottom:1px solid rgba(134,114,94,0.06);
}
.stat-row:last-child { border-bottom:none; }
.stat-lbl { font-size:12px; color:var(--muted); }
.stat-val { font-size:13px; font-weight:600; color:var(--text); }
.stat-val.green { color:var(--green); }
.stat-val.muted { color:var(--muted); font-weight:400; }

.detail-loading {
  text-align:center; padding:14px; font-size:12px; color:var(--muted);
  display:flex; align-items:center; justify-content:center; gap:7px;
}
.detail-loading::before {
  content:''; width:12px; height:12px;
  border:2px solid rgba(122,133,153,0.25); border-top-color:var(--muted);
  border-radius:50%; animation:spin .7s linear infinite; flex-shrink:0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.detail-err { text-align:center; padding:12px; font-size:12px; color:var(--red); opacity:.8; }

.btn-steam {
  display:flex; align-items:center; justify-content:center; gap:6px;
  background: linear-gradient(135deg, #1b2a3d, #172333);
  color:#b8cfe0; border:1px solid rgba(100,160,220,0.18); border-radius:var(--radius-sm);
  padding:9px 12px; text-align:center; text-decoration:none;
  font-size:13px; font-family:inherit; font-weight:500;
  transition:background .15s, border-color .15s;
}
.btn-steam:hover { background:linear-gradient(135deg,#213448,#1b2c40); border-color:rgba(100,160,220,0.36); }

/* ── Loading state in list ──────────────────────── */
.list-status {
  text-align:center; padding:36px 20px;
  color:var(--muted); font-size:13px;
  display:flex; flex-direction:column; align-items:center; gap:12px;
}
.list-spinner {
  width:24px; height:24px;
  border:2px solid rgba(122,133,153,0.2); border-top-color:var(--green);
  border-radius:50%; animation:spin .8s linear infinite;
}
.no-results { text-align:center; padding:48px 20px; color:rgba(122,133,153,0.45); font-size:13px; }

/* ── Compare overlay ────────────────────────────── */
.overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.75);
  backdrop-filter:blur(4px); z-index:100;
  display:flex; align-items:center; justify-content:center; padding:20px;
  animation:fadeIn .18s ease;
}
.overlay.hidden { display:none; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.cmp-modal {
  background:rgba(16,8,2,0.98); border:1px solid rgba(134,114,94,0.3); border-radius:12px;
  width: min(92vw, 860px); max-height: 82vh; display:flex; flex-direction:column; overflow:hidden;
  min-width: 340px; box-shadow:0 24px 80px rgba(0,0,0,.7);
  animation:slideUp .2s cubic-bezier(.2,.8,.4,1);
}
@keyframes slideUp { from{transform:translateY(14px) scale(.97);opacity:0} to{transform:none;opacity:1} }

.cmp-hdr {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--border); flex-shrink:0;
}
.cmp-hdr span { font-family:'Rajdhani',sans-serif; font-weight:700; color:var(--heading); font-size:15px; letter-spacing:1px; }
#cmp-close {
  background:rgba(255,255,255,0.05); border:1px solid transparent;
  color:var(--muted); cursor:pointer; font-size:14px;
  width:26px; height:26px; display:flex; align-items:center; justify-content:center;
  border-radius:5px; transition:color .15s, background .15s;
}
#cmp-close:hover { color:var(--text); background:rgba(255,255,255,0.1); }

.cmp-cards { display:flex; flex-wrap:wrap; gap:14px; padding:20px; overflow-y:auto; }
.cmp-cards::-webkit-scrollbar { height:4px; }
.cmp-cards::-webkit-scrollbar-thumb { background:rgba(134,114,94,0.25); border-radius:2px; }

.cmp-card {
  min-width:190px; max-width:220px; background:rgba(8,4,1,0.9);
  border:1px solid rgba(134,114,94,0.18); border-radius:var(--radius-sm);
  padding:16px 14px; display:flex; flex-direction:column; gap:9px; flex-shrink:0;
}
.cmp-card-icon {
  width:64px; height:64px; border-radius:8px; overflow:hidden;
  align-self:center; display:flex; align-items:center; justify-content:center;
}
.cmp-card-icon img { width:64px; height:64px; object-fit:contain; image-rendering:pixelated; }
.cmp-card-name {
  font-size:13px; font-weight:600; text-align:center;
  overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  min-height:34px; line-height:1.45;
}
.cmp-divider { border:none; border-top:1px solid rgba(134,114,94,0.12); margin:3px 0; }
.cmp-stat { display:flex; justify-content:space-between; font-size:13px; gap:4px; }
.cmp-stat .lbl { color:var(--muted); }
.cmp-stat .val { font-weight:600; text-align:right; }
.cmp-stat .val.green { color:var(--green); }
.cmp-stat .val.muted { color:var(--muted); font-weight:400; }
.cmp-link {
  display:block; background:rgba(27,40,56,0.9); color:#b8cfe0;
  border:1px solid rgba(100,160,220,0.18); border-radius:4px;
  padding:5px 8px; text-align:center; text-decoration:none; font-size:11px;
  margin-top:auto; transition:background .15s;
}
.cmp-link:hover { background:rgba(33,52,72,0.9); }

/* ── Filter sidebar ─────────────────────────────── */
.filter-sidebar {
  width: 148px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: rgba(9,4,1,0.65);
}
.filter-sidebar::-webkit-scrollbar { width: 3px; }
.filter-sidebar::-webkit-scrollbar-thumb { background: rgba(134,114,94,0.2); border-radius: 2px; }

.fs-clear-btn {
  display: block;
  width: calc(100% - 16px);
  margin: 8px 8px 4px;
  background: rgba(200,64,32,0.12);
  border: 1px solid rgba(200,64,32,0.25);
  border-radius: 4px;
  color: #c86050;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  padding: 5px 8px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
}
.fs-clear-btn:hover { background: rgba(200,64,32,0.22); color: #e07060; }

.fs-section { border-bottom: 1px solid rgba(134,114,94,0.1); padding-bottom: 6px; }
.fs-price-row { display: flex; align-items: center; gap: 4px; padding: 4px 8px; }
.fs-price-inp {
  width: 0; flex: 1 1 0;
  background: rgba(20,10,4,0.8);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  padding: 4px 5px;
  appearance: textfield;
  -moz-appearance: textfield;
}
.fs-price-inp::-webkit-inner-spin-button,
.fs-price-inp::-webkit-outer-spin-button { appearance: none; margin: 0; }
.fs-price-inp:focus { outline: none; border-color: rgba(106,191,64,0.4); }
.fs-price-sep { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.fs-price-apply {
  display: block; width: calc(100% - 16px); margin: 3px 8px 0;
  background: rgba(106,191,64,0.1);
  border: 1px solid rgba(106,191,64,0.25);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: 11px; font-family: inherit; font-weight: 600;
  padding: 4px 0; cursor: pointer;
  transition: background .15s;
}
.fs-price-apply:hover { background: rgba(106,191,64,0.2); }
.fs-title {
  font-size: 10px;
  font-weight: 700;
  color: rgba(122,133,153,0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 10px 4px;
}
.fs-list { display: flex; flex-direction: column; }

.fs-row {
  display: flex;
  align-items: center;
  padding: 1px 4px 1px 10px;
  transition: background .1s;
}
.fs-row:hover                    { background: rgba(26,12,4,0.85); }
.fs-row.fs-active .fs-name       { color: var(--heading); }
.fs-row.fs-excluded              { background: rgba(200,64,32,0.06); }
.fs-row.fs-excluded .fs-name     { color: var(--red); opacity: .65; text-decoration: line-through; }
.fs-row.fs-disabled              { opacity: .28; pointer-events: none; }

.fs-label {
  flex: 1; display: flex; align-items: center; gap: 6px;
  padding: 3px 0; cursor: pointer; user-select: none;
  min-width: 0; font-size: 12px; color: var(--text); line-height: 1.7;
}
.fs-excl {
  width: 18px; height: 18px; flex-shrink: 0;
  background: none; border: none;
  color: rgba(134,114,94,0.18); cursor: pointer; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px; opacity: 0;
  transition: opacity .12s, color .12s, background .12s; padding: 0;
}
.fs-row:hover .fs-excl       { opacity: 1; color: rgba(200,100,80,0.6); }
.fs-row.fs-excluded .fs-excl { opacity: 1; color: #e05040; background: rgba(200,64,32,0.2); }

.fs-label input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 13px; height: 13px;
  border: 1.5px solid rgba(134,114,94,0.35);
  border-radius: 3px; background: rgba(12,6,2,0.9);
  flex-shrink: 0; cursor: pointer; margin: 0;
  position: relative; transition: border-color .15s, background .15s;
}
.fs-row:hover .fs-label input[type="checkbox"] { border-color: rgba(106,191,64,0.45); }
.fs-label input[type="checkbox"]:checked { background: var(--green); border-color: var(--green); }
.fs-label input[type="checkbox"]:checked::after {
  content: ''; position: absolute;
  left: 3px; top: 0; width: 4px; height: 8px;
  border: 2px solid #0a1804; border-top: none; border-left: none;
  transform: rotate(45deg);
}
.fs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fs-more-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-family: inherit;
  padding: 3px 10px 7px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: color .15s;
}
.fs-more-btn:hover { color: var(--heading); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1100px) { .ad-rail { width: 120px; } }
@media (max-width: 900px)  { #ad-right { display: none; } }
@media (max-width: 700px)  { .ad-rail { display: none; } body { padding: 8px 0 0; } }

@media (max-width: 640px) {
  .filter-sidebar { display: none; }
  .controls { flex-wrap: wrap; }
  .search-wrap { order: -1; min-width: 100%; }
  .detail-panel {
    position:fixed; right:0; top:0; bottom:0;
    width:min(100vw,320px); z-index:50; box-shadow:-6px 0 30px rgba(0,0,0,.8);
  }
}

/* ── Filter toggle button (mobile only) ─────────── */
.filter-toggle-btn {
  display: none;
  background: rgba(106,191,64,0.1);
  border: 1px solid rgba(106,191,64,0.25);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  gap: 5px;
  transition: background .15s;
}
.filter-toggle-btn:hover { background: rgba(106,191,64,0.2); }

/* ── Filter backdrop (mobile) ───────────────────── */
.filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
  animation: fadeIn .18s ease;
}
.filter-backdrop.hidden { display: none; }

/* ── Scroll to top button ───────────────────────── */
.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  background: rgba(106,191,64,0.22);
  border: 2px solid rgba(106,191,64,0.6);
  border-radius: 10px;
  color: var(--green);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, background .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-top-btn:hover { background: rgba(106,191,64,0.28); }

@media (max-width: 640px) {
  /* Show filter toggle button */
  .filter-toggle-btn { display: flex; }

  /* Mobile filter drawer */
  .filter-sidebar {
    display: block !important;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 200px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    border-right: 1px solid var(--border2);
    box-shadow: 4px 0 20px rgba(0,0,0,.7);
    background: rgba(9,4,1,0.98);
  }
  .filter-sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* ── Mobile stacking context fix ────────────────── */
@media (max-width: 640px) {
  #app { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ── iPhone safe area (Dynamic Island / notch) ───── */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-left:  env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  background: rgba(106,191,64,0.22);
  border: 2px solid rgba(106,191,64,0.6);
  border-radius: 10px;
  color: var(--green);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, background .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
}
@media (max-width: 640px) {
  @supports (padding: env(safe-area-inset-bottom)) {
    .filter-sidebar {
      padding-top:    env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}
