:root {
  --yellow: #FFD400;
  --yellow-soft: #FFF3B8;
  --black: #0F0F0F;
  --dark: #1a1a1a;
  --gray: #6B7280;
  --gray-light: #E5E7EB;
  --bg: #F4F5F6;
  --card: #FFFFFF;
  --text: #111827;
  --ok: #16A34A;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Prompt", "Leelawadee UI", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; }

.text-yellow { color: var(--yellow); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #2b2b2b, #0f0f0f);
  border-bottom: 3px solid var(--yellow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand-logo { height: 40px; max-width: 180px; object-fit: contain; margin: 8px 0; border-radius: 8px; }

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow);
  color: #111;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255,212,0,.35);
  transition: transform .12s ease, filter .12s ease;
}
.btn-contact:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-contact svg { width: 18px; height: 18px; }
.btn-contact.btn-icon { padding: 9px 10px; }

/* ---------- Hero carousel ---------- */
.hero { background: #000; position: relative; overflow: hidden; }
.hero-carousel { position: relative; max-width: 1120px; margin: 0 auto; }
.hero-viewport { overflow: hidden; }
.hero-track { display: flex; transition: transform .55s cubic-bezier(.25,.8,.35,1); }
.hero-slide { min-width: 100%; }
.hero-slide img { width: 100%; height: 220px; object-fit: cover; }
.hero-dots {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px;
}
.hero-dots button {
  width: 9px; height: 9px; border-radius: 99px; border: none; cursor: pointer;
  background: rgba(255,255,255,.45); transition: width .2s, background .2s;
}
.hero-dots button.on { width: 22px; background: var(--yellow); }

/* ---------- Menu bar ---------- */
.menu-bar {
  background: linear-gradient(180deg, #141414, #0f0f0f);
  border-bottom: 2px solid var(--yellow);
  position: sticky;
  top: 64px;
  z-index: 45;
}
.menu-inner { display: flex; gap: 4px; overflow-x: auto; padding: 6px 8px; }
.menu-inner::-webkit-scrollbar { display: none; }
.menu-item {
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: none; cursor: pointer;
  color: #d1d5db; padding: 6px 14px; border-radius: 10px;
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.menu-item svg { width: 22px; height: 22px; }
.menu-item:hover { background: rgba(255,212,0,.1); color: #fff; }
.menu-item.on { background: var(--yellow); color: #111; }
.menu-item.on:hover { color: #111; }

/* ---------- Main ---------- */
.main { flex: 1; padding: 20px 0 120px; }
.section-title {
  font-size: 1.25rem; font-weight: 800; color: var(--black);
  display: flex; align-items: center; gap: 10px; margin: 22px 0 6px;
}
.section-title::before {
  content: ""; width: 5px; height: 22px; border-radius: 4px; background: var(--yellow);
}
.section-sub { color: var(--gray); font-size: 0.9rem; margin-bottom: 14px; }
.section { padding-bottom: 8px; }

/* ---------- Provider grid ---------- */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.provider-card {
  background: var(--card);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  position: relative;
}
.provider-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(15,15,15,.12); border-color: #d4d4d4; }
.provider-thumb {
  aspect-ratio: 350 / 225;
  display: flex; align-items: center; justify-content: center;
  background: #0f0f0f; padding: 0;
}
.provider-thumb img { width: 100%; height: 100%; object-fit: cover; }
.provider-name { font-size: 0.78rem; font-weight: 700; padding: 7px 4px; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-badge {
  position: absolute; top: 5px; right: 5px;
  background: var(--yellow); color: #111;
  font-size: 0.62rem; font-weight: 800; padding: 2px 6px; border-radius: 99px;
}
.provider-badge.gray { background: #e5e7eb; color: #374151; }

/* ---------- Game list ---------- */
.game-toolbar {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap;
}
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--black); color: var(--yellow);
  border: none; border-radius: 9px; padding: 8px 12px;
  font-family: inherit; font-weight: 700; cursor: pointer; font-size: 0.85rem;
}
.btn-back svg { width: 16px; height: 16px; }
.search-box {
  flex: 1 1 220px;
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--gray-light); border-radius: 9px; padding: 0 10px;
}
.search-box svg { width: 16px; height: 16px; color: var(--gray); }
.search-box input { border: none; outline: none; flex: 1; padding: 8px 0; font-family: inherit; font-size: 0.9rem; background: transparent; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.game-card {
  background: var(--card); border: 1px solid var(--gray-light); border-radius: 12px; overflow: hidden;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(15,15,15,.12); }
.game-thumb { aspect-ratio: 16 / 10; background: #0f0f0f; overflow: hidden; }
.game-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.game-card:hover .game-thumb img { transform: scale(1.04); }
.game-info { padding: 8px 10px; }
.game-name { font-size: 0.82rem; font-weight: 700; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-tag { font-size: 0.62rem; color: #fff; background: #ef4444; border-radius: 4px; padding: 1px 5px; display: inline-block; margin-top: 4px; font-weight: 700; }
.game-tag.new { background: #f59e0b; }
.game-empty { text-align: center; color: var(--gray); padding: 40px 0; }

/* ---------- Promotions ---------- */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.promo-card {
  background: var(--card); border: 1px solid var(--gray-light); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
}
.promo-img { width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.promo-body { padding: 12px 14px 14px; }
.promo-name { font-size: 1rem; font-weight: 800; }
.promo-desc { color: var(--gray); font-size: 0.85rem; margin-top: 2px; }
.promo-cond { font-size: 0.82rem; margin-top: 8px; color: #374151; font-weight: 600; }
.promo-cond + ul { list-style: none; margin-top: 6px; }
.promo-cond + ul li {
  font-size: 0.78rem; color: var(--gray); padding-left: 14px; position: relative; margin-top: 3px;
}
.promo-cond + ul li::before { content: "•"; position: absolute; left: 2px; color: var(--yellow); font-weight: 900; }
.promo-date { margin-top: 10px; font-size: 0.7rem; color: #9ca3af; }

/* ---------- Lotto ---------- */
.lotto-group { margin-bottom: 14px; }
.lotto-head { font-size: 0.9rem; font-weight: 800; color: var(--black); margin-bottom: 8px; }
.lotto-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.lotto-item {
  background: var(--card); border: 1px solid var(--gray-light); border-radius: 10px;
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.lotto-provider { font-size: 0.82rem; font-weight: 700; }
.lotto-time { font-size: 0.74rem; color: #059669; font-weight: 700; text-align: right; }
.lotto-closed { color: #9ca3af; }

/* ---------- Contact card ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.contact-card { background: var(--card); border: 1px solid var(--gray-light); border-radius: 14px; padding: 16px; }
.contact-card h3 { font-size: 0.95rem; font-weight: 800; margin-bottom: 10px; }
.contact-list { list-style: none; }
.contact-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gray-light); font-size: 0.85rem; }
.contact-list li:last-child { border-bottom: none; }
.contact-label { color: var(--gray); }
.contact-value { font-weight: 700; color: #111; display: flex; align-items: center; gap: 6px; }
.btn-copy {
  background: var(--yellow); border: none; color: #111; border-radius: 6px;
  font-family: inherit; font-size: 0.7rem; font-weight: 700; padding: 3px 8px; cursor: pointer;
}
.btn-copy.done { background: #16a34a; color: #fff; }
.contact-line-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: #06c755; color: #fff; font-weight: 800; font-size: 0.85rem;
  border: none; border-radius: 9px; padding: 9px 14px; text-decoration: none; cursor: pointer;
}
.contact-line-btn svg { width: 16px; height: 16px; }

/* ---------- Footer ---------- */
.site-footer {
  background: linear-gradient(180deg, #0f0f0f, #000);
  color: #9ca3af; text-align: center; padding: 20px 16px; font-size: 0.8rem;
  border-top: 3px solid var(--yellow);
}
.site-footer strong { color: #fff; }
.footer-copy { margin-top: 4px; color: #6b7280; font-size: 0.72rem; }

/* ---------- Install bar ---------- */
.install-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; display: none;
}
.install-bar.show { display: block; }
.install-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.97); border-top: 2px solid var(--yellow);
  box-shadow: 0 -6px 20px rgba(0,0,0,.15);
  border-radius: 12px 12px 0 0;
  padding: 8px 12px;
}
.install-logo { height: 38px; border-radius: 8px; flex: 0 0 auto; }
.install-text { flex: 1; min-width: 0; }
.install-title { font-size: 0.85rem; font-weight: 800; }
.install-sub { font-size: 0.72rem; color: var(--gray); }
.btn-install {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--black); color: var(--yellow);
  border: none; border-radius: 9px; padding: 9px 14px;
  font-family: inherit; font-weight: 800; cursor: pointer;
}
.btn-install svg { width: 16px; height: 16px; }
.btn-close { background: transparent; border: none; color: #9ca3af; cursor: pointer; padding: 6px; }
.btn-close svg { width: 20px; height: 20px; }
.btn-close:hover { color: var(--black); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(15,15,15,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .15s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 16px; max-width: 420px; width: 100%;
  overflow: hidden; animation: popIn .18s ease; border-top: 4px solid var(--yellow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--gray-light);
}
.modal-head h2 { font-size: 1rem; font-weight: 800; }
.modal-body { padding: 14px 16px 18px; }
.modal-note { font-size: 0.85rem; color: var(--gray); margin-bottom: 12px; }
.modal-line {
  display: flex; align-items: center; gap: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 12px;
}
.modal-line .line-badge {
  width: 38px; height: 38px; border-radius: 10px; background: #06c755; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.8rem;
  flex: 0 0 auto;
}
.modal-line .line-id { font-size: 0.85rem; }
.modal-line .line-id b { font-weight: 800; }
.modal-line .btn-copy { margin-left: auto; }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.modal-actions a {
  flex: 1; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--black); color: var(--yellow); text-decoration: none;
  font-weight: 700; font-size: 0.82rem; padding: 10px; border-radius: 9px;
}
.modal-actions a.green { background: #06c755; color: #fff; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

/* game detail modal */
.game-detail { text-align: center; }
.game-detail img { width: 100%; border-radius: 12px; margin-bottom: 10px; }
.game-detail h3 { font-size: 1.05rem; font-weight: 800; }
.game-detail p { font-size: 0.8rem; color: var(--gray); margin-top: 2px; }
.game-detail .play-btn {
  margin-top: 12px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--yellow); color: #111; font-weight: 800; font-size: 0.95rem;
  border: none; border-radius: 10px; padding: 12px; font-family: inherit; cursor: pointer;
}
.game-detail .play-btn svg { width: 18px; height: 18px; }
.game-detail .play-note { font-size: 0.72rem; color: var(--gray); margin-top: 8px; }

/* spinner */
.spinner {
  width: 34px; height: 34px; margin: 30px auto; border-radius: 50%;
  border: 4px solid var(--gray-light); border-top-color: var(--yellow);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .hero-slide img { height: 170px; }
  .menu-item { padding: 6px 10px; font-size: 0.74rem; }
  .provider-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; }
}

/* menu icon images */
.menu-item .menu-icon { width: 22px; height: 22px; object-fit: contain; display: inline-block; }

/* feature strip (lucky wheel + affiliate) */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.feature-card {
  position: relative; border: none; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--dark); text-align: left; font-family: inherit;
}
.feature-card img { width: 100%; aspect-ratio: 2.4 / 1; object-fit: cover; display: block; }
.feature-label {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(15,15,15,.88); color: var(--yellow); font-weight: 800; font-size: 0.8rem;
  padding: 5px 10px; border-radius: 8px;
}
.feature-sub {
  position: absolute; right: 10px; bottom: 12px;
  background: rgba(255,212,0,.9); color: #111; font-size: 0.66rem; font-weight: 700;
  padding: 3px 8px; border-radius: 30px;
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* game launch overlay */
.launch-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: #0f0f0f; display: flex; flex-direction: column;
}
.launch-overlay[hidden] { display: none; }
.launch-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; background: #161616; border-bottom: 1px solid var(--gray-light);
}
.launch-title { font-size: 0.85rem; font-weight: 700; color: var(--yellow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launch-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.launch-btn {
  background: #262626; color: var(--yellow); border: 1px solid #3a3a3a;
  border-radius: 8px; padding: 5px 10px; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.launch-btn.launch-close { background: var(--yellow); color: #111; border-color: var(--yellow); }
.launch-frame { flex: 1; min-height: 0; }
.launch-frame iframe { width: 100%; height: 100%; border: 0; background: #000; }

/* featured rows (hot/new games) */
.featured-wrap { margin-bottom: 20px; }
.featured-head { font-weight: 800; font-size: 0.98rem; margin-bottom: 10px; color: #111; }
.featured-row {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px; scrollbar-width: none;
}
.featured-row::-webkit-scrollbar { display: none; }
.featured-card {
  flex: 0 0 150px; scroll-snap-align: start; cursor: pointer; text-align: left;
  background: var(--card); border: 1px solid var(--gray-light); border-radius: 12px; overflow: hidden; padding: 0;
  font-family: inherit;
}
.featured-card img { width: 100%; aspect-ratio: 350 / 225; object-fit: cover; display: block; }
.featured-name { font-size: 0.72rem; font-weight: 700; padding: 6px 8px 0; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-prov { font-size: 0.62rem; color: #777; padding: 2px 8px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* global search overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 210; background: #fff;
  display: flex; flex-direction: column;
}
.search-overlay[hidden] { display: none; }
.search-top {
  display: flex; gap: 8px; align-items: center; padding: 10px;
  background: var(--dark); border-bottom: 1px solid var(--gray-light);
}
.search-input {
  flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid #333;
  background: #1c1c1c; color: #fff; font-size: 0.95rem; outline: none;
}
.search-input::placeholder { color: #888; }
.search-body { flex: 1; overflow-y: auto; padding: 10px; }
.search-status { color: #666; font-weight: 700; margin-bottom: 8px; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--gray-light); border-radius: 10px;
  padding: 6px; cursor: pointer; font-family: inherit;
}
.search-thumb { width: 58px; height: 38px; object-fit: cover; border-radius: 6px; flex: none; }
.search-item-name { font-size: 0.82rem; font-weight: 700; color: #111; }
.search-item-prov { font-size: 0.66rem; color: #777; }

/* promo modal */
.promo-modal-backdrop {
  position: fixed; inset: 0; z-index: 220; background: rgba(15,15,15,.72);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.promo-modal {
  position: relative; max-width: 420px; width: 100%; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 16px;
}
.promo-x { position: absolute; top: 10px; right: 10px; z-index: 2; background: #fff; border-radius: 50%; }
.promo-modal-img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 16px 16px 0 0; }
.promo-modal-body { padding: 14px; }
.promo-modal-body h3 { margin: 0 0 8px; font-size: 1.05rem; color: #111; }
.promo-modal-desc { color: #444; font-size: 0.85rem; line-height: 1.5; margin: 0 0 8px; }
.promo-modal-list { margin: 8px 0; padding-left: 18px; color: #333; font-size: 0.8rem; }
.promo-modal-list li { margin-bottom: 4px; }
.promo-contact { margin-top: 12px; width: 100%; justify-content: center; }

/* lotto results */
.lotto-result { margin-top: 8px; background: #fff; border: 1px solid var(--gray-light); border-radius: 8px; padding: 8px; }
.lotto-result-date { font-size: 0.68rem; font-weight: 700; color: var(--yellow); margin-bottom: 6px; }
.lotto-result-grid { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lotto-prize-label { font-size: 0.6rem; color: #999; }
.lotto-prize-num { font-size: 0.75rem; font-weight: 800; color: #111; letter-spacing: 1px; }