/* ═══ Rules page ═══ */

.rules-page {
  background: #f4f1ea;
  color: #0a0a0a;
}

/* ── Header (zůstává tmavý — branding) ── */
.rules-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rules-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem var(--pad-xl);
}

.rules-header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.rules-header__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.rules-header__wordmark {
  font-family: "Bebas Neue", "Inter", sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: #ffffff;
}

.rules-header__back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(245, 245, 245, 0.55);
  text-decoration: none;
  transition: color 180ms ease;
}

.rules-header__back:hover {
  color: #e8353f;
}

/* ── Hero ── */
.rules__hero {
  position: relative;
  padding: clamp(7rem, 12vw, 10rem) var(--pad-xl) clamp(4rem, 8vw, 6rem);
  background-image: url('../assets/rules_thumbnail.png');
  background-color: #0a0a0a;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  min-height: clamp(420px, 55vh, 580px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.rules__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.rules__hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.rules__hero-text {
  max-width: 640px;
}

.rules__title {
  margin: 0 0 1.6rem;
  font-family: "Bebas Neue", "Inter", sans-serif;
  font-size: clamp(3rem, 7.5vw, 5.5rem);
  letter-spacing: 0.06em;
  line-height: 0.95;
  color: #ffffff;
  text-align: left;
}

.rules__lead {
  margin: 0;
  max-width: 540px;
  font-family: "Lora", Georgia, serif;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.7;
  color: rgba(245, 245, 245, 0.72);
  text-align: left;
}

.rules__lead strong {
  color: #ffffff;
}

/* ── Body layout ── */
.rules__body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad-xl) clamp(4rem, 8vw, 6rem);
}

/* ── Table of contents ── */
.rules__toc {
  position: sticky;
  top: 5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding-right: 1rem;
}

.rules__toc-title {
  font-family: "Bebas Neue", "Inter", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 0.6rem;
}

.rules__toc-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: rgba(0, 0, 0, 0.68);
  text-decoration: none;
  padding: 0.4rem 0 0.4rem 0;
  line-height: 1.35;
  transition:
    color 260ms cubic-bezier(0.33, 1, 0.68, 1),
    transform 260ms cubic-bezier(0.33, 1, 0.68, 1);
}

.rules__toc-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(0, 0, 0, 0.45);
  transition: color 260ms cubic-bezier(0.33, 1, 0.68, 1);
}

.rules__toc-link:hover {
  color: #0a0a0a;
}

.rules__toc-link:hover .rules__toc-icon {
  color: rgba(163, 13, 24, 0.7);
}

.rules__toc-link.is-active {
  color: #a30d18;
  transform: translateX(3px);
}

.rules__toc-link.is-active .rules__toc-icon {
  color: #a30d18;
}

/* ── Content ── */
.rules__content {
  min-width: 0;
}

.rules__section {
  padding-bottom: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: clamp(2.5rem, 4vw, 3.5rem);
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  scroll-margin-top: 5rem;
}

.rules__section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rules__section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rules__section-num {
  font-family: "Bebas Neue", "Inter", sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.2rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: #a30d18;
  flex-shrink: 0;
}

.rules__section-head h2 {
  margin: 0;
  font-family: "Bebas Neue", "Inter", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.06em;
  color: #0a0a0a;
}

.rules__subtitle {
  margin: 1.8rem 0 0.7rem;
  font-family: "Inter", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0a0a0a;
  letter-spacing: 0.01em;
}

.rules__text {
  margin: 0 0 0.8rem;
  font-family: "Lora", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.75;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.85);
  text-align: justify;
  hyphens: manual;
  -webkit-hyphens: manual;
  hyphenate-limit-chars: 14 6 6;
  -webkit-hyphenate-limit-before: 6;
  -webkit-hyphenate-limit-after: 6;
}

.rules__list {
  margin: 0 0 0.8rem;
  padding-left: 0;
  list-style: none;
}

.rules__list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
  font-family: "Lora", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.7;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.85);
  text-align: justify;
  hyphens: manual;
  -webkit-hyphens: manual;
  hyphenate-limit-chars: 14 6 6;
  -webkit-hyphenate-limit-before: 6;
  -webkit-hyphenate-limit-after: 6;
}

.rules__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 11px;
  height: 2px;
  background: #a30d18;
  border-radius: 1px;
}

.rules__list li strong {
  color: #0a0a0a;
}

.rules__list ul {
  margin-top: 0.5rem;
  padding-left: 0;
  list-style: none;
}

.rules__list ul li::before {
  width: 7px;
  background: rgba(163, 13, 24, 0.55);
}

/* ── Term tooltip / definition popover ── */
.term {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  line-height: 1;
}

.term__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  margin-left: 0.18em;
  padding: 0;
  border: none;
  background: transparent;
  color: #3b9bf0;
  font-family: "Inter", sans-serif;
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
  vertical-align: 0.15em;
  border-radius: 50%;
  transition: color 160ms ease, transform 160ms ease;
}

.term__trigger:hover,
.term__trigger:focus-visible,
.term[data-open="true"] .term__trigger {
  color: #1e7fd0;
  outline: none;
  transform: scale(1.15);
}

.term__popup {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(300px, 78vw);
  padding: 0.75rem 0.95rem;
  background: #1e7fd0;
  color: rgba(255, 255, 255, 0.96);
  font-family: "Lora", Georgia, serif;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  white-space: normal;
  text-align: left;
  border-radius: 0.45rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 180ms cubic-bezier(0.33, 1, 0.68, 1),
    transform 180ms cubic-bezier(0.33, 1, 0.68, 1),
    visibility 0ms 180ms;
  z-index: 50;
}

.term__popup strong {
  color: #ffffff;
}

.term__popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #1e7fd0;
}

.term__trigger:hover + .term__popup,
.term__trigger:focus-visible + .term__popup,
.term[data-open="true"] .term__popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity 180ms cubic-bezier(0.33, 1, 0.68, 1),
    transform 180ms cubic-bezier(0.33, 1, 0.68, 1);
}

/* ── Section reference ── */
.section-ref {
  color: #a30d18;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  transition: color 150ms ease, border-color 150ms ease;
  white-space: nowrap;
}

.section-ref:hover,
.section-ref:focus-visible {
  color: #6c0810;
  border-bottom-style: solid;
  outline: none;
}

/* ── Discord chip ── */
.discord-chip {
  display: inline-block;
  padding: 0.05em 0.45em;
  font-family: "gg sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  font-size: 0.95em;
  font-weight: 500;
  color: #5865f2;
  background: rgba(88, 101, 242, 0.16);
  border-radius: 0.3rem;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.discord-chip:hover,
.discord-chip:focus-visible {
  background: #5865f2;
  color: #ffffff;
  outline: none;
}

/* ── Callout ── */
.rules__callout {
  padding: 1rem 1.4rem;
  margin: 1rem 0;
  border-left: 3px solid #a30d18;
  background: rgba(163, 13, 24, 0.08);
  border-radius: 0 0.5rem 0.5rem 0;
  font-family: "Lora", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.88);
}

.rules__callout strong {
  color: #0a0a0a;
}

.rules__callout--danger {
  border-left-color: #a30d18;
  background: rgba(163, 13, 24, 0.13);
}

.rules__callout--info {
  border-left-color: #4a9eff;
  background: rgba(74, 158, 255, 0.1);
}

.rules__callout--info strong {
  color: #0a0a0a;
}

.rules__callout p {
  margin: 0.75rem 0 0 0;
}

.rules__callout--info p {
  text-align: justify;
  hyphens: manual;
  -webkit-hyphens: manual;
  line-height: 1.7;
}

.rules__callout--info p strong {
  display: inline-block;
  margin-bottom: 0.15rem;
  letter-spacing: 0.01em;
}

/* ── Footer note ── */
.rules__footer-note {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: 1.2rem 1.4rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.6rem;
  text-align: center;
}

.rules__footer-note p {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  font-size: 0.92rem;
  color: rgba(0, 0, 0, 0.68);
  font-style: italic;
}

/* ── Announcement hero (coming soon pages) ── */
.rules__hero--announcement {
  position: relative;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rules__hero--announcement .rules__hero-inner {
  position: relative;
  z-index: 1;
}

.rules__hero-bg {
  position: absolute;
  inset: 0;
  /* background-image: url('../assets/announcement_bg.png'); */
  background-size: cover;
  background-position: center;
  opacity: 0.15;
}

.announcement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.announcement__img {
  max-width: 500px;
  width: 100%;
  height: auto;
  border-radius: 20px;
  object-fit: cover;
}

.announcement__link {
  color: #c1121f;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 180ms ease;
}

.announcement__link:hover {
  color: #e8353f;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .rules__body {
    grid-template-columns: 1fr;
  }

  .rules__toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem 0.6rem;
    max-height: none;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    overflow-y: visible;
  }

  .rules__toc-title {
    width: 100%;
    margin-bottom: 0.3rem;
  }

  .rules__toc-link {
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition:
      color 220ms cubic-bezier(0.33, 1, 0.68, 1),
      background 220ms cubic-bezier(0.33, 1, 0.68, 1),
      border-color 220ms cubic-bezier(0.33, 1, 0.68, 1),
      transform 220ms cubic-bezier(0.33, 1, 0.68, 1);
  }

  .rules__toc-link:hover {
    background: rgba(0, 0, 0, 0.08);
  }

  .rules__toc-link.is-active {
    color: #a30d18;
    border-color: rgba(163, 13, 24, 0.5);
    background: rgba(163, 13, 24, 0.08);
    transform: none;
  }
}

@media (max-width: 520px) {
  .rules-header__inner {
    padding: 0.75rem 1.2rem;
  }

  .rules__hero {
    padding: clamp(5.5rem, 10vw, 7rem) 1.2rem clamp(2.5rem, 5vw, 3.5rem);
    min-height: auto;
  }

  .rules__body {
    padding: 1.5rem 1.2rem 3rem;
  }

  .rules__section-head {
    gap: 0.6rem;
  }

  .rules__section-num {
    font-size: 2rem;
  }
}
