/* Site-wide resilience, accessibility and mobile performance layer. */
html {
  width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(215, 170, 50, .18);
}

body {
  width: 100%;
  min-width: 0;
}

:where(main, header, footer, nav, section, article, aside, figure, form, .shell, .wrap, .page) {
  min-width: 0;
}

img,
video,
svg,
canvas,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

img,
svg,
canvas { display: block; }

button,
a,
summary,
select,
input,
textarea {
  touch-action: manipulation;
}

select,
input,
textarea { font-size: max(16px, 1em); }

p,
h1,
h2,
h3,
h4,
li,
.link-value,
.comment-body { overflow-wrap: anywhere; }

.game-switcher a,
.nav-links a { overflow-wrap: normal; }

main > section:not(:first-child),
main > article:nth-child(n + 3),
.wrap > .section:not(:first-of-type),
.news-grid > .news-card:nth-child(n + 3),
.games > .game-card,
.about-block,
.module-grid > article,
footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 700px;
}

@media (max-width: 700px) {
  .shell {
    width: min(calc(100% - 28px), var(--max, 1200px));
    margin-inline: auto;
  }

  :where(.shell, .wrap, .page, .nav-inner, .game-switcher-inner) {
    margin-left: auto;
    margin-right: auto;
  }

  :where(main, .wrap, .page) { max-width: 100%; }

  .game-switcher { position: relative; }

  .game-switcher a,
  .game-switcher a:last-child {
    text-align: center;
    line-height: 1.2;
  }

  [class*="grid"],
  [class*="inner"],
  [class*="body"] { min-width: 0; }

  .hero-grid,
  .march-hero-grid,
  .leak-hero-grid,
  .news-hero-grid { margin-inline: auto; }

  .btn,
  [class*="button"],
  .reaction,
  .discord { min-height: 44px; }
}

@media (max-width: 420px) {
  .shell { width: min(calc(100% - 22px), var(--max, 1200px)); }
}

@media (max-width: 360px) {
  .news-corner {
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  .news-corner-link,
  .march-page .news-corner-link {
    padding: 14px 48px 13px 14px !important;
  }

  .news-corner-title,
  .march-page .news-corner-title {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.08;
  }

  .news-corner-summary { display: none; }
  .news-corner-read { margin-top: 10px; }
}

@media (hover: none) {
  a:hover,
  button:hover { transform: none !important; }

  .game-card:hover,
  .game-card:hover .game-image,
  .news-card:hover::before,
  .leak-button:hover { transform: none !important; }
}

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

@media (prefers-reduced-data: reduce) {
  body::before,
  body::after { background-image: none !important; }
}
