:root{
  --bg:#f6f7f9;
  --card:#ffffff;
  --text:#111;
  --muted:#6b7280;
  --line:#e5e7eb;
  --chip:#ffffff;
  --chipHover:#f3f4f6;
  --chipActive:#111;
  --chipActiveText:#fff;

  --btnText:#111;
  --btnBg:#ffffff;
  --btnHover:#e5e7eb;

  --radius:14px;
  --tp-header-space:110px;
}

html,
body{
  margin:0;
  padding:0;
  min-height:100%;
  overflow-x:hidden;
}

body{
  font-family:Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.page-content{
  padding-top:var(--tp-header-space);
  box-sizing:border-box;
}

.page{
  width:100%;
  padding:0 14px calc(170px + env(safe-area-inset-bottom, 0px));
  box-sizing:border-box;
}

.container{
  width:100%;
  max-width:1200px;
  margin:0 auto;
}

/* ===== Breadcrumb ===== */
.breadcrumb{
  margin-top:10px;
  margin-bottom:10px;
  display:flex;
  align-items:center;
  gap:12px;
  padding-left:40px;
}

.crumb-icon{
  width:56px;
  height:56px;
  border-radius:16px;
  object-fit:cover;
  display:block;
  flex-shrink:0;
}

.crumb-game{
  font-size:24px;
  font-weight:600;
  color:#111;
}

.crumb-mode{
  font-size:22px;
  font-weight:600;
  color:#111;
  opacity:.8;
}

/* ===== Modes strip ===== */
.modes-wrap{
  position:relative;
  margin-top:12px;
}

.modes{
  display:flex;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  padding:4px 28px 4px 0;
}

.modes::-webkit-scrollbar{
  display:none;
}

.mode-pill{
  flex:0 0 auto;
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--chip);
  color:#3b82f6;
  font-size:15px;
  font-weight:700;
  line-height:1;
  text-align:center;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition:background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}

.mode-pill:active{
  transform:scale(.98);
}

.mode-pill.active{
  background:#3b82f6;
  border-color:#3b82f6;
  color:#fff;
}

@media (max-width:640px){
  .modes-wrap::after{
    content:"";
    position:absolute;
    top:0;
    right:0;
    width:28px;
    height:100%;
    pointer-events:none;
    background:linear-gradient(to right, rgba(246,247,249,0), var(--bg) 85%);
  }
}

@media (min-width:961px){
  .modes{
    overflow:visible;
    flex-wrap:wrap;
    padding:0;
    gap:10px;
  }

  .modes-wrap::after{
    display:none;
  }

  .mode-pill{
    min-height:40px;
    padding:0 14px;
    font-size:14px;
  }
}

/* ===== Top bar ===== */
.topbar{
  margin-top:14px;
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.search{
  position:relative;
  flex:0 1 360px;
  min-width:260px;
}

.search input{
  width:100%;
  box-sizing:border-box;
  padding:12px 38px 12px 12px;
  border-radius:5px;
  border:1px solid var(--line);
  background:#fff;
  font-size:16px;
  outline:none;
}

.search input:focus{
  border-color:#cbd5e1;
}

.search .icon{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:18px;
  opacity:.55;
}

.search .icon svg{
  width:18px;
  height:18px;
  stroke:#6b7280;
  stroke-width:2;
  fill:none;
}

.filters{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
  gap:6px;
  align-items:end;
}

.select{
  width:100%;
  height:40px;
  border-radius:5px;
  border:1px solid var(--line);
  background:#fff;
  padding:0 12px;
  font-size:14px;
  outline:none;
  box-sizing:border-box;
}

.sort-chip{
  height:40px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 12px;
  border-radius:5px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  user-select:none;
  font-size:14px;
  font-weight:600;
  white-space:nowrap;
}

.sort-chip .state{
  width:18px;
  text-align:center;
  font-weight:800;
  opacity:.85;
  font-size:16px;
  line-height:1;
}

.sort-chip.disabled{
  opacity:.5;
  cursor:default;
  background:#fff;
}

.sort-chip.disabled:hover{
  background:#fff;
}

.sort-chip.active{
  background:#3b82f6;
  border-color:#3b82f6;
  color:#fff;
}

.sell-btn{
  height:44px;
  padding:0 18px;
  border-radius:5px;
  background:#fff;
  border:1px solid #e5e7eb;
  color:#3b82f6;
  font-weight:700;
  cursor:pointer;
}

.filter-icon{
  width:16px;
  height:16px;
  stroke:currentColor;
  stroke-width:2;
  fill:none;
}

/* ===== Empty state ===== */
.empty-state{
  display:none;
  width:100%;
  max-width:560px;
  margin:40px auto 0;
  padding:0 12px 8px;
  box-sizing:border-box;
  text-align:center;
}

.empty-state.show{
  display:block;
}

.empty-state-inner{
  width:100%;
}

.empty-state-illustration{
  width:min(260px, 72vw);
  margin:0 auto 22px;
  filter:drop-shadow(0 20px 40px rgba(79,125,243,.16));
}

.empty-state-illustration svg{
  display:block;
  width:100%;
  height:auto;
}

.empty-state-title{
  margin:0 0 10px;
  font-size:28px;
  line-height:1.15;
  font-weight:800;
  color:#111827;
}

.empty-state-text{
  margin:0;
  color:#8b95a7;
  font-size:16px;
  line-height:1.5;
  font-weight:400;
}

/* ===== OFFERS ===== */
.offers-list{
  margin-top:20px;
  display:grid;
  gap:16px;
}

.offer-card{
  width:100%;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.offer-image{
  position:relative;
  width:100%;
  aspect-ratio:16 / 9;
  background:#f3f4f6;
  overflow:hidden;
}

@media (max-width:640px){
  .offer-image{
    aspect-ratio:3 / 2;
  }
}

.offer-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block;
}

.offer-image-empty{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  box-sizing:border-box;
  background:#e5e7eb;
  text-align:center;
}

.offer-image-empty-label{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 14px;
  border-radius:999px;
  background:rgba(17,24,39,.08);
  color:#6b7280;
  font-size:14px;
  font-weight:700;
  line-height:1.2;
}

.offer-body{
  padding:10px;
  display:flex;
  flex-direction:column;
  flex:1;
  gap:4px;
}

.offer-title{
  font-size:14px;
  font-weight:700;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.offer-price{
  font-size:18px;
  font-weight:900;
  margin:6px 0 8px;
  letter-spacing:0.2px;
}

.seller-avatar{
  position:relative;
  width:32px;
  height:32px;
  border-radius:50%;
  background:#e5e7eb;
  flex-shrink:0;
}

.seller-avatar img{
  width:100%;
  height:100%;
  border-radius:50%;
  object-fit:cover;
  display:block;
}

.seller-status{
  position:absolute;
  width:14px;
  height:14px;
  border-radius:50%;
  right:-3px;
  bottom:-3px;
  background:#22c55e;
  border:2px solid #fff;
  z-index:3;
}

.seller-name{
  font-size:13px;
  line-height:1.25;
  font-weight:600;
  color:#374151;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:120px;
}

.seller-rating{
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex-wrap:nowrap;
  white-space:nowrap;
  font-size:12px;
  color:#9ca3af;
  cursor:pointer;
}

.seller-rating:hover{
  opacity:.8;
}

.seller-rating .stars{
  flex:0 0 auto;
}

.seller-rating .reviews-count{
  flex:0 0 auto;
  color:#8d8f92;
  font-weight:600;
}

.seller-rating:hover{
  opacity:.8;
}

.no-reviews{
  color:#6b7280;
  font-weight:600;
}

.rating-hidden{
  color:#6b7280;
  font-weight:600;
}

/* stars */
.stars{
  display:inline-flex;
  gap:2px;
  font-size:14px;
  line-height:1;
}

.star{
  color:#9ca3af;
}

.star.filled{
  color:currentColor;
}

.stars.r5{
  color:#facc15;
}

.stars.r4{
  color:#fbbf24;
}

.stars.r3{
  color:#f59e0b;
}

.stars.r2{
  color:#ef4444;
}

.stars.r1{
  color:#991b1b;
}

/* heart */
.offer-heart{
  position:absolute;
  bottom:10px;
  right:10px;
  width:32px;
  height:32px;
  border-radius:50%;
  background:rgba(255,255,255,0.95);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:5;
  border:1px solid #e5e7eb;
}

.offer-heart svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:#6b7280;
  stroke-width:2;
}

.offer-heart.active svg{
  fill:#ef4444;
  stroke:#ef4444;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button{
  -webkit-appearance:none;
  margin:0;
}

input[type="number"]{
  -moz-appearance:textfield;
}

/* ===== RANGE FILTER ===== */
.filter-range{
  display:flex;
  flex-direction:column;
  gap:4px;
  max-width:320px;
}

.filter-range-row{
  display:flex;
  gap:6px;
}

.range-input{
  width:120px;
  flex:0 0 auto;
}

.range-label{
  font-size:12px;
  font-weight:600;
  color:#6b7280;
  margin:0;
  line-height:1.1;
}

#extraFilters{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  width:auto;
}

.offer-seller{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-top:auto;
  padding-right:40px;
}

.offer-seller > div{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
}

/* Beta mode: reviews are hidden, so center seller name with avatar */
.offer-seller--beta{
  align-items:center;
}

.offer-seller--beta .seller-card-meta{
  min-width:0;
  height:32px;
  min-height:32px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:0;
}

.offer-seller--beta .seller-name{
  line-height:1.25;
  padding:1px 0 2px;
}

.offer-seller--beta .seller-rating,
.offer-seller--beta .seller-since{
  display:none !important;
}

/* ===== OFFERS GRID ===== */
.offers-list{
  display:grid;
  gap:16px;
}

@media (max-width:640px){
  .offers-list{
    grid-template-columns:repeat(2, 1fr);
    gap:12px;
  }
}

@media (min-width:641px){
  .offers-list{
    grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
  }
}

.category-offers-actions{
  display:flex;
  justify-content:center;
  margin:18px 0 28px;
}

.category-offers-actions[hidden]{
  display:none !important;
}

.category-show-more{
  min-height:44px;
  padding:0 22px;
  border:1px solid #d6dbea;
  border-radius:14px;
  background:#fff;
  color:#1E50D4;
  font:inherit;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,23,42,.04);
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}

.category-show-more:hover{
  border-color:#b9c5e6;
  background:#f8fbff;
}

.category-show-more:active{
  transform:translateY(1px);
}

html[data-tp-theme="dark"] .category-show-more{
  border-color:rgba(148,163,184,.28);
  background:#111827;
  color:#93c5fd;
  box-shadow:none;
}

html[data-tp-theme="dark"] .category-show-more:hover{
  border-color:rgba(147,197,253,.44);
  background:#162033;
}

@media (max-width:640px){
  .category-offers-actions{
    margin:16px 0 34px;
  }

  .category-show-more{
    width:100%;
    min-height:46px;
  }
}

@media (max-width:640px){
  .offer-title{
    font-size:13px;
  }
}

@media (max-width:640px){
  .seller-since{
    display:none;
  }
}

@media (max-width:640px){
  .breadcrumb{
    padding-left:0;
    margin-top:8px;
    gap:12px;
    align-items:center;
    flex-wrap:nowrap;
  }

  .crumb-icon{
    width:52px;
    height:52px;
    border-radius:14px;
    object-fit:cover;
    display:block;
    flex-shrink:0;
  }

  .crumb-game,
  .crumb-mode{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:100%;
  }

  .crumb-game{
    font-size:18px;
    font-weight:800;
  }

  .crumb-mode{
    font-size:16px;
    font-weight:700;
    opacity:.75;
  }
}

/* ===== MOBILE FILTER STRUCTURE ===== */
.mobile-controls{
  display:flex;
  gap:8px;
  width:100%;
  justify-content:flex-start;
}

.mobile-search-row{
  display:flex;
  gap:8px;
  align-items:center;
}

.filters-panel{
  display:none;
}

@media (min-width:641px){
  .filters-panel{
    display:flex !important;
    gap:10px;
    align-items:center;
    flex-wrap:nowrap;
  }

  .filters-panel select{
    width:auto;
    min-width:160px;
  }
}

@media (min-width:641px){
  #filterToggle{
    display:none;
  }
}

@media (min-width:641px){
  .topbar{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
  }

  .mobile-controls{
    display:flex;
    align-items:center;
    gap:10px;
    width:auto;
  }

  .mobile-search-row{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:10px;
  }

  .mobile-search-row .search{
    min-width:280px;
  }
}

@media (max-width:640px){
  .filters-panel{
    display:none;
    width:100%;
  }

  .filters-panel.show{
    display:flex;
    flex-direction:column;
    gap:12px;
    width:100%;
    align-items:flex-start;
    margin-top:2px;
    margin-bottom:2px;
  }

  .filters-panel select{
    width:100%;
    max-width:100%;
  }

#extraFilters{
  width:100%;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
}

  #extraFilters > *{
    width:100%;
    max-width:100%;
  }

  .filter-range{
    max-width:100%;
  }

  .filter-range-row{
    width:100%;
  }

  .range-input{
    width:100%;
    min-width:0;
    flex:1 1 0;
  }
}

.offers-count{
  font-size:12px;
  color:#9ca3af;
  font-weight:500;
  width:100%;
  margin-top:10px;
}

@media (max-width:640px){
  .topbar{
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  .mobile-controls{
    justify-content:flex-start;
    width:100%;
  }

  .mobile-search-row{
    width:100%;
  }

  .mobile-search-row .search{
    flex:1 1 auto;
    min-width:0;
  }

  .sell-btn{
    flex:0 0 auto;
  }
}

@media (max-width:640px){
  .seller-name{
    max-width:10ch;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
}

@media (max-width:768px){
  :root{
    --tp-header-space:100px;
  }

  .page{
    padding:0 12px calc(185px + env(safe-area-inset-bottom, 0px));
  }
}

.tp-toast{
  position:fixed;
  left:50%;
  top:20px;
  transform:translateX(-50%) translateY(-12px);
  min-width:220px;
  max-width:min(92vw, 420px);
  padding:12px 14px;
  border-radius:12px;
  color:#fff;
  font-size:14px;
  font-weight:600;
  line-height:1.4;
  box-shadow:0 10px 24px rgba(0,0,0,.14);
  opacity:0;
  pointer-events:none;
  z-index:3000;
  transition:opacity .22s ease, transform .22s ease;
  text-align:center;
}

.tp-toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

.tp-toast.success{
  background:#56a356;
}

.tp-toast.error{
  background:#7f1d1d;
}

@media (max-width:640px){
  .offer-body{
    position:relative;
    padding-right:48px;
  }

  .offer-heart{
    position:absolute;
    top:10px;
    right:10px;
    bottom:auto;
    left:auto;
    width:32px;
    height:32px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(
      180deg,
      rgba(255,255,255,.72) 0%,
      rgba(255,255,255,.48) 100%
    );
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    border:1px solid rgba(255,255,255,.75);
    box-shadow:
      0 6px 18px rgba(15,23,42,.10),
      inset 0 1px 0 rgba(255,255,255,.65);
  }

  .offer-heart svg{
    width:17px;
    height:17px;
  }

  .offer-seller{
    padding-right:0;
  }

  .offer-seller > div{
    min-width:0;
  }

  .empty-state{
    margin:28px auto 0;
    padding:0 8px 8px;
  }

  .empty-state-illustration{
    width:min(220px, 70vw);
    margin:0 auto 18px;
  }

  .empty-state-title{
    font-size:24px;
  }

  .empty-state-text{
    font-size:15px;
  }
}

@media (max-width:640px){
  .offer-image-empty-label{
    font-size:13px;
    padding:0 12px;
  }
}
/* ===== FINAL FIX: no-photo label has no chip in dark theme ===== */
html[data-tp-theme="dark"] .offer-image-empty-label{
  display:inline !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  color:var(--tp-dark-muted, #aeb8ca) !important;
}

/* ===== FINAL NO-PHOTO CHIP REMOVAL ===== */
html[data-tp-theme="dark"] body :is(.tp-no-photo__label,.offer-image-empty-label){
  display:inline !important;
  min-width:0 !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  color:#aeb8ca !important;
}

.empty-state-cta{
  margin-top:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 18px;
  border:0;
  border-radius:999px;
  background:#2563eb;
  color:#fff;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 14px 30px rgba(37,99,235,.22);
}

.empty-state-cta:hover{
  background:#1d4ed8;
}

html[data-tp-theme="dark"] .empty-state-cta{
  background:#3b82f6;
  color:#fff;
  box-shadow:0 16px 34px rgba(37,99,235,.28);
}

html[data-tp-theme="dark"] .empty-state-cta:hover{
  background:#2563eb;
}

/* ===== v28.29: category offer-card seller row final alignment =====
   index.html and category.html load category.css, not offer-card.css.
   Keep compact/no-review seller nicknames visually centered with the avatar here. */

.offers-list .offer-card .offer-filter-meta{
  display:none !important;
}

.offers-list .offer-card .offer-seller--compact{
  display:flex !important;
  align-items:center !important;
  gap:9px !important;
  min-height:36px !important;
}

.offers-list .offer-card .offer-seller--compact .seller-avatar{
  align-self:center !important;
  width:32px !important;
  height:32px !important;
  flex:0 0 32px !important;
}

.offers-list .offer-card .offer-seller--compact .seller-card-meta{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  height:32px !important;
  min-height:32px !important;
  min-width:0 !important;
  flex:1 1 auto !important;
  gap:0 !important;
  padding:0 !important;
  margin:0 !important;
  transform:translateY(0px) !important;
  overflow:hidden !important;
}

.offers-list .offer-card .offer-seller--compact .seller-name{
  display:block !important;
  position:static !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
  transform:none !important;
  min-height:0 !important;
  height:auto !important;
  line-height:1.2 !important;
  padding:0 !important;
  margin:0 !important;
  max-width:100% !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.offers-list .offer-card .offer-seller--compact .seller-rating,
.offers-list .offer-card .offer-seller--compact .seller-since,
.offers-list .offer-card .offer-seller--compact .rating-hidden{
  display:none !important;
}

@media (max-width:640px){
  .offers-list .offer-card .seller-name{
    max-width:118px;
  }
}


/* ===== Offer SVG status badges ===== */
.offer-card-badges{
  position:absolute;
  top:9px;
  left:9px;
  z-index:6;
  display:flex;
  align-items:center;
  gap:6px;
  pointer-events:none;
}

.offer-card-badge{
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.92);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 8px 20px rgba(15,23,42,.16);
  backdrop-filter:blur(7px);
}

.offer-card-badge svg{
  width:16px;
  height:16px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.offer-card-badge--featured{
  color:#f59e0b;
}

.offer-card-badge--featured svg{
  fill:currentColor;
  stroke:none;
}

.offer-card-badge--safe{
  color:#1E50D4;
}

html[data-tp-theme="dark"] .offer-card-badge{
  background:rgba(17,24,39,.82);
  border-color:rgba(148,163,184,.24);
  box-shadow:0 8px 22px rgba(0,0,0,.36);
}

html[data-tp-theme="dark"] .offer-card-badge--safe{
  color:#8fb3ff;
}

@media (max-width:640px){
  .offer-card-badges{
    top:8px;
    left:8px;
    gap:5px;
  }

  .offer-card-badge{
    width:26px;
    height:26px;
  }

  .offer-card-badge svg{
    width:15px;
    height:15px;
  }
}
