:root {
  --bg: #0b0f12;
  --panel-rgb: 69, 65, 63;
  --panel-alpha: 0.84;
  --panel: rgba(var(--panel-rgb), var(--panel-alpha));
  --panel-accent: rgba(164, 93, 179, 0.88);
  --text: #fff8fb;
  --muted: rgba(255, 248, 251, 0.82);
  --brand: #ffd7f6;
  --border: rgba(255, 255, 255, 0.18);
  --shadow: 0 18px 50px rgba(36, 17, 35, 0.24);
}

html,
body {
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: blur(6px) saturate(1.05);
  opacity: 0.98;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(36, 22, 33, 0.42), rgba(36, 22, 33, 0.54)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 42%),
    radial-gradient(circle at bottom, rgba(153, 102, 204, 0.16), transparent 30%);
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px 20px 32px;
  isolation: isolate;
}

.nav-wrap {
  position: sticky;
  top: 18px;
  z-index: 5;
  width: min(1180px, 100%);
  margin: 0 auto 36px;
  padding: 12px 18px;
  border-radius: 28px;
  background: rgba(69, 65, 63, 0.85);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.brand {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  text-align: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel-accent);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.2s ease;
  font-size: 0.9rem;
  line-height: 1;
}

.nav-links a:hover {
  transform: translateY(-2px);
}

.rules-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0 64px;
}

.rules-top-gif {
  width: min(1180px, 100%);
  margin: 0 auto 20px;
}

.rules-top-gif img {
  display: block;
  width: min(560px, 100%);
  height: auto;
  margin: 0 auto;
}

.content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rules-markdown {
  display: grid;
  gap: 10px;
}

.rules-markdown p {
  margin: 0;
  color: var(--muted);
  line-height: 1.78;
  font-size: clamp(15px, 1.2vw, 18px);
}

.rules-markdown h1,
.rules-markdown h2,
.rules-markdown h3 {
  color: var(--text);
  margin: 0;
}

.rules-markdown h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  font-weight: 800;
  margin-bottom: 10px;
}

.rules-markdown h2 {
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 800;
  margin-top: 16px;
}

.rules-markdown h3 {
  font-size: clamp(16px, 1.45vw, 21px);
  font-weight: 800;
  color: var(--brand);
  margin-top: 12px;
}

.rules-markdown strong {
  color: var(--text);
}

.markdown-list {
  margin: 0;
  padding-left: 26px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.markdown-list li {
  line-height: 1.72;
  font-size: clamp(15px, 1.2vw, 18px);
}

.page-footer {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.backtotop {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 248, 251, 0.08);
}

.backtotop:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 920px) {
  .nav {
    flex-direction: column;
    gap: 12px;
  }

  .brand {
    position: static;
    transform: none;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 14px;
  }

  .content,
  .nav-wrap {
    border-radius: 22px;
  }

  .rules-top-gif {
    width: min(1180px, 100%);
    margin: 0 auto 20px;
  }

  .rules-top-gif img {
    display: block;
    width: min(560px, 100%);
    height: auto;
    margin: 0 auto;
  }

  .content {
    padding: 20px 18px;
  }
}
