/* --- ГЛОБАЛЬНЫЕ СТИЛИ И ФОН --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    min-height: 100vh;
    color: #2c3e50;
    overflow-x: hidden;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: -1;
    background-image: 
        radial-gradient(circle at 25% 25%, #ffffff 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, #ffffff 2px, transparent 2px);
    background-size: 50px 50px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
}

/* --- БАЗОВЫЕ КОМПОНЕНТЫ (НОВОЕ) --- */

/* Единый стиль для всех карточек */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px; /* Единый радиус */
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.profile-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px; /* Единый радиус */
    padding: 1rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Единый стиль для основной кнопки */
.btn-main {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-main:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-main:active:not(:disabled) {
    transform: translateY(0);
}

.btn-main:disabled, .btn-main.processing {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* --- ЗАГОЛОВОК И БАЛАНС --- */
.header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: #ef4444;
    border-radius: 2px;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -2px;
    padding-top: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.balance {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.balance-item {
    /* Используем стили .card, удаляем дубли */
    padding: 2rem 2.5rem; /* Можно оставить кастомный паддинг, если нужно */
    min-width: 220px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.balance-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.balance-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.points {
    color: #ef4444;
    text-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.shekels {
    color: #22c55e;
    text-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}


/* --- ВКЛАДКА "МАГАЗИН" (SHOP) --- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.shop-item {
    /* Используем стили .card, удаляем дубли */
}

.shop-item.insufficient {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(50%);
}

.shop-item > * {
    position: relative;
    z-index: 2;
}

.item-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: #ef4444;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.item-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.2);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.shop-item:hover .item-image::before {
    transform: translateX(100%);
}

.item-image img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    filter: brightness(1.1);
}

.item-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
}

.item-price {
    font-size: 1.2rem;
    color: #ef4444;
    margin-bottom: 2rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 15px;
    display: inline-block;
}

.buy-button {
    /* Используем стили .btn-main, удаляем дубли */
    /* Можно оставить кастомные стили, если они отличаются */
    padding: 1.2rem 2.5rem;
    border-radius: 16px;
    letter-spacing: 0.5px;
}


/* --- ВКЛАДКА "ВЫВЕСТИ" (WITHDRAW) --- */
.withdraw-form {
    /* Теперь тоже в стиле .card для единства */
    max-width: 380px; /* Немного увеличил для лучшего вида */
    margin: 2rem auto 0 auto;
    padding: 2rem; /* Сделал паддинг чуть меньше */
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.withdraw-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: left; /* Выравниваем текст в полях по левому краю */
}

.withdraw-field label {
    font-size: 1rem;
    color: #ef4444;
    font-weight: 600;
    padding-left: 0.5rem; /* Небольшой отступ */
}

.withdraw-field input {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 1.1rem;
    background: #fff;
    outline: none;
    transition: border 0.2s;
}

.withdraw-field input:focus {
    border: 1.5px solid #ef4444;
}

.withdraw-btn {
    /* Используем стили .btn-main, удаляем дубли */
    margin-top: 0.7rem;
}


/* --- ИНФО О ПОЛЬЗОВАТЕЛЕ TELEGRAM --- */
.tg-user {
    /* Можно тоже применить стиль .card */
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.2rem;
    margin: 1.2rem auto 0 auto;
    max-width: 380px;
    font-size: 1.1rem;
    font-weight: 500;
}

.tg-userpic {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}


/* --- ВКЛАДКА "ЗАРАБОТАТЬ" (EARN) --- */
.earn-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.earn-item {
    /* Используем стили .card, удаляем дубли */
    padding: 2rem 2.5rem;
    min-width: 280px;
}

.earn-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    color: #ef4444; /* Добавил цвет иконке */
}

.earn-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 0.7rem;
}

.earn-desc {
    color: #374151;
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.earn-reward {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.earn-btn {
    /* Используем стили .btn-main, удаляем дубли */
}


/* --- НИЖНЯЯ ПАНЕЛЬ И ПРОЧЕЕ --- */

/* Нижняя панель вкладок */
.bottom-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    height: 64px;
    background: #f9fafb;
    border-radius: 16px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    z-index: 1001;
    padding: 0 12px;
}

.bottom-nav .tab {
    flex: 1;
    height: 44px;
    margin: 0 4px;
    border: none;
    border-radius: 12px;
    background: #eef1f5;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav .tab.active {
    background: #e54646;
    color: #fff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.bottom-nav .tab:hover:not(.active) {
    background: #e0e7ff;
    color: #a33030;
}

/* Уведомления и анимации */
.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: #22c55e;
    color: white;
    padding: 1.2rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(34, 197, 94, 0.3);
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.notification.show {
    transform: translateX(5%);
}

.notification.error {
    background: #ef4444;
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3);
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 79, 79, 0.1);
    animation: float 20s infinite linear;
}
.shape:nth-child(1) { width: 80px; height: 80px; top: 10%; left: 10%; animation-delay: 0s; }
.shape:nth-child(2) { width: 120px; height: 120px; top: 70%; left: 80%; animation-delay: -7s; }
.shape:nth-child(3) { width: 60px; height: 60px; top: 30%; left: 70%; animation-delay: -14s; }

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

.success-animation {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .container { padding: 2rem 1rem; }
    .header h1 { font-size: 2.5rem; }
    .balance { gap: 1.5rem; }
    .balance-item { min-width: auto; flex: 1; padding: 1.5rem; }
    .shop-grid { grid-template-columns: 1fr; gap: 2rem; }
    .shop-item, .card { padding: 2rem; } /* Упрощение для мобильных */
}

@media (max-width: 600px) {
    .bottom-nav { height: 56px; padding: 0 8px; }
    .bottom-nav .tab { font-size: 0.95rem; height: 40px; }
}