*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Kanit", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color: #f3e7c4;
  background: linear-gradient(180deg, #0a1233 0%, #0d1a47 100%) fixed;
  background-color: #0a1233;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ปุ่มทอง */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  color: #3a2303;
  background: linear-gradient(180deg, #ffd965 0%, #eaa92b 100%);
  border-radius: 999px;
  white-space: nowrap;
  transition: filter .15s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.btn--sm { height: 38px; padding: 0 18px; font-size: 15px; }
.btn--lg { height: 60px; padding: 0 40px; font-size: 22px; width: min(100%, 420px); }
.btn--block { height: 54px; width: 100%; font-size: 20px; }

/* หัวบน */
.topbar { background: #0a1233; }
.topbar__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar__logo img { height: 44px; width: auto; }
.topbar__actions { display: flex; align-items: center; gap: 14px; }
.link-login { font-size: 15px; color: #e9d9a8; }
.link-login:hover { color: #fff; }

/* แบนเนอร์ */
.hero,
.cta-banner { max-width: 1920px; margin: 0 auto; }
.hero img,
.cta-banner img { width: 100%; }

.cta-row { display: flex; justify-content: center; padding: 24px 16px; }

/* การ์ด 4 ใบ */
.cards {
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.cards img { width: 100%; border-radius: 16px; }

.footer {
  padding: 24px 16px 32px;
  text-align: center;
  font-size: 13px;
  color: rgba(243, 231, 196, .55);
}

/* ปุ่มสมัครติดล่างจอ — มือถือเท่านั้น */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 18, 51, .94);
  transition: transform .2s ease;
}
.sticky-cta.is-hidden { transform: translateY(100%); }

@media (max-width: 767px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}

@media (max-width: 379px) {
  .topbar__logo img { height: 36px; }
  .topbar__actions { gap: 10px; }
  .btn--sm { padding: 0 14px; font-size: 14px; }
  .link-login { font-size: 14px; }
}

@media (min-width: 768px) {
  .sticky-cta { display: none; }
  .topbar__inner { padding: 12px 24px; }
  .topbar__logo img { height: 56px; }
  .btn--sm { height: 42px; padding: 0 24px; font-size: 16px; }
  .cta-row { padding: 32px 24px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 24px; padding: 8px 24px 40px; }
  .cards img { border-radius: 20px; }
}

@media (min-width: 1400px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}

/* ===== ลูกเล่นปุ่มสมัคร: แสงวิ่งผ่าน + เต้นเบา ๆ + ดาวระยิบ (ไม่ใช้กรอบ/แสงเรือง) ===== */
.btn--shine { position: relative; overflow: hidden; isolation: isolate; }
.btn--shine::after {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-20deg);
  animation: btn-shine 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1; /* แสงวิ่งใต้ตัวหนังสือ — ตัวอักษรไม่จางตอนแสงผ่าน */
}
@keyframes btn-shine {
  0% { left: -60%; }
  40%, 100% { left: 140%; }
}

.btn--pulse { animation: btn-pulse 2.8s ease-in-out infinite; }
@keyframes btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.spark {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  animation: spark 1.8s ease-in-out infinite;
  pointer-events: none;
}
.spark.s1 { left: 9%; top: 18%; }
.spark.s2 { right: 10%; bottom: 18%; width: 10px; height: 10px; animation-delay: .6s; }
.spark.s3 { right: 22%; top: 14%; width: 8px; height: 8px; animation-delay: 1.2s; }
@keyframes spark {
  0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn--shine::after, .btn--pulse, .spark { animation: none; }
  .btn--shine::after, .spark { display: none; }
}
