:root {
  --bg: #0c0c10;
  --bg-2: #121218;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f4f6;
  --muted: #a3a3ad;
  --red: #e10613;
  --red-2: #ff2a36;
  --radius: 10px;
  --header: 76px;
  --pad: clamp(16px, 4vw, 64px);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 14px;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--red);
  z-index: 40;
}
body.is-loading .nav-progress { width: 70%; transition: width .35s ease; }
#view { animation: rise .42s cubic-bezier(.2, .7, .2, 1); }
#view.is-out { opacity: .35; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.card, .stat, .panel, .btn, .nav-link, .suggest button, .app-row { transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.poster { transition: transform .25s ease, box-shadow .25s ease; }
.card:hover .poster { transform: translateY(-6px); }
@media (prefers-reduced-motion: reduce) {
  #view, #view.is-out, .card, .stat, .btn { animation: none; transition: none; }
}
.btn:hover { transform: translateY(-1px); }
.cabinet { padding: 32px var(--pad) 72px; }
.cabinet-head { display: flex; gap: 20px; align-items: center; margin: 0 0 28px; }
.cabinet-head h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.04em; }
.cabinet-head p { margin: 8px 0 0; color: var(--muted); }
.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red);
  font-size: 30px;
  font-weight: 800;
  flex: none;
  box-shadow: 0 0 0 6px rgba(225, 6, 19, 0.18);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 36px; }
.stat {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 46%),
    #14141a;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 18px 18px 16px;
}
.stat b { display: block; font-size: 34px; letter-spacing: -0.04em; line-height: 1; }
.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat:hover { transform: translateY(-3px); border-color: rgba(225, 6, 19, 0.45); }
.cabinet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 90px),
    #14141a;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 22px 22px 20px;
}
.panel h2 { margin: 0 0 16px; font-size: 18px; letter-spacing: -0.02em; }
.panel .btn { margin-top: 4px; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  height: var(--header);
  padding: 0 var(--pad);
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.92), rgba(8, 8, 12, 0.72) 70%, transparent);
  backdrop-filter: blur(10px);
}
.logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.04em;
  color: var(--red);
  line-height: 1;
}
.nav {
  justify-self: center;
  display: flex;
  gap: 2px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(20, 20, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
}
.nav-link, .drawer-panel button[data-nav], .footer-links button {
  background: transparent;
  border: 0;
  color: #eee;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-link.is-on, .nav-link:hover { background: rgba(255, 255, 255, 0.08); }
.caret { font-size: 10px; opacity: 0.7; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 700;
}
.btn-red { background: var(--red); color: #fff; box-shadow: 0 10px 24px rgba(225, 6, 19, 0.22); }
.btn-red:hover { background: var(--red-2); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}
.btn-block { width: 100%; }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
}
.burger { display: none; flex-direction: column; gap: 5px; }
.burger span { display: block; width: 18px; height: 1.5px; background: #fff; }

.hero {
  position: relative;
  min-height: min(78vh, 760px);
  margin-top: calc(var(--header) * -1);
  padding: calc(var(--header) + 64px) var(--pad) 36px;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(circle at 78% 42%, rgba(255, 176, 92, 0.55), transparent 28%),
    radial-gradient(circle at 62% 18%, rgba(120, 150, 190, 0.28), transparent 22%),
    linear-gradient(90deg, rgba(6, 6, 10, 0.82) 0%, rgba(6, 6, 10, 0.25) 48%, rgba(6, 6, 10, 0.15) 100%),
    linear-gradient(180deg, rgba(6, 6, 10, 0.05), rgba(12, 12, 16, 0.2) 70%, #0c0c10 100%),
    var(--hero, #1a120c);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero-copy { max-width: 640px; position: relative; z-index: 1; }
.kicker {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  color: #ddd;
}
.hero h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.sub {
  margin: 14px 0 0;
  color: #e7e7ea;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
}
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}
.dots {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.dots button {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  border: 0;
  background: rgba(255, 255, 255, 0.35);
  padding: 0;
}
.dots button.is-on { width: 22px; background: var(--red); }
.age {
  position: absolute;
  right: var(--pad);
  bottom: 28px;
  font-size: 28px;
  font-weight: 500;
  opacity: 0.85;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--pad) 12px;
}
.tools-left, .tools-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.chip, .filter {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: #eee;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
}
.chip.is-on { color: #fff; background: var(--red); border-color: transparent; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(360px, 70vw);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
}
.search input, .search-lg input, .field input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
}
.search input::placeholder, .search-lg input::placeholder { color: #8d8d98; }

.section { padding: 28px 0 6px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 0 var(--pad) 14px;
}
.section-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.linkish {
  background: none;
  border: 0;
  color: #ff4d57;
  font-weight: 600;
  padding: 0;
}
.row-wrap { position: relative; }
.row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--pad) 18px;
  scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.arrow {
  position: absolute;
  right: 18px;
  top: 38%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: #111;
  font-size: 20px;
  box-shadow: var(--shadow);
}
.card {
  flex: 0 0 168px;
  scroll-snap-align: start;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  color: #fff;
}
.poster {
  height: 248px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 42%, rgba(0,0,0,0.72)),
    var(--p, #1b1b22);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}
.poster::before {
  content: "";
  position: absolute;
  width: 140%;
  height: 70%;
  left: -20%;
  top: -10%;
  background: radial-gradient(circle, rgba(255,255,255,0.28), transparent 62%);
}
.poster span {
  position: relative;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-shadow: 0 8px 24px rgba(0,0,0,0.65);
}
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 6px;
}
.card small, .grid-card small, .app-card small {
  display: block;
  margin-top: 8px;
  color: #ddd;
  font-size: 13px;
  line-height: 1.3;
}
.card em, .app-card em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px 14px;
  padding: 8px var(--pad) 40px;
}
.grid .card { flex: none; width: 100%; }
.grid .poster { height: auto; aspect-ratio: 2 / 3; }
.grid-card, .app-card {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  color: inherit;
}
.page-hero {
  padding: 32px var(--pad) 4px;
}
.page-hero h1 { margin: 0 0 8px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.04em; }
.page-hero p { margin: 0; color: var(--muted); max-width: 640px; line-height: 1.5; }

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 8px var(--pad) 48px;
}
.app-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 48%),
    #14141a;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  color: inherit;
  text-align: left;
}
.app-row:hover { border-color: rgba(255,255,255,0.16); }
.app-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mono {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--p, #222);
}
.app-row strong { display: block; }
.app-row span { color: var(--muted); font-size: 12px; }
.download {
  border: 1px solid rgba(255,255,255,0.16);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 12px;
}
.download:hover { border-color: #fff; }

.footer {
  margin-top: 24px;
  padding: 28px var(--pad) 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: grid;
  gap: 12px;
}
.footer-brand { font-weight: 800; color: var(--red); font-size: 22px; }
.footer-links { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; }
.footer-note { margin: 0; color: var(--muted); max-width: 720px; }

.drawer, .modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
}
.drawer[hidden], .modal[hidden], .toast[hidden], .suggest[hidden], .pick[hidden] { display: none; }
.drawer-panel, .modal-card {
  background: #16161c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.drawer-panel {
  width: min(420px, 100%);
  margin-left: auto;
  align-self: stretch;
  border-radius: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drawer-panel button[data-nav] {
  text-align: left;
  border-radius: 10px;
  padding: 14px 12px;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-card { width: min(560px, 100%); padding: 22px; position: relative; }
.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 4px;
}
.tab.is-on { color: #fff; box-shadow: inset 0 -2px 0 var(--red); }
.field { display: grid; gap: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: #c8c8d0; }
.field input, .date-row input, .composer input, .composer select {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 13px 14px;
  background: #0e0e12;
}
.field input:focus, .date-row input:focus, .composer input:focus, .composer select:focus, .search:focus-within, .search-lg:focus-within {
  border-color: rgba(225, 6, 19, 0.75);
  box-shadow: 0 0 0 4px rgba(225, 6, 19, 0.12);
  outline: none;
}
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.eyebrow { margin: 0; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); font-size: 11px; font-weight: 700; }
.add-card h2 { margin: 6px 0 14px; font-size: 26px; }
.search-lg {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 12px 14px;
}
.suggest { margin-top: 10px; display: grid; max-height: 320px; overflow: auto; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }
.suggest button {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 10px 12px;
  color: #fff;
}
.suggest button img, .pick img, .thumb {
  width: 46px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  background: #2a2a32;
  display: block;
}
.poster.has-photo span, .poster.has-photo::before { display: none; }
.card-copy small { display: block; margin-top: 10px; color: #f2f2f4; font-size: 13px; line-height: 1.3; font-weight: 600; }
.card-copy em { display: block; margin-top: 3px; color: var(--muted); font-style: normal; font-size: 12px; }
.poster-x {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 8, 12, 0.62);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  backdrop-filter: blur(8px);
}
.card:hover .poster-x, .card:focus-within .poster-x { opacity: 1; }
.card-tools {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(10, 10, 14, 0.86);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.card:hover .card-tools, .card:focus-within .card-tools { opacity: 1; transform: none; pointer-events: auto; }
.card-tools input[type="date"] {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  padding: 2px;
}
.card-tool-row { display: flex; gap: 6px; }
.card-tool-row button {
  flex: 1;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 700;
}
.card-tool-row button:first-child { background: var(--red); }
@media (hover: none) {
  .poster-x { opacity: 1; }
  .card-tools { position: static; opacity: 1; transform: none; pointer-events: auto; margin: 8px; }
}
.pick { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; }
.pick img { width: 72px; height: 104px; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: rgba(255,255,255,0.05); }
.suggest button b, .pick b { display: block; color: #fff; font-size: 15px; font-weight: 700; }
.suggest button small, .pick small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.pick {
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
}
.pick p { margin: 8px 0 0; color: #d5d5dc; font-size: 13px; line-height: 1.45; }
.date-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.date-row input { flex: 1; }
.ghost-date.is-on { outline: 1px solid var(--red); }

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: #fff;
  color: #111;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.empty {
  margin: 20px var(--pad) 48px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.02);
}

@media (max-width: 980px) {
  .nav { display: none; }
  .burger { display: flex; }
  .header { grid-template-columns: 1fr auto; }
  .btn { padding: 10px 14px; }
  .card { flex-basis: 140px; }
  .poster { height: 206px; }
  .age { display: none; }
  .tools-right { display: none; }
  .toolbar { align-items: stretch; }
  .tools-left { width: 100%; }
  .search { min-width: 0; flex: 1; }
  .composer { grid-template-columns: 1fr 1fr; }
  .composer input[name="url"], .composer input[name="notes"], .composer .btn { grid-column: 1 / -1; }
}
.auth-error { color: #ff8d95; margin: 0 0 12px; }
.poster img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.poster { position: relative; }
.card-x, .app-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 0;
  margin-top: 4px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px var(--pad) 4px; }
.composer {
  display: grid;
  grid-template-columns: 1.1fr 140px 1.5fr 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 8px var(--pad) 20px;
  padding: 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 70%),
    #14141a;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.composer input, .composer select { width: 100%; }
.user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
.user-name:hover { border-color: rgba(255,255,255,0.28); }

@media (max-width: 640px) {
  .hero { min-height: 70vh; align-items: flex-end; padding-bottom: 72px; }
  .hero h1 { font-size: 40px; }
  .header-actions .btn { display: none; }
  .section-head h2 { font-size: 18px; }
  .apps { grid-template-columns: 1fr; }
  .download { padding: 8px 10px; }
  .stats, .cabinet-grid { grid-template-columns: 1fr 1fr; }
}
.drawer-panel a { display: block; padding: 14px 12px; border-radius: 10px; font-size: 16px; }
.drawer-panel a:hover { background: rgba(255,255,255,0.06); }
a.chip { text-decoration: none; }
.auth-card,
.add-card {
  display: block;
  width: min(480px, calc(100% - 32px));
  margin: 32px auto 48px;
  padding: 28px 28px 24px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 90px),
    #14141a;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.07);
}
#view:has(.auth-card) {
  min-height: calc(100vh - 76px);
  display: grid;
  align-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(225, 6, 19, 0.18), transparent 46%);
}
