/* Rules & Format page (static, read-only). Reuses the Live View look; nothing here is interactive. */
.rulespage { max-width: 880px; }
.rulespage h1, .rulespage h2 { font-family: var(--display); font-weight: 700; }
.rulespage h1 { margin: 8px 0 0; font-size: clamp(30px, 5vw, 46px); line-height: 1; text-transform: uppercase; color: #fff; }
@supports (-webkit-background-clip: text) or (background-clip: text) { .rulespage h1 { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; } }
.rulespage h2 { margin: 0; font-size: 24px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.rulespage h3 { margin: 22px 0 6px; font-family: var(--display); font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rhero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.rhero::before { display: none; }
.rhero .hero-text { padding: 20px 24px 20px; }
.rhero .evnote { max-width: 62ch; margin-top: 12px; }
.state.draft { color: var(--cyan); border: 1px solid var(--cyan); background: transparent; }
.rhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rtag { font-family: var(--display); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; padding: 2px 9px; border: 1px solid var(--silver-lo); border-radius: var(--r); color: var(--silver-hi); }
.proposed .rtag { color: var(--cyan); border-color: var(--cyan-dim); }
.open .rtag { color: var(--muted); border-style: dashed; }
.rnote { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.rlist { list-style: none; margin: 10px 0 0; padding: 0; }
.rlist li { position: relative; padding: 10px 0 10px 22px; border-top: 1px solid var(--line); color: var(--ink-2); line-height: 1.5; }
.rlist li:first-child { border-top: 0; }
.rlist li::before { content: ""; position: absolute; left: 4px; top: 1.05em; width: 7px; height: 7px; background: var(--silver-hi); transform: rotate(45deg); }
.proposed .rlist li::before { background: transparent; border: 1px solid var(--cyan); }
.open .rlist li::before { background: transparent; border: 1px dashed var(--silver); }
.rlist b { color: var(--ink); }
.set { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 1px; font-family: var(--display); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); vertical-align: 1px; }
@media (max-width: 640px) { .rhero .hero-text { padding: 16px; } .rulespage h2 { font-size: 22px; } }

/* Plain text lines, numbered tiebreak steps, one key line, and the two small tables. */
.rtext { margin: 12px 0 0; color: var(--ink-2); line-height: 1.5; }
.rsteps { counter-reset: step; }
.rsteps li { padding-left: 34px; counter-increment: step; }
.rsteps li::before { content: counter(step); top: 10px; left: 0; width: 22px; height: 22px; transform: none; background: transparent; border: 1px solid var(--silver-lo); border-radius: 50%; color: var(--ink); font: 700 13px/20px var(--display); text-align: center; }
.rkey { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--cyan); background: rgba(47,134,255,.07); color: var(--ink-2); line-height: 1.5; }
.rkey b { color: var(--ink); }
.rtable { width: 100%; margin: 12px 0 4px; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.rtable th, .rtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--ink-2); }
.rtable thead th { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line-2); }
.rtable tbody th { color: var(--ink); font-weight: 700; white-space: nowrap; }
.rtable.points { max-width: 420px; }
.rtable.points td:last-child { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ink); white-space: nowrap; }
/* Phones: each row of the comparison table becomes a small card with labels, so nothing scrolls sideways. */
@media (max-width: 640px) {
  .rtable.compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable.compare, .rtable.compare tbody, .rtable.compare tr, .rtable.compare th, .rtable.compare td { display: block; width: auto; }
  .rtable.compare tr { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); }
  .rtable.compare tbody th { padding: 0 0 6px; border: 0; font-family: var(--display); font-size: 17px; white-space: normal; }
  .rtable.compare td { padding: 4px 0; border: 0; }
  /* The visible label repeats the column header, so screen readers skip it ("/ ''"); older browsers fall back to the first line. */
  .rtable.compare td::before { content: attr(data-label); content: attr(data-label) / ""; display: block; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
}

/* ---- Layout pass (owner UX review, Oct 4): compact hero, Jump to, glance tiles, labelled rows, explainer, playoff emphasis ---- */
.rhero .hero-text { padding: 18px 22px; }
.rsub { margin: 10px 0 0; font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .03em; color: var(--ink); }
.rhero .evnote { margin-top: 6px; }

/* Jump to sits after the hero. Wide screens: one row that sticks to the top once the reader reaches it.
   Phones: a wrapped grid that scrolls with the page (only the main header stays pinned). */
.rjump { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; margin: 0 0 16px; padding: 6px 12px; background: #070c16; border: 1px solid var(--line-2); border-radius: 3px; }
.rjump-h { margin: 0; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.rjump ul { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 0; padding: 0; list-style: none; }
.rjump a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 9px; font: 700 14px/1.15 var(--display); letter-spacing: .08em; text-transform: uppercase; text-align: center; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.rjump a:hover, .rjump a:focus-visible { color: #fff; border-bottom-color: var(--cyan); }
@media (min-width: 641px) {
  body.rules .stick { position: static; }   /* the staging bar scrolls away so the jump row can stick to the top */
  .rjump { position: sticky; top: 0; z-index: 6; }
}
@media (max-width: 640px) {
  .rjump { display: block; padding: 10px 12px 12px; }
  .rjump-h { margin-bottom: 8px; }
  .rjump ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .rjump a { display: flex; width: 100%; padding: 4px; letter-spacing: .05em; background: #0b1220; border: 1px solid var(--line-2); border-radius: var(--r); }
}
@media (max-width: 379px) { .rjump ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Section anchors land just below whatever is pinned: the jump row on wide screens, the header on phones. */
body.rules #glance, body.rules #joining, body.rules #playing, body.rules #breaks, body.rules #points, body.rules #pairings,
body.rules #standings, body.rules #playoff, body.rules #missing, body.rules #leaving, body.rules #fixes { scroll-margin-top: 72px; }
@media (min-width: 641px) and (max-width: 899px) {   /* tablets: "Jump to" takes its own line and the links can wrap to two rows (up to 123px) */
  body.rules #glance, body.rules #joining, body.rules #playing, body.rules #breaks, body.rules #points, body.rules #pairings,
  body.rules #standings, body.rules #playoff, body.rules #missing, body.rules #leaving, body.rules #fixes { scroll-margin-top: 136px; }
}
@media (max-width: 640px) {
  body.rules #glance, body.rules #joining, body.rules #playing, body.rules #breaks, body.rules #points, body.rules #pairings,
  body.rules #standings, body.rules #playoff, body.rules #missing, body.rules #leaving, body.rules #fixes { scroll-margin-top: 64px; }
}

/* At a glance: six small tiles, 3 x 2 on wide screens, 2 x 3 on phones */
.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 4px; padding: 0; list-style: none; }
.glance li { padding: 12px 14px; font-size: 15px; line-height: 1.4; color: var(--ink-2); background: rgba(6, 10, 19, .45); border: 1px solid var(--line-2); border-radius: 3px; }
.glance b { display: block; margin-bottom: 2px; font-family: var(--display); font-size: 18px; letter-spacing: .02em; color: var(--ink); }
@media (max-width: 640px) {
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .glance li { padding: 10px 12px; font-size: 14px; }
  .glance b { font-size: 16px; }
}

/* Who breaks: three labelled rows (label beside the text; stacked on phones) */
.rrows { margin: 10px 0 0; }
.rrows > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.rrows > div:first-child { border-top: 0; }
.rrows dt { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .04em; color: var(--ink); }
.rrows dd { margin: 0; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 640px) { .rrows > div { grid-template-columns: minmax(0, 1fr); } }

/* What is Buchholz? A small explainer inside tiebreak step 1 */
.rexplain { margin: 8px 0 2px; padding: 10px 12px; background: rgba(6, 10, 19, .5); border: 1px solid var(--line-2); border-radius: 3px; }
.rulespage .rexplain h3 { margin: 0 0 4px; font-size: 13px; color: var(--ink); }
.rexplain p { margin: 0; line-height: 1.5; color: var(--ink-2); }

/* Sudden-death playoff: a little more presence than an ordinary section (restrained cyan, no gold) */
.rulespage .rplayoff { overflow: hidden; border-color: #2f4a80; box-shadow: 0 0 0 1px rgba(47, 134, 255, .12); }
.rplayoff::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }
.rpair { display: grid; gap: 8px; margin: 12px 0 4px; padding: 0; list-style: none; }
.rpair li { padding: 10px 14px; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .02em; line-height: 1.3; color: #fff; background: rgba(47, 134, 255, .08); border-left: 3px solid var(--cyan); }

/* Short lists (Leaving, Fixes): no dividers */
.rlist.light li { padding: 5px 0 5px 22px; border-top: 0; }
.rlist.light li::before { top: .8em; }

/* Back to the top */
.rback { margin: 4px 0 0; text-align: center; }
.rback a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font: 700 14px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.rback a:hover, .rback a:focus-visible { color: #fff; border-bottom-color: var(--cyan); }
