:root {
  --ink: #11273a;
  --muted: #71808b;
  --line: #e4e9ec;
  --paper: #f5f7f5;
  --card: #ffffff;
  --teal: #1b7471;
  --gold: #c08b35;
  --red: #a35750;
  --shadow: 0 18px 48px rgba(17, 39, 58, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 12% 0%, #fff 0, var(--paper) 38rem); }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 28px; }
.site-header { display: flex; align-items: center; gap: 16px; padding-bottom: 40px; }
.brand-mark { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 21px Georgia, serif; box-shadow: 7px 7px 0 #d7e2e0; }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font: 700 clamp(25px, 4vw, 39px)/1.1 Georgia, "Songti SC", serif; letter-spacing: -.03em; }
h2 { margin-bottom: 0; font: 700 clamp(24px, 3vw, 31px)/1.15 Georgia, "Songti SC", serif; }
.subtitle, .muted { color: var(--muted); font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.quiet-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.quiet-link:hover { color: var(--ink); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; font-size: 21px; }
.hero-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 32px; border-radius: 22px; color: #fff; background: linear-gradient(120deg, #11273a, #1f4c61); box-shadow: var(--shadow); }
.hero-card h2 { font-size: clamp(27px, 4vw, 42px); }
.hero-card .muted, .hero-card .label { color: #b6c9d2; }
.label, .week-picker span { display: block; margin-bottom: 9px; font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.week-picker { min-width: 220px; color: #fff; }
.week-picker select { width: 100%; padding: 12px 13px; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; color: #fff; background: rgba(255,255,255,.1); }
.section-block { margin-top: 52px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading .muted { margin-bottom: 4px; }
.ranking-status { margin: 0 0 4px; color: #174c78; font-size: 13px; font-weight: 800; }
.leaderboard-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.prize-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 15px 22px; color: #174c78; background: #eef5f7; border-bottom: 1px solid var(--line); font-size: 12px; }
.prize-summary strong { font-size: 13px; }
.prize-summary span { color: var(--muted); }
.neutral-award { color: var(--ink); background: #f7f8f6; }
.rank-row { display: grid; grid-template-columns: 54px 42px 1fr auto; align-items: center; gap: 15px; min-height: 78px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-row.rank-1 { background: #fffaf0; }
.rank-number { color: #9ba8ae; font: 700 18px Georgia, serif; text-align: center; }
.rank-1 .rank-number { color: var(--gold); font-size: 26px; }
.rank-2 .rank-number { color: #8498a0; }
.rank-3 .rank-number { color: #a87958; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #dfe9e8; }
.avatar.is-missing { display: block; }
.rank-name { display: grid; gap: 4px; }
.rank-name strong { font-size: 15px; }
.rank-name span { color: var(--muted); font-size: 12px; }
.rank-score { display: flex; align-items: baseline; gap: 5px; }
.rank-score strong { font: 700 27px Georgia, serif; }
.rank-score span { color: var(--muted); font-size: 12px; }
.fixture-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.fixture-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 9px 28px rgba(17,39,58,.045); }
.fixture-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 18px 0; color: var(--muted); font-size: 12px; }
.fixture-top > span:nth-child(2) { margin-right: auto; }
.league-tag { padding: 4px 8px; border-radius: 999px; color: var(--teal); background: #e7f2f0; font-weight: 800; }
.teams { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 10px; padding: 23px 18px 19px; }
.teams > div { display: grid; gap: 6px; }
.teams strong { font: 700 21px Georgia, serif; }
.teams small { color: var(--muted); font-size: 11px; }
.away-team { text-align: right; }
.versus { color: #b8c1c5; font: 700 11px Georgia, serif; text-align: center; }
.odds-row { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.odds-row span { display: grid; gap: 4px; padding: 11px 6px; color: var(--muted); font-size: 11px; text-align: center; }
.odds-row span + span { border-left: 1px solid var(--line); }
.odds-row b { color: var(--ink); font-size: 14px; }
.odds-row em { color: var(--teal); font-size: 10px; font-style: normal; font-weight: 800; }
.pending-chip, .pending-result, .void-result, .final-result { font-size: 11px; }
.pending-chip, .pending-result { color: #a17b39; }
.final-result { color: var(--teal); font-weight: 800; }
.void-result { color: var(--red); }
.pick-grid { padding: 14px 18px 17px; }
.pick-header, .pick-row { display: grid; grid-template-columns: 1fr 48px 42px; align-items: center; gap: 7px; }
.pick-header { padding-bottom: 7px; color: #a2adb1; font-size: 10px; }
.pick-header span:nth-child(2), .pick-header span:nth-child(3), .pick-row strong, .pick-points { text-align: right; }
.pick-row { min-height: 28px; color: var(--muted); font-size: 12px; }
.pick-row strong { color: var(--ink); font-size: 13px; }
.pick-points { color: var(--teal); font-size: 11px; }
.pick-points.is-void { color: var(--red); }
.no-picks { padding: 6px 0 2px; color: var(--muted); font-size: 12px; }
.empty-state { display: grid; gap: 8px; padding: 38px 24px; border: 1px dashed #cbd6d7; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.6); }
.empty-state strong { color: var(--ink); }
.site-footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 58px; padding-top: 18px; border-top: 1px solid var(--line); color: #9aa6aa; font-size: 11px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 5; transform: translate(-50%, 14px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 999px; color: #fff; background: var(--ink); font-size: 13px; transition: .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.report-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.report-preview { display: grid; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #f7f5ef; }
.report-image { display: block; width: min(100%, 720px); height: auto; margin: 0 auto; border: 1px solid #d8d1c4; border-radius: 10px; box-shadow: 0 10px 30px rgba(17,39,58,.1); }
.report-download { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* Admin */
.admin-layout { max-width: 1220px; }
.admin-layout .hero-card { align-items: center; }
.admin-layout main { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: start; }
.admin-layout .full-width { grid-column: 1 / -1; }
.admin-panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.admin-panel h2 { margin-bottom: 5px; font-size: 23px; }
.admin-panel > p { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid #d9e1e2; border-radius: 9px; outline: 0; color: var(--ink); background: #fbfcfc; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(27,116,113,.11); }
.field textarea { min-height: 130px; resize: vertical; }
.primary-button, .secondary-button { min-height: 40px; padding: 0 15px; border: 0; border-radius: 9px; font-weight: 800; }
.primary-button { color: #fff; background: var(--teal); }
.secondary-button { border: 1px solid #d7e0e0; color: var(--ink); background: #fff; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.button-row button:disabled { cursor: not-allowed; opacity: .48; }
.confirm-dialog { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(17, 39, 58, .42); }
.confirm-dialog.hidden { display: none; }
.confirm-card { width: min(100%, 420px); padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 20px 60px rgba(17, 39, 58, .2); }
.admin-message { min-height: 20px; margin: 12px 0 0; color: var(--teal); font-size: 12px; }
.admin-message.is-error { color: var(--red); }
.preview-box { display: grid; gap: 9px; margin-top: 15px; padding: 12px; border-radius: 10px; background: #f5f8f7; font-size: 12px; }
.preview-box:empty { display: none; }
.preview-line { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid #e0e9e7; }
.preview-line:last-child { padding-bottom: 0; border-bottom: 0; }
.preview-line label { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.preview-candidate { display: inline-flex; align-items: center; gap: 6px; margin-left: 5px; }
.preview-candidate select { max-width: 260px; padding: 5px 7px; border: 1px solid #d7e0e0; border-radius: 6px; color: var(--ink); background: #fff; font-size: 11px; }
.preview-candidate .secondary-button { min-height: 28px; padding: 0 8px; font-size: 11px; }
.batch-entry { display: grid; gap: 8px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.batch-entry h3 { font-size: 18px; }
.batch-entry > p { margin: 0; }
.batch-text { min-height: 190px !important; font-family: inherit; line-height: 1.6; }
.batch-row > label { width: 100%; align-items: flex-start; }
.batch-row > label > span { flex: 1; min-width: 180px; line-height: 1.65; }
.batch-row > label > strong { min-width: 130px; color: var(--teal); text-align: right; }
.batch-row small { color: var(--muted); font-size: 11px; font-weight: 400; }
.batch-edit-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.batch-edit-controls select, .batch-edit-controls input { min-height: 29px; max-width: 220px; padding: 4px 7px; border: 1px solid #d7e0e0; border-radius: 6px; color: var(--ink); background: #fff; font-size: 11px; }
.warning-list { color: var(--red); line-height: 1.6; }
.admin-table-wrap { overflow: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; }
.admin-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { color: var(--muted); background: #f7f9f9; font-size: 11px; }
.admin-table tr:last-child td { border-bottom: 0; }
.login-card { width: min(430px, 100%); margin: 9vh auto 0; padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 8px; font-size: 30px; }
.hidden { display: none !important; }
@media (max-width: 780px) {
  .page-shell { width: min(100% - 24px, 620px); padding-top: 25px; }
  .site-header { padding-bottom: 26px; }
  .brand-mark { width: 40px; height: 40px; }
  .subtitle { font-size: 12px; }
  .hero-card { display: grid; padding: 23px; }
  .week-picker { min-width: 0; }
  .section-block { margin-top: 36px; }
  .section-heading { display: grid; gap: 8px; }
  .section-heading .muted { margin-bottom: 0; }
  .fixture-list { grid-template-columns: 1fr; }
  .admin-layout main { display: block; }
  .admin-panel { margin-bottom: 16px; padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .site-footer { display: grid; gap: 4px; }
  .batch-row > label > strong { min-width: 0; text-align: left; }
}
@media (max-width: 420px) {
  .header-actions .quiet-link { display: none; }
  .rank-row { grid-template-columns: 30px 38px 1fr auto; gap: 9px; padding: 10px 12px; }
  .rank-row .avatar { width: 38px; height: 38px; }
  .rank-score strong { font-size: 23px; }
  .teams strong { font-size: 18px; }
}
