/* deskgame ph - core stylesheet
 * CSS class prefix: g39d-
 * Mobile-first design, max-width 430px base, expands to desktop.
 * Palette: #333333 | #CD853F | #87CEFA | #0000CD | #4169E1
 */
:root {
  --g39d-bg: #1a1a1a;
  --g39d-bg-alt: #2a2a2a;
  --g39d-bg-deep: #0f0f0f;
  --g39d-primary: #CD853F;
  --g39d-primary-dark: #a86b2c;
  --g39d-accent: #4169E1;
  --g39d-accent-light: #87CEFA;
  --g39d-link: #0000CD;
  --g39d-text: #f5f5f5;
  --g39d-text-muted: #c9c9c9;
  --g39d-border: #3a3a3a;
  --g39d-radius: 14px;
  --g39d-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  --g39d-header-h: 60px;
  --g39d-bottomnav-h: 62px;
}

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

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

body {
  font-family: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  background: var(--g39d-bg);
  color: var(--g39d-text);
  line-height: 1.5rem;
  font-size: 1.4rem;
  overflow-x: hidden;
}

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

.g39d-container { width: 100%; max-width: 430px; margin: 0 auto; padding: 0 14px; position: relative; }
.g39d-wrapper { width: 100%; overflow-x: hidden; }

/* ---------- Header ---------- */
.g39d-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--g39d-header-h);
  background: linear-gradient(90deg, #0f0f0f, #333333 60%, #0f0f0f);
  border-bottom: 2px solid var(--g39d-primary);
  box-shadow: var(--g39d-shadow);
}
.g39d-header-inner { max-width: 430px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.g39d-logo { display: flex; align-items: center; gap: 8px; color: var(--g39d-primary); font-weight: 700; font-size: 1.7rem; }
.g39d-logo img { width: 30px; height: 30px; border-radius: 6px; }
.g39d-logo .g39d-logo-text { color: var(--g39d-text); font-weight: 700; }
.g39d-logo .g39d-logo-text span { color: var(--g39d-primary); }

.g39d-header-actions { display: flex; align-items: center; gap: 8px; }
.g39d-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  border: none; border-radius: 20px;
  font-size: 1.3rem; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
  color: #fff; background: var(--g39d-primary);
  font-family: inherit;
}
.g39d-btn:hover { transform: translateY(-1px); background: var(--g39d-primary-dark); color: #fff; }
.g39d-btn:active { transform: scale(.96); }
.g39d-btn-secondary { background: var(--g39d-accent); }
.g39d-btn-secondary:hover { background: #3550b8; color: #fff; }
.g39d-btn-block { display: flex; width: 100%; justify-content: center; padding: 12px; font-size: 1.5rem; }
.g39d-btn-ghost { background: transparent; border: 1px solid var(--g39d-primary); color: var(--g39d-primary); }
.g39d-btn-ghost:hover { background: rgba(205,133,63,.12); color: var(--g39d-primary); }

.g39d-menu-toggle {
  background: transparent; border: none; color: var(--g39d-text);
  font-size: 2rem; cursor: pointer; padding: 6px 8px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.g39d-menu-toggle:hover { color: var(--g39d-primary); }

/* ---------- Mobile expandable menu ---------- */
.g39d-mobile-menu {
  position: fixed; top: var(--g39d-header-h); left: 0; right: 0; z-index: 9999;
  background: var(--g39d-bg-deep);
  border-bottom: 2px solid var(--g39d-primary);
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
}
.g39d-mobile-menu.g39d-menu-open { max-height: 80vh; overflow-y: auto; box-shadow: var(--g39d-shadow); }
.g39d-mobile-menu-inner { padding: 10px 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.g39d-mobile-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; border-radius: 8px;
  color: var(--g39d-text); font-size: 1.35rem;
  border-bottom: 1px solid #222;
}
.g39d-mobile-menu a:hover { background: rgba(205,133,63,.12); color: var(--g39d-primary); }
.g39d-mobile-menu a i { width: 22px; text-align: center; color: var(--g39d-primary); }
.g39d-menu-section-title { color: var(--g39d-primary); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .05em; margin: 10px 6px 4px; font-weight: 700; }

/* ---------- Main layout ---------- */
.g39d-main { padding-top: calc(var(--g39d-header-h) + 6px); min-height: 60vh; }

section.g39d-section { padding: 18px 0; }
.g39d-section-title {
  font-size: 1.8rem; font-weight: 700; color: var(--g39d-text);
  margin-bottom: 10px; padding-left: 10px; border-left: 4px solid var(--g39d-primary);
}
.g39d-section-title span { color: var(--g39d-primary); }
.g39d-section-sub { color: var(--g39d-text-muted); font-size: 1.25rem; margin-bottom: 12px; padding-left: 14px; }

/* ---------- Carousel ---------- */
.g39d-carousel {
  position: relative; width: 100%; border-radius: var(--g39d-radius); overflow: hidden;
  box-shadow: var(--g39d-shadow); background: #111;
}
.g39d-carousel-track { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.g39d-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease;
  display: flex; align-items: flex-end;
}
.g39d-slide.g39d-slide-active { opacity: 1; }
.g39d-slide img { width: 100%; height: 100%; object-fit: cover; }
.g39d-slide-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff; font-size: 1.3rem; font-weight: 600;
}
.g39d-slide-caption a { color: var(--g39d-primary); font-weight: 700; }
.g39d-carousel-prev, .g39d-carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff; border: none;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-size: 1.6rem; display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.g39d-carousel-prev { left: 8px; }
.g39d-carousel-next { right: 8px; }
.g39d-carousel-dots { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; z-index: 2; }
.g39d-dot {
  display: inline-block; width: 8px; height: 8px; margin: 0 3px;
  border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer;
}
.g39d-dot.g39d-dot-active { background: var(--g39d-primary); width: 22px; border-radius: 4px; }

/* ---------- Filter chips ---------- */
.g39d-filter-bar { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; -webkit-overflow-scrolling: touch; }
.g39d-filter-chip {
  white-space: nowrap; padding: 7px 14px; border-radius: 18px;
  background: var(--g39d-bg-alt); color: var(--g39d-text-muted);
  font-size: 1.2rem; cursor: pointer; border: 1px solid var(--g39d-border);
}
.g39d-filter-chip.g39d-filter-chip-active { background: var(--g39d-primary); color: #fff; border-color: var(--g39d-primary); }

/* ---------- Game grid ---------- */
.g39d-game-group { margin-bottom: 22px; }
.g39d-game-group-title {
  font-size: 1.5rem; font-weight: 700; color: var(--g39d-primary);
  margin: 6px 0 10px; display: flex; align-items: center; gap: 8px;
}
.g39d-game-group-title i { font-size: 2rem; }
.g39d-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.g39d-card {
  background: var(--g39d-bg-alt); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--g39d-border); cursor: pointer; position: relative;
  transition: transform .18s ease, border-color .2s ease;
}
.g39d-card:hover { transform: translateY(-3px); border-color: var(--g39d-primary); }
.g39d-card:active { transform: scale(.97); }
.g39d-card-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #111; }
.g39d-card-name {
  padding: 6px 8px; font-size: 1.1rem; text-align: center; color: var(--g39d-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g39d-card-badge {
  position: absolute; top: 4px; left: 4px; background: var(--g39d-primary);
  color: #fff; font-size: .95rem; padding: 2px 6px; border-radius: 6px; font-weight: 700;
}

/* ---------- Info / content blocks ---------- */
.g39d-content-block {
  background: var(--g39d-bg-alt); border-radius: var(--g39d-radius); padding: 16px;
  border: 1px solid var(--g39d-border); margin-bottom: 14px;
}
.g39d-content-block h2 { color: var(--g39d-primary); font-size: 1.7rem; margin-bottom: 8px; }
.g39d-content-block h3 { color: var(--g39d-accent-light); font-size: 1.4rem; margin: 10px 0 6px; }
.g39d-content-block p { color: var(--g39d-text-muted); margin-bottom: 8px; font-size: 1.25rem; }
.g39d-content-block a { color: var(--g39d-primary); font-weight: 600; }
.g39d-content-block ul { padding-left: 18px; color: var(--g39d-text-muted); }
.g39d-content-block ul li { margin-bottom: 5px; font-size: 1.2rem; }

/* ---------- Feature grid ---------- */
.g39d-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.g39d-feature-item {
  background: var(--g39d-bg-alt); border-radius: 12px; padding: 14px; text-align: center;
  border: 1px solid var(--g39d-border);
}
.g39d-feature-item i { font-size: 2.6rem; color: var(--g39d-primary); margin-bottom: 6px; }
.g39d-feature-item h3 { color: var(--g39d-text); font-size: 1.3rem; margin-bottom: 4px; }
.g39d-feature-item p { color: var(--g39d-text-muted); font-size: 1.1rem; }

/* ---------- Testimonials ---------- */
.g39d-testimonial {
  background: var(--g39d-bg-alt); border-radius: 12px; padding: 14px; margin-bottom: 10px;
  border-left: 3px solid var(--g39d-primary);
}
.g39d-testimonial-name { color: var(--g39d-primary); font-weight: 700; font-size: 1.25rem; }
.g39d-testimonial-stars { color: #FFD700; font-size: 1.1rem; margin: 2px 0; }
.g39d-testimonial-text { color: var(--g39d-text-muted); font-size: 1.2rem; }

/* ---------- Winners ---------- */
.g39d-winner-list { display: flex; flex-direction: column; gap: 8px; }
.g39d-winner-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--g39d-bg-alt); border-radius: 10px; padding: 10px 12px;
  border: 1px solid var(--g39d-border);
}
.g39d-winner-name { color: var(--g39d-text); font-size: 1.2rem; font-weight: 600; }
.g39d-winner-game { color: var(--g39d-text-muted); font-size: 1.05rem; }
.g39d-winner-amount { color: var(--g39d-primary); font-weight: 700; font-size: 1.3rem; }

/* ---------- Payment methods ---------- */
.g39d-pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g39d-pay-item {
  background: #fff; border-radius: 8px; padding: 8px; text-align: center;
  color: #333; font-size: 1rem; font-weight: 700; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- App download CTA ---------- */
.g39d-app-cta {
  background: linear-gradient(135deg, var(--g39d-accent), var(--g39d-primary));
  border-radius: var(--g39d-radius); padding: 18px; text-align: center; color: #fff;
}
.g39d-app-cta h2 { color: #fff; font-size: 1.7rem; margin-bottom: 6px; }
.g39d-app-cta p { color: #f0f0f0; font-size: 1.2rem; margin-bottom: 12px; }

/* ---------- Promo link inline text ---------- */
.g39d-promo-text {
  color: var(--g39d-primary); font-weight: 700; cursor: pointer; text-decoration: underline;
}
.g39d-promo-text:hover { color: var(--g39d-primary-dark); }

/* ---------- Reveal animation ---------- */
.g39d-reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.g39d-reveal.g39d-reveal-in { opacity: 1; transform: translateY(0); }

/* ---------- Footer ---------- */
.g39d-footer {
  background: var(--g39d-bg-deep); border-top: 2px solid var(--g39d-primary);
  padding: 22px 14px calc(var(--g39d-bottomnav-h) + 20px);
}
.g39d-footer-inner { max-width: 430px; margin: 0 auto; }
.g39d-footer-brand { color: var(--g39d-primary); font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.g39d-footer-desc { color: var(--g39d-text-muted); font-size: 1.15rem; margin-bottom: 12px; }
.g39d-footer-promos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.g39d-footer-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.g39d-footer-links a { color: var(--g39d-text-muted); font-size: 1.15rem; }
.g39d-footer-links a:hover { color: var(--g39d-primary); }
.g39d-footer-copy { color: #777; font-size: 1.05rem; border-top: 1px solid #222; padding-top: 10px; }

/* ---------- Mobile bottom nav ---------- */
.g39d-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  height: var(--g39d-bottomnav-h);
  background: linear-gradient(180deg, #1f1f1f, #0a0a0a);
  border-top: 2px solid var(--g39d-primary);
  display: flex; justify-content: space-around; align-items: stretch;
  box-shadow: 0 -4px 14px rgba(0,0,0,.5);
}
.g39d-bottomnav-btn {
  flex: 1; min-width: 60px; min-height: 60px;
  background: transparent; border: none; color: var(--g39d-text-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; font-family: inherit;
  transition: color .2s ease, transform .18s ease;
  position: relative; padding: 4px 2px;
}
.g39d-bottomnav-btn i, .g39d-bottomnav-btn .material-icons-outlined,
.g39d-bottomnav-btn .icon { font-size: 22px; }
.g39d-bottomnav-btn span { font-size: 1rem; }
.g39d-bottomnav-btn:hover { color: var(--g39d-primary); }
.g39d-bottomnav-btn:active { transform: scale(.92); }
.g39d-bottomnav-btn.g39d-bottomnav-active { color: var(--g39d-primary); }
.g39d-bottomnav-btn.g39d-bottomnav-active::before {
  content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 3px;
  background: var(--g39d-primary); border-radius: 0 0 4px 4px;
}
.g39d-bottomnav-promo { color: var(--g39d-primary); }
.g39d-bottomnav-promo span { font-weight: 700; }

/* Mobile bottom padding for main content + footer clearance */
@media (max-width: 768px) {
  .g39d-main { padding-bottom: calc(var(--g39d-bottomnav-h) + 12px); }
}

/* ---------- Desktop: hide bottom nav, expand container ---------- */
@media (min-width: 769px) {
  .g39d-bottomnav { display: none; }
  .g39d-container { max-width: 960px; }
  .g39d-header-inner { max-width: 960px; }
  .g39d-footer-inner { max-width: 960px; }
  .g39d-grid { grid-template-columns: repeat(6, 1fr); }
  .g39d-feature-grid { grid-template-columns: repeat(4, 1fr); }
  .g39d-pay-grid { grid-template-columns: repeat(8, 1fr); }
  .g39d-footer { padding-bottom: 22px; }
}
