/* Global Styles */
* {
    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;
    overflow-x: hidden;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    background: #f5f7fa;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header */
.header {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-icon {
    font-size: 20px;
    cursor: pointer;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.coins {
    background: #28a745;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.profile {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 3px solid #ffd700;
}

/* Running Match Header */
.running-match-header {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    margin: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
}

/* Matches Container */
.matches-container {
    padding: 0 15px 100px 15px;
}

/* Match Cards */
.match-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #28a745;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Match Info */
.match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.players-count {
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

.match-details {
    font-size: 12px;
    color: #888;
    font-weight: bold;
    text-align: center;
    flex-grow: 1;
}

.quick-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Match Content */
.match-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
}

.match-content-large {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Prize Section */
.prize-section {
    flex: 1;
}

.prize-label {
    font-size: 10px;
    color: #888;
    font-weight: bold;
    margin-bottom: 5px;
}

.prize-amount {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* Timer Section */
.timer-section {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

/* Entry Section */
.entry-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.entry-label {
    font-size: 10px;
    color: #888;
    font-weight: bold;
    margin-bottom: 5px;
}

.join-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 70px;
}

.join-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.join-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Large Match Info */
.large-match-info h3 {
    font-size: 16px;
    margin: 0;
    color: #333;
}

.large-match-info p {
    font-size: 12px;
    color: #888;
    margin: 0;
}

/* Status Messages */
.status-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: bold;
    z-index: 1000;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 300px;
    padding: 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top: 4px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #28a745;
}

.loading-content p {
    font-size: 14px;
    color: #ccc;
    line-height: 1.4;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 400px;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item.active .nav-icon {
    background: #6f42c1;
    color: white;
}

.nav-item.active .nav-label {
    color: #6f42c1;
    font-weight: bold;
}

.nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #f8f9fa;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

.nav-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Game Page Styles */
.game-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.scores {
    display: flex;
    gap: 20px;
}

.score-box {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
}

.timer-display {
    background: #ff4757;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
}

.question-container {
    background: white;
    color: #333;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.question-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.4;
}

.options-container {
    display: grid;
    gap: 15px;
}

.option-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover {
    border-color: #6f42c1;
    transform: translateY(-2px);
}

.option-btn.correct {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.option-btn.wrong {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.option-btn:disabled {
    cursor: not-allowed;
}

/* Result Screen */
.result-screen {
    text-align: center;
    padding: 50px 20px;
}

.result-title {
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: bold;
}

.winner {
    color: #28a745;
}

.loser {
    color: #dc3545;
}

.draw {
    color: #ffc107;
}

.final-scores {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
}

.score-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 18px;
}

.play-again-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-again-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .match-content {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .timer-section {
        justify-content: center;
    }
    
    .entry-section {
        align-items: stretch;
    }
    
    .join-btn {
        width: 100%;
    }
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.match-card {
    animation: fadeIn 0.5s ease forwards;
}

.status-message {
    animation: slideIn 0.3s ease forwards;
}

/* Loading animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-content h2 {
    animation: pulse 1.5s ease-in-out infinite;
}