/* Movimento do site: mesma curva e mesmos tempos em tudo (abrir, fechar, hover, foco). */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.18s;
  --dur: 0.3s;
  --dur-slow: 0.55s;
}

html { scroll-behavior: smooth; }
::selection { background: rgb(242 193 78 / 0.35); color: #fff; }

/* Transição padrão de todo elemento interativo. Peso zero: qualquer regra do tema vence. */
:where(a, button, [role="button"], summary, input, select, textarea, label) {
  transition:
    color var(--dur-fast) ease,
    background-color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    box-shadow var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out),
    opacity var(--dur-fast) ease;
}

:where(button:not(:disabled), [role="button"]):active { transform: scale(0.97); }

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 3px;
}

/* Entrada da página (só opacidade, para não mexer em elementos fixos). */
main { animation: mx-page-in var(--dur-slow) var(--ease-out) both; }
@keyframes mx-page-in { from { opacity: 0; } }

/* Menu lateral: itens entram em sequência ao abrir. */
.gm-dw[data-aberto="true"] .gm-dw-item,
.gm-dw[data-aberto="true"] .gm-dw-secao {
  animation: mx-rise 0.5s var(--ease-out) both;
}
.gm-dw[data-aberto="true"] .gm-dw-corpo > :nth-child(1) { animation-delay: 0.05s; }
.gm-dw[data-aberto="true"] .gm-dw-corpo > :nth-child(2) { animation-delay: 0.08s; }
.gm-dw[data-aberto="true"] .gm-dw-corpo > :nth-child(3) { animation-delay: 0.11s; }
.gm-dw[data-aberto="true"] .gm-dw-corpo > :nth-child(4) { animation-delay: 0.14s; }
.gm-dw[data-aberto="true"] .gm-dw-corpo > :nth-child(5) { animation-delay: 0.17s; }
.gm-dw[data-aberto="true"] .gm-dw-corpo > :nth-child(6) { animation-delay: 0.2s; }
.gm-dw[data-aberto="true"] .gm-dw-corpo > :nth-child(n + 7) { animation-delay: 0.23s; }
@keyframes mx-rise { from { opacity: 0; transform: translateX(-14px); } }

/* Janelas (dialog): mesma curva do carrinho. */
.dialog[data-state="open"], .dialog[data-state="closed"] { animation-timing-function: var(--ease-out); }
.dialog[data-state="open"] > div, .dialog[data-state="closed"] > div { animation-timing-function: var(--ease-out); }

/* Seções sobem suavemente ao entrar na tela (onde o navegador suporta, sem JavaScript). */
@supports (animation-timeline: view()) {
  .gta, .t5, .hrv, .cat-shelf, .home-vdepo-section, .av-hero, .av-toolbar, .cb-head, .home-steam-tutorial, .hs-moldura {
    animation: mx-section-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
  @keyframes mx-section-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
}

/* Cartões de jogo: elevação padronizada. */
@media (hover: hover) and (pointer: fine) {
  .ig-store-card { transition: transform var(--dur) var(--ease-out), border-color var(--dur-fast) ease, box-shadow var(--dur-slow) var(--ease-out); }
  .ig-store-card:hover { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main, .gm-dw[data-aberto="true"] .gm-dw-item, .gm-dw[data-aberto="true"] .gm-dw-secao { animation: none; }
  @supports (animation-timeline: view()) {
    .gta, .t5, .hrv, .cat-shelf, .home-vdepo-section, .av-hero, .av-toolbar, .cb-head, .home-steam-tutorial, .hs-moldura { animation: none; }
  }
}

.ig-live[hidden] {
  display: none;
}

.ig-sale-stack {
  position: fixed;
  z-index: 35;
  top: clamp(6rem, 13vh, 8.5rem);
  right: 1.25rem;
  width: min(21rem, calc(100vw - 2.5rem));
  pointer-events: none;
}

.ig-sale-item {
  display: grid;
  grid-template-rows: 1fr;
  pointer-events: auto;
  animation: ig-sale-enter 460ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.ig-sale-slot {
  min-height: 0;
  overflow: hidden;
  padding: 0 0.5rem 0.25rem;
  margin: 0 -0.5rem;
}

.ig-sale-item.is-leaving {
  pointer-events: none;
  animation: ig-sale-leave 320ms cubic-bezier(0.4, 0, 1, 1) both;
}

.ig-sale-notice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
  padding: 0.7rem 0.4rem 0.85rem 0.7rem;
  overflow: hidden;
  border: 1px solid #ffffff14;
  border-radius: 1rem;
  background:
    radial-gradient(90% 120% at 0% 0%, #f2c14e14, transparent 55%),
    linear-gradient(160deg, #241a35f2, #15101fF2);
  color: #f6effc;
  box-shadow: 0 10px 30px -8px #07030f99;
  transform-origin: top center;
  transition:
    transform 400ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    opacity 400ms ease;
}

.ig-sale-item:nth-child(2) .ig-sale-notice {
  transform: scale(0.965);
  opacity: 0.78;
}

.ig-sale-item:nth-child(n + 3) .ig-sale-notice {
  transform: scale(0.93);
  opacity: 0.55;
}

.ig-sale-notice__cover {
  position: relative;
  display: block;
  width: 2.9rem;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #2b2040;
  box-shadow:
    0 6px 14px -4px #000a,
    0 0 0 1px #ffffff1f;
  transform: rotate(-3deg);
  animation: ig-sale-cover 600ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) 120ms both;
}

.ig-sale-notice__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-sale-notice__cover[hidden] {
  display: none;
}

.ig-sale-notice__buyer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: #b3a5c7;
  font:
    600 0.72rem/1.3 Manrope,
    sans-serif;
}

.ig-sale-notice__buyer strong {
  overflow: hidden;
  color: #efe6fa;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-sale-notice__avatar {
  display: grid;
  flex: none;
  width: 1.15rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--ig-sale-avatar-bg, #564071);
  color: #fff;
  font:
    800 0.6rem/1 Manrope,
    sans-serif;
}

.ig-sale-notice__games {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
  font:
    800 0.92rem/1.25 Manrope,
    sans-serif;
  overflow-wrap: anywhere;
}

.ig-sale-notice__games li + li {
  margin-top: 0.1rem;
}

.ig-sale-notice__details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  margin: 0.35rem 0 0;
  color: #8f80a6;
  font:
    600 0.7rem/1.25 Manrope,
    sans-serif;
}

.ig-sale-notice__details strong {
  color: #f2cf86;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ig-sale-notice button {
  display: grid;
  align-self: start;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.5rem;
  color: #8f80a6;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.ig-sale-notice button:is(:hover, :focus-visible) {
  background: #ffffff14;
  color: #fff;
}

.ig-sale-notice__timer {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
}

.ig-sale-notice__timer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #f2c14e80;
  transform-origin: left;
  animation: ig-sale-timer var(--ig-sale-life, 5000ms) linear both;
}

.ig-sale-stack:is(:hover, :focus-within) .ig-sale-notice__timer::after {
  animation-play-state: paused;
}

.ig-live {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.875rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid #ffffff12;
  border-radius: 0.9rem;
  background:
    radial-gradient(80% 140% at 0% 50%, #7852ae24, transparent 70%),
    #ffffff06;
  font-family: Manrope, sans-serif;
}

.ig-live__faces {
  display: flex;
  flex: none;
}

.ig-live__faces i {
  display: grid;
  width: 1.7rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px #1a1228;
  color: #fff;
  font:
    800 0.68rem/1 Manrope,
    sans-serif;
}

.ig-live__faces i + i {
  margin-left: -0.5rem;
}

.ig-live__text {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  min-width: 0;
  color: #a99bbf;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.ig-live__row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ig-live__row strong {
  display: inline-block;
  min-width: 1.1ch;
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ig-live__row--cart strong {
  color: #f2cf86;
}

.ig-live__row strong.is-tick {
  animation: ig-count-tick 420ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.ig-live__dot {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #5be08a;
  box-shadow: 0 0 0 0 #5be08a66;
  animation: ig-live-ping 2s ease-out 3;
}

.ig-live__bag {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  color: #f2c14e;
}

@keyframes ig-sale-enter {
  from {
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateX(1.25rem);
  }
}

@keyframes ig-sale-leave {
  to {
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateX(0.75rem);
  }
}

@keyframes ig-sale-cover {
  0% {
    transform: rotate(-9deg) scale(0.85);
  }

  65% {
    transform: rotate(-1deg) scale(1.04);
  }
}

@keyframes ig-sale-timer {
  to {
    transform: scaleX(0);
  }
}

@keyframes ig-count-tick {
  0% {
    opacity: 0.3;
    transform: translateY(0.35em);
  }

  60% {
    transform: translateY(-0.08em);
  }
}

@keyframes ig-live-ping {
  to {
    box-shadow: 0 0 0 0.4rem #5be08a00;
  }
}

@media (max-width: 400px) {
  .ig-live {
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
  }

  .ig-live__text {
    font-size: 0.72rem;
  }
}

@media (max-width: 767px) {
  .ig-sale-stack {
    top: auto;
    right: auto;
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    left: 0.75rem;
    width: min(19.5rem, calc(100vw - 4.75rem));
  }

  .ig-sale-item {
    animation-name: ig-sale-enter-mobile;
  }

  .ig-sale-item.is-leaving {
    animation-name: ig-sale-leave-mobile;
  }

  .ig-sale-notice {
    gap: 0.65rem;
    padding: 0.6rem 0.25rem 0.8rem 0.6rem;
  }

  .ig-sale-notice__cover {
    width: 2.5rem;
  }

  .ig-sale-notice button {
    width: 2.25rem;
    height: 2.25rem;
  }
}

@keyframes ig-sale-leave-mobile {
  to {
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(0.6rem);
  }
}

@keyframes ig-sale-enter-mobile {
  from {
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(0.9rem);
  }
}

@media (max-width: 1023px) {
  body:has([data-product-activity]) .ig-sale-stack {
    top: auto;
    bottom: calc(9.75rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ig-sale-item,
  .ig-sale-notice__cover,
  .ig-live__row strong.is-tick,
  .ig-live__dot {
    animation: none;
  }
}

/* Abas da página de produto: em tela estreita rolam de lado em vez de empurrar a última aba para fora. */
#gm-tabs > div:first-child {
  overflow-x: auto;
  scrollbar-width: none;
}

#gm-tabs > div:first-child::-webkit-scrollbar {
  display: none;
}

#gm-tabs [data-tab] {
  flex: none;
  white-space: nowrap;
}
