/* Phone-width app shell. Ground list styled like matchday ticket stubs; a guide opens over it. */
:root {
  --bg: #eef1ec;
  --surface: #ffffff;
  --ink: #14211a;
  --muted: #5d6b62;
  --line: #d5dcd5;
  --accent: #c41e3a;      /* turnstile red */
  --pitch: #1e6b3c;       /* visited */
  --pitch-soft: #dcefe2;
  --chip: #e2e8e2;
  --f-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1511; --surface: #17211b; --ink: #e6ede8; --muted: #95a59a; --line: #2a3830;
    --accent: #ff5468; --pitch: #5fcf8a; --pitch-soft: #193726; --chip: #223029; color-scheme: dark;
  }
}

/* Shades of each division's colour, used by the menus and the guide text.
   Light mode: soft tint behind menu items, deep shade for their text, deep fill + white text when selected.
   Dark mode: the bright colour is the selected fill, with dark text on it. */
:root {
  --accent-deep: color-mix(in srgb, var(--accent) 72%, var(--ink));
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--bg));
  --accent-soft-hover: color-mix(in srgb, var(--accent) 20%, var(--bg));
  --accent-strong: var(--accent-deep);
  --on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent-deep: color-mix(in srgb, var(--accent) 80%, var(--ink));
    --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--bg));
    --accent-soft-hover: color-mix(in srgb, var(--accent) 28%, var(--bg));
    --accent-strong: var(--accent);
    --on-accent: var(--bg);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.shell { max-width: 600px; margin: 0 auto; padding-inline: 16px; padding-block: 0 32px; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Header */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-block: 20px 6px; }
.brand { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; line-height: .9; font-size: clamp(2rem, 9vw, 2.6rem); text-wrap: balance; letter-spacing: .01em; margin: 0; }
.brand span { color: var(--accent); display: block; font-size: clamp(.8rem, 3.6vw, 1rem); letter-spacing: .12em; white-space: nowrap; font-weight: 700; margin-bottom: 4px; }
.tally { text-align: right; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tally b { display: block; font-family: var(--f-display); font-size: 1.9rem; color: var(--pitch); letter-spacing: 0; line-height: 1; }
.bar { height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; margin-block: 10px 4px; }
.bar i { display: block; height: 100%; background: var(--pitch); width: 0; transition: width .4s; }
.barnote { font-size: .78rem; color: var(--muted); margin: 0 0 8px; }

/* Controls */
.controls { position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); padding-block: 8px 10px; z-index: 5; display: grid; gap: 10px; }
.search { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; color: var(--ink); }
.search:focus { border-color: var(--ink); outline: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--accent-soft); color: var(--accent-deep); padding: 7px 13px; border-radius: 999px; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.chip:hover { background: var(--accent-soft-hover); }
.chip[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); }
.chip small { font-family: var(--f-data); opacity: .7; margin-left: 4px; font-size: .72rem; }
.status { font-size: .85rem; color: var(--muted); margin: 6px 0; }
.status button { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

/* Ticket list */
.list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 6px 0 0; }
.ticket { display: grid; grid-template-columns: 1fr auto; background: var(--surface); border-radius: 12px; overflow: hidden; cursor: pointer; border: 0; text-align: left; width: 100%; padding: 0; }
.ticket:hover .t-main { background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
.t-main { padding: 14px 16px; min-width: 0; transition: background .15s; }
.t-league { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.t-ground { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.5rem; line-height: 1; margin: 3px 0 4px; text-wrap: balance; }
.t-club { color: var(--muted); font-size: .88rem; }
.t-stub { border-left: 2px dashed var(--line); padding: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 78px; gap: 2px; position: relative; }
.t-stub::before, .t-stub::after { content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.t-stub::before { top: -8px; } .t-stub::after { bottom: -8px; }
.t-code { font-family: var(--f-display); font-weight: 900; font-size: 1.6rem; line-height: 1; }
.t-codelbl { font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.visited-tag { margin-top: 6px; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--pitch); background: var(--pitch-soft); padding: 2px 7px; border-radius: 999px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.skeleton { height: 84px; border-radius: 12px; background: var(--surface); opacity: .6; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.foot { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 28px; }
.foot .linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.foot br + * { margin-top: 6px; }

/* Guide */
.detail { position: fixed; inset: 0; background: var(--bg); overflow-y: auto; z-index: 20; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); -webkit-overflow-scrolling: touch; }
.d-head { background: var(--ink); color: var(--bg); position: relative; overflow: hidden; }
.d-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.d-head .shell { position: relative; padding-block: 14px 22px; }
.back { background: none; border: 0; color: inherit; opacity: .85; cursor: pointer; padding: 6px 0; font-weight: 600; font-size: .9rem; }
/* The guide header is dark in light mode and light in dark mode, so the division label gets its own shade (--head-accent, set per division). */
.d-league { color: var(--head-accent, var(--accent)); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: 10px; }
.d-ground { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.4rem, 11vw, 3.4rem); line-height: .92; margin: 4px 0 8px; text-wrap: balance; }
.d-club { opacity: .85; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.btn { border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 700; font-size: .88rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-tick { background: var(--bg); color: var(--ink); }
.btn-tick[aria-pressed="true"] { background: var(--pitch); color: var(--bg); }
.btn-out { background: transparent; color: var(--bg); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bg) 45%, transparent); }

.notice { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; padding: 12px 14px; margin-top: 18px; font-size: .88rem; }
.notice p { margin: 0; }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; margin: 18px 0 0; }
.spec { background: var(--surface); padding: 12px 14px; min-width: 0; }
.spec.wide { grid-column: 1 / -1; }
.spec dt { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.spec dd { margin: 2px 0 0; font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 6px; margin-top: 20px; padding-block: 10px; border-bottom: 1.5px solid var(--line); overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: var(--accent-soft); color: var(--accent-deep); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.tab:hover { background: var(--accent-soft-hover); }
.tab[aria-selected="true"] { background: var(--accent-strong); color: var(--on-accent); }

/* Guide body text pulled from the site */
.prose { padding-block: 16px 4px; max-width: 65ch; overflow-wrap: break-word; }
.prose > * + * { margin-top: .8em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
/* Levels set apart by colour as well as weight:
   section headings in the division colour with a rule above, sub-headings and named places
   (pubs, hotels) in a deeper shade of it, and labels like "Price:" as small grey captions. */
.prose h3 { font-family: var(--f-display); text-transform: uppercase; font-size: 1.45rem; line-height: 1.05; letter-spacing: .01em; text-wrap: balance;
  color: var(--accent); margin: 1.8em 0 0; padding-top: .9em; border-top: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.prose h4 { font-size: 1rem; font-weight: 700; color: var(--accent-deep); margin: 1.4em 0 0; }
.prose > h3:first-child, .prose > h4:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 + h4, .prose h3 + p, .prose h3 + ul, .prose h4 + p, .prose h4 + ul { margin-top: .5em; }
.prose .item > strong:first-child { color: var(--accent-deep); font-size: 1.04em; }
.prose p.item { margin-top: 1.4em; }
.prose h3 + p.item, .prose h4 + p.item { margin-top: .6em; }
.prose strong.label { color: var(--muted); font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.prose strong.warn { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--accent); }
.prose .kv { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); background: var(--surface); border-radius: 10px; overflow: hidden; margin-top: .8em; }
.prose .kv dt, .prose .kv dd { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); font-size: .88rem; }
.prose .kv dt { font-weight: 700; }
.prose .kv dt:first-of-type, .prose .kv dt:first-of-type + dd { border-top: 0; }
.prose .table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; font-size: .88rem; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.loading { color: var(--muted); padding: 24px 0; }
.disclaimer { font-size: .78rem; color: var(--muted); margin-top: 24px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
