/* Chaos Lunia public identity and fair-play policy sections. */

@media (min-width: 1481px) {
  .topbar {
    width: min(1400px, calc(100% - 12px));
  }
}

/* The topbar stays dark in both themes, so its links need light contrast. */
[data-theme="light"] .topbar .desktop-nav a,
[data-theme="light"] .mobile-nav a,
[data-theme="light"] .mobile-nav .mobile-account-button {
  color: #c6cada;
}

[data-theme="light"] .topbar .desktop-nav a:hover,
[data-theme="light"] .topbar .desktop-nav a.active,
[data-theme="light"] .mobile-nav a:hover,
[data-theme="light"] .mobile-nav a.active,
[data-theme="light"] .mobile-nav .mobile-account-button:hover,
[data-theme="light"] .mobile-nav .mobile-account-button:focus-visible {
  color: #ffffff;
}

.mobile-nav {
  max-height: calc(100dvh - 116px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.about-section,
.rules-section {
  position: relative;
  isolation: isolate;
}

/* Keep these public headings readable if the reveal observer starts late. */
.about-section .section-heading .fx-reveal,
.rules-section .section-heading .fx-reveal {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  clip-path: inset(0 0 0 0);
}

.rules-section .news-type.red {
  background: var(--coral);
}

.about-section {
  background:
    radial-gradient(circle at 12% 20%, rgba(67, 199, 255, 0.11), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(255, 200, 87, 0.1), transparent 30%);
}

.about-heading p,
.rules-heading-row .section-heading p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.03rem;
  font-weight: 760;
  line-height: 1.65;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: stretch;
}

.about-story {
  --rest-rotate: -0.35deg;
  padding: 34px;
  overflow: hidden;
  transform: rotate(var(--rest-rotate));
}

.about-story::before {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -52px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(67, 199, 255, 0.34) 0 18%, transparent 19% 34%, rgba(255, 200, 87, 0.25) 35% 38%, transparent 39%);
  pointer-events: none;
}

.about-story > * {
  position: relative;
  z-index: 1;
}

.about-story h3 {
  max-width: 520px;
  margin: 18px 0 14px;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
  line-height: 1.05;
}

.about-story p {
  margin: 0;
  color: #555c70;
  font-weight: 760;
  line-height: 1.7;
}

.about-story .about-lead {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.about-characteristics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.about-characteristic {
  min-height: 188px;
  padding: 24px;
  overflow: hidden;
}

.about-characteristic:nth-child(odd) {
  transform: rotate(-0.35deg);
}

.about-characteristic:nth-child(even) {
  transform: rotate(0.35deg);
}

.about-index,
.rule-number {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  margin-bottom: 16px;
  border: 2px solid rgba(22, 25, 40, 0.16);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(67, 199, 255, 0.28), rgba(255, 200, 87, 0.36));
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 1000;
}

.about-characteristic h3,
.rule-card h3,
.alpha-reward-rule h3 {
  margin-bottom: 10px;
  line-height: 1.16;
}

.about-characteristic p,
.rule-card p,
.alpha-reward-rule p,
.rules-effective p,
.rules-report-row p {
  margin: 0;
  color: #5b6275;
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.62;
}

.rules-section {
  background:
    linear-gradient(180deg, rgba(255, 91, 106, 0.045), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(255, 91, 106, 0.1), transparent 32%);
}

.rules-layout {
  display: grid;
  gap: 20px;
}

.rules-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.42fr);
  gap: 24px;
  align-items: end;
}

.rules-heading-row .section-heading {
  margin-bottom: 0;
}

.rules-title-separator {
  color: var(--coral);
}

.rules-effective {
  padding: 24px;
  border-color: rgba(255, 200, 87, 0.4);
  transform: rotate(0.4deg);
}

.rules-effective strong {
  display: block;
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rule-card {
  min-height: 260px;
  padding: 26px;
}

.rule-card:nth-child(odd) {
  transform: rotate(-0.25deg);
}

.rule-card:nth-child(even) {
  transform: rotate(0.25deg);
}

.rule-card p + p {
  margin-top: 12px;
}

.rule-card-enforcement {
  border-color: rgba(255, 91, 106, 0.36);
  background:
    linear-gradient(145deg, rgba(255, 91, 106, 0.12), rgba(255, 255, 255, 0.1) 42%, transparent),
    var(--paper);
}

.alpha-reward-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 22px;
  align-items: stretch;
  padding: 30px;
  border-color: rgba(255, 91, 106, 0.5);
  overflow: hidden;
}

.alpha-reward-rule h3 {
  margin-top: 14px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.alpha-reward-consequence {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border: 2px solid rgba(167, 55, 66, 0.28);
  border-radius: 16px;
  background: rgba(255, 91, 106, 0.13);
}

.alpha-reward-consequence strong {
  margin-bottom: 8px;
  color: #9f2e3c;
  font-size: 1.2rem;
  font-weight: 1000;
}

.rules-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
}

.rules-report-row > div {
  max-width: 760px;
}

.rules-report-row strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 1rem;
}

.rules-report-row .button {
  flex: 0 0 auto;
}

.footer-info-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.footer-info-links > a:not(.footer-discord) {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 4px;
}

@media (max-width: 980px) {
  .about-layout,
  .rules-heading-row,
  .alpha-reward-rule {
    grid-template-columns: 1fr;
  }

  .rules-effective {
    transform: none;
  }
}

@media (max-width: 700px) {
  .about-characteristics,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .about-story,
  .about-characteristic,
  .rule-card {
    transform: none !important;
  }

  .about-story,
  .rule-card,
  .alpha-reward-rule {
    padding: 24px;
  }

  .about-actions,
  .rules-report-row,
  .footer-info-links {
    align-items: stretch;
    flex-direction: column;
  }

  .about-actions .button,
  .rules-report-row .button {
    width: 100%;
  }

  .rules-report-row {
    padding: 24px;
  }

  .footer-info-links {
    justify-content: flex-start;
  }
}
