/* ============ ALIVE «Спогади» ============ */

/* ---- Fonts ---- */
@font-face {
  font-family: 'NAMU';
  src: url('../assets/fonts/NAMU-Pro.otf') format('opentype');
  font-weight: 400 700;
  font-display: swap;
}
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../assets/fonts/Onest-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../assets/fonts/Onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../assets/fonts/Onest-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../assets/fonts/Onest-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; }

/* ---- Tokens ---- */
:root {
  --blue: #35499F; --yellow: #FCAF17; --red: #EE3523;
  --blue-bright: #5B6FD6; --blue-deep: #263675;
  --yellow-soft: #FFC751; --red-bright: #FF5B49;
  --ink-950: #0C0E1B; --ink-900: #121527; --ink-800: #1A1E36;
  --ink-700: #252A4A; --ink-600: #3A4066; --ink-400: #6D739B; --ink-200: #B9BDD6;
  --paper-0: #FFFFFF; --paper-50: #F8F7F3; --paper-100: #EFEDE5; --paper-200: #E2DFD3;

  --surface-page: var(--ink-950);
  --surface-card: var(--ink-900);
  --surface-raised: var(--ink-800);
  --surface-overlay: rgba(12, 14, 27, 0.72);
  --text-primary: #F5F5F8; --text-secondary: #B9BDD6; --text-muted: #6D739B;
  --border-subtle: rgba(245,245,248,0.10); --border-strong: rgba(245,245,248,0.22);
  --accent: var(--yellow); --accent-hover: var(--yellow-soft); --accent-contrast: var(--ink-950);
  --link: var(--blue-bright);

  --font-display: 'NAMU', 'Onest', sans-serif;
  --font-body: 'Onest', system-ui, sans-serif;
  --tracking-display: 0.08em; --tracking-wide: 0.18em;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --grooves-faint: repeating-radial-gradient(circle at 50% 50%,
      rgba(245,245,248,0.05) 0 1px, transparent 1px 14px);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--surface-page); color: var(--text-primary);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink-950), 0 0 0 4px var(--yellow); border-radius: 6px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: var(--tracking-display); text-transform: uppercase; line-height: 1.12; margin: 0; }
.eyebrow { font-size: 12px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.section-title { font-size: clamp(26px, 4vw, 40px); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 15px;
  min-height: 44px; transition: background .18s var(--ease-out), transform .12s var(--ease-out), border-color .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--text-secondary); background: rgba(245,245,248,0.06); }
.btn-lg { padding: 14px 26px; font-size: 16px; }

/* ---- Header ---- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 24px;
  background: rgba(12,14,27,0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s;
}
.site-header.scrolled { background: rgba(12,14,27,0.85); border-bottom-color: var(--border-subtle); }
.logo img { height: 26px; width: auto; }
.site-nav { display: flex; gap: 22px; margin-left: 8px; flex: 1; }
.site-nav a {
  font-size: 13px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--text-secondary); padding: 8px 2px; transition: color .18s;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); }
.site-nav .ext { font-size: 11px; }
.btn-add { padding: 8px 16px; min-height: 36px; font-size: 13.5px; }
@media (max-width: 640px) {
  .site-header { gap: 14px; padding: 10px 14px; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 11px; letter-spacing: 0.1em; }
  .btn-add { padding: 6px 12px; min-height: 30px; font-size: 12px; border-radius: 8px; }
}

/* ---- Hero: стіна спогадів ---- */
.hero { position: relative; min-height: 100svh; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.wall { position: absolute; inset: -40px; display: flex; gap: 8px; filter: saturate(0.94); }
.wall-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.wall-cell { position: relative; overflow: hidden; border-radius: 4px; background: var(--ink-900); }
.wall-cell img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.1s ease;
}
.wall-cell img.on { opacity: 1; }
.wall-cell .cap {
  position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(12,14,27,0.85));
  font-size: 12px; line-height: 1.3; color: var(--text-primary);
  opacity: 0; translate: 0 6px; transition: opacity .25s var(--ease-out), translate .25s var(--ease-out);
  pointer-events: none;
}
.wall-cell .cap b { display: block; font-weight: 600; }
.wall-cell .cap span { color: var(--text-secondary); font-size: 11px; }
.wall-cell:hover .cap, .wall-cell:focus-visible .cap { opacity: 1; translate: 0 0; }
.wall-cell:hover img.on { scale: 1.04; transition: opacity 1.1s ease, scale 2.5s var(--ease-out); }
.hero-scrim {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, rgba(12,14,27,0.72) 0%, rgba(12,14,27,0.45) 45%, rgba(12,14,27,0.28) 100%),
              linear-gradient(180deg, rgba(12,14,27,0.55), transparent 22%, transparent 72%, var(--ink-950) 100%);
}
.hero-content { position: relative; z-index: 4; text-align: center; padding: 90px 20px 40px; max-width: 720px; }
.hero-mark { width: 64px; margin: 0 auto 18px; opacity: 0.95; }
.hero-title { font-size: clamp(40px, 9vw, 96px); text-shadow: 0 4px 40px rgba(12,14,27,0.6); }
.hero-sub { color: var(--text-secondary); max-width: 540px; margin: 18px auto 26px; font-size: 15px; }
.hero-sub b { color: var(--text-primary); font-weight: 700; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-hint {
  position: absolute; bottom: 18px; left: 50%; translate: -50% 0; z-index: 4;
  color: var(--text-muted); font-size: 18px; animation: hint 2.2s ease-in-out infinite;
}
@keyframes hint { 0%,100% { translate: -50% 0; opacity: .6; } 50% { translate: -50% 8px; opacity: 1; } }

/* ---- Featured carousel (Ken Burns) ---- */
.featured { padding: 72px 0 0; }
.featured-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.featured-progress { display: flex; gap: 6px; }
.featured-progress .bar { width: 44px; height: 3px; border-radius: 2px; background: var(--ink-700); overflow: hidden; cursor: pointer; }
.featured-progress .bar i { display: block; height: 100%; width: 0%; background: var(--accent); }
.featured-stage { position: relative; height: min(78vh, 640px); overflow: hidden; }
.feat-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.feat-slide.on { opacity: 1; pointer-events: auto; }
.feat-slide .bg { position: absolute; inset: 0; }
.feat-slide .bg img { width: 100%; height: 100%; object-fit: cover; }
.feat-slide.on .bg { animation: kenburns 14s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1) translate(0,0); } to { transform: scale(1.08) translate(-1.2%, -1%); } }
.feat-slide .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,14,27,0.25), transparent 40%, rgba(12,14,27,0.88) 92%); }
.feat-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px max(20px, calc((100% - 1160px)/2)) 34px; }
.feat-info .tag { margin-bottom: 10px; }
.feat-title { font-size: clamp(28px, 5vw, 56px); }
.feat-meta { color: var(--text-secondary); margin: 8px 0 6px; }
.feat-teaser { color: var(--text-secondary); max-width: 560px; margin: 0 0 16px; font-size: 15px; }
.feat-arrows { position: absolute; right: max(20px, calc((100% - 1160px)/2)); bottom: 34px; display: flex; gap: 8px; z-index: 5; }
.feat-arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 18px; background: rgba(12,14,27,0.4); transition: border-color .18s, background .18s; }
.feat-arrow:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) { .feat-arrows { display: none; } .featured-stage { height: 66vh; } }

/* ---- Tags / chips ---- */
.tag {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--accent); color: var(--accent-contrast);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}
.tag-soft { background: var(--ink-700); color: var(--ink-200); font-weight: 500; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border-subtle);
  background: var(--surface-card); color: var(--text-secondary); font-size: 14px;
  transition: all .16s var(--ease-out); min-height: 38px;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600; }

/* ---- Timeline + каталог: одна «картонна» секція архіву ---- */
:root { --cardboard: #CBBF9F; }
.timeline-section {
  margin-top: 84px; padding: 56px 0 10px;
  background: var(--cardboard); color: var(--ink-950);
  background-image: repeating-radial-gradient(circle at 50% 100%,
      rgba(12, 14, 27, 0.045) 0 1px, transparent 1px 14px);
}
.timeline-section .section-title { color: var(--ink-950); }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tl-note { color: #6E6650; font-size: 13px; margin: 0; }
.years-strip {
  display: flex; gap: clamp(28px, 6vw, 72px); overflow-x: auto; padding: 34px max(20px, calc((100% - 1160px)/2)) 20px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.years-strip::-webkit-scrollbar { display: none; }
.year { flex: 0 0 auto; }
.year-num {
  font-family: var(--font-display); font-size: clamp(44px, 6vw, 72px); letter-spacing: 0.04em;
  color: var(--ink-950); padding: 0 2px 6px; border-bottom: 3px solid transparent;
  transition: color .18s, border-color .18s;
}
.year-empty .year-num { color: #AC9F7E; cursor: default; }
.year:not(.year-empty) .year-num:hover { color: var(--blue); }
.year.active .year-num { color: var(--blue); border-bottom-color: var(--blue); }
.year-dots { display: flex; gap: 7px; flex-wrap: wrap; max-width: 260px; padding-top: 12px; }
.dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--ink-400);
  position: relative; transition: background .15s, scale .15s;
}
.year-dots .dot:nth-child(3n+1) { background: var(--blue); }
.year-dots .dot:nth-child(3n+2) { background: var(--yellow); }
.year-dots .dot:nth-child(3n+3) { background: var(--red); }
.dot:hover { scale: 1.5; }
.dot::after {
  content: attr(data-tip); position: absolute; bottom: 18px; left: 50%; translate: -50% 0;
  background: var(--ink-950); color: var(--paper-50); font-size: 12px; padding: 6px 10px;
  border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s;
  z-index: 10;
}
.dot:hover::after { opacity: 1; }
.year-soon { display: block; padding-top: 14px; color: #857A5E; font-size: 12px; max-width: 120px; }

/* ---- Catalog — продовження картонної секції ---- */
.catalog {
  padding: 4px 0 72px;
  background: var(--cardboard); color: var(--ink-950);
  background-image: repeating-radial-gradient(circle at 50% 0%,
      rgba(12, 14, 27, 0.045) 0 1px, transparent 1px 14px);
}
.catalog-head { margin-bottom: 22px; }
.catalog-sub { color: #6E6650; margin: 8px 0 0; font-size: 14px; }
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search {
  background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(12, 14, 27, 0.22);
  border-radius: 10px; color: var(--ink-950); padding: 12px 16px; font: inherit;
  width: min(360px, 100%); transition: background .15s, border-color .15s;
}
.search::placeholder { color: #857A5E; }
.search:focus { outline: none; border-color: var(--blue); background: rgba(255, 255, 255, 0.8); }
.catalog .flip-face {
  border: none;
  box-shadow: 0 3px 8px rgba(12, 14, 27, 0.12), 0 14px 30px rgba(12, 14, 27, 0.22);
}
.catalog .btn-ghost { border-color: rgba(12, 14, 27, 0.4); color: var(--ink-950); }
.catalog .btn-ghost:hover { background: rgba(12, 14, 27, 0.07); border-color: rgba(12, 14, 27, 0.6); }
.catalog .empty-note { color: #6E6650; }

.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 980px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards-grid { grid-template-columns: 1fr; } }

.flip { perspective: 1200px; aspect-ratio: 4 / 3; }
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .7s var(--ease-out);
}
.flip:hover .flip-inner, .flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 16px; overflow: hidden; background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}
.flip-face img { width: 100%; height: 100%; object-fit: cover; }
.flip-front .f-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,14,27,0.2), transparent 34%, transparent 48%, rgba(12,14,27,0.62) 68%, rgba(12,14,27,0.97)); }
.flip-front .f-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; }
.flip-front .f-info { position: absolute; left: 16px; right: 16px; bottom: 14px; }
.f-name { display: block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: var(--tracking-display); font-size: 19px; line-height: 1.15; color: #F5F5F8; text-shadow: 0 1px 3px rgba(12,14,27,0.9), 0 3px 14px rgba(12,14,27,0.75); }
.f-date { display: block; color: var(--ink-200); font-size: 13px; margin-top: 5px; text-shadow: 0 1px 3px rgba(12,14,27,0.9); }
.f-counts { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.badge { background: rgba(12,14,27,0.65); backdrop-filter: blur(6px); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--text-secondary); }
.badge .hh { color: var(--red-bright); }
.flip-back { transform: rotateY(180deg); }
.flip-back .f-scrim { position: absolute; inset: 0; background: rgba(12,14,27,0.55); }
.flip-back .f-body { position: absolute; inset: 0; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.f-live { font-size: 11px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--accent); }
.f-teaser { font-size: 13.5px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.f-cta { color: var(--accent); font-weight: 600; font-size: 14px; }
.more-wrap { text-align: center; padding: 30px 0 10px; }
.empty-note { text-align: center; color: var(--text-muted); padding: 30px 0; }

/* ---- Stats ---- */
.stats { padding: 60px 0; }
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center;
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); padding: 36px 20px;
}
@media (max-width: 640px) { .stats-row { grid-template-columns: repeat(2, 1fr); row-gap: 28px; } }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(34px, 5vw, 56px); letter-spacing: 0.04em; color: var(--accent); }
.stat span { color: var(--text-muted); font-size: 13px; letter-spacing: var(--tracking-wide); text-transform: uppercase; }

/* ---- CTA band ---- */
.cta-band { padding: 20px 0 60px; }
.cta-inner {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 24px;
  padding: 34px; display: flex; align-items: center; gap: 28px;
}
@media (max-width: 860px) { .cta-inner { flex-direction: column; text-align: center; } }
.cta-strip { display: flex; gap: 5px; flex: 0 0 auto; }
.cta-strip img { width: 34px; height: 72px; object-fit: cover; border-radius: 4px; }
.cta-strip img:nth-child(even) { translate: 0 8px; }
.cta-text { flex: 1; }
.cta-text h2 { font-size: clamp(20px, 3vw, 28px); }
.cta-text p { color: var(--text-secondary); margin: 8px 0 0; }

/* ---- Guests strip ---- */
.guests { padding: 0 0 72px; }
.guests-row { display: flex; gap: 12px; overflow-x: auto; padding: 20px 2px 8px; scrollbar-width: none; }
.guests-row::-webkit-scrollbar { display: none; }
.guest-card { flex: 0 0 200px; border-radius: 12px; overflow: hidden; position: relative; aspect-ratio: 3/4; background: var(--surface-card); }
.guest-card img { width: 100%; height: 100%; object-fit: cover; }
.guest-card .g-cap {
  position: absolute; inset: auto 0 0 0; padding: 24px 10px 8px; font-size: 12px;
  background: linear-gradient(180deg, transparent, rgba(12,14,27,0.9));
}
.guest-card .g-cap b { display: block; }
.guest-card .g-cap span { color: var(--text-secondary); font-size: 11px; }
.guests-empty { color: var(--text-muted); background: var(--surface-card); border: 1px dashed var(--border-strong); border-radius: 16px; padding: 26px; text-align: center; margin-top: 16px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border-subtle); padding: 44px 0 30px; background: var(--ink-900); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; justify-content: space-between; }
.footer-logo { height: 22px; margin-bottom: 10px; }
.footer-brand p { color: var(--text-muted); font-size: 13px; margin: 0; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-secondary); font-size: 14px; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { width: 100%; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--border-subtle); padding-top: 18px; margin: 10px 0 0; display: flex; align-items: center; gap: 10px; }
.triad { display: inline-flex; gap: 4px; }
.triad i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.d-blue { background: var(--blue); } .d-yellow { background: var(--yellow); } .d-red { background: var(--red); }

/* ---- Modal (правила, рулетка, UGC) ---- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12,14,27,0.8); backdrop-filter: blur(6px); }
.modal-card {
  position: relative; background: var(--surface-raised); border: 1px solid var(--border-subtle);
  border-radius: 20px; padding: 28px; max-width: 560px; width: 100%; max-height: 86vh; overflow: auto;
}
.modal-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: var(--ink-700); font-size: 14px; }
.modal-x:hover { background: var(--ink-600); }
.rules-list { color: var(--text-secondary); padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; }

/* ---- Рулетка пам'яті ---- */
.roulette-card { max-width: 860px; padding: 0; overflow: hidden; background: var(--ink-950); }
.roulette-img { width: 100%; max-height: 64vh; object-fit: contain; background: var(--ink-950); }
.roulette-info { padding: 18px 24px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.roulette-info .meta { flex: 1; min-width: 200px; }
.roulette-info b { font-family: var(--font-display); text-transform: uppercase; letter-spacing: var(--tracking-display); font-size: 20px; display: block; }
.roulette-info span { color: var(--text-secondary); font-size: 14px; }

/* ============ Сторінка події ============ */
.ev-hero { position: relative; min-height: 72svh; display: flex; align-items: flex-end; overflow: hidden; }
.ev-hero-bg { position: absolute; inset: 0; }
.ev-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.ev-hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,14,27,0.5), rgba(12,14,27,0.12) 38%, rgba(12,14,27,0.9) 96%); }
.ev-hero-content { position: relative; z-index: 2; padding-top: 120px; padding-bottom: 40px; width: 100%; }
.ev-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ev-title { font-size: clamp(32px, 6vw, 72px); max-width: 900px; text-shadow: 0 4px 40px rgba(12,14,27,0.7); }
.ev-meta { color: var(--text-secondary); margin: 12px 0 20px; font-size: 16px; }
.ev-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-been { background: rgba(12,14,27,0.55); border: 1px solid var(--border-strong); backdrop-filter: blur(8px); }
.btn-been .heart { color: var(--red-bright); font-size: 17px; transition: scale .2s var(--ease-out); }
.btn-been.on { border-color: var(--red-bright); }
.btn-been.on .heart { scale: 1.25; }
.btn-been b { font-weight: 700; }

/* Скролітелінг */
.story { padding: 64px 20px 30px; }
.story-block { max-width: 680px; margin: 0 auto; }
.story-h { font-size: clamp(22px, 3vw, 32px); margin: 44px 0 16px; }
.story-p { color: var(--ink-200); font-size: 17px; line-height: 1.75; margin: 0 0 16px; }
.story-photo {
  margin: 44px calc(50% - 50vw); width: 100vw; max-width: none; overflow: hidden; max-height: 78vh;
}
@media (min-width: 1300px) { .story-photo { margin: 48px calc(50% - 620px); width: 1240px; border-radius: 18px; } }
.story-photo img { width: 100%; height: 100%; object-fit: cover; will-change: transform; cursor: zoom-in; }
.story-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 44px auto; max-width: 900px; }
@media (max-width: 640px) { .story-duo { grid-template-columns: 1fr; } }
.story-photo-half { margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 3/2; }
.story-photo-half img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: scale .5s var(--ease-out); }
.story-photo-half:hover img { scale: 1.03; }
.story-credit { text-align: center; color: var(--text-muted); font-size: 13px; letter-spacing: var(--tracking-wide); text-transform: uppercase; margin: 40px 0 0; }

/* Галерея */
.gallery { padding: 40px 20px 20px; }
.g-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 22px; }
.g-tab {
  padding: 12px 18px; color: var(--text-muted); font-weight: 600; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.g-tab:hover { color: var(--text-secondary); }
.g-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.g-count { background: var(--ink-700); border-radius: 999px; padding: 2px 8px; font-size: 12px; margin-left: 6px; color: var(--ink-200); }
.g-grid { columns: 3 260px; column-gap: 12px; }
.g-item { margin: 0 0 12px; border-radius: 10px; overflow: hidden; break-inside: avoid; cursor: zoom-in; position: relative; background: var(--surface-card); }
.g-item img { width: 100%; height: auto; transition: scale .5s var(--ease-out); }
.g-item:hover img { scale: 1.03; }
.g-item .by { position: absolute; left: 8px; bottom: 8px; background: rgba(12,14,27,0.7); backdrop-filter: blur(4px); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; color: var(--text-secondary); }
.g-item .pending { position: absolute; top: 8px; left: 8px; background: var(--yellow); color: var(--ink-950); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.g-empty { border: 1px dashed var(--border-strong); border-radius: 16px; padding: 34px; text-align: center; color: var(--text-secondary); }
.g-empty p { margin: 0 0 10px; }

/* Upload CTA */
.ev-upload { padding: 40px 20px; }
.ev-upload-card {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 20px;
  padding: 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.ev-upload-card h2 { font-size: clamp(20px, 3vw, 26px); }
.ev-upload-card p { color: var(--text-secondary); margin: 8px 0 0; }

/* Навігація між подіями */
.ev-nav { padding: 30px 20px 80px; }
.nav-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; margin-bottom: 56px; }
@media (max-width: 760px) { .nav-grid { grid-template-columns: 1fr; } }
.nav-card {
  position: relative; border-radius: 14px; overflow: hidden; min-height: 110px;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px 16px; gap: 2px;
  transition: border-color .18s, transform .18s var(--ease-out); text-align: left;
}
.nav-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.nav-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.3; transition: opacity .2s; }
.nav-card:hover > img { opacity: 0.45; }
.nav-label { position: relative; font-size: 11px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-muted); }
.nav-name { position: relative; font-weight: 700; }
.nav-date { position: relative; color: var(--text-secondary); font-size: 13px; }
.nav-random { align-items: center; justify-content: center; padding: 14px 26px; }
.nav-dice { font-size: 30px; color: var(--accent); }
.rel-title { font-size: 22px; margin-bottom: 18px; }
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .rel-grid { grid-template-columns: 1fr; } }
.rel-card { border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 16/9; background: var(--surface-card); }
.rel-card img { width: 100%; height: 100%; object-fit: cover; transition: scale .4s var(--ease-out); }
.rel-card:hover img { scale: 1.04; }
.rel-meta { position: absolute; inset: auto 0 0 0; padding: 30px 14px 12px; background: linear-gradient(180deg, transparent, rgba(12,14,27,0.9)); display: flex; flex-direction: column; }
.rel-meta b { font-size: 15px; }
.rel-meta span { color: var(--text-secondary); font-size: 12.5px; }

/* ---- Лайтбокс ---- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(8,9,16,0.96); display: flex; flex-direction: column; }
.lb[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: var(--text-secondary); font-size: 14px; }
.lb-counter { font-variant-numeric: tabular-nums; }
.lb-top .sp { flex: 1; }
.lb-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; color: var(--text-secondary); transition: background .15s, color .15s; }
.lb-btn:hover { background: var(--ink-800); color: var(--text-primary); }
.lb-btn.on { color: var(--accent); }
.lb-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; padding: 0 64px; }
@media (max-width: 700px) { .lb-stage { padding: 0; } }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; transition: scale .3s var(--ease-out); }
.lb-img.zoomed { scale: 1.8; cursor: zoom-out; }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border-radius: 50%; background: rgba(18,21,39,0.7); display: grid; place-items: center; font-size: 20px; z-index: 2; transition: background .15s; }
.lb-nav:hover { background: var(--ink-700); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@media (max-width: 700px) { .lb-nav { display: none; } }
.lb-cap { text-align: center; padding: 12px 20px 20px; color: var(--text-secondary); font-size: 14px; }
.lb-cap b { color: var(--text-primary); }
.lb-toast { position: fixed; bottom: 26px; left: 50%; translate: -50% 0; background: var(--paper-50); color: var(--ink-950); font-weight: 600; border-radius: 999px; padding: 10px 20px; font-size: 14px; opacity: 0; transition: opacity .25s, translate .25s; pointer-events: none; z-index: 120; }
.lb-toast.show { opacity: 1; translate: -50% -6px; }

/* ---- UGC flow ---- */
.ugc-card { max-width: 480px; padding: 0; overflow: hidden; }
.ugc-head { padding: 20px 24px 0; display: flex; align-items: center; gap: 10px; }
.ugc-head .steps { flex: 1; display: flex; gap: 4px; }
.ugc-head .st { height: 3px; flex: 1; border-radius: 2px; background: var(--ink-700); }
.ugc-head .st.on { background: var(--accent); }
.ugc-body { padding: 20px 24px 26px; }
.ugc-body h3 { font-size: 20px; margin-bottom: 6px; }
.ugc-sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 16px; }
.ugc-ev-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; margin-bottom: 16px; }
.ugc-ev {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px;
  border: 1px solid var(--border-subtle); background: var(--surface-card); text-align: left; transition: border-color .15s;
}
.ugc-ev:hover { border-color: var(--border-strong); }
.ugc-ev.sel { border-color: var(--accent); }
.ugc-ev img { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; }
.ugc-ev b { display: block; font-size: 14px; }
.ugc-ev span { color: var(--text-muted); font-size: 12px; }
.ugc-auth-btn { width: 100%; margin-bottom: 10px; justify-content: center; }
.ugc-or { text-align: center; color: var(--text-muted); font-size: 12px; letter-spacing: var(--tracking-wide); text-transform: uppercase; margin: 14px 0 10px; }
.ugc-input { width: 100%; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 10px; color: var(--text-primary); padding: 12px 14px; font: inherit; margin-bottom: 10px; }
.ugc-input:focus { outline: none; border-color: var(--accent); }
.ugc-drop {
  border: 2px dashed var(--border-strong); border-radius: 16px; padding: 30px 20px; text-align: center;
  color: var(--text-secondary); transition: border-color .2s, background .2s; margin-bottom: 12px; cursor: pointer;
}
.ugc-drop.over { border-color: var(--accent); background: rgba(252,175,23,0.06); }
.ugc-drop b { display: block; color: var(--text-primary); margin-bottom: 6px; }
.ugc-drop .lim { font-size: 12.5px; color: var(--text-muted); display: block; margin-top: 6px; }
.ugc-note { font-size: 12.5px; color: var(--text-muted); margin: 10px 0 0; }
.ugc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.ugc-th { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-card); }
.ugc-th img { width: 100%; height: 100%; object-fit: cover; }
.ugc-th .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(12,14,27,0.75); font-size: 12px; display: grid; place-items: center; }
.ugc-th .err { position: absolute; inset: 0; background: rgba(238,53,35,0.82); font-size: 11px; padding: 8px; display: flex; align-items: center; text-align: center; line-height: 1.3; }
.ugc-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-secondary); margin: 4px 0 16px; cursor: pointer; }
.ugc-consent input { margin-top: 3px; accent-color: var(--yellow); width: 16px; height: 16px; }
.ugc-consent a { color: var(--link); text-decoration: underline; }
.ugc-progress-list { display: grid; gap: 10px; margin: 10px 0 16px; }
.ugc-pr { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-secondary); }
.ugc-pr .bar { flex: 1; height: 5px; border-radius: 3px; background: var(--ink-700); overflow: hidden; }
.ugc-pr .bar i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .3s; }
.ugc-pr.done .bar i { background: #3EB876; }
.ugc-done { text-align: center; padding: 12px 0 4px; }
.ugc-done .big { font-size: 46px; margin-bottom: 8px; }
.ugc-status-list { display: grid; gap: 10px; margin-top: 14px; }
.ugc-status { display: flex; gap: 12px; align-items: center; background: var(--surface-card); border-radius: 12px; padding: 8px; }
.ugc-status img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.ugc-status .inf { flex: 1; text-align: left; font-size: 13px; }
.ugc-status .inf span { color: var(--text-muted); display: block; font-size: 12px; }
.st-badge { border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; }
.st-mod { background: rgba(252,175,23,0.16); color: var(--yellow-soft); }
.st-pub { background: rgba(62,184,118,0.16); color: #5ED598; }
.ugc-error-band { background: rgba(238,53,35,0.12); border: 1px solid rgba(238,53,35,0.4); color: #FFB3AB; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 12px; }
.ugc-foot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }
.ugc-foot .btn { flex: 0 0 auto; }
.ugc-full { width: 100%; justify-content: center; }

/* ---- Анімації появи ---- */
.reveal { opacity: 0; translate: 0 24px; transition: opacity .7s var(--ease-out), translate .7s var(--ease-out); }
.reveal.in { opacity: 1; translate: 0 0; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; translate: 0 0; }
  .hero-hint { display: none; }
}

/* ================================================================
   Фінальне поліровання — craft-шар поверх базової системи
   ================================================================ */

/* ---- Глобальні деталі ---- */
::selection { background: var(--yellow); color: var(--ink-950); }
html { scrollbar-color: var(--ink-600) var(--ink-950); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-950); }
::-webkit-scrollbar-thumb { background: var(--ink-700); border-radius: 8px; border: 2px solid var(--ink-950); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-600); }

/* делікатний плівковий шум поверх сторінки (під шапкою і модалками) */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 55; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035; mix-blend-mode: overlay;
}

/* фірмова сигнатура секційних заголовків — три крапки тріади */
.section-title { position: relative; padding-bottom: 20px; }
.section-title::after {
  content: ''; position: absolute; left: 3px; bottom: 4px; width: 46px; height: 8px;
  background:
    radial-gradient(circle at 4px 4px, var(--blue) 0 3.6px, transparent 4px),
    radial-gradient(circle at 23px 4px, var(--yellow) 0 3.6px, transparent 4px),
    radial-gradient(circle at 42px 4px, var(--red) 0 3.6px, transparent 4px);
  background-repeat: no-repeat;
}

/* ---- Кнопки: глибина і відгук ---- */
.btn-accent { box-shadow: 0 6px 20px rgba(252, 175, 23, 0.25); }
.btn-accent:hover { box-shadow: 0 10px 28px rgba(252, 175, 23, 0.35); translate: 0 -1px; }
.btn { transition: background .18s var(--ease-out), transform .12s var(--ease-out),
       border-color .18s, box-shadow .25s var(--ease-out), translate .2s var(--ease-out), color .18s; }

/* ---- Хедер: анімоване підкреслення ---- */
.site-nav a { position: relative; }
.site-nav a::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 1px; height: 2px;
  border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease-out);
}
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }
.logo img { transition: opacity .2s; }
.logo:hover img { opacity: 0.82; }

/* ---- Hero: постановочний вхід ---- */
@keyframes riseIn { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
.hero-content > * { animation: riseIn .9s var(--ease-out) both; }
.hero-content > :nth-child(1) { animation-delay: .1s; }
.hero-content > :nth-child(2) { animation-delay: .22s; }
.hero-content > :nth-child(3) { animation-delay: .38s; }
.hero-content > :nth-child(4) { animation-delay: .52s; }
.hero-hint {
  width: 30px; height: 48px; border: 1.5px solid var(--border-strong); border-radius: 999px;
  display: grid; place-items: start center; padding-top: 9px; font-size: 13px;
  color: var(--text-secondary);
}
#btnShuffle .ico { display: inline-block; transition: rotate .5s var(--ease-out); }
#btnShuffle:hover .ico { rotate: 180deg; }

/* ---- Карусель обраних ---- */
.feat-count {
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0.18em;
  color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: 14px;
}
.featured-head { align-items: center; }
.featured-progress .bar { transition: height .2s var(--ease-out); }
.featured-progress .bar:hover { height: 5px; }
.feat-title { text-shadow: 0 3px 30px rgba(12, 14, 27, 0.8); }

/* ---- Кольорове кодування типів (тріада, як в адмінці) ---- */
.tag[data-type="Вечірка"] { background: var(--blue); color: #fff; }
.tag[data-type="Аніме & K-pop"] { background: #4757BD; color: #fff; }
.tag[data-type="Фест"], .tag[data-type="Батл"] { background: #CE2917; color: #fff; }

/* ---- Каталог: картки-фотокартки ---- */
.flip { transition: translate .35s var(--ease-out); }
.flip:hover { translate: 0 -6px; }
.catalog .flip:hover .flip-face {
  box-shadow: 0 6px 14px rgba(12, 14, 27, 0.18), 0 26px 52px rgba(12, 14, 27, 0.32);
}
.year-num { position: relative; display: inline-block; border-bottom: none; padding-bottom: 8px; }
.year.active .year-num { border-bottom-color: transparent; }
.year-num::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 0; height: 4px;
  border-radius: 2px; background: var(--blue);
  transform: scaleX(0); transform-origin: left; transition: transform .32s var(--ease-out);
}
.year.active .year-num::after { transform: scaleX(1); }
.year:not(.year-empty) .year-num { transition: color .18s, translate .25s var(--ease-out); }
.year:not(.year-empty) .year-num:hover { translate: 0 -3px; }

/* ---- Лічильники ---- */
@media (min-width: 641px) {
  .stats-row .stat + .stat { border-left: 1px solid var(--border-subtle); }
}

/* ---- CTA: розкидані фотокартки ---- */
.cta-strip img {
  border-radius: 6px; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  transition: rotate .35s var(--ease-out), translate .35s var(--ease-out);
}
.cta-strip img:nth-child(odd) { rotate: -4deg; }
.cta-strip img:nth-child(even) { rotate: 3deg; translate: 0 8px; }
.cta-inner:hover .cta-strip img { rotate: 0deg; translate: 0 0; }

/* ---- Стрічка гостей ---- */
.guest-card { transition: translate .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.guest-card:hover { translate: 0 -5px; box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45); }

/* ---- Футер: водяний V-знак ---- */
.site-footer { position: relative; overflow: hidden; }
.site-footer::after {
  content: ''; position: absolute; right: -70px; bottom: -90px; width: 360px; height: 360px;
  background: url('../assets/v-mark-white.png') center / contain no-repeat;
  opacity: 0.045; pointer-events: none;
}
.footer-inner { position: relative; z-index: 1; }
.footer-links a { position: relative; width: fit-content; }
.footer-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease-out);
}
.footer-links a:hover::after { transform: scaleX(1); }

/* ---- Сторінка події ---- */
.crumb {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  font-size: 12px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--text-secondary); background: rgba(12, 14, 27, 0.45);
  border: 1px solid var(--border-subtle); border-radius: 999px; padding: 9px 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color .2s, border-color .2s;
}
.crumb:hover { color: var(--accent); border-color: var(--border-strong); }

.story-block:first-of-type .story-p:first-of-type { font-size: 19px; line-height: 1.7; color: #D9DCEA; }
.story-h { display: flex; align-items: baseline; gap: 14px; }
.story-h::before {
  content: ''; flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--yellow); translate: 0 -2px;
}
.story-block:nth-of-type(3n+2) .story-h::before { background: var(--blue-bright); }
.story-block:nth-of-type(3n) .story-h::before { background: var(--red-bright); }

/* галерея: сегментовані таби + зум-підказка */
.g-tabs {
  display: inline-flex; gap: 4px; background: var(--ink-900);
  border: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
  padding: 5px; border-radius: 999px; margin-bottom: 24px;
}
.g-tab { border-radius: 999px; padding: 9px 18px; margin-bottom: 0; border-bottom: none; }
.g-tab.active { background: var(--ink-700); border-bottom-color: transparent; }
.g-item::after {
  content: '⊕'; position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%; font-size: 17px; color: #F5F5F8;
  background: rgba(12, 14, 27, 0.65); backdrop-filter: blur(4px);
  opacity: 0; translate: 0 8px; transition: opacity .25s var(--ease-out), translate .25s var(--ease-out);
}
.g-item:hover::after { opacity: 1; translate: 0 0; }

.nav-card:hover .nav-label { color: var(--accent); }
.nav-random:hover .nav-dice { animation: diceSpin .5s var(--ease-out); }
@keyframes diceSpin { 50% { rotate: 22deg; scale: 1.15; } }

/* ---- Лайтбокс і модалки ---- */
.lb { background: rgba(8, 9, 16, 0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.lb-img { transition: opacity .22s ease, scale .3s var(--ease-out); }
.lb-img.loading { opacity: 0; }
.lb-counter { font-family: var(--font-display); letter-spacing: 0.14em; }
@keyframes modalIn { from { opacity: 0; scale: 0.96; translate: 0 10px; } to { opacity: 1; scale: 1; translate: 0 0; } }
.modal-card { animation: modalIn .32s var(--ease-out); box-shadow: 0 34px 90px rgba(0, 0, 0, 0.55); }
.modal-backdrop { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ugc-drop { transition: border-color .2s, background .2s, translate .2s var(--ease-out); }
.ugc-drop:hover { translate: 0 -1px; }

/* ================================================================
   Мобільна верстка (mobile-first пріоритет ТЗ — 390px)
   ================================================================ */
@media (max-width: 640px) {
  /* --- Шапка: два яруси — логотип+CTA, під ними навігація --- */
  .site-header { flex-wrap: wrap; gap: 2px 14px; padding: 10px 16px 6px; }
  .logo { order: 1; }
  .logo img { height: 22px; }
  .btn-add { order: 2; margin-left: auto; }
  .site-nav { order: 3; flex: 1 1 100%; gap: 22px; margin-left: 0; }
  .site-nav a { padding: 7px 0; font-size: 11.5px; }

  /* --- Hero --- */
  .hero-content { padding: 130px 20px 48px; }
  .hero-mark { width: 50px; margin-bottom: 14px; }
  .hero-sub { font-size: 14.5px; }
  .hero-actions { flex-direction: column; align-items: stretch; max-width: 300px; margin: 0 auto; }
  .hero-hint { bottom: 12px; }

  /* --- Карусель обраних --- */
  .featured { padding-top: 52px; }
  .featured-stage { height: 62vh; }
  .featured-head { flex-wrap: wrap; gap: 10px; }
  .featured-progress .bar { width: 26px; }
  .feat-info { padding-bottom: 28px; }
  .feat-teaser {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }

  /* --- Таймлайн: snap і більші точки-цілі --- */
  .years-strip { scroll-snap-type: x proximity; padding-top: 26px; }
  .year { scroll-snap-align: start; }
  .dot { width: 13px; height: 13px; }
  .year-dots { gap: 9px; max-width: 240px; }

  /* --- Лічильники / CTA / гості --- */
  .stats-row { padding: 26px 6px; }
  .cta-inner { padding: 26px 20px; gap: 20px; }
  .cta-inner .btn { width: 100%; }
  .guests-row { scroll-snap-type: x mandatory; }
  .guest-card { flex: 0 0 168px; scroll-snap-align: start; }

  /* --- Сторінка події --- */
  .ev-hero { min-height: 64svh; }
  .ev-hero-content { padding-top: 140px; padding-bottom: 32px; }
  .crumb { margin-bottom: 14px; padding: 8px 13px; }
  .ev-meta { font-size: 14.5px; margin: 10px 0 16px; }
  .story { padding-top: 44px; }
  .story-p { font-size: 16.5px; }
  .story-block:first-of-type .story-p:first-of-type { font-size: 17.5px; }
  .story-photo { margin-top: 32px; margin-bottom: 32px; }
  .story-duo { margin: 32px auto; gap: 10px; }

  /* галерея: 2 колонки, таби на всю ширину */
  .g-tabs { display: flex; width: 100%; }
  .g-tab { flex: 1; justify-content: center; display: inline-flex; align-items: center; padding: 9px 8px; }
  .g-grid { columns: 2; column-gap: 8px; }
  .g-item { margin-bottom: 8px; border-radius: 8px; }
  .g-item::after { display: none; }   /* зум-бейдж зайвий на тачі */

  .ev-upload-card { padding: 22px 20px; }
  .ev-upload-card .btn { width: 100%; }

  /* попередня/наступна поряд, кубик знизу на всю ширину */
  .nav-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .nav-random { grid-column: 1 / -1; order: 3; min-height: 74px; }

  /* --- Модалки як нижні шторки --- */
  .modal { padding: 0; place-items: end stretch; }
  .modal-card {
    max-width: none; width: 100%; max-height: 92dvh;
    border-radius: 22px 22px 0 0; padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
    animation: sheetIn .35s var(--ease-out);
  }
  .modal-card::before {
    content: ''; position: absolute; top: 8px; left: 50%; translate: -50% 0;
    width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong);
  }
  .roulette-card { padding: 0; }
  .roulette-card::before { z-index: 5; background: rgba(245,245,248,0.5); }
  .roulette-img { max-height: 54vh; }
  .roulette-info { padding: 14px 18px calc(20px + env(safe-area-inset-bottom)); }
  .roulette-info .btn { flex: 1 1 100%; }
  .ugc-card .ugc-body { padding: 14px 20px calc(22px + env(safe-area-inset-bottom)); }
  .ugc-ev-list { max-height: 42dvh; }

  /* --- Лайтбокс --- */
  .lb-top { padding: 10px 8px; }
  .lb-stage { padding: 0 4px; }
  .lb-cap { padding-bottom: calc(14px + env(safe-area-inset-bottom)); font-size: 13px; }
}
@keyframes sheetIn { from { translate: 0 48px; opacity: 0; } to { translate: 0 0; opacity: 1; } }

/* середні екрани: галерея 2 колонки і на планшеті у портреті */
@media (min-width: 641px) and (max-width: 900px) {
  .g-grid { columns: 2 240px; }
  .cards-grid { gap: 14px; }
}

/* ================= Відео в галереї та лайтбоксі ================= */
.g-video { position: relative; }
.g-play {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; padding-left: 4px;
  color: var(--ink-950); background: rgba(252, 175, 23, 0.92);
  box-shadow: 0 8px 24px rgba(12, 14, 27, 0.5);
  transition: scale .25s var(--ease-out), background .2s;
  pointer-events: none;
}
.g-video:hover .g-play { scale: 1.12; background: var(--yellow-soft); }
.g-video::after { display: none; }           /* замість зум-бейджа — кнопка play */
.g-vlabel {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(12, 14, 27, 0.72); backdrop-filter: blur(6px);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--text-secondary);
}
.badge-video { color: var(--yellow-soft); }
.lb-video { max-width: 100%; max-height: 100%; background: #000; }
@media (max-width: 640px) {
  .g-play { width: 44px; height: 44px; font-size: 16px; }
}

/* ---- Лічильники → блок збору «На Літачки» ---- */
.stats-support { grid-template-columns: auto auto auto; justify-content: center; column-gap: clamp(30px, 6vw, 80px); align-items: center; }
.stats-support .stat b { white-space: nowrap; }
.stats-support .stat b > span { font: inherit; color: inherit; }
.stats-support .stat > span { max-width: 300px; margin: 6px auto 0; display: block; line-height: 1.5; }
.stat-cta { justify-self: center; }
@media (max-width: 900px) {
  .stats-support { grid-template-columns: 1fr; row-gap: 26px; }
  .stats-support .stat + .stat { border-left: none; }
}
