:root {
  --bg: #100716;
  --panel: rgba(21, 11, 31, 0.9);
  --panel-2: rgba(31, 16, 45, 0.86);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f7f5;
  --muted: #9aa9a2;
  --lime: #8f2ffc;
  --mint: #6c18d9;
  --gold: #f5c84c;
  --red: #ed3b3b;
  --green: #03d40d;
}

* {
  box-sizing: border-box;
  max-width: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  color: var(--text);
  font-family: "Noto Sans Thai", Arial, sans-serif;
  background:
    linear-gradient(120deg, rgba(34, 0, 80, 1), transparent 35%),
    linear-gradient(240deg, rgba(81, 0, 192, 1), transparent 35%),
    #220050;
}

.ticket-shell {
  position: relative;
  width: min(800px, 100%);
  min-height: 100vh;
  margin: auto;
  padding: 14px 14px 86px;
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#loader.hide {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255,255,255,0.18);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup img {
  width: 90px;
  height: 50px;
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(209, 92, 255, 0.18);
}

.brand-lockup span,
.section-bar span,
.slip-label {
  display: block;
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-lockup h1 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.live-count {
  min-width: 104px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-align: right;
}

.live-count small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.live-count strong {
  color: var(--lime);
  font-size: 16px;
}

.promo-billboard {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.32);
}

.promo-slider {
  position: relative;
  aspect-ratio: 16 / 9;
}

.promo-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity 600ms ease, transform 900ms ease;
  pointer-events: none;
}

.promo-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.promo-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  max-height: 540px;
}

.promo-billboard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 34%, rgba(7, 3, 11, 0.76));
}

.billboard-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 1;
  color: #fff;
}

.billboard-copy span {
  display: block;
  max-width: 100%;
  color: var(--lime);
  font-size: 20px;
  font-weight: 900;
}

.billboard-copy h2 {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1;
}

.promo-dots {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.promo-dots button.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.42);
  border: none;
  padding: 0;
  cursor: pointer;
}

.promo-dots span.active {
  width: 20px;
  background: var(--lime);
}

.promo-dots button.dot.active {
  width: 20px;
  background: var(--lime);
}

.promo-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(14, 7, 22, 0.6);
  color: var(--lime);
  font-size: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.promo-control.prev { left: 8px; }
.promo-control.next { right: 8px; }

.promo-control:focus, .promo-dots button.dot:focus { outline: 2px solid rgba(182, 92, 255, 0.28); }

/* ensure images are responsive and not oversized */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* improve promo copy readability on very small screens */
@media (max-width: 420px) {
  .billboard-copy span { font-size: 10px; }
  .billboard-copy h2 { font-size: 18px; }
}

.cta-ticket {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 9px;
  margin: 12px 0;
}

.cta-main,
.cta-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border-radius: 12px;
  color: #e9c8ff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 900;
}

.cta-main {
  background: linear-gradient(180deg, #5902cc 53%, #7a01ec 90%);
}

.cta-line {
  background: linear-gradient(180deg, #218b00 53%, #01c701 90%);
}

.chip-nav {
  display: flex;
  gap: 8px;
  margin: 0 -14px 12px;
  padding: 0 14px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-nav::-webkit-scrollbar {
  display: none;
}

.category {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 108px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
}

.category.active {
  border-color: rgb(104, 1, 189);
  background: rgb(41, 0, 80);
  color: var(--lime);
}

.category img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.coupon-board {
  display: grid;
  grid-template-columns: 1fr 232px;
  gap: 10px;
}

.match-coupons,
.ticket-slip,
.pg-games,
.activity-feed {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 34px rgba(0,0,0,0.18);
}

.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.date-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.date-controls input[type="date"] {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 8px;
}
.date-controls button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.section-bar h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 19px;
}

.section-bar strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.match-list,
.withdraw-list {
  display: grid;
  gap: 8px;
}

.match-row,
.content-row,
.withdraw-row {
  display: grid;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
}

.match-row {
  grid-template-columns: 1fr auto 1fr;
  text-align: center;
}

.content-row,
.withdraw-row {
  grid-template-columns: 38px 1fr auto;
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.team,
.content-name,
.withdraw-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.team { display: flex; align-items: center; justify-content: center; gap: 8px; flex-direction: column; }
.team-flag { width: 40px; height: 28px; object-fit: cover; border-radius: 4px; box-shadow: 0 6px 14px rgba(0,0,0,0.38); }
.team-name { margin-top: 6px; font-size: 13px; font-weight: 900; color: var(--text); text-align: center; }

.match-meta,
.content-desc,
.withdraw-time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.match-status {
  min-width: 74px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(71, 1, 163, 0.14);
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

.content-icon,
.bank-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(176, 92, 255, 0.1);
  color: var(--lime);
  font-size: 17px;
}

.ticket-slip {
  align-self: start;
  background:
    linear-gradient(180deg, rgba(20, 11, 31, 0.94), rgba(22, 11, 31, 0.86)),
    url("assets/worldcup-banner-2.png") center/cover;
}

.ticket-slip strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--text);
  font-size: 15px;
}

.ticket-slip p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stake-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.stake-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-family: inherit;
  font-weight: 900;
}

.ticket-slip a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--lime);
  color: #100716;
  text-decoration: none;
  font-weight: 900;
}

.promo-stack {
  display: grid;
  grid-template-columns: 1fr 232px;
  gap: 10px;
  margin: 10px 0;
}

.promo-stack article,
.promo-stack a {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 34px rgba(0,0,0,0.18);
}

.promo-stack article img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.promo-stack > div {
  display: grid;
  gap: 8px;
}

.promo-stack a {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.promo-stack a img {
  width: 78px;
  height: 44px;
  object-fit: contain;
}

.pg-games {
  margin-bottom: 10px;
}

.pg-game-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.pg-game-row a {
  display: grid;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  font-size: 10px;
  font-weight: 900;
}

.pg-game-row img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
}

.pg-game-row span {
  min-height: 28px;
  display: grid;
  place-items: center;
  line-height: 1.15;
}

.activity-feed {
  margin-bottom: 10px;
}

.withdraw-amount {
  color: var(--lime);
  font-size: 13px;
  font-weight: 900;
}

.page-footer {
  padding: 8px 0 16px;
  text-align: center;
}

.page-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.bottom-stub {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(800px, 100%);
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(17, 7, 22, 0.96);
  backdrop-filter: blur(14px);
}

.bottom-stub a {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.bottom-stub i {
  color: var(--lime);
  font-size: 18px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .coupon-board,
  .promo-stack {
    grid-template-columns: 1fr;
  }

  .pg-game-row {
    display: flex;
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .pg-game-row::-webkit-scrollbar {
    display: none;
  }

  .pg-game-row a {
    flex: 0 0 104px;
  }
}

@media (max-width: 520px) {
  .ticket-shell {
    padding: 12px 10px 84px;
  }

  .billboard-copy span {
    max-width: 100%;
    font-size: 15px;
  }

  .billboard-copy h2 {
    font-size: 10px;
  }

  .coupon-board {
    gap: 8px;
  }

  .cta-ticket {
    grid-template-columns: 1fr 0.72fr;
  }
}
