/* =========================================================
   Sua Lista | Workin'Store — Style
   Tema Gamer Premium (PlayStation-inspired)
   Glassmorphism • Neon azul/roxo • Preto
   ========================================================= */

:root {
  --bg-1: #05060d;
  --bg-2: #0b0d1a;
  --bg-3: #11132a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --text-muted: #a4a9c9;
  --primary: #00b3ff;   /* neon azul */
  --secondary: #8a2be2; /* neon roxo */
  --accent: #ff2bd6;
  --success: #22c55e;
  --warning: #eab308;
  --orange: #f97316;
  --danger: #ef4444;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-neon-blue: 0 0 25px rgba(0, 179, 255, 0.45);
  --shadow-neon-purple: 0 0 25px rgba(138, 43, 226, 0.45);
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Rajdhani', system-ui, sans-serif;
  --transition: 0.25s cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* HTML e BODY: garantem cor de fundo escura em qualquer altura de rolagem,
   evitando "margens brancas" quando o conteúdo é maior que a viewport
   (especialmente no painel admin em celulares). */
html { background-color: var(--bg-1); }
html, body {
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg-1);
  background-image:
    radial-gradient(1200px 800px at 10% -10%, rgba(0, 179, 255, 0.18), transparent 60%),
    radial-gradient(1000px 800px at 100% 0%, rgba(138, 43, 226, 0.20), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(255, 43, 214, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 40%, var(--bg-3));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100dvh; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }

/* -------- Glassmorphism helper -------- */
.glass {
  background: var(--surface);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}

/* -------- Loader -------- */
.app-loader {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  gap: 1rem;
  background: var(--bg-1);
  z-index: 9999;
  flex-direction: column;
}
.app-loader p { color: var(--text-muted); font-family: var(--font-display); letter-spacing: .2em; }
.loader-ring {
  width: 64px; height: 64px;
  border: 4px solid rgba(255,255,255,.08);
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: var(--shadow-neon-blue);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------- Header -------- */
.site-header {
  position: sticky; top: 12px; z-index: 50;
  margin: 12px 16px 0;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 44px; height: 44px; object-fit: contain;
  filter: drop-shadow(0 0 10px var(--primary));
}
.brand-logo:not([src]), .brand-logo[src=""] { display: none; }
.brand-title {
  font-family: var(--font-display);
  font-weight: 900; letter-spacing: .1em;
  font-size: 1.15rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.header-actions { display: flex; gap: 10px; align-items: center; }

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px;
  font-weight: 600; letter-spacing: .04em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  border: 1px solid var(--border);
  background: var(--surface);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  box-shadow: var(--shadow-neon-blue);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(0,179,255,.7), 0 0 40px rgba(138,43,226,.5); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-neon {
  border-color: rgba(0,179,255,.5);
  box-shadow: inset 0 0 0 1px rgba(0,179,255,.2), 0 0 15px rgba(0,179,255,.25);
}
.btn-ghost { background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn.danger { color: #ffb4b4; }
.badge {
  background: var(--accent);
  color: white; font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 0 12px rgba(255,43,214,.6);
}

/* -------- Pendrive bar -------- */
.pendrive-bar {
  margin: 14px 16px;
  padding: 16px 20px;
  display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: center;
}
.pendrive-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pendrive-controls label { font-weight: 700; color: var(--text-muted); }

/* Botões de capacidade (visíveis apenas no mobile) */
.pendrive-buttons { display: none; gap: 8px; flex-wrap: wrap; }
.pendrive-buttons button {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.pendrive-buttons button:hover { transform: translateY(-1px); }
.pendrive-buttons button.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(124, 58, 237, .5);
}
.progress-track {
  height: 14px; width: 100%; border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden; border: 1px solid var(--border);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #10b981, #22c55e);
  transition: width .4s ease, background .3s ease;
  box-shadow: 0 0 12px rgba(34,197,94,.5);
}
.pendrive-stats {
  display: flex; gap: 18px; margin-top: 8px; flex-wrap: wrap;
  color: var(--text-muted); font-weight: 500;
}
.pendrive-stats b { color: var(--text); }

/* -------- Selects & inputs -------- */
.select-neon, input[type=text], input[type=email], input[type=password], input:not([type]) {
  background: rgba(255,255,255,.05);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.select-neon:focus, input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,179,255,.2);
}
.select-neon option { background: #0b0d1a; }

/* -------- Filters -------- */
.filters {
  margin: 14px 16px;
  padding: 14px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px;
}
.filter-item.search { position: relative; }
.filter-item.search i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
}
.filter-item.search input { width: 100%; padding-left: 34px; }

/* -------- Catalog grid -------- */
.catalog-wrapper { padding: 6px 16px 40px; }
.games-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp .35s ease both;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,179,255,.5);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), var(--shadow-neon-blue);
}
.game-card .thumb {
  aspect-ratio: 3/4;
  background: #0a0c18;
  overflow: hidden;
}
.game-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.game-card:hover .thumb img { transform: scale(1.06); }
.game-card .info { padding: 10px 12px; }
.game-card .info h3 { font-size: 15px; line-height: 1.2; margin-bottom: 4px; }
.game-card .meta { color: var(--text-muted); font-size: 12px; display: flex; justify-content: space-between; }

/* Botão de ação flutuante no card (adicionar OU remover) */
.game-card .card-action {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  opacity: 0; transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  z-index: 3;
}
.game-card .card-action.add {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow-neon-blue);
}
.game-card .card-action.remove {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 0 18px rgba(239,68,68,.55);
}
.game-card:hover .card-action { opacity: 1; transform: translateY(0); }
.game-card.in-list { border-color: var(--accent); box-shadow: 0 0 20px rgba(255,43,214,.4); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px);} to {opacity:1; transform:none;} }

/* -------- Barra de alternância Grade / Lista -------- */
.view-toggle-bar {
  margin: 0 16px;
  display: flex; justify-content: flex-end;
}
.view-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  backdrop-filter: blur(10px);
}
.vt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px;
  color: var(--text-muted); font-weight: 600; font-size: 13px;
  transition: background var(--transition), color var(--transition);
}
.vt-btn:hover { color: var(--text); }
.vt-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; box-shadow: var(--shadow-neon-blue);
}

/* -------- Modo Lista -------- */
.games-grid.list {
  grid-template-columns: 1fr;
  gap: 10px;
}
.games-grid.list .game-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
}
.games-grid.list .game-card .thumb {
  width: 72px; height: 72px; aspect-ratio: auto;
  border-radius: 10px; overflow: hidden;
}
.games-grid.list .game-card .info { padding: 0; min-width: 0; }
.games-grid.list .game-card .info h3 {
  font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.games-grid.list .game-card .meta { gap: 12px; justify-content: flex-start; }
.games-grid.list .game-card .card-action {
  position: static; opacity: 1; transform: none;
  align-self: center;
}
.games-grid.list .game-card:hover { transform: none; }

/* -------- Mobile: força 3 por linha (grade) e ajustes -------- */
@media (max-width: 720px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .game-card .info h3 { font-size: 12px; }
  .game-card .meta { font-size: 10px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .pendrive-bar { grid-template-columns: 1fr; }
  /* No mobile: esconde o <select> e mostra os botões de capacidade */
  #pendriveSelect { display: none; }
  .pendrive-buttons { display: flex; }
  .header-inner { padding: 10px 14px; }
  .brand-title { font-size: .95rem; }

  /* Botão de ação do card sempre visível no celular */
  .game-card .card-action {
    opacity: 1;
    transform: none;
    width: 30px; height: 30px;
    top: 6px; right: 6px;
    font-size: 13px;
  }

  /* Ajustes do modo Lista no mobile */
  .games-grid.list { grid-template-columns: 1fr; }
  .games-grid.list .game-card { grid-template-columns: 60px 1fr auto; gap: 10px; }
  .games-grid.list .game-card .thumb { width: 60px; height: 60px; }
  .games-grid.list .game-card .info h3 { font-size: 14px; }
  .games-grid.list .game-card .meta { font-size: 12px; }
  .games-grid.list .game-card .card-action { width: 38px; height: 38px; }
}

/* -------- Pagination -------- */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  margin-top: 20px;
}
.pagination button {
  padding: 8px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text);
}
.pagination button.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none; box-shadow: var(--shadow-neon-blue);
}
.pagination button:disabled { opacity: .35; cursor: not-allowed; }

/* -------- Empty state -------- */
.empty-state {
  text-align: center; color: var(--text-muted); padding: 60px 20px;
}
.empty-state i { font-size: 48px; margin-bottom: 10px; color: var(--secondary); }

/* -------- Footer -------- */
.site-footer {
  margin: 20px 16px;
  padding: 18px; text-align: center; color: var(--text-muted);
}

/* -------- Modals -------- */
.modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(3,4,10,.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  animation: fadeIn .2s ease;
  padding: 16px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow: auto;
  padding: 24px;
  animation: popIn .25s cubic-bezier(.2,.9,.3,1.2);
}
/* Modais com 90% de opacidade (fundo sólido) para melhor legibilidade */
.modal-content.glass {
  background: rgba(11, 13, 26, 0.92);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.modal-content.wide { max-width: 860px; }
.modal-content.narrow { max-width: 400px; }
@keyframes popIn { from { opacity:0; transform: scale(.94);} to {opacity:1; transform:none;} }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06);
}
.modal-close:hover { background: rgba(255,255,255,.12); }

.modal h2 { font-family: var(--font-display); margin-bottom: 14px; letter-spacing: .05em; }

/* -------- Game detail -------- */
.game-detail { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.game-detail img { border-radius: 12px; width: 100%; }
.badges { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap;}
.tag {
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: rgba(0,179,255,.15); color: #7dd3fc;
  border: 1px solid rgba(0,179,255,.4);
}
.specs { list-style: none; margin: 12px 0; color: var(--text-muted); }
.specs li { padding: 3px 0; }
.specs b { color: var(--text); }
@media (max-width: 600px) { .game-detail { grid-template-columns: 1fr; } }

/* -------- Cart -------- */
.cart-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 300px; overflow: auto; }
.cart-item {
  display: grid; grid-template-columns: 44px 1fr auto auto; gap: 10px; align-items: center;
  padding: 8px; background: rgba(255,255,255,.04); border-radius: 10px; border: 1px solid var(--border);
}
.cart-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.cart-item .name { font-weight: 600; }
.cart-item .size { color: var(--text-muted); font-size: 13px; }
.cart-item .rm { color: var(--danger); padding: 6px 10px; border-radius: 8px; background: rgba(239,68,68,.1); }
.cart-summary { padding: 10px; text-align: center; color: var(--text-muted); }
.warn { color: #ffb4b4; margin-top: 6px; }

/* Aviso vermelho sobre jogos não-oficiais / patches */
.warn-official {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fecaca;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}
.warn-official .warn-official-title {
  color: #ff6b6b;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.warn-official p {
  color: #fecaca;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

/* -------- Forms -------- */
.checkout-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.checkout-form h3 { font-family: var(--font-display); font-size: 14px; color: var(--text-muted); letter-spacing: .1em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* -------- JPG modal actions -------- */
.row-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }

/* -------- Toast -------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; padding: 12px 20px; border-radius: 12px;
  box-shadow: var(--shadow-neon-blue);
  z-index: 200; opacity: 0; transition: opacity .3s, transform .3s;
  font-weight: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 0 20px rgba(239,68,68,.5); }
.toast.success { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 0 20px rgba(34,197,94,.5); }

/* =========================================================
   ADMIN
   ========================================================= */
.admin-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  gap: 12px; padding: 12px;
  background-color: var(--bg-1); /* garante fundo escuro contínuo */
}
.admin-sidebar { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.admin-sidebar .brand.small h2 { font-family: var(--font-display); font-size: 1.1rem; }
.neon-purple { color: var(--secondary); filter: drop-shadow(0 0 10px var(--secondary)); }
.admin-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.nav-item {
  padding: 10px 12px; border-radius: 10px; text-align: left;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(0,179,255,.25), rgba(138,43,226,.25));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(0,179,255,.3);
}
.admin-main { display: flex; flex-direction: column; gap: 12px; }
.admin-topbar {
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.admin-topbar h1 { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .06em; }
.user-chip {
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.05); color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 14px;
}
#mobileMenuBtn { display: none; }
.view-container { padding: 4px 4px 40px; display: flex; flex-direction: column; gap: 16px; }

/* Dashboard cards */
.stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.stat-card {
  padding: 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0,179,255,.15), rgba(138,43,226,.15));
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.stat-card .label { color: var(--text-muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.stat-card .value { font-family: var(--font-display); font-size: 1.8rem; margin-top: 4px; }
.stat-card i { color: var(--primary); }

/* Admin panels */
.panel {
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--font-display); font-size: 1rem; letter-spacing: .06em; }

.table-wrap { overflow-x: auto; }
table.admin-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.admin-table tr:hover td { background: rgba(255,255,255,.03); }
.admin-table .thumb-sm { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }

.status {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.status.pendente { background: rgba(234,179,8,.2); color: #fde047; border: 1px solid rgba(234,179,8,.4); }
.status.finalizado { background: rgba(34,197,94,.2); color: #86efac; border: 1px solid rgba(34,197,94,.4); }

.row-btns { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  transition: background var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn.danger { color: #ff9d9d; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.12), rgba(255,255,255,.04));
  background-size: 200% 100%;
  animation: shine 1.2s infinite;
  border-radius: 8px;
}
@keyframes shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.whatsapp-float img {
    width: 70%;
    height: 70%;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #128c7e;
}

/* Ajuste para celular */
@media (max-width: 480px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}

/* Admin mobile — corrige "margens brancas" e mantém fundo uniforme */
@media (max-width: 860px) {
  html, body { background-attachment: scroll; } /* iOS ignora fixed → usa scroll */
  .admin-app {
    grid-template-columns: 1fr;
    padding: 8px;
    gap: 8px;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
  }
  .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 200;
    transform: translateX(-110%); transition: transform .3s ease;
    border-radius: 0; margin: 0;
    background: rgba(11, 13, 26, 0.96); /* opaco para não vazar conteúdo */
  }
  .admin-sidebar.open { transform: translateX(0); }
  #mobileMenuBtn { display: inline-grid; }

  /* Evita "cinturas" brancas quando o conteúdo é maior que a viewport */
  .admin-main { min-height: calc(100dvh - 16px); }
  .admin-topbar { padding: 10px 14px; }
  .view-container { padding: 4px 2px 32px; }
}

/* Barra do toggle em telas pequenas */
@media (max-width: 720px) {
  .view-toggle-bar { margin: 0 16px; justify-content: center; }
  .vt-btn { padding: 8px 12px; font-size: 12px; }
}


/* =========================================================
   ATUALIZAÇÕES DE LAYOUT — v2
   • Botão de área restrita quase imperceptível
   • Botão flutuante "Finalizar lista e enviar"
   • Área administrativa em modal com abas horizontais
   • Ajustes finos de responsividade
   ========================================================= */

/* -------- Botão de acesso restrito (discreto) -------- */
.admin-access {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  opacity: .18;
  transition: opacity .3s ease;
}
.admin-access:hover, .admin-access:focus-visible { opacity: .45; }
.admin-access .admin-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  display: block;
}

/* -------- Botão flutuante: finalizar lista -------- */
.float-finish {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 10px 30px rgba(0,0,0,.45), var(--shadow-neon-blue);
  animation: floatIn .3s ease both;
  max-width: calc(100vw - 130px);
}
.float-finish:hover { transform: translateX(-50%) translateY(-2px); }
.float-finish.hidden { display: none !important; }
.float-finish .float-count {
  background: rgba(0,0,0,.28);
  padding: 2px 10px; border-radius: 999px;
  font-size: 13px;
}
@keyframes floatIn { from { opacity: 0; transform: translateX(-50%) translateY(14px); } to { opacity: 1; } }

/* Evita que o botão flutuante cubra o final do catálogo */
body.has-float-finish .site-footer { margin-bottom: 96px; }

/* Toast acima do botão flutuante */
body.has-float-finish .toast { bottom: 96px; }

/* -------- Área administrativa em modal -------- */
.admin-modal { padding: 12px; align-items: stretch; }
.admin-modal-content {
  max-width: 1180px;
  width: 100%;
  max-height: calc(100dvh - 24px);
  display: flex; flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.admin-modal-header {
  position: relative;
  padding: 14px 56px 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  flex-shrink: 0;
}
.admin-modal-title {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  margin-bottom: 10px;
}
.admin-modal-title h2 {
  font-family: var(--font-display);
  font-size: 1.05rem; letter-spacing: .06em;
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-modal-title .user-chip { margin-left: auto; flex-shrink: 0; }
.admin-modal .modal-close { top: 12px; right: 12px; }

/* Barra horizontal de menus */
.admin-tabs {
  display: flex; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 10px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.admin-tabs::-webkit-scrollbar { height: 5px; }
.admin-tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 999px; }
.admin-tabs .nav-item {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.admin-tabs .nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; border-color: transparent;
  box-shadow: 0 0 14px rgba(0,179,255,.35);
}
.admin-tabs .nav-item.danger { color: #ffb4b4; margin-left: auto; }

.admin-modal .view-container {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  gap: 14px;
}
body.modal-open { overflow: hidden; }

/* -------- Correções de layout gerais -------- */
.warn-official { margin: 14px 16px; }
.catalog-wrapper { padding-top: 14px; }
.header-inner { gap: 12px; }
.brand { min-width: 0; }
.brand-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { flex-shrink: 0; }
.cart-items { max-height: min(46vh, 380px); }
.modal-content { max-height: calc(100dvh - 32px); }
.select-neon { max-width: 100%; }
.pendrive-stats { row-gap: 6px; }
.pagination { flex-wrap: wrap; }
img { max-width: 100%; }
.admin-table td input { max-width: 100%; }

/* -------- Responsivo -------- */
@media (max-width: 860px) {
  .admin-modal { padding: 0; }
  .admin-modal-content {
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
  .admin-modal-header { padding: 12px 50px 0 12px; }
  .admin-modal .view-container { padding: 12px 12px 28px; }
  .panel { padding: 14px; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .panel-head > div, .panel-head input, .panel-head .btn { width: 100%; }
  .panel-head input { max-width: none !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 14px; }
  .stat-card .value { font-size: 1.4rem; }
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 8px; white-space: nowrap; }
}

@media (max-width: 720px) {
  .site-header { margin: 8px 10px 0; top: 8px; }
  .pendrive-bar, .filters, .warn-official, .site-footer { margin-left: 10px; margin-right: 10px; }
  .catalog-wrapper { padding-left: 10px; padding-right: 10px; }
  .view-toggle-bar { margin: 0 10px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 8px; }
  .filter-item.search { grid-column: 1 / -1; }
  .modal { padding: 10px; }
  .modal-content { padding: 18px 14px; }
  .cart-item { grid-template-columns: 40px 1fr auto; row-gap: 6px; }
  .cart-item .rm { grid-column: 3; }
  .float-finish {
    left: 12px; right: 84px;
    transform: none;
    max-width: none;
    justify-content: center;
    padding: 13px 16px;
    font-size: 14px;
  }
  .float-finish:hover { transform: translateY(-2px); }
  @keyframes floatIn { from { opacity: 0; } to { opacity: 1; } }
  .whatsapp-float { bottom: 22px; right: 16px; }
  body.has-float-finish .toast { bottom: 92px; }
  .admin-tabs .nav-item { padding: 8px 12px; font-size: 12px; }
  .admin-tabs .nav-item.danger { margin-left: 0; }
}

@media (max-width: 420px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-title { font-size: .85rem; }
  .stats { grid-template-columns: 1fr; }
  .float-finish span:not(.float-count) { font-size: 13px; }
}

/* Esconde botões flutuantes enquanto o painel administrativo está aberto */
body.modal-open .whatsapp-float,
body.modal-open .float-finish { display: none !important; }

/* =========================================================
   PAGINAÇÃO DOS MENUS ADMINISTRATIVOS
   (Jogos, Categorias, Subcategorias, Pendrives)
   ========================================================= */
.admin-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-pagination .apg-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}
.admin-pagination .apg-filter i { color: var(--primary); }

.admin-pagination .apg-per-group {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.admin-pagination .apg-per {
  min-width: 42px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  transition: var(--transition);
}
.admin-pagination .apg-per:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.admin-pagination .apg-per.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow-neon-blue);
}

.admin-pagination .apg-info { font-size: 12px; opacity: .8; }

.admin-pagination .apg-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-pagination .apg-num,
.admin-pagination .apg-arrow {
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-weight: 700;
  transition: var(--transition);
}
.admin-pagination .apg-num:hover:not(.active),
.admin-pagination .apg-arrow:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: var(--shadow-neon-blue);
}
.admin-pagination .apg-num.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-neon-purple);
}
.admin-pagination .apg-arrow:disabled { opacity: .3; cursor: not-allowed; }

@media (max-width: 640px) {
  .admin-pagination { justify-content: center; }
  .admin-pagination .apg-filter { width: 100%; justify-content: center; flex-wrap: wrap; }
  .admin-pagination .apg-pages { width: 100%; justify-content: center; }
}

/* =========================================================
   SPINNER DE AUTENTICAÇÃO (login admin)
   ========================================================= */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}
.btn.is-loading { opacity: .85; cursor: progress; }
.form-loading input { pointer-events: none; opacity: .7; }
