* {
    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;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Header Logo Styles */
.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.header-content {
    flex: 0 1 auto;
    min-width: 300px;
}

.header-logo {
    height: 60px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.header-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.header-logo.left {
    order: 1;
}

.header-content {
    order: 2;
}

.header-logo.right {
    order: 3;
}

.hidden {
    display: none !important;
}

/* Loading Styles */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Setup Styles */
.setup {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.setup-content {
    background: rgba(255,255,255,0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 500px;
}

.setup-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
}

.setup-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #666;
}

/* Button Styles */
.btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Game Area Styles */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.progress-bar {
    background: rgba(255,255,255,0.2);
    height: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.image-battle {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin-bottom: 20px;
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
    cursor: pointer;
}

.image-container:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
}

.battle-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    background: #f8f9fa;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.image-container.disabled {
    pointer-events: none;
}

.image-container.winner {
    animation: sparkle 1s ease-in-out;
    border: 3px solid #4CAF50;
}

.image-container.loser {
    animation: fadeOut 1s ease-in-out;
    position: relative;
}

.image-container.loser::after {
    content: '✖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #ff4444;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    z-index: 20;
    animation: crossFade 0.5s ease-in-out;
}

@keyframes sparkle {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }
    25% { 
        transform: scale(1.05); 
        box-shadow: 0 0 20px #4CAF50, 0 0 40px #4CAF50;
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 0 0 30px #4CAF50, 0 0 60px #4CAF50;
    }
    75% { 
        transform: scale(1.05); 
        box-shadow: 0 0 20px #4CAF50, 0 0 40px #4CAF50;
    }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 0.5; }
    100% { opacity: 0.3; }
}

@keyframes crossFade {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1);
    }
}

.choose-btn {
    padding: 15px 25px;
    background: white;
    color: #333;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.choose-btn:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.vs-divider {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin: 10px 0;
    z-index: 10;
}

.feedback {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Complete/Error Styles */
.complete, .error {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.complete-content, .error-content {
    background: rgba(255,255,255,0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 500px;
}

.complete-content h2, .error-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.complete-content p, .error-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #666;
}

.complete-content button, .error-content button {
    margin: 5px;
}

/* Leaderboard Styles */
.leaderboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.leaderboard-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.leaderboard-list {
    margin-bottom: 20px;
}

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

.leaderboard-item:first-child {
    border-left-color: #ffd700;
    background: #fff9c4;
}

.leaderboard-item:nth-child(2) {
    border-left-color: #c0c0c0;
    background: #f5f5f5;
}

.leaderboard-item:nth-child(3) {
    border-left-color: #cd7f32;
    background: #faebd7;
}

.leaderboard-rank {
    font-weight: bold;
    margin-right: 10px;
    color: #666;
}

.leaderboard-image {
    flex: 1;
    margin: 0 10px;
    word-break: break-all;
}

.leaderboard-score {
    font-weight: bold;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .header-logos {
        gap: 20px;
        max-width: 600px;
    }
    
    .header-logo {
        height: 50px;
        max-width: 100px;
    }
    
    .header-content {
        min-width: 250px;
    }
    
    .image-battle {
        gap: 15px;
    }
    
    .vs-divider {
        margin: 5px 0;
    }
    
    .battle-image {
        max-height: 300px;
    }
    
    .image-container {
        max-width: 100%;
    }
    
    .setup-content, .complete-content, .error-content {
        padding: 25px;
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .header-logos {
        gap: 15px;
        flex-direction: column;
        max-width: 400px;
    }
    
    .header-logo {
        height: 40px;
        max-width: 80px;
    }
    
    .header-content {
        min-width: 200px;
        order: 1;
    }
    
    .header-logo.left {
        order: 2;
    }
    
    .header-logo.right {
        order: 3;
    }
    
    .battle-image {
        max-height: 250px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .choose-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
} 