/* ==========================================================================
   site-nav.css — โครงเมนูใหม่ + หน้าฮับ + ค้นหารวม (จัดระเบียบเว็บ 21 ต.ค. 2569)
   โหลดต่อจาก style.css ทุกหน้า (partials/header.ejs) · ข้อมูลเมนูอยู่ src/siteNav.js
   แยกไฟล์ไว้ก่อนตามแผนเฟส 2 (แบ่ง style.css เป็นไฟล์ตามหมวด) — ห้ามย้ายกลับไปปนใน style.css
   ========================================================================== */

:root {
  /* --muted ถูกใช้ใน style.css ~50 จุดแต่ไม่เคยประกาศ (ข้อความที่ควรจางเลยขึ้นสีปกติ) */
  --muted: #86695a;
  --hub-radius: 16px;
  --tabbar-h: 60px;
}

/* ---------- หัวเว็บ: เดสก์ท็อป ---------- */
.header-inner { max-width: 1240px; gap: 14px; }
.main-nav { gap: 0; }
.snav-items { display: flex; align-items: stretch; gap: 2px; }
.main-nav .snav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 70px; /* 74 → 70 ตอนเพิ่มปุ่มหน้าหลัก (7 ช่อง) — 1181px ยังไม่ล็อกอินล้น 1px */
  padding: 6px 9px 8px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.main-nav .snav-link img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(120, 60, 10, .18));
  transition: transform .2s ease;
}
.main-nav .snav-link:hover { color: var(--orange-dark); background: var(--bg-soft); transform: none; }
.main-nav .snav-link:hover img { transform: translateY(-2px) scale(1.06); }
.main-nav .snav-link.active { color: #c94f00; background: linear-gradient(180deg, #fff3e6, #ffe6d1); }
.main-nav .snav-link.active::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -9px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffb066, var(--orange), var(--orange-dark));
  box-shadow: 0 1px 6px rgba(255, 106, 0, .4);
}
.snav-drawer-extra { display: none; }

.header-actions { gap: 8px; }
.snav-topup {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 14px 0 7px;
  border-radius: 999px;
  border: 1px solid #ffd27a;
  background: linear-gradient(180deg, #fffaf0, #fff0cf);
  color: #a35a00;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: box-shadow .2s ease, transform .2s ease;
}
.snav-topup img { width: 26px; height: 26px; object-fit: contain; }
.snav-topup:hover, .snav-topup.active { box-shadow: 0 4px 14px rgba(230, 150, 0, .28); transform: translateY(-1px); color: #8a4a00; }
.header-actions .btn-sm {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: none;
}
.header-actions .btn-fire.btn-sm { box-shadow: 0 4px 12px rgba(255, 106, 0, .28); }
.snav-account { max-width: 170px; }
.snav-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--ink-3);
  transition: color .2s ease, background-color .2s ease;
}
.snav-logout svg { width: 19px; height: 19px; }
.snav-logout:hover { color: var(--red); background: #fff1f1; }
.snav-search-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--orange-dark);
  border: 1px solid var(--line-2);
  background: #fff;
  flex-shrink: 0;
}
.snav-search-btn svg { width: 20px; height: 20px; }

/* ---------- ช่องค้นหารวม (หัวเว็บ / ฮับ / หน้า /search) ---------- */
.ssearch {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ssearch:focus-within { border-color: var(--orange-3); box-shadow: 0 0 0 3px rgba(255, 106, 0, .14); }
.ssearch > svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--orange-dark); pointer-events: none; }
.ssearch input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.ssearch input::-webkit-search-cancel-button { cursor: pointer; }
.ssearch button {
  flex-shrink: 0;
  margin: 4px;
  padding: 0 18px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange-3), var(--orange-dark));
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ssearch-header { width: 168px; transition: width .25s ease, border-color .2s ease, box-shadow .2s ease; }
.ssearch-header:focus-within { width: 250px; }
.ssearch-header input { height: 36px; font-size: 13.5px; }
.ssearch-hero, .ssearch-page { max-width: 560px; box-shadow: 0 6px 22px rgba(120, 60, 10, .12); }
.ssearch-hero input, .ssearch-page input { height: 48px; font-size: 16px; padding-left: 42px; }
.ssearch-hero > svg, .ssearch-page > svg { left: 15px; width: 20px; height: 20px; }

.ssuggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  z-index: 120;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(60, 30, 10, .18);
  text-align: left;
}
.ssearch-header .ssuggest { left: auto; right: 0; width: 340px; }
.ssuggest-head { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ssuggest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--ink);
}
.ssuggest-row:hover, .ssuggest-row:focus, .ssuggest-row.is-active { background: var(--bg-soft); outline: none; }
.ssuggest-row strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.ssuggest-row small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.ssuggest-ico { flex: 0 0 32px; height: 32px; display: grid; place-items: center; }
.ssuggest-ico img { max-width: 32px; max-height: 32px; object-fit: contain; }
.ssuggest-ico.is-sprite img { image-rendering: pixelated; }
.ssuggest-ico.is-blank { border-radius: 8px; background: var(--bg-soft-2); }
.ssuggest-empty { padding: 14px 10px; color: var(--muted); font-size: 14px; }
.ssuggest-all { display: block; margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--line); color: var(--orange-dark); font-size: 13.5px; font-weight: 600; }

/* ---------- หน้าฮับ (ฐานข้อมูล / คู่มือ / ค้นหา) ---------- */
.hub-page { max-width: 1200px; margin: 0 auto; padding: 14px 16px 48px; }
.hub-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; font-size: 13.5px; color: var(--muted); }
.hub-crumbs a { color: var(--ink-2); }
.hub-crumbs a:hover { color: var(--orange-dark); }
.hub-crumbs strong { color: var(--ink); font-weight: 600; }

.hub-hero {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: center;
  border-radius: 22px;
  background: #fde9d6;
  box-shadow: var(--shadow-md);
}
.hub-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }
.hub-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 250, 244, .96) 0%, rgba(255, 248, 240, .9) 36%, rgba(255, 246, 236, .35) 62%, rgba(255, 246, 236, 0) 78%);
  z-index: 1;
}
.hub-hero-copy { position: relative; z-index: 2; width: min(560px, 100%); padding: 34px 40px; }
.hub-hero-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 106, 0, .12);
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hub-hero h1 { margin: 0 0 6px; font-size: 36px; line-height: 1.2; color: var(--ink); }
.hub-hero p { margin: 0 0 18px; font-size: 16px; color: var(--ink-2); line-height: 1.6; }

.hub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.hub-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--hub-radius);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hub-tile:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.hub-tile-ico {
  flex: 0 0 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, #fff8ef, #ffeedd);
}
.hub-tile-ico img { width: 56px; height: 56px; object-fit: contain; }
.hub-tile-ico.is-sprite img { width: 48px; height: 48px; image-rendering: pixelated; }
.hub-tile-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hub-tile-body strong { font-size: 16px; font-weight: 700; line-height: 1.3; }
.hub-tile-body small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.hub-tile-body em {
  align-self: flex-start;
  margin-top: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--bg-soft-2);
  color: var(--orange-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.hub-note { margin: 14px 2px 0; font-size: 13px; color: var(--muted); }

.hub-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hub-jump a {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.hub-jump a:hover { color: var(--orange-dark); border-color: var(--orange-3); }
.hub-group { margin-top: 28px; scroll-margin-top: 90px; }
.hub-group h2, .hub-more-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 22px;
  color: var(--ink);
}
.hub-group h2::before, .hub-more-title::before {
  content: '';
  width: 6px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--orange-3), var(--orange-dark));
}
.hub-group .hub-tiles { margin-top: 12px; }
.hub-more-title { margin-top: 36px; font-size: 18px; }
.hub-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.hub-more a {
  display: flex;
  align-items: center;
  gap: 10px;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--hub-radius);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hub-more a:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.hub-more img {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  padding: 4px;
  object-fit: contain;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #fff8ef, #ffeedd);
}
.hub-more strong { display: block; font-size: 15px; }
.hub-more small { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------- หน้า /search ---------- */
.search-title { margin: 6px 0 14px; font-size: 28px; color: var(--ink); }
.search-hint { margin: 14px 2px; color: var(--muted); font-size: 14px; }
.search-hint a { color: var(--orange-dark); font-weight: 600; }
.search-shortcuts { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.search-sec { margin-top: 26px; }
.search-sec h2 { margin: 0 0 10px; font-size: 18px; color: var(--ink); }
.search-sec h2 small { font-size: 14px; color: var(--muted); font-weight: 500; }
.search-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}
.search-row:hover { border-color: var(--orange-3); box-shadow: var(--shadow-sm); }
.search-row-ico { flex: 0 0 40px; height: 40px; display: grid; place-items: center; }
.search-row-ico img { max-width: 40px; max-height: 40px; object-fit: contain; }
.search-row-ico.is-sprite img { image-rendering: pixelated; }
.search-row-ico.is-blank { border-radius: 10px; background: var(--bg-soft-2); }
.search-row-body { min-width: 0; }
.search-row-body strong { display: block; font-size: 15px; font-weight: 600; }
.search-row-body small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-more { display: inline-block; margin-top: 10px; color: var(--orange-dark); font-weight: 600; font-size: 14px; }
.search-empty { margin: 30px auto; text-align: center; color: var(--ink-2); }
.search-empty img { width: 120px; height: auto; }
.search-empty p { margin: 8px 0 0; font-size: 17px; }
.search-empty .search-empty-sub { font-size: 14px; color: var(--muted); }

/* ---------- แถบเมนูล่าง (มือถือ) ---------- */
.tabbar { display: none; }

/* ---------- จอกลาง: บีบเมนูให้พอดี ---------- */
@media (max-width: 1180px) {
  .ssearch-header { display: none; }
  .snav-search-btn { display: inline-flex; }
  /* ปุ่มค้นหาอยู่หน้าปุ่มเติมเงิน/บัญชี (DOM อยู่ท้ายเพื่อให้มือถือชิดปุ่มเมนู) */
  .header-logo { order: 1; }
  .main-nav { order: 2; }
  .snav-search-btn { order: 3; }
  .header-actions { order: 4; }
  .nav-toggle { order: 5; }
  .main-nav .snav-link { min-width: 66px; padding: 6px 6px 8px; font-size: 12.5px; }
}
@media (max-width: 1040px) {
  .snav-topup { padding: 0; font-size: 0; gap: 0; }
  .snav-topup img { width: 28px; height: 28px; }
  .header-actions .btn-sm { padding: 0 12px; font-size: 13px; }
  .snav-topup { width: 38px; justify-content: center; }
  .snav-account span { display: none; }
  .main-nav .snav-link { min-width: 58px; padding: 6px 5px 8px; } /* 901px ยังไม่ล็อกอิน (ปุ่มสมัคร+เข้าสู่ระบบ) ล้น 17px */
}

/* ---------- มือถือ/แท็บเล็ต: ลิ้นชักเมนู + แถบล่าง ---------- */
@media (max-width: 900px) {
  .header-inner { height: 64px; gap: 8px; }
  .header-logo img { height: 46px; }
  .header-logo { margin-right: auto; }
  .main-nav {
    top: 64px;
    max-height: calc(100vh - 64px - var(--tabbar-h) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    padding: 14px 14px 18px;
    border-radius: 0 0 20px 20px;
  }
  .snav-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .main-nav .snav-link {
    min-width: 0;
    padding: 12px 6px 10px;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-size: 14px;
  }
  .main-nav .snav-link img { width: 46px; height: 46px; }
  .main-nav .snav-home { display: none; } /* แถบล่างมีหน้าแรกแล้ว · ลิ้นชัก 3 คอลัมน์คง 6 ช่องเต็มแถว */
  .main-nav .snav-link.active { border-color: var(--orange-3); }
  .main-nav .snav-link.active::after { display: none; }
  .snav-drawer-extra { display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
  .main-nav .snav-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
  .main-nav .snav-auth .btn { justify-content: center; padding: 11px 10px; font-size: 15px; }
  .main-nav .snav-extra {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 6px;
    border-radius: 12px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
  }
  .main-nav .snav-extra img { width: 30px; height: 30px; object-fit: contain; }
  .main-nav .snav-extra small { margin-left: 6px; color: var(--muted); font-weight: 500; }
  .main-nav .snav-extra:hover { background: var(--bg-soft); }
  .main-nav .snav-extra-row { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 6px 0; }
  .main-nav .snav-extra-row a { padding: 4px 0; color: var(--ink-2); font-size: 14px; }
  body.nav-open { overflow: hidden; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(43, 27, 18, .08);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar a.active { color: var(--orange-dark); }
  .tabbar a.active svg { filter: drop-shadow(0 2px 4px rgba(255, 106, 0, .35)); }
  body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .wiki-toast,
  body.has-tabbar .lucky-toast { bottom: calc(var(--tabbar-h) + 16px); }

  .hub-page { padding-top: 8px; }
  .hub-hero { min-height: 0; align-items: flex-end; border-radius: 18px; }
  .hub-hero-art { position: relative; inset: auto; height: 170px; object-position: 75% 30%; }
  .hub-hero { flex-direction: column; align-items: stretch; }
  .hub-hero::before { background: linear-gradient(180deg, rgba(255, 248, 240, 0) 90px, rgba(255, 248, 240, .97) 170px); }
  .hub-hero-copy { padding: 0 18px 20px; margin-top: -26px; width: 100%; }
  .hub-hero h1 { font-size: 28px; }
  .hub-hero p { font-size: 15px; margin-bottom: 14px; }
}

@media (max-width: 560px) {
  .hub-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hub-tile { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 10px; }
  .hub-tile-ico { flex: 0 0 auto; width: 64px; }
  .hub-tile-body { align-items: center; }
  .hub-tile-body strong { font-size: 15px; }
  .hub-tile-body small { font-size: 12px; }
  .hub-tile-body em { align-self: center; }
  .hub-more { grid-template-columns: 1fr; }
  .search-list { grid-template-columns: 1fr; }
  .search-title { font-size: 24px; }
  .ssearch-hero input, .ssearch-page input { height: 46px; font-size: 16px; }
  .ssearch button { padding: 0 14px; }
}

/* ---------- หน้ากิจกรรม: ทางไปหน้าที่ย้ายออก (ไข่สุ่ม → กาชา · บันทึกอัปเดต) ---------- */
.events4-moved { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.events4-moved a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-size: 13.5px;
}
.events4-moved a:hover { border-color: var(--orange-3); color: var(--orange-dark); }
.events4-moved img { width: 30px; height: 30px; object-fit: contain; }
.events4-moved strong { color: var(--orange-dark); }

/* ---------- ฮับฐานข้อมูล: บันทึกอัปเดตล่าสุด (เจ้าของขอให้อยู่บนสุด 21 ต.ค. 2569) ---------- */
.hub-updates {
  margin-top: 20px;
  padding: 16px 18px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff4e8 0%, #fffaf5 60%, #fff 100%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
}
.hub-updates-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hub-updates-head img { width: 44px; height: 44px; object-fit: contain; }
.hub-updates-head h2 { margin: 0; font-size: 20px; color: var(--ink); }
.hub-updates-head a { margin-left: auto; color: var(--orange-dark); font-size: 14px; font-weight: 600; white-space: nowrap; }
.hub-updates-list { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.hub-update {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--hub-radius);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hub-update:hover { transform: translateY(-2px); border-color: var(--orange-3); box-shadow: var(--shadow-md); }
.hub-update.is-latest { border-color: var(--orange-3); box-shadow: 0 6px 20px rgba(255, 106, 0, .14); }
.hub-update-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hub-update-date { font-size: 13px; font-weight: 700; color: var(--orange-dark); }
.hub-update-new { padding: 1px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
.hub-update-tag { padding: 1px 8px; border-radius: 999px; background: var(--bg-soft-2); color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.hub-update strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hub-update.is-latest strong { font-size: 16.5px; }
.hub-update-foot { margin-top: auto; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .hub-updates-list { grid-template-columns: 1fr; }
  .hub-update:not(.is-latest) strong { -webkit-line-clamp: 1; }
}
@media (max-width: 560px) {
  .hub-updates { padding: 14px 12px; }
  .hub-updates-head { flex-wrap: wrap; }
  .hub-updates-head h2 { font-size: 18px; white-space: nowrap; }
  .hub-updates-head a { flex-basis: 100%; margin-left: 54px; font-size: 13px; }
}

/* หัวหน้า /events — ให้ตัวหนังสือชุดเดียวกับหัวฮับ (.hub-hero) แทน 54px/800 สองสีของ events4 เดิม */
.events4-hero-copy h1 { margin: 0 0 6px; font-size: 36px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.events4-hero-copy p { font-size: 16px; font-weight: 400; color: var(--ink-2); line-height: 1.6; }
@media (max-width: 900px) {
  .events4-hero-copy h1 { font-size: 28px; }
  .events4-hero-copy p { font-size: 15px; }
}

/* ---------- footer (ชุดเดียวกับหัวเว็บ: ไอคอน RO · ปุ่มแคปซูล · หัวข้อแถบส้มแบบ .hub-group h2) ---------- */
.footer { margin-top: 40px; background: linear-gradient(180deg, #fffaf5, #fff1e4); border-top: 1px solid var(--line); }
.sfoot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px 28px;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.05fr;
  gap: 28px 36px;
}
.sfoot-logo img { width: 160px; height: auto; }
.sfoot-tagline { margin: 8px 0 16px; font-size: 14px; color: var(--ink-2); }
.sfoot-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sfoot-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--orange);
  background: #fff;
  color: var(--orange-dark);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: box-shadow .2s ease, transform .2s ease;
}
.sfoot-btn img { width: 24px; height: 24px; object-fit: contain; margin-left: -6px; }
.sfoot-btn-fire { border-color: transparent; background: linear-gradient(180deg, #ff8a2a, var(--orange)); color: #fff; box-shadow: 0 4px 12px rgba(255, 106, 0, .28); }
.sfoot-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 106, 0, .25); color: var(--orange-dark); }
.sfoot-btn-fire:hover { color: #fff; }
.sfoot-time {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 0 10px;
  padding: 10px 16px;
  border-radius: var(--hub-radius);
  border: 1px solid var(--line);
  background: #fff;
}
.sfoot-time-label { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--muted); }
.sfoot-clock { font-size: 22px; font-weight: 700; color: var(--orange-dark); font-variant-numeric: tabular-nums; line-height: 1.3; }
.sfoot-date { font-size: 13px; color: var(--ink-2); }
.sfoot-brand .footer-status { display: flex; }

.sfoot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.sfoot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.sfoot-head::before { content: ''; width: 4px; height: 16px; border-radius: 3px; background: linear-gradient(180deg, #ffa24d, var(--orange-dark)); }
.sfoot-head-gap { margin-top: 16px; }
.sfoot-col > a { padding: 4px 0; font-size: 14px; color: var(--ink-2); transition: color .15s ease; }
.sfoot-col > a:hover { color: var(--orange-dark); }
.sfoot-col > a.sfoot-navlink { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-weight: 600; }
.sfoot-navlink img { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(120, 60, 10, .18)); transition: transform .2s ease; }
.sfoot-navlink:hover img { transform: translateY(-1px) scale(1.06); }
.sfoot-col > a.sfoot-social {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 230px;
  margin-bottom: 8px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  transition: border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.sfoot-col > a.sfoot-social:hover { border-color: #ffc49b; box-shadow: 0 4px 12px rgba(255, 106, 0, .14); }
.sfoot-social .fs-ico { width: 30px; height: 30px; border-radius: 999px; }
.sfoot-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--ink-3);
}
.sfoot-legal { display: flex; gap: 16px; }
.sfoot-legal a { color: var(--ink-3); }
.sfoot-legal a:hover { color: var(--orange-dark); }
.footer .footer-mascot { bottom: 64px; width: 84px; }

@media (max-width: 1040px) {
  .sfoot { grid-template-columns: 1fr 1fr 1fr; }
  .sfoot-brand { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
  .sfoot-tagline { margin: 4px 0 0; }
  .sfoot-cta { margin: 0; }
}
@media (max-width: 560px) {
  .sfoot { grid-template-columns: 1fr 1fr; gap: 24px 16px; padding: 28px 16px 20px; }
  .sfoot-brand { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sfoot-logo img { width: 130px; }
  .sfoot-col:last-child { grid-column: 1 / -1; }
  .sfoot-col:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .sfoot-col:last-child .sfoot-head { grid-column: 1 / -1; }
  .sfoot-col > a.sfoot-social { max-width: none; font-size: 13px; padding-right: 8px; }
  .sfoot-bottom { justify-content: center; text-align: center; }
}

/* ==========================================================================
   ผิวกลางของหน้าย่อยแบบเก่า (เจ้าของสั่ง 21 ต.ค. 2569 "หน้าอื่นที่ยังเป็นหน้าเดิม ปรับให้เป็นรูปแบบใหม่")
   .wiki-hero (36 หน้า) + .maps4-hero / .skill4-hero + .wiki-crumbs (46 หน้า) ใน style.css → หน้าตาเดียวกับ .hub-hero / .hub-crumbs
   ภาพหัวหมวดเลือกตาม data-sec ของ .layout (partials/header.ejs · siteNav.activeNavKey) — ไม่ต้องแก้ ejs ทีละไฟล์
   ========================================================================== */
.layout { --sec-art: url('/img/ui/banner-database.webp'); }
.layout[data-sec="events"] { --sec-art: url('/img/ui/banner-events.webp'); }
.layout[data-sec="guide"] { --sec-art: url('/img/ui/banner-guide.webp'); }
.layout[data-sec="gacha"] { --sec-art: url('/img/ui/banner-gacha.webp'); }
.layout[data-sec="market"] { --sec-art: url('/img/ui/banner-market.webp'); }
.layout[data-sec="rankings"] { --sec-art: url('/img/ui/banner-rankings.webp'); }

.wiki-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; font-size: 13.5px; color: var(--muted); }
.wiki-crumbs a { color: var(--ink-2); font-weight: 500; }
.wiki-crumbs a:hover { color: var(--orange-dark); text-decoration: none; }
.wiki-crumbs span { margin: 0; color: #d9b8a3; }
.wiki-crumbs strong { color: var(--ink); font-weight: 600; }

.wiki-hero, .maps4-hero, .skill4-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 168px;
  padding: 26px 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(90deg, #fffaf4 0%, #fff6ec 50%, #fde9d6 100%);
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}
.wiki-hero::after, .maps4-hero::after, .skill4-hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 54%;
  z-index: 0;
  pointer-events: none;
  background: var(--sec-art) no-repeat 72% 32% / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
}
.wiki-hero-deco { display: none; }
.wiki-hero-copy, .skill4-hero-copy { position: relative; z-index: 1; max-width: 58%; }
/* แผนที่: ช่องเลือกดันเจี้ยน/แมพอยู่ในหัว ⇒ เรียงแนวนอนเหมือนเดิม วางเหนือภาพ */
.maps4-hero { flex-direction: row; align-items: center; justify-content: space-between; }
.maps4-hero-copy, .maps4-controls { position: relative; z-index: 1; }
.maps4-hero-copy { max-width: 46%; }
.maps4-sel span { color: var(--ink-2); text-shadow: 0 1px 2px rgba(255, 255, 255, .9); }
.maps4-sel select { background: #fff; border-color: var(--line-2, #ffd2b3); }
.wiki-hero-copy h1, .maps4-hero-copy h1, .skill4-hero-copy h1 { margin: 6px 0 6px; font-size: clamp(24px, 2.8vw, 32px); line-height: 1.22; color: var(--ink); }
.wiki-hero-copy p, .maps4-hero-copy p, .skill4-hero-copy p { color: var(--ink-2); font-size: 15px; line-height: 1.6; max-width: 600px; }
.wiki-badge {
  padding: 3px 12px;
  border: 0;
  background: rgba(255, 106, 0, .12);
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.wiki-hero-tabs a { border-color: var(--line-2, #ffd2b3); background: #fff; color: var(--ink-2); }
.wiki-hero-tabs a:not(.active):hover { border-color: var(--orange); color: var(--orange-dark); }

@media (max-width: 720px) {
  .wiki-hero, .maps4-hero, .skill4-hero { min-height: 0; padding: 20px 18px; border-radius: 18px; }
  .maps4-hero { flex-direction: column; align-items: stretch; }
  .maps4-hero-copy { max-width: 100%; }
  .wiki-hero::after, .maps4-hero::after, .skill4-hero::after { width: 100%; opacity: .3; -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 100%); mask-image: linear-gradient(90deg, transparent 25%, #000 100%); }
  .wiki-hero-copy, .skill4-hero-copy { max-width: 100%; }
  .wiki-hero-copy h1, .maps4-hero-copy h1, .skill4-hero-copy h1 { font-size: 24px; }
  .wiki-hero-copy p, .maps4-hero-copy p, .skill4-hero-copy p { font-size: 14px; }
}

/* /database/leveling ใช้ .level-guide-hero (หัวกลางสีส้มแบบเก่า · ไม่มี .wiki-hero) → ผิวเดียวกับ .wiki-hero โดยไม่แก้ ejs */
.level-guide-hero {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 26px 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(90deg, #fffaf4 0%, #fff6ec 50%, #fde9d6 100%);
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}
.level-guide-hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 54%;
  z-index: 0;
  pointer-events: none;
  background: var(--sec-art) no-repeat 72% 32% / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
}
.level-guide-hero > *, .level-guide-hero > p { position: relative; z-index: 1; max-width: 58%; }
.level-guide-hero .level-guide-badge { border: 0; background: rgba(255, 106, 0, .12); color: var(--orange-dark); }
.level-guide-hero h1 { margin: 10px 0 6px; font-size: clamp(24px, 2.8vw, 32px); line-height: 1.22; color: var(--ink); }
.level-guide-hero p { margin: 0; color: var(--ink-2); }
.level-guide-hero .level-guide-note { background: rgba(255, 255, 255, .85); }
@media (max-width: 720px) {
  .level-guide-hero { padding: 20px 18px; border-radius: 18px; }
  .level-guide-hero::after { width: 100%; opacity: .3; -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 100%); mask-image: linear-gradient(90deg, transparent 25%, #000 100%); }
  .level-guide-hero > *, .level-guide-hero > p { max-width: 100%; }
  .level-guide-hero h1 { font-size: 24px; }
  .level-guide-hero p { font-size: 14px; }
}

/* หัวหน้าเฉพาะตัวแบบเก่าของหน้าใน server.js/routes (login · forgot-password · register · rankings · server-info)
   → ผิวเดียวกับ .wiki-hero: ชิดซ้าย + ภาพหัวหมวด RO ด้านขวา · ซ่อนตัวการ์ตูน chibi เดิม · ไม่แก้ ejs
   นำหน้าด้วย .layout ให้ชนะกฎเดิมใน style.css (รวม media query) */
.layout .login-hero, .layout .register-hero { --sec-art: url('/img/hero-scene.webp'); }
.layout .login-hero, .layout .register-hero, .layout .rank4-hero, .layout .info4-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  place-items: initial;
  min-height: 168px;
  height: auto;
  padding: 26px 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(90deg, #fffaf4 0%, #fff6ec 50%, #fde9d6 100%);
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
  text-align: left;
}
.layout .login-hero::before, .layout .register-hero::before, .layout .rank4-hero::before, .layout .info4-hero::before { content: none; }
.layout .login-hero::after, .layout .register-hero::after, .layout .rank4-hero::after, .layout .info4-hero::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 54%;
  height: auto;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  background: var(--sec-art) no-repeat 72% 32% / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
}
.layout .login-hero-art, .layout .register-hero-art, .layout .rank4-hero-art, .layout .rank4-trophy, .layout .info4-crest { display: none; }
.layout .login-hero-copy, .layout .register-hero-copy, .layout .rank4-hero-copy, .layout .info4-hero-inner {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: 58%;
  margin: 0;
  padding: 0;
  text-align: left;
  justify-items: start;
  background: none;
  box-shadow: none;
}
.layout .login-hero h1, .layout .register-hero h1, .layout .rank4-hero h1, .layout .info4-hero h1 {
  margin: 6px 0 6px;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0;
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}
.layout .info4-hero h1 span { color: var(--orange-dark); -webkit-text-fill-color: currentColor; background: none; }
.layout .login-hero p, .layout .register-hero p, .layout .rank4-hero p, .layout .info4-hero p {
  max-width: 600px;
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  text-shadow: none;
}
.layout .login-hero-badge, .layout .register-hero-badge {
  width: 38px;
  height: 38px;
  margin: 0 0 4px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 106, 0, .12);
  color: var(--orange-dark);
  box-shadow: none;
}
.layout .login-hero-badge svg, .layout .register-hero-badge svg { width: 20px; height: 20px; }
.layout .rank4-badge, .layout .info4-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin: 0 0 2px;
  padding: 3px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 106, 0, .12);
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: none;
  clip-path: none;
  transform: none;
}
.layout .rank4-badge img { width: 16px; height: 16px; }
.layout .info4-ribbon { margin: 2px 0 8px; }
.layout .info4-ribbon::before, .layout .info4-ribbon::after { content: none; }
@media (max-width: 720px) {
  .layout .login-hero, .layout .register-hero, .layout .rank4-hero, .layout .info4-hero { min-height: 0; padding: 20px 18px; border-radius: 18px; }
  .layout .login-hero::after, .layout .register-hero::after, .layout .rank4-hero::after, .layout .info4-hero::after { width: 100%; opacity: .3; -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 100%); mask-image: linear-gradient(90deg, transparent 25%, #000 100%); }
  .layout .login-hero-copy, .layout .register-hero-copy, .layout .rank4-hero-copy, .layout .info4-hero-inner { max-width: 100%; }
  .layout .login-hero h1, .layout .register-hero h1, .layout .rank4-hero h1, .layout .info4-hero h1 { font-size: 24px; }
  .layout .login-hero p, .layout .register-hero p, .layout .rank4-hero p, .layout .info4-hero p { font-size: 14px; }
}

/* แผงซ้ายของฟอร์มล็อกอิน/ลืมรหัส: ตัวการ์ตูน chibi เดิม → ภาพ RO ชุดใหม่ (หัวหมวดคู่มือ) เห็นชัด จางเฉพาะขอบฝั่งฟอร์ม/ล่าง */
.layout .login-panel-art { background: #fde9d6 url('/img/ui/banner-guide.webp') no-repeat 62% 30% / cover; }
.layout .login-panel-art img { display: none; }
.layout .login-panel-art::before { content: none; }
.layout .login-panel-art::after { background: linear-gradient(90deg, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, .85) 100%), linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(255, 248, 241, .9) 100%); }

/* หน้าสมัครบนมือถือ: grid track โตตาม min-content ของฟอร์ม (470px ในจอ 390 → ขอบขวาโดนตัด · เป็นมาแต่เดิมบนเว็บจริง) */
.layout .register-page, .layout .register-form, .layout .register-form-section { grid-template-columns: minmax(0, 1fr); }
.layout .register-page > *, .layout .register-form > *, .layout .register-form-section > * { min-width: 0; }
/* มือถือเดิมดึงหัวหน้าสมัครขึ้น -26px ให้ชนหัวเว็บเก่า → ขอบบนการ์ดใหม่โดนตัด */
.layout .register-hero, .layout .login-hero { margin-top: 0; }

/* /contact: หัวสามช่อง (chibi + กลาง + ป้ายไม้สีน้ำตาล) → ชิดซ้าย + ภาพ RO ขวา + กล่องข้อควรระวังเป็นการ์ดขาว */
.layout .contact-hero {
  --sec-art: url('/img/ui/banner-guide.webp');
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 22px;
  min-height: 0;
  margin: 0 0 18px;
  padding: 26px 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(90deg, #fffaf4 0%, #fff6ec 50%, #fde9d6 100%);
  box-shadow: var(--shadow-md);
}
.layout .contact-hero::after {
  inset: 0 0 0 auto;
  width: 60%;
  height: auto;
  z-index: 0;
  background: var(--sec-art) no-repeat 60% 30% / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
}
.layout .contact-hero-art, .layout .contact-spark { display: none; }
.layout .contact-hero-main { text-align: left; max-width: 560px; }
.layout .contact-hero-main h1 { margin: 0 0 4px; font-size: clamp(24px, 2.8vw, 32px); font-weight: 700; line-height: 1.22; text-shadow: none; }
.layout .contact-subtitle { margin: 0 0 2px; padding: 3px 12px; border-radius: 999px; background: rgba(255, 106, 0, .12); color: var(--orange-dark); font-size: 12px; font-weight: 700; }
.layout .contact-subtitle::before, .layout .contact-subtitle::after { content: none; }
.layout .contact-hero-main p { margin: 6px 0 0; font-size: 15px; font-weight: 400; }
.layout .contact-trust { max-width: 520px; }
.layout .contact-trust span { background: rgba(255, 255, 255, .88); }
.layout .contact-warning {
  min-height: 0;
  padding: 16px 18px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .93);
  border: 1px solid #f5c6c2;
  border-left: 4px solid #e0483f;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(120, 50, 0, .14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.layout .contact-warning::before, .layout .contact-warning::after, .layout .contact-warning-lamp { display: none; }
.layout .contact-warning-icon { display: none; }
.layout .contact-warning h2 { margin: 0 0 8px; color: #b4302a; font-size: 16px; text-align: left; }
.layout .contact-warning li { color: var(--ink-2); text-shadow: none; text-align: left; justify-content: flex-start; }
.layout .contact-warning ul { justify-items: start; }
@media (max-width: 900px) {
  .layout .contact-hero { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; border-radius: 18px; }
  .layout .contact-hero::after { width: 100%; opacity: .3; -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 100%); mask-image: linear-gradient(90deg, transparent 25%, #000 100%); }
}

/* หัวหน้าแบบเรียบ .page-head (download · 404 · bug-hunter · event-detail · news-detail): ไอคอน chibi + h1 ส้ม → แถบการ์ดชุดใหม่ */
.layout .page-head {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 22px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(90deg, #fffaf4 0%, #fff6ec 50%, #fde9d6 100%);
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}
.layout .page-head::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 46%;
  z-index: 0;
  pointer-events: none;
  background: var(--sec-art) no-repeat 72% 32% / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
}
.layout .page-head > * { position: relative; z-index: 1; }
.layout .page-head .page-art { display: none; }
.layout .page-head h1 { font-size: clamp(24px, 2.8vw, 32px); font-weight: 700; line-height: 1.22; color: var(--ink); }
.layout .page-head-back { background: rgba(255, 255, 255, .92); }
@media (max-width: 720px) {
  .layout .page-head { min-height: 0; padding: 18px; border-radius: 18px; flex-wrap: wrap; }
  .layout .page-head::after { width: 100%; opacity: .3; -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 100%); mask-image: linear-gradient(90deg, transparent 25%, #000 100%); }
  .layout .page-head h1 { font-size: 24px; }
}

/* web-reorg-skin5-1021: ปุ่มในหัว .page-head (bug-hunter "Ranking" / "Back") เคยลอยไปทับภาพด้านขวา → ถอยมาอยู่ก่อนช่วงภาพทึบ */
.layout .page-head-back { margin-right: 34%; }
@media (max-width: 720px) {
  .layout .page-head-back { margin-right: 0; }
}

/* /credit-merchants/promotions: breadcrumb + หัวข้อกลางแบบเก่า → breadcrumb ชุดเดียวกับ .wiki-crumbs + หัวการ์ดชิดซ้ายมีภาพ (แบบ .page-head)
   จับเฉพาะ .credit-section-head ที่ตามหลัง .credit-crumb (หน้านี้หน้าเดียว) — หัวหมวดใน /credit-merchants ไม่โดน */
.layout .credit-crumb { max-width: none; margin: 4px 0 12px; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.layout .credit-crumb a { color: var(--ink-2); font-weight: 500; }
.layout .credit-crumb a:hover { color: var(--orange-dark); text-decoration: none; }
.layout .credit-crumb [aria-hidden] { color: #d9b8a3; }
.layout .credit-crumb + .credit-section-head {
  --sec-art: url('/img/hero-scene.webp');
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(90deg, #fffaf4 0%, #fff6ec 50%, #fde9d6 100%);
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
}
.layout .credit-crumb + .credit-section-head::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 46%;
  z-index: 0;
  pointer-events: none;
  background: var(--sec-art) no-repeat 72% 32% / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 28%, #000 58%);
}
.layout .credit-crumb + .credit-section-head > * { position: relative; z-index: 1; max-width: 56%; }
.layout .credit-crumb + .credit-section-head h2 { font-size: clamp(24px, 2.8vw, 32px); font-weight: 700; color: var(--ink); }
.layout .credit-crumb + .credit-section-head > .credit-section-sub { margin-inline: 0; color: var(--ink-2); font-weight: 500; }
@media (max-width: 720px) {
  .layout .credit-crumb + .credit-section-head { padding: 18px; border-radius: 18px; }
  .layout .credit-crumb + .credit-section-head::after { width: 100%; opacity: .3; -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 100%); mask-image: linear-gradient(90deg, transparent 25%, #000 100%); }
  .layout .credit-crumb + .credit-section-head > * { max-width: none; }
  .layout .credit-crumb + .credit-section-head h2 { font-size: 24px; }
}

/* ---------- /database/collection: รวมหน้าสรุปบัฟเข้ามาเป็นแท็บ (web-collmerge-1021 · 21 ต.ค. 2569) ----------
   style.css มีชุด .coll4-* / .collsum-* เดิมอยู่แล้ว — ตรงนี้แค่จัดกล่อง "ไอดีคุณ" 2 ฝั่ง + ตัวเลขในแท็บ */
.coll4-tabs a span { margin-left: 4px; font-weight: 500; opacity: .8; }
.coll4-me { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 18px 0 6px; align-items: stretch; }
.coll4-me .coll4-progress { margin: 0; }
.coll4-mybuff { padding: 16px 18px; border: 1px solid var(--line-2, #ffd2b3); border-radius: 14px; background: var(--bg-soft, #fff7f0); }
.coll4-mybuff-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.coll4-mybuff .collsum-list li { border-color: var(--line-2, #ffd2b3); font-weight: 600; }
.coll4-mybuff .collsum-empty { line-height: 1.6; }
.coll4-page [data-panel][hidden] { display: none; }
.coll4-page .collsum-full { margin-top: 26px; }
@media (max-width: 760px) {
  .coll4-me { grid-template-columns: 1fr; }
  .coll4-me .coll4-progress-head { flex-wrap: wrap; gap: 2px 12px; }
  .coll4-me .coll4-progress-count { white-space: nowrap; }
  .coll4-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 360px; }
  .coll4-tabs a { padding: 8px 10px; text-align: center; white-space: nowrap; }
}
