html {
  scroll-behavior: smooth;
}

body {
  color: rgb(32, 32, 32);
  background: rgb(255, 255, 255);
  font-family: Outfit, Arial, sans-serif;
}

body > header, main > section:not(.details-hero) {
  zoom: 0.9;
}

a {
  color: inherit;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  h2 {
    transition: transform 0.3s, text-shadow 0.3s, background-color 0.3s, color 0.3s, border-color 0.3s;
  }

  h2:hover {
    transform: translateY(-4px);
    text-shadow: rgba(25, 41, 54, 0.2) 0px 5px 12px;
  }
}

@media (hover: hover) and (pointer: fine) {
  body h2:hover {
    background-color: var(--heading-hover-bg, #192936);
    border-color: var(--heading-hover-bg, #192936);
    color: var(--heading-hover-color, #fff);
  }
}

header {
  min-width: 0px;
}

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 280px;
}

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

@media (max-width: 1200px) {
  header {
    padding: 16px clamp(24px, calc(4 * var(--layout-vw)), 40px);
  }
}

@media (max-width: 992px) {
  header {
    padding: 16px 32px;
  }
}

@media (max-width: 767px) {
  .logo img {
    max-width: 170px;
  }

  header {
    flex-wrap: nowrap;
    gap: 14px;
    padding: 14px 18px;
  }

  .logo {
    flex: 1 1 auto;
  }

  .logo img {
    width: min(170px, calc(34 * var(--layout-vw)));
  }
}

@media (max-width: 640px) {
  header {
    text-align: center;
    padding: 16px 20px;
  }

  .logo {
    order: 1;
  }

  header {
    flex-wrap: wrap;
  }

  .logo {
    flex: 0 0 auto;
  }

  .logo img {
    width: min(185px, calc(52 * var(--layout-vw)));
  }

  header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  header .logo {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  header {
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
  }

  .logo img {
    width: min(150px, calc(45 * var(--layout-vw)));
  }
}

@media (max-width: 380px) {
  .logo img {
    max-width: 135px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a:focus-visible {
  outline: rgb(8, 175, 216) solid 2px;
  outline-offset: 4px;
}

.motion-tilt:hover {
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  .rounds-panel, .rounds-column {
    animation: auto ease 0s 1 normal none running none !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0px;
}

.rules-page .rules-banner {
  zoom: 1;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1921 / 818;
  overflow: hidden;
}

.rules-banner::before {
  content: "";
  position: absolute;
  inset: 0px;
  pointer-events: none;
  clip-path: inset(33% 32% 57%);
  transform: translateY(11.6137%);
}

.rules-banner h1 {
  position: relative;
  z-index: 1;
  max-width: 76%;
  margin: 0px;
  text-align: center;
  color: rgb(239, 56, 39);
  font-size: clamp(20px, 4.37vw, 84px);
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  animation: 0.85s ease-out 0s 1 normal both running rulesTitleEnter, 4s ease-in-out 0.85s infinite normal none running rulesTitleFloat;
}

@media (prefers-reduced-motion: reduce) {
  .rules-banner h1 {
    animation: auto ease 0s 1 normal none running none;
  }
}

.rules-page main > .rules-section {
  zoom: 1;
}

.rules-section {
  padding: clamp(24px, 3.3vw, 64px) 6.8% 0px;
  background-color: rgb(255, 255, 255);
  background-image: repeating-linear-gradient(90deg, rgba(26, 43, 54, .018) 0 2px, transparent 2px 6px), repeating-linear-gradient(0deg, rgba(26, 43, 54, .014) 0 1px, transparent 1px 5px);
}

.rules-inner {
  width: 100%;
  margin: auto;
  padding: clamp(24px, 1.8vw, 35px) clamp(20px, 3.65vw, 70px) clamp(28px, 3.3vw, 64px);
  border: 2px solid var(--section-accent);
  background: rgb(255, 255, 255);
}

.rules-section h2 {
  margin: 0px 0px clamp(22px, 2.15vw, 42px);
  color: var(--section-accent);
  font-size: clamp(25px, 2.15vw, 42px);
  line-height: 1.2;
  text-align: center;
  font-weight: 600;
}

.rules-section h2::after {
  content: none;
}

.rules-section p, .rules-list {
  font-size: clamp(17px, 1.46vw, 28px);
  line-height: 1.35;
}

.rules-section strong {
  font-weight: 400;
}

.rules-strategies {
  padding: clamp(20px, 1.65vw, 32px) 12.25% 0px;
  background: rgb(30, 42, 54);
  --section-accent: #00bfea;
  color: rgb(255, 255, 255);
}

.rules-strategies .rules-inner {
  padding: clamp(24px, 2vw, 40px) 4% clamp(32px, 3.8vw, 73px);
  border-color: rgb(191, 197, 201);
  background: transparent;
}

.rules-strategies h2 {
  --heading-hover-bg: #00bfea;
  --heading-hover-color: #fff;
  margin-bottom: clamp(14px, 1.15vw, 22px);
}

.rules-strategies p {
  margin: 0px;
  text-align: center;
}

.rules-format {
  --section-accent: #ff3b2c;
  padding-top: clamp(24px, 2.1vw, 41px);
}

.rules-list {
  list-style: none;
  display: grid;
  gap: clamp(12px, 1.12vw, 22px);
}

.rules-list li {
  position: relative;
  padding-left: clamp(24px, 2.2vw, 42px);
}

.rules-list li::before {
  content: "";
  position: absolute;
  top: 0.2em;
  left: 0px;
  width: clamp(12px, 1vw, 19px);
  height: clamp(17px, 1.4vw, 27px);
  background: url("../images/rules-bullet.png") center center / contain no-repeat;
}

.rules-list a {
  color: inherit;
  overflow-wrap: anywhere;
}

.rules-list a:hover {
  text-decoration: underline;
}

.rules-pattern {
  --section-accent: #383d78;
  color: rgb(32, 32, 32);
}

.rules-pattern .rules-inner {
  padding-bottom: clamp(24px, 2.5vw, 48px);
}

.pattern-table-wrap {
  margin: 0px clamp(-60px, -3.1vw, -12px);
}

.pattern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: clamp(12px, 3.1vw, 60px) 0px;
  table-layout: fixed;
  text-align: center;
  font-size: clamp(16px, 1.46vw, 28px);
  color: rgb(255, 255, 255);
}

.pattern-table th, .pattern-table td {
  padding: clamp(10px, 0.85vw, 16px) 6px;
  line-height: 1.3;
  border: 0px;
  font-weight: 400;
}

.pattern-table thead th {
  background: rgb(255, 255, 255);
  font-weight: 600;
  font-size: clamp(18px, 1.85vw, 36px);
  box-shadow: currentcolor 0px 0px 0px 1px inset;
}

.pattern-table thead th:nth-child(1) {
  color: rgb(255, 59, 44);
}

.pattern-table thead th:nth-child(2) {
  color: rgb(0, 191, 234);
}

.pattern-table thead th:nth-child(3) {
  color: rgb(248, 117, 22);
}

.pattern-table tbody th {
  background: rgb(246, 95, 83);
}

.pattern-table tbody td:nth-child(2) {
  background: rgb(25, 188, 226);
}

.pattern-table tbody td:nth-child(3) {
  background: rgb(251, 137, 55);
}

.pattern-table tbody tr:nth-child(2n) th {
  background: rgb(239, 56, 39);
}

.pattern-table tbody tr:nth-child(2n) td:nth-child(2) {
  background: rgb(0, 181, 218);
}

.pattern-table tbody tr:nth-child(2n) td:nth-child(3) {
  background: rgb(244, 119, 25);
}

.pattern-note {
  margin: clamp(22px, 2vw, 39px) 0px 0px;
  text-align: left;
}

.rules-prelims {
  --section-accent: #08c5ef;
  padding-top: clamp(32px, 5.8vw, 112px);
}

.rules-prelims .rules-list li::before {
  background-image: url("../images/rules-bullet-blue.png");
}

.rules-mains {
  --section-accent: #ff791d;
  padding-bottom: clamp(24px, 3.3vw, 64px);
}

.rules-mains .rules-list li::before {
  background-image: url("../images/rules-bullet-orange.png");
}

.js-motion .rules-section .motion-reveal {
  translate: 0px 22px;
  scale: 1;
  filter: none;
  transition: opacity .6s ease var(--motion-delay,0ms),translate .65s ease var(--motion-delay,0ms);
}

.js-motion .rules-section .motion-reveal.is-visible {
  translate: 0px;
  opacity: 1;
}

@media (max-width: 900px) {
  .rules-section p, .rules-list {
    line-height: 1.5;
  }

  .rules-strategies {
    padding-inline: 5%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rules-page .motion-reveal, .rules-page .table-row-reveal {
    opacity: 1 !important;
    translate: none !important;
    scale: 1 !important;
    filter: none !important;
    transition: none !important;
  }
}

@media (max-width: 560px) {
  .rules-strategies {
    padding-inline: 5%;
  }

  .rules-section:not(.rules-strategies) {
    padding-inline: 5%;
  }

  .rules-inner {
    padding: 24px 16px;
  }

  .pattern-table {
    border-spacing: 8px 0px;
    font-size: 15px;
  }

  .pattern-table-wrap {
    margin-inline: -8px;
  }

  .pattern-table thead th {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .pattern-table th, .pattern-table td {
    padding: 10px 3px;
  }
}

/* Keep mobile sections on the same centered content width, without CSS zoom. */
@media (max-width: 900px) {
  .rules-page {
    --rules-gutter: max(16px, 5%, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }

  .rules-page main {
    width: 100%;
    min-width: 0;
  }

  .rules-page main > :is(.rules-section, .rounds-section, .rules-breadcrumb) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: var(--rules-gutter);
    zoom: 1;
  }

  .rules-page :is(.rules-inner, .rounds-panel) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: auto;
  }

  .rules-page .rules-list li {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
