/* ---------- Токены: стиль «Конфетти» ---------- */
:root {
  --font: 'Nunito', system-ui, sans-serif;
  --text: #3b2a4a;
  --text-soft: #7a6888;
  --surface: #ffffff;
  --shadow: 0 10px 0 rgba(59, 42, 74, .12), 0 18px 40px rgba(59, 42, 74, .12);
  --radius: 36px;
  --gutter: clamp(16px, 3vw, 40px);
}

/* ---------- Каркас ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #fff4e8;
  font-family: var(--font);
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overflow-x: hidden;
}
.bg { position: fixed; inset: 0; z-index: -1; background: #fff4e8 center / cover no-repeat; }

#app {
  padding: calc(env(safe-area-inset-top) + var(--gutter)) var(--gutter) calc(env(safe-area-inset-bottom) + 48px);
  max-width: 1400px;
  margin: 0 auto;
}
.screen { animation: enter .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes enter { from { opacity: 0; transform: translateY(24px) scale(.98); } }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.press { transition: transform .12s ease; }
.press:active { transform: scale(.94); }

/* ---------- Главный экран ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: clamp(20px, 3vw, 36px);
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tile .art {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(59, 42, 74, .22));
}
.tile .label {
  position: relative;
  margin-top: -6px;
  padding: 10px 30px 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 900;
  font-size: clamp(26px, 3.2vw, 36px);
  text-align: center;
}
.tile .badge {
  position: absolute; top: -16px; right: -16px;
  min-width: 48px; height: 48px; padding: 0 12px;
  border-radius: 24px; background: #ff7aa2; color: #fff;
  box-shadow: 0 4px 0 rgba(59, 42, 74, .15);
  font-weight: 900; font-size: 24px; display: grid; place-items: center;
}

/* ---------- Шапка раздела и видео ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: clamp(20px, 3vw, 36px);
}
.back {
  flex: none;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.back svg { width: 44px; height: 44px; }
.topbar h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  display: flex; align-items: center; gap: 14px;
  min-width: 0;
}
.topbar h1 .em { width: 1.8em; height: 1.8em; object-fit: contain; flex: none; filter: drop-shadow(0 6px 8px rgba(59, 42, 74, .2)); }

/* ---------- Список видео ---------- */
.videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(20px, 3vw, 32px);
}
.vcard {
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.poster {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  display: grid; place-items: center;
  overflow: hidden;
}
.poster .art { font-size: 96px; }
.poster .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster .play {
  position: absolute; left: 16px; bottom: 16px;
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center;
}
.poster .play svg { width: 26px; height: 26px; margin-left: 4px; fill: #3b2a4a; }
.poster .dur {
  position: absolute; right: 14px; bottom: 14px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-weight: 800; font-size: 20px;
  padding: 4px 12px; border-radius: 14px;
}
.vcard .vtitle {
  padding: 16px 20px 20px;
  font-weight: 900;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.2;
}

.empty {
  text-align: center; font-size: 28px; font-weight: 800; color: var(--text-soft);
  padding: 60px 20px;
}
.empty .art { font-size: 110px; display: block; margin-bottom: 12px; }

/* ---------- Страница видео ---------- */
.player {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
}
.player video {
  display: block; width: 100%;
  max-height: calc(100vh - 220px);
  aspect-ratio: 16 / 9;
  background: #000;
}
.story {
  margin-top: clamp(20px, 3vw, 32px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 36px);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.5;
  font-weight: 700;
}
.story p { margin: 0 0 .6em; }
.story p:last-child { margin-bottom: 0; }

/* Главный экран без заголовка: плитки по центру экрана */
.home {
  min-height: calc(100vh - 2 * var(--gutter) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 48px);
  display: flex; align-items: center;
}
.home .tiles { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; }
.home .tile { flex: 0 1 calc((100% - 2 * clamp(20px, 3vw, 36px)) / 3); min-width: min(100%, 280px); }
