/* Mini App аукционов — тёмный «аукционный дом».
   Один сознательный вид: почти чёрный фон, тёплый белый текст, шампанское-золото
   только на цене и главных действиях, антиква Cormorant в названиях, Inter в цифрах.
   Цвета интерфейса Telegram подстраиваются под этот фон из app.js. */

:root {
  color-scheme: dark;

  --bg: #0a0a0c;
  --bg-2: #111114;
  --bg-3: #17171b;
  --bg-4: #1e1e23;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);

  --text: #f4f1ea;         /* тёплый белый, 17.6:1 */
  --text-2: #aaa59b;       /* вторичный, 8.1:1 */
  --text-3: #85807a;       /* третичный, 5.1:1 */

  --gold: #d6b87a;         /* 11.1:1 */
  --gold-hi: #ecd6a2;
  --gold-lo: #a8864b;
  --gold-line: rgba(214, 184, 122, .38);
  --gold-glow: rgba(214, 184, 122, .14);
  --on-gold: #1a140a;

  --live: #ff6b6f;         /* 6.4:1 */
  --ok: #6fd9a2;
  --warn: #eab767;

  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --pad: 16px;
  --tap: 44px;

  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-exit: 150ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  --z-sticky: 20;
  --z-dock: 30;
  --z-modal: 100;
  --z-toast: 200;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  touch-action: manipulation;
}

body {
  min-height: 100dvh;
  /* едва заметное тёплое свечение сверху — глубина без «градиентной картинки» */
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(214, 184, 122, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, p, dl, dd, dt, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
b, strong { font-weight: 600; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}

.pad { padding-left: var(--pad); padding-right: var(--pad); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.gold { color: var(--gold); }
.note { color: var(--text-3); font-size: 14px; margin: 12px 0; line-height: 1.5; }
.lead { color: var(--text-2); margin: 8px 0 18px; line-height: 1.55; }
.gate-note { color: var(--text-2); margin: 6px 0 16px; line-height: 1.55; }
[hidden] { display: none !important; }

:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ---------- типографика ---------- */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3);
}
.display {
  font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.08;
  letter-spacing: -.01em; margin: 6px 0 4px;
}
.display-sm { font-size: 30px; margin: 2px 0 0; }
.muted-label {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- загрузка ---------- */
.boot {
  display: grid; place-items: center; align-content: center; gap: 16px;
  min-height: 80dvh; color: var(--text-3); padding: 0 var(--pad); text-align: center;
}
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--gold);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- кнопки ---------- */
.btn {
  appearance: none; border: 0; border-radius: 14px;
  min-height: var(--tap); padding: 11px 18px;
  font: 600 15px/1.2 var(--sans); letter-spacing: .01em;
  background: var(--bg-3); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur) ease,
              border-color var(--dur) ease, opacity var(--dur) ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn-gold {
  color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 48%, var(--gold-lo) 100%);
  box-shadow: 0 10px 30px -12px rgba(214, 184, 122, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-ghost { background: var(--bg-3); border: 1px solid var(--line-2); }
.btn-quiet {
  background: transparent; color: var(--text-2); width: 100%;
  border: 1px solid var(--line-2);
}
.btn-danger { background: rgba(255, 107, 111, .1); color: var(--live); border: 1px solid rgba(255, 107, 111, .28); }
.btn-lg { width: 100%; min-height: 54px; font-size: 16px; border-radius: 16px; }

.btn-icon {
  appearance: none; background: transparent; border: 0; color: var(--text);
  width: var(--tap); height: var(--tap); flex: none; padding: 0;
  display: grid; place-items: center; cursor: pointer; border-radius: 14px;
  transition: background var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.btn-icon:active { transform: scale(.92); background: var(--bg-3); }
.btn-icon .i { width: 22px; height: 22px; }

.sticky-bottom {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  padding: 16px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}

/* ---------- экраны доступа ---------- */
.gate { padding-top: 28px; }
.gate-mark {
  width: 64px; height: 64px; margin: 8px auto 18px; border-radius: 50%;
  display: grid; place-items: center; color: var(--gold);
  border: 1px solid var(--gold-line);
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
}
.gate-mark .i { width: 26px; height: 26px; }
.center-screen { display: grid; align-content: center; justify-items: center; min-height: 86dvh; gap: 6px; }
.panel {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 14px 0;
}
.panel .eyebrow { margin-bottom: 10px; }
.rules-body { white-space: pre-wrap; max-height: 56dvh; overflow-y: auto; color: var(--text-2); line-height: 1.6; }
.rules-body b { color: var(--text); }
.req {
  white-space: pre-wrap; margin: 0 0 14px; color: var(--text);
  font: 500 15px/1.7 var(--sans); font-variant-numeric: tabular-nums;
}

/* ---------- топбар ---------- */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 8px 8px;
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: linear-gradient(to bottom, var(--bg) 70%, rgba(10, 10, 12, 0));
}
.topbar-list { padding: max(18px, env(safe-area-inset-top)) var(--pad) 10px; }
.status-pill {
  flex: 1; min-width: 0; text-align: center;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.status-pill.live { color: var(--live); }
.topbar-lot {
  width: var(--tap); text-align: center; flex: none;
  font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--bg-4) center/cover no-repeat;
  border: 1px solid var(--line-2);
}
.avatar-lg { width: 40px; height: 40px; }

.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none;
  box-shadow: 0 0 0 0 rgba(255, 107, 111, .6);
  animation: live 1.8s ease-out infinite;
}
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(255, 107, 111, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 111, 0); } }

/* ---------- баннер ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 6px var(--pad) 0; padding: 12px 14px;
  border-radius: 14px; font-size: 14px; line-height: 1.45;
}
.banner-danger { background: rgba(255, 107, 111, .08); border: 1px solid rgba(255, 107, 111, .25); color: var(--live); }

/* ---------- список: большие карточки идущих лотов ---------- */
.group-title {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 12px;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.feature-item { margin-bottom: 14px; }
.feature {
  display: block; width: 100%; padding: 0; text-align: left; color: inherit; font: inherit;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  cursor: pointer; transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur) ease;
}
.feature:active { transform: scale(.99); border-color: var(--gold-line); }
.feature-media {
  position: relative; display: block; aspect-ratio: 4 / 3;
  background: var(--bg-3) center/cover no-repeat;
}
.feature-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 12, .85) 0%, rgba(10, 10, 12, 0) 45%);
}
.feature-media .i-placeholder {
  position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; color: var(--text-3);
}
.pill {
  position: absolute; z-index: 1; top: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  background: rgba(10, 10, 12, .62); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pill-live { left: 12px; color: var(--text); }
.pill-timer { right: 12px; color: var(--gold); font-variant-numeric: tabular-nums; }
.feature-body { display: block; padding: 14px 16px 16px; }
.feature-title {
  display: block; font-family: var(--serif); font-weight: 600;
  font-size: 24px; line-height: 1.15; margin-bottom: 10px;
}
.feature-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.feature-price { font-size: 22px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------- список: компактные карточки ---------- */
.lot-item { margin-bottom: 8px; }
.lot-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 14px 10px 10px; color: inherit; font: inherit; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur) ease;
}
.lot-card:active { transform: scale(.99); border-color: var(--line-2); }
.lot-thumb {
  width: 64px; height: 64px; border-radius: 12px; flex: none;
  background: var(--bg-3) center/cover no-repeat;
  display: grid; place-items: center; color: var(--text-3);
}
.lot-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lot-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3);
}
.lot-badge .i { width: 13px; height: 13px; }
.lot-badge.soon { color: var(--gold); }
.lot-title { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot-meta { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot-price { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--text-3); text-align: center; padding: 60px 20px; line-height: 1.6; }

/* ---------- экран лота: галерея ---------- */
.auction { padding-bottom: 8px; }
.hero { padding: 4px var(--pad) 0; }
.hero-frame {
  position: relative; margin: 0 auto;
  width: 100%; max-width: 520px;
  aspect-ratio: 1 / 1; max-height: min(40dvh, 520px);
  border-radius: 24px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #1c1b20, #0d0d10 75%);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(214, 184, 122, .05) inset;
}
.gallery {
  display: flex; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery li { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.gallery img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  cursor: zoom-in; user-select: none; -webkit-user-drag: none;
}
.gallery-empty {
  height: 100%; display: grid; place-items: center; align-content: center; gap: 10px;
  color: var(--text-3); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
}
.gallery-empty .i { width: 40px; height: 40px; }
.hero-counter {
  position: absolute; left: 12px; bottom: 12px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(10, 10, 12, .6); border: 1px solid var(--line-2); color: var(--text);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hero-expand {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(10, 10, 12, .55); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hero-expand .i { width: 18px; height: 18px; }
/* стрелки листания: круглые «стеклянные», тап-зона 44px, у краёв гаснут */
.photo-nav {
  position: absolute; top: 50%; z-index: 2;
  width: var(--tap); height: var(--tap); margin-top: calc(var(--tap) / -2);
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 50%; color: var(--text);
  background: rgba(10, 10, 12, .5); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity var(--dur) ease, transform var(--dur-fast) var(--ease-out), background var(--dur) ease;
}
.photo-nav .i { width: 20px; height: 20px; }
.photo-nav.prev { left: 10px; }
.photo-nav.next { right: 10px; }
.photo-nav.prev .i { margin-left: -2px; }
.photo-nav.next .i { margin-right: -2px; }
.photo-nav:active { transform: scale(.9); background: rgba(10, 10, 12, .75); }
.photo-nav[disabled] { opacity: 0; pointer-events: none; }
.lightbox .photo-nav { width: 52px; height: 52px; margin-top: -26px; background: rgba(20, 20, 24, .6); }
.lightbox .photo-nav.prev { left: 12px; }
.lightbox .photo-nav.next { right: 12px; }
@media (hover: hover) {
  .photo-nav:hover { background: rgba(10, 10, 12, .75); border-color: var(--gold-line); }
}

.dots { display: flex; justify-content: center; gap: 6px; min-height: 16px; padding-top: 10px; }
.dots span {
  width: 6px; height: 6px; border-radius: 999px; background: var(--line-2);
  transition: width var(--dur) var(--ease-out), background var(--dur) ease;
}
.dots span.on { width: 18px; background: var(--gold); }

/* ---------- экран лота: название и цена ---------- */
.lot-head { text-align: center; padding-top: 6px; }
.lot-name {
  font-family: var(--serif); font-weight: 600;
  font-size: 30px; line-height: 1.12; letter-spacing: -.005em;
  margin: 2px auto 10px; max-width: 30ch;
}
.price-card {
  display: grid; justify-items: center; gap: 2px;
  padding: 12px 16px 8px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(214, 184, 122, .07), rgba(214, 184, 122, .015));
  border: 1px solid var(--gold-line);
}
.price-value {
  font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: -.025em;
  color: var(--gold); font-variant-numeric: tabular-nums;
}
.leader {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; color: var(--text-2); min-height: 28px; margin-top: 2px;
}
.leader .avatar { width: 24px; height: 24px; }
.leader.me { color: var(--ok); font-weight: 600; }

.extend-flash {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--warn);
  background: rgba(234, 183, 103, .1); border: 1px solid rgba(234, 183, 103, .3);
  animation: flash var(--dur) var(--ease-out);
}
@keyframes flash { from { transform: translateY(-4px); opacity: 0; } }

/* ---------- экран лота: описание, параметры, лента ---------- */
.content { padding-top: 22px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); line-height: 1.65; margin-bottom: 18px; }
.desc b { color: var(--text); font-weight: 600; }
.desc a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.desc code, .desc pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
}
.desc code { padding: 1px 5px; }
.desc pre { margin: 8px 0; padding: 10px 12px; overflow-x: auto; white-space: pre; }
.desc blockquote { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--gold-line); }
.desc .spoiler {
  background: var(--line-2); color: transparent; border-radius: 4px; cursor: pointer;
  transition: color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.desc .spoiler.revealed { background: transparent; color: inherit; cursor: auto; }
.params {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-2);
}
.param { padding: 12px 14px; }
.param:nth-child(odd) { border-right: 1px solid var(--line); }
.param:nth-child(n+3) { border-top: 1px solid var(--line); }
.param dt { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.param dd { font-size: 15px; font-weight: 500; margin: 3px 0 0; font-variant-numeric: tabular-nums; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 28px 0 12px; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.section-title .i { width: 15px; height: 15px; }
.section-meta { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.feed { display: flex; flex-direction: column; }
.bid {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.bid:last-child { border-bottom: 0; }
.bid.enter { animation: slidein var(--dur) var(--ease-out); }
@keyframes slidein { from { transform: translateY(-6px); opacity: 0; } }
.bid .avatar { width: 32px; height: 32px; }
.bid .grow { display: flex; flex-direction: column; gap: 1px; }
.bid-who { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bid-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bid-amount {
  margin-left: auto; display: flex; align-items: center; gap: 6px; white-space: nowrap;
  font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2);
}
.bid-amount .i { width: 14px; height: 14px; color: var(--warn); }
.bid.top .bid-amount { color: var(--gold); }
.bid.top .bid-who::after {
  content: "лидер"; margin-left: 8px; padding: 1px 7px; border-radius: 999px; vertical-align: 2px;
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-line);
}
.bid.mine .bid-who { color: var(--gold-hi); }
.bid.cancelled { opacity: .5; }
.bid.cancelled .bid-amount { text-decoration: line-through; }
.feed .note { margin: 4px 0; }

/* ---------- админ ---------- */
.admin-block { margin-top: 8px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-actions .btn { flex: 1 1 30%; font-size: 14px; padding: 8px 10px; }

/* ---------- победитель ---------- */
.winner-card {
  margin: 26px 0 8px; padding: 18px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(180deg, rgba(214, 184, 122, .1), rgba(214, 184, 122, .02));
  border: 1px solid var(--gold-line);
}
.winner-card h2 {
  font-family: var(--serif); font-weight: 600; font-size: 26px;
  display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold);
}
.winner-card h2 .i { width: 24px; height: 24px; }
.winner-total { color: var(--text-2); margin: 6px 0 2px; }
.winner-total b { color: var(--text); font-variant-numeric: tabular-nums; }
.winner-card .req { text-align: left; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
[data-winner-block] > .btn { margin-top: 10px; }

/* ---------- нижняя панель: таймер + ставки ---------- */
.dock {
  position: sticky; bottom: 0; z-index: var(--z-dock);
  margin-top: 22px;
  padding: 14px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: rgba(14, 14, 17, .94);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border-top: 1px solid var(--line-2);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .8);
}
.dock-timer { display: flex; align-items: flex-end; gap: 12px; }
.timer-label {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.timer-value {
  font-size: 38px; font-weight: 600; line-height: 1.05; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.timer-value.gold { color: var(--gold); }
.dock-hint {
  text-align: right; font-size: 13px; color: var(--text-2); line-height: 1.35; padding-bottom: 4px;
  display: flex; align-items: center; gap: 6px; max-width: 55%;
}
.dock-hint .i { width: 15px; height: 15px; flex: none; }
.dock-hint.leading { color: var(--ok); font-weight: 600; }
.dock-timer.warn .timer-value { color: var(--warn); }
.dock-timer.hot .timer-value { color: var(--live); animation: pulse .9s ease-in-out infinite; }
.dock-timer.hot .timer-label { color: var(--live); }
@keyframes pulse { 50% { opacity: .55; } }

.timer-bar { height: 3px; border-radius: 3px; background: var(--line); margin: 12px 0 0; overflow: hidden; }
.timer-bar span {
  display: block; height: 100%; width: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi));
  transition: width .4s linear;
}
.timer-bar span.warn { background: var(--warn); }
.timer-bar span.hot { background: var(--live); }

.dock-bids { margin-top: 14px; }
.quick-row { display: flex; gap: 8px; margin-bottom: 8px; }
.quick-row .btn {
  flex: 1; flex-direction: column; gap: 3px; min-height: 60px; padding: 8px 4px;
  background: var(--bg-3); border: 1px solid var(--gold-line); color: var(--gold);
  border-radius: 14px;
}
.quick-row .btn:active { background: var(--bg-4); }
.quick-row .btn.btn-gold {
  /* правило .quick-row .btn выше специфичнее .btn-gold и перебивало золотой фон —
     тёмный текст оказывался на тёмной кнопке и «Сделать первую ставку» было не видно */
  color: var(--on-gold); border: 0;
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 48%, var(--gold-lo) 100%);
}
.quick-row .btn.btn-gold:active { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lo) 100%); }
.quick-sum { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.quick-total { font-size: 12px; font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; }

/* ---------- профиль ---------- */
.avatar-btn {
  appearance: none; background: none; border: 0; padding: 2px; cursor: pointer;
  width: var(--tap); height: var(--tap); display: grid; place-items: center; border-radius: 50%;
  transition: transform var(--dur-fast) var(--ease-out);
}
.avatar-btn:active { transform: scale(.92); }
.avatar-btn .avatar { border-color: var(--gold-line); }

.profile-head { text-align: center; padding-top: 10px; }
.profile-avatar {
  width: 88px; height: 88px; margin: 6px auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-3) center/cover no-repeat;
  font-family: var(--serif); font-size: 34px; font-weight: 600; color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-line), 0 0 0 6px var(--bg), 0 0 0 7px rgba(214, 184, 122, .18),
              0 20px 40px -18px rgba(214, 184, 122, .35);
}
.profile-name { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.15; }
.profile-sub { color: var(--text-3); font-size: 14px; margin-top: 4px; }

.stats {
  display: grid; grid-template-columns: 1fr 1fr; margin-top: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
}
.stat { padding: 16px 14px 14px; text-align: center; }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.stat dd {
  margin: 0; font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat dt { margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.stat.accent dd { color: var(--gold); }

.spent {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 10px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(214, 184, 122, .07), rgba(214, 184, 122, .015));
  border: 1px solid var(--gold-line);
}
.spent-value { font-size: 22px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }

.won-list { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.won-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.won-status .i { width: 13px; height: 13px; }
.won-status.bought { color: var(--ok); }
.won-status.waiting, .won-status.checking { color: var(--warn); }
.won-status.unpaid { color: var(--live); }
.lot-card.is-unpaid .lot-price { color: var(--text-3); text-decoration: line-through; }

/* ---------- модерация участника (только админ) ---------- */
.bid-person {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit;
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: var(--tap);
  text-align: left; cursor: pointer; border-radius: 12px;
}
.bid-person:active .avatar { box-shadow: 0 0 0 2px var(--gold-line); }
.bid-person .avatar { box-shadow: 0 0 0 1px var(--gold-line); }
.bid-tools { display: flex; align-items: center; margin-right: -8px; }
.bid-tools .btn-icon .i { width: 19px; height: 19px; }
.btn-ban { color: var(--text-3); }
.btn-ban.on { color: var(--live); background: rgba(255, 107, 111, .12); }
.bid.user-blocked .bid-who { color: var(--live); }
.bid.user-blocked .bid-who::before {
  content: "запрет"; margin-right: 8px; padding: 1px 7px; border-radius: 999px; vertical-align: 2px;
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--live); border: 1px solid rgba(255, 107, 111, .4);
}
.leader-btn {
  appearance: none; background: none; border: 0; padding: 0 8px; margin: 0; color: inherit; font: inherit;
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); cursor: pointer; border-radius: 12px;
}

.mod-panel {
  margin-top: 18px; padding: 14px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line-2);
}
.mod-status {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2); margin-bottom: 12px;
}
.mod-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line-2);
}
.mod-chip .i { width: 14px; height: 14px; }
.mod-chip.ok { color: var(--ok); border-color: rgba(111, 217, 162, .35); }
.mod-chip.bad { color: var(--live); border-color: rgba(255, 107, 111, .4); }
.mod-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mod-actions .btn { font-size: 14px; padding: 10px 8px; }

/* ---------- конструктор лота ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.new-lot-btn {
  appearance: none; cursor: pointer; flex: none;
  width: var(--tap); height: var(--tap); border-radius: 50%; padding: 0;
  display: grid; place-items: center; color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 50%, var(--gold-lo));
  border: 0; box-shadow: 0 8px 20px -10px rgba(214, 184, 122, .7);
  transition: transform var(--dur-fast) var(--ease-out);
}
.new-lot-btn:active { transform: scale(.92); }
.new-lot-btn .i { width: 22px; height: 22px; stroke-width: 2.25; }
.topbar-list { gap: 10px; }

.save-state {
  width: auto; min-width: var(--tap); padding-right: 8px; text-align: right; flex: none;
  font-size: 12px; color: var(--text-3); display: flex; align-items: center; justify-content: flex-end; gap: 5px;
}
.save-state .i { width: 14px; height: 14px; }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--live); }

.builder { padding-bottom: 8px; }
.b-section { padding: 18px 0 6px; border-bottom: 1px solid var(--line); }
.b-section:last-child { border-bottom: 0; }
.b-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.b-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
  margin: 16px 0 10px;
}
.b-section > .b-label:first-child { margin-top: 0; }
.b-counter { letter-spacing: 0; text-transform: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.b-hint { font-size: 13px; color: var(--text-3); margin: 10px 0 8px; line-height: 1.45; }
.b-input {
  width: 100%; padding: 13px 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  font: 400 16px/1.4 var(--sans);
  transition: border-color var(--dur) ease;
}
.b-input::placeholder { color: var(--text-3); opacity: .8; }
.b-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold-line); }
.b-input[aria-invalid="true"] { border-color: var(--live); }
.b-textarea { resize: vertical; min-height: 100px; }

/* описание: оформленный текст */
.b-editor-wrap { position: relative; }
.b-editor {
  min-height: 110px; max-height: 50vh; overflow-y: auto; resize: none;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; cursor: text;
}
.b-editor:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold-line); }
.b-editor.is-empty::before { content: attr(data-placeholder); color: var(--text-3); opacity: .8; pointer-events: none; }
.b-editor b { font-weight: 600; }
.b-editor a { color: var(--gold); text-decoration: underline; }
.b-editor code, .b-editor pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em;
  background: rgba(255, 255, 255, .06); border-radius: 5px;
}
.b-editor code { padding: 1px 4px; }
.b-editor pre { display: block; margin: 6px 0; padding: 8px 10px; }
.b-editor blockquote { margin: 6px 0; padding-left: 10px; border-left: 2px solid var(--gold-line); }
.b-editor .spoiler, .fmt-spoiler {
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 3px, rgba(255,255,255,.05) 3px 6px);
  border-radius: 4px;
}
.b-fmt {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5;
  display: flex; gap: 2px; padding: 4px;
  background: #1b1a1d; border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.b-fmt button {
  min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: 500 15px/1 var(--sans); cursor: pointer;
}
.b-fmt button code { font-size: 12px; }
.b-fmt button .fmt-spoiler { padding: 2px 4px; font-size: 12px; color: var(--text-2); }
.b-fmt button[aria-pressed="true"] { background: var(--gold-glow); color: var(--gold); }
.b-fmt button:focus-visible { outline: 2px solid var(--gold); }
.b-input[type="datetime-local"] { color-scheme: dark; margin-bottom: 10px; font-variant-numeric: tabular-nums; }

.b-photos { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.b-photos::-webkit-scrollbar { display: none; }
.b-photo {
  position: relative; flex: none; width: 96px; height: 96px; border-radius: 14px; overflow: hidden;
  background: var(--bg-3) center/cover no-repeat; border: 1px solid var(--line-2);
}
.b-photo-main { appearance: none; border: 0; padding: 0; width: 100%; height: 100%; background: transparent; cursor: pointer; }
.b-photo.cover { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.b-cover-badge {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--on-gold); background: var(--gold); pointer-events: none;
}
.b-cover-badge .i { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.b-photo-del {
  position: absolute; top: 0; right: 0; width: var(--tap); height: var(--tap);
  display: grid; place-items: start end; padding: 6px; border: 0; background: none; cursor: pointer;
}
.b-photo-del span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 10, 12, .72); border: 1px solid var(--line-2); color: var(--text);
}
.b-photo-del .i { width: 14px; height: 14px; }
.b-photo.uploading { display: grid; place-items: center; }
.b-photo-add {
  flex: none; width: 96px; height: 96px; border-radius: 14px; cursor: pointer;
  display: grid; place-items: center; align-content: center; gap: 4px;
  border: 1px dashed var(--gold-line); color: var(--gold); background: rgba(214, 184, 122, .04);
  font-size: 12px; font-weight: 600;
}
.b-photo-add .i { width: 24px; height: 24px; }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px;
}
.segmented button {
  appearance: none; border: 0; cursor: pointer; min-height: 42px; border-radius: 10px;
  font: 600 14px/1.2 var(--sans); color: var(--text-2); background: transparent; padding: 6px 8px;
}
.segmented button[aria-checked="true"] { color: var(--on-gold); background: var(--gold); }

.chips .chip[aria-pressed="true"] {
  color: var(--on-gold); background: var(--gold); border-color: var(--gold);
}
.chip.chip-custom { color: var(--gold); border-style: dashed; border-color: var(--gold-line); }
.chip-input {
  width: 118px; min-height: var(--tap); padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--gold); background: var(--bg); color: var(--gold);
  font: 600 14px var(--sans); font-variant-numeric: tabular-nums;
}
.chip-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.b-footer {
  position: sticky; bottom: 0; z-index: var(--z-dock); margin-top: 18px;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: rgba(14, 14, 17, .95);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line-2); border-radius: 22px 22px 0 0;
}
.b-missing { font-size: 13px; color: var(--warn); text-align: center; margin-bottom: 8px; min-height: 18px; }
.b-missing.ready { color: var(--ok); }
.b-footer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

.drafts .lot-badge { color: var(--warn); }

/* ---------- предпросмотр лота (админ) ---------- */
/* плашка поверх фото — не занимает место, цена остаётся над нижней панелью */
.preview-banner {
  position: absolute; z-index: 3; top: 12px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; line-height: 1.2; color: var(--text);
  background: rgba(10, 10, 12, .72); border: 1px dashed var(--gold-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.preview-banner .i { width: 15px; height: 15px; color: var(--gold); }
.preview-banner b { color: var(--gold); }
.auction.is-preview .dock { border-top-style: dashed; }

/* ---------- подсказки «?» ---------- */
.param dt { display: flex; align-items: center; gap: 2px; }
.param-help {
  /* визуально кружок 18px, но зона нажатия 44px — растягиваем её за пределы кружка */
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--gold);
  width: var(--tap); height: var(--tap); margin: -14px -13px -14px -9px; padding: 0;
  display: grid; place-items: center; flex: none; border-radius: 50%;
}
.param-help span {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gold-line); background: rgba(214, 184, 122, .08);
  font: 600 11px/1 var(--sans); letter-spacing: 0; text-transform: none;
  transition: background var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.param-help:active span { transform: scale(.9); background: rgba(214, 184, 122, .22); }
.help-sheet { text-align: center; }
.help-mark {
  width: 52px; height: 52px; margin: 2px auto 12px; border-radius: 50%;
  display: grid; place-items: center; color: var(--gold);
  font: 600 24px/1 var(--serif); border: 1px solid var(--gold-line);
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
}
.help-body { text-align: left; margin-top: 12px; }
.help-body p { color: var(--text-2); line-height: 1.6; margin: 0 0 10px; }
.help-body p b { color: var(--text); }
.help-example {
  margin: 14px 0 4px; padding: 12px 14px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line-2);
  font-size: 14px; line-height: 1.7; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.help-example b { color: var(--gold); }

/* ---------- полноэкранный просмотр ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(5, 5, 6, .97);
  animation: fade var(--dur) ease;
}
.lightbox-inner { position: absolute; inset: 0; }
.lightbox-track {
  display: flex; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.lightbox-track::-webkit-scrollbar { display: none; }
.lightbox-track li { flex: 0 0 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; }
.lightbox-track img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px;
  background: rgba(20, 20, 24, .7); border: 1px solid var(--line-2);
}
.lightbox-counter {
  position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums;
}

/* ---------- модалки ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: end center;
  background: rgba(0, 0, 0, .66);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fade var(--dur-fast) ease; padding-top: 20px;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 520px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 92dvh; overflow-y: auto;
  animation: up var(--dur) var(--ease-out);
}
@keyframes up { from { transform: translateY(28px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-title { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.15; }
.modal-row { display: flex; gap: 10px; margin-top: 18px; }
.modal-row .btn { flex: 1; min-height: 50px; }

.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 14px 0 8px; }
.amount-input {
  width: 100%; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--gold);
  font: 600 28px/1.2 var(--sans); text-align: center; font-variant-numeric: tabular-nums;
}
.amount-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-color: var(--gold-line); }
.amount-input[aria-invalid="true"] { border-color: var(--live); }
.field-help { font-size: 13px; color: var(--text-3); margin: 8px 0; }
.field-error { font-size: 14px; color: var(--live); font-weight: 600; margin: 8px 0; display: flex; align-items: center; gap: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: var(--tap); padding: 8px 14px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text);
  font: 600 14px var(--sans); cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip:active { transform: scale(.96); border-color: var(--gold-line); }
.confirm-amount {
  font-size: 44px; font-weight: 600; text-align: center; margin: 18px 0 6px;
  letter-spacing: -.03em; color: var(--gold); font-variant-numeric: tabular-nums;
}

/* ---------- тосты ---------- */
#toasts {
  position: fixed; left: 0; right: 0; top: calc(10px + env(safe-area-inset-top)); z-index: var(--z-toast);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; padding: 0 12px;
}
.toast {
  max-width: 100%; padding: 11px 16px; border-radius: 14px;
  font-size: 14px; font-weight: 500; line-height: 1.35;
  display: flex; align-items: center; gap: 9px;
  background: rgba(23, 23, 27, .96); border: 1px solid var(--line-2); color: var(--text);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: toastin var(--dur) var(--ease-out);
}
.toast .i { width: 17px; height: 17px; }
.toast.ok .i { color: var(--gold); }
.toast.err { border-color: rgba(255, 107, 111, .45); }
.toast.err .i { color: var(--live); }
.toast.out { animation: toastout var(--dur-exit) ease forwards; }
@keyframes toastin { from { transform: translateY(-10px); opacity: 0; } }
@keyframes toastout { to { transform: translateY(-8px); opacity: 0; } }

/* ---------- шире телефона ---------- */
@media (min-width: 640px) {
  :root { --pad: 24px; }
  .screen { max-width: 640px; margin: 0 auto; }
  .lot-name { font-size: 36px; }
}

/* ---------- низкие экраны: фото чуть меньше, чтобы цена оставалась на виду ---------- */
@media (max-height: 700px) {
  .hero-frame { max-height: 36dvh; }
  .lot-name { font-size: 26px; margin-bottom: 10px; }
  .price-value { font-size: 34px; }
  .timer-value { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .dock-timer.hot .timer-value { animation: none; text-decoration: underline; text-underline-offset: 6px; }
  .live-dot { animation: none; }
}
