/* profile-card.css — หน้าโปรไฟล์แบบบัตรผู้เล่น (Code/Profile/profile-card.js) · แนว Endfield: แผงกระจกเข้ม มุมตัด เส้นสีเน้น ป้ายตัวอักษรเล็ก
   สีของธีมอยู่ในตัวแปร --pc-* ของ .pc-theme-<id> · ใช้หน่วย vh เพราะจอเกมเป็นแนวนอน (ความสูงคือด้านที่จำกัด)
   EXTEND: ธีมใหม่ = คัดลอกบล็อก .pc-theme-sakura แล้วเปลี่ยนสี */

/* ---------- ธีม ---------- */
.pc-theme-sakura {
  --pc-accent: #ffd36e;
  --pc-accent2: #ff8fb8;
  --pc-panel: rgba(34, 22, 44, 0.78);
  --pc-line: rgba(255, 211, 110, 0.55);
  --pc-ink: #fff6ea;
  --pc-mut: #d9c6dc;
  --pc-glow: radial-gradient(ellipse at 52% 60%, #ff8fb855 0, #3a1d4a00 60%), linear-gradient(160deg, #2a1838, #4a2346 60%, #1d1029);
}
.pc-theme-night {
  --pc-accent: #7fe3ff;
  --pc-accent2: #b7a6ff;
  --pc-panel: rgba(12, 18, 36, 0.8);
  --pc-line: rgba(127, 227, 255, 0.5);
  --pc-ink: #eef6ff;
  --pc-mut: #a9b8d6;
  --pc-glow: radial-gradient(ellipse at 52% 60%, #4a7dff44 0, #0c122600 60%), linear-gradient(160deg, #0b1124, #1b2350 60%, #070b18);
}
.pc-theme-teahouse {
  --pc-accent: #f4c26b;
  --pc-accent2: #9ed38a;
  --pc-panel: rgba(42, 28, 18, 0.8);
  --pc-line: rgba(244, 194, 107, 0.5);
  --pc-ink: #fff4e2;
  --pc-mut: #d8c4a6;
  --pc-glow: radial-gradient(ellipse at 52% 60%, #e8a35a44 0, #2a1c1200 60%), linear-gradient(160deg, #2a1c12, #4d3320 60%, #1a110a);
}

/* ---------- โครงหน้า ---------- */
.pg[data-pg='pc'] .pg-body {
  display: block !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: relative;
}
.pc {
  position: absolute;
  inset: 0 0 0 0;
  display: grid;
  grid-template-columns: minmax(0, 34fr) minmax(0, 28fr) minmax(0, 38fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1.2vh 1.6vw;
  padding: 1vh 2.4vw 1.6vh;
  color: var(--pc-ink);
  font-family: Sarabun, sans-serif;
  background: var(--pc-glow);
  overflow: hidden;
}
/* เส้นตารางจาง ๆ แบบหน้าจอเทคโนโลยี */
.pc::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, #ffffff08 0 1px, transparent 1px 4.2vh),
    repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 4.2vh);
  pointer-events: none;
}
/* ตัวละครยึดขอบบน (หัวอยู่ในหน้าต่างเสมอ เว้น 1.5vh) แล้วขยายสูงเกินกรอบ 22% — ส่วนที่เกินคือปลายเท้าล่างสุด ซึ่งแถบปุ่มล่างบังอยู่แล้ว */
.pc-art {
  position: absolute;
  inset: 1.5vh 0 0;
  background: center top / auto 122% no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 0 3vh #0008);
}
.pc-left,
.pc-right {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1vh;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.pc-left {
  grid-column: 1;
}
.pc-right {
  grid-column: 3;
}
.pc-left > *,
.pc-right > * {
  background: var(--pc-panel);
  border-left: 0.45vh solid var(--pc-accent);
  /* มุมขวาบนตัดเฉียง — เอกลักษณ์แผงแบบ Endfield */
  clip-path: polygon(0 0, calc(100% - 1.8vh) 0, 100% 1.8vh, 100% 100%, 0 100%);
  padding: 1vh 1.4vh;
  backdrop-filter: blur(4px);
}
.pc h4 {
  display: flex;
  align-items: center;
  gap: 0.8vh;
  margin: 0 0 0.7vh;
  font-size: 2.1vh;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--pc-accent);
}
.pc h4::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--pc-line), transparent);
}
.pc-mut {
  margin: 0;
  font-size: 1.9vh;
  color: var(--pc-mut);
}

/* ---------- บัตรผู้เล่น ---------- */
.pc-id {
  display: flex;
  gap: 1.4vh;
  align-items: center;
}
.pc-av {
  position: relative;
  flex: none;
  width: 11vh;
  height: 11vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  /* หกเหลี่ยม */
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: linear-gradient(160deg, var(--pc-accent), var(--pc-accent2));
  font-size: 6vh;
}
/* รูปหน้าจาก avFace() วางเต็มกรอบ (av-fc เป็น absolute) เว้นขอบสีไว้นิดหนึ่ง */
.pc-av .av-fc {
  inset: 4%;
  border-radius: 0;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: #1a1222;
}
.pc-av-empty {
  display: grid;
  place-items: center;
  color: var(--pc-mut);
}
.pc-who {
  display: flex;
  flex-direction: column;
  gap: 0.2vh;
  min-width: 0;
}
.pc-who b {
  font-size: 3.2vh;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-who small {
  display: flex;
  align-items: center;
  gap: 0.8vh;
  font-size: 1.9vh;
  color: var(--pc-mut);
}
.pc-copy {
  border: 1px solid var(--pc-line);
  background: none;
  color: var(--pc-accent);
  font: 700 1.6vh Sarabun, sans-serif;
  padding: 0.1vh 0.8vh;
  border-radius: 0.4vh;
  cursor: pointer;
}
.pc-since {
  font-size: 1.7vh;
  color: var(--pc-mut);
}
.pc-badge {
  font-style: normal;
  font-size: 1.8vh;
  font-weight: 700;
  color: var(--pc-accent);
}

/* ---------- เลเวล / แรงก์ / ตัวเลขสะสม ---------- */
.pc-lvs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6vh 1.6vh;
  align-items: center;
}
.pc-lv {
  display: flex;
  align-items: baseline;
  gap: 0.6vh;
  font-size: 1.8vh;
  color: var(--pc-mut);
}
.pc-lv i {
  font-style: normal;
  color: var(--pc-accent2);
}
.pc-lv b {
  font-size: 3vh;
  color: var(--pc-ink);
}
.pc-rank {
  font-size: 1.8vh;
  font-weight: 800;
  padding: 0.2vh 1vh;
  border: 1px solid var(--pc-line);
  color: var(--pc-accent);
}
.pc-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}
.pc-counts div + div {
  border-left: 1px solid var(--pc-line);
}
.pc-counts b {
  display: block;
  font-size: 3vh;
  line-height: 1.1;
}
.pc-counts small {
  font-size: 1.7vh;
  color: var(--pc-mut);
}

/* ---------- ความชำนาญรายเกม ---------- */
.pc-ms {
  display: grid;
  grid-template-columns: 9vh 1fr auto;
  gap: 1vh;
  align-items: center;
  font-size: 1.8vh;
  line-height: 1.7;
}
.pc-ms i {
  height: 0.8vh;
  background: #ffffff1c;
  overflow: hidden;
}
.pc-ms u {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pc-accent2), var(--pc-accent));
}
.pc-ms b {
  color: var(--pc-accent);
  font-size: 1.7vh;
}

/* ---------- เหรียญเกียรติยศ ---------- */
.pc-medals {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.8vh;
}
.pc-medal {
  position: relative;
  aspect-ratio: 1 / 1.08;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  text-align: center;
  font-size: 1.4vh;
  font-weight: 800;
  line-height: 1.15;
  padding: 0.6vh;
  color: #2a1c12;
}
.pc-medal span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-medal em {
  position: absolute;
  bottom: 9%;
  font-style: normal;
  font-size: 1.3vh;
}
.pc-medal.bronze {
  background: linear-gradient(160deg, #f0b685, #a8653a);
}
.pc-medal.silver {
  background: linear-gradient(160deg, #ffffff, #9aa7b8);
}
.pc-medal.gold {
  background: linear-gradient(160deg, #fff1a8, #e3a730 55%, #ff9fd0);
}
.pc-medal.empty {
  background: #ffffff14;
  color: var(--pc-mut);
}

/* ---------- ตู้โชว์ตัวละคร ---------- */
.pc-ops {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8vh;
}
.pc-op {
  position: relative;
  aspect-ratio: 3 / 4.2;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff22, #00000055);
  border-bottom: 0.45vh solid #7aa7ff;
  clip-path: polygon(0 0, calc(100% - 1.4vh) 0, 100% 1.4vh, 100% 100%, 0 100%);
}
.pc-op.epic {
  border-color: #ffc54d;
}
.pc-op.legendary {
  border-color: #ff7fc0;
}
.pc-op img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.pc-op b,
.pc-op small {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 0.6vh;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0.2vh 0.4vh #000;
}
.pc-op b {
  bottom: 2.6vh;
  font-size: 1.8vh;
}
.pc-op small {
  bottom: 0.6vh;
  font-size: 1.5vh;
  color: var(--pc-accent);
}
.pc-op.empty {
  display: grid;
  place-items: center;
  font-size: 4vh;
  color: var(--pc-mut);
  border-color: transparent;
}

/* ---------- ข้อความแนะนำตัว ---------- */
.pc-bio {
  margin: 0;
  font-size: 2vh;
  font-style: italic;
  color: var(--pc-ink);
}
.pc-bio::before {
  content: '“ ';
  color: var(--pc-accent);
  font-weight: 800;
}

/* ---------- แถบปุ่มล่าง ---------- */
.pc-bar {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1vh 1.4vh;
}
.pc-bar button {
  min-height: 6vh;
  padding: 0 2.2vh;
  border: 1px solid var(--pc-line);
  background: var(--pc-panel);
  color: var(--pc-ink);
  font: 800 2vh Sarabun, sans-serif;
  clip-path: polygon(1.2vh 0, 100% 0, calc(100% - 1.2vh) 100%, 0 100%);
  cursor: pointer;
}
.pc-bar button.go {
  background: linear-gradient(90deg, var(--pc-accent), var(--pc-accent2));
  color: #2a1830;
  border: 0;
}
.pc-bar button:disabled {
  opacity: 0.45;
  cursor: default;
}
.pc-warn {
  padding: 0.6vh 1.4vh;
  background: var(--pc-panel);
  text-align: center;
  font-size: 1.7vh;
  color: #ffb3b3;
}

/* โหมดดูภาพ: ซ่อนแผง เหลือตัวละครเด่นกับแถบปุ่ม */
.pc.art-only .pc-left,
.pc.art-only .pc-right {
  opacity: 0;
  pointer-events: none;
}
.pc.art-only .pc-bar > :not(:last-child) {
  display: none;
}
.pc-left,
.pc-right {
  transition: opacity 0.25s;
}

/* ---------- หน้าต่างดูบัตรของคนอื่น ---------- */
.pc-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  background: #0009;
}
.pc-modal > .pc {
  position: relative;
  width: min(96vw, 180vh);
  height: 88vh;
  border: 1px solid var(--pc-line);
  box-shadow: 0 2vh 6vh #000a;
}
.pc-close {
  position: absolute;
  top: 2vh;
  right: 2vw;
  z-index: 2;
  width: 6vh;
  height: 6vh;
  border-radius: 50%;
  border: 0;
  background: #2a1c3e;
  color: #ffe3a8;
  font-size: 3vh;
  cursor: pointer;
}

/* ---------- หน้าต่างแก้ไขบัตร (กรอบใช้ .st-box ของชุดซากุระ) ---------- */
.pc-edit-box {
  width: min(92vw, 150vh) !important;
  max-height: 88vh;
  overflow-y: auto;
}
.pc-f {
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
  margin: 0 0 1.4vh;
  font-size: 2vh;
}
.pc-f > span {
  font-weight: 800;
}
.pc-f input {
  font: 600 2.2vh Sarabun, sans-serif;
  padding: 0.8vh 1.2vh;
  border-radius: 1vh;
  border: 1px solid #d9b06a;
}
.pc-picks {
  display: flex;
  gap: 0.8vh;
  overflow-x: auto;
  padding-bottom: 0.4vh;
}
.pc-pick {
  position: relative;
  flex: none;
  width: 10vh;
  padding: 0;
  border: 0.3vh solid transparent;
  border-radius: 1vh;
  background: #00000014;
  overflow: hidden;
  cursor: pointer;
}
.pc-pick img {
  display: block;
  width: 100%;
  height: 11vh;
  object-fit: cover;
  object-position: center top;
}
.pc-pick span {
  display: block;
  font: 700 1.5vh Sarabun, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.2vh;
}
.pc-pick.on {
  border-color: #f0659a;
  background: #ffe4ef;
}
.pc-pick em {
  position: absolute;
  top: 0.4vh;
  left: 0.4vh;
  width: 2.8vh;
  height: 2.8vh;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f0659a;
  color: #fff;
  font: 800 1.6vh Sarabun, sans-serif;
}
.pc-tpicks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8vh;
}
.pc-tpick {
  padding: 0.6vh 1.4vh;
  border-radius: 99px;
  border: 1px solid #d9b06a;
  background: #fff;
  font: 700 1.8vh Sarabun, sans-serif;
  cursor: pointer;
}
.pc-tpick.on {
  background: #f0659a;
  border-color: #f0659a;
  color: #fff;
}
.pc-save {
  display: block;
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .pc-left,
  .pc-right {
    transition: none;
  }
}

/* ---------- ทางเข้าหน้าความสำเร็จ (Code/Achievements/) ---------- */
.pc-more {
  order: 2;
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--pc-accent2);
  font: 800 1.8vh Sarabun, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.pc-bar .pc-ach {
  position: relative;
  padding-right: 4.6vh;
}
/* จุดแดงอยู่ในตัวปุ่ม เพราะปุ่มตัดมุมด้วย clip-path (ของที่ล้นออกนอกปุ่มจะถูกตัด) */
.pc-ach em {
  position: absolute;
  top: 50%;
  right: 1.6vh;
  transform: translateY(-50%);
  min-width: 2.6vh;
  height: 2.6vh;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #e8344e;
  color: #fff;
  font: 800 1.5vh Sarabun, sans-serif;
  font-style: normal;
}

/* ======================================================================
   หน้าตาใหม่ของบัตรผู้เล่น (Beta 0.21.0) — คลาส .pp-* · แบบเดียวกับหน้าตัวละคร (Code/Characters/char-page.css)
   กฎ .pc-* ด้านบนเป็นหน้าตาเดิม (ยังใช้กับหน้าต่างแก้ไขบัตร .pc-edit / .pc-pick) — ส่วนหน้าบัตรไม่ได้ใช้แล้ว
   ธีม 3 แบบ = สีแถบเฉียง + สีเน้น (ตัวแปร --pp-*) · ตัวหนังสือมีขั้นต่ำเป็น px ให้อ่านออกบนมือถือแนวนอน
   ====================================================================== */
#app.pp-app {
  background: none;
}
.pp {
  --pp-ink: #3b4255;
  --pp-soft: #6b7285;
  --pp-accent: #e86a92;
  --pp-band1: #f6b7cb;
  --pp-band2: #ec86a8;
  --pp-chip1: #ff9ac0;
  --pp-chip2: #c7a2ff;
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: var(--pp-ink);
  font-family: Mali, Sarabun, sans-serif;
  background:
    repeating-linear-gradient(90deg, #3b425508 0 1px, transparent 1px 12vh),
    repeating-linear-gradient(0deg, #3b425508 0 1px, transparent 1px 12vh),
    linear-gradient(160deg, #fbf6f1, #efe7ea 60%, #e9e3ea);
}
.pp-theme-night {
  --pp-accent: #6c7fd8;
  --pp-band1: #8da0e6;
  --pp-band2: #4a5ab0;
  --pp-chip1: #8da0e6;
  --pp-chip2: #b9a2f0;
}
.pp-theme-teahouse {
  --pp-accent: #c58a3a;
  --pp-band1: #ecc98f;
  --pp-band2: #c58a3a;
  --pp-chip1: #e0b062;
  --pp-chip2: #e98a6a;
}
.pp button {
  font: inherit;
  cursor: pointer;
}
.pp-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 max(14px, 2.6vh) / 1 Mali, sans-serif;
  color: var(--pp-soft);
}

/* ---------- ฉาก ---------- */
.pp-band {
  position: absolute;
  left: -18vh;
  top: -20vh;
  width: 66vh;
  height: 150vh;
  background: linear-gradient(180deg, var(--pp-band1), var(--pp-band2));
  transform: rotate(-24deg);
  opacity: 0.9;
  pointer-events: none;
}
.pp-band-txt {
  position: absolute;
  left: 1.6vh;
  bottom: 3vh;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 900 8vh/1 Georgia, serif;
  letter-spacing: 0.06em;
  color: #ffffffa0;
  pointer-events: none;
}
.pp-ghost {
  position: absolute;
  right: 8vh;
  top: 4vh;
  height: 112vh;
  opacity: 0.08;
  filter: grayscale(1);
  pointer-events: none;
}
.pp-hero {
  position: absolute;
  left: 50%;
  bottom: -6vh;
  height: 104vh;
  transform: translateX(-46%);
  filter: drop-shadow(0 1vh 2vh #0003);
  pointer-events: none;
}

/* ---------- แถบบน ---------- */
.pp-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 11vh;
  display: flex;
  align-items: center;
  gap: 2vh;
  padding: 0 2.4vh;
  background: linear-gradient(#fffaf2f0, #fffaf200);
  z-index: 2;
}
.pp-crumb {
  font: 800 max(14px, 2.6vh) / 1 Mali, sans-serif;
  white-space: nowrap;
}
.pp-crumb small {
  margin-left: 0.6vh;
  font-weight: 700;
  color: var(--pp-soft);
}
.pp-copy {
  margin-left: auto;
  margin-right: 8vh; /* เว้นที่ให้ปุ่มปิดของหน้าต่างดูบัตรคนอื่น (.pc-close) */
  display: inline-flex;
  align-items: center;
  gap: 0.8vh;
  padding: 0.8vh 1.4vh;
  border: 0;
  border-radius: 99px;
  background: #ffffffc8;
  color: var(--pp-soft);
  font: 700 max(11px, 1.8vh) / 1 Sarabun, sans-serif !important;
}
.pp-copy em {
  font-style: normal;
  color: var(--pp-accent);
  font-weight: 800;
}

/* ---------- ซ้าย: การ์ดผู้เล่น ---------- */
.pp-card {
  position: absolute;
  left: 7vh;
  top: 13vh;
  width: max(48vh, 270px);
  max-height: 72vh;
  overflow-y: auto;
  padding: 2vh;
  border-radius: 1.6vh;
  background: #fffaf2eb;
  box-shadow: 0 1vh 2.4vh #0002;
  z-index: 1;
  scrollbar-width: none;
}
.pp-id {
  display: flex;
  align-items: center;
  gap: 1.8vh;
}
.pp-av {
  position: relative;
  flex: none;
  width: 13vh;
  height: 13vh;
}
.pp-who {
  min-width: 0;
}
.pp-who b {
  display: block;
  font: 900 max(18px, 3.6vh) / 1.1 Mali, sans-serif;
  overflow-wrap: anywhere;
}
.pp-title,
.pp-badge {
  display: inline-block;
  margin: 0.6vh 0.6vh 0 0;
  padding: 0.4vh 1.2vh;
  border-radius: 0.6vh;
  color: #fff;
  font: 800 max(11px, 1.7vh) / 1.3 Mali, sans-serif;
  font-style: normal;
  background: linear-gradient(90deg, var(--pp-chip1), var(--pp-chip2));
}
.pp-title.none {
  background: #3b42551f;
  color: var(--pp-soft);
}
.pp-badge {
  background: linear-gradient(90deg, #ffd36b, #d99a12);
  color: #5a3a0a;
}
.pp-who small {
  display: block;
  margin-top: 0.6vh;
  font: 600 max(10px, 1.5vh) / 1.2 Sarabun, sans-serif;
  color: var(--pp-soft);
}
.pp-bio {
  margin: 1.2vh 0 0;
  padding: 0.8vh 1.2vh;
  border-left: 0.4vh solid var(--pp-accent);
  border-radius: 0 0.6vh 0.6vh 0;
  background: #ffffffb0;
  font: 600 max(11px, 1.7vh) / 1.4 Sarabun, sans-serif;
  color: var(--pp-ink);
  font-style: italic;
}
.pp-lv {
  display: flex;
  align-items: flex-end;
  gap: 1.2vh;
  margin-top: 1.6vh;
}
.pp-lv > b {
  font: 900 max(34px, 7.4vh) / 0.85 Georgia, serif;
}
.pp-lv > span {
  padding-bottom: 0.6vh;
  font: 800 max(11px, 1.9vh) / 1.3 Sarabun, sans-serif;
}
.pp-lv small {
  display: block;
  font-weight: 700;
  color: var(--pp-soft);
}
.pp-lv > em {
  margin-left: auto;
  padding-bottom: 0.6vh;
  font: 800 max(10px, 1.6vh) / 1.2 Sarabun, sans-serif;
  font-style: normal;
  color: var(--pp-accent);
}
.pp-exp {
  height: 1vh;
  margin: 1vh 0 0;
  border-radius: 9px;
  overflow: hidden;
  background: #3b425526;
}
.pp-exp i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pp-band1), var(--pp-accent));
}
.pp-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1vh;
  margin-top: 1.4vh;
}
.pp-acts button {
  padding: 1vh 0.8vh;
  border: 0;
  border-radius: 0.9vh;
  color: #fff;
  background: #3b4255e8;
  font: 800 max(12px, 1.8vh) / 1.2 Mali, sans-serif !important;
}
.pp-acts button:disabled {
  opacity: 0.5;
  cursor: default;
}
.pp-acts small {
  display: block;
  margin-top: 0.3vh;
  font: 600 max(10px, 1.4vh) / 1.2 Sarabun, sans-serif;
  color: #ffd6e4;
}
.pp-warn {
  display: block;
  margin-top: 0.6vh;
  font: 700 max(10px, 1.5vh) / 1.3 Sarabun, sans-serif;
  color: #c0392b;
}
.pp-sec {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.4vh;
  padding: 0.6vh 1.2vh;
  border-radius: 0.6vh 0.6vh 0 0;
  background: var(--pp-ink);
  color: #fff;
  font: 800 max(12px, 1.8vh) / 1.2 Mali, sans-serif;
}
.pp-sec em {
  font: 700 max(10px, 1.4vh) / 1.2 Sarabun, sans-serif;
  font-style: normal;
  opacity: 0.8;
}
.pp-right .pp-sec {
  margin-top: 0;
}
.pp-medals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1vh 0.8vh;
  padding: 1.2vh;
  border-radius: 0 0 0.8vh 0.8vh;
  background: #ffffffd0;
}
.pp-medal {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.5vh;
  text-align: center;
}
.pp-medal i {
  width: 5.6vh;
  height: 5.6vh;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #3b42551a;
}
.pp-medal.bronze i {
  background: radial-gradient(circle at 50% 35%, #ffe0c2, #c47a3a);
}
.pp-medal.silver i {
  background: radial-gradient(circle at 50% 35%, #ffffff, #a9b1c0);
}
.pp-medal.gold i {
  background: radial-gradient(circle at 50% 35%, #fff3c4, #e0a521);
}
.pp-medal span {
  font: 800 max(10px, 1.5vh) / 1.2 Mali, sans-serif;
  overflow-wrap: anywhere;
}
.pp-medal.empty span {
  color: #3b425566;
  font-weight: 700;
}
.pp-medal em {
  position: absolute;
  top: -0.4vh;
  right: 18%;
  padding: 0 0.6vh;
  border-radius: 99px;
  background: var(--pp-accent);
  color: #fff;
  font: 800 max(9px, 1.3vh) / 1.5 Sarabun, sans-serif;
  font-style: normal;
}

/* ---------- ขวา ---------- */
.pp-right {
  position: absolute;
  right: 3vh;
  top: 13vh;
  width: max(48vh, 290px); /* จอเตี้ย (มือถือ) ตัวหนังสือมีขั้นต่ำเป็น px — แผงต้องกว้างพอ */
  display: grid;
  gap: 1.4vh;
  z-index: 1;
}
.pp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8vh;
}
.pp-stats div {
  padding: 1.1vh 0.6vh;
  border-radius: 0.9vh;
  text-align: center;
  background: #ffffffdb;
  box-shadow: inset 0 0 0 0.25vh #3b42551a;
}
.pp-stats b {
  display: block;
  font: 900 max(17px, 3.3vh) / 1 Georgia, serif;
}
.pp-stats small {
  font: 700 max(10px, 1.4vh) / 1.3 Sarabun, sans-serif;
  color: var(--pp-soft);
}
.pp-rank {
  display: flex;
  align-items: center;
  gap: 1.6vh;
  padding: 1.3vh;
  border-radius: 1vh;
  color: #fff;
  background: #3b4255e8;
}
.pp-rank > i {
  flex: none;
  width: 7.6vh;
  height: 7.6vh;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, #ffe28a, #d99a12);
  color: #6b3f12;
  font: 900 max(14px, 2.6vh) / 1 Georgia, serif;
  font-style: normal;
}
.pp-rank.t0 > i {
  background: linear-gradient(160deg, #f1c9a2, #b06f38);
}
.pp-rank.t1 > i {
  background: linear-gradient(160deg, #ffffff, #a9b1c0);
}
.pp-rank.t3 > i {
  background: linear-gradient(160deg, #d9fbff, #4fb3c8);
}
.pp-rank.t4 > i {
  background: linear-gradient(160deg, #e6f2ff, #6b8cff);
}
.pp-rank.t5 > i {
  background: conic-gradient(#ff9ac0, #ffd36b, #8fe3ff, #c7a2ff, #ff9ac0);
}
.pp-rank.none > i {
  background: #ffffff33;
  color: #fff;
}
.pp-rank b {
  display: block;
  font: 900 max(15px, 2.7vh) / 1.1 Mali, sans-serif;
}
.pp-rank small {
  display: block;
  font: 600 max(10px, 1.5vh) / 1.3 Sarabun, sans-serif;
  color: #ffd6e4;
}
.pp-rp {
  margin-left: auto;
  text-align: right;
  font: 900 max(16px, 3vh) / 1 Georgia, serif;
}
.pp-rp small {
  color: #ffffffaa;
}
.pp-games {
  display: grid;
  gap: 0.9vh;
  padding: 1.2vh;
  border-radius: 0 0 0.8vh 0.8vh;
  background: #ffffffd0;
}
.pp-grow {
  display: grid;
  grid-template-columns: max(9vh, 52px) 1fr max(12vh, 82px);
  align-items: center;
  gap: 1vh;
}
.pp-grow span {
  font: 800 max(11px, 1.7vh) / 1.2 Mali, sans-serif;
}
.pp-grow i {
  height: 1.2vh;
  border-radius: 9px;
  overflow: hidden;
  background: #3b425522;
}
.pp-grow u {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pp-band1), var(--pp-accent));
}
.pp-grow em {
  text-align: right;
  font: 700 max(10px, 1.5vh) / 1.2 Sarabun, sans-serif;
  font-style: normal;
  color: var(--pp-soft);
  white-space: nowrap;
}
.pp-arena {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8vh;
  padding: 1.1vh;
  border-radius: 0 0 0.8vh 0.8vh;
  background: #ffffffd0;
  cursor: pointer;
}
.pp-arena > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8vh;
}
.pp-arena > div.lock {
  opacity: 0.45;
}
.pp-arena b {
  font: 900 max(12px, 2vh) / 1 Georgia, serif;
}
.pp-boss {
  flex: none;
  width: 5vh;
  height: 5vh;
  border-radius: 50%;
  overflow: hidden;
  border: 0.3vh solid #fff;
  box-shadow: 0 0.2vh 0.5vh #0003;
  background: #f2e9ee;
}
.pp-boss img {
  width: 100%;
  height: 200%;
  object-fit: cover;
  object-position: 50% 0;
}

/* ---------- ล่าง: ปุ่ม · ตู้โชว์ · แก้ไขบัตร ---------- */
.pp-bottom {
  position: absolute;
  left: 7vh;
  bottom: 2.6vh;
  display: flex;
  gap: 1vh;
  z-index: 1;
}
.pp-bottom button {
  position: relative;
  height: 6vh;
  padding: 0 1.8vh;
  border: 0;
  border-radius: 0.9vh;
  color: var(--pp-ink);
  background: #fffaf2eb;
  box-shadow: 0 0.3vh 0.6vh #0002;
  font: 800 max(12px, 1.9vh) / 1 Mali, sans-serif !important;
}
.pp-bottom em {
  position: absolute;
  top: -0.8vh;
  right: -0.8vh;
  min-width: 2.6vh;
  height: 2.6vh;
  padding: 0 0.6vh;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #e5484d;
  color: #fff;
  font: 800 max(10px, 1.5vh) / 1 Sarabun, sans-serif;
  font-style: normal;
}
.pp-show {
  position: absolute;
  left: 50%;
  bottom: 2vh;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 1vh;
  padding: 0.8vh 1.2vh;
  border-radius: 1.2vh;
  background: #fffaf2c8;
  box-shadow: 0 0.6vh 1.4vh #0002;
  z-index: 1;
}
.pp-show-h {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
  font: 800 max(10px, 1.5vh) / 1 Mali, sans-serif;
  color: var(--pp-soft);
}
.pp-op {
  position: relative;
  width: 9vh;
  height: 12vh;
  overflow: hidden;
  border-radius: 0.8vh;
  background: linear-gradient(#f6e9ef, #e9dbe6);
  box-shadow: inset 0 0 0 0.25vh #ffffff;
}
.pp-op img {
  position: absolute;
  left: 50%;
  top: 0;
  height: 190%;
  transform: translateX(-50%);
}
.pp-op b,
.pp-op small {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 0.4vh;
  text-align: center;
  color: #fff;
  text-shadow: 0 0.2vh 0.4vh #000a;
}
.pp-op b {
  bottom: 2.2vh;
  font: 800 max(10px, 1.5vh) / 1.1 Mali, sans-serif;
}
.pp-op small {
  bottom: 0.6vh;
  font: 700 max(8px, 1.2vh) / 1.1 Sarabun, sans-serif;
  color: #ffe08a;
}
.pp-op::after {
  content: '';
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent, #0008);
}
.pp-op b,
.pp-op small {
  z-index: 1;
}
.pp-op.empty {
  display: grid;
  place-items: center;
  color: #3b425555;
  font: 800 max(16px, 3vh) / 1 sans-serif;
}
.pp-op.empty::after {
  display: none;
}
.pp-edit {
  position: absolute;
  right: 3vh;
  bottom: 2.6vh;
  width: 36vh;
  height: 10vh;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border-style: solid;
  border-color: transparent;
  border-width: 0 8.8vh 0 7.6vh;
  border-image: url(../../Assets/UI/Assets/kit3/btn-gold.webp) 0 72 0 62 fill / 0 8.8vh 0 7.6vh stretch;
  color: #6b3f12;
  font: 900 max(16px, 3.4vh) / 1 Mali, sans-serif !important;
  filter: drop-shadow(0 0.8vh 1.2vh #0004);
  z-index: 1;
}
.pp-edit:disabled {
  filter: grayscale(0.7) opacity(0.7);
  cursor: default;
}

/* โหมดดูภาพ: ซ่อนแผงทั้งหมด เหลือภาพตัวละคร + ปุ่มล่าง */
.pp.art-only .pp-panels,
.pp.art-only .pp-show,
.pp.art-only .pp-edit {
  opacity: 0;
  pointer-events: none;
}
.pp-panels,
.pp-show,
.pp-edit {
  transition: opacity 0.25s;
}

/* หน้าต่างดูบัตรของคนอื่น: บัตรเต็มกรอบหน้าต่าง */
.pc-modal > .pp {
  position: relative;
  inset: auto;
  width: min(96vw, 180vh);
  height: 92vh;
  border-radius: 1.6vh;
  box-shadow: 0 2vh 6vh #000a;
}
.pc-modal > .pc-close {
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .pp-panels,
  .pp-show,
  .pp-edit {
    transition: none;
  }
}
