* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #242424;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #06DF9A;
    --accent-hover: #05c98a;
    --success: #4caf50;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    /* Предотвращение зума при тапе на iOS */
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
    display: flex;
    justify-content: center;
}

.container {
    margin: 0 auto;
    padding: 12px;
    width: 100%;
    max-width: 480px;
}

/* Header */
.header {
    text-align: center;
    padding: 50px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    position: relative;
}

.logo {
    width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Snow toggle button */
.snow-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.snow-toggle:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    transform: scale(1.05);
}

.snow-toggle:active {
    transform: scale(0.95);
}

.status-badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px auto;
}

/* Snow container */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.snow-container.dimmed {
    opacity: 0.15;
}

/* Confetti container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    background: #fff;
    border-radius: 50%;
    animation: fall linear infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

/* Confetti */
.confetti {
    position: absolute;
    top: -10px;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
    user-select: none;
    pointer-events: none;
    z-index: 10000;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0.7;
    }
}

/* Section */
.section .status-badge {
    font-size: 14px;
    margin: 0;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #3fffd2;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* Markdown styles */
b, strong {
    font-weight: 700;
    color: var(--text-primary);
}

i, em {
    font-style: italic;
    color: var(--text-secondary);
}

mark {
    background: linear-gradient(145deg, #0f2e2e, #0b2323);
    -webkit-background-clip: text;
    -webkit-text-fill-color: #3fffd2;
    color: #3fffd2;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #3fffd2;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
}

.card-header h3 {
    margin: 0;
    flex: 1;
    padding-right: 50px;
}

.new-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.country-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
    cursor: default;
    text-transform: uppercase;
    color: var(--text-primary);
    position: absolute;
    top: 0;
    right: 0;
}

.country-badge:hover {
    border-color: var(--accent);
    background: var(--bg-card);
    transform: scale(1.05);
}

.card p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-height: 44px;
    width: 100%;
    color: #3fffd2;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0,255,200,0.25);
    background: linear-gradient(145deg, #0f2e2e, #0b2323);
    color: #3fffd2;
    font-size: 14px;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn-primary:hover {
    background: linear-gradient(145deg, #134040, #0e2f2f);
    border-color: rgba(0,255,200,0.5);
    box-shadow: 0 0 12px rgba(0,255,200,0.15);
}

.btn-primary .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3fffd2;
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0,255,200,0.25);
    background: linear-gradient(145deg, #0f2e2e, #0b2323);
    color: #3fffd2;
    font-size: 14px;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn-secondary:hover {
    background: linear-gradient(145deg, #134040, #0e2f2f);
    border-color: rgba(0,255,200,0.5);
    box-shadow: 0 0 12px rgba(0,255,200,0.15);
}

/* Info Block */
.info-block {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.info-block h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.info-block ul,
.info-block ol {
    color: var(--text-secondary);
    padding-left: 20px;
}

.info-block li {
    margin-bottom: 8px;
    font-size: 14px;
}

.info-block strong {
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: modalIn 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0;
    gap: 0;
    overflow: hidden;
    margin: 0 auto;
}

.modal-content.closing {
    animation: modalOut 0.3s ease forwards;
}

@keyframes modalOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.95) translateY(10px); }
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
    text-align: center;
    padding-right: 32px;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    background: var(--bg-secondary);
    -webkit-overflow-scrolling: touch;
}

.modal-body h4 {
    font-size: 15px;
    margin: 16px 0 10px;
    color: #3fffd2;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body ol {
    color: var(--text-secondary);
    padding-left: 20px;
    margin-bottom: 16px;
}

.modal-body li {
    margin-bottom: 8px;
    font-size: 14px;
}

.modal-body code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #3fffd2;
}

.modal-body mark {
    background: rgba(6, 223, 154, 0.3);
    color: #3fffd2;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.modal-body a {
    color: #3fffd2;
    text-decoration: none;
    transition: color 0.2s ease;
}

.modal-body a:hover {
    color: #3fffd2;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
}

.instruction-footer-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 12px 0 10px;
}

.btn-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0,255,200,0.25);
    background: linear-gradient(145deg, #0f2e2e, #0b2323);
    color: #3fffd2;
    font-size: 14px;
    cursor: pointer;
    transition: 0.25s ease;
    margin-top: 12px;
    margin-bottom: 16px;
    min-height: 44px;
}

.btn-footer:hover {
    background: linear-gradient(145deg, #134040, #0e2f2f);
    border-color: rgba(0,255,200,0.5);
    box-shadow: 0 0 12px rgba(0,255,200,0.15);
}

.btn-footer:active {
    transform: translateY(0);
}

/* Platform buttons */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 16px 0;
    width: 100%;
}

.platform-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 12px 0;
}

.platform-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0,255,200,0.25);
    background: linear-gradient(145deg, #0f2e2e, #0b2323);
    color: #3fffd2;
    font-size: 14px;
    cursor: pointer;
    transition: 0.25s ease;
    min-height: 44px;
    width: 100%;
    text-decoration: none;
}

.platform-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.platform-btn:hover {
    background: linear-gradient(145deg, #134040, #0e2f2f);
    border-color: rgba(0,255,200,0.5);
    box-shadow: 0 0 12px rgba(0,255,200,0.15);
}

.platform-btn:active {
    transform: translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Блокировка прокрутки body при открытом модальном окне */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

html.modal-open {
    overflow: hidden;
    touch-action: none;
}
