body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
}

h1 {
    text-align: center;
    color: #fff;
    margin-bottom: 1rem;
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.project-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.project-description {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.game-container {
    background: linear-gradient(135deg, #2c5364 0%, #203a43 100%);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 100px rgba(44, 83, 100, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Setup Panel */
.setup-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.strategy-selection {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

.player-setup, .bot-setup {
    flex: 1;
}

.player-setup h3, .bot-setup h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

select:hover {
    border-color: #667eea;
}

.game-settings {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.game-settings label {
    color: #333;
    font-weight: 500;
}

#numRounds {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: #f44336;
    color: white;
}

.btn-secondary:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

/* Game Arena */
.game-arena {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.players-area {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 2rem;
}

.player {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.player.choosing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.player-avatar {
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.player h3 {
    color: #333;
    margin: 0.5rem 0;
}

.choice-display {
    min-height: 40px;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.5s;
}

.choice-display.cooperate {
    background: #4CAF50;
    color: white;
    animation: cooperateAnimation 0.5s;
}

.choice-display.defect {
    background: #f44336;
    color: white;
    animation: defectAnimation 0.5s;
}

@keyframes cooperateAnimation {
    0% { transform: scale(0) rotate(0); opacity: 0; }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

@keyframes defectAnimation {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2) translateX(-10px); }
    75% { transform: scale(1.2) translateX(10px); }
    100% { transform: scale(1) translateX(0); opacity: 1; }
}

.score {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.versus {
    font-size: 2rem;
    font-weight: bold;
    color: #764ba2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Choice Buttons */
.choice-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.choice-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.choice-btn.cooperate {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

.choice-btn.cooperate:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.4);
}

.choice-btn.defect {
    background: linear-gradient(135deg, #f44336, #ff6b6b);
    color: white;
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.3);
}

.choice-btn.defect:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(244, 67, 54, 0.4);
}

.choice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Round Info */
.round-info {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(145deg, #f5f5f5, #ffffff);
    border-radius: 10px;
    margin-top: 1rem;
}

.round-counter {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.round-result {
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 30px;
    color: #667eea;
}

/* Game History */
.game-history {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.game-history h3 {
    color: #333;
    margin-bottom: 1rem;
}

.history-grid {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 10px;
    min-height: 60px;
}

.history-round {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.history-round:hover {
    transform: scale(1.1);
    z-index: 10;
}

.history-round.both-cooperate {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
}

.history-round.player-defect {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.history-round.bot-defect {
    background: linear-gradient(135deg, #9c27b0, #ba68c8);
}

.history-round.both-defect {
    background: linear-gradient(135deg, #f44336, #ef5350);
}

.history-round .round-num {
    font-size: 0.6rem;
    opacity: 0.8;
}

/* Payoff Matrix */
.info-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.payoff-matrix, .strategy-descriptions {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
}

.payoff-matrix h3, .strategy-descriptions h3 {
    color: #333;
    margin-bottom: 1rem;
}

.payoff-matrix table {
    width: 100%;
    border-collapse: collapse;
}

.payoff-matrix th, .payoff-matrix td {
    padding: 0.75rem;
    text-align: center;
    border: 2px solid #ddd;
}

.payoff-matrix th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.payoff-matrix td {
    font-weight: 500;
}

.both-cooperate {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
}

.sucker {
    background: rgba(156, 39, 176, 0.2);
    color: #6a1b9a;
}

.temptation {
    background: rgba(255, 152, 0, 0.2);
    color: #e65100;
}

.both-defect {
    background: rgba(244, 67, 54, 0.2);
    color: #c62828;
}

.strategy-info p {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 5px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.strategy-info strong {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .strategy-selection {
        flex-direction: column;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
    
    .players-area {
        flex-direction: column;
        gap: 2rem;
    }
    
    .versus {
        transform: rotate(90deg);
        margin: 1rem 0;
    }
}