/* ===========================================================
   ph99.homes — core stylesheet (css/design.css)
   All custom classes use the sf39- prefix to isolate namespaces.
   Mobile-first: max-width 430px base, scales up to desktop.
   Palette: #EE82EE | #EEE8AA | #FFF8DC | #D8BFD8 | #2C3E50
   Dark (#2C3E50) = background, light (#FFF8DC) = text.
   =========================================================== */

:root {
  --sf39-primary: #EE82EE;
  --sf39-secondary: #EEE8AA;
  --sf39-bg: #2C3E50;
  --sf39-bg-dark: #1f2c3a;
  --sf39-bg-light: #354b61;
  --sf39-text: #FFF8DC;
  --sf39-muted: #D8BFD8;
  --sf39-accent: #EE82EE;
  --sf39-accent-soft: rgba(238, 130, 238, 0.18);
  --sf39-card: #354b61;
  --sf39-border: rgba(238, 130, 238, 0.35);
  --sf39-radius: 14px;
  --sf39-radius-sm: 10px;
  --sf39-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  --sf39-header-h: 56px;
  --sf39-nav-h: 60px;
}

/* Root font sizing — rem based (62.5% trick from spec). */
html {
  font-size: 62.5%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--sf39-bg);
  color: var(--sf39-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--sf39-primary);
  text-decoration: none;
}

/* Layout primitives */
.sf39-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 14px;
}

.sf39-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.sf39-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--sf39-header-h);
  background: var(--sf39-bg-dark);
  border-bottom: 1px solid var(--sf39-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.sf39-header-inner {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sf39-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sf39-text);
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: 0.5px;
}

.sf39-logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.sf39-logo .sf39-logo-accent {
  color: var(--sf39-primary);
}

.sf39-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sf39-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 20px;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  color: var(--sf39-bg);
  background: var(--sf39-secondary);
}

.sf39-btn:active {
  transform: scale(0.95);
}

.sf39-btn-primary {
  background: linear-gradient(135deg, var(--sf39-primary), #c65ec6);
  color: #fff;
  box-shadow: 0 3px 10px rgba(238, 130, 238, 0.45);
}

.sf39-btn-ghost {
  background: transparent;
  color: var(--sf39-text);
  border: 1px solid var(--sf39-border);
}

.sf39-menu-btn {
  background: transparent;
  border: none;
  color: var(--sf39-text);
  font-size: 2rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

/* ===== Mobile expandable menu ===== */
.sf39-mobile-menu {
  position: fixed;
  top: var(--sf39-header-h);
  left: 0;
  right: 0;
  background: var(--sf39-bg-dark);
  border-bottom: 1px solid var(--sf39-border);
  transform: translateY(-130%);
  transition: transform 0.28s ease;
  z-index: 9999;
  max-width: 430px;
  margin: 0 auto;
  box-shadow: var(--sf39-shadow);
}

.sf39-mobile-menu.sf39-menu-open {
  transform: translateY(0);
}

.sf39-mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 8px 14px 14px;
}

.sf39-mobile-menu li a {
  display: block;
  padding: 12px 10px;
  color: var(--sf39-text);
  font-size: 1.4rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(216, 191, 216, 0.12);
}

.sf39-mobile-menu li a:active {
  color: var(--sf39-primary);
}

/* ===== Main content ===== */
.sf39-main {
  flex: 1;
  padding-top: calc(var(--sf39-header-h) + 10px);
}

/* ===== Hero carousel ===== */
.sf39-carousel {
  position: relative;
  width: 100%;
  border-radius: var(--sf39-radius);
  overflow: hidden;
  margin: 8px 0 18px;
  box-shadow: var(--sf39-shadow);
}

.sf39-slide {
  position: relative;
  display: none;
  cursor: pointer;
}

.sf39-slide.sf39-active {
  display: block;
}

.sf39-slide img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.sf39-slide-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  background: rgba(31, 44, 58, 0.78);
  padding: 8px 12px;
  border-radius: var(--sf39-radius-sm);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sf39-text);
}

.sf39-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.sf39-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 248, 220, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
}

.sf39-dot.sf39-active {
  background: var(--sf39-primary);
  width: 22px;
  border-radius: 4px;
}

/* ===== Section headings ===== */
.sf39-section {
  margin: 22px 0;
}

.sf39-section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--sf39-secondary);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sf39-section-title .sf39-hl {
  color: var(--sf39-primary);
}

.sf39-section-sub {
  color: var(--sf39-muted);
  font-size: 1.25rem;
  margin: 0 0 12px;
}

/* H1 page heading */
.sf39-h1 {
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--sf39-text);
  margin: 18px 0 8px;
}

.sf39-lead {
  font-size: 1.35rem;
  color: var(--sf39-muted);
  margin: 0 0 14px;
}

/* ===== Filter tabs ===== */
.sf39-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
}

.sf39-filters::-webkit-scrollbar {
  display: none;
}

.sf39-filter-btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid var(--sf39-border);
  background: var(--sf39-bg-light);
  color: var(--sf39-text);
  border-radius: 18px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sf39-filter-btn.sf39-filter-active {
  background: var(--sf39-primary);
  color: #fff;
  border-color: var(--sf39-primary);
}

/* ===== Game grid ===== */
.sf39-game-section {
  margin: 14px 0 24px;
}

.sf39-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sf39-game-card {
  background: var(--sf39-card);
  border: 1px solid rgba(238, 130, 238, 0.18);
  border-radius: var(--sf39-radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
}

.sf39-game-card:active {
  transform: scale(0.95);
  box-shadow: 0 0 0 2px var(--sf39-primary);
}

.sf39-game-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #000;
}

.sf39-game-name {
  font-size: 1.05rem;
  color: var(--sf39-text);
  padding: 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* ===== Feature cards / generic cards ===== */
.sf39-card {
  background: var(--sf39-card);
  border: 1px solid var(--sf39-border);
  border-radius: var(--sf39-radius);
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--sf39-shadow);
}

.sf39-card h2,
.sf39-card h3 {
  color: var(--sf39-secondary);
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.sf39-card p {
  font-size: 1.3rem;
  color: var(--sf39-text);
  margin: 0 0 8px;
}

.sf39-card-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.sf39-card-list li {
  padding: 8px 0;
  font-size: 1.3rem;
  border-bottom: 1px dashed rgba(216, 191, 216, 0.18);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sf39-card-list li:last-child {
  border-bottom: none;
}

/* Promo inline link */
.sf39-promo-link {
  color: var(--sf39-primary);
  font-weight: 800;
  cursor: pointer;
}

.sf39-promo-link:hover {
  text-decoration: underline;
}

/* ===== Stats / RTP compact rows ===== */
.sf39-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sf39-stat {
  background: var(--sf39-bg-light);
  border-radius: var(--sf39-radius-sm);
  padding: 12px;
  text-align: center;
}

.sf39-stat .sf39-stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--sf39-primary);
}

.sf39-stat .sf39-stat-label {
  font-size: 1.15rem;
  color: var(--sf39-muted);
}

/* ===== Testimonials ===== */
.sf39-testimonial {
  background: var(--sf39-card);
  border-left: 4px solid var(--sf39-primary);
  border-radius: var(--sf39-radius-sm);
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 1.3rem;
}

.sf39-testimonial .sf39-testi-author {
  display: block;
  margin-top: 6px;
  color: var(--sf39-secondary);
  font-weight: 700;
  font-size: 1.2rem;
}

/* ===== Payment methods ===== */
.sf39-pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sf39-pay-chip {
  background: var(--sf39-bg-light);
  border: 1px solid var(--sf39-border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 1.2rem;
  color: var(--sf39-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== Winners ===== */
.sf39-winner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(216, 191, 216, 0.18);
  font-size: 1.25rem;
}

.sf39-winner .sf39-winner-amount {
  color: var(--sf39-primary);
  font-weight: 800;
}

/* ===== Play Now CTA ===== */
.sf39-cta {
  background: linear-gradient(135deg, var(--sf39-primary), #c65ec6);
  border-radius: var(--sf39-radius);
  padding: 18px;
  text-align: center;
  color: #fff;
  margin: 18px 0;
  box-shadow: 0 6px 16px rgba(238, 130, 238, 0.4);
}

.sf39-cta h2 {
  color: #fff;
  margin: 0 0 6px;
  font-size: 2rem;
}

.sf39-cta p {
  margin: 0 0 12px;
  font-size: 1.3rem;
  color: #fff8dc;
}

.sf39-cta .sf39-btn {
  background: #fff;
  color: var(--sf39-primary);
  font-size: 1.5rem;
  padding: 10px 24px;
}

/* ===== Reveal animation ===== */
.sf39-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.sf39-reveal.sf39-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Footer ===== */
.sf39-footer {
  background: var(--sf39-bg-dark);
  border-top: 1px solid var(--sf39-border);
  padding: 22px 14px 90px;
  margin-top: 24px;
}

.sf39-footer-inner {
  max-width: 430px;
  margin: 0 auto;
}

.sf39-footer-about {
  font-size: 1.25rem;
  color: var(--sf39-muted);
  margin: 0 0 14px;
  line-height: 1.6;
}

.sf39-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.sf39-footer-links a,
.sf39-footer-links button {
  font-size: 1.2rem;
  color: var(--sf39-secondary);
  background: var(--sf39-bg-light);
  border: 1px solid var(--sf39-border);
  border-radius: 16px;
  padding: 6px 12px;
  cursor: pointer;
}

.sf39-footer-copy {
  font-size: 1.15rem;
  color: var(--sf39-muted);
  text-align: center;
  margin-top: 10px;
}

/* ===== Back to top button ===== */
.sf39-top-btn {
  position: fixed;
  right: 14px;
  bottom: calc(var(--sf39-nav-h) + 14px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sf39-primary);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 998;
  box-shadow: var(--sf39-shadow);
}

.sf39-top-btn.sf39-top-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Mobile bottom navigation (5 buttons, fixed) ===== */
.sf39-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--sf39-nav-h);
  background: var(--sf39-bg-dark);
  border-top: 1px solid var(--sf39-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.4);
}

.sf39-nav-item {
  flex: 1;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--sf39-muted);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  transition: color 0.18s ease, transform 0.18s ease;
  padding: 4px 2px;
}

.sf39-nav-item .sf39-nav-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.sf39-nav-item:active {
  transform: scale(0.9);
}

.sf39-nav-item.sf39-nav-active {
  color: var(--sf39-primary);
}

.sf39-nav-item.sf39-nav-promo {
  color: var(--sf39-secondary);
}

/* Mobile content padding clearance for bottom nav */
@media (max-width: 768px) {
  .sf39-main {
    padding-bottom: 80px;
  }
}

/* Desktop: hide bottom nav, widen container, show menu inline */
@media (min-width: 769px) {
  .sf39-bottom-nav {
    display: none;
  }
  .sf39-container,
  .sf39-header-inner,
  .sf39-mobile-menu,
  .sf39-footer-inner {
    max-width: 760px;
  }
  .sf39-footer {
    padding-bottom: 30px;
  }
  .sf39-game-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .sf39-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
