/* ===== LOCAL FONTS ===== */
@font-face {
  font-family: 'Special Elite';
  src: url('./fonts/specialelite-regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('./fonts/spacegrotesk-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PT Mono';
  src: url('./fonts/ptmono-regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('./fonts/inter-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== COMMON UTILITY CLASSES ===== */
.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.text-break {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: 'Space Grotesk', sans-serif;
    min-width: 320px;
}

/* Стабильный скроллбар для современных браузеров */
@supports (scrollbar-gutter: stable) {
    body {
        scrollbar-gutter: stable;
    }
}

/* Предотвращение FOUT (Flash of Unstyled Text) - используем локальные шрифты */

/* Скрываем текст до загрузки шрифта с fallback */
#intro-text {
    font-family: 'Special Elite', 'Courier New', 'Courier', monospace;
    font-weight: normal;
    font-style: normal;
}

/* Дополнительная защита от FOUT */
#intro-text:not(.font-loaded) {
    visibility: hidden;
}

#intro-text.font-loaded {
    visibility: visible;
}

.cursor {
    width: 5px;
    height: 1.5em;
    background-color: #fff;
    animation: blink 1s step-end infinite;
    z-index: 10;
    user-select: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto; /* Разрешаем клики, но без изменения курсора */
}

.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    font-family: Inter, sans-serif;
    font-size: 16px;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

@keyframes blink {
    50% { opacity: 0; }
}

#intro-text {
    font-size: clamp(1.5em, 6vw, 3em);
    font-family: 'Special Elite', cursive;
    color: #fff;
    text-align: center;
    max-width: 90vw;
    width: 90vw;
    padding: 0 5vw;
    box-sizing: border-box;
    line-height: 1.4;
    opacity: 0;
    user-select: none;
}

.sentence {
    width: 95vw;
    font-size: clamp(1.2em, 4vw, 2em);
    color: #fff;
    text-align: center;
    font-family: 'PT Mono', monospace;
    line-height: 1.4;
    max-width: 100%;
    user-select: none;
    padding: 0 2.5vw;
    box-sizing: border-box;
}

/* Медиа-запросы для адаптивности */

/* Планшеты в портретной ориентации */
@media (max-width: 1024px) {
    .sentence {
        width: 92vw;
        font-size: clamp(1.1em, 4.5vw, 1.8em);
        line-height: 1.35;
        padding: 0 4vw;
    }
}

/* Десктопные устройства */
@media (min-width: 1025px) and (max-width: 1439px) {
    .sentence {
        width: 95vw;
        font-size: clamp(1.4em, 3.5vw, 2em);
        line-height: 1.4;
        padding: 0 2.5vw;
        max-width: 900px;
    }
}

/* Планшеты в альбомной ориентации и маленькие ноутбуки */
@media (max-width: 768px) {
    .sentence {
        width: 94vw;
        font-size: clamp(1em, 5vw, 1.5em);
        line-height: 1.3;
        padding: 0 3vw;
    }
    
    body {
        padding: 10px;
    }
}

/* Большие мобильные устройства */
@media (max-width: 640px) {
    .sentence {
        width: 95vw;
        font-size: clamp(0.95em, 5.5vw, 1.3em);
        line-height: 1.25;
        padding: 0 2.5vw;
    }
}

/* Стандартные мобильные устройства */
@media (max-width: 480px) {
    .sentence {
        width: 96vw;
        font-size: clamp(0.9em, 6vw, 1.2em);
        line-height: 1.2;
        padding: 0 2vw;
    }
}

/* Маленькие мобильные устройства */
@media (max-width: 375px) {
    .sentence {
        width: 97vw;
        font-size: clamp(0.85em, 6.5vw, 1.1em);
        line-height: 1.15;
        padding: 0 1.5vw;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 320px) {
    .sentence {
        width: 98vw;
        font-size: 0.8em;
        line-height: 1.1;
        padding: 0 1vw;
    }
}

/* Для больших экранов */
@media (min-width: 1440px) {
    .sentence {
        font-size: clamp(1.8em, 3vw, 2.2em);
        max-width: 1100px;
        width: 95vw;
        padding: 0 2.5vw;
    }
}

@media (min-width: 1920px) {
    .sentence {
        font-size: 2.2em;
        max-width: 1300px;
        width: 95vw;
        padding: 0 2.5vw;
    }
}

/* Для очень больших экранов (4K и выше) */
@media (min-width: 2560px) {
    .sentence {
        font-size: 2.5em;
        max-width: 1500px;
        width: 95vw;
        padding: 0 2.5vw;
    }
}

/* Стили для iOS Safari - исправление рендеринга форм */
/* Глобальные iOS-override'ы удалены - теперь они применяются только к модалке */

/* Горизонтальная ориентация на мобильных устройствах */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 768px) {
    .sentence {
        font-size: clamp(1.2em, 5vw, 1.8em);
        line-height: 1.3;
        width: 96vw !important;
        max-width: 600px !important;
        padding: 0 10px !important;
    }
}

/* Альбомная ориентация для маленьких экранов */
@media (max-height: 400px) and (orientation: landscape) and (max-width: 768px) {
    .sentence {
        font-size: clamp(1.1em, 4.5vw, 1.6em);
        line-height: 1.2;
        width: 98vw !important;
        max-width: 500px !important;
        padding: 0 8px !important;
    }
}

/* Планшеты в альбомной ориентации */
@media (min-width: 768px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
    .sentence {
        font-size: clamp(1.4em, 4vw, 2.2em);
        line-height: 1.4;
        width: 94vw !important;
        max-width: 700px !important;
        padding: 0 12px !important;
    }
}

/* Высокие экраны (соотношение сторон больше 16:9) */
@media (min-aspect-ratio: 16/9) {
    .sentence {
        font-size: clamp(1.5em, 3.5vw, 2.5em);
    }
}

/* Стили модального окна удалены - теперь они в main.js с правильным ID */

/* Медиа-запросы для курсора на мобильных устройствах */
@media (max-width: 768px) {
    .cursor {
        height: 1.2em;
        width: 4px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 480px) {
    .cursor {
        height: 1.1em;
        width: 3px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 375px) {
    .cursor {
        height: 1em;
        width: 3px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

/* Дополнительные стили для курсора на iOS */
@supports (-webkit-touch-callout: none) {
    .cursor {
        /* Улучшенное позиционирование для iOS */
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        will-change: opacity;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* Специальные стили для модального окна удалены */
}

/* Мобильные стили для модального окна удалены - теперь они в main.js */

/* Стили для контейнера Turnstile */
.waitlist-form .cf-turnstile {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
}

/* Стили для CTA текста */
#ln-cta-text {
  transition: all 0.3s ease;
  cursor: default; /* По умолчанию неактивен */
  opacity: 0.6; /* Визуально показываем неактивность */
}

#ln-cta-text.active {
  cursor: pointer; /* Курсор-рука когда активен */
  opacity: 1; /* Полная непрозрачность когда активен */
}

/* Дополнительные стили для кнопки CTA */
#ln-cta-button {
  cursor: default; /* По умолчанию неактивен */
  transition: all 0.3s ease;
}

#ln-cta-button.active {
  cursor: pointer; /* Курсор-рука когда активен */
}

#ln-cta-text.active:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

#ln-cta-text.active:active {
  transform: scale(0.95);
}

/* Анимация появления текста */
#ln-cta-text span {
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.12s ease;
}

/* Эффект свечения для активного текста */
#ln-cta-text.glow {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
  }
}

/* Адаптивные стили для CTA в альбомном режиме */
@media (orientation: landscape) and (max-height: 600px) {
  #ln-cta {
    bottom: 10vh !important; /* Поднимаем выше в альбомном режиме */
    bottom: calc(10 * var(--vh, 1vh)) !important; /* Используем динамическую высоту viewport */
  }
  
  #ln-cta-button {
    font-size: clamp(18px, 3vw, 26px) !important; /* Увеличиваем размер шрифта */
    letter-spacing: 0.07em !important; /* Увеличиваем межбуквенный интервал */
  }
}

/* Дополнительные стили для очень маленьких экранов в альбомном режиме */
@media (orientation: landscape) and (max-height: 500px) {
  #ln-cta {
    bottom: 8vh !important; /* Поднимаем выше для очень маленьких экранов */
    bottom: calc(8 * var(--vh, 1vh)) !important; /* Используем динамическую высоту viewport */
  }
  
  #ln-cta-button {
    font-size: clamp(16px, 2.5vw, 22px) !important; /* Увеличиваем размер */
    letter-spacing: 0.06em !important;
  }
}

/* Стили для планшетов в альбомном режиме */
@media (orientation: landscape) and (min-width: 768px) and (max-height: 600px) {
  #ln-cta {
    bottom: 12vh !important; /* Поднимаем выше для планшетов */
    bottom: calc(12 * var(--vh, 1vh)) !important; /* Используем динамическую высоту viewport */
  }
  
  #ln-cta-button {
    font-size: clamp(20px, 3.2vw, 28px) !important; /* Увеличиваем размер */
  }
}

/* Дополнительные стили для логотипа в альбомном режиме на мобильных устройствах */
@media (orientation: landscape) and (max-height: 600px) {
  /* Уменьшаем размер логотипа в альбомном режиме */
  img[alt="LoreNow Logo"], img[alt="LoreNow Logo (blur)"] {
    width: clamp(120px, 25vw, 280px) !important;
    max-width: 50vw !important;
  }
  
  /* Уменьшаем размер подзаголовка в альбомном режиме */
  .logo-subtitle {
    font-size: clamp(10px, 1.5vw, 16px) !important;
    margin-top: 4px !important;
  }
}

/* Адаптация дизайна для работы с видимой адресной строки в альбомном режиме */
@media (orientation: landscape) and (max-width: 768px) {
  /* Используем доступную высоту с учетом адресной строки */
  body {
    height: calc(100vh - 56px); /* Вычитаем примерную высоту адресной строки */
    height: calc(var(--available-vh, 1vh) * 100); /* Используем CSS переменную для точной высоты */
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  
  /* Разрешаем прокрутку для модалки waitlist */
  body:has(.waitlist-overlay) {
    overflow: visible !important; /* Переопределяем для модалки */
  }
  
  /* Fallback для браузеров без поддержки :has() */
  body.waitlist-open {
    overflow: visible !important;
  }
  
  /* Убеждаемся, что контент использует всю доступную высоту */
  #ln-cta {
    position: fixed !important;
    bottom: calc(8 * var(--available-vh, 1vh)) !important;
  }
  
}

/* Отдельный @media для очень маленьких экранов в альбомном режиме */
@media (orientation: landscape) and (max-width: 768px) and (max-height: 500px) {
  body {
    height: calc(100vh - 48px); /* Меньшая высота адресной строки на маленьких экранах */
  }
  
  #ln-cta {
    bottom: calc(6 * var(--available-vh, 1vh)) !important;
  }
}

/* Отдельный @media для планшетов в альбомном режиме */
@media (orientation: landscape) and (min-width: 768px) {
  .waitlist-overlay {
    overflow-y: auto !important; /* Принудительно включаем прокрутку */
  }
}

/* Стили для очень маленьких экранов в альбомном режиме */
@media (orientation: landscape) and (max-height: 500px) {
  img[alt="LoreNow Logo"], img[alt="LoreNow Logo (blur)"] {
    width: clamp(100px, 20vw, 220px) !important;
    max-width: 40vw !important;
  }
  
  /* Еще больше уменьшаем подзаголовок для очень маленьких экранов */
  .logo-subtitle {
    font-size: clamp(8px, 1.2vw, 12px) !important;
    margin-top: 2px !important;
  }
}

/* Оптимизация для альбомного режима с учетом видимой адресной строки */
@media (orientation: landscape) and (max-width: 768px) {
  /* Используем доступную высоту с учетом адресной строки */
  html {
    height: 100%;
    overflow: hidden;
  }
  
  /* Дополнительные стили для контейнера */
  #app, #root, body > div:first-child {
    height: calc(var(--available-vh, 1vh) * 100);
    overflow: hidden;
  }
  
  /* Разрешаем прокрутку для модалки waitlist */
  .waitlist-overlay {
    overflow-y: auto !important; /* Включаем вертикальную прокрутку */
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
  }
  
  .waitlist-overlay .waitlist-dialog {
    overflow: visible !important; /* Разрешаем прокрутку содержимого */
  }
  
  
  /* Стили для предотвращения нежелательного скролла */
  * {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Скрытие полос прокрутки */
  ::-webkit-scrollbar {
    display: none;
  }
  
  /* Для Firefox */
  * {
    scrollbar-width: none;
  }
}

/* Специальные стили для iOS Safari */
@supports (-webkit-touch-callout: none) {
  @media (orientation: landscape) and (max-width: 768px) {
    body {
      /* Используем -webkit-fill-available для iOS */
      height: -webkit-fill-available;
      min-height: -webkit-fill-available;
    }
    
    html {
      height: -webkit-fill-available;
    }
    
    /* Специальные стили для waitlist на iOS в альбомном режиме */
    .waitlist-overlay {
      height: -webkit-fill-available !important;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch !important;
    }
  }
  
  /* iOS поддержка для планшетов */
  @media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .waitlist-overlay {
      height: -webkit-fill-available; /* iOS fallback */
    }
  }
  
  @media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    .waitlist-overlay {
      height: -webkit-fill-available; /* iOS fallback */
    }
  }
}

/* WAITLIST */
/* Оверлей должен скроллиться сам и начинать контент от самого верха */
.waitlist-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;     /* было center → из-за этого «залипала» серединка */
  justify-content: center;
  overflow-y: auto;            /* скролл на оверлее */
  padding: 24px 16px 32px;     /* небольшой верхний/нижний отступ, чтобы не прилипало */
  box-sizing: border-box;
  background: rgba(0,0,0,.8);
  z-index: 10000;
}

/* Сам модальный контейнер — без «самовольных» сдвигов вверх/вниз */
.waitlist-modal {
  margin: 0;                   /* на всякий случай обнуляем, чтобы не было «минусовых» маржинов */
  transform: none;             /* если вдруг где-то стоял translateY(...) для центровки */
  max-width: 720px;            /* как у вас было/нужно */
  width: 100%;
}

/* если у вас на десктопе ранее был другой набор правил через media — перебейте их тоже */
@media (min-width: 1025px) {
  .waitlist-overlay {
    align-items: flex-start;
    overflow-y: auto;
  }
}

.waitlist-dialog {
  background: #FFFFFF;
  border: 1px solid #0A0A0A;
  border-radius: 8px;
  padding: 40px;
  max-width: 640px;
  width: 100%;
  position: relative;
  font-family: 'PT Mono', monospace;
  box-sizing: border-box;
}

.waitlist-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #0A0A0A;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.waitlist-close:hover {
  background-color: #f5f5f5;
}

.waitlist-header {
  text-align: center;
  margin-bottom: 24px;
}

.waitlist-title {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0A0A0A;
  margin: 0 0 8px 0;
  font-weight: normal;
}

.waitlist-subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: #6B7280;
  margin: 0 0 16px 0;
}

.waitlist-divider {
  display: none;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
}

.waitlist-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 24px;
}

/* First field has no top margin */
.waitlist-form > .waitlist-field:first-child {
  margin-top: 0;
}

/* Comment field - independent margin control */
.waitlist-comment-field {
  margin-top: 24px; /* Gap between Comment and Submit */
}

/* Consent field - independent margin control */
.waitlist-consent-field {
  margin-top: 24px; /* Standard gap for Consent field */
}

.waitlist-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #0A0A0A;
  font-weight: normal;
}

/* Email horizontal layout */
.waitlist-email-field {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.waitlist-email-container {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 40px;
}

.waitlist-email-label {
  font-size: 14px;
  font-weight: 500;
  color: #0A0A0A;
  font-family: 'PT Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  width: 80px;
}

.waitlist-email-input-container {
  position: relative;
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.waitlist-email-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #0A0A0A;
  transition: height 0.2s ease;
}

.waitlist-email-input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  font-family: 'PT Mono', monospace;
  color: #0A0A0A;
  padding: 0;
  height: 40px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.waitlist-email-input:focus + .waitlist-email-underline {
  height: 2px;
}

.waitlist-email-input::placeholder {
  color: transparent;
}

/* Desktop: hide placeholder, Mobile: show placeholder */
@media (max-width: 1024px) {
  .waitlist-email-input::placeholder {
    color: #6B7280;
  }
}

/* Mobile: vertical layout */
@media (max-width: 1024px) {
  .waitlist-email-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .waitlist-email-label {
    width: auto;
  }
}

.waitlist-textarea {
  height: 120px;
  padding: 12px;
  border: 1px solid #0A0A0A;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  font-family: 'PT Mono', monospace;
  background: #FFFFFF;
  color: #0A0A0A;
  resize: vertical;
  box-sizing: border-box;
  margin-top: 8px;
}

.waitlist-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px #0A0A0A;
}

/* Remove boxes around groups - clean native elements */
.waitlist-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 24px;
}

.waitlist-radio-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  line-height: 1.3;
  vertical-align: middle;
}

.waitlist-radio {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.waitlist-radio-label {
  font-size: 14px;
  line-height: 1.3;
  color: #0A0A0A;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  align-items: center;
  vertical-align: middle;
}

.waitlist-checkbox-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.waitlist-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  line-height: 1.3;
  vertical-align: middle;
}

.waitlist-checkbox {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.waitlist-checkbox-label {
  font-size: 14px;
  line-height: 1.3;
  color: #0A0A0A;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  align-items: center;
  vertical-align: middle;
}

.waitlist-submit {
  background: #000000;
  color: #FFFFFF;
  border: 1px solid #000000;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: 'PT Mono', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.waitlist-submit:hover {
  background: #FFFFFF;
  color: #000000;
}

.waitlist-submit:active {
  transform: translateY(1px);
}

.waitlist-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.waitlist-help {
  font-size: 12px;
  color: #6B7280;
  margin-top: 4px;
}

.waitlist-error {
  font-size: 12px;
  color: #B91C1C;
  margin-top: 4px;
}

/* Email field error positioning */
.waitlist-email-field .waitlist-error {
  margin-top: 8px;
  margin-left: 96px; /* Align with input field (80px label + 16px gap) */
}

@media (max-width: 1024px) {
  .waitlist-email-field .waitlist-error {
    margin-left: 0; /* Reset for mobile */
  }
}

.waitlist-counter {
  font-size: 12px;
  color: #6B7280;
  text-align: right;
  margin-top: 4px;
}

.waitlist-footer {
  font-size: 12px;
  color: #6B7280;
  text-align: left;
  margin-top: 16px;
  line-height: 1.4;
}

.waitlist-toast {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: #0A0A0A;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'PT Mono', monospace;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.waitlist-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.waitlist-toast.error {
  background: #B91C1C;
  color: #FFFFFF;
}

/* Tablet Portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .waitlist-overlay {
    height: 100dvh; /* Реальная высота viewport на планшетах */
    height: 100vh; /* Fallback для старых браузеров */
    align-items: flex-start; /* Выравниваем по верху */
    padding: env(safe-area-inset-top, 20px) 20px env(safe-area-inset-bottom, 20px) 20px; /* Safe area + отступы */
    overflow-y: auto; /* Разрешаем вертикальную прокрутку */
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
  }
  
  .waitlist-dialog {
    width: 90%;
    max-width: 600px; /* Компактная ширина для планшета */
    min-width: auto;
    padding: 32px; /* Компактные внутренние поля */
    margin: 0 auto; /* Центрируем диалог горизонтально */
    max-height: calc(100dvh - env(safe-area-inset-top, 20px) - env(safe-area-inset-bottom, 20px) - 40px); /* Ограничиваем высоту */
    overflow-y: auto; /* Прокрутка внутри диалога при переполнении */
  }
  
  .waitlist-fieldset {
    grid-template-columns: repeat(2, 1fr); /* 2 колонки для портрета */
    gap: 16px;
  }
  
  .waitlist-checkbox-group {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  /* Кнопка закрытия для планшетного портретного режима */
  .waitlist-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 8px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    z-index: 10;
  }
  
  .waitlist-close:hover {
    background-color: #f5f5f5;
  }
  
  .waitlist-header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 52px; /* 44px (кнопка) + 8px (отступ) */
  }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
  .waitlist-overlay {
    height: 100dvh; /* Реальная высота viewport на планшетах */
    height: 100vh; /* Fallback для старых браузеров */
    align-items: flex-start; /* Выравниваем по верху */
    padding: env(safe-area-inset-top, 10px) 10px env(safe-area-inset-bottom, 10px) 10px; /* Safe area + отступы */
    overflow-y: auto; /* Разрешаем вертикальную прокрутку */
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
  }
  
  .waitlist-dialog {
    width: 90%;
    max-width: 800px; /* Широкая ширина для ландшафта */
    min-width: auto;
    padding: 24px; /* Компактные внутренние поля */
    margin: 0 auto; /* Центрируем диалог горизонтально */
    max-height: calc(100dvh - env(safe-area-inset-top, 10px) - env(safe-area-inset-bottom, 10px) - 20px); /* Ограничиваем высоту */
    overflow-y: auto; /* Прокрутка внутри диалога при переполнении */
  }
  
  .waitlist-fieldset {
    grid-template-columns: repeat(3, 1fr); /* 3 колонки для ландшафта */
    gap: 16px;
  }
  
  .waitlist-checkbox-group {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  
  /* Кнопка закрытия для планшетного ландшафтного режима */
  .waitlist-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 4px);
    left: 4px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    z-index: 10;
  }
  
  .waitlist-close:hover {
    background-color: #f5f5f5;
  }
  
  .waitlist-header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 48px; /* 44px (кнопка) + 4px (отступ) */
  }
}

/* Desktop PC styles (≥1024px) */
@media (min-width: 1024px) {
  .waitlist-dialog {
    max-width: 640px;
    width: 100%;
  }
  
  .waitlist-fieldset {
    gap: 16px;
  }
  
  .waitlist-checkbox-group {
    gap: 16px;
  }
}

/* Platform field specific layout - 3 columns in one row */
.waitlist-platform-fieldset {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  gap: 24px;
  display: grid;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

/* Role field specific layout - 3 columns x 2 rows */
.waitlist-role-fieldset {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
  row-gap: 0;
  align-content: start;
  align-items: start;
  gap: 0 24px;
  display: grid;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

/* Genres field specific layout - 3 columns x 2 rows */
.waitlist-genres-fieldset {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
  row-gap: 0;
  align-content: start;
  align-items: start;
  gap: 0 24px;
  display: grid;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

/* Mobile Portrait */
@media (max-width: 1024px) and (orientation: portrait) {
  .waitlist-overlay {
    align-items: flex-start; /* Выравниваем по верху вместо центра */
    padding: 20px; /* Добавляем отступы от краев экрана */
    overflow-y: auto; /* Разрешаем вертикальную прокрутку */
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
  }
  
  .waitlist-dialog {
    width: 90%;
    max-width: 92vw;
    min-width: auto;
    padding: 24px;
    margin: 0 auto; /* Центрируем диалог горизонтально */
    max-height: none; /* Убираем ограничение высоты */
  }
  
  /* Кнопка закрытия для мобильного портретного режима */
  .waitlist-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 2px); /* Safe area + минимальный отступ */
    left: 12px;
    width: 44px; /* Минимальный размер тач-таргета */
    height: 44px; /* Минимальный размер тач-таргета */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    z-index: 10; /* Выше заголовка */
  }
  
  .waitlist-close:hover {
    background-color: #f5f5f5;
  }
  
  /* Заголовок с отступом под кнопку закрытия */
  .waitlist-header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 46px; /* 44px (кнопка) + 2px (отступ) */
  }
  
  .waitlist-fieldset {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .waitlist-checkbox-group {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .waitlist-submit {
    width: 100%;
  }
  
  .waitlist-platform-fieldset {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    row-gap: 0; /* Выравниваем с Role блоком - убираем вертикальный зазор */
  }
  
  .waitlist-role-fieldset {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
  
  .waitlist-genres-fieldset {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
  
  /* Email field alignment with content grid */
  .waitlist-email-container {
    width: 100%; /* Занимаем полную ширину контентной области */
  }
  
  .waitlist-email-input-container {
    width: 100%; /* Зона ввода на всю ширину */
    box-sizing: border-box; /* Внутренние отступы не влияют на ширину */
    margin: 0; /* Убираем любые внешние отступы */
    padding: 0; /* Убираем внутренние отступы */
  }
  
  .waitlist-email-input {
    width: 100%; /* Input на всю ширину контейнера */
    box-sizing: border-box; /* Внутренние отступы не влияют на ширину */
    margin: 0; /* Убираем любые внешние отступы */
    padding: 0; /* Убираем внутренние отступы */
  }
  
  .waitlist-email-underline {
    left: 0; /* Линия начинается с левого края */
    right: 0; /* Линия заканчивается на правом краю */
    width: 100%; /* Линия на всю ширину контейнера */
  }
}

/* Mobile Landscape */
@media (max-width: 1024px) and (orientation: landscape) {
  .waitlist-overlay {
    align-items: flex-start; /* Выравниваем по верху вместо центра */
    padding: 10px; /* Меньшие отступы для ландшафтного режима */
    overflow-y: auto; /* Разрешаем вертикальную прокрутку */
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
  }
  
  .waitlist-dialog {
    width: 90%;
    max-width: 92vw;
    min-width: auto;
    padding: 24px;
    margin: 0 auto; /* Центрируем диалог горизонтально */
    max-height: none; /* Убираем ограничение высоты */
  }
  
  /* Кнопка закрытия для мобильного ландшафтного режима */
  .waitlist-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 1px); /* Safe area + минимальный отступ для ландшафта */
    left: 8px;
    width: 44px; /* Минимальный размер тач-таргета */
    height: 44px; /* Минимальный размер тач-таргета */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    z-index: 10; /* Выше заголовка */
  }
  
  .waitlist-close:hover {
    background-color: #f5f5f5;
  }
  
  /* Заголовок с отступом под кнопку закрытия */
  .waitlist-header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 45px; /* 44px (кнопка) + 1px (отступ) */
  }
  
  .waitlist-field {
    margin-top: 16px;
  }
  
  .waitlist-form > .waitlist-field:first-child {
    margin-top: 0;
  }
  
  .waitlist-comment-field {
    margin-top: 16px; /* Gap between Comment and Submit on mobile */
  }
  
  .waitlist-consent-field {
    margin-top: 16px; /* Standard gap for Consent field on mobile */
  }
  
  .waitlist-fieldset {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  
  .waitlist-checkbox-group {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Focus trap styles */
.waitlist-dialog[aria-hidden="true"] {
  display: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .waitlist-overlay,
  .waitlist-dialog,
  .waitlist-toast,
  .waitlist-submit {
    transition: none;
  }
}

