/* =========================================================
 * ptt-gaming-apk.css - PTT Gaming APK base styling
 * All custom classes use the v331- prefix.
 * Palette: #0D1117 (dark background) + #C9C9FF (light text)
 * Mobile-first; root font 62.5% (1rem = 10px).
 * =======================================================*/

:root {
  --v331-bg: #0D1117;
  --v331-bg-soft: #141a24;
  --v331-bg-card: #18202e;
  --v331-bg-elev: #1f2937;
  --v331-text: #C9C9FF;
  --v331-text-soft: #a7a7d8;
  --v331-text-muted: #7a8094;
  --v331-accent: #C9C9FF;
  --v331-accent2: #6f7bff;
  --v331-gold: #f4c95d;
  --v331-border: #2a3344;
  --v331-success: #4ade80;
  --v331-danger: #ef6b6b;
  --v331-radius: 14px;
  --v331-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--v331-bg);
  color: var(--v331-text);
  font-family: "Segoe UI", "Helvetica Neue", Roboto, Arial, system-ui, sans-serif;
  font-size: 62.5%;
  line-height: 1.5;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

a { color: var(--v331-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.v331-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.4rem;
}

/* ---------- Header ---------- */
.v331-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #0f1622 0%, #0D1117 100%);
  border-bottom: 1px solid var(--v331-border);
}
.v331-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}
.v331-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--v331-accent);
  letter-spacing: 0.3px;
}
.v331-logo img { width: 32px; height: 32px; border-radius: 8px; }
.v331-logo span { color: var(--v331-text); font-weight: 700; }
.v331-logo small { display: block; font-size: 0.95rem; color: var(--v331-text-muted); font-weight: 500; }

.v331-header-actions { display: flex; align-items: center; gap: 0.6rem; }
.v331-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.3rem;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 38px;
}
.v331-btn:active { transform: scale(0.96); }
.v331-btn-login {
  background: transparent;
  color: var(--v331-text);
  border: 1px solid var(--v331-border);
}
.v331-btn-register {
  background: linear-gradient(135deg, var(--v331-accent2), var(--v331-accent));
  color: #0D1117;
  box-shadow: 0 4px 14px rgba(111, 123, 255, 0.4);
}
.v331-burger {
  background: transparent;
  border: 1px solid var(--v331-border);
  border-radius: 8px;
  color: var(--v331-text);
  width: 38px;
  height: 38px;
  font-size: 1.6rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Mobile menu / drawer ---------- */
#v331-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9998;
}
#v331-menu-backdrop.v331-show { opacity: 1; pointer-events: auto; }

#v331-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 82%;
  max-width: 320px;
  height: 100vh;
  background: var(--v331-bg-soft);
  border-left: 1px solid var(--v331-border);
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 9999;
  padding: 1.6rem 1.4rem;
  overflow-y: auto;
}
#v331-mobile-menu.v331-open { transform: translateX(0); }
.v331-menu-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.4rem;
}
.v331-menu-head h3 { margin: 0; font-size: 1.6rem; color: var(--v331-accent); }
.v331-menu-close {
  background: transparent; border: 0; color: var(--v331-text);
  font-size: 2rem; cursor: pointer;
}
.v331-menu-section { margin-bottom: 1.6rem; }
.v331-menu-section h4 {
  font-size: 1.2rem; color: var(--v331-text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin: 0 0 0.8rem;
}
.v331-menu-section a {
  display: block;
  padding: 0.8rem 0.6rem;
  color: var(--v331-text);
  font-size: 1.35rem;
  border-bottom: 1px solid var(--v331-border);
}
.v331-menu-section a:hover { color: var(--v331-accent); text-decoration: none; }
.v331-menu-cta {
  display: block;
  text-align: center;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--v331-accent2), var(--v331-accent));
  color: #0D1117; font-weight: 800;
  padding: 1rem; border-radius: 10px;
}

/* ---------- Hero / Carousel ---------- */
.v331-hero {
  position: relative;
  margin: 1.2rem 0;
  border-radius: var(--v331-radius);
  overflow: hidden;
  box-shadow: var(--v331-shadow);
}
.v331-carousel { position: relative; }
.v331-slides { position: relative; }
.v331-slide {
  display: none;
  position: relative;
  min-height: 220px;
  background: linear-gradient(135deg, #1a2336, #0f1622);
}
.v331-slide.v331-active { display: block; animation: v331Fade 0.6s ease; }
@keyframes v331Fade { from { opacity: 0.4; } to { opacity: 1; } }
.v331-slide-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.55;
}
.v331-slide-content {
  position: relative;
  padding: 1.8rem 1.6rem;
  z-index: 2;
}
.v331-slide-tag {
  display: inline-block;
  background: rgba(201, 201, 255, 0.18);
  color: var(--v331-accent);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}
.v331-slide-content h2 {
  margin: 0 0 0.5rem;
  font-size: 2.2rem;
  color: #fff;
  line-height: 1.2;
}
.v331-slide-content p {
  margin: 0 0 1rem;
  color: var(--v331-text-soft);
  font-size: 1.3rem;
}
.v331-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(13, 17, 23, 0.6);
  border: 1px solid var(--v331-border);
  color: var(--v331-text);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
  font-size: 1.4rem;
}
.v331-carousel-arrow.v331-prev { left: 8px; }
.v331-carousel-arrow.v331-next { right: 8px; }
#v331-carousel-dots {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
  z-index: 3;
}
.v331-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(201, 201, 255, 0.35);
  border: 0; padding: 0; cursor: pointer;
}
.v331-dot.v331-active { background: var(--v331-accent); width: 22px; border-radius: 5px; }

/* ---------- Section / titles ---------- */
.v331-section { padding: 1.8rem 0; }
.v331-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.2rem;
}
.v331-section-head h2 {
  margin: 0; font-size: 1.8rem; color: #fff;
  font-weight: 700;
}
.v331-section-head h2 .v331-bar {
  display: inline-block; width: 4px; height: 1.4rem;
  background: var(--v331-accent); margin-right: 0.6rem;
  vertical-align: middle; border-radius: 3px;
}
.v331-section-head a { font-size: 1.2rem; color: var(--v331-accent); }

/* ---------- Quick action tiles ---------- */
.v331-quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.v331-quick {
  background: var(--v331-bg-card);
  border: 1px solid var(--v331-border);
  border-radius: 12px;
  padding: 1rem 0.4rem;
  text-align: center;
  color: var(--v331-text);
  font-size: 1.1rem;
  cursor: pointer;
}
.v331-quick i, .v331-quick .material-icons-outlined {
  font-size: 2rem; color: var(--v331-accent); display: block; margin-bottom: 0.4rem;
}

/* ---------- Filter tabs ---------- */
.v331-filter-bar {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.4rem 0 1rem;
  scrollbar-width: none;
}
.v331-filter-bar::-webkit-scrollbar { display: none; }
.v331-filter-tab {
  flex: 0 0 auto;
  background: var(--v331-bg-card);
  border: 1px solid var(--v331-border);
  color: var(--v331-text-soft);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-size: 1.2rem;
  cursor: pointer;
  white-space: nowrap;
  text-transform: capitalize;
}
.v331-filter-tab.v331-active {
  background: linear-gradient(135deg, var(--v331-accent2), var(--v331-accent));
  color: #0D1117;
  border-color: transparent;
  font-weight: 700;
}

/* ---------- Game grid / cards ---------- */
.v331-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.v331-game-card {
  background: var(--v331-bg-card);
  border: 1px solid var(--v331-border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.v331-game-card:active { transform: scale(0.97); }
.v331-game-card img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  background: #0f1622;
}
.v331-game-card .v331-game-name {
  padding: 0.5rem 0.6rem;
  font-size: 1.1rem;
  color: var(--v331-text);
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v331-game-card .v331-play-overlay {
  position: absolute; inset: 0;
  background: rgba(13, 17, 23, 0.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.18s ease;
}
.v331-game-card:hover .v331-play-overlay { opacity: 1; }
.v331-play-overlay span {
  background: var(--v331-accent); color: #0D1117;
  padding: 0.5rem 1rem; border-radius: 20px;
  font-size: 1.1rem; font-weight: 700;
}
.v331-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--v331-danger);
  color: #fff; font-size: 0.95rem;
  padding: 0.15rem 0.5rem; border-radius: 6px; font-weight: 700;
}
.v331-badge.v331-hot { background: linear-gradient(135deg, #ef4444, #f4c95d); }
.v331-badge.v331-new { background: var(--v331-success); color: #0D1117; }

/* ---------- Feature / promo strip ---------- */
.v331-feature {
  background: linear-gradient(135deg, #1a2336, #11192a);
  border: 1px solid var(--v331-border);
  border-radius: var(--v331-radius);
  padding: 1.4rem;
  margin: 1rem 0;
  display: flex; gap: 1rem; align-items: center;
}
.v331-feature .v331-feature-icon {
  font-size: 2.4rem; color: var(--v331-gold);
}
.v331-feature h3 { margin: 0 0 0.3rem; font-size: 1.5rem; color: #fff; }
.v331-feature p { margin: 0; font-size: 1.2rem; color: var(--v331-text-soft); }

/* ---------- Article / SEO text ---------- */
.v331-article {
  background: var(--v331-bg-soft);
  border: 1px solid var(--v331-border);
  border-radius: var(--v331-radius);
  padding: 1.6rem;
  margin: 1rem 0;
}
.v331-article h2 { font-size: 1.7rem; color: #fff; margin: 0 0 0.8rem; }
.v331-article h3 { font-size: 1.4rem; color: var(--v331-accent); margin: 1.2rem 0 0.6rem; }
.v331-article p { font-size: 1.3rem; color: var(--v331-text-soft); margin: 0 0 1rem; line-height: 1.6; }
.v331-article ul { padding-left: 1.6rem; color: var(--v331-text-soft); font-size: 1.3rem; }
.v331-article ul li { margin-bottom: 0.5rem; line-height: 1.6; }
.v331-article a { color: var(--v331-accent); font-weight: 600; }

/* ---------- FAQ ---------- */
.v331-faq-item {
  background: var(--v331-bg-card);
  border: 1px solid var(--v331-border);
  border-radius: 10px;
  margin-bottom: 0.7rem;
  overflow: hidden;
}
.v331-faq-q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--v331-text);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.6rem;
}
.v331-faq-q .v331-faq-icon { transition: transform 0.2s ease; color: var(--v331-accent); }
.v331-faq-item.v331-open .v331-faq-icon { transform: rotate(45deg); }
.v331-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 1.2rem;
  color: var(--v331-text-soft);
  font-size: 1.25rem;
  line-height: 1.6;
}
.v331-faq-item.v331-open .v331-faq-a {
  max-height: 500px;
  padding: 0 1.2rem 1.2rem;
}

/* ---------- Footer ---------- */
.v331-footer {
  background: #0a0e16;
  border-top: 1px solid var(--v331-border);
  padding: 2rem 0 6rem;
  margin-top: 2rem;
}
.v331-footer h4 {
  font-size: 1.3rem; color: var(--v331-accent);
  margin: 1.4rem 0 0.6rem; text-transform: uppercase; letter-spacing: 1px;
}
.v331-footer p { font-size: 1.2rem; color: var(--v331-text-muted); line-height: 1.5; margin: 0 0 0.5rem; }
.v331-footer-links {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem;
}
.v331-footer-links a {
  color: var(--v331-text-soft); font-size: 1.2rem; padding: 0.3rem 0;
}
.v331-footer-bottom {
  text-align: center; padding-top: 1.6rem;
  border-top: 1px solid var(--v331-border);
  margin-top: 1.6rem;
  color: var(--v331-text-muted);
  font-size: 1.1rem;
}
.v331-pay-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem;
}
.v331-pay-chip {
  background: var(--v331-bg-card);
  border: 1px solid var(--v331-border);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 1.05rem;
  color: var(--v331-text-soft);
}

/* ---------- Mobile bottom nav ---------- */
.v331-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  background: linear-gradient(180deg, #11192a, #0a0e16);
  border-top: 1px solid var(--v331-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.v331-bottom-nav-btn {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--v331-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1rem;
  cursor: pointer;
  min-width: 60px;
  min-height: 60px;
  padding: 6px 2px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.v331-bottom-nav-btn i,
.v331-bottom-nav-btn .material-icons-outlined,
.v331-bottom-nav-btn .bi {
  font-size: 22px;
}
.v331-bottom-nav-btn:hover { color: var(--v331-accent); }
.v331-bottom-nav-btn.v331-current { color: var(--v331-accent); transform: translateY(-2px); }
.v331-bottom-nav-btn.v331-promo {
  color: var(--v331-gold);
}
.v331-bottom-nav-btn.v331-promo i { text-shadow: 0 0 10px rgba(244, 201, 93, 0.5); }

/* Back to top */
#v331-back-top {
  position: fixed;
  right: 14px;
  bottom: 76px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--v331-accent);
  color: #0D1117;
  border: 0;
  font-size: 1.6rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}
#v331-back-top.v331-show { opacity: 1; pointer-events: auto; }
#v331-back-top:active { transform: scale(0.9); }

/* ---------- Desktop / wider screens ---------- */
@media (min-width: 769px) {
  .v331-container { max-width: 960px; }
  .v331-game-grid { grid-template-columns: repeat(6, 1fr); }
  .v331-quick-row { grid-template-columns: repeat(8, 1fr); }
  .v331-footer-links { grid-template-columns: repeat(4, 1fr); }
  .v331-bottom-nav { display: none; }
  .v331-footer { padding-bottom: 2rem; }
  #v331-back-top { bottom: 24px; }
}
@media (max-width: 768px) {
  main { padding-bottom: 80px; }
  .v331-slide-content h2 { font-size: 1.9rem; }
}

/* Utility */
.v331-hidden { display: none !important; }
.v331-text-center { text-align: center; }
.v331-mt-1 { margin-top: 0.6rem; }
.v331-mt-2 { margin-top: 1.2rem; }
.v331-promo-link {
  color: var(--v331-gold);
  font-weight: 700;
  text-decoration: underline;
}
.v331-promo-link:hover { color: var(--v331-accent); }
