/* ===== ГЛОБАЛЬНЫЕ НАСТРОЙКИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0b0e11;
    --bg-secondary: #1e2329;
    --bg-card: #1e2329;
    --bg-hover: #2b3139;
    --text-primary: #eaecef;
    --text-secondary: #848e9c;
    --accent: #f0b90b;
    --accent-hover: #d4a00a;
    --green: #0ecb81;
    --green-bg: #0ecb8120;
    --red: #f6465d;
    --red-bg: #f6465d20;
    --border: #2b3139;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1280px;
    --header-height: 60px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== ШАПКА ===== */
.header {
    background: var(--bg-secondary);
    padding: 10px 0;
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(16px, 2.5vw, 22px);
    font-weight: 800;
    color: var(--accent);
    cursor: default;
    flex-shrink: 0;
}

.logo i {
    font-size: clamp(18px, 2.5vw, 26px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: clamp(12px, 1.2vw, 14px);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-menu a.active {
    color: var(--accent);
    background: var(--bg-hover);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.last-update {
    font-size: clamp(10px, 0.9vw, 12px);
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.last-update i {
    font-size: clamp(10px, 0.9vw, 12px);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: clamp(20px, 3vw, 24px);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
}

/* ===== МОБИЛЬНОЕ МЕНЮ ===== */
.mobile-menu {
    display: none;
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 4px;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.mobile-menu a.active {
    color: var(--accent);
}

/* ===== БАННЕР ===== */
.banner {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    padding: clamp(20px, 4vw, 50px) 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(240, 185, 11, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.banner h1 {
    font-size: clamp(20px, 5vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.banner h1 span {
    color: var(--accent);
}

.banner p {
    font-size: clamp(14px, 1.8vw, 18px);
    color: var(--text-secondary);
}

/* ===== РЕКЛАМА ===== */
.ad-section {
    padding: clamp(12px, 2vw, 24px) 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

.ad-container .ad-content {
    max-width: 100%;
    text-align: center;
}

.ad-container .ad-content img,
.ad-container .ad-content video,
.ad-container .ad-content iframe {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.ad-container .ad-content a {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(14px, 1.5vw, 18px);
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.ad-container .ad-content a:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.ad-container .ad-placeholder {
    color: var(--text-secondary);
    font-size: clamp(12px, 1vw, 14px);
    opacity: 0.5;
    display: none;
}

/* ===== СЕКЦИИ ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: clamp(16px, 2.5vw, 24px);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.section-header h2 i {
    color: var(--accent);
    font-size: clamp(14px, 2vw, 20px);
}

.section-subtitle {
    font-size: clamp(10px, 1vw, 14px);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ===== КРИПТОВАЛЮТЫ ===== */
.crypto-grid {
    padding: clamp(16px, 3vw, 40px) 0;
}

.crypto-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 18vw, 240px), 1fr));
    gap: clamp(10px, 1.5vw, 16px);
}

.crypto-card {
    background: var(--bg-card);
    padding: clamp(12px, 1.5vw, 20px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: default;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.crypto-card:nth-child(1) { animation-delay: 0.05s; }
.crypto-card:nth-child(2) { animation-delay: 0.10s; }
.crypto-card:nth-child(3) { animation-delay: 0.15s; }
.crypto-card:nth-child(4) { animation-delay: 0.20s; }
.crypto-card:nth-child(5) { animation-delay: 0.25s; }
.crypto-card:nth-child(6) { animation-delay: 0.30s; }
.crypto-card:nth-child(7) { animation-delay: 0.35s; }
.crypto-card:nth-child(8) { animation-delay: 0.40s; }
.crypto-card:nth-child(9) { animation-delay: 0.45s; }
.crypto-card:nth-child(10) { animation-delay: 0.50s; }
.crypto-card:nth-child(11) { animation-delay: 0.55s; }
.crypto-card:nth-child(12) { animation-delay: 0.60s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crypto-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.crypto-card .name {
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.crypto-card .name img {
    width: clamp(20px, 2vw, 28px);
    height: clamp(20px, 2vw, 28px);
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: contain;
}

.crypto-card .symbol {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: clamp(10px, 0.9vw, 13px);
    margin-left: auto;
    text-transform: uppercase;
}

.crypto-card .price {
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 700;
    margin: 4px 0 6px;
}

.crypto-card .change {
    font-size: clamp(12px, 1vw, 14px);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
}

.change.positive {
    color: var(--green);
    background: var(--green-bg);
}

.change.negative {
    color: var(--red);
    background: var(--red-bg);
}

/* ===== НОВОСТИ ===== */
.news-section {
    padding: clamp(16px, 3vw, 40px) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(260px, 30vw, 340px), 1fr));
    gap: clamp(10px, 1.5vw, 16px);
}

.news-card {
    background: var(--bg-card);
    padding: clamp(12px, 1.5vw, 18px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.news-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.news-card .news-source {
    font-size: clamp(10px, 0.9vw, 12px);
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.news-card .news-source .source-badge {
    background: var(--accent);
    color: var(--bg-primary);
    font-size: clamp(8px, 0.7vw, 10px);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.news-card h3 {
    font-size: clamp(13px, 1.2vw, 16px);
    line-height: 1.4;
    font-weight: 600;
}

.news-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.news-card h3 a:hover {
    color: var(--accent);
}

/* ===== ПОСТЫ ===== */
.blog-section {
    padding: clamp(16px, 3vw, 40px) 0;
}

.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(240px, 28vw, 320px), 1fr));
    gap: clamp(10px, 1.5vw, 16px);
}

.post-card {
    background: var(--bg-card);
    padding: clamp(14px, 1.5vw, 20px);
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    border: 1px solid var(--border);
    border-left-width: 4px;
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.post-card h3 {
    font-size: clamp(14px, 1.3vw, 17px);
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.post-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--accent);
}

.post-card .date {
    font-size: clamp(10px, 0.8vw, 12px);
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.post-card p {
    color: var(--text-secondary);
    font-size: clamp(12px, 0.9vw, 14px);
    line-height: 1.5;
}

/* ===== ПОДВАЛ ===== */
.footer {
    background: var(--bg-secondary);
    padding: clamp(20px, 3vw, 40px) 0 clamp(12px, 1.5vw, 20px);
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: clamp(16px, 2vw, 30px);
    margin-bottom: clamp(16px, 2vw, 30px);
}

.footer-brand .logo {
    font-size: clamp(16px, 2vw, 20px);
    margin-bottom: 6px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: clamp(12px, 0.9vw, 14px);
    max-width: 260px;
}

.footer-links h4 {
    font-size: clamp(12px, 0.9vw, 14px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: clamp(11px, 0.8vw, 13px);
    padding: 3px 0;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: clamp(12px, 1.5vw, 20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: clamp(10px, 0.8vw, 13px);
}

.footer-update {
    font-size: clamp(9px, 0.7vw, 12px) !important;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification-banner {
    position: fixed;
    bottom: clamp(12px, 2vw, 30px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: clamp(10px, 1.5vw, 16px) clamp(14px, 2vw, 24px);
    box-shadow: var(--shadow);
    z-index: 9999;
    max-width: min(500px, 92%);
    width: auto;
    display: none;
    animation: slideUp 0.4s ease;
}

.notification-banner.show {
    display: block;
}

.notification-banner .notif-content {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
}

.notification-banner .notif-icon {
    color: var(--accent);
    font-size: clamp(18px, 2.5vw, 24px);
    flex-shrink: 0;
}

.notification-banner .notif-text {
    flex: 1;
    font-size: clamp(12px, 1.2vw, 14px);
    color: var(--text-primary);
    line-height: 1.4;
}

.notification-banner .notif-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: clamp(14px, 1.8vw, 18px);
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .last-update span {
        display: none;
    }
    
    .header {
        height: 54px;
    }
    
    .crypto-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        height: 48px;
        padding: 6px 0;
    }
    
    .crypto-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .news-container {
        grid-template-columns: 1fr;
    }
    
    .posts-container {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 380px) {
    .crypto-container {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .crypto-card {
        padding: 10px;
    }
    
    .crypto-card .price {
        font-size: 16px;
    }
}

@media (min-width: 1920px) {
    .container {
        max-width: 1440px;
    }
    
    .crypto-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* ===== TELEGRAM MINI APP ===== */
body.tg-app .header {
    padding-top: env(safe-area-inset-top, 10px);
}

body.tg-app .footer {
    padding-bottom: env(safe-area-inset-bottom, 10px);
}
