@import url("./motion.css");

/* Grid compartilhado por todo o conteudo abaixo da primeira dobra. */
:root {
  --content-grid-max: 1648px;
  --content-grid-gutter: 24px;
}

#jogar.modes-section,
.defenses-section,
.tutorial-section,
.ranking-section {
  padding-right: 0;
  padding-left: 0;
}

#jogar.modes-section .modes-heading,
#jogar.modes-section .mode-grid,
.defenses-intro,
.defenses-content,
.tutorial-content,
.ranking-intro,
.ranking-inner,
.footer-inner {
  width: min(var(--content-grid-max), calc(100% - var(--content-grid-gutter) - var(--content-grid-gutter)));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

.ranking-intro,
.ranking-inner,
.footer-inner {
  position: relative;
}

.section-grid-marker {
  position: absolute;
  z-index: 8;
  width: 14px;
  height: 14px;
  opacity: 0.58;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.section-grid-marker::before,
.section-grid-marker::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.section-grid-marker::before {
  width: 11px;
  height: 2px;
  background: linear-gradient(90deg, rgba(220, 227, 225, 0.38), #f3f5f4 28%, #f3f5f4 72%, rgba(220, 227, 225, 0.38));
}

.section-grid-marker::after {
  width: 2px;
  height: 11px;
  background: linear-gradient(180deg, rgba(220, 227, 225, 0.38), #f3f5f4 28%, #f3f5f4 72%, rgba(220, 227, 225, 0.38));
}

.section-grid-marker-top-left,
.section-grid-marker-bottom-left {
  left: 0;
}

.section-grid-marker-top-right,
.section-grid-marker-bottom-right {
  left: 100%;
}

.section-grid-marker-top-left,
.section-grid-marker-top-right {
  top: 0;
}

.section-grid-marker-bottom-left,
.section-grid-marker-bottom-right {
  top: 100%;
}

:is(#jogar, #defesas, #tutorial, #ranking, footer),
:is(#jogar, #defesas, #tutorial, #ranking, footer) *,
:is(#jogar, #defesas, #tutorial, #ranking, footer) *::before,
:is(#jogar, #defesas, #tutorial, #ranking, footer) *::after,
.floating-bottom-nav {
  box-shadow: none !important;
}

@media (max-width: 1000px) {
  .topbar {
    width: calc(100% - 48px);
  }

  #jogar.modes-section .modes-heading,
  #jogar.modes-section .mode-grid,
  .defenses-intro,
  .defenses-content,
  .tutorial-content,
  .ranking-intro,
  .ranking-inner,
  .footer-inner {
    width: calc(100% - 48px);
  }

  #jogar .modes-heading,
  #jogar .mode-grid,
  .defenses-intro,
  .defenses-content,
  .tutorial-content,
  .ranking-intro,
  .ranking-inner,
  .footer-inner {
    border-right: 0;
    border-left: 0;
  }

  #jogar .grid-junction,
  .defenses-grid-junction,
  .section-grid-marker {
    display: none !important;
  }

  .defenses-content,
  .tutorial-content,
  .ranking-inner,
  .footer-inner {
    padding-right: 0;
    padding-left: 0;
  }

  #jogar .modes-heading > div:first-child,
  #jogar .modes-heading-action,
  #jogar .mode-card,
  #jogar .mode-card:hover,
  #jogar .mode-card.selected {
    padding-right: 0;
    padding-left: 0;
  }

  #jogar .mode-card.futuristic-card,
  #jogar .mode-card.futuristic-card:hover,
  #jogar .mode-card.futuristic-card.selected {
    border-bottom: 0;
  }

  #jogar .mode-card.futuristic-card::after,
  #jogar .mode-card.futuristic-card:hover::after,
  #jogar .mode-card.futuristic-card.selected::after {
    position: absolute;
    z-index: 3;
    bottom: 0;
    left: 50%;
    width: 100vw;
    height: 1px;
    background: rgba(141, 158, 174, 0.22);
    content: "";
    pointer-events: none;
    transform: translateX(-50%);
  }

  #jogar .modes-intro,
  #jogar .mode-card > p {
    font-size: 14px;
    line-height: 1.6;
  }

  .tutorial-heading h2,
  .ranking-intro h2 {
    font-size: clamp(40px, 6.4vw, 52px);
    line-height: 1.02;
  }

  .defenses-intro {
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .defenses-intro::before {
    content: none;
  }

  .defenses-intro h2 {
    margin-top: 56px;
    margin-bottom: 30px;
  }
}

@media (max-width: 800px) {
  .card-top {
    margin-bottom: 45px;
  }
}

@media (max-width: 680px) {
  .defense-dots {
    display: none;
  }

  .defenses-section {
    border-bottom: 0;
  }

  .tutorial-section {
    border-bottom: 0;
  }

  .ranking-intro::after {
    content: none;
  }
}

@media (max-width: 620px) {
  .defenses-intro h2 {
    width: 100%;
    margin-top: 48px;
    margin-bottom: 0;
    padding-inline: 0;
    overflow: visible;
    font-size: 36px;
    line-height: 1.05;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
  }

  .defenses-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    margin-bottom: 28px;
  }

  .defenses-content {
    padding-top: 32px;
  }

  .defense-mode-toggle {
    width: 100%;
    min-height: 48px;
    padding: 3px;
  }

  .defense-mode-toggle button {
    flex: 1;
    min-height: 40px;
    justify-content: center;
    padding-right: 10px;
    padding-left: 10px;
  }

  .defenses-controls {
    display: none;
  }

  #jogar .modes-heading h2 {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    font-size: 36px;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
  }

  .defense-layout {
    position: relative;
    gap: 0;
  }

  .defense-mobile-navigation {
    position: absolute;
    z-index: 5;
    top: 175px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    margin: 0;
    transform: translateY(-50%);
    pointer-events: none;
  }

  .defense-mobile-arrows {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .defense-mobile-navigation button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(var(--defense-accent-rgb), 0.42);
    border-radius: 50%;
    background: #0e0e11;
    color: var(--defense-accent);
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
  }

  .defense-mobile-navigation button:first-child {
    margin-left: -22px;
  }

  .defense-mobile-navigation button:last-child {
    margin-right: -22px;
  }

  .defense-mobile-navigation button:hover,
  .defense-mobile-navigation button:focus-visible {
    background: var(--defense-accent);
    color: #071017;
    transform: translateY(-2px);
  }

  .defense-mobile-navigation button svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.55;
  }

  .defense-mobile-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin: 14px auto 40px;
    color: var(--defense-accent);
    font: 700 11px/1 Figtree, Manrope, sans-serif;
    letter-spacing: 0.1em;
  }

  .tutorial-heading h2 {
    font-size: 36px;
  }

  .ranking-intro h2 {
    font-size: 36px;
  }

  .gameplay-loop h3 {
    font-size: 20px;
  }

  .tutorial-intro,
  .ranking-copy > p:last-of-type,
  .defense-role-copy {
    font-size: 14px;
  }

  .tutorial-content,
  .ranking-intro,
  .ranking-inner {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .tutorial-content {
    padding-bottom: 0;
  }

  .ranking-intro {
    padding-bottom: 0;
  }

  .ranking-inner {
    padding-top: 32px;
  }

  .defense-cta {
    display: flex;
    width: min(260px, 100%);
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
  }

  .ranking-copy .ranking-cta {
    width: min(100%, 360px);
    min-width: 0;
    padding-left: 20px;
    font-size: 13px;
    white-space: nowrap;
  }

  .ranking-copy .ranking-cta span {
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  #jogar .modes-heading h2 {
    font-size: 36px;
  }
}

@media (max-width: 393px) {
  .ranking-intro h2 {
    font-size: 34px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
