/* src/css/xu.css – đồng xu vector, ô số xu (menubar / thanh trên cùng mobile), hộp thoại Nạp xu (#xuNap). xu.js vẽ.
   Màu: theme.css (--xu-* cho đồng xu, --ui-* cho ô xu và hộp thoại theo theme đang chọn). */

/* ── Đồng xu: viền, mặt, vành trong, khung lỗ vuông, lỗ, vệt sáng ── */
.xu-ic { display: inline-block; flex: 0 0 auto; width: 1.15em; height: 1.15em; margin-right: .3em; vertical-align: -.22em; }
.xu-ic-v { fill: var(--xu-vien); }
.xu-ic-m { fill: var(--xu-mat); }
.xu-ic-n { fill: none; stroke: var(--xu-net); stroke-width: .8; }
.xu-ic-k { fill: none; stroke: var(--xu-net); stroke-width: 1.2; }
.xu-ic-l { fill: var(--xu-lo); }
.xu-ic-s { fill: none; stroke: var(--xu-sang); stroke-width: 1.3; stroke-linecap: round; }
.xu-ic-to { width: 44px; height: 44px; margin: 0; }

/* ── Ô số xu: "(đồng xu) 120 xu"; bấm → hộp thoại Nạp xu ── */
.xu-o {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px 0 8px;
  border: 1px solid var(--ui-chip-border); border-radius: 999px; background: var(--ui-chip-bg);
  color: var(--ui-chip-fg); font: 13px/1 Inter, ui-sans-serif, system-ui, sans-serif; white-space: nowrap; cursor: pointer;
  transition: border-color .15s, filter .15s;
}
.xu-o[hidden] { display: none; }
.xu-o .xu-ic { width: 18px; height: 18px; margin: 0; }
.xu-o b { font-weight: 700; color: var(--ui-accent); font-variant-numeric: tabular-nums; }
.xu-o span { opacity: .8; }
.xu-o:hover { border-color: var(--ui-accent); }
.xu-o:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.m-top-xu { height: 30px; padding: 0 10px 0 6px; font-size: 12.5px; border-color: var(--xu-m-vien); background: var(--xu-m-nen); color: var(--xu-m-chu); }   /* thanh trên cùng mobile luôn nền tối */
.m-top-xu b { color: var(--xu-m-chu); }
.m-top-xu:active { filter: brightness(1.15); }

/* ── Hộp thoại Nạp xu: nằm dưới <body>, phủ cả màn hình, hộp ở giữa ── */
#xuNap[hidden] { display: none; }
.xu-nen { position: fixed; inset: 0; z-index: 10060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.xu-hop {
  position: relative; width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 12px; padding: 20px;
  border: 1px solid var(--ui-gold); border-radius: 16px; background: var(--ui-deep); color: var(--ui-ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45); font: 13.5px/1.55 'Be Vietnam Pro', Inter, ui-sans-serif, system-ui, sans-serif;
}
.xu-x {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ui-ink-2); font-size: 15px; cursor: pointer;
}
.xu-x:hover { background: var(--ui-gold-nhat); color: var(--ui-ink); }
.xu-dau { display: flex; align-items: center; gap: 12px; padding-right: 32px; }
.xu-dau h3 { margin: 0; font: 600 20px 'Playfair Display', Georgia, serif; color: var(--ui-ink); }
.xu-dau p { margin: 2px 0 0; color: var(--ui-ink-2); }
.xu-dau p b { color: var(--ui-gold); }
.xu-muc-ten { margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-ink-3); }
.xu-ghi { margin: 0; color: var(--ui-ink-2); }
.xu-cho { margin: 0; color: var(--ui-ink-2); font-style: italic; }
.xu-loi { margin: 0; color: var(--ui-err); }

/* Gói nạp */
.xu-goi-ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.xu-goi {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 10px 10px;
  border: 1px solid var(--ui-edge); border-radius: 12px; background: var(--ui-the); color: var(--ui-ink);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.xu-goi:hover { border-color: var(--ui-gold); }
.xu-goi.on { border-color: var(--ui-gold); background: var(--ui-gold-nhat); box-shadow: inset 0 0 0 1px var(--ui-gold); }
.xu-goi-xu { display: inline-flex; align-items: center; font-size: 15px; font-weight: 700; color: var(--ui-ink); }
.xu-goi-tien { font-size: 12.5px; color: var(--ui-ink-2); }
.xu-goi em {
  position: absolute; top: -8px; right: 8px; padding: 1px 7px; border-radius: 999px;
  background: var(--xu-nut); color: var(--xu-nut-chu); font: 700 11px/1.5 Inter, sans-serif; font-style: normal;
}

/* Phương thức thanh toán */
.xu-pt-ds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xu-pt {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px;
  border: 1px solid var(--ui-edge); border-radius: 12px; background: var(--ui-the); color: var(--ui-ink);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.xu-pt:hover { border-color: var(--ui-gold); }
.xu-pt.on { border-color: var(--ui-gold); background: var(--ui-gold-nhat); box-shadow: inset 0 0 0 1px var(--ui-gold); }
.xu-pt svg { flex: 0 0 auto; width: 26px; height: 26px; color: var(--ui-gold); }
.xu-pt > span { display: flex; flex-direction: column; min-width: 0; }
.xu-pt b { font-size: 13px; }
.xu-pt b + span { font-size: 11.5px; line-height: 1.35; color: var(--ui-ink-3); }
.xu-bao { padding: 10px 12px; border-radius: 10px; background: var(--ui-gold-nhat); box-shadow: inset 0 0 0 1px var(--ui-edge); color: var(--ui-ink); }
.xu-bao b { color: var(--ui-gold); }

/* Nút */
.xu-nut { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.xu-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px;
  border: 1px solid var(--ui-edge); border-radius: 10px; background: transparent; color: var(--ui-gold);
  font: 600 13.5px 'Be Vietnam Pro', Inter, sans-serif; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.xu-btn:hover { background: var(--ui-gold-nhat); }
.xu-btn-chinh { border-color: var(--xu-nut); background: var(--xu-nut); color: var(--xu-nut-chu); }
.xu-btn-chinh:hover { border-color: var(--xu-nut-h); background: var(--xu-nut-h); }
.xu-btn:focus-visible, .xu-goi:focus-visible, .xu-pt:focus-visible, .xu-x:focus-visible { outline: 2px solid var(--ui-gold); outline-offset: 2px; }

body[data-layout="mobile"] .xu-hop { padding: 16px; }
body[data-layout="mobile"] .xu-goi-ds { grid-template-columns: 1fr 1fr; }
body[data-layout="mobile"] .xu-pt-ds { grid-template-columns: 1fr; }
body[data-layout="mobile"] .xu-nut .xu-btn { flex: 1 1 auto; }
