:root {
  --bg: #f7f5f0;
  --panel: #ffffff;
  --ink: #14171a;
  --muted: #55606b;
  --line: #d8dee4;
  --accent: #17603f;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0ea;
  --warn-bg: #fdf3dd;
  --warn-ink: #8a5a00;
  /* Tamarisk CC brand, sampled from the club monogram (shared with poker./mahjong.adviza.com).
     The clay only reaches 3.0:1 on white, so it is for large text and chrome only. */
  --tcc-brown: #403830;
  --tcc-clay: #e0785f;
  --high: #1f8a4c;
  --medium: #d9a400;
  --low: #a9b0b8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- header (Tamarisk chrome) ---------- */
header.site {
  background: var(--tcc-brown); color: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-bottom: 4px solid var(--tcc-clay);
}
header.site .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
header.site .mark { width: 44px; height: 44px; border-radius: 9px; display: block; flex: none; }
header.site .brandtext { display: flex; flex-direction: column; line-height: 1.12; }
header.site .club { font-size: 13px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; color: var(--tcc-clay); }
header.site .game { font-size: 24px; font-weight: 800; }
header.site .season { font-size: 15px; opacity: .85; }
@media (max-width: 480px) {
  header.site .mark { width: 36px; height: 36px; }
  header.site .game { font-size: 20px; }
  header.site .club { font-size: 11px; letter-spacing: 1.3px; }
  header.site .season { display: none; }
}

.layout { display: grid; grid-template-columns: 330px 1fr; gap: 24px; padding-top: 22px; padding-bottom: 40px; }
.lede { margin: 0 0 12px; font-size: 16px; }

.filters {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  align-self: start; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto;
}
.filters h2, .results h2 { font-size: 17px; margin: 14px 0 8px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.presets-label { color: var(--muted); font-size: 14px; margin-right: 2px; }
.presets button, button.secondary, a.button {
  background: var(--accent-soft); color: var(--accent); border: 1px solid #c9dcd0;
  border-radius: 999px; padding: 7px 13px; font-size: 15px; cursor: pointer; text-decoration: none; display: inline-block;
  font-family: inherit;
}
.presets button:hover, button.secondary:hover, a.button:hover { background: #d9e8de; }
button.secondary:disabled { opacity: .45; cursor: not-allowed; }

.category-list { display: flex; flex-direction: column; gap: 6px; }
.cat { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fbfaf7; }
.cat-row { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.cat-row .cat-name { flex: 1; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.cat-row .cat-name.toggle { cursor: pointer; user-select: none; }
.cat-row .chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-top: -3px; transition: transform .15s; }
.cat.collapsed .chev { transform: rotate(-45deg); margin-top: 2px; }
.cat-row .n, .series-row .n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.series { margin: 6px 0 0 26px; display: flex; flex-direction: column; gap: 5px; }
.series-row { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 26px; }
.series-row label { flex: 1; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; flex: none; }
.cat.collapsed .series { display: none; }
.cat.off .series { opacity: .6; }

.status { margin-top: 12px; font-size: 14px; color: var(--muted); }
.status.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px; border-radius: 6px; }

.results { min-width: 0; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.results-head h2 { margin: 0; font-size: 22px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
button.primary {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
  padding: 12px 20px; font-size: 17px; font-weight: 650; cursor: pointer; font-family: inherit; min-height: 48px;
}
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.primary:not(:disabled):hover { filter: brightness(1.08); }
.actions button.secondary { min-height: 48px; font-size: 16px; padding: 10px 16px; }

.howto { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.howto summary { cursor: pointer; font-weight: 650; }
.howto-body { padding-top: 6px; }
.howto h3 { font-size: 15px; margin: 14px 0 4px; }
.howto ol { margin: 0 0 6px; padding-left: 22px; }
.howto p { margin: 6px 0; }
code { background: #eee9de; padding: 1px 5px; border-radius: 4px; font-size: 14px; }

.feed-row { display: flex; gap: 8px; margin: 10px 0; }
.feed-row input { flex: 1; min-width: 0; font: 15px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; }
.feed-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.feed-buttons a.button { font-weight: 650; }

.table-scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
table.preview { width: 100%; border-collapse: collapse; font-size: 15px; }
table.preview th, table.preview td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.preview th { position: sticky; top: 0; background: #f1efe8; font-weight: 650; font-size: 14px; }
table.preview tr:last-child td { border-bottom: 0; }
table.preview td.time { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.preview td.date { white-space: nowrap; }
table.preview .note { color: var(--muted); font-size: 13px; }
tr.month-row td { background: #f7f5ef; font-weight: 650; color: var(--muted); font-size: 14px; }
.badge { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.fineprint { color: var(--muted); font-size: 14px; margin-top: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--low); }
.dot.high { background: var(--high); }
.dot.medium { background: var(--medium); }
.dot.low { background: var(--low); }

.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 18px 0 32px; background: #f1efe8; }
.site-foot p { margin: 0; }

.mobile-bar { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding-bottom: 90px; }
  .filters { position: static; max-height: none; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px;
    background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.08);
    font-weight: 650;
  }
  .site-foot { padding-bottom: 100px; }
}
