/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Экран авторизации */
#auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #f8f9fa;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

/* Кнопки */
.btn-primary,
.btn-secondary,
.btn-logout,
.btn-copy {
    border: none;
    border-radius: 10px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
}

.btn-logout {
    background: #ff6b6b;
    color: white;
}

.btn-copy {
    background: #4ecdc4;
    color: white;
    padding: 10px 15px;
    font-size: 14px;
}

.auth-form a {
    color: #667eea;
    text-decoration: none;
}

.auth-form a:hover {
    text-decoration: underline;
}

/* Игровой экран */
.game-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-info span:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.user-info span:last-child {
    font-size: 24px;
    font-weight: 700;
    color: #4ecdc4;
}

.menu-buttons {
    display: flex;
    gap: 10px;
}

.menu-buttons button {
    padding: 10px 20px;
    font-size: 14px;
}

/* Игровая зона */
.game-main {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.game-zone {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    width: 100%;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.level-info h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4 0%, #44a08d 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.click-area {
    margin: 40px 0;
}

.click-button {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    border: none;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 30px rgba(255, 154, 158, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.click-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 154, 158, 0.6);
}

.click-button:active {
    transform: scale(0.95);
}

.click-text {
    font-size: 4rem;
    margin-bottom: 10px;
}

.click-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.multiplier-info p {
    font-size: 1.1rem;
    margin: 10px 0;
    color: #666;
}

.multiplier-info span {
    font-weight: 600;
    color: #4ecdc4;
}

/* Индикатор сохранения */
.save-status {
    text-align: center;
    margin-top: 15px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.save-status.saved {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.save-status.saving {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.save-status.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Панель завершения уровня */
.level-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 3px solid #4ecdc4;
}

.level-panel.hidden {
    display: none;
}

.level-panel h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #4ecdc4;
}

.level-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

/* Кастомный скроллбар для модальных окон */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Для Firefox */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.modal h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5rem;
}

.deposit-info {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.deposit-info.hidden {
    display: none;
}

.wallet-address {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.wallet-address input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
}

.deposit-note {
    color: #ff6b6b;
    font-weight: 500;
    margin: 15px 0;
}

/* Уведомления */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.notification {
    background: white;
    border-left: 4px solid #4ecdc4;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.notification.error {
    border-left-color: #ff6b6b;
}

.notification.success {
    border-left-color: #4ecdc4;
}

.notification.warning {
    border-left-color: #feca57;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 20px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .menu-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .click-button {
        width: 150px;
        height: 150px;
        font-size: 2.5rem;
    }
    
    .click-text {
        font-size: 3rem;
    }
    
    .level-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
    
    .wallet-address {
        flex-direction: column;
    }
}

/* CryptoCloud стили */
.payment-method-selection {
    margin-bottom: 20px;
    text-align: center;
}

.method-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.method-btn {
    padding: 10px 15px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.method-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.method-btn:hover {
    border-color: #4CAF50;
}

.payment-form {
    display: none;
}

.payment-form.active {
    display: block;
}

.payment-info {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

.invoice-info {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.payment-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.payment-note {
    font-size: 13px;
    color: #555;
    background: #f0f8ff;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

/* Стили для форм */
.auth-form .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.1);
}

.auth-form .input-group input:valid {
    border-color: #27ae60;
}

.auth-form .input-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #e74c3c;
}

/* Анимация переключения форм */
.auth-form.active {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для кнопки статуса */
.menu-buttons .btn-secondary[title] {
    position: relative;
}

.menu-buttons .btn-secondary[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Кнопка отмены */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Стили для настроек */
.settings-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.settings-tab {
    flex: 1;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.settings-tab:hover {
    background: #e9ecef;
}

.settings-tab.active {
    background: white;
    border-bottom-color: #007bff;
    color: #007bff;
}

.settings-content {
    display: none;
    padding: 20px 0;
}

.settings-content.active {
    display: block;
}

.settings-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.settings-content .input-group {
    margin-bottom: 15px;
}

.settings-content .input-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* История пополнений */
.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.stat-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.history-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.history-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.history-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-status {
    font-size: 16px;
}

.history-amount {
    font-weight: bold;
    color: #007bff;
}

.history-date {
    color: #666;
    font-size: 12px;
}

.history-hash {
    font-family: monospace;
    font-size: 11px;
    color: #999;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Управление платежами */
.payment-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.payment-info {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.payment-info.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.payment-info.error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.payment-info.success {
    border-left-color: #28a745;
    background: #d4edda;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination button:disabled {
    background: #f8f9fa;
    color: #999;
    cursor: not-allowed;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Адаптивность для настроек */
@media (max-width: 768px) {
    .settings-tabs {
        flex-direction: column;
    }
    
    .settings-tab {
        border-bottom: 1px solid #eee;
        border-right: none;
    }
    
    .settings-tab.active {
        border-bottom-color: #eee;
        border-left: 3px solid #007bff;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .payment-controls {
        flex-direction: column;
    }

    /* Модальные окна на мобильных */
    .modal-content {
        margin: 2% auto;
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }

    .modal h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .close {
        font-size: 24px;
        right: 15px;
        top: 10px;
    }
}