:root {
  --cream: #faf6f0;
  --gold: #c9a14a;
  --gold-dark: #8a6a1f;
  --red: #b8132a;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --card: #ffffff;
  --line: #e7dfd0;
  --app-width: 500px;
  --nav-height: 66px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: #e9e3d8;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  display: block;
  max-width: var(--app-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream) url("assets/ui/body.jpg") center top / 100% auto repeat-y;
  padding-bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 56px 1fr 80px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  min-height: 60px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.menu-btn img { width: 46px; height: auto; }
.logo { justify-self: center; }
.logo img { height: 40px; width: auto; }
.partner img { width: 76px; height: auto; margin-left: auto; }

/* ---------- Marquee ---------- */
.marquee { background: linear-gradient(180deg, #f7dc8a, #d9ae4a); border-bottom: 2px solid var(--gold-dark); overflow: hidden; white-space: nowrap; font-size: 14px; font-weight: 600; padding: 4px 0; }
.marquee span { display: inline-block; padding-left: 40%; animation: marquee 40s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Carousel ---------- */
.carousel { position: relative; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; aspect-ratio: 7 / 3; overflow: hidden; }
.slide img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.carousel-dots { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; }
/* Small dot, but a 24px tap area around it. */
.carousel-dots button { width: 24px; height: 24px; padding: 8.5px; border-radius: 50%; background-color: rgba(255, 255, 255, .7); background-clip: content-box; }
.carousel-dots button.active { background-color: var(--red); }

/* ---------- Buttons ---------- */
.img-btn { display: block; padding: 0; cursor: pointer; transition: transform .1s, filter .15s; }
.img-btn img { width: 100%; height: auto; }
.img-btn:hover { filter: brightness(1.06); }
.img-btn:active { transform: scale(.97); }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 10px 4px; }

/* ---------- Hot games ---------- */
.block { margin-top: 10px; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 10px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hot { flex: 0 0 31%; scroll-snap-align: start; text-align: center; }
.hot-name { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play { display: block; margin: 6px auto 0; width: 88%; padding: 5px 0; border-radius: 16px; background: linear-gradient(180deg, #f7e3a1, #d4a940); border: 1px solid var(--gold-dark); font-size: 14px; font-weight: 800; }

/* ---------- Providers ---------- */
.providers { display: flex; gap: 8px; padding: 14px 8px 0; }
.cat-list { flex: 0 0 72px; display: grid; align-content: start; gap: 6px; }
.cat img { width: 100%; border-radius: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.cat.on img { outline: 2px solid var(--gold); }
.prov-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; align-content: start; }
.prov { display: block; }
.prov img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.hot, .cat, .prov { transition: transform .1s, filter .15s; }
.prov:hover, .hot:hover { filter: brightness(1.05); }
.prov:active, .hot:active { transform: scale(.97); }

/* ---------- Cards ---------- */
.card { margin: 18px 10px 0; padding: 16px; background: var(--card); border-radius: 16px; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.card h2 { font-size: 20px; margin-bottom: 4px; }
.card h3 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .3px; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- Daily check-in ---------- */
.checkin-box { margin-top: 14px; padding: 14px 10px; border-radius: 12px; background: linear-gradient(180deg, #f7e5ad, #e7c36b); }
.checkin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.checkin-btn { padding: 6px 14px; border-radius: 16px; background: #3b3530; color: #f7e3a1; font-weight: 700; white-space: nowrap; }
.crowns { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.crown { text-align: center; font-size: 12px; }
.crown img { width: 100%; }

/* ---------- Referral and promos ---------- */
.referral { position: relative; margin: 18px 10px 0; }
.referral > img { width: 100%; border-radius: 14px; }
/* The artwork leaves its lower part empty for the four buttons. */
.ref-actions { position: absolute; left: 4%; right: 4%; top: 78%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.promo { display: block; margin: 12px 10px 0; }
.promo img { width: 100%; border-radius: 10px; }

/* ---------- Trust card ---------- */
.trust .bk { width: 150px; margin-bottom: 8px; }
.trust p { font-size: 14px; line-height: 1.55; }
.icons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.icons img { height: 30px; width: auto; }

/* ---------- Keyword text ---------- */
.seo { font-size: 14px; line-height: 1.65; color: #4a4a50; }
.seo h1 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.seo h2 { font-size: 16px; color: var(--text); margin: 18px 0 6px; text-transform: none; }
.seo h3 { font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; }
.seo a { color: #1a5fd0; text-decoration: underline; }
/* FAQ page: each question is a tappable card. */
.faq-page .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.faq-page .crumbs a { color: var(--muted); text-decoration: none; }
.faq-list { display: grid; gap: 10px; margin: 14px 0; }
.faq-list details { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.faq-list summary { padding: 14px 16px; font-weight: 700; color: var(--text); cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; float: right; color: var(--gold-dark); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { padding: 0 16px 14px; }
.faq-page .auth-row { padding: 14px 0 6px; }
.guide ol, .guide ul, .faq-page ul { padding-left: 20px; }
.guide ul, .faq-page ul { list-style: disc; }
.guide li, .faq-page li { margin-bottom: 6px; }

/* Long sections fold to a preview; collapse.js adds the toggle button. */
.collapsible { position: relative; max-height: 320px; overflow: hidden; }
.collapsible:not(.open)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); pointer-events: none; }
.collapsible.open { max-height: none; }
.toggle-btn { display: block; margin: 12px auto 0; padding: 10px 40px; border-radius: 24px; background: linear-gradient(180deg, #f7e3a1, #d4a940); border: 1px solid var(--gold-dark); font-size: 15px; font-weight: 800; }

/* ---------- Contact footer ---------- */
.contact { font-size: 14px; }
.quick { display: grid; gap: 6px; padding-left: 18px; list-style: disc; }
.quick a { color: #1a5fd0; text-decoration: underline; }
.info { display: grid; gap: 8px; color: #4a4a50; line-height: 1.5; }
.info a { color: #1a5fd0; text-decoration: underline; }
.map { display: block; width: 100%; height: 220px; margin-top: 14px; border: 0; border-radius: 12px; }
.map-btn { display: grid; place-items: center; background: #f3ead8 url("assets/ui/body.jpg") center / cover; color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; }
.map-link { display: inline-block; margin-top: 8px; color: #1a5fd0; text-decoration: underline; font-size: 14px; }
.copyright { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }
.footer-note { margin-top: 6px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Change Luck float ---------- */
.change-luck { position: fixed; right: max(0px, calc(50% - var(--app-width) / 2)); top: 165px; z-index: 25; width: min(100px, 22vw); }
.change-luck[hidden] { display: none; }
.change-luck img { width: 100%; }
.change-luck .close { position: absolute; top: 0; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; line-height: 1; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: 100%;
  max-width: var(--app-width);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(180deg, #fffaf0, #f2e6cf);
  border-top: 2px solid var(--gold);
}
.bottom-nav a { position: relative; display: grid; place-items: center; height: var(--nav-height); transition: transform .1s; }
.bottom-nav img { height: calc(var(--nav-height) - 6px); width: auto; }
.bottom-nav a:active { transform: scale(.95); }
.badge { position: absolute; top: 4px; right: 16%; min-width: 22px; height: 22px; border-radius: 50%; background: #c45500; color: #fff; font-size: 13px; display: grid; place-items: center; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-height) + 24px); transform: translateX(-50%); z-index: 50; background: rgba(0, 0, 0, .85); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; padding-left: 12px; }
}
