/**
 * PTT Gaming - Theme Stylesheet
 * Color palette: #BDB76B (Khaki Gold) | #DEB887 (Burlywood) | #212F3D (Dark Blue-Gray)
 * Dark background (#212F3D), light text (#DEB887, #BDB76B)
 * All classes prefixed with s477- for namespace isolation
 * Mobile-first: max-width 430px optimized
 */

/* === CSS Variables === */
:root {
  --s477-primary: #BDB76B;
  --s477-secondary: #DEB887;
  --s477-bg: #212F3D;
  --s477-bg-light: #2C3E50;
  --s477-bg-dark: #1A252F;
  --s477-text: #F5F0E1;
  --s477-text-muted: #B0A890;
  --s477-accent: #D4AC0D;
  --s477-danger: #E74C3C;
  --s477-success: #27AE60;
  --s477-border: rgba(189, 183, 107, 0.2);
  --s477-radius: 8px;
  --s477-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 62.5%; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--s477-bg);
  color: var(--s477-text);
  line-height: 1.5rem;
  font-size: 1.4rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--s477-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--s477-accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* === Container === */
.s477-container { max-width: 430px; margin: 0 auto; padding: 0 1.2rem; width: 100%; }

/* === Header === */
.s477-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--s477-bg-dark);
  border-bottom: 1px solid var(--s477-border);
  height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  transition: box-shadow 0.3s;
}
.s477-header-scrolled { box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5); }
.s477-header-left { display: flex; align-items: center; gap: 0.6rem; }
.s477-header-logo { width: 28px; height: 28px; border-radius: 4px; }
.s477-header-brand { font-size: 1.5rem; font-weight: 700; color: var(--s477-primary); white-space: nowrap; }
.s477-header-right { display: flex; align-items: center; gap: 0.5rem; }
.s477-header-btn {
  padding: 0.5rem 1rem; border-radius: 6px; font-size: 1.2rem; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s;
}
.s477-btn-register { background: var(--s477-primary); color: var(--s477-bg-dark); }
.s477-btn-register:hover { background: var(--s477-accent); }
.s477-btn-login { background: transparent; color: var(--s477-primary); border: 1px solid var(--s477-primary); }
.s477-btn-login:hover { background: rgba(189, 183, 107, 0.1); }
.s477-menu-toggle {
  background: none; border: none; color: var(--s477-primary);
  font-size: 2rem; cursor: pointer; padding: 0.4rem; line-height: 1;
}

/* === Mobile Menu === */
.s477-menu-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6); z-index: 9998;
}
.s477-mobile-menu {
  position: fixed; top: 0; left: 0; width: 260px; height: 100vh;
  background: var(--s477-bg-dark); z-index: 9999;
  transform: translateX(-100%); transition: transform 0.3s ease;
  padding: 2rem 1.5rem; overflow-y: auto;
}
.s477-mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.s477-mobile-menu-close { background: none; border: none; color: var(--s477-text-muted); font-size: 2.4rem; cursor: pointer; line-height: 1; }
.s477-mobile-menu-links a {
  display: block; padding: 1rem 0; color: var(--s477-text);
  border-bottom: 1px solid var(--s477-border); font-size: 1.4rem; transition: color 0.2s;
}
.s477-mobile-menu-links a:hover { color: var(--s477-primary); }

/* === Main Content === */
.s477-main { padding-top: 54px; }
@media (max-width: 768px) {
  .s477-main { padding-bottom: 72px; }
}

/* === Carousel === */
.s477-carousel { position: relative; width: 100%; height: 200px; overflow: hidden; }
.s477-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.8s ease; cursor: pointer;
}
.s477-slide:first-child { opacity: 1; }
.s477-slide img { width: 100%; height: 100%; object-fit: cover; }

/* === Section === */
.s477-section { padding: 2rem 0; }
.s477-section-title {
  font-size: 1.8rem; font-weight: 700; color: var(--s477-primary);
  margin-bottom: 1.2rem; padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--s477-border);
}
.s477-section-subtitle {
  font-size: 1.4rem; color: var(--s477-secondary); margin-bottom: 1rem;
}

/* === Game Grid === */
.s477-game-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}
.s477-game-card {
  background: var(--s477-bg-light); border-radius: var(--s477-radius);
  overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--s477-border);
}
.s477-game-card:hover { transform: translateY(-2px); box-shadow: var(--s477-shadow); }
.s477-game-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.s477-game-card-name {
  font-size: 1.1rem; text-align: center; padding: 0.4rem 0.2rem;
  color: var(--s477-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* === Category Header === */
.s477-cat-header {
  font-size: 1.5rem; font-weight: 600; color: var(--s477-secondary);
  margin: 1.6rem 0 0.8rem; padding-left: 0.4rem;
  border-left: 3px solid var(--s477-primary);
}

/* === Buttons === */
.s477-btn {
  display: inline-block; padding: 1rem 2rem; border-radius: var(--s477-radius);
  font-size: 1.4rem; font-weight: 600; cursor: pointer; border: none;
  transition: all 0.2s; text-align: center;
}
.s477-btn-primary { background: var(--s477-primary); color: var(--s477-bg-dark); }
.s477-btn-primary:hover { background: var(--s477-accent); transform: scale(1.02); }
.s477-btn-outline { background: transparent; color: var(--s477-primary); border: 2px solid var(--s477-primary); }
.s477-btn-outline:hover { background: rgba(189, 183, 107, 0.1); }
.s477-btn-block { display: block; width: 100%; }

/* === Cards === */
.s477-card {
  background: var(--s477-bg-light); border-radius: var(--s477-radius);
  padding: 1.4rem; border: 1px solid var(--s477-border);
  margin-bottom: 1.2rem;
}

/* === Promo Text Link === */
.s477-promo-link {
  color: var(--s477-primary); font-weight: 600; cursor: pointer;
  border-bottom: 1px dashed var(--s477-primary); transition: color 0.2s;
}
.s477-promo-link:hover { color: var(--s477-accent); }

/* === Winner Badge === */
.s477-winner {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem; background: var(--s477-bg-light);
  border-radius: var(--s477-radius); margin-bottom: 0.6rem;
  border-left: 3px solid var(--s477-primary);
}
.s477-winner-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--s477-bg-dark); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.s477-winner-info { flex: 1; }
.s477-winner-name { font-size: 1.2rem; font-weight: 600; color: var(--s477-secondary); }
.s477-winner-amount { font-size: 1.1rem; color: var(--s477-primary); font-weight: 700; }
.s477-winner-game { font-size: 1rem; color: var(--s477-text-muted); }

/* === Testimonial === */
.s477-testimonial {
  background: var(--s477-bg-light); border-radius: var(--s477-radius);
  padding: 1.2rem; margin-bottom: 1rem; border: 1px solid var(--s477-border);
}
.s477-testimonial-text { font-size: 1.3rem; color: var(--s477-text); font-style: italic; margin-bottom: 0.6rem; }
.s477-testimonial-author { font-size: 1.1rem; color: var(--s477-primary); font-weight: 600; }

/* === Payment Methods === */
.s477-payment-grid { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.s477-payment-item {
  background: var(--s477-bg-light); border: 1px solid var(--s477-border);
  border-radius: var(--s477-radius); padding: 0.8rem 1.2rem;
  font-size: 1.2rem; color: var(--s477-text); text-align: center;
}

/* === Content Typography === */
.s477-content p { margin-bottom: 1rem; line-height: 1.6; color: var(--s477-text); }
.s477-content h2 { font-size: 1.7rem; color: var(--s477-primary); margin: 1.8rem 0 0.8rem; }
.s477-content h3 { font-size: 1.5rem; color: var(--s477-secondary); margin: 1.4rem 0 0.6rem; }
.s477-content ul { padding-left: 1.6rem; margin-bottom: 1rem; }
.s477-content li { margin-bottom: 0.4rem; list-style: disc; color: var(--s477-text); }

/* === Footer === */
.s477-footer {
  background: var(--s477-bg-dark); padding: 2rem 0 1rem;
  border-top: 1px solid var(--s477-border);
}
.s477-footer-brand { text-align: center; margin-bottom: 1.5rem; }
.s477-footer-brand p { font-size: 1.2rem; color: var(--s477-text-muted); line-height: 1.6; }
.s477-footer-links { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 1.5rem; }
.s477-footer-link {
  padding: 0.5rem 1rem; background: var(--s477-bg-light); border-radius: 6px;
  font-size: 1.1rem; color: var(--s477-primary); border: 1px solid var(--s477-border);
  transition: all 0.2s; cursor: pointer;
}
.s477-footer-link:hover { background: var(--s477-primary); color: var(--s477-bg-dark); }
.s477-footer-copy { text-align: center; font-size: 1.1rem; color: var(--s477-text-muted); padding-top: 1rem; border-top: 1px solid var(--s477-border); }

/* === Bottom Navigation === */
.s477-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: var(--s477-bg-dark);
  border-top: 1px solid var(--s477-border);
  height: 60px;
  display: flex; justify-content: space-around; align-items: center;
  padding: 0 0.4rem;
}
.s477-bottom-nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 58px; min-height: 54px; background: none; border: none;
  color: var(--s477-text-muted); cursor: pointer; transition: all 0.2s;
  padding: 0.3rem;
}
.s477-bottom-nav-btn:hover, .s477-bottom-nav-btn.s477-active { color: var(--s477-primary); }
.s477-bottom-nav-btn:active { transform: scale(0.92); }
.s477-bottom-nav-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 0.1rem; }
.s477-bottom-nav-label { font-size: 1rem; line-height: 1.2; }

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
  .s477-bottom-nav { display: none; }
}

/* === Responsive === */
@media (min-width: 769px) {
  .s477-container { max-width: 430px; }
  .s477-menu-toggle { display: none; }
}

/* === Utility Classes === */
.s477-text-center { text-align: center; }
.s477-text-gold { color: var(--s477-primary); }
.s477-text-muted { color: var(--s477-text-muted); }
.s477-mb-1 { margin-bottom: 0.8rem; }
.s477-mb-2 { margin-bottom: 1.6rem; }
.s477-mt-1 { margin-top: 0.8rem; }
.s477-mt-2 { margin-top: 1.6rem; }

/* === FAQ Accordion === */
.s477-faq-item { border-bottom: 1px solid var(--s477-border); }
.s477-faq-q {
  padding: 1rem 0; font-weight: 600; color: var(--s477-secondary);
  font-size: 1.3rem; cursor: default;
}
.s477-faq-a { padding: 0 0 1rem; color: var(--s477-text); font-size: 1.2rem; line-height: 1.6; }

/* === CTA Banner === */
.s477-cta-banner {
  background: linear-gradient(135deg, var(--s477-bg-light), var(--s477-bg-dark));
  border: 1px solid var(--s477-primary); border-radius: var(--s477-radius);
  padding: 1.6rem; text-align: center; margin: 1.6rem 0;
}
.s477-cta-banner h3 { color: var(--s477-primary); font-size: 1.6rem; margin-bottom: 0.6rem; }
.s477-cta-banner p { color: var(--s477-text); font-size: 1.2rem; margin-bottom: 1rem; }

/* === App Download === */
.s477-app-download {
  background: var(--s477-bg-light); border-radius: var(--s477-radius);
  padding: 1.4rem; text-align: center; border: 1px solid var(--s477-border);
}
.s477-app-download h3 { color: var(--s477-primary); margin-bottom: 0.8rem; font-size: 1.5rem; }

/* === Highlight Box === */
.s477-highlight {
  background: linear-gradient(135deg, rgba(189, 183, 107, 0.1), rgba(222, 184, 135, 0.05));
  border-left: 3px solid var(--s477-primary); padding: 1rem 1.2rem;
  border-radius: 0 var(--s477-radius) var(--s477-radius) 0;
  margin-bottom: 1rem;
}
.s477-highlight strong { color: var(--s477-primary); }
