/* ===========================================================
 * ph-78 basefile stylesheet
 * All class names use the "v58d-" prefix.
 * Palette: #CC99FF | #F0F0F0 | #DDA0DD | #333333 | #8470FF | #F5DEB3
 * =========================================================== */

:root {
  --v58d-primary: #8470FF;
  --v58d-primary-soft: #CC99FF;
  --v58d-accent: #DDA0DD;
  --v58d-bg: #333333;
  --v58d-bg-dark: #2a2a2a;
  --v58d-bg-card: #3d3d3d;
  --v58d-text: #F0F0F0;
  --v58d-text-muted: #F5DEB3;
  --v58d-white: #ffffff;
  --v58d-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.35);
  --v58d-radius: 1rem;
  --v58d-radius-sm: 0.6rem;
  --v58d-header-h: 6rem;
  --v58d-nav-h: 6.4rem;
}

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

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

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--v58d-bg);
  color: var(--v58d-text);
  line-height: 1.5;
  font-size: 1.5rem;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

/* ---------- Layout ---------- */
.v58d-container { width: 100%; max-width: 430px; margin: 0 auto; padding: 0 1.2rem; }
.v58d-wrapper { padding: 1rem 1.2rem; }
.v58d-section { padding: 2.4rem 1.2rem; }
.v58d-section-alt { background: var(--v58d-bg-dark); }

.v58d-h1 {
  font-size: 2.4rem;
  line-height: 1.25;
  color: var(--v58d-white);
  margin-bottom: 1rem;
  font-weight: 800;
}
.v58d-h2 {
  font-size: 2rem;
  color: var(--v58d-primary-soft);
  margin: 1.6rem 0 1rem;
  font-weight: 700;
}
.v58d-h3 {
  font-size: 1.7rem;
  color: var(--v58d-text-muted);
  margin: 1.2rem 0 0.8rem;
  font-weight: 700;
}
.v58d-lead { font-size: 1.5rem; color: var(--v58d-text); margin-bottom: 1rem; }
.v58d-muted { color: var(--v58d-text-muted); }
.v58d-p { margin-bottom: 1rem; }

/* ---------- Header ---------- */
.v58d-header {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  z-index: 1000;
  background: linear-gradient(135deg, var(--v58d-primary) 0%, #6b58e0 100%);
  box-shadow: var(--v58d-shadow);
  transition: padding 0.2s ease;
  padding: 0.8rem 1rem;
}
.v58d-header.v58d-header-compact { padding: 0.5rem 1rem; }
.v58d-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem;
}
.v58d-brand {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--v58d-white);
  font-weight: 800;
  font-size: 1.7rem;
}
.v58d-brand img { width: 2.8rem; height: 2.8rem; border-radius: 0.5rem; }
.v58d-header-actions { display: flex; align-items: center; gap: 0.5rem; }

.v58d-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  border: none; cursor: pointer;
  font-weight: 700;
  font-size: 1.3rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 3.6rem;
  text-decoration: none;
  line-height: 1;
}
.v58d-btn:active { transform: scale(0.96); }
.v58d-btn-register {
  background: linear-gradient(135deg, #F5DEB3 0%, #DDA0DD 100%);
  color: #333;
  box-shadow: 0 0.3rem 0.8rem rgba(0,0,0,0.25);
}
.v58d-btn-login {
  background: transparent;
  color: var(--v58d-white);
  border: 0.15rem solid rgba(255,255,255,0.7);
}
.v58d-btn-block { width: 100%; padding: 1rem; font-size: 1.5rem; }
.v58d-btn-promo {
  background: linear-gradient(135deg, var(--v58d-primary-soft) 0%, var(--v58d-accent) 100%);
  color: #333;
}

.v58d-menu-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--v58d-white);
  width: 3.6rem; height: 3.6rem;
  border-radius: 0.8rem;
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

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

.v58d-mobile-menu {
  position: fixed;
  top: 0; right: -80%;
  width: 78%; max-width: 320px;
  height: 100vh;
  background: var(--v58d-bg-dark);
  z-index: 9999;
  padding: 2.5rem 1.6rem;
  transition: right 0.3s ease;
  overflow-y: auto;
}
.v58d-mobile-menu.v58d-menu-open { right: 0; }
.v58d-mobile-menu h3 {
  color: var(--v58d-primary-soft);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.v58d-mobile-menu a {
  display: block;
  padding: 1rem 0.4rem;
  color: var(--v58d-text);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 1.45rem;
}
.v58d-mobile-menu a:hover { color: var(--v58d-primary-soft); }
.v58d-menu-close {
  background: transparent; border: none; color: var(--v58d-white);
  font-size: 2rem; position: absolute; top: 1rem; right: 1.2rem;
  cursor: pointer;
}

/* ---------- Main ---------- */
.v58d-main { padding-top: var(--v58d-header-h); }

/* ---------- Hero carousel ---------- */
.v58d-hero { position: relative; margin: 1rem 0; }
.v58d-slides { position: relative; border-radius: var(--v58d-radius); overflow: hidden; box-shadow: var(--v58d-shadow); }
.v58d-slide {
  display: none;
  position: relative;
  cursor: pointer;
}
.v58d-slide.v58d-slide-active { display: block; }
.v58d-slide img { width: 100%; height: 18rem; object-fit: cover; }
.v58d-slide-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1rem 1.2rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: var(--v58d-white);
  font-weight: 700;
}
.v58d-dots {
  display: flex; justify-content: center; gap: 0.5rem;
  margin-top: 0.6rem;
}
.v58d-dot {
  width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: rgba(255,255,255,0.4); cursor: pointer;
  border: none;
}
.v58d-dot.v58d-dot-active { background: var(--v58d-primary-soft); }

/* ---------- Game grid ---------- */
.v58d-cat-title {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 1.8rem 0 1rem;
  color: var(--v58d-primary-soft);
  font-size: 1.7rem; font-weight: 800;
}
.v58d-cat-title i { font-size: 2rem; }
.v58d-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.v58d-card {
  background: var(--v58d-bg-card);
  border-radius: var(--v58d-radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid rgba(204,153,255,0.08);
}
.v58d-card:active { transform: scale(0.96); }
.v58d-card img {
  width: 100%; height: 8.5rem; object-fit: cover;
  background: #222;
}
.v58d-card-name {
  padding: 0.5rem 0.4rem;
  font-size: 1.15rem;
  text-align: center;
  color: var(--v58d-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Content / SEO blocks ---------- */
.v58d-content p { margin-bottom: 1rem; }
.v58d-content strong { color: var(--v58d-primary-soft); }
.v58d-faq-item {
  background: var(--v58d-bg-card);
  border-radius: var(--v58d-radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
}
.v58d-faq-q { font-weight: 700; color: var(--v58d-text-muted); margin-bottom: 0.4rem; }
.v58d-faq-a { color: var(--v58d-text); font-size: 1.35rem; }

.v58d-features {
  display: grid; grid-template-columns: 1fr; gap: 0.8rem;
}
.v58d-feature {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--v58d-bg-card);
  padding: 1rem; border-radius: var(--v58d-radius-sm);
}
.v58d-feature i { color: var(--v58d-primary-soft); font-size: 2.2rem; }
.v58d-feature h4 { font-size: 1.4rem; color: var(--v58d-white); margin-bottom: 0.3rem; }
.v58d-feature p { font-size: 1.3rem; color: var(--v58d-text); }

/* ---------- Promo CTA ---------- */
.v58d-cta {
  background: linear-gradient(135deg, var(--v58d-primary) 0%, var(--v58d-accent) 100%);
  border-radius: var(--v58d-radius);
  padding: 1.6rem;
  text-align: center;
  color: var(--v58d-white);
  margin: 1.5rem 0;
  box-shadow: var(--v58d-shadow);
}
.v58d-cta h3 { color: var(--v58d-white); }
.v58d-cta a { color: #333; font-weight: 800; }
.v58d-link-text {
  color: var(--v58d-primary-soft);
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.v58d-footer {
  background: var(--v58d-bg-dark);
  padding: 2rem 1.2rem;
  color: var(--v58d-text);
}
.v58d-footer-brand { margin-bottom: 1rem; font-size: 1.35rem; }
.v58d-footer-links {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1rem;
  margin: 1rem 0;
}
.v58d-footer-links a {
  color: var(--v58d-text-muted);
  font-size: 1.25rem;
}
.v58d-footer-links a:hover { color: var(--v58d-primary-soft); }
.v58d-footer-copy {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 1rem; padding-top: 1rem;
  font-size: 1.2rem; color: var(--v58d-text-muted);
}

/* ---------- Mobile bottom nav ---------- */
.v58d-bottomnav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: var(--v58d-nav-h);
  background: var(--v58d-bg-dark);
  border-top: 1px solid rgba(204,153,255,0.18);
  display: flex; justify-content: space-around; align-items: stretch;
  z-index: 1000;
  box-shadow: 0 -0.3rem 1rem rgba(0,0,0,0.4);
}
.v58d-nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.2rem;
  color: var(--v58d-text-muted);
  font-size: 1.1rem;
  text-decoration: none;
  background: transparent; border: none; cursor: pointer;
  padding: 0.4rem 0.2rem;
  transition: color 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.v58d-nav-item i, .v58d-nav-item span.icon { font-size: 2.2rem; line-height: 1; }
.v58d-nav-item .material-icons-outlined,
.v58d-nav-item .material-icons { font-size: 2.2rem; }
.v58d-nav-item:active { transform: scale(0.92); }
.v58d-nav-item.v58d-nav-active { color: var(--v58d-primary-soft); }
.v58d-nav-item.v58d-nav-promo { color: var(--v58d-accent); }

/* ---------- Responsive ---------- */
@media (min-width: 769px) {
  .v58d-bottomnav { display: none; }
}

@media (max-width: 768px) {
  .v58d-main { padding-bottom: calc(var(--v58d-nav-h) + 1rem); }
  .v58d-footer { padding-bottom: calc(var(--v58d-nav-h) + 1.5rem); }
}
