:root {
  color-scheme: dark;
  --bg: #05050a;
  --surface: rgba(10, 11, 17, 0.78);
  --surface-strong: rgba(13, 14, 21, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f7f3ff;
  --muted: #c8c2d2;
  --dim: #8f879e;
  --cyan: #35dcff;
  --pink: #f15cff;
  --red: #ff5a68;
  --amber: #ffd166;
  --green: #75ffc8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --container: min(1180px, calc(100% - 32px));
  --radius: 8px;
}

::selection {
  background: rgba(53, 220, 255, 0.26);
  color: white;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: geometricPrecision;
}

body::-webkit-scrollbar {
  width: 11px;
}

body::-webkit-scrollbar-track {
  background: #06060b;
}

body::-webkit-scrollbar-thumb {
  border: 3px solid #06060b;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

body::-webkit-scrollbar-thumb:hover {
  background: rgba(53, 220, 255, 0.42);
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.scene-bg,
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scene-bg {
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(5, 5, 10, 0.16), rgba(5, 5, 10, 0.66) 58%, rgba(5, 5, 10, 0.96)),
    url("assets/metropolis-bg.png") center / cover no-repeat;
  transform: scale(1.02);
}

.login-page .scene-bg {
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.12), transparent 10%),
    radial-gradient(ellipse at 50% 72%, rgba(53, 220, 255, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(2, 2, 7, 0.18), rgba(5, 5, 10, 0.44) 44%, rgba(5, 5, 10, 0.94)),
    url("assets/metropolis-bg.png") center / cover no-repeat;
  filter: saturate(1.08) contrast(1.08);
  animation: cinematicDrift 18s ease-in-out infinite alternate;
}

.rules-page .scene-bg {
  background:
    linear-gradient(180deg, rgba(5, 5, 10, 0.78), rgba(5, 5, 10, 0.91) 45%, rgba(5, 5, 10, 0.985)),
    url("assets/metropolis-bg.png") center top / cover no-repeat;
}

.noise-layer {
  z-index: -2;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 88%);
}

.login-page .noise-layer {
  opacity: 0.32;
  background-image:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: auto, 54px 54px, 54px 54px;
  mix-blend-mode: screen;
}

.login-aura {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.86;
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 255, 255, 0.12), transparent 8%),
    radial-gradient(ellipse at 50% 50%, rgba(241, 92, 255, 0.17), transparent 31%),
    radial-gradient(ellipse at 50% 70%, rgba(53, 220, 255, 0.11), transparent 34%),
    linear-gradient(90deg, transparent 0 47%, rgba(255, 255, 255, 0.06) 49%, transparent 51% 100%);
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 78%, transparent);
  animation: auraBreath 5.8s ease-in-out infinite;
}

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 40;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 18px rgba(53, 220, 255, 0.42);
}

.login-shell {
  min-height: 100vh;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 44px);
  overflow: hidden;
  perspective: 1100px;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  left: 50%;
  width: min(760px, 84vw);
  height: 1px;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent),
    linear-gradient(90deg, transparent, rgba(53, 220, 255, 0.2), transparent);
  box-shadow: 0 0 22px rgba(53, 220, 255, 0.16);
}

.login-screen::before {
  top: 17%;
}

.login-screen::after {
  bottom: 14%;
}

.login-hud {
  position: absolute;
  inset: clamp(18px, 4vw, 44px);
  pointer-events: none;
  opacity: 0;
  animation: enterSoft 900ms ease forwards 120ms;
}

.login-hud span {
  position: absolute;
  width: clamp(34px, 6vw, 74px);
  height: clamp(34px, 6vw, 74px);
  border-color: rgba(255, 255, 255, 0.28);
  filter: drop-shadow(0 0 14px rgba(53, 220, 255, 0.13));
}

.login-hud span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 1px solid;
  border-left: 1px solid;
}

.login-hud span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 1px solid;
  border-right: 1px solid;
}

.login-hud span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.login-hud span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.login-core {
  position: relative;
  display: grid;
  justify-items: center;
  transform-style: preserve-3d;
}

.login-core::before,
.login-core::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
  transform: translateX(-50%);
}

.login-core::before {
  top: 50%;
  z-index: -1;
  width: clamp(260px, 38vw, 520px);
  height: clamp(260px, 38vw, 520px);
  border-radius: 50%;
  background:
    conic-gradient(from 120deg, transparent 0 18%, rgba(255, 255, 255, 0.14), transparent 34% 100%),
    radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 58%);
  opacity: 0.45;
  filter: blur(0.2px);
  animation: haloTurn 11s linear infinite;
}

.login-core::after {
  top: calc(50% + clamp(142px, 20vw, 238px));
  z-index: -2;
  width: clamp(210px, 34vw, 460px);
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(241, 92, 255, 0.28), rgba(53, 220, 255, 0.12) 42%, transparent 72%);
  filter: blur(12px);
  opacity: 0.78;
  animation: shadowBreath 3.8s ease-in-out infinite;
}

.login-mark {
  position: relative;
  width: clamp(210px, 25vw, 330px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto 32px;
  opacity: 0;
  transform: translateY(16px);
  animation: enterSoft 780ms ease forwards 160ms;
}

.login-mark::before,
.login-mark::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-mark::before {
  inset: 8%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  transform: rotate(45deg);
  opacity: 0.68;
  animation: markTilt 6s ease-in-out infinite;
}

.login-mark::after {
  inset: 16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.17), transparent 63%);
  filter: blur(10px);
  opacity: 0.52;
  animation: logoBacklight 2.8s ease-in-out infinite;
}

.login-mark img {
  position: relative;
  z-index: 2;
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(241, 92, 255, 0.5)) drop-shadow(0 16px 26px rgba(0, 0, 0, 0.34));
  animation: logoFloat 3.4s ease-in-out infinite, logoPulse 4.8s ease-in-out infinite;
}

.logo-glass {
  position: absolute;
  inset: 17%;
  z-index: 3;
  pointer-events: none;
  border-radius: 28px;
  background: linear-gradient(115deg, transparent 0 35%, rgba(255, 255, 255, 0.24) 45%, transparent 55% 100%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-38%) rotate(-8deg);
  animation: glassSweep 4.2s ease-in-out infinite 1.1s;
}

.loader-ring,
.loader-ring::before,
.loader-ring::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
}

.loader-ring {
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.04), 0 0 26px rgba(241, 92, 255, 0.1);
  animation: spin 9s linear infinite;
}

.loader-ring::before,
.loader-ring::after {
  content: "";
}

.loader-ring::before {
  inset: 12px;
  border-color: rgba(53, 220, 255, 0.32);
  border-style: dashed;
  animation: spin 6.4s linear infinite reverse;
}

.loader-ring::after {
  inset: 26px;
  border-color: rgba(255, 255, 255, 0.18);
  animation: pulseRing 1.8s ease-in-out infinite;
}

.access-button {
  position: relative;
  isolation: isolate;
  width: min(100%, 248px);
  min-height: 56px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), transparent 34% 66%, rgba(255, 255, 255, 0.055)),
    rgba(5, 5, 8, 0.38);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 850;
  text-transform: uppercase;
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
  opacity: 0;
  transform: translateY(16px);
  animation: enterSoft 780ms ease forwards 280ms;
}

.access-button::before,
.access-button::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.access-button::before {
  inset: 1px;
  z-index: -1;
  border-radius: calc(var(--radius) - 1px);
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  opacity: 0;
  transform: translateX(-72%);
}

.access-button::after {
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: calc(var(--radius) - 3px);
}

.access-button:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 32% 68%, rgba(255, 255, 255, 0.08)),
    rgba(10, 10, 14, 0.46);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.access-button:not(:disabled):hover::before {
  animation: buttonSheen 820ms ease;
}

.access-button:disabled {
  cursor: wait;
  color: rgba(255, 255, 255, 0.72);
}

.access-button.is-ready {
  border-color: rgba(255, 255, 255, 0.46);
  color: rgba(255, 255, 255, 0.94);
}

.access-button.is-entering {
  filter: brightness(0.9);
  transform: translateY(0) scale(0.985);
}

.button-text {
  position: relative;
  z-index: 2;
}

.button-progress {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 0%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.13)),
    linear-gradient(180deg, rgba(53, 220, 255, 0.08), rgba(241, 92, 255, 0.08));
  transition: width 160ms ease;
}

.access-button:focus-visible,
.nav-tabs a:focus-visible,
.ghost-link:focus-visible,
.filter-button:focus-visible,
.search-box:focus-within {
  outline: 2px solid rgba(53, 220, 255, 0.62);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(5, 5, 10, 0.86);
  backdrop-filter: blur(20px) saturate(1.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.brand,
.ghost-link,
.nav-tabs a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(241, 92, 255, 0.48));
  transition: transform 180ms ease, filter 180ms ease;
}

.brand:hover img {
  transform: translateY(-1px) scale(1.04);
  filter: drop-shadow(0 0 18px rgba(53, 220, 255, 0.38));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-tabs a,
.ghost-link,
.filter-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-tabs a:hover,
.ghost-link:hover,
.filter-button:hover {
  transform: translateY(-1px);
}

.ghost-link {
  color: var(--muted);
}

.nav-tabs a:hover,
.nav-tabs a.is-active,
.ghost-link:hover,
.filter-button:hover,
.filter-button.is-active {
  border-color: rgba(53, 220, 255, 0.38);
  background: rgba(53, 220, 255, 0.1);
}

.rules-app {
  min-height: 100vh;
  padding-bottom: 70px;
}

.hero,
.tool-strip,
.rules-section,
.site-footer,
.no-results {
  width: var(--container);
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
  padding: clamp(24px, 4vw, 44px) 0 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(1.78rem, 3.2vw, 2.72rem);
  line-height: 1.06;
  text-wrap: balance;
  text-shadow: 0 0 30px rgba(53, 220, 255, 0.12);
}

.hero-copy p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.25vw, 1.02rem);
  line-height: 1.65;
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

.hero-panel div {
  min-height: 72px;
  display: grid;
  align-content: center;
  padding: 14px 16px;
  background: rgba(10, 11, 17, 0.76);
}

.hero-panel strong {
  color: white;
  font-size: clamp(1.32rem, 3vw, 1.9rem);
  line-height: 1;
}

.hero-panel span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
}

.tool-strip {
  position: sticky;
  top: 84px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(7, 8, 13, 0.84);
  backdrop-filter: blur(18px) saturate(1.08);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
}

.result-count {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.84rem;
}

.search-box {
  flex: 1 1 300px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.052);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: rgba(200, 194, 210, 0.72);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rules-section {
  padding: clamp(20px, 4vw, 34px) 0;
  scroll-margin-top: 118px;
}

.rules-section + .rules-section {
  margin-top: 8px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  line-height: 1.04;
}

.section-count {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.82rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 282px), 1fr));
  gap: 16px;
}

.mixed-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.rule-card {
  --accent: var(--cyan);
  --accent-rgb: 53, 220, 255;
  position: relative;
  min-height: 176px;
  overflow: hidden;
  padding: clamp(18px, 2.5vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.13), rgba(255, 255, 255, 0.026)),
    var(--surface);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  opacity: 0;
  transform: translateY(14px);
}

.rule-card[data-accent="red"] {
  --accent: var(--red);
  --accent-rgb: 255, 90, 104;
}

.rule-card[data-accent="amber"] {
  --accent: var(--amber);
  --accent-rgb: 255, 209, 102;
}

.rule-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.38);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.rule-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 420ms ease, transform 420ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.rule-card.is-visible:hover {
  transform: translateY(-2px);
}

.rule-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.62;
}

.wide-card {
  grid-column: 1 / -1;
  min-height: auto;
}

.wide-card ul {
  columns: 2;
  column-gap: 34px;
}

.compact-card {
  min-height: 150px;
}

.rule-code {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rule-card h3 {
  margin-bottom: 10px;
  font-size: clamp(1.04rem, 1.3vw, 1.18rem);
  line-height: 1.2;
}

.rule-card p,
.rule-card li {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.62;
}

.rule-card p:last-child,
.rule-card ul:last-child {
  margin-bottom: 0;
}

.rule-card ul {
  margin: 0;
  padding-left: 1.15rem;
}

.rule-card li::marker {
  color: var(--accent);
}

.rule-card li + li {
  margin-top: 8px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
  margin: 8px 0 14px;
}

.timeline div {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.046);
  padding: 16px;
  position: relative;
}

.timeline div::after {
  content: "";
  position: absolute;
  inset: auto 16px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.timeline span {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-weight: 900;
}

.no-results {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
}

.is-hidden-card,
.section-empty {
  display: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--dim);
  font-size: 0.86rem;
}

.back-to-top {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 35;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 8, 13, 0.82);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: rgba(53, 220, 255, 0.38);
  background: rgba(53, 220, 255, 0.1);
}

@keyframes cinematicDrift {
  0% {
    transform: scale(1.025) translate3d(-6px, 0, 0);
  }

  100% {
    transform: scale(1.055) translate3d(6px, -4px, 0);
  }
}

@keyframes auraBreath {
  0%,
  100% {
    opacity: 0.74;
    filter: saturate(1);
  }

  50% {
    opacity: 0.95;
    filter: saturate(1.18);
  }
}

@keyframes enterSoft {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes haloTurn {
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

@keyframes shadowBreath {
  0%,
  100% {
    transform: translateX(-50%) scaleX(1);
    opacity: 0.58;
  }

  50% {
    transform: translateX(-50%) scaleX(1.12);
    opacity: 0.88;
  }
}

@keyframes markTilt {
  0%,
  100% {
    transform: rotate(45deg) scale(1);
    opacity: 0.42;
  }

  50% {
    transform: rotate(45deg) scale(1.05);
    opacity: 0.78;
  }
}

@keyframes logoBacklight {
  0%,
  100% {
    opacity: 0.38;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.68;
    transform: scale(1.04);
  }
}

@keyframes glassSweep {
  0%,
  48%,
  100% {
    opacity: 0;
    transform: translateX(-42%) rotate(-8deg);
  }

  58% {
    opacity: 0.72;
  }

  70% {
    opacity: 0;
    transform: translateX(42%) rotate(-8deg);
  }
}

@keyframes buttonSheen {
  0% {
    opacity: 0;
    transform: translateX(-72%);
  }

  35% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
    transform: translateX(72%);
  }
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.025);
  }
}

@keyframes logoPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 22px rgba(241, 92, 255, 0.5));
  }

  50% {
    filter: drop-shadow(0 0 30px rgba(53, 220, 255, 0.32));
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseRing {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .ghost-link {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 520px;
  }

  .tool-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .result-count {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  :root {
    --container: min(100% - 24px, 1180px);
  }

  html {
    scroll-padding-top: 116px;
  }

  .login-screen {
    padding: 18px;
  }

  .login-screen::before {
    top: 14%;
  }

  .login-screen::after {
    bottom: 12%;
  }

  .login-hud {
    inset: 16px;
    opacity: 0.74;
  }

  .login-core::before {
    width: min(86vw, 360px);
    height: min(86vw, 360px);
  }

  .login-core::after {
    top: calc(50% + 160px);
    width: min(78vw, 320px);
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    padding: 10px 12px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .brand small {
    font-size: 0.72rem;
  }

  .nav-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs a {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .hero {
    gap: 18px;
    padding-top: 24px;
    padding-bottom: 12px;
  }

  .hero h1 {
    margin-bottom: 0;
    font-size: clamp(1.72rem, 8vw, 2.35rem);
  }

  .hero-copy p:not(.eyebrow) {
    display: none;
  }

  .hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-panel div {
    min-height: 76px;
    padding: 12px;
  }

  .hero-panel strong {
    font-size: 1.35rem;
  }

  .hero-panel span {
    font-size: 0.72rem;
  }

  .tool-strip {
    position: relative;
    top: auto;
    padding: 10px;
  }

  .search-box {
    flex: none;
    min-height: 44px;
  }

  .filter-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-button {
    min-height: 40px;
  }

  .result-count {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .rule-card {
    min-height: auto;
  }

  .rule-card p,
  .rule-card li {
    font-size: 0.94rem;
  }

  .wide-card ul {
    columns: 1;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .login-mark {
    width: min(76vw, 246px);
    margin-bottom: 26px;
  }

  .access-button {
    width: min(100%, 226px);
    min-height: 54px;
  }

  .login-hud span {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
