/*!
 * ph888.homes - Core stylesheet (mobile-first, max-width 430px)
 * All custom classes use the s58d- prefix to avoid collisions.
 * Comments in English only.
 */

:root {
  --s58d-bg: #2D2D2D;
  --s58d-bg-soft: #3a3a3a;
  --s58d-bg-elevated: #454545;
  --s58d-primary: #DDA0DD;
  --s58d-primary-strong: #C68FC6;
  --s58d-silver: #C0C0C0;
  --s58d-muted: #696969;
  --s58d-slate: #778899;
  --s58d-light: #CED4DA;
  --s58d-text: #F5F5F5;
  --s58d-text-dim: #B8B8B8;
  --s58d-accent-gold: #E6C275;
  --s58d-border: rgba(192, 192, 192, 0.16);
  --s58d-radius: 14px;
  --s58d-radius-sm: 10px;
  --s58d-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  background: var(--s58d-bg);
  color: var(--s58d-text);
  line-height: 1.5rem;
  font-size: 1.5rem;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--s58d-primary-strong);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6rem;
  line-height: 1.25;
  color: var(--s58d-text);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.7rem; }
h4 { font-size: 1.5rem; }

p { margin: 0 0 1rem; }

/* ============ Layout containers ============ */
.s58d-wrapper {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}

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

main.s58d-main {
  padding-top: 6rem;
  padding-bottom: 1rem;
}

/* ============ Header ============ */
.s58d-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #1f1f1f 0%, #2D2D2D 100%);
  border-bottom: 1px solid var(--s58d-border);
  transition: box-shadow 0.25s ease;
}

.s58d-header.s58d-scrolled {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.s58d-header-inner {
  max-width: 430px;
  margin: 0 auto;
  padding: 0.7rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.s58d-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.s58d-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.s58d-brand-name {
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--s58d-primary);
  letter-spacing: 0.4px;
}

.s58d-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.s58d-menu-btn {
  background: transparent;
  border: 1px solid var(--s58d-border);
  color: var(--s58d-silver);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.6rem;
}

/* ============ Buttons ============ */
.s58d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  min-height: 38px;
  transition: transform 0.15s ease, background 0.2s ease;
}

.s58d-btn:hover { transform: translateY(-1px); text-decoration: none; }

.s58d-btn-primary {
  background: linear-gradient(135deg, #DDA0DD 0%, #C68FC6 100%);
  color: #2D2D2D;
}

.s58d-btn-ghost {
  background: transparent;
  color: var(--s58d-light);
  border: 1px solid var(--s58d-silver);
}

.s58d-btn-gold {
  background: linear-gradient(135deg, #E6C275 0%, #C49A4B 100%);
  color: #2D2D2D;
}

.s58d-btn-block {
  width: 100%;
  display: flex;
}

.s58d-link-text {
  color: var(--s58d-primary);
  font-weight: 700;
}

/* ============ Mobile dropdown menu ============ */
.s58d-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #232323;
  border-bottom: 1px solid var(--s58d-border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  z-index: 9999;
  padding: 0 1.2rem;
}

.s58d-mobile-menu.s58d-menu-open {
  max-height: 80vh;
  padding: 5.6rem 1.2rem 1.4rem;
  overflow-y: auto;
  box-shadow: var(--s58d-shadow);
}

.s58d-mobile-menu a {
  display: block;
  padding: 0.95rem 0.6rem;
  border-bottom: 1px solid var(--s58d-border);
  color: var(--s58d-light);
  font-size: 1.45rem;
}

.s58d-mobile-menu a:hover { color: var(--s58d-primary); }

/* ============ Hero / Carousel ============ */
.s58d-carousel {
  position: relative;
  border-radius: var(--s58d-radius);
  overflow: hidden;
  box-shadow: var(--s58d-shadow);
  margin-bottom: 1.4rem;
}

.s58d-carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.s58d-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.s58d-carousel-slide.s58d-active { opacity: 1; }

.s58d-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s58d-carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.2rem 1.6rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0) 100%);
  color: #fff;
}

.s58d-carousel-caption h2 {
  font-size: 1.7rem;
  margin: 0 0 0.3rem;
  color: #fff;
}

.s58d-carousel-dots {
  position: absolute;
  bottom: 0.7rem;
  right: 1rem;
  display: flex;
  gap: 0.4rem;
}

.s58d-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
}

.s58d-carousel-dot.s58d-active { background: var(--s58d-primary); }

/* ============ Section base ============ */
.s58d-section {
  margin: 1.8rem 0;
  padding: 1.4rem;
  background: var(--s58d-bg-soft);
  border-radius: var(--s58d-radius);
  border: 1px solid var(--s58d-border);
}

.s58d-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  color: var(--s58d-primary);
}

.s58d-section-title .material-icons,
.s58d-section-title i {
  color: var(--s58d-primary);
  font-size: 2rem;
}

.s58d-lead {
  color: var(--s58d-text-dim);
  font-size: 1.4rem;
}

.s58d-muted { color: var(--s58d-text-dim); }

/* ============ Game grid ============ */
.s58d-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.6rem 0 0.8rem;
  padding: 0 0.4rem;
}

.s58d-cat-head h2 {
  font-size: 1.7rem;
  margin: 0;
}

.s58d-cat-head .s58d-cat-link {
  font-size: 1.25rem;
  color: var(--s58d-primary);
  font-weight: 700;
}

.s58d-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.s58d-game-card {
  background: var(--s58d-bg-elevated);
  border-radius: var(--s58d-radius-sm);
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--s58d-border);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.s58d-game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--s58d-shadow);
}

.s58d-game-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.s58d-game-card .s58d-game-name {
  display: block;
  font-size: 1.15rem;
  color: var(--s58d-light);
  padding: 0.4rem 0.3rem 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ Feature / step list ============ */
.s58d-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.s58d-feature {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: var(--s58d-bg-elevated);
  border-radius: var(--s58d-radius-sm);
  padding: 0.9rem;
  border: 1px solid var(--s58d-border);
}

.s58d-feature .material-icons,
.s58d-feature i {
  font-size: 2.2rem;
  color: var(--s58d-primary);
  flex-shrink: 0;
}

.s58d-feature h3 {
  font-size: 1.4rem;
  margin: 0 0 0.2rem;
}

.s58d-feature p {
  font-size: 1.3rem;
  color: var(--s58d-text-dim);
  margin: 0;
}

/* ============ Steps ============ */
.s58d-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.s58d-steps li {
  position: relative;
  padding: 0.7rem 0.7rem 0.7rem 3.2rem;
  margin-bottom: 0.6rem;
  background: var(--s58d-bg-elevated);
  border-radius: var(--s58d-radius-sm);
  border: 1px solid var(--s58d-border);
  counter-increment: step;
}

.s58d-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--s58d-primary);
  color: #2D2D2D;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ============ FAQ accordion ============ */
.s58d-faq-item {
  background: var(--s58d-bg-elevated);
  border: 1px solid var(--s58d-border);
  border-radius: var(--s58d-radius-sm);
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.s58d-faq-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--s58d-text);
  font-size: 1.35rem;
}

.s58d-faq-head .s58d-faq-icon {
  transition: transform 0.25s ease;
  color: var(--s58d-primary);
}

.s58d-faq-item.s58d-active .s58d-faq-head .s58d-faq-icon {
  transform: rotate(45deg);
}

.s58d-faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
  color: var(--s58d-text-dim);
  font-size: 1.3rem;
}

.s58d-faq-item.s58d-active .s58d-faq-body {
  max-height: 320px;
  padding: 0 1rem 0.9rem;
}

/* ============ Testimonial / winner / payment grids ============ */
.s58d-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.s58d-tile {
  background: var(--s58d-bg-elevated);
  border: 1px solid var(--s58d-border);
  border-radius: var(--s58d-radius-sm);
  padding: 0.8rem;
  font-size: 1.25rem;
}

.s58d-tile strong { color: var(--s58d-primary); }

.s58d-winners li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--s58d-border);
  font-size: 1.3rem;
}

.s58d-winners li:last-child { border-bottom: none; }

.s58d-pay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  text-align: center;
}

.s58d-pay-grid .s58d-tile {
  padding: 0.7rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.s58d-pay-grid .material-icons,
.s58d-pay-grid i { font-size: 1.9rem; color: var(--s58d-accent-gold); }

/* ============ Promo CTA banner ============ */
.s58d-cta {
  background: linear-gradient(135deg, #DDA0DD 0%, #778899 100%);
  color: #2D2D2D;
  border-radius: var(--s58d-radius);
  padding: 1.4rem;
  text-align: center;
  margin: 1.6rem 0;
}

.s58d-cta h3 { color: #2D2D2D; margin-bottom: 0.4rem; }

.s58d-cta p { color: #3a3a3a; font-size: 1.3rem; margin-bottom: 0.8rem; }

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

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

/* ============ Footer ============ */
.s58d-footer {
  background: #1f1f1f;
  border-top: 1px solid var(--s58d-border);
  padding: 1.6rem 1.4rem 2.4rem;
  margin-top: 1.6rem;
}

.s58d-footer h4 {
  color: var(--s58d-primary);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.s58d-footer p {
  color: var(--s58d-text-dim);
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
}

.s58d-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  margin: 0.5rem 0 1rem;
}

.s58d-footer-links a {
  font-size: 1.2rem;
  color: var(--s58d-light);
  padding: 0.2rem 0;
}

.s58d-footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
}

.s58d-copyright {
  font-size: 1.15rem;
  color: var(--s58d-muted);
  text-align: center;
  border-top: 1px solid var(--s58d-border);
  padding-top: 0.8rem;
  margin-top: 0.6rem;
}

/* ============ Bottom navigation (mobile only) ============ */
.s58d-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #1f1f1f;
  border-top: 1px solid var(--s58d-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}

.s58d-bottom-nav a {
  flex: 1;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--s58d-silver);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

.s58d-bottom-nav a:active { transform: scale(0.92); }

.s58d-bottom-nav a .material-icons,
.s58d-bottom-nav a i,
.s58d-bottom-nav a ion-icon {
  font-size: 22px;
  color: var(--s58d-light);
}

.s58d-bottom-nav a.s58d-nav-current {
  color: var(--s58d-primary);
}

.s58d-bottom-nav a.s58d-nav-current .material-icons,
.s58d-bottom-nav a.s58d-nav-current i,
.s58d-bottom-nav a.s58d-nav-current ion-icon {
  color: var(--s58d-primary);
}

.s58d-nav-badge {
  position: absolute;
  top: 8px;
  right: 28%;
  background: #DDA0DD;
  color: #2D2D2D;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0 0.35rem;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
}

/* ============ Responsive ============ */
@media (min-width: 769px) {
  .s58d-bottom-nav { display: none; }
}

@media (max-width: 768px) {
  main.s58d-main { padding-bottom: 80px; }
}

/* Tiny screens keep readable spacing */
@media (max-width: 360px) {
  .s58d-grid { grid-template-columns: repeat(2, 1fr); }
  .s58d-pay-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 1.9rem; }
}
