/* Sporting Circle — stylesheet
   Palette: circle blue, ink navy, tip gold; cool-biased neutrals. */
:root {
  --ground: #ffffff;
  --surface: #f3f6fa;
  --surface-2: #e9eef5;
  --border: #d9e0e8;
  --ink: #0e1f33;
  --muted: #5e6e82;
  --blue: #14468c;
  --blue-soft: #e4ecf8;
  --gold: #e8a317;
  --gold-soft: #fff4d6;
  --live: #d63a3a;
  --win: #1f8a4c;
  --loss: #c0392b;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(14, 31, 51, .06), 0 4px 14px rgba(14, 31, 51, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e1521; --surface: #16202e; --surface-2: #1d2a3b; --border: #26324a;
    --ink: #e8edf3; --muted: #93a2b7; --blue: #6fa3f0; --blue-soft: #1a2c48;
    --gold: #f0b429; --gold-soft: #3a2d10; --live: #ff6b6b; --win: #4cc37a; --loss: #f07167;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0e1521; --surface: #16202e; --surface-2: #1d2a3b; --border: #26324a;
  --ink: #e8edf3; --muted: #93a2b7; --blue: #6fa3f0; --blue-soft: #1a2c48;
  --gold: #f0b429; --gold-soft: #3a2d10; --live: #ff6b6b; --win: #4cc37a; --loss: #f07167;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.topbar { border-bottom: 1px solid var(--border); background: var(--ground); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { height: 34px; width: auto; }
.brand-word { white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .02em; line-height: 1; text-transform: uppercase; }
.brand-word b { color: var(--blue); font-weight: 700; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.nav button {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 20px 12px 17px;
  font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); white-space: nowrap;
}
.nav button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.nav button:hover { color: var(--ink); }
.clock { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 1300px) {
  .topbar .wrap { flex-wrap: wrap; row-gap: 0; }
  .nav { order: 3; flex-basis: 100%; margin-left: 0; border-top: 1px solid var(--border); }
  .nav button { padding: 12px 12px 9px; }
  .clock { margin-left: auto; }
}
.clock .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--win); margin-right: 6px; vertical-align: middle; }
.clock.stale .dot { background: var(--gold); }

/* ---------- Ticker ---------- */
.ticker { background: var(--surface); border-bottom: 1px solid var(--border); }
.ticker .wrap { display: flex; align-items: stretch; gap: 0; }
.ticker-label { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 14px; color: var(--muted); padding: 10px 14px 10px 0; border-right: 1px solid var(--border); display: flex; align-items: center; white-space: nowrap; }
.ticker-track { display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin; }
.tick { display: grid; grid-template-columns: auto auto; column-gap: 10px; row-gap: 1px; padding: 8px 14px; border-right: 1px solid var(--border); font-size: 13px; min-width: 150px; white-space: nowrap; }
.tick .st { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; max-width: 220px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tick .st.live { color: var(--live); font-weight: 700; }
.tick .sc { font-weight: 700; text-align: right; }
.tick .win { color: var(--ink); }
.tick .los { color: var(--muted); }

/* ---------- Layout ---------- */
.main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding: 28px 0 48px; }
@media (max-width: 900px) { .main { grid-template-columns: 1fr; } }

.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.section-head h2 { font-family: var(--display); font-size: 26px; text-transform: uppercase; letter-spacing: .03em; margin: 0; line-height: 1; }
.section-head .sub { color: var(--muted); font-size: 13px; }
.section-head .right { margin-left: auto; }
.select { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 5px 8px; font-size: 13px; font-family: var(--body); }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } }
.news-grid .lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: center; }
@media (max-width: 700px) { .news-grid .lead { grid-template-columns: 1fr; } }
.story { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.story .thumb:empty { display: none; }
.story .thumb { aspect-ratio: 16 / 9; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.story .thumb img { width: 100%; height: 100%; object-fit: cover; }
.story .kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); font-weight: 700; }
.story h3 { font-family: var(--display); font-size: 22px; line-height: 1.1; margin: 0; text-wrap: balance; }
.lead .story h3 { font-size: 34px; }
.story p { margin: 0; color: var(--muted); font-size: 15px; }
.story .meta { font-size: 12px; color: var(--muted); }
.story:hover h3 { color: var(--blue); }

/* ---------- Fixtures / results ---------- */
.fixtures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .fixtures { grid-template-columns: 1fr; } }
.match { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--ground); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.match .lg { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.match .lg .state { font-weight: 700; }
.match .lg .state.live { color: var(--live); }
.match .lg .state.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .match .lg .state.live::before { animation: none; } }
.match .team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match .team img { width: 20px; height: 20px; object-fit: contain; }
.match .team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .team.los { color: var(--muted); }
.match .score { font-family: var(--display); font-size: 20px; font-weight: 700; text-align: right; }
.match .score.los { color: var(--muted); }
.match .sets { font-size: 13px; letter-spacing: .04em; }
.match .info { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.match.single { grid-template-columns: 1fr; }
.match.single .name { font-family: var(--display); font-size: 19px; }
.sessions { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.sessions li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 3px; }
.sessions li span:first-child { color: var(--ink); }
.sessions li.post { opacity: .6; }
.sessions li.in span:first-child { color: var(--live); font-weight: 700; }

/* ---------- Standings ---------- */
.table-wrap { overflow-x: auto; }
table.standings { width: 100%; border-collapse: collapse; font-size: 14px; }
.standings th, .standings td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.standings th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.standings th:nth-child(2), .standings td:nth-child(2) { text-align: left; width: 100%; }
.standings td.rk { color: var(--muted); }
.standings td.pts { font-weight: 700; }
.standings tr.cl td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.standings tr.rel td:first-child { box-shadow: inset 3px 0 0 var(--loss); }
.standings .tm { display: flex; align-items: center; gap: 8px; }
.standings .tm img { width: 18px; height: 18px; object-fit: contain; }

/* ---------- Tips rail ---------- */
.rail { position: sticky; top: 80px; align-self: start; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .rail { position: static; } }
.tips-card { background: var(--surface); border-radius: var(--radius); border-top: 4px solid var(--gold); padding: 16px; box-shadow: var(--shadow); }
.tips-card h2 { font-family: var(--display); font-size: 24px; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 4px; line-height: 1; }
.tips-card .record { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.tips-card .record b { color: var(--ink); }
.tip { border-top: 1px solid var(--border); padding: 10px 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.tip .ev { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tip .sel { font-family: var(--display); font-size: 19px; line-height: 1.1; }
.tip .odds { font-family: var(--display); font-size: 19px; color: var(--blue); text-align: right; }
.tip .note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.tip .foot { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.won { background: var(--win); color: #fff; }
.pill.lost { background: var(--loss); color: #fff; }
.pill.void { background: var(--surface-2); }
.pill.pending { background: var(--gold-soft); color: var(--ink); }
.conf { display: inline-flex; gap: 2px; }
.conf i { width: 8px; height: 8px; border-radius: 2px; background: var(--border); }
.conf i.on { background: var(--gold); }
.tips-empty { color: var(--muted); font-size: 14px; padding: 10px 0; }
.tips-card .admin-link { display: block; margin-top: 12px; text-align: right; font-size: 12px; color: var(--muted); background: none; border: 0; padding: 0; margin-left: auto; }
.tips-card .admin-link:hover { color: var(--ink); }

.about-card { font-size: 13px; color: var(--muted); padding: 0 4px; }
.about-card h3 { font-family: var(--display); font-size: 16px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); margin: 0 0 4px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 20px 0 32px; color: var(--muted); font-size: 13px; display: grid; gap: 14px; }
.footer .disclaimer { max-width: 80ch; line-height: 1.5; }
.footer .disclaimer strong { color: var(--ink); }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; }

/* ---------- Loading / empty ---------- */
.empty { color: var(--muted); font-size: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 56px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Admin panel ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 16, 28, .55); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 50; }
.modal.open { display: flex; }
.panel { background: var(--ground); color: var(--ink); width: min(760px, 100%); border-radius: 8px; box-shadow: var(--shadow); border-top: 4px solid var(--gold); }
.panel header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel header h2 { margin: 0; font-family: var(--display); font-size: 24px; text-transform: uppercase; letter-spacing: .03em; }
.panel .body { padding: 20px; display: grid; gap: 20px; }
.form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form input, .form select, .form textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; width: 100%; }
.form .c2 { grid-column: span 2; } .form .c3 { grid-column: span 3; } .form .c6 { grid-column: span 6; }
@media (max-width: 640px) { .form .c2, .form .c3 { grid-column: span 3; } }
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 8px 14px; font-weight: 600; font-size: 14px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1200; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: var(--loss); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row .spacer { flex: 1; }
.admin-list { display: grid; gap: 8px; }
.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); align-items: center; font-size: 14px; }
.admin-row .r1 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-row .r1 b { font-family: var(--display); font-size: 18px; }
.admin-row .acts { display: flex; gap: 6px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; }
.login { display: grid; gap: 12px; max-width: 320px; }
.login input { font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); }

/* ---------- Members ---------- */
.account-slot { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.account-slot .hello { font-size: 13px; color: var(--muted); }
.account-slot .hello b { color: var(--ink); }
@media (max-width: 1300px) { .account-slot { margin-left: 8px; } }
.panel.narrow { width: min(460px, 100%); }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 8px 14px; font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stack input:not([type=checkbox]) { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px; width: 100%; }
.stack label.check { grid-template-columns: auto 1fr; align-items: start; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.stack label.check input { margin-top: 3px; }
.stack .hint { margin: 0; }
.notice { padding: 10px 12px; border-radius: var(--radius); font-size: 14px; background: var(--surface); border: 1px solid var(--border); }
.notice.error { background: var(--gold-soft); border-color: var(--loss); }
.notice.warn { background: var(--gold-soft); }
.notice.ok { border-color: var(--win); }
.check-title { font-family: var(--display); font-size: 24px; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 6px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; font: inherit; cursor: pointer; }
.tip.locked .blur { filter: blur(5px); user-select: none; color: var(--muted); }
.gate { background: var(--gold-soft); border-radius: var(--radius); padding: 12px; font-size: 14px; margin: 4px 0 8px; }
table.members { width: 100%; border-collapse: collapse; font-size: 13px; }
.members th, .members td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.members th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
#members-section { margin-top: 8px; }
#members-section .section-head { align-items: center; }
