/* 
 * СвойХит - Основные стили
 * Дизайн в стиле Telegram карточки бота
 */

/* === Глобальные стили === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body.rules-page,
body.oferta-page {
    height: auto;
    overflow-y: auto;
}

/* === Главная страница === */
.index-page {
    background: linear-gradient(135deg, #2ecc71 0%, #3498db 50%, #9b59b6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.page-wrapper {
    width: 100%;
    max-width: 500px;
}

.card-container {
    width: 100%;
}

.profile-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
}

/* === Аватар === */
.avatar-wrapper {
    margin-bottom: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* === Заголовки === */
.bot-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
}

.bot-username {
    font-size: 0.95rem;
    color: #707579;
    margin-bottom: 6px;
}

.bot-stats {
    font-size: 0.875rem;
    color: #999;
    margin-bottom: 25px;
}

/* === Описание === */
.bot-description {
    background: #f7f7f7;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 25px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.music-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.bot-description p {
    font-size: 0.95rem;
    color: #222;
    line-height: 1.5;
    margin: 0;
}

/* === Кнопка === */
.start-button {
    display: inline-block;
    background: #3390ec;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    padding: 12px 40px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.start-button:hover {
    background: #2b7fd1;
}

.start-button:active {
    transform: scale(0.98);
}

/* === Адаптивность для главной страницы === */

/* Планшеты */
@media (max-width: 768px) {
    .index-page {
        padding: 15px;
    }
    
    .page-wrapper {
        max-width: 450px;
    }
    
    .profile-card {
        padding: 35px 28px;
        border-radius: 18px;
    }
    
    .bot-title {
        font-size: 1.6rem;
    }
    
    .avatar {
        width: 110px;
        height: 110px;
    }
    
    .bot-description {
        padding: 16px 18px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .index-page {
        padding: 20px 15px;
        align-items: center;
    }
    
    .page-wrapper {
        max-width: 100%;
    }
    
    .profile-card {
        padding: 35px 24px;
        border-radius: 20px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .bot-title {
        font-size: 1.5rem;
    }
    
    .bot-username {
        font-size: 0.9rem;
    }
    
    .bot-stats {
        font-size: 0.85rem;
        margin-bottom: 22px;
    }
    
    .bot-description {
        padding: 15px 16px;
        border-radius: 10px;
        margin-bottom: 22px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .music-icon {
        font-size: 1.15rem;
        margin-top: 0;
    }
    
    .bot-description p {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .start-button {
        font-size: 0.9rem;
        padding: 12px 36px;
        border-radius: 24px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .index-page {
        padding: 15px 12px;
    }
    
    .profile-card {
        padding: 32px 20px;
        border-radius: 18px;
    }
    
    .avatar {
        width: 90px;
        height: 90px;
    }
    
    .bot-title {
        font-size: 1.4rem;
    }
    
    .bot-description {
        padding: 14px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .bot-description p {
        font-size: 0.875rem;
        text-align: center;
    }
}

/* === Страницы контента (Правила, Оферта) === */
.rules-page,
.oferta-page {
    background: #f9f9f9;
    min-height: 100vh;
    padding: 40px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Новый хедер с аватаром */
.page-header-simple {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-small-wrapper {
    margin-bottom: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    display: inline-block;
}

.avatar-small {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.page-title-center {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    margin: 0 0 10px 0;
    text-align: center;
}

.last-updated-center {
    font-size: 15px;
    color: #555;
    margin: 0 0 25px 0;
    text-align: center;
}

/* Старый хедер (не используется) */
.page-header {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-content {
    max-width: 100%;
}

.back-link {
    display: inline-block;
    color: #3390ec;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 15px;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.7;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    margin: 0;
}

.page-content {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    padding: 28px;
    margin-bottom: 0;
}

.rules-content,
.oferta-content {
    color: #222;
}

.content-html {
    color: #222;
    font-size: 1rem;
    line-height: 1.6;
}

.content-html h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 20px 0 10px;
}

.content-html h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 15px 0 8px;
}

.content-html p {
    margin: 0 0 10px 0;
    text-align: justify;
    color: #222;
}

.content-html p:first-child {
    text-align: center;
    margin-bottom: 20px;
}

.content-html ul,
.content-html ol {
    padding-left: 22px;
    margin: 10px 0;
}

.content-html li {
    margin: 8px 0;
    color: #222;
}

.last-updated {
    font-style: italic;
    color: #707579;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.rules-section,
.oferta-section {
    margin-bottom: 35px;
}

.rules-section h2,
.oferta-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 10px;
    margin-top: 15px;
}

.rules-section p,
.oferta-section p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
    margin-bottom: 8px;
}

.rules-section ul,
.oferta-section ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.rules-section li,
.oferta-section li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 8px;
}

.notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 18px;
    margin-bottom: 25px;
    border-radius: 8px;
    color: #856404;
    font-size: 0.95rem;
}

.footer {
    text-align: center;
    padding: 20px;
}

.footer-content {
    color: #707579;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #999;
    margin-top: 10px;
}

/* === Адаптивность для страниц контента === */

/* Планшеты */
@media (max-width: 768px) {
    .rules-page,
    .oferta-page {
        padding: 30px 15px;
    }
    
    .page-content {
        padding: 22px;
    }
    
    .page-title-center {
        font-size: 24px;
    }
    
    .content-html h2 {
        font-size: 18px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .rules-page,
    .oferta-page {
        padding: 20px 10px;
    }
    
    .page-content {
        padding: 18px;
    }
    
    .page-title-center {
        font-size: 22px;
    }
    
    .content-html h2 {
        font-size: 18px;
    }
    
    .rules-section h2,
    .oferta-section h2 {
        font-size: 1.15rem;
        margin-bottom: 10px;
        margin-top: 15px;
        line-height: 1.3;
    }
    
    .rules-section p,
    .oferta-section p,
    .content-html p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 12px;
        text-align: left;
    }
    
    .rules-section ul,
    .oferta-section ul {
        margin-left: 18px;
        margin-bottom: 12px;
    }
    
    .rules-section li,
    .oferta-section li {
        font-size: 0.9rem;
        margin-bottom: 8px;
        line-height: 1.5;
    }
    
    .notice {
        padding: 12px 14px;
        font-size: 0.875rem;
        margin-bottom: 18px;
        line-height: 1.5;
    }
    
    .content-html {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .rules-page,
    .oferta-page {
        padding: 12px 10px;
    }
    
    .page-header {
        padding: 18px 14px;
        border-radius: 10px;
    }
    
    .page-content {
        padding: 18px 14px;
        border-radius: 10px;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
    
    .back-link {
        font-size: 0.875rem;
    }
    
    .rules-section h2,
    .oferta-section h2 {
        font-size: 1.1rem;
        margin-top: 12px;
    }
    
    .rules-section p,
    .oferta-section p,
    .content-html p {
        font-size: 0.875rem;
        line-height: 1.55;
    }
    
    .rules-section li,
    .oferta-section li {
        font-size: 0.875rem;
    }
}

/* === Улучшения для touch-устройств === */
@media (hover: none) and (pointer: coarse) {
    .start-button {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .back-link {
        padding: 8px 0;
    }
    
    /* Увеличиваем область нажатия для ссылок */
    .back-link::before {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
    }
}
