/* โทนสีเดียวกับ sarshopconnect24.com/ea - เขียว/ทองเข้มบนพื้นดำอมเขียว */

* { 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", "Noto Sans Thai", 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;
  }
}

.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)); }

.header-with-home { display: flex; align-items: stretch; gap: 10px; margin-bottom: 22px; }

/* ★ ตามคำขอผู้ใช้ (08/09/2569) ★ .game-select ตอนนี้เป็นดรอปดาวน์สลับเกมได้จริงแล้ว (เดิม
   เป็นแค่ป้ายแสดงผลเฉยๆ) - .game-select เป็น wrapper ตำแหน่งสัมพัทธ์ (สำหรับ dropdown ที่
   ลอยอยู่ข้างใน), .game-select-btn คือแถวที่เห็น/กดได้จริง */
.game-select {
  position: relative;
  flex: 1 1 0;
  min-width: 120px;
}

.game-select-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #3a4a3e;
  background: #10160f;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.game-select-btn:hover { border-color: #e8b923; }

.game-icon {
  height: 34px;
  width: 34px;
  border-radius: 8px;
  flex: 0 0 auto;
  object-fit: cover;
}

.game-text { flex: 1 1 auto; min-width: 0; }

.game-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chevron {
  flex: 0 0 auto;
  color: #6f7d72;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.game-select.open .chevron { transform: rotate(180deg); }

.game-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  background: #161f19;
  border: 1px solid #3a4a3e;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.game-select.open .game-dropdown { display: block; }

.game-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  cursor: pointer;
  color: #e8e8e8;
  text-decoration: none;
}
.game-option img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: 0 0 auto; }
.game-option:hover { background: rgba(232, 185, 35, 0.1); }
.game-option.selected { background: rgba(232, 185, 35, 0.15); color: #ffd75e; font-weight: 600; }

.back-link {
  display: block; text-align: center;
  font-size: 15px; font-weight: 800; color: #fff; text-decoration: none;
  padding: 8px 16px; border: none; border-radius: 10px;
  background: #1f8a4c; transition: background 0.15s ease;
}
.back-link:hover { background: #14602f; }

.home-btn-inline {
  width: auto; flex: 0 0 auto; white-space: nowrap;
  display: flex; align-items: center; justify-content: center;
}

@media (max-width: 380px) {
  .header-with-home { flex-direction: column; }
  .game-select { min-width: 0; }
}

.steps {
  display: flex;
  align-items: flex-start;
  margin-bottom: 22px;
}

.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: 11px 6px 0;
}

.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  font-size: 12.5px;
  color: #c7cfc9;
  line-height: 1.6;
}

.agree-row input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: #e8b923;
}

.agree-row b { color: #ff6b6b; }

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

.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; }

.modal-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-box p.title { font-size: 16px; font-weight: 800; margin: 0 0 10px; text-align: center; }

.check-row {
  text-align: left; font-size: 13px; background: #10160f; border: 1px solid #3a4a3e;
  border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; line-height: 1.9;
}
.check-row b { color: #ffd75e; }

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

.queue-box button {
  width: auto;
  margin: 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; }

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

label:first-of-type { margin-top: 0; }

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; }

.warning-box {
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  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-top: 16px;
}

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

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.ghost {
  background: transparent;
  border: 1px solid #e8b923;
  color: #e8b923;
}
button.ghost:hover { background: rgba(232, 185, 35, 0.1); }

/* ★ ตามคำขอผู้ใช้ (08/09/2569 — เอาหลักการ EA มาใช้: ป็อปอัปยืนยันก่อนออกจากหน้าระหว่าง
   ทำงาน, ปุ่มยกเลิกเอง, ข้อความห้ามออกจากหน้า) ★ */
.stay-btn {
  background: #1f8a4c; color: #fff;
}
.stay-btn:hover { background: #14602f; }

.warning-critical { color: #ff6b6b; }

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

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

.progress-bar-wrap {
  width: 100%; height: 8px; border-radius: 999px; overflow: hidden;
  background: #10160f; border: 1px solid #243026; margin: 12px 0 4px;
}
.progress-bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #1f8a4c, #e8b923);
  transition: width 0.6s linear;
}

.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); } }

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

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

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

.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-icon.notice { background: rgba(232, 185, 35, 0.15); color: #ffd75e; }
/* ★ ตามคำขอผู้ใช้ (08/09/2569 — ป็อปอัปยืนยันก่อนเชื่อมบัญชี เตือน OVERWRITE เด่นๆ) ★
   โทนแดง แยกจากป็อปอัปเตือนทั่วไป (สีทอง) เพราะเคสนี้ทำให้ไอดีเดิมหายถาวร กู้คืนไม่ได้ */
.result-icon.danger {
  background: rgba(231, 76, 60, 0.15); color: #e74c3c;
  border: 1.5px solid rgba(231, 76, 60, 0.4); width: 64px; height: 64px; font-size: 30px;
}
.notice-modal-box {
  padding: 32px 24px 26px;
  text-align: center;
  align-items: center;
}
.notice-modal-box.danger-modal-box { border-color: rgba(231, 76, 60, 0.35); }
.cancel-btn {
  background: #e74c3c; border: none; color: #fff;
  display: block; width: 100%; margin-top: 14px; padding: 12px; border-radius: 9px;
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.cancel-btn:hover { background: #b83a2d; }

#statusTitle {
  text-align: center;
  font-size: 18px;
  margin: 0 0 8px;
}

.status-message {
  text-align: center;
  color: #9aa39d;
  font-size: 13.5px;
  line-height: 1.7;
  margin: 0 0 18px;
  white-space: pre-line;
}

.status-detail {
  border-top: 1px solid #243026;
  padding-top: 14px;
  font-size: 13px;
}

.status-detail div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: #e8e8e8;
}

.status-detail span { color: #9aa39d; }

.footer {
  text-align: center;
  margin-top: 18px;
  font-size: 11.5px;
  color: #556058;
}

.hidden { display: none !important; }
