* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #27ae60;
    display: block;
}

.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.grid-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #ecf0f1;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.grid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.grid-item-number {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.grid-item-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grid-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.grid-item-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.85rem;
    min-width: 80px;
}

.grid-item-value {
    text-align: right;
    flex: 1;
}

.grid-username {
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.grid-bank {
    font-weight: 500;
    color: #34495e;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.grid-game {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin: 5px 0;
}

.grid-amount {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.1rem;
    text-align: center;
    padding: 8px;
    background: #d5f4e6;
    border-radius: 8px;
    margin: 5px 0;
}

.grid-proof {
    text-align: center;
    margin: 10px 0;
}

.grid-proof-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    text-decoration: none;
    display: inline-block;
}

.grid-proof-btn:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.grid-time {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

/* Hide table view */
table {
    display: none;
}

/* Responsive grid */
@media (max-width: 768px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        padding: 5px 0;
    }
    
    .grid-item {
        padding: 15px;
    }
    
    .grid-item-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .grid-item-content {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .grid-view {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0;
    }
    
    .grid-item {
        padding: 12px;
    }
    
    .grid-amount {
        font-size: 1rem;
    }
    
    .grid-game {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

.last-update {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.last-update p {
    margin: 5px 0;
    color: #7f8c8d;
}

.last-update span {
    font-weight: 600;
    color: #2c3e50;
}

footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .table-container {
        padding: 15px;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    .game {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    .amount {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 6px 4px;
    }
}

/* Animation for new data */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-row {
    animation: fadeIn 0.5s ease-in;
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
