/* ไพ่ฮีลใจ · Little Practice Cards + ส่วนกลางของไพ่ (ใช้กับไพ่ยิปซีด้วย)
   บล็อก: din/healing-deck (.lpc-app.lpc-stage), din/healing-article (.lpc-app .lpc-article) */
/* ---------- สีหลัก: ดึงมาจากธีมเว็บ DIYInspireNow ---------- */
.lpc-app {
  --lpc-green: #4ba44e;        /* สีแถบหัวกิจกรรม (เหมือนหน้าลอยกระทง) */
  --lpc-green-dark: #2b481e;   /* สีหัวข้อของเว็บ */
  --lpc-green-soft: #e3f1d9;
  --lpc-yellow: #f2b84b;       /* สีปุ่มหลักของกิจกรรมบนเว็บ */
  --lpc-yellow-text: #2b2207;
  --lpc-yellow-soft: #fff4d2;
  --lpc-orange: #f08a24;
  --lpc-pink-soft: #fde3e1;
  --lpc-cream: #fffcf2;
  --lpc-text: #333333;         /* สีตัวหนังสือของเว็บ */
  --lpc-muted: #66705f;
}

/* ---------- กันธีม WordPress มาทับสไตล์ ---------- */
.lpc-app, .lpc-app * { box-sizing: border-box; }
.lpc-app [hidden] { display: none !important; }
.lpc-app img { display: block; max-width: 100%; margin: 0; border: 0; box-shadow: none; }
.lpc-app :where(button, a.lpc-btn) {
  font: inherit; margin: 0; padding: 0; border: 0; background: none; color: inherit;
  text-transform: none; letter-spacing: normal; text-decoration: none; box-shadow: none;
  line-height: 1.3; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.lpc-app p, .lpc-app h2, .lpc-app h3, .lpc-app ul { margin: 0; padding: 0; }
.lpc-app ul { list-style: none; }

/* ---------- กรอบหลัก ---------- */
.lpc-app {
  text-align: center;
  font-family: var(--din-font, Sarabun, 'Noto Sans Thai', sans-serif); font-size: 17px; line-height: 1.6; color: var(--lpc-text);
}

/* ---------- พื้นที่กิจกรรม ---------- */
.lpc-app.lpc-stage { padding: 28px 16px 40px; border-radius: 10px; background: linear-gradient(180deg, #fbfdf6 0%, #f1f8e9 100%); }
.lpc-app .lpc-title { font-weight: 700; font-size: 23px; line-height: 1.4; color: var(--lpc-green-dark); }
.lpc-app .lpc-lead { margin: 8px auto 0; max-width: 32em; color: var(--lpc-muted); font-size: 16px; }

/* ลมหายใจ */
.lpc-app .lpc-breath { display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--lpc-green-dark); font-size: 15px; }
.lpc-app .lpc-breath-dot {
  width: 18px; height: 18px; border-radius: 50%; background: var(--lpc-yellow);
  box-shadow: 0 0 0 6px var(--lpc-yellow-soft); animation: lpc-breathe 8s ease-in-out infinite;
}
@keyframes lpc-breathe { 0%,100% { transform: scale(.7); } 50% { transform: scale(1.35); } }

/* ---------- หน้าเลือกไพ่ ---------- */
/* ไพ่คว่ำซ้อนเหลื่อมกันเป็นรูปพัด: ทุกใบหมุนรอบจุดหมุนที่อยู่ใต้ไพ่ลงไป (transform-origin) */
.lpc-app .lpc-pick {
  --lpc-cw: min(112px, 19vw);                       /* ความกว้างไพ่ 1 ใบ */
  position: relative; height: calc(var(--lpc-cw) * 2.15 + 34px); margin: 26px auto 0;
}
.lpc-app .lpc-pick-card {
  position: absolute; top: 22px; left: calc(50% - var(--lpc-cw) / 2); width: var(--lpc-cw); aspect-ratio: 2 / 3;
  border-radius: calc(var(--lpc-cw) * .11); transform-origin: 50% 260%;
  transform: rotate(var(--lpc-r, 0deg)); box-shadow: -2px 4px 10px rgba(43, 72, 30, .22);
  transition: transform .55s cubic-bezier(.2, .8, .3, 1) var(--lpc-d, 0s), opacity .35s ease;
}
.lpc-app .lpc-pick.is-gathered .lpc-pick-card { transform: rotate(0deg); transition-duration: 0s; }
.lpc-app .lpc-pick-card:hover, .lpc-app .lpc-pick-card:focus-visible { transform: rotate(var(--lpc-r, 0deg)) translateY(-18px); transition-delay: 0s; }
.lpc-app .lpc-pick-card:focus-visible { outline: 3px solid var(--lpc-orange); outline-offset: 3px; }
.lpc-app .lpc-pick.is-choosing .lpc-pick-card { pointer-events: none; opacity: .25; }
.lpc-app .lpc-pick.is-choosing .lpc-pick-card.is-chosen { z-index: 20; opacity: 1; animation: lpc-chosen 1.1s ease-in-out forwards; }
@keyframes lpc-chosen {
  0% { transform: rotate(var(--lpc-r)) translateY(-18px); }
  35% { transform: rotate(0) translateY(-22px); box-shadow: 0 0 0 5px var(--lpc-yellow-soft), 0 0 36px 10px rgba(247, 201, 72, .65); }
  55% { transform: rotate(-1.5deg) translateY(-22px); }
  75% { transform: rotate(1.5deg) translateY(-22px); }
  100% { transform: rotate(0) translateY(-22px); box-shadow: 0 0 0 5px var(--lpc-yellow-soft), 0 0 46px 16px rgba(247, 201, 72, .8); }
}
.lpc-app .lpc-pick-help { margin-top: 18px; font-size: 15px; color: var(--lpc-muted); }

/* ---------- หลังไพ่ (ลายคว่ำ) ---------- */
.lpc-app .lpc-back {
  container-type: inline-size; position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #fff8d6 0%, var(--lpc-green-soft) 70%);
  border: 3px solid var(--lpc-green);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqw;
}
.lpc-app .lpc-back::before { content: ""; position: absolute; inset: 5cqw; border: 1.5px dashed rgba(79, 154, 63, .55); border-radius: 8px; }
.lpc-app .lpc-back svg { width: 46cqw; height: auto; }
.lpc-app .lpc-back-brand { font-weight: 700; font-size: 10cqw; line-height: 1.1; color: var(--lpc-green-dark); }
.lpc-app .lpc-back-sub { font-size: 7cqw; color: var(--lpc-green); }
/* ธีมตั้ง .entry-content img { height: auto !important } ไว้ ต้องใช้ !important ให้รูปเต็มกรอบไพ่ */
.lpc-app .lpc-back img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; }

/* ---------- ผลลัพธ์ + พลิกไพ่ ---------- */
.lpc-app .lpc-result { padding-top: 26px; }
.lpc-app .lpc-flip {
  width: min(360px, 84vw); aspect-ratio: 2 / 3; margin: 0 auto; perspective: 1600px;
  cursor: pointer; border-radius: 20px; outline: none;
}
.lpc-app .lpc-flip:focus-visible { box-shadow: 0 0 0 3px var(--lpc-orange); }
.lpc-app .lpc-flip.is-revealing { animation: lpc-reveal .6s ease-out; }
@keyframes lpc-reveal { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
.lpc-app .lpc-flip-inner {
  position: relative; width: 100%; height: 100%; border-radius: inherit;
  transform-style: preserve-3d; transition: transform .8s cubic-bezier(.4, .2, .2, 1);
}
.lpc-app .lpc-flip.is-flipped .lpc-flip-inner { transform: rotateY(180deg); }
.lpc-app .lpc-face {
  container-type: inline-size; position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--lpc-cream); box-shadow: 0 14px 34px rgba(79, 110, 40, .22);
}
.lpc-app .lpc-face-guide { transform: rotateY(180deg); }
.lpc-app .lpc-face > img { width: 100%; height: 100% !important; object-fit: cover; }
.lpc-app .lpc-tap-hint { margin-top: 12px; font-size: 14px; color: var(--lpc-muted); }

/* ไพ่ที่ยังไม่มีรูป: สร้างหน้าตาชั่วคราวจากข้อความ */
.lpc-app .lpc-gen {
  height: 100%; padding: 6cqw 6cqw 5cqw; display: flex; flex-direction: column; align-items: center; gap: 2.4cqw;
  border: 2.5px solid var(--lpc-green); border-radius: inherit;
  background: linear-gradient(180deg, #fffdf3 0%, #f5f9e6 100%);
  font-size: 4.2cqw; line-height: 1.5; text-align: center;
}
.lpc-app .lpc-gen-brand { font-weight: 700; font-size: 5.5cqw; color: var(--lpc-green-dark); line-height: 1.1; }
.lpc-app .lpc-gen-ribbon {
  padding: .6cqw 5cqw; border-radius: 999px; background: var(--lpc-green); color: #fff;
  font-weight: 600; font-size: 4.4cqw;
}
.lpc-app .lpc-gen-num {
  display: grid; place-items: center; width: 11cqw; height: 11cqw; border-radius: 50%;
  background: var(--lpc-yellow); color: #fff; font-weight: 700; font-size: 5.5cqw;
}
.lpc-app .lpc-gen-th { font-weight: 700; font-size: 8cqw; line-height: 1.3; color: #4a3b22; }
.lpc-app .lpc-gen-en { font-style: italic; font-size: 5cqw; color: var(--lpc-green-dark); }
.lpc-app .lpc-gen-art {
  flex: 1; width: 100%; min-height: 0; border-radius: 4cqw; background: var(--lpc-yellow-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw; color: var(--lpc-muted); font-size: 3.6cqw;
}
.lpc-app .lpc-gen-art svg { width: 32cqw; height: auto; opacity: .9; }
.lpc-app .lpc-gen-quote { font-weight: 600; font-size: 5.2cqw; line-height: 1.45; color: var(--lpc-green-dark); }
.lpc-app .lpc-gen-foot { font-style: italic; font-size: 3.6cqw; color: var(--lpc-green-dark); }

.lpc-app .lpc-guide { gap: 2.2cqw; text-align: left; overflow-y: auto; }
.lpc-app .lpc-guide .lpc-gen-brand, .lpc-app .lpc-guide .lpc-gen-ribbon, .lpc-app .lpc-guide .lpc-guide-from { align-self: center; }
.lpc-app .lpc-guide-from { padding: .4cqw 4cqw; border-radius: 999px; background: var(--lpc-green-soft); font-size: 3.8cqw; }
.lpc-app .lpc-guide-sec { width: 100%; padding: 2.6cqw 3.6cqw; border-radius: 4cqw; }
.lpc-app .lpc-guide-sec h3 { font-weight: 700; font-size: 5cqw; line-height: 1.3; color: #3d3320; }
.lpc-app .lpc-guide-sec h3 small { font-weight: 500; font-style: italic; font-size: 3.6cqw; color: var(--lpc-green-dark); margin-left: 1.5cqw; }
.lpc-app .lpc-guide-sec li { position: relative; padding-left: 4.5cqw; }
.lpc-app .lpc-guide-sec li::before { content: "🌿"; position: absolute; left: 0; font-size: 3.2cqw; top: .4cqw; }
.lpc-app .lpc-sec-look { background: var(--lpc-green-soft); }
.lpc-app .lpc-sec-see { background: var(--lpc-yellow-soft); }
.lpc-app .lpc-sec-try { background: var(--lpc-pink-soft); }
.lpc-app .lpc-guide-foot { align-self: center; text-align: center; font-size: 3.8cqw; color: var(--lpc-green-dark); }

/* ---------- ปุ่ม ---------- */
.lpc-app .lpc-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 22px; }
.lpc-app .lpc-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.lpc-app .lpc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 10px 22px; border-radius: 999px; font-weight: 600; font-size: 16px; transition: transform .15s ease, background .2s ease;
}
.lpc-app .lpc-btn:active { transform: scale(.97); }
.lpc-app .lpc-btn:focus-visible { outline: 3px solid var(--lpc-orange); outline-offset: 3px; }
/* ปุ่มหลัก = ปุ่มเหลืองทรงแคปซูล แบบเดียวกับปุ่ม "ลอยกระทงออนไลน์เลย" บนเว็บ */
.lpc-app .lpc-btn-primary {
  background: var(--lpc-yellow); color: var(--lpc-yellow-text); font-weight: 700; font-size: 18px;
  min-height: 54px; padding: 12px 34px; box-shadow: 0 8px 18px rgba(0, 0, 0, .15); min-width: min(320px, 84vw);
}
.lpc-app .lpc-btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); color: var(--lpc-yellow-text); }
.lpc-app .lpc-btn-green { background: var(--lpc-green); color: #fff; }
.lpc-app .lpc-btn-green:hover { background: color-mix(in srgb, var(--lpc-green), #000 12%); color: #fff; }
.lpc-app .lpc-btn-ghost { background: #fff; color: var(--lpc-green-dark); border: 1.5px solid #cfe3bd; font-size: 15px; min-height: 42px; padding: 8px 18px; }
.lpc-app .lpc-btn-ghost:hover { background: var(--lpc-green-soft); color: var(--lpc-green-dark); }
.lpc-app .lpc-btn-link { color: var(--lpc-green-dark); text-decoration: underline; text-underline-offset: 4px; font-weight: 500; }
.lpc-app .lpc-share { padding: 12px; border-radius: 16px; background: #fff; border: 1px solid #e4eed8; }

/* ---------- กล่องชวนอ่านบทความ ---------- */
.lpc-app .lpc-article {
  margin: 26px auto 0; max-width: 460px; padding: 20px 18px; border-radius: 20px;
  background: #fff; border: 1.5px dashed var(--lpc-green); animation: lpc-reveal .5s ease-out;
}
.lpc-app .lpc-article p { margin-bottom: 12px; color: var(--lpc-text); }
.lpc-app .lpc-article .lpc-btn-primary { min-width: 0; width: 100%; text-align: center; font-size: 16px; border-radius: 18px; }
.lpc-app .lpc-again { margin-top: 22px; }

@media (prefers-reduced-motion: reduce) {
  .lpc-app *, .lpc-app *::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.lpc-app.lpc-stage.has-background { background-image: none; }
.lpc-app.lpc-stage { margin-left: auto; margin-right: auto; }
.lpc-app .lpc-intro .lpc-title { margin: 0; font-size: 23px; }
.lpc-article-block { text-align: center; }
.lpc-article-block .lpc-article { margin-top: 0; }
.lpc-article-block[hidden] { display: none !important; }
