* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #0b0b0d;
  color: #f5f5f5;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  padding: 32px 0 48px;
}

.page {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

h1 {
  margin: 0 0 28px;
  text-align: center;
  font-size: 22px;
  font-weight: 500;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.video-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #151518;
  cursor: pointer;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.video-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #151518;
  pointer-events: none;
}

.video-card:hover {
  transform: scale(1.01);
}

.video-card:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.duration {
  position: absolute;
  right: 8px;
  bottom: 8px;

  padding: 3px 6px;
  border-radius: 5px;

  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;

  font-size: 12px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;

  pointer-events: none;
}

/* =========================
   ПОСЛЕДНЕЕ ВИДЕО
   ========================= */

.final-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 22px;

  margin-top: 22px;
}

.final-video {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.9),
    0 0 26px rgba(255, 255, 255, 0.18);
}

.final-video:hover {
  transform: scale(1.015);

  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 1),
    0 0 34px rgba(255, 255, 255, 0.28);
}

.final-side {
  display: flex;
  align-items: center;
  gap: 14px;

  color: rgba(255, 255, 255, 0.75);

  font-size: 18px;
  font-weight: 400;

  user-select: none;
  pointer-events: none;
}

.final-left {
  justify-content: flex-end;
}

.final-right {
  justify-content: flex-start;
}

.final-arrow {
  color: rgba(255, 255, 255, 0.95);
  font-size: 38px;
  line-height: 1;
}

/* =========================
   ПРИГЛАШЕНИЕ
   ========================= */

.date-modal {
  position: fixed;
  inset: 0;

  z-index: 5000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: #0b0b0d;

  opacity: 1;
  visibility: visible;

  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;
}

.date-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.date-card {
  width: min(520px, 100%);
  text-align: center;
}

.date-title {
  margin-bottom: 22px;

  font-size: clamp(20px, 4vw, 28px);
  font-weight: 500;
}

.date-question {
  margin-bottom: 38px;

  font-size: clamp(26px, 5vw, 38px);
}

.date-buttons {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 18px;

  min-height: 52px;
}

.date-buttons button {
  min-width: 110px;
  height: 48px;

  padding: 0 24px;

  border: 0;
  border-radius: 10px;

  font-size: 16px;
  font-family: inherit;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.yes-button {
  background: #f5f5f5;
  color: #0b0b0d;
}

.yes-button:hover {
  transform: scale(1.04);
  background: #ffffff;
}

.no-button {
  position: relative;

  background: #242428;
  color: #ffffff;
}

.no-button.running {
  position: fixed;
  z-index: 6000;

  transition:
    left 0.22s ease,
    top 0.22s ease,
    transform 0.18s ease;
}

/* =========================
   ПРОСМОТР ВИДЕО
   ========================= */

.viewer {
  position: fixed;
  inset: 0;

  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 40px;

  background: rgba(0, 0, 0, 0.94);
}

.viewer[hidden] {
  display: none;
}

.viewer video {
  width: auto;
  height: auto;

  max-width: 100%;
  max-height: calc(100vh - 80px);

  object-fit: contain;
}

.close {
  position: fixed;

  top: 18px;
  right: 24px;

  z-index: 1001;

  width: 44px;
  height: 44px;

  padding: 0;
  border: 0;

  background: transparent;
  color: #ffffff;

  font-size: 38px;
  font-weight: 200;
  line-height: 44px;

  cursor: pointer;
}

/* =========================
   ПЛАНШЕТ
   ========================= */

@media (max-width: 900px) {

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .final-section {
    grid-template-columns: 1fr;
  }

  .final-side {
    display: none;
  }

  .final-video {
    width: 60%;
    margin: 0 auto;
  }
}

/* =========================
   ТЕЛЕФОН
   ========================= */

@media (max-width: 600px) {

  body {
    padding: 24px 0 32px;
  }

  .page {
    width: calc(100% - 24px);
  }

  h1 {
    margin-bottom: 20px;
    font-size: 20px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .final-section {
    margin-top: 14px;
  }

  .final-video {
    width: 100%;
  }

  .viewer {
    padding: 20px;
  }

  .viewer video {
    max-height: calc(100vh - 40px);
  }

  .close {
    top: 8px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Финальный фон страницы */
html,
body {
  background-color: #0b0b0d !important;
  background-image:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.025),
      transparent 45%
    );
  background-attachment: fixed;
}

/* Более заметный фон страницы */
html,
body {
  min-height: 100%;
  background-color: #101115 !important;
  background-image:
    radial-gradient(
      circle at 50% -10%,
      rgba(255, 255, 255, 0.09) 0%,
      rgba(255, 255, 255, 0.035) 25%,
      transparent 55%
    ),
    radial-gradient(
      circle at 15% 90%,
      rgba(120, 120, 255, 0.035),
      transparent 35%
    ),
    radial-gradient(
      circle at 85% 90%,
      rgba(255, 120, 180, 0.025),
      transparent 35%
    ) !important;
  background-attachment: fixed;
}

/* =========================
   ФОН ИЗ background.jpg
   ========================= */

html,
body {
  min-height: 100%;
}

body {
  background-color: #0b0b0d !important;
  background-image: url("background.jpg") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

/* Лёгкое затемнение поверх картинки,
   чтобы текст и видео хорошо читались */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.28);
}

/* Чтобы модальное окно тоже показывало фон */
.date-modal {
  background: rgba(11, 11, 13, 0.58) !important;
}

body {
  background-image: url("background.jpg") !important;
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

@media (max-width: 600px) {
  body {
    background-size: 100% auto !important;
    background-position: center top !important;
    background-attachment: scroll !important;
    background-color: #0b0b0d !important;
  }
}

@media (max-width: 600px) {
  .page {
    width: calc(100% - 36px);
  }

  .video-grid {
    gap: 34px;
  }

  .final-section {
    margin-top: 34px;
  }

  .final-video {
    width: 94%;
    margin: 0 auto;
  }
}

/* Бесконечно повторяем фон на мобильных */
@media (max-width: 600px) {
  html,
  body {
    background-image: url("background.jpg") !important;
    background-size: 100% auto !important;
    background-position: center top !important;
    background-repeat: repeat-y !important;
    background-attachment: scroll !important;
    background-color: #0b0b0d !important;
  }
}
