:root {
  --bg: #ffe3e2;
  --card: #fff;
  --red: #a0141d;
  --red-2: #fc6868;
  --red-grad: linear-gradient(180deg, #fc6868, #a0141d);
  --red-grad-h: linear-gradient(90deg, #a0141d, #f65e5b);
  --text: #3a0a10;
  --muted: #8a4a50;
  --line: #f6b8b6;
  --app-width: 500px;
  --nav-height: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Segoe UI", Arial, Helvetica, sans-serif; background: #f3cfcd; 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; }
.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(--bg);
  padding-bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 6px 10px; min-height: 60px; background: var(--red-grad); box-shadow: 0 2px 8px rgba(160, 20, 29, .35); }
.menu-btn img { width: 38px; height: 38px; border-radius: 8px; }
.logo { justify-self: center; }
.logo img { height: 46px; width: auto; }

/* ---------- Carousel ---------- */
.carousel { position: relative; margin: 10px 10px 0; border-radius: 12px; overflow: hidden; }
.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: 22px; height: 24px; padding: 8.5px 7.5px; border-radius: 50%; background-color: rgba(255, 255, 255, .6); background-clip: content-box; }
.carousel-dots button.active { background-color: var(--red); }

/* ---------- Marquee ---------- */
.marquee { display: flex; align-items: center; gap: 6px; margin: 8px 10px 0; padding: 3px 4px 3px 3px; border-radius: 14px; background: var(--red-grad-h); color: #fff; }
.mic { flex-shrink: 0; width: 24px; height: 24px; }
.mq { flex: 1; overflow: hidden; white-space: nowrap; }
.mq span { display: inline-block; padding-left: 40%; font-size: 13px; font-weight: 600; animation: marquee 45s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Login / Register ---------- */
.auth { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 10px 0; }
.auth img { width: 100%; }

/* ---------- Quick links ---------- */
.quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 12px 10px 0; padding: 10px 4px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 4px rgba(160, 20, 29, .12); }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; text-align: center; line-height: 1.15; }
.qi { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--red-grad); overflow: hidden; }
.qi img { width: 28px; height: 28px; }
.qi svg { width: 24px; height: 24px; fill: #fff; }
.qi-4d { color: #fff; font-size: 15px; font-weight: 900; }

/* ---------- Referral ---------- */
.referral { display: flex; margin: 12px 10px 0; border-radius: 12px; overflow: hidden; background: var(--red-grad-h); color: #fff; }
.ref-title { flex: 0 0 30%; display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; background: rgba(0, 0, 0, .18); border-radius: 0 28px 28px 0; }
.ref-title b { font-size: 16px; letter-spacing: .5px; }
.ref-title small { font-size: 10.5px; font-weight: 700; }
.ref-actions { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ref-actions > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 2px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.ref-actions img { width: 24px; height: 24px; }

/* ---------- Games ---------- */
.block { margin-top: 16px; }
.head { margin: 0 10px 8px; padding-left: 10px; border-left: 4px solid var(--red); font-size: 17px; font-weight: 800; color: var(--red); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 10px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hot { flex: 0 0 31%; min-width: 0; scroll-snap-align: start; }
.hot img { width: 100%; aspect-ratio: 300 / 335; object-fit: cover; border-radius: 10px; }
.g-name { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 2px; }
.g-prov { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.rtp { flex-shrink: 0; padding: 2px 8px; border-radius: 10px; background: var(--red-grad); color: #fff; font-size: 11px; font-weight: 800; }
.rtp.play { margin: 0 auto; }
.new-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 10px; }
.new-card { display: block; padding: 6px; border-radius: 10px; background: var(--card); box-shadow: 0 1px 4px rgba(160, 20, 29, .12); }
.new-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.new-card b { display: block; margin-top: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.new-card > span:not(.rtp) { display: block; font-size: 11px; color: var(--red); text-transform: uppercase; }
.rtp.wide { display: block; margin-top: 6px; text-align: center; }

/* Category menu on the left, provider grid on the right. */
.games { display: grid; grid-template-columns: 22% minmax(0, 1fr); gap: 8px; align-items: start; padding: 0 10px; }
.cat-col { position: sticky; top: 70px; display: grid; gap: 6px; }
.cat { border-radius: 10px; }
.cat.on { box-shadow: 0 0 0 2px var(--red); }
.cat img { width: 100%; }
.prov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.prov img { width: 100%; aspect-ratio: 200 / 280; border-radius: 8px; }
.hot, .new-card, .prov, .cat, .auth a { transition: transform .1s; }
.hot:active, .new-card:active, .prov:active, .cat:active, .auth a:active { transform: scale(.97); }

/* ---------- Hot matches ---------- */
.match { display: block; margin: 0 10px; padding: 12px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 4px rgba(160, 20, 29, .12); text-align: center; }
.match-tag { display: inline-block; padding: 3px 10px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; }
.match-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 10px 0 6px; }
.match-side { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; }
.crest { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); font-size: 22px; }
.match-vs { font-size: 20px; font-weight: 900; color: var(--red); }
.match-text { display: block; font-size: 12.5px; color: var(--muted); }
.match-btn { display: inline-block; margin-top: 10px; padding: 8px 32px; border-radius: 18px; background: var(--red-grad); color: #fff; font-size: 14px; font-weight: 800; }

/* ---------- Daily check-in ---------- */
.checkin { margin: 16px 10px 0; padding: 12px 8px; border-radius: 14px; background: var(--red-grad-h); color: #fff; text-align: center; }
.checkin-head h2 { font-size: 18px; font-weight: 900; letter-spacing: .5px; }
.checkin-head small { font-size: 11.5px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.days a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 8px; background: #fff; color: var(--red); }
.days b { font-size: 10px; }
.days img { width: 28px; height: 28px; }
.days span { font-size: 10px; font-weight: 800; }
.days .day7 { background: #fff3c4; }
.checkin-btn { display: inline-block; margin-top: 10px; padding: 8px 40px; border-radius: 18px; background: #fff; color: var(--red); font-size: 14px; font-weight: 900; }

.promo { display: block; margin: 14px 10px 0; }
.promo img { width: 100%; border-radius: 10px; }

/* ---------- Keyword text ---------- */
.seo { margin: 18px 10px 0; padding: 14px 16px; border-radius: 14px; background: var(--card); font-size: 14px; line-height: 1.6; color: #4a2328; }
.seo h1 { font-size: 17px; color: var(--red); margin-bottom: 8px; }
.seo h2 { font-size: 16px; color: var(--red); margin: 16px 0 6px; }
.seo h3 { font-size: 14px; color: var(--text); margin: 12px 0 4px; }
.seo a { color: var(--red); text-decoration: underline; }
.seo ol, .seo ul { padding-left: 20px; }
.seo li { margin-bottom: 6px; }
.seo b { color: var(--text); }

/* Long sections fold to a preview; collapse.js adds the toggle button. */
.collapsible { position: relative; max-height: 260px; 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: 9px 40px; border-radius: 20px; background: var(--red-grad); color: #fff; font-size: 14px; font-weight: 800; }

/* ---------- Footer ---------- */
.footer { display: grid; gap: 10px; padding: 18px 10px 10px; }
.card { padding: 12px 14px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 4px rgba(160, 20, 29, .12); }
.partner { display: flex; align-items: center; gap: 12px; }
.partner img { width: 110px; flex-shrink: 0; }
.partner p { font-size: 14px; line-height: 1.4; }
.footer h3 { margin-bottom: 10px; font-size: 15px; font-weight: 800; color: var(--red); }
.icons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.icons img { height: 28px; width: auto; }
.copyright { margin-top: 8px; text-align: center; font-size: 13px; font-weight: 700; color: var(--red); }

/* ---------- Floats ---------- */
.side-tab { position: fixed; right: max(0px, calc(50% - var(--app-width) / 2)); top: 48%; z-index: 20; width: 24px; }
.float { position: fixed; z-index: 25; }
.float[hidden] { display: none; }
.change-luck { right: max(0px, calc(50% - var(--app-width) / 2)); top: 170px; width: min(96px, 21vw); }
.deposit-float { right: calc(max(0px, calc(50% - var(--app-width) / 2)) + 8px); bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom)); width: min(70px, 16vw); }
.float .close { position: absolute; top: 0; right: 2px; 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: var(--red-grad);
  border-radius: 14px 14px 0 0;
}
.bottom-nav a { position: relative; display: grid; place-items: center; opacity: .85; }
.bottom-nav a.on { opacity: 1; }
.bottom-nav img { width: 58px; height: 58px; }
.promo-tab img { width: 76px; height: 76px; margin-top: -22px; }
.badge { position: absolute; top: 4px; right: 14%; min-width: 18px; height: 18px; border-radius: 50%; background: #ffd400; color: var(--red); font-size: 11px; display: grid; place-items: center; }
.promo-tab .badge { top: -12px; }

/* ---------- 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) {
  .mq span { animation: none; padding-left: 12px; }
}

/* ---------- Guide pages ---------- */
.guide { margin-top: 14px; }
.guide .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.guide .crumbs a { color: var(--muted); text-decoration: none; }
.seo ul { list-style: disc; }
.guide-auth { margin: 18px 0 4px; }
.table-wrap { overflow-x: auto; margin: 10px 0; }
.seo table { width: 100%; border-collapse: collapse; font-size: 13px; }
.seo th { background: var(--red-grad-h); color: #fff; text-align: left; padding: 8px; }
.seo td { padding: 8px; border: 1px solid var(--line); vertical-align: top; }

/* ---------- Guide card grid ---------- */
.guide-grid-wrap { margin-top: 22px; }
.home-grid { margin: 18px 10px 0; }
.guide-grid-title, .seo .guide-grid-title { margin: 0 0 12px; font-size: 18px; font-weight: 800; color: var(--red); }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guide-grid a, .seo .guide-grid a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; transition: border-color .15s, background .15s; }
.seo .guide-grid a { background: #fff6f6; }
.guide-grid a:hover { border-color: var(--red); }
.guide-grid b { display: block; font-size: 15px; color: var(--red); }
.guide-grid span { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.faq-list { display: grid; gap: 10px; margin: 14px 0; }
.faq-list details { border: 1px solid var(--line); border-radius: 12px; background: #fff6f6; }
.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(--red); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { padding: 0 16px 14px; }
