:root {
    --bg-primary: #0a0a2a;
    --bg-secondary: #15153b;
    --bg-tertiary: #1e1e4a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0d0;
    --text-accent: #4a76a8;
    --accent: #4a76a8;
    --accent-hover: #5a86b8;
    --success: #00ff88;
    --success-dark: #00cc66;
    --danger: #ff5555;
    --danger-dark: #cc4444;
    --warning: #ffaa00;
    --border: #2a2a5a;
    --border-light: #3a3a6a;
    --shadow: rgba(0, 0, 0, 0.5);
    --gradient: linear-gradient(135deg, #4a76a8, #2a4a78);
    --gradient-dark: linear-gradient(135deg, #2a4a78, #1a2a48);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.app {
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

.app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(74, 118, 168, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(42, 74, 120, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.header {
    background: var(--bg-secondary);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--shadow);
}

.balance-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.balance {
    font-size: 1.3em;
    font-weight: bold;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(74, 118, 168, 0.3);
}

.mode {
    font-size: 0.75em;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 15px;
    margin-top: 4px;
    border: 1px solid var(--border-light);
}

.logo {
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 1.5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.nav {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    position: sticky;
    top: 70px;
    z-index: 99;
    backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 15px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 0.9em;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active::before {
    width: 80%;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.main {
    padding: 20px;
    min-height: calc(100vh - 120px);
    position: relative;
    z-index: 1;
}

.section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Сетка игр */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.game-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--shadow);
}

.game-card:active {
    transform: translateY(-2px);
}

.game-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.game-name {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.game-desc {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Кнопки */
.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-size: 1em;
    box-shadow: 0 4px 15px rgba(74, 118, 168, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 118, 168, 0.4);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-2px);
}

/* Формы */
.input {
    width: 100%;
    padding: 15px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 118, 168, 0.2);
}

.textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Информационные блоки */
.profile-info, .withdraw-info, .nft-info, .deposit-info {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 15px var(--shadow);
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 42, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    margin: 10% auto;
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 350px;
    border: 2px solid var(--border-light);
    box-shadow: 0 20px 60px var(--shadow);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
}

.close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

/* Игры */
.game-section {
    padding: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Rocket Game */
.rocket-area {
    height: 300px;
    position: relative;
    margin: 30px 0;
    border: 2px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.rocket {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3em;
    transition: bottom 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin: 25px 0;
    overflow: hidden;
    border: 2px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

/* Mines Game */
.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 25px 0;
}

.mine-cell {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mine-cell:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.mine-cell.diamond {
    background: var(--success-dark);
    border-color: var(--success);
}

.mine-cell.mine {
    background: var(--danger);
    border-color: var(--danger-dark);
}

/* FlipIt Game */
.coin-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    height: 150px;
}

.coin {
    width: 120px;
    height: 120px;
    font-size: 4em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: 50%;
    box-shadow: 0 8px 25px var(--shadow);
}

.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.choice-btn {
    padding: 20px;
    font-size: 1.2em;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

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

/* Управление играми */
.game-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 25px 0;
}

.game-info {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    border: 1px solid var(--border-light);
}

.multiplier {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--success);
    text-shadow: 0 2px 10px rgba(0, 255, 136, 0.3);
}

/* Утилиты */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Анимации */
@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes explode {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Адаптивность */
@media (max-width: 380px) {
    .header {
        padding: 12px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .main {
        padding: 15px;
    }
    
    .game-card {
        padding: 15px;
    }
}

/* Специальные эффекты */
.glow {
    text-shadow: 0 0 10px currentColor;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Темная тема по умолчанию */
[data-theme="dark"] {
    color-scheme: dark;
}