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

:root {
    --color-blue: #2A4DF4;
    --color-blue-bright: #4D7AFF;
    --color-yellow: #FFB800;
    --color-text: #FFFFFF;
    --color-text-secondary: #F0F4FF;
    --shadow-glass: 0 20px 40px rgba(0, 0, 0, 0.3);
    --blur-amount: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(145deg, #2A4DF4 0%, #FFB800 100%);
    min-height: 100vh;
    color: var(--color-text);
    line-height: 1.4;
    position: relative;
    overflow-x: hidden;
}

.app::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-image: url('assets/icons/1.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 600px auto;
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    animation: floatLogo 20s ease-in-out infinite;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.2));
}

@keyframes floatLogo {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    20% {
        transform: translate(-48%, -52%) scale(1.02) rotate(2deg);
    }
    40% {
        transform: translate(-52%, -48%) scale(0.98) rotate(-2deg);
    }
    60% {
        transform: translate(-47%, -53%) scale(1.01) rotate(3deg);
    }
    80% {
        transform: translate(-53%, -47%) scale(0.99) rotate(-3deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

@keyframes glowPulse {
    0% {
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));
    }
    50% {
        filter: drop-shadow(0 0 60px rgba(255, 255, 255, 0.4));
    }
    100% {
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));
    }
}

.app::before {
    animation: floatLogo 25s ease-in-out infinite, glowPulse 8s ease-in-out infinite;
}

.app {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding: 20px 12px 30px;
    background: transparent;
    z-index: 1;
}

.greeting {
    padding: 0 8px 30px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.greeting-title {
    font-size: 36px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.3);
}

.greeting-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 30px 0 20px 8px;
    letter-spacing: -0.3px;
    text-transform: uppercase;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    display: inline-block;
    z-index: 2;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 70px;
    height: 4px;
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.7);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 24px;
    padding: 15px 5px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s ease;
}

.card:active {
    transform: scale(0.96);
    transition: transform 0.05s ease;
}

.card-icon-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: transparent;
    border: none;
}

.card-icon {
    width: 130px;
    height: 130px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.4));
}

.card-content {
    width: 100%;
    text-align: center;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    font-weight: 400;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.badge {
    background: #FFFFFF;
    color: #2A4DF4;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 20px;
    right: 20px;
    max-width: 440px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 16px 24px;
    border-radius: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s, transform 0.3s;
}

/* ===== АДАПТАЦИЯ ПОД РАЗНЫЕ ТЕЛЕФОНЫ ===== */

/* Большие телефоны (iPhone Pro Max, Samsung Ultra) */
@media (max-width: 480px) {
    .app { padding: 16px 10px 24px; }
    .card-icon { width: 100px; height: 100px; }
    .card-title { font-size: 14px; }
    .card-subtitle { font-size: 11px; }
    .greeting-title { font-size: 30px; }
    .greeting-subtitle { font-size: 16px; }
    .section-title { font-size: 20px; }
    .cards-grid { gap: 10px; }
}

/* Средние телефоны (iPhone 14/15/16, Pixel, Xiaomi) */
@media (max-width: 430px) {
    .card-icon { width: 90px; height: 90px; }
    .card-title { font-size: 13px; }
    .greeting-title { font-size: 28px; }
    .app { padding: 14px 8px 20px; }
}

/* Маленькие телефоны (iPhone SE, 12 mini, 13 mini) */
@media (max-width: 380px) {
    .card-icon { width: 80px; height: 80px; }
    .card-title { font-size: 12px; }
    .card-subtitle { font-size: 10px; }
    .greeting-title { font-size: 26px; }
    .greeting-subtitle { font-size: 14px; }
    .section-title { font-size: 18px; }
    .cards-grid { gap: 8px; }
    .app { padding: 12px 6px 16px; }
    .app::before { background-size: 400px auto; }
}

/* Очень маленькие телефоны (iPhone 5/SE 2016) */
@media (max-width: 340px) {
    .card-icon { width: 70px; height: 70px; }
    .card-title { font-size: 11px; }
    .card-subtitle { font-size: 9px; }
    .greeting-title { font-size: 24px; }
    .badge { font-size: 7px; padding: 2px 5px; }
    .cards-grid { gap: 6px; }
    .app::before { background-size: 350px auto; }
}

@media (prefers-color-scheme: dark) {
    .app::before {
        opacity: 0.15;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app::before {
        animation: none;
    }
}
