:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #475569;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Game Status Section */
.game-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.status-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.status-card h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.status-badge {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
}

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

.status-active {
    background: var(--success-color);
    color: white;
    animation: pulse 2s infinite;
}

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

.timer-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.timer-display.urgent {
    color: var(--danger-color);
    animation: blink 0.5s infinite;
}

.prize-pool {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--success-color);
}

/* Rules Section */
.rules-section {
    margin-bottom: 40px;
}

.rules-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

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

.rule-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.rule-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    line-height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.rule-card h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.rule-card p {
    color: var(--text-secondary);
}

/* Token Info */
.token-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.info-card h3 {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.address-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-container code {
    flex: 1;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--secondary-color);
}

.highlight {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Participants Section */
.participants-section, .winners-section, .history-section {
    margin-bottom: 40px;
}

.participants-section h2, .winners-section h2, .history-section h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.participants-count {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.participants-table {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.table-header, .table-row {
    display: grid;
    grid-template-columns: 80px 1fr 150px 200px;
    padding: 15px;
    gap: 15px;
    align-items: center;
}

.table-header {
    background: var(--bg-secondary);
    font-weight: bold;
    color: var(--text-secondary);
}

.table-row {
    border-bottom: 1px solid var(--border-color);
}

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

.top-participant {
    background: rgba(99, 102, 241, 0.1);
}

.rank {
    font-size: 1.2rem;
}

.chance-bar-container {
    width: 100px;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    margin-right: 10px;
}

.chance-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.3s ease;
}

/* States */
.empty-state, .loading-state, .error-state {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 12px;
}

.error-state {
    color: var(--danger-color);
}

/* Winners */
.winners-list {
    display: grid;
    gap: 15px;
}

.winner-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.winner-badge {
    font-size: 2rem;
}

.winner-details {
    flex: 1;
}

.winner-round {
    font-weight: bold;
    margin-bottom: 5px;
}

.winner-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* History */
.round-history {
    display: grid;
    gap: 15px;
}

.history-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.history-id {
    font-weight: bold;
}

.history-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.status-completed {
    background: var(--success-color);
}

.history-details {
    display: grid;
    gap: 8px;
}

.history-detail {
    display: flex;
    justify-content: space-between;
}

.label {
    color: var(--text-secondary);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 20px;
    color: var(--text-secondary);
}

.network-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.network-status.connected {
    background: var(--success-color);
    color: white;
}

.network-status.disconnected {
    background: var(--danger-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .table-header, .table-row {
        grid-template-columns: 60px 1fr;
        font-size: 0.9rem;
    }

    .table-header div:nth-child(3),
    .table-header div:nth-child(4),
    .table-row div:nth-child(3),
    .table-row div:nth-child(4) {
        display: none;
    }
}
