.content-page h2,
.content-page h3 {
  letter-spacing: 0.04em;
}

.rules-type-perma h3 {
  color: #ff3366;
}

.rules-type-temp h3 {
  color: #40b0bf;
}

.rules-type-mute h3 {
  color: #5ee38f;
}

.rules-table-container {
  margin: 1.5rem auto;
  max-width: 1200px;
}

.table-title {
  font-family: 'VT323', var(--font-heading), monospace;
  color: #22a5e5;
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 15px rgba(34, 165, 229, 0.4);
}

.rules-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: linear-gradient(135deg, rgba(1, 17, 26, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(34, 165, 229, 0.2),
    0 0 40px rgba(34, 165, 229, 0.1);
}

.rules-table thead {
  background: linear-gradient(135deg, #22a5e5 0%, #40b0bf 100%);
}

.rules-table thead th {
  padding: 1.2rem 1.5rem;
  font-family: 'VT323', var(--font-heading), monospace;
  font-size: 1.1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  border: none;
  text-align: left;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.rules-table thead th:first-child {
  border-top-left-radius: 12px;
}

.rules-table thead th:last-child {
  border-top-right-radius: 12px;
  text-align: center;
  width: 200px;
}

.rules-table tbody tr {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid rgba(34, 165, 229, 0.15);
  position: relative;
}

.rules-table tbody tr:nth-child(even) {
  background: rgba(34, 165, 229, 0.03);
}

.rules-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(34, 165, 229, 0.25) 0%, rgba(64, 176, 191, 0.15) 100%);
  transform: translateX(6px);
  box-shadow: -4px 0 0 0 #22a5e5, 0 2px 12px rgba(34, 165, 229, 0.25);
  border-color: rgba(34, 165, 229, 0.4);
  z-index: 1;
}

.rules-table tbody tr:last-child {
  border-bottom: none;
}

.rules-table tbody td {
  padding: 1rem 1.5rem;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  border: none;
}

.rules-table tbody td:first-child {
  font-weight: 600;
  color: #22a5e5;
  text-shadow: none;
  font-size: 1.05rem;
}

.rules-table tbody td:last-child {
  text-align: center;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

/* Cores de punição */
/* Cores de punição */
.punishment-permanent,
.punishment-temporal,
.punishment-mute {
  display: inline-block;
  min-width: 150px;
  padding: 0.5rem 1rem !important;
  border-radius: 6px;

  color: #ffffff !important;
  font-weight: 600 !important;
  line-height: 1.3;
  text-align: center;

  text-shadow: none !important;
  filter: none !important;
  box-shadow: none;
}

.punishment-permanent {
  background: rgba(255, 51, 102, 0.14);
  border: 1px solid rgba(255, 51, 102, 0.5);
  border-left: 3px solid #ff3366;
}

.punishment-temporal {
  background: rgba(64, 176, 191, 0.14);
  border: 1px solid rgba(64, 176, 191, 0.5);
  border-left: 3px solid #40b0bf;
}

.punishment-mute {
  background: rgba(94, 227, 143, 0.14);
  border: 1px solid rgba(94, 227, 143, 0.5);
  border-left: 3px solid #5ee38f;
}
/* ===================== RESPONSIVO ===================== */

@media (max-width: 768px) {
  .rules-types {
    padding: 1rem;
  }

  .rules-types-grid {
    gap: 10px;
  }

  .rules-type-card h3 {
    font-size: 1.35rem;
  }

  .rules-type-card p {
    font-size: 0.9rem;
  }

  .table-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .rules-table thead th,
  .rules-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .rules-table thead th:last-child {
    width: 120px;
  }

  .rules-table tbody td:last-child {
    font-size: 0.85rem;
  }

  .rules-table tbody td:first-child {
    font-size: 0.95rem;
  }

  .punishment-permanent,
  .punishment-temporal,
  .punishment-mute {
    padding: 0.4rem 0.75rem !important;
  }
}

@media (max-width: 576px) {
  .rules-table-container {
    margin: 1rem 0;
  }

  .table-title {
    font-size: 1.25rem;
  }

  .rules-table {
    border-radius: 8px;
  }

  .rules-table thead th,
  .rules-table tbody td {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .rules-table thead th:last-child {
    width: 100px;
  }

  .rules-table tbody td:last-child {
    font-size: 0.8rem;
  }

  .rules-table tbody td:first-child {
    font-size: 0.875rem;
  }

  .rules-table tbody tr:hover {
    transform: translateX(4px);
  }

  .punishment-permanent,
  .punishment-temporal,
  .punishment-mute {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.8rem !important;
  }
}

/* iPad 768px–1024px */
@media (min-width: 768px) and (max-width: 1024px) {

  .rules-table thead th,
  .rules-table tbody td {
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
  }

  .rules-table thead th:last-child {
    width: 140px;
  }
}

/* Ultra-small ≤360px */
@media (max-width: 360px) {
  .table-title {
    font-size: 1.1rem;
    letter-spacing: 0;
  }

  .rules-table thead th,
  .rules-table tbody td {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .rules-table thead th:last-child {
    width: 80px;
  }

  .rules-table tbody td:last-child {
    font-size: 0.72rem;
  }

  .rules-table tbody td:first-child {
    font-size: 0.78rem;
  }

  .rules-table tbody tr:hover {
    transform: translateX(2px);
  }

  .punishment-permanent,
  .punishment-temporal,
  .punishment-mute {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.72rem !important;
  }
}
/* ===================== ÍNDICE + REGRAS (issue #16) ===================== */
.rules-section .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.rules-content {
  min-width: 0;
  max-width: 50rem;
  width: 100%;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.65;
}

/* Âncoras não ficam embaixo da navbar fixa */
.rules-section [id] {
  scroll-margin-top: 100px;
}

/* ---- Índice ---- */
.rules-index-box {
  background: rgba(34, 165, 229, 0.06);
  border: 1px solid rgba(34, 165, 229, 0.25);
  border-radius: 10px;
}

.rules-index-summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-family: var(--font-heading, 'Fredoka One'), sans-serif;
  font-size: 1.1rem;
  color: #22a5e5;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rules-index-summary::-webkit-details-marker {
  display: none;
}

.rules-index-summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-right: 0.25rem;
}

.rules-index-box[open] .rules-index-summary::after {
  transform: rotate(-135deg);
}

.rules-index-body {
  padding: 0 0.75rem 0.85rem;
}

.rules-filter {
  display: block;
  margin: 0.5rem 0;
}

.rules-filter[hidden] {
  display: none;
}

.rules-filter input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(34, 165, 229, 0.35);
  background: rgba(1, 17, 26, 0.9);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
}

.rules-filter input:focus {
  outline: 2px solid #22a5e5;
  outline-offset: 1px;
}

.rules-filter-empty {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0.5rem 0.25rem;
}

.rules-index-list {
  list-style: none;
  margin: 0.25rem 0;
  padding: 0;
}

.rules-section .rules-index-list li {
  margin: 0;
}

.rules-index-list li[hidden] {
  display: none;
}

.rules-index-list a,
.rules-index-quick {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
}

.rules-index-list a::before {
  content: attr(data-n);
  min-width: 1.4rem;
  color: rgba(34, 165, 229, 0.8);
  font-variant-numeric: tabular-nums;
}

.rules-index-quick {
  color: #22a5e5;
  font-weight: 600;
}

.rules-index-list a:hover,
.rules-index-quick:hover,
.rules-index-list a:focus-visible {
  background: rgba(34, 165, 229, 0.12);
  color: #fff;
}

.rules-index-list a.is-active {
  background: rgba(34, 165, 229, 0.18);
  border-left-color: #22a5e5;
  color: #fff;
}

/* ---- Regras ---- */
.rules-list {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0;
  counter-reset: rule;
}

.rules-section .rules-list > .rule {
  counter-increment: rule;
  margin: 0;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(34, 165, 229, 0.18);
  color: rgba(255, 255, 255, 0.88);
}

.rule-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.6rem;
}

.rule-head::before {
  content: counter(rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: rgba(34, 165, 229, 0.15);
  color: #22a5e5;
  font-weight: 700;
  font-size: 0.95rem;
}

.rules-section .rule-title {
  font-size: 1.9rem;
  line-height: 1.05;
  color: #fff;
  margin: 0;
  letter-spacing: 0.02em;
}

.rule-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
}

.rule-link:hover,
.rule-link:focus-visible {
  color: #22a5e5;
  background: rgba(34, 165, 229, 0.12);
}

.rule-link.is-copied {
  color: #5ee38f;
}

.rule-penalty {
  flex-basis: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rule-penalty .punishment-permanent,
.rule-penalty .punishment-temporal,
.rule-penalty .punishment-mute {
  min-width: 0;
  padding: 0.15rem 0.6rem !important;
  font-size: 0.85rem;
  border-radius: 5px;
}

.rules-table tbody td:first-child a {
  color: inherit;
  text-decoration: none;
}

.rules-table tbody td:first-child a:hover,
.rules-table tbody td:first-child a:focus-visible {
  text-decoration: underline;
}

/* Prisão e Resumo dentro da coluna de leitura */
.rules-content .rules-table-container {
  max-width: none;
}

.rules-content .rules-table-container > p,
.rules-content .rules-table-container > ul {
  color: rgba(255, 255, 255, 0.88);
}

/* Destaque breve ao chegar por âncora */
.rules-section .rule-title:target {
  color: #22a5e5;
}

/* ---- Voltar ao topo ---- */
.rules-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1020;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #22a5e5;
  color: #01111a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.rules-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.rules-top:hover,
.rules-top:focus-visible {
  background: #40b0bf;
  color: #01111a;
}

/* ---- Desktop: índice fixo na lateral ---- */
@media (min-width: 992px) {
  .rules-layout {
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }

  .rules-index {
    position: sticky;
    top: 96px;
  }

  .rules-index-box {
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .rules-index-summary {
    cursor: default;
    pointer-events: none;
  }

  .rules-index-summary::after {
    display: none;
  }

  .rules-content {
    margin: 0;
  }

  .rules-top {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

@media (max-width: 575px) {
  .rules-content {
    font-size: 1rem;
  }

  .rules-section .rule-title {
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rules-top,
  .rules-index-summary::after {
    transition: none;
  }
}
