:root {
  --bg: #0f1114;
  --panel: #13161b;
  --panel-alt: #0d0f12;
  --line: #1c2229;
  --text: #e8eff4;
  --text-dim: #9aa7b2;
  --accent: #00d0df;
  --accent-700: #00a8b4;
  --accent-glow: rgba(0, 208, 223, 0.18);
  --container: min(1200px, 92%);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, var(--accent-glow), transparent 60%), var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}
.container {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 20, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand__name {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.nav__list {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--text);
}

.site-main {
  flex: 1;
  padding: 0;
}

.rules-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 120px);
  max-width: 1400px;
  margin: 0 auto;
}

.rules-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  overflow-y: auto;
}

.sidebar-content {
  padding: 1.5rem 0;
}

.search-container {
  position: relative;
  margin: 0 1rem 1.5rem 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.sidebar-nav {
  padding: 0;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  margin: 0;
}

.nav-item {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  outline: none;
}

.nav-item:hover {
  background: var(--panel-alt);
  color: var(--text);
  border-left-color: var(--accent);
}

.nav-item.active {
  background: var(--panel-alt);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item.filtered-out {
  display: none;
}

.rules-content {
  padding: 2rem;
  background: var(--bg);
}

.rules-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.rules-header h1 {
  margin: 0 0 1rem 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.02em;
}

.rules-subtitle {
  font-size: 1.125rem;
  color: var(--text-dim);
  margin: 0 0 1rem 0;
  max-width: 65ch;
  line-height: 1.6;
}

.last-updated {
  font-size: 0.875rem;
  color: var(--text-dim);
  font-style: italic;
}

.rule-section {
  margin-bottom: 3rem;
  scroll-margin-top: 100px;
}

.rule-section h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
}

.rule-list {
  display: grid;
  gap: 1.5rem;
}

.rule-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.rule-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.rule-item h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}

.rule-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.rule-item.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.search-highlight {
  background: var(--accent);
  color: #001317;
  padding: 0.1em 0.2em;
  border-radius: 3px;
  font-weight: 600;
}

.ql-size-small {
  font-size: 0.75em;
}

.ql-size-large {
  font-size: 1.5em;
}

.ql-size-huge {
  font-size: 2.5em;
}

.rule-item .ql-size-small,
.rules-content .ql-size-small {
  font-size: 0.75em;
}

.rule-item .ql-size-large,
.rules-content .ql-size-large {
  font-size: 1.5em;
}

.rule-item .ql-size-huge,
.rules-content .ql-size-huge {
  font-size: 2.5em;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #0b0d10;
}

.footer__inner {
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__copy {
  margin: 0;
  color: var(--text-dim);
}

.footer__socials {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--panel);
  color: var(--text-dim);
  border: 1px solid var(--line);
  text-decoration: none;
  transition:
    filter 0.15s ease,
    transform 0.08s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.social-btn:hover {
  color: var(--text);
  border-color: color-mix(in sRGB, var(--accent) 60%, var(--line));
  filter: brightness(1.05);
}

.rules-sidebar::-webkit-scrollbar {
  width: 6px;
}

.rules-sidebar::-webkit-scrollbar-track {
  background: var(--panel-alt);
}

.rules-sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.rules-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

@media (max-width: 1024px) {
  .rules-container {
    grid-template-columns: 250px 1fr;
  }

  .rules-content {
    padding: 1.5rem;
  }

  .nav-item {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .rules-container {
    grid-template-columns: 1fr;
  }

  .rules-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-content {
    padding: 1rem;
  }

  .search-container {
    margin: 0 0 1rem 0;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-item {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: none;
    background: var(--panel-alt);
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .nav-item:hover,
  .nav-item.active {
    background: var(--accent);
    color: #001317;
    border-left: none;
  }

  .rules-content {
    padding: 1rem;
  }

  .rules-header h1 {
    font-size: 1.75rem;
  }

  .rule-section {
    margin-bottom: 2rem;
  }

  .rule-section h2 {
    font-size: 1.5rem;
  }

  .rule-item {
    padding: 1rem;
  }

  .rule-item h3 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .header__inner {
    padding: 10px 0;
  }

  .brand__name {
    font-size: 0.9rem;
  }

  .nav__list {
    gap: 12px;
  }

  .nav__link {
    font-size: 0.8rem;
  }

  .rules-content {
    padding: 0.75rem;
  }

  .rules-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .rules-subtitle {
    font-size: 1rem;
  }

  .nav-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
}

@media print {
  .rules-sidebar,
  .site-header,
  .site-footer {
    display: none;
  }

  .rules-container {
    grid-template-columns: 1fr;
  }

  .rules-content {
    padding: 0;
  }

  .rule-item {
    break-inside: avoid;
    background: white;
    color: black;
    border: 1px solid #ccc;
  }
}
