/* =========================================
   TUARAI - Cyberpunk Street Dark Style
   ========================================= */

:root {
  --bg-color: #0d0d0d;
  --card-bg: #161616;
  --accent-wine: #8b0000;
  --accent-red: #ff2a2a;
  --text-main: #f5f5f5;
  --text-muted: #888888;
  --border-color: #262626;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Prompt', 'Kanit', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---------- Navbar ---------- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 8%;
  background-color: rgba(13, 13, 13, 0.9);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.logo {
  font-family: 'Permanent Marker', 'Mitr', cursive;
  font-size: 2.2rem;
  color: var(--accent-red);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 42, 42, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-item {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-item:hover, .nav-item.active {
  color: var(--accent-red);
}

.btn-login {
  background: var(--accent-wine);
  color: #fff;
  padding: 8px 18px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  border: none;
  transition: background 0.3s, transform 0.2s;
}

.btn-login:hover {
  background: var(--accent-red);
  transform: translateY(-2px);
}

/* ---------- Hero & Store ---------- */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fff 0%, #aaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
}

.price-filter {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 40px;
  flex-wrap: wrap;
  padding: 0 5%;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 22px;
  cursor: pointer;
  border-radius: 30px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 15px rgba(255, 42, 42, 0.4);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 0 8%;
  max-width: 1400px;
  margin: 0 auto;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-red);
  box-shadow: 0 10px 25px rgba(255, 42, 42, 0.15);
}

.product-card.highlight {
  border-color: var(--accent-wine);
}

.product-img-wrapper {
  width: 100%;
  height: 200px;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.product-img-placeholder {
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.product-info {
  padding: 20px;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-main);
}

.product-price {
  font-size: 1.5rem;
  color: var(--accent-red);
  font-weight: 700;
  margin-bottom: 18px;
}

.btn-buy {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent-red);
  color: #fff;
  padding: 10px 0;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  transition: background 0.3s ease;
}

.btn-buy:hover {
  background: var(--accent-wine);
}

.notice-box {
  margin: 60px 8% 40px;
  padding: 18px 24px;
  background: rgba(139, 0, 0, 0.12);
  border-left: 4px solid var(--accent-red);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 1400px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--accent-red);
  width: 90%;
  max-width: 420px;
  padding: 30px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 0 20px rgba(255, 42, 42, 0.3);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal:hover {
  color: var(--accent-red);
}

.modal-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--accent-red);
  border-bottom: 2px solid var(--accent-red);
}

.auth-form h3 {
  margin-bottom: 20px;
  color: var(--text-main);
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  background: #0d0d0d;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 4px;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-red);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--accent-red);
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: var(--accent-wine);
}

/* ---------- Dashboard Page Styles ---------- */
.dashboard-container {
  padding: 40px 8%;
  max-width: 1400px;
  margin: 0 auto;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent-red);
  border-radius: 8px;
  padding: 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar-placeholder {
  width: 60px;
  height: 60px;
  background: var(--accent-wine);
  color: #fff;
  font-size: 1.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-red);
}

.user-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-email {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.badge-status {
  background: #222;
  color: var(--accent-red);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
}

.stat-card h4 {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 10px;
}

.btn-small {
  background: #222;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-small:hover {
  background: var(--accent-wine);
  border-color: var(--accent-red);
}

.dash-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.table-wrapper {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.dash-table th, .dash-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.dash-table th {
  background: #111;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.dash-table td {
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .navbar {
    padding: 15px 5%;
    flex-direction: column;
    gap: 15px;
  }
  .profile-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-container {
    padding: 20px 5%;
  }
}
/* ---------- How To Buy Page Styles ---------- */
.how-to-container {
  max-width: 900px;
  margin: 20px auto 60px;
  padding: 0 5%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 25px 30px;
  display: flex;
  align-items: center;
  gap: 25px;
  transition: border-color 0.3s ease, transform 0.2s ease;
}

.step-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-3px);
}

.step-card.highlight-step {
  border-color: var(--accent-wine);
  background: linear-gradient(135deg, var(--card-bg) 0%, #1f0d0d 100%);
}

.step-number {
  font-family: 'Permanent Marker', 'Mitr', cursive;
  font-size: 2.5rem;
  color: var(--accent-red);
  min-width: 70px;
  text-shadow: 0 0 10px rgba(255, 42, 42, 0.3);
}

.step-details h3 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.step-details p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.step-details code {
  background: #0d0d0d;
  color: var(--accent-red);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .step-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
  }
  .step-number {
    font-size: 2rem;
  }
}

/* ---------- Photo Upload / Photo Manager ---------- */
.photo-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #0d0d0d;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.photo-thumb button:hover {
  background: var(--accent-red);
}

.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================================
   ร้านค้า: การ์ดเว็บ / แพ็กเกจ / ซื้อ / ชำระเงิน / แก้ไข / QR
   ========================================= */
.muted { color: var(--text-muted); }

a.btn-small {
  display: inline-block;
  text-decoration: none;
}
.btn-small.primary { background: var(--accent-wine); border-color: var(--accent-red); }
.btn-small.primary:hover { background: var(--accent-red); }
.btn-small.danger:hover { background: #5a0000; border-color: #ff5a5a; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dash-table small { font-size: 0.8rem; }

.btn-outline {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 10px 14px;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  background: transparent;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--accent-red); color: #fff; }

/* ---------- การ์ดเว็บหน้าแรก ---------- */
.product-img-wrapper { position: relative; overflow: hidden; }
.product-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; }
.price-sub { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.card-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.card-actions .btn-buy { cursor: pointer; border: none; font-family: inherit; font-size: 1rem; }

/* ---------- เปรียบเทียบแพ็กเกจ ---------- */
.compare-section { max-width: 900px; margin: 60px auto 0; padding: 0 5%; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.package-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 26px 24px;
}
.package-card.recommended { border-color: var(--accent-red); box-shadow: 0 0 22px rgba(255, 42, 42, 0.15); }
.package-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.pkg-price { font-size: 2rem; font-weight: 700; color: var(--accent-red); margin-bottom: 14px; }
.pkg-price small { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.pkg-badge {
  position: absolute; top: -11px; right: 16px;
  background: var(--accent-red); color: #fff; font-size: 0.78rem; font-weight: 700;
  padding: 3px 12px; border-radius: 12px;
}
.pkg-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pkg-features li { padding-left: 22px; position: relative; color: var(--text-main); font-size: 0.93rem; }
.pkg-features li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-red); font-weight: 700; }
.pkg-features.small { gap: 4px; margin-top: 8px; }
.pkg-features.small li { font-size: 0.82rem; color: var(--text-muted); }

/* ---------- หน้าต่างเลือกซื้อ ---------- */
.modal-content.buy-modal, .modal-content.qr-modal {
  max-width: 660px;
  width: 94%;
  max-height: 92vh;
  overflow-y: auto;
}
.buy-title { color: var(--accent-red); margin: 4px 0 8px; padding-right: 26px; }
.pkg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 18px; }
.pkg-option {
  position: relative; display: block; cursor: pointer;
  background: #101010; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pkg-option input { position: absolute; opacity: 0; pointer-events: none; }
.pkg-option.selected { border-color: var(--accent-red); box-shadow: 0 0 14px rgba(255, 42, 42, 0.25); }
.pkg-option-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pkg-option-price { color: var(--accent-red); font-weight: 700; font-size: 1.2rem; }
.field-label { display: block; color: var(--text-muted); font-size: 0.9rem; margin: 2px 0 6px; }
.auth-form textarea, .auth-form select {
  width: 100%; padding: 12px; margin-bottom: 15px; background: #0d0d0d;
  border: 1px solid var(--border-color); color: #fff; border-radius: 4px; font-family: inherit; resize: vertical;
}
.auth-form textarea:focus, .auth-form select:focus { outline: none; border-color: var(--accent-red); }
.auth-form input[type="date"] { color-scheme: dark; }
.photo-pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.photo-thumb .cover-tag {
  position: absolute; left: 4px; bottom: 4px; background: var(--accent-red); color: #fff;
  font-size: 0.68rem; padding: 1px 7px; border-radius: 8px; pointer-events: none;
}
.photo-thumb button.cover-btn { left: 4px; right: auto; color: #ffd35a; }

/* ---------- Dashboard ---------- */
.pkg-tag { display: inline-block; padding: 2px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: 700; border: 1px solid var(--border-color); }
.pkg-tag.pkg-pro { background: var(--accent-wine); color: #fff; border-color: var(--accent-red); }
.pkg-tag.pkg-basic { background: #222; color: var(--text-main); }
.st { font-weight: 500; }
.st-active { color: #00ff88; }
.st-draft { color: #ffaa00; }
.st-expired { color: #ff5a5a; }

/* ---------- หน้าแก้ไข / ชำระเงิน ---------- */
.edit-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.edit-card {
  background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px;
  padding: 22px 24px; margin-bottom: 20px;
}
.edit-card h4 { margin-bottom: 14px; font-size: 1.1rem; }
.edit-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.notice-inline {
  background: rgba(139, 0, 0, 0.14); border-left: 4px solid var(--accent-red); border-radius: 0 6px 6px 0;
  padding: 12px 16px; margin-bottom: 20px; font-size: 0.93rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.notice-inline.warn { background: rgba(255, 170, 0, 0.1); border-left-color: #ffaa00; }

.pay-container { max-width: 620px; margin: 30px auto 60px; padding: 0 5%; }
.pay-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.pay-table td { padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.pay-table td:first-child { color: var(--text-muted); width: 40%; }
.pay-amount { font-size: 1.5rem; color: var(--accent-red); font-weight: 700; }
.pp-img { width: 100%; max-width: 280px; background: #fff; padding: 10px; border-radius: 8px; margin: 10px auto; display: block; }
.demo-box { border-style: dashed; border-color: #ffaa00; }

/* ---------- ส่งมอบ QR ---------- */
.qr-main { text-align: center; margin: 14px 0; }
.qr-main img { width: 100%; max-width: 300px; border-radius: 8px; background: #fff; }
.qr-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.qr-actions .btn-submit { width: auto; padding: 10px 20px; text-decoration: none; display: inline-block; }
#qrLinkNote { text-align: center; word-break: break-all; margin-top: 10px; }
.qr-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 10px; }
.qr-style {
  background: #101010; border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 6px;
  color: var(--text-main); cursor: pointer; font-family: inherit; font-size: 0.78rem; display: flex; flex-direction: column;
  align-items: center; gap: 6px;
}
.qr-style img { width: 100%; border-radius: 4px; background: #fff; }
.qr-style.selected { border-color: var(--accent-red); box-shadow: 0 0 12px rgba(255, 42, 42, 0.3); }
.qr-style.locked { opacity: 0.7; }

/* ---------- เว็บหมดอายุ ---------- */
.expired-box { max-width: 520px; margin: 14vh auto; padding: 0 6%; text-align: center; }
.expired-heart { font-size: 4rem; margin-bottom: 10px; }
.expired-box h1 { font-size: 1.6rem; margin-bottom: 10px; }
.expired-box p { color: var(--text-muted); margin-bottom: 8px; }

@media (max-width: 768px) {
  .edit-grid { grid-template-columns: 1fr; }
  .pkg-choice { grid-template-columns: 1fr; }
  .card-actions { grid-template-columns: 1fr; }
  .modal-content.buy-modal, .modal-content.qr-modal { padding: 22px 18px; }
}

/* ---------- PREMIUM COLLECTION banner (หน้าแรก) ---------- */
.premium-banner { position: relative; margin: 8px 4% 46px; max-width: 1400px; margin-left: auto; margin-right: auto; padding: 34px 22px 22px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, #1b1024 0%, #0f0a18 55%, #170d12 100%); isolation: isolate; width: calc(100% - 8%); }
.premium-banner::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; z-index: -1;
  background: linear-gradient(120deg, #ffd166, #ff5d8f, #8a5cff, #4cc9f0, #ffd166); background-size: 300% 300%; animation: pbBorder 6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes pbBorder { to { background-position: 300% 0; } }
.pb-glow { position: absolute; inset: -40% -10% auto -10%; height: 90%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 60% at 25% 40%, rgba(255,93,143,.25), transparent 70%), radial-gradient(40% 60% at 75% 30%, rgba(76,201,240,.2), transparent 70%); }
.pb-head { text-align: center; max-width: 820px; margin: 0 auto 24px; }
.pb-tag { display: inline-block; padding: 5px 16px; border-radius: 999px; font-size: .78rem; letter-spacing: .14em; font-weight: 600; color: #2a1a00;
  background: linear-gradient(135deg, #ffd166, #ff9f43); box-shadow: 0 0 22px rgba(255,209,102,.5); animation: pbPulse 2s ease-in-out infinite; }
@keyframes pbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.pb-title { margin: 14px 0 8px; font-size: clamp(1.6rem, 4.6vw, 2.5rem); line-height: 1.25; font-weight: 700; }
.pb-title span { display: block; background: linear-gradient(90deg, #ffd166, #ff5d8f, #8a5cff, #4cc9f0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pb-sub { color: #cfc4dd; font-size: 1rem; font-weight: 300; }
.pb-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.pb-chips li { padding: 5px 13px; font-size: .85rem; border-radius: 999px; border: 1px solid rgba(255,209,102,.5); background: rgba(255,209,102,.08); color: #ffe6a8; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.pb-card { position: relative; border-radius: 16px; overflow: hidden; background: #1a1226; border: 1px solid rgba(255,255,255,.12); transition: transform .3s, box-shadow .3s, border-color .3s; display: flex; flex-direction: column; }
.pb-card:hover { transform: translateY(-8px); border-color: #ffd166; box-shadow: 0 16px 38px rgba(255,209,102,.22); }
.pb-ribbon { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 3px 10px; border-radius: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; color: #2a1a00; background: linear-gradient(135deg, #ffd166, #ff9f43); }
.pb-img { position: relative; aspect-ratio: 16 / 9; background: #120b1c; overflow: hidden; }
.pb-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.pb-card:hover .pb-img img { transform: scale(1.08); }
.pb-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.pb-body h3 { font-size: 1.05rem; margin-bottom: 2px; }
.pb-tagline { color: #ffd166; font-size: .82rem; margin-bottom: 6px; }
.pb-desc { color: #b9aecb; font-size: .85rem; line-height: 1.5; margin-bottom: 10px; flex: 1; }
.pb-price { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.pb-price small { font-size: .8rem; font-weight: 400; color: #b9aecb; }
.pb-card .btn-outline { border-color: #ffd166; color: #ffd166; }
.pb-card .btn-outline:hover { background: #ffd166; color: #2a1a00; }
.pb-card .btn-buy { background: linear-gradient(135deg, #ff5d8f, #8a5cff); }
.pb-card .btn-buy:hover { filter: brightness(1.15); }
.pb-foot { text-align: center; margin-top: 16px; font-size: .85rem; color: #b9aecb; }
.std-title { text-align: center; font-size: 1.4rem; margin: 0 0 22px; font-weight: 500; }
@media (max-width: 600px) { .premium-banner { width: calc(100% - 20px); padding: 26px 12px 16px; } }
@media (min-width: 1180px) { .pb-grid { grid-template-columns: repeat(5, 1fr); } }
.pb-card .card-actions { grid-template-columns: 1fr; }

/* ตัวแก้ไขบทสนทนา (ธีมวิชวลโนเวล) */
.dlg-box { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.dlg-item { border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.03); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-add { align-self: flex-start; }

/* การ์ดพิเศษ (ธีมวิชวลโนเวล) */
.pb-ribbon.special { background: linear-gradient(135deg, #ff7aa8, #c8414c); color: #fff; letter-spacing: .14em; box-shadow: 0 0 14px rgba(255,122,168,.6); }
.pb-card.is-special { border-color: #ff9ec0; box-shadow: 0 0 0 1px rgba(255,158,192,.5), 0 12px 40px rgba(255,100,150,.25); }
@media (min-width: 900px) {
  .pb-card.is-special { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch; }
  .pb-card.is-special .pb-img { height: 100%; min-height: 260px; aspect-ratio: auto; }
  .pb-card.is-special .pb-body { display: flex; flex-direction: column; justify-content: center; padding: 26px; }
  .pb-card.is-special .card-actions { flex-direction: row; }
}

/* ช่องคำใต้รูป (ธีมจับคู่) */
.photo-grid.with-cap { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.photo-thumb.has-cap { aspect-ratio: auto; display: flex; flex-direction: column; }
.photo-thumb.has-cap img { aspect-ratio: 1 / 1; height: auto; }
.cap-in { width: 100%; border: 0; border-top: 1px solid var(--border-color); background: #181818; color: #fff; padding: 7px 6px; font-size: .8rem; font-family: inherit; }

/* ---------- หลังบ้านแอดมิน: แดชบอร์ด ---------- */
.ad-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ad-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ad-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 14px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 4px; }
.ad-card > span { color: var(--text-muted); font-size: .82rem; }
.ad-card b { font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.ad-card b em { font-size: .8rem; font-style: normal; color: var(--text-muted); font-weight: 400; }
.ad-card small { color: var(--text-muted); font-size: .8rem; }
.ad-card .up { color: #00ff88; } .ad-card .down { color: #ff7a7a; font-style: normal; }
.ad-card.hot { border-color: #3b7bd8; background: linear-gradient(160deg, rgba(59,123,216,.18), var(--card-bg)); }
.ad-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ad-box { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 14px; padding: 18px; min-width: 0; }
.ad-wide { grid-column: 1 / -1; }
.ad-box-h { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: .95rem; }
.ad-chart svg { width: 100%; height: 190px; display: block; }
.ad-bar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; margin-bottom: 9px; font-size: .85rem; }
.ad-bar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-bar .b { height: 8px; background: #222; border-radius: 99px; overflow: hidden; }
.ad-bar .b i { display: block; height: 100%; background: linear-gradient(90deg, #8b0000, #ff5d6c); border-radius: 99px; }
.ad-bar .v { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }
.ad-big { font-size: 3rem; font-weight: 600; line-height: 1; margin-bottom: 8px; } .ad-big em { font-size: 1.2rem; font-style: normal; color: var(--text-muted); }
.ad-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-tabs button { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); border-radius: 999px; padding: 7px 16px; font-size: .88rem; cursor: pointer; }
.ad-tabs button.on { background: var(--accent-wine); color: #fff; border-color: var(--accent-red); }
.ad-tabs i { font-style: normal; background: #3b7bd8; color: #fff; border-radius: 99px; padding: 0 7px; margin-left: 4px; font-size: .75rem; }
.ad-modal { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ad-modal[hidden] { display: none; }
.ad-modal-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; width: min(900px, 100%); max-height: 92vh; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 22px; }
.ad-slip-img { overflow: auto; max-height: 80vh; background: #000; border-radius: 10px; }
.ad-slip-img img { width: 100%; display: block; }
.ad-slip-side { display: flex; flex-direction: column; gap: 8px; padding-top: 22px; }
.ad-slip-amt { font-size: 1.7rem; font-weight: 600; color: #ffd166; }
.ad-slip-side input { background: #111; border: 1px solid var(--border-color); border-radius: 8px; color: #fff; padding: 10px; margin-top: 8px; }
.ad-slip-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.ad-slip-btns .btn-small { padding: 12px; font-size: 1rem; }
.ad-x { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; }
@media (max-width: 760px) { .ad-grid { grid-template-columns: 1fr; } .ad-modal-card { grid-template-columns: 1fr; overflow: auto; } .ad-slip-img { max-height: 46vh; } }
.ad-card[data-d], .ad-bar[data-month], .ad-bar[data-theme], tr.clk { cursor: pointer; }
.ad-card[data-d]:hover { border-color: var(--accent-red); transform: translateY(-2px); }
.ad-card { transition: transform .2s, border-color .2s; }
.ad-bar[data-month]:hover .n, .ad-bar[data-theme]:hover .n { color: var(--accent-red); }
tr.clk:hover td { background: rgba(255,255,255,.04); }
.ad-chart g[data-day]:hover rect { filter: brightness(1.4); }
.ad-det-card { position: relative; width: min(980px, 100%); max-height: 90vh; overflow: auto; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 22px; }
.ad-det-h { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding-right: 36px; }
.ad-det-h h4 { font-size: 1.2rem; font-weight: 500; }
.ad-kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin-top: 14px; }
.ad-kv { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-color); font-size: .92rem; }
.ad-kv span { color: var(--text-muted); } .ad-kv b { font-weight: 500; text-align: right; }
.ad-det-act { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@media (max-width: 700px) { .ad-kvs { grid-template-columns: 1fr; } }
.dlg-pair { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; border-bottom: 1px dashed rgba(255,255,255,.1); }
.dlg-orep { font-size: .85rem; padding-left: 22px !important; border-style: dashed !important; opacity: .95; }

.ad-card.hot.alert { border-color: #5ab0ff; box-shadow: 0 0 0 1px rgba(90,176,255,.4), 0 0 24px rgba(59,123,216,.35); animation: adPulse 2.2s ease-in-out infinite; }
@keyframes adPulse { 50% { box-shadow: 0 0 0 1px rgba(90,176,255,.7), 0 0 34px rgba(59,123,216,.55); } }

.dlg-price { font-size: .85rem; color: #ffd166; background: rgba(255,209,102,.08); border: 1px dashed rgba(255,209,102,.4); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.dlg-extra { font-size: .75rem; font-weight: 500; color: #ffd166; border: 1px solid rgba(255,209,102,.5); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.dlg-buy { background: linear-gradient(135deg, #ff5d8f, #8a5cff) !important; border-color: transparent !important; color: #fff !important; }

/* ---------- ท้ายเว็บ + หน้าข้อตกลง ---------- */
.site-foot { margin-top: clamp(70px, 9vw, 120px); border-top: 1px solid var(--border-color); padding: 30px 5%; }
.sf-in { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 30px; color: var(--text-muted); font-size: .88rem; }
.sf-in nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.sf-in a { color: #cfc8da; text-decoration: none; } .sf-in a:hover { color: var(--accent-red); }
.legal-wrap { max-width: 860px; margin: 0 auto; padding: clamp(40px, 7vw, 90px) 5% 0; }
.legal-tabs { display: inline-flex; gap: 6px; padding: 5px; border: 1px solid var(--border-color); border-radius: 999px; margin-bottom: 28px; }
.legal-tabs a { padding: 9px 22px; border-radius: 999px; color: var(--text-muted); text-decoration: none; font-size: .92rem; }
.legal-tabs a.on { background: var(--accent-wine); color: #fff; }
.legal-wrap h1 { font-family: 'Mitr', 'Prompt', sans-serif; font-weight: 500; font-size: clamp(1.7rem, 5vw, 2.4rem); }
.legal-meta { color: var(--text-muted); font-size: .88rem; margin: 10px 0 30px; }
.legal-sum { padding: 18px 22px; border-radius: 16px; background: rgba(255,42,77,.08); border: 1px solid rgba(255,42,77,.3); margin-bottom: 36px; line-height: 1.9; }
.legal-wrap h2 { font-size: 1.15rem; font-weight: 500; margin: 36px 0 10px; color: #fff; }
.legal-wrap p, .legal-wrap li { color: #bdb6c9; line-height: 1.95; font-weight: 300; }
.legal-wrap ul, .legal-wrap ol { padding-left: 22px; margin: 6px 0; }
.legal-wrap li { margin: 4px 0; }
.legal-wrap strong { color: #fff; font-weight: 500; }
.legal-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.legal-toc a { font-size: .82rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-color); color: #cfc8da; text-decoration: none; }
.legal-toc a:hover { border-color: var(--accent-red); color: #fff; }

/* ซ่อนแถบเลื่อนสีขาวในหน้าต่างป๊อปอัป (ยังเลื่อนด้วยล้อเมาส์/นิ้วได้ตามปกติ) */
.modal-overlay, .modal-content, .modal-content.buy-modal, .modal-content.qr-modal { scrollbar-width: none; -ms-overflow-style: none; }
.modal-overlay::-webkit-scrollbar, .modal-content::-webkit-scrollbar { display: none; width: 0; height: 0; }

.sf-contact { margin-top: 14px; text-align: center; font-size: 14px; opacity: .85; }
.sf-contact a { color: inherit; text-decoration: underline; }

/* ฟอนต์โลโก้: ใช้ไฟล์ในเว็บเองถ้ามี (static/fonts/PermanentMarker-Regular.ttf) ไม่มีก็ใช้ของ Google เดิม */
@font-face { font-family: 'Permanent Marker'; font-style: normal; font-weight: 400; font-display: swap;
  src: local('Permanent Marker'), local('PermanentMarker-Regular'), url('/static/fonts/PermanentMarker-Regular.ttf') format('truetype'); }

/* โลโก้ + ชื่อ */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo span { font-family: 'Permanent Marker', 'Mitr', cursive; font-weight: 400; letter-spacing: 2px; }
.logo img { width: 1.1em; height: 1.1em; flex: none; filter: drop-shadow(0 0 8px rgba(255, 42, 42, .45)); }

/* คำถามที่พบบ่อย */
.faq { max-width: 820px; margin: 60px auto 20px; padding: 0 5%; }
.faq h2 { font-family: 'Mitr', sans-serif; font-weight: 500; font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: 16px; }
.faq details { border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; background: rgba(255, 255, 255, .03); }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent-red); font-size: 1.3em; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { margin-top: 10px; color: var(--text-muted, #aaa); line-height: 1.8; }
.faq a { color: var(--accent-red); }

/* ===== พื้นหลังดาร์กไล่เฉด + แสงเรืองโรแมนติก (ทุกหน้าหลักของร้าน) ===== */
html { background: #0a0a0f; }
body { background: linear-gradient(180deg, #0a0a0f 0%, #140d1e 28%, #1a1025 50%, #140d1e 72%, #0a0a0f 100%) fixed; background-color: #0a0a0f; position: relative; }
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(90px); will-change: transform; }
body::before { width: min(70vw, 720px); height: min(70vw, 720px); top: -18vh; right: -14vw; background: radial-gradient(closest-side, rgba(255,70,140,.30), transparent 72%); animation: ambA 16s ease-in-out infinite alternate; }
body::after { width: min(80vw, 820px); height: min(80vw, 820px); bottom: -24vh; left: -18vw; background: radial-gradient(closest-side, rgba(140,80,255,.28), transparent 72%); animation: ambB 19s ease-in-out infinite alternate; }
@keyframes ambA { to { transform: translate(-6vw, 8vh) scale(1.12); } }
@keyframes ambB { to { transform: translate(8vw, -6vh) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }
.lowfx body::before, .lowfx body::after { animation: none; filter: blur(50px); }
@media (max-width: 640px) { body::before, body::after { filter: blur(60px); } }
html, body { overflow-x: clip; max-width: 100%; }

/* ===== ตัวเลือกภารกิจ (ฟอร์มสร้าง/แก้ไขเว็บ) ===== */
.qe-box { margin-bottom: 6px; }
.qe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0 14px; }
.qe-chip { appearance: none; position: relative; text-align: left; display: grid; gap: 3px; padding: 12px 12px 12px 14px; min-height: 92px; color: #f3e9ff; font-family: inherit; cursor: pointer; border-radius: 16px; border: 1.5px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04); transition: border-color .2s, background .2s, transform .15s; }
.qe-chip:active { transform: scale(.98); }
.qe-chip .qe-ic { font-size: 22px; line-height: 1; }
.qe-chip b { font-size: 15px; }
.qe-chip small { font-size: 12.5px; line-height: 1.45; color: #b8a9d6; }
.qe-chip .qe-tick { position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; color: transparent; border: 1.5px solid rgba(255,255,255,.25); }
.qe-chip.on { border-color: #ff6fa5; background: rgba(255,111,165,.12); }
.qe-chip.on .qe-tick { background: #ff6fa5; border-color: #ff6fa5; color: #fff; }
.qe-panel { margin: 0 0 14px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.2); }
.qe-qa { display: grid; gap: 8px; margin: 10px 0 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.qe-qa:last-child { border: 0; padding-bottom: 0; margin-bottom: 0; }
.qe-panel input[type="text"] { width: 100%; margin-bottom: 8px; }
.qe-qa input { margin-bottom: 0 !important; }
@media (min-width: 700px) { .qe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qe-off { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 10px; border: 2px dashed #c9a46a; border-radius: 12px; background: #fff8ec; cursor: pointer; }
.qe-off input { width: 20px; height: 20px; accent-color: #b0102a; }
.qe-off small { color: #8a7355; }
.qe-chip.dis { opacity: .45; cursor: not-allowed; filter: grayscale(.8); }

/* ===== ธีมบอกเลิก: เลือกตุ๊กตา + คำเตือนสติ ===== */
.doll-row, .tone-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.doll-chip { flex: 1 1 22%; min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 2px solid #e3cfa6; border-radius: 14px; background: #fff8ec; cursor: pointer; font: inherit; }
.doll-chip span { font-size: 28px; line-height: 1.1; } .doll-chip small { font-size: 11px; color: #8a7355; text-align: center; }
.doll-chip.on { border-color: #b0102a; background: #fdeaea; box-shadow: 0 0 0 3px rgba(176,16,42,.12); }
.tone-chip { padding: 8px 14px; border-radius: 999px; border: 2px solid #e3cfa6; background: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.tone-chip.on { border-color: #b0102a; background: #b0102a; color: #fff; }
.bye-box { max-width: 420px; text-align: center; }
.bye-ic { font-size: 40px; margin-top: 8px; } .bye-box h3 { margin: 6px 0 10px; color: var(--text-main, #3a1a1a); }
.bye-msg { line-height: 1.7; color: var(--text-muted, #6b5a5a); margin-bottom: 14px; }
.bye-ck { display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 14px; margin-bottom: 8px; border: 2px solid #e3cfa6; border-radius: 12px; background: #fff8ec; cursor: pointer; }
.bye-ck input { width: 20px; height: 20px; accent-color: #b0102a; }
.bye-help { font-size: 12.5px; color: #8a7355; margin: 12px 0 14px; line-height: 1.6; }
.bye-act { display: flex; gap: 10px; } .bye-act button { flex: 1; padding: 13px 10px; border-radius: 999px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.bye-back { background: #efe3cf; color: #5a4630; } .bye-go { background: #b0102a; color: #fff; } .bye-go:disabled { opacity: .45; cursor: not-allowed; }

.bye-opts{margin-top:10px;padding:10px;border-radius:12px;background:rgba(0,0,0,.04);text-align:left}.bye-opts b{display:block;font-size:13px;margin-bottom:6px}.bye-opts .bye-ck{display:flex;gap:8px;align-items:flex-start;margin:6px 0;font-size:13px;cursor:pointer}
.doll-one{padding:10px 14px;border-radius:12px;background:#fff0f0;border:1px solid #d9889a;font-weight:600;display:inline-block}

.cf-card{margin:8px 0;padding:10px;border-radius:12px;background:#fff;border:1px solid #ecd9bb}.cf-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}.cf-del{border:1px solid #d9889a;background:#fff;border-radius:999px;padding:2px 12px;cursor:pointer}.cf-card input,.cf-card textarea{width:100%;margin:4px 0;box-sizing:border-box}.cf-add{margin-top:6px;border:0;border-radius:999px;padding:8px 16px;background:#d9889a;color:#fff;cursor:pointer}
