:root {
  --primary: #CC0033;
  --primary-dark: #980026;
  --primary-soft: #FFF0F4;
  --primary-soft-2: #FFE4EB;
  --ink: #18181B;
  --muted: #71717A;
  --line: #E8E8EC;
  --panel: #FFFFFF;
  --page: #FAFAFB;
  --success: #087A4B;
  --danger: #B42318;
  --warning: #9A6700;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(31, 31, 38, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  color: var(--muted);
}
.boot-mark,
.brand-logo {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}
.boot-mark {
  width: 58px;
  height: 58px;
  margin: auto;
  border-radius: 18px;
  font-size: 25px;
  box-shadow: 0 16px 34px rgba(204, 0, 51, .22);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(232, 232, 236, .9);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}
.header-inner {
  width: min(1100px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand-logo {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 20px;
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand-copy span { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.member-chip {
  max-width: 190px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 96px;
}
.auth-shell {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(380px, 1.1fr);
  align-items: center;
  gap: 44px;
  padding-block: 42px 72px;
}
.auth-intro .eyebrow,
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}
.auth-intro h1 {
  margin: 13px 0 12px;
  max-width: 560px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.auth-intro p { max-width: 570px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.feature-list { display: grid; gap: 10px; margin-top: 24px; }
.feature-item { display: flex; gap: 10px; align-items: flex-start; color: #3F3F46; font-size: 13px; }
.feature-icon { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 900; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card { padding: 28px; }
.card-head { margin-bottom: 20px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #3F3F46; font-size: 12px; font-weight: 800; }
.required { color: var(--primary); }
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #DCDCE2;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(204, 0, 51, .09);
}
.input[readonly] { background: #F5F5F7; color: #52525B; }
.textarea { min-height: 92px; resize: vertical; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.5; }
.check-row { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.check-row input { margin-top: 3px; accent-color: var(--primary); }

.btn {
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 850;
  transition: transform .18s, opacity .18s, background .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 12px 26px rgba(204, 0, 51, .18); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.btn-soft { color: var(--primary-dark); background: var(--primary-soft); }
.btn-danger-soft { color: var(--danger); background: #FFF0EF; }
.btn-sm { min-height: 36px; padding: 8px 11px; border-radius: 11px; font-size: 12px; }
.text-button { border: 0; background: transparent; color: var(--primary); padding: 0; font-weight: 850; }
.auth-switch { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.device-lock {
  display: flex;
  gap: 10px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid #F2C3CF;
  border-radius: 13px;
  background: var(--primary-soft);
  color: #7F1230;
  font-size: 11px;
  line-height: 1.55;
}

.top-nav {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  overflow-x: auto;
}
.nav-btn {
  flex: 1 0 auto;
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.nav-btn.active { color: #fff; background: var(--primary); }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-title h1 { margin: 4px 0 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -.025em; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.summary-hero {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 18px;
  padding: 26px;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--primary), #8F0024);
  box-shadow: 0 24px 54px rgba(145, 0, 36, .2);
}
.summary-hero small { color: rgba(255,255,255,.72); }
.summary-hero h2 { margin: 6px 0 4px; font-size: 25px; }
.points-number { display: block; margin-top: 8px; font-size: clamp(42px, 8vw, 64px); line-height: 1; letter-spacing: -.04em; }
.points-label { color: rgba(255,255,255,.72); font-size: 12px; }
.summary-side { display: grid; align-content: center; gap: 10px; }
.summary-mini { padding: 13px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; background: rgba(255,255,255,.1); }
.summary-mini span { display: block; color: rgba(255,255,255,.7); font-size: 11px; }
.summary-mini strong { display: block; margin-top: 3px; font-size: 18px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.stat-card { padding: 18px; }
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin-top: 4px; font-size: 25px; }
.section-card { margin-top: 14px; padding: 22px; }
.section-card h3 { margin: 0 0 14px; font-size: 17px; }

.progress-head { display: flex; justify-content: space-between; gap: 15px; align-items: flex-end; }
.progress-head strong { font-size: 18px; }
.progress-head span { color: var(--muted); font-size: 11px; text-align: right; }
.progress-track { height: 10px; margin-top: 12px; border-radius: 999px; background: #F0F0F3; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--primary); }
.milestone-row { display: flex; gap: 9px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.milestone-pill { flex: 0 0 auto; min-width: 132px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.milestone-pill.reached { border-color: #F0AFC0; background: var(--primary-soft); }
.milestone-pill strong { display: block; font-size: 12px; }
.milestone-pill span { color: var(--muted); font-size: 10px; }

.history-list { display: grid; gap: 9px; }
.history-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); }
.history-copy strong { display: block; font-size: 12px; }
.history-copy small { color: var(--muted); font-size: 10px; }
.point-change { font-size: 12px; font-weight: 900; }
.point-change.plus { color: var(--success); }
.point-change.minus { color: var(--primary); }

.upload-box {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px 18px;
  border: 1.5px dashed #D7A1AF;
  border-radius: 16px;
  background: #FFFAFB;
  text-align: center;
}
.upload-box.drag { background: var(--primary-soft); border-color: var(--primary); }
.upload-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 24px; }
.upload-box small { color: var(--muted); font-size: 10px; }
.file-name { color: var(--success); font-size: 11px; font-weight: 800; word-break: break-all; }

.reward-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.reward-card { overflow: hidden; }
.reward-visual { min-height: 125px; display: grid; place-items: center; background: linear-gradient(145deg, var(--primary-soft), #fff); font-size: 52px; }
.reward-body { padding: 17px; }
.reward-body h3 { margin: 0; font-size: 15px; }
.reward-body p { min-height: 38px; margin: 6px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.reward-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.point-pill { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 10px; font-weight: 900; }
.locked { opacity: .6; }

.notice { display: flex; gap: 10px; padding: 13px; border: 1px solid #F0C5CF; border-radius: 13px; background: var(--primary-soft); color: #7F1230; font-size: 11px; line-height: 1.55; }
.notice.success { border-color: #B7E2CF; background: #EEFBF5; color: #126344; }
.notice.danger { border-color: #F0B6B0; background: #FFF1F0; color: var(--danger); }
.empty { padding: 32px 18px; color: var(--muted); text-align: center; font-size: 12px; }
.loading { padding: 40px; color: var(--muted); text-align: center; }
.spinner { width: 27px; height: 27px; margin: 0 auto 9px; border: 3px solid #EEE; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(24,24,27,.58); }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; border-radius: 20px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 11px; background: #F1F1F4; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 120; max-width: min(390px, calc(100vw - 36px)); padding: 13px 15px; border-radius: 13px; background: #202024; color: #fff; box-shadow: 0 18px 48px rgba(0,0,0,.25); transform: translateY(24px); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: none; opacity: 1; }
.toast.success { background: #086B43; }
.toast.error { background: #A51E1E; }
.footer { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 30px; color: var(--muted); text-align: center; font-size: 10px; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .auth-intro h1 { font-size: 38px; }
  .summary-hero { grid-template-columns: 1fr; }
  .summary-side { grid-template-columns: 1fr 1fr; }
  .reward-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .header-inner, .shell, .footer { width: min(100% - 22px, 1100px); }
  .header-inner { min-height: 62px; }
  .brand-logo { width: 38px; height: 38px; border-radius: 12px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy span { max-width: 130px; }
  .member-chip { display: none; }
  .shell { padding-top: 18px; }
  .auth-shell { min-height: auto; padding: 10px 0 50px; }
  .auth-intro { padding: 8px 4px; }
  .auth-intro h1 { font-size: 32px; }
  .auth-card { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .top-nav { position: sticky; top: 70px; z-index: 20; }
  .nav-btn { padding-inline: 12px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .summary-hero { padding: 21px; }
  .summary-side { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 .stat-card:last-child { grid-column: 1 / -1; }
  .reward-grid { grid-template-columns: 1fr; }
  .section-card { padding: 18px 15px; }
}

/* V1.10: หน้าโปรโมชันก่อนลงทะเบียน */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.welcome-view {
  background: #F7F2F5;
}
body.welcome-view #app {
  min-height: 100dvh;
}
.welcome-page {
  min-height: 100dvh;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 0 0 22px;
  background:
    radial-gradient(circle at 50% -10%, rgba(204, 0, 51, .10), transparent 38%),
    #F7F2F5;
}
.welcome-card {
  width: min(100%, 560px);
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 18px 55px rgba(62, 9, 30, .12);
}
.welcome-art {
  position: relative;
  width: 100%;
  line-height: 0;
  background: #6D1336;
}
.welcome-art img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.welcome-hotspot {
  position: absolute;
  left: 32.5%;
  top: 84.9%;
  width: 35%;
  height: 8.5%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.welcome-hotspot::after {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .65);
  transition: box-shadow .18s ease, transform .18s ease;
}
.welcome-hotspot:hover::after,
.welcome-hotspot:focus-visible::after {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .78), 0 8px 24px rgba(79, 0, 30, .24);
  transform: scale(1.02);
}
.welcome-hotspot:focus-visible {
  outline: none;
}
.welcome-hotspot:active {
  transform: scale(.98);
}
.welcome-account-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 8px;
  padding: 14px 18px 16px;
  color: var(--muted);
  background: #FFFFFF;
  font-size: 12px;
  line-height: 1.55;
}
.welcome-account-links .text-button {
  min-height: 30px;
  padding: 3px 2px;
}
.welcome-separator {
  color: #C9AAB5;
}
@media (min-width: 620px) {
  .welcome-page { padding: 24px; align-content: center; }
  .welcome-card { border-radius: 24px; }
}

/* V1.12 — หน้าแรก RG4 สไตล์อวกาศ + ป๊อปอัปโปรโมชั่น */
body.landing-view {
  background: #170008;
  overflow-x: hidden;
}
body.landing-view #app { min-height: 100dvh; }
.rg4-landing {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 69, 112, .34), transparent 34%),
    radial-gradient(circle at 8% 35%, rgba(204, 0, 51, .30), transparent 24%),
    radial-gradient(circle at 92% 48%, rgba(255, 186, 64, .16), transparent 28%),
    linear-gradient(180deg, #24000b 0%, #65001f 48%, #170008 100%);
}
.rg4-landing::before,
.rg4-landing::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid rgba(255, 205, 101, .42);
  box-shadow: 0 0 60px rgba(204, 0, 51, .30), inset 0 0 50px rgba(255, 191, 76, .12);
}
.rg4-landing::before { width: 70vw; height: 70vw; max-width: 760px; max-height: 760px; top: -270px; left: 50%; transform: translateX(-50%); }
.rg4-landing::after { width: 280px; height: 280px; right: -140px; bottom: 5%; }
.rg4-stars,
.rg4-stars::before,
.rg4-stars::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.92) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255,204,102,.88) 0 1px, transparent 1.4px);
  background-size: 71px 71px, 113px 113px;
  background-position: 4px 11px, 35px 47px;
  opacity: .42;
}
.rg4-stars::before { transform: scale(1.25) rotate(9deg); opacity: .28; }
.rg4-stars::after { transform: scale(.8) rotate(-8deg); opacity: .2; }
.rg4-login-frame {
  position: relative;
  width: min(100%, 620px);
  border: 1px solid rgba(255, 207, 103, .72);
  border-radius: 32px;
  padding: 8px;
  background: linear-gradient(145deg, rgba(125, 0, 34, .88), rgba(31, 0, 11, .97));
  box-shadow:
    0 0 0 2px rgba(204, 0, 51, .32),
    0 0 42px rgba(204, 0, 51, .44),
    0 28px 90px rgba(0, 0, 0, .62),
    inset 0 0 44px rgba(255, 193, 77, .13);
}
.rg4-login-frame::before {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: 38px;
  background: linear-gradient(120deg, #ffd66b, #ff4f78 35%, #cc0033 70%, #ffb742);
  filter: blur(7px);
  opacity: .55;
}
.rg4-mascot-wrap {
  overflow: hidden;
  border-radius: 25px 25px 14px 14px;
  background: #3a0012;
  line-height: 0;
}
.rg4-mascot-wrap img { display: block; width: 100%; height: auto; }
.rg4-panel {
  position: relative;
  margin-top: -28px;
  padding: 28px 28px 24px;
  border: 1px solid rgba(255, 205, 103, .7);
  border-radius: 27px;
  background:
    linear-gradient(180deg, rgba(105, 0, 31, .98), rgba(31, 0, 11, .99)),
    #210009;
  box-shadow: inset 0 0 55px rgba(204, 0, 51, .20), 0 -12px 35px rgba(0,0,0,.3);
}
.rg4-panel::before,
.rg4-panel::after {
  content: "";
  position: absolute;
  width: 62px;
  height: 5px;
  top: 14px;
  border-radius: 999px;
  background: #ffd267;
  box-shadow: 0 0 16px #ff9f3f;
}
.rg4-panel::before { left: 24px; }
.rg4-panel::after { right: 24px; }
.rg4-brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 2px auto 14px;
  color: #fff2d2;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .07em;
}
.rg4-brand-badge span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #65001f;
  background: linear-gradient(145deg, #fff1b6, #ffb43c);
  box-shadow: 0 0 22px rgba(255, 191, 67, .70);
}
.rg4-login-title { text-align: center; }
.rg4-login-title > span { color: #ffd36b; font-size: 10px; font-weight: 900; letter-spacing: .25em; }
.rg4-login-title h1 { margin: 8px 0 3px; color: #fff; font-size: clamp(27px, 7vw, 39px); line-height: 1.15; text-shadow: 0 0 20px rgba(255, 67, 109, .44); }
.rg4-login-title p { margin: 0; color: #e7a7b9; font-size: 12px; line-height: 1.65; }
.rg4-line-chip {
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 210, 105, .35);
  border-radius: 999px;
  color: #fff4dc;
  background: rgba(94, 0, 29, .52);
  font-size: 11px;
}
.rg4-line-chip span { color: #64f39a; font-weight: 900; }
.rg4-line-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg4-login-form { display: grid; gap: 13px; margin-top: 18px; }
.rg4-login-form > label { display: grid; gap: 6px; color: #ffe4eb; font-size: 12px; font-weight: 800; }
.rg4-login-form label small { color: #bd8394; font-size: 10px; font-weight: 500; }
.rg4-input-wrap {
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  border: 1px solid rgba(255, 195, 80, .62);
  border-radius: 14px;
  background: rgba(36, 0, 12, .90);
  box-shadow: inset 0 0 20px rgba(204, 0, 51, .16), 0 0 0 1px rgba(90, 0, 27, .65);
  transition: border-color .18s, box-shadow .18s;
}
.rg4-input-wrap:focus-within { border-color: #ffd36b; box-shadow: 0 0 0 3px rgba(255, 206, 96, .14), 0 0 24px rgba(204, 0, 51, .24); }
.rg4-input-wrap b { display: grid; place-items: center; height: 30px; border-right: 1px solid rgba(255, 207, 110, .23); color: #ffd36b; font-size: 18px; }
.rg4-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff8f2;
  background: transparent;
  padding: 13px 14px;
  font-size: 15px;
}
.rg4-input-wrap input::placeholder { color: #936274; }
.rg4-consent { grid-template-columns: 20px 1fr !important; align-items: start; gap: 8px !important; color: #c99cab !important; font-size: 10px !important; font-weight: 500 !important; line-height: 1.55; }
.rg4-consent input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: #cc0033; }
.rg4-login-button {
  min-height: 56px;
  border: 1px solid #ffd36b;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(180deg, #ef174e 0%, #a6002b 100%);
  box-shadow: 0 0 25px rgba(204, 0, 51, .55), inset 0 1px 0 rgba(255,255,255,.45);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .04em;
}
.rg4-login-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.rg4-login-button:disabled { opacity: .6; transform: none; }
.rg4-login-button span { color: #fff0b8; margin-right: 8px; }
.rg4-bonus-banner {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 210, 73, .45);
  border-radius: 13px;
  text-align: center;
  background: linear-gradient(110deg, rgba(255, 184, 0, .14), rgba(255, 227, 119, .04));
}
.rg4-bonus-banner strong { color: #ffe277; font-size: 13px; }
.rg4-bonus-banner span { color: #a89c74; font-size: 9px; }
.rg4-register-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  color: #c1909f;
  font-size: 11px;
}
.rg4-register-actions button { border: 0; padding: 2px; color: #ffd36b; background: transparent; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.rg4-register-actions i { color: #7d3a50; font-style: normal; }

.promo-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 0, 9, .82);
  backdrop-filter: blur(10px);
  animation: promoFade .2s ease-out;
}
.promo-popup-card { position: relative; width: min(92vw, 480px); }
.promo-popup-image { display: block; width: 100%; padding: 0; overflow: hidden; border: 1px solid rgba(255, 210, 105, .82); border-radius: 22px; background: #3c0013; box-shadow: 0 0 45px rgba(204, 0, 51, .56), 0 30px 90px rgba(0,0,0,.6); }
.promo-popup-image img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #28000d; }
.promo-popup-close {
  position: absolute;
  z-index: 2;
  top: -13px;
  right: -10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  color: #fff;
  background: #7a0024;
  box-shadow: 0 0 18px rgba(255, 183, 66, .55);
  font-size: 24px;
  line-height: 1;
}
@keyframes promoFade { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 640px) {
  .rg4-landing { padding: 0; align-items: start; }
  .rg4-login-frame { width: 100%; min-height: 100dvh; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
  .rg4-login-frame::before { display: none; }
  .rg4-mascot-wrap { border-radius: 0; }
  .rg4-panel { margin-top: -22px; border-left: 0; border-right: 0; border-bottom: 0; border-radius: 25px 25px 0 0; padding: 25px 18px max(24px, env(safe-area-inset-bottom)); min-height: 54dvh; }
  .rg4-brand-badge { font-size: 17px; }
  .rg4-login-title h1 { font-size: 27px; }
  .promo-popup-backdrop { padding: 14px; }
  .promo-popup-card { width: min(94vw, 420px); }
}


/* V1.13.1 — แสดงมาสคอตและกรอบเข้าสู่ระบบเต็มภาพ ไม่ซ้อนทับกัน */
.rg4-login-frame { overflow: hidden; }
.rg4-mascot-wrap {
  position: relative;
  z-index: 1;
  border-radius: 25px 25px 0 0;
}
.rg4-mascot-wrap img {
  width: 100%;
  height: auto;
  aspect-ratio: 760 / 420;
  object-fit: contain;
  object-position: center;
}
.rg4-panel {
  z-index: 2;
  margin-top: 0;
  border-radius: 0 0 27px 27px;
  border-top-color: rgba(255, 205, 103, .45);
}
@media (max-width: 640px) {
  .rg4-login-frame { min-height: auto; }
  .rg4-mascot-wrap { border-radius: 0; }
  .rg4-mascot-wrap img { aspect-ratio: 760 / 420; object-fit: contain; }
  .rg4-panel {
    margin-top: 0;
    min-height: auto;
    border-top: 1px solid rgba(255, 205, 103, .45);
    border-radius: 0;
    padding-top: 29px;
  }
}


/* V1.14 — เงื่อนไขใช้แต้มแลกรางวัลใต้เมนูส่งสลิป */
.redemption-conditions-card {
  position: relative;
  overflow: hidden;
  border-color: #E7B4C1;
  background:
    radial-gradient(circle at 92% 7%, rgba(255, 205, 103, .24), transparent 28%),
    linear-gradient(155deg, #FFF9F3 0%, #FFF0F4 58%, #FFFFFF 100%);
}
.redemption-conditions-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #7A001F, #CC0033, #FFCD67, #CC0033, #7A001F);
}
.redemption-conditions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.redemption-conditions-head h3 { margin: 3px 0 4px; color: #620019; font-size: 20px; }
.redemption-conditions-head p { margin: 0; color: #7B5861; font-size: 12px; }
.deposit-point-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(204, 0, 51, .14);
  border-radius: 999px;
  background: #FFF4F6;
  color: #9F1638;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(204, 0, 51, .045);
}
.deposit-point-mini > span:first-child { color: #CC0033; font-size: 11px; }
.redemption-balance {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid #E7B44E;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFF2B5, #FFCD67);
  color: #6B2100;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(204, 0, 51, .08);
}
.redemption-condition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.redemption-condition {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #E9CDD4;
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 25px rgba(73, 0, 20, .045);
}
.redemption-condition.special {
  border-color: #E2B34C;
  background: linear-gradient(135deg, #FFF8D9, #FFF0F4);
}
.redemption-condition.available { border-color: #D99AAB; box-shadow: 0 10px 25px rgba(204, 0, 51, .09); }
.redemption-condition-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #FFF1B5, #FFCD67);
  font-size: 23px;
}
.redemption-condition-copy { min-width: 0; }
.redemption-condition-copy span,
.redemption-condition-copy strong,
.redemption-condition-copy small { display: block; }
.redemption-condition-copy span { color: #A00028; font-size: 10px; font-weight: 900; }
.redemption-condition-copy strong { margin-top: 2px; color: #3B0715; font-size: 14px; }
.redemption-condition-copy small { margin-top: 3px; color: #8B6B73; font-size: 9px; line-height: 1.4; }
.redemption-condition-status {
  padding: 6px 8px;
  border-radius: 999px;
  background: #F6ECEF;
  color: #8B5865;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}
.redemption-condition.available .redemption-condition-status { background: #EAF8F1; color: #087A4B; }
.redemption-go-button { width: 100%; margin-top: 14px; }
.redemption-note { margin-top: 10px; }
@media (max-width: 680px) {
  .redemption-conditions-head { align-items: stretch; flex-direction: column; }
  .redemption-balance { align-self: flex-start; }
  .redemption-condition-grid { grid-template-columns: 1fr; }
  .redemption-condition { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 12px; }
}

/* V1.15 — Reward catalog with editable promotion images */
.reward-catalog {
  align-items: stretch;
  gap: 16px;
}
.reward-catalog .reward-card {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #eee6e9;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(74, 15, 34, .055);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.reward-catalog .reward-card:not(.locked):hover {
  transform: translateY(-3px);
  border-color: #e8bac6;
  box-shadow: 0 18px 42px rgba(117, 0, 33, .11);
}
.reward-catalog .reward-visual {
  min-height: 158px;
  height: 158px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 14px 18px;
  border-bottom: 1px solid #f1e8eb;
  background:
    radial-gradient(circle at 48% 0%, rgba(255,255,255,.98), transparent 64%),
    linear-gradient(145deg, #fffafb, #fff4f6);
}
.reward-catalog .reward-visual.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.reward-catalog .reward-visual.fallback {
  background: linear-gradient(145deg, #fff6f8, #fff);
}
.reward-fallback-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff1c2, #ffd66d);
  font-size: 42px;
  box-shadow: 0 12px 25px rgba(181, 105, 0, .13);
}
.reward-catalog .reward-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}
.reward-catalog .reward-copy { flex: 1; }
.reward-catalog .reward-body h3 {
  margin: 0;
  color: #262126;
  font-size: 16px;
  line-height: 1.35;
}
.reward-catalog .reward-body p {
  min-height: 0;
  margin: 7px 0 0;
  color: #8b8085;
  font-size: 11px;
  line-height: 1.65;
}
.reward-catalog .reward-meta {
  align-items: center;
  margin-top: auto;
}
.reward-catalog .point-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 0;
  background: #fff0f4;
  color: #d4003c;
  font-size: 10px;
  font-weight: 900;
}
.reward-redeem-button {
  min-width: 104px;
  min-height: 36px;
  padding-inline: 13px;
  border-radius: 12px;
  white-space: nowrap;
}
.reward-catalog .reward-card.locked {
  opacity: .66;
  filter: saturate(.72);
}
.reward-catalog .reward-card.locked .reward-visual img { filter: grayscale(.08); }

@media (max-width: 860px) {
  .reward-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .reward-catalog { grid-template-columns: 1fr; }
  .reward-catalog .reward-visual { height: 176px; min-height: 176px; }
  .reward-catalog .reward-meta { gap: 10px; }
  .reward-redeem-button { min-width: 116px; }
}
