/* =====================================================================
 * niceph login - style.css
 * Palette: #CED4DA (text) | #F08080 (accent) | #1A1A1A (background)
 * Mobile-first. Root font-size 62.5% so 1rem = 10px.
 * All custom classes use the pg4d- namespace.
 * Comments in English only.
 * ===================================================================== */

:root {
  --pg4d-bg: #1A1A1A;
  --pg4d-bg-soft: #232323;
  --pg4d-bg-card: #2a2a2a;
  --pg4d-text: #CED4DA;
  --pg4d-text-muted: #9aa3ab;
  --pg4d-primary: #F08080;
  --pg4d-primary-dark: #d96262;
  --pg4d-gold: #f3c969;
  --pg4d-border: rgba(206, 212, 218, 0.12);
  --pg4d-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --pg4d-radius: 14px;
  --pg4d-radius-sm: 10px;
  --pg4d-header-h: 60px;
  --pg4d-bottom-h: 62px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, #2b2b2b 0%, var(--pg4d-bg) 55%) no-repeat;
  background-color: var(--pg4d-bg);
  color: var(--pg4d-text);
  font-family: "Segoe UI", "Helvetica Neue", Roboto, system-ui, -apple-system, sans-serif;
  font-size: 1.5rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- Layout containers ---------- */
.pg4d-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 14px;
}
.pg4d-wrapper { width: 100%; }
.pg4d-section { padding: 32px 0 8px; }
.pg4d-hidden { display: none !important; }

/* ---------- Header ---------- */
.pg4d-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--pg4d-header-h);
  background: rgba(20, 20, 20, 0.96);
  border-bottom: 1px solid var(--pg4d-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.pg4d-header-inner {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pg4d-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.pg4d-brand img {
  width: 30px; height: 30px;
  border-radius: 8px;
}
.pg4d-brand-name {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--pg4d-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg4d-brand-name b { color: var(--pg4d-primary); }

.pg4d-header-actions { display: flex; align-items: center; gap: 8px; }
.pg4d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.3rem;
  padding: 9px 16px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
  line-height: 1;
}
.pg4d-btn:hover { text-decoration: none; transform: translateY(-1px); }
.pg4d-btn-primary {
  background: linear-gradient(135deg, var(--pg4d-primary), var(--pg4d-primary-dark));
  color: #1a1a1a;
  box-shadow: 0 4px 14px rgba(240, 128, 128, 0.45);
}
.pg4d-btn-outline {
  background: transparent;
  color: var(--pg4d-text);
  border: 1.5px solid var(--pg4d-primary);
}
.pg4d-btn-block { width: 100%; padding: 13px; font-size: 1.45rem; }

.pg4d-menu-btn {
  background: transparent;
  border: 0;
  color: var(--pg4d-text);
  font-size: 2.2rem;
  padding: 6px 8px;
  cursor: pointer;
}

/* ---------- Mobile slide menu ---------- */
.pg4d-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
  z-index: 9998;
}
.pg4d-overlay-visible { opacity: 1; visibility: visible; }

.pg4d-mobile-menu {
  position: fixed;
  top: 0; right: -82%;
  width: 78%;
  max-width: 320px;
  height: 100vh;
  background: var(--pg4d-bg-soft);
  z-index: 9999;
  padding: 22px 18px;
  transition: right .28s ease;
  overflow-y: auto;
}
.pg4d-menu-open { right: 0; }
.pg4d-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.pg4d-menu-head h3 {
  margin: 0;
  font-size: 1.7rem;
  color: var(--pg4d-primary);
}
.pg4d-menu-close {
  background: transparent;
  border: 0;
  color: var(--pg4d-text);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}
.pg4d-menu-list { list-style: none; padding: 0; margin: 0; }
.pg4d-menu-list li { border-bottom: 1px solid var(--pg4d-border); }
.pg4d-menu-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 6px;
  color: var(--pg4d-text);
  font-size: 1.45rem;
}
.pg4d-menu-list a:hover { color: var(--pg4d-primary); text-decoration: none; }
.pg4d-menu-list .material-icons,
.pg4d-menu-list i { font-size: 20px; color: var(--pg4d-primary); }

/* ---------- Hero / Carousel ---------- */
.pg4d-main { padding-top: calc(var(--pg4d-header-h) + 8px); padding-bottom: 80px; }
.pg4d-hero {
  position: relative;
  border-radius: var(--pg4d-radius);
  overflow: hidden;
  margin-top: 12px;
  box-shadow: var(--pg4d-shadow);
}
.pg4d-hero-track { position: relative; height: 220px; }
.pg4d-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  background-size: cover;
  background-position: center;
}
.pg4d-hero-active { opacity: 1; }
.pg4d-hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,26,.92) 0%, rgba(26,26,26,.25) 55%, rgba(26,26,26,0) 100%);
}
.pg4d-hero-content { position: relative; z-index: 2; }
.pg4d-hero-tag {
  display: inline-block;
  background: var(--pg4d-primary);
  color: #1a1a1a;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.pg4d-hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: #fff;
  line-height: 1.2;
}
.pg4d-hero-sub {
  font-size: 1.25rem;
  margin: 0 0 10px;
  color: var(--pg4d-text);
}
.pg4d-hero-dots {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 3;
}
.pg4d-hero-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(206,212,218,.4);
  border: 0; padding: 0; cursor: pointer;
}
.pg4d-dot-active { background: var(--pg4d-primary); width: 18px; border-radius: 4px; }

/* ---------- Section headers ---------- */
.pg4d-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 12px;
}
.pg4d-section-head h2 {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0;
  color: var(--pg4d-text);
  position: relative;
  padding-left: 12px;
}
.pg4d-section-head h2::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  background: var(--pg4d-primary);
  border-radius: 2px;
}
.pg4d-section-more { font-size: 1.2rem; color: var(--pg4d-primary); }

/* ---------- Feature highlights row ---------- */
.pg4d-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 4px;
}
.pg4d-feature {
  background: var(--pg4d-bg-card);
  border: 1px solid var(--pg4d-border);
  border-radius: var(--pg4d-radius-sm);
  padding: 12px 4px;
  text-align: center;
}
.pg4d-feature i, .pg4d-feature .material-icons {
  font-size: 22px;
  color: var(--pg4d-primary);
}
.pg4d-feature span {
  display: block;
  font-size: 1.05rem;
  margin-top: 4px;
  color: var(--pg4d-text-muted);
}

/* ---------- Promo banner CTA ---------- */
.pg4d-cta {
  background: linear-gradient(135deg, rgba(240,128,128,.18), rgba(240,128,128,.05));
  border: 1px solid rgba(240,128,128,.4);
  border-radius: var(--pg4d-radius);
  padding: 16px;
  margin: 18px 0;
  text-align: center;
}
.pg4d-cta h3 { margin: 0 0 6px; font-size: 1.65rem; color: #fff; }
.pg4d-cta p { margin: 0 0 12px; font-size: 1.25rem; color: var(--pg4d-text-muted); }

/* ---------- Game grid ---------- */
.pg4d-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pg4d-filter-bar::-webkit-scrollbar { display: none; }
.pg4d-filter-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--pg4d-bg-card);
  color: var(--pg4d-text-muted);
  border: 1px solid var(--pg4d-border);
  font-size: 1.3rem;
  cursor: pointer;
  white-space: nowrap;
}
.pg4d-tab-active {
  background: var(--pg4d-primary);
  color: #1a1a1a;
  border-color: var(--pg4d-primary);
  font-weight: 700;
}

.pg4d-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pg4d-card {
  background: var(--pg4d-bg-card);
  border: 1px solid var(--pg4d-border);
  border-radius: var(--pg4d-radius-sm);
  overflow: hidden;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pg4d-card:hover { transform: translateY(-2px); box-shadow: var(--pg4d-shadow); }
.pg4d-card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0e0e0e;
  overflow: hidden;
}
.pg4d-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.pg4d-card:hover .pg4d-card-img img { transform: scale(1.06); }
.pg4d-card-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--pg4d-primary);
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}
.pg4d-card-ribbon {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,.65);
  color: var(--pg4d-gold);
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}
.pg4d-card-title {
  padding: 7px 8px;
  font-size: 1.18rem;
  color: var(--pg4d-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg4d-card-play {
  display: block;
  background: var(--pg4d-primary);
  color: #1a1a1a;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 6px 0;
  text-decoration: none;
}
.pg4d-card-play:hover { background: var(--pg4d-primary-dark); text-decoration: none; }

/* ---------- Two-column featured list ---------- */
.pg4d-featured {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pg4d-featured .pg4d-card-title { font-weight: 700; }

/* ---------- Article / SEO content ---------- */
.pg4d-article {
  background: var(--pg4d-bg-card);
  border: 1px solid var(--pg4d-border);
  border-radius: var(--pg4d-radius);
  padding: 18px 16px;
  margin: 18px 0;
}
.pg4d-article h2 {
  font-size: 1.8rem;
  margin: 0 0 10px;
  color: #fff;
}
.pg4d-article h3 {
  font-size: 1.45rem;
  margin: 16px 0 6px;
  color: var(--pg4d-primary);
}
.pg4d-article p {
  font-size: 1.32rem;
  color: var(--pg4d-text);
  margin: 0 0 10px;
}
.pg4d-article ol, .pg4d-article ul {
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--pg4d-text);
}
.pg4d-article li { font-size: 1.3rem; margin-bottom: 5px; }
.pg4d-article strong { color: var(--pg4d-primary); }

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

/* ---------- FAQ accordion ---------- */
.pg4d-faq-list { display: flex; flex-direction: column; gap: 8px; }
.pg4d-faq-item {
  background: var(--pg4d-bg-card);
  border: 1px solid var(--pg4d-border);
  border-radius: var(--pg4d-radius-sm);
  overflow: hidden;
}
.pg4d-faq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
}
.pg4d-faq-head h3 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--pg4d-text);
  font-weight: 600;
}
.pg4d-faq-icon { color: var(--pg4d-primary); font-size: 18px; transition: transform .2s; }
.pg4d-faq-open .pg4d-faq-icon { transform: rotate(45deg); }
.pg4d-faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding: 0 14px;
}
.pg4d-faq-body p {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: var(--pg4d-text-muted);
}

/* ---------- Footer ---------- */
.pg4d-footer {
  background: #141414;
  border-top: 1px solid var(--pg4d-border);
  padding: 26px 0 24px;
  margin-top: 24px;
}
.pg4d-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pg4d-footer-brand img { width: 32px; height: 32px; border-radius: 8px; }
.pg4d-footer-brand b { color: var(--pg4d-primary); font-size: 1.5rem; }
.pg4d-footer p {
  font-size: 1.2rem;
  color: var(--pg4d-text-muted);
  margin: 0 0 14px;
}
.pg4d-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.pg4d-footer-links a {
  background: var(--pg4d-bg-card);
  border: 1px solid var(--pg4d-border);
  color: var(--pg4d-text);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 1.15rem;
}
.pg4d-footer-links a:hover { color: var(--pg4d-primary); border-color: var(--pg4d-primary); text-decoration: none; }
.pg4d-footer-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.pg4d-footer-cols h4 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: var(--pg4d-primary);
}
.pg4d-footer-cols ul { list-style: none; margin: 0; padding: 0; }
.pg4d-footer-cols li { margin-bottom: 4px; }
.pg4d-footer-cols a { font-size: 1.15rem; color: var(--pg4d-text-muted); }
.pg4d-footer-bottom {
  border-top: 1px solid var(--pg4d-border);
  padding-top: 12px;
  font-size: 1.1rem;
  color: var(--pg4d-text-muted);
  text-align: center;
}

/* ---------- Bottom navigation ---------- */
.pg4d-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--pg4d-bottom-h);
  background: rgba(20, 20, 20, 0.98);
  border-top: 1px solid var(--pg4d-border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}
.pg4d-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--pg4d-text-muted);
  text-decoration: none;
  font-size: 1rem;
  min-width: 60px;
  min-height: 60px;
  transition: color .15s;
}
.pg4d-bottom-nav a:hover { text-decoration: none; }
.pg4d-bottom-nav a i,
.pg4d-bottom-nav a .material-icons,
.pg4d-bottom-nav a .ion { font-size: 22px; }
.pg4d-bottom-nav .pg4d-nav-active { color: var(--pg4d-primary); }
.pg4d-bottom-nav .pg4d-nav-promo {
  position: relative;
  color: var(--pg4d-primary);
}
.pg4d-bottom-nav .pg4d-nav-promo i,
.pg4d-bottom-nav .pg4d-nav-promo .material-icons { font-size: 24px; }

/* ---------- Back to top ---------- */
.pg4d-top-btn {
  position: fixed;
  right: 14px;
  bottom: calc(var(--pg4d-bottom-h) + 14px);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--pg4d-primary);
  color: #1a1a1a;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, transform .2s;
  z-index: 999;
}
.pg4d-top-visible { opacity: 1; visibility: visible; }

/* ---------- Marquee strip ---------- */
.pg4d-marquee {
  background: linear-gradient(90deg, var(--pg4d-primary), var(--pg4d-gold));
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 6px 0;
  margin: 12px 0;
  border-radius: var(--pg4d-radius-sm);
  overflow: hidden;
  white-space: nowrap;
}
.pg4d-marquee span { display: inline-block; padding-left: 100%; animation: pg4dscroll 18s linear infinite; }
@keyframes pg4dscroll { to { transform: translateX(-100%); } }

/* ---------- Desktop rules ---------- */
@media (min-width: 769px) {
  body { background-color: #0e0e0e; }
  .pg4d-bottom-nav { display: none; }
  .pg4d-main { padding-bottom: 30px; }
  .pg4d-container { max-width: 430px; }
  .pg4d-header-inner { max-width: 430px; }
}

/* ---------- Touch target safety ---------- */
@media (max-width: 768px) {
  .pg4d-btn { min-height: 40px; }
  .pg4d-menu-list a { min-height: 44px; }
  .pg4d-bottom-nav a { min-height: 56px; }
  main { padding-bottom: 80px; }
}
