/* Modern games grid and card styles */
/* Live Border energy variable */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotate-neon {
  to { --angle: 360deg; }
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px; /* Reduced gap for mobile */
}
@media (min-width: 640px) {
  .games-grid {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 10px;
  }
}

/* Mobile-only container padding for Our Games grid */
.card .games-grid { padding: 0 8px; }
.listing-card .games-grid { padding: 0; }
@media (min-width: 640px) { .card .games-grid { padding: 0; } }

/* Ensure the link behaves as a proper card container */
.game-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  min-width: 0; /* Critical: allows grid item to shrink below content size (fixes wrapping text blowing out width) */
}

.game-card {
  position: relative;
  isolation: isolate;
  height: 100%;
  width: 100%; /* Ensure it fills the grid item */
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255, 213, 79, 0.10) 0%, rgba(255, 213, 79, 0.00) 60%),
    radial-gradient(120% 90% at 100% 30%, rgba(34, 211, 238, 0.08) 0%, rgba(34, 211, 238, 0.00) 55%),
    url("/static/images/card-bg.svg"),
    var(--bg-1);
  background-size: cover, cover, cover, auto;
  background-position: center, center, center, center;
  background-origin: padding-box;
  background-clip: padding-box;
  border: 1px solid var(--border-0);
  border-radius: var(--radius-12);
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0,0,0,0.20);
  transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 250ms ease;
  z-index: 1;
}

.see-more-card {
  border-color: rgba(255, 213, 79, 0.38);
  box-shadow: 0 12px 24px rgba(0,0,0,0.20), 0 0 18px rgba(255, 213, 79, 0.10);
}

.see-more-card .see-more-media {
  width: 100%;
  aspect-ratio: 9/10;
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(255, 213, 79, 0.22);
  background:
    radial-gradient(140% 120% at 30% 20%, rgba(34, 211, 238, 0.10) 0%, rgba(34, 211, 238, 0) 55%),
    radial-gradient(160% 120% at 70% 90%, rgba(255, 213, 79, 0.16) 0%, rgba(255, 213, 79, 0) 60%),
    rgba(10, 19, 41, 0.55);
}

.see-more-card .see-more-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 2px solid rgba(255, 213, 79, 0.55);
  display: grid;
  place-items: center;
  font-family: var(--font-gaming);
  font-size: 28px;
  font-weight: 900;
  color: var(--banana-1);
  background: rgba(10, 19, 41, 0.92);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(34, 211, 238, 0.12);
  text-shadow: 0 0 16px rgba(255, 213, 79, 0.40);
}
.game-card::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--angle),
    var(--banana-1),
    #ffb300,
    #ff8a00,
    #ff6d00,
    #ff8a00,
    #ffb300,
    var(--banana-1)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  /* Always-on active glow as requested */
  animation: rotate-neon 6s linear infinite;
  opacity: 1;
  pointer-events: none;
  z-index: 3;
  /* Stronger glow by default */
  filter: drop-shadow(0 0 10px rgba(255, 179, 0, 0.45)) drop-shadow(0 0 18px rgba(255, 109, 0, 0.25));
}

/* New, stronger hover effect */
.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 0 26px rgba(255, 138, 0, 0.18), 0 0 14px rgba(255, 213, 79, 0.18);
  z-index: 10;
  border-color: rgba(255,255,255,0.1);
}

.game-card:hover::before {
  animation-duration: 3s; /* Speed up significantly */
  filter: drop-shadow(0 0 12px rgba(255, 179, 0, 0.55)) drop-shadow(0 0 26px rgba(255, 109, 0, 0.32));
}

.game-card .media { position: relative; overflow: visible; z-index: 1; }
.game-card .media .primary { width: 100%; aspect-ratio: 9/10; object-fit: cover; object-position: center 20%; display: block; }
.game-card .media .primary[src$="Honor%20of%20king.webp"], .game-card .media .primary[src$="Honor of king.webp"] { object-position: center; }
.game-card .media .secondary {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -16.8px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid var(--banana-1);
  background: rgba(10, 19, 41, 0.92);
  padding: 0;
  display: block;
  object-fit: cover;
  z-index: 2;
  box-shadow: 0 6px 14px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.35) inset;
}

.game-card .content { padding: 28px 10px 10px; position: relative; text-align: center; z-index: 1; /* Center content */ }
.game-card .content .title { 
  font-family: var(--font-gaming);
  font-size: clamp(9px, 3vw, 14px); /* Smaller min font size and multiplier for mobile */
  font-weight: 700; 
  letter-spacing: 0.3px; 
  margin: 0; 
  margin-bottom: 3px;
  white-space: nowrap; /* Prevent wrapping */
  overflow: hidden;    /* Handle overflow if it still happens */
  text-overflow: ellipsis; 
}

/* Status Wrapper - Minimal, square-ish styling */
.status-wrapper {
  margin-top: 4px;
  display: flex;
  justify-content: center; /* Center status box */
}

.instant-status {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: rgba(20, 20, 0, 0.6);
  border: 1px solid var(--banana-1); /* Banana Yellow */
  color: var(--banana-1);
  font-family: var(--font-gaming);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 6px rgba(255, 213, 79, 0.25); /* Yellow glow */
}

.game-card .content .btn { height: 36px; }

@media (max-width: 480px) {
  .game-card { border-radius: var(--radius-8); }
  .game-card .media .secondary { width: 44px; height: 44px; bottom: -13.2px; }
  .game-card .content { padding: 22px 4px 8px; } /* Reduced padding for mobile */
  /* .game-card .content .title rule is now handled by main rule with clamp, but we can fine tune if needed */
  /* .game-card .content .meta { font-size: 11px; margin: 4px 0 8px; } removed as it might not be present */
  .game-card .content .btn { height: 32px; font-size: 13px; }
}

@media (max-width: 767px) {
  .game-card { box-shadow: 0 8px 18px rgba(0,0,0,0.18); }
  .game-card::before { animation: none; filter: drop-shadow(0 0 8px rgba(255, 179, 0, 0.28)); }
}
@media (min-width: 1024px) {
  .game-card .media .secondary { width: 56px; height: 56px; bottom: -16.8px; padding: 0; }
  .game-card .content { padding-top: 28px; }
}

.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-items: stretch; }
@media (min-width: 640px) { .products-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.product-card { background: var(--bg-1); border: 1px solid var(--border-0); border-radius: var(--radius-12); overflow: hidden; box-shadow: 0 12px 24px rgba(0,0,0,0.20); width: 100%; min-width: 0; }
.product-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 12px; gap: 8px; }
.product-header .title {
  font-weight: 800;
  font-size: 14px;
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}
.stock-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--border-0); color: var(--text-1); background: #0a1329; font-size: 12px; }
.stock-in { color: var(--neon-1); border-color: var(--neon-1); }
.stock-out { color: #f87171; border-color: #f87171; }
@media (max-width: 767px) {
  .product-header { flex-wrap: wrap; gap: 6px; }
  .product-header .title { max-width: 100%; }
}
.product-prices { display: flex; gap: 8px; padding: 0 12px 12px; }
.price-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-0); font-size: 12px; }
.price-badge.usd { color: var(--text-0); }
.price-badge.mmk { color: var(--banana-1); border-color: var(--banana-1); }
.product-actions { display: flex; gap: 8px; align-items: center; padding: 12px; }
.product-actions .qty-input { width: 60px; height: 36px; border-radius: var(--radius-8); border: 1px solid var(--border-0); background: #0a1329; color: var(--text-0); padding: 0 10px; text-align: center; }
.qty-control { display: inline-flex; align-items: center; gap: 6px; }
.qty-btn { height: 36px; width: 36px; border: 1px solid var(--border-0); background: #0a1329; color: var(--text-0); border-radius: var(--radius-8); cursor: pointer; }
.qty-btn:active { transform: translateY(1px); }
@media (max-width: 480px) { .product-actions .qty-input { width: 48px; } .qty-btn { width: 32px; height: 32px; } }
.qty-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.qty-control[data-in-stock="0"] .qty-input { opacity: 0.5; pointer-events: none; }

body[data-page="games"] .listing-card,
body[data-page="voucher"] .listing-card {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  animation: none;
}
