html {
  scroll-behavior: smooth;
}

/* Inter Font */

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

@container (min-width: 992px) {
  header {
    height: 240px;
    background: var(--bs-gray-400);
  }
}

header .nav-link {
  color: #F9E79B;
}

header .nav-link.active {
  color: #F1C50E !important;
}

header .nav-link:hover {
  color: #B29A36 !important;
}

.badge {
  background-color: #F1C50E !important;
  border: 1px solid #B29A36 !important;
  color: #0d6efd !important;
}

footer .nav-link {
  color: #F9E79B !important;
}

footer .nav-link:hover {
  color: #B29A36 !important;
}

footer .nav-link.current-page {
  color: #6c757d !important;
  pointer-events: none;
}

/* MD viewport: keep navbar content within header bounds */

@media (min-width: 768px) and (max-width: 991.98px) {
  header .navbar > .container {
    flex-wrap: nowrap;
    overflow: hidden;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  header .navbar-brand {
    flex: 0 1 auto;
    min-width: 0;
    margin-right: 0.25rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  header .navbar-brand h1 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  header .navbar-brand img {
    max-height: 60px !important;
    max-width: 60px !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  header .navbar-nav .nav-link {
    font-size: 0.8rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  header .linguise_switcher_root {
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
    flex-shrink: 1;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  header .btn[href*="donate"] {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
  }
}

/* SM and MD: third column in aboutus_aboutgame fills full width when wrapped */

/* XS and MD: about_us image fits within column */

@media (max-width: 575.98px), (min-width: 768px) and (max-width: 991.98px) {
  #about_us .col-md-6 img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
}

/* XS and SM: footer adapts height for wrapped links */

@media (max-width: 767.98px) {
  footer {
    height: auto !important;
  }
}

@media (max-width: 767.98px) {
  footer > .container {
    height: auto !important;
    flex-direction: column;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 991.98px) {
  footer nav, footer p {
    font-size: 12px;
  }
}

@media (max-width: 767.98px) {
  footer .navbar-nav .nav-link {
    padding: 0.15rem 0.4rem;
  }
}

/* XS: badges in discord and telegram containers fit within screen */

@media (max-width: 575.98px) {
  #discord .badge, #telegram .badge {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }
}

@media (max-width: 575.98px) {
  #telegram .col-md-6 {
    width: 100% !important;
  }
}

@media (max-width: 575.98px) {
  #telegram .col-md-6 > div {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* Discord image: max container width and centered */

#discord .col-auto {
  max-width: 100%;
}

#discord .col-auto img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* SM: aboutus_aboutgame spacer columns fixed width */

@media (min-width: 576px) and (max-width: 767.98px) {
  #aboutus_aboutgame > .row > .col:not(.col-spacer-smmd) {
    flex: 0 0 160px;
    width: 160px;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  #aboutus_aboutgame > .row > .col-spacer-smmd {
    display: block !important;
    flex: 0 0 160px;
    width: 160px;
  }
}

/* MD: aboutus_aboutgame spacer columns fixed width */

@media (min-width: 768px) and (max-width: 991.98px) {
  #aboutus_aboutgame > .row > .col:not(.col-spacer-smmd) {
    flex: 0 0 340px;
    width: 340px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  #aboutus_aboutgame > .row > .col-spacer-smmd {
    display: block !important;
    flex: 0 0 340px;
    width: 340px;
  }
}

/* LG+: hide SM/MD spacer */

@media (min-width: 992px) {
  #aboutus_aboutgame > .row > .col-spacer-smmd {
    display: none !important;
  }
}

/* XS viewport: header title wraps to 3 lines */

@media (max-width: 575.98px) {
  header h1 {
    font-size: 1.25rem;
    line-height: 1.3;
    word-spacing: 100vw;
    overflow: visible;
    min-height: 4.5em;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 575.98px) {
  header .navbar-brand {
    overflow: visible;
    min-height: auto;
    white-space: normal;
  }
}

/* XS: hide donate and linguise outside collapse, show them inside */

@media (max-width: 575.98px) {
  header .navbar > .container > .linguise_switcher_root, header .navbar > .container > .btn[href*="donate"] {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  header .collapse .linguise-xs, header .collapse .donate-xs {
    display: block !important;
  }
}

@media (max-width: 575.98px) {
  header .collapse .donate-xs {
    margin-top: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 575.98px) {
  header .collapse .linguise-xs {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
}

/* SM only: donate, linguise and toggler stacked vertically, right-aligned */

@media (min-width: 576px) and (max-width: 767.98px) {
  header .navbar > .container {
    flex-wrap: wrap;
    align-items: flex-start;
    position: relative;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  header .navbar-brand {
    flex: 1 1 auto;
    max-width: calc(100% - 90px);
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  header .navbar-toggler, header .linguise_switcher_root, header .btn[href*="donate"] {
    flex: 0 0 auto;
    position: absolute;
    right: 1rem;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  header .btn[href*="donate"] {
    order: 1;
    top: 0.75rem;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  header .linguise_switcher_root {
    order: 2;
    top: 3.5rem;
    margin: 0 !important;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  header .navbar-toggler {
    order: 3;
    top: auto;
    bottom: 0.75rem;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  header .collapse.navbar-collapse {
    order: 10;
    flex-basis: 100%;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  header .collapse .linguise-xs, header .collapse .donate-xs {
    display: none !important;
  }
}

/* XS: tools page – columns and containers fit screen width */

@media (max-width: 575.98px) {
  body.am4 > .row {
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
  }
}

@media (max-width: 575.98px) {
  body.am4 > .row > .col {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 575.98px) {
  body.am4 > .row > .col > .container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

@media (max-width: 575.98px) {
  body.am4 > .row > .col > .container img {
    max-width: 100%;
    height: auto;
  }
}

/* MD+: hide XS duplicates */

@media (min-width: 768px) {
  header .collapse .linguise-xs, header .collapse .donate-xs {
    display: none !important;
  }
}

