:root {
  --bg: #0b0e12;
  --surface: #12161d;
  --text: #e6ebf5;
  --muted: #9aa4b2;
  --primary: #7c4dff; /* roxo neon */
  --primary-2: #00e0ff; /* ciano neon */
  --accent: #22c55e; /* verde */
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --anim-fast: .18s;
  --anim-medium: .28s;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.bg-art {
  position: fixed;
  inset: -20vh -20vw auto auto;
  width: 120vw;
  height: 120vh;
  pointer-events: none;
  z-index: -2; /* fica abaixo do efeito premium */
  background: radial-gradient(60vw 60vh at 10% 10%, rgba(124,77,255,.25), transparent 60%),
              radial-gradient(40vw 40vh at 90% 30%, rgba(0,224,255,.25), transparent 60%),
              radial-gradient(50vw 50vh at 50% 90%, rgba(34,197,94,.18), transparent 60%);
  filter: blur(40px) saturate(120%);
}

/* Container do efeito premium (Three.js/Vanta) */
#bg-premium {
  position: fixed;
  inset: 0;
  z-index: -1; /* atrás do conteúdo, acima do gradiente */
  pointer-events: none; /* não interfere com cliques do site */
}

.container { width: min(1200px, 92%); margin: 0 auto; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  /* Suporte cross-browser para desfoque do topo */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(18,22,29,.75), rgba(18,22,29,.55));
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar .container { display: grid; grid-template-columns: 170px auto; align-items: center; gap: 12px; padding: 14px 0; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-mark { background: linear-gradient(45deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; font-size: 22px; letter-spacing: .6px; }
.brand-text { color: var(--text); font-weight: 700; opacity: .9; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap i { position: absolute; left: 12px; color: var(--muted); }
.search-wrap input {
  width: 100%;
  background: #0f141b;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px 12px 38px;
  outline: none;
}
.search-wrap input::placeholder { color: #74808f; }

.actions { display: flex; gap: 10px; justify-content: flex-end; position: relative; }
.icon-btn {
  background: #10151c;
  border: 1px solid rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; position: relative;
}
.icon-btn:hover { border-color: rgba(255,255,255,.15); }
.badge { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #08110c; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 2px 6px; border: 2px solid #0f141b; }

.page { padding: 24px 0 80px; }
.section-header h1, .section-header h2 { margin: 0; }
.muted { color: var(--muted); }
.section-sep { height: 1px; background: rgba(255,255,255,.06); margin: 28px 0; }
.space-top { margin-top: 8px; }

/* Packs - carrossel horizontal */
.packs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.card-pack, .card-game { background: var(--surface); border: 1px solid rgba(255,255,255,.06); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; transition: transform var(--anim-medium) var(--ease-out), box-shadow var(--anim-medium) var(--ease-out), border-color var(--anim-fast) var(--ease-out); will-change: transform; }
.card-pack:hover, .card-game:hover { transform: translateY(-4px); border-color: rgba(124,77,255,.30); box-shadow: 0 14px 40px rgba(124,77,255,.12), var(--shadow); }
.card-pack .media { height: 140px; background-size: cover; background-position: center; position: relative; }
.card-pack:hover .media { background-position: center 42%; }
.card-pack .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-pack .title { padding: 14px 14px 4px; font-weight: 700; }
.price-row { display: flex; align-items: baseline; gap: 8px; padding: 0 14px 12px; }
.price-old { color: #758195; text-decoration: line-through; }
.price { font-weight: 800; letter-spacing: .3px; }
.discount-pill { margin-left: auto; background: rgba(34,197,94,.15); color: var(--accent); border: 1px solid rgba(34,197,94,.25); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.card-footer { padding: 12px 14px; display: flex; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); color: var(--text); cursor: pointer; text-decoration: none; position: relative; overflow: hidden; transition: transform var(--anim-fast) var(--ease-out), box-shadow var(--anim-fast) var(--ease-out), filter var(--anim-fast) var(--ease-out), background-position 1.4s linear; }
.btn.primary { background: linear-gradient(90deg, var(--primary), var(--primary-2)); font-weight: 700; border: none; box-shadow: 0 0 0 0 rgba(124,77,255,.0); background-size: 200% auto; }
.btn.ghost { background: #10151c; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 8px 22px rgba(124,77,255,.15); background-position: right center; }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
/* Ripple element */
.btn .ripple { position: absolute; border-radius: 50%; transform: translate(-50%, -50%) scale(0); pointer-events: none; animation: ripple .6s var(--ease-out); background: rgba(255,255,255,.35); }
.btn.primary .ripple { background: rgba(124,77,255,.35); }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(2.6); opacity: 0; } }
/* Shine subtle */
@keyframes shine { 0% { background-position: left center; } 100% { background-position: right center; } }

/* Grid de catálogo */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card-game { position: relative; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid rgba(255,255,255,.06); cursor: default; }
.card-game .media { height: 260px; background-size: cover; background-position: center; position: relative; }
.card-game .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-game:hover { box-shadow: 0 14px 40px rgba(124,77,255,.18), var(--shadow); transform: translateY(-2px); transition: box-shadow var(--anim-medium) var(--ease-out), transform var(--anim-medium) var(--ease-out); }
.media .badge-corner { position: absolute; top: 10px; left: 10px; background: rgba(124,77,255,.85); color: white; padding: 4px 8px; border-radius: 8px; font-size: 12px; }
.media .fav { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.15); color: #fff; border-radius: 12px; padding: 8px; font-size: 20px; }
.media .fav.active { background: rgba(124,77,255,.85); border-color: rgba(255,255,255,.3); }

/* Overlay com desfoque na base do card */
.card-game .info-blur {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  /* altura agora se ajusta ao conteúdo */
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; justify-content: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.0), rgba(0,0,0,0.55));
  /* Removido o desfoque para deixar a capa nítida */
}
.info-blur .title { color: #fff; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,.35); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.info-blur .price-row { display: flex; align-items: baseline; gap: 8px; }
.info-blur .price-old { color: #c3cbd8; text-decoration: line-through; font-size: 13px; }
.info-blur .price { color: #fff; font-size: 16px; font-weight: 800; }

/* Botão grande dentro do card */
.info-blur .actions { display: flex; gap: 8px; }
.info-blur .actions .btn { flex: 1; justify-content: center; }
.btn i { font-size: 20px; margin-right: 8px; }

/* Remover estilos antigos do Tilt */
.card-game.tilt-init { transform: none; }
.card-game .tilt-tooltip, .card-game .tilt-overlay { display: none !important; }

/* Drawer carrinho */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity var(--anim-medium) var(--ease-out), backdrop-filter var(--anim-medium) var(--ease-out); z-index: 1002; }
.drawer { position: fixed; right: -400px; top: 0; height: 100vh; width: 380px; background: var(--surface); border-left: 1px solid rgba(255,255,255,.06); box-shadow: var(--shadow); transition: right .25s ease; z-index: 1003; display: flex; flex-direction: column; }
/* Usar unidades de viewport dinâmicas para cobrir a tela inteira em mobile */
@supports (height: 100dvh) {
  .drawer { height: 100dvh; }
}
@supports (height: 100svh) {
  .drawer { height: 100svh; }
}
.drawer.open { right: 0; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); will-change: backdrop-filter; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.drawer-body { padding: 12px 12px 0; overflow-y: auto; flex: 1; }
.drawer-footer { border-top: 1px solid rgba(255,255,255,.06); padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.drawer-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; padding: 10px; border: 1px solid rgba(255,255,255,.06); border-radius: 12px; background: #0f141b; margin-bottom: 10px; }
.drawer-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.drawer-item .title { font-weight: 600; }
.drawer-item .qty { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #121820; border: 1px solid rgba(255,255,255,.08); color: var(--text); cursor: pointer; }
.drawer-item .remove { color: var(--danger); background: transparent; border: none; cursor: pointer; }
.drawer-footer .total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.drawer-actions { display: flex; gap: 10px; }

/* Floating WhatsApp */
.floating-whatsapp { position: fixed; right: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 10px; background: #25D366; color: #04110a; padding: 12px 16px; border-radius: 999px; box-shadow: var(--shadow); text-decoration: none; font-weight: 700; }
.floating-whatsapp i { font-size: 20px; }

/* Modal de autenticação */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; z-index: 1004; }
.modal-overlay.open { display: block; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); will-change: backdrop-filter; }
.modal { width: min(420px, 92%); background: var(--surface); border: 1px solid rgba(255,255,255,.06); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.modal header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.06); padding-bottom: 8px; margin-bottom: 12px; }
.auth-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.auth-row input { width: 100%; background: #0b0e12; color: var(--text); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 10px; }
.auth-row .muted { margin: 6px 0 0; }

/* Modal de produto (detalhe) */
.product-modal { width: min(900px, 92%); padding: 0; overflow: hidden; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1005; max-height: 90vh; overflow-y: auto; }
.product-modal .hero { height: 380px; background-size: cover; background-position: center; position: relative; }
.product-modal .hero::after { content: ''; position: absolute; left:0; right:0; bottom:0; height: 40%; background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.55)); }
.product-modal header { position: absolute; right: 10px; top: 10px; border: none; margin: 0; padding: 0; }
.product-modal header .icon-btn { background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.15); color: #fff; }
.product-modal .content { padding: 18px; display: grid; gap: 12px; }
.product-modal .title { font-size: 22px; font-weight: 800; }
.product-modal .price-row { display: flex; align-items: baseline; gap: 10px; }
.product-modal .price-old { color: #c3cbd8; text-decoration: line-through; }
.product-modal .price { color: #fff; font-size: 20px; font-weight: 900; }
.product-modal .actions { display: flex; gap: 10px; align-items: center; }
.product-modal .actions .btn.primary { flex: 1; justify-content: center; }
.product-modal .desc { color: #cdd6e3; white-space: pre-line; line-height: 1.55; }

/* Responsividade */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .topbar .container { grid-template-columns: 1fr auto; }
  .brand { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
}

/* Bloquear scroll do fundo quando drawer estiver aberto */
body.no-scroll { overflow: hidden; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--anim-medium) var(--ease-out), transform var(--anim-medium) var(--ease-out); }
.reveal.show { opacity: 1; transform: none; }

/* Menu de conta (dropdown) */
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid rgba(255,255,255,.06); box-shadow: var(--shadow); border-radius: 12px; padding: 8px; z-index: 1001; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; color: var(--text); border: none; padding: 10px 12px; cursor: pointer; border-radius: 10px; }
.menu-item:hover { background: #10151c; }

/* Listas do modal Minha Conta */
.list .card { background: #0f141b; border: 1px solid rgba(255,255,255,.06); border-radius: 12px; margin-bottom: 10px; }
.list .card-header { display: flex; align-items: baseline; justify-content: space-between; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.list-plain { list-style: none; margin: 0; padding: 10px 12px; }
.list-plain li { margin: 4px 0; color: var(--text); }
.list .card-footer { border-top: 1px solid rgba(255,255,255,.06); padding: 12px; }

/* ===== Slider de Destaques ===== */
.featured-slider { position: relative; margin: 20px 0 8px; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)); border: 1px solid rgba(255,255,255,.06); border-radius: 16px; padding: 14px; /* velocidade padrão do scroll contínuo */ --slider-speed: 26s; animation: section-float 14s ease-in-out infinite; }
/* Glow sutil se movendo para dar vida à sessão (bem clean) */
.featured-slider::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, rgba(124,77,255,.08), rgba(0,224,255,.06), rgba(124,77,255,.08)); background-size: 200% 100%; animation: section-bg-shift 22s linear infinite; opacity: .35; }
@keyframes section-float { 0% { transform: translateY(0); } 50% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
@keyframes section-bg-shift { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
.slider-viewport { overflow: hidden; position: relative; }
/* Suaviza as bordas com fade para um visual clean */
.slider-viewport::before, .slider-viewport::after { content: ''; position: absolute; top: 0; bottom: 0; width: 60px; pointer-events: none; z-index: 2; }
.slider-viewport::before { left: 0; background: linear-gradient(to right, rgba(11,14,18,1), rgba(11,14,18,0)); }
.slider-viewport::after { right: 0; background: linear-gradient(to left, rgba(11,14,18,1), rgba(11,14,18,0)); }
/* Track contínuo: duplica conteúdo e anima da direita para a esquerda */
.slider-track { display: flex; gap: 16px; width: max-content; will-change: transform; }
.slider-track.auto-scroll { animation: featured-scroll var(--slider-speed, 40s) linear infinite; }
.featured-slider:hover .slider-track.auto-scroll { animation-play-state: paused; }
@keyframes featured-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .slider-track { animation: none; } }
.slide-card { width: clamp(280px, 30vw, 360px); min-width: clamp(280px, 30vw, 360px); background: var(--surface); border: 1px solid rgba(255,255,255,.06); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.slide-card .media { height: 200px; background-size: cover; background-position: center; position: relative; animation: media-pan 12s ease-in-out infinite; }
.slide-card .media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Pausar animações do slider quando modal estiver aberto para evitar glitches */
body.modal-open .featured-slider { animation-play-state: paused; }
body.modal-open .featured-slider .slider-track { animation-play-state: paused; }
.slide-card .body { padding: 12px; display: grid; gap: 8px; }
.slide-card .title { font-weight: 700; }
.slide-card .price { font-weight: 800; }
.slide-card .actions { display: flex; gap: 8px; }
.slide-card .actions .btn { flex: 1; }
/* Pack style dentro do slider */
.pack-card .price-row { display: flex; align-items: baseline; gap: 8px; }
.pack-card .price-old { color: #758195; text-decoration: line-through; }
.pack-card .price { font-weight: 800; }
.discount-pill { margin-left: auto; background: rgba(34,197,94,.15); color: var(--accent); border: 1px solid rgba(34,197,94,.25); padding: 2px 8px; border-radius: 999px; font-size: 12px; }

/* Pan sutil na imagem para não ficar estática */
@keyframes media-pan {
  0% { background-position: center; }
  50% { background-position: 60% center; }
  100% { background-position: center; }
}

/* ===== Rodapé ===== */
.site-footer { border-top: 1px solid rgba(255,255,255,.06); background: radial-gradient(60vw 60vh at 50% 100%, rgba(124,77,255,.1), transparent 70%), var(--bg); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 22px 0; }
.footer-col h4 { margin: 0 0 10px; }
.footer-col .socials { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--text); text-decoration: none; opacity: .9; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.06); padding: 12px 0; color: var(--muted); }

@media (max-width: 768px){
  .footer-grid { grid-template-columns: 1fr; }
  .slide-card { min-width: 240px; }
  .slide-card .media { height: 160px; }
}

/* Navegação do slider */
.slider-nav { position: absolute; inset: 0; pointer-events: none; }
.slider-nav .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); cursor: pointer; pointer-events: auto; }
.slider-nav .nav-btn:hover { background: rgba(0,0,0,.6); }
.slider-nav .nav-btn i { font-size: 22px; }
.slider-nav .nav-btn.prev { left: 6px; }
.slider-nav .nav-btn.next { right: 6px; }

/* ===== Detalhes de Pack no Modal ===== */
.pack-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0 16px;
}
.pack-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px;
  border-radius: 10px;
}
.pack-item img {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}
.pack-item .meta {
  display: flex;
  flex-direction: column;
}
.bullet {
  margin: 10px 0 4px;
  padding-left: 18px;
}
.bullet li { list-style: disc; }