/* Стили для верхней панели управления */
.top-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #111111;
    border-bottom: 1px solid #222222;
    height: 70px;
    box-sizing: border-box;
}

.control-buttons {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.control-buttons.hidden {
    display: none;
}

/* Общие стили для кнопок */
.vibration-button,
.flag-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #222222;
    border: 2px solid #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vibration-button:hover,
.flag-button:hover {
    transform: scale(1.05);
    border-color: #444444;
}

/* Стили для иконки вибрации */
.vibration-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.vibration-icon svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    transition: all 0.3s ease;
}

/* Стили для вибрации выключена (черная иконка) */
.vibration-off .vibration-icon svg {
    fill: #666666;
}

/* Стили для вибрации включена (белая иконка) */
.vibration-on .vibration-icon svg {
    fill: #ffffff;
}

/* Стили для флага */
.flag {
    font-size: 1.6rem;
    transition: all 0.3s ease;
    display: inline-block;
}

/* Легкое колыхание кончиков флагов как на ветру */
.ru-flag {
    animation: flagWave 4s ease-in-out infinite;
}

.us-flag {
    animation: flagWave 4s ease-in-out infinite;
}

@keyframes flagWave {
    0%, 100% {
        transform: perspective(100px) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: perspective(100px) rotateX(1deg) rotateY(1deg);
    }
    50% {
        transform: perspective(100px) rotateX(-0.5deg) rotateY(-1deg);
    }
    75% {
        transform: perspective(100px) rotateX(0.5deg) rotateY(0.5deg);
    }
}

/* Анимация волны для всех кнопок */
.wave-animation {
    animation: waveEffect 0.6s ease-out;
}

@keyframes waveEffect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Анимация перехода между вкладками */
.tab-transition-enter {
    animation: tabEnter 0.4s ease-out;
}

.tab-transition-exit {
    animation: tabExit 0.4s ease-out;
}

@keyframes tabEnter {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tabExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000000;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 400px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Увеличенная панель загрузки */
.loading-content {
    background: #111111;
    padding: 4rem 3rem;
    border-radius: 20px;
    border: 1px solid #222222;
    text-align: center;
    margin: auto;
    width: 90%;
    max-width: 350px;
}

.cube {
    font-size: 5rem;
    margin-bottom: 2rem;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(90deg); }
    50% { transform: translateY(-5px) rotate(180deg); }
    75% { transform: translateY(-8px) rotate(270deg); }
}

/* Толстый и короткий прогресс-бар */
.progress-bar {
    width: 180px;
    height: 16px;
    background: #222222;
    border-radius: 8px;
    margin: 0 auto;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #2563eb;
    width: 0%;
    transition: width 0.2s;
    border-radius: 8px;
}

/* Быстрое появление контента */
.main-content {
    background: #111111;
    flex: 1;
    padding: 1.5rem;
    border: 1px solid #222222;
    border-bottom: none;
    overflow-y: auto;
    position: relative;
    margin-top: 70px;
}

.tab-content {
    display: none;
}

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

/* Стили для Кейсов */
.cases-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.case-item {
    background: #222222;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #333333;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    animation: itemRise 0.3s ease-out both;
}

.case-item:hover {
    background: #2a2a2a;
}

.case-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.case-name {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #e5e7eb;
}

.case-price {
    font-size: 1.1rem;
    color: #cccccc;
    font-weight: 600;
}

/* Стили для Игр */
.games-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.game-item {
    background: #222222;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #333333;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    animation: itemRise 0.3s ease-out both;
}

.game-item:hover {
    background: #2a2a2a;
}

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.game-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #e5e7eb;
    font-weight: 600;
}

.game-description {
    font-size: 0.9rem;
    color: #888888;
}

/* Быстрое появление элементов сетки */
.case-item:nth-child(1),
.game-item:nth-child(1) {
    animation-delay: 0.1s;
}

.case-item:nth-child(2),
.game-item:nth-child(2) {
    animation-delay: 0.2s;
}

.case-item:nth-child(3),
.game-item:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes itemRise {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Стили для Кубика */
.dice-wheel {
    font-size: 4rem;
    text-align: center;
    margin: 2rem 0;
    animation: shake 0.5s ease-in-out infinite;
}

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

.spin-button {
    background: #333333;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.spin-button:hover {
    background: #444444;
}

.spin-button:disabled {
    background: #2a2a2a;
    cursor: not-allowed;
}

/* Стили для Профиля */
.user-info {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.avatar {
    width: 140px;
    height: 140px;
    background: #222222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #333333;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar svg {
    width: 70px;
    height: 70px;
    fill: #666666;
}

.user-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
}

/* Быстрая анимация появления нижних табов */
.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: #111111;
    border-top: 1px solid #222222;
    min-height: 80px;
}

.tab {
    padding: 1.2rem 0.8rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.tab.active .tab-icon {
    background: #2563eb;
}

.tab:not(.active) .tab-icon {
    background: #222222;
}

.tab.active .tab-icon svg {
    fill: #000000;
}

.tab:not(.active) .tab-icon svg {
    fill: #000000;
}

.tab.active .tab-label {
    color: #2563eb;
}

.tab:not(.active) .tab-label {
    color: #cccccc;
}

.tab-icon {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab .tab-icon {
    width: 32px;
    height: 32px;
    background: #222222;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab .tab-icon svg {
    width: 18px;
    height: 18px;
    fill: #000000;
}

.tab-label {
    font-size: 0.85rem;
    color: #cccccc;
    font-weight: 500;
}

/* Кастомные уведомления */
.notification {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #222222;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-100px);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hidden {
    display: none !important;
}

/* Стили для Tether баланса */
.tether-balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #222222;
    padding: 0.5rem 0.8rem;
    border-radius: 25px;
    border: 2px solid #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.tether-balance:hover {
    transform: scale(1.05);
    border-color: #444444;
}

.tether-icon {
    width: 24px;
    height: 24px;
    background: #26a17b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.9rem;
    font-family: 'Arial', sans-serif;
}

.tether-amount {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.add-balance-button {
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #444444;
}

.add-balance-button:hover {
    transform: scale(1.1);
    background: #f0f0f0;
}

.add-icon {
    color: #000000;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1;
    margin-top: -1px;
}

/* Адаптация для мобильных устройств */
@media (max-width: 480px) {
    .top-controls {
        padding: 0.8rem;
        height: 60px;
    }
    
    .control-buttons {
        gap: 0.7rem;
    }
    
    .vibration-button,
    .flag-button {
        width: 42px;
        height: 42px;
    }
    
    .vibration-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .flag {
        font-size: 1.5rem;
    }
    
    .user-info {
        margin-top: 1rem;
        gap: 1.5rem;
    }
    
    .avatar {
        width: 120px;
        height: 120px;
        border: 3px solid #333333;
    }
    
    .avatar svg {
        width: 60px;
        height: 60px;
    }
    
    .user-name {
        font-size: 1.6rem;
    }
    
    .container {
        max-width: 100%;
        height: 100vh;
    }
    
    .loading-content {
        padding: 3rem 2rem;
        width: 85%;
    }
    
    .cube {
        font-size: 4rem;
    }
    
    .progress-bar {
        width: 160px;
        height: 14px;
    }
    
    .main-content {
        padding: 1rem;
        margin-top: 60px;
    }
    
    .cases-grid,
    .games-grid {
        gap: 0.75rem;
    }
    
    .case-item,
    .game-item {
        padding: 1rem;
    }
    
    .tabs {
        min-height: 75px;
    }
    
    .tab {
        padding: 1rem 0.7rem;
        min-height: 75px;
    }
    
    .tab-icon {
        font-size: 1.2rem;
    }
    
    .tab .tab-icon {
        width: 30px;
        height: 30px;
    }
    
    .tab .tab-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .tab-label {
        font-size: 0.8rem;
    }
    
    .dice-wheel {
        font-size: 3.5rem;
    }
    
    .notification {
        top: 80px;
        min-width: 250px;
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }
    
    .tether-balance {
        padding: 0.4rem 0.7rem;
        gap: 0.4rem;
    }
    
    .tether-icon {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }
    
    .tether-amount {
        font-size: 0.9rem;
    }
    
    .add-balance-button {
        width: 22px;
        height: 22px;
    }
    
    .add-icon {
        font-size: 1rem;
    }
}
