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

body {
    background: radial-gradient(ellipse at top, #0a0a0f, #050508);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Poppins', sans-serif;
    min-height: 100vh;
    color: #fff;
}

.app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: linear-gradient(180deg, rgba(20,20,35,0.8) 0%, rgba(10,10,20,0.95) 100%);
    backdrop-filter: blur(2px);
}

/* Анимации */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

@keyframes winFlash {
    0% { transform: scale(1); text-shadow: 0 0 0 #ffd700; }
    50% { transform: scale(1.3); text-shadow: 0 0 30px #ffd700; }
    100% { transform: scale(1); text-shadow: 0 0 0 #ffd700; }
}

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

@keyframes reelSpin {
    from { transform: translateY(0); }
    to { transform: translateY(-600px); }
}

/* Верхняя панель */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ff3366, #ff6680);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(255,51,102,0.3);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #eee;
}

.balance-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.5);
    padding: 10px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255,215,0,0.3);
}

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

.balance-details {
    display: flex;
    flex-direction: column;
}

.balance-label {
    font-size: 10px;
    color: #ffd700;
    letter-spacing: 1px;
}

.balance-value {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.menu-trigger {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.08);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.menu-trigger:hover {
    background: rgba(255,255,255,0.15);
}

.menu-dots {
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* Навигация по играм */
.games-nav {
    display: flex;
    padding: 16px 20px;
    gap: 12px;
    background: rgba(0,0,0,0.3);
}

.game-tab {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: none;
    padding: 12px 8px;
    border-radius: 30px;
    color: #aaa;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.game-tab.active {
    background: linear-gradient(135deg, #ff3366, #ff6680);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255,51,102,0.3);
}

.tab-icon {
    font-size: 18px;
}

/* Панели игр */
.game-panel {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.game-panel.active {
    display: block;
}

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

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

.game-header h2 {
    font-size: 22px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.game-desc {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* Рулетка */
.roulette-stage {
    text-align: center;
    margin-bottom: 30px;
}

.roulette-wheel {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
    background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,215,0,0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 2px 0 rgba(255,255,255,0.1);
}

.wheel-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,51,102,0.2), transparent);
    animation: glowPulse 2s infinite;
}

.wheel-result {
    font-size: 80px;
    z-index: 2;
    background: #0a0a0f;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roulette-wheel.spinning .wheel-result {
    animation: spinWheel 0.08s linear infinite;
}

.history-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    font-size: 12px;
    color: #888;
}

.history-icons {
    display: flex;
    gap: 6px;
}

.history-icons span {
    font-size: 20px;
}

/* Кости */
.dice-stage {
    text-align: center;
    margin-bottom: 30px;
}

.dice-cube {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    background: linear-gradient(135deg, #2a2a3e, #1a1a2e);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.dice-face {
    font-size: 70px;
}

.dice-value {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-top: 15px;
    color: #ffd700;
}

.dice-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-badge {
    background: rgba(255,255,255,0.08);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

.dice-cube.rolling {
    animation: diceRoll 0.3s ease infinite;
}

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

/* Слоты */
.slots-machine {
    background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
    border-radius: 30px;
    padding: 30px 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.1);
}

.slot-reels {
    display: flex;
    gap: 15px;
    justify-content: center;
    overflow: hidden;
}

.reel {
    width: 80px;
    height: 100px;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255,215,0,0.3);
}

.reel-symbols {
    font-size: 50px;
    text-align: center;
    line-height: 100px;
    transition: transform 0.3s ease;
}

.reel.spinning .reel-symbols {
    animation: reelSpin 0.1s linear infinite;
}

@keyframes reelSpin {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

.slots-result {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-top: 20px;
    padding: 12px;
    border-radius: 30px;
    background: rgba(0,0,0,0.5);
}

.slots-payouts {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.payout {
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
}

.spin-btn {
    background: linear-gradient(135deg, #ff3366, #ff6680);
    border: none;
    padding: 14px 30px;
    border-radius: 50px;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: 0.2s;
}

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

/* Crash Game */
.crash-stage {
    background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
    border-radius: 30px;
    padding: 30px;
    text-align: center;
    margin-bottom: 25px;
}

.multiplier-display {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
}

.crash-graph {
    height: 100px;
    background: rgba(0,0,0,0.5);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.graph-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,51,102,0.3), transparent);
    transform: scaleY(0);
    transition: transform 0.05s linear;
}

.crash-status {
    font-size: 14px;
    color: #ffd700;
}

.crash-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.crash-bet-btn, .crash-cashout-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
}

.crash-bet-btn {
    background: linear-gradient(135deg, #ff3366, #ff6680);
    color: #fff;
}

.crash-cashout-btn {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #fff;
}

.crash-cashout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Общие элементы ставок */
.amount-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.amount, .dice-amount, .slots-amount, .crash-amount {
    background: rgba(255,255,255,0.08);
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.amount.active, .dice-amount.active, .slots-amount.active, .crash-amount.active {
    background: linear-gradient(135deg, #ff3366, #ff6680);
    box-shadow: 0 4px 15px rgba(255,51,102,0.3);
}

.custom-trigger {
    background: rgba(255,255,255,0.15);
}

.custom-panel {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.custom-panel input {
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 16px;
    border-radius: 30px;
    color: #fff;
    width: 130px;
    text-align: center;
}

.custom-panel button {
    background: #ff3366;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.current-bet {
    text-align: center;
    font-size: 14px;
    color: #ffd700;
    margin: 15px 0;
}

.current-bet span {
    font-size: 20px;
    font-weight: 800;
}

.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.bet {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: 0.1s;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.bet:active {
    transform: scale(0.97);
}

.red-bet {
    background: linear-gradient(135deg, #e63946, #c1121f);
    box-shadow: 0 6px 20px rgba(230,57,70,0.4);
}

.black-bet {
    background: linear-gradient(135deg, #2b2d42, #1a1a2e);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

.dice-high {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
}

.dice-low {
    background: linear-gradient(135deg, #f77f00, #d62828);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 60px;
    opacity: 0;
}

.x2 {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
}

/* Боковое меню */
.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, #0f0f1a, #050508);
    z-index: 200;
    transition: right 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
}

.side-menu.open {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.menu-header button {
    background: none;
    border: none;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
}

.menu-items {
    flex: 1;
}

.menu-item {
    padding: 16px;
    margin: 8px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.menu-item:hover {
    background: rgba(255,51,102,0.2);
}

.menu-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.user-rank {
    color: #ffd700;
    font-weight: 600;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 150;
    display: none;
}

.overlay.show {
    display: block;
}

/* Toast уведомления */
.toast {
    position: fixed;
    bottom: 30px;
    left: 20px;
    right: 20px;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    padding: 14px 20px;
    border-radius: 50px;
    text-align: center;
    transform: translateY(100px);
    transition: transform 0.3s;
    z-index: 300;
    font-weight: 600;
}

.toast.show {
    transform: translateY(0);
}

.toast.error {
    background: rgba(230,57,70,0.9);
}

.toast.win {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
}

.hidden {
    display: none;
}

.win-animation {
    animation: winFlash 0.4s ease;
}

.lose-animation {
    animation: loseShake 0.3s ease;
}