/* DLC | SRC — мини-приложение. Чёрно-белое, шрифт с dlcsrc.site. */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: block;
  src: url(/fonts/open-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: block;
  src: url(/fonts/open-sans-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(/fonts/jetbrains-mono-latin-400.woff2) format("woff2");
}

:root {
  --bg: #000;
  --panel: #0c0c0d;
  --panel-2: #141416;
  --line: #242427;
  --line-soft: #1b1b1e;
  --fg: #fff;
  --muted: #8d8d93;
  --dim: #5c5c62;
  --radius: 16px;
  --tabbar: 74px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --squircle: 28%;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.45 "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

#snow { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 26px 14px calc(var(--tabbar) + 30px + env(safe-area-inset-bottom));
}

.screen { display: none; animation: fade 0.2s var(--ease); }
.screen.on { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- снежная шапка ---------- */
/* Не плоская полоса, а сугроб: сам SVG с градиентом даёт объём,
   тень под ним отделяет его от блока, края сходят на нет. */

.snowcap { position: relative; }
.snowcap::before {
  content: '';
  position: absolute;
  left: -2px; right: -2px; top: -9px;
  height: 26px;
  background: var(--cap) no-repeat left top;
  pointer-events: none;
  z-index: 3;
  transform-origin: 50% 100%;
  animation: settle 0.9s var(--ease) both;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}

/* намело: сугроб оседает сверху вниз */
@keyframes settle {
  from { transform: scaleY(0.35) translateY(-3px); opacity: 0; }
  60%  { transform: scaleY(1.06); opacity: 1; }
  to   { transform: scaleY(1); opacity: 1; }
}

body.plain .snowcap::before { display: none; }

/* под сугробом первой строке нужно немного воздуха */
.snowcap > .row:first-child { padding-top: 17px; }

/* ---------- шапка экрана ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.chip img { width: 26px; height: 26px; border-radius: var(--squircle); object-fit: cover; }

.icon-btn {
  width: 46px; height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--muted);
  transition: transform 0.16s var(--ease), color 0.16s, border-color 0.16s;
}
.icon-btn:active { transform: scale(0.94); color: var(--fg); border-color: #3a3a3f; }

/* ---------- группы строк ---------- */

.group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 56px;
  position: relative;
  transition: background 0.14s;
}
.row + .row::before {
  content: '';
  position: absolute;
  left: 52px; right: 0; top: 0;
  height: 1px;
  background: var(--line-soft);
}
.row:active { background: #141416; }

.row .ico {
  width: 28px; height: 28px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--fg);
}
.row .ico svg { width: 16px; height: 16px; }

.row .label { flex: 1; font-size: 15.5px; }
.row .value {
  color: var(--muted);
  font-size: 15px;
  max-width: 48%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .chev { color: var(--dim); flex: none; }
.row .chev svg { width: 18px; height: 18px; }

.section-title {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin: 0 0 9px 4px;
  font-weight: 600;
}

/* ---------- профиль ---------- */

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
}
.profile .ava {
  width: 62px; height: 62px;
  flex: none;
  border-radius: var(--squircle);
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.profile .ava-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
  color: var(--muted);
}
.profile .who { min-width: 0; }
.profile .who b { display: block; font-size: 18px; font-weight: 700; }
.profile .who span { display: block; color: var(--muted); font-size: 14px; }
.profile .who code {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--dim);
}

/* ---------- переключатель ---------- */

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #2a2a2e;
  border: 1px solid var(--line);
  transition: background 0.24s var(--ease);
}
.switch span::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: #d8d8da;
  transition: transform 0.24s var(--ease), width 0.18s var(--ease), background 0.24s;
}
.switch input:checked + span { background: #fff; border-color: #fff; }
.switch input:checked + span::after { transform: translateX(20px); background: #000; }
.switch input:active + span::after { width: 29px; }
.switch input:checked:active + span::after { transform: translateX(16px); }

/* ---------- поля ---------- */

.field {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 13px 14px;
  font: inherit;
  resize: none;
}
.field::placeholder { color: var(--dim); }
.field:focus { outline: none; border-color: #3d3d42; }

.counter {
  text-align: right;
  color: var(--dim);
  font-size: 12px;
  margin: 7px 4px 18px;
  font-family: "JetBrains Mono", monospace;
}

.btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #000;
  font: 700 15.5px/1 inherit;
  letter-spacing: 0.01em;
  transition: transform 0.15s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; }

/* Кнопка отправки: сразу видно, готова заявка или чего-то не хватает */
.submit {
  height: auto;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--fg);
}
.submit .submit-ico {
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.submit .submit-ico svg { width: 18px; height: 18px; }
.submit .submit-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.submit b { font-size: 15.5px; font-weight: 700; }
.submit small { font-size: 12px; color: var(--muted); font-weight: 400; }

/* всё заполнено — кнопка становится белой и явно зовёт нажать */
.submit.ready {
  background: #fff;
  border-color: #fff;
  color: #000;
}
.submit.ready .submit-ico { background: rgba(0, 0, 0, 0.08); border-color: rgba(0, 0, 0, 0.12); }
.submit.ready small { color: #3c3c42; }

/* ---------- главная ---------- */

.hero {
  text-align: center;
  padding: 24px 18px 20px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.hero-mark {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  border-radius: var(--squircle);
  background: #000 center/cover no-repeat;
  border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.7);
}
.hero h1 {
  margin: 0 0 7px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero p { margin: 0 auto; max-width: 330px; font-size: 13.5px; color: var(--muted); }

.hero-stats {
  display: flex;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.hero-stats div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.hero-stats b { font-size: 19px; font-weight: 700; font-family: "JetBrains Mono", monospace; }
.hero-stats span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.07em; }

/* ---------- каталог ---------- */

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: pop 0.26s var(--ease) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.card .thumb {
  aspect-ratio: 16 / 10;
  background: #09090a center/cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 11px;
  border-bottom: 1px solid var(--line-soft);
}
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.card p {
  margin: 0; font-size: 12px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: "JetBrains Mono", monospace;
}

.card .open {
  margin: 0 12px 12px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--fg);
  font: 600 12.5px/1 inherit;
}
.card .open:active { background: #1c1c1f; }

.empty { text-align: center; color: var(--dim); padding: 46px 20px; font-size: 13.5px; }

/* ---------- правила ---------- */

.rule-block { padding: 15px 16px; }
.rule-block h4 { margin: 0 0 9px; font-size: 14.5px; font-weight: 700; }
.rule-block ul { margin: 0; padding-left: 17px; }
.rule-block li { font-size: 13.5px; color: #b6b6bb; margin-bottom: 7px; }

/* ---------- таббар ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(430px, calc(100% - 26px));
  height: 64px;
  display: flex;
  padding: 6px;
  border-radius: 24px;
  background: rgba(10, 10, 11, 0.82);
  border: 1px solid #2a2a2e;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
  z-index: 20;
  touch-action: none;
}
.tabbar.dragging {
  border-color: #46464c;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.85);
  transform: translateX(-50%) scale(1.03);
  transition: transform 0.18s var(--ease), border-color 0.18s;
}

.tabbar .pill {
  position: absolute;
  top: 6px;
  height: calc(100% - 12px);
  border-radius: 19px;
  background: #1e1e21;
  border: 1px solid #313136;
  transition: transform 0.42s var(--ease);
  pointer-events: none;
  will-change: transform;
}

.tab {
  position: relative;
  flex: 1;
  border: 0;
  background: none;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font: 600 10px/1 inherit;
  letter-spacing: 0.01em;
  transition: color 0.24s var(--ease);
  z-index: 1;
}
.tab svg { width: 22px; height: 22px; }
.tab .glyph { display: block; transition: transform 0.4s var(--ease); }
.tab.on { color: var(--fg); }
.tab.on .glyph { transform: translateY(-1px) scale(1.05); }

.tab .ava-tab {
  width: 23px; height: 23px;
  border-radius: var(--squircle);
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: border-color 0.24s, transform 0.4s var(--ease);
}
.tab.on .ava-tab { border-color: #fff; transform: scale(1.06); }

.ava-letter {
  display: grid;
  place-items: center;
  font: 700 11px/1 inherit;
  color: var(--muted);
}
.tab.on .ava-letter { color: var(--fg); }

.tab .glyph.play-home    { animation: gl-home 0.62s var(--ease); }
.tab .glyph.play-catalog { animation: gl-catalog 0.6s var(--ease); }
.tab .glyph.play-upload  { animation: gl-upload 0.6s var(--ease); }
.tab .glyph.play-account { animation: gl-account 0.6s var(--ease); }

/* домик приседает и выпрямляется */
@keyframes gl-home {
  0%  { transform: translateY(3px) scaleY(0.78) scaleX(1.12); }
  55% { transform: translateY(-4px) scaleY(1.1) scaleX(0.94); }
  to  { transform: translateY(-1px) scale(1.05); }
}
/* сетка доворачивается */
@keyframes gl-catalog {
  0%  { transform: rotate(-70deg) scale(0.72); }
  60% { transform: rotate(8deg) scale(1.1); }
  to  { transform: rotate(0) scale(1.05) translateY(-1px); }
}
/* стрелка выстреливает вверх */
@keyframes gl-upload {
  0%  { transform: translateY(6px) scale(0.84); }
  45% { transform: translateY(-6px) scale(1.12); }
  to  { transform: translateY(-1px) scale(1.05); }
}
/* аватарка пружинит */
@keyframes gl-account {
  0%  { transform: scale(0.74) rotate(-10deg); }
  55% { transform: scale(1.16) rotate(5deg); }
  to  { transform: scale(1.05) translateY(-1px); }
}

/* ---------- тост и лист ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + 30px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: #121214;
  border: 1px solid var(--line);
  padding: 11px 16px;
  border-radius: 13px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s var(--ease);
  z-index: 30;
  max-width: calc(100% - 40px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
  z-index: 40;
}
.sheet-back.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: min(560px, 100%);
  max-height: 72vh;
  overflow-y: auto;
  background: #0c0c0d;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 10px 14px calc(22px + env(safe-area-inset-bottom));
  transition: transform 0.32s var(--ease);
  z-index: 41;
}
.sheet.on { transform: translate(-50%, 0); }
.sheet .grabber { width: 36px; height: 4px; border-radius: 2px; background: #2e2e32; margin: 2px auto 14px; }
.sheet h3 { margin: 0 0 10px 4px; font-size: 15px; font-weight: 700; }

.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 15.5px;
  color: var(--muted);
}
.opt:active { background: #141416; }
.opt.sel { color: var(--fg); }
.opt svg { width: 18px; height: 18px; }

.opt { align-items: center; gap: 12px; }

.opt-ico {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 11px;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.opt-ico-empty {
  display: grid;
  place-items: center;
  font: 700 17px/1 inherit;
  color: var(--dim);
}

.opt-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.opt-text b {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--fg);
}
.opt-text small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.opt.sel .opt-text b { color: #fff; }

.opt-tag {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-family: "JetBrains Mono", monospace;
}
.opt-check { flex: none; color: var(--fg); margin-top: 2px; }

/* список длинный — разделители помогают не теряться */
.opt + .opt { border-top: 1px solid var(--line-soft); border-radius: 0; }

.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: rot 0.7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}
@keyframes rot { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ---------- рекламное место ---------- */

.ad {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px dashed #2e2e33;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, transform 0.15s var(--ease);
}
.ad:active { transform: scale(0.99); background: #141416; }
.ad.taken { border-style: solid; border-color: var(--line); }

.ad-img {
  width: 54px; height: 54px;
  flex: none;
  border-radius: 13px;
  background: var(--panel-2) center/cover no-repeat;
  border: 1px solid var(--line);
}
.ad.taken .ad-img { border-style: solid; }

.ad-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-body b { font-size: 14.5px; font-weight: 700; }
.ad-body span {
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ad-cta {
  margin-top: 5px;
  font-size: 11.5px !important;
  font-weight: 700;
  color: var(--fg) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- широкий баннер ---------- */
/* Когда у рекламы своя картинка 16:9, показываем её целиком,
   а не прячем в квадратик 54×54. */

.ad.wide {
  display: block;
  padding: 0;
  overflow: hidden;
  border-style: solid;
}
.ad.wide .ad-img { display: none; }
.ad.wide .ad-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000 center/cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.ad.wide .ad-body { padding: 12px 14px 14px; }
.ad.wide .ad-body span { -webkit-line-clamp: 3; }

.ad-cover { display: none; }
