* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

h1 {
    text-align: center;
    padding: 30px;
    background: linear-gradient(45deg, #00b894, #00a085);
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0;
}

.input-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px;
    background: #f8f9fa;
}

.player-input {
    text-align: center;
    flex: 1;
}

.player-input h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.player-input input {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.player-input input:focus {
    outline: none;
    border-color: #00b894;
}

.vs-divider {
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    margin: 0 30px;
    background: linear-gradient(45deg, #00b894, #00a085);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#simulateBtn {
    display: block;
    width: 200px;
    margin: 30px auto;
    padding: 15px 30px;
    background: linear-gradient(45deg, #00b894, #00a085);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

#simulateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#simulateBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.results-section {
    padding: 30px;
    display: none;
}

.results-section.show {
    display: block;
}

#matchHeader {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    color: white;
    border-radius: 10px;
}

#coinToss {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 5px solid #00b894;
}

#liveScore {
    margin-bottom: 20px;
}

.set-header {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 30px 0 15px 0;
    color: #1e3c72;
    background: linear-gradient(45deg, #00b894, #00a085);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.game-result {
    padding: 15px;
    margin: 8px 0;
    background: #ffffff;
    border-radius: 8px;
    border-left: 4px solid #00b894;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tiebreak-result {
    background: #fff8dc;
    border-left-color: #ff9500;
    font-weight: bold;
}

.set-final {
    background: #e8f5e8;
    border-left-color: #00b894;
    font-weight: bold;
    font-size: 1.1rem;
}

#finalResults {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(45deg, #00b894, #00a085);
    color: white;
    border-radius: 10px;
    text-align: center;
}

.set-scores {
    margin: 20px 0;
}

.set-score {
    font-size: 1.2rem;
    margin: 10px 0;
    padding: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
}

.winner {
    font-size: 2rem;
    font-weight: bold;
    margin-top: 20px;
}

/* New styles for better game display */
.game-score {
    font-weight: bold;
    color: #1e3c72;
    font-size: 1.1rem;
}

.game-info {
    color: #666;
    font-size: 0.9rem;
}

.server-info {
    background: #f0f8ff;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #1e3c72;
}

.games-container {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.game-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #00b894;
}

.game-row.tiebreak {
    border-left-color: #ff9500;
    background: #fff8dc;
}

.game-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.game-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.game-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex: 1;
}

.game-winner {
    font-weight: bold;
    color: #00b894;
    font-size: 1rem;
    background: rgba(0, 184, 148, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid #00b894;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .input-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .vs-divider {
        margin: 20px 0;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .player-input input {
        max-width: 250px;
    }
}
