:root {
  --ink: #14241e;
  --muted: #5f6f68;
  --paper: #f6f2e7;
  --surface: #fffdf7;
  --line: #d9d2c2;
  --green: #087f5b;
  --green-soft: #e5f3e9;
  --amber: #bc7611;
  --amber-soft: #fff2d5;
  --red: #b63b3b;
  --red-soft: #fce7e5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; cursor: pointer; }
.app-header { background: #073d30; border-bottom: 4px solid #c58b2b; }
.header-inner { max-width: 1120px; min-height: 70px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.primary-nav { display: flex; gap: 5px; }
.gameweek-context { border-bottom: 1px solid #d9d2c2; background: #f3eee2; }
.gameweek-context-inner { max-width: 1120px; min-height: 46px; display: flex; align-items: center; gap: 9px; margin: 0 auto; padding: 7px 18px; color: var(--muted); font-size: 12px; font-weight: 850; }
.gameweek-context select { min-width: 132px; min-height: 32px; padding: 5px 28px 5px 8px; border: 1px solid #c9bda7; border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 900; }
.gameweek-context small { color: var(--green); font-size: 12px; font-weight: 850; }
.nav-button, .account-button { border: 0; color: #eef8f2; background: transparent; border-radius: 5px; padding: 10px 14px; font-weight: 800; }
.nav-button:hover, .nav-button.active { background: #17644f; color: white; }
.account-button { width: 44px; min-height: 40px; margin-left: auto; padding: 7px; background: #f4ecd8; color: #153328; font-size: 19px; line-height: 1; }
.account-button:hover { background: #fffdf7; }
.app-shell { max-width: 1120px; margin: 0 auto; padding: 26px 18px 70px; }
.view { display: none; }
.view.active { display: block; }
.gameweek-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.gameweek-bar.compact { padding-top: 6px; }
.eyebrow { margin: 0 0 4px; color: var(--amber); font-size: 12px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 27px; line-height: 1.1; }
h2 { margin-bottom: 5px; font-size: 20px; }
.subtle, .section-heading p, .pick-intro p { margin-bottom: 0; color: var(--muted); }
.deadline-chip { min-width: 172px; padding: 11px 15px; border: 1px solid #cfb87e; background: var(--amber-soft); color: #6f4610; border-radius: 5px; text-align: left; font-weight: 700; }
.deadline-chip strong { display: block; margin-top: 2px; font-size: 18px; }
.deadline-label { color: var(--green); font-weight: 800; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 26px 0 12px; }
.icon-button { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--green); font-size: 23px; line-height: 1; }
.icon-button:hover { background: var(--green-soft); }
.status-strip { padding: 11px 13px; margin-bottom: 13px; background: var(--amber-soft); border: 1px solid #e6ca8e; border-radius: 5px; color: #75501d; font-size: 14px; font-weight: 750; }
.slip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.slip { position: relative; overflow: hidden; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.slip.live { border-color: #86c6a8; background: #f4fbf5; }
.slip-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 11px; }
.slip-head strong { min-width: 0; font-size: 15px; }
.slip-head span { color: var(--muted); font-size: 12px; font-weight: 750; }
.slip-picks { display: grid; gap: 6px; }
.slip-private { margin: 0; padding: 14px 10px; color: var(--muted); background: #f3f0e8; border: 1px dashed #d6cebd; border-radius: 4px; font-size: 13px; font-weight: 750; text-align: center; }
.slip-pick { display: flex; align-items: center; justify-content: space-between; padding: 9px; background: #eef5f0; border-radius: 4px; font-size: 14px; font-weight: 800; }
.slip-pick em { font-style: normal; color: var(--green); }
.slip-pick.skipped { background: var(--red-soft); border: 1px solid #e4aaa6; }
.slip-pick.skipped em { color: var(--red); }
.slip.needs-review { border-color: #e4aaa6; background: #fff7f5; }
.slip-foot { margin: 12px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.schedule-list { display: grid; gap: 14px; margin-top: 22px; }
.schedule-picker { display: flex; justify-content: flex-end; }
.schedule-picker label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 850; }
.schedule-picker select { min-height: 34px; padding: 5px 26px 5px 8px; border: 1px solid #c9bda7; border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 900; }
.schedule-week { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.schedule-week header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #f3eee2; border-bottom: 1px solid var(--line); }
.schedule-week header span { display: block; color: var(--ink); font-weight: 900; }
.schedule-week header small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 750; }
.schedule-week header strong { color: #72501a; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.schedule-fixtures { display: grid; }
.schedule-fixture { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #eee8dc; font-size: 14px; font-weight: 750; }
.schedule-fixture:last-child { border-bottom: 0; }
.schedule-fixture time { color: var(--muted); font-size: 12px; font-weight: 800; }
.schedule-fixture span { min-width: 0; }
.schedule-fixture b { margin: 0 4px; color: var(--muted); }
.schedule-fixture em { padding: 4px 7px; border-radius: 999px; background: var(--green); color: white; font-size: 10px; font-style: normal; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.schedule-fixture.selected { background: var(--green-soft); }
.schedule-empty { margin: 22px 0 0; padding: 16px; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-weight: 750; }
.pick-intro { margin: 26px 0 14px; }
.pick-list { display: grid; gap: 10px; }
.fixture-notice { margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 750; }
.fixture-notice.draft { border-color: #cfb87e; background: var(--amber-soft); color: #75501c; }
.fixture-notice.warning { border-color: #e4aaa6; background: var(--red-soft); color: #8e302c; }
.fixture-notice.info { border-color: #acd3b8; background: var(--green-soft); color: var(--green); }
.fixture-picker { display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr); align-items: center; gap: 10px; padding: 14px; background: var(--green-soft); border: 1px solid #acd3b8; border-radius: 6px; transition: background .15s ease, border-color .15s ease; }
.fixture-picker.skipped { background: var(--red-soft); border-color: #e4aaa6; }
.team { font-weight: 850; }
.team.home { text-align: right; }
.score-control { display: flex; gap: 6px; align-items: center; }
.score-control input { width: 42px; height: 38px; border: 1px solid #afcaba; border-radius: 4px; color: var(--ink); background: #f3fbf5; font-weight: 900; font-size: 17px; text-align: center; }
.score-control span { color: var(--muted); font-weight: 900; }
.fixture-meta { display: flex; align-items: center; justify-content: space-between; grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid rgba(20, 36, 30, .12); }
.fixture-meta small { color: var(--muted); font-weight: 750; }
.include-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 13px; font-weight: 900; }
.include-toggle input { width: 16px; height: 16px; accent-color: var(--green); }
.fixture-picker.skipped .include-toggle { color: var(--red); }
.fixture-form { grid-column: 1 / -1; width: 100%; padding-top: 9px; border-top: 1px solid rgba(20, 36, 30, .12); }
.fixture-form summary { width: max-content; color: #726342; cursor: pointer; font-size: 12px; font-weight: 850; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 10px; }
.form-team { min-width: 0; }
.form-team strong { display: block; margin-bottom: 6px; font-size: 12px; }
.form-results { display: flex; gap: 4px; flex-wrap: wrap; }
.form-result { min-width: 25px; padding: 4px 3px; border-radius: 3px; color: white; font-size: 11px; font-weight: 900; text-align: center; }
.form-result.win { background: var(--green); }
.form-result.draw { background: #9a7b31; }
.form-result.loss { background: var(--red); }
.form-note { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.submit-row { display: flex; gap: 10px; margin-top: 18px; }
.submit-button, .reset-button, .outline-button { border-radius: 5px; font-weight: 850; padding: 12px 16px; }
.submit-button { flex: 1; border: 1px solid #066b4d; background: var(--green); color: white; }
.submit-button:hover { background: #056044; }
.reset-button { width: 105px; border: 1px solid #e2b5b0; background: var(--red-soft); color: #993030; }
.reset-button:hover { background: #f9d7d4; }
.leaderboard-card { overflow-x: auto; margin-top: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 590px; }
th { background: #f4eddf; color: #5c675f; font-size: 12px; text-align: left; text-transform: uppercase; }
th, td { padding: 13px; border-bottom: 1px solid var(--line); }
td { font-weight: 750; }
.table-empty { padding: 24px 13px; color: var(--muted); font-weight: 750; text-align: center; }
tr:last-child td { border-bottom: 0; }
.player-identity { display: inline-flex; align-items: center; min-width: 0; }
.player-dot { width: 27px; height: 27px; display: inline-grid; flex: 0 0 auto; place-items: center; margin-right: 9px; background: var(--green-soft); border: 1px solid #9bc9ae; border-radius: 50%; font-size: 15px; line-height: 1; }
.player-full-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-short-name { display: none; }
.slip-head .player-full-name, .slip-head .player-short-name { color: var(--ink); font-size: 15px; }
.slip-estimate { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed #b6cfbf; color: var(--green); font-size: 12px; font-weight: 800; }
.slip-estimate strong { font-size: 16px; }
.slip-estimate small { color: var(--muted); font-size: 11px; font-weight: 700; }
.slip-estimate.unavailable { color: var(--muted); }
.money-section { margin-top: 16px; }
.money-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.money-card, .leaderboard-pot { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.money-card span, .leaderboard-pot span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.money-card strong, .leaderboard-pot strong { display: block; margin: 5px 0 3px; font-size: 20px; }
.money-card small, .leaderboard-pot small { color: var(--muted); font-size: 11px; font-weight: 700; }
.leaderboard-pot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; background: var(--green-soft); border-color: #add5bb; }
.leaderboard-pot strong { color: var(--green); }
.payout-rule { display: grid; grid-template-columns: 110px 1fr; gap: 12px; margin-top: 10px; padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: #694718; font-size: 13px; line-height: 1.45; }
.payout-rule strong { color: #67410d; }
.account-card { max-width: 530px; margin: 48px auto 0; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.account-card p { color: var(--muted); line-height: 1.5; }
#accountIntro { min-height: 4.5em; }
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 22px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #f3eee2; }
.auth-mode { border: 0; border-radius: 4px; padding: 10px; background: transparent; color: var(--muted); font-weight: 850; }
.auth-mode.active { background: var(--surface); color: var(--green); box-shadow: 0 1px 3px rgba(20, 36, 30, .12); }
.account-actions { display: flex; gap: 10px; margin-top: 22px; }
.outline-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.auth-form { display: grid; gap: 13px; margin-top: 22px; }
.auth-form label { display: grid; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 850; }
.auth-form input, .auth-form select, .badge-picker select { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); font: inherit; }
.auth-form input:focus, .auth-form select:focus, .badge-picker select:focus { outline: 3px solid rgba(8, 127, 91, .18); border-color: var(--green); }
.auth-form .account-actions { margin-top: 2px; }
.text-button { justify-self: start; padding: 2px 0; border: 0; background: transparent; color: var(--green); font-weight: 800; text-decoration: underline; }
.signed-in-panel { margin-top: 22px; padding: 15px; border: 1px solid #add5bb; border-radius: 5px; background: var(--green-soft); }
.signed-in-panel p { margin-bottom: 12px; }
.badge-picker { display: grid; gap: 6px; margin: 12px 0; color: var(--ink); font-size: 13px; font-weight: 850; }
.payment-banner { margin: 14px 0; padding: 13px 14px; border: 1px solid #cfb87e; border-radius: 5px; background: var(--amber-soft); color: #75501d; font-size: 13px; font-weight: 750; line-height: 1.45; }
.payment-banner strong { display: block; margin-bottom: 3px; color: #67410d; }
.payment-banner.paid { border-color: #add5bb; background: var(--green-soft); color: #176448; }
.payment-banner.paid strong { color: var(--green); }
.payment-admin { display: grid; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #ddcfb5; }
.payment-admin h3 { margin: 0; font-size: 15px; }
.payment-admin p { margin: 0; font-size: 12px; }
.payment-player { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid #ddcfb5; border-radius: 5px; background: white; font-size: 13px; font-weight: 800; }
.payment-player small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.payment-toggle { flex: 0 0 auto; min-width: 78px; padding: 7px 9px; border: 1px solid #d8aaa5; border-radius: 4px; background: var(--red-soft); color: #94332e; font-size: 12px; font-weight: 900; }
.payment-toggle.paid { border-color: #9fcbb0; background: var(--green-soft); color: var(--green); }
.admin-panel { margin-top: 22px; padding: 20px; border: 1px solid #d9bd82; border-radius: 6px; background: #fff9ec; }
.admin-panel p { margin-bottom: 15px; }
.admin-card-summary { display: grid; gap: 5px; padding: 12px; border: 1px solid #ddcfb5; border-radius: 5px; background: white; color: var(--ink); font-size: 13px; font-weight: 750; }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 12px; border: 1px solid #ddcfb5; border-radius: 5px; background: #fffdf8; }
.backup-row strong, .backup-row span { display: block; }
.backup-row span { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 700; }
.backup-row .outline-button { flex: 0 0 auto; white-space: nowrap; }
.admin-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-panel-heading h2 { margin-bottom: 0; }
.admin-panel-heading > span { padding: 5px 8px; border-radius: 99px; background: var(--amber-soft); color: #744d16; font-size: 11px; font-weight: 850; }
.admin-form { display: grid; gap: 13px; }
.admin-gameweek-meta { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.admin-form label { display: grid; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 850; }
.admin-form input { min-width: 0; min-height: 40px; padding: 8px 9px; border: 1px solid #d5c7aa; border-radius: 4px; background: white; color: var(--ink); font: inherit; }
.admin-fixture-fields { display: grid; gap: 10px; }
.admin-fixture { display: grid; grid-template-columns: 145px 1fr 1fr; gap: 9px; margin: 0; padding: 11px; border: 1px solid #ddcfb5; border-radius: 5px; }
.admin-fixture legend { padding: 0 5px; color: var(--amber); font-size: 11px; font-weight: 900; }
.small-print { font-size: 12px; }
.placement-board { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.placement-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.placement-heading h2 { margin-bottom: 0; }
.placement-rows { display: grid; gap: 8px; margin-top: 12px; }
.placement-row { display: grid; grid-template-columns: 55px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #f7f4eb; }
.placement-row strong { color: var(--green); }
.placed-toggle { border: 1px solid #9dc6ac; border-radius: 4px; background: white; color: var(--green); padding: 6px 8px; font-size: 12px; font-weight: 850; }
.placed-toggle.placed { background: var(--green); color: white; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 5; max-width: calc(100vw - 32px); transform: translate(-50%, 90px); padding: 11px 15px; border-radius: 5px; background: #143c30; color: white; font-weight: 750; opacity: 0; transition: opacity .18s ease, transform .18s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 760px) {
  .player-full-name { display: none; }
  .player-short-name, .slip-head .player-short-name { display: inline; font-size: 12px; font-weight: 900; }
  .player-dot { width: 25px; height: 25px; margin-right: 6px; font-size: 14px; }
  .app-shell { padding: 20px 12px 55px; }
  .header-inner { padding: 10px 12px; }
  .gameweek-context-inner { min-height: 42px; padding: 6px 12px; }
  .gameweek-context small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-button { padding: 9px 9px; font-size: 13px; }
  .account-button { padding: 9px 10px; font-size: 13px; }
  .gameweek-bar { align-items: flex-start; }
  .deadline-chip { min-width: 124px; padding: 9px; font-size: 12px; }
  .deadline-chip strong { font-size: 15px; }
  .slip-grid { grid-template-columns: 1fr; }
  .schedule-fixture { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .schedule-fixture time { grid-column: 1 / -1; }
  .schedule-fixture em { grid-column: 2; grid-row: 2; }
  .fixture-picker { grid-template-columns: 1fr; gap: 9px; text-align: center; }
  .team.home { text-align: center; }
  .score-control { justify-content: center; grid-row: 2; }
  .fixture-picker .team.away { grid-row: 3; }
  .fixture-meta { grid-row: 4; }
  .fixture-form { grid-row: 5; }
  .deadline-label { font-size: 12px; text-align: right; }
  .placement-row { grid-template-columns: 42px 1fr; }
  .placed-toggle { grid-column: 2; justify-self: start; }
  .money-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payout-rule { grid-template-columns: 1fr; gap: 3px; }
  .account-actions { flex-wrap: wrap; }
  .account-actions > button { flex: 1 1 180px; }
  .admin-gameweek-meta, .admin-fixture { grid-template-columns: 1fr; }
  .backup-row { align-items: flex-start; flex-direction: column; }
  .backup-row .outline-button { width: 100%; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
