/* ============================================================
   GamerVault Modern Marketplace UI — Phase 1
   Clean, minimal, professional gaming marketplace skin.
   ============================================================ */

:root {
  --bg: #0b0e12;
  --bg2: #0f1318;
  --bg3: #141920;
  --surface: #11161d;
  --surface2: #161c24;
  --surface3: #1c232d;
  --neu-shadow-dark: rgba(0,0,0,.28);
  --neu-shadow-light: rgba(255,255,255,.015);
  --gold: #f3bd45;
  --gold2: #dca32d;
  --gold-glow: rgba(243,189,69,.12);
  --accent: #f3bd45;
  --accent2: #dca32d;
  --green: #5fc98b;
  --red: #e26767;
  --orange: #dc9f52;
  --blue: #78a6e6;
  --text: #f5f7fa;
  --text2: #a7b0bc;
  --text3: #707b89;
  --border: rgba(255,255,255,.055);
  --border2: rgba(255,255,255,.095);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --transition: .18s ease;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --container: 1240px;
}

html[data-theme="light"] { color-scheme: dark; }
body {
  background:
    radial-gradient(circle at 48% -20%, rgba(69,86,108,.11), transparent 35%),
    var(--bg);
  color: var(--text);
  letter-spacing: -.006em;
}
a { color: inherit; }
.container { max-width: var(--container); }

/* Quiet shared surfaces */
.neu, .neu-lg, .card-sku, .stat-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  box-shadow: none;
}
.form-control, .search-bar {
  box-shadow: none;
}

/* Header */
.navbar {
  height: 66px;
  background: rgba(11,14,18,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.navbar-inner {
  max-width: var(--container);
  height: 66px;
  gap: 28px;
}
.navbar-logo {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.navbar-logo svg { width: 24px; height: 24px; }
.navbar-nav { gap: 4px; }
.navbar-nav a {
  color: #aeb6c1;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 11px;
  border-radius: 7px;
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--text);
  background: rgba(255,255,255,.045);
}
.navbar-actions { gap: 8px; }
.navbar-actions #theme-toggle-btn { display: none !important; }
.btn-gold, .btn-accent {
  background: var(--gold);
  color: #17120a !important;
  border: 1px solid #f7ca67;
  box-shadow: none;
  font-weight: 750;
  border-radius: 7px;
}
.btn-gold:hover, .btn-accent:hover {
  background: #f7ca67;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  box-shadow: none;
  border-radius: 7px;
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.16); }

/* Homepage */
.modern-home { padding-bottom: 72px; }
.home-section { padding: 34px 0; }
.home-section + .home-section { border-top: 1px solid var(--border); }
.home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.home-section-heading h2 { font-size: 18px; line-height: 1.2; font-weight: 760; letter-spacing: -.02em; }
.home-section-heading p { color: var(--text3); font-size: 12px; margin-top: 5px; }
.home-section-heading a { color: var(--text2); font-size: 12px; text-decoration: none; }
.home-section-heading a:hover { color: var(--gold); }

.market-hero {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #0c1015;
}
.market-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #0c1015 0%, rgba(12,16,21,.97) 37%, rgba(12,16,21,.52) 66%, rgba(12,16,21,.82) 100%);
}
.market-hero-media {
  position: absolute;
  inset: 0 0 0 42%;
  background-position: center;
  background-size: cover;
  filter: saturate(.76) contrast(1.03) brightness(.72);
  opacity: .92;
}
.market-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #0c1015 0%, transparent 46%), linear-gradient(90deg, #0c1015 0%, transparent 54%);
}
.market-hero-inner {
  min-height: 430px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  padding-top: 32px;
  padding-bottom: 32px;
}
.market-hero-copy { width: min(610px, 58%); }
.hero-proof {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b5bec8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-proof::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(95,201,139,.08); }
.market-hero h1 {
  max-width: 650px;
  font-size: clamp(38px, 4.8vw, 64px);
  line-height: .98;
  font-weight: 800;
  letter-spacing: -.055em;
  margin: 0;
}
.market-hero h1 .accent { color: var(--gold); }
.market-hero .hero-description {
  max-width: 530px;
  margin-top: 22px;
  color: #aab3bf;
  font-size: 15px;
  line-height: 1.65;
}
.hero-search {
  display: grid;
  grid-template-columns: 150px minmax(200px, 1fr) auto;
  width: min(660px, 100%);
  margin-top: 28px;
  background: #11161d;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 9px;
  overflow: hidden;
}
.hero-search select, .hero-search input {
  min-width: 0;
  height: 52px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
}
.hero-search select { border-right: 1px solid var(--border2); color: var(--text2); }
.hero-search input::placeholder { color: #6d7784; }
.hero-search button {
  height: 42px;
  align-self: center;
  margin-right: 5px;
  padding: 0 22px;
  background: var(--gold);
  color: #17120a;
  border: 1px solid #f7ca67;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.hero-actions-inline { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-actions-inline a { font-size: 12px; text-decoration: none; padding: 10px 14px; }
.hero-trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; color: #929ca8; font-size: 11px; }
.hero-trust-item { display: flex; align-items: center; gap: 7px; }

.hero-metrics {
  position: absolute;
  right: max(28px, calc((100vw - var(--container))/2));
  top: 50%;
  transform: translateY(-50%);
  width: 176px;
  display: grid;
  gap: 10px;
  z-index: 3;
}
.hero-metric {
  background: rgba(15,20,27,.82);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  padding: 13px 15px;
  backdrop-filter: blur(8px);
}
.hero-metric strong { display: block; font-size: 16px; line-height: 1.2; color: var(--text); }
.hero-metric span { display: block; color: var(--text3); font-size: 10px; margin-top: 3px; }
.hero-metric.rating strong { color: var(--gold); }

.game-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 10px;
}
.game-tile {
  min-width: 0;
  display: block;
  text-decoration: none;
  border: 1px solid var(--border2);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.game-tile:hover { border-color: rgba(243,189,69,.42); transform: translateY(-2px); }
.game-tile-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface2); }
.game-tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.78) brightness(.76); transition: filter var(--transition), transform var(--transition); }
.game-tile:hover img { filter: saturate(.94) brightness(.86); transform: scale(1.025); }
.game-tile-media::after { content:""; position:absolute; inset:0; background:linear-gradient(0deg, rgba(8,11,15,.88), transparent 64%); }
.game-tile-content { padding: 10px 11px 11px; }
.game-tile-title { font-size: 12px; font-weight: 720; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-tile-count { color: var(--text3); font-size: 10px; margin-top: 2px; }

.market-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.market-grid.compact { grid-template-columns: repeat(5, minmax(0,1fr)); }
.market-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 9px;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.market-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.17); background: #131920; }
.market-card-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #171d25; }
.market-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.83) brightness(.76); transition: transform var(--transition), filter var(--transition); }
.market-card:hover .market-card-media img { transform: scale(1.025); filter: saturate(.95) brightness(.83); }
.market-card-placeholder { width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#151b22,#0f1318); }
.market-card-shade { position:absolute;inset:0;background:linear-gradient(0deg,rgba(8,10,13,.78),transparent 56%); }
.market-badge { position:absolute; top:9px; left:9px; z-index:2; padding:4px 7px; border-radius:5px; background:var(--gold); color:#17120a; font-size:8px; text-transform:uppercase; letter-spacing:.06em; font-weight:850; }
.market-platform { position:absolute; top:9px; right:9px; z-index:2; padding:4px 6px; border-radius:5px; background:rgba(7,9,12,.72); color:#dfe4ea; font-size:8px; font-weight:750; }
.market-card-body { display:flex;flex-direction:column;flex:1;padding:12px; }
.market-game { color:var(--text3);font-size:9px;font-weight:720;text-transform:uppercase;letter-spacing:.07em; }
.market-card-title { color:var(--text);font-size:13px;font-weight:720;line-height:1.36;margin-top:5px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden; }
.market-card-meta { min-height:32px;color:#7f8996;font-size:10px;line-height:1.5;margin-top:7px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden; }
.market-card-footer { margin-top:auto;padding-top:12px;display:flex;align-items:end;justify-content:space-between;gap:8px;border-top:1px solid var(--border); }
.market-price { color:var(--text);font-size:17px;font-weight:800;letter-spacing:-.02em; }
.market-seller { min-width:0;display:flex;align-items:center;gap:5px;color:var(--text3);font-size:9px;margin-top:4px; }
.market-seller-name { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:105px; }
.market-rating { color:var(--text2);font-size:10px;white-space:nowrap; }
.market-rating b { color:var(--gold); }
.market-delivery { color:var(--green);font-size:9px;white-space:nowrap; }

.boost-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.boost-card {
  position: relative;
  overflow: hidden;
  min-height: 182px;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 9px;
}
.boost-card::after { content:"";position:absolute;inset:0 0 auto auto;width:52%;height:100%;background:var(--boost-image) center/cover no-repeat;opacity:.18;filter:saturate(.8);mask-image:linear-gradient(90deg,transparent,#000); }
.boost-card > * { position:relative;z-index:1; }
.boost-game { color:var(--text3);font-size:9px;text-transform:uppercase;letter-spacing:.07em;font-weight:750; }
.boost-card h3 { font-size:15px;margin-top:7px;line-height:1.3; }
.boost-card p { max-width:75%;color:var(--text3);font-size:10px;line-height:1.55;margin-top:7px; }
.boost-card-footer { position:absolute;left:17px;right:17px;bottom:15px;display:flex;align-items:center;justify-content:space-between;gap:10px;z-index:2; }
.boost-card-footer a { padding:8px 11px;border:1px solid rgba(243,189,69,.55);border-radius:6px;color:var(--gold);font-size:10px;font-weight:750;text-decoration:none; }
.boost-card-footer span { color:var(--text2);font-size:10px; }

.trust-panel { display:grid;grid-template-columns:1.15fr 1.15fr repeat(3,.7fr);background:var(--surface);border:1px solid var(--border2);border-radius:10px;overflow:hidden; }
.trust-cell { min-height:112px;padding:21px;border-right:1px solid var(--border);display:flex;flex-direction:column;justify-content:center; }
.trust-cell:last-child { border-right:0; }
.trust-cell h3 { font-size:13px; }
.trust-cell p { color:var(--text3);font-size:10px;line-height:1.55;margin-top:6px; }
.trust-cell.metric { text-align:center;align-items:center; }
.trust-cell.metric strong { font-size:23px;line-height:1.1; }
.trust-cell.metric span { color:var(--text3);font-size:9px;margin-top:5px; }

.home-cta { display:flex;align-items:center;justify-content:space-between;gap:28px;padding:30px;background:#10151b;border:1px solid var(--border2);border-radius:10px; }
.home-cta h2 { font-size:22px;letter-spacing:-.025em; }
.home-cta p { color:var(--text3);font-size:12px;margin-top:7px;max-width:650px; }
.home-cta-actions { display:flex;gap:9px;flex-shrink:0; }
.home-cta-actions a { text-decoration:none;padding:11px 16px;font-size:11px; }

/* Footer */
.footer { background:#0a0d11;border-top:1px solid var(--border);padding-top:44px; }
.footer-brand { color:var(--text);font-size:16px;font-weight:800;background:none;-webkit-text-fill-color:initial; }
.footer-desc { color:var(--text3);font-size:11px;line-height:1.65; }
.footer-col h4 { color:var(--text2);font-size:11px; }
.footer-col a { color:var(--text3);font-size:11px; }
.footer-col a:hover { color:var(--text); }
.footer-bottom { color:var(--text3);font-size:10px; }

/* Builder */
.builder-shell { display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;align-items:start; }
.builder-panel { background:var(--surface);border:1px solid var(--border2);border-radius:10px;padding:20px; }
.builder-panel h2 { font-size:15px;margin-bottom:16px; }
.builder-list { display:grid;gap:8px; }
.builder-item { display:flex;align-items:center;gap:11px;padding:12px;background:var(--surface2);border:1px solid var(--border2);border-radius:8px;cursor:grab; }
.builder-item.dragging { opacity:.45; }
.builder-handle { color:var(--text3);font-size:16px; }
.builder-item-main { flex:1;min-width:0; }
.builder-item-main strong { display:block;font-size:12px; }
.builder-item-main span { display:block;color:var(--text3);font-size:10px;margin-top:2px; }
.builder-switch { width:38px;height:22px;border-radius:99px;background:#303641;border:0;position:relative;cursor:pointer; }
.builder-switch::after { content:"";position:absolute;width:16px;height:16px;border-radius:50%;background:#8993a0;top:3px;left:3px;transition:.16s; }
.builder-switch.active { background:rgba(243,189,69,.26); }
.builder-switch.active::after { left:19px;background:var(--gold); }
.builder-preview { position:sticky;top:22px; }
.builder-preview-frame { overflow:hidden;border:1px solid var(--border2);border-radius:8px;background:#0b0e12; }
.builder-preview-bar { display:flex;gap:5px;padding:8px 10px;background:#151a21;border-bottom:1px solid var(--border); }
.builder-preview-bar i { width:6px;height:6px;border-radius:50%;background:#49515d; }
.builder-preview-canvas { padding:12px;min-height:330px; }
.builder-mini-hero { padding:22px 16px;border:1px solid var(--border);border-radius:6px;background:linear-gradient(110deg,#11161d,#19170f); }
.builder-mini-hero small { color:var(--gold);font-size:6px;text-transform:uppercase; }
.builder-mini-hero h3 { font-size:15px;line-height:1.1;margin-top:7px;max-width:75%; }
.builder-mini-hero p { color:var(--text3);font-size:6px;margin-top:7px;max-width:70%; }
.builder-mini-section { margin-top:9px; }
.builder-mini-title { width:36%;height:6px;border-radius:3px;background:#454d58;margin-bottom:7px; }
.builder-mini-cards { display:grid;grid-template-columns:repeat(4,1fr);gap:5px; }
.builder-mini-card { height:46px;background:#171c23;border:1px solid var(--border);border-radius:4px; }

@media (max-width: 1120px) {
  .market-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .market-grid.compact { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .game-strip { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .hero-metrics { display:none; }
  .market-hero-copy { width:65%; }
  .builder-shell { grid-template-columns:1fr; }
  .builder-preview { position:static; }
}
@media (max-width: 820px) {
  .market-hero, .market-hero-inner { min-height: 470px; }
  .market-hero-media { inset:0;opacity:.55; }
  .market-hero::after { background:linear-gradient(90deg,rgba(12,16,21,.96),rgba(12,16,21,.72)),linear-gradient(0deg,#0c1015 0%,transparent 45%); }
  .market-hero-copy { width:100%;max-width:600px; }
  .market-hero h1 { font-size:46px; }
  .market-grid, .boost-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .market-grid.compact { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .trust-panel { grid-template-columns:repeat(3,1fr); }
  .trust-cell:nth-child(1), .trust-cell:nth-child(2) { grid-column:span 3; }
  .trust-cell { border-bottom:1px solid var(--border); }
  .home-cta { align-items:flex-start;flex-direction:column; }
}
@media (max-width: 640px) {
  .navbar { height:60px; }
  .navbar-inner { height:60px;padding:0 16px; }
  .market-hero, .market-hero-inner { min-height: 500px; }
  .market-hero-inner { padding:42px 18px;align-items:flex-start; }
  .market-hero h1 { font-size:39px;line-height:1.02; }
  .market-hero .hero-description { font-size:13px; }
  .hero-search { grid-template-columns:1fr;overflow:visible;background:transparent;border:0;gap:8px; }
  .hero-search select, .hero-search input { height:46px;background:#11161d;border:1px solid var(--border2);border-radius:7px; }
  .hero-search select { border-right:1px solid var(--border2); }
  .hero-search button { height:46px;margin:0;width:100%; }
  .hero-actions-inline { display:none; }
  .hero-trust-row { gap:13px; }
  .game-strip { display:flex;overflow-x:auto;padding-bottom:6px;scrollbar-width:none; }
  .game-strip::-webkit-scrollbar { display:none; }
  .game-tile { min-width:150px; }
  .market-grid, .market-grid.compact, .boost-grid { grid-template-columns:1fr 1fr;gap:9px; }
  .market-card-body { padding:10px; }
  .market-price { font-size:15px; }
  .market-delivery, .market-rating { font-size:8px; }
  .home-section { padding:27px 0; }
  .home-section-heading { align-items:flex-start; }
  .home-section-heading h2 { font-size:16px; }
  .trust-panel { grid-template-columns:1fr; }
  .trust-cell, .trust-cell:nth-child(1), .trust-cell:nth-child(2) { grid-column:auto;border-right:0; }
  .home-cta-actions { width:100%; }
  .home-cta-actions a { flex:1;text-align:center; }
}
@media (max-width: 430px) {
  .market-grid, .market-grid.compact, .boost-grid { grid-template-columns:1fr; }
  .market-card-media { aspect-ratio:16/8.5; }
}

/* Marketplace archive */
.marketplace-page .browse-layout {
  display: grid !important;
  grid-template-columns: 220px minmax(0,1fr) !important;
  gap: 28px !important;
  align-items: start !important;
}
.marketplace-filter {
  position: sticky;
  top: 84px;
  padding: 18px !important;
  background: #10151b !important;
  border-radius: 9px !important;
}
.marketplace-filter .form-group { margin-bottom: 17px; }
.marketplace-filter .form-label { font-size: 10px; color: var(--text3); letter-spacing: .04em; text-transform: uppercase; }
.marketplace-filter .form-control {
  background: #0d1116;
  border-color: var(--border2);
  color: var(--text2);
  border-radius: 7px;
  min-height: 40px;
  font-size: 12px;
}
.marketplace-filter .btn-accent,
.marketplace-filter .btn-ghost { min-height: 40px; font-size: 11px !important; }
.marketplace-results .cat-tabs { gap: 6px; margin-bottom: 22px !important; }
.marketplace-results .cat-tab {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 6px;
  background: transparent;
  border-color: var(--border2);
  font-size: 10px;
  box-shadow: none;
}
.marketplace-results .cat-tab:hover,
.marketplace-results .cat-tab.active {
  background: rgba(243,189,69,.09);
  border-color: rgba(243,189,69,.38);
  color: var(--gold);
  box-shadow: none;
}
.marketplace-results h1 { letter-spacing: -.025em; }
.marketplace-results .tag { border-radius: 5px; background: #141a21; }
.pagination .page-btn { background:var(--surface);border:1px solid var(--border2);border-radius:6px;box-shadow:none; }
.pagination .page-btn.active { background:var(--gold);color:#17120a;border-color:var(--gold); }

@media(max-width:900px){
  .marketplace-page .browse-layout { grid-template-columns:1fr !important; }
  .marketplace-filter { position:static; }
}
