:root {
    --tg-theme-bg-color: #000000;
    --tg-theme-text-color: #FFFFFF;
    --tg-theme-button-color: #0088CC;
    --tg-theme-button-text-color: #FFFFFF;
    --tg-theme-hint-color: #AAAAAA;
    --tg-theme-secondary-bg-color: #1C2526;
    --accent-color: var(--tg-theme-button-color);
    --support-color: #ec3942;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

body {
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    position: relative;
    overflow-y: auto;
}

#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    max-width: 600px;
    width: 100%;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.header {
    text-align: center;
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--tg-theme-text-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.promo {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 15px;
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 500;
    transition: transform 0.3s ease;
}

.promo a {
    color: var(--tg-theme-button-text-color);
    text-decoration: underline;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

.promo a:hover { opacity: 0.8; }
.promo:hover { transform: scale(1.02); }

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--tg-theme-text-color);
    border: none;
    padding: 12px;
    font-size: clamp(14px, 4vw, 16px);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    height: 48px; /* Фиксированная высота */
}

.menu button:hover {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    transform: scale(1.02);
}

.menu .support-server-row,
.menu .keys-balance-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
}

.menu .support-server-row button,
.menu .keys-balance-row button {
    flex: 1;
    padding: 12px;
    font-size: clamp(14px, 4vw, 16px);
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
    box-sizing: border-box;
    height: 48px; /* Фиксированная высота */
}

.menu .support-server-row button:not(.support-btn),
.menu .keys-balance-row button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--tg-theme-text-color);
}

.menu .support-server-row button:not(.support-btn):hover,
.menu .keys-balance-row button:hover {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    transform: scale(1.02);
}

.menu .support-btn {
    background: #ec3942 !important; /* Красный цвет с приоритетом */
    color: #FFFFFF !important; /* Белый текст */
}

.menu .support-btn:hover {
    background: #ec3942 !important;
    color: #FFFFFF !important;
    transform: scale(1.02);
}

.expandable {
    display: none;
    margin-top: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.expandable button {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
    border: none;
    padding: 12px;
    font-size: clamp(14px, 4vw, 16px);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    height: 48px; /* Фиксированная высота */
}

.spoiler-arrow {
    display: inline-block;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.spoiler-arrow.down::after {
    content: '▼';
    font-size: 16px;
}

.spoiler-arrow.up::after {
    content: '▲';
    font-size: 16px;
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(250px, 90vw, 400px);
    max-height: 85vh;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    overflow-y: auto;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -55%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.popup-btn-close {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    background: var(--tg-theme-button-color);
    border-radius: 50%;
    border: none;
    color: var(--tg-theme-button-text-color);
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.popup-btn-close:hover {
    background: var(--accent-color);
}

.popup iframe {
    width: 100%;
    height: 40vh;
    border-radius: 10px;
    border: none;
}

.security-info {
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.security-info span {
    color: var(--accent-color);
    font-weight: 500;
}

.language-switcher {
    text-align: center;
    margin-top: 15px;
    font-size: clamp(14px, 4vw, 16px);
    color: var(--tg-theme-hint-color);
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.language-switcher a {
    color: var(--tg-theme-text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s ease;
}

.language-switcher a:hover {
    opacity: 0.8;
}

.language-switcher .flag {
    font-family: 'Flags Color World', sans-serif;
    font-size: 20px;
}

.language-switcher .flag-icon {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    vertical-align: middle;
    object-fit: contain;
}