* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(145deg, #f5f7fc 0%, #eef2f7 100%);
    min-height: 100vh;
    height: auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Основной контейнер — теперь адаптивный по высоте, без фиксации 100vh */
.container {
    max-width: 700px;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 32px;
    padding: 20px 20px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(0px);
    transition: all 0.2s ease;
}

/* Заголовок продажи */
.sale-header {
    text-align: center;
    margin-bottom: 8px;
}

.sale-header h1 {
    font-size: clamp(26px, 8vw, 36px);
    font-weight: 800;
    background: linear-gradient(135deg, #1e2b3c, #0f1a24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}

.contact-email {
    text-align: center;
    font-size: 14px;
    color: #4a627a;
    background: #f0f4fa;
    display: inline-block;
    width: auto;
    margin: 8px auto 12px;
    padding: 8px 18px;
    border-radius: 60px;
    backdrop-filter: blur(4px);
    font-weight: 500;
}

.radio-heading {
    text-align: center;
    margin: 16px 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-heading h2 {
    font-size: clamp(20px, 6vw, 28px);
    font-weight: 700;
    background: linear-gradient(120deg, #0077ff, #00c3ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.2px;
}

.now-playing {
    text-align: center;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #ffffffea;
    border-radius: 60px;
    font-size: 14px;
    color: #2c3e4e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.05);
    font-weight: 500;
    backdrop-filter: blur(2px);
}

.now-playing span {
    color: #0070e0;
    font-weight: 700;
    font-size: 15px;
    background: #eef3ff;
    padding: 4px 12px;
    border-radius: 40px;
    display: inline-block;
    margin-left: 6px;
}

/* Список радиостанций — компактный и удобный для скролла */
.radio-wrapper {
    flex: 1;
    overflow-y: auto;
    max-height: 52vh;
    margin: 12px 0 18px;
    padding-right: 4px;
}

/* Кастомизация скроллбара (тонкий, но удобный) */
.radio-wrapper::-webkit-scrollbar {
    width: 4px;
}

.radio-wrapper::-webkit-scrollbar-track {
    background: #e9edf2;
    border-radius: 10px;
}

.radio-wrapper::-webkit-scrollbar-thumb {
    background: #b9c4d0;
    border-radius: 10px;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 4px 2px;
}

.radio-grid li {
    background: transparent;
    border-radius: 20px;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.radio-grid li button {
    width: 100%;
    padding: 14px 8px;
    background: #f8fafd;
    border: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    font-size: 15px;
    font-weight: 590;
    color: #1f2e3a;
    border-radius: 28px;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    backdrop-filter: blur(2px);
    letter-spacing: -0.2px;
    text-align: center;
}

.radio-grid li button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 6px 14px rgba(0, 123, 255, 0.25);
}

.radio-grid li button.playing {
    background: #1f9e4d;
    color: white;
    border-color: #188a42;
    box-shadow: 0 4px 12px rgba(31, 158, 77, 0.3);
}

.radio-grid li button.playing::after {
    content: " 🔊";
    font-size: 13px;
    font-weight: normal;
    margin-left: 4px;
}

.radio-grid li button:active {
    transform: scale(0.96);
}

/* Кнопка остановки */
.player-controls {
    text-align: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.control-button {
    background: #f1f3f7;
    color: #d1453b;
    border: 1px solid rgba(209, 69, 59, 0.3);
    padding: 12px 26px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    backdrop-filter: blur(4px);
    width: auto;
    min-width: 160px;
    letter-spacing: 0.3px;
}

.control-button:hover {
    background: #ffe8e6;
    border-color: #d1453b;
    transform: translateY(-1px);
}

.control-button:active {
    transform: scale(0.97);
}

/* Адаптивность под узкие экраны */
@media (max-width: 560px) {
    body {
        padding: 12px;
    }
    .container {
        padding: 16px 16px 20px;
        border-radius: 28px;
    }
    .radio-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .radio-grid li button {
        padding: 12px 6px;
        font-size: 13.5px;
    }
    .now-playing {
        font-size: 12.5px;
        padding: 10px 12px;
    }
    .now-playing span {
        font-size: 13px;
        padding: 3px 10px;
    }
    .radio-wrapper {
        max-height: 48vh;
        margin: 8px 0 14px;
    }
    .control-button {
        padding: 10px 22px;
        font-size: 15px;
        min-width: 140px;
    }
    .contact-email {
        font-size: 12px;
        padding: 6px 14px;
    }
}

@media (max-width: 420px) {
    .radio-grid {
        grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
        gap: 8px;
    }
    .radio-grid li button {
        padding: 10px 4px;
        font-size: 12.5px;
        border-radius: 26px;
    }
    .radio-wrapper {
        max-height: 50vh;
    }
}

/* Стили для тач-устройств без hover-эффектов, чтобы не мешать */
@media (hover: none) {
    .radio-grid li button:hover {
        transform: none;
    }
    .control-button:hover {
        transform: none;
    }
}

/* Анимация загрузки */
@keyframes softPulse {
    0% { opacity: 0.7; background: #ffb347; transform: scale(0.98);}
    100% { opacity: 1; background: #ff9f2c; transform: scale(1);}
}

.radio-grid li button.loading {
    animation: softPulse 0.9s ease-in-out infinite;
    background: #ffa559;
    color: #2d2b26;
    border-color: #ff8c33;
    pointer-events: none;
}

/* Улучшение для сенсорного скролла */
.radio-wrapper {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Скрываем стандартные outline, но оставляем для accessibility */
button:focus-visible {
    outline: 2px solid #0077ff;
    outline-offset: 2px;
}

audio {
    display: none;
}

.small-note {
    text-align: center;
    font-size: 10px;
    color: #8c9aa8;
    margin-top: 16px;
    letter-spacing: 0.2px;
}