:root {
  --bg: #f4f6f2;
  --card: #ffffff;
  --line: #dfe5dc;
  --text: #17211b;
  --muted: #5d6d62;
  --felt: #17733e;
  --felt-dark: #0f5a2f;
  --felt-soft: #17733e14;
  --gold: #a8790f;
  --warn: #b4501f;
  --hero-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1512;
    --card: #18211c;
    --line: #26332b;
    --text: #eef3ef;
    --muted: #9db0a3;
    --felt: #2aa35e;
    --felt-dark: #0f3d24;
    --felt-soft: #2aa35e1f;
    --gold: #e8b84a;
    --warn: #ef8a5c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.hero {
  background: radial-gradient(ellipse at top, #1f8a4c, var(--felt-dark));
  color: var(--hero-text);
  padding: 22px 0 30px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-weight: 800; letter-spacing: .3px; font-size: 15px; opacity: .95;
}
.hero h1 { margin: 18px 0 4px; font-size: 32px; letter-spacing: -.6px; line-height: 1.1; }
.sub { margin: 0; opacity: .85; }

/* view tabs */
.hero { padding-bottom: 0; }
.tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  color: #ffffffcc; text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 10px 14px; border-radius: 10px 10px 0 0; white-space: nowrap;
}
.tabs a:hover { color: #fff; background: #ffffff14; }
.tabs a[aria-current="page"] { background: var(--bg); color: var(--text); }

/* filters */
.filters { margin: 18px 0 6px; }
.filters[hidden] { display: none; }
#q {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit;
}
#q:focus { outline: 2px solid var(--felt); outline-offset: 1px; }
details { margin-top: 10px; }
summary {
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted);
  list-style: none; display: inline-flex; gap: 6px; align-items: center; user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }
.pill { background: var(--felt); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.frow { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: start; margin-top: 10px; }
.flabel { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding-top: 8px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px;
}
.linkbtn { background: none; border: 0; color: var(--felt); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; margin-top: 12px; }
.linkbtn:hover { text-decoration: underline; }
.chip[aria-pressed="true"] { background: var(--felt); border-color: var(--felt); color: #fff; }
.count { color: var(--muted); font-size: 13px; margin: 8px 0 4px; }

.day {
  margin: 26px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold); font-weight: 700; display: flex; gap: 8px; align-items: baseline;
}
.day .rel {
  color: var(--felt); text-transform: none; letter-spacing: 0; font-size: 12px;
  background: var(--felt-soft); padding: 1px 8px; border-radius: 6px;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
  display: grid; grid-template-columns: 76px 1fr; gap: 14px;
}
.card.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.time { font-weight: 700; font-size: 15px; white-space: nowrap; }
.time small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; white-space: normal; }
.name { font-weight: 700; font-size: 16px; margin: 0 0 2px; }
.where { color: var(--muted); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { background: var(--felt-soft); color: var(--felt); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.tag.fee { background: transparent; border: 1px solid var(--line); color: var(--text); }
.tag.rec { color: var(--gold); background: transparent; border: 1px solid var(--gold); }
.fmt { font-size: 13px; color: var(--muted); margin-top: 6px; }
.flag { font-size: 12px; color: var(--warn); margin-top: 6px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.actions a, .actions button {
  color: var(--felt); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
}
.actions a:hover, .actions button:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

.foot { color: var(--muted); font-size: 12px; margin-top: 40px; padding-bottom: 48px; }
.foot p { margin: 4px 0; }

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .card { grid-template-columns: 1fr; gap: 4px; }
}

/* links inside cards */
.where a, .by a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.where a:hover, .by a:hover { color: var(--felt); border-color: var(--felt); }
.by { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* game dots */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.g8 { background: #111; box-shadow: 0 0 0 1px #888 inset; }
.g9 { background: #e8b400; }
.g10 { background: #2a5bd7; }

/* calendar */
.calhead { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 10px; }
.calhead h2 { margin: 0; font-size: 20px; }
.navbtn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 16px;
}
.navbtn:disabled { opacity: .35; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: center; font-weight: 700; padding: 4px 0; }
.cell {
  min-height: 92px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cell.out { opacity: .35; }
.cell.past { opacity: .5; }
.cell.today .num { background: var(--felt); color: #fff; }
.cell.sel { border-color: var(--felt); box-shadow: 0 0 0 1px var(--felt) inset; }
.cell.none { cursor: default; }
.num { font-size: 12px; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.ev { display: flex; gap: 4px; align-items: center; font-size: 11px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span:last-child { overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 11px; color: var(--muted); }
.dots { display: none; gap: 3px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; align-items: center; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }

/* map */
#map { height: 460px; border-radius: 14px; border: 1px solid var(--line); margin: 10px 0 6px; z-index: 0; }
.leaflet-popup-content { font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; margin: 12px 14px; }
.pop h4 { margin: 0 0 2px; font-size: 14px; }
.pop .pc { color: #5d6d62; margin-bottom: 6px; }
.pop ul { margin: 0 0 8px; padding-left: 16px; }
.pop a { color: #17733e; font-weight: 600; }

/* directory grids (bars / directors) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 14px; }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; text-decoration: none; color: var(--text);
}
.tile:hover { border-color: var(--felt); }
.tile h3 { margin: 0 0 2px; font-size: 16px; }
.tile .meta { color: var(--muted); font-size: 13px; }
.tile .big { font-size: 26px; font-weight: 800; color: var(--felt); margin-top: 8px; line-height: 1; }
.tile .big small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile .next { font-size: 13px; margin-top: 8px; }
.tile.dim { opacity: .55; }

/* detail page header */
.dhead { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-top: 14px; }
.dhead .crumb { font-size: 13px; color: var(--felt); text-decoration: none; font-weight: 600; }
.dhead h2 { margin: 6px 0 2px; font-size: 22px; }
.dhead p { margin: 2px 0; color: var(--muted); font-size: 14px; }
.dhead .actions { margin-top: 10px; }
.note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

@media (max-width: 640px) {
  .cell { min-height: 54px; padding: 4px; align-items: center; }
  .cell .ev, .cell .more { display: none; }
  .cell .dots { display: flex; justify-content: center; }
  #map { height: 340px; }
  .frow { grid-template-columns: 1fr; gap: 4px; }
  .flabel { padding-top: 0; }
}

/* submit a tournament */
.submit-btn {
  display: inline-block; margin-top: 14px; background: #fff; color: var(--felt-dark);
  font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 999px; text-decoration: none;
}
.submit-btn:hover { background: #f0f7f2; }
.alerts-btn { margin-left: 8px; background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #ffffffb3; }
.alerts-btn:hover { background: #ffffff1f; }
.code-form { display: grid; gap: 10px; max-width: 360px; margin-top: 10px; }
.code-form p { font-size: 14px; }
.code-form input { text-transform: uppercase; letter-spacing: 2px; font-size: 18px !important; }
.code { font-size: 24px; letter-spacing: 3px; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; }
.submit p { color: var(--muted); }
#submit-form { display: grid; gap: 14px; margin-top: 14px; max-width: 560px; }
.fl { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.fl .req { color: var(--warn); font-weight: 600; font-size: 12px; }
.fl input[type=text], .fl textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.fl input[type=file] { font: inherit; font-weight: 400; }
#flyer-preview { max-width: 220px; max-height: 300px; border-radius: 10px; border: 1px solid var(--line); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn {
  justify-self: start; background: var(--felt); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 20px; font: inherit; font-weight: 700; cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.thanks { font-size: 16px; color: var(--text) !important; font-weight: 600; }
.signin-why { font-size: 14px; }
.signin-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.btn.fb { background: #1877f2; border-radius: 999px; padding: 10px 18px; }
[hidden] { display: none !important; }

/* accounts: follow buttons, alerts page */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #e0a526; color: #1b1b1b; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.actions button.follow.on { color: var(--felt-dark); }
.dhead .follow { border: 1px solid var(--felt); border-radius: 999px; padding: 6px 14px; text-decoration: none !important; }
.dhead .follow.on { background: var(--felt); color: #fff; }
.asec { margin-top: 18px; }
.asec h3 { font-size: 15px; margin: 0 0 6px; }
.flist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.flist li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.flist .kind { color: var(--muted); font-size: 12px; margin-left: 6px; }
.flist .linkbtn { margin-top: 0; }
.alert { display: block; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); padding: 8px 0; }
.alert b { display: block; font-size: 14px; }
.alert span { color: var(--muted); font-size: 13px; }
.alert.unread b::before { content: "● "; color: #e0a526; }
.linkbtn.danger { color: var(--warn); }

/* Phase 2: verified pages, director tools, live brackets */
.verified { font-size: 13px; font-weight: 700; color: #fff; background: var(--felt); border-radius: 999px; padding: 2px 9px; vertical-align: middle; }
.tag.posted { background: #e8f4ec; color: var(--felt-dark); border-color: #cfe6d7; }
.row-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; font-size: 13px; font-weight: 600; }
.row-actions a { color: var(--felt); }
.claim-form, .event-form, .reg-form, .start-form { display: grid; gap: 12px; max-width: 560px; }
.event-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl select, .fl input[type=date], .fl input[type=time], .fl input[type=number], .fl input[type=url], .inline-form input {
  font: inherit; font-weight: 400; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.inline-form input[name=name] { flex: 1 1 160px; }
.inline-form input[name=rating] { width: 90px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.plist { margin: 6px 0 0; padding-left: 22px; font-size: 14px; }
.live { color: #c0392b; font-weight: 700; }
.champ { font-size: 18px; font-weight: 800; color: var(--text); }
.busy { opacity: .55; pointer-events: none; }
.host-actions { display: flex; gap: 16px; margin: 8px 0; }
.host-actions .linkbtn { margin-top: 0; }
.bracket { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.bcol { min-width: 170px; display: grid; gap: 8px; align-content: start; }
.bcol h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.match { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--card); font-size: 13px; display: grid; gap: 3px; }
.match.ready { border-color: var(--felt); }
.match.called { box-shadow: inset 3px 0 0 #e0a526; }
.match .mid { font-size: 11px; color: var(--muted); }
.match .won { font-weight: 800; }
.match .lost { color: var(--muted); text-decoration: line-through; }
.tbd { color: var(--muted); }
.pick { font: inherit; text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.pick:hover { border-color: var(--felt); background: #e8f4ec; }
.callrow select { font: inherit; font-size: 12px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.tbl { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 4px; font-size: 14px; background: var(--card); }
.tno { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.vs { font-size: 11px; color: var(--muted); }
.standings { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.standings th, .standings td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.standings tr.out { color: var(--muted); }
@media (max-width: 640px) { .event-form .two { grid-template-columns: 1fr; } }
a.btn { display: inline-block; text-decoration: none; margin: 4px 0; }
.btn.watch { background: #c0392b; }
.results .place, .history .place { white-space: nowrap; font-weight: 700; }
.results tr.p1 td { font-weight: 800; }
.tag.live-tag { background: #fdecea; color: #c0392b; border-color: #f5c6c0; }
.watch-link { color: #c0392b !important; }

/* scorekeeper */
.score-setup { display: grid; gap: 12px; max-width: 560px; }
.score-setup .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score-setup input:not([type]), .score-setup input[type=number] { font: inherit; font-weight: 400; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.race-preview { font-weight: 700; color: var(--felt-dark); margin: 0; }
.score-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; margin-bottom: 8px; }
.score-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-side { display: grid; gap: 4px; justify-items: center; align-content: center; min-height: 260px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; padding: 14px 8px; touch-action: manipulation; }
.score-side:active { transform: scale(.98); background: #e8f4ec; }
.score-side .who { font-size: 18px; font-weight: 800; text-align: center; }
.score-side .brk { display: block; font-size: 12px; font-weight: 700; color: var(--felt); }
.score-side .big { font-size: 88px; font-weight: 900; line-height: 1; color: var(--felt-dark); }
.score-side .race { font-size: 13px; color: var(--muted); }
.score-side.won { border-color: var(--felt); background: #e8f4ec; }
.score-side.lost { opacity: .55; }
.score-side .banner { font-weight: 800; color: var(--felt-dark); }
.score-side:disabled { cursor: default; }
.score-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn.ghost { background: transparent; color: var(--felt); box-shadow: inset 0 0 0 2px var(--felt); }
@media (max-width: 640px) { .score-side { min-height: 230px; } .score-side .big { font-size: 72px; } .score-side .who { font-size: 16px; } .score-setup .two { grid-template-columns: 1fr; } }
.score-setup select, .score-setup input { width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; }
.score-setup .fl, .score-setup .two > * { min-width: 0; }
.submit-btn { margin-right: 8px; }
.alerts-btn { margin-left: 0; }

/* scorekeeper: league formats */
.score-setup .sub { display: grid; gap: 12px; }
.score-setup .sub.two { grid-template-columns: 1fr 1fr; }
.score-setup .pair { display: flex; gap: 8px; }
.score-setup select { font: inherit; font-weight: 400; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.nine-side { display: grid; gap: 3px; justify-items: center; align-content: center; min-height: 170px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); padding: 12px 8px; text-align: center; }
.nine-side.shooting { border-color: var(--felt); box-shadow: 0 0 0 3px #1f8a4c33; }
.nine-side .who { font-size: 16px; font-weight: 800; }
.nine-side .big { font-size: 60px; font-weight: 900; line-height: 1; color: var(--felt-dark); }
.nine-side .race { font-size: 13px; color: var(--muted); }
.nine-side.won { border-color: var(--felt); background: #e8f4ec; }
.nine-side.lost { opacity: .55; }
.nine-side .banner { font-weight: 800; color: var(--felt-dark); }
.nine-help { margin-top: 12px; }
.balls { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin: 8px 0; }
.ball { aspect-ratio: 1; border-radius: 50%; border: 0; font: inherit; font-weight: 900; font-size: 18px; color: #111; cursor: pointer; display: grid; place-items: center; align-content: center; position: relative; touch-action: manipulation; }
.ball span { background: #fff; border-radius: 50%; width: 62%; aspect-ratio: 1; display: grid; place-items: center; font-size: 15px; }
.ball small { position: absolute; bottom: -16px; font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ball.down { opacity: .3; }
.b1 { background: #f2c200; } .b2 { background: #1d4ed8; } .b3 { background: #dc2626; } .b4 { background: #6d28d9; } .b5 { background: #ea580c; }
.b6 { background: #15803d; } .b7 { background: #7f1d1d; } .b8 { background: #111; } .b9 { background: linear-gradient(#fff 22%, #f2c200 22% 78%, #fff 78%); }
.dead-toggle { margin: 18px 0 4px; font-weight: 500; }
.clocks { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-bottom: 10px; }
.match-clock { display: grid; gap: 4px; justify-items: center; align-content: center; border: 2px solid var(--line); border-radius: 16px; padding: 10px; background: var(--card); }
.match-clock b { font-size: 34px; font-variant-numeric: tabular-nums; }
.match-clock.up b { color: #c0392b; }
.shot-clock { display: grid; gap: 2px; justify-items: center; align-content: center; border: 2px solid var(--felt); border-radius: 16px; padding: 10px; background: #e8f4ec; color: var(--text); font: inherit; cursor: pointer; touch-action: manipulation; }
.shot-clock b { font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--felt-dark); }
.shot-clock.warn { background: #fff4d6; border-color: #e0a526; }
.shot-clock.warn b { color: #9a6700; }
.shot-clock.out { background: #fdecea; border-color: #c0392b; }
.shot-clock.out b { color: #c0392b; }
.shot-clock .note { text-align: center; }
@media (max-width: 640px) { .score-setup .sub.two { grid-template-columns: 1fr; } .balls { gap: 4px; } .ball { font-size: 14px; } .ball span { font-size: 12px; } }

/* challenge board */
.safety { background: #fff8e6; border: 1px solid #f0d99a; border-radius: 10px; padding: 8px 10px; color: #6b5200 !important; }
.ch-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; background: var(--card); display: grid; gap: 4px; }
.ch-card.matched { border-color: var(--felt); background: #f3faf5; }
.ch-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 15px; }
.ch-where { font-size: 14px; color: var(--muted); }
.ch-where a { color: var(--felt); font-weight: 600; }
.ch-note { font-size: 14px; }
.ch-matched { font-size: 14px; font-weight: 700; color: var(--felt-dark); }
.ch-actions { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.ch-actions .linkbtn { margin-top: 0; }
.linkbtn.report { color: var(--muted); font-weight: 500; }
.ch-form { display: grid; gap: 12px; max-width: 560px; margin-top: 12px; }
.ch-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ch-form select, .ch-form input { font: inherit; font-weight: 400; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; box-sizing: border-box; min-width: 0; }
#ch-post summary { list-style: none; display: inline-block; cursor: pointer; }
#ch-post summary::-webkit-details-marker { display: none; }
#bar-challenges h3 { font-size: 15px; margin: 6px 0 0; }
@media (max-width: 640px) { .ch-form .two { grid-template-columns: 1fr; } }
#ch-post summary::marker { content: ""; }
.race-line { font-size: 12px; font-weight: 700; color: var(--felt-dark); }

/* profiles */
.profile { margin: 10px 0; display: grid; gap: 8px; }
.profile-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.profile-about { color: var(--text) !important; font-size: 15px !important; margin: 0; }
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.profile-facts dt { color: var(--muted); font-weight: 600; }
.profile-facts dd { margin: 0; }
.profile-links { font-size: 14px; font-weight: 600; }
.profile-links a, .edit-profile { color: var(--felt); }
.edit-profile { font-size: 13px; font-weight: 700; }
.days { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.days legend { font-weight: 600; margin-bottom: 6px; }
#photo-preview { max-width: 240px; border-radius: 10px; border: 1px solid var(--line); }
.tag.practice { background: #fff4d6; color: #9a6700; border-color: #f0d99a; }

/* stats */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.stat-tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; background: var(--card); display: grid; gap: 2px; }
.stat-tile b { font-size: 24px; color: var(--felt-dark); }
.stat-tile span { font-size: 12px; color: var(--muted); }
.stat-table td:first-child { font-weight: 600; }
.res-win { color: var(--felt); } .res-loss { color: #c0392b; } .res-draw { color: var(--muted); }
.where-played { border-top: 1px dashed var(--line); padding-top: 10px; }
@media (max-width: 640px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }

/* match card */
.card-table { font-size: 22px; text-align: center; margin: 10px 0; }
.card-table b { font-size: 56px; color: var(--felt-dark); display: block; line-height: 1; }
.card-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; margin: 8px 0 12px; }
.card-vs > div { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; background: var(--card); }
.card-vs b { font-size: 18px; }
.card-race { font-weight: 800; color: var(--felt-dark); }
.reported { font-size: 12px; font-weight: 700; color: var(--felt-dark); background: #e8f4ec; border-radius: 8px; padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reported.warn { background: #fff4d6; color: #9a6700; }

/* players at a table right now */
.standings tr.playing td { background: #e8f4ec; }
.standings tr.playing td:first-child { box-shadow: inset 4px 0 0 var(--felt); font-weight: 700; }
.now-playing { display: inline-block; white-space: nowrap; vertical-align: middle; font-size: 12px; font-weight: 800; color: #fff; background: var(--felt); border-radius: 999px; padding: 2px 9px; }
.now-sep { color: var(--muted); font-weight: 400; margin: 0 2px; }
.fix-banner { background: #e8f4ec; border: 1px solid var(--felt); border-radius: 10px; padding: 8px 10px; font-size: 14px; font-weight: 600; margin: 8px 0; }
.results-log .kind { margin: 0 6px 0 0; font-weight: 700; }

/* badges: break and runs and racks won on the break */
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--card); }
.badge-row .note { flex-basis: 100%; margin: 0; }
.tag-btn { font: inherit; font-size: 14px; font-weight: 700; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.tag-btn.on { background: var(--gold); border-color: var(--gold); color: #fff; }
.sk-badges { font-size: 14px; font-weight: 800; color: var(--gold); }
.badge-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; max-width: 420px; }
.badge-tile { border: 2px solid var(--gold); border-radius: 14px; padding: 10px 6px; text-align: center; background: var(--card); display: grid; gap: 2px; }
.badge-tile .bi { font-size: 26px; line-height: 1; }
.badge-tile b { font-size: 28px; color: var(--gold); line-height: 1.1; }
.badge-tile span:last-child { font-size: 12px; color: var(--muted); }
.badge-tile.none { border-color: var(--line); opacity: .6; }
.badge-tiles.small .badge-tile b { font-size: 22px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fpill { font: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.fpill.on { background: var(--felt); border-color: var(--felt); color: #fff; }
.fpill:disabled { opacity: .45; cursor: default; }
.mbadge { font-size: 12px; font-weight: 800; color: var(--gold); white-space: nowrap; }

/* break-and-run pots */
.pot-line { margin: 6px 0 2px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.pot-badge { display: inline-block; background: var(--gold); color: #fff; border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 700; }
.pot-badge b { font-size: 15px; font-weight: 900; }
.pot-note { font-size: 13px; font-weight: 600; color: var(--gold); }

/* weekly turnout and payments */
.turnout { font-size: 13px; color: var(--muted); margin: 4px 0 2px; }
.turnout b { color: var(--text); }
.paid-on { color: var(--felt); font-weight: 800; }
.payments summary { cursor: pointer; list-style: revert; }
.payments summary h3 { display: inline; }

/* live tables, watch page, stream setup */
.live-now h3 { margin-bottom: 6px; }
.live-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.live-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.live-table { font-weight: 800; color: var(--felt-dark); min-width: 68px; }
.live-match { flex: 1; min-width: 180px; }
.live-score { font-size: 18px; margin: 0 6px; color: var(--felt-dark); font-variant-numeric: tabular-nums; }
.btn.watch { background: #c4302b; border-color: #c4302b; color: #fff; }
.player-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin: 10px 0; }
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-score { display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 20px; font-weight: 700; margin-top: 8px; }
.watch-score b { font-size: 30px; color: var(--felt-dark); font-variant-numeric: tabular-nums; }
.setup-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.setup-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); display: grid; gap: 8px; }
.setup-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pair-code { margin: 0; }
.pair-code > b { font-size: 26px; letter-spacing: 3px; font-family: ui-monospace, Consolas, monospace; color: var(--felt-dark); }
.inline-form input[type=url] { flex: 1; min-width: 200px; }

.live-badge { margin-top: 4px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.live-badge b { color: var(--felt-dark); font-size: 15px; font-variant-numeric: tabular-nums; }
.watch-mini { background: #c4302b; color: #fff !important; border-radius: 999px; padding: 1px 9px; font-weight: 700; text-decoration: none; }
.setup-row, .setup-list { min-width: 0; }
.setup-row .inline-form { flex-wrap: wrap; }
.setup-row .inline-form input[type=url] { min-width: 0; width: 100%; flex: 1 1 100%; }
#live-setup .inline-form { flex-wrap: wrap; }
#live-setup .inline-form input { min-width: 0; flex: 1 1 180px; }

/* ================= 2026-10-25 look & feel: app bar, tab bar, Me hub, sign-in sheet ================= */
:root { --shadow: 0 1px 2px rgba(16, 40, 26, .05), 0 4px 14px rgba(16, 40, 26, .06); --radius: 16px; --tabbar-h: 64px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); } }
body { font-size: 15.5px; }
h1, h2, h3 { letter-spacing: -.2px; }

/* app bar */
.appbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, #19804a, var(--felt-dark)); color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); padding-top: env(safe-area-inset-top); }
.appbar-row { display: flex; align-items: center; gap: 14px; height: 56px; }
.appbar .brand { font-size: 17px; font-weight: 800; letter-spacing: .2px; opacity: 1; gap: 9px; }
.topnav { display: flex; gap: 2px; margin-left: auto; }
.topnav a { color: #ffffffcc; text-decoration: none; font-weight: 650; font-size: 14.5px; padding: 8px 12px; border-radius: 10px; }
.topnav a:hover { color: #fff; background: #ffffff18; }
.topnav a[aria-current="page"] { color: #fff; background: #ffffff26; }
.topnav a[data-tab="me"] { display: none; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 4px 12px 4px 4px; border-radius: 999px; background: #ffffff1f; border: 1px solid #ffffff33; }
.me-chip:hover { background: #ffffff2e; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #ffffff; color: var(--felt-dark); display: inline-grid; place-items: center;
  font-weight: 800; font-size: 13px; flex: none; }
.avatar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.avatar.big { width: 64px; height: 64px; font-size: 24px; background: var(--felt); color: #fff; }
.avatar.big svg { width: 34px; height: 34px; }

/* home intro */
.hero-mini { background: linear-gradient(180deg, var(--felt-dark), transparent 140%); color: #fff; padding: 18px 0 26px; margin-bottom: -10px; }
.hero-mini h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.15; }
.hero-mini .sub { opacity: .88; font-size: 14.5px; }
.hero-mini[hidden], .seg[hidden] { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-mini { background: linear-gradient(180deg, #0f3d24, transparent 140%); } }

/* Events sub-views: segmented control */
.seg { display: flex; gap: 4px; margin: 18px 0 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow); position: relative; z-index: 1; }
.seg::-webkit-scrollbar { display: none; }
.seg a { flex: 1; text-align: center; text-decoration: none; font-weight: 650; font-size: 14px; color: var(--muted); padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.seg a:hover { color: var(--text); background: var(--felt-soft); }
.seg a[aria-current="page"] { background: var(--felt); color: #fff; }

/* bottom tab bar (phones) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topnav { display: none; }
  .me-chip { margin-left: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); text-decoration: none;
    font-size: 11.5px; font-weight: 650; -webkit-tap-highlight-color: transparent; }
  .tabbar a svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--felt); }
  .tabbar a[aria-current="page"] svg { stroke-width: 2.3; }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--felt); }
  .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: 24px; }
  .hero-mini h1 { font-size: 23px; }
  .seg a { flex: none; }
}

/* cards and panels */
.card { border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 16px; transition: transform .12s ease, box-shadow .12s ease; }
@media (hover: hover) { .card:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16,40,26,.06), 0 8px 22px rgba(16,40,26,.09); } }
.dhead { border-radius: var(--radius); box-shadow: var(--shadow); }
.name { font-size: 16.5px; }
.day { margin-top: 28px; }
.btn { border-radius: 12px; font-weight: 700; }
.empty-card { display: grid; gap: 4px; text-align: center; padding: 22px 18px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty-card b { color: var(--text); }
.page-head { margin: 20px 0 8px; }
.page-head h2 { margin: 0; font-size: 24px; }
.section-title { margin: 26px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); }

/* nudges */
.nudge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 16px 0 6px; padding: 14px 16px;
  border-radius: var(--radius); background: linear-gradient(135deg, var(--felt-soft), transparent), var(--card); border: 1px solid color-mix(in srgb, var(--felt) 35%, var(--line));
  box-shadow: var(--shadow); }
.nudge > div:first-child { display: grid; gap: 2px; flex: 1 1 260px; }
.nudge span { color: var(--muted); font-size: 14px; }
.nudge-actions { display: flex; align-items: center; gap: 12px; }
.nudge-actions .linkbtn { margin: 0; }

/* Me hub */
.me-hero { display: flex; align-items: center; gap: 16px; margin: 20px 0 14px; }
.me-hero h2 { margin: 0; font-size: 24px; }
.me-hero.guest { display: block; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 18px; }
.me-hero.guest .avatar { margin: 0 auto 8px; }
.me-hero.guest p { color: var(--muted); }
.perks { list-style: none; padding: 0; margin: 12px auto; display: grid; gap: 8px; text-align: left; max-width: 460px; }
.perks li { background: var(--felt-soft); border-radius: 12px; padding: 9px 12px; font-size: 14.5px; }
.me-hero .signin-btns { justify-content: center; }
.me-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin: 14px 0; }
.me-tile { display: grid; gap: 3px; align-content: start; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; min-height: 104px; transition: transform .12s ease; }
.me-tile:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--felt) 40%, var(--line)); }
.me-tile .ti { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.me-tile b { font-size: 15.5px; }
.me-tile span:last-child { color: var(--muted); font-size: 13px; }
.me-tile.hot { border-color: #e0a526; box-shadow: 0 0 0 1px #e0a526 inset, var(--shadow); }

/* Live tab */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.live-card { display: grid; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid #c4302b;
  border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; }
.live-dot { color: #c4302b; font-size: 12px; font-weight: 800; letter-spacing: .8px; }
.live-meta { font-size: 13.5px; }

/* sign-in sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(8, 20, 13, .55); display: flex; align-items: flex-end; justify-content: center;
  animation: fadein .15s ease; }
.sheet { position: relative; width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--card); color: var(--text);
  border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.25); animation: slideup .2s ease; }
.sheet h2 { margin: 0 34px 4px 0; font-size: 21px; }
.sheet .perks { margin: 12px 0; }
.sheet-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--felt-soft); color: var(--text);
  font-size: 15px; cursor: pointer; }
@media (min-width: 761px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } }
body.sheet-open { overflow: hidden; }
@keyframes slideup { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.signin-why { font-weight: 600; }
.signin-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }

/* player profile */
.profile-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin: 0 0 12px; display: grid; gap: 8px; }
.profile-card.complete { border-color: color-mix(in srgb, var(--felt) 40%, var(--line)); }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pc-top h3 { margin: 0; font-size: 16px; }
.meter { height: 8px; border-radius: 999px; background: var(--felt-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--felt); border-radius: 999px; }
.rchips { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0 8px; vertical-align: middle; }
.profile-card .rchips, .asec .rchips { margin-left: 0; }
.rchip { font: inherit; font-size: 12.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); white-space: nowrap; }
button.rchip { cursor: pointer; border-style: dashed; }
.rchip.verified { border-color: var(--felt); border-style: solid; background: var(--felt-soft); }
.rchip .ok, .ok { color: var(--felt); font-weight: 800; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rfield { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.rfield .fl.sub { font-size: 13px; color: var(--muted); }
.player-head { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.player-head h2 { margin: 0; }
/* list rows with several buttons wrap on phones */
.flist li { flex-wrap: wrap; }
.flist li > span:first-child { min-width: 0; flex: 1 1 200px; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
