/* === Базовый стиль === */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    margin: 0;
    padding: 20px;
    line-height: 1.5;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    margin: 0;
    background: linear-gradient(90deg, #ff0000, #ff8800, #ffff00, #00cc44, #0088ff, #8800ff, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 5s linear infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

/* Сетка карточек */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

/* Карточка приложения */
.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.2s;
    overflow: hidden;
}
.card:hover {
    border-color: #4caf50;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 12px;
    background: #fff;
}

.card h2 {
    font-size: 1.1em;
    margin: 0 0 5px;
    color: #e6edf3;
}

.card p {
    font-size: 0.85em;
    color: #8b949e;
    flex: 1;
}

/* Кнопки */
button {
    background: #238636;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: background 0.2s;
}
button:active {
    background: #2ea043;
}

.install-main-btn {
    background: #1b5e20;
    max-width: 300px;
    display: block;
    margin: 20px auto;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px #4caf50; }
    50% { box-shadow: 0 0 20px #4caf50, 0 0 40px #238636; }
    100% { box-shadow: 0 0 5px #4caf50; }
}

/* Кнопка "Поддержать" */
.donate-btn {
    background: #da3633;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: background 0.2s;
}
.donate-btn:hover {
    background: #c62828;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: #1b1e20;
    border: 1px solid #30363d;
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    color: #e0e0e0;
}
.modal-content h3 {
    margin-top: 0;
    color: #4caf50;
}
.close-btn {
    float: right;
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
}
#goToSafariBtn {
    background: #238636;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    color: #484f58;
}
.card h2 {
    color: #e6edf3 !important;
}
button {
    box-sizing: border-box;
}
