/* ===================================================
   PRAVIDLA / ZÁKONÍK — čistý layout
=================================================== */

.links a.is-active {
  background: var(--blue-dim);
  color: #fff;
}

/* Layout pravidel */
.rules-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 32px;
  align-items: start;
  min-height: calc(100vh - 68px);
  padding: 32px var(--side) 72px;
  font-family: Montserrat, "Segoe UI", sans-serif;
}

/* Boční panel */
.rules-side {
  position: sticky;
  top: 84px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line2);
  max-height: calc(100dvh - 110px);
  overflow: hidden;
}

/* Vyhledávání */
.rules-search input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: rgba(6,8,14,0.7);
  color: var(--text);
  font: 500 13px Montserrat, "Segoe UI", sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rules-search input::placeholder { color: var(--muted); }
.rules-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,106,249,0.15);
}

/* TOC (obsah) */
.rules-toc {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  align-content: start;
  gap: 16px;
  overscroll-behavior: contain;
}
.rules-toc::-webkit-scrollbar { width: 4px; }
.rules-toc::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(0,106,249,0.35); }

.toc-group strong {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 4px;
  color: var(--blue-2);
  font: 800 10px/1 Outfit, Montserrat, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc-group em {
  font-style: normal;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
}

.toc-group a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--silver);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.toc-group a:hover {
  background: rgba(0,106,249,0.1);
  color: #fff;
  transform: translateX(2px);
}
.toc-group a.is-current {
  background: rgba(0,106,249,0.15);
  color: #fff;
  font-weight: 700;
  border-left: 3px solid var(--blue);
  padding-left: 8px;
}

/* ID badge v TOC */
.rule-id,
.toc-group .rule-id {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 2px 7px;
  border: 1px solid rgba(0,106,249,0.3);
  border-radius: 6px;
  background: var(--blue-dim);
  color: var(--blue-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Hlavní obsah */
.rules-main,
.rules-intro,
.rules-cat,
.rule-card,
.rule-card p,
.rule-card li,
.rules-empty,
.wl-wrap,
.wl-intro,
.wl-card,
.wl-q,
.wl-meta,
.wl-chip,
.wl-timer,
.wl-q h3 {
  font-family: Montserrat, "Segoe UI", sans-serif;
}

/* Intro */
.rules-intro {
  max-width: 680px;
  margin-bottom: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.rules-intro h1 {
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.04em;
  margin-top: 8px;
}
.rules-intro p { color: var(--muted); font-size: 15px; }

/* Kategorie */
.rules-cat {
  margin-bottom: 56px;
}
.rules-cat > h2 {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: #fff;
  letter-spacing: -0.02em;
}

/* Karta pravidla */
.rule-card {
  position: relative;
  margin-bottom: 14px;
  padding: 24px 26px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  scroll-margin-top: 100px;
  transition: border-color 0.25s;
}
.rule-card:hover { border-color: rgba(0,106,249,0.3); }

.rule-card.is-flash {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,106,249,0.25);
  animation: rule-flash 2s ease forwards;
}
@keyframes rule-flash {
  0%   { box-shadow: 0 0 0 6px rgba(0,106,249,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(0,106,249,0); }
}

.rule-card h3 {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 18px;
  color: #fff;
}
.rule-card .rule-id {
  min-width: 52px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
}

/* Obsah karty */
.rule-card p,
.rule-card li {
  color: var(--silver);
  line-height: 1.8;
  font-size: 14px;
}
.rule-card p + p,
.rule-card ul { margin-top: 10px; }
.rule-card ul { padding-left: 18px; }
.rule-card li { margin-bottom: 5px; }

/* Obrázek */
.rule-img {
  display: block;
  width: 100%;
  max-width: 680px;
  margin-top: 16px;
  border-radius: 10px;
  border: 1px solid var(--line2);
}

/* Poznámka */
.rule-note {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,106,249,0.25);
  background: var(--blue-dim);
  color: #daeaff;
  font-size: 13.5px;
  line-height: 1.7;
}

/* Příklady dobré/špatné */
.rule-ex { display: grid; gap: 10px; margin-top: 14px; }
.rule-ex > div {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
}
.rule-ex p + p { margin-top: 6px; }
.rule-ex .good { border: 1px solid rgba(46,232,122,0.3); background: rgba(46,232,122,0.07); color: #c0efcf; }
.rule-ex .bad  { border: 1px solid rgba(255,77,106,0.3);  background: rgba(255,77,106,0.07); color: #ffbfc7; }

/* Prázdný stav */
.rules-empty {
  color: var(--muted);
  font-size: 15px;
  padding: 32px;
  text-align: center;
}

/* Skrytí */
.rule-card.is-hidden,
.rules-cat.is-hidden,
.toc-link.is-hidden { display: none; }

/* Footer na pravidla stránce */
.rules-page .site-footer { background: var(--bg2); }

/* ─── RESPONZIVITA ─── */
@media (max-width: 980px) {
  .rules-layout {
    grid-template-columns: 1fr;
    padding: 20px 18px;
  }
  .rules-side {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .rules-toc {
    max-height: 240px;
    overflow: auto;
  }
}
