/* ============================================================
 * ninong game - layout.css
 * All custom classes use the "g888-" prefix.
 * Palette: #2C2C2C (dark) | #FF7F50 (coral) | #FFBF00 (gold)
 * Mobile-first, max-width 430px viewport optimised.
 * ============================================================ */

:root {
  --g888-bg: #2C2C2C;
  --g888-bg-soft: #3a3a3a;
  --g888-bg-deep: #1f1f1f;
  --g888-primary: #FF7F50;
  --g888-gold: #FFBF00;
  --g888-text: #ffffff;
  --g888-text-soft: #d8d8d8;
  --g888-text-mute: #9a9a9a;
  --g888-line: rgba(255, 255, 255, 0.08);
  --g888-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

* { 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", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--g888-bg);
  color: var(--g888-text);
  line-height: 1.5rem;
  font-size: 1.4rem;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
}

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

a { color: var(--g888-gold); text-decoration: none; }
a:hover { color: var(--g888-primary); }

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

.g888-wrapper { padding: 1rem 1.2rem; }

/* ---------- Header ---------- */
.g888-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  max-width: 430px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--g888-bg-deep), var(--g888-bg));
  border-bottom: 2px solid var(--g888-primary);
  z-index: 1000;
  box-shadow: var(--g888-shadow);
}

.g888-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  gap: 0.6rem;
}

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

.g888-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--g888-primary), var(--g888-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.g888-brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--g888-gold);
  white-space: nowrap;
}

.g888-brand-name span { color: var(--g888-primary); }

.g888-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.g888-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  min-height: 38px;
  text-decoration: none;
}

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

.g888-btn-register {
  background: linear-gradient(135deg, var(--g888-primary), #ff5e2c);
  color: #fff;
  box-shadow: 0 4px 10px rgba(255, 127, 80, 0.4);
}

.g888-btn-login {
  background: linear-gradient(135deg, var(--g888-gold), #ff9d00);
  color: #2C2C2C;
}

.g888-btn-block {
  display: flex;
  width: 100%;
  margin: 0.6rem 0;
}

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

/* ---------- Mobile menu ---------- */
.g888-mobile-menu {
  display: none;
  background: var(--g888-bg-deep);
  border-bottom: 1px solid var(--g888-line);
  padding: 0.5rem 1rem 0.8rem;
}

.g888-menu-open { display: block; }

.g888-mobile-menu a {
  display: block;
  padding: 0.8rem 0.4rem;
  color: var(--g888-text-soft);
  border-bottom: 1px solid var(--g888-line);
  font-size: 1.35rem;
}
.g888-mobile-menu a:last-child { border-bottom: none; }
.g888-mobile-menu a i { color: var(--g888-primary); margin-right: 0.6rem; }

/* ---------- Hero carousel ---------- */
main { padding-top: 64px; padding-bottom: 0; }

.g888-hero {
  position: relative;
  margin: 0.8rem 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--g888-shadow);
}

.g888-slide {
  display: none;
  position: relative;
  cursor: pointer;
}
.g888-slide-active { display: block; }

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

.g888-slide-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  padding: 1rem;
  color: #fff;
}

.g888-slide-overlay h2 {
  font-size: 1.7rem;
  color: var(--g888-gold);
  margin-bottom: 0.3rem;
}
.g888-slide-overlay p { font-size: 1.2rem; color: var(--g888-text-soft); }

.g888-dots {
  position: absolute;
  bottom: 8px;
  right: 12px;
  display: flex;
  gap: 5px;
}

.g888-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.g888-dot-active { background: var(--g888-gold); }

/* ---------- Section titles ---------- */
.g888-section {
  margin: 1.6rem 0;
}

.g888-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--g888-gold);
  margin-bottom: 0.9rem;
  padding-left: 0.6rem;
  border-left: 4px solid var(--g888-primary);
}

.g888-section-title i { color: var(--g888-primary); }

.g888-intro {
  color: var(--g888-text-soft);
  font-size: 1.32rem;
  margin-bottom: 1rem;
  background: var(--g888-bg-soft);
  padding: 1rem;
  border-radius: 10px;
}

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

.g888-card {
  background: var(--g888-bg-soft);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid var(--g888-line);
}

.g888-card:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(255, 127, 80, 0.35);
}

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

.g888-card-name {
  font-size: 1.1rem;
  color: var(--g888-text-soft);
  text-align: center;
  padding: 0.4rem 0.2rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g888-card-badge {
  display: inline-block;
  font-size: 1rem;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: var(--g888-primary);
  color: #fff;
  margin-right: 0.4rem;
}

.g888-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--g888-primary), var(--g888-gold));
  color: #2C2C2C;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin: 1rem 0 0.6rem;
}

/* ---------- Info / feature blocks ---------- */
.g888-info-card {
  background: var(--g888-bg-soft);
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 0.9rem;
  border-left: 3px solid var(--g888-gold);
}

.g888-info-card h3 {
  font-size: 1.45rem;
  color: var(--g888-gold);
  margin-bottom: 0.5rem;
}
.g888-info-card h3 i { color: var(--g888-primary); margin-right: 0.4rem; }

.g888-info-card p {
  color: var(--g888-text-soft);
  font-size: 1.28rem;
  margin-bottom: 0.5rem;
}

.g888-info-card ul {
  list-style: none;
  padding-left: 0;
}
.g888-info-card ul li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--g888-text-soft);
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}
.g888-info-card ul li::before {
  content: "\f005";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--g888-gold);
  position: absolute;
  left: 0;
  font-size: 1rem;
}

/* ---------- Testimonial ---------- */
.g888-testi {
  background: var(--g888-bg-soft);
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 0.7rem;
  border: 1px solid var(--g888-line);
}
.g888-testi-stars { color: var(--g888-gold); font-size: 1.2rem; margin-bottom: 0.3rem; }
.g888-testi p { color: var(--g888-text-soft); font-size: 1.25rem; font-style: italic; }
.g888-testi .g888-testi-author { color: var(--g888-primary); font-size: 1.15rem; margin-top: 0.3rem; font-weight: 700; }

/* ---------- Payment / winners compact ---------- */
.g888-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.4rem 0;
}
.g888-chip {
  background: var(--g888-bg-deep);
  border: 1px solid var(--g888-line);
  color: var(--g888-text-soft);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.g888-chip i { color: var(--g888-gold); }

.g888-winner {
  display: flex;
  justify-content: space-between;
  background: var(--g888-bg-deep);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
  border-left: 3px solid var(--g888-primary);
}
.g888-winner span:last-child { color: var(--g888-gold); font-weight: 700; }

/* ---------- Footer ---------- */
.g888-footer {
  background: var(--g888-bg-deep);
  color: var(--g888-text-mute);
  padding: 1.4rem 1.2rem 2rem;
  margin-top: 1.5rem;
  border-top: 2px solid var(--g888-primary);
}

.g888-footer-about {
  font-size: 1.22rem;
  color: var(--g888-text-soft);
  margin-bottom: 1rem;
  line-height: 1.7rem;
}

.g888-footer-promos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
}
.g888-footer-promos .g888-btn {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 130px;
  padding: 0.6rem 0.8rem;
  font-size: 1.2rem;
}

.g888-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.6rem 0 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--g888-line);
}
.g888-footer-links a {
  color: var(--g888-text-soft);
  font-size: 1.18rem;
  text-decoration: underline;
}

.g888-copyright {
  font-size: 1.1rem;
  color: var(--g888-text-mute);
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--g888-line);
}

/* ---------- Mobile bottom nav ---------- */
.g888-bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 430px;
  margin: 0 auto;
  height: 60px;
  background: linear-gradient(180deg, var(--g888-bg-deep), #161616);
  border-top: 2px solid var(--g888-gold);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.4);
}

.g888-navbtn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--g888-text-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1rem;
  cursor: pointer;
  min-width: 60px;
  min-height: 60px;
  padding: 4px 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.g888-navbtn .material-icons,
.g888-navbtn ion-icon,
.g888-navbtn i {
  font-size: 24px;
}
.g888-navbtn ion-icon { font-size: 26px; }

.g888-navbtn:active { transform: scale(0.92); }
.g888-navbtn:hover { color: var(--g888-gold); }
.g888-navbtn-active { color: var(--g888-primary); }

.g888-navbtn-badge {
  position: absolute;
  top: 4px;
  right: 22%;
  background: var(--g888-primary);
  color: #fff;
  font-size: 0.9rem;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Mobile spacing & desktop rules ---------- */
@media (max-width: 768px) {
  main { padding-bottom: 80px; }
}

@media (min-width: 769px) {
  .g888-bottomnav { display: none; }
  body { max-width: 430px; }
}

/* Utility */
.g888-text-gold { color: var(--g888-gold); }
.g888-text-primary { color: var(--g888-primary); }
.g888-center { text-align: center; }
.g888-mt { margin-top: 1rem; }
