@font-face {
  font-family: Barlow;
  src: url('/fonts/barlow-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Barlow;
  src: url('/fonts/barlow-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Barlow;
  src: url('/fonts/barlow-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Barlow;
  src: url('/fonts/barlow-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Russo One';
  src: url('/fonts/russo-one-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Barlow, system-ui, sans-serif;
  line-height: 1.5;
  color: #102644;
  background: #fff;
  --display: 'Russo One', 'Arial Black', sans-serif;
  --navy: #002b7f;
  --red: #ce1126;
  --line: #dbe3ef;
  --muted: #566781;
  --wash: #f4f7fb;
  --soft-blue: #e8eef9;
  --mobile-nav: calc(56px + env(safe-area-inset-bottom));
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--navy); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; min-width: 0; border-radius: 6px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid #1454b7; outline-offset: 3px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #bfcde1; background: var(--wash); color: inherit; }
textarea { resize: vertical; min-height: 7rem; }
input[type=checkbox] { width: auto; accent-color: var(--navy); }
label { display: grid; gap: 6px; font-weight: 600; }
label.checkbox { display: flex; align-items: center; gap: 8px; }
h1, h2, h3, p { margin: 0 0 12px; }
h1, h2 { font: 400 1.3rem/1.14 var(--display); color: var(--navy); text-transform: uppercase; }
h1 { font-size: clamp(1.8rem, 4.4vw, 2.6875rem); margin-bottom: 10px; }
h3 { font-size: 1.05rem; }
small { font-size: .875rem; }

.shell { width: min(1200px, calc(100% - 56px)); margin-inline: auto; }
.skip { position: fixed; left: 8px; top: 8px; transform: translateY(-150%); background: #fff; padding: 8px 12px; z-index: 5; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage-band { padding: 6px 0; background: var(--soft-blue); color: var(--navy); font-size: .8125rem; }
.stage-band .shell { display: flex; justify-content: center; align-items: center; column-gap: 10px; flex-wrap: wrap; }
.stage-band span { color: #3e567a; }
.site-header { position: relative; background: linear-gradient(110deg, #001b42, #002b7f 68%, #073994); color: #fff; border-bottom: 3px solid var(--red); }
.site-header::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .07; background: repeating-linear-gradient(125deg, transparent 0 50px, #7ab3ff 50px 51px, transparent 51px 96px); }
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 85px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 400 1.5rem/1 var(--display); color: #fff; text-decoration: none; white-space: nowrap; letter-spacing: -.04em; }
.brand img { display: block; }
.brand b { font-weight: inherit; color: #ff5870; }
#account-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 42px); }
nav { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px); }
nav a { position: relative; display: grid; align-items: center; min-height: 45px; padding: 0 2px; text-decoration: none; color: #fff; font-size: .8125rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
nav a[aria-current=page]::after, nav a:hover::after { content: ''; position: absolute; inset: auto 0 2px; height: 3px; background: var(--red); }
.site-header :focus-visible { outline-color: #a4c6ff; }
main { flex: 1; min-height: 62vh; padding-block: 42px 62px; }
main:has(.fixture-tabs) { padding-top: 28px; }
.site-footer { padding: 26px 0; color: #c9d5e8; background: linear-gradient(110deg, #00152e, #00265e); font-size: .875rem; }
.page-heading { margin-bottom: 24px; }
.page-description, .muted { color: var(--muted); }
.page-description { line-height: 1.7; max-width: 42rem; }
.eyebrow { margin-bottom: 9px; color: var(--red); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

.panel { min-width: 0; padding: clamp(16px, 2.3vw, 26px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.panel + .panel, .admin-content > .grid + .panel { margin-top: 14px; }
.auth { max-width: 480px; margin: 18px auto; padding: clamp(22px, 4vw, 40px); }
.auth h1 { font-size: clamp(1.65rem, 4vw, 2.25rem); }
.auth .page-heading { margin-bottom: 20px; }
.stack { display: grid; gap: 12px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline > label { min-width: 0; }
.inline > label + .btn { align-self: end; }
.split { justify-content: space-between; }
.btn { border: 1px solid var(--navy); border-radius: 5px; min-height: 44px; padding: 9px 16px; background: var(--navy); color: #fff; font-size: .9375rem; font-weight: 700; }
.btn:not(:disabled):hover { filter: brightness(.91); }
.btn:disabled { opacity: .55; }
.btn.primary { background: var(--red); border-color: var(--red); }
.btn.ghost { background: #fff; color: var(--navy); border-color: #c6d2e5; }
.btn.small { min-height: 36px; font-size: .875rem; }
.status { display: inline-block; border: 1px solid currentColor; border-radius: 5px; padding: 3px 7px; background: transparent; color: #244776; font-size: .8125rem; text-transform: capitalize; }
.status.open, .status.invited, .status.paid, .status.won { color: #185b36; }
.status.revoked, .status.declined, .status.lost, .status.cancelled { color: #9e1932; }
.status.in-progress { color: #6d460c; }
.grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); align-items: start; }
.fields, .metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--wash); }
.metric small { display: block; color: var(--muted); }
.metric strong { display: block; color: var(--navy); font-size: clamp(.9375rem, 2vw, 1.1875rem); overflow-wrap: anywhere; }

.balance-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; margin-bottom: 20px; border: 1px solid #dce5f4; border-radius: 8px; background: var(--soft-blue); }
.balance-bar small, .balance-bar strong { display: block; }
.balance-bar small { color: #3d5678; font-weight: 600; }
.balance-bar strong { color: var(--navy); font-size: 1.4rem; line-height: 1.2; }
.balance-bar a { font-weight: 700; }
.fixture-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; margin-bottom: 22px; }
.fixture-card { display: grid; align-content: start; gap: 13px; width: 100%; padding: 17px 20px; text-align: left; color: #fff; background: linear-gradient(160deg, #073e96, #00285f 60%, #001c40); border: 0; border-top: 3px solid var(--red); border-radius: 10px; }
.fixture-card:hover { background: linear-gradient(160deg, #0d4bab, #003476 60%, #001c40); }
.fixture-card-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.fixture-tournament { color: #ff6666; font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.fixture-card .status { flex-shrink: 0; color: #c2d8fb; }
.fixture-card .status.upcoming { color: #92e6b1; }
.fixture-card .status.in-progress { color: #ffdb93; }
.fixture-card .status.cancelled { color: #ff9ca7; }
.fixture-teams { font: 400 1.125rem/1.45 var(--display); overflow-wrap: anywhere; }
.fixture-time { color: #d1e0f7; font-size: .9rem; }
.fixture-admin-actions { margin: 12px 0 16px; display: grid; gap: 10px; }
.fixture-admin-actions summary { width: fit-content; color: var(--navy); cursor: pointer; font-weight: 700; }
.fixture-admin-actions form { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.fixture-admin-actions form p { margin: 0; }
.market-list { display: grid; gap: 14px; min-width: 0; }
.read-only-markets { grid-template-columns: minmax(0, 1fr); }
.match-head { padding: 24px; background: linear-gradient(160deg, #073e96, #00285f 60%, #001c40); color: #fff; border-radius: 10px; border-top: 3px solid var(--red); box-shadow: 0 5px 22px #002b7f12; }
.match-head h2 { margin-bottom: 7px; color: #fff; font-size: clamp(1.25rem, 3vw, 1.75rem); text-transform: none; }
.match-head p { color: #d1e0f7; margin: 0; }
.match-head .fixture-cancellation { margin-top: 8px; }
.market.panel { margin: 0; }
.market h2 { margin: 0; font-size: clamp(1rem, 2.5vw, 1.2rem); }
.market small { display: block; margin-top: 3px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr)); gap: 8px; margin-top: 12px; }
.choice { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; position: relative; min-height: 60px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); color: #102644; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.choice span:nth-child(2) { color: var(--muted); font-size: .875rem; font-weight: 600; }
.choice:not(:disabled):hover { border-color: #4974b2; }
.choice[aria-pressed=true] { box-shadow: inset 0 0 0 1px var(--navy); border-color: var(--navy); background: var(--soft-blue); color: var(--navy); }
.choice:disabled { opacity: .62; }
.bet-slip {
  --slip-gutter: clamp(14px, 2vw, 22px);
  --slip-red: #df0c34;
  position: sticky;
  top: 20px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  scroll-margin: 16px;
  padding: 0;
  border-top: 4px solid var(--slip-red);
  border-radius: 13px;
  box-shadow: 0 5px 22px #002b7f12;
}
.slip-header, .slip-selection, .slip-stake, .slip-estimate, .slip-totals > div, .slip-calculation dl > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.slip-header { align-items: center; padding: 21px var(--slip-gutter); border-bottom: 1px solid var(--line); }
.slip-header h2 { margin: 0; font: 700 1.4rem/1.2 Barlow, system-ui, sans-serif; text-transform: none; color: #102644; }
.slip-count { padding: 4px 9px; border-radius: 5px; background: var(--soft-blue); color: #244776; font-size: .8125rem; white-space: nowrap; }
.slip-form { padding: 0 var(--slip-gutter) 18px; }
.slip-empty { margin: 0; padding: 17px 0; border-bottom: 1px solid var(--line); }
.slip-row { padding: 15px 0 17px; border-bottom: 1px solid var(--line); }
.slip-selection { align-items: start; margin-bottom: 12px; }
.slip-selection strong { display: block; margin-top: 2px; font-size: 1.05rem; overflow-wrap: anywhere; }
.slip-market-name { color: var(--muted); font-size: .8125rem; letter-spacing: .035em; text-transform: uppercase; }
.slip-remove { display: grid; place-items: center; flex: 0 0 32px; min-height: 32px; padding: 0; border: 0; background: transparent; color: #566c88; font-size: 1.25rem; line-height: 1; }
.slip-remove:hover { background: var(--wash); color: var(--navy); }
.slip-stake { align-items: center; font-size: .9rem; font-weight: 700; }
.slip-stake input { width: min(6.25rem, 50%); padding: 8px; text-align: center; font-variant-numeric: tabular-nums; border-radius: 8px; }
.slip-stake input[aria-invalid=true] { border-color: #9e1932; }
.slip-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 8px 0 12px; }
.slip-presets button { min-height: 32px; padding: 4px 1px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: .8125rem; font-weight: 700; }
.slip-presets button:hover, .slip-presets button[aria-pressed=true] { border-color: #396fd4; background: var(--soft-blue); }
.slip-stake-error { margin: 0 0 6px; color: #9e1932; font-size: .8125rem; }
.slip-estimate { color: var(--muted); font-size: .875rem; }
.slip-estimate strong { color: var(--navy); font-size: 1.1rem; white-space: nowrap; }
.slip-calculation { margin-top: 7px; color: var(--muted); font-size: .8125rem; }
.slip-calculation summary { cursor: pointer; color: var(--navy); font-weight: 700; }
.slip-calculation dl { display: grid; gap: 3px; margin: 8px 0 5px; }
.slip-calculation dd, .slip-totals dd { margin: 0; color: var(--navy); font-weight: 700; white-space: nowrap; }
.slip-calculation p { margin: 0; }
.slip-totals { display: grid; gap: 7px; margin: 15px 0 17px; font-size: .875rem; }
.slip-totals .slip-total { font-size: 1.25rem; font-weight: 700; }
.slip-form > .btn { width: 100%; min-height: 49px; border-color: var(--slip-red); border-radius: 9px; background: var(--slip-red); font-size: 1rem; }
.slip-form > .message { margin-bottom: 10px; font-size: .8125rem; }
.slip-notes { margin: 12px 0 0; color: var(--muted); font-size: .8125rem; }
.audit-row { border-top: 1px solid var(--line); padding: 12px 0; }
.settlement-card summary { cursor: pointer; }
.settlement-card > form { margin: 14px 0; }
.score-fields { min-width: 0; margin: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 6px; }
.score-fields legend { padding-inline: 4px; color: var(--navy); font-weight: 700; }
.void-options label { margin-top: 8px; }
.settlement-card [data-form=settle] { margin-top: 16px; }
.mobile-slip { display: none; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .9375rem; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
td { overflow-wrap: anywhere; }
td.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt { font-family: ui-monospace, monospace; font-size: .8125rem; overflow-wrap: anywhere; }
.secret { margin-top: 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs .btn { flex: 1 1 auto; min-height: 46px; background: var(--wash); }
.tabs .btn[aria-pressed=true], .tabs .btn[aria-selected=true] { background: var(--navy); border-color: var(--navy); box-shadow: inset 0 -3px var(--red); color: #fff; }
#feedback:not(:empty) { margin-bottom: 16px; }
.message { padding: 9px 13px; border: 1px solid #c7e0d0; border-radius: 8px; background: #e6f3eb; }
.message.error { background: #fff0f2; border-color: #edc4ce; color: #861630; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .signed-in { padding-bottom: var(--mobile-nav); }
  .header-inner { min-height: 65px; }
  .brand { font-size: 1.25rem; }
  .brand img { width: 36px; height: 36px; }
  #account-nav > .btn { padding-inline: 10px; font-size: .875rem; }
  #account-nav nav { position: fixed; z-index: 3; inset: auto 0 0; gap: 0; padding: 0 8px env(safe-area-inset-bottom); min-height: var(--mobile-nav); background: #fff; border-top: 1px solid var(--line); }
  nav a { flex: 1; justify-items: center; text-align: center; color: var(--muted); font-size: .875rem; text-transform: none; }
  nav a[aria-current=page] { color: var(--navy); }
  nav a[aria-current=page]::after, nav a:hover::after { inset: 0 20% auto; }
  main { padding-block: 28px 40px; }
  main:has(.fixture-tabs) { padding-top: 20px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .bet-slip { position: static; max-height: none; overflow: visible; scroll-margin-bottom: calc(var(--mobile-nav) + 62px); }
  .mobile-slip { display: block; position: fixed; z-index: 2; right: 16px; bottom: calc(var(--mobile-nav) + 12px); box-shadow: 0 4px 15px #001b4233; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .balance-bar, .match-head { padding: 14px 16px; }
}

@media (min-width: 350px) and (max-width: 500px) {
  .choices:has(.choice:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .metrics { gap: 6px; }
  .metric { padding: 8px; }
  .metric small { font-size: .8rem; }
  .tabs { gap: 6px; }
  .tabs .btn { padding-inline: 9px; }
}
