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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #191d31;
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 10px 20px 20px 20px;
    min-height: 100vh;
    position: relative;
}

/* Заголовок */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

/* Информация о пользователе */
.user-info {
    background: #26293d;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.user-name {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-stats {
    font-size: 0.9em;
    opacity: 0.8;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: relative;
}

.balance-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.balance-label {
    font-size: 0.9em;
    color: #ffd700;
    font-weight: 600;
    opacity: 0.9;
}

.balance-display {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Кнопка пополнения баланса */
.balance-add-button {
    background: linear-gradient(135deg, #00b894, #00a085);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 184, 148, 0.3);
    z-index: 10;
}

.balance-add-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4);
    background: linear-gradient(135deg, #00d4aa, #00b894);
}

.balance-add-button:active {
    transform: scale(0.95);
}

.add-icon {
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

/* Секция подарков */
.gifts-section {
    display: flex;
    align-items: center;
}

.gifts-button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    position: relative;
    overflow: hidden;
}

.gifts-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #5a9ee8, #4a90e2);
}

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

.gifts-button-content {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.gifts-icon {
    font-size: 1.1em;
    animation: gifts-glow 2s ease-in-out infinite alternate;
}

.gifts-text {
    font-size: 0.8em;
    font-weight: 600;
    color: white;
}

/* Анимация для кнопки подарков */
@keyframes gifts-glow {
    0% {
        filter: brightness(1) drop-shadow(0 0 2px rgba(74, 144, 226, 0.5));
    }
    100% {
        filter: brightness(1.2) drop-shadow(0 0 8px rgba(74, 144, 226, 0.8));
    }
}

/* Частицы для кнопки подарков */
.gifts-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: gifts-shine 3s linear infinite;
    z-index: 1;
}

@keyframes gifts-shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Анимированная кнопка подарков */
.animated-gifts-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.gifts-icon-container {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gifts-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: gifts-icon-glow 2s ease-in-out infinite alternate;
    display: none; /* По умолчанию скрыто, показывается только если cap.png загружен */
}

.gifts-icon-fallback {
    font-size: 1.1em;
    animation: gifts-glow 2s ease-in-out infinite alternate;
    display: block; /* По умолчанию показано */
}

.gifts-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.gifts-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, #4a90e2, #357abd);
    border-radius: 50%;
    animation: gifts-particle-float 3s ease-in-out infinite;
}

.gifts-sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #4a90e2;
    border-radius: 50%;
    animation: gifts-sparkle 2s ease-in-out infinite;
}

/* Позиции частиц для кнопки подарков */
.gifts-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.gifts-particle:nth-child(2) { left: 80%; top: 30%; animation-delay: 0.5s; }
.gifts-particle:nth-child(3) { left: 30%; top: 70%; animation-delay: 1s; }
.gifts-particle:nth-child(4) { left: 70%; top: 15%; animation-delay: 1.5s; }

.gifts-sparkle:nth-child(5) { left: 20%; top: 80%; animation-delay: 0.3s; }
.gifts-sparkle:nth-child(6) { left: 60%; top: 10%; animation-delay: 0.8s; }
.gifts-sparkle:nth-child(7) { left: 90%; top: 60%; animation-delay: 1.3s; }

@keyframes gifts-icon-glow {
    0% {
        filter: brightness(1) drop-shadow(0 0 3px rgba(74, 144, 226, 0.6));
        transform: scale(1);
    }
    100% {
        filter: brightness(1.3) drop-shadow(0 0 10px rgba(74, 144, 226, 0.9));
        transform: scale(1.1);
    }
}

@keyframes gifts-particle-float {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-12px) scale(1.3);
        opacity: 1;
    }
}

@keyframes gifts-sparkle {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.8);
        opacity: 1;
    }
}

/* Рулетка */
.roulette-container {
    margin-bottom: 30px;
    position: relative;
}

.roulette-wheel {
    background: #26293d;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    height: 120px;
}

.roulette-items {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    width: max-content;
    animation: roulette-infinite 15s linear infinite;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0); /* GPU acceleration */
}

.roulette-items.spinning {
    animation-duration: 3s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
}

@keyframes roulette-infinite {
    0% {
        transform: translateX(0px);
    }
    100% {
        transform: translateX(-810px); /* 9 подарков * 90px = 810px - один полный набор */
    }
}

.roulette-item {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    height: 80px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* 🔧 Фиксы для предотвращения исчезновения */
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    opacity: 1;
    visibility: visible;
}

.roulette-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.roulette-item.common {
    background: linear-gradient(135deg, #26293d, #1e2138);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.roulette-item.rare {
    background: linear-gradient(135deg, #2d4a5a, #1e3a4a);
    border: 1px solid rgba(0, 184, 148, 0.3);
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.2);
}

.roulette-item.epic {
    background: linear-gradient(135deg, #3d2a5a, #2e1e4a);
    border: 1px solid rgba(162, 155, 254, 0.4);
    box-shadow: 0 4px 12px rgba(162, 155, 254, 0.3);
}

.roulette-item.legendary {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 193, 7, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.8);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
    animation: legendary-glow 2s ease-in-out infinite alternate;
}

.roulette-item.legendary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: legendary-shine 3s linear infinite;
}

/* Звездная пыль для легендарных карточек */
.roulette-item.legendary .roulette-star-dust {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

/* Частицы для карточек рулетки */
.roulette-item.legendary .roulette-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: radial-gradient(circle, #ffd700, #ffed4e);
    border-radius: 50%;
    animation: roulette-particle-float 2s infinite;
}

.roulette-item.legendary .roulette-sparkle {
    position: absolute;
    width: 1px;
    height: 1px;
    background: #ffd700;
    border-radius: 50%;
    animation: roulette-sparkle 3s infinite;
}

/* Позиции частиц */
.roulette-item.legendary .roulette-particle:nth-child(1) { left: 15%; top: 20%; animation-delay: 0s; }
.roulette-item.legendary .roulette-particle:nth-child(2) { left: 75%; top: 30%; animation-delay: 0.4s; }
.roulette-item.legendary .roulette-particle:nth-child(3) { left: 35%; top: 70%; animation-delay: 0.8s; }
.roulette-item.legendary .roulette-particle:nth-child(4) { left: 85%; top: 15%; animation-delay: 1.2s; }

.roulette-item.legendary .roulette-sparkle:nth-child(5) { left: 25%; top: 85%; animation-delay: 0.2s; }
.roulette-item.legendary .roulette-sparkle:nth-child(6) { left: 65%; top: 10%; animation-delay: 0.6s; }
.roulette-item.legendary .roulette-sparkle:nth-child(7) { left: 90%; top: 60%; animation-delay: 1.0s; }

@keyframes roulette-particle-float {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-5px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-15px) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(-25px) scale(0.3);
    }
}

@keyframes roulette-sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg);
    }
}

@keyframes legendary-shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes legendary-glow {
    0% {
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
        transform: scale(1.02);
    }
}



.roulette-item-icon {
    font-size: 2em;
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.roulette-star-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.4));
}

/* Специальные эффекты для звездочки в легендарных карточках */
.roulette-item.legendary .roulette-star-icon {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    animation: legendary-star-glow 2s ease-in-out infinite alternate;
}

@keyframes legendary-star-glow {
    0% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 1));
        transform: scale(1.1);
    }
}

.roulette-item-name {
    font-size: 0.7em;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    margin-top: -8px;
    position: relative;
    z-index: 2;
}

.roulette-pointer {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #ff6b6b;
    z-index: 10;
    filter: drop-shadow(0 2px 8px rgba(255, 107, 107, 0.6));
    animation: pointer-float 3s ease-in-out infinite;
}

.roulette-pointer::before {
    content: '';
    position: absolute;
    top: -16px;
    left: -12px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #ff4757;
    filter: blur(1px);
    opacity: 0.6;
}

@keyframes pointer-float {
    0%, 100% {
        transform: translate(-50%, 0) scale(1);
        filter: drop-shadow(0 2px 8px rgba(255, 107, 107, 0.6));
    }
    50% {
        transform: translate(-50%, 0) scale(1.1);
        filter: drop-shadow(0 4px 12px rgba(255, 107, 107, 0.8));
    }
}

/* Секция ставки и кнопки крутки */
.spin-section {
    text-align: center;
    margin-bottom: 30px;
}

.stake-input-section {
    background: #26293d;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stake-label {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 10px;
}

.stake-input {
    width: 120px;
    padding: 12px 15px;
    font-size: 1.2em;
    font-weight: 600;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    outline: none;
    margin-bottom: 10px;
    /* Убираем стрелки вверх/вниз */
    -moz-appearance: textfield;
}

/* Убираем стрелки в WebKit браузерах (Chrome, Safari) */
.stake-input::-webkit-outer-spin-button,
.stake-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stake-input:focus {
    border-color: #ff9500;
    box-shadow: 0 0 15px rgba(255, 149, 0, 0.3);
}

.stake-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.stake-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.stake-min {
    color: #ffd700;
}

.stake-max {
    color: #ff6b6b;
}

.stake-input.stake-valid {
    border-color: #ff9500;
    background: rgba(255, 149, 0, 0.1);
}

.stake-input.stake-invalid {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Анимации для звезды и частиц */
@keyframes starGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.9));
        transform: scale(1.05);
    }
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-30px) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.3);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    }
}

.spin-button {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 149, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.spin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(255, 149, 0, 0.4);
}

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

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    animation: button-disabled-pulse 1s ease-in-out infinite;
}

@keyframes button-disabled-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
    }
}

.spin-icon {
    margin-left: 10px;
    display: inline-block;
    animation: spin 2s linear infinite;
}

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

/* Результат */
.result-section {
    text-align: center;
    margin-bottom: 30px;
}

.result-card {
    background: #26293d;
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.5s ease;
}

.result-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 0.6s ease;
}

.result-text {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.result-gift {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.result-rarity {
    font-size: 0.9em;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 15px;
    border-radius: 15px;
    display: inline-block;
    margin-top: 10px;
}

.result-rarity.common { background: rgba(116, 185, 255, 0.3); }
.result-rarity.rare { background: rgba(0, 184, 148, 0.3); }
.result-rarity.epic { background: rgba(162, 155, 254, 0.3); }
.result-rarity.legendary { background: rgba(253, 203, 110, 0.3); }

/* Вкладки */
.tabs {
    display: flex;
    background: #26293d;
    border-radius: 15px;
    padding: 5px;
    margin: 5px 0 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.tab-button {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 8px;
    color: white;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.tab-button:hover {
    background: rgba(255, 149, 0, 0.1);
}

.tab-button.active {
    background: #ff9500;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* История */
.history-container {
    background: #26293d;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}



.history-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.history-item {
    background: #191d31;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #252847;
    border-color: #444;
}

/* Цветовая кодировка по редкости */
.history-item.rarity-common {
    border-left: 4px solid #4a90e2;
}

.history-item.rarity-rare {
    border-left: 4px solid #20c997;
}

.history-item.rarity-epic {
    border-left: 4px solid #9b59b6;
}

.history-item.rarity-legendary {
    border-left: 4px solid #f39c12;
    background: linear-gradient(135deg, #191d31 0%, #2a2440 100%);
}

.history-gift {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-gift-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background: #ff9500;
}

.history-gift-icon.rarity-common {
    background: linear-gradient(135deg, #4a90e2, #357abd);
}

.history-gift-icon.rarity-rare {
    background: linear-gradient(135deg, #20c997, #17a085);
}

.history-gift-icon.rarity-epic {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.history-gift-icon.rarity-legendary {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.3);
}

.history-gift-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-gift-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.history-gift-rarity {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
}

.history-gift-rarity,
.history-item.rarity-common .history-gift-rarity {
    color: #4a90e2;
}

.history-item.rarity-rare .history-gift-rarity {
    color: #20c997;
}

.history-item.rarity-epic .history-gift-rarity {
    color: #9b59b6;
}

.history-item.rarity-legendary .history-gift-rarity {
    color: #f39c12;
}

.history-transaction {
    display: flex;
    gap: 10px;
    font-size: 0.8em;
}

.history-cost {
    color: #ff6b6b;
    font-weight: 500;
}

.history-win {
    color: #00b894;
    font-weight: 600;
}

.history-date {
    font-size: 12px;
    color: #888;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-date-day {
    font-weight: 500;
    color: #aaa;
}

.history-date-time {
    font-size: 11px;
    color: #666;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.6;
}

/* Страница подарков */
.gifts-container {
    background: #26293d;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gifts-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 0.9em;
    font-weight: 600;
}

.back-button:hover {
    transform: translateX(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.back-icon {
    font-size: 1.1em;
}

.back-text {
    font-weight: 600;
}

.gifts-header h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.gifts-content {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gifts-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.7;
}

.gifts-empty-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: gifts-empty-pulse 2s ease-in-out infinite;
}

.gifts-empty p {
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.gifts-empty small {
    font-size: 0.9em;
    color: #aaa;
    line-height: 1.4;
}

@keyframes gifts-empty-pulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }
}

/* Страница пополнения баланса */
.deposit-container {
    background: #26293d;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.deposit-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.deposit-header h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.deposit-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.deposit-info {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.current-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.deposit-options h4 {
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
    text-align: center;
}

.deposit-info-text {
    margin-bottom: 20px;
    text-align: center;
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.deposit-info-text p {
    margin: 0;
    font-size: 0.9em;
    color: #ffd700;
    opacity: 0.9;
}

/* Быстрые кнопки пополнения */
.quick-deposit-buttons {
    margin: 20px 0;
}

.quick-deposit-buttons h5 {
    font-size: 1em;
    color: #ffd700;
    margin-bottom: 15px;
    font-weight: 600;
}

.quick-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-deposit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

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

.quick-deposit-btn:hover::before {
    left: 100%;
}

.quick-deposit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7c8ff0 0%, #8a5bb8 100%);
}

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

.quick-amount {
    font-size: 1.1em;
    font-weight: bold;
    color: white;
}

.quick-stars {
    font-size: 0.9em;
    color: #ffd700;
    animation: quick-star-glow 2s ease-in-out infinite alternate;
}

@keyframes quick-star-glow {
    0% {
        filter: brightness(1) drop-shadow(0 0 2px rgba(255, 215, 0, 0.5));
    }
    100% {
        filter: brightness(1.3) drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
    }
}

.deposit-input-section {
    margin-top: 20px;
}

.deposit-input-label {
    display: block;
    font-size: 1em;
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 500;
}

.deposit-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #191d31;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px;
    transition: all 0.3s ease;
}

.deposit-input-container:focus-within {
    border-color: #00b894;
    background: rgba(0, 184, 148, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

.deposit-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px;
    font-size: 1.2em;
    color: #ffffff;
    outline: none;
    font-weight: 600;
}

.deposit-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.deposit-input-suffix {
    padding: 15px 20px;
    font-size: 1.2em;
    color: #ffd700;
    font-weight: 600;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    margin-right: 5px;
}

.deposit-input-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8em;
    color: #aaa;
}

.deposit-min {
    color: #4CAF50;
}

.deposit-max {
    color: #ff6b6b;
}

/* Удалены стили для старых карточек пополнения */

.deposit-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.exchange-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 184, 148, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.exchange-from, .exchange-to {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    color: #ffffff;
}

.exchange-amount {
    font-weight: 700;
    color: #ff6b6b;
}

.exchange-result {
    font-weight: 700;
    color: #4CAF50;
}

.exchange-arrow {
    font-size: 1.5em;
    color: #00b894;
    font-weight: bold;
    animation: exchange-pulse 2s ease-in-out infinite;
}

@keyframes exchange-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.deposit-button {
    background: linear-gradient(135deg, #00b894, #00a085);
    border: none;
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.deposit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #00d4aa, #00b894);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.deposit-button:active:not(:disabled) {
    transform: translateY(0);
}

.deposit-button:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.deposit-button-text {
    position: relative;
    z-index: 2;
}

/* Кнопка проверки баланса */
.balance-check-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: none;
}

.balance-check-btn:hover {
    background: linear-gradient(135deg, #7c8ff0 0%, #8a5bb8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

/* Меню игр */
.menu-container {
    background: #26293d;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.game-card {
    background: #191d31;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-card:hover {
    background: #252847;
    border-color: #ff9500;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.2);
}

.game-card-content {
    position: relative;
    z-index: 2;
}

.game-icon {
    font-size: 3em;
    margin-bottom: 15px;
    text-align: center;
    animation: starGlow 2s ease-in-out infinite;
}

.game-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    text-align: center;
}

.game-description {
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.4;
}

.game-status {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

/* Звездная пыль для карточки игры */
.game-star-dust {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.game-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 215, 0, 0.6);
    border-radius: 50%;
    animation: game-particle-float 4s ease-in-out infinite;
}

.game-sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: game-sparkle 3s ease-in-out infinite;
}

.game-particle:nth-child(1) { left: 15%; top: 20%; animation-delay: 0s; }
.game-particle:nth-child(2) { left: 75%; top: 30%; animation-delay: 0.4s; }
.game-particle:nth-child(3) { left: 35%; top: 70%; animation-delay: 0.8s; }
.game-particle:nth-child(4) { left: 85%; top: 15%; animation-delay: 1.2s; }

.game-sparkle:nth-child(5) { left: 25%; top: 85%; animation-delay: 0.2s; }
.game-sparkle:nth-child(6) { left: 65%; top: 10%; animation-delay: 0.6s; }
.game-sparkle:nth-child(7) { left: 90%; top: 60%; animation-delay: 1.0s; }

@keyframes game-particle-float {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-15px) scale(1.2);
        opacity: 1;
    }
}

@keyframes game-sparkle {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Загрузка */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* Скрыто по умолчанию */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.1em;
    color: white;
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Анимированная звезда */
.animated-star {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #26293d;
    border-radius: 25px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: pulse 3s ease-in-out infinite;
    overflow: hidden;
}

.star-container {
    position: relative;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-icon {
    width: 28px;
    height: 28px;
    background-image: url('./assets/images/star.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: starGlow 2s ease-in-out infinite;
    z-index: 2;
}

/* Если PNG недоступен, используем emoji */
.star-icon.fallback {
    background-image: none;
    font-size: 24px;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.star-icon.fallback::before {
    content: '⭐';
}

.star-amount {
    font-size: 16px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    z-index: 2;
}

/* Звездная пыль */
.star-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, #FFD700, transparent);
    border-radius: 50%;
    animation: particleFloat 2s infinite;
}

.particle:nth-child(1) { left: 20%; top: 30%; animation-delay: 0s; }
.particle:nth-child(2) { left: 70%; top: 40%; animation-delay: 0.3s; }
.particle:nth-child(3) { left: 40%; top: 60%; animation-delay: 0.6s; }
.particle:nth-child(4) { left: 80%; top: 20%; animation-delay: 0.9s; }
.particle:nth-child(5) { left: 15%; top: 70%; animation-delay: 1.2s; }
.particle:nth-child(6) { left: 60%; top: 80%; animation-delay: 1.5s; }

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFD700;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkle 3s infinite;
}

.sparkle:nth-child(7) { left: 10%; top: 10%; animation-delay: 0.2s; }
.sparkle:nth-child(8) { left: 85%; top: 85%; animation-delay: 1.1s; }
.sparkle:nth-child(9) { left: 90%; top: 15%; animation-delay: 2.3s; }

/* Размеры звезды */
.animated-star.large {
    padding: 12px 20px;
}

.animated-star.large .star-icon {
    width: 36px;
    height: 36px;
}

.animated-star.large .star-amount {
    font-size: 20px;
}

.animated-star.small {
    padding: 6px 12px;
}

.animated-star.small .star-icon {
    width: 20px;
    height: 20px;
}

.animated-star.small .star-amount {
    font-size: 14px;
}

/* Адаптивность */
@media (max-width: 320px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .roulette-item {
        min-width: 60px;
        height: 60px;
        font-size: 1.2em;
    }
    
    .spin-button {
        padding: 12px 30px;
        font-size: 1.1em;
    }
    
    .animated-star {
        padding: 6px 12px;
    }
}

/* Стили авторизации */
.avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar-initial {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.premium-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.8em;
    animation: premium-sparkle 2s ease-in-out infinite;
}

@keyframes premium-sparkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.demo-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 10px;
    padding: 10px;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9em;
    animation: demo-pulse 3s ease-in-out infinite;
}

@keyframes demo-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.auth-error {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin: 50px 0;
}

.auth-error h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #ff6b6b;
}

.auth-error p {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.retry-button {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Темные/светлые темы */
[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --text-color: #e1e1e1;
    --card-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] body {
    background: var(--bg-gradient);
    color: var(--text-color);
}

[data-theme="dark"] .user-info,
[data-theme="dark"] .roulette-wheel,
[data-theme="dark"] .result-card {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Адаптивность для авторизации */
@media (max-width: 320px) {
    .avatar-img,
    .avatar-initial {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    
    .user-info {
        padding: 12px;
        gap: 12px;
    }
    
    .auth-error {
        padding: 30px 15px;
        margin: 30px 0;
    }
}

/* Страница ошибки о необходимости Telegram */
.telegram-required-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.error-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.telegram-required-error h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: 600;
}

.telegram-required-error p {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.5;
    max-width: 400px;
}

.error-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

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