/**
 * 30jili original login - layout.css
 * All custom classes use the "s847-" prefix.
 * Palette: #FFEF94 | #F0E68C | #FFF8DC | #2D2D2D | #FAF0E6
 */

:root {
  --s847-primary: #FFEF94;
  --s847-accent: #F0E68C;
  --s847-cream: #FFF8DC;
  --s847-bg: #2D2D2D;
  --s847-bg-alt: #232323;
  --s847-text: #FAF0E6;
  --s847-muted: #B8A98E;
  --s847-border: rgba(255, 239, 148, 0.18);
  --s847-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  --s847-radius: 14px;
  --s847-header-h: 56px;
  --s847-bottom-h: 62px;
}

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

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

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

img { max-width: 100%; display: block; }
a { color: var(--s847-primary); text-decoration: none; }
a:hover { color: var(--s847-cream); }
ul, ol { list-style: none; }

.s847-container { width: 100%; padding: 0 12px; }
.s847-wrapper { max-width: 430px; margin: 0 auto; padding: 0 14px; }
.s847-grid { display: grid; gap: 12px; }

/* ===== Header ===== */
.s847-header {
  position: fixed; top: 0; left: 0; right: 0;
  max-width: 430px; margin: 0 auto;
  height: var(--s847-header-h);
  background: linear-gradient(90deg, #1f1f1f 0%, #2D2D2D 100%);
  border-bottom: 1px solid var(--s847-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; z-index: 1000; box-shadow: var(--s847-shadow);
}

.s847-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.s847-brand-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; border: 1px solid var(--s847-primary); }
.s847-brand-name {
  font-size: 1.5rem; font-weight: 700; color: var(--s847-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s847-header-actions { display: flex; align-items: center; gap: 8px; }

.s847-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border: none; border-radius: 20px;
  font-size: 1.3rem; font-weight: 600; cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease;
  text-decoration: none; line-height: 1;
}
.s847-btn:active { transform: scale(.94); }
.s847-btn-register {
  background: linear-gradient(135deg, #FFEF94, #F0E68C);
  color: #2D2D2D; box-shadow: 0 2px 8px rgba(255, 239, 148, 0.35);
}
.s847-btn-login { background: transparent; color: var(--s847-primary); border: 1px solid var(--s847-primary); }

.s847-menu-icon {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--s847-primary); font-size: 2rem; cursor: pointer;
}

/* ===== Mobile Menu ===== */
.s847-menu-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 9998;
}
.s847-backdrop-visible { opacity: 1; pointer-events: auto; }

.s847-mobile-menu {
  position: fixed; top: 0; right: -85%;
  width: 78%; max-width: 320px; height: 100%;
  background: #1c1c1c; padding: 16px 14px;
  transition: right .3s ease; z-index: 9999;
  overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
}
.s847-menu-open { right: 0; }

.s847-menu-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--s847-border); margin-bottom: 10px;
}
.s847-menu-title { color: var(--s847-primary); font-size: 1.6rem; font-weight: 700; }
.s847-menu-close { background: transparent; border: none; color: var(--s847-text); font-size: 2.2rem; cursor: pointer; }

.s847-menu-section-label {
  color: var(--s847-accent); font-size: 1.2rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin: 10px 0 4px;
}

.s847-menu-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px;
  color: var(--s847-text); border-radius: 10px; font-size: 1.35rem; transition: background .18s ease;
}
.s847-menu-link:hover { background: rgba(255, 239, 148, 0.08); color: var(--s847-primary); }
.s847-menu-link i { color: var(--s847-accent); font-size: 1.7rem; width: 22px; text-align: center; }

/* ===== Main ===== */
.s847-main { padding-top: calc(var(--s847-header-h) + 6px); padding-bottom: 80px; }

/* ===== Carousel ===== */
.s847-carousel {
  position: relative; width: 100%; margin: 8px 0 6px;
  border-radius: var(--s847-radius); overflow: hidden; box-shadow: var(--s847-shadow);
}
.s847-carousel-track { position: relative; width: 100%; height: 180px; }
.s847-carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; cursor: pointer; }
.s847-carousel-slide img { width: 100%; height: 180px; object-fit: cover; }
.s847-slide-active { opacity: 1; }

.s847-carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.45); color: var(--s847-primary); border: none;
  font-size: 1.6rem; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2;
}
.s847-carousel-arrow.s847-prev { left: 6px; }
.s847-carousel-arrow.s847-next { right: 6px; }

.s847-carousel-dots {
  position: absolute; bottom: 8px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px; z-index: 2;
}
.s847-carousel-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 248, 220, 0.4); cursor: pointer; border: none; }
.s847-dot-active { background: var(--s847-primary); }

/* ===== Headings & Text ===== */
.s847-h1 { font-size: 2rem; font-weight: 800; color: var(--s847-primary); margin: 14px 0 8px; line-height: 1.35; }
.s847-h2 {
  font-size: 1.7rem; font-weight: 700; color: var(--s847-cream);
  margin: 16px 0 8px; padding-left: 10px; border-left: 4px solid var(--s847-primary);
}
.s847-h3 { font-size: 1.45rem; font-weight: 700; color: var(--s847-accent); margin: 12px 0 6px; }
.s847-text-muted { color: var(--s847-muted); }
.s847-lead { font-size: 1.4rem; color: var(--s847-text); margin-bottom: 10px; }
.s847-para { margin-bottom: 10px; color: var(--s847-text); }

/* ===== Game grid ===== */
.s847-section { padding: 12px 0; }
.s847-game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.s847-game-card {
  background: var(--s847-bg-alt); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--s847-border); cursor: pointer;
  transition: transform .18s ease, border-color .18s ease; display: block; text-align: center;
}
.s847-game-card:hover { transform: translateY(-3px); border-color: var(--s847-primary); }
.s847-game-card:active { transform: scale(.96); }
.s847-game-card img { width: 100%; height: 84px; object-fit: cover; }
.s847-game-name { font-size: 1.1rem; color: var(--s847-text); padding: 5px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.s847-cat-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.s847-cat-head i { color: var(--s847-primary); font-size: 1.9rem; }

/* ===== Cards / Features ===== */
.s847-card {
  background: var(--s847-bg-alt); border: 1px solid var(--s847-border);
  border-radius: var(--s847-radius); padding: 14px; margin-bottom: 12px;
}
.s847-card-icon-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.s847-card-icon-row i { color: var(--s847-accent); font-size: 2.2rem; }

.s847-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.s847-feature-item {
  background: rgba(255, 239, 148, 0.05); border: 1px solid var(--s847-border);
  border-radius: 10px; padding: 12px 10px; text-align: center;
}
.s847-feature-item i { color: var(--s847-primary); font-size: 2.4rem; margin-bottom: 6px; display: block; }
.s847-feature-item strong { color: var(--s847-cream); display: block; font-size: 1.25rem; margin-bottom: 4px; }
.s847-feature-item span { color: var(--s847-muted); font-size: 1.15rem; }

/* ===== Testimonials / Chips / Winners ===== */
.s847-testimonial {
  background: var(--s847-bg-alt); border-left: 3px solid var(--s847-primary);
  border-radius: 10px; padding: 12px; margin-bottom: 10px;
}
.s847-testimonial p { color: var(--s847-text); font-style: italic; margin-bottom: 6px; }
.s847-testimonial cite { color: var(--s847-accent); font-size: 1.2rem; font-style: normal; }

.s847-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.s847-chip {
  background: rgba(255, 239, 148, 0.07); border: 1px solid var(--s847-border);
  border-radius: 18px; padding: 6px 12px; color: var(--s847-text); font-size: 1.2rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.s847-chip i { color: var(--s847-primary); }

.s847-winners {
  background: linear-gradient(135deg, #1f1f1f, #2D2D2D);
  border: 1px solid var(--s847-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.s847-winner-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px dashed rgba(255, 239, 148, 0.12); font-size: 1.25rem;
}
.s847-winner-row:last-child { border-bottom: none; }
.s847-winner-name { color: var(--s847-text); }
.s847-winner-amount { color: var(--s847-primary); font-weight: 700; }

/* ===== FAQ ===== */
.s847-faq-item {
  background: var(--s847-bg-alt); border: 1px solid var(--s847-border);
  border-radius: 10px; padding: 12px; margin-bottom: 8px;
}
.s847-faq-q { color: var(--s847-primary); font-weight: 700; font-size: 1.3rem; margin-bottom: 6px; }
.s847-faq-a { color: var(--s847-text); font-size: 1.25rem; }

/* ===== CTA & Links ===== */
.s847-cta {
  background: linear-gradient(135deg, #FFEF94, #F0E68C); color: #2D2D2D;
  border-radius: var(--s847-radius); padding: 14px; text-align: center;
  margin: 12px 0; box-shadow: var(--s847-shadow);
}
.s847-cta h3 { color: #2D2D2D; margin-bottom: 6px; }
.s847-cta p { color: #3a3a3a; margin-bottom: 10px; font-size: 1.25rem; }
.s847-cta .s847-btn { background: #2D2D2D; color: var(--s847-primary); }

.s847-text-link { color: var(--s847-accent); text-decoration: underline; text-underline-offset: 2px; }
.s847-text-link:hover { color: var(--s847-primary); }

/* ===== Footer ===== */
.s847-footer {
  background: #1c1c1c; border-top: 1px solid var(--s847-border);
  padding: 16px 14px calc(var(--s847-bottom-h) + 14px); margin-top: 10px;
}
.s847-footer-brand { color: var(--s847-text); font-size: 1.3rem; margin-bottom: 12px; }
.s847-footer-promo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.s847-footer-promo .s847-btn {
  background: rgba(255, 239, 148, 0.1); color: var(--s847-primary);
  border: 1px solid var(--s847-border); font-size: 1.2rem; padding: 0 8px; min-height: 34px;
}
.s847-footer-links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0; }
.s847-footer-links a { color: var(--s847-muted); font-size: 1.2rem; }
.s847-footer-links a:hover { color: var(--s847-primary); }
.s847-footer-copy { color: var(--s847-muted); font-size: 1.15rem; margin-top: 8px; text-align: center; }

/* ===== Bottom Nav ===== */
.s847-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 430px; margin: 0 auto; height: var(--s847-bottom-h);
  background: linear-gradient(180deg, #1f1f1f, #161616);
  border-top: 1px solid var(--s847-border);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 1000; box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.4);
}
.s847-bottom-nav-btn {
  flex: 1; min-width: 60px; min-height: var(--s847-bottom-h);
  background: transparent; border: none; color: var(--s847-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; font-size: 1rem; padding: 4px 2px;
  transition: color .18s ease, transform .18s ease; text-decoration: none;
}
.s847-bottom-nav-btn i { font-size: 2rem; }
.s847-bottom-nav-btn:active { transform: scale(.9); }
.s847-bottom-nav-btn:hover, .s847-nav-current { color: var(--s847-primary); }
.s847-nav-current i { transform: translateY(-1px); }

/* ===== Reveal ===== */
.s847-reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.s847-revealed { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (min-width: 431px) { body { border-left: 1px solid #111; border-right: 1px solid #111; } }
@media (min-width: 769px) {
  .s847-bottom-nav { display: none; }
  .s847-footer { padding-bottom: 16px; }
  .s847-main { padding-bottom: 20px; }
  body { font-size: 1.5rem; }
}
@media (max-width: 360px) {
  .s847-game-grid { grid-template-columns: repeat(2, 1fr); }
  .s847-brand-name { font-size: 1.3rem; }
  .s847-btn { padding: 0 10px; font-size: 1.2rem; }
}
