:root {
  --bg: #060911;
  --bg-elevated: #0c1220;
  --glass: rgba(13, 19, 33, 0.72);
  --glass-strong: rgba(15, 22, 38, 0.9);
  --glass-hover: rgba(24, 34, 58, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #8492a6;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --gold: #f59e0b;
  --gold-bright: #fbbf24;
  --gold-soft: rgba(245, 158, 11, 0.14);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.14);
  --orange: #fb923c;
  --danger: #ef4444;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.tabular-nums,
.price-main,
.bento-price,
.cabin-val,
.cg-price,
.drawer-price-val,
.badge {
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.hidden {
  display: none !important;
}

/* Ambient Obsidian Glow */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
}

.orb-emerald {
  width: 560px;
  height: 560px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.13), transparent 70%);
}

.orb-gold {
  width: 520px;
  height: 520px;
  top: -140px;
  right: 6%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.1), transparent 70%);
}

.orb-indigo {
  width: 640px;
  height: 640px;
  bottom: -240px;
  left: 35%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 70%);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(6, 9, 17, 0.8);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--emerald) 100%);
  color: #061018;
  font-weight: 800;
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 8px var(--emerald-bright);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Main Desktop Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

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

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(16, 185, 129, 0.18));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.35);
}

/* Smart Search Box + Popover */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 480px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 22, 38, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 4px 5px 4px 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box:focus-within {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  padding: 6px 0;
}

.search-box input::placeholder {
  color: var(--muted);
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.btn-icon-clear {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.btn-search-submit {
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #061018;
  background: linear-gradient(135deg, var(--gold-bright), var(--emerald-bright));
  transition: transform 0.14s ease, filter 0.14s ease;
  flex-shrink: 0;
}

.btn-search-submit:hover {
  filter: brightness(1.06);
}

/* Search Popover */
.search-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(12, 18, 32, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 90;
  max-height: 70vh;
  overflow-y: auto;
}

.sp-section + .sp-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.sp-clear-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.sp-clear-btn:hover {
  color: var(--text);
}

.sp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sp-chip:hover {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fff;
  background: rgba(251, 191, 36, 0.1);
}

.sp-chip-del {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  padding: 0 2px;
}

.sp-chip-del:hover {
  color: var(--danger);
}

.sp-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.sp-suggest-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.sp-suggest-item img {
  width: 64px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  background: #121a2d;
  flex-shrink: 0;
}

.sp-suggest-info {
  flex: 1;
  min-width: 0;
}

.sp-suggest-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-suggest-sub {
  font-size: 11px;
  color: var(--muted);
}

.sp-suggest-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--emerald-bright);
  flex-shrink: 0;
}

/* Topbar Actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 8px var(--emerald-bright);
}

.status-pill.busy .dot {
  background: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-bright);
  animation: pulseDot 1s infinite;
}

/* Generic Buttons */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-row {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--emerald-bright));
  color: #061018;
  font-weight: 700;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-row {
  padding: 6px 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-row:hover {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fff;
  background: rgba(251, 191, 36, 0.12);
}

.btn-row:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 248px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 80;
}

.dropdown-menu button {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
}

.dropdown-menu button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.dropdown-tip {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* Main Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.alert-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Bento Hero Section (Home Channel) */
.hero-section {
  margin-bottom: 22px;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
}

.bento-grid > * {
  min-width: 0;
}

.bento-featured {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 290px;
  background: #0d1424;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.bento-featured:hover {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.45);
}

.bento-featured-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.bento-featured:hover .bento-featured-bg {
  transform: scale(1.04);
  opacity: 0.58;
}

.bento-featured-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 17, 0.15) 0%, rgba(6, 9, 17, 0.65) 55%, rgba(6, 9, 17, 0.96) 100%);
}

.bento-featured-content {
  position: relative;
  z-index: 2;
}

.bento-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.eyebrow-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.24), rgba(245, 158, 11, 0.14));
  color: var(--gold-bright);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.eyebrow-save {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.22);
  color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.bento-featured-title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.bento-featured-prices {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
}

.bento-price {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--emerald-bright);
}

.bento-steam-ori {
  font-size: 13px;
  color: var(--muted);
}

.bento-platform-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.bento-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.stats-cabin {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-width: 0;
}

.cabin-card {
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cabin-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.cabin-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.cabin-val.emerald {
  color: var(--emerald-bright);
}

.cabin-val.gold {
  color: var(--gold-bright);
}

.steals-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
}

.steal-mini-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 124px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.steal-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.45);
}

.steal-mini-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
}

.steal-mini-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 17, 0.25), rgba(6, 9, 17, 0.94));
}

.steal-mini-body {
  position: relative;
  z-index: 2;
}

.steal-mini-save {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-bottom: 5px;
}

.steal-mini-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.steal-mini-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--emerald-bright);
}

.quick-entries {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  transition: all 0.16s ease;
  text-align: left;
}

.quick-tile:hover {
  background: var(--glass-hover);
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}

.quick-tile-title {
  font-size: 13px;
  font-weight: 700;
  display: block;
}

.quick-tile-sub {
  font-size: 11px;
  color: var(--muted);
}

.quick-tile-arrow {
  color: var(--gold-bright);
  font-size: 14px;
  font-weight: 700;
}

/* Channel Header (Rankings / Steals / Lowest / Library / Search) */
.channel-header {
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 22, 38, 0.86), rgba(12, 18, 32, 0.65));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ch-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ch-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.ranking-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.rank-subtab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rank-subtab:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.rank-subtab.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(16, 185, 129, 0.18));
  border-color: rgba(251, 191, 36, 0.5);
  color: #fff;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.vt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vt-btn svg {
  width: 14px;
  height: 14px;
}

.vt-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-btn.active {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.12);
  color: #fff;
}

.badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.price-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}

.pf-pill {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.pf-pill:hover {
  color: var(--text);
}

.pf-pill.active {
  background: linear-gradient(135deg, var(--gold-bright), var(--emerald-bright));
  color: #061018;
  font-weight: 700;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.toggle-label input {
  accent-color: var(--gold-bright);
}

.select-input {
  background: rgba(15, 22, 38, 0.9);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

/* Category Bar */
.category-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.cat-pill.active {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fff;
}

.cat-count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.75;
}

/* Table View */
.table-wrap {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
}

.th-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}
.th-dot.steam { background: var(--blue); }
.th-dot.steampy { background: var(--emerald-bright); }
.th-dot.heybox { background: var(--orange); }

.compare-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.14s ease;
}

.compare-table tbody tr:last-child {
  border-bottom: none;
}

.compare-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.compare-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.empty-cell {
  text-align: center;
  padding: 48px 16px !important;
  color: var(--muted);
}

.game-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.rank-medal {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.rank-medal.r1 {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #1f1300;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.rank-medal.r2 {
  background: linear-gradient(135deg, #f1f5f9, #94a3b8);
  color: #0f172a;
  border-color: transparent;
}

.rank-medal.r3 {
  background: linear-gradient(135deg, #fdba74, #c2410c);
  color: #1c0b00;
  border-color: transparent;
}

.game-thumb {
  width: 108px;
  height: 50px;
  border-radius: 9px;
  object-fit: cover;
  background: #121a2d;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.game-info {
  min-width: 0;
}

.game-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  display: block;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-cell:hover .game-name {
  color: var(--gold-bright);
}

.game-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.tag-badge.lowest {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-badge.lowest-new {
  background: rgba(245, 158, 11, 0.18);
  color: var(--gold-bright);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-badge.score {
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

.tag-badge.new-hot {
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-badge.coop-badge {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.tag-badge.deadline {
  color: var(--muted);
}

/* Price Cell */
.price-box {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 10px;
  min-width: 108px;
}

.price-box.is-lowest {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.42);
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.15);
}

.price-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-main {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.price-box.is-lowest .price-main {
  color: var(--emerald-bright);
}

.discount-pill {
  background: rgba(16, 185, 129, 0.22);
  color: var(--emerald-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
}

.type-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
}

.price-sub {
  font-size: 11px;
  color: var(--muted);
}

.status-tag {
  display: inline-block;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}

.status-tag.loading {
  color: var(--gold-bright);
  border-color: rgba(251, 191, 36, 0.35);
}

.savings-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-bottom: 3px;
}

.fold-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(16, 185, 129, 0.2));
  color: var(--gold-bright);
  border: 1px solid rgba(251, 191, 36, 0.42);
  margin-left: 4px;
}

/* High-Resolution Card Grid View */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.cg-card {
  border-radius: 18px;
  overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.cg-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, 0.42);
}

.cg-cover-wrap {
  position: relative;
  aspect-ratio: 460 / 215;
  background: #101728;
  overflow: hidden;
}

.cg-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.cg-card:hover .cg-cover-wrap img {
  transform: scale(1.04);
}

.cg-float-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cg-discount {
  padding: 3px 8px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(6, 9, 17, 0.78);
  backdrop-filter: blur(8px);
  color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.cg-save-badge {
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.92), rgba(245, 158, 11, 0.92));
  color: #1c1000;
}

.cg-body {
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.cg-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cg-prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.cg-pbox {
  padding: 6px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  text-align: center;
}

.cg-pbox.best {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
}

.cg-pname {
  font-size: 10px;
  color: var(--muted);
}

.cg-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.cg-pbox.best .cg-price {
  color: var(--emerald-bright);
}

.cg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--muted);
}

/* Pagination */
.load-more-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.pagination-info {
  font-size: 12px;
  color: var(--muted);
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.jump-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.jump-input {
  width: 58px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}

/* Footer */
.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

.footer-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.footer-link:hover {
  color: var(--text);
}

/* Shimmer Skeleton & Cover Fade-in */
@keyframes darkShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.game-thumb,
.cg-cover-wrap,
.m-row-cover,
.drawer-cover {
  background: linear-gradient(90deg, #0e1526 25%, #19243b 50%, #0e1526 75%);
  background-size: 200% 100%;
  animation: darkShimmer 1.6s ease-in-out infinite;
}

.cover-img {
  opacity: 0;
  transition: opacity 180ms ease;
}

.cover-img.loaded {
  opacity: 1;
}

/* Row Refresh Spinner & 1px Scanline */
@keyframes spinIcon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-icon {
  display: inline-block;
  animation: spinIcon 0.8s linear infinite;
}

.compare-table tbody tr {
  position: relative;
}

.compare-table tbody tr.is-scanning {
  background: rgba(16, 185, 129, 0.06);
}

.compare-table tbody tr.is-scanning::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--emerald-bright), var(--gold-bright), transparent);
  background-size: 200% 100%;
  animation: darkShimmer 1.1s linear infinite;
  pointer-events: none;
}

.compare-table tbody tr.row-flashed {
  background: rgba(16, 185, 129, 0.14);
  transition: background 0.6s ease;
}

/* Tactile Press Feedback */
.mb-tab,
.pf-pill,
.cat-pill,
.btn-row,
.btn-combo,
.quick-tile,
.rank-subtab {
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.mb-tab:active,
.pf-pill:active,
.cat-pill:active,
.btn-row:active,
.btn-combo:active,
.quick-tile:active,
.rank-subtab:active {
  transform: scale(0.97);
}

/* Slide-over Quick View Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: flex-end;
  transition: opacity 0.15s ease;
}

.drawer-backdrop.closing {
  opacity: 0;
  pointer-events: none;
}

.detail-drawer {
  width: min(460px, 100%);
  height: 100%;
  background: #0b111e;
  border-left: 1px solid var(--border-strong);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.65);
  overflow-y: auto;
  animation: slideLeft 0.2s ease-out;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.drawer-backdrop.closing .detail-drawer {
  transform: translateX(30px);
  opacity: 0;
}

@keyframes slideLeft {
  from { transform: translateX(30px); opacity: 0.4; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 460 / 215;
  background: #121a2d;
}

.drawer-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 9, 17, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.drawer-content {
  padding: 20px;
}

.drawer-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.drawer-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.drawer-platforms {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.drawer-pcard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

.drawer-pcard.best {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.48);
}

.drawer-pname {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-pmeta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.drawer-pright {
  text-align: right;
}

.drawer-price-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.drawer-pcard.best .drawer-price-val {
  color: var(--emerald-bright);
}

.drawer-actions {
  display: flex;
  gap: 10px;
}

.drawer-actions .btn-primary,
.drawer-actions .btn-secondary {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
}

/* Modal & Toast */
.btn-combo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(16, 185, 129, 0.12));
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-combo:hover {
  border-color: rgba(251, 191, 36, 0.72);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(16, 185, 129, 0.2));
}

.combo-modal-card {
  width: min(600px, 100%);
}

.combo-budget-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.combo-custom-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.combo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 12px;
  margin-bottom: 12px;
}

.combo-summary strong {
  font-family: var(--font-mono);
  color: var(--emerald-bright);
  font-size: 15px;
}

.combo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.combo-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.combo-item:hover {
  border-color: rgba(251, 191, 36, 0.45);
}

.combo-item img {
  width: 92px;
  height: 43px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
}

.combo-item-info {
  flex: 1;
  min-width: 0;
}

.combo-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-item-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.combo-item-price {
  text-align: right;
  flex-shrink: 0;
}

.combo-item-price strong {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--emerald-bright);
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 150;
}

.modal-card {
  width: min(640px, 100%);
  background: #0e1626;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.modal-header,
.modal-footer {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  gap: 10px;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
}

.modal-body {
  padding: 16px 18px;
}

.modal-desc {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.modal-steps {
  margin: 0 0 12px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.code-copy-row {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #060911;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.code-copy-row code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fde68a;
  overflow-x: auto;
  white-space: nowrap;
}

.modal-textarea,
.modal-input {
  width: 100%;
  background: #060911;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  background: rgba(15, 22, 38, 0.96);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 200;
  font-size: 13px;
}

/* Mobile Elements (Hidden on Desktop) */
.mobile-search-btn,
.mobile-subtabs,
.m-hero-strip,
.mobile-cards,
.mobile-bottom-nav {
  display: none;
}

.m-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.m-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(12, 18, 32, 0.94);
  border-bottom: 1px solid var(--border);
}

.m-search-back {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.m-search-back svg {
  width: 22px;
  height: 22px;
}

.m-search-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 10px;
}

.m-search-input-wrap input {
  flex: 1;
  min-width: 0;
  height: 36px;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
}

.m-search-submit {
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #061018;
  background: linear-gradient(135deg, var(--gold-bright), var(--emerald-bright));
  flex-shrink: 0;
}

.m-search-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 32px;
}

/* Responsive Tablet & Mobile */
@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .quick-entries {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip;
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .topbar-inner {
    height: 50px;
    padding: 0 14px;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
    font-size: 16px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-sub,
  .search-wrap,
  .topbar-actions,
  .view-toggle,
  .bento-grid {
    display: none !important;
  }

  .mobile-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-search-btn svg {
    width: 14px;
    height: 14px;
    color: var(--gold-bright);
  }

  .container {
    padding: 10px 12px 24px;
    overflow-x: clip;
  }

  .hero-section {
    margin-bottom: 8px;
  }

  /* Compact Mobile Hero Strip */
  .m-hero-strip {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .m-stats-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--glass);
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  .m-stats-pill strong {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 12px;
  }

  .m-stats-pill strong.emerald {
    color: var(--emerald-bright);
  }

  .m-stats-pill strong.gold {
    color: var(--gold-bright);
  }

  .m-steals-scroll {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .m-steals-scroll::-webkit-scrollbar {
    display: none;
  }

  .m-steal-card {
    position: relative;
    width: 204px;
    height: 92px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    scroll-snap-align: start;
    background: #0e1526;
    border: 1px solid var(--border);
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .m-steal-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
  }

  .m-steal-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 9, 17, 0.15) 0%, rgba(6, 9, 17, 0.92) 100%);
  }

  .m-steal-body {
    position: relative;
    z-index: 2;
  }

  .m-steal-save {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.24);
    color: var(--emerald-bright);
    border: 1px solid rgba(16, 185, 129, 0.4);
    margin-bottom: 3px;
  }

  .m-steal-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-steal-price {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--emerald-bright);
  }

  /* Xiaoheihe-style Underline SubTabs */
  .mobile-subtabs {
    display: flex;
    align-items: center;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    margin: 2px 0 10px;
    padding: 0 24px 0 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
  }

  .mobile-subtabs::-webkit-scrollbar {
    display: none;
  }

  .m-subtab {
    position: relative;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 2px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
  }

  .m-subtab.active {
    color: #fff;
    font-weight: 700;
  }

  .m-subtab.active::after {
    content: '';
    position: absolute;
    left: 15%;
    right: 15%;
    bottom: 0;
    height: 2.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold-bright), var(--emerald-bright));
  }

  .channel-header {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .ch-title {
    font-size: 16px;
  }

  .ch-desc {
    font-size: 12px;
  }

  .ranking-subtabs {
    display: none;
  }

  .coop-subtabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: 10px;
    padding-right: 24px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
  }

  .coop-subtabs::-webkit-scrollbar {
    display: none;
  }

  .coop-subtabs .rank-subtab {
    flex-shrink: 0;
    padding: 5px 11px;
    font-size: 12px;
  }

  .toolbar {
    margin-bottom: 8px;
    gap: 0;
  }

  .toolbar-left {
    display: none;
  }

  .toolbar-right {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 24px 4px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
  }

  .toolbar-right::-webkit-scrollbar,
  .category-bar::-webkit-scrollbar {
    display: none;
  }

  .price-filter-bar {
    flex-shrink: 0;
    padding: 2px;
  }

  .pf-pill {
    padding: 5px 9px;
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .toggle-label {
    flex-shrink: 0;
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
  }

  .select-input {
    flex-shrink: 0;
    padding: 5px 9px;
    font-size: 11px;
  }

  .category-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 8px;
    padding: 0 24px 4px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
  }

  .cat-pill {
    flex-shrink: 0;
    padding: 5px 11px;
    font-size: 11px;
  }

  .table-wrap,
  .card-grid {
    display: none !important;
  }

  /* Xiaoheihe High-Density List Rows */
  .mobile-cards {
    display: flex;
    flex-direction: column;
  }

  .m-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
  }

  .m-row:active {
    background: rgba(255, 255, 255, 0.03);
  }

  .m-row-cover {
    position: relative;
    width: 114px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #101728;
    border: 1px solid var(--border);
  }

  .m-row-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .m-row-disc {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    background: rgba(6, 9, 17, 0.85);
    color: var(--emerald-bright);
    border: 1px solid rgba(16, 185, 129, 0.35);
  }

  .m-row-rank {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 18px;
    height: 16px;
    padding: 0 4px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
    background: rgba(6, 9, 17, 0.82);
    color: #fff;
  }

  .m-row-rank.r1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #1f1300; }
  .m-row-rank.r2 { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #0f172a; }
  .m-row-rank.r3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #1c0b00; }

  .m-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .m-row-title {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-row-price-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .m-row-low {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--emerald-bright);
  }

  .m-row-ori {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    text-decoration: line-through;
  }

  .m-row-tag {
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
  }

  .m-row-tag.low {
    background: rgba(16, 185, 129, 0.18);
    color: var(--emerald-bright);
  }

  .m-row-tag.save {
    background: rgba(245, 158, 11, 0.2);
    color: var(--gold-bright);
  }

  .m-row-compare {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
  }

  .m-row-compare .win {
    color: var(--emerald-bright);
    font-weight: 600;
  }

  .m-row-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .score-badge {
    min-width: 44px;
    height: 22px;
    padding: 0 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
  }

  .score-badge.t-gold { background: linear-gradient(135deg, #f59e0b, #ea580c); }
  .score-badge.t-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
  .score-badge.t-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
  .score-badge.t-slate { background: rgba(255, 255, 255, 0.12); color: var(--text-secondary); }
  .score-badge.t-save { background: rgba(16, 185, 129, 0.2); color: var(--emerald-bright); border: 1px solid rgba(16, 185, 129, 0.4); }

  /* Bottom Native Glass Nav */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(8, 12, 22, 0.9);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border-top: 1px solid var(--border-strong);
  }

  .mb-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 0;
    cursor: pointer;
  }

  .mb-tab svg {
    width: 20px;
    height: 20px;
  }

  .mb-tab.active {
    color: var(--gold-bright);
  }

  /* Drawer as Bottom Sheet on Mobile */
  .drawer-backdrop {
    align-items: flex-end;
    justify-content: center;
  }

  .detail-drawer {
    width: 100%;
    height: auto;
    max-height: 85vh;
    border-left: none;
    border-top: 1px solid var(--border-strong);
    border-radius: 22px 22px 0 0;
    animation: slideUp 0.22s ease-out;
  }

  .drawer-backdrop.closing .detail-drawer {
    transform: translateY(36px);
    opacity: 0;
  }

  @keyframes slideUp {
    from { transform: translateY(40px); opacity: 0.4; }
    to { transform: translateY(0); opacity: 1; }
  }

  .toast {
    bottom: calc(76px + env(safe-area-inset-bottom));
    right: 12px;
    left: 12px;
    text-align: center;
  }
}
