* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f4f4;
    color: #171717;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

header {
    background: #111;
    color: white;
    padding: 20px;
}

.header-inner {
    max-width: 900px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.season {
    font-size: 11px;
    letter-spacing: 2px;
    opacity: .65;
}

h1 {
    margin: 4px 0 0;
    font-size: 26px;
}

main {
    max-width: 900px;
    margin: auto;
    padding: 25px 15px 60px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 5px 25px rgba(0,0,0,.06);
}

.login-card {
    max-width: 420px;
    margin: 40px auto;
}

h2 {
    margin-top: 0;
}

p {
    color: #666;
}

label {
    display: block;
    font-weight: 600;
    margin-top: 18px;
}

select,
input {
    width: 100%;
    padding: 13px;
    margin-top: 7px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: white;
    font-size: 16px;
}

button {
    font-family: inherit;
    cursor: pointer;
}

button:disabled {
    cursor: default;
    opacity: .8;
}

.primary {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.secondary {
    padding: 10px 14px;
    border: 0;
    border-radius: 9px;
    background: #eee;
    color: #111;
    font-weight: 600;
}

.text-button {
    display: block;
    margin: 16px auto 0;
    border: 0;
    background: none;
    text-decoration: underline;
    color: #555;
}

.hidden {
    display: none !important;
}

.welcome {
    margin: 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gameweek-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 7px;
    margin-bottom: 12px;
}

.gameweek-tab {
    padding: 11px 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 9px;
    font-weight: 600;
}

.gameweek-tab.active {
    background: #111;
    color: white;
    border-color: #111;
}

.gameweek-tab.revealed {
    border-color: #888;
}

.player-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.fixture {
    display: grid;
    grid-template-columns: 35px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.fixture:last-child {
    border-bottom: none;
}

.fixture-number {
    color: #999;
    font-weight: 700;
}

.teams {
    line-height: 1.6;
}

.pick-buttons {
    display: flex;
    gap: 6px;
}

.pick-buttons button {
    padding: 9px 11px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 8px;
    font-weight: 700;
}

.pick-buttons button.selected {
    background: #111;
    color: white;
    border-color: #111;
}

.lock-button {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    background: #111;
    color: white;
    border: 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
}

.status-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 7px;
    margin: 15px 0;
}

.status {
    padding: 10px;
    background: #f1f1f1;
    border-radius: 9px;
    font-size: 14px;
}

.notice {
    padding: 12px;
    border-radius: 9px;
    background: #f1f1f1;
    margin: 12px 0;
}

.deadline-box {
    padding: 12px;
    border-radius: 9px;
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    margin: 12px 0;
}

.admin-section {
    margin-bottom: 20px;
}

.admin-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-row select,
.admin-row input {
    width: auto;
    margin-top: 0;
}

.result-input {
    width: 60px !important;
}

.admin-button {
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #111;
    color: white;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

#loginMessage,
#messageBox {
    margin-top: 12px;
    color: #a00;
}

#messageBox {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: #111;
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    display: none;
    max-width: 90%;
    z-index: 1000;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 900;
}

.leaderboard-modal {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    padding: 25px;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    border: 0;
    background: none;
    font-size: 30px;
    line-height: 1;
    color: #555;
}

@media (max-width: 600px) {

    main {
        padding-top: 15px;
    }

    .fixture {
        grid-template-columns: 25px 1fr;
    }

    .pick-buttons {
        grid-column: 2;
    }

    .welcome {
        align-items: flex-start;
    }

    .gameweek-tabs {
        grid-template-columns: repeat(5, 1fr);
    }

}