/* main.css - Оптимизированная версия */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(10px, 3vw, 20px);
}

.menu {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: clamp(20px, 5vw, 40px);
    padding: clamp(20px, 5vw, 40px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.header {
    text-align: center;
    margin-bottom: clamp(20px, 5vw, 40px);
}

.header h1 {
    font-size: clamp(2em, 8vw, 3.5em);
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.header p {
    color: #94a3b8;
    font-size: clamp(0.9em, 3vw, 1.1em);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(15px, 3vw, 20px);
    margin-bottom: clamp(20px, 5vw, 40px);
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: clamp(20px, 4vw, 25px);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px;
}

.card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(96, 165, 250, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.card:active {
    transform: translateY(-2px);
}

.card-icon {
    font-size: clamp(2em, 6vw, 2.5em);
    margin-bottom: clamp(10px, 2vw, 15px);
    background: rgba(96, 165, 250, 0.1);
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.card-title {
    font-size: clamp(1.2em, 4vw, 1.4em);
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    word-break: break-word;
}

.card-desc {
    color: #94a3b8;
    font-size: clamp(0.85em, 2.5vw, 0.9em);
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    word-break: break-word;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #60a5fa;
    font-size: clamp(0.85em, 2.5vw, 0.9em);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
    margin-top: auto;
}

.category {
    background: rgba(96, 165, 250, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: clamp(0.75em, 2vw, 0.8em);
    color: #60a5fa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.arrow {
    font-size: clamp(1em, 3vw, 1.2em);
    flex-shrink: 0;
}

.footer {
    text-align: center;
    color: #64748b;
    font-size: clamp(0.8em, 2.5vw, 0.9em);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: clamp(20px, 4vw, 30px);
}

@media (max-width: 380px) {
    .card {
        min-height: 180px;
        padding: 15px;
    }
    
    .card-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .category {
        max-width: 100%;
        white-space: normal;
    }
}

@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.03);
    }
    
    .card:active {
        background: rgba(255, 255, 255, 0.08);
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 10px;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}