body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f0f2f5;
    color: #1c1e21;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

#game-container {
    width: 100%;
    max-width: 1400px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.screen {
    display: none;
    padding: 20px 40px;
    animation: fadeIn 0.5s ease-in-out;
}

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

.screen.active {
    display: block;
}

button {
    background-color: #1877f2;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #166fe5;
}

button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* Setup Screen */
#setup-screen {
    text-align: center;
    padding: 40px;
}

#setup-screen h1 {
    font-size: 3em;
    color: #1877f2;
    margin-bottom: 10px;
}

.form-group {
    margin: 25px 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 1.1em;
}

input[type="text"], select {
    padding: 12px;
    width: 300px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 1em;
}

/* Main Screen */
header {
    background-color: #1877f2;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    margin: -20px -40px 20px -40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 2em;
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.panel {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.panel h2 {
    margin-top: 0;
    color: #1877f2;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.panel p {
    font-size: 1.1em;
    line-height: 1.6;
}

#league-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#league-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

#league-table th, #league-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
}

#league-table th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
}

#league-table tr:last-child td {
    border-bottom: none;
}

#league-table tr.player-team {
    font-weight: bold;
    background-color: #e7f3ff;
}

#season-results {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.result-item {
    padding: 5px;
    border-bottom: 1px solid #eee;
}
.result-item:last-child {
    border-bottom: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

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

#match-result-score {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

#match-events {
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
}

#transfer-offers .offer {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

