.rules-page { background: #0a0a0a; min-height: 100vh; }
.sidebar-simple .side-nav { display: none; }

.rules-breadcrumb-bar {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 14px 50px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: #0d0d0d;
}
.rules-breadcrumb {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.45);
}
.rules-breadcrumb span { color: #fff; }

.rules-layout {
  margin-left: var(--sidebar-width);
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 80vh;
}

.rules-menu {
  padding: 40px 0 40px 40px;
  border-right: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: calc(var(--header-height) + 8px);
  height: fit-content;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.rules-menu h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 24px;
}
.rules-menu-nav { display: flex; flex-direction: column; gap: 0; max-width: 220px; }
.rules-menu-item {
  background: transparent;
  border: none;
  text-align: left;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rules-menu-item:hover { background: rgba(255,255,255,0.04); }
.rules-menu-item.active { background: #fff; color: #000; }

.rules-content { padding: 40px 50px 100px; max-width: 900px; }
.rules-content-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.copy-link-btn {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 0;
  cursor: pointer;
}
.last-updated {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px 14px;
}

.rules-page-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.rules-intro {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  margin-bottom: 12px;
  max-width: 700px;
}

.class-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 28px 0;
}
.class-card {
  border-radius: 14px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.class-card strong { font-size: 13px; }
.class-card span:last-child { font-size: 12px; color: rgba(255,255,255,0.45); }

.class-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  width: fit-content;
}
.class-a { background: #4caf50; color: #000; }
.class-b { background: #f5c542; color: #000; }
.class-c { background: #e53935; color: #fff; }
.class-d { background: #9c6ade; color: #fff; }

.rules-alert {
  background: rgba(180, 40, 40, 0.2);
  border-left: 3px solid #e53935;
  padding: 18px 20px;
  margin: 24px 0 40px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.75);
}
.rules-alert p { margin-bottom: 8px; }
.rules-alert p:last-child { margin-bottom: 0; }

.rules-section { margin-bottom: 56px; scroll-margin-top: 80px; }
.section-num {
  display: inline-block;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.rules-section h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.section-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
  max-width: 600px;
}

.rule-card {
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 3px solid #5b9bd5;
  padding: 20px 22px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.3);
}
.rule-card.alert-card { border-left-color: #e53935; }
.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rule-card h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.rule-head h3 { margin-bottom: 0; }
.rule-card p {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}
.rule-card ul {
  margin: 8px 0 8px 18px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.65;
}
.rule-card code {
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  font-size: 12px;
}

.rule-example {
  border: 1px dashed rgba(91, 155, 213, 0.4);
  background: rgba(0,0,0,0.35);
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.55);
}
.ex-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}
.not-ok { color: #ef5350; font-weight: 700; }
.ok { color: #66bb6a; font-weight: 700; }

.penalty-table { margin: 20px 0; border: 1px solid rgba(255,255,255,0.1); }
.penalty-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  align-items: center;
  color: rgba(255,255,255,0.7);
}
.penalty-row.header {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.03);
}
.penalty-note {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin: 12px 0 32px;
}

.golden-rules {
  border: 1px solid rgba(255,255,255,0.1);
  padding: 24px;
  margin-top: 20px;
}
.golden-rules h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.golden-rules ol {
  padding-left: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 2;
}

@media (max-width: 900px) {
  .rules-layout { grid-template-columns: 1fr; }
  .rules-menu {
    position: relative;
    top: 0;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 24px 20px;
  }
  .rules-menu-nav { flex-direction: row; flex-wrap: wrap; max-width: none; gap: 6px; }
  .rules-menu-item { border-bottom: none; font-size: 11px; padding: 10px 12px; }
  .rules-content { padding: 30px 20px 80px; }
  .class-cards { grid-template-columns: 1fr 1fr; }
  .penalty-row { grid-template-columns: 60px 1fr 70px; font-size: 12px; }
}


/* Rules page: keep header always visible like other pages */
.rules-page .header {
  transform: none !important;
  opacity: 1 !important;
  z-index: 1000;
}

.rules-page .header.hidden {
  transform: none !important;
  opacity: 1 !important;
}

.class-grid,
.severity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.class-card,
.severity-card,
.rule-card,
.rules-notice,
.rule-block {
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,0.1);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s !important;
}
.class-card:hover,
.severity-card:hover,
.rule-card:hover,
.rule-block:hover {
  border-color: rgba(255,255,255,0.4) !important;
  box-shadow: 0 0 28px rgba(255,255,255,0.06), 0 12px 28px rgba(0,0,0,0.35) !important;
  transform: translateY(-3px);
}
.rules-menu a,
.rules-nav a {
  border-radius: 10px !important;
}
@media (max-width: 900px) {
  .class-grid, .severity-grid { grid-template-columns: repeat(2, 1fr); }
}
