/* =========================================================
   BaphometRo 2.0 Landing - Simple Editable Version
   แก้สี/ฟอนต์/รูป ได้ง่ายจากไฟล์นี้
   ========================================================= */

:root {
  --gold: #f6d365;
  --purple: #ab83f5;
  --dark: #1a1030;
  --text: #ffffff;
  --max-width: 1200px;
  --header-h: 64px;
  --font-body: 'Poppins', 'Segoe UI', 'Noto Sans Thai', Arial, sans-serif;
  --font-display: 'Kanit', 'Poppins', sans-serif;   /* หัวข้อ/ปุ่ม แนวเกม */
}

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

/* เลื่อนลงนุ่มๆ เมื่อกดลิงก์ในเมนู (หักความสูง header) */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--dark);
  line-height: 1.5;
}

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

/* หัวข้อ/ปุ่ม ใช้ฟอนต์ display แนวเกม (ลิงก์ nav-menu ใช้ Poppins เพื่ออ่านง่าย) */
.section-title, .btn-register-hero, .btn-recharge, .btn-submit,
.modal-head h2, .hero-banner { font-family: var(--font-display); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ================= HEADER ================= */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(20, 12, 40, 0.55);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background .3s, box-shadow .3s, border-color .3s;
}
/* พื้นหลังเข้มขึ้น + เงา เมื่อเลื่อนลง */
.site-header.scrolled {
  background: rgba(16, 9, 33, 0.92);
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
  border-bottom-color: rgba(171,131,245,.25);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }

/* โลโก้รูปมุมซ้ายบน */
.nav-logo { display: flex; align-items: center; }
.nav-logo img {
  height: 48px; width: 48px; border-radius: 50%;
  filter: drop-shadow(0 2px 6px rgba(120,60,220,.6));
  transition: transform .2s;
}
.nav-logo:hover img { transform: scale(1.08); }

.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu a { position: relative; font-weight: 600; font-size: 15px; transition: color .2s; }
.nav-menu a:hover { color: var(--gold); }
/* ไฮไลต์เมนูที่ตรงกับ section ที่กำลังดู */
.nav-menu a.active { color: var(--gold); }
.nav-menu a:not(.btn-recharge)::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  transition: right .25s ease;
}
.nav-menu a:not(.btn-recharge):hover::after,
.nav-menu a.active:not(.btn-recharge)::after { right: 0; }
.btn-recharge {
  background: linear-gradient(90deg, var(--purple), var(--gold));
  color: #2a1a4a; padding: 8px 22px; border-radius: 20px; font-weight: 700;
  border: none; font-size: 15px; cursor: pointer; font-family: inherit;
  transition: transform .2s, box-shadow .2s;
}
.btn-recharge:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(171,131,245,.5); }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 100vh;
  background: url("../images/hero-bg.jpg") center top / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: var(--header-h) 20px 40px;
}
/* ไล่เฉดเข้มด้านล่าง hero -> ต่อกับ section ถัดไปแบบเนียน */
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: linear-gradient(to bottom, transparent, var(--dark));
  pointer-events: none; z-index: 1;
}
.hero-content { position: relative; z-index: 2; }
.hero-content {
  display: flex; flex-direction: column; align-items: center; gap: 30px;
  margin-top: auto;   /* ดันเนื้อหาลงครึ่งล่าง เห็นภาพศิลป์ด้านบน */
  padding-bottom: 6vh;   /* ยกกลุ่มเนื้อหาขึ้นจากขอบล่าง */
}

/* โลโก้มาสคอตกลางจอ (จุดโฟกัสเหนือปุ่ม) — ใหญ่ขึ้น + ลอยสูงกว่าปุ่มเล็กน้อย */
.hero-mascot-wrap {
  display: grid; place-items: center; padding: 18px; border-radius: 50%;
  margin-bottom: 6px;
  /* แสงเรืองวงกลมเข้มบางๆ ให้โลโก้แยกจากพื้นหลังที่รก */
  background: radial-gradient(circle, rgba(14,6,32,.6) 42%, rgba(14,6,32,.25) 60%, transparent 72%);
  animation: mascotFloat 3s ease-in-out infinite;
}
.hero-mascot {
  width: clamp(150px, 16vw, 210px); height: auto; border-radius: 50%;
  filter: drop-shadow(0 6px 22px rgba(120,60,220,.85));
}
@keyframes mascotFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ปุ่ม REGISTER NOW ตัวใหญ่ (CTA หลัก) */
.btn-register-hero {
  font-family: inherit; cursor: pointer; border: none;
  font-size: clamp(20px, 3vw, 30px); font-weight: 900; letter-spacing: 2px;
  color: #3a2410; padding: 16px 56px; border-radius: 40px;
  background: linear-gradient(180deg, #ffe9a8, var(--gold) 55%, #e0a93a);
  box-shadow: 0 8px 0 #a9741d, 0 12px 24px rgba(0,0,0,.45);
  transition: transform .15s, box-shadow .15s;
  animation: pulse 2s ease-in-out infinite;
}
.btn-register-hero:hover { transform: translateY(-3px); box-shadow: 0 11px 0 #a9741d, 0 16px 30px rgba(0,0,0,.5); }
.btn-register-hero:active { transform: translateY(4px); box-shadow: 0 4px 0 #a9741d, 0 6px 12px rgba(0,0,0,.4); }
@keyframes pulse { 0%,100%{ filter: brightness(1);} 50%{ filter: brightness(1.12);} }

/* ส่วนดาวน์โหลด (ป้าย + ปุ่ม store) อยู่ล่างสุด */
.download-area { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero-banner { width: min(360px, 62vw); }
.store-buttons { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.store-btn img { height: 46px; transition: transform .2s; }
.store-btn:hover img { transform: translateY(-3px); }

/* ================= SECTIONS ================= */
.section { padding: 70px 0; }
.section-title {
  text-align: center; font-size: 34px; letter-spacing: 3px; margin-bottom: 40px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* พื้นหลังศิลป์ของ section (เปลี่ยน/เอาออกได้) */
.news { background: url("../images/scene-lower.png") center / cover no-repeat, var(--dark); }
.features { background: linear-gradient(180deg, #241542, #14082a); }

/* ================= NEWS ================= */
.news-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }

.news-list { list-style: none; background: rgba(0,0,0,.35); border-radius: 12px; padding: 8px 18px; }
.news-list li { border-bottom: 1px solid rgba(255,255,255,.1); }
.news-list li:last-child { border-bottom: none; }
.news-list a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 10px; margin: 0 -10px; font-size: 14px; border-radius: 8px; transition: background .2s, padding-left .2s; }
.news-list a:hover { background: rgba(171,131,245,.12); padding-left: 18px; }
.news-list a:hover span { color: var(--gold); }
.news-list time { color: #b9a9dd; white-space: nowrap; }

/* ================= CAROUSEL (ใช้ร่วมกัน) ================= */
.carousel { position: relative; overflow: hidden; border-radius: 12px; }
.carousel-track { display: flex; transition: transform .4s ease; }
.slide { min-width: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; border: none; font-size: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.carousel-btn:hover { background: var(--purple); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
/* ภาพซูมเบาๆ ตอน hover */
.slide img { transition: transform .5s ease; }
.carousel:hover .slide img { transform: scale(1.03); }

/* จุดบอกสไลด์ (pagination dots) วางทับด้านล่างภาพ */
.carousel-dots {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 3;
  display: flex; justify-content: center; gap: 9px;
}
.carousel-dots .dot {
  width: 9px; height: 9px; border-radius: 50%; cursor: pointer; border: none;
  background: rgba(255,255,255,.45); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
  transition: background .25s, transform .25s, width .25s;
}
.carousel-dots .dot:hover { background: rgba(255,255,255,.8); }
.carousel-dots .dot.active { width: 24px; border-radius: 5px; background: linear-gradient(90deg, var(--purple), var(--gold)); }

/* ================= FOOTER / STAY CONNECTED ================= */
.site-footer { background: linear-gradient(180deg, #14082a, #0d0620); padding: 56px 0 32px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }

.footer-title {
  font-size: 24px; letter-spacing: 3px; font-weight: 800;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.social-icons { display: flex; gap: 18px; }
.social {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(171,131,245,.35);
  transition: transform .2s, background .2s, box-shadow .2s, border-color .2s;
}
.social svg { width: 26px; height: 26px; fill: #cdbdf2; transition: fill .2s; }
.social:hover { transform: translateY(-4px); }
.social:hover svg { fill: #fff; }
/* hover เปลี่ยนสีตามแบรนด์ */
.social.discord:hover  { background: #5865F2; border-color: #5865F2; box-shadow: 0 8px 20px rgba(88,101,242,.5); }
.social.facebook:hover { background: #1877F2; border-color: #1877F2; box-shadow: 0 8px 20px rgba(24,119,242,.5); }
.social.tiktok:hover   { background: #010101; border-color: #25F4EE; box-shadow: 0 8px 20px rgba(37,244,238,.4); }

.copyright { color: #6d5b95; font-size: 13px; }

/* ================= REGISTER MODAL (POPUP) ================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8, 4, 20, 0.78); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-card {
  position: relative; width: 100%; max-width: 500px;
  max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #241542, #170b30);
  border: 1px solid rgba(171,131,245,.45); border-radius: 18px;
  padding: 28px 26px 30px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 0 30px rgba(171,131,245,.08);
  animation: modalIn .28s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97);} to { opacity: 1; transform: none;} }

.modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.08); color: #fff; font-size: 22px; line-height: 1;
  transition: background .2s;
}
.modal-close:hover { background: rgba(255,255,255,.2); }

.modal-head { margin-bottom: 20px; }
.modal-logo { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; filter: drop-shadow(0 2px 8px rgba(120,60,220,.7)); }
.modal-head h2 {
  font-size: 24px; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-head p { color: #b9a9dd; font-size: 14px; margin-top: 4px; }

/* ฟอร์ม — 2 คอลัมน์บน PC, 1 คอลัมน์บนมือถือ */
.reg-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; text-align: left; }
.reg-form[hidden] { display: none; }   /* ต้องมี ไม่งั้น grid จะ override attribute hidden */
.reg-form .full { grid-column: 1 / -1; }   /* ช่องที่ต้องเต็มแถว */
.reg-form label { font-size: 13px; font-weight: 600; color: #d7ccf2; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.reg-form input, .reg-form select {
  font-family: inherit; font-size: 15px; color: #fff;
  background: rgba(0,0,0,.35); border: 1px solid rgba(171,131,245,.35);
  border-radius: 10px; padding: 11px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.reg-form input::placeholder { color: #7d6ea3; }
.reg-form input:focus, .reg-form select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,211,101,.18); }
.reg-form select option { background: #1c1030; }
#captcha-q { color: var(--gold); font-weight: 800; letter-spacing: 1px; }

/* honeypot: ซ่อนสนิทจากผู้ใช้จริง */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.reg-msg { min-height: 18px; font-size: 13px; margin: 2px 0; }
.reg-msg.error { color: #ff8a8a; }
.reg-msg.success { color: #7dffb0; }

.btn-submit {
  margin-top: 6px; font-family: inherit; cursor: pointer; border: none;
  font-size: 17px; font-weight: 800; letter-spacing: 1px; color: #2a1a4a;
  padding: 13px; border-radius: 12px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(171,131,245,.5); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ลิงก์สลับ Register <-> Change Password */
.switch-mode { text-align: center; font-size: 13px; color: #b9a9dd; margin-top: 2px; }
.switch-mode a { color: var(--gold); font-weight: 700; text-decoration: underline; cursor: pointer; }
.switch-mode a:hover { color: #fff; }

/* ฟอร์มบนจอเล็ก -> 1 คอลัมน์ */
@media (max-width: 560px) {
  .reg-form { grid-template-columns: 1fr; }
  .modal-card { padding: 24px 18px 26px; }
}

/* ================= ลูกเล่น: SCROLL REVEAL + BACK TO TOP ================= */
/* เนื้อหาค่อยๆ fade เลื่อนขึ้นตอนเลื่อนมาถึง (JS เติมคลาส .visible) */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ปุ่มกลับขึ้นบนสุด */
#backToTop {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--purple), #7a4fd0); color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s, transform .3s, visibility .3s, background .2s;
}
#backToTop.show { opacity: 1; visibility: visible; transform: none; }
#backToTop:hover { background: linear-gradient(180deg, var(--gold), var(--purple)); transform: translateY(-3px); }

/* เคารพผู้ที่ตั้งค่าลดการเคลื่อนไหว */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-mascot-wrap, .btn-register-hero { animation: none; }
}

/* ================= RESPONSIVE (มือถือ) ================= */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(20, 12, 40, 0.97); padding: 10px 0;
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 14px 20px; width: 100%; text-align: center; }
  .btn-recharge { border-radius: 6px; margin: 8px 20px; }

  .news-layout { grid-template-columns: 1fr; }
  .section-title { font-size: 26px; }
}
