/*css โครงสร้างและดีไซน์นี้เป็นทรัพย์สินทางปัญญาของ misiry และ shicenter ทางเราขอสงวนสิทธิ์ตามกฎหมาย ห้ามทำซ้ำ ดัดแปลง
หรือลอกเลียนแบบโดยไม่ได้รับอนุญาต การละเมิดจะถูกดำเนินคดีตามกฎหมายสูงสุด*/
/* =========================================
   1. ตัวแปรสีและค่าพื้นฐาน (Soft Light Pink Theme)
========================================= */
:root {
  --text-dark: #791a3d;      /* ชมพูเข้มอมน้ำตาล อ่านง่าย */
  --text-gray: #a58a92;      /* เทาอมชมพูละมุนสำหรับข้อความรอง */
  --accent-brown: #f4a4c0;   /* ชมพูพาสเทลนุ่มนวลเน้นจุดสำคัญ */
  --btn-hover: #fde8f0;      /* ชมพูอ่อนเมื่อโฮเวอร์ */
  --card-border: rgba(244, 164, 192, 0.3); /* ขอบชมพูบางเบา */
  --star-gold: #f4a4c0;      /* ทองประกายสำหรับดาว */
  --fab-blue: #f4a4c0;       /* ชมพูพาสเทลสำหรับปุ่ม FAB */
}

* { 
  box-sizing: border-box; 
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text-dark);
  font-family: 'Prompt', sans-serif !important;
}

button, input, select, textarea { 
  font: inherit; 
  color: inherit; 
}

/* =========================================
   2. พื้นหลัง Mesh Gradient & ตัวการ์ดหลัก
========================================= */
/* =========================================
   พื้นหลังลายจุดแบบเว้นระยะห่างมากขึ้น
   - สีพื้น: #fdf0f4
   - สีจุด: #ffffff
========================================= */
.app-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow: hidden;
  
  /* สีพื้นหลัง */
  background-color: #fdf0f4;
  
  /* ขนาดจุด 3.5px กำลังพอดี ไม่เล็กลอยและไม่ใหญ่เกินไป */
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.9) 3.5px, transparent 4px),
    radial-gradient(rgba(255, 255, 255, 0.9) 3.5px, transparent 4px);
  
  /* ตำแหน่งสลับแถว (ครึ่งหนึ่งของ background-size) */
  background-position: 0 0, 35px 35px;
  
  /* เพิ่มระยะห่างระหว่างจุดเป็น 70px */
  background-size: 70px 70px;
}

.main-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin-top: 10px;
  padding: 25px 18px 100px;
  
  /* ปรับให้การ์ดโปร่งใส และเห็นลายวอลเปเปอร์ทะลุผ่าน */
  background: rgba(255, 255, 255, 0.65);           /* สีขาวโปร่งแสงจางๆ */
  backdrop-filter: blur(8px);                      /* เบลอพื้นหลังกระจกฝ้า */
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);    /* ขอบสะท้อนแสงสีขาว */
  
  box-shadow: 0 15px 40px rgba(244, 164, 192, 0.25);
  border-radius: 35px 35px 0 0;
}

/* =========================================
   3. ตัวละครเกาะขอบ (Peeking)
========================================= */
.peeking-characters {
  position: absolute;
  top: -153px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  z-index: 10;
  pointer-events: none;
}

.peeking-characters img {
  display: block;
  width: 100%; 
  height: 100%;
  object-fit: contain;
}

.char-bear { height: 110px; }

/* =========================================
   4. รูปปก & โปรไฟล์
========================================= */
.cover-img {
  height: 200px;
  border-radius: 25px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #fff0f3;
  box-shadow: 0 8px 20px rgba(244, 164, 192, 0.2);
}

.cover-img img,
.cover-img video {
  width: 100%; 
  height: 100%; 
  object-fit: cover;
  object-position: center 0px;
}

.shop-info {
  position: relative;
  z-index: 2;
  margin-top: -55px; 
  text-align: center;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-box {
  position: relative; /* กำหนดเป็น relative เพื่อให้กรอบอ้างอิงตำแหน่งจากกล่องนี้ */
  width: 105px; 
  height: 105px;
  margin: 0 auto; 
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #f9d3e0, #f9d3e0);
  box-shadow: 0 8px 22px rgba(244, 164, 192, 0.3);
}

/* รูปโปรไฟล์ด้านใน */
.avatar-box .avatar-pic {
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  border-radius: 50%;
  display: block;
}

/* กรอบรูปซ้อนทับด้านบน */
.avatar-box .avatar-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200%; /* ปรับขนาดความกว้างของกรอบ (ปรับเพิ่ม-ลด % ตามความเหมาะสม) */
  height: 200%; /* ปรับขนาดความสูงของกรอบ */
  object-fit: contain;
  pointer-events: none; /* ป้องกันไม่ให้กรอบบังการคลิก */
  z-index: 2;
}

.badge-check {
  position: absolute;
  z-index: 9;
  bottom: 4px;
  right: 4px;
  background-color: var(--accent-brown);
  color: white;
  font-size: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.btn-admin {
  position: absolute;
  right: 5px;
  top: 65px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--card-border);
  color: var(--text-dark);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(244, 164, 192, 0.15);
}

.btn-admin:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.sub-title {
  margin: 14px 0 2px; 
  color: var(--accent-brown);
  font-size: 9px; 
  font-weight: 800; 
  letter-spacing: 0.2em;
}

.shop-name {
  margin: 0; 
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dark);
}

.tags {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.tag {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--card-border);
  color: var(--text-gray);
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 15px;
}

/* =========================================
   5. การ์ดสถิติ (Stats Card)
========================================= */
.stats-card {
  margin: 22px 0;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 4px 15px rgba(244, 164, 192, 0.2);
}

.stats-deco-img {
  position: absolute;
  top: 350px;                 /* ปรับลด/เพิ่มระยะความสูงตรงนี้ (ยิ่งน้อยยิ่งขยับขึ้น) */
  right: -15px;               /* ปรับระยะห่างจากขอบขวา */
  width: 80px;
  height: auto;
  z-index: 10;
  pointer-events: none;

  /* ใส่ค่าติดลบเพื่อเชิดปลายปีกขึ้น */
  transform: rotate(15deg); 
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: bold;
  color: var(--text-dark);
}

.stat-label {
  font-size: 11px;
  color: var(--text-gray);
}

.star-icon {
  color: var(--star-gold);
}

.divider {
  width: 1px;
  height: 30px;
  background-color: var(--card-border);
}

/* =========================================
   6. รายการรีวิว (Review Section)
========================================= */
.review-section {
  margin-top: 20px;
}

.section-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--accent-brown);
  font-style: italic;
}

.section-title {
  margin: 2px 0 14px 0;
  font-size: 18px;
  font-weight: bold;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loading-text {
  text-align: center;
  color: var(--text-gray);
  font-size: 12px;
  padding: 20px 0;
}

.review-item {
  position: relative;
  
  /* ปรับความใส (0.2 - 0.4 กำลังสวย ถ้าอยากให้ใสมากให้ลดเหลือ 0.1) */
  background: rgba(255, 255, 255, 0.75); 
  
  /* เอฟเฟกต์เบลอพื้นหลังด้านหลังการ์ด */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  /* เส้นขอบสีขาวโปร่งแสงเน้นมิติ */
  border-radius: 18px;
  padding: 15px;
  
  /* ปรับเงาให้บางลงเพื่อความละมุน */
  box-shadow: 0 4px 15px rgba(244, 164, 192, 0.15); 
}

.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #fff0f3;
  color: var(--accent-brown);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: bold;
  font-size: 13px;
}

.review-time {
  font-size: 10px;
  color: var(--text-gray);
}

.quote-icon {
  position: absolute;
  top: 12px;
  right: 15px;
  color: rgba(244, 164, 192, 0.25);
  font-size: 20px;
}

.stars {
  color: var(--star-gold);
  font-size: 11px;
  margin-bottom: 6px;
}

.review-text {
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.5;
}

/* =========================================
   7. ปุ่มลอยเขียนรีวิว (FAB Button)
========================================= */
.fab-review {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--fab-blue);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(244, 164, 192, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 40;
}

.fab-review:active {
  transform: translateX(-50%) scale(0.95);
}

/* =========================================
   8. Pop-up Modal
========================================= */
.overlay-bg {
  position: fixed; 
  z-index: 50; 
  inset: 0;
  display: none; 
  align-items: center; 
  justify-content: center; 
  padding: 20px;
  background: rgba(90, 64, 72, 0.35); 
  backdrop-filter: blur(5px);
}

.overlay-bg.show { 
  display: flex; 
  animation: fadeIn 0.2s ease; 
}

.popup-card {
  position: relative; 
  width: 100%; 
  max-width: 380px;
  padding: 25px 20px; 
  text-align: center;
  
  /* ปรับพื้นหลังให้โปร่งใส (ปรับค่า 0.35 เพิ่ม-ลด ความใสได้) */
  background: rgba(255, 255, 255, 0.85); 
  
  /* เอฟเฟกต์เบลอพื้นหลังกระจก */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
    
  /* เส้นขอบสีขาวโปร่งแสง */
  border: 1px solid rgba(255, 255, 255, 0.8); 
  border-radius: 25px;
  
  /* เงาละมุนฟุ้งๆ */
  box-shadow: 0 20px 50px rgba(244, 164, 192, 0.2);
  animation: slideUp 0.3s ease;
}

.btn-close {
  position: absolute; 
  top: 15px; 
  right: 15px;
  width: 30px; 
  height: 30px; 
  border: none; 
  border-radius: 50%;
  background: #fff0f3; 
  color: var(--text-gray);
  font-size: 18px; 
  cursor: pointer;
}

.popup-card p.top-tag { 
  margin: 0; 
  color: var(--accent-brown); 
  font-size: 9px; 
  font-weight: bold; 
  letter-spacing: 0.15em; 
}

.popup-card h2 { 
  margin: 4px 0 15px; 
  font-size: 18px; 
}

.form-group {
  text-align: left;
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: var(--text-gray);
  margin-bottom: 4px;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #fff8fa;
  font-size: 12px;
  outline: none;
}

/* เพิ่มส่วนนี้เพื่อป้องกันไม่ให้ลากปรับขนาด textarea ออกมานอกกรอบ */
.form-group textarea {
  resize: none;
}

.btn-submit {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: var(--accent-brown);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media(min-width: 540px) {
  .main-card {
    margin-top: 10px; 
    border-radius: 35px; 
    min-height: 800px;
  }
}
/* =========================================
   9. กลีบดอกไม้/ใบไม้ร่วง (Falling Image Animation)
========================================= */
.petals { 
  position: fixed; 
  z-index: 20; 
  inset: 0; 
  overflow: hidden; 
  pointer-events: none; 
}

.petal {
  position: absolute;
  top: -30px;
  width: 70px;
  height: 70px; 
  background-image: url('../images/53451123.png?v=1791567824');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  
  /* เพิ่มคำสั่งนี้หากต้องการให้โทนสีของภาพมืด/เข้มขึ้นอีก (ค่ามาตรฐานคือ 1) */
  filter: brightness(1.05); 
  
  animation: fall 10s linear infinite;
}

/* กระจายตำแหน่ง 7 กลีบ */
.petal:nth-child(1)  { left: 8%;  animation-delay: -2s;  animation-duration: 12s; }
.petal:nth-child(2)  { left: 22%; animation-delay: -7s;  animation-duration: 9s;  }
.petal:nth-child(3)  { left: 38%; animation-delay: -4s;  animation-duration: 14s; }
.petal:nth-child(4)  { left: 52%; animation-delay: -9s;  animation-duration: 11s; }
.petal:nth-child(5)  { left: 66%; animation-delay: -1s;  animation-duration: 13s; }
.petal:nth-child(6)  { left: 80%; animation-delay: -5s;  animation-duration: 15s; }
.petal:nth-child(7)  { left: 92%; animation-delay: -3s;  animation-duration: 10s; }

/* ซ่อนกลีบที่เหลือ (8-15) */
.petal:nth-child(n+8) { display: none; }

@keyframes fall {
  0%   { transform: translate3d(0, -30px, 0) rotate(0deg); opacity: 0; }
  15%  { opacity: 1; }    /* ปรับเป็น 1 ให้เห็นชัดเต็ม 100% */
  85%  { opacity: 0.9; }  /* คงความเข้มชัดไว้ตลอดทางร่วง */
  100% { transform: translate3d(-26px, 108vh, 0) rotate(430deg); opacity: 0; }
}

/* =========================================
   10. สไตล์เพิ่มเติมสำหรับ Admin & ปุ่มลบ
========================================= */
.btn-admin.is-admin {
  background: var(--accent-brown);
  color: white;
  border-color: #f7c5d1;
}

.btn-delete-review {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #fff0f3;
  color: #e57373;
  border: 1px solid #f7c5d1;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-delete-review:hover {
  background: #ffe2e8;
  transform: scale(1.05);
}

.error-msg {
  color: #e57373;
  font-size: 11px;
  margin: -4px 0 10px;
  display: none;
}

.error-msg.show {
  display: block;
}

#admin-pin-input {
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.3em;
}

/* =========================================
   11. Custom Glassmorphism Confirm Modal
========================================= */
.glass-popup-card {
  position: relative;
  width: 90%;
  max-width: 320px;
  padding: 28px 20px 22px;
  text-align: center;
  border-radius: 28px;
  background: rgba(255, 250, 251, 0.9);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 20px 40px rgba(244, 164, 192, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  animation: glassPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-icon-box {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(244, 164, 192, 0.15);
  color: #e57373;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(244, 164, 192, 0.3);
}

.glass-popup-card h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 700;
}

.glass-popup-card p {
  margin: 0 0 20px 0;
  font-size: 12px;
  color: var(--text-gray);
  line-height: 1.4;
}

.confirm-btn-group {
  display: flex;
  gap: 10px;
}

.btn-glass-cancel, .btn-glass-confirm {
  flex: 1;
  padding: 10px 0;
  border-radius: 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border: none;
}

.btn-glass-cancel {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-gray);
  border: 1px solid var(--card-border);
}

.btn-glass-cancel:hover {
  background: #ffffff;
}

.btn-glass-confirm {
  background: var(--accent-brown);
  color: white;
  box-shadow: 0 4px 12px rgba(244, 164, 192, 0.35);
}

.btn-glass-confirm:hover {
  background: #f7c5d1;
  transform: translateY(-1px);
}

@keyframes glassPopIn {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

.form-group input.input-error,
.form-group textarea.input-error {
  border-color: #f4a4c0 !important;
  background-color: #fff0f3 !important;
  box-shadow: 0 0 0 3px rgba(244, 164, 192, 0.2);
  animation: fieldShake 0.3s ease-in-out;
}

.field-error {
  display: none;
  color: #e57373;
  font-size: 11px;
  margin: 5px 0 0 2px;
  font-weight: 600;
}

.field-error.show {
  display: flex;
  align-items: center;
  gap: 4px;
  animation: fadeIn 0.2s ease;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* =========================================
   12. ปุ่มแบ่งหน้า (Pagination)
========================================= */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}

.page-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--card-border);
  color: var(--text-dark);
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  background: #fff;
  border-color: var(--accent-brown);
  color: var(--accent-brown);
}

.page-btn.active {
  background: var(--accent-brown);
  color: white;
  border-color: var(--accent-brown);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.plus𓈒one {
  display: block; margin-top: 4px; color: var(--text-gray); font-size: 12.5px;
}

/* =========================================
   13. Custom Rating Dropdown (สไลด์ลง)
========================================= */
.custom-rating-select {
  position: relative;
  user-select: none;
  width: 100%;
}

.select-selected {
  background: #fff8fa;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(244, 164, 192, 0.08);
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.select-selected:hover, 
.custom-rating-select.open .select-selected {
  border-color: var(--accent-brown);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(244, 164, 192, 0.2);
}

.selected-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.arrow-icon {
  font-size: 11px;
  color: var(--text-gray);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-rating-select.open .arrow-icon {
  transform: rotate(180deg);
  color: var(--accent-brown);
}

.select-items {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(244, 164, 192, 0.2);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scaleY(0.95);
  transform-origin: top center;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.custom-rating-select.open .select-items {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scaleY(1);
}

.select-item {
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(244, 164, 192, 0.12);
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.select-item:last-child {
  border-bottom: none;
}

.select-item:hover {
  background-color: #fff0f3;
  padding-left: 18px;
}

.select-item.active {
  background-color: #ffe2e8;
  font-weight: bold;
}

.rating-stars {
  color: var(--star-gold);
  font-size: 11px;
  display: inline-flex;
  gap: 2px;
}

.rating-text {
  font-size: 12px;
  color: var(--text-dark);
}

/* =========================================
   จัดตำแหน่งหัวข้อ & ปุ่มหลักฐานการซื้อ-ขาย
========================================= */
.review-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.title-group .section-title {
  margin: 2px 0 0 0;
}

.proof-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #ffffff, #fff0f3);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  color: var(--text-dark);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(244, 164, 192, 0.15);
  transition: all 0.25s ease;
}

.proof-btn i {
  color: var(--accent-brown);
  font-size: 13px;
}

.proof-btn:hover {
  background: #ffffff;
  border-color: var(--accent-brown);
  color: var(--accent-brown);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(244, 164, 192, 0.25);
}

.proof-btn:hover i {
  color: var(--accent-brown);
}

/* =========================================
   14. Cookie Tap Effect (รูปภาพเด้งตรงจุดกด)
========================================= */
.cookie-tap-single {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  width: 100px;  /* 👈 กำหนดความกว้างของรูปภาพ */
  height: 100px; /* 👈 กำหนดความสูงของรูปภาพ */
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  animation: singleCookiePop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  filter: drop-shadow(0 2px 4px rgba(244, 164, 192, 0.25));
}

@keyframes singleCookiePop {
  0% {
    transform: translate(-50%, -50%) scale(0.2) rotate(-8deg);
    opacity: 0;
  }
  35% {
    transform: translate(-50%, -50%) scale(1.2) rotate(4deg);
  }
  65% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, calc(-50% - 6px)) scale(0.7);
    opacity: 0;
  }
}

/* =========================================
   14. ป้องกันการคัดลอกและการลากรูปภาพ
========================================= */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ปลดล็อกให้ช่องกรอกข้อมูลยังคงพิมพ์และเลือกข้อความได้ */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ป้องกันการลากรูปภาพ */
img {
  -webkit-user-drag: none;
  -user-drag: none;
  pointer-events: none;
}

/* ปุ่มแก้ไขรูปภาพเฉพาะแอดมิน */
.admin-only {
  display: none !important;
}

body.is-admin-mode .admin-only {
  display: flex !important;
}

.cover-img {
  position: relative;
}

.btn-edit-img {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(90, 64, 72, 0.5);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.btn-edit-avatar {
  top: 0;
  right: -5px;
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.btn-edit-img:hover {
  background: var(--accent-brown);
  transform: scale(1.1);
}

/* =========================================
   15. ปุ่มควบคุมเพลง (ซีดีหมุนมินิมอล)
========================================= */
.music-btn {
  position: fixed;
  top: 30px;
  right: 20px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--card-border);
  color: var(--accent-brown);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(244, 164, 192, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s ease, background 0.3s ease;
}

.music-btn:hover {
  background: #ffffff;
  transform: scale(1.08);
  color: #d88197;
}

.music-btn:active {
  transform: scale(0.95);
}

/* แผ่นซีดีหมุนนุ่มนวลตอนเล่นเพลง */
.music-btn.playing i {
  animation: spinCD 4s linear infinite;
  color: var(--accent-brown);
  will-change: transform;
}

@keyframes spinCD {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =========================================
   ป้ายประเภทสินค้า (Product Badge)
========================================= */
.product-badge {
  display: inline-block;
  background-color: #f9d3e0; /* ชมพูพาสเทลหวานนุ่ม */
  color: #ffffff;             /* ตัวหนังสือสีขาว */
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;        /* ทำขอบมนเป็นทรงแคปซูล */
  margin-top: 8px;            /* ระยะห่างจากข้อความรีวิวด้านบน */
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(244, 164, 192, 0.25);
}

/* =========================================
   1. โค้ดสำหรับจอคอม PC (Desktop)
========================================= */
.main-card {
  position: relative !important;
  margin-top: 110px !important;
}

.sword-banner {
  position: absolute;
  top: -325px;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  max-width: 130%;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

.sword-banner img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* =========================================
   2. โค้ดเฉพาะมือถือ (Mobile Responsive)
========================================= */
@media (max-width: 768px) {
  .main-card {
    margin-top: 110px !important;
  }

  .sword-banner {
    position: absolute;
    top: -75vw;
    left: 50%;
    transform: translateX(-50%);
    width: 130%;
    max-width: 130%;
    text-align: center;
    z-index: 10;
    pointer-events: none;
  }
}

/* =========================================
   8. Preloader, Petals, Music & Effect
========================================= */
/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 50% 40%, rgba(255, 230, 238, 0.8) 0%, transparent 60%), linear-gradient(135deg, #fff0f4 0%, #f9d3e0 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-box { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar-loader { position: relative; width: 90px; height: 90px; margin-bottom: 18px; animation: avatarFloat 2.5s ease-in-out infinite; }
.avatar-loader img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pulse-ring { position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent-brown); opacity: 0.8; animation: ringPulse 1.8s infinite; }
.brand-text { font-size: 15px; font-weight: 800; letter-spacing: 0.25em; color: var(--accent-brown); margin-bottom: 16px; }
.progress-bar-wrap { width: 160px; height: 6px; background: rgba(255, 255, 255, 0.9); border-radius: 10px; overflow: hidden; border: 1px solid var(--card-border); }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #f9d3e0 0%, #f9d3e0 100%); transition: width 0.1s ease; }
.loading-percent { margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--text-gray); }

.loader-petals { position: absolute; inset: -20px; pointer-events: none; z-index: 3; }
.lp {
  position: absolute; top: 50%; left: 50%; width: 10px; height: 14px;
  border-radius: 80% 0% 100% 20% / 100% 0% 80% 20%;
  background: linear-gradient(135deg, #ffffff 0%, #f9d3e0 50%, #f9d3e0 100%);
  opacity: 0; animation: petalOrbit 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}
.lp:nth-child(1) { animation-delay: 0s; }
.lp:nth-child(2) { animation-delay: 0.5s; }
.lp:nth-child(3) { animation-delay: 1.0s; }
.lp:nth-child(4) { animation-delay: 1.5s; }
.lp:nth-child(5) { animation-delay: 2.0s; }

@keyframes avatarFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ringPulse { 0% { transform: scale(0.85); opacity: 0.8; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes petalOrbit {
  0% { transform: translate(-50%, -50%) rotate(0deg) translateY(-52px) rotate(0deg) scale(0.6); opacity: 0; }
  20%, 80% { opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(360deg) translateY(-52px) rotate(-360deg) scale(1.1); opacity: 0; }
}

/* กรอบรูปสำหรับ Preloader หน้าโหลด */
.avatar-loader .loader-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200%;
  height: 200%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  
  /* เพิ่ม 2 บรรทัดนี้เพื่อให้ตำแหน่งและขนาดตรงกับหน้าหลัก */
  scale: 1.093;
  translate: 5.36% -12.62%;
}