/**
 * Лендинг GuitarPulse — состояние страницы и стили для динамического контента.
 * Основная вёрстка и стили из Figma (Tailwind) в mobile_landing.html, Tailwind CDN в index.html.
 */

/* Заголовки на лендинге: чем меньше экран, тем меньше шрифт */
.landing h1,
.mobile-landing h1 {
    font-size: clamp(1.5rem, 8vw + 1rem, 6rem) !important;
}
.landing h2,
.mobile-landing h2 {
    font-size: clamp(1.25rem, 6vw + 1rem, 4.5rem) !important;
}
.landing h3,
.mobile-landing h3 {
    font-size: clamp(1.125rem, 4vw + 0.5rem, 1.5rem) !important;
}
.landing h4,
.mobile-landing h4,
.landing .text-4xl,
.mobile-landing .text-4xl {
    font-size: clamp(1rem, 3vw + 0.5rem, 2.25rem) !important;
}

/* Секции: чем уже экран, тем меньше верхний и нижний паддинг */
.landing section,
.mobile-landing section {
    padding-top: clamp(1.5rem, 6vw + 1rem, 8rem) !important;
    padding-bottom: clamp(1.5rem, 6vw + 1rem, 8rem) !important;
}
/* Блоки с py-20 (например, контент в hero) — меньший максимум */
.landing .py-20,
.mobile-landing .py-20 {
    padding-top: clamp(1.25rem, 5vw + 0.75rem, 5rem) !important;
    padding-bottom: clamp(1.25rem, 5vw + 0.75rem, 5rem) !important;
}

/* ---------- Состояние страницы: показ лендинга ---------- */
.mobile-landing-active {
    overflow: hidden;
}

.mobile-landing-active .app-preloader,
.mobile-landing-active #app,
.mobile-landing-active .auth-modal,
.mobile-landing-active .telegram-banner {
    display: none !important;
}

/* Шапка лендинга: одна строка — лого | иконки по центру | ИГРАТЬ (без Tailwind grid) */
.landing-header-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
}

@media (min-width: 640px) {
    .landing-header-row {
        gap: 1rem;
    }
}

.landing-header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    justify-self: start;
    text-decoration: none;
    color: inherit;
}

@media (min-width: 640px) {
    .landing-header-brand {
        gap: 0.75rem;
    }
}

.landing-header-brand-text {
    font-size: clamp(0.9375rem, 2.8vw, 1.25rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(42vw, 11rem);
}

@media (max-width: 400px) {
    .landing-header-brand-text {
        display: none;
    }
}

.landing-header-brand-accent {
    background: linear-gradient(to right, #22d3ee, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.landing-header-social {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    min-width: 0;
    padding: 0 0.125rem;
}

@media (min-width: 640px) {
    .landing-header-social {
        gap: 0.5rem;
        padding: 0 0.25rem;
    }
}

.landing-header__cta {
    justify-self: end;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

/* Логотип в шапке: фиксированный размер (не зависит от purge Tailwind для w-9/h-9) */
.landing-header-logo {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

@media (max-width: 379px) {
    .landing-header-logo {
        width: 36px;
        height: 36px;
        max-width: 36px;
        max-height: 36px;
    }
}

/* ---------- Иконки соцсетей в шапке (без подписей) ---------- */
.landing-header-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.landing-header-social__link:hover {
    color: #f8fafc;
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(34, 211, 238, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.landing-header-social__link:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.85);
    outline-offset: 2px;
}

@media (max-width: 379px) {
    .landing-header-social__link {
        width: 34px;
        height: 34px;
    }

    .landing-header-social__link svg {
        width: 18px;
        height: 18px;
    }
}

/* ---------- Кнопка ИГРАТЬ в шапке (инжект из landing.js) ---------- */
.landing-header__cta .landing-cta-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0891b2, #2563eb);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (max-width: 360px) {
    .landing-header__cta .landing-cta-play {
        padding: 8px 14px;
        font-size: 13px;
    }
}

.landing-header__cta .landing-cta-play:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

/* ---------- Пульсация кнопки «ПОПРОБУЙ САМ» под видео ---------- */
@keyframes landing-cta-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.45);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(6, 182, 212, 0);
        transform: scale(1.02);
    }
}

.landing-cta-pulse {
    animation: landing-cta-pulse 2s ease-in-out infinite;
}

.landing-cta-pulse:hover {
    animation: none;
}

/* ---------- Кнопка вкл/выкл звука: красная с градиентом, в стиле сайта ---------- */
@keyframes landing-mute-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
        transform: scale(1.05);
    }
}

.landing-mute-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: rgba(239, 68, 68, 0.4);
    animation: landing-mute-pulse 2s ease-in-out infinite;
}

.landing-mute-btn:hover {
    background: linear-gradient(135deg, #f87171, #ef4444) !important;
    animation: none;
}

/* Иконки в одной точке: контейнер фиксированного размера, обе иконки друг над другом */
.landing-mute-btn-icons {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.landing-mute-btn-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
}

.landing-mute-icon-hidden {
    opacity: 0;
    pointer-events: none;
}

/* На мобильных кнопки ИГРАТЬ и ПОПРОБУЙ САМ остаются видимыми; по клику показывается сообщение «попробуй с ПК» (см. landing.js / mobileLanding.js) */

/* ---------- Блоки «Особенности» (features-grid): адаптивная вёрстка ---------- */
/* Ширина < 350px: картинка (иконка) по центру по ширине */
@media (max-width: 399px) {
    .feature-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .feature-card .feature-card-icon {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.5rem;
    }
    .feature-card .feature-card-content {
        width: 100%;
    }
}

/* Ширина 350px–770px: в одну строку картинка и текст внутри каждого блока */
@media (min-width: 400px) and (max-width: 770px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    .feature-card {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
        text-align: left;
    }
    .feature-card .feature-card-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .feature-card .feature-card-content {
        flex: 1;
        min-width: 0;
    }
    .feature-card .feature-card-content h3 {
        margin-bottom: 0.5rem;
    }
}

/* ---------- Корень лендинга (оверлей поверх страницы) ---------- */
.landing.mobile-landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    overflow-y: auto;
}

/* ---------- Список песен (инжектируется из landing.js) ---------- */
.songs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-song-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.6);
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.landing-song-card:hover {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2);
}

.song-info {
    display: flex;
    flex-direction: column;
}

.song-name {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
}

.song-level {
    font-size: 13px;
    color: rgba(148, 163, 184, 1);
}

.landing-play-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.landing-play-btn:hover {
    transform: scale(1.05);
}

.landing-play-btn:active {
    transform: scale(0.98);
}

.landing-play-btn.playing {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
}

.play-icon {
    font-size: 18px;
    margin-left: 2px;
}

.landing-play-btn.playing .play-icon {
    margin-left: 0;
}

.landing-no-songs,
.landing-error,
.landing-songs-loading {
    text-align: center;
    padding: 20px;
    color: rgba(148, 163, 184, 1);
    font-size: 15px;
}
