* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-bg: #1a1f2e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent-gold: #ffd700;
    --accent-blue: #4a90e2;
    --accent-purple: #9b59b6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.game-container {
    max-width: 1400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.account-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar {
    width: 70px;
    height: 70px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.user-details {
    color: var(--text-primary);
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-balance {
    font-size: 32px;
    font-weight: 800;
}

.balance-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-right: 10px;
}

.coin-icon {
    display: inline-block;
}

.stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Кнопки */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* Основной контент */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Секция майнинга */
.mining-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 40px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.section-title h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.badge {
    padding: 5px 15px;
    background: var(--secondary-gradient);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.mining-area {
    text-align: center;
    margin-bottom: 30px;
}

.coin-container {
    perspective: 1000px;
    margin-bottom: 30px;
    cursor: pointer;
}

.coin {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
    animation: rotateCoin 20s infinite linear;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    backface-visibility: hidden;
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.coin-face.front {
    transform: rotateY(0deg);
}

.coin-face.back {
    transform: rotateY(180deg);
}

.coin.mining {
    animation: miningPulse 0.2s ease-out;
}

.mining-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.mining-stat {
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mining-stat .stat-label {
    display: block;
    margin-bottom: 5px;
}

.mining-stat .stat-value {
    font-size: 24px;
    color: var(--accent-gold);
}

.mine-button {
    position: relative;
    padding: 20px 60px;
    font-size: 24px;
    font-weight: 800;
    color: white;
    background: var(--primary-gradient);
    border: none;
    border-radius: 60px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.mine-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.mine-button:active {
    transform: scale(0.95);
}

.button-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.mine-button:active .button-effect {
    width: 300px;
    height: 300px;
}

.energy-bar {
    margin-top: 20px;
}

.energy-label {
    display: flex;
    justify-content: space-between;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Секция маркета - без анимаций */
.market-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 40px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.market-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 20px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.market-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
}

.market-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.item-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 15px;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.item-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 5px;
}

.item-description {
    font-size: 12px;
    color: var(--text-secondary);
}

.item-level {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    background: var(--secondary-gradient);
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

/* Секция рулетки */
.roulette-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 40px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
}

.roulette-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 30px;
    padding: 20px;
}

.roulette-wheel {
    position: relative;
    background: linear-gradient(135deg, #2a2f3f, #1a1f2f);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    z-index: 10;
    filter: drop-shadow(0 5px 10px rgba(255, 215, 0, 0.5));
}

.wheel-numbers {
    display: flex;
    gap: 10px;
    transition: transform 3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.number {
    min-width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4a4f5f, #3a3f4f);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
    box-shadow: 0 5px 0 #1a1f2f;
}

.number.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.number.black { background: linear-gradient(135deg, #1f2937, #111827); }
.number.green { background: linear-gradient(135deg, #10b981, #059669); }

.bet-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.bet-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.bet-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.bet-option .bet-color {
    display: block;
    height: 60px;
    border-radius: 15px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.bet-option.red .bet-color { background: linear-gradient(135deg, #ef4444, #dc2626); }
.bet-option.black .bet-color { background: linear-gradient(135deg, #1f2937, #111827); }
.bet-option.green .bet-color { background: linear-gradient(135deg, #10b981, #059669); }

.bet-option input:checked + .bet-color {
    transform: scale(1.05);
    box-shadow: 0 0 30px currentColor;
}

.bet-label {
    display: block;
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.bet-multiplier {
    display: block;
    text-align: center;
    color: var(--accent-gold);
    font-weight: 700;
}

.bet-input-group {
    display: flex;
    gap: 15px;
}

.bet-input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.bet-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Окно авторизации */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.auth-box {
    background: var(--dark-bg);
    border-radius: 40px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.auth-button {
    width: 100%;
    padding: 15px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* Уведомления */
.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 20px 30px;
    background: var(--primary-gradient);
    border-radius: 20px;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification.show {
    transform: translateX(0);
}

.notification.success { background: linear-gradient(135deg, #10b981, #059669); }
.notification.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.notification.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* Анимации */
@keyframes rotateCoin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@keyframes miningPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); filter: brightness(1.5); }
    100% { transform: scale(1); }
}

/* Адаптивность */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .stats {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .market-grid {
        grid-template-columns: 1fr;
    }
    
    .bet-options {
        flex-direction: column;
    }
    
    .coin {
        width: 150px;
        height: 150px;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
}

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */

/* Планшеты (горизонтальная ориентация) */
@media (max-width: 1024px) {
    .game-container {
        padding: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .stat-item {
        min-width: 120px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mining-section, .market-section, .roulette-section {
        padding: 20px;
    }
    
    .coin {
        width: 180px;
        height: 180px;
    }
    
    .mine-button {
        padding: 15px 40px;
        font-size: 20px;
    }
}

/* Планшеты (вертикальная ориентация) и большие телефоны */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        border-radius: 30px;
    }
    
    .header {
        padding: 15px;
    }
    
    .account-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .avatar {
        width: 60px;
        height: 60px;
        font-size: 30px;
        margin: 0 auto;
    }
    
    .user-name {
        font-size: 20px;
    }
    
    .user-balance {
        font-size: 28px;
    }
    
    .stats {
        gap: 10px;
    }
    
    .stat-item {
        padding: 8px 12px;
        min-width: 80px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Вкладки */
    .game-tabs {
        gap: 5px;
        padding: 5px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Майнинг */
    .mining-area {
        padding: 10px;
    }
    
    .coin {
        width: 150px;
        height: 150px;
    }
    
    .coin-face {
        font-size: 60px;
    }
    
    .mining-stats {
        gap: 15px;
    }
    
    .mining-stat {
        padding: 10px 15px;
    }
    
    .mining-stat .stat-value {
        font-size: 20px;
    }
    
    .mine-button {
        padding: 12px 30px;
        font-size: 18px;
    }
    
    /* Маркет */
    .market-filters {
        gap: 5px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .market-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .market-item {
        padding: 15px;
    }
    
    .item-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .item-name {
        font-size: 16px;
    }
    
    .item-price {
        font-size: 20px;
    }
    
    /* Рулетка */
    .dice-container {
        padding: 20px;
    }
    
    .dice {
        width: 150px;
        height: 150px;
    }
    
    .dice-face {
        font-size: 60px;
    }
    
    .bet-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .bet-option {
        width: 100%;
    }
    
    .bet-option .bet-color {
        height: 50px;
    }
    
    .bet-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .bet-input {
        width: 100%;
    }
    
    /* Уведомления */
    .notification {
        top: 20px;
        right: 20px;
        left: 20px;
        width: auto;
        padding: 15px;
        font-size: 14px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .header {
        padding: 10px;
    }
    
    .stat-item {
        min-width: 70px;
        padding: 6px 8px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .coin {
        width: 120px;
        height: 120px;
    }
    
    .coin-face {
        font-size: 50px;
    }
    
    .mining-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .mining-stat {
        width: 100%;
    }
    
    .mine-button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    .energy-label {
        font-size: 14px;
    }
    
    .dice {
        width: 120px;
        height: 120px;
    }
    
    .dice-face {
        font-size: 50px;
    }
    
    .auth-box {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .auth-tabs {
        gap: 10px;
    }
    
    .auth-tab {
        padding: 10px;
        font-size: 16px;
    }
    
    .form-group input {
        padding: 12px 15px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 320px) {
    .game-container {
        padding: 8px;
    }
    
    .stats {
        flex-direction: column;
        width: 100%;
    }
    
    .stat-item {
        width: 100%;
    }
    
    .coin {
        width: 100px;
        height: 100px;
    }
    
    .coin-face {
        font-size: 40px;
    }
}

/* Горизонтальная ориентация на телефонах */
@media (max-width: 900px) and (orientation: landscape) {
    .game-container {
        padding: 10px;
    }
    
    .header {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .account-info {
        flex-direction: row;
    }
    
    .avatar {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .main-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .coin {
        width: 100px;
        height: 100px;
    }
    
    .mining-stats {
        flex-direction: row;
    }
    
    .dice {
        width: 100px;
        height: 100px;
    }
    
    .bet-options {
        flex-direction: row;
    }
}

/* Touch-friendly улучшения */
@media (hover: none) and (pointer: coarse) {
    .btn, .market-item, .tab-btn, .filter-btn, .bet-option {
        cursor: default;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active, .market-item:active, .tab-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    input, button {
        font-size: 16px !important; /* Предотвращает масштабирование при фокусе на iOS */
    }
}

/* Темная тема для мобильных браузеров */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1f2e;
        --text-primary: #ffffff;
    }
}

/* Анимации для мобильных устройств (упрощенные) */
@media (prefers-reduced-motion: reduce) {
    .coin, .dice, .notification {
        animation: none !important;
        transition: none !important;
    }
}

/* Стили для ежедневного бонуса */
.bonus-timer {
    font-size: 14px;
    color: var(--accent-gold);
    margin-left: 10px;
}

.bonus-claimed {
    opacity: 0.7;
    pointer-events: none;
}

.bonus-claimed .btn-primary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        border-radius: 30px;
        background: var(--primary-gradient);
        color: white;
        font-size: 24px;
        border: none;
        box-shadow: 0 5px 20px rgba(0,0,0,0.3);
        z-index: 100;
        cursor: pointer;
    }
    
    .game-tabs.mobile-hidden {
        display: none;
    }
    
    .game-tabs.mobile-visible {
        display: flex;
        position: fixed;
        bottom: 90px;
        right: 20px;
        left: 20px;
        background: var(--dark-bg);
        border-radius: 30px;
        padding: 15px;
        flex-direction: column;
        z-index: 99;
        box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    }
}