* {
    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;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.players-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin-bottom: 40px;
    align-items: center;
}

.player-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.player-card.player1 {
    border-top: 5px solid #4CAF50;
}

.player-card.player2 {
    border-top: 5px solid #2196F3;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f0f0f0;
    display: none;
}

.avatar.visible {
    display: block;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    border: 4px solid #f0f0f0;
}

.avatar-placeholder.hidden {
    display: none;
}

.player-card h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

.score-display {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-value {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

.win-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.win-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.win-button:active {
    transform: scale(0.95);
}

.vs-divider {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

.stats-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeInUp 0.8s ease-out;
}

.stats-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.win-rate-bar {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.win-rate-fill {
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.player1-bar {
    background: linear-gradient(90deg, #4CAF50, #45a049);
}

.player2-bar {
    background: linear-gradient(90deg, #2196F3, #1976D2);
}

.win-rate-labels {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #666;
}

.chart-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.chart-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.history-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeInUp 1.2s ease-out;
}

.history-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.game-history {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    animation: slideInRight 0.3s ease-out;
}

.history-item.player1-win {
    border-left-color: #4CAF50;
}

.history-item.player2-win {
    border-left-color: #2196F3;
}

.history-winner {
    font-weight: bold;
    color: #333;
}

.history-time {
    font-size: 0.9rem;
    color: #666;
}

.settings-section {
    text-align: center;
    margin-bottom: 40px;
}

.settings-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.settings-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.settings-panel {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 0.3s ease-out;
}

.settings-panel.hidden {
    display: none;
}

.settings-panel h3 {
    margin-bottom: 20px;
    color: #333;
}

.setting-group {
    margin-bottom: 20px;
    text-align: left;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.setting-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setting-group input:focus {
    outline: none;
    border-color: #667eea;
}

.save-button, .reset-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.save-button:hover, .reset-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.reset-button {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.reset-button:hover {
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.6);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    font-weight: bold;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.notification.hidden {
    display: none;
}

.notification.success {
    border-left: 5px solid #4CAF50;
}

.notification.error {
    border-left: 5px solid #f44336;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .players-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .vs-divider {
        transform: rotate(90deg);
    }

    header h1 {
        font-size: 2rem;
    }

    .player-card h2 {
        font-size: 1.5rem;
    }

    .score-value {
        font-size: 2.5rem;
    }
}

