* {
    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;
    color: #333;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

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

.match-info {
    font-size: 1.2em;
    margin-top: 10px;
}

.team-name {
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 5px;
}

.team-name.chelsea {
    background: #034694;
    color: white;
}

.team-name.manutd {
    background: #DA291C;
    color: white;
}

.vs {
    margin: 0 15px;
    font-weight: bold;
}

.game-wrapper {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.sidebar {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

#game-canvas {
    border: 3px solid #2c3e50;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: #2ecc71;
}

.game-info,
.controls,
.instructions,
.selected-player-info,
.action-buttons,
.legend {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-info h2,
.instructions h3,
.selected-player-info h3,
.action-buttons h3,
.legend h3,
.controls h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.team-score {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    flex: 1;
    margin: 0 5px;
}

.chelsea-score {
    background: #034694;
    color: white;
}

.manutd-score {
    background: #DA291C;
    color: white;
}

.team-label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.score {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
}

.turn-info p,
.ball-info p {
    margin: 8px 0;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.instructions li:last-child {
    border-bottom: none;
}

.btn {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-action {
    background: #2ecc71;
    color: white;
}

.btn-action:hover:not(:disabled) {
    background: #27ae60;
}

.btn-action:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-cancel {
    background: #e74c3c;
    color: white;
}

.btn-cancel:hover {
    background: #c0392b;
}

#player-details {
    background: white;
    padding: 15px;
    border-radius: 6px;
    min-height: 150px;
}

.no-selection {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.player-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.player-stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: bold;
    color: #2c3e50;
}

.stat-value {
    color: #3498db;
    font-weight: bold;
}

.legend {
    margin-top: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.legend-item:last-child {
    border-bottom: none;
}

.legend-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9em;
}

.legend-icon.chelsea-player {
    background: #034694;
    color: white;
}

.legend-icon.manutd-player {
    background: #DA291C;
    color: white;
}

.legend-icon.ball {
    font-size: 1.2em;
}

.legend-box {
    width: 30px;
    height: 30px;
    border-radius: 4px;
}

.legend-box.valid-move {
    background: rgba(46, 204, 113, 0.3);
    border: 2px solid #2ecc71;
}

.legend-box.selected {
    background: rgba(241, 196, 15, 0.3);
    border: 2px solid #f39c12;
}

footer {
    background: #ecf0f1;
    padding: 20px 30px;
    border-top: 2px solid #bdc3c7;
}

.game-log h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

#log-messages {
    background: white;
    padding: 15px;
    border-radius: 6px;
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid #ecf0f1;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.goal {
    color: #e74c3c;
    font-weight: bold;
}

.log-entry.tackle {
    color: #e67e22;
}

.log-entry.pass {
    color: #3498db;
}

.log-entry.move {
    color: #95a5a6;
}

@media (max-width: 1400px) {
    .game-wrapper {
        flex-direction: column;
    }

    .sidebar {
        flex: 1;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar > div {
        flex: 1;
        min-width: 250px;
    }
}
