/* =========================================================
   xuanfeng 玄封電競俱樂部 - Main Stylesheet
   ========================================================= */

/* ── DemoBlack Web Font ──────────────────────────────────── */
@font-face {
  font-family: 'DemoBlack';
  src: url('../fonts/demoblack.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DemoBlack', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  background: #F5F5F5;
  color: #1A1A1A;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 64px; /* space for bottom nav */
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --banner-h:       120px;
  --game-tab-h:     88px;
  --bottom-nav-h:   64px;

  --color-red:      #E53935;
  --color-red-dark: #B71C1C;
  --color-gold:     #FFD600;

  --card-bg-from:   #0a1628;
  --card-bg-to:     #0d2150;
  --card-glow:      rgba(0, 120, 255, 0.5);

  --section-title:  #1A1A1A;
  --tab-active-bg:  #FFFFFF;
  --tab-inactive:   #E0E0E0;

  --radius-card:    12px;
  --radius-btn:     10px;
  --shadow-card:    0 4px 16px rgba(0,0,0,0.18);
  --transition:     0.2s ease;
}

/* =========================================================
   BANNER
   ========================================================= */
.site-banner {
  width: 100%;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(0,80,200,0.35) 0%, transparent 70%),
    linear-gradient(135deg, #050d1f 0%, #0a1f4a 40%, #061230 70%, #000814 100%);
  position: relative;
  overflow: hidden;
  min-height: var(--banner-h);
  display: flex;
  align-items: center;
}

/* Sparkling stars effect */
.site-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 55%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 70%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 35%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(2px 2px at 25% 80%, rgba(100,180,255,0.8) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 10%, rgba(255,220,100,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 90%, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
}

/* Lightning bolt accent */
.site-banner::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 8%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(0,200,255,0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.banner-logo {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0,100,255,0.4);
}

.banner-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.banner-title {
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.15em;
  text-shadow:
    0 0 10px rgba(100,180,255,0.6),
    0 0 30px rgba(0,100,255,0.4),
    3px 3px 6px rgba(0,0,0,0.8),
    -1px -1px 0 rgba(100,180,255,0.3);
  line-height: 1.2;
}

/* =========================================================
   GAME TABS
   ========================================================= */
.game-tabs {
  background: #FFFFFF;
  border-bottom: 2px solid #E0E0E0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.game-tabs-inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

.game-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  color: #999;
  font-size: 1rem;
  font-weight: 700;
}

.game-tab.active {
  border-bottom-color: var(--color-red);
  color: #1A1A1A;
}

.game-tab:hover:not(.active) {
  color: #555;
  background: rgba(0,0,0,0.03);
}

.game-tab-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.game-tab-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* PUBGM icon: dark helmet aesthetic */
.pubgm-icon {
  background: linear-gradient(135deg, #1a2a3a 0%, #2c3e50 100%);
  border: 2px solid rgba(100,150,200,0.4);
}

.pubgm-icon span {
  font-size: 0.45rem;
  font-weight: 900;
  color: #AECDE8;
  text-align: center;
  line-height: 1.2;
}

/* Delta Force icon */
.delta-icon {
  background: linear-gradient(135deg, #0a1a0a 0%, #1a2e1a 100%);
  border: 2px solid rgba(0,200,100,0.4);
  padding: 6px;
}

.delta-icon svg {
  width: 100%;
  height: 100%;
}

.game-tab-name {
  font-size: 1rem;
  font-weight: 700;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 12px;
}

.hidden { display: none !important; }

/* ── Loading / Empty hint ────────────────────────────────── */
.loading-hint,
.empty-hint {
  text-align: center;
  padding: 40px 16px;
  color: #888;
  font-size: 0.95rem;
}

/* ── Section ──────────────────────────────────────────────── */
.product-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--section-title);
  margin-bottom: 12px;
  padding-left: 4px;
  letter-spacing: 0.02em;
}

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.product-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Product Card ─────────────────────────────────────────── */
.product-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  background: #111;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-card);
}

/* ── Back Button (shared) ────────────────────────────────── */
.btn-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
}
.btn-back:hover { background: rgba(255,255,255,0.12); }
.btn-back svg   { width: 22px; height: 22px; }

/* ── Order Button ─────────────────────────────────────────── */
.btn-order {
  width: 100%;
  padding: 0;
  background: none;
  border-radius: var(--radius-btn);
  overflow: hidden;
  display: block;
  box-shadow: 0 4px 12px rgba(229,57,53,0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-order-img {
  width: 100%;
  display: block;
  border-radius: var(--radius-btn);
}

.btn-order:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(229,57,53,0.5);
}

.btn-order:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(229,57,53,0.35);
}

/* =========================================================
   BOTTOM NAVIGATION
   ========================================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: #1A1A1A;
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.4);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #888;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: color var(--transition), background var(--transition);
}

.bottom-nav-item.active {
  color: #FFFFFF;
}

.bottom-nav-item:hover:not(.active) {
  color: #CCC;
  background: rgba(255,255,255,0.05);
}

.nav-icon {
  width: 24px;
  height: 24px;
}

/* =========================================================
   RESPONSIVE – Desktop & Tablet
   ========================================================= */
@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .btn-order {
    font-size: 1rem;
    padding: 12px 8px;
  }
}

@media (min-width: 900px) {
  .site-banner {
    min-height: 160px;
  }

  .banner-logo {
    width: 96px;
    height: 96px;
  }

  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  /* On desktop, bottom nav shifts to a side layout or stays at bottom */
  body {
    padding-bottom: 70px;
  }
}

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* =========================================================
   SCROLLBAR
   ========================================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #888; }
