/* =====================================================================
   Trang trí hồ sơ & HUD (artwork gốc trong assets/cosmetics, do Codex/ChatGPT vẽ theo brief).
   Nạp sau ad_command.css. Thông số vùng trống lấy từ assets/cosmetics/manifest.json.
   ===================================================================== */

/* ---- khung ảnh đại diện: ảnh giữ nguyên cỡ, khung phủ to hơn 42% (lỗ khung 360/512) ---- */
.av.fr-art { overflow: visible; }
.av.fr-art::after { display: none; }
.av > .fov { position: absolute; left: -21.1%; top: -21.1%; width: 142.2%; height: 142.2%; max-width: none; border-radius: 0; object-fit: fill; pointer-events: none; z-index: 2; }
.av.sm > .fov { left: -18%; top: -18%; width: 136%; height: 136%; }

/* ---- bảng tên: ảnh 720×120, bỏ 120px ô avatar bên trái (phóng 120% rồi neo phải), chữ ở dải giữa ---- */
.np { display: inline-flex; align-items: center; min-width: 9em; height: 2.3em; padding: 0 2.2em 0 .9em; margin: -.35em 0; background: right center / 120% 100% no-repeat; color: #f1ead8; text-shadow: 0 1px 2px #000, 0 0 6px #000c; white-space: nowrap; vertical-align: middle; box-sizing: border-box; }
.np.big { font-size: inherit; height: 2.1em; padding-right: 2.6em; }
.ld-row .nm .np { font-size: 15px; }

/* ---- thanh danh hiệu 480×72: chữ ở dải giữa ---- */
.ttl { display: inline-flex; align-items: center; justify-content: center; min-width: 200px; height: 30px; padding: 0 34px; font: 600 13px var(--font); letter-spacing: .5px; color: #e9d9b4; text-shadow: 0 1px 2px #000; white-space: nowrap; box-sizing: border-box; }
.ttl:not(.art) { min-width: 0; padding: 0; height: auto; color: #d8c08c; font-style: italic; }
.ttl.art { background: center / 100% 100% no-repeat; min-width: 240px; height: 36px; }
.pf2-id .ttl { margin: 2px 0 6px; }

/* ---- huy hiệu thành tích ---- */
.bdg { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; margin-left: 6px; filter: drop-shadow(0 1px 2px #000); }
.bdg.sm { width: 22px; height: 22px; margin-left: 4px; }
.bdg-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.bdg-row img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 1px 3px #000); transition: transform .15s; }
.bdg-row img.off { filter: grayscale(1) brightness(.35); }
.bdg-row img.sel { transform: scale(1.12); }
.bdg-pick button img, .lk-row button img { width: 28px; height: 28px; object-fit: cover; vertical-align: middle; margin-right: 6px; border-radius: 3px; }
.bdg-pick button img { object-fit: contain; }
.lk-row button.off { opacity: .4; }
.emo-own { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid #ffffff1a; color: #c9d3df; font-size: 14px; }
.emo-own img { width: 34px; height: 34px; }

/* ---- nền hồ sơ / thẻ mini ---- */
.pf2-head.has-bg { background-size: cover; background-position: center; border: 1px solid #ffffff1f; padding-top: 26px; padding-bottom: 26px; }
.ld-me.has-bg { background-size: cover; background-position: center; padding: 14px; border: 1px solid #ffffff1a; }

/* ---- cửa hàng: ảnh xem trước ---- */
.sk .skr { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin-top: -4px; }
.pc-prev { width: 100%; aspect-ratio: 16 / 9; background: #0b0f15 center / cover no-repeat; border: 1px solid #ffffff14; position: relative; overflow: hidden; }
.pc-prev.hud img { position: absolute; left: 0; top: 0; width: 100%; height: auto; }
.pc-prev.hud img.tm { left: 50%; top: 18%; width: 30%; transform: translateX(-50%); }
.pc-prev.bg { aspect-ratio: 2 / 1; }
.pc-prev.plate, .pc-prev.title { aspect-ratio: auto; height: 96px; display: grid; place-items: center; background: radial-gradient(#1a2430, #0b0f15); font-size: 18px; }
.pc-prev.banner { aspect-ratio: 1600 / 360; background-size: contain; display: grid; place-items: center; }
.pc-prev.banner b { font: 700 22px var(--title, serif); letter-spacing: 4px; color: #fff3cf; text-shadow: 0 0 10px #000, 0 0 4px #000; }
.pc-prev.emote { width: 112px; height: 112px; object-fit: contain; border: 0; background: none; aspect-ratio: 1; margin: 0 auto; display: block; }
.sk-grid.sk-plate, .sk-grid.sk-title, .sk-grid.sk-banner { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.st-body .tabs { flex-wrap: wrap; }

/* ---- thẻ trang trí trong rương ---- */
.cos.pc .ci img { object-fit: contain; }
.cos.pc-bg .ci img, .cos.pc-load .ci img, .cos.pc-hud .ci img { object-fit: cover; }
.chest-cover.c-cosm img { object-fit: contain; background: radial-gradient(#26313d, #0b0f15); }

/* ---- banner thắng sau trận ---- */
.report-banner.art { background-size: 100% 100%; background-position: center; background-repeat: no-repeat; min-height: 120px; border-color: transparent; justify-content: center; text-align: center; }
.report-banner.art .result { text-shadow: 0 0 14px #000, 0 2px 4px #000; }

/* ---- màn tải đã chọn ---- */
.ld-bg.art { background-size: cover; background-position: center; filter: brightness(.85); }

/* ---- sticker trong chat sau trận ---- */
.pg-emo { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pg-emo button { width: 54px; height: 54px; padding: 3px; background: #0b0f15aa; border: 1px solid #ffffff1a; cursor: pointer; }
.pg-emo button:hover { border-color: #c9a46a; }
.pg-emo img { width: 100%; height: 100%; object-fit: contain; }
#PgLog .pl img.pl-emo { width: 64px; height: 64px; object-fit: contain; vertical-align: middle; }

/* =====================================================================
   HUD: nền, khung trên, góc khối kỹ năng, khung đồng hồ, viền ô (7 theme)
   ===================================================================== */
body.hud-art #Board .Tile { position: relative; }
/* khung trên vẽ ở lớp nền (#bg) để không đè chữ/nút ở hai góc trên */
body.hud-art #UltBlock .Corners, body.hud-art #AbilityBlock .Corners { width: 64px; height: 64px; border: 0; background: var(--hud-corner) 0 0 / 100% 100% no-repeat; }
body.hud-art #UltBlock .Corners.tl, body.hud-art #AbilityBlock .Corners.tl { left: -16px; top: -16px; }
body.hud-art #UltBlock .Corners.tr, body.hud-art #AbilityBlock .Corners.tr { right: -16px; top: -16px; transform: scaleX(-1); }
body.hud-art #UltBlock .Corners.bl, body.hud-art #AbilityBlock .Corners.bl { left: -16px; bottom: -16px; transform: scaleY(-1); }
body.hud-art #UltBlock .Corners.br, body.hud-art #AbilityBlock .Corners.br { right: -16px; bottom: -16px; transform: scale(-1); }
body.hud-art #Timer, body.hud-art #stage.my-turn #Timer { width: 118px; height: 48px; border: 0; background: var(--hud-timer) center / 100% 100% no-repeat; }
body.hud-art #Board .Tile::before { content: ""; position: absolute; inset: -13%; background: var(--hud-tile) 0 0 / 100% 100% no-repeat; pointer-events: none; z-index: 3; }
body.hud-art #UltBlock, body.hud-art #AbilityBlock { background: #0b1118a8; }
body.hud-art #bg { background: radial-gradient(520px 240px at 0 0, #0b0f14e6 30%, #0b0f1400 100%), var(--hud-top) center top / 100% auto no-repeat, linear-gradient(#0b0f1480, #0b0f14c0), var(--hud-bg) center / cover no-repeat !important; opacity: 1 !important; }
body.hud-art #stage:not(.ph-draft) #bg { background: linear-gradient(#0b0f14a0, #0b0f14d0), var(--hud-bg) center / cover no-repeat !important; }
body.hud-art #bg::after { display: none; }

/* 2026-10-15 · Profile showcase: antique gold / obsidian. Keep the effects behind
   the account data and quiet enough for readable text on every background. */
#stage .pf2-head[style*="bg_relic_vault"],
#stage .pf2-head[style*="bg_eclipse_forge"] {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: #9d773d;
  box-shadow: 0 18px 42px #0008, inset 0 0 0 1px #f1c67724;
}
#stage .pf2-head[style*="bg_relic_vault"] > *,
#stage .pf2-head[style*="bg_eclipse_forge"] > * { position: relative; z-index: 1; }
#stage .pf2-head[style*="bg_relic_vault"]::before,
#stage .pf2-head[style*="bg_eclipse_forge"]::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -80% -30%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 43%, #f7d18b08 48%, #ffe3a31c 50%, #f7d18b08 52%, transparent 57%);
  transform: translateX(-52%) rotate(-5deg);
  animation: pf-vault-glint 12s cubic-bezier(.2,.7,.2,1) infinite;
}
#stage .pf2-head[style*="bg_eclipse_forge"]::before { animation-delay: -6s; }
@keyframes pf-vault-glint {
  0%, 16% { transform: translateX(-52%) rotate(-5deg); opacity: 0; }
  25% { opacity: .8; }
  44%, 100% { transform: translateX(52%) rotate(-5deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #stage .pf2-head[style*="bg_relic_vault"]::before,
  #stage .pf2-head[style*="bg_eclipse_forge"]::before { animation: none; opacity: 0; }
}

#stage .pf2-showcase {
  margin: 0 0 18px;
  padding: 17px 21px 20px;
  background: linear-gradient(115deg, #1b1b1b, #121517 70%);
  border: 1px solid #8066388c;
  border-radius: 12px;
  box-shadow: 0 12px 24px #0005;
}
#stage .pf2-showcase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 13px; }
#stage .pf2-showcase-head h3 { margin: 0; color: #f3d9a4; font: 700 24px/1.35 'FG Display', sans-serif; letter-spacing: .025em; }
#stage .pf2-showcase-head span { color: #c6b898; font: 500 14px/1.4 'FG Body', sans-serif; }
#stage .pf2-showcase-items { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
#stage .pf2-showcase-item {
  display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 82px; padding: 10px 13px;
  background: #090c0fe8; border: 1px solid #a58a5b75; border-radius: 8px;
  box-shadow: inset 0 1px #ffdf9920, 0 5px 16px #0005;
}
#stage .pf2-showcase-item img { flex: none; width: 62px; height: 62px; object-fit: cover; border: 1px solid #c2a46f80; border-radius: 5px; }
#stage .pf2-showcase-item div { min-width: 0; }
#stage .pf2-showcase-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f4ead6; font: 650 17px/1.4 'FG Body', sans-serif; }
#stage .pf2-showcase-item span { display: block; color: #c4b99f; font: 500 14px/1.45 'FG Body', sans-serif; }
#stage .pf2-showcase-empty { display: flex; align-items: center; gap: 16px; color: #d9cbb0; font: 500 16px/1.5 'FG Body', sans-serif; }
#stage .pf2-showcase-empty .Btn { min-height: 44px; }

body[data-hud="relic_vault"].hud-art #Timer,
body[data-hud="eclipse_forge"].hud-art #Timer { filter: drop-shadow(0 5px 9px #0009); }
body[data-hud="relic_vault"].hud-art #Board .Tile::before,
body[data-hud="eclipse_forge"].hud-art #Board .Tile::before { filter: drop-shadow(0 2px 3px #000a); }

html.touch #stage .pf2-showcase { padding: 21px 25px; }
html.touch #stage .pf2-showcase-head h3 { font-size: 32px; }
html.touch #stage .pf2-showcase-head span,
html.touch #stage .pf2-showcase-item span { font-size: 20px; }
html.touch #stage .pf2-showcase-item { min-height: 98px; gap: 17px; }
html.touch #stage .pf2-showcase-item img { width: 76px; height: 76px; }
html.touch #stage .pf2-showcase-item b { font-size: 23px; }
html.touch #stage .pf2-showcase-empty { font-size: 22px; }
html.touch #stage .pf2-showcase-empty .Btn { min-height: 64px; font-size: 22px; }

