/* Rules page (regeln.html), on top of landing.css (tokens, header, footer, buttons, FAQ list).
 * One reading column; a sticky row of section links; board diagrams as <img> with a written caption each.
 * Also covers large controls (html.big-ui), the TV mode (html.tv-ui, tv.css) and the dither looks (dither.css tokens). */

.rules-page { max-width: 46rem; margin: 0 auto; padding: 0 var(--gutter) 40px; }
.rules-hero { padding: clamp(20px, 5vw, 48px) 0 8px; }
.rules-hero h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); line-height: 1.05; letter-spacing: -0.03em; }
.rules-hero .lead { margin: 14px 0 0; }

/* ------------------------------------------------------------- section links */
.toc {
  position: sticky; top: 0; z-index: 5; margin: 24px calc(-1 * var(--gutter)) 0; padding: 8px var(--gutter);
  background: var(--walnut); border-bottom: 1px solid var(--line);
}
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.toc ul::-webkit-scrollbar { display: none; }
.toc a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--ivory); text-decoration: none; font-size: 1rem; font-weight: 600;
}
.toc a:hover { border-color: var(--gold); }
.rule-section { scroll-margin-top: 24px; }
.rules-page h1 { scroll-margin-top: 80px; }
@media (min-width: 760px) { .toc ul { flex-wrap: wrap; overflow: visible; } }

/* ------------------------------------------------------------- text */
.rule-section { padding-top: clamp(48px, 8vw, 80px); }
.rule-section h2 { font-size: clamp(2rem, 4.4vw, 2.75rem); line-height: 1.1; }
.rule-section h3 { font-size: 1.375rem; line-height: 1.25; margin-top: 32px; letter-spacing: -0.012em; }
.rule-section p { margin-top: 12px; color: var(--ivory-dim); }
.rule-section .section-lead { margin-top: 14px; color: var(--ivory); font-size: 1.1875rem; }
.rule-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.rule-list li { position: relative; padding-left: 22px; color: var(--ivory-dim); }
.rule-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.mistakes li::before { border-radius: 1px; background: var(--red); transform: rotate(45deg); }
.house {
  margin-top: 16px !important; padding: 12px 16px; border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0;
  background: var(--smoke); color: var(--ivory) !important;
}
.house b { color: var(--gold); }

/* ------------------------------------------------------------- diagrams */
.diagram { margin: 20px 0 0; }
.diagram img {
  display: block; width: 100%; height: auto; border-radius: 12px;
  box-shadow: 0 2px 0 #3b2414, 0 18px 36px rgba(0, 0, 0, .45);
}
.diagram figcaption { margin-top: 12px; color: var(--ivory-dim); font-size: 1rem; line-height: 1.55; }
.figures { display: grid; gap: 28px; margin-top: 8px; }

/* ------------------------------------------------------------- short answers, glossary, links */
.faq-short .faq-list { margin-top: 20px; }
.glossary { margin: 20px 0 0; border-top: 1px solid var(--line); }
.glossary div { display: grid; grid-template-columns: minmax(9rem, 1fr) 2fr; gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 0; color: var(--ivory-dim); }
.rules-actions { justify-content: flex-start; margin-top: 28px; }
.to-top { margin-top: 28px !important; }
.to-top a { display: inline-flex; align-items: center; min-height: 48px; color: var(--ivory-dim); }

@media (max-width: 560px) {
  .glossary div { grid-template-columns: 1fr; }
  .rules-actions { flex-direction: column; align-items: stretch; }
}

/* ------------------------------------------------------------- large controls and TV */
.big-ui .toc a, .big-ui .to-top a { min-height: 64px; font-size: 1.1rem; padding: 0 20px; }
.big-ui .toc ul { gap: 12px; }
.big-ui .rule-section { scroll-margin-top: 48px; }
.tv-ui .rules-page { max-width: 64rem; }
.tv-ui .toc { position: static; margin: 1.5vh 0 0; padding: 0; background: none; border: 0; }
.tv-ui .toc ul { flex-wrap: wrap; overflow: visible; }
.tv-ui .toc a { min-height: 2.8rem; font-size: 1rem; }
.tv-ui .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ------------------------------------------------------------- dither looks (tokens from dither.css) */
.theme-dither .toc { background: var(--paper); border-bottom: var(--rule) solid var(--ink); }
.theme-dither .toc a { border: var(--rule) solid var(--ink); color: var(--ink); }
.theme-dither .toc a:hover { background: var(--ink); color: var(--paper); }
.theme-dither .rule-section p, .theme-dither .rule-list li, .theme-dither .glossary dd, .theme-dither .diagram figcaption,
.theme-dither .rule-section .section-lead, .theme-dither .to-top a { color: var(--ink); }
.theme-dither .rule-list li::before, .theme-dither .mistakes li::before { background: var(--ink); }
.theme-dither .house { background: var(--paper); border: var(--rule) solid var(--ink); border-left-width: 6px; border-radius: 0; color: var(--ink) !important; }
.theme-dither .house b { color: var(--ink); }
.theme-dither .diagram img { border-radius: 0; box-shadow: var(--lift) var(--lift) 0 var(--ink); }
.theme-dither .glossary, .theme-dither .glossary div { border-color: var(--ink); }

@media (forced-colors: active) {
  .toc a { border: 1px solid LinkText; }
  .house { border: 2px solid CanvasText; }
}
