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

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-tertiary: #2d2d2d;
    --rust-orange: #CD412B;
    --rust-orange-dark: #a3351f;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --green: #4CAF50;
    --red: #f44336;
    --yellow: #FFD700;
    --black-bet: #333333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--rust-orange);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--rust-orange);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: var(--rust-orange);
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    padding: 15px 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--rust-orange);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--rust-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Pages */
.page {
    display: none;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

/* Servers Header */
.servers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.servers-header h1 {
    color: var(--rust-orange);
    font-size: 28px;
}

.servers-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
}

.servers-stats strong {
    color: var(--rust-orange);
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--rust-orange);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: var(--rust-orange-dark);
    transform: scale(1.05);
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: var(--rust-orange);
}

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

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* Filters */
.filters-container {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.filters-container h2 {
    margin-bottom: 20px;
    color: var(--rust-orange);
}

.filter-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--text-secondary);
    background: transparent;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: var(--rust-orange);
    color: var(--rust-orange);
}

.filter-btn.active {
    background: var(--rust-orange);
    border-color: var(--rust-orange);
    color: white;
}

.range-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-filter input[type="range"] {
    width: 80px;
    accent-color: var(--rust-orange);
}

.reset-btn {
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--rust-orange);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.reset-btn:hover {
    background: var(--rust-orange-dark);
}

/* Servers Table */
.servers-table-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
}

.servers-table th,
.servers-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--bg-tertiary);
}

.servers-table th {
    background: var(--bg-tertiary);
    color: var(--rust-orange);
    font-weight: 600;
}

.servers-table tr:hover {
    background: var(--bg-tertiary);
}

.connect-btn {
    padding: 8px 16px;
    background: var(--green);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.connect-btn:hover {
    opacity: 0.8;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* Rate Badges */
.rate-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.rate-x1 { background: #3498db; }
.rate-x2 { background: #2ecc71; }
.rate-x3 { background: #f39c12; }
.rate-x5 { background: #e74c3c; }
.rate-x10 { background: #9b59b6; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 44px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--rust-orange);
    color: var(--rust-orange);
}

.page-btn.active {
    background: var(--rust-orange);
    border-color: var(--rust-orange);
    color: white;
}

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

.page-dots {
    color: var(--text-secondary);
    padding: 0 5px;
}

/* Wheel Page */
.wheel-container {
    text-align: center;
}

.wheel-container h2 {
    color: var(--rust-orange);
    margin-bottom: 20px;
}

.wheel-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.wheel-info > div {
    background: var(--bg-secondary);
    padding: 15px 30px;
    border-radius: 8px;
}

.wheel-game {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.wheel-wrapper {
    position: relative;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--rust-orange);
    z-index: 10;
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(205, 65, 43, 0.3);
}

.betting-panel {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    min-width: 300px;
    text-align: left;
}

.betting-panel h3 {
    margin-bottom: 20px;
    color: var(--rust-orange);
}

.bet-colors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

/* Rust Wheel Bets */
.rust-bet-colors {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.rust-bet {
    padding: 12px 8px;
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    transition: all 0.2s;
}

.rust-bet:hover { transform: scale(1.05); }
.rust-bet.selected { border-color: white; box-shadow: 0 0 10px rgba(255,255,255,0.5); }

.rust-bet.num1 { background: #E8D44D; color: #222; }
.rust-bet.num3 { background: #4A90D9; color: #fff; }
.rust-bet.num5 { background: #9B59B6; color: #fff; }
.rust-bet.num10 { background: #27AE60; color: #fff; }
.rust-bet.num20 { background: #E67E22; color: #fff; }

.bet-num { font-size: 24px; }
.bet-mult { font-size: 12px; opacity: 0.8; }

.place-bet-btn {
    width: 100%;
    padding: 12px;
    background: #CD412B;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background 0.3s;
}

.place-bet-btn:hover { background: #a3351f; }

/* Ad Containers */
.ad-container {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.ad-top { margin-top: 10px; }
.ad-bottom { margin-bottom: 20px; }
.ad-side { margin-top: 20px; }

.bet-amount {
    margin-bottom: 15px;
}

.bet-amount label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.bet-amount input {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-secondary);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    margin-bottom: 10px;
}

.quick-bets {
    display: flex;
    gap: 10px;
}

.quick-bets button {
    flex: 1;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-secondary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-bets button:hover {
    border-color: var(--rust-orange);
    color: var(--rust-orange);
}

.current-bets {
    border-top: 1px solid var(--bg-tertiary);
    padding-top: 15px;
}

.current-bets h4 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

#my-bets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-bet-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.wheel-history {
    margin-top: 30px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
}

.wheel-history h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

#wheel-history-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.history-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* Mines Page */
.mines-container {
    max-width: 800px;
    margin: 0 auto;
}

.mines-container h2 {
    color: var(--rust-orange);
    text-align: center;
    margin-bottom: 30px;
}

.mines-game {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
}

.mines-settings {
    margin-bottom: 30px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.setting-group input[type="number"] {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-secondary);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    width: 150px;
    margin-right: 15px;
}

.mines-count-btns {
    display: flex;
    gap: 10px;
}

.mines-count-btns button {
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-secondary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.mines-count-btns button:hover,
.mines-count-btns button.active {
    background: var(--rust-orange);
    border-color: var(--rust-orange);
}

.start-btn {
    width: 100%;
    padding: 15px;
    background: var(--green);
    border: none;
    color: white;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.start-btn:hover {
    opacity: 0.9;
}

.mines-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.mine-cell {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
}

.mine-cell:hover:not(.revealed) {
    border-color: var(--rust-orange);
    transform: scale(1.05);
}

.mine-cell.revealed.safe {
    background: var(--green);
    border-color: var(--green);
}

.mine-cell.revealed.mine {
    background: var(--red);
    border-color: var(--red);
}

.mines-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--bg-tertiary);
}

.current-mult, .potential-win {
    font-size: 18px;
}

.current-mult span, .potential-win span {
    color: var(--green);
    font-weight: bold;
}

.cashout-btn {
    padding: 15px 40px;
    background: var(--yellow);
    border: none;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.cashout-btn:not(:disabled):hover {
    transform: scale(1.05);
}

/* Crash Page */
.crash-container {
    max-width: 900px;
    margin: 0 auto;
}

.crash-container h2 {
    color: var(--rust-orange);
    text-align: center;
    margin-bottom: 30px;
}

.crash-game {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
}

.crash-display {
    position: relative;
    background: linear-gradient(180deg, #1a2a3a 0%, #0d1520 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

#crash-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.crash-multiplier {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
}

.crash-multiplier.crashed {
    color: var(--red);
}

.crash-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 14px;
}

.crash-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.crash-controls .bet-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crash-controls input[type="number"] {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-secondary);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    width: 100px;
}

.auto-cashout {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-cashout input[type="number"] {
    width: 70px;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-secondary);
    border-radius: 6px;
    color: white;
}

.bet-btn {
    padding: 15px 40px;
    background: var(--green);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.bet-btn:not(:disabled):hover {
    transform: scale(1.05);
}

.crash-history {
    padding-top: 20px;
}

.crash-history h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

#crash-history-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.crash-history-item {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
}

.crash-history-item.low {
    background: var(--red);
}

.crash-history-item.medium {
    background: var(--rust-orange);
}

.crash-history-item.high {
    background: var(--green);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .wheel-game {
        flex-direction: column;
        align-items: center;
    }
    
    .crash-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .crash-multiplier {
        font-size: 48px;
    }
}
