/**
 * Основные стили для сайта "ВдругДадут"
 * Версия: 3.5.0 — добавлена анимация встряхивания для поля ввода пин-кода,
 * улучшены стили для статуса попыток и блокировки в модалке продления жизни
 */

/* ============================================================
   ГЛОБАЛЬНЫЕ СТИЛИ
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0f0a;
    color: #d4f0d4;
    overflow-x: hidden;
}

a {
    color: #0079ff;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #ffe44d;
}

/* ============================================================
   ФОРМА ВХОДА
   ============================================================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at center, #0f1f0f, #050805);
}

.login-box {
    background: #0b150b;
    border: 2px solid #ffd700;
    border-radius: 28px;
    padding: 40px 36px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.2);
    animation: loginIn 0.4s ease-out;
}

@keyframes loginIn {
    0% { opacity: 0; transform: scale(0.92) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.login-box h1 {
    color: #ffd700;
    font-size: 32px;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.login-box .subtitle {
    color: #8aaa8a;
    text-align: center;
    font-size: 14px;
    margin-bottom: 24px;
    letter-spacing: 2px;
}

.login-box .form-group {
    margin-bottom: 14px;
}

.login-box .form-group label {
    display: block;
    color: #b3ffb3;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-box .form-group input {
    width: 100%;
    background: #1a2a1a;
    border: 1px solid #2a4a3a;
    color: #d4f0d4;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-box .form-group input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.login-box .form-group button {
    width: 100%;
    background: #ffd700;
    border: none;
    color: #0a1a0a;
    padding: 14px;
    border-radius: 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.login-box .form-group button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

.login-box .form-group button:active {
    transform: scale(0.97);
}

.login-box .message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    min-height: 22px;
}

.login-box .message.success {
    color: #2ecc71;
}

.login-box .links {
    text-align: center;
    margin-top: 12px;
}

.login-box .links a {
    color: #8aaa8a;
    font-size: 14px;
    text-decoration: none;
}

.login-box .links a:hover {
    color: #ffd700;
}

.login-box .info-text {
    margin-top: 20px;
    font-size: 12px;
    color: #5a7a5a;
    text-align: center;
    border-top: 1px solid #1a3a2a;
    padding-top: 16px;
    line-height: 1.6;
}

/* ============================================================
   СТАТУСЫ
   ============================================================ */

.status-badge {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid;
}

.status-badge.alive {
    background: #1a4a2a;
    color: #5eff8a;
    border-color: #2ecc71;
}

.status-badge.dead {
    background: #3a1a1a;
    color: #e74c3c;
    border-color: #e74c3c;
}

.status-badge.pending {
    background: #3a3a1a;
    color: #ffd700;
    border-color: #ffb800;
}

.status-badge.confirmed {
    background: #1a4a2a;
    color: #5eff8a;
    border-color: #2ecc71;
}

.status-badge.rejected {
    background: #3a1a1a;
    color: #e74c3c;
    border-color: #e74c3c;
}

.status-badge.none {
    background: #2a2a2a;
    color: #8aaa8a;
    border-color: #4a4a4a;
}

/* ============================================================
   МОДАЛКИ
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
    backdrop-filter: blur(6px);
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-panel {
    background: #0b150b;
    border: 2px solid #ffd700;
    border-radius: 28px;
    padding: 32px 40px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.25);
    animation: panelIn 0.35s ease-out;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.modal-panel::-webkit-scrollbar {
    display: none;
}

@keyframes panelIn {
    0% { opacity: 0; transform: scale(0.92) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 16px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    color: #8aaa8a;
    font-size: 28px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.modal-close:hover {
    color: #d4f0d4;
    transform: rotate(90deg);
}

.modal-btn {
    background: #2e7d52;
    border: none;
    color: #fff;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
    min-width: 120px;
    font-family: inherit;
}

.modal-btn:hover {
    background: #3a9a6a;
    transform: scale(1.02);
}

.modal-btn.secondary {
    background: transparent;
    border: 2px solid #4a6a4a;
    color: #b3ffb3;
}

.modal-btn.secondary:hover {
    border-color: #6a9a6a;
    background: rgba(255, 255, 255, 0.05);
}

.modal-btn.success-btn {
    background: #ffd700;
    border-color: #ffd700;
    color: #0a1a0a;
}

.modal-btn.success-btn:hover {
    background: #ffe44d;
}

.modal-btn.danger-btn {
    background: #c0392b;
    border-color: #e74c3c;
}

.modal-btn.danger-btn:hover {
    background: #e74c3c;
}

/* ============================================================
   ФОРМЫ
   ============================================================ */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    color: #8aaa8a;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: #1a2a1a;
    border: 1px solid #2a4a3a;
    color: #d4f0d4;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* ============================================================
   УВЕДОМЛЕНИЯ
   ============================================================ */

#notifications {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    width: 90%;
    max-width: 600px;
}

.notification {
    background: #1a2a1a;
    border: 1px solid #ffb800;
    color: #ffe484;
    padding: 12px 28px;
    border-radius: 36px;
    font-weight: bold;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.9);
    animation: notifFade 4.5s forwards;
    font-size: 15px;
    text-align: center;
    backdrop-filter: blur(4px);
    width: 100%;
    pointer-events: auto;
}

.notification.success {
    border-color: #2ecc71;
    color: #b3ffb3;
}

.notification.error {
    border-color: #e74c3c;
    color: #ff8a7a;
}

@keyframes notifFade {
    0% { opacity: 0; transform: translateY(-20px); }
    12% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================================
   СВИТОК ПРИВЕТСТВИЯ
   ============================================================ */
.scroll-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 600;
    backdrop-filter: blur(8px);
    padding: 16px;
}
.scroll-overlay.active {
    display: flex;
}
.scroll-paper {
    background: #f5e6c8;
    background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.03) 0px, rgba(0,0,0,0.03) 2px, transparent 2px, transparent 4px);
    padding: 30px 35px;
    border-radius: 30px;
    max-width: 640px;
    width: 100%;
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.4);
    border: 3px solid #b8860b;
    color: #2a1a0a;
    position: relative;
    animation: scrollIn 0.6s ease-out;
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scroll-paper::-webkit-scrollbar {
    display: none;
}

@keyframes scrollIn {
    0% { transform: scale(0.8) rotate(-2deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.scroll-paper h2 {
    text-align: center;
    color: #8b6508;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px dashed #b8860b;
    padding-bottom: 14px;
    font-family: 'Times New Roman', serif;
}
.scroll-paper .scroll-text {
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 8px;
    color: #3a2a1a;
    padding: 0 4px;
}
.scroll-paper .scroll-text strong {
    color: #6a3a0a;
}
.scroll-paper .scroll-divider {
    border: none;
    border-top: 2px dashed #b8860b;
    margin: 18px 0;
}
.scroll-paper .scroll-footer {
    font-size: 12px;
    color: #8a7a5a;
    text-align: center;
    border-top: 1px solid #d4c4a8;
    padding-top: 14px;
    margin-top: 10px;
    line-height: 1.6;
}
.scroll-paper .scroll-footer a {
    color: #8a7a5a;
    text-decoration: none;
}
.scroll-paper .scroll-footer a:hover {
    color: #6a4a2a;
    text-decoration: underline;
}
.scroll-paper .scroll-btn {
    display: block;
    background: #ffd700;
    border: none;
    color: #0a1a0a;
    padding: 16px 48px;
    border-radius: 40px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    margin: 24px auto 8px;
    transition: 0.2s;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    font-family: inherit;
}
.scroll-paper .scroll-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.7);
}
.scroll-paper .scroll-btn:active {
    transform: scale(0.96);
}
.scroll-paper .scroll-full {
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    font-size: 20px;
    padding: 16px 0;
}

/* ============================================================
   ИГРОВОЙ ИНТЕРФЕЙС (UI КАРТОЧКИ)
   ============================================================ */

#topUI {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 50;
    pointer-events: none;
}

.ui-card {
    background: rgba(5, 15, 5, 0.92);
    border: 1px solid #ffd700;
    border-radius: 18px;
    padding: 10px 16px;
    backdrop-filter: blur(8px);
    pointer-events: auto;
    font-size: 13px;
    color: #c8ffc8;
    min-width: 150px;
    line-height: 1.6;
}

.ui-card strong {
    color: #ffd700;
}

.ui-card .gold-price {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ui-card .gold-price .currency {
    font-size: 12px;
    color: #8aaa8a;
}

/* ============================================================
   МОДАЛКА ПОЖЕРТВОВАНИЯ
   ============================================================ */
.donation-info {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.donation-info p {
    margin: 6px 0;
    color: #d4f0d4;
}
.donation-info strong {
    color: #ffd700;
}
.donation-instruction {
    font-size: 14px;
    color: #8aaa8a;
}
.donation-note {
    font-size: 13px;
    color: #5a7a5a;
}

/* ============================================================
   МОДАЛКА ВЫВОДА ЗОЛОТА
   ============================================================ */
#withdrawModal .form-group input {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}
#withdrawModal #withdrawCard {
    font-size: 18px;
}
#withdrawModal #withdrawAmount {
    font-size: 20px;
    font-weight: 600;
}
#withdrawPreview {
    border: 1px dashed #4a7a4a;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
}
#withdrawInfo {
    margin-bottom: 16px;
    font-size: 14px;
    color: #8aaa8a;
}
#withdrawInfo strong {
    color: #ffd700;
}

/* ============================================================
   ФОРМАТИРОВАНИЕ БАЛАНСА (крупные/мелкие цифры)
   ============================================================ */
.gold-frac-big {
    font-size: 1.2em;
    font-weight: 600;
}
.gold-frac-small {
    font-size: 0.7em;
    opacity: 0.6;
}

/* ============================================================
   ФИНАЛЬНАЯ ЗАСТАВКА
   ============================================================ */
.final-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    animation: finalFadeIn 0.8s ease-out;
}

@keyframes finalFadeIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.final-content {
    position: relative;
    text-align: center;
    color: #ffd700;
    padding: 50px 60px;
    background: rgba(10, 20, 10, 0.95);
    border-radius: 40px;
    border: 3px solid #ffd700;
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.3);
    max-width: 500px;
    width: 100%;
}

/* Крестик в финальном окне */
.final-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #8aaa8a;
    font-size: 28px;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
    line-height: 1;
}

.final-close:hover {
    color: #ffd700;
    transform: rotate(90deg);
}

.trophy {
    font-size: 100px;
    line-height: 1;
    filter: drop-shadow(0 0 40px #ffd700);
}

.winner-number {
    font-size: 70px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px #ffd700, 0 0 80px #ffb800;
    margin-top: -5px;
}

.winner-name {
    font-size: 32px;
    font-weight: 700;
    color: #ffe484;
    margin-top: 10px;
    background: rgba(0,0,0,0.5);
    padding: 8px 30px;
    border-radius: 50px;
    display: inline-block;
    border: 2px solid #ffd700;
}

.final-message {
    font-size: 20px;
    color: #8aaa8a;
    margin-top: 12px;
    letter-spacing: 2px;
}

/* Блок с призом в финальном окне */
.final-prize {
    margin-top: 12px;
    font-size: 18px;
    color: #ffd700;
    background: rgba(0,0,0,0.4);
    padding: 6px 18px;
    border-radius: 30px;
    display: inline-block;
}

.final-prize span {
    font-weight: bold;
}

.final-subtitle {
    font-size: 14px;
    color: #5a7a5a;
    margin-top: 8px;
}

.final-hide-btn {
    margin-top: 16px;
    background: rgba(255,215,0,0.1);
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
}

.final-hide-btn:hover {
    background: rgba(255,215,0,0.25);
    transform: scale(1.05);
}

/* ============================================================
   МОДАЛКА ОТМЕНЫ 2FA
   ============================================================ */
.warning-text {
    background: rgba(200, 50, 50, 0.1);
    border-left: 4px solid #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #ff8a7a;
}
.warning-text strong {
    color: #e74c3c;
}

/* ============================================================
   СВОРАЧИВАЕМЫЙ БЛОК ПРОГРЕССИВНОЙ ВЫПЛАТЫ
   ============================================================ */

/* Кнопка-триггер (круглая иконка) */
.payout-toggle {
    position: fixed;
    bottom: 300px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(10, 20, 10, 0.95);
    border: 2px solid #ffd700;
    color: #ffd700;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 150;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    transition: 0.2s;
    backdrop-filter: blur(4px);
    user-select: none;
}
.payout-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Сам блок (по умолчанию скрыт) */
.payout-block {
    position: fixed;
    bottom: 370px;
    right: 20px;
    z-index: 160;
    background: rgba(10, 20, 10, 0.97);
    border: 1px solid #ffd700;
    border-radius: 18px;
    padding: 18px 18px 14px;
    max-width: 270px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
    display: none;
    animation: payoutFadeIn 0.25s ease-out;
}
.payout-block.active {
    display: block;
}

@keyframes payoutFadeIn {
    0% { opacity: 0; transform: scale(0.92) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Кнопка закрытия (крестик) */
.payout-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: #8aaa8a;
    font-size: 24px;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s;
    line-height: 1;
    padding: 0 4px;
}
.payout-close:hover {
    color: #d4f0d4;
    transform: rotate(90deg);
}

.payout-block .payout-label {
    font-size: 12px;
    color: #8aaa8a;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.payout-block .payout-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}
.payout-block .payout-input-group input {
    flex: 1;
    background: #1a2a1a;
    border: 1px solid #2a4a3a;
    color: #d4f0d4;
    padding: 6px 10px;
    border-radius: 10px;
    width: 70px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.payout-block .payout-input-group input:focus {
    border-color: #ffd700;
}
.payout-block .payout-input-group button {
    background: #ffd700;
    border: none;
    color: #0a1a0a;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}
.payout-block .payout-input-group button:hover {
    transform: scale(1.05);
}
.payout-block .payout-result {
    margin-top: 8px;
    font-size: 14px;
    color: #ffd700;
    min-height: 22px;
    font-weight: 600;
    word-break: break-word;
}
.payout-block .payout-hint {
    font-size: 9px;
    color: #5a7a5a;
    margin-top: 4px;
    line-height: 1.4;
}
.payout-block .payout-status {
    margin-top: 6px;
    font-size: 10px;
    color: #8aaa8a;
    border-top: 1px solid #1a3a2a;
    padding-top: 4px;
}
.payout-block .payout-status .status-enabled {
    color: #5eff8a;
}
.payout-block .payout-status .status-disabled {
    color: #ffd700;
}

/* ============================================================
   СТАТУС ПОПЫТОК ПИН-КОДА В МОДАЛКЕ ПРОДЛЕНИЯ
   ============================================================ */
#extendStatus .attempts-remaining {
    display: inline-block;
    font-weight: 700;
    color: #ffd700;
    min-width: 20px;
    font-size: 18px;
}
#extendStatus .blocked-timer {
    font-weight: 700;
    color: #e74c3c;
    font-family: 'Courier New', monospace;
    font-size: 18px;
}
#extendStatus .lock-icon {
    font-size: 20px;
    margin-right: 6px;
}

/* ============================================================
   АНИМАЦИЯ ВСТРЯХИВАНИЯ ДЛЯ ПОЛЯ ВВОДА ПИН-КОДА
   ============================================================ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* ============================================================
   ФУТЕР
   ============================================================ */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(5, 15, 5, 0.95);
    border-top: 1px solid #1a3a2a;
    padding: 8px 16px;
    z-index: 40;
    font-size: 11px;
    color: #5a7a5a;
    text-align: center;
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer a {
    color: #8aaa8a;
    text-decoration: none;
}

.footer a:hover {
    color: #ffd700;
}

/* ============================================================
   КНОПКИ В ИГРЕ
   ============================================================ */
.profile-btn {
    position: fixed;
    right: 20px;
    bottom: 85px;
    background: rgba(20, 20, 30, 0.85);
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 15px;
    cursor: pointer;
    z-index: 150;
    backdrop-filter: blur(8px);
    font-family: inherit;
    transition: 0.2s;
}

.profile-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: #ffe066;
}

.admin-btn {
    position: fixed;
    right: 105px;
    bottom: 150px;
    background: rgba(20, 20, 30, 0.85);
    border: 1px solid #4a6a8a;
    color: #8ab4ff;
    padding: 10px 16px;
    border-radius: 24px;
    font-size: 13px;
    cursor: pointer;
    z-index: 150;
    backdrop-filter: blur(8px);
    font-family: inherit;
    transition: 0.2s;
}

.admin-btn:hover {
    background: rgba(30, 40, 60, 0.9);
    border-color: #6a9aff;
}

/* ============================================================
   УПРАВЛЕНИЕ
   ============================================================ */
#controls {
    position: fixed;
    right: 20px;
    bottom: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 150;
    background: rgba(10, 20, 10, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 8px 6px;
    border: 1px solid #2a5a3a;
}

#controls button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: rgba(30, 50, 30, 0.7);
    color: #b3ffb3;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

#controls button:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: scale(1.05);
}

#controls button:active {
    transform: scale(0.90);
}

#controls .divider {
    height: 1px;
    background: #2a5a3a;
    margin: 4px 0;
}

/* ============================================================
   ПЕРСОНАЖИ (ОБНОВЛЁННЫЕ — С РУКАМИ)
   ============================================================ */
.character {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    transition: filter 0.3s;
}

.character.dead {
    z-index: 1;
    opacity: 0.5;
    filter: grayscale(0.8);
}

.character.self {
    z-index: 200 !important;
    filter: drop-shadow(0 0 20px #ffd700);
}

.character .head {
    width: 18px;
    height: 18px;
    background: #ffd700;
    border-radius: 50%;
    border: 2px solid #b8860b;
    box-shadow: 0 0 8px #ffd700;
    position: relative;
    z-index: 2;
    transition: background 0.3s;
}

.character.dead .head {
    background: #5a6b5a;
    border-color: #3a4a3a;
    box-shadow: 0 0 4px #444;
}

.character .body {
    width: 12px;
    height: 24px;
    background: #b8860b;
    border-radius: 4px 4px 0 0;
    border: 1px solid #8b6508;
    margin-top: -2px;
    position: relative;
    z-index: 1;
}

.character.dead .body {
    background: #4a5a4a;
    border-color: #3a4a3a;
}

/* ===== РУКИ ===== */
.character .arm-left,
.character .arm-right {
    position: absolute;
    width: 6px;
    height: 18px;
    background: #b8860b;
    border: 1px solid #8b6508;
    border-radius: 4px;
    z-index: 0;
    top: 6px;
}

.character .arm-left {
    left: -8px;
    transform: rotate(15deg);
}

.character .arm-right {
    right: -8px;
    transform: rotate(-15deg);
}

.character.dead .arm-left,
.character.dead .arm-right {
    background: #4a5a4a;
    border-color: #3a4a3a;
    animation: none;
}

/* Анимация покачивания рук для живых персонажей */
@keyframes armSwing {
    0% { transform: rotate(15deg); }
    50% { transform: rotate(-15deg); }
    100% { transform: rotate(15deg); }
}

.character.alive .arm-left,
.character.alive .arm-right {
    animation: armSwing 2.5s ease-in-out infinite;
}
.character.alive .arm-right {
    animation-delay: 0.15s;
}

/* ===== НОГИ ===== */
.character .legs {
    display: flex;
    justify-content: space-between;
    width: 12px;
    margin-top: -2px;
    z-index: 0;
}

.character .leg {
    width: 4px;
    height: 12px;
    background: #b8860b;
    border-radius: 0 0 3px 3px;
    border: 1px solid #8b6508;
}

.character.dead .leg {
    background: #4a5a4a;
    border-color: #3a4a3a;
}

.character .number-tag {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 12px;
    border: 2px solid #ffd700;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    text-shadow: 0 0 10px rgba(255,215,0,0.6);
    font-family: 'Courier New', monospace;
}

.character.self .number-tag {
    border-color: #ffb800;
    color: #ffd700;
    text-shadow: 0 0 16px #ffb800;
    background: rgba(20,15,0,0.9);
}

.character.danger .head {
    animation: dangerBlink 0.5s infinite alternate;
    background: #e74c3c;
    border-color: #c0392b;
    box-shadow: 0 0 20px #e74c3c;
}

.character.danger .body,
.character.danger .arm-left,
.character.danger .arm-right,
.character.danger .leg {
    background: #c0392b;
    border-color: #a93226;
}

@keyframes dangerBlink {
    from { box-shadow: 0 0 15px #e74c3c; }
    to { box-shadow: 0 0 35px #ff0000; }
}

/* ============================================================
   ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ
   ============================================================ */

.text-center {
    text-align: center;
}

.text-gold {
    color: #ffd700;
}

.text-muted {
    color: #5a7a5a;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.w-full {
    width: 100%;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 768px) {
    .login-box {
        padding: 28px 20px;
    }

    .login-box h1 {
        font-size: 26px;
    }

    .modal-panel {
        padding: 28px 24px 32px;
        max-height: 85vh;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 80px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 8px 12px;
    }

    #topUI {
        flex-direction: column;
        gap: 4px;
        top: 6px;
        left: 6px;
        right: 6px;
    }

    .ui-card {
        padding: 6px 12px;
        font-size: 12px;
        min-width: auto;
        width: 100%;
    }

    #controls {
        right: 10px;
        bottom: 180px;
        padding: 6px 4px;
        gap: 4px;
    }

    #controls button {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .profile-btn {
        padding: 8px 14px;
        font-size: 13px;
        right: 10px;
        bottom: 115px;
    }

    .admin-btn {
        right: 10px;
        bottom: 75px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .footer {
        font-size: 10px;
        padding: 4px 8px;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* ===== УВЕЛИЧЕННЫЕ ОТСТУПЫ ДЛЯ СВИТКА НА ПЛАНШЕТАХ ===== */
    .scroll-paper {
        padding: 30px 28px 36px;
        border-radius: 24px;
    }
    .scroll-paper h2 {
        font-size: 26px;
        margin-bottom: 16px;
    }
    .scroll-paper .scroll-text {
        font-size: 16px;
        line-height: 1.7;
    }
    .scroll-paper .scroll-btn {
        padding: 14px 36px;
        font-size: 20px;
        margin: 18px auto 6px;
    }

    /* Адаптив для финальной заставки */
    .final-content {
        padding: 30px 24px;
        margin: 20px;
    }
    .final-close {
        font-size: 22px;
        top: 5px;
        right: 10px;
    }
    .trophy {
        font-size: 70px;
    }
    .winner-number {
        font-size: 50px;
    }
    .winner-name {
        font-size: 24px;
        padding: 6px 20px;
    }
    .final-message {
        font-size: 17px;
    }
    .final-prize {
        font-size: 15px;
        padding: 4px 14px;
    }
    .final-subtitle {
        font-size: 13px;
    }
    .final-hide-btn {
        padding: 8px 24px;
        font-size: 14px;
    }

    /* Адаптив для модалки вывода */
    #withdrawModal .modal-panel {
        padding: 24px 20px 28px;
    }
    #withdrawModal #withdrawAmount {
        font-size: 18px;
    }
    #withdrawModal #withdrawCard {
        font-size: 16px;
    }
    #withdrawReceiveRub {
        font-size: 20px !important;
    }

    /* Адаптив для сворачиваемого блока прогрессивной выплаты */
    .payout-toggle {
        bottom: 110px;
        right: 350px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    .payout-block {
        bottom: 280px;
        right: 100px;
        max-width: 220px;
        padding: 14px 14px 12px;
    }
    .payout-block .payout-input-group input {
        width: 50px;
        font-size: 12px;
        padding: 4px 6px;
    }
    .payout-block .payout-input-group button {
        padding: 4px 10px;
        font-size: 14px;
    }
    .payout-block .payout-result {
        font-size: 12px;
    }
    .payout-block .payout-hint {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 20px 16px;
    }

    .login-box h1 {
        font-size: 22px;
    }

    .login-box .subtitle {
        font-size: 12px;
    }

    .login-box .form-group button {
        font-size: 16px;
        padding: 12px;
    }

    .modal-panel {
        padding: 24px 18px 28px;
        max-height: 85vh;
        border-radius: 24px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        top: 8px;
        right: 12px;
        font-size: 24px;
    }

    .notification {
        font-size: 13px;
        padding: 10px 16px;
    }

    /* ===== УВЕЛИЧЕННЫЕ ОТСТУПЫ ДЛЯ СВИТКА НА ТЕЛЕФОНАХ ===== */
    .scroll-paper {
        padding: 26px 20px 32px;
        border-radius: 20px;
    }
    .scroll-paper h2 {
        font-size: 22px;
        padding-bottom: 10px;
        margin-bottom: 14px;
    }
    .scroll-paper .scroll-text {
        font-size: 15px;
        line-height: 1.6;
    }
    .scroll-paper .scroll-btn {
        padding: 12px 28px;
        font-size: 18px;
        margin: 14px auto 4px;
    }
    .scroll-paper .scroll-footer {
        font-size: 10px;
        padding-top: 10px;
    }

    .footer {
        font-size: 9px;
        gap: 4px;
    }

    /* Адаптив для финальной заставки на телефонах */
    .final-content {
        padding: 20px 16px;
        margin: 10px;
    }
    .final-close {
        font-size: 20px;
        top: 5px;
        right: 8px;
    }
    .trophy {
        font-size: 50px;
    }
    .winner-number {
        font-size: 36px;
    }
    .winner-name {
        font-size: 18px;
        padding: 4px 14px;
    }
    .final-message {
        font-size: 14px;
    }
    .final-prize {
        font-size: 13px;
        padding: 4px 10px;
    }
    .final-subtitle {
        font-size: 11px;
    }
    .final-hide-btn {
        padding: 6px 18px;
        font-size: 12px;
    }

    /* Адаптив для модалки вывода на телефонах */
    #withdrawModal .modal-panel {
        padding: 20px 16px 24px;
    }
    #withdrawModal #withdrawAmount {
        font-size: 16px;
        padding: 8px 12px;
    }
    #withdrawModal #withdrawCard {
        font-size: 14px;
        padding: 8px 12px;
    }
    #withdrawModal .form-group input {
        font-size: 14px;
        padding: 8px 12px;
    }
    #withdrawReceiveRub {
        font-size: 18px !important;
    }
    #withdrawInfo {
        font-size: 12px;
    }

    /* Адаптив для сворачиваемого блока прогрессивной выплаты на телефонах */
    .payout-toggle {
        bottom: 200px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .payout-block {
        bottom: 240px;
        right: 10px;
        max-width: 190px;
        padding: 12px 10px 10px;
    }
    .payout-block .payout-input-group input {
        width: 40px;
        font-size: 11px;
        padding: 3px 4px;
    }
    .payout-block .payout-input-group button {
        padding: 3px 8px;
        font-size: 12px;
    }
    .payout-block .payout-result {
        font-size: 11px;
        min-height: 18px;
    }
    .payout-block .payout-hint {
        font-size: 8px;
    }
    .payout-close {
        font-size: 20px;
        top: 4px;
        right: 6px;
    }

    /* Адаптив для модалки продления жизни */
    #extendStatus .attempts-remaining {
        font-size: 16px;
    }
    #extendStatus .blocked-timer {
        font-size: 16px;
    }
    #extendStatus .lock-icon {
        font-size: 18px;
    }
}

/* Дополнительный медиа-запрос для очень узких экранов (≤ 360px) */
@media (max-width: 360px) {
    .modal-panel {
        padding: 20px 14px 24px;
        max-height: 85vh;
        border-radius: 20px;
    }
    .modal-title {
        font-size: 16px;
    }
    .modal-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 70px;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 13px;
        padding: 6px 10px;
    }

    .scroll-paper {
        padding: 20px 14px 26px;
        border-radius: 16px;
    }
    .scroll-paper h2 {
        font-size: 18px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }
    .scroll-paper .scroll-text {
        font-size: 13px;
        line-height: 1.5;
    }
    .scroll-paper .scroll-btn {
        padding: 10px 20px;
        font-size: 16px;
        margin: 10px auto 2px;
    }
    .scroll-paper .scroll-footer {
        font-size: 9px;
        padding-top: 8px;
        margin-top: 6px;
    }

    /* Адаптив для финальной заставки на очень узких экранах */
    .final-content {
        padding: 16px 12px;
        margin: 8px;
    }
    .final-close {
        font-size: 18px;
        top: 4px;
        right: 6px;
    }
    .trophy {
        font-size: 40px;
    }
    .winner-number {
        font-size: 28px;
    }
    .winner-name {
        font-size: 16px;
        padding: 3px 10px;
    }
    .final-message {
        font-size: 12px;
    }
    .final-prize {
        font-size: 11px;
        padding: 3px 8px;
    }
    .final-subtitle {
        font-size: 10px;
    }
    .final-hide-btn {
        padding: 4px 14px;
        font-size: 11px;
    }

    /* Адаптив для модалки вывода на очень узких экранах */
    #withdrawModal .modal-panel {
        padding: 16px 12px 20px;
    }
    #withdrawModal #withdrawAmount {
        font-size: 14px;
        padding: 6px 10px;
    }
    #withdrawModal #withdrawCard {
        font-size: 13px;
        padding: 6px 10px;
    }
    #withdrawModal .form-group input {
        font-size: 13px;
        padding: 6px 10px;
    }
    #withdrawReceiveRub {
        font-size: 16px !important;
    }
    #withdrawInfo {
        font-size: 11px;
    }
    #withdrawPreview {
        padding: 8px 12px;
    }

    /* Адаптив для сворачиваемого блока на очень узких экранах */
    .payout-toggle {
        bottom: 170px;
        right: 8px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .payout-block {
        bottom: 210px;
        right: 8px;
        max-width: 170px;
        padding: 10px 8px 8px;
    }
    .payout-block .payout-input-group input {
        width: 36px;
        font-size: 10px;
        padding: 2px 4px;
    }
    .payout-block .payout-input-group button {
        padding: 2px 6px;
        font-size: 11px;
    }
    .payout-block .payout-result {
        font-size: 10px;
        min-height: 16px;
    }
    .payout-block .payout-hint {
        font-size: 7px;
    }
    .payout-close {
        font-size: 18px;
        top: 3px;
        right: 5px;
    }

    /* Адаптив для модалки продления на очень узких экранах */
    #extendStatus .attempts-remaining {
        font-size: 14px;
    }
    #extendStatus .blocked-timer {
        font-size: 14px;
    }
    #extendStatus .lock-icon {
        font-size: 16px;
    }
}

/* ============================================================
   СКРОЛЛБАР (глобально для десктопа, кроме модалок)
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a150a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #2a5a3a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a7a4a;
}