/* =========================================================
   Sunwin20 base layout stylesheet
   Class prefix: pg8b-
   Palette: #8B7355 | #141414 | #FFCCCB | #D2B48C | #FF6347
   Mobile-first, max-width 430px container
   ========================================================= */

:root {
  --pg8b-brown: #8B7355;
  --pg8b-dark: #141414;
  --pg8b-pink: #FFCCCB;
  --pg8b-tan: #D2B48C;
  --pg8b-tomato: #FF6347;
  --pg8b-bg: #1a1410;
  --pg8b-surface: #221a14;
  --pg8b-text: #f5ede2;
  --pg8b-muted: #b6a795;
  --pg8b-gold: #e9c87a;
  --pg8b-radius: 14px;
  --pg8b-shadow: 0 6px 24px rgba(0,0,0,.35);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Be Vietnam Pro", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(139,115,85,.20), transparent 60%),
    linear-gradient(180deg, #1a1410 0%, #100b08 100%);
  color: var(--pg8b-text);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--pg8b-tan); text-decoration: none; }
a:hover { color: var(--pg8b-tomato); }

.pg8b-wrap {
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
}

/* ============== Header ============== */
.pg8b-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(20,16,12,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(210,180,140,.18);
  transition: box-shadow .25s ease;
}
.pg8b-header-scrolled { box-shadow: var(--pg8b-shadow); }
.pg8b-header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.pg8b-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  letter-spacing: .5px;
}
.pg8b-logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pg8b-tomato), var(--pg8b-gold));
  display: grid; place-items: center;
  color: #141414; font-weight: 900;
}
.pg8b-logo span { color: var(--pg8b-tomato); }

.pg8b-header-spacer { flex: 1; }

.pg8b-menu-toggle {
  background: transparent;
  border: 1px solid rgba(210,180,140,.3);
  color: var(--pg8b-tan);
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
}
.pg8b-header-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pg8b-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
  color: #fff;
}
.pg8b-btn:hover { transform: translateY(-1px); }
.pg8b-register-btn {
  background: linear-gradient(135deg, var(--pg8b-tomato), #ff8a5b);
  box-shadow: 0 4px 14px rgba(255,99,71,.4);
}
.pg8b-login-btn {
  background: transparent;
  border: 1.5px solid var(--pg8b-tan);
  color: var(--pg8b-tan);
}

/* ============== Desktop nav (hidden on mobile) ============== */
.pg8b-desktop-nav {
  display: none;
  background: rgba(20,16,12,.9);
  border-bottom: 1px solid rgba(210,180,140,.15);
}
.pg8b-desktop-nav ul {
  max-width: 1100px;
  margin: 0 auto;
  list-style: none;
  display: flex;
  gap: 22px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.pg8b-desktop-nav a {
  color: var(--pg8b-text);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 2px;
}
.pg8b-desktop-nav a:hover { color: var(--pg8b-tomato); }

/* ============== Hero slider ============== */
.pg8b-hero {
  padding: 14px;
}
.pg8b-hero-slider {
  position: relative;
  border-radius: var(--pg8b-radius);
  overflow: hidden;
  background: #0c0907;
  box-shadow: var(--pg8b-shadow);
}
.pg8b-hero-slide {
  display: none;
  position: relative;
  min-height: 200px;
}
.pg8b-hero-slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: brightness(.65);
}
.pg8b-hero-active { display: block; }
.pg8b-hero-caption {
  position: absolute;
  left: 16px; right: 16px; bottom: 18px;
  color: #fff;
}
.pg8b-hero-caption h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
}
.pg8b-hero-caption p {
  font-size: 13px;
  color: var(--pg8b-pink);
  margin-bottom: 10px;
}
.pg8b-hero-cta {
  background: linear-gradient(135deg, var(--pg8b-tomato), #ff8a5b);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pg8b-hero-dots {
  position: absolute;
  bottom: 8px; right: 12px;
  display: flex; gap: 5px;
}
.pg8b-hero-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  cursor: pointer;
}
.pg8b-hero-dot-active { background: var(--pg8b-tomato); }

/* ============== Promo banner strip ============== */
.pg8b-strip {
  margin: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139,115,85,.3), rgba(255,99,71,.18));
  border: 1px solid rgba(210,180,140,.3);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.pg8b-strip i { color: var(--pg8b-gold); font-size: 18px; }
.pg8b-strip strong { color: var(--pg8b-tomato); }

/* ============== Section ============== */
.pg8b-section {
  padding: 14px;
  margin-top: 4px;
}
.pg8b-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.pg8b-section-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  position: relative;
  padding-left: 12px;
}
.pg8b-section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pg8b-tomato), var(--pg8b-gold));
}
.pg8b-section-more {
  margin-left: auto;
  font-size: 12px;
  color: var(--pg8b-tan);
}

/* ============== Tabs ============== */
.pg8b-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.pg8b-tabs::-webkit-scrollbar { display: none; }
.pg8b-tab {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(210,180,140,.2);
  color: var(--pg8b-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pg8b-tab-active {
  background: linear-gradient(135deg, var(--pg8b-tomato), var(--pg8b-brown));
  color: #fff;
  border-color: transparent;
}

/* ============== Game grid ============== */
.pg8b-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pg8b-card {
  background: var(--pg8b-surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(210,180,140,.12);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}
.pg8b-card:hover { transform: translateY(-3px); box-shadow: var(--pg8b-shadow); }
.pg8b-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #0c0907;
}
.pg8b-card-body {
  padding: 8px 8px 10px;
  text-align: center;
}
.pg8b-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--pg8b-text);
  line-height: 1.3;
  margin-bottom: 6px;
  height: 32px;
  overflow: hidden;
}
.pg8b-card-tag {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(255,99,71,.9);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.pg8b-play-btn {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, var(--pg8b-tomato), #ff8a5b);
  color: #fff;
  padding: 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Panel switching */
.pg8b-tab-panel { display: none; }
.pg8b-panel-show { display: block; }

/* ============== Feature grid (2 cols) ============== */
.pg8b-feat {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pg8b-feat-item {
  background: var(--pg8b-surface);
  border: 1px solid rgba(210,180,140,.15);
  border-radius: 12px;
  padding: 14px;
}
.pg8b-feat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,99,71,.2), rgba(233,200,122,.2));
  display: grid; place-items: center;
  color: var(--pg8b-tomato);
  font-size: 20px;
  margin-bottom: 8px;
}
.pg8b-feat-item h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.pg8b-feat-item p {
  font-size: 12px;
  color: var(--pg8b-muted);
}

/* ============== Featured games (2 col highlight) ============== */
.pg8b-feat-card {
  display: flex;
  gap: 10px;
  background: var(--pg8b-surface);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(210,180,140,.15);
  align-items: center;
}
.pg8b-feat-card img {
  width: 80px; height: 80px;
  border-radius: 10px;
  object-fit: cover;
}
.pg8b-feat-card-body { flex: 1; }
.pg8b-feat-card h3 {
  font-size: 14px;
  color: #fff;
  margin-bottom: 4px;
}
.pg8b-feat-card p {
  font-size: 12px;
  color: var(--pg8b-muted);
  margin-bottom: 6px;
}
.pg8b-feat-card a {
  font-size: 12px;
  color: var(--pg8b-tomato);
  font-weight: 700;
}

/* ============== SEO long text ============== */
.pg8b-seo {
  padding: 14px;
  background: var(--pg8b-surface);
  border-radius: 12px;
  margin: 14px;
  border: 1px solid rgba(210,180,140,.12);
}
.pg8b-seo h2 {
  font-size: 17px;
  color: #fff;
  margin-bottom: 10px;
  padding-left: 12px;
  position: relative;
}
.pg8b-seo h2::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  background: var(--pg8b-tomato);
  border-radius: 2px;
}
.pg8b-seo h3 {
  font-size: 15px;
  color: var(--pg8b-tan);
  margin: 12px 0 6px;
}
.pg8b-seo p {
  font-size: 13px;
  color: var(--pg8b-muted);
  margin-bottom: 8px;
}
.pg8b-seo ul {
  padding-left: 18px;
  margin-bottom: 8px;
}
.pg8b-seo li {
  font-size: 13px;
  color: var(--pg8b-muted);
  margin-bottom: 4px;
}
.pg8b-seo a { color: var(--pg8b-tomato); font-weight: 600; }

/* ============== FAQ ============== */
.pg8b-faq { padding: 14px; }
.pg8b-faq-item {
  background: var(--pg8b-surface);
  border: 1px solid rgba(210,180,140,.15);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.pg8b-faq-q {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.pg8b-faq-q .pg8b-faq-icon { color: var(--pg8b-tomato); transition: transform .2s; }
.pg8b-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding: 0 14px;
  font-size: 13px;
  color: var(--pg8b-muted);
}
.pg8b-faq-open .pg8b-faq-a {
  max-height: 400px;
  padding-bottom: 12px;
}
.pg8b-faq-open .pg8b-faq-icon { transform: rotate(45deg); }

/* ============== CTA block ============== */
.pg8b-cta {
  margin: 16px 14px;
  padding: 22px 16px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,99,71,.18), rgba(139,115,85,.18));
  border: 1px solid rgba(255,99,71,.35);
}
.pg8b-cta h2 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 8px;
}
.pg8b-cta p {
  color: var(--pg8b-pink);
  font-size: 13px;
  margin-bottom: 14px;
}
.pg8b-cta-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ============== Footer ============== */
.pg8b-footer {
  background: #0c0907;
  border-top: 1px solid rgba(210,180,140,.15);
  padding: 20px 14px 30px;
  margin-top: 10px;
}
.pg8b-footer h4 {
  color: var(--pg8b-tan);
  font-size: 14px;
  margin: 12px 0 8px;
}
.pg8b-footer ul { list-style: none; }
.pg8b-footer li { margin-bottom: 5px; }
.pg8b-footer a {
  color: var(--pg8b-muted);
  font-size: 12px;
}
.pg8b-footer a:hover { color: var(--pg8b-tomato); }
.pg8b-footer-bottom {
  text-align: center;
  font-size: 11px;
  color: var(--pg8b-muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(210,180,140,.1);
}
.pg8b-pay {
  display: flex; flex-wrap: wrap;
  gap: 8px; margin-top: 10px;
}
.pg8b-pay span {
  font-size: 10px;
  padding: 4px 8px;
  background: rgba(255,255,255,.05);
  border-radius: 6px;
  color: var(--pg8b-muted);
  border: 1px solid rgba(210,180,140,.15);
}

/* ============== Mobile menu (slide-in) ============== */
.pg8b-mobile-menu {
  position: fixed;
  top: 0; right: -280px;
  width: 260px;
  height: 100%;
  background: #14100c;
  z-index: 9999;
  padding: 18px 16px;
  overflow-y: auto;
  transition: right .25s ease;
  border-left: 1px solid rgba(210,180,140,.15);
}
.pg8b-menu-open { right: 0; }
.pg8b-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s;
}
.pg8b-overlay-show { opacity: 1; visibility: visible; }
.pg8b-mobile-menu h4 {
  color: var(--pg8b-tan);
  font-size: 13px;
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pg8b-mobile-menu a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--pg8b-text);
  font-size: 13px;
  margin-bottom: 2px;
}
.pg8b-mobile-menu a:hover { background: rgba(255,99,71,.12); color: var(--pg8b-tomato); }
.pg8b-lock { overflow: hidden; }

/* ============== Bottom nav (mobile only) ============== */
.pg8b-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  background: rgba(20,16,12,.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(210,180,140,.2);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.pg8b-bottom-nav button,
.pg8b-bottom-nav a {
  flex: 1;
  min-width: 60px;
  min-height: 60px;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--pg8b-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: color .2s;
}
.pg8b-bottom-nav i { font-size: 22px; }
.pg8b-bottom-nav button:hover,
.pg8b-bottom-nav a:hover { color: var(--pg8b-tomato); }
.pg8b-bottom-nav .pg8b-active { color: var(--pg8b-tomato); }
.pg8b-bottom-nav .pg8b-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 28px; height: 3px;
  border-radius: 2px;
  background: var(--pg8b-tomato);
}
.pg8b-bottom-promo {
  position: relative;
}
.pg8b-bottom-promo i {
  background: linear-gradient(135deg, var(--pg8b-tomato), var(--pg8b-gold));
  color: #141414;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  margin-top: -18px;
  box-shadow: 0 4px 12px rgba(255,99,71,.5);
  border: 3px solid #141414;
}

/* Back to top */
.pg8b-top-btn {
  position: fixed;
  right: 14px;
  bottom: 76px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--pg8b-brown);
  color: #fff;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 999;
}
.pg8b-top-show { opacity: 1; visibility: visible; }

/* ============== Desktop breakpoint ============== */
@media (min-width: 769px) {
  body { background: #100b08; }
  .pg8b-wrap { max-width: 1100px; box-shadow: var(--pg8b-shadow); }
  .pg8b-header-inner { max-width: 1100px; margin: 0 auto; }
  .pg8b-desktop-nav { display: block; }
  .pg8b-bottom-nav { display: none; }
  .pg8b-menu-toggle { display: none; }
  .pg8b-grid { grid-template-columns: repeat(5, 1fr); }
  .pg8b-feat { grid-template-columns: repeat(4, 1fr); }
  .pg8b-hero-slide img { height: 340px; }
}

/* ============== Mobile bottom padding ============== */
@media (max-width: 768px) {
  main.pg8b-main { padding-bottom: 80px; }
  .pg8b-footer { padding-bottom: 90px; }
}
