/* PeakeCoin Betting Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d3748;
    --secondary-color: #4a5568;
    --accent-color: #3182ce;
    --success-color: #38a169;
    --danger-color: #e53e3e;
    --warning-color: #d69e2e;
    --background-color: #f7fafc;
    --card-background: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.keychain-status {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-keychain-btn,
.debug-keychain-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: white;
    transition: background 0.2s;
}

.refresh-keychain-btn:hover,
.debug-keychain-btn:hover,
.test-keychain-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.test-keychain-btn {
    background: rgba(56, 161, 105, 0.7);
    border: none;
    border-radius: 4px;
    margin-left: 0.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: white;
    transition: background 0.2s;
}

.keychain-label {
    opacity: 0.9;
}

.keychain-status-text {
    font-weight: 500;
    margin-left: 0.5rem;
}

.keychain-status.connected .keychain-status-text {
    color: #68d391;
}

.keychain-status.disconnected .keychain-status-text {
    color: #fed7d7;
}

.balance-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.balance-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.balance-amount {
    font-weight: 600;
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

.username-input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    min-width: 200px;
}

.connect-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.connect-btn:hover {
    background: #2c5aa0;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

.connection-status {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.connection-status.hidden {
    display: none;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
}

.game-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.game-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.bet-input-group {
    margin-bottom: 1rem;
}

.bet-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.bet-input-group input,
.bet-input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.bet-input-group input:focus,
.bet-input-group select:focus {
    border-color: var(--accent-color);
}

.choice-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.choice-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.choice-btn:hover {
    border-color: var(--accent-color);
    background: #f0f8ff;
}

.choice-btn.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.place-bet-btn {
    width: 100%;
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.875rem;
}

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

.place-bet-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

/* Lottery specific styles */
.lottery-info {
    background: #f0f8ff;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.lottery-info p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

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

/* Betting History */
.betting-history {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.betting-history h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-item:last-child {
    border-bottom: none;
}

.bet-info {
    flex: 1;
}

.bet-type {
    font-weight: 600;
    color: var(--primary-color);
}

.bet-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.bet-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.bet-status.active {
    background: var(--warning-color);
    color: white;
}

.bet-status.won {
    background: var(--success-color);
    color: white;
}

.bet-status.lost {
    background: var(--danger-color);
    color: white;
}

.no-bets {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer p {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
        width: 100%;
    }
    
    .username-input {
        min-width: auto;
        flex: 1;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}