/* ============================================
   TON MINES CASINO - PROFESSIONAL DESIGN
   Inspired by Stake.com & 1win
   ============================================ */

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

:root {
    /* Dark Theme Colors - Stake Style */
    --bg-primary: #0f212e;
    --bg-secondary: #1a2c38;
    --bg-tertiary: #213743;
    --bg-card: #1e3a4c;
    
    /* Accent Colors */
    --accent-primary: #0098ea;
    --accent-secondary: #00d4ff;
    --accent-danger: #ff4655;
    --accent-warning: #ffc800;
    --accent-success: #00e701;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b1bad3;
    --text-tertiary: #7f8c9e;
    --text-success: #0098ea;
    --text-danger: #ff4655;
    
    /* Border Colors */
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.12);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0098ea 0%, #0077cc 100%);
    --gradient-secondary: linear-gradient(135deg, #00d4ff 0%, #0098ea 100%);
    --gradient-danger: linear-gradient(135deg, #ff4655 0%, #d63647 100%);
    --gradient-card: linear-gradient(135deg, #1e3a4c 0%, #1a2c38 100%);
    --gradient-glow: linear-gradient(135deg, rgba(0, 152, 234, 0.15) 0%, rgba(0, 212, 255, 0.15) 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --glow-primary: 0 0 30px rgba(0, 152, 234, 0.5), 0 0 60px rgba(0, 152, 234, 0.3);
    --glow-secondary: 0 0 30px rgba(0, 212, 255, 0.5), 0 0 60px rgba(0, 212, 255, 0.3);
    --glow-danger: 0 0 30px rgba(255, 70, 85, 0.4), 0 0 60px rgba(255, 70, 85, 0.2);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Global Styles */
html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    position: fixed;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    /* Запретить pull-to-refresh */
    overscroll-behavior-y: none;
    touch-action: pan-y;
}

#app {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* ============================================
   HEADER
   ============================================ */

.app-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0, 231, 1, 0.5));
}

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

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 20px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-sm);
}

.balance-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 231, 1, 0.1);
    border-radius: 50%;
    color: var(--accent-primary);
}

.balance-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.balance-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-currency {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.header-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.header-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;
}

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

.deposit-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.deposit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-success);
}

.withdraw-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.withdraw-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-secondary);
}

/* ============================================
   NAVIGATION TABS
   ============================================ */

.nav-tabs {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.nav-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

.nav-tab.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

.nav-tab.active::after {
    width: 60%;
}

.tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.nav-tab.active .tab-icon {
    color: var(--accent-primary);
}

/* ============================================
   GAME CONTAINER
   ============================================ */

.app-content {
    min-height: calc(100vh - 140px);
    padding-top: 0;
    padding-bottom: 70px;
    box-sizing: border-box;
    margin-top: 21px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

.game-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2px 12px 80px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Bet Controls */
.bet-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.bet-control-card {
    padding: 14px;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-md);
    width: 100%;
    box-sizing: border-box;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-md);
}

.control-label svg {
    color: var(--accent-primary);
}

.input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.input-btn {
    min-width: 60px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.input-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

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

.bet-input-wrapper {
    flex: 0 1 auto;
    min-width: 120px;
    max-width: 180px;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 0 12px;
    transition: all var(--transition-fast);
}

.bet-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 231, 1, 0.1);
}

/* Bet input row with MAX button */
.bet-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Compact bet input wrapper */
.bet-input-wrapper-compact {
    flex: 0 1 auto;
    width: 180px;
    max-width: 60%;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 0 12px;
    transition: all var(--transition-fast);
    height: 52px;
}

.bet-input-wrapper-compact:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 231, 1, 0.1);
}

.bet-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    text-align: left;
    outline: none;
    padding: 12px 0;
    width: 100%;
    min-width: 0;
}

.bet-input::-webkit-inner-spin-button,
.bet-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-currency {
    font-size: 16px;
    font-weight: 700;
    margin-left: 8px;
    color: var(--text-secondary);
}

.quick-bet-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.quick-bet-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-bet-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* MAX button next to input */
.max-btn {
    flex: 0 0 auto;
    min-width: 70px;
    height: 52px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 700;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    color: var(--accent-primary);
}

.max-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: scale(1.02);
}

/* Mines Selector */
.mines-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.mines-btn {
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mines-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.mines-mult {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.mines-btn.active {
    background: var(--gradient-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-success);
    transform: scale(1.05);
}

.mines-btn.active .mines-count {
    color: white;
}

.mines-btn:hover:not(.active) {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* Game Stats Banner */
.game-stats-banner {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all var(--transition-normal);
    min-height: 68px;
}

.stat-box.highlight {
    border-color: var(--accent-primary);
    background: rgba(0, 231, 1, 0.05);
}

.stat-icon {
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.stat-value.success {
    color: var(--accent-primary);
}

/* Mines Grid */
.mines-grid-wrapper {
    padding: 12px;
    margin: 0;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.mine-tile {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.mine-tile::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 231, 1, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.mine-tile:hover:not(.revealed):not(.disabled)::before {
    width: 200%;
    height: 200%;
}

.mine-tile:hover:not(.revealed):not(.disabled) {
    transform: scale(1.08) translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-success);
}

.mine-tile:active:not(.revealed):not(.disabled) {
    transform: scale(0.95);
}

.mine-tile.revealed {
    cursor: default;
    animation: revealTile 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mine-tile.revealed.safe {
    background: var(--gradient-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-success);
}

.mine-tile.revealed.mine {
    background: var(--gradient-danger);
    border-color: var(--accent-danger);
    box-shadow: var(--glow-danger);
    animation: explode 0.6s ease-out;
}

.mine-tile.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@keyframes revealTile {
    0% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.15) rotateY(90deg);
        opacity: 0.7;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes explode {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    75% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Game Actions */
.game-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.action-btn {
    width: 100%;
    padding: 18px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    min-height: 56px;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:active::before {
    width: 300px;
    height: 300px;
}

.action-btn.primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow-success);
}

.action-btn.success {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: var(--shadow-lg);
    }
    50% {
        box-shadow: var(--glow-success);
    }
}

.action-btn.success:hover {
    transform: translateY(-3px) scale(1.02);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.action-btn.hidden {
    display: none;
}

.btn-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.btn-text {
    font-size: 20px;
    font-weight: 700;
}

.btn-amount {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 600;
}

/* ============================================
   LIVE TAB
   ============================================ */

.live-container {
    padding: var(--spacing-lg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-danger);
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.live-counter {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.live-feed {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.live-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    animation: slideInRight 0.5s ease;
    transition: all var(--transition-normal);
}

.live-item:hover {
    transform: translateX(4px);
    border-color: var(--accent-primary);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.live-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.live-info {
    flex: 1;
    min-width: 0;
}

.live-user {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

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

.live-amount {
    text-align: right;
    flex-shrink: 0;
}

.live-bet {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.live-multiplier {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-primary);
}

.live-multiplier.lose {
    color: var(--accent-danger);
}

/* ============================================
   PROFILE TAB
   ============================================ */

.profile-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2px 12px 80px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.avatar-icon {
    color: white;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.user-id {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.user-level {
    flex-shrink: 0;
}

.level-badge {
    padding: 8px 16px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-card {
    padding: 14px 10px;
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    text-align: center;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.stat-card.highlight {
    border-color: var(--accent-primary);
    background: rgba(0, 231, 1, 0.05);
}

.stat-card-icon {
    font-size: 28px;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-card-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-card-value.profit {
    color: var(--accent-primary);
}

.stat-card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* History Section */
.history-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

.history-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-primary);
}

.history-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.history-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.history-tab.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.history-tab.active::after {
    transform: scaleX(1);
}

.history-content {
    display: none;
    padding: 12px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.history-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    overflow-x: hidden;
    width: 100%;
}

.history-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-normal);
}

.history-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-game {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-time {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.history-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}

.detail-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-value.win {
    color: var(--accent-primary);
}

.detail-value.lose {
    color: var(--accent-danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.3;
    filter: grayscale(100%);
}

.empty-text {
    font-size: 16px;
    font-weight: 500;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    width: calc(100vw - 24px);
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    max-height: 90vh;
    margin: 0 12px;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-title svg {
    color: var(--accent-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 12px 14px;
    max-height: calc(90vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.modal-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    width: 100%;
    max-width: 100%;
}

.amount-selector {
    margin-bottom: var(--spacing-lg);
}

.amount-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    border-radius: 10px;
    margin-bottom: 12px;
    transition: all var(--transition-fast);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.amount-input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 231, 1, 0.1);
}

.amount-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    outline: none;
    width: 100%;
    min-width: 0;
}

.amount-input::-webkit-inner-spin-button,
.amount-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-currency {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 100%;
}

.quick-amount-btn {
    padding: 10px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
}

.quick-amount-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.payment-methods {
    margin-bottom: var(--spacing-lg);
}

.payment-method-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.payment-method-card.active {
    border-color: var(--accent-primary);
    background: rgba(0, 231, 1, 0.05);
}

.payment-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-info {
    flex: 1;
}

.payment-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

.payment-check {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-box {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: rgba(0, 152, 234, 0.08);
    border: 1px solid rgba(0, 152, 234, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.info-box.warning {
    background: rgba(255, 200, 0, 0.08);
    border-color: rgba(255, 200, 0, 0.3);
}

.info-box svg {
    flex-shrink: 0;
    color: var(--accent-secondary);
}

.info-box.warning svg {
    color: var(--accent-warning);
}

.info-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.info-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

.balance-info-box {
    padding: 16px;
    background: var(--gradient-glow);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.balance-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.balance-info-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
}

.wallet-input {
    margin-bottom: var(--spacing-lg);
}

.wallet-address-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: all var(--transition-fast);
    font-family: 'Courier New', monospace;
    box-sizing: border-box;
    max-width: 100%;
}

.wallet-address-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 231, 1, 0.1);
}

.wallet-help {
    margin-top: var(--spacing-sm);
    font-size: 12px;
    color: var(--text-tertiary);
}

.max-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.max-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.fee-info {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.fee-row:not(:last-child) {
    border-bottom: 1px solid var(--border-primary);
}

.fee-row.total {
    padding-top: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.fee-row.total span:last-child {
    color: var(--accent-primary);
}

.modal-footer {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
}

.modal-btn.secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

.modal-btn.secondary:hover {
    background: var(--bg-card);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.modal-btn.primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-success);
}

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

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: var(--spacing-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 350px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-xl);
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast.success::before {
    background: var(--accent-primary);
}

.toast.error::before {
    background: var(--accent-danger);
}

.toast.info::before {
    background: var(--accent-secondary);
}

.toast.warning::before {
    background: var(--accent-warning);
}

.toast-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(0, 231, 1, 0.15);
    color: var(--accent-primary);
}

.toast.error .toast-icon {
    background: rgba(255, 70, 85, 0.15);
    color: var(--accent-danger);
}

.toast.info .toast-icon {
    background: rgba(0, 152, 234, 0.15);
    color: var(--accent-secondary);
}

.toast.warning .toast-icon {
    background: rgba(255, 200, 0, 0.15);
    color: var(--accent-warning);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.toast-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toast-close svg {
    width: 18px;
    height: 18px;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Bottom Navigation Logo */
.nav-logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0.7);
    transition: all var(--transition-fast);
}

.bottom-nav-btn.active .nav-logo-img {
    filter: brightness(1) drop-shadow(0 0 8px rgba(0, 152, 234, 0.6));
}

.bottom-nav-btn:hover .nav-logo-img {
    filter: brightness(1);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* iPhone SE и очень маленькие экраны */
@media (max-width: 375px) {
    :root {
        --spacing-sm: 6px;
        --spacing-md: 10px;
        --spacing-lg: 12px;
        --radius-md: 8px;
        --radius-lg: 10px;
    }
    
    .mines-grid {
        gap: 6px;
    }
    
    .mine-tile {
        font-size: 24px;
    }
    
    .stats-grid {
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px 8px;
    }
    
    .stat-card-icon {
        font-size: 24px;
    }
    
    .stat-card-value {
        font-size: 16px;
    }
    
    .header-actions {
        flex-direction: row;
        gap: 4px;
    }
    
    .header-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .logo-img {
        height: 28px;
    }
    
    .quick-amounts {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toast-container {
        left: 8px;
        right: 8px;
        max-width: none;
    }
    
    .action-btn {
        padding: 16px 18px;
        min-height: 52px;
    }
    
    .btn-text {
        font-size: 14px;
    }
    
    .mines-selector {
        gap: 6px;
    }
    
    .mines-btn {
        padding: 12px 8px;
    }
    
    .mines-count {
        font-size: 16px;
    }
    
    .game-container,
    .profile-container,
    .fairness-container {
        padding: 10px 8px 75px 8px;
    }
    
    .modal-content {
        width: calc(100vw - 16px);
        margin: 0 8px;
    }
}

/* Старые Android телефоны */
@media (max-width: 360px) {
    .mines-grid {
        gap: 5px;
    }
    
    .mine-tile {
        font-size: 22px;
    }
    
    .game-stats-banner {
        gap: 6px;
    }
    
    .stat-box {
        padding: 6px 4px;
        min-height: 50px;
    }
    
    .stat-icon {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 8px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .balance-row {
        padding: 6px 10px;
    }
    
    .balance-icon {
        width: 16px;
        height: 16px;
    }
}

/* Очень старые устройства */
@media (max-width: 320px) {
    :root {
        --spacing-sm: 4px;
        --spacing-md: 8px;
        --spacing-lg: 10px;
    }
    
    .mines-grid {
        gap: 4px;
    }
    
    .mine-tile {
        font-size: 20px;
    }
    
    .logo-img {
        height: 24px;
    }
    
    .game-container,
    .profile-container,
    .fairness-container {
        padding: 8px 6px 75px 6px;
    }
    
    .stat-box {
        padding: 6px 3px;
        min-height: 55px;
    }
    
    .currency-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Улучшение производительности анимаций */
.action-btn,
.mine-tile,
.bottom-nav-btn,
.mines-btn,
.currency-dropdown,
.modal-content {
    will-change: transform;
}

.mine-tile:hover:not(.revealed):not(.disabled),
.action-btn:hover,
.bottom-nav-btn:hover,
.mines-btn:hover {
    will-change: transform, box-shadow;
}

/* Оптимизация для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .mine-tile:hover:not(.revealed):not(.disabled)::before {
        display: none;
    }
    
    .action-btn::before {
        display: none;
    }
}

/* Предотвращение выделения текста на touch */
.mine-tile,
.action-btn,
.bottom-nav-btn,
.mines-btn,
button {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.blur {
    filter: blur(4px);
    pointer-events: none;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   UPDATED HEADER (Simplified)
   ============================================ */

/* ============================================
   HEADER WITH DROPDOWN
   ============================================ */

.app-header {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 150;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 152, 234, 0.3));
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #0098ea 0%, #00e701 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 152, 234, 0.3);
}

.header-balance {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.balance-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    padding: 8px 14px;
    border-radius: 24px;
    border: 1px solid var(--border-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    min-height: 36px;
}

.balance-row:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
}

.balance-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.balance-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-currency {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
}

.balance-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
}

.balance-row.active .balance-arrow {
    transform: rotate(180deg);
}

/* Currency Dropdown */
.currency-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 8px;
    width: 220px;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 200;
}

.currency-dropdown.active {
    opacity: 1;
    visibility: visible;
}

.currency-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.currency-dropdown-item:hover {
    background: var(--bg-tertiary);
}

.currency-dropdown-item.active {
    background: rgba(0, 152, 234, 0.1);
}

.currency-item-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.currency-item-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.currency-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.currency-item-balance {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
    font-weight: 600;
}

.header-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

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

.header-btn.deposit-btn {
    color: var(--accent-primary);
}

.header-btn.deposit-btn:hover {
    background: rgba(0, 152, 234, 0.1);
    border-color: var(--accent-primary);
}

.header-btn.withdraw-btn {
    color: var(--accent-warning);
}

.header-btn.withdraw-btn:hover {
    background: rgba(255, 200, 0, 0.1);
    border-color: var(--accent-warning);
}

.btn-label {
    display: none;
}

@media (min-width: 400px) {
    .btn-label {
        display: inline;
    }
}

/* ============================================
   BOTTOM NAVIGATION (Instagram style)
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 16px 8px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    /* Safe area для новых iPhone с вырезом */
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 50px;
}

.bottom-nav-btn::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.bottom-nav-btn.active::before {
    width: 50%;
}

.bottom-nav-btn.active {
    color: var(--accent-primary);
}

.bottom-nav-btn .nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-btn .nav-label {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

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

/* ============================================
   CONTENT AREA (with bottom nav spacing)
   ============================================ */

.app-content {
    min-height: calc(100vh - 140px);
    padding-bottom: 80px;
}

/* ============================================
   CURRENCY SELECTOR
   ============================================ */

.currency-selector-wrapper {
    padding: 16px 20px;
}

.currency-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.currency-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.currency-btn.active {
    background: var(--gradient-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

.currency-btn:hover:not(.active) {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

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

.currency-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.currency-btn.active .currency-name {
    color: white;
}

/* ============================================
   FAIRNESS TAB (Simplified)
   ============================================ */

.fairness-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2px 12px 80px 12px;
}

/* Provably Fair Info Card */
.fairness-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 12px;
}

.fairness-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-primary);
}

.fairness-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 10px rgba(0, 152, 234, 0.3));
}

.fairness-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Seeds Display */
.fairness-seeds {
    margin-bottom: 12px;
}

.seed-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-primary);
}

.seed-row:last-child {
    border-bottom: none;
}

.seed-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.seed-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seed-value.copyable {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
}

.seed-value.copyable:hover {
    background: rgba(0, 231, 1, 0.1);
    transform: scale(1.05);
}

.seed-value.copyable:active {
    transform: scale(0.95);
}

/* Copy Seed Button */
.copy-seed-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.copy-seed-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

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

/* Change Seed Button */
.change-seed-btn {
    width: 100%;
    padding: 10px 14px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.change-seed-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
}

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

/* Live Bets Section in Fairness Tab */
.live-section {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ff4655;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.live-counter {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.live-feed {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

/* ============================================
   MODAL CURRENCY & NETWORK SELECTOR
   ============================================ */

.modal-currency-selector {
    margin-bottom: var(--spacing-lg);
}

.currency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.currency-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: 60px;
}

.currency-option.active {
    background: var(--gradient-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

.currency-option:hover:not(.active) {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.currency-option .currency-icon {
    font-size: 28px;
}

.currency-option-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.currency-option .currency-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-secondary);
    white-space: nowrap;
}

.currency-option.active .currency-text {
    color: white;
}

.network-selector {
    margin-bottom: var(--spacing-lg);
}

.network-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.network-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: left;
}

.network-option.active {
    background: rgba(0, 152, 234, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.network-option:hover:not(.active) {
    background: var(--bg-card);
    border-color: var(--accent-primary);
}

.network-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.network-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.3;
}

.wallet-display {
    margin-bottom: var(--spacing-lg);
}

.wallet-address-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
}

.wallet-address {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    line-height: 1.4;
}

.copy-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.copy-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--glow-primary);
}

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

/* ============================================
   RESPONSIVE UPDATES
   ============================================ */

@media (max-width: 400px) {
    .currency-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .currency-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .currency-option {
        padding: 10px 6px;
        min-height: 65px;
    }
    
    .currency-option-icon {
        width: 28px;
        height: 28px;
    }
    
    .currency-option .currency-text {
        font-size: 14px;
        font-weight: 800;
    }
    
    .balance-amount {
        font-size: 13px;
    }
    
    .balance-currency {
        font-size: 10px;
    }
    
    .header-btn {
        padding: 8px 10px;
        font-size: 12px;
        gap: 3px;
    }
    
    .header-btn svg {
        width: 14px;
        height: 14px;
    }
    
    /* Bet input mobile optimization */
    .bet-input-wrapper-compact {
        width: 140px;
        max-width: 55%;
        height: 48px;
        padding: 0 10px;
    }
    
    .bet-input {
        font-size: 18px;
    }
    
    .input-currency {
        font-size: 14px;
    }
    
    .max-btn {
        min-width: 60px;
        height: 48px;
        padding: 0 16px;
        font-size: 14px;
    }
}

/* Fix for bottom nav spacing */
@media (max-width: 500px) {
    .app-content {
        padding-bottom: 75px;
    }
    
    .game-container,
    .profile-container,
    .fairness-container {
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 75px;
    }
}
