:root {
  color-scheme: dark;
  --base: #101512;
  --sidebar: #111713;
  --panel: #191f1a;
  --panel-hover: #222b22;
  --border: #303b31;
  --text: #f2f5ee;
  --muted: #a6b0a5;
  --accent: #d3f473;
  --ink: #192410;
  --radius: 16px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--base);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: var(--accent); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 2; transform: translateY(-200%); background: var(--panel); padding: 12px; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.03; letter-spacing: -.064em; }
h2 { font-size: 1.45rem; line-height: 1.15; letter-spacing: -.045em; }
p { line-height: 1.55; }
small { font-size: .8rem; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
.eyebrow { font-size: .75rem; font-weight: 750; letter-spacing: .115em; text-transform: uppercase; color: var(--muted); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }

#app { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 32px 17px 20px; background: var(--sidebar); border-right: 1px solid var(--border); }
.brand { display: flex; width: fit-content; align-items: center; text-align: left; gap: 12px; padding: 0 8px; background: none; border: 0; }
.brand img { width: 42px; height: 42px; }
.brand b { display: block; font-size: 1.9rem; line-height: .9; letter-spacing: -.075em; }
.brand b span { color: var(--accent); }
.brand small { font-size: .57rem; font-weight: 800; letter-spacing: .12em; color: var(--muted); }
.nav-group { margin-top: 54px; }
.sidebar-label { padding: 0 11px; margin-bottom: 13px; }
nav { display: grid; gap: 5px; }
.nav-item { text-align: left; display: flex; gap: 12px; align-items: center; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted); padding: 11px; font-size: .93rem; font-weight: 600; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item[aria-current] { color: var(--accent); border-color: #38452a; background: #252f1e; }
.side-club { margin-top: auto; padding: 16px 3px 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.side-club small, .club-card small { display: block; color: var(--muted); margin-top: 4px; }
.topbar { height: 68px; padding: 0 max(30px, calc((100% - 1330px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .86rem; }
.topbar strong { color: var(--text); }
.crumb { color: #758572; margin: 0 7px; }
.format { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.format .icon { color: var(--accent); width: 15px; height: 15px; }
.content { max-width: 1390px; margin: 0 auto; padding: 30px 30px 52px; }
.hero { position: relative; isolation: isolate; display: grid; min-height: 310px; align-items: center; overflow: hidden; border: 1px solid #454f37; border-radius: var(--radius); background: #2b3827; }
.hero::before { position: absolute; content: ''; z-index: -1; inset: 0; background: linear-gradient(90deg, #121b13 4%, #152017ed 26%, #1721189c 52%, #10161029 100%), url('assets/harbour-oval.webp') center 55% / cover, radial-gradient(ellipse at 86% 18%, #9c8844 0%, #394b2e 45%, #1c241b 78%); }
.hero-content { padding: clamp(24px, 4vw, 48px); }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.7rem); margin: 12px 0; line-height: .98; }
.hero p { color: #d8e1d4; max-width: 340px; }
.hero .actions { margin-top: 24px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button { border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); padding: 10px 15px; font-weight: 700; font-size: .9rem; min-height: 42px; transition: background .16s, border-color .16s; }
.button.primary { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: #e4ff9d; border-color: #e4ff9d; }
.button.secondary { background: #1b231d; border-color: #405044; }
.button.secondary:hover { background: #2b372b; border-color: #87957e; }
.button.hero-button { background: #172118c9; border-color: #6a7765; }
.overview-grid, .tactics-grid, .squad-grid, .match-grid { display: grid; gap: 18px; align-items: start; }
.overview-grid { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); margin-top: 20px; align-items: stretch; }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--border); padding: 21px; border-radius: var(--radius); }
.section-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.section-top h2 { margin-top: 5px; }
.badge { display: inline-flex; max-width: 100%; white-space: nowrap; padding: 5px 9px; color: #d6ddd2; border: 1px solid #3f4b3d; border-radius: 30px; background: #222a22; font-size: .77rem; font-weight: 650; }
.badge.good { color: var(--accent); border-color: #4e6131; background: #26331d; }
.fixture { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 24px 0; }
.fixture-team { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }
.fixture-team.right { flex-direction: row-reverse; text-align: right; }
.fixture-team strong { color: var(--text); display: block; font-size: 1.16rem; letter-spacing: -.02em; }
.crest { display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--team); width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--team) 11%, #20241f); border: 1px solid color-mix(in srgb, var(--team) 37%, #252c25); font-size: .8rem; font-weight: 850; letter-spacing: -.05em; }
.crest.large { width: 50px; height: 50px; border-radius: 13px; font-size: 1rem; }
.versus { color: var(--muted); font-weight: 750; font-size: .67rem; }
.fixture-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; color: var(--muted); font-size: .82rem; }
.fixture-foot .icon { width: 14px; height: 14px; }
.fixture-foot span { margin-left: auto; }
.prep-row { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; padding: 12px 7px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .9rem; }
.prep-row:first-of-type { margin-top: 8px; }
.prep-row:last-child { border-bottom: 0; padding-bottom: 0; }
.prep-row:hover { color: var(--accent); }
.prep-row .icon { color: var(--accent); }
.prep-row small { display: block; margin-top: 3px; font-weight: 450; color: var(--muted); }
.club-section { margin-top: 27px; }
.club-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 13px 0 17px; }
.club-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; text-align: left; background: var(--panel); font-size: .88rem; }
.club-card:hover { background: var(--panel-hover); }
.club-card[aria-pressed="true"] { border-color: #80964b; background: #252e20; }
select { color: var(--text); background: #131a15; border: 1px solid #465347; border-radius: 7px; padding: 8px 32px 8px 10px; min-height: 38px; max-width: 100%; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23c9d4c5' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.opponent, .match-controls label { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .86rem; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 23px; }
.page-heading h1 { margin: 6px 0 8px; }
.page-heading p { color: var(--muted); }
.notice { background: #322c1d; border: 1px solid #776740; color: #ffdf98; border-radius: 10px; padding: 11px 15px; margin-bottom: 14px; }

.squad-grid { grid-template-columns: minmax(0, 2.15fr) minmax(250px, 1fr); }
.table-card { padding: 0; overflow: hidden; }
.table-heading { padding: 20px 20px 14px; }
.scroll-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid #2b352c; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
thead th { color: var(--muted); background: #151c17; white-space: nowrap; font-size: .77rem; letter-spacing: .035em; }
tbody th { font-weight: 650; }
td { color: #d1dad0; }
tbody tr:hover, .selected-row { background: #232d22; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rating-number { font-weight: 700; }
[data-player-row] { cursor: pointer; }
.player-link { padding: 2px 0; background: transparent; border: 0; color: var(--text); font-weight: 700; text-align: left; }
.player-link:hover, .player-link[aria-pressed="true"] { color: var(--accent); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; width: 16px; height: 16px; margin: 0; }
input:disabled { cursor: default; }
.order { display: flex; gap: 4px; align-items: center; }
.order > span { min-width: 19px; }
.order-help { margin-top: 4px; color: var(--muted); font-size: .82rem; }
.order-grip { cursor: grab; text-align: center; color: var(--muted); font-size: 1.06rem; user-select: none; }
.order-grip:active { cursor: grabbing; }
.drop-before > * { box-shadow: inset 0 2px var(--accent); }
.drop-after > * { box-shadow: inset 0 -2px var(--accent); }
.button.order-button { min-height: 28px; padding: 2px 5px; font-size: .75rem; border-color: #435245; }
.button.order-button:hover:not(:disabled) { background: #354530; }
.table-footer { padding: 13px 20px; }
.profile { position: sticky; top: 14px; }
.profile-name { display: flex; align-items: center; gap: 10px; margin: 13px 0 19px; }
.profile-name p { color: var(--muted); font-size: .86rem; }
.avatar { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border: 1px solid #596946; border-radius: 12px; background: #2b3624; color: var(--accent); font-weight: 800; }
.rating { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 12px 0; font-size: .85rem; }
.meter { grid-column: 1 / -1; height: 5px; background: #344135; border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.facts { margin: 18px 0 0; font-size: .83rem; }
.facts div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; text-align: right; }
.profile-match { border-top: 1px solid var(--border); padding-top: 12px; font-size: .85rem; }
.match-inspector { width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 28px); color: var(--text); overflow: auto; }
.match-inspector::backdrop { background: #0b100cbb; }
.match-inspector form { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.match-inspector .profile { position: static; padding: 0; border: 0; }
.inspector-content h2 { margin-top: 4px; }
.inspector-content h2:focus, .profile-name h2:focus { outline: none; }
.inspector-back, .opposition-table { margin-top: 14px; }
.opposition-table th, .opposition-table td { padding-inline: 8px; }
.tactics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.lower-grid { margin-top: 18px; }
fieldset { margin: 0; }
.plan-card .section-top .icon { color: var(--accent); }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 10px; background: #151c17; border: 1px solid #364237; border-radius: 8px; cursor: pointer; }
.choice:has(:checked) { background: #283322; border-color: #839854; }
.choice input { flex: 0 0 auto; }
.choice small { display: block; margin-top: 3px; color: var(--muted); }
.lower-grid p { margin-top: 8px; }
.bowling-order { display: grid; gap: 8px; margin-top: 12px; }
.bowling-order label { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; align-items: center; font-size: .9rem; }

.start-card { max-width: 560px; }
.match-banner { background: radial-gradient(ellipse at 90% 0%, #2b3f26 0%, #1a251c 53%, #19211a 80%); border-color: #445c3a; }
.score-main { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.score-main div strong { font-size: 1.25rem; }
.score-main small, .final-scores small { display: block; color: var(--muted); }
.score-main b { margin-left: auto; font-size: clamp(2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.075em; font-variant-numeric: tabular-nums; }
.score-stats, .at-crease { display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--muted); font-size: .88rem; }
.score-stats strong, .at-crease b { color: var(--text); }
.at-crease { margin-top: 12px; padding-top: 10px; border-top: 1px solid #435141; }
.chase { color: var(--accent); margin-top: 9px; font-size: .95rem; font-weight: 700; }
.result { margin: 7px 0 16px; font-size: clamp(1.55rem, 3vw, 2.35rem); }
.final-scores { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.final-scores > div { display: flex; align-items: center; gap: 10px; background: #10181170; padding: 10px; border-radius: 11px; }
.final-scores b { margin-left: auto; font-size: 1.55rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.match-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 14px 0; }
.match-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.innings-buttons { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 19px 13px; }
.button.segment { min-height: 36px; padding: 6px 10px; border-color: var(--border); font-size: .82rem; }
.button.segment[aria-pressed="true"] { color: var(--accent); background: #283522; border-color: #617746; }
.bowling-table { margin-top: 15px; }
tfoot { font-weight: 700; }
tfoot small { color: var(--muted); font-weight: 500; }
.ball-strip { display: flex; flex-wrap: wrap; gap: 5px; border-bottom: 1px solid var(--border); margin: 12px 0 0; padding-bottom: 10px; min-height: 12px; }
.ball { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .73rem; font-weight: 800; color: #e0e9de; background: #333f34; }
.ball-4, .ball-6 { background: var(--accent); color: var(--ink); }
.ball-W { background: #582f2a; color: #ffd1c6; }
.ball-Wd, .ball-Nb { background: #4d401e; color: #ffe098; }
.feed-list { list-style: none; padding: 0; margin: 0; max-height: 455px; overflow: auto; scrollbar-width: thin; }
.feed-list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 3px 9px 0; border-bottom: 1px solid var(--border); font-size: .83rem; }
.feed-list small { display: block; color: var(--muted); }
.over-label { color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { font-size: .87rem; color: var(--muted); margin-top: 10px; }

@media (max-width: 1140px) {
  .club-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .match-grid { grid-template-columns: minmax(0, 1fr); }
  .match-grid .feed { grid-row: 1; }
  .feed-list { max-height: 220px; }
}
@media (max-width: 900px) {
  #app { grid-template-columns: 168px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .content, .topbar { padding-inline: 20px; }
  .squad-grid { grid-template-columns: minmax(0, 1fr); }
  .profile { position: static; grid-row: 1; }
}
@media (max-width: 700px) {
  #app { display: block; }
  .sidebar { position: static; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand img { width: 35px; height: 35px; }
  .brand b { font-size: 1.55rem; }
  .nav-group { margin-top: 13px; }
  .sidebar-label, .side-club { display: none; }
  nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .nav-item { flex-direction: column; justify-content: center; text-align: center; gap: 5px; padding: 7px 2px; font-size: .75rem; }
  .topbar { height: 46px; font-size: .79rem; }
  .content { padding-top: 16px; }
  .hero { min-height: 270px; }
  .hero::before { background-position: center, 62% 55%, center; }
  .overview-grid, .tactics-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: start; flex-direction: column; }
  .final-scores { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .content, .topbar { padding-inline: 12px; }
  .card { padding-inline: 14px; }
  .table-card { padding-inline: 0; }
  .crest.large { width: 39px; height: 39px; font-size: .87rem; }
  .fixture { gap: 6px; }
  .fixture-team { gap: 5px; }
  .fixture-team strong { font-size: 1.04rem; }
  .club-card { padding: 8px; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
