/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0a0e27;
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-connect {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-connect:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.wallet-address, .balance {
    font-size: 0.9rem;
    color: #a0aec0;
}

/* Game Container */
.game-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Crash Display */
.crash-display {
    background: #1a1f3a;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#crashChart {
    width: 100% !important;
    height: 400px !important;
    margin-bottom: 20px;
}

.multiplier-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    pointer-events: none;
}

.multiplier-display.crashed {
    color: #f56565;
    animation: pulse 0.5s ease;
}

.multiplier-display.cashed-out {
    color: #48bb78;
}

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

.game-status {
    text-align: center;
    font-size: 1.1rem;
    color: #a0aec0;
    margin-top: 10px;
}

/* Betting Panel */
.betting-panel {
    background: #1a1f3a;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.bet-controls {
    margin-bottom: 20px;
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #a0aec0;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.quick-amounts, .quick-multipliers {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.quick-btn {
    flex: 1;
    padding: 6px 10px;
    background: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #a0aec0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.btn-primary, .btn-cash-out {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-cash-out {
    background: #48bb78;
    color: white;
}

.btn-cash-out:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-primary:disabled, .btn-cash-out:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bet-info {
    padding: 15px;
    background: #2d3748;
    border-radius: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item span:first-child {
    color: #a0aec0;
}

.info-item span:last-child {
    font-weight: 600;
}

/* Provably Fair Section */
.provably-fair-section {
    background: #1a1f3a;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.provably-fair-section h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.seeds-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.seed-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seed-group label {
    font-weight: 600;
    color: #a0aec0;
    font-size: 0.9rem;
}

.seed-input {
    padding: 12px;
    background: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.btn-secondary {
    padding: 8px 16px;
    background: #4a5568;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #5a67d8;
}

.verify-section {
    margin-top: 20px;
    padding: 20px;
    background: #2d3748;
    border-radius: 8px;
}

.verify-content p {
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Bottom Panels */
.bottom-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.players-panel, .history-panel {
    background: #1a1f3a;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.players-panel h3, .history-panel h3 {
    margin-bottom: 15px;
    color: #e2e8f0;
}

.players-list, .history-list {
    max-height: 300px;
    overflow-y: auto;
}

.player-item, .history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #2d3748;
    border-radius: 8px;
    margin-bottom: 8px;
}

.player-item.cashed-out {
    border-left: 3px solid #48bb78;
}

.player-item.crashed {
    border-left: 3px solid #f56565;
    opacity: 0.7;
}

.history-item {
    cursor: pointer;
    transition: background 0.2s ease;
}

.history-item:hover {
    background: #3a4356;
}

.crash-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.crash-value.high {
    color: #48bb78;
}

.crash-value.medium {
    color: #ecc94b;
}

.crash-value.low {
    color: #f56565;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1f3a;
    padding: 30px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #a0aec0;
}

.close:hover {
    color: white;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.verify-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.verify-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 10px;
}

.verify-row label {
    font-weight: 600;
    color: #a0aec0;
    font-size: 0.9rem;
}

.verify-row input {
    padding: 10px;
    background: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.verify-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.verify-status.success {
    background: rgba(72, 187, 120, 0.2);
    color: #48bb78;
}

.verify-status.error {
    background: rgba(245, 101, 101, 0.2);
    color: #f56565;
}

/* Responsive */
@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 1fr;
    }

    .bottom-panels {
        grid-template-columns: 1fr;
    }

    .seeds-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }

    .wallet-info {
        flex-direction: column;
        width: 100%;
    }

    .btn-connect {
        width: 100%;
    }

    .multiplier-display {
        font-size: 3rem;
    }
}
