/* needlroom market — оформление мини-аппа.
   Тёмный фон, кремовые «бумажные» детали, мятная бумага из задников канала, зерно как на плёнке.
   Заголовки — Unbounded (поджатый), текст — Rubik, надпись NEEDL ROOM — Fraunces. */
:root {
  --ink: #0d0d0d; --ink2: #161616; --ink3: #1f1f1f; --line: rgba(255,255,255,.09);
  --text: #f2f2ef; --hint: #8f8f8a; --cream: #f6f3ea; --mint: #8fdcc6; --mint-d: #3d9a6a;
  --green: #7fe0b0; --blue: #6f9bff; --red: #e5484d;
  --fh: Unbounded, Rubik, sans-serif; --fb: Rubik, -apple-system, "Segoe UI", sans-serif; --fw: "Fraunces", serif;
  --tight: -0.045em;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 15px/1.38 var(--fb); }
body { padding: 0 16px calc(84px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
body::after { content: ""; position: fixed; inset: 0; background: var(--grain); opacity: .06; pointer-events: none; z-index: 30; mix-blend-mode: overlay; }
button, select, input, textarea { font: inherit; color: inherit; }
.h, h1, h2, .section, .title { font-family: var(--fh); letter-spacing: var(--tight); font-weight: 600; }

/* Бумага — как задники в канале */
.paper { position: relative; color: var(--ink); background: #eef2ef url("paper.jpg") 50% 50% / cover; isolation: isolate; }
.paper::after { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .16; mix-blend-mode: multiply; pointer-events: none; }

/* Верх: надпись, поиск, форматы */
.top { position: relative; z-index: 5; background: var(--ink); padding: 12px 0 6px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.brand { font-family: var(--fw); font-weight: 300; letter-spacing: .34em; font-size: 13px; text-transform: uppercase; }
.brand b { font-weight: 300; }
.spark { display: none; }
.search input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 2px; background: transparent;
  outline: none; font-size: 15px; }
.search input::placeholder { color: var(--hint); }
.search input:focus { border-bottom-color: rgba(255,255,255,.35); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 13px; cursor: pointer; white-space: nowrap; font-size: 14px; color: #cfcfca; }
.chip.on { background: var(--cream); color: var(--ink); border-color: transparent; font-weight: 600; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--ink); color: #cfcfca; }
.top.slim .search, .top.slim .chips, .top.slim .row { display: none; }

/* Баннер на главной: мятая бумага, полароид со скотчем, круглая наклейка, бегущая строка */
.hero { margin: 4px -16px 0; padding: 20px 18px 18px; min-height: 214px; overflow: hidden; }
.hero .kicker { font-family: var(--fw); font-weight: 300; letter-spacing: .34em; font-size: 10.5px; text-transform: uppercase; color: #4b4e48; }
.hero h2 { font-size: 23px; line-height: 1.06; margin: 10px 0 8px; max-width: 54%; position: relative; z-index: 2; }
.hero p { margin: 0; font-size: 12.5px; color: #42453f; max-width: 52%; line-height: 1.35; position: relative; z-index: 2; }
.mark { background: linear-gradient(transparent 55%, rgba(120,214,190,.9) 55%, rgba(120,214,190,.9) 92%, transparent 92%); padding: 0 3px; margin: 0 -3px; }
.polaroid { position: absolute; right: 16px; top: 24px; width: 140px; padding: 7px 7px 24px; background: #fbfaf6; transform: rotate(4deg);
  box-shadow: 0 10px 22px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.2); cursor: pointer; }
.polaroid img, .polaroid .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; filter: saturate(.92) contrast(1.04); background: #ddd; }
.polaroid span { position: absolute; bottom: 5px; left: 6px; right: 6px; text-align: center; font-size: 11px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape { position: absolute; width: 60px; height: 19px; background: rgba(240,236,220,.75); top: -9px; left: 40px; transform: rotate(-6deg);
  box-shadow: 0 1px 2px rgba(0,0,0,.12); clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 45%); }
.badge-round { position: absolute; right: 4px; top: 8px; z-index: 3; width: 60px; height: 60px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; text-align: center; font: 600 9.5px/1.1 var(--fh); letter-spacing: var(--tight); transform: rotate(-10deg);
  box-shadow: 0 0 0 3px #f7f7f3, 0 4px 10px rgba(0,0,0,.25); }
.ticker { margin: 0 -16px; background: var(--cream); color: var(--ink); white-space: nowrap; overflow: hidden; font: 600 12px var(--fh); letter-spacing: var(--tight); padding: 7px 0; }
.ticker span { display: inline-block; padding-left: 12px; animation: run 26s linear infinite; }
@keyframes run { to { transform: translateX(-50%); } }

/* Заголовки разделов */
.section { color: var(--text); font-size: 19px; margin: 22px 2px 10px; }
.count { color: var(--hint); font-size: 13px; margin: -4px 2px 10px; }
.empty { color: var(--hint); text-align: center; padding: 30px 10px; }
.more { display: block; width: 100%; margin: 16px 0 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: transparent; cursor: pointer; }

/* Карточки: фото — главное, цена — бумажный ценник */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.thumb { aspect-ratio: 1; background: #1e1e1e center/cover no-repeat; position: relative; border-radius: 10px 12px 11px 9px; }
.thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; opacity: .5; }
.card .info { padding: 8px 2px 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card .t { font: 600 14.5px/1.15 var(--fh); letter-spacing: var(--tight); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .a { color: var(--hint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket { position: absolute; right: -4px; bottom: 12px; background: var(--cream); color: var(--ink); font: 600 12.5px var(--fh); letter-spacing: var(--tight);
  padding: 5px 9px 5px 13px; transform: rotate(-3deg); box-shadow: 0 3px 8px rgba(0,0,0,.35); clip-path: polygon(0 50%, 8px 0, 100% 0, 100% 100%, 8px 100%); white-space: nowrap; }
.ticket s { font-weight: 400; color: #8a877d; font-size: 10.5px; margin-left: 3px; }
.flags { position: absolute; left: 7px; top: 7px; right: 44px; display: flex; flex-wrap: wrap; gap: 4px; }
.flag { font: 600 10.5px var(--fh); letter-spacing: var(--tight); padding: 3px 8px; border-radius: 4px; background: var(--cream); color: var(--ink); white-space: nowrap; transform: rotate(-2deg); }
.flag.want { background: var(--red); color: #fff; }
.flag.ok { background: #2e7d55; color: #fff; }
.flag.new { background: var(--blue); color: #fff; }
.flag.sale { background: var(--red); color: #fff; }
.heart { position: absolute; right: 6px; top: 6px; border: 0; border-radius: 999px; padding: 5px 8px; min-width: 32px; background: rgba(13,13,13,.55);
  color: #fff; font-size: 14px; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); }
.heart span { font-size: 11px; margin-left: 3px; }
.heart.on { color: #ff6b81; }
.st { font-size: 11px; color: var(--hint); }
.st.published { color: var(--green); } .st.sold { color: #e0a030; } .st.review, .st.queued { color: var(--blue); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .card { scroll-snap-align: start; }
@media (min-width: 560px) { .strip { grid-auto-columns: 28%; } }
.skeleton { background: linear-gradient(90deg, var(--ink2), #232323, var(--ink2)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.sell { display: block; text-align: center; margin: 20px 0 4px; padding: 14px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.2); color: var(--text); cursor: pointer; font: 600 14px var(--fh); letter-spacing: var(--tight); }

/* Страница лота */
#page { padding-top: 12px; }
#page.lotpage { padding-top: 0; }
.back { border: 0; background: none; color: var(--hint); padding: 4px 0 10px; cursor: pointer; }
.galwrap { position: relative; margin: 0 -16px; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 1; max-height: 70vh; object-fit: cover; scroll-snap-align: center; background: #1e1e1e; filter: saturate(.94) contrast(1.03); }
.galwrap .fade { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--ink)); pointer-events: none; }
.galwrap .heart { top: 14px; right: 14px; font-size: 17px; padding: 8px 11px; }
.dots { position: absolute; right: 16px; bottom: 14px; margin: 0; font-size: 12px; color: #ddd; }
h1 { font-size: 28px; line-height: 1.05; margin: 10px 0 4px; }
.sub { color: var(--hint); margin: 0 0 6px; font-size: 13.5px; }
.pricerow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.price { font: 700 25px var(--fh); letter-spacing: var(--tight); }
.price s.old { font: 400 14px var(--fb); color: var(--hint); margin-left: 6px; }
.plaque { font: 600 11.5px var(--fh); letter-spacing: var(--tight); padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.plaque { color: #cfcfca; background: rgba(255,255,255,.08); }
.plaque.ok { color: var(--green); background: rgba(61,154,106,.18); }
.round { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(13,13,13,.55); backdrop-filter: blur(6px); color: #fff; font-size: 20px; cursor: pointer; }
.back-r { position: absolute; left: 14px; top: 14px; }
.plaque.warn { color: #f0b860; background: rgba(224,160,48,.15); }
.plaque.sale { color: #fff; background: var(--red); }
.sold { display: inline-block; margin-left: 8px; font: 600 12px var(--fh); padding: 3px 9px; border-radius: 999px; background: #b33; color: #fff; vertical-align: middle; letter-spacing: 0; }
.want-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: #c9c9c3; margin: 8px 0 4px; }
.want-line b { font: 600 12.5px var(--fh); letter-spacing: var(--tight); color: #fff; background: var(--red); padding: 5px 11px; border-radius: 999px; transform: rotate(-1.5deg); white-space: nowrap; }
.flags.inline { position: static; margin: 4px 0 0; }
.origin-note { color: var(--hint); font-size: 12.5px; margin: 2px 0 6px; }
.spec { margin-top: 12px; }
.spec div { display: flex; align-items: baseline; font-size: 14px; padding: 7px 0; }
.spec span { color: var(--hint); flex: none; }
.spec i { flex: 1; border-bottom: 1px dotted rgba(255,255,255,.22); margin: 0 6px; min-width: 14px; transform: translateY(-4px); }
.spec b { font-weight: 500; text-align: right; max-width: 62%; }
.comment { border-left: 2px solid var(--mint); padding: 4px 0 4px 12px; margin-top: 14px; white-space: pre-wrap; color: #deded9; }
.facts { margin-top: 6px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fact:last-child { border-bottom: 0; }
.fact span:first-child { color: var(--hint); flex: none; }
.fact span:last-child { text-align: right; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }
.tracks { border-top: 1px solid var(--line); padding: 10px 0; margin-top: 6px; }
.tracks summary { cursor: pointer; color: var(--text); font: 600 13px var(--fh); letter-spacing: var(--tight); }
.tracks ol { margin: 8px 0 0; padding-left: 22px; color: var(--hint); }
.tracks li { padding: 2px 0; }
.seller { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.ava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 16px var(--fh); background: var(--cream); color: var(--ink); flex: none; }
.seller .who { flex: 1; min-width: 0; }
.seller .r { color: var(--hint); font-size: 12.5px; }
.actions { display: grid; gap: 8px; margin-top: 16px; }
.btn { display: block; text-align: center; text-decoration: none; border: 0; border-radius: 14px; padding: 14px; background: var(--cream); color: var(--ink);
  font: 600 14.5px var(--fh); letter-spacing: var(--tight); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.16); }
.btn.small { padding: 11px; margin-top: 8px; font-size: 13px; width: 100%; }
.btn:disabled { opacity: .6; }
/* Нижняя панель на странице лота: ♡ и главная кнопка */
.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 10px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--ink) 30%); }
.cta .heart { position: static; width: 52px; height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2); background: var(--ink); font-size: 19px; flex: none; padding: 0; }
.cta .btn { flex: 1; height: 52px; display: grid; place-items: center; padding: 0 12px; }
body.lotview .tabs { display: none; }
body.lotview { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

/* Отзывы, теги */
.review { border-bottom: 1px solid var(--line); padding: 12px 0; }
.review .s { color: var(--cream); }
.review .m, .m { color: var(--hint); font-size: 13px; }
.stars { letter-spacing: 1px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(61,154,106,.18); color: #bfe9d2; }
.tag.bad { background: rgba(229,72,77,.18); color: #ffb3b5; }

/* Нижнее меню — классическое */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--ink); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.tab { text-decoration: none; color: #77776f; font-size: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tab svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: #fff; }
.tab.plus svg { width: 32px; height: 32px; stroke: #fff; }

/* Шторка */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; }
.sheet-box { width: 100%; background: var(--ink2); border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: grid; gap: 8px; max-height: 82vh; overflow-y: auto; }
.sheet-title { font: 600 17px var(--fh); letter-spacing: var(--tight); margin: 0 2px 2px; }
.phrase { text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; background: transparent; cursor: pointer; }
.phrase.plain { color: var(--mint); }

/* Профиль, вкус, достижения */
.me-head { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.me-head h1 { margin: 0; font-size: 24px; }
.ava.big { width: 64px; height: 64px; font-size: 24px; object-fit: cover; border-radius: 50%; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 16px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 10px 2px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font: 600 19px var(--fh); letter-spacing: var(--tight); }
.stats span { color: var(--hint); font-size: 11px; }
.achs { display: grid; gap: 0; }
.ach { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 11px 0; opacity: .5; }
.ach.got { opacity: 1; }
.ach-i { font-size: 24px; width: 34px; text-align: center; flex: none; }
.ach-b { flex: 1; min-width: 0; }
.ach b { font: 600 13.5px var(--fh); letter-spacing: var(--tight); }
.pbar { height: 5px; border-radius: 5px; background: rgba(255,255,255,.1); margin: 7px 0 4px; overflow: hidden; }
.pbar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--mint-d), var(--mint)); }
.pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
textarea { width: 100%; min-height: 76px; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; background: var(--ink2); resize: vertical; outline: none; }
.hello { position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 14px 0 4px; }
.hello b { font: 600 15px var(--fh); letter-spacing: var(--tight); }
.hello .x { position: absolute; right: 8px; top: 6px; }

/* Хотелки: вкладки, «Что ищешь» на бумаге, запросы — как треклист */
.title { font-size: 30px; margin: 8px 0 10px; }
.seg { display: flex; gap: 20px; margin: 0 0 14px; }
.seg a { text-decoration: none; color: var(--hint); font-size: 14.5px; padding-bottom: 6px; }
.seg a.on { color: #fff; font-weight: 600; box-shadow: inset 0 -2px 0 #fff; }
.want-box { margin: 0 -16px; padding: 18px 18px 16px; display: grid; gap: 8px; }
.want-box b.h { font-size: 21px; }
.want-box .m { color: #3f423d; }
.want-box .rowi { border-bottom: 1.5px solid var(--ink); padding: 2px 0; }
.want-box .txt { background: transparent; color: var(--ink); padding: 8px 0; }
.want-box .txt::placeholder { color: #6b6e68; }
.want-box .rowi .btn { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 12.5px; }
.want-box .chip { border-color: rgba(13,13,13,.18); color: #2b2d29; font-size: 12.5px; padding: 6px 11px; }
.want-box.dark { margin: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--text); }
.want-box.dark .m { color: var(--hint); }
.rowi { display: flex; gap: 8px; align-items: center; }
.rowi .txt { flex: 1; min-width: 0; }
.rowi .btn { padding: 11px 14px; flex: none; }
.txt { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--ink2); outline: none; }
.wish { border-bottom: 1px solid var(--line); padding: 12px 0; }
.wish-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wish .n { font: 400 14px var(--fh); color: var(--hint); width: 24px; flex: none; }
.wish .q { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; }
.wish .q small { display: block; font-weight: 400; font-size: 12px; color: var(--hint); margin-top: 2px; }
.wish .q small.hot { color: #ff8a8d; }
.wish .strip { margin-top: 10px; grid-auto-columns: 38%; }
.x { border: 0; background: none; color: #6a6a64; font-size: 16px; cursor: pointer; padding: 2px 6px; }

/* Форма «Продать» */
.field { margin-top: 16px; display: grid; gap: 7px; }
.field > label { font: 600 14px var(--fh); letter-spacing: var(--tight); }
.field > label .m { font-family: var(--fb); font-weight: 400; letter-spacing: 0; }
.field .pick { margin-top: 0; }
.err { color: #ff6b70; font-size: 13px; }
.err:empty { display: none; }
.hint { font-size: 13px; color: var(--hint); }
.hint summary { cursor: pointer; color: var(--mint); }
.hint div { margin-top: 6px; line-height: 1.5; }
.filebtn { margin-top: 0; }
.found { border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; display: grid; gap: 6px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph { aspect-ratio: 1; border-radius: 10px; background: #1e1e1e center/cover no-repeat; position: relative; }
.ph .x { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.6); color: #fff; border-radius: 999px; }
.ph.add { display: grid; place-items: center; font-size: 28px; color: var(--hint); border: 1px dashed rgba(255,255,255,.2); background: none; cursor: pointer; }
.own { border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 14px; padding: 11px 13px; margin: 10px 0; }
.own-btns .btn.small { margin-top: 8px; }
.sheet-text { line-height: 1.45; }
.done { text-align: center; padding-top: 30px; }
.done .big { font-size: 48px; }
.origin { display: none; }

/* ---------- Медали ---------- */
.medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 6px; margin-top: 4px; }
.medal { position: relative; display: flex; flex-direction: column; align-items: center; border: 0; background: none; padding: 6px 0 0; cursor: pointer; color: inherit;
  animation: medalIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.medal svg { width: 100%; max-width: 100px; height: auto; display: block; }
.medal .lvl { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font: 700 11px var(--fh); letter-spacing: var(--tight);
  background: var(--cream); color: var(--ink); border-radius: 8px; padding: 3px 8px; box-shadow: 0 3px 8px rgba(0,0,0,.5); z-index: 2; }
.medal .nm { font: 600 11.5px/1.2 var(--fh); letter-spacing: var(--tight); margin-top: 2px; text-align: center; }
.medal.off .nm { color: #6f6f69; }
.medal .bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.1); margin-top: 7px; width: 64%; overflow: hidden; }
.medal .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint-d), var(--mint)); border-radius: 4px; }
.section .m { font-family: var(--fb); font-size: 14px; letter-spacing: 0; font-weight: 400; }
.tip { margin: -4px 2px 10px; }
.medal-card { text-align: center; justify-items: center; }
.medal-card .big svg { width: 180px; height: auto; animation: medalBig .6s var(--spring) both; }
.medal-card p { margin: 4px 0; color: #c9c9c3; font-size: 14px; }
.medal-card .btn { width: 100%; }
.tierchip { font: 600 12px var(--fh); letter-spacing: var(--tight); padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.08); }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; }
.ladder span { font: 600 11.5px var(--fh); letter-spacing: var(--tight); padding: 6px 9px; border-radius: 9px; border: 1px solid var(--line); color: var(--hint); }
.ladder span.on { background: var(--cream); color: var(--ink); border-color: transparent; }
.ladder span.next { border-color: var(--mint); color: var(--mint); }
.tiers { display: flex; justify-content: center; gap: 0; }
.tiers span { width: 46px; }
.tiers span svg { width: 46px; height: auto; }
.tiers span.dim { opacity: .35; filter: grayscale(.6); }

/* Ник, «основатель», медали рядом с ником */
.nameline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.nameline.big .nm { font: 600 22px var(--fh); letter-spacing: var(--tight); }
.founder { font: 600 10.5px var(--fh); letter-spacing: var(--tight); color: var(--ink); background: var(--mint); padding: 3px 8px; border-radius: 999px; }
.mini { display: inline-flex; }
.mini svg { height: auto; }
.shopline { display: block; width: 100%; text-align: left; margin-top: 12px; border: 1px solid rgba(143,220,198,.35); background: rgba(143,220,198,.08);
  color: var(--mint); border-radius: 14px; padding: 11px 13px; font-size: 13.5px; cursor: pointer; }
.links { display: flex; gap: 18px; justify-content: center; margin: 26px 0 6px; }
.links button { border: 0; background: none; color: var(--hint); font-size: 13.5px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* Как у нас всё устроено */
.principles { margin-top: 10px; }
.pr { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.pr .n { font: 600 15px var(--fh); color: var(--mint); width: 26px; flex: none; }
.pr b { font: 600 15px var(--fh); letter-spacing: var(--tight); }
.pr p { margin: 4px 0 0; color: #c9c9c3; font-size: 14px; }

/* Фото на весь экран */
.viewer { position: fixed; inset: 0; z-index: 50; --bg: 1; background: rgba(0,0,0,calc(.96 * var(--bg))); opacity: 0; transition: opacity .28s var(--ease); }
.viewer.open { opacity: 1; }
.viewer.closing { opacity: 0; }
.vtrack { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.vtrack::-webkit-scrollbar { display: none; }
.vslide { flex: none; width: 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.vslide img { max-width: 100%; max-height: 100%; object-fit: contain; transform: scale(.94); transition: transform .38s var(--spring); }
.viewer.open .vslide img { transform: scale(1); }
.vtop { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; }
.vcount { font: 600 13px var(--fh); letter-spacing: var(--tight); color: #ddd; }

/* ---------- Анимации: быстро и плавно ---------- */
:root { --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.4, .64, 1); --sheet: cubic-bezier(.32, .72, 0, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes medalIn { from { opacity: 0; transform: scale(.82) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes medalBig { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

/* Новый экран мягко «всплывает»; перерисовка того же экрана — без анимации */
#page > * { animation: rise .38s var(--ease) both; }
#page > *:nth-child(2) { animation-delay: 30ms; } #page > *:nth-child(3) { animation-delay: 60ms; }
#page > *:nth-child(4) { animation-delay: 90ms; } #page > *:nth-child(n+5) { animation-delay: 120ms; }
#page.still > *, #page.still .medal, #page.still .card { animation: none; }
#page > .doc { animation: none; }  /* длинный текст с анимацией на iPhone может не отрисоваться */
#catalog > * { animation: fadeIn .35s var(--ease) both; }
.grid .card, .strip .card { animation: rise .42s var(--ease) both; }
.grid .card:nth-child(2), .strip .card:nth-child(2) { animation-delay: 40ms; }
.grid .card:nth-child(3), .strip .card:nth-child(3) { animation-delay: 80ms; }
.grid .card:nth-child(4), .strip .card:nth-child(4) { animation-delay: 110ms; }
.grid .card:nth-child(n+5) { animation-delay: 140ms; }

/* Отклик на нажатие: лёгкое «вдавливание» */
.card, .btn, .chip, .medal, .phrase, .tab, .heart, .polaroid, .seller, .round, .more, .sell, .shopline, .x {
  transition: transform .18s var(--ease), opacity .18s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.card:active, .polaroid:active, .seller:active { transform: scale(.975); }
.btn:active, .chip:active, .phrase:active, .more:active, .sell:active, .shopline:active { transform: scale(.965); }
.medal:active { transform: scale(.93); }
.tab:active, .round:active, .x:active { transform: scale(.88); }
.heart:active { transform: scale(.85); }
.heart.pop { animation: pop .45s var(--spring); }
.polaroid:active { transform: rotate(4deg) scale(.97); }

/* Шторка: выезжает как в iOS, фон затемняется */
.sheet { animation: fadeIn .25s var(--ease) both; }
.sheet .sheet-box { animation: sheetUp .42s var(--sheet) both; }
.sheet.closing { animation: fadeIn .24s var(--ease) reverse both; }
.sheet.closing .sheet-box { transition: transform .26s var(--ease); transform: translateY(100%); animation: none; }

/* Фото: проявляются, листаются по одной */
.gallery { scroll-behavior: smooth; overscroll-behavior-x: contain; }
.gallery img { scroll-snap-stop: always; opacity: 0; transition: opacity .35s var(--ease); cursor: zoom-in; }
.gallery img.ld { opacity: 1; }
.thumb { transition: transform .18s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* Предзаказ, «магазин», документы */
.flag.pre { background: var(--blue); color: #fff; }
.preorder { border: 1px solid rgba(111,155,255,.35); background: rgba(111,155,255,.08); border-radius: 14px; padding: 11px 13px; margin: 8px 0;
  display: grid; gap: 3px; font-size: 13.5px; color: #cfd8f5; }
.preorder b { font: 600 13px var(--fh); letter-spacing: var(--tight); color: var(--blue); }
/* Безопасная сделка через гаранта: заметно, но спокойно — мятная рамка, кнопка справа */
.guard { display: grid; gap: 9px; border: 1px solid rgba(143,220,198,.4); background: rgba(143,220,198,.07);
  border-radius: 14px; padding: 12px 13px; margin: 8px 0; }
.guard > div { display: grid; gap: 3px; }
.guard b { font: 600 13.5px var(--fh); letter-spacing: var(--tight); color: var(--mint); }
.guard span { font-size: 12.5px; color: #c4d6cf; line-height: 1.4; }
.guard .btn { width: auto; justify-self: start; padding: 9px 16px; background: var(--mint); color: var(--ink); }
.phrase.guard-p { color: var(--mint); border-color: rgba(143,220,198,.4); }
.scan b.h .opt { font: 500 13px var(--fb, inherit); color: #5d625b; letter-spacing: 0; }
/* Коллекция Discogs в шторке */
.dg-items { display: grid; gap: 6px; max-height: 48vh; overflow-y: auto; margin: 8px 0; }
.dg-item { display: flex; gap: 10px; align-items: center; text-align: left; background: transparent; border: 1px solid var(--line);
  border-radius: 12px; padding: 7px; color: inherit; cursor: pointer; }
.dg-item img, .dg-item .noimg { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--ink2); }
.dg-item b { display: block; font-size: 13.5px; }
.dg-item small { color: var(--hint); font-size: 12px; }
.founder.shop { background: var(--cream); }
.founder.trusted { background: transparent; color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); margin-left: 4px; }
.consent { font-size: 12.5px; color: var(--hint); margin: 18px 2px 0; }
.consent a, .docs a { color: var(--mint); }
.docs { display: grid; gap: 0; }
.docs a { text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.doc h3 { font: 600 16px var(--fh); letter-spacing: var(--tight); margin: 22px 0 6px; }
.doc p, .doc li { color: #d6d6d1; font-size: 14px; line-height: 1.5; }
.doc p { margin: 6px 0; }
.doc ul { margin: 6px 0; padding-left: 20px; }

/* Штрих-код — главный блок формы «Продать» */
.scan { margin: 16px -16px 0; padding: 18px 18px 16px; display: grid; gap: 9px; }
.scan b.h { font-size: 20px; }
.scan > .m { color: #3f423d; }
.scan > .btn { background: var(--ink); color: #fff; padding: 15px; }
.scan .txt { background: rgba(255,255,255,.75); border-color: rgba(13,13,13,.14); color: var(--ink); }
.scan .txt::placeholder { color: #6b6e68; }
.scan .rowi .btn { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.scan .found { background: rgba(255,255,255,.72); border-color: rgba(13,13,13,.12); color: var(--ink); }
.scan .found .m, .scan .found .hint, .scan .err { color: #3f423d; }
.scan .found .hint summary { color: #1f6b52; }
.scan .found .ok { font: 600 12.5px var(--fh); letter-spacing: var(--tight); color: #1f6b52; }
.scan .found .btn { background: var(--ink); color: #fff; }
.scan .found .btn.ghost { background: transparent; color: var(--ink); border-color: rgba(13,13,13,.3); }
.scan .err { color: #b3261e; }

/* Ранний доступ и «Что ищут» */
.early { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 6px; }
.eh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.eh b { font: 600 16px var(--fh); letter-spacing: var(--tight); }
.eh span { font-size: 12.5px; color: var(--mint); white-space: nowrap; }
.early .pbar { margin: 2px 0; }
.wantedlist { display: flex; flex-wrap: wrap; gap: 6px; }
.wq { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 7px 7px 13px; cursor: pointer; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; transition: transform .18s var(--ease); }
.wq:active { transform: scale(.965); }
.wq i { font: 600 11px var(--fh); font-style: normal; background: var(--mint); color: var(--ink); border-radius: 999px; padding: 2px 7px; }
