/* ===== Account page (account.html) – loaded after style.css + home.css ===== */

/* Banner with the two characters; its faded bottom runs under the card */
.acc-hero {
  aspect-ratio: 1920 / 1616;
  background: url("../images/account/banner.webp") center top / 100% auto no-repeat;
}

/* Lavender page background, starting under the card's top */
.acc-main {
  margin-top: -44vw; /* page-bg fades in from transparent at its top, hiding the banner's bottom edge */
  padding-top: 0;
  background: url("../images/account/page-bg.webp") center top / 100% 100% no-repeat;
}

/* Paper card (frame baked into card.webp, 1847x1509) */
.acc-card {
  position: relative;
  z-index: 1;
  width: min(1100px, 92vw);
  margin: 0 auto 70px;
  padding: 5.5% 9% 7%;
  background: url("../images/account/card.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 10px 24px rgba(60, 10, 110, .25));
}
.acc-card__title img { width: min(420px, 60%); margin: 0 auto; }
/* gradient ribbon: dark purple in the middle, fading out on both sides */
.acc-card__hello {
  width: min(560px, 80%);
  margin: 18px auto 34px;
  padding: 8px 0;
  background: url("../images/account/ribbon.png") center / 100% 100% no-repeat;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.acc-card__hello b { color: #ffd98a; }
.acc-card__bar {
  position: relative;
  z-index: 2; /* dropdown above the form */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 40px;
  background: #350079;
}
.acc-card__diamond { width: 22px; }
.acc-card__dragon { width: 46px; margin: -10px 0; }
.acc-card__chest { width: 54px; margin: -12px 0; }
.acc-card__bar [hidden] { display: none; }
.acc-card__chevron { width: 24px; transition: transform .2s; }
/* Bar title + chevron open the section dropdown */
.acc-pick { position: relative; }
.acc-pick__btn { display: flex; align-items: center; gap: 12px; color: #fff; }
/* title image label-info.png (717x61, white-to-violet gradient text); text fallback copies that gradient */
.acc-pick__label {
  font-size: 26px;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(#fff 20%, #a96bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.acc-pick__label img { height: 26px; width: auto; max-width: none; }
.acc-pick__label img[src*="history"] { height: 32px; } /* outlined letters, taller canvas (537x74) */
.acc-pick__btn:hover { filter: brightness(1.2); }
.acc-pick__btn[aria-expanded="true"] .acc-card__chevron { transform: rotate(180deg); }
.acc-pick__menu[hidden] { display: none; }
.acc-pick__menu {
  position: absolute;
  left: -12px;
  top: calc(100% + 8px);
  width: 222px;
  list-style: none;
  box-shadow: 0 8px 20px rgba(30, 0, 70, .35);
}
.acc-pick__menu button {
  display: block;
  width: 100%;
  height: 33px;
  margin-top: -1px; /* rows share one border line */
  padding: 0 0 0 36px;
  border: 1px solid #9747ff;
  background: #350079;
  color: #fff;
  font-size: 15px;
  text-align: left;
  transition: background .2s;
}
.acc-pick__menu button:hover, .acc-pick__menu button.is-active { background: #9747ff; }

/* ===== Nạp Bạc panel ===== */
/* Lilac strip with the two method tabs (text images + round radio) */
.topup__tabs { display: flex; gap: 28px; padding: 12px 40px; background: #cfc3e2; }
.topup__tab { display: flex; align-items: center; gap: 8px; }
.topup__tab img { height: 24px; width: auto; }
.topup__tab::after { /* radio dot */
  content: "";
  width: 20px;
  aspect-ratio: 1;
  background: url("../images/account/radio-off.png") center / contain no-repeat;
}
.topup__tab.is-active::after { background-image: url("../images/account/radio-on.png"); }
.topup__tab:hover { filter: brightness(1.15); }
.topup__form { padding: 18px 40px 0; }
.topup__code { color: #1a1a1a; font-size: 24px; font-weight: 700; }
.topup__code b { color: #350079; }
.topup__row { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.topup__row label img { height: 19px; width: auto; }
.topup__row input {
  flex: 1;
  height: 36px;
  padding: 0 18px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: 2px solid transparent;
  background: #fff;
  color: #2a0b3d;
  font: inherit;
  font-size: 18px;
  text-align: right;
}
.topup__row input::placeholder { color: #c8c8c8; }
.topup__row input:focus { outline-color: #8fb5f0; }
.topup__submit { flex: 0 0 auto; width: 150px; transition: transform .2s, filter .2s; }
.topup__submit:hover { transform: translateY(-2px); filter: brightness(1.15); }
.topup__msg { min-height: 1.4em; margin: 6px 0; color: #e00000; font-size: 14px; }
.topup__msg.is-ok { color: #1a8a2a; }
/* Notes box */
.topup__note { padding: 14px 20px 18px; border: 1px solid #e7d9c4; background: #fffdf9; color: #1a1a1a; font-size: 13px; line-height: 1.75; }
.topup__note h3 { color: #b0000f; font-size: 18px; }
.topup__note h4 { margin-top: 1.4em; color: #b0000f; font-size: 13px; }
.topup__note a { color: #350079; font-weight: 700; text-decoration: underline; }

/* Nạp Thẻ form: SỐ SERI / MÃ THẺ rows, NẠP THẺ button under them */
.topup__form[hidden] { display: none; }
.card__row { display: flex; align-items: center; gap: 16px; width: min(420px, 100%); margin-top: 12px; }
.card__row label { flex: 0 0 64px; color: #1a1a1a; font-size: 14px; font-weight: 700; }
.card__row input {
  min-width: 0;
  flex: 1;
  height: 32px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: 2px solid transparent;
  background: #fff;
  font: inherit;
  font-size: 18px;
  text-align: right;
}
.card__row input::placeholder { color: #c8c8c8; }
.card__row input:focus { outline-color: #8fb5f0; }
.card__submit { display: block; width: 150px; margin-top: 14px; transition: transform .2s, filter .2s; }
.card__submit:hover { transform: translateY(-2px); filter: brightness(1.15); }
/* Card success popup: shorter than the payment popup, green badge + message */
.card-ok__box { aspect-ratio: 770 / 685; }
.card-ok__icon { width: 44%; margin-top: 4%; }

/* ===== Mở Khóa Tài Khoản: thin-bordered box, purple character picker + MỞ KHÓA button ===== */
.unlock[hidden] { display: none; }
.unlock {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 520px;
  margin-top: 14px;
  padding: 26px 20px;
  border: 1px solid #e7d9c4;
}
.unlock__pick { position: relative; width: min(468px, 100%); }
.unlock__btn { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 40px; padding: 0 14px; background: #350079; color: #fff; font-size: 17px; font-weight: 700; }
.unlock__label img { height: 18px; width: auto; }
.unlock__chevron { width: 28px; transition: transform .2s; }
.unlock__btn[aria-expanded="true"] .unlock__chevron { transform: rotate(180deg); }
.unlock__menu[hidden] { display: none; }
.unlock__menu { position: absolute; left: 0; right: 0; top: 100%; z-index: 2; list-style: none; box-shadow: 0 8px 20px rgba(30, 0, 70, .35); }
.unlock__menu button { display: block; width: 100%; height: 36px; margin-top: -1px; padding: 0 14px; border: 1px solid #9747ff; background: #350079; color: #fff; font-size: 15px; text-align: left; transition: background .2s; }
.unlock__menu button:hover, .unlock__menu button.is-active { background: #9747ff; }
.unlock__submit { width: 190px; margin-top: 14px; transition: transform .2s, filter .2s; }
.unlock__submit:hover { transform: translateY(-2px); filter: brightness(1.15); }
.unlock__msg { min-height: 1.4em; margin-top: 8px; color: #e00000; font-size: 14px; }
.unlock__msg.is-ok { color: #1a8a2a; }
/* Unlock popup: short scroll frame 770x419, title ribbon 788x67 */
.unlock-verify__box { aspect-ratio: 770 / 419; background-image: url("../images/account/verify-frame-short.webp"); }
.verify__title.unlock-verify__title { top: 9%; }
.verify__form.unlock-verify__form { top: 34%; }

/* ===== Lịch Sử Nạp Bạc: purple header row, lilac body, vertical column lines ===== */
.history { padding: 22px 13% 10px; } /* table ~70% of the card width, centered */
.history__sum { color: #1a1a1a; font-size: 14px; text-align: center; }
.history__sum b { color: #350079; }
.history__wrap { margin-top: 12px; overflow-x: auto; }
.history__table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: #e9dcfb;
  font-size: 13px;
  text-align: center;
}
.history__table th { padding: 8px 6px; background: #350079; color: #fff; font-size: 11px; font-weight: 500; }
.history__table td { padding: 9px 6px; border-bottom: 1px solid #fff; color: #2a0b3d; }
.history__table th, .history__table td { border-left: 1px solid #c9b3e6; }
.history__table th:first-child, .history__table td:first-child { width: 8%; border-left: 0; }
.history__table th:nth-child(2) { width: 34%; }
.history__table tbody::after { content: ""; display: block; height: 160px; } /* empty space under the rows like the design */
.history__table td[data-status="Thành công"] { color: #1a8a2a; font-weight: 700; }
.history__table td[data-status="Thất bại"] { color: #e00000; font-weight: 700; }
.history__table td[data-status="Đang xử lý"] { color: #c27a00; font-weight: 700; }

/* Form rows: label | input | red edit link, purple line under each row */
.acc-form { padding: 10px 4% 0; }
.acc-form__row {
  display: grid;
  grid-template-columns: 30% 1fr 90px;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #350079;
}
.acc-form label { color: #2a0b3d; font-size: 17px; font-weight: 700; }
.acc-form input {
  grid-column: 2;
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border: 1px solid #c9b3e6;
  outline: 2px solid transparent;
  background: #fff;
  color: #2a0b3d;
  font: inherit;
}
.acc-form input[readonly] { background: #f3eef9; }
.acc-form input:focus:not([readonly]) { outline-color: #8fb5f0; }
.acc-form__edit { justify-self: start; color: #e00000; font-size: 15px; font-weight: 700; text-decoration: underline; }
.acc-form__edit:hover { color: #ff3b3b; }
.acc-form__edit.is-saving { color: #1a8a2a; }

/* ===== Verify popup (phone change) – scroll frame 770x685, title ribbon 788x100 overhangs it ===== */
.verify {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 0, 40, .7);
}
.verify[hidden] { display: none; }
.verify__box {
  position: relative;
  width: min(560px, 100%);
  aspect-ratio: 770 / 685;
  background: url("../images/account/verify-frame.webp") center / 100% 100% no-repeat;
}
.verify__title { position: absolute; left: 50%; top: 6%; width: 102%; transform: translateX(-50%); }
.verify__close { position: absolute; top: -5%; right: -1.5%; width: 9.4%; transition: transform .2s, filter .2s; }
.verify__close:hover { transform: scale(1.1); filter: brightness(1.2); }
.verify__form { position: absolute; left: 9%; right: 9%; top: 26%; display: flex; flex-direction: column; align-items: center; } /* % of the box (padding % would use the screen width) */
.verify__row { display: flex; align-items: center; gap: 4%; width: 100%; margin-bottom: 4%; }
.verify__row label { flex: 0 0 24%; color: #2a0b3d; font-size: 15px; font-weight: 700; white-space: nowrap; }
.verify__row input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #e3dccf;
  border-radius: 10px;
  outline: 2px solid transparent;
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.verify__row input:focus { outline-color: #8fb5f0; }
.verify__error { min-height: 1.4em; color: #e00000; font-size: 14px; }
.verify__submit { width: 52%; margin-top: 2%; transition: transform .2s, filter .2s; }
.verify__submit:hover { transform: translateY(-2px); filter: brightness(1.15); }

/* ===== Payment popup – same frame as verify, taller; title ribbon is 788x59 ===== */
.pay__box { width: min(480px, 100%); aspect-ratio: 770 / 960; }
.verify__title.pay__title { top: 4.5%; }
.pay__body { position: absolute; left: 12%; right: 12%; top: 15%; display: flex; flex-direction: column; align-items: center; text-align: center; color: #1a1a1a; }
.pay__qr { display: grid; place-items: center; width: 80%; aspect-ratio: 1; background: #d9d9d9; color: #9a9a9a; font-size: 28px; font-weight: 700; }
.pay__note { margin-top: 5%; font-size: 14px; line-height: 1.4; }
.pay__info { margin-top: 5%; font-size: 14px; font-weight: 700; line-height: 1.8; }

@media (max-width: 768px) {
  .acc-hero {
    aspect-ratio: 393 / 460;
    background-size: auto 100%;
    background-position: 40% top;
    /* page-bg is stretched over a tall column here, so its fade is too weak: fade the banner itself */
    -webkit-mask: linear-gradient(#000 65%, transparent);
    mask: linear-gradient(#000 65%, transparent);
  }
  .acc-main { margin-top: -30vw; }
  .acc-card { width: 94vw; margin-bottom: 14vw; padding: 8vw 7vw 10vw; }
  .acc-card__title img { width: 70%; }
  .acc-card__hello { width: 90%; margin: 3vw auto 5vw; padding: 1.6vw 0; font-size: 3.8vw; }
  .acc-card__bar { gap: 2vw; padding: 1.6vw 3vw; }
  .acc-card__diamond, .acc-card__chevron { width: 4.4vw; }
  .acc-card__dragon { width: 8vw; margin: -1.6vw 0; }
  .acc-card__chest { width: 9vw; margin: -2vw 0; }
  .topup__tabs { gap: 5vw; padding: 2.4vw 3vw; }
  .topup__tab img { height: 4.6vw; }
  .topup__tab::after { width: 4vw; }
  .topup__form { padding: 4vw 0 0; }
  .topup__code { font-size: 4.6vw; }
  .topup__row { flex-wrap: wrap; gap: 2vw; margin-top: 2.4vw; }
  .topup__row label { flex: 1 0 100%; }
  .topup__row label img { height: 3.8vw; }
  .topup__row input { min-width: 0; height: 9vw; padding: 0 3vw; font-size: 3.8vw; } /* label on its own line, input + button side by side */
  .topup__submit { width: 30vw; }
  .topup__msg { font-size: 3.2vw; }
  .topup__note { padding: 3vw 3.4vw 4vw; font-size: 3vw; }
  .topup__note h3 { font-size: 4vw; }
  .topup__note h4 { font-size: 3vw; }
  .acc-pick__btn { gap: 2vw; }
  .acc-pick__label { font-size: 4.2vw; }
  .acc-pick__label img { height: 4.2vw; }
  .acc-pick__label img[src*="history"] { height: 5.2vw; }
  .history { padding: 4vw 0 2vw; }
  .history__sum { font-size: 3.2vw; }
  .history__table td { white-space: nowrap; } /* table scrolls sideways instead of wrapping cells */
  .acc-pick__menu { left: -2vw; width: 56vw; }
  .acc-pick__menu button { height: 8.4vw; padding-left: 6vw; font-size: 3.6vw; }
  .acc-form { padding: 1vw 0 0; }
  /* label + link on one line, input full width below */
  .acc-form__row { grid-template-columns: 1fr auto; gap: 1.6vw 2vw; padding: 2.6vw 0; }
  .acc-form label { font-size: 3.6vw; }
  .acc-form input { grid-column: 1 / -1; grid-row: 2; height: 9vw; padding: 0 3vw; font-size: 3.6vw; }
  .acc-form__edit { grid-row: 1; grid-column: 2; font-size: 3.2vw; }
  .verify { padding: 4vw; }
  .verify__row label { flex-basis: 31%; font-size: 3.4vw; }
  .verify__row input { height: 9vw; padding: 0 3vw; border-radius: 2vw; font-size: 3.4vw; }
  .verify__error { font-size: 3vw; }
  .pay__qr { width: 66%; }
  .unlock { min-height: 70vw; margin-top: 3vw; padding: 5vw 3vw; }
  .unlock__btn { height: 9vw; padding: 0 3vw; font-size: 3.6vw; }
  .unlock__label img { height: 3.6vw; }
  .unlock__chevron { width: 5.6vw; }
  .unlock__menu button { height: 8.4vw; padding: 0 3vw; font-size: 3.6vw; }
  .unlock__submit { width: 36vw; margin-top: 3vw; }
  .unlock__msg { font-size: 3.2vw; }
  .card__row { gap: 3vw; margin-top: 2.4vw; }
  .card__row label { flex-basis: 16vw; font-size: 3.4vw; }
  .card__row input { height: 9vw; padding: 0 3vw; font-size: 3.8vw; }
  .card__submit { width: 30vw; margin-top: 3vw; }
  .pay__note, .pay__info { font-size: 3.2vw; }
}

/* ===== API states (account-topup.js / account.js) ===== */
/* Level-2 gate: first-time creation needs 3 rows → tall frame instead of the short one */
.pin-gate__box.is-create { aspect-ratio: 770 / 685; background-image: url("../images/account/verify-frame.webp"); }
.verify__row[hidden] { display: none; }
.verify__submit:disabled, .unlock__submit:disabled, .topup__submit:disabled, .card__submit:disabled { opacity: .6; cursor: wait; }
.acc-form__msg { min-height: 1.2em; margin: 4px 0; color: #e00000; font-size: 14px; text-align: center; }
.acc-form__msg.is-ok { color: #1a8a2a; }
.acc-form__msg:empty { display: none; }
/* Real QR image from the bank provider; keeps the placeholder box size */
img.pay__qr { display: block; object-fit: contain; background: #fff; }
/* Loading / empty / error line under the history table */
.history__state { margin-top: 10px; color: #6b5a78; text-align: center; }
.history__state.is-error { color: #e00000; font-weight: 700; }
.history__state:empty { display: none; }
.history__table td[data-status="Sai mệnh giá"] { color: #e00000; }
.topup__code[hidden] { display: none; }

/* Giftcode: mã không được xuống dòng giữa chừng (người chơi gõ tay dễ nhầm) */
.giftcode__table td:first-child { width: auto; white-space: nowrap; border-left: 0; }
.giftcode__copy { margin-left: 8px; padding: 2px 8px; border-radius: 4px; background: #350079; color: #fff; font-size: 11px; cursor: pointer; }
