/* ============================================================
   Luck Store — Design System
   ============================================================ */

:root {
  --brand: #9A0000;
  --brand-hover: #7a0000;
  --brand-soft: rgba(154, 0, 0, 0.35);
  --bg-base: #0D0D0D;
  --bg-surface: #161616;
  --bg-elevated: #1d1d1d;
  --border-subtle: #2a2a2a;
  --text-primary: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #6b6b6b;
  --radius-card: 12px;
  --radius-button: 8px;
  --shadow-card-hover: 0 0 20px var(--brand-soft);
  --font-stack: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max-content: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ============================================================
   Background — Paths animados + trevo
   ============================================================ */

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-paths {
  width: 100%;
  height: 100%;
  color: var(--brand);
}

.bg-paths svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.bg-paths path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  /* Com pathLength="1" no SVG, esses valores são fração do path:
     dash de 60% do path + gap de 100% do path. */
  stroke-dasharray: 0.6 1;
  stroke-dashoffset: 1;
  animation: pathSweep var(--dur, 25s) linear var(--delay, 0s) infinite,
             pathFade var(--dur, 25s) ease-in-out var(--delay, 0s) infinite;
  will-change: stroke-dashoffset, opacity;
}

@keyframes pathSweep {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: -2; }
}

@keyframes pathFade {
  0%, 100% { opacity: var(--op-min, 0.25); }
  50%      { opacity: var(--op-max, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-paths path { animation: none !important; stroke-dashoffset: 0; opacity: 0.3; }
}

/* ============================================================
   Layout chrome — header, footer
   ============================================================ */

.site-header,
.site-footer,
main {
  position: relative;
  z-index: 2;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(13, 13, 13, 0.7);
  backdrop-filter: blur(8px);
}

.logo {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  padding-bottom: 2px;
  border-bottom: 2px solid var(--brand);
  display: inline-flex;
  align-items: baseline;
}

.logo-l, .logo-s { font-size: 1.55rem; }
.logo-mid { font-weight: 600; }

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
}

.site-footer {
  margin-top: auto;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--brand);
  color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 0 16px var(--brand-soft);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-cta {
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ============================================================
   Hero (index.html)
   ============================================================ */

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  min-height: 80vh;
}

.hero-content {
  text-align: center;
  max-width: 760px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  margin: 0 0 2rem;
  line-height: 1.5;
}

.trust-badges {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.trust-badges li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.trust-badges svg { color: var(--brand); }

/* ============================================================
   Page header (contas.html, listing.html)
   ============================================================ */

.page-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 4vw, 2rem);
}

.page-title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--text-secondary);
  margin: 0 0 2rem;
  font-size: 1rem;
}

/* ============================================================
   Games grid (contas.html)
   ============================================================ */

.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow-card-hover);
}

.game-card-image {
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated) center/cover no-repeat;
  position: relative;
}

.game-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.game-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.game-card-count {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(154, 0, 0, 0.15);
  color: var(--brand);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--brand-soft);
}

.game-card-count[data-loading="true"] {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

/* ============================================================
   Listing layout (listing.html)
   ============================================================ */

.listing-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .listing-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 1024px) {
  .filter-toggle { display: none; }
}

.filters {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 1023px) {
  .filters {
    position: fixed;
    inset: 0;
    z-index: 50;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .filters.is-open { transform: translateX(0); }
}

.filters h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.filter-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  align-self: flex-end;
  display: none;
}

@media (max-width: 1023px) {
  .filter-close { display: block; }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-group label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--brand);
}

.filter-range {
  display: flex;
  gap: 0.5rem;
}

.filter-range input { flex: 1; min-width: 0; }

.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.filter-actions .btn { flex: 1; }

/* ============================================================
   Account cards
   ============================================================ */

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) { .account-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .account-grid { grid-template-columns: repeat(3, 1fr); } }

.account-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.account-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow-card-hover);
}

.account-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.account-id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.account-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.account-price small {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: 0.25rem;
}

.account-rank {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.account-rank-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.account-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.account-stats strong {
  color: var(--text-primary);
  font-weight: 600;
  display: block;
}

.account-stats div { display: flex; flex-direction: column; }

.account-card .btn {
  margin-top: auto;
}

/* ============================================================
   Skeleton loading
   ============================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 0%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 220px;
}

.skeleton-line { height: 14px; }
.skeleton-line.lg { height: 28px; width: 60%; }
.skeleton-line.md { width: 80%; }
.skeleton-line.sm { width: 40%; }

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 2.5rem 0 1rem;
}

.pagination button {
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.pagination button:hover:not(:disabled):not(.active) {
  border-color: var(--brand);
  color: var(--text-primary);
}

.pagination button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .ellipsis {
  color: var(--text-muted);
  padding: 0 0.25rem;
}

/* ============================================================
   Empty / error states
   ============================================================ */

.state-message {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.state-message h3 {
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.state-message p { margin: 0; font-size: 0.95rem; }
