: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;
  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 { width: min(1200px, 92%); margin: 0 auto; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  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 .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 .media { height: 180px; background-size: cover; background-position: center; position: relative; }
.card-game:hover .media { background-position: center 42%; }
.card-game .content { padding: 14px; }
.card-game .title { font-weight: 700; margin: 0 0 6px; }
.card-game .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { background: #0f141b; border: 1px solid rgba(255,255,255,.06); color: #b6c0cf; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.card-game .footer { display: flex; align-items: center; gap: 10px; }
.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: 10px; padding: 6px; }
.media .fav.active { background: rgba(124,77,255,.85); border-color: rgba(255,255,255,.3); }

/* TiltedCard styles */
.card-game { position: relative; }
.card-game.tilt-init { will-change: transform; transition: transform 160ms ease; transform-style: preserve-3d; }
.card-game.tilt-init:hover { box-shadow: 0 14px 40px rgba(124,77,255,.12), var(--shadow); }
.card-game .tilt-tooltip { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 8px; opacity: 0; transition: opacity 200ms ease; pointer-events: none; }
.card-game:hover .tilt-tooltip { opacity: 1; }
.card-game .tilt-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.45)); opacity: 0; transition: opacity 220ms ease; pointer-events: none; display: flex; align-items: flex-end; }
.card-game:hover .tilt-overlay { opacity: 1; }
.card-game .tilt-overlay-text { color: #fff; font-size: 14px; padding: 12px; font-weight: 600; }

/* 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; backdrop-filter: blur(2px); }
.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,.6); display: none; align-items: center; justify-content: center; z-index: 1004; }
.modal-overlay.open { display: flex; backdrop-filter: blur(2px); }
.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; }

/* 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; }