/* home.theme-5.css — Home · ชั้นธีมใหม่ (แยกจาก theme2.css เดิม)
   ลำดับ <link> ใน index.html มีผลต่อการทับกันของกฎ — ไฟล์ชั้นเดียวกันเรียงตามเลขส่วน */
.rv-plate small {
  position: relative;
  color: #f4f1e6 !important;
  font-size: calc(var(--D) * 0.13);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
}
.rv-lvbar {
  position: absolute;
  left: calc(var(--D) * 0.5);
  top: calc(var(--D) * 0.56);
  width: calc(var(--D) * 2.42);
  height: calc(var(--D) * 0.36);
  z-index: 1;
  background: linear-gradient(#a9abae, #9b9da1);
  clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
  box-sizing: border-box;
  padding: 0 0 0 calc(var(--D) * 0.62);
}
.rv-lvbar i {
  position: absolute;
  left: calc(var(--D) * 0.5);
  right: calc(var(--D) * 0.18);
  top: 20%;
  height: calc(var(--D) * 0.065);
  border-radius: 99px;
  background: #5b6070;
  overflow: hidden;
}
.rv-lvbar i u {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(#22e0a6, #16b85a);
}
.rv-lvbar b {
  position: absolute;
  left: calc(var(--D) * 0.62);
  bottom: 6%;
  color: #ffa600 !important;
  font:
    900 calc(var(--D) * 0.2)/1 'Arial Black',
    Arial,
    sans-serif;
  letter-spacing: 0.02em;
  text-shadow: 0 0.15vh 0 #7a4a0055;
}
.rv-lvbar b em {
  font-style: normal;
  color: #ffd83b;
  margin-right: 0.35em;
  font-size: 0.95em;
}
.rv-lvbar small {
  position: absolute;
  right: calc(var(--D) * 0.5);
  bottom: 14%;
  color: #fff !important;
  font-size: calc(var(--D) * 0.11);
  line-height: 1;
  text-shadow: 0 0.1vh 0.2vh #0006;
}
@media (max-height: 500px) {
  .rv-me2 {
    --D: 20vh;
  }
}
/* ===== หน้าแรก/โปรไฟล์ (0.6.2) ===== */
/* พื้นหลังหน้าแรกเต็มจอ รวมพื้นที่ขอบเว้า (notch) ไม่ให้เห็นภาพอื่นต่อ */
#app.home {
  background: url(../../Assets/UI/Assets/kit2/bg-home.webp) center/cover no-repeat !important;
}
#app.home .scene {
  background: none !important;
}
/* ปุ่มแพตช์โน้ตด้านซ้าย */
.rv-sb.rv-pn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.rv-sb.rv-pn small {
  font:
    800 max(8px, 1.6vh)/1 Sarabun,
    sans-serif;
  color: #ffe2a6;
  margin-top: 0.3vh;
}
.rv-sb.rv-pn {
  width: 8.4vh !important;
  height: 8.4vh !important;
  padding: 0.8vh !important;
}
.rv-sb.rv-pn svg {
  width: 4.2vh !important;
  height: 4.2vh !important;
  flex: none;
}
/* ===== ปุ่มเริ่มเล่น: สตามิน่า · แสงวิ่ง · กดยุบ + กลีบซากุระ · ลูกศรเปลี่ยนเกม ===== */
.rv-play {
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.8vh !important;
}
.rv-start {
  position: relative;
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}
.rv-start::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -7.5vh;
  right: -7.5vh;
  clip-path: inset(0 round 99px);
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0 38%, #fff8 46%, #ffffffcc 50%, #fff8 54%, transparent 62% 100%) no-repeat;
  background-size: 60% 100%;
  background-position: -150% 0;
  animation: rvShine 3.6s ease-in-out infinite;
}
@keyframes rvShine {
  0%,
  62% {
    background-position: -150% 0;
  }
  100% {
    background-position: 250% 0;
  }
}
.rv-start:active,
.rv-start.press {
  transform: translateY(0.6vh) scale(0.96);
  filter: drop-shadow(0 0.3vh 0.6vh #0006) brightness(0.97);
}
.rv-start b {
  font-size: 5.6vh !important;
}
.rv-start .rv-st {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5vh;
  font-size: max(10px, 2vh) !important;
  font-weight: 800;
  opacity: 1 !important;
  color: #4a3410;
  text-shadow: none;
}
.rv-start .rv-st b {
  font-size: inherit !important;
  letter-spacing: 0;
  line-height: 1;
}
.rv-petal {
  position: fixed;
  z-index: 9999;
  width: calc(max(10px, 2.8vh) * var(--sz, 1));
  height: calc(max(10px, 2.8vh) * var(--sz, 1));
  margin: calc(max(10px, 2.8vh) * var(--sz, 1) / -2) 0 0 calc(max(10px, 2.8vh) * var(--sz, 1) / -2);
  pointer-events: none;
  background: center/contain no-repeat;
  filter: drop-shadow(0 0.2vh 0.4vh #c0607055);
  animation: rvPetal 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes rvPetal {
  0% {
    transform: translate(0, 0) rotate(0) scale(0.6);
    opacity: 1;
  }
  65% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1);
    opacity: 0;
  }
}
.rv-swap {
  display: inline-flex;
  align-items: center;
  gap: 0.8vh;
  height: 4.6vh;
  padding: 0 1.8vh;
  border-radius: 99px;
  border: 0.25vh solid #e9cf86;
  background: linear-gradient(#3b4255ee, #2a3040ee);
  color: #fff;
  font:
    800 max(11px, 2.2vh) Sarabun,
    sans-serif;
  box-shadow: 0 0.4vh 1vh #0005;
  cursor: pointer;
}
.rv-swap i {
  font-style: normal;
  color: #ffd36b;
  font-size: 0.9em;
  transition: transform 0.15s;
}
.rv-swap:active {
  transform: translateY(0.3vh);
}
.rv-gpick {
  position: absolute;
  right: 0;
  bottom: calc(100% + 1vh);
  min-width: 30vh;
  padding: 1vh;
  border-radius: 1.8vh;
  background: #fffaf2;
  box-shadow: 0 1vh 2.4vh #0007;
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
  z-index: 20;
  animation: pgUp 0.18s ease-out;
}
.rv-gpick button {
  display: flex;
  align-items: center;
  gap: 1.2vh;
  padding: 1vh 1.4vh;
  border: 0;
  border-radius: 1.2vh;
  background: #f2ecdf;
  color: #3b4255;
  font:
    800 max(12px, 2.4vh) Sarabun,
    sans-serif;
  text-align: left;
  cursor: pointer;
}
.rv-gpick button span {
  font-size: 1.2em;
}
.rv-gpick button b {
  flex: 1;
}
.rv-gpick button.on {
  background: #fff3cf;
  box-shadow: inset 0 0 0 0.25vh #e0a521;
}
.rv-gpick button em {
  font-style: normal;
  color: #2e9a5a;
}
@media (prefers-reduced-motion: reduce) {
  .rv-start::after {
    animation: none;
  }
  .rv-petal {
    display: none;
  }
}
/* 0.7.1 หน้าเล่นเกม: ปุ่มเปลี่ยนเกมเปิดรายการเกมด้านล่าง (ไม่มีหน้าเลือกเกมแยกแล้ว) */
.gcur-w {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 5;
}
.gcur-w .gcur {
  width: 100%;
}
.gcur-w .rv-gpick {
  top: calc(100% + 0.8vh);
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  min-width: min(46vh, 90vw);
}
/* ===== ปุ่มแถบข้างซ้าย (0.16.1) ===== */
/* ทำไม: 0.16.0 เพิ่มปุ่มอีเวนต์/แอดมิน ปุ่มเรียงลงล่างยาวจนทับเมนูร้านค้า/ช่องเก็บของ
   กำหนดกรอบให้อยู่ระหว่างใต้ป้ายโปรไฟล์ (สูงราว 22vh) กับเหนือเมนูล่าง (ราว 19vh) แล้วให้ปุ่มที่ล้นขึ้นคอลัมน์ใหม่ทางขวา */
.rv-side {
  top: 24vh;
  bottom: 20vh;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 1.6vh;
}
/* ===== เมนูซ่อนข้างปุ่มเริ่มเล่น (0.19.1) ===== */
/* ทำไม: ปุ่มข้างซ้ายเยอะจนบังฉาก — รวมไว้ในปุ่ม "เมนู" ข้างปุ่มเริ่มเล่น กดแล้วกางออกไปทางซ้าย (แบบ Arknights: Endfield)
   .rv-more ลอยอยู่ซ้ายของ .rv-play สูงเท่าปุ่มเริ่มเล่น · row-reverse = ปุ่มเปิดอยู่ขวาสุด รายการเรียงออกไปทางซ้าย */
.rv-side {
  display: none; /* แถบข้างซ้ายเดิม — ย้ายปุ่มไปเมนูซ่อนแล้ว */
}
.rv-more {
  --rv-more-h: 15vh; /* ความสูงปุ่มเริ่มเล่น (home.theme.css .rv-start) — ให้เมนูอยู่กึ่งกลางแนวเดียวกัน */
  position: absolute;
  right: calc(100% + 1.6vh);
  bottom: 0;
  height: var(--rv-more-h);
  width: max-content; /* ไม่งั้นความกว้างถูกจำกัดเท่า .rv-play แล้วรายการจะตกเป็นแนวตั้ง */
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 1.4vh;
}
.rv-mtg {
  position: relative;
  flex: none;
  width: 11vh;
  height: 11vh;
  padding: 1.6vh;
  border: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #4a5266;
  background: url(../../Assets/UI/Assets/kit3/btn-round.webp) center / 100% 100% no-repeat;
  filter: drop-shadow(0 0.5vh 0.8vh #0005);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.rv-mtg svg {
  width: 4.4vh;
  height: 4.4vh;
  flex: none;
  transition: transform 0.25s ease;
}
.rv-mtg small {
  font:
    800 max(9px, 1.8vh)/1 Sarabun,
    sans-serif;
  margin-top: 0.3vh;
  white-space: nowrap;
}
.rv-mtg:active {
  transform: scale(0.94);
}
.rv-more.open .rv-mtg svg {
  transform: rotate(45deg);
}
.rv-more.open .rv-mtg {
  filter: drop-shadow(0 0 1.2vh #ffd36bcc) drop-shadow(0 0.5vh 0.8vh #0005);
}
.rv-mdot {
  position: absolute;
  right: 0.8vh;
  top: 0.8vh;
  width: 2.2vh;
  height: 2.2vh;
  border-radius: 50%;
  background: #e5484d;
  box-shadow: 0 0 0 0.3vh #fff;
}
.rv-more.open .rv-mdot {
  display: none; /* เปิดแล้วเห็นตัวเลขที่ปุ่มแต่ละอันอยู่แล้ว */
}
/* แถบรายการ: ปิด = ตัดซ่อนจากขวาไปซ้าย · เปิด = กางออกทางซ้าย · รายการเยอะจนเกินจอ = ขึ้นแถวใหม่ด้านบน */
.rv-drawer {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap-reverse;
  align-items: center;
  gap: 1.4vh 1.6vh;
  /* เกินกว้างนี้ขึ้นแถวใหม่ด้านบนแทน — 60vh = ขอบขวาของแถบ (ห่างขอบจอ 56vh: ปุ่มเริ่มเล่น + ปุ่มเมนู) + ระยะขอบซ้าย 4vh
     (มุมซ้ายล่างว่างแล้ว: ร้านค้า/ช่องเก็บของย้ายขึ้นไปเป็นแถบ .rv-tabs ใต้ป้ายโปรไฟล์) */
  box-sizing: border-box;
  max-width: calc(100vw - 60vh);
  padding: 1.2vh 2.4vh 1.2vh 3vh;
  border-radius: 5.8vh;
  background: linear-gradient(to left, #2a3040e6, #2a3040b3 70%, #2a304066);
  box-shadow: 0 0.6vh 1.6vh #0005;
  clip-path: inset(-4vh -4vh -4vh 100% round 5.8vh);
  visibility: hidden;
  transition:
    clip-path 0.28s cubic-bezier(0.2, 0.8, 0.3, 1),
    visibility 0s linear 0.28s;
}
.rv-more.open .rv-drawer {
  clip-path: inset(-4vh -4vh -4vh -4vh round 5.8vh);
  visibility: visible;
  transition:
    clip-path 0.28s cubic-bezier(0.2, 0.8, 0.3, 1),
    visibility 0s;
}
/* ปุ่มในเมนูเล็กกว่าปุ่มข้างเดิม (9.6vh ใน sakura-kit.css) เพื่อให้เรียงแถวเดียวได้บนจอ 16:9 */
.rv-drawer .rv-sb.rv-pn {
  flex: none;
  width: 9.2vh !important;
  height: 9.2vh !important;
  padding: 1.2vh !important;
}
.rv-drawer .rv-sb.rv-pn svg {
  width: 3.4vh !important;
  height: 3.4vh !important;
}
.rv-drawer .rv-sb.rv-pn small {
  font-size: max(7px, 1.3vh); /* ป้ายยาว (แบทเทิลพาส · เควสรายวัน) ต้องอยู่ในวงทองได้ */
  letter-spacing: -0.02em;
}
@media (prefers-reduced-motion: reduce) {
  .rv-drawer,
  .rv-more.open .rv-drawer,
  .rv-mtg,
  .rv-mtg svg {
    transition: none;
  }
}
/* ===== แถบร้านค้า/ช่องเก็บของซ้ายมือ แบบ RoV (0.19.1) ===== */
/* ทำไม: ฝั่งซ้ายว่างหลังย้ายปุ่มข้างเข้าเมนูซ่อน — ทางเข้าที่กดบ่อยเป็นแถบยาว (ไอคอน + ชื่อ + คำอธิบาย) ใต้ป้ายโปรไฟล์
   กรอบใช้ปุ่มครีม btn-cream.webp 265×74 ตัด 3 ช่วง ซ้าย 60 · ขวา 66 (ค่าเดียวกับ sakura-kit.css) · ไอคอนล้นออกทางซ้ายทับดอกซากุระของกรอบ */
.rv-tabs {
  position: absolute;
  left: 3vh;
  top: 27vh;
  display: flex;
  flex-direction: column;
  gap: 2.2vh;
}
.rv-tab {
  --rv-tab-h: 10vh;
  position: relative;
  box-sizing: border-box;
  width: 46vh;
  height: var(--rv-tab-h);
  padding: 0 0 0 3.2vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  background: none;
  border-style: solid;
  border-color: transparent;
  border-width: 0 calc(var(--rv-tab-h) * 0.9) 0 calc(var(--rv-tab-h) * 0.84);
  border-image: url(../../Assets/UI/Assets/kit3/btn-cream.webp) 0 66 0 60 fill / 0 calc(var(--rv-tab-h) * 0.9) 0 calc(var(--rv-tab-h) * 0.84) stretch;
  filter: drop-shadow(0 0.6vh 1vh #0005);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.rv-tab img {
  position: absolute;
  left: -9.6vh;
  top: 50%;
  width: 11.5vh;
  height: 11.5vh;
  object-fit: contain;
  transform: translateY(-54%);
  filter: drop-shadow(0 0.3vh 0.4vh #0005); /* เงาใส่ด้วยโค้ด — ไอคอนสีครีมจะได้ไม่จมกับกรอบครีม */
  pointer-events: none;
}
.rv-tab b {
  font:
    800 max(13px, 3vh) / 1.1 Mali,
    Sarabun,
    sans-serif;
  color: #4a3410;
  white-space: nowrap;
}
.rv-tab small {
  font:
    700 max(9px, 1.7vh) / 1.2 Sarabun,
    sans-serif;
  color: #8a6d3b;
  white-space: nowrap;
}
.rv-tab:active {
  transform: translateY(0.4vh) scale(0.97);
}
@media (prefers-reduced-motion: reduce) {
  .rv-tab {
    transition: none;
  }
}

/* ===== หน้าเล่นเกม แบบ C (home.js: playView) =====
   แท็บเกมด้านบน · การ์ดโหมด (ใหญ่ 2 ใบ · เล็ก 3 ใบ) · แผงรายละเอียดโปร่งแสง (ไม่บังตัวละครด้านหลัง)
   สีของแต่ละโหมดอยู่ที่ .pm-m-<id> (ตัวแปร --pm-c สีหลัก · --pm-soft สีอ่อนของการ์ดเล็ก)
   EXTEND: โหมดใหม่ = เพิ่มบล็อก .pm-m-<id> ตั้งสี 2 ตัว */
.pm-m-match {
  --pm-c: #c9446f;
  --pm-soft: #f2c6d4;
}
.pm-m-ranked {
  --pm-c: #34405f;
  --pm-soft: #e9c77b;
}
.pm-m-solo {
  --pm-c: #d07a12;
  --pm-soft: #ffe6c2;
}
.pm-m-room {
  --pm-c: #8a6644;
  --pm-soft: #fff8f0;
}
.pm-m-join {
  --pm-c: #4a3428;
  --pm-soft: #fff8f0;
}
.pm {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr) minmax(0, 0.5fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  column-gap: 2vh;
  row-gap: 1.4vh;
  font-family: Sarabun, sans-serif;
  color: #4a3428;
}
.pm > * {
  position: relative;
  z-index: 1;
}
/* ตัวละครที่ใส่อยู่ ยืนมุมขวา อยู่หลังแผงรายละเอียด (แผงโปร่งแสงจึงยังเห็นตัวละคร) */
.pm > .pm-hero {
  position: absolute;
  z-index: 0;
  right: -2vh;
  bottom: -2vh;
  height: 100%;
  max-width: 42%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  filter: drop-shadow(0 1vh 2vh #0004);
}
.pm > .cstat,
.pm > .note {
  grid-row: 2;
  grid-column: 1 / 3;
  margin: 0;
}
/* --- แถบเลือกเกม + ปุ่มสอนเล่น --- */
.pm-top {
  grid-row: 1;
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.4vh;
}
.pm-games {
  display: flex;
  gap: 0.6vh;
  padding: 0.7vh;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.95);
  box-shadow: 0 0.6vh 1.4vh #0002;
}
.pm-gtab,
.pm-tut {
  min-height: 36px;
  height: 6vh;
  margin: 0;
  padding: 0 2.2vh;
  border-radius: 999px;
  font:
    800 max(12px, 2.6vh) / 1 Sarabun,
    sans-serif;
  cursor: pointer;
}
.pm-gtab {
  border: 0;
  background: transparent;
  color: #4a3428;
}
.pm-gtab.on {
  background: #c9446f;
  color: #fff;
}
.pm-tut {
  border: 2px dashed #c9446f;
  background: rgba(255, 240, 245, 0.95);
  color: #9e2f55;
}
/* --- การ์ดโหมด --- */
.pm-grid {
  grid-row: 3;
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1.6vh;
  min-height: 0;
}
.pm-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 2vh 2.2vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.4vh;
  text-align: left;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 2.6vh;
  box-shadow: 0 1vh 2vh #0003;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.pm-card.on {
  border: 0.5vh solid #fff;
  box-shadow:
    0 0 0 0.45vh #e9c77b,
    0 1.6vh 3vh #0004;
  transform: translateY(-0.6vh);
}
.pm-card:active {
  transform: translateY(0) scale(0.98);
}
.pm-card b {
  font:
    700 max(15px, 3.4vh) / 1.15 Mali,
    Sarabun,
    sans-serif;
}
.pm-card small {
  font:
    600 max(10px, 1.9vh) / 1.3 Sarabun,
    sans-serif;
}
.pm-ic {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pm-badge {
  display: inline-block;
  padding: 0.5vh 1.4vh;
  border-radius: 999px;
  font:
    800 max(10px, 1.8vh) / 1.2 Sarabun,
    sans-serif;
}
/* การ์ดใหญ่: พื้นสีเข้มของโหมด ตัวอักษรขาว */
.pm-big {
  grid-column: span 3;
  background: var(--pm-c);
  color: #fff;
}
.pm-big .pm-badge {
  position: absolute;
  left: 2.2vh;
  top: 2vh;
  background: var(--pm-soft);
  color: var(--pm-c);
}
.pm-big .pm-icbox {
  width: 9vh;
  height: 9vh;
  margin-bottom: auto;
  margin-top: 5vh;
}
.pm-big b {
  font-size: max(20px, 5.4vh);
}
.pm-big small {
  color: #f6eef3;
  font-size: max(11px, 2.2vh);
}
/* รูปพื้นการ์ดใหญ่ (Assets/UI/Assets/play/) + เงาไล่ด้านล่างให้ตัวหนังสือขาวอ่านชัด */
.pm-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.pm-card.has-art::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(20, 12, 24, 0.55));
  pointer-events: none;
}
.pm-card.has-art > b,
.pm-card.has-art > small {
  position: relative;
  z-index: 1;
  text-shadow: 0 0.3vh 0.8vh #0008;
}
.pm-card.has-art > .pm-badge {
  z-index: 1;
  background: #fff;
}
/* ตราแรงก์ของผู้เล่น วางกลางวงแสงบนแท่นของรูปพื้น
   ขนาดตามความสูงการ์ด (top/bottom เป็น %) — จอเล็กจอใหญ่ตราจึงพอดีวงแสงเท่ากัน */
.pm-rank {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 12%;
  bottom: 33%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2vh;
}
.pm-rank .rk-em.big {
  flex: 1 1 0;
  min-height: 0;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  transform: scale(1.45); /* รูปตรามีขอบใสรอบตัว + เจ้าของอยากให้ตราเด่น → ขยายเกินวงแสงเล็กน้อย */
  transform-origin: center 85%; /* ขยายขึ้นด้านบนเป็นหลัก ไม่ลงไปทับป้ายชื่อระดับ */
  filter: drop-shadow(0 0 1.8vh rgba(255, 220, 140, 0.75));
}
.pm-rank small {
  position: relative;
  padding: 0.3vh 1.4vh;
  border-radius: 999px;
  background: rgba(20, 24, 40, 0.6);
  color: #ffe2a0;
  font:
    800 max(10px, 1.9vh) / 1.2 Sarabun,
    sans-serif;
}
.pm-rank.empty .rk-em.big {
  filter: grayscale(1) opacity(0.55);
}
/* การ์ดเล็ก: พื้นสีอ่อน ไอคอนในกล่องสีของโหมด */
.pm-small {
  grid-column: span 2;
  background: var(--pm-soft);
  color: #4a3428;
}
.pm-small .pm-icbox {
  width: 6vh;
  height: 6vh;
  margin-bottom: auto;
  padding: 1vh;
  box-sizing: border-box;
  border-radius: 1.4vh;
  background: var(--pm-c);
  color: #fff;
}
.pm-small small {
  color: #6b5a4e;
}
/* --- แผงรายละเอียด: โปร่งแสงบาง ๆ แต่ตัวหนังสือชัด (เงาขาวรอบตัวอักษร) --- */
.pm-detail {
  grid-row: 3;
  grid-column: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8vh;
  padding: 2.4vh 2.6vh;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 2.6vh;
  background: rgba(255, 250, 244, 0.3);
  -webkit-backdrop-filter: blur(1.2vh);
  backdrop-filter: blur(1.2vh);
  box-shadow: 0 1vh 2.4vh #0002;
  color: #3e2a20;
  text-shadow:
    0 0 0.5vh #fff,
    0 0 1vh #fffc;
}
.pm-dhead {
  display: flex;
  align-items: center;
  gap: 1vh;
}
.pm-dhead .pm-badge {
  background: var(--pm-c);
  color: #fff;
  text-shadow: none;
}
.pm-dhead small {
  font:
    700 max(10px, 1.9vh) / 1.2 Sarabun,
    sans-serif;
}
.pm-detail h2 {
  margin: 0;
  font:
    700 max(18px, 5vh) / 1.15 Mali,
    Sarabun,
    sans-serif;
}
.pm-detail p {
  margin: 0;
  font:
    700 max(11px, 2.3vh) / 1.35 Sarabun,
    sans-serif;
}
.pm-detail ul {
  margin: 0.4vh 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
}
.pm-detail li {
  position: relative;
  padding-left: 3vh;
  font:
    600 max(11px, 2.1vh) / 1.35 Sarabun,
    sans-serif;
}
.pm-detail li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--pm-c);
  font-weight: 800;
}
.pm-grow {
  flex-grow: 1;
}
.pm-codel {
  font:
    700 max(10px, 1.9vh) / 1.2 Sarabun,
    sans-serif;
}
.pm-code {
  min-height: 40px;
  height: 7vh;
  padding: 0 1.6vh;
  border: 2px solid #ead9c8;
  border-radius: 1.6vh;
  background: #fffdf9;
  color: #4a3428;
  font:
    700 max(14px, 3vh) / 1 Sarabun,
    sans-serif;
  letter-spacing: 0.4vh;
  text-transform: uppercase;
}
.pm-go {
  min-height: 44px;
  height: 8.5vh;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1vh;
  border: 0.4vh solid #fff;
  border-radius: 2vh;
  background: var(--pm-c);
  color: #fff;
  text-shadow: none;
  font:
    800 max(15px, 3.4vh) / 1 Sarabun,
    sans-serif;
  box-shadow: 0 1vh 2vh #0003;
  cursor: pointer;
}
.pm-go svg {
  width: 3.4vh;
  height: 3.4vh;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pm-go:active {
  transform: scale(0.97);
}
@media (prefers-reduced-motion: reduce) {
  .pm-card,
  .pm-card.on,
  .pm-card:active,
  .pm-go:active {
    transition: none;
    transform: none;
  }
}
