/* ─────────────────────────────────────────────────────────────
   Grozny Quiz — «Афиша»: карточки ближайших игр, календарь сезона,
   архив афиш и лайтбокс. Подключается после landing.css и берёт
   его переменные (--ink, --purple, --hot …).
   ───────────────────────────────────────────────────────────── */

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.af-week { margin-top: 20px; color: var(--paper-d); font-size: 14px; line-height: 1.55; max-width: 300px; }

/* ── Бейджи и заглушка ── */
/* Бейдж — в нижнем левом углу: сверху у афиш заголовок (слева) и логотипы (справа),
   а у итоговых таблиц внизу пустое поле. */
.af-badge { position: absolute; bottom: 8px; left: 8px; z-index: 3; font-family: var(--mono); font-size: 10px; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 8px; background: rgba(11, 3, 19, 0.86); color: var(--paper); border: 1px solid var(--line-2); pointer-events: none; }
.af-badge--hot { background: var(--hot); color: #000; border-color: var(--hot); }
.af-ph + .af-badge { top: 8px; bottom: auto; } /* у заглушки текст внизу, а верх слева пустой */

.af-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 14px; text-align: left; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(124, 77, 255, 0.07) 0 12px, transparent 12px 24px),
    radial-gradient(80% 60% at 30% 15%, rgba(124, 77, 255, 0.35), transparent 70%),
    linear-gradient(160deg, #12061f 0%, #2a1250 100%);
}
.af-ph-logo { position: absolute; top: 12px; right: 14px; font-family: "Actay Wide", sans-serif; font-weight: 700; font-size: 18px; color: var(--hot); letter-spacing: -0.02em; }
.af-ph-series { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--purple-2); }
.af-ph-title { font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 15px; line-height: 1.05; color: var(--paper); overflow-wrap: anywhere; }
.af-ph-date { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-d); }

/* ── Ближайшие игры: карточки с афишей ── */
.af-up { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 56px; }
.af-card { display: flex; flex-direction: column; border: 1px solid var(--line-2); background: var(--ink-2); min-width: 0; }
.af-card.is-today { border-color: var(--hot); box-shadow: 6px 6px 0 rgba(255, 192, 0, 0.18); }
.af-card-poster { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--ink); cursor: zoom-in; }
.af-card-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.af-card-poster:hover img { transform: scale(1.03); }
.af-card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.af-when { display: flex; align-items: center; gap: 14px; }
.af-date { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 8px 6px; border: 1px solid var(--line-2); background: var(--ink); line-height: 1; }
.af-date .d { font-family: "Actay Wide", sans-serif; font-weight: 700; font-size: 30px; color: var(--hot); margin: 3px 0; }
.af-date .w, .af-date .m { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--paper-d); }
.af-when-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.af-time { font-family: "Actay Wide", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 0.02em; }
.af-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.af-tags span { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; padding: 4px 8px; border: 1px solid var(--line-2); color: var(--paper-d); }
.af-tags .af-tag-hot { background: var(--hot); border-color: var(--hot); color: #000; }
.af-title { font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 20px; line-height: 1.08; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.af-venue { font-size: 14px; color: var(--paper-d); }
.af-cta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.af-note { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-d); }

.af-empty { margin-top: 56px; padding: 28px; border: 1px dashed var(--line-2); background: rgba(21, 10, 38, 0.45); color: var(--paper-d); font-size: 15px; line-height: 1.55; }
.af-empty-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 16px; }

/* ── Календарь сезона ── */
.af-cal { margin-top: 72px; border-top: 2px solid var(--paper); padding-top: 32px; }
.af-cal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.af-h3 { font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 36px; line-height: 0.95; letter-spacing: -0.02em; }
.af-h3 .accent { color: var(--purple-2); }
.af-cal-nav { display: flex; align-items: center; gap: 10px; }
.af-cal-btn {
  width: 44px; height: 44px; border: 1px solid var(--line-2); background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 16px; cursor: pointer; transition: border-color 140ms, color 140ms;
}
.af-cal-btn:hover:not(:disabled) { border-color: var(--hot); color: var(--hot); }
.af-cal-btn:disabled { opacity: 0.3; cursor: default; }
.af-cal-btn:focus-visible, .af-chip:focus-visible, .af-day-ev:focus-visible, .af-tile:focus-visible, .af-card-poster:focus-visible, .af-lb button:focus-visible, .af-lb a:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
.af-cal-label { min-width: 170px; text-align: center; font-family: "Actay Wide", sans-serif; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; }

.af-cal-wd, .af-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.af-cal-wd { margin-bottom: 6px; }
.af-cal-wd span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--paper-f); text-align: center; }
.af-cal-wd span:nth-child(n+6) { color: var(--paper-d); }
.af-day { position: relative; aspect-ratio: 4 / 5; border: 1px solid var(--line); background: rgba(21, 10, 38, 0.45); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.af-day.is-out { border-color: transparent; background: transparent; }
.af-day-n { position: absolute; top: 5px; left: 6px; z-index: 3; font-family: var(--mono); font-size: 11px; color: var(--paper-f); pointer-events: none; }
.af-day.has-ev { border-color: var(--line-2); background: var(--ink); }
.af-day.has-ev .af-day-n { color: #fff; background: rgba(11, 3, 19, 0.78); padding: 2px 4px; top: 3px; left: 3px; }
.af-day.is-today { border-color: var(--purple-2); }
.af-day.is-today .af-day-n { color: var(--purple-2); }
.af-day-ev { position: relative; flex: 1; display: block; overflow: hidden; min-height: 0; cursor: zoom-in; background: var(--ink-3); }
.af-day-ev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 250ms ease, filter 250ms ease; }
.af-day-ev:hover img { transform: scale(1.06); }
/* рамка «игра впереди» — отдельным слоем поверх миниатюры (outline рисуется под картинкой) */
.af-day-ev.is-soon::after { content: ""; position: absolute; inset: 0; z-index: 2; border: 2px solid var(--hot); pointer-events: none; }
.af-day-ph { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-d); line-height: 1.1; overflow-wrap: anywhere;
  background: radial-gradient(90% 70% at 30% 20%, rgba(124, 77, 255, 0.35), transparent 70%), linear-gradient(160deg, #12061f, #2a1250); }
.af-month-meta { margin-top: 12px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-f); }
.af-cal-foot { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.af-legend { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--paper-d); }
.af-legend-soon { width: 14px; height: 18px; border: 2px solid var(--hot); display: inline-block; }

/* ── Страница /afisha/ ── */
.af-hero { padding: 72px 0 24px; position: relative; }
.af-filters { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.af-filter-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: start; }
.af-filter-k { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-d); padding-top: 11px; }
.af-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.af-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line-2); color: var(--paper); text-decoration: none; font-family: "Actay Wide", sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; transition: border-color 140ms, color 140ms, background 140ms; }
.af-chip:hover { border-color: var(--hot); color: var(--hot); }
.af-chip.is-on { background: var(--purple-d); border-color: var(--purple-d); color: #fff; }
.af-chip .n { font-family: var(--mono); font-weight: 400; font-size: 10px; color: var(--paper-d); }
.af-chip.is-on .n { color: rgba(255, 255, 255, 0.75); }
/* город без игр выбранного формата: ссылка ведёт на все игры города */
.af-chip.is-empty { border-style: dashed; color: var(--paper-d); }
.af-chip.is-empty .n { color: var(--paper-f); }
.af-filter-note { margin: 2px 0 0; padding: 12px 16px; border: 1px dashed var(--hot); background: rgba(255, 192, 0, 0.06); color: var(--paper); font-size: 14px; line-height: 1.5; }
.af-filter-note .sched-link { white-space: nowrap; }

.af-part { padding: 48px 0 24px; }
.af-part-h { font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: clamp(26px, 4vw, 44px); line-height: 1; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.af-part-h .accent { color: var(--purple-2); }
.af-part-n { font-size: 14px; color: var(--paper-d); letter-spacing: 0.1em; }
.af-part .af-up { margin-top: 28px; }
.af-arch-month { margin-top: 40px; }
.af-arch-h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--line); font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 20px; }
.af-arch-h .mono { font-size: 11px; font-weight: 400; letter-spacing: 0.14em; color: var(--paper-d); }
.af-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px 14px; }
.af-tile { display: flex; flex-direction: column; gap: 6px; color: var(--paper); text-decoration: none; min-width: 0; }
.af-tile-img { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line-2); background: var(--ink-2); cursor: zoom-in; }
.af-tile-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.af-tile:hover .af-tile-img img { transform: scale(1.04); }
.af-tile:hover .af-tile-title { color: var(--hot); }
.af-tile-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-d); }
.af-tile-title { font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 14px; line-height: 1.12; overflow-wrap: anywhere; transition: color 140ms; }
.af-tile-win { font-size: 12px; color: var(--paper-d); line-height: 1.35; }
.af-tile-win span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hot); }
.cta-end--compact { padding: 96px 0; margin-top: 72px; }

/* ── Лайтбокс ── */
html.af-lock, html.af-lock body { overflow: hidden; }
.af-lb { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.af-lb[hidden] { display: none; }
/* атрибут hidden внутри лайтбокса сильнее любых display (.af-lb-img — block): иначе у игры
   без афиши пустая картинка занимает полширины и выталкивает заглушку вправо */
.af-lb [hidden] { display: none !important; }
.af-lb-backdrop { position: absolute; inset: 0; background: rgba(5, 1, 10, 0.92); backdrop-filter: blur(6px); }
.af-lb-panel {
  position: relative; z-index: 1; width: min(1120px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--ink-2); border: 1px solid var(--line-2);
  box-shadow: 16px 16px 0 var(--ink-3), 16px 16px 0 1px var(--line-2);
}
.af-lb-fig { position: relative; margin: 0; background: var(--ink); display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; touch-action: pan-y; }
.af-lb-img { display: block; width: 100%; height: auto; max-height: calc(100vh - 50px); max-height: calc(100dvh - 50px); object-fit: contain; transition: filter 200ms; user-select: none; -webkit-user-drag: none; }
.af-lb-ph { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 80vh; }
.af-lb-ph .af-ph-title { font-size: 26px; }
.af-lb-kind { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px; background: rgba(11, 3, 19, 0.85); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-d); }
.af-lb-info { padding: 40px 36px 28px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; }
.af-lb-kicker { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--purple-2); padding-right: 44px; }
.af-lb-title { font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 30px; line-height: 1.02; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.af-lb-facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 4px 0 0; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.af-lb-facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-d); padding-top: 3px; }
.af-lb-facts dd { margin: 0; font-size: 15px; line-height: 1.4; }
.af-lb-facts dd.hot { color: var(--hot); font-family: "Actay Wide", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 0.02em; }
.af-lb-desc { color: var(--paper-d); font-size: 15px; line-height: 1.55; }
.af-lb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.af-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 34px 14px 20px;
  font-family: "Actay Wide", sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%);
  background: var(--purple); color: #fff; transition: background 140ms, color 140ms;
}
.af-btn:hover { background: var(--hot); color: #000; }
.af-btn--hot { background: var(--hot); color: #000; }
.af-btn--hot:hover { background: var(--purple); color: #fff; }
.af-btn--ghost { background: transparent; color: var(--paper); clip-path: none; border: 1px solid var(--line-2); padding: 13px 18px; }
.af-btn--ghost:hover { background: transparent; border-color: var(--hot); color: var(--hot); }
.af-lb-note { width: 100%; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-d); }
.af-lb-count { font-size: 10px; letter-spacing: 0.14em; color: var(--paper-f); }
.af-lb-close {
  position: absolute; top: 10px; right: 10px; z-index: 4; width: 44px; height: 44px; border: 1px solid var(--line-2);
  background: rgba(11, 3, 19, 0.85); color: var(--paper); font-size: 26px; line-height: 1; cursor: pointer;
}
.af-lb-close:hover { border-color: var(--hot); color: var(--hot); }
.af-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; height: 64px;
  border: 1px solid var(--line-2); background: rgba(11, 3, 19, 0.72); color: var(--paper); font-family: var(--mono); font-size: 18px; cursor: pointer;
}
.af-lb-nav:hover:not(:disabled) { border-color: var(--hot); color: var(--hot); }
.af-lb-nav:disabled { opacity: 0.25; cursor: default; }
.af-lb-prev { left: 10px; }
.af-lb-next { right: 10px; }
.af-lb-panel.is-loading .af-lb-img { filter: blur(6px) saturate(0.9); }

@media (max-width: 900px) {
  .af-h3 { font-size: 28px; }
  .af-cal-head { align-items: flex-start; flex-direction: column; }
  .af-cal-nav { width: 100%; justify-content: space-between; }
  .af-cal-label { flex: 1; min-width: 0; }
  .af-lb { padding: 0; }
  .af-lb-panel { width: 100%; height: 100%; max-height: none; grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; box-shadow: none; border: 0; }
  .af-lb-fig { min-height: 50vh; }
  .af-lb-img { max-height: 72vh; max-height: 72dvh; width: 100%; }
  .af-lb-info { overflow: visible; padding: 24px 20px 32px; }
  .af-lb-title { font-size: 24px; }
  .af-lb-kicker { padding-right: 0; }
  .af-lb-close { position: fixed; top: 10px; right: 10px; }
  .af-lb-ph .af-ph-logo { right: auto; left: 16px; } /* справа сверху — кнопка «закрыть» */
}
@media (max-width: 600px) {
  .af-up { grid-template-columns: 1fr; margin-top: 40px; }
  .af-cal { margin-top: 56px; }
  .af-cal-wd, .af-cal-grid { gap: 3px; }
  .af-day-n { font-size: 9px; top: 2px; left: 3px; }
  .af-day.has-ev .af-day-n { padding: 1px 2px; top: 1px; left: 1px; }
  .af-day-ph { font-size: 7px; padding: 2px; }
  .af-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
  .af-filter-row { grid-template-columns: 1fr; gap: 8px; }
  .af-filter-k { padding-top: 0; }
  .af-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-right: -24px; padding-right: 24px; scrollbar-width: thin; }
  .af-chip { flex: 0 0 auto; }
  .af-hero { padding-top: 48px; }
  .af-lb-facts { grid-template-columns: 1fr; gap: 2px; }
  .af-lb-facts dd { margin-bottom: 8px; }
  .af-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .af-card-poster img, .af-day-ev img, .af-tile-img img { transition: none; }
}
