/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #242424;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent: #6c5ce7;
    --accent-hover: #5f4dd8;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --shadow: rgba(0, 0, 0, 0.3);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px;
}

/* Загрузчик */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Шапка */
.header {
    background: linear-gradient(135deg, var(--accent) 0%, #a29bfe 100%);
    padding: 20px;
    box-shadow: 0 4px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content h1 {
    font-size: 24px;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.user-balance {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.balance-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
}

.balance-label {
    opacity: 0.9;
    margin-right: 5px;
}

.balance-value {
    font-weight: bold;
    font-size: 16px;
}

/* Контент */
.content {
    flex: 1;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.screen-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Категории */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.category-card {
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-card:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

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

.category-icon {
    font-size: 36px;
}

.category-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
}

.category-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Экраны */
.menu-screen, .category-screen, .action-screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.menu-screen.active, .category-screen.active, .action-screen.active {
    display: block;
}

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

/* Кнопка назад */
.back-btn {
    background: var(--bg-card);
    color: var(--accent);
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--bg-secondary);
    transform: translateX(-4px);
}

/* Действия */
.actions-grid {
    display: grid;
    gap: 12px;
}

.action-btn {
    background: var(--bg-card);
    border: 2px solid var(--bg-secondary);
    border-radius: 14px;
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.action-btn:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.action-btn:active {
    transform: scale(0.98);
}

.action-icon {
    font-size: 24px;
}

.action-info {
    flex: 1;
}

.action-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.action-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Контент действия */
.action-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
}

.action-content h3 {
    margin-bottom: 15px;
    color: var(--accent);
}

.action-content .info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-secondary);
}

.action-content .info-row:last-child {
    border-bottom: none;
}

.action-content button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: all 0.2s;
}

.action-content button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.action-content button:active {
    transform: translateY(0);
}

.action-content button:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-card);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -4px 20px var(--shadow);
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    flex: 1;
}

.nav-btn:hover {
    color: var(--accent);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 11px;
}

/* Уведомления */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow);
    z-index: 1000;
    transition: top 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.notification.show {
    top: 20px;
}

.notification-content {
    font-size: 15px;
}

/* Списки */
.item-list {
    display: grid;
    gap: 10px;
}

.list-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item-icon {
    font-size: 24px;
    margin-right: 12px;
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.list-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.list-item-price {
    font-weight: bold;
    color: var(--success);
}

/* Адаптивность */
@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-content h1 {
        font-size: 20px;
    }
    
    .user-balance {
        font-size: 13px;
    }
    
    .balance-value {
        font-size: 14px;
    }
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Утилиты */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-secondary); }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

