:root {
  --green: #9fe86c;
  --green-dark: #8bdf57;
  --green-soft: #eefbe2;
  --green-ink: #3a6b1c; /* readable green for text/accents on light bg */
  --ink: #1f2937;
  --muted: #8a94a6;
  --line: #e6e9ef;
  --bg: #f4f7fb;
  --red: #e5484d;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 40, 80, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 120% at 50% -10%, #ffffff 0%, var(--bg) 60%) fixed;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.logo__mark {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--green-ink);
}
.logo__sub { font-size: 10px; color: var(--muted); margin-top: 3px; }

.nav { display: flex; gap: 6px; margin-left: auto; }
.nav__link {
  text-decoration: none;
  color: #475569;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.nav__link:hover { background: #eef2f7; }
.nav__link--active { background: #e7f0ff; color: #1d4ed8; }

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  cursor: pointer;
  color: #334155;
  font-family: inherit;
  font-size: 14px;
  transition: box-shadow .15s, transform .1s;
}
.cart-btn:hover { box-shadow: var(--shadow); }
.cart-btn:active { transform: scale(.97); }
.cart-btn__count {
  position: absolute;
  top: -6px; left: 22px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--green-ink);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* auth area (navbar) */
.auth-area { display: flex; align-items: center; }
.login-link {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.login-link:hover { box-shadow: var(--shadow); }
.login-link:active { transform: scale(.97); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-chip__link { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.user-chip__link:hover .user-chip__name { color: var(--green-ink); }
.user-chip__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: var(--green-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
}
.user-chip__name { font-size: 14px; font-weight: 600; color: #334155; }
.user-chip__logout {
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.user-chip__logout:hover { color: var(--red); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 40px 20px 24px; }
.hero__draw {
  display: inline-block;
  background: #e7f0ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero__title {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.5px;
}
.hero__title span { color: var(--green-ink); }
.hero__subtitle { color: var(--muted); margin: 12px 0 0; font-size: 16px; }

/* ---------- Layout ---------- */
.layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px 64px;
}

/* ---------- Cards ---------- */
.content { display: flex; flex-direction: column; gap: 20px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ---------- Input card ---------- */
.input-card__title {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
}
.otp-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
.otp { display: flex; gap: 8px; }
.otp__box {
  width: 70px;
  height: 84px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.otp__box:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}
.otp__box.filled { border-color: var(--green); background: var(--green-soft); }
.otp__box.is-random { color: #94a3b8; }
.otp__box::placeholder { color: #d4dae3; font-weight: 700; }
.otp.error .otp__box { border-color: var(--red); background: #fdeced; }

/* span from left edge of box 2 to right edge of box 5: inset one box (70px) + one gap (8px) each side */
.otp-actions { display: flex; gap: 10px; width: calc(100% - 156px); }
.btn.icon-btn {
  height: 60px;
  padding: 0;
  display: grid;
  place-items: center;
}
.btn.icon-btn#clearBtn {
  flex: 1;
  background: #ff9b85;
  border-color: #ff9b85;
  color: #fff;
}
.btn.icon-btn.icon-btn--add { flex: 3; } /* 3x the clear button */
.btn.icon-btn#clearBtn:hover { background: #ff876d; border-color: #ff876d; }
.icon-btn--add .icon-check { display: none; }
.icon-btn--add.is-success .icon-cart { display: none; }
.icon-btn--add.is-success .icon-check { display: block; }
.icon-btn--add.is-success { background: var(--green); border-color: var(--green); }
.input-card__hint {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0 0;
}
.input-card__hint.error { color: var(--red); }
.input-card__hint.ok { color: var(--green-ink); }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn--primary {
  background: var(--green);
  color: var(--green-ink);
  box-shadow: 0 6px 16px rgba(159, 232, 108, .5);
}
.btn--primary:hover { background: var(--green-dark); }
.btn--ghost {
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #dbe5ff;
  padding: 12px 22px;
  font-size: 15px;
}
.btn--ghost:hover { background: #f3f7ff; }

/* ---------- Cart card ---------- */
.cart-card__title { margin: 0 0 16px; font-size: 22px; font-weight: 700; }
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 0;
  font-size: 15px;
  margin: 0;
}

.ticket {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  background: #fcfdfe;
  animation: pop .1s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
/* blue square mock logo */
.ticket__thumb {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(140deg, #2f6bff, #1d4ed8);
  box-shadow: 0 4px 10px rgba(29, 78, 216, .3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.ticket__thumb-grid { display: none; }
.ticket__thumb-num {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .5px;
  color: #fff;
}
/* gold number plate (clickable to re-load into input) */
.ticket__number {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 5px;
  background: linear-gradient(135deg, #fff6db, #ffe7a8);
  border: 1px solid #f3d98f;
  color: #7a5500;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}
.ticket__number:hover { box-shadow: 0 2px 8px rgba(122, 85, 0, .25); }
.ticket__number:active { transform: scale(.97); }

/* stepper */
.stepper {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
}
.stepper__btn {
  width: 30px; height: 30px;
  border: none;
  background: #f1f4f9;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #334155;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .12s, transform .1s;
}
.stepper__btn:hover { background: #e3e8f0; }
.stepper__btn:active { transform: scale(.9); }
.stepper__qty {
  width: 44px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 0;
}
.stepper__qty:focus { background: #eef2f7; }
/* hide number-input spinners */
.stepper__qty::-webkit-outer-spin-button,
.stepper__qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-card__footer {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* promo */
.promo__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background .15s;
}
.promo__toggle:hover { background: #eef2f7; }
.promo__toggle .promo__icon { color: #1d4ed8; }
.promo__chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.promo__toggle[aria-expanded="true"] .promo__chev { transform: rotate(180deg); }
.promo__panel { margin-top: 12px; }
.promo__panel[hidden] { display: none; }
.promo__field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.promo__field:focus-within { border-color: #1d4ed8; box-shadow: 0 0 0 4px #e7f0ff; }
.promo__field.is-applied { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.promo__icon { color: var(--muted); flex-shrink: 0; }
#promoInput {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  background: none;
  text-transform: uppercase;
  color: var(--ink);
  min-width: 0;
}
#promoInput::placeholder { text-transform: none; color: var(--muted); }
.promo__apply {
  border: none;
  background: #1d4ed8;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.promo__apply:hover { background: #1746c0; }
.promo__apply:active { transform: scale(.96); }
.promo__msg { margin: 8px 2px 0; font-size: 13px; font-weight: 600; }
.promo__msg.ok { color: var(--green-ink); }
.promo__msg.err { color: var(--red); }

/* summary */
.summary { display: flex; flex-direction: column; gap: 8px; }
.summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  color: #475569;
}
.summary__row--discount { color: var(--green-ink); font-weight: 600; }
.summary__row--total {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.cart-total__value { font-size: 24px; font-weight: 800; color: var(--green-ink); }
#checkoutBtn { padding: 15px 24px; font-size: 16px; }

/* ---------- Payment / Login views ---------- */
.content[hidden] { display: none; }

/* login */
.auth-card { max-width: 420px; width: 100%; margin: 0 auto; text-align: center; }
.auth-card__lock {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-ink);
  display: grid;
  place-items: center;
}
.auth-card__title { margin: 0 0 6px; font-size: 23px; font-weight: 800; }
.auth-card__sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-card .field { margin-bottom: 16px; }
.auth-card__note { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.link-btn { background: none; border: none; padding: 0; color: var(--green-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
/* ----- async button loading state (spinner + locked) ----- */
.is-busy { cursor: progress !important; pointer-events: none; opacity: 0.9; }
.btn-spinner {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: none;
  border: none;
  color: #475569;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 8px;
}
.back-btn:hover { color: var(--ink); }

.pay-card { max-width: 460px; width: 100%; margin: 0 auto; text-align: center; }
.pay-card__title { margin: 0 0 20px; font-size: 24px; font-weight: 800; }
.pay-card__cta { width: 100%; padding: 15px; font-size: 17px; margin-top: 22px; }

.pay-amount {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--green-soft);
  border: 1px solid #d6f3bd;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 22px;
}
.pay-amount__label { font-size: 13px; color: #5b7a3e; }
.pay-amount__value { font-size: 32px; font-weight: 800; color: var(--green-ink); }
.pay-amount__qty { font-size: 13px; color: #5b7a3e; }

/* mock QR */
.qr {
  width: 200px; height: 200px;
  margin: 0 auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  box-shadow: var(--shadow);
}
.qr__cell { width: 100%; height: 100%; }
.qr__cell--on { background: #0f172a; }
.qr-cap { color: var(--muted); font-size: 13px; margin: 12px 0 20px; }

.bank {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
}
.bank__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-size: 15px;
}
.bank__row + .bank__row { border-top: 1px solid var(--line); }
.bank__row span { color: var(--muted); }
.bank__row strong { color: var(--ink); font-weight: 700; }
.bank__row--acct strong { font-size: 17px; letter-spacing: .5px; }
.copy-btn {
  border: 1px solid #dbe5ff;
  background: #f3f7ff;
  color: #1d4ed8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.copy-btn:hover { background: #e7f0ff; }
.copy-btn.copied { background: var(--green-soft); border-color: #d6f3bd; color: var(--green-ink); }

/* upload slip */
.upload {
  display: block;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 28px 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 20px;
}
.upload:hover { border-color: var(--green); background: var(--green-soft); }
.upload.has-file { padding: 10px; border-style: solid; border-color: var(--green); }
.upload__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #64748b;
}
.upload__placeholder span { font-weight: 600; font-size: 15px; }
.upload__placeholder small { font-size: 12px; color: var(--muted); }
.upload__preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

/* email field */
.field { text-align: left; margin-bottom: 6px; }
.field__label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field__input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field__input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.field__input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px #fdeced; }
.field__err { color: var(--red); font-size: 13px; margin: 8px 2px 0; }

/* success */
.pay-success { padding: 16px 0; }
.pay-success__check {
  width: 76px; height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--green);
  color: var(--green-ink);
  display: grid;
  place-items: center;
  animation: pop .1s ease;
}
.pay-success__title { margin: 0 0 10px; font-size: 24px; font-weight: 800; }
.pay-success__text { color: #475569; font-size: 15px; line-height: 1.6; margin: 0; }
.pay-success__text strong { color: var(--ink); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  animation: fade .1s ease;
}
.modal__card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  width: min(90vw, 380px);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: pop .1s ease;
}
.modal__title { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.modal__text { margin: 0 0 22px; color: #475569; font-size: 15px; }
.modal__text strong { color: var(--ink); letter-spacing: 2px; }
.modal__actions { display: flex; gap: 10px; }
.modal__actions .btn { flex: 1; }
.btn--danger { background: var(--red); color: #fff; padding: 12px; }
.btn--danger:hover { background: #cf3a3f; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav { display: none; }
  .cart-btn__label { display: none; }
  .hero { padding: 32px 20px 16px; }
  .hero__title { font-size: 28px; }
  .hero__subtitle { font-size: 14px; }
  .card { padding: 20px; }
  .input-card__title { font-size: 20px; }
  .otp-row { width: 100%; gap: 18px; }
  .otp { gap: 5px; width: 100%; justify-content: space-between; }
  .otp__box { flex: 1; min-width: 0; height: 72px; font-size: 30px; }
  .otp-actions { width: 100%; }
  .btn.icon-btn { height: 56px; }
  .cart-card__footer { flex-direction: column; align-items: stretch; }
  .cart-card__footer #checkoutBtn { width: 100%; }
}

@media (max-width: 520px) {
  .header__inner { gap: 12px; padding: 12px 16px; }
  .layout { padding: 8px 14px 48px; }
  /* ticket: number on its own row, controls below */
  .ticket { flex-wrap: wrap; gap: 10px 12px; padding: 14px; }
  .ticket__thumb { width: 64px; height: 38px; }
  .ticket__number { font-size: 20px; letter-spacing: 3px; }
  .otp { gap: 4px; }
  .otp__box { height: 64px; font-size: 26px; }
}

/* ============================================================
   Account portal
   ============================================================ */
/* navbar credit chip (account + shop pages) */
.acct-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  padding: 6px 14px;
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 12px;
}
.acct-balance__label { font-size: 11px; color: var(--green-ink); font-weight: 600; }
.acct-balance__value { font-size: 15px; font-weight: 800; color: var(--green-ink); }
.acct-menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  color: #334155;
  cursor: pointer;
}

.acct-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: start;
}

.acct-sidebar {
  position: sticky;
  top: 80px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.acct-user { display: flex; align-items: center; gap: 12px; padding: 6px 6px 16px; border-bottom: 1px solid var(--line); }
.acct-user__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green); color: var(--green-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.acct-user__meta { display: flex; flex-direction: column; line-height: 1.3; }
.acct-user__meta strong { font-size: 15px; }
.acct-user__meta span { font-size: 12px; color: var(--muted); }

.acct-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.acct-nav__group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 14px 8px 4px; }
.acct-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #334155;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: none; border: none; text-align: left; width: 100%;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.acct-nav__ic { width: 20px; text-align: center; }
.acct-nav__item:hover { background: #f3f7ff; }
.acct-nav__item.is-active { background: var(--green-soft); color: var(--green-ink); }
.acct-nav__item--soon { color: var(--muted); cursor: default; }
.acct-nav__item--soon:hover { background: #f7f8fa; }
.acct-logout {
  width: 100%; margin-top: 16px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 10px;
  font-family: inherit; font-weight: 600; font-size: 14px; color: #64748b;
  cursor: pointer;
}
.acct-logout:hover { color: var(--red); border-color: #f3c6c8; }
.acct-sidebar__scrim { display: none; }

.acct-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* portal buttons (anchors + buttons share .btn) */
.acct-main .btn, .wallet-hero .btn, .wallet-form .btn, .panel .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; font-size: 15px; text-decoration: none;
}

/* page head */
.page-head__title { margin: 0; font-size: 26px; }
.page-head__sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  text-decoration: none; color: var(--ink);
  transition: transform .12s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20,40,80,.1); }
.stat-card__label { font-size: 13px; color: var(--muted); }
.stat-card__value { font-size: 24px; font-weight: 800; color: var(--green-ink); }
.stat-card__sub { font-size: 12px; color: var(--muted); }

/* generic panel */
.panel { padding: 20px; }
.panel__head, .panel__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel__title { margin: 0 0 12px; font-size: 17px; }
.panel__head .panel__title { margin: 0; }
.panel__link { color: var(--green-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.panel__label { font-size: 13px; color: var(--muted); }
.panel__big { font-size: 18px; font-weight: 700; margin-top: 2px; }

/* wallet */
.wallet-hero {
  background: linear-gradient(135deg, var(--green-soft), #fff);
  border-color: var(--green);
}
.wallet-hero__top { display: flex; flex-direction: column; gap: 2px; }
.wallet-hero__label { font-size: 14px; color: var(--green-ink); font-weight: 600; }
.wallet-hero__value { font-size: 38px; font-weight: 800; color: var(--green-ink); }
.wallet-hero__actions { display: flex; gap: 10px; margin-top: 16px; }
.wallet-hero__hint { margin: 14px 0 0; font-size: 13px; color: #5b6b53; }
.wallet-form { border-color: var(--green); }
.wallet-form__note { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.wallet-form__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* transaction list */
.txn-list { list-style: none; margin: 0; padding: 0; }
.txn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.txn:last-child { border-bottom: none; }
.txn__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.txn__label { font-weight: 700; font-size: 15px; }
.txn__note { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.txn__right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.txn__amt { font-weight: 800; font-size: 15px; }
.txn__amt--in { color: var(--green-ink); }
.txn__amt--out { color: var(--red); }
.txn__date { font-size: 12px; color: var(--muted); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs__btn {
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 8px 16px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: #475569;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.tabs__btn:hover { background: #f3f7ff; }
.tabs__btn.is-active { background: var(--green); color: var(--green-ink); border-color: var(--green); }

/* status chips */
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip--ok { background: var(--green-soft); color: var(--green-ink); }
.chip--warn { background: #fff4e0; color: #b76e00; }
.chip--muted { background: #eef1f5; color: #64748b; }

/* orders */
.order-list { display: flex; flex-direction: column; gap: 14px; }
.order { padding: 18px; }
.order__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.order__ref { display: block; font-weight: 800; font-size: 16px; }
.order__date { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.order__nums { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.order__num { display: inline-flex; align-items: baseline; gap: 4px; background: #fffbe9; border: 1px solid #f1e3a8; border-radius: 8px; padding: 5px 10px; }
.order__num b { font-size: 16px; letter-spacing: 2px; }
.order__num small { font-size: 12px; color: var(--muted); }
.order__foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 12px; }
.order__qty { color: var(--muted); font-size: 14px; }
.order__total { font-weight: 800; font-size: 18px; color: var(--green-ink); }

/* my tickets */
.ticket-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.lt { padding: 18px; }
.lt--won { border-color: var(--green); background: linear-gradient(135deg, var(--green-soft), #fff); }
.lt__top { display: flex; align-items: center; justify-content: space-between; }
.lt__num { font-size: 26px; font-weight: 800; letter-spacing: 4px; }
.lt__meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 8px; }
.lt__prize { margin-top: 12px; font-weight: 700; color: var(--green-ink); font-size: 14px; }
.lt__wait { margin-top: 12px; color: #b76e00; font-size: 14px; }

.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .acct-shell { grid-template-columns: 1fr; }
  .acct-menu-btn { display: inline-flex; }
  .acct-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
    width: 270px; border-radius: 0; transform: translateX(-100%);
    transition: transform .22s ease; overflow-y: auto;
  }
  .acct-sidebar.is-open { transform: translateX(0); }
  .acct-sidebar__scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .acct-sidebar__scrim.is-open { opacity: 1; pointer-events: auto; }
}
@media (max-width: 520px) {
  .acct-balance { padding: 4px 10px; }
  .ticket-grid { grid-template-columns: 1fr; }
  .wallet-hero__value { font-size: 30px; }
  .page-head__title { font-size: 22px; }
}

/* ============================================================
   Phase 2 — customer portal extras
   ============================================================ */
.chip--danger { background: #fdeced; color: var(--red); }

/* page head with trailing action */
.page-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.stat-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* forms */
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.field__textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font-family: inherit; font-size: 15px; outline: none;
  resize: vertical; min-height: 96px; transition: border-color .15s, box-shadow .15s;
}
.field__textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.upload--sm { padding: 16px 12px; margin-bottom: 14px; }

/* KYC status banner */
.kyc-status { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: #f3f7ff; font-size: 14px; margin-bottom: 8px; }

/* withdraw cancel action inside a txn (full-width row below the txn) */
.txn__action { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.txn__action-hint { font-size: 11px; color: var(--muted); }
.txn--void { opacity: .6; }
.txn--void .txn__label { text-decoration: line-through; }

/* notifications */
.notif-list { display: flex; flex-direction: column; gap: 12px; }
.notif { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; cursor: pointer; transition: box-shadow .15s; }
.notif:hover { box-shadow: 0 8px 22px rgba(20,40,80,.08); }
.notif__dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; flex-shrink: 0; margin-top: 7px; }
.notif--unread { border-color: var(--green); }
.notif--unread .notif__dot { background: var(--green); }
.notif__body { flex: 1; min-width: 0; }
.notif__body strong { display: block; font-size: 15px; margin-bottom: 3px; }
.notif__body p { margin: 0; font-size: 14px; color: #475569; line-height: 1.5; }
.notif__date { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* favorites */
.fave-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fave {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #fffbe9; border: 1px solid #f1e3a8; border-radius: 14px; padding: 16px;
}
.fave__num { font-size: 24px; font-weight: 800; letter-spacing: 4px; color: var(--ink); }
.fave__actions { display: flex; gap: 8px; }

/* referral link box */
.ref-link {
  display: flex; align-items: center; gap: 10px;
  background: #f3f7ff; border: 1px dashed var(--green); border-radius: 12px;
  padding: 12px 16px; font-weight: 800; letter-spacing: 1px; color: var(--green-ink);
  word-break: break-all;
}

/* support thread */
.ticket-thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.msg p { margin: 4px 0 0; }
.msg__who { font-size: 11px; font-weight: 700; opacity: .7; }
.msg--user { align-self: flex-end; background: var(--green-soft); border: 1px solid #d6f3bd; }
.msg--admin { align-self: flex-start; background: #f1f5f9; border: 1px solid var(--line); }
.reply-row { display: flex; gap: 8px; margin-top: 4px; }
.reply-row .field__input { flex: 1; }

.btn-link-danger {
  background: none; border: none; color: var(--red); font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px;
}
.btn-link-danger:hover { text-decoration: underline; }

/* ============================================================
   Mini-wallet popover (shop credit chip)
   ============================================================ */
.mini-wallet-wrap { position: relative; }
.mini-wallet {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 70;
  width: 240px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(20,40,80,.18); padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  animation: pop .12s ease;
}
.mini-wallet[hidden] { display: none; }
.mini-wallet::before {
  content: ""; position: absolute; top: -6px; right: 22px;
  width: 12px; height: 12px; background: #fff;
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.mini-wallet__label { font-size: 12px; color: var(--muted); }
.mini-wallet__value { font-size: 28px; font-weight: 800; color: var(--green-ink); margin-bottom: 4px; }
.mini-wallet .btn { width: 100%; padding: 10px; font-size: 14px; text-decoration: none; }

/* ============================================================
   Admin panel
   ============================================================ */
body.is-admin { background: #f1f3f7; }
.acct-shell--admin { max-width: 1180px; }
.acct-user__avatar--admin { background: var(--ink); color: #fff; }

/* alert / queue panel */
.panel--alert { border-color: #f1e3a8; background: linear-gradient(135deg, #fffbe9, #fff); }
.muted-text { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl td b { letter-spacing: 1px; }
.row-actions { display: flex; gap: 6px; }

/* small action buttons */
.sbtn {
  border: 1px solid var(--line); background: #fff; color: #334155;
  border-radius: 8px; padding: 6px 12px; font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.sbtn:hover { background: #f3f7ff; }
.sbtn--ok { border-color: var(--green); color: var(--green-ink); }
.sbtn--ok:hover { background: var(--green-soft); }
.sbtn--danger { border-color: #f3c6c8; color: var(--red); }
.sbtn--danger:hover { background: #fdeced; }
.sbtn--ghost { color: var(--muted); }

.back-btn {
  border: none; background: none; color: var(--green-ink); font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer; padding: 0 0 8px; align-self: flex-start;
}
.back-btn:hover { text-decoration: underline; }

/* form grid (admin add/edit forms) */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; align-items: end; }
.form-grid .form-actions { grid-column: 1 / -1; }

/* key-value detail */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv__row:last-child { border-bottom: none; }
.kv__k { color: var(--muted); font-size: 14px; }
.kv__v { font-weight: 700; font-size: 15px; }

/* approval queue */
.approve-list { display: flex; flex-direction: column; gap: 12px; }
.approve {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff;
}
.approve__info { min-width: 0; }
.approve__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.approve__head strong { font-size: 15px; }
.approve__amt { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.approve__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* settings switches */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: none; }

.admin-placeholder { text-align: center; color: var(--muted); padding: 36px 20px; }
.admin-placeholder ul { text-align: left; max-width: 360px; margin: 12px auto 0; line-height: 1.8; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid--coupon, .form-grid--adjust { grid-template-columns: 1fr; }
  .approve { flex-direction: column; align-items: stretch; }
  .approve__actions { justify-content: flex-end; }
}

/* ===== Banned screen ===== */
#viewBanned:not([hidden]) { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.banned-card {
  max-width: 420px; margin: 8vh auto; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px 32px; box-shadow: var(--shadow);
}
.banned-card__icon {
  width: 72px; height: 72px; margin: 0 auto 20px; display: grid; place-items: center;
  border-radius: 50%; background: #fdeced; color: var(--red);
}
.banned-card__title { margin: 0 0 10px; font-size: 22px; font-weight: 800; color: var(--ink); }
.banned-card__text { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }
.banned-card .btn { width: 100%; }

/* ===== Payment method selector ===== */
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.pay-method {
  text-align: left; cursor: pointer; border: 2px solid var(--line); background: #fff;
  border-radius: 14px; padding: 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.pay-method:hover { border-color: var(--green); }
.pay-method.is-active { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 4px var(--green-soft); }
.pay-method__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-method__name { font-weight: 700; color: var(--ink); }
.pay-method__badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); }
.pay-method__badge--muted { background: #eef1f5; color: #64748b; }
.pay-method__sub { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.pay-credit__note { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green-ink); font-size: 14px; }
.pay-credit__note.is-warn { background: #fff4e0; color: #b76e00; }

/* ===== Dashboard prominent wallet panel ===== */
.panel--wallet { border-color: #d6f3bd; background: linear-gradient(135deg, #f3fce9, #fff); }
.panel--wallet .approve-list { margin-top: 14px; }
.panel--wallet .approve { border-color: var(--line); }

/* ===== Coupon & adjust form grids ===== */
.form-grid--coupon { grid-template-columns: repeat(5, 1fr); }
.form-grid--adjust { grid-template-columns: 1fr 2fr; }
.muted-text { color: var(--muted); }

/* ===== Fraud panel ===== */
.fraud-panel .panel__head { margin-bottom: 12px; }
.fraud-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fraud-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fafbfd; border: 1px solid var(--line); }
.fraud-item__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--muted); }
.fraud-item--high { background: #fdeced; border-color: #f4c9cb; }
.fraud-item--high .fraud-item__dot { background: var(--red); }
.fraud-item--med { background: #fff4e0; border-color: #f1e3a8; }
.fraud-item--med .fraud-item__dot { background: #b76e00; }
.fraud-item__text { font-weight: 600; color: var(--ink); }
.fraud-item__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== Prize import + results ===== */
.prize-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 14px 0 4px; }
.prize-field .field__label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.prize-field__meta { font-size: 12px; font-weight: 600; color: var(--green-ink); white-space: nowrap; }
.prize-ta { resize: vertical; font-family: inherit; line-height: 1.6; min-height: 52px; }
.prize-result { display: flex; flex-direction: column; gap: 14px; }
.prize-row { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.prize-row:last-child { border-bottom: none; padding-bottom: 0; }
.prize-row__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.prize-row__label { font-weight: 700; color: var(--ink); }
.prize-row__amt { font-size: 13px; font-weight: 700; color: var(--green-ink); }
.prize-nums { display: flex; flex-wrap: wrap; gap: 6px; }
.prize-num {
  font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 8px; background: var(--green-soft); color: var(--green-ink); font-size: 13px;
}
.prize-num--more { background: #eef1f5; color: #64748b; }

@media (max-width: 860px) {
  .prize-grid { grid-template-columns: 1fr; }
}

/* ===== Orders: draw groups + item chips ===== */
.draw-group { padding: 0; overflow: hidden; }
.draw-group__summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; font-weight: 700;
}
.draw-group__summary::-webkit-details-marker { display: none; }
.draw-group__summary::before {
  content: "▸"; margin-right: 4px; color: var(--muted); transition: transform .15s; font-size: 13px;
}
.draw-group[open] .draw-group__summary::before { transform: rotate(90deg); }
.draw-group__summary:hover { background: #f7f9fc; }
.draw-group--latest .draw-group__summary { background: var(--green-soft); color: var(--green-ink); }
.draw-group__title { flex: 1; }
.draw-group__meta { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.draw-group--latest .draw-group__meta { color: var(--green-ink); }
.draw-group .table-wrap { border-top: 1px solid var(--line); }

.ord-nums { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ord-num {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px;
  padding: 2px 8px; border-radius: 7px; background: #eef1f5; color: var(--ink);
}
.ord-more {
  border: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
  padding: 2px 9px; border-radius: 7px; background: var(--green-soft); color: var(--green-ink);
}
.ord-more:hover { background: #d6f3bd; }

/* ===== Sale open/close banner (shop) ===== */
.sale-status {
  max-width: 980px; margin: 0 auto 18px; padding: 12px 18px; border-radius: 12px;
  font-weight: 700; font-size: 14px; text-align: center;
}
.sale-status--open { background: var(--green-soft); color: var(--green-ink); }
.sale-status--closed { background: #fdeced; color: var(--red); }
