/* Cramb Shop — минимализм «под водой».
   Фон — светлая толща воды (water.js: каустика, лучи, взвесь), поверх — стекло: матовые светлые блоки с размытием того,
   что под ними. Тёмный текст, один акцент — глубокий морской. Никаких градиентных кнопок, бликов-«шайнов» и эмодзи-списков. */
:root {
  color-scheme: light;
  --ink: #062a3c; --ink2: #3f6a7e; --ink3: #7c9cab;
  --glass: rgba(255,255,255,.46); --glass-hi: rgba(255,255,255,.66); --glass-line: rgba(255,255,255,.75);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 10px 30px rgba(4,52,74,.12);
  --blur: blur(22px) saturate(170%);
  --accent: #063c56; --on-accent: #fff; --sep: rgba(6,42,60,.08); --fill: rgba(6,42,60,.06);
  --ok: #12a46b; --bad: #d8394b;
  --sab: max(env(safe-area-inset-bottom), var(--tg-sab, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; color: var(--ink); overscroll-behavior: none; background: #9fdcec; }
html.no-gl body { background: linear-gradient(#cdf2fb, #79d0e6 55%, #3497b8); }
body { font: 16px/1.35 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { border: 0; outline: none; background: transparent; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
svg { display: block; }
.ic { display: inline-flex; width: 20px; height: 20px; flex-shrink: 0; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
tgs-sticker { display: block; flex-shrink: 0; }

@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-100vh - 140px), 0); } }
@keyframes sway { 0%, 100% { margin-left: -7px; } 50% { margin-left: 7px; } }
@keyframes burst { from { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; } 12% { opacity: 1; } to { transform: translate3d(var(--x, 0), -70vh, 0) scale(1); opacity: 0; } }
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- вода и пузыри ---------- */
#water { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; image-rendering: auto; }
html.no-gl #water { display: none; }
.bubbles { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.bubbles i, .burst i { position: absolute; border-radius: 50%; will-change: transform;
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 10%, rgba(255,255,255,.22) 22%, rgba(255,255,255,.06) 55%, rgba(255,255,255,.7) 69%, transparent 72%); }
.bubbles i { bottom: -60px; animation: rise var(--d, 14s) linear var(--w, 0s) infinite, sway calc(var(--d, 14s) / 4) ease-in-out var(--w, 0s) infinite; }
.paused .bubbles i, .bubbles.paused i { animation-play-state: paused; }
.burst { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.burst i { bottom: 40px; animation: burst var(--d, 1.6s) cubic-bezier(.25,.6,.3,1) var(--w, 0s) forwards; opacity: 0; }

/* ---------- стекло ---------- */
.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow); border: 1px solid var(--glass-line); }

/* ---------- каркас ---------- */
.app { position: fixed; inset: 0; z-index: 2; max-width: 560px; margin: 0 auto; overflow: hidden; }
.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain;
  padding: var(--top, 12px) 0 calc(var(--sab) + 104px); }
.scroll::-webkit-scrollbar { display: none; }
.screen { display: none; flex-direction: column; }
.screen.on { display: flex; animation: fade .25s ease; }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 18px 2px 20px; min-height: 48px; }
.mark { font-size: 28px; line-height: 32px; font-weight: 800; letter-spacing: -1.2px; }
.mark span { font-weight: 400; color: var(--ink2); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 18px 2px 20px; min-height: 48px; }
.nav h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -1px; }
.chip { flex-shrink: 0; height: 34px; padding: 0 13px; border-radius: 999px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip .ic { width: 16px; height: 16px; }
.chip:active, .icbtn:active { transform: scale(.95); }
.lead { padding: 2px 20px 4px; font-size: 15px; line-height: 20px; color: var(--ink2); }

/* ---------- фильтры ---------- */
.chips { display: flex; gap: 8px; padding: 12px 16px 2px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex-shrink: 0; height: 34px; padding: 0 15px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink2);
  background: rgba(255,255,255,.32); border: 1px solid rgba(255,255,255,.5); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: background .2s, color .2s; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- карточка схемы ---------- */
.cards { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 0; }
.card { display: block; width: 100%; padding: 8px; border-radius: 26px; text-align: left; animation: up .45s cubic-bezier(.2,.8,.2,1) backwards;
  transition: transform .18s ease; }
.card:active { transform: scale(.98); }
.cover { position: relative; aspect-ratio: 16 / 9; border-radius: 19px; overflow: hidden; background: rgba(6,42,60,.08); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .flag { position: absolute; left: 10px; top: 10px; height: 26px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--ink); }
.cover .flag.ok { background: var(--ok); color: #fff; }
.card__body { padding: 12px 8px 6px; }
.card__row { display: flex; align-items: flex-start; gap: 12px; }
.card__t { flex: 1; min-width: 0; font-size: 19px; line-height: 24px; font-weight: 700; letter-spacing: -.3px; }
.card__p { margin-top: 3px; font-size: 14.5px; line-height: 19px; color: var(--ink2); }
.price { flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; }
.price small { font-size: 12px; opacity: .8; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.meta span { height: 26px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,.55); color: var(--ink2); }
.diff { display: inline-flex; gap: 2px; }
.diff i { width: 4px; height: 10px; border-radius: 2px; background: rgba(6,42,60,.16); }
.diff i.on { background: var(--accent); }

/* ---------- кнопки ---------- */
.btn { position: relative; width: 100%; height: 54px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16.5px; font-weight: 700; background: var(--accent); color: var(--on-accent); transition: transform .15s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn.soft { background: rgba(255,255,255,.6); color: var(--ink); }
.btn.danger { background: rgba(255,255,255,.6); color: var(--bad); }
.btns { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.4px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ---------- группы и строки ---------- */
.sec { margin: 22px 22px 8px; font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; }
.group { margin: 0 16px; border-radius: 22px; overflow: hidden; }
.sheet .group { margin: 0; }
.cell { position: relative; width: 100%; min-height: 56px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.cell + .cell::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--sep); }
button.cell { transition: background .15s; }
button.cell:active { background: rgba(255,255,255,.4); }
.cell__ic { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cell__thumb { width: 58px; height: 36px; border-radius: 9px; flex-shrink: 0; object-fit: cover; background: var(--fill); }
.cell__m { flex: 1; min-width: 0; }
.cell__t { font-size: 16px; line-height: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell__s { margin-top: 1px; font-size: 13.5px; line-height: 18px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell__r { flex-shrink: 0; font-size: 14px; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.cell__r .ic { width: 15px; height: 15px; color: var(--ink3); }
.cell__r b { color: var(--ink); font-weight: 700; }
.foot { margin: 10px 22px 0; font-size: 13px; line-height: 18px; color: var(--ink2); }

/* ---------- профиль и статистика ---------- */
.me { margin: 10px 16px 0; padding: 14px 16px; border-radius: 24px; display: flex; align-items: center; gap: 14px; }
.me__ava { width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
  background: var(--accent); color: #fff; }
.me__n { font-size: 19px; font-weight: 700; }
.me__u { margin-top: 2px; font-size: 14px; color: var(--ink2); }
.me tgs-sticker { margin-left: auto; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 16px 0; }
.tiles.two { grid-template-columns: 1fr 1fr; }
.tile { min-width: 0; padding: 12px 13px; border-radius: 20px; display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: 12.5px; color: var(--ink2); }
.tile b { font-size: 22px; line-height: 27px; font-weight: 800; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { font-size: 12px; color: var(--ink2); }

/* ---------- пусто ---------- */
.empty { margin: 14px 16px 0; padding: 22px 20px 24px; border-radius: 26px; display: flex; flex-direction: column; align-items: center; text-align: center; animation: up .4s ease backwards; }
.empty tgs-sticker { margin-bottom: 10px; }
.empty b { font-size: 18px; font-weight: 700; }
.empty span { margin-top: 6px; max-width: 280px; font-size: 14.5px; line-height: 20px; color: var(--ink2); }
.empty .btn { margin-top: 16px; max-width: 240px; height: 46px; }
.skel { height: 290px; border-radius: 26px; background: linear-gradient(100deg, rgba(255,255,255,.28) 30%, rgba(255,255,255,.55) 50%, rgba(255,255,255,.28) 70%) 0 0 / 300% 100%;
  animation: skel 1.3s linear infinite; }

/* ---------- нижнее меню — стеклянная пилюля ---------- */
.tabbar { position: absolute; z-index: 12; left: 0; right: 0; bottom: calc(var(--sab) + 10px); display: flex; justify-content: center; padding: 0 14px; pointer-events: none; }
.pill { pointer-events: auto; position: relative; width: 100%; max-width: 420px; height: 64px; padding: 5px; border-radius: 32px; display: flex; }
.pill__hl { position: absolute; top: 5px; bottom: 5px; left: 5px; border-radius: 27px; background: rgba(255,255,255,.72);
  box-shadow: 0 2px 10px rgba(4,52,74,.12); transition: transform .38s cubic-bezier(.3,1.25,.5,1), width .38s; }
.tab { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; border-radius: 27px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink2); transition: color .2s; }
.tab.on { color: var(--ink); }
.tab:active { transform: scale(.94); }
.tab__ic { position: relative; display: block; width: 24px; height: 24px; }
.tab__ic svg { width: 24px; height: 24px; fill: currentColor; fill-opacity: 0; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: fill-opacity .2s; }
.tab.on .tab__ic svg { fill-opacity: 1; }
.tab__l { font-size: 10.5px; line-height: 12px; font-weight: 600; white-space: nowrap; }
.tab__n { position: absolute; top: -4px; left: 15px; min-width: 16px; height: 16px; padding: 0 4.5px; border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 10px; line-height: 16px; font-weight: 700; text-align: center; animation: pop .35s ease; }

/* ---------- шторка — толстое стекло ---------- */
.dim { position: absolute; inset: 0; z-index: 30; background: rgba(4,40,58,.28); opacity: 0; transition: opacity .3s ease; }
.dim.on { opacity: 1; }
.sheet { position: absolute; z-index: 31; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--top, 12px) - 10px); border-radius: 30px 30px 0 0; overflow: hidden;
  display: flex; flex-direction: column; background: rgba(240,250,253,.78); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 -1px 0 rgba(255,255,255,.9) inset, 0 -10px 40px rgba(4,52,74,.18);
  transform: translateY(104%); transition: transform .45s cubic-bezier(.22,1,.36,1); }
.sheet.on { transform: translateY(var(--dy, 0px)); }
.sheet, .dim { will-change: transform, opacity; backface-visibility: hidden; }
.sheet.drag { transition: none; }
.sheet .glass { background: rgba(255,255,255,.62); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-color: rgba(255,255,255,.9); }
.sheet__top { position: relative; flex-shrink: 0; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 0; touch-action: none; }
.sheet__grab { position: absolute; top: 7px; left: 50%; margin-left: -18px; width: 36px; height: 5px; border-radius: 999px; background: rgba(6,42,60,.18); }
.sheet__title { flex: 1; min-width: 0; padding: 0 8px; font-size: 17px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icbtn { width: 32px; height: 32px; flex-shrink: 0; border-radius: 999px; background: rgba(6,42,60,.07); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.icbtn .ic { width: 14px; height: 14px; }
.icbtn svg { stroke-width: 2.4; }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 2px 16px calc(24px + var(--sab)); }
.sheet__body::-webkit-scrollbar { display: none; }
.detail .cover { border-radius: 22px; margin-bottom: 14px; }
.detail__t { font-size: 25px; line-height: 30px; font-weight: 800; letter-spacing: -.6px; }
.detail__p { margin-top: 4px; font-size: 15.5px; color: var(--ink2); }
.specs { margin-top: 14px; border-radius: 20px; overflow: hidden; }
.spec { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; font-size: 15px; }
.spec + .spec { border-top: 1px solid var(--sep); }
.spec span { color: var(--ink2); }
.spec b { font-weight: 600; text-align: right; }
.prose { margin-top: 12px; padding: 14px; border-radius: 20px; font-size: 15px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.prose.secret { -webkit-user-select: text; user-select: text; box-shadow: inset 0 0 0 1.5px rgba(18,164,107,.5); }
.lbl { margin: 18px 4px 8px; font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .4px; display: flex; justify-content: space-between; gap: 10px; }
.lbl span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.note { margin-top: 10px; font-size: 13px; line-height: 18px; color: var(--ink2); text-align: center; }
.lock { margin-top: 12px; padding: 10px 14px 10px 8px; border-radius: 20px; display: flex; gap: 10px; align-items: center; font-size: 14px; line-height: 19px; color: var(--ink2); }
.done { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 0 2px; animation: pop .45s ease; }
.done b { font-size: 20px; margin-top: 4px; }
.done span { margin-top: 2px; font-size: 14px; color: var(--ink2); }

/* ---------- формы ---------- */
.inp { display: block; width: 100%; min-height: 50px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.66); font-size: 16px; line-height: 22px;
  border: 1px solid rgba(255,255,255,.9); transition: box-shadow .15s; }
textarea.inp { resize: none; min-height: 110px; }
.inp:focus { box-shadow: 0 0 0 2px var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
.pricebox { position: relative; }
.pricebox small { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--ink2); pointer-events: none; }
.upl { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 10px; border-radius: 18px; background: rgba(255,255,255,.62); }
.upl img { width: 92px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--fill); flex-shrink: 0; }
.upl__m { flex: 1; min-width: 0; font-size: 14px; line-height: 19px; color: var(--ink2); overflow-wrap: anywhere; }
.upl__m b { display: block; color: var(--ink); font-weight: 600; }
.upl label, .upl .small { flex-shrink: 0; height: 36px; padding: 0 13px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; cursor: pointer; }
.upl .small { background: rgba(6,42,60,.08); color: var(--ink); }
.upl input { display: none; }
.switchrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,.62); margin-top: 10px; }
.switchrow span { flex: 1; font-size: 15px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; background: rgba(6,42,60,.16); flex-shrink: 0; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .25s cubic-bezier(.3,1.3,.5,1); }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }

/* ---------- тост ---------- */
.toast { position: absolute; z-index: 50; left: 0; right: 0; bottom: calc(var(--sab) + 90px); display: flex; justify-content: center; pointer-events: none; }
.toast div { max-width: calc(100% - 40px); padding: 11px 17px; border-radius: 999px; font-size: 14px; font-weight: 600; text-align: center; color: var(--ink);
  background: rgba(255,255,255,.8); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 8px 26px rgba(4,52,74,.2); animation: up .25s ease backwards; }

/* ---------- заставка: вода уже течёт, на ней динозавр на круге ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity .5s ease; }
.splash.off { opacity: 0; pointer-events: none; }
.splash .mark { margin-top: 6px; font-size: 34px; line-height: 38px; animation: up .6s .1s ease backwards; }
.splash__text { margin-top: 6px; font-size: 14px; color: var(--ink2); animation: fade .8s .25s ease backwards; }
.splash__bar { position: absolute; left: 50%; bottom: calc(max(env(safe-area-inset-bottom), 0px) + 56px); width: 120px; margin-left: -60px; height: 3px; border-radius: 3px; background: rgba(6,42,60,.12); overflow: hidden; }
.splash__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(.04); transition: transform .4s ease; }
.app.hide { opacity: 0; }
.app { transition: opacity .5s ease; }

@media (min-width: 700px) { .app { box-shadow: 0 0 0 1px rgba(255,255,255,.4); } }
