* { box-sizing: border-box; }

html { background: #0b120e; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* ★ ความสูงจอจริงบนมือถือ (แถบเบราว์เซอร์ย่อ/ขยายก็ไม่มีรอยขาด) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b120e;
  color: #e8e8e8;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(232, 185, 35, 0.08), transparent 60%),
    radial-gradient(700px circle at 85% 90%, rgba(31, 138, 76, 0.18), transparent 60%),
    #0b120e;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: #161f19;
  border: 1px solid #243026;
  border-radius: 16px;
  padding: 28px 24px;
  margin: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* ★ ตามคำขอผู้ใช้ ★ บนมือถือ (จอแคบ) ให้การ์ดยืดเต็มจอไปเลย ไม่ใช่ "ลอย" อยู่กลางจอแบบมี
   ขอบ/มุมโค้ง/เงาเห็นพื้นหลังรอบๆ เหมือนวิดเจ็ตเล็กๆ — ให้ความรู้สึกเหมือนเปิดแอปจริง
   เต็มหน้าจอแนวตั้ง ส่วนจอกว้าง (คอมพิวเตอร์) ยังคงเป็นการ์ดลอยกลางจอเหมือนเดิม */
@media (max-width: 600px) {
  body { align-items: stretch; }
  .card {
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-badge {
  height: 68px;
  width: auto;
  border-radius: 8px;
  flex: 0 0 auto;
}

h1 {
  font-size: 19px;
  margin: 0;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #9aa39d;
}

.how-to-btn {
  width: 100%;
  margin: 0 0 18px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(232, 185, 35, 0.15), rgba(31, 138, 76, 0.15));
  border: 1px solid #e8b923;
  color: #ffd75e;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.how-to-btn:hover {
  background: linear-gradient(90deg, rgba(232, 185, 35, 0.28), rgba(31, 138, 76, 0.28));
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  background: #161f19;
  border: 1px solid #243026;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #243026;
  flex: 0 0 auto;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
}

.modal-close {
  width: auto;
  margin: 0;
  padding: 4px 10px;
  background: transparent;
  border: none;
  color: #9aa39d;
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover { color: #fff; }

.success-modal-box {
  padding: 32px 24px 26px;
  text-align: center;
  align-items: center;
}

.success-modal-box .result-icon {
  width: 64px;
  height: 64px;
  font-size: 32px;
  margin: 0 auto 14px;
}

#success-overlay-text {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
}

/* ★ ตามคำขอผู้ใช้ ★ เดิมข้อความคำอธิบายลอยอยู่เฉยๆ บนพื้นหลังมืดของป๊อปอัป ไม่มีขอบ/กรอบ
   แยกให้เห็นชัดว่าเป็นข้อความสำคัญ — ใส่กรอบสีเขียว (โทนเดียวกับสถานะสำเร็จ) ให้เด่นขึ้น
   เหมือนกล่องเตือนสีทอง (.warning-box) ที่ใช้อยู่แล้วจุดอื่นในเว็บ แค่เปลี่ยนโทนสี */
#success-overlay .hint {
  margin: 0 0 20px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #a8e6bd;
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
}

#btn-close-success-overlay {
  width: auto;
  padding: 10px 28px;
}

.notice-modal-box {
  padding: 32px 24px 26px;
  text-align: center;
  align-items: center;
}

.result-icon.notice {
  background: rgba(232, 185, 35, 0.15);
  color: #ffd75e;
  width: 64px;
  height: 64px;
  font-size: 32px;
  margin: 0 auto 14px;
}

#notice-overlay-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  margin: 0 0 20px;
}

#btn-close-notice-overlay {
  width: auto;
  padding: 10px 28px;
  background: transparent;
  border: 1px solid #e8b923;
  color: #ffd75e;
}

.modal-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
}

.confirm-modal-box {
  padding: 28px 24px 24px;
  text-align: center;
  align-items: center;
}

.confirm-modal-box > p:first-child {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
}

.confirm-modal-box #otp-confirm-code {
  color: #ffd75e;
  letter-spacing: 4px;
  font-size: 19px;
}

.confirm-modal-actions {
  width: 100%;
  margin-top: 18px;
}

.confirm-modal-actions button { margin-top: 10px; }
.confirm-modal-actions button:first-child { margin-top: 0; }

.how-step {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.how-step:last-child { margin-bottom: 0; }

.how-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1f8a4c;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 14px;
}

.how-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #9aa39d;
}

.how-desc code {
  background: #10160f;
  border: 1px solid #3a4a3e;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}

.how-desc b { color: #ffd75e; }

.faq-title {
  margin: 22px 0 12px;
  padding-top: 18px;
  border-top: 1px solid #243026;
  font-weight: 700;
  font-size: 14px;
  color: #e8e8e8;
}

.faq-item {
  border: 1px solid #243026;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #10160f;
}

.faq-item summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #e8e8e8;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: #e8b923;
  transition: transform 0.15s ease;
}

.faq-item[open] summary::before { transform: rotate(90deg); }

.faq-item p {
  margin: 8px 0 2px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #9aa39d;
}

.faq-item p b { color: #ffd75e; }

.steps {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.step .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #243026;
  color: #6f7d72;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #2f3d33;
  transition: all 0.25s ease;
}

.step .label {
  font-size: 10px;
  color: #6f7d72;
  white-space: nowrap;
}

.step.active .dot,
.step.done .dot {
  background: #e8b923;
  border-color: #e8b923;
  color: #14201a;
}

.step.done .dot { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }

.step.active .label,
.step.done .label { color: #e8e8e8; }

.step-line {
  flex: 1;
  height: 2px;
  background: #243026;
  margin: 0 6px 18px;
}

label {
  display: block;
  font-size: 13px;
  color: #9aa39d;
  margin: 14px 0 6px;
}

input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid #3a4a3e;
  background: #10160f;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus { border-color: #e8b923; }

input::placeholder { color: #556058; }

.otp-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 10px;
  font-weight: 700;
}

button {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-radius: 9px;
  background: #1f8a4c;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:hover { background: #14602f; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

button.danger { background: #e74c3c; }
button.danger:hover { background: #922b21; }

button.ghost {
  background: transparent;
  border: 1px solid #e8b923;
  color: #e8b923;
}
button.ghost:hover { background: rgba(232, 185, 35, 0.1); }

#btn-contact-admin {
  display: block;
  width: 100%;
  margin: -6px 0 16px;
  padding: 12px;
  border-radius: 9px;
  background: #1877f2;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s ease;
}
#btn-contact-admin:hover { background: #145dbf; }

.hidden { display: none !important; }

#turnstile-widget {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.error { color: #e74c3c; font-size: 13px; margin-top: 8px; }

/* ★ ตามคำขอผู้ใช้ ★ ข้อความเตือน "OTP ผิด" ค้างอยู่ใกล้ช่องกรอก (แยกจากป๊อปอัปที่ปิดไปแล้ว)
   จนกว่าลูกค้าจะกดส่ง OTP รอบใหม่ถึงจะหาย — ทำให้เด่นกว่า .error ปกตินิดหน่อยเพราะต้อง
   ค้างอยู่นาน ไม่ใช่แค่เตือนวูบเดียว */
.otp-wrong-inline-hint {
  text-align: center;
  font-weight: 700;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
}

.hint { font-size: 13px; color: #9aa39d; text-align: center; margin: 6px 0; }

.queue-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid #3a4a3e;
  background: #10160f;
}

.queue-box button {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 13px;
  flex: 0 0 auto;
}

.queue-box.queue-free { border-color: #1f8a4c; background: rgba(31, 138, 76, 0.1); color: #6fd39a; }
.queue-box.queue-busy { border-color: #e74c3c; background: rgba(231, 76, 60, 0.1); color: #f19187; }

.warning-box {
  font-size: 12.5px;
  line-height: 1.6;
  color: #f0c869;
  background: rgba(232, 185, 35, 0.08);
  border: 1px solid rgba(232, 185, 35, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.warning-box b { color: #ffd75e; }

#no-leave-warning { margin-top: 10px; margin-bottom: 0; text-align: center; }

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#status-text { text-align: center; color: #9aa39d; margin: 0; }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #3a4a3e;
  border-top-color: #e8b923;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

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

#screenshot {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #3a4a3e;
  margin: 14px 0;
}

.result-box {
  text-align: center;
}

.result-icon {
  width: 48px;
  height: 48px;
  margin: 4px auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.result-icon.success { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.result-icon.failure { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }

#result-text { font-size: 15px; text-align: center; margin: 0; font-weight: 600; }

#retry-email-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #243026;
  text-align: left;
}

.footer-brand {
  text-align: center;
  font-size: 12px;
  color: #556058;
  margin: 28px 0 4px;
}

/* ★ ตามคำขอผู้ใช้ ★ ป๊อปอัป "วิธีเข้าเกม" — โผล่จากปุ่มในหน้าเชื่อมสำเร็จ เดิมเป็นปุ่ม
   ghost (ขอบบางๆ) ไม่ค่อยเด่น ปรับให้เป็นปุ่มไล่สีทอง-เขียวแบบเดียวกับปุ่ม "วิธีใช้งาน"
   บนหน้าแรก (.how-to-btn) ให้สะดุดตา ไม่พลาดดูขั้นตอนสำคัญนี้ */
#btn-how-to-enter-game {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(232, 185, 35, 0.22), rgba(31, 138, 76, 0.22));
  border: 1px solid #e8b923;
  color: #ffd75e;
  font-weight: 700;
}
#btn-how-to-enter-game:hover {
  background: linear-gradient(90deg, rgba(232, 185, 35, 0.35), rgba(31, 138, 76, 0.35));
}

.screenshot-reminder {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #ffd75e;
  background: rgba(232, 185, 35, 0.1);
  border: 1px solid rgba(232, 185, 35, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
}

.how-enter-intro { margin-top: 0; }

.device-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.device-toggle-btn {
  flex: 1;
  margin-top: 0;
  padding: 10px;
  background: transparent;
  border: 1px solid #3a4a3e;
  color: #9aa39d;
}
.device-toggle-btn:hover { background: rgba(255, 255, 255, 0.04); }
.device-toggle-btn.active {
  background: rgba(31, 138, 76, 0.15);
  border-color: #1f8a4c;
  color: #6fd39a;
  font-weight: 700;
}

.device-content .hint { text-align: left; margin: 14px 0 6px; }
.device-content .hint:first-child { margin-top: 0; }

.how-enter-steps {
  margin: 0 0 4px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.7;
}

.how-enter-links {
  font-size: 12.5px;
  line-height: 1.8;
  color: #9aa39d;
  margin: 10px 0 4px;
}

.how-enter-divider {
  text-align: center;
  font-size: 12px;
  color: #6b756e;
  margin: 14px 0;
}

.how-enter-footer {
  text-align: center;
  font-size: 12.5px;
  color: #9aa39d;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid #243026;
}

.modal-body a {
  color: #6fd39a;
  text-decoration: underline;
}
.modal-body a:hover { color: #8ee6ab; }

.footer-brand b { color: #9aa39d; }
