/* «Моя шкатулка» — чёрное и золото. */
:root {
  --bg: #070707;
  --bg-2: #0e0e0f;
  --card: #121212;
  --card-2: #18181a;
  --line: rgba(212, 175, 98, .22);
  --line-2: rgba(212, 175, 98, .45);
  --gold: #d4af62;
  --gold-hi: #f4e2ae;
  --gold-lo: #9a7531;
  --gold-grad: linear-gradient(135deg, #f6e7b8 0%, #d9b469 38%, #b38a3e 70%, #e8cf8a 100%);
  --ink: #f1e9d8;
  --muted: #9b9384;
  --ok: #8fc79f;
  --bad: #e08a7e;
  --radius: 16px;
  --serif: "Didot", "Bodoni 72", "Bodoni Moda", "Playfair Display", Georgia, serif;
  --sans: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(90% 50% at 50% -10%, rgba(212,175,98,.13), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom);
  letter-spacing: .01em;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.gold-text, .top h1, .title-row h2, .panel h3, .sheet h3, .auth h2, .stat b, .card .price {
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.splash { display: grid; place-items: center; min-height: 100vh; font-family: var(--serif); font-size: 34px; color: var(--gold); letter-spacing: .04em; }

/* Шапка */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgba(7,7,7,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line-2); }
.top .brand { flex: 1; min-width: 0; }
.top h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: .03em; }
.top small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .32em; text-transform: uppercase; margin-top: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-family: var(--serif); font-size: 17px; }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .35em; font-size: 10px; color: var(--gold); margin: 6px 0 4px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title-row h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: .01em; }

.btn {
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  border-radius: 12px; padding: 12px 16px; font-weight: 500; letter-spacing: .02em;
  transition: background .15s, border-color .15s;
}
.btn:active { background: rgba(212,175,98,.08); }
.btn.primary { background: var(--gold-grad); color: #1a1408; border: 0; font-weight: 600; box-shadow: 0 6px 22px rgba(212,175,98,.22); }
.btn.soft { border-color: var(--gold); color: var(--gold-hi); }
.btn.danger { color: var(--bad); border-color: rgba(224,138,126,.4); }
.btn.small { padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; }
[data-act="add"] { white-space: nowrap; }

/* Вкладки */
.tabs { display: flex; justify-content: space-between; gap: 8px; margin: 20px 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 10px 0; color: var(--muted); font-size: 15px; white-space: nowrap; flex: none; border-bottom: 2px solid transparent; letter-spacing: .03em; }
.tabs button.on { color: var(--gold-hi); border-bottom-color: var(--gold); }
.count { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--gold); font-size: 12px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.toolbar input, .toolbar select, .in {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); border-radius: 12px; padding: 12px 14px; outline: none;
}
.toolbar input:focus, .in:focus { border-color: var(--gold); }
.toolbar input { flex: 1; min-width: 0; }
.toolbar input::placeholder, .in::placeholder { color: #6d675c; }
select { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px !important; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; color: #cfc6b3; border-radius: 99px; padding: 6px 12px; font-size: 13px; letter-spacing: .02em; }
.chip i { font-style: normal; color: var(--gold); margin-left: 6px; font-size: 12px; }
.chip i:empty { display: none; }
.chip.on { background: var(--ink); color: #121212; border-color: var(--ink); }
.chip.on i { color: #7a5c20; }
.chips.mat .chip { border-color: rgba(212,175,98,.35); color: var(--gold-hi); }
.chips.mat .chip.on { background: var(--gold-grad); color: #1a1408; border-color: transparent; }
.meta { color: var(--muted); font-size: 13px; margin: 8px 0 14px; letter-spacing: .04em; }

/* Сетка карточек */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; } }
.card { background: linear-gradient(180deg, var(--card-2), var(--card)); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.card .ph { position: relative; aspect-ratio: 1; background: #1c1c1c center/cover no-repeat; cursor: pointer; border-bottom: 1px solid var(--line); }
.badge { position: absolute; top: 8px; left: 8px; background: rgba(7,7,7,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--ink); border: 1px solid var(--line-2); border-radius: 99px; padding: 3px 10px; font-size: 11px; letter-spacing: .05em; }
.badge.reserved { color: #f1cf86; border-color: #c99a3c; }
.badge.sold { color: var(--ok); border-color: rgba(143,199,159,.5); }
.badge.purchase { color: #d8c0f0; border-color: rgba(216,192,240,.45); }
.card .body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .row { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.card h3 { margin: 3px 0 0; font-size: 15px; font-weight: 500; line-height: 1.3; cursor: pointer; color: var(--ink); }
.card .mats { font-size: 11px; color: var(--gold); letter-spacing: .03em; }
.card .where { font-size: 12px; opacity: .8; margin-top: 4px; }
.card .price { font-family: var(--serif); font-size: 24px; margin-top: auto; padding-top: 8px; }
.card .price small { font-family: var(--sans); font-size: 11px; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.card .acts { display: grid; gap: 6px; margin-top: 8px; }
.card .acts .btn { padding: 9px; font-size: 13px; border-radius: 10px; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-family: var(--serif); font-size: 18px; }

/* Панели */
.panel { background: linear-gradient(180deg, var(--card-2), var(--card)); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; border: 1px solid var(--line); }
.panel h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 10px; }
.panel p { color: #b9b09f; line-height: 1.5; margin: 6px 0 12px; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 26px; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: .03em; }

.list { display: grid; gap: 10px; }
.li { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 14px; padding: 10px; border: 1px solid var(--line); }
.li .thumb { width: 64px; height: 64px; border-radius: 10px; background: #1c1c1c center/cover; flex: none; cursor: pointer; }
.li .info { flex: 1; min-width: 0; }
.li .info b { display: block; font-size: 15px; font-weight: 500; }
.li .info span { font-size: 13px; color: var(--muted); }
.li .right { text-align: right; font-size: 14px; }
.profit { color: var(--ok); font-weight: 600; }
.profit.neg { color: var(--bad); }

/* Окна */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } }
.sheet { background: var(--bg-2); color: var(--ink); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; }
@media (min-width: 700px) { .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); } }
.sheet h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; }
.x { background: none; border: 0; font-size: 28px; line-height: 1; color: var(--gold); -webkit-text-fill-color: var(--gold); }
label.f { display: block; font-size: 11px; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; margin: 16px 0 6px; }
.in { width: 100%; }
textarea.in { min-height: 84px; resize: vertical; }
input[type="date"].in { color-scheme: dark; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photos { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.photos .p { position: relative; width: 92px; height: 92px; border-radius: 12px; background: #1c1c1c center/cover; flex: none; border: 1px solid var(--line); }
.photos .p button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 14px; }
.photos .add { width: 92px; height: 92px; border-radius: 12px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--gold); font-size: 28px; flex: none; background: none; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick .chip { font-size: 14px; padding: 7px 12px; }
.pick.mat .chip { color: var(--gold-hi); border-color: rgba(212,175,98,.35); }
.pick.mat .chip.on { background: var(--gold-grad); color: #1a1408; border-color: transparent; }
.checks { display: flex; gap: 18px; margin-top: 12px; color: #cfc6b3; }
.checks label { display: flex; gap: 6px; align-items: center; }
input[type="checkbox"] { accent-color: var(--gold); width: 17px; height: 17px; }
.sheet .acts { display: grid; gap: 8px; margin-top: 20px; }
.viewer { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.viewer img { flex: none; width: 100vw; height: 100vh; object-fit: contain; scroll-snap-align: center; }
.viewer .x { position: fixed; top: calc(env(safe-area-inset-top) + 10px); right: 14px; font-size: 34px; z-index: 61; }

/* Вход */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .panel { width: 100%; max-width: 400px; padding: 28px 24px; }
.auth .logo { text-align: center; margin-bottom: 16px; }
.auth .logo img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 0 0 1px var(--line-2), 0 10px 40px rgba(212,175,98,.18); }
.auth h2 { font-family: var(--serif); font-weight: 400; text-align: center; margin: 6px 0 0; font-size: 34px; letter-spacing: .02em; }
.auth .sub { text-align: center; color: var(--muted); margin: 6px 0 12px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; }
.link { background: none; border: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #151515; color: var(--ink); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.6); z-index: 80; max-width: 90vw; }
.banner { background: rgba(212,175,98,.1); border: 1px solid var(--line-2); color: var(--gold-hi); padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; }
.progress { height: 6px; background: #222; border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress div { height: 100%; background: var(--gold-grad); width: 0; transition: width .2s; }
footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 24px 16px 30px; border-top: 1px solid var(--line); max-width: 1100px; margin: 20px auto 0; }

/* Переключатель языка */
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 99px; overflow: hidden; flex: none; }
.lang button { background: none; border: 0; color: var(--muted); font-size: 11px; letter-spacing: .1em; padding: 6px 9px; }
.lang button.on { background: var(--gold-grad); color: #1a1408; font-weight: 600; }
@media (max-width: 380px) { .tabs button { font-size: 14px; } .count { margin-left: 4px; padding: 0 6px; } }

/* Заказы */
.card .wants { font-size: 12px; color: var(--gold-hi); }
.card .wants a, .wants a { color: var(--gold); text-decoration: underline; cursor: pointer; }
.card .note { font-size: 12px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .ph.noph { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #241d10, #0e0e0f 70%); }
.card .ph .ghost { font-size: 44px; color: var(--gold); opacity: .55; }
.badge.rq-open { color: var(--gold-hi); border-color: var(--gold); }
.badge.rq-found { color: #f1cf86; }
.badge.rq-done { color: var(--ok); }
.badge.rq-cancelled { color: var(--muted); }
.card .acts a.btn { text-align: center; text-decoration: none; padding: 9px; font-size: 13px; border-radius: 10px; }
.li.market { align-items: flex-start; }
.li .mats { display: block; color: var(--gold); font-size: 12px; margin-top: 2px; }
.li .who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.li .who .chip { font-size: 12px; padding: 5px 10px; }

/* Вкладки: на телефоне — панель внизу, как в приложении */
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; display: none; }
@media (max-width: 699px) {
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(7,7,7,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); border-bottom: 0;
  }
  .tabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; font-size: 10.5px; letter-spacing: .02em; border-bottom: 0; }
  .tabs button.on { color: var(--gold); }
  .tabs svg { display: block; }
  .tabs .count { position: absolute; top: 0; left: 55%; margin: 0; padding: 0 5px; font-size: 10px; line-height: 16px; background: var(--gold-grad); color: #1a1408; border: 0; font-weight: 600; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  main { padding-top: 14px; }
  .title-row h2 { font-size: 26px; }
}
@media (min-width: 700px) { .tabs { justify-content: flex-start; gap: 30px; } }
.colsel { font-family: var(--serif); font-size: 26px; color: var(--gold-hi); background-color: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 2px 30px 4px 0 !important; max-width: 100%; }
.colsel option { color: #111; font-family: var(--sans); font-size: 16px; }

/* Для создательницы */
.avatar.founder { position: relative; border-color: var(--gold); box-shadow: 0 0 14px rgba(212,175,98,.45); }
.avatar .crown { position: absolute; top: -13px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 15px; color: var(--gold); text-shadow: 0 0 8px rgba(212,175,98,.7); }
.founder-card { display: flex; gap: 14px; align-items: center; padding: 16px 18px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid var(--gold); background: linear-gradient(135deg, rgba(246,231,184,.12), rgba(179,138,62,.06)); }
.founder-card > span { font-size: 34px; color: var(--gold); }
.founder-card b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--gold-hi); }
.founder-card small { color: var(--muted); }
footer .sign { display: inline-block; margin-top: 6px; color: var(--gold); opacity: .75; cursor: pointer; }
.top img[data-act="egg"] { cursor: pointer; }

/* Пасхалка */
.egg { position: fixed; inset: 0; z-index: 90; background: radial-gradient(circle at 50% 45%, rgba(40,30,12,.92), rgba(0,0,0,.94)); display: grid; place-items: center; overflow: hidden; animation: eggIn .4s ease; }
.egg i { position: absolute; top: -40px; font-style: normal; color: var(--gold); text-shadow: 0 0 10px rgba(246,231,184,.8); animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); opacity: .2; } }
@keyframes eggIn { from { opacity: 0; } }
.egg-card { position: relative; text-align: center; padding: 34px 30px; border: 1px solid var(--gold); border-radius: 22px; background: rgba(7,7,7,.75); box-shadow: 0 0 60px rgba(212,175,98,.35); animation: pop .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.egg-crown { font-size: 52px; color: var(--gold); text-shadow: 0 0 18px rgba(246,231,184,.9); }
.egg-title { font-family: var(--serif); font-size: 30px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.egg-sub { color: var(--muted); letter-spacing: .3em; text-transform: uppercase; font-size: 11px; margin-top: 10px; }
.egg-name { font-family: var(--serif); font-size: 42px; margin-top: 4px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.egg-brand { margin-top: 16px; font-size: 11px; letter-spacing: .35em; color: var(--gold); }

/* Находки: рынки и места */
h2.sec { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 4px 0 0; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h3.sub { font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); font-weight: 500; margin: 18px 0 8px; }
.li .note { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.market-li { align-items: flex-start; }
.market-li .date { flex: none; width: 58px; text-align: center; border: 1px solid var(--line-2); border-radius: 12px; padding: 6px 0; }
.market-li .date b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--gold-hi); font-weight: 400; }
.market-li .date span, .market-li .date small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.market-li.past { opacity: .7; }
.li .who a.chip { text-decoration: none; color: var(--gold-hi); }
.li .thumb { display: grid; place-items: center; }
.ghost-sm { color: var(--gold); opacity: .5; font-size: 22px; }

/* Плашка «Есть новая версия» */
.updbar { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  background: #15120c; border: 1px solid var(--gold, #c9a45c); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.updbar span { color: var(--gold, #c9a45c); font-size: 14px; }
@media (min-width: 700px) { .updbar { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }

/* Место: полоски и сирена */
.ubar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin: 6px 0 4px; }
.ubar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #8a6d33, #e3c27a); }
.ubar i.hot { background: linear-gradient(90deg, #9b2c2c, #e05a4f); }
.banner.alarm { border-color: #e05a4f; background: rgba(224, 90, 79, .12); }
