.rulesBtn { font-family: var(--display); font-size: 16px; font-weight: 800; }

.rulesLayer {
  position: fixed;
  z-index: 320;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 20, 30, .62);
}

.rulesLayer.show { display: flex; }

.rulesBox {
  position: relative;
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 32px));
  max-height: min(680px, calc(100svh - 32px));
  overflow: auto;
  padding: 22px 22px 20px;
  color: #dbe4ee;
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 16px;
  background: linear-gradient(180deg, #141c28, #101722);
  box-shadow: 0 18px 48px rgba(2, 6, 10, .6);
}

.rulesClose {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  color: var(--game-muted, #9aa8b8);
  border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.rulesClose:hover { color: #f0e6cd; }

.rulesBox h2 { margin: 0 26px 6px 0; color: #f0e6cd; font-size: 20px; font-weight: 800; line-height: 1.1; }
.rulesIntro { margin: 0 0 16px; color: var(--game-muted, #9aa8b8); font-size: 12.5px; line-height: 1.45; }

.rulesSection { margin-bottom: 16px; }
.rulesSection:last-child { margin-bottom: 0; }

.rulesSection h3 {
  margin: 0 0 6px;
  color: rgba(212, 175, 55, .9);
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rulesSection p { margin: 0; color: #dbe4ee; font-size: 12.5px; line-height: 1.5; }

.rulesList { margin: 0; padding-left: 18px; color: #dbe4ee; font-size: 12.5px; line-height: 1.5; }
.rulesList li { margin-bottom: 4px; }

.rulesGlossary { margin: 0; }
.rulesTerm { margin-bottom: 8px; }
.rulesTerm:last-child { margin-bottom: 0; }
.rulesTerm dt { color: #f0e6cd; font-size: 12.5px; font-weight: 800; }
.rulesTerm dd { margin: 2px 0 0; color: var(--game-muted, #9aa8b8); font-size: 12px; line-height: 1.45; }

.rulesProvisional {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  color: #141c28;
  border-radius: 999px;
  background: var(--game-bronze, #d4af37);
  font-family: var(--utility);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rulesFairnessLink {
  width: 100%;
  margin-top: 18px;
  padding: 11px 12px;
  border-radius: 10px;
  font-family: var(--utility);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media (max-width: 390px) {
  .rulesBox { padding: 18px 16px 16px; }
  .rulesBox h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .rulesLayer { transition: none; }
}
