/* Public site chrome — advertise.ru style (light page, black header/footer, lime accents) */

:root {
  --adv-bg: #f4f4f4;
  --adv-card: #ffffff;
  --adv-ink: #1a1a1a;
  --adv-muted: #888888;
  --adv-line: #e6e6e6;
  --adv-lime: #d4f828;
  --adv-yellow: #f5c518;
  --adv-black: #0b0b0b;
  --adv-header: #000000;
  --adv-link-hover: #000;
  --adv-game-title: #7a9a00;
  --adv-ph: #eee;
  --adv-shadow: 0 1px 3px rgba(0,0,0,0.06);
  --adv-scroll-track: transparent;
  --adv-scroll-thumb: #c8c8c8;
  --adv-scroll-thumb-hover: #a8a8a8;
  --adv-bg-gradient: linear-gradient(225deg, #bdbdbd 0%, #e4e4e4 45%, #ffffff 100%);
}

html[data-theme="dark"] {
  --adv-bg: #121212;
  --adv-card: #1c1c1c;
  --adv-ink: #e8e8e8;
  --adv-muted: #9a9a9a;
  --adv-line: #2e2e2e;
  --adv-lime: #d4f828;
  --adv-yellow: #f5c518;
  --adv-black: #050505;
  --adv-header: #000000;
  --adv-link-hover: #fff;
  --adv-game-title: #c8e82a;
  --adv-ph: #2a2a2a;
  --adv-shadow: 0 1px 3px rgba(0,0,0,0.35);
  --adv-scroll-track: transparent;
  --adv-scroll-thumb: #3a3a3a;
  --adv-scroll-thumb-hover: #d4f828;
  --adv-bg-gradient: linear-gradient(225deg, #000000 0%, #1c1c1c 45%, #3a3a3a 100%);
}

* { box-sizing: border-box; }

/* Thin modern scrollbars (Firefox + Chromium/WebKit) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--adv-scroll-thumb) var(--adv-scroll-track);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--adv-scroll-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--adv-scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--adv-scroll-thumb-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.messages-conv-list,
.messages-thread-body,
.cabinet-drawer {
  scrollbar-gutter: stable;
}

html {
  font-size: 15px;
  background-color: var(--adv-bg);
  background-image: var(--adv-bg-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body.site-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, "Segoe UI", sans-serif;
  color: var(--adv-ink);
  background: transparent;
}

a { color: var(--adv-ink); }
a:hover { color: var(--adv-link-hover); }

.adv-wrap {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

/* ===== Header ===== */
.adv-header {
  background: var(--adv-header);
  min-height: 70px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.adv-header-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 1.25rem;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

.adv-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
  justify-content: flex-start;
}

.adv-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
  justify-content: flex-end;
}

.adv-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
}

.adv-logo span {
  display: inline-block;
  padding: 0.45rem 0.85rem 0.4rem;
  background: var(--adv-lime);
  color: #000;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transform: skewX(-8deg);
  border-radius: 2px 12px 2px 10px;
}

.adv-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.adv-nav a {
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.adv-nav a:hover {
  color: #fff;
  border-bottom-color: rgba(212, 248, 40, 0.5);
}

.adv-nav a.is-active {
  border-bottom-color: var(--adv-lime);
}

.adv-nav-sell {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem !important;
  background: #2f9e44;
  color: #fff !important;
  border: 1px solid #2f9e44;
  border-radius: 3px;
  border-bottom: 1px solid #2f9e44 !important;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  white-space: nowrap;
  line-height: 1.2;
}

.adv-nav-sell:hover {
  background: #278a3a;
  border-color: #278a3a !important;
  color: #fff !important;
}

.adv-lang {
  position: relative;
  flex-shrink: 0;
}

.adv-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.45rem 0.3rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 1px solid #abacac;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.adv-lang-btn:hover,
.adv-lang-btn:focus-visible,
.adv-lang.is-open .adv-lang-btn {
  border-color: var(--adv-lime);
  outline: none;
}

.adv-lang-flag {
  display: block;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.adv-lang-code {
  text-transform: none;
  letter-spacing: 0.02em;
}

.adv-lang-caret {
  width: 10px;
  height: 7px;
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.adv-lang.is-open .adv-lang-caret {
  transform: rotate(180deg);
}

.adv-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1200;
  min-width: 100%;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: #151515;
  border: 1px solid #abacac;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.adv-lang-menu[hidden] {
  display: none;
}

.adv-lang-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.adv-lang-option:hover {
  background: rgba(212, 248, 40, 0.12);
  color: #fff;
}

.adv-lang-menu li.is-active .adv-lang-option {
  background: rgba(212, 248, 40, 0.18);
  color: var(--adv-lime);
}

.adv-user-name {
  color: #ddd;
  font-size: 0.85rem;
  font-weight: 600;
}

.adv-mail {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  color: #fff;
  text-decoration: none;
  border: 0;
  background: transparent;
  flex-shrink: 0;
}

.adv-mail:hover {
  color: #fff;
}

.adv-mail-icon {
  width: 1.55rem;
  height: 1.55rem;
}

.adv-mail-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 2px #000;
  pointer-events: none;
}

.fgb-newmsg {
  position: fixed;
  left: 12px;
  top: calc(var(--adv-header-h, 70px) + 14px);
  z-index: 1400;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem 0.65rem 0.7rem;
  background: var(--adv-card);
  color: var(--adv-ink);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--adv-line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  font-weight: 700;
  font-size: 0.88rem;
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.fgb-newmsg:hover {
  color: var(--adv-ink);
  border-color: var(--adv-lime);
}

.fgb-newmsg.is-show {
  transform: translateX(0);
  opacity: 1;
}

.fgb-newmsg.is-hide {
  transform: translateX(-120%);
  opacity: 0;
}

.fgb-newmsg-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--adv-lime);
  color: #111;
  flex-shrink: 0;
}

.fgb-newmsg-ico svg {
  width: 1.05rem;
  height: 1.05rem;
}

.fgb-newmsg-label {
  white-space: nowrap;
}

.adv-cabinet-trigger {
  position: relative;
  display: inline-flex;
  padding: 0;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.adv-cabinet-trigger:hover,
.adv-cabinet-trigger[aria-expanded="true"] {
  border-color: var(--adv-lime);
}

.adv-cabinet-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--adv-ph);
}

.adv-cabinet-dot {
  top: -1px;
  right: -1px;
  box-shadow: 0 0 0 2px #000;
}

.adv-cabinet-balance {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 3.5rem;
}

.adv-cabinet-login {
  color: #ddd;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.adv-cabinet-money {
  color: var(--adv-lime);
  font-size: 0.88rem;
  font-weight: 800;
}

.adv-auth-link {
  color: var(--adv-lime) !important;
  text-decoration: none !important;
  font-size: 0.85rem;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.adv-auth-link:hover {
  color: #fff !important;
}

/* ===== Main ===== */
.adv-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
  overflow: visible;
}

.home-intro {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.35rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--adv-shadow);
}

.home-intro h1 {
  margin: 0 0 0.45rem;
  font-size: 1.45rem;
  font-weight: 700;
}

.home-intro p {
  margin: 0;
  color: var(--adv-ink);
  line-height: 1.55;
  max-width: 48rem;
}

.home-intro a {
  color: var(--adv-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.home-intro a:hover {
  color: var(--adv-link-hover);
}

.home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--adv-line);
  color: var(--adv-muted);
  font-size: 0.88rem;
}

.home-meta b { color: var(--adv-ink); }

.home-region {
  margin-left: auto;
  background: var(--adv-lime);
  color: #000;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
}

.home-games h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.game-list-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--adv-card);
  border-radius: 4px;
  padding: 0.9rem;
  box-shadow: var(--adv-shadow);
}

.game-list-item img,
.game-list-ph {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--adv-ph);
  flex-shrink: 0;
}

.game-list-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--adv-game-title);
}

.game-list-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
}

.game-list-types a {
  color: var(--adv-ink);
  font-size: 0.86rem;
  text-decoration: none;
  font-weight: 500;
}

.home-advantages {
  margin: 2rem 0 0.5rem;
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.5rem 1.25rem 0.5rem;
  box-shadow: var(--adv-shadow);
}

.home-advantages > h2 {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.advantages-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.advantage-item {
  text-align: center;
  padding: 1.75rem 0.75rem;
}

.advantage-img {
  margin-bottom: 0.65rem;
}

.advantage-img img {
  width: 96px;
  height: auto;
  display: inline-block;
}

.advantage-title {
  margin: 0 0 0.55rem;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 700;
  color: #aad505;
  line-height: 1.2;
}

.advantage-text {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--adv-ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

@media (max-width: 800px) {
  .advantages-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .advantage-item {
    padding: 1.25rem 0.5rem;
  }
}

.game-list-types a:hover {
  color: var(--adv-link-hover);
  text-decoration: underline;
}

/* ===== Footer ===== */
.adv-footer {
  position: relative;
  background: var(--adv-black);
  color: #fff;
  padding: 2.5rem 0 1.25rem;
  overflow: hidden;
}

.adv-footer-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image:
    radial-gradient(circle at 10px 10px, #fff 1px, transparent 1.5px),
    radial-gradient(circle at 40px 30px, #fff 1px, transparent 1.5px);
  background-size: 60px 50px;
  pointer-events: none;
}

.adv-footer-inner {
  position: relative;
  z-index: 1;
}

.adv-footer-logo {
  margin-bottom: 1.5rem;
}

.adv-footer-logo span {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--adv-lime);
  color: #000;
  font-weight: 800;
  text-transform: uppercase;
  transform: skewX(-8deg);
  border-radius: 2px 12px 2px 10px;
}

.adv-footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.adv-footer-cols h4 {
  margin: 0 0 0.75rem;
  color: var(--adv-lime);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.adv-footer-cols a,
.adv-footer-cols span,
.adv-footer-cols p {
  display: block;
  color: #ddd;
  font-size: 0.88rem;
  margin: 0 0 0.4rem;
  text-decoration: none;
  line-height: 1.4;
}

.adv-footer-cols a:hover {
  color: #fff;
}

.adv-footer-social-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.adv-footer-social-icons a {
  display: inline-flex;
  line-height: 0;
  opacity: 0.92;
}

.adv-footer-social-icons a:hover {
  opacity: 1;
}

.adv-footer-social-icons img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.adv-footer-contacts p {
  color: #aaa;
  max-width: 16rem;
}

.adv-footer-copy {
  padding-top: 1rem;
  color: #777;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.footer-li-counter {
  display: inline-flex;
  line-height: 0;
}

/* Legal / static info pages */
.legal-page {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.35rem 1.5rem 1.75rem;
  box-shadow: var(--adv-shadow);
  max-width: 52rem;
  margin: 0 auto;
}

.legal-page h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.25;
}

.legal-page h2 {
  margin: 1.35rem 0 0.55rem;
  font-size: 1.1rem;
}

.legal-body {
  color: var(--adv-ink);
  line-height: 1.6;
  font-size: 0.95rem;
}

.legal-body p { margin: 0 0 0.75rem; }

.legal-body ul,
.legal-body ol {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}

.legal-body li { margin-bottom: 0.45rem; }

.legal-body a {
  color: var(--adv-lime);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.legal-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.75rem auto 1rem;
  border-radius: 4px;
}

.legal-garant-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 1.1rem 0 1.4rem;
}

.legal-garant-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--adv-line);
  border-radius: 6px;
  text-decoration: none !important;
  color: var(--adv-ink) !important;
  min-width: 8.5rem;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.legal-garant-card:hover {
  background: var(--adv-ph);
  box-shadow: var(--adv-shadow);
}

.legal-garant-card span {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--adv-ink);
}


/* Auth / catalog on public layout */
.auth-page {
  max-width: 420px;
  margin: 0 auto;
  background: var(--adv-card);
  padding: 1.5rem;
  border-radius: 4px;
  box-shadow: var(--adv-shadow);
}

.auth-page h1 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.auth-form .auth-field { margin-bottom: 0.85rem; }
.auth-form label { display: block; margin-bottom: 0.25rem; font-weight: 700; }
.auth-actions { margin-top: 1rem; }
.auth-submit { width: 100%; }
.auth-switch { margin-top: 1rem; text-align: center; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0;
  color: var(--adv-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--adv-line);
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--adv-line);
  border-radius: 4px;
  background: var(--adv-card);
  color: var(--adv-ink) !important;
  text-decoration: none !important;
  font-weight: 700;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.auth-google-btn:hover {
  background: var(--adv-ph);
  box-shadow: var(--adv-shadow);
}

.auth-error {
  color: #b00020;
  margin-bottom: 0.75rem;
}

.btn-primary,
.auth-submit {
  background: var(--adv-yellow) !important;
  border-color: var(--adv-yellow) !important;
  color: #000 !important;
  font-weight: 700;
}

.catalog-type-logo img {
  max-width: 100%;
  border-radius: 4px;
}

.catalog-type .breadcrumb-line a { color: var(--adv-muted); }
.catalog-type .breadcrumb-line a:hover { color: var(--adv-link-hover); }
.catalog-type .text-muted { color: var(--adv-muted) !important; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  color: #ddd;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--adv-lime);
  color: var(--adv-lime);
}

.theme-toggle-icon {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
}

.theme-toggle .theme-icon-moon { display: none; }
.theme-toggle.is-dark .theme-icon-sun { display: none; }
.theme-toggle.is-dark .theme-icon-moon { display: block; }

@media (max-width: 900px) {
  .adv-header-inner {
    flex-wrap: wrap;
    padding: 0.65rem 0;
    gap: 0.65rem;
  }

  .adv-header-left {
    width: 100%;
    justify-content: space-between;
  }

  .adv-header-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .adv-nav {
    gap: 0.75rem 1rem;
  }

  .adv-user-name { display: none; }

  .adv-footer-cols {
    grid-template-columns: 1fr 1fr;
  }

  .home-region { margin-left: 0; }
}

@media (max-width: 560px) {
  .adv-footer-cols { grid-template-columns: 1fr; }
}

/* ===== Catalog item-type page (legacy GameLot structure, new chrome) ===== */
.catalog-page { display: flex; flex-direction: column; gap: 1rem; }

.catalog-hero {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--adv-shadow);
  position: relative;
  overflow: hidden;
}

/*
  Big type logo (legacy .big-img):
  - flush to viewport left + top (part hides behind header)
  - lots card starts ~30vh from top and covers lower part of logo
*/
.catalog-page.has-big-logo {
  --catalog-header-h: var(--adv-header-h, 70px);
  position: relative;
  gap: 0;
  overflow: visible;
  isolation: isolate;
  /* pull page to window top (under header); hero itself reserves logo space */
  margin-top: calc(-1.5rem - var(--catalog-header-h));
  padding-top: var(--catalog-header-h);
}

.catalog-big-logo {
  position: absolute;
  z-index: 0;
  width: min(900px, 95vw);
  /* page top == viewport top → logo flush to window top */
  top: 0;
  left: calc(50% - 50vw);
  border-radius: 0 300px;
  overflow: hidden;
  pointer-events: none;
}

.catalog-big-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.catalog-hero.has-big-logo {
  position: relative;
  z-index: 3;
  overflow: visible;
  margin: 0;
  /* keep room for big logo when lead text is short */
  min-height: max(0px, calc(30vh - var(--catalog-header-h)));
  padding: 1.35rem 0 1.5rem;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  pointer-events: none;
}

.catalog-hero.has-big-logo .catalog-hero-main {
  position: relative;
  margin-left: min(520px, 48%);
  min-height: 0;
  pointer-events: auto;
}

.catalog-hero.has-big-logo .catalog-hero-text {
  text-align: right;
}

.catalog-hero.has-big-logo .catalog-hero-text p {
  margin-left: auto;
  max-width: 34rem;
}

.catalog-hero.has-big-logo .catalog-actions {
  position: relative;
  margin-left: min(520px, 48%);
  margin-top: 0.85rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  justify-content: flex-end;
  pointer-events: auto;
}

/* White lots card overlaps bottom of logo (legacy) */
.catalog-page.has-big-logo .catalog-after-hero {
  position: relative;
  z-index: 2;
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1rem 1.25rem 1.35rem;
  box-shadow: var(--adv-shadow);
  margin-top: 0.35rem;
}

.catalog-hero-main {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
}

.catalog-hero-icon {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  margin: 0.15rem 0.35rem 0.5rem 0;
}

.catalog-hero-text {
  flex: 1;
  min-width: 0;
}

.catalog-hero-text h1 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.catalog-hero-text p {
  margin: 0;
  color: var(--adv-ink);
  line-height: 1.5;
  max-width: 52rem;
  text-align: justify;
}

.catalog-hero-text p a {
  color: var(--adv-lime);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.catalog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--adv-line);
  justify-content: flex-end;
}

.catalog-action {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  background: var(--adv-bg);
  color: var(--adv-ink) !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 3px;
  border: 1px solid var(--adv-line);
}

.catalog-action.is-active {
  background: var(--adv-lime);
  color: #000 !important;
  border-color: var(--adv-lime);
}

.catalog-action-sell {
  background: #2f9e44;
  color: #fff !important;
  border-color: #2f9e44;
  opacity: 1;
  cursor: pointer;
}

.catalog-breadcrumb {
  font-size: 0.88rem;
  color: var(--adv-muted);
}

.catalog-breadcrumb a {
  color: var(--adv-muted);
  text-decoration: none;
}

.catalog-breadcrumb a:hover { color: var(--adv-link-hover); }
.catalog-bc-sep { margin: 0 0.35rem; opacity: 0.6; }

.catalog-lots-meta {
  color: var(--adv-muted);
  font-size: 0.9rem;
}

.catalog-lots-meta b { color: var(--adv-ink); }
.catalog-empty { color: var(--adv-muted); }

.lot-list { display: flex; flex-direction: column; gap: 0.75rem; }

.lot-card {
  display: grid;
  grid-template-columns: 92px max-content minmax(0, 1fr);
  gap: 0.9rem;
  background: var(--adv-card);
  border-radius: 4px;
  padding: 0.9rem;
  box-shadow: var(--adv-shadow);
  border: 1px solid transparent;
  position: relative;
}

.lot-card.is-top {
  border-color: rgba(212, 248, 40, 0.45);
  background: color-mix(in srgb, var(--adv-card) 92%, var(--adv-lime));
}

.lot-card.is-sold { opacity: 0.72; }

.lot-card.is-deleted {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.35);
}

.lot-seller {
  text-align: center;
  font-size: 0.78rem;
}

.lot-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 0.35rem;
}

.lot-avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--adv-ph);
}

.lot-online {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f9e44;
  border: 1px solid #fff;
  z-index: 1;
}

.lot-banned {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
}

.lot-seller-name {
  font-weight: 700;
  color: var(--adv-ink);
  word-break: break-word;
}

.lot-seller-rating {
  color: var(--adv-muted);
  margin-top: 0.15rem;
}

.lot-reviews {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
}

.lot-reviews span {
  padding: 0.05rem 0.28rem;
  border-radius: 2px;
}

.rev-good { background: #178203; }
.rev-mid { background: #d7b700; }
.rev-bad { background: #d70000; }

.lot-media {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  height: 7rem;
  max-width: 100%;
}

.lot-params {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  gap: 0;
  flex: 0 0 auto;
  min-width: 3.25rem;
  max-width: 5.5rem;
  margin: 0;
  padding: 0.1rem 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--adv-ink);
  line-height: 1.2;
}

.lot-params span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.lot-params img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.lot-thumb-link {
  flex: 0 0 auto;
  display: block;
  color: inherit;
  text-decoration: none;
  height: 7rem;
}

.lot-thumb {
  position: relative;
  height: 7rem;
  width: 14rem;
  max-width: min(14rem, 42vw);
  background: var(--adv-ph);
  border-radius: 4px;
  overflow: hidden;
}

.lot-desc {
  margin: 0.4rem 0 0;
  color: var(--adv-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.lot-thumb > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lot-price {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  background: var(--adv-yellow);
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
}

.lot-date {
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
}

.lot-platform {
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
  width: 22px;
  height: 22px;
}

.lot-body { min-width: 0; }

.lot-title {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--adv-ink);
}

.lot-title img { flex-shrink: 0; margin-top: 0.15rem; }
.lot-vip { height: 16px; width: auto; }

.lot-title .lot-card-link {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.lot-views {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--adv-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding-top: 0.15rem;
  line-height: 1;
}

.lot-views-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  flex-shrink: 0;
  opacity: 0.9;
}

.lot-views-count {
  line-height: 1;
}

.lot-page-meta .lot-views {
  margin-left: 0;
  padding-top: 0;
  font-size: inherit;
  font-weight: 600;
}

.lot-page-meta .lot-views-icon {
  width: 1rem;
  height: 1rem;
}

.lot-server {
  margin: 0 0 0.25rem;
  color: var(--adv-muted);
  font-size: 0.86rem;
}

.lot-seller-link {
  display: block;
  color: inherit;
  text-decoration: none !important;
}

.lot-seller-link:hover .lot-seller-name {
  color: var(--adv-link-hover);
}

.lot-server { font-weight: 700; color: var(--adv-ink); }

.lot-sold-badge {
  display: inline-block;
  margin-top: 0.5rem;
  background: #d70000;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
}

.catalog-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  padding: 0.5rem 0 0.25rem;
}

.catalog-pager a {
  min-width: 2rem;
  text-align: center;
  padding: 0.35rem 0.55rem;
  background: var(--adv-card);
  border: 1px solid var(--adv-line);
  border-radius: 3px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--adv-ink);
}

.catalog-pager a.is-active,
.catalog-pager a:hover {
  background: var(--adv-lime);
  border-color: var(--adv-lime);
  color: #000;
}

.catalog-extra,
.catalog-safety {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--adv-shadow);
}

.catalog-extra h2,
.catalog-safety h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.catalog-extra-body {
  color: var(--adv-muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.catalog-extra-body h2,
.catalog-extra-body h3 {
  color: var(--adv-ink);
  font-size: 1rem;
  margin: 1rem 0 0.4rem;
}

.catalog-extra-body ul,
.catalog-extra-body ol {
  padding-left: 1.2rem;
}

.catalog-safety ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--adv-muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.catalog-safety li { margin-bottom: 0.35rem; }

@media (max-width: 900px) {
  .lot-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "body body"
      "media seller";
    align-items: start;
  }
  .lot-seller {
    grid-area: seller;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.2rem;
    text-align: center;
    align-self: center;
    padding-left: 0.25rem;
  }
  .lot-media { grid-area: media; }
  .lot-body { grid-area: body; }
  .lot-avatar-wrap { margin: 0 auto 0.15rem; }
  .lot-seller-name {
    word-break: normal;
    overflow-wrap: anywhere;
    max-width: 5.5rem;
  }
  .lot-reviews { justify-content: center; }

  /*
    Mobile: stack like pages without big logo
    (banner → hero card → lots). Desktop keeps under-header logo.
  */
  .catalog-page.has-big-logo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0;
    padding-top: 0;
  }

  .catalog-big-logo {
    position: relative;
    z-index: auto;
    width: 100%;
    left: 0;
    top: 0;
    border-radius: 4px;
    max-height: 200px;
    order: -1;
    pointer-events: auto;
  }

  .catalog-big-logo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center top;
  }

  .catalog-hero.has-big-logo {
    position: relative;
    overflow: visible;
    min-height: 0;
    padding: 1.25rem 1.35rem;
    background: var(--adv-card);
    box-shadow: var(--adv-shadow);
  }

  .catalog-hero.has-big-logo .catalog-hero-main,
  .catalog-hero.has-big-logo .catalog-actions {
    margin-left: 0;
  }

  .catalog-hero.has-big-logo .catalog-actions {
    margin-top: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid var(--adv-line);
    justify-content: flex-end;
  }

  .catalog-hero.has-big-logo .catalog-hero-text {
    text-align: left;
  }

  .catalog-hero.has-big-logo .catalog-hero-text p {
    margin-left: 0;
    max-width: none;
  }

  .catalog-page.has-big-logo .catalog-after-hero {
    margin-top: 0;
    padding: 1rem 1.25rem;
  }

  .catalog-hero-main { flex-direction: column; }
  .catalog-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .lot-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* ===== Lot detail page ===== */
.lot-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lot-page-header {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--adv-shadow);
}

.lot-page-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  color: var(--adv-ink);
  font-weight: 800;
}

.lot-page-title-meta {
  font-weight: 600;
  color: var(--adv-muted);
  font-size: 0.82em;
}

.lot-page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  color: var(--adv-muted);
  font-size: 0.9rem;
}

.lot-page-views {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lot-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.lot-page-main,
.lot-page-side {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--adv-shadow);
}

.lot-edit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.lot-edit-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  background: var(--adv-accent, #b8e000);
  color: #111;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.lot-edit-link:hover {
  filter: brightness(1.05);
  color: #111;
}

.lot-delete-form {
  margin: 0;
  display: inline-flex;
}

.lot-delete-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border: 0;
  border-radius: 4px;
  background: #e53935;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.lot-delete-link:hover {
  background: #c62828;
}

.lot-admin-delete {
  display: inline-flex;
  align-items: center;
  margin-top: 0.55rem;
  padding: 0.28rem 0.7rem;
  border: 0;
  border-radius: 4px;
  background: #e53935;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.lot-admin-delete:hover {
  background: #c62828;
}

.lot-admin-delete:disabled {
  opacity: 0.6;
  cursor: wait;
}

.lot-flash {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--adv-accent, #b8e000) 22%, transparent);
  color: var(--adv-ink);
  font-weight: 600;
  font-size: 0.92rem;
}

.lot-page-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.lot-gallery-item {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
}

.lot-gallery-item.is-placeholder {
  cursor: default;
  background: color-mix(in srgb, var(--adv-muted) 12%, transparent);
}

.lot-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lot-about {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--adv-muted) 35%, transparent);
}

.lot-about-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 7rem;
}

.lot-about-label {
  font-size: 0.8rem;
  color: var(--adv-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lot-about-row b a {
  color: var(--adv-game-title);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.lot-about-row b a:hover {
  color: var(--adv-lime);
  text-decoration: underline;
}

.lot-about-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lot-desc-block h2,
.lot-chat-cta h2,
.lot-reviews-section h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  color: var(--adv-ink);
}

.lot-desc-body {
  color: var(--adv-ink);
  line-height: 1.55;
  font-size: 0.95rem;
  word-break: break-word;
}

.lot-desc-body p { margin: 0 0 0.65rem; }

.lot-params-full {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--adv-muted) 8%, transparent);
  border-radius: 4px;
}

.lot-params-full li {
  margin: 0.25rem 0;
  font-size: 0.92rem;
  color: var(--adv-ink);
}

.lot-seller-card {
  text-align: center;
}

.lot-seller-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.lot-seller-card-link:hover .lot-seller-card-name {
  color: var(--adv-link-hover);
}

.lot-seller-card-ava {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.55rem;
}

.lot-seller-card-ava .lot-avatar {
  width: 88px;
  height: 88px;
}

.lot-seller-card-name {
  font-weight: 800;
  color: var(--adv-ink);
  font-size: 1.05rem;
}

.lot-seller-card-login {
  color: var(--adv-muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.lot-seller-presence {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.lot-seller-presence.is-online { color: #189700; }
.lot-seller-presence.is-offline { color: #b00303; }

.lot-chat-cta {
  padding-top: 0.35rem;
  border-top: 1px dashed color-mix(in srgb, var(--adv-muted) 35%, transparent);
}

.lot-chat-note {
  margin: 0.35rem 0 0.65rem;
  color: var(--adv-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.lot-deal-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lot-deal-benefits li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--adv-muted);
}

.lot-deal-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #189700;
  font-weight: 800;
}

.lot-buy-block {
  text-align: center;
  padding-top: 0.35rem;
  border-top: 1px dashed color-mix(in srgb, var(--adv-muted) 35%, transparent);
}

.lot-buy-price {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--adv-ink);
  margin-bottom: 0.35rem;
}

.lot-deal-how {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--adv-ink);
  font-size: 0.95rem;
}

.lot-deal-how:hover { color: var(--adv-link-hover); }

.lot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.lot-btn-message {
  background: color-mix(in srgb, var(--adv-ink) 10%, transparent);
  color: var(--adv-ink);
}

.lot-btn-message:hover {
  background: color-mix(in srgb, var(--adv-ink) 16%, transparent);
  color: var(--adv-ink);
}

.lot-btn-buy {
  background: #2fbf71;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lot-btn-buy:hover {
  background: #28a862;
  color: #fff;
}

.lot-btn-buy:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.lot-btn-wait {
  background: #f6d72d;
  color: #2c1a47;
  cursor: not-allowed;
}

.lot-sold-badge-lg {
  display: inline-block;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
}

.lot-reviews-section {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--adv-shadow);
}

.lot-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lot-review {
  padding: 0.75rem 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--adv-muted) 30%, transparent);
}

.lot-review:last-child { border-bottom: 0; }

.lot-review-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.lot-review-ava {
  border-radius: 50%;
  object-fit: cover;
}

.lot-review-author {
  font-weight: 700;
  color: var(--adv-ink);
  font-size: 0.92rem;
}

.lot-review-date {
  font-size: 0.78rem;
  color: var(--adv-muted);
}

.lot-review-game {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--adv-muted);
}

.lot-review-text {
  margin: 0;
  color: var(--adv-ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.lot-review.is-good .lot-review-author::after { content: " ▲"; color: #178203; }
.lot-review.is-bad .lot-review-author::after { content: " ▼"; color: #d70000; }
.lot-review.is-mid .lot-review-author::after { content: " ●"; color: #d7b700; font-size: 0.7em; }

.lot-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(96vw, 1100px);
}

.lot-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.lot-lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 88vh;
  margin: 0 auto;
  border-radius: 4px;
}

.lot-lightbox-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lot-card-link {
  color: inherit;
  text-decoration: none;
}

.lot-card-link:hover .lot-title span:first-of-type,
.lot-title a:hover {
  color: var(--adv-link-hover);
}

@media (max-width: 960px) {
  .lot-page-grid {
    grid-template-columns: 1fr;
  }

  .lot-page-side {
    order: -1;
  }
}

@media (max-width: 560px) {
  .lot-gallery {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== User profile ===== */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-card {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.25rem;
  align-items: start;
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--adv-shadow);
}

.profile-card.is-banned {
  opacity: 0.85;
}

.profile-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--adv-ph);
  display: block;
}

.profile-name {
  margin: 0 0 0.2rem;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.profile-login {
  margin: 0 0 1rem;
  color: var(--adv-muted);
  font-size: 0.92rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.profile-stat-label {
  color: var(--adv-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-stat-value {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--adv-ink);
}

.profile-stat-value.is-online { color: #2f9e44; }
.profile-stat-value.is-offline { color: var(--adv-muted); }

.profile-reviews {
  justify-content: flex-start;
  margin-top: 0.85rem;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.profile-message-btn {
  white-space: nowrap;
  cursor: pointer;
}

.profile-lots-block {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1rem 1.25rem 1.35rem;
  box-shadow: var(--adv-shadow);
}

.profile-lot-card {
  grid-template-columns: 1fr;
}

.profile-lot-card.is-text-only {
  padding: 0.85rem 1rem;
}

.profile-lot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.profile-lot-game {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--adv-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.profile-lot-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--adv-ink);
  white-space: nowrap;
}

.profile-lot-desc-link {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
}

.profile-lot-desc-link:hover {
  color: var(--adv-ink) !important;
}

.profile-lot-date {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--adv-muted);
}

.cabinet-lots-page .cabinet-section-actions {
  margin-top: 0.85rem;
}

.cabinet-lot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin-top: 0.45rem;
}

.cabinet-lot-meta .profile-lot-date {
  margin-top: 0;
}

.cabinet-lot-meta .lot-sold-badge {
  margin-top: 0;
}

.cabinet-lot-waiting {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: color-mix(in srgb, #d7b700 28%, transparent);
  color: var(--adv-ink);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cabinet-lot-edit {
  color: var(--adv-lime);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.cabinet-lot-edit:hover {
  text-decoration: underline;
}

.cabinet-lot-delete-form {
  display: inline-flex;
  margin: 0;
}

.cabinet-lot-delete {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 0;
  border-radius: 4px;
  background: #e53935;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.cabinet-lot-delete:hover {
  background: #c62828;
}

.sell-delete-bar {
  margin-top: 1rem;
  max-width: 52rem;
}

@media (max-width: 900px) {
  .profile-card {
    grid-template-columns: 96px 1fr;
  }

  .profile-avatar-wrap,
  .profile-avatar {
    width: 88px;
    height: 88px;
  }

  .profile-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
  }

  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }

  .profile-lot-card {
    grid-template-columns: 1fr;
  }
}

/* ===== Cabinet drawer + pages ===== */
.cabinet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.45);
}

.cabinet-drawer {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  z-index: 60;
  width: min(320px, 92vw);
  height: 100vh;
  overflow-y: auto;
  background: var(--adv-bg);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.2);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  padding: 0.85rem 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

body.cabinet-open .cabinet-drawer {
  transform: translateX(0);
}

.cabinet-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.cabinet-drawer-head strong {
  font-size: 0.95rem;
}

.cabinet-drawer-close {
  border: 0;
  background: transparent;
  color: var(--adv-ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.cabinet-card {
  display: block;
  background: var(--adv-card);
  border-radius: 10px;
  padding: 0.85rem 1rem 1rem;
  text-decoration: none !important;
  color: var(--adv-ink) !important;
  box-shadow: var(--adv-shadow);
}

.cabinet-card.is-active {
  outline: 2px solid var(--adv-lime);
}

.cabinet-card-top {
  display: flex;
  justify-content: space-between;
  color: var(--adv-muted);
  font-size: 0.8rem;
  margin-bottom: 0.65rem;
}

.cabinet-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 0.55rem;
  background: var(--adv-ph);
}

.cabinet-card-name {
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
}

.cabinet-card-value {
  font-size: 1.55rem;
  font-weight: 800;
}

.cabinet-card-finance {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cabinet-card-finance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.cabinet-card-finance-label {
  color: var(--adv-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.cabinet-card-finance-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--adv-ink);
}

.cabinet-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.35rem;
}

.cabinet-nav a,
.cabinet-logout {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.55rem;
  color: var(--adv-ink) !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.95rem;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  border-radius: 6px;
}

.cabinet-nav-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  display: block;
  opacity: 0.88;
}

.cabinet-nav a:hover .cabinet-nav-icon,
.cabinet-logout:hover .cabinet-nav-icon,
.cabinet-nav a.is-active .cabinet-nav-icon {
  opacity: 1;
}

.cabinet-nav a:hover,
.cabinet-logout:hover {
  color: var(--adv-link-hover) !important;
}

.cabinet-nav a.is-active {
  color: #000 !important;
  background: color-mix(in srgb, var(--adv-lime) 55%, transparent);
}

.cabinet-nav hr {
  border: 0;
  border-top: 1px solid var(--adv-line);
  margin: 0.35rem 0;
}

.cabinet-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 826px; /* ~70% of site wrap (1180px) */
  margin-inline: auto;
}

.cabinet-section-card {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--adv-shadow);
}

.cabinet-section-card h1 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.cabinet-section-card > p {
  margin: 0;
  color: var(--adv-muted);
  line-height: 1.5;
  max-width: 40rem;
}

.cabinet-section-actions {
  margin-top: 1rem;
}

.cabinet-finance-box {
  margin-top: 1.15rem;
  padding: 1rem 1.15rem;
  background: var(--adv-bg);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 16rem;
}

.cabinet-finance-label {
  color: var(--adv-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.cabinet-finance-amount {
  font-size: 1.6rem;
  font-weight: 800;
}

/* ===== Cabinet Finance ===== */
.finance-nav-card {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.finance-tabs {
  margin: 0;
  padding: 0;
  border: 0;
  justify-content: flex-start;
}

.finance-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.finance-stat-card {
  min-height: 8.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
}

.finance-stat-value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 800;
  color: var(--adv-ink);
  line-height: 1;
}

.finance-stat-currency {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--adv-muted);
}

.finance-stat-label {
  color: var(--adv-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.finance-legend {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
  list-style: disc;
  color: var(--adv-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.finance-legend li + li {
  margin-top: 0.2rem;
}

.finance-panel-title {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.finance-note {
  margin: 0 0 1rem;
  color: var(--adv-muted);
  line-height: 1.5;
}

.finance-balance-line {
  margin: 0 0 1rem;
  color: var(--adv-ink);
}

.finance-amount-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 20rem;
}

.finance-pay-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.finance-pay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  background: var(--adv-bg);
  border-radius: 4px;
  border: 1px solid var(--adv-line);
}

.finance-pay-icon {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}

.finance-pay-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 10rem;
}

.finance-pay-meta strong {
  font-size: 0.95rem;
}

.finance-pay-meta span {
  color: var(--adv-muted);
  font-size: 0.85rem;
}

.finance-pay-total {
  color: var(--adv-ink) !important;
  font-weight: 700;
}

.finance-pay-form {
  margin: 0;
}

.finance-pay-form button,
.finance-amount-form button {
  border: 1px solid var(--adv-lime);
  cursor: pointer;
  font-family: inherit;
}

.finance-back-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--adv-muted);
  font-size: 0.9rem;
}

.finance-steps {
  margin: 0 0 1.15rem;
  padding-left: 1.2rem;
  line-height: 1.55;
  color: var(--adv-ink);
}

.finance-steps li + li {
  margin-top: 0.45rem;
}

.finance-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.finance-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--adv-line);
  border-radius: 4px;
  background: var(--adv-bg);
  color: var(--adv-ink);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.finance-method.is-active {
  border-color: var(--adv-lime);
  background: color-mix(in srgb, var(--adv-lime) 22%, var(--adv-card));
  outline: 1px solid var(--adv-lime);
}

.finance-method-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.finance-method-fee {
  color: var(--adv-muted);
  font-size: 0.78rem;
}

.finance-withdraw-info {
  margin: 0 0 1rem;
  color: var(--adv-muted);
  font-size: 0.9rem;
}

.finance-withdraw-info p {
  margin: 0.2rem 0;
}

.finance-withdraw-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
}

.finance-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.finance-table th,
.finance-table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--adv-line);
  text-align: left;
  vertical-align: middle;
}

.finance-table th {
  color: var(--adv-muted);
  font-weight: 600;
  white-space: nowrap;
}

.finance-wallet-cell {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-status.is-wait { color: #b59b00; font-weight: 700; }
.finance-status.is-progress { color: #2f9e44; font-weight: 700; }
.finance-status.is-cancel { color: #c62828; font-weight: 700; }

.finance-inline-form { margin: 0; }

.finance-cancel-btn {
  border: 1px solid var(--adv-line);
  background: var(--adv-bg);
  color: var(--adv-ink);
  border-radius: 3px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.finance-cancel-btn:hover {
  border-color: #c62828;
  color: #c62828;
}

@media (max-width: 640px) {
  .finance-stats {
    grid-template-columns: 1fr;
  }
}

.cabinet-page-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
}

.cabinet-page-lead {
  margin: 0;
  color: var(--adv-muted);
  max-width: 40rem;
}

.cabinet-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 820px) {
  .cabinet-settings-grid {
    grid-template-columns: 1fr;
  }
}

.cabinet-settings-block h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.cabinet-avatar-preview {
  width: 150px;
  height: 150px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--adv-ph);
  border: 1px solid var(--adv-line);
}

.cabinet-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cabinet-settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cabinet-settings-form .btn {
  align-self: flex-start;
  min-width: 8rem;
}

.cabinet-hint-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--adv-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.cabinet-settings-meta {
  margin: 0 0 0.75rem;
  color: var(--adv-muted);
  font-size: 0.92rem;
}

.cabinet-settings-note {
  margin: 0 0 0.85rem;
  color: var(--adv-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.cabinet-flash {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.cabinet-flash.is-ok {
  background: rgba(56, 142, 60, 0.12);
  color: #2e7d32;
}

.cabinet-flash.is-err {
  background: rgba(198, 40, 40, 0.1);
  color: #c62828;
}

[data-theme="dark"] .cabinet-flash.is-ok {
  color: #81c784;
}

[data-theme="dark"] .cabinet-flash.is-err {
  color: #ef9a9a;
}

.cabinet-msg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--adv-lime);
  color: #111;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.messages-warning {
  max-width: 52rem;
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 820px) {
  .messages-layout {
    grid-template-columns: 1fr;
  }
}

.messages-sidebar,
.messages-thread {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.messages-sidebar {
  max-height: min(70vh, 36rem);
}

.messages-thread {
  min-height: 0;
}

.messages-sidebar-head {
  padding: 0.85rem 1rem;
  font-weight: 800;
  border-bottom: 1px solid var(--adv-line);
}

.messages-conv-list {
  overflow-y: auto;
  min-height: 0;
}

.messages-conv-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--adv-line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.messages-conv-item:hover,
.messages-conv-item.is-active {
  background: rgba(212, 248, 40, 0.12);
}

.messages-conv-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--adv-ph);
}

.messages-conv-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.messages-conv-meta strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-conv-meta small {
  color: var(--adv-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-unread {
  flex-shrink: 0;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--adv-lime);
  color: #111;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-empty {
  padding: 1.25rem 1rem;
  color: var(--adv-muted);
  font-size: 0.9rem;
}

.messages-thread-head {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--adv-line);
}

.messages-peer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.messages-peer-link:hover {
  color: inherit;
}

.messages-peer-ava {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--adv-ph);
}

.messages-peer-link strong {
  display: block;
  font-size: 0.95rem;
}

.messages-peer-link small {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
}

.messages-peer-link small.is-online {
  color: #2e7d32;
}

.messages-peer-link small.is-offline {
  color: #c62828;
}

.messages-peer-link small.messages-peer-last {
  color: var(--adv-muted);
  font-weight: 400;
}

.messages-thread-placeholder {
  padding: 1.5rem 1rem;
  color: var(--adv-muted);
  text-align: center;
}

.messages-thread-body {
  max-height: min(55vh, 28rem);
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--adv-bg);
}

.messages-bubble {
  max-width: min(78%, 34rem);
  align-self: flex-start;
  padding: 0.55rem 0.75rem 0.4rem;
  border-radius: 10px 10px 10px 3px;
  background: var(--adv-card);
  border: 1px solid var(--adv-line);
  box-shadow: var(--adv-shadow);
}

.messages-bubble.is-mine {
  align-self: flex-end;
  border-radius: 10px 10px 3px 10px;
  background: rgba(212, 248, 40, 0.18);
  border-color: rgba(212, 248, 40, 0.35);
}

.messages-bubble.is-garant {
  align-self: stretch;
  max-width: 100%;
  background: color-mix(in srgb, #2fbf71 12%, var(--adv-card));
  border-color: color-mix(in srgb, #2fbf71 35%, var(--adv-line));
}

.messages-bubble.is-garant .messages-bubble-meta {
  text-align: left;
  color: #2fbf71;
}

.messages-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.4;
}

.messages-bubble-meta {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--adv-muted);
  text-align: right;
}

.messages-composer {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--adv-line);
  align-items: flex-end;
}

.messages-active-deals {
  padding: 0.65rem 1rem 0.75rem;
  border-top: 1px solid var(--adv-line);
  background: color-mix(in srgb, var(--adv-lime) 12%, var(--adv-card));
}

.messages-active-deals-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--adv-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.messages-active-deals-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
}

.messages-active-deal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--adv-lime) 45%, var(--adv-line));
  background: var(--adv-card);
  color: var(--adv-ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.messages-active-deal-link:hover {
  border-color: var(--adv-lime);
  background: color-mix(in srgb, var(--adv-lime) 18%, var(--adv-card));
  color: var(--adv-ink);
}

.messages-active-deals.is-flash {
  animation: messages-deals-flash 1.2s ease;
}

@keyframes messages-deals-flash {
  0%, 100% { background: color-mix(in srgb, var(--adv-lime) 12%, var(--adv-card)); }
  35% { background: color-mix(in srgb, var(--adv-lime) 38%, var(--adv-card)); }
}

.messages-composer textarea {
  flex: 1;
  min-height: 2.6rem;
  max-height: 8rem;
  resize: vertical;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--adv-line);
  border-radius: 6px;
  background: var(--adv-card);
  color: inherit;
  font: inherit;
}

.messages-composer textarea:focus {
  outline: none;
  border-color: var(--adv-lime);
}

.messages-composer .btn {
  flex-shrink: 0;
}


/* ===== Sell lot page ===== */
.sell-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sell-header {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.15rem 1.35rem;
  box-shadow: var(--adv-shadow);
}

.sell-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  color: var(--adv-ink);
}

.sell-header p {
  margin: 0;
  color: var(--adv-muted);
  line-height: 1.45;
  max-width: 52rem;
}

.sell-alert {
  background: color-mix(in srgb, #d70000 12%, var(--adv-card));
  border: 1px solid color-mix(in srgb, #d70000 35%, transparent);
  color: var(--adv-ink);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
}

.sell-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.sell-main,
.sell-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sell-card {
  background: var(--adv-card);
  border-radius: 4px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--adv-shadow);
}

.sell-card h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  color: var(--adv-ink);
}

.sell-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.sell-field > span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--adv-ink);
}

.sell-field em {
  color: #d70000;
  font-style: normal;
}

.sell-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--adv-line);
  border-radius: 4px;
  background: var(--adv-card);
  color: var(--adv-ink);
  font: inherit;
}

.sell-input:focus {
  outline: none;
  border-color: var(--adv-lime);
}

.sell-textarea {
  min-height: 9rem;
  resize: vertical;
  line-height: 1.45;
}

.sell-input-sm {
  width: 5.5rem;
  flex: 0 0 auto;
}

.sell-hint {
  display: block;
  margin: 0.15rem 0 0;
  color: var(--adv-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.sell-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.85rem;
  margin: 0.25rem 0 0.65rem;
  padding: 0.75rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--adv-muted) 8%, transparent);
}

.sell-param-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sell-param-unit {
  font-size: 0.85rem;
  color: var(--adv-muted);
}

.sell-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 8rem;
  padding: 1.25rem;
  border: 1.5px dashed color-mix(in srgb, var(--adv-muted) 45%, transparent);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sell-dropzone:hover {
  border-color: var(--adv-lime);
  background: color-mix(in srgb, var(--adv-lime) 8%, transparent);
}

.sell-dropzone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.sell-dropzone-title {
  font-weight: 800;
  color: var(--adv-ink);
}

.sell-dropzone-hint {
  font-size: 0.82rem;
  color: var(--adv-muted);
}

.sell-photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.sell-photo-existing {
  margin-bottom: 0.35rem;
}

.sell-photo-item {
  margin: 0;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--adv-ph);
  position: relative;
}

.sell-photo-item-existing {
  overflow: visible;
}

.sell-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

.sell-photo-delete {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  z-index: 2;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.sell-photo-delete:hover {
  background: #c62828;
}

.sell-photo-delete:disabled {
  opacity: 0.55;
  cursor: wait;
}

.sell-price-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sell-currency {
  font-weight: 800;
  color: var(--adv-ink);
}

.sell-buyer-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--adv-lime) 14%, transparent);
  color: var(--adv-ink);
  font-size: 0.92rem;
}

.sell-buyer-price strong {
  font-size: 1.15rem;
}

.sell-contact {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

.sell-contact img {
  flex-shrink: 0;
  opacity: 0.9;
}

.sell-submit {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

.sell-hint-warn {
  color: #b00303;
  font-weight: 600;
}

.catalog-action-sell {
  text-decoration: none;
}

@media (max-width: 960px) {
  .sell-grid {
    grid-template-columns: 1fr;
  }

  .sell-params {
    grid-template-columns: 1fr;
  }
}

/* —— Deal page —— */
.deal-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.deal-page-title {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
  font-weight: 700;
}

.deal-flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.deal-flash-error {
  background: color-mix(in srgb, #c0392b 12%, var(--adv-card));
  color: #c0392b;
  border: 1px solid color-mix(in srgb, #c0392b 30%, var(--adv-line));
}

.deal-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.deal-party {
  padding: 1rem;
}

.deal-party-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--adv-muted);
  font-weight: 600;
}

.deal-party-link {
  display: flex;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.deal-party-link:hover strong {
  color: var(--adv-game-title);
}

.deal-party-ava-wrap {
  position: relative;
  flex-shrink: 0;
}

.deal-party-ava {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--adv-ph);
}

.deal-banned-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.deal-party-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.deal-party-meta strong {
  font-size: 1.05rem;
}

.deal-party-login {
  color: var(--adv-muted);
  font-size: 0.85rem;
}

.deal-party-rating {
  font-weight: 700;
  font-size: 0.95rem;
}

.deal-otziv {
  display: inline-flex;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  border-radius: 3px;
}

.deal-otziv span {
  padding: 1px 5px;
  color: #fff;
}

.deal-otziv .is-good { background: #178203; }
.deal-otziv .is-mid { background: #d7b700; }
.deal-otziv .is-bad { background: #d70000; }

.deal-party-meta small.is-online { color: #2fbf71; font-weight: 600; }
.deal-party-meta small.is-offline { color: #c0392b; font-weight: 600; }

.deal-info,
.deal-rules,
.deal-chat {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.deal-info-title {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
}

.deal-info-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.deal-info-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 0.5rem;
}

.deal-info-list dt {
  margin: 0;
  color: var(--adv-muted);
  font-size: 0.9rem;
}

.deal-info-list dd {
  margin: 0;
}

.deal-desc {
  line-height: 1.45;
  word-break: break-word;
}

.deal-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.deal-photos a {
  display: block;
  width: calc(25% - 0.4rem);
  min-width: 100px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--adv-ph);
}

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

.deal-hold {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem;
  margin-top: 0.75rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--adv-lime) 18%, var(--adv-card));
  border: 1px solid var(--adv-line);
  font-size: 1.05rem;
}

.deal-hold strong {
  font-size: 1.35rem;
}

.deal-closed-badge {
  text-align: center;
  margin: 1rem 0 0;
  font-weight: 700;
  color: #2fbf71;
}

.deal-rules-lead {
  margin: 0 0 0.65rem;
  color: #b00303;
  font-weight: 600;
  line-height: 1.4;
}

.deal-rules ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--adv-ink);
  line-height: 1.45;
}

.deal-rules li {
  margin-bottom: 0.4rem;
}

.deal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 0 0 1rem;
}

.deal-action-form {
  display: inline;
  margin: 0;
}

.deal-btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
}

.deal-btn-ok {
  background: #2fbf71;
}

.deal-btn-ok:hover {
  background: #28a862;
}

.deal-btn-cancel {
  background: #c0392b;
}

.deal-btn-cancel:hover {
  background: #a93226;
}

.deal-btn-continue {
  background: #5b2c8a;
}

.deal-btn-garant {
  background: #e67e22;
}

.deal-btn-garant:hover {
  background: #d35400;
}

.deal-notice {
  text-align: center;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  border-radius: 8px;
  background: var(--adv-card);
  border: 1px solid var(--adv-line);
  color: var(--adv-ink);
  line-height: 1.4;
}

.deal-messages {
  margin-top: 1rem;
}

.deal-messages .messages-thread-body {
  min-height: 16rem;
  max-height: min(55vh, 28rem);
}

.deal-messages .deal-notice {
  margin: 0.75rem 1rem 1rem;
}

.deal-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.deal-modal[hidden] {
  display: none !important;
}

.deal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.deal-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--adv-card);
  color: var(--adv-ink);
  border-radius: 12px;
  border: 1px solid var(--adv-line);
  box-shadow: var(--adv-shadow);
  padding: 1.25rem 1.25rem 1.4rem;
}

.deal-modal-card h3 {
  margin: 0 1.5rem 0.75rem 0;
}

.deal-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--adv-muted);
}

.deal-modal-warn {
  color: #c0392b;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 1rem;
}

.deal-complete-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.deal-complete-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.deal-complete-form textarea,
.deal-complete-form select {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--adv-line);
  background: var(--adv-bg);
  color: var(--adv-ink);
  font: inherit;
}

.deal-complete-form .deal-btn {
  align-self: center;
  margin-top: 0.25rem;
}

@media (max-width: 720px) {
  .deal-parties {
    grid-template-columns: 1fr;
  }

  .deal-info-list > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .deal-photos a {
    width: calc(50% - 0.25rem);
  }
}

/* —— Cabinet deals list —— */
.cabinet-deals-block {
  padding: 1rem 1.15rem 1.25rem;
}

.cabinet-deals-scroll {
  overflow-x: auto;
  margin-top: 0.75rem;
  border: 1px solid var(--adv-line);
  border-radius: 8px;
}

.cabinet-deals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 860px;
}

.cabinet-deals-table th,
.cabinet-deals-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--adv-line);
  vertical-align: middle;
}

.cabinet-deals-table thead th {
  background: color-mix(in srgb, var(--adv-ink) 4%, var(--adv-card));
  color: var(--adv-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.cabinet-deals-table tbody tr:last-child td {
  border-bottom: none;
}

.cabinet-deals-table tbody tr:hover {
  background: color-mix(in srgb, var(--adv-lime) 10%, var(--adv-card));
}

.cabinet-deal-row {
  cursor: pointer;
}

.cabinet-deal-row:focus-visible {
  outline: 2px solid var(--adv-game-title);
  outline-offset: -2px;
}

.cabinet-deal-title {
  max-width: 220px;
  word-break: break-word;
}

.deal-status-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.deal-status-badge.is-wait {
  color: #c6b009;
}

.deal-status-badge.is-closed {
  color: #09ad2d;
}

.deal-status-badge.is-other {
  color: #ad1509;
}

.deal-help-badge {
  display: inline-block;
  font-weight: 800;
  font-size: 0.85rem;
  color: #c6b009;
  white-space: nowrap;
}

.cabinet-deal-row.is-help {
  background: color-mix(in srgb, #c6b009 10%, transparent);
}

.deal-open-link {
  font-weight: 700;
  color: var(--adv-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.deal-open-link:hover {
  color: var(--adv-lime-ink, var(--adv-ink));
}

.admin-withdraw-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.admin-withdraw-select {
  min-width: 9rem;
  width: auto;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.admin-withdraw-wallet {
  max-width: 160px;
  word-break: break-all;
  font-size: 0.85rem;
}

.admin-withdraw-table .btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}



/* Item type SEO (admin + catalog) */
.item-type-seo-block {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.1rem 0.35rem;
  border: 1px solid var(--adv-border, #d8dde6);
  border-radius: 6px;
  background: var(--adv-card, #fff);
}
.item-type-seo-block legend {
  float: none;
  width: auto;
  padding: 0 0.35rem;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}
.catalog-seo-extra {
  margin-top: 1.5rem;
  line-height: 1.55;
  color: var(--adv-ink, #1a1f2b);
}
.catalog-seo-extra p { margin: 0 0 0.75rem; }
