.rules-page {
  height: 100vh;
  padding-bottom: 0;
  overflow: hidden;
}

.rules-page.has-staff-ticker {
  padding-bottom: 0;
}

.rules-page .staff-ticker,
.rules-page .scroll-controls {
  display: none;
}

.rules-page .site-shell,
.rules-page main,
.rules-page .page-backdrop {
  height: 100vh;
}

.rules-page .page-backdrop {
  display: flex;
  align-items: stretch;
}

.rules-shell {
  width: min(100%, 1180px);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(4px, 0.7vh, 8px);
  padding-top: clamp(2px, 0.4vh, 5px);
  padding-bottom: clamp(2px, 0.4vh, 5px);
  overflow: hidden;
}

.rules-hero {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
  margin-bottom: 0;
  padding: clamp(5px, 0.8vh, 8px) 12px;
  border: 1px solid rgba(255, 214, 107, 0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 107, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(13, 8, 24, 0.96), rgba(6, 4, 14, 0.98));
  box-shadow: 0 10px 24px rgba(8, 4, 15, 0.28);
}

.rules-hero .eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  font-size: clamp(0.58rem, 1.2vh, 0.72rem);
}

.rules-hero h1 {
  margin: 0;
  color: #fff7d8;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.45rem, 3.1vh, 2.2rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(255, 212, 107, 0.22);
}

.rules-hero p:last-child {
  max-width: none;
  margin: 0;
  color: #d8c9e8;
  font-size: clamp(0.7rem, 1.45vh, 0.86rem);
  font-weight: 800;
  line-height: 1.25;
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.rules-index {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  min-height: 0;
  padding: clamp(4px, 0.75vh, 8px);
  border: 1px solid rgba(201, 153, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 8, 24, 0.96), rgba(6, 4, 14, 0.98));
  box-shadow: 0 14px 34px rgba(8, 4, 15, 0.3);
}

.rules-index-title {
  margin: 0 0 clamp(1px, 0.3vh, 3px);
  color: #ffe4a0;
  font-size: clamp(0.5rem, 0.9vh, 0.62rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rules-index nav {
  display: grid;
  grid-template-rows: repeat(16, minmax(0, 1fr));
  min-height: 0;
}

.rules-index a {
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #d8c9b4;
  font-size: clamp(0.52rem, 1.18vh, 0.72rem);
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-decoration: none;
  transition:
    color 160ms ease,
    padding-left 160ms ease;
}

.rules-index a:hover,
.rules-index a:focus-visible {
  color: #fff3cc;
  padding-left: 6px;
}

.rules-content {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rules-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.rule-section,
.rules-note {
  scroll-margin-top: 12px;
  padding: 20px;
  border: 1px solid rgba(201, 153, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(13, 8, 24, 0.96), rgba(6, 4, 14, 0.98));
  box-shadow: 0 14px 34px rgba(8, 4, 15, 0.28);
}

.rule-section h2,
.rules-note h2 {
  margin: 0;
  color: #fff7d8;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.rule-section p,
.rules-note p {
  margin: 10px 0 0;
  color: #cdbfe0;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.55;
}

.rule-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.rule-list li {
  position: relative;
  padding: 10px 12px 10px 34px;
  border: 1px solid rgba(201, 153, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: #d9cde9;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.45;
}

.rule-list li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffe45f;
  box-shadow: 0 0 12px rgba(255, 228, 95, 0.32);
}

.offense-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.offense-grid.single {
  grid-template-columns: minmax(220px, 320px);
}

.offense-card {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.offense-card span {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.offense-card strong {
  display: block;
  color: #f2ecff;
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.35;
}

.offense-card.warning strong {
  color: #ffe45f;
}

.offense-card.danger strong {
  color: #ff5d6c;
}

.rules-note {
  border-color: rgba(88, 255, 154, 0.2);
  background:
    radial-gradient(circle at top left, rgba(88, 255, 154, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(13, 8, 24, 0.96), rgba(6, 4, 14, 0.98));
}

.rules-note h2 {
  color: #8fffb8;
}

@media (max-width: 900px) {
  .rules-page {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .rules-page .site-shell,
  .rules-page main,
  .rules-page .page-backdrop {
    height: auto;
  }

  .rules-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .rules-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .rules-index {
    max-height: none;
    overflow: visible;
  }

  .rules-content {
    overflow: visible;
    padding-right: 0;
  }

  .rules-index nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }
}

@media (max-height: 720px) and (min-width: 901px) {
  .rules-shell {
    gap: 6px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .rules-hero {
    padding: 6px 10px;
  }

  .rules-hero .eyebrow {
    display: none;
  }

  .rules-hero h1 {
    font-size: clamp(1.2rem, 2.6vh, 1.7rem);
  }

  .rules-hero p:last-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .rules-index {
    padding: 6px 8px;
  }

  .rules-index-title {
    margin-bottom: 2px;
    font-size: 0.56rem;
  }

  .rules-index a {
    font-size: clamp(0.54rem, 1.22vh, 0.72rem);
    line-height: 1;
  }
}

@media (max-height: 600px) and (min-width: 901px) {
  .rules-hero {
    grid-template-columns: 1fr;
  }

  .rules-hero p:last-child {
    display: none;
  }
}

@media (max-width: 640px) {
  .rules-shell {
    padding-top: 18px;
    padding-bottom: 58px;
  }

  .rules-hero,
  .rule-section,
  .rules-note {
    padding: 15px;
  }

  .rules-index nav,
  .offense-grid,
  .offense-grid.single {
    grid-template-columns: 1fr;
  }

  .offense-card {
    min-height: 74px;
  }
}

/* Final rules page layout: normal page scroll, no trapped side/content scroll. */
.rules-page {
  height: auto;
  min-height: 100vh;
  padding-bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.rules-page.has-staff-ticker {
  padding-bottom: 0;
}

.rules-page .staff-ticker,
.rules-page .scroll-controls {
  display: none;
}

.rules-page .site-shell,
.rules-page main,
.rules-page .page-backdrop {
  height: auto;
  min-height: 100vh;
}

.rules-page .page-backdrop {
  display: block;
}

.rules-shell {
  height: auto;
  min-height: 100vh;
  display: block;
  padding-top: 28px;
  padding-bottom: 70px;
  overflow: visible;
}

.rules-hero {
  display: block;
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 14px;
}

.rules-hero .eyebrow {
  display: block;
  margin: 0 0 8px;
  font-size: 0.74rem;
}

.rules-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.rules-hero p:last-child {
  display: block;
  max-width: 860px;
  margin: 10px 0 0;
  overflow: visible;
  color: #d8c9e8;
  font-size: 0.98rem;
  line-height: 1.55;
  white-space: normal;
  text-overflow: clip;
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-height: 0;
  overflow: visible;
}

.rules-index {
  position: sticky;
  top: 18px;
  display: block;
  align-self: start;
  max-height: none;
  overflow: visible;
  padding: 16px;
}

.rules-index-title {
  margin: 0 0 10px;
  font-size: 0.74rem;
}

.rules-index nav {
  display: grid;
  grid-template-rows: none;
  min-height: 0;
}

.rules-index a {
  display: block;
  min-height: 0;
  padding: 10px 0;
  color: #d8c9b4;
  font-size: 0.9rem;
  line-height: 1.32;
  overflow: visible;
}

.rules-content {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.rule-section,
.rules-note {
  scroll-margin-top: 18px;
}

@media (max-width: 900px) {
  .rules-layout {
    grid-template-columns: 1fr;
  }

  .rules-index {
    position: static;
  }

  .rules-index nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }
}

@media (max-width: 640px) {
  .rules-shell {
    padding-top: 18px;
    padding-bottom: 48px;
  }

  .rules-index nav {
    grid-template-columns: 1fr;
  }
}
