@import url("topbar.css?v=1.0.2");

/* =========================================================
   GRANADO ESPADA M — Pre-register Landing
   ---------------------------------------------------------
   Layout : Bootstrap 5 (grid / modal / tab) + custom layer
   Theme  : Dark bronze & gold (ตาม reference)
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg:         #120c07;
  --bg-2:       #1a110a;
  --panel:      rgba(24, 15, 9, 0.88);
  --gold:       #d6a64a;
  --gold-hi:    #f6d98f;
  --gold-deep:  #8a5a1c;
  --gold-line:  rgba(214, 166, 74, 0.45);
  --gold-faint: rgba(214, 166, 74, 0.18);
  --ink:        #f2e6d0;
  --ink-2:      #d4c3a6;
  --muted:      #a8936f;
  --danger:     #ff8a73;

  --grad-gold:      linear-gradient(180deg, #fbe7b0 0%, #e2b35c 48%, #a8702a 100%);
  --grad-gold-text: linear-gradient(180deg, #fff3cc 0%, #f1c872 50%, #b9802f 100%);

  --font-body:    "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  --font-head:    "Prompt", "IBM Plex Sans Thai", sans-serif;
  --font-display: "Cinzel", "Times New Roman", serif;

  --topbar-h: 64px;
  --radius: 6px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--topbar-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--gold-hi); text-decoration: none; }
a:hover { color: #fff3cc; }
/* ครอบ ol ด้วย — ไม่งั้น padding-inline-start 40px ที่เบราว์เซอร์ใส่มาเอง
   จะดันคอลัมน์ในตารางอันดับให้เหลื่อมกับหัวตาราง */
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
img { max-width: 100%; }

/* section ที่ snippet ปิดไว้ ต้องชนะ display ที่มากับคอมโพเนนต์ */
#hero[hidden],
#campaign[hidden],
#news[hidden],
#characters[hidden],
#ranking[hidden],
#features[hidden],
#socialRail[hidden],
#siteFooter[hidden] { display: none !important; }

::selection { background: var(--gold); color: #1a0f06; }

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

.gemth-gold-text,
.gemth-counter__value,
.gemth-mcard__number,
.gemth-char-panel__name {
  background: var(--grad-gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 3. Buttons ---------- */

/* ปุ่มภาพ (asset ปุ่มลงทะเบียน) */
.gemth-btn-art {
  position: relative;
  display: inline-block;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 0 !important;
  color: inherit;
  cursor: pointer;
  line-height: 0 !important;
  text-transform: none !important;
  /* hover ใช้ property "translate" แยกจาก "transform"
     เพื่อไม่ให้ชน GSAP ที่ใช้ transform ทำอนิเมชันตอนเข้า */
  transition: translate .2s ease, filter .2s ease;
}

.gemth-btn-art img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity .2s ease;
}

.gemth-btn-art:hover,
.gemth-btn-art:focus-visible {
  translate: 0 -2px;
  filter: brightness(1.08) drop-shadow(0 0 14px rgba(246, 201, 110, 0.55));
}

/* light sweep แววาววิ่งผ่านปุ่ม
   - .gemth-btn-art__shine = กรอบนิ่ง ใช้รูปปุ่มเป็น mask แสงจึงอยู่เฉพาะบนตัวปุ่ม
   - ::before = แถบแสง เคลื่อนด้วย transform อย่างเดียว (GPU ทำงาน ไม่ต้อง repaint ทุกเฟรม) */
.gemth-btn-art__shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: url("../img/btn-register.webp") center / 100% 100% no-repeat;
  mask: url("../img/btn-register.webp") center / 100% 100% no-repeat;
}

.gemth-btn-art__shine::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  background: linear-gradient(105deg,
    rgba(255, 250, 230, 0) 0%,
    rgba(255, 250, 230, .12) 30%,
    rgba(255, 252, 238, .62) 50%,
    rgba(255, 250, 230, .12) 70%,
    rgba(255, 250, 230, 0) 100%);
  transform: translate3d(-110%, 0, 0);
  will-change: transform;
  animation: btn-sweep 3.6s ease-in-out infinite;
}

.gemth-btn-art:hover .gemth-btn-art__shine::before { animation-duration: 1.6s; }

@keyframes btn-sweep {
  0%        { transform: translate3d(-110%, 0, 0); }
  40%, 100% { transform: translate3d(270%, 0, 0); }
}

.gemth-btn-art:active { translate: 0 0; }
.gemth-btn-art:focus-visible { outline-offset: 0; border-radius: 12px; }

.gemth-btn-art__loading {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #2a1706;
}

.gemth-btn-art.gemth-is-loading { pointer-events: none; }
.gemth-btn-art.gemth-is-loading img { opacity: .55; }
.gemth-btn-art.gemth-is-loading .gemth-btn-art__loading { display: grid; }

.gemth-btn-art--block { display: block; width: min(100%, 340px); margin: 26px auto 0; }

/* ปุ่มทอง / ปุ่มเส้น (CSS) */
.gemth-btn-gold,
.gemth-btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

.gemth-btn-gold {
  color: #2a1706;
  background: var(--grad-gold);
  border: 1px solid #fbe3a3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 10px rgba(0, 0, 0, .35);
}

.gemth-btn-gold:hover,
.gemth-btn-gold:focus-visible {
  color: #2a1706;
  filter: brightness(1.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 18px rgba(246, 201, 110, .45);
}

.gemth-btn-line {
  color: var(--ink);
  background: rgba(10, 6, 3, .35);
  border: 1px solid var(--gold-line);
}

.gemth-btn-line:hover,
.gemth-btn-line:focus-visible {
  color: var(--gold-hi);
  border-color: var(--gold);
  background: rgba(214, 166, 74, .1);
}

.gemth-btn-gold--sm,
.gemth-btn-line--sm { font-size: 13px; padding: 9px 16px; }

/* ปุ่มเปิด/ปิดเพลงประกอบ — ไอคอนโน้ตดนตรีวงกลม
   .gemth-is-off = ปิดอยู่ (มีขีดทับ), ไม่มี class = กำลังเล่น */
.gemth-btn-sound {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 19px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.gemth-btn-sound i { line-height: 1; }

.gemth-btn-sound.gemth-is-playing i { animation: note-beat 1.9s ease-in-out infinite; }

.gemth-btn-sound.gemth-is-off {
  color: var(--muted);
  border-color: rgba(214, 166, 74, .26);
}

/* ขีดทับแบบ mute — เงาดำบาง ๆ ช่วยให้เส้นอ่านออกแม้ทับตัวโน้ต */
.gemth-btn-sound.gemth-is-off::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -2px 0 rgba(10, 6, 3, .9);
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes note-beat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}

/* ---------- 4. Top bar ---------- */
.gemth-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1030;
  height: var(--topbar-h);
  background: linear-gradient(180deg, rgba(10, 6, 3, .9), rgba(10, 6, 3, .68));
  border-bottom: 1px solid rgba(214, 166, 74, .22);
  transition: background-color .25s ease, box-shadow .25s ease;
}

.gemth-topbar.gemth-is-scrolled {
  background: rgba(12, 8, 4, .96);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

.gemth-topbar__inner {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
}

.gemth-brand { display: inline-flex; align-items: center; }
.gemth-brand__logo { height: 42px; width: auto; }

.gemth-topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ---------- 4.5 Top nav ---------- */
.gemth-topbar__nav { display: flex; align-items: center; }
.gemth-topbar__nav[hidden] { display: none; }

.gemth-topnav__burger { display: none; }

.gemth-topnav__list { display: flex; align-items: center; gap: 4px; }

.gemth-topnav__item { position: relative; }

.gemth-topnav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}

.gemth-topnav__link:hover,
.gemth-topnav__link:focus-visible { color: var(--gold-hi); background: rgba(214, 166, 74, .12); }

.gemth-topnav__toggle .bi { font-size: .8em; transition: rotate .2s ease; }
.gemth-topnav__toggle[aria-expanded="true"] { color: var(--gold-hi); background: rgba(214, 166, 74, .14); }
.gemth-topnav__toggle[aria-expanded="true"] .bi { rotate: 180deg; }

.gemth-topnav__sub {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--gold-line);
  border-radius: 5px;
  background: rgba(14, 9, 4, .98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6);
  display: none;
}

.gemth-topnav__item.gemth-is-open .gemth-topnav__sub { display: block; }

.gemth-topnav__sublink {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.5;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}

.gemth-topnav__sublink:hover,
.gemth-topnav__sublink:focus-visible { color: var(--gold-hi); background: rgba(214, 166, 74, .14); }

/* ---------- 5. Floating social rail ---------- */
.gemth-social-rail {
  --rail-btn: 52px;
  position: fixed;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1020;
  /* ธีม Newspaper ใส่ width/margin ให้ aside, ul, li ในเนื้อหน้า — ล็อกให้กว้างเท่าปุ่ม */
  width: max-content !important;
  max-width: max-content !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

.gemth-social-rail__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: max-content !important;
  max-width: max-content !important;
  margin: 0 !important;
  padding: 14px 10px !important;
  list-style: none !important;
  border: 1px solid rgba(214, 166, 74, .3);
  border-radius: 999px;
  background: rgba(12, 8, 4, .84);
}

.gemth-social-rail__list > li {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  list-style: none !important;
}

.gemth-social-rail__list > li::before,
.gemth-social-rail__list > li::after {
  content: none !important;
  display: none !important;
}

/* ธีม WP มัก override font ของ <i> — ล็อก bootstrap-icons ให้ social rail */
.gemth-social-rail__item .bi {
  display: inline-block;
  line-height: 1;
  font-style: normal;
  font-weight: normal !important;
  -webkit-font-smoothing: antialiased;
}

.gemth-social-rail__item .bi::before {
  font-family: bootstrap-icons !important;
}

.gemth-social-rail__item {
  position: relative;
  display: grid !important;
  place-items: center;
  flex: 0 0 var(--rail-btn) !important;
  width: var(--rail-btn) !important;
  height: var(--rail-btn) !important;
  min-width: var(--rail-btn) !important;
  max-width: var(--rail-btn) !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  color: var(--gold-hi);
  font-size: 22px;
  line-height: 1;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.gemth-social-rail__item:hover,
.gemth-social-rail__item:focus-visible {
  color: #2a1706;
  background: var(--grad-gold);
  box-shadow: 0 0 14px rgba(246, 201, 110, .5);
}

.gemth-social-rail__item::after {
  content: attr(data-tip) !important;
  position: absolute !important;
  left: calc(100% + 16px) !important;
  right: auto !important;
  top: 50% !important;
  bottom: auto !important;
  width: max-content !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 12px;
  line-height: 1;
  color: var(--ink);
  background: rgba(12, 8, 4, .92);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  padding: 7px 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.gemth-social-rail__item:hover::after { opacity: 1; }

/* ---------- 6. Section shells ---------- */
.gemth-section {
  position: relative;
  padding: 96px 0 104px;
  isolation: isolate;
}

.gemth-section--map {
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(40, 24, 10, 0) 0%, rgba(18, 12, 7, .55) 100%),
    url("../img/bg-map.webp") center / cover no-repeat,
    var(--bg);
}

.gemth-section--dark {
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(120, 76, 30, .22) 0%, rgba(18, 12, 7, 0) 70%),
    var(--bg);
}

.gemth-section--dark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/bg-map.webp") center / cover no-repeat;
  opacity: .16;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

/* ขนาดกรอบแคมเปญแปรผันตามความกว้างจอ: จอเล็ก 44px → จอ PC ใหญ่สุด 128px
   padding ของ section เพิ่มตามขนาดกรอบ เนื้อหาจะได้ไม่ชนลวดลาย */
.gemth-section.gemth-campaign {
  --frame-bw: clamp(44px, 7.5vw, 128px);
  padding: calc(var(--frame-bw) + 52px) 0 calc(var(--frame-bw) + 84px);
}
.gemth-characters { border-top: 1px solid rgba(214, 166, 74, .25); padding-bottom: 56px; }
.gemth-features { padding-top: 40px; }

/* กรอบลวดลายทองรอบ section แคมเปญ
   - มุม 4 ด้าน + เส้นขอบ = border-image (ยืดเฉพาะเส้นตรง มุมคงสัดส่วนเสมอ)
   - ลายกลางด้านบน/ล่าง = แยกเป็น ::before / ::after ขนาดตามสัดส่วนจริง ไม่ถูกยืด
   ภาพต้นฉบับ 2000px: มุมกว้าง 225 สูง 185, ลายกลางกว้าง 470 สูง 95 (บน) / 111 (ล่าง)
   --bw = ความสูงของมุมบนจอ ทุกอย่างสเกลตามค่านี้ */
.gemth-section__frame {
  --bw: var(--frame-bw, 64px);
  --s: calc(var(--bw) / 185);
  position: absolute;
  inset: 14px;
  z-index: -1;
  border: 1px solid transparent;
  border-image-source: url("../img/frame-ornament-edge.webp");
  border-image-slice: 185 225;
  border-image-width: var(--bw) calc(var(--s) * 225);
  border-image-repeat: stretch;
  opacity: .9;
  pointer-events: none;
}

.gemth-section__frame::before,
.gemth-section__frame::after {
  content: "";
  position: absolute;
  left: 50%;
  width: calc(var(--s) * 470);
  transform: translateX(-50%);
  background: center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .65));
}

.gemth-section__frame::before {
  top: -1px;
  height: calc(var(--s) * 95);
  background-image: url("../img/frame-crest-top.webp");
}

.gemth-section__frame::after {
  bottom: -1px;
  height: calc(var(--s) * 111);
  background-image: url("../img/frame-crest-bottom.webp");
}

.gemth-section__head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 44px;
}

.gemth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.gemth-eyebrow::before,
.gemth-eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.gemth-eyebrow::after { transform: scaleX(-1); }

/* เซคชันแคมเปญใช้พื้นหลังลายแผนที่สีบรอนซ์ ซึ่งสว่างใกล้ --gold
   eyebrow สีทองปกติจึงจมไปกับพื้น — เฉพาะเซคชันนี้ดันให้สว่างขึ้น
   แล้วเพิ่มเงาเข้มรองไว้ให้ตัวอักษรลอยออกจากลายพื้น */
.gemth-campaign .gemth-eyebrow {
  color: #fff1cf;
  text-shadow: 0 1px 3px rgba(10, 6, 3, .95), 0 0 16px rgba(10, 6, 3, .85);
}

.gemth-campaign .gemth-eyebrow::before,
.gemth-campaign .gemth-eyebrow::after {
  background: linear-gradient(90deg, transparent, #ffe6a8);
}

.gemth-section__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.35;
  color: var(--ink);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}

.gemth-section__desc {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- 7. Hero ---------- */
.gemth-hero {
  --trio-w: min(1040px, 98vw, 112vh);
  position: relative;
  overflow: hidden;
  padding: calc(var(--topbar-h) + 8px) 0 44px;
  isolation: isolate;
  text-align: center;
}

.gemth-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/bg-hero.webp") center 30% / cover no-repeat;
}

.gemth-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(18, 12, 7, 0) 0%, rgba(18, 12, 7, .35) 100%),
    linear-gradient(180deg, rgba(12, 8, 4, .35) 0%, rgba(12, 8, 4, 0) 25%, rgba(18, 12, 7, .15) 55%, rgba(18, 12, 7, .92) 88%, var(--bg) 100%);
}

.gemth-hero__inner { position: relative; }

/* ---------- ละอองไฟลอยขึ้นใน hero ----------
   z-index: 1 = ลอยอยู่หน้าสุด เหนือทั้งตัวละครและ backdrop วงกลมของ .gemth-hero__body
   เคยลองวางไว้ใต้ .gemth-hero__inner แล้ว แต่ backdrop วงกลม (ทึบถึง .86) กับตัวละคร
   บังจนแทบไม่เห็นอะไรเลย — ละอองไฟเป็นแสง การอยู่หน้าสุดจึงถูกต้องกว่าอยู่แล้ว
   ความทึบสูงสุดคุมไว้ไม่ให้รบกวนการอ่าน (ดู --peak ใน main.js) */
.gemth-hero__embers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.gemth-ember {
  position: absolute;
  left: var(--x);
  bottom: -6%;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle,
    rgba(255, 243, 204, .95) 0%,
    rgba(246, 217, 143, .7) 32%,
    rgba(214, 166, 74, .3) 58%,
    rgba(214, 166, 74, 0) 75%);
  /* แยกสองอนิเมชันคนละ property — ember-rise เขียน translate, ember-sway เขียน
     transform จึงทำงานพร้อมกันได้โดยไม่ทับกัน และคนละ duration ทำให้เส้นทาง
     ของแต่ละลูกไม่ซ้ำแบบกัน ดูเป็นธรรมชาติ */
  animation:
    ember-rise var(--dur) linear var(--delay) infinite,
    ember-sway var(--sway-dur) ease-in-out var(--delay) infinite;
}

@keyframes ember-rise {
  0%        { translate: 0 0; opacity: 0; }
  12%       { opacity: var(--peak); }
  72%       { opacity: var(--peak); }
  100%      { translate: 0 calc(var(--rise) * -1); opacity: 0; }
}

@keyframes ember-sway {
  0%, 100%  { transform: translateX(calc(var(--sway) * -1)) scale(.65); }
  50%       { transform: translateX(var(--sway)) scale(1); }
}

/* hero เลื่อนพ้นจอแล้วไม่ต้องเผา CPU ทิ้ง — main.js สลับ class ให้ด้วย IntersectionObserver */
.gemth-hero__embers.gemth-is-paused .gemth-ember { animation-play-state: paused; }

.gemth-hero__cast {
  width: var(--trio-w);
  margin: calc(var(--trio-w) * -0.1) auto 0;
  pointer-events: none;
}

.gemth-hero__trio {
  display: block;
  width: 100%;
  height: auto;
}

.gemth-hero__body {
  --glow-size: min(1120px, 126vw);
  --glow-y: 62%;
  position: relative;
  isolation: isolate;
  margin-top: calc(var(--trio-w) * -0.58);
}

/* backdrop ไล่สีดำทรงวงรีหลังเนื้อหา hero — ดันตัวหนังสือ/ปุ่มให้ลอยออกมา
   ไม่จมไปกับภาพตัวละครกับฉากเมืองที่รายละเอียดเยอะ
   ศูนย์กลางเยื้องลงล่าง (60%) ให้เข้มสุดตรงช่วง tagline → แถวแพลตฟอร์ม
   แล้วจางหมดก่อนถึงใบหน้าตัวละครด้านบน
   isolation: isolate ที่ตัวแม่ = z-index -1 อยู่หลังข้อความ แต่ยังทับรูปตัวละคร */
.gemth-hero__body::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 80%;
  translate: -50% -50%;
  width: var(--glow-size);
  aspect-ratio: 1;
  pointer-events: none;
  /* กล่องเป็นสี่เหลี่ยมจัตุรัส + closest-side = รัศมีวงกลมเท่ากับครึ่งกล่องพอดี
     สีจึงจางเป็น 0 ตรงขอบกล่องพอดี ไม่มีส่วนไหนถูกครอปให้เห็นเป็นขอบตัด */
  background: radial-gradient(circle closest-side,
    rgba(0, 0, 0, .86) 0%,
    rgba(0, 0, 0, .8) 34%,
    rgba(0, 0, 0, .6) 56%,
    rgba(0, 0, 0, .3) 78%,
    rgba(0, 0, 0, 0) 100%);
}

.gemth-hero__logo {
  width: min(460px, 80vw);
  margin: 0 auto;
  line-height: 0;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .75));
}

.gemth-hero__logo img { width: 100%; height: auto; }

/* ไล่สีครีม → ทอง → อำพัน (ต้องใช้ background-clip: text จึงใส่ color: transparent)
   ไม่มีเส้นขอบ — ใช้ drop-shadow เข้มรองไว้ให้อ่านออกบนภาพพื้นหลัง */
.gemth-hero__tagline {
  margin-top: 16px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(26px, 4.1vw, 50px);
  line-height: 1.3;
  letter-spacing: .005em;
  background: linear-gradient(180deg,
    #fffdf7 0%,
    #fdf7dd 30%,
    #f8e2a0 46%,
    #f0bf58 58%,
    #dd9a2e 74%,
    #b06b17 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 .04em .02em rgba(58, 26, 6, .95))
    drop-shadow(0 .06em .26em rgba(0, 0, 0, .75));
}

.gemth-hero__sub {
  margin: 12px auto 26px;
  max-width: 760px;
  color: var(--ink);
  font-weight: 500;
  font-size: clamp(17px, 1.9vw, 26px);
  line-height: 1.6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 18px rgba(0, 0, 0, .6);
}

/* บางสเตจเน้นบรรทัดบน บางสเตจเน้นบรรทัดล่าง — main.js สลับคลาสให้ตามสเตจ */
.gemth-hero__tagline--lg { font-size: clamp(32px, 5.2vw, 64px); }

/* บรรทัดล่างแบบเน้น ต้องใหญ่กว่าบรรทัดบนทุกความกว้างจอ
   จึงตั้งทั้ง min/vw/max สูงกว่าค่าของ .gemth-hero__tagline */
.gemth-hero__sub--lg {
  margin-top: 4px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: 1.3;
  letter-spacing: .005em;
  background: linear-gradient(180deg,
    #fffdf7 0%,
    #fdf7dd 30%,
    #f8e2a0 46%,
    #f0bf58 58%,
    #dd9a2e 74%,
    #b06b17 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter:
    drop-shadow(0 .04em .02em rgba(58, 26, 6, .95))
    drop-shadow(0 .06em .26em rgba(0, 0, 0, .75));
}

.gemth-hero__cta { width: min(320px, 82vw); }

.gemth-platforms {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 0;
}

.gemth-platforms__item {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 2px 26px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.4;
  color: var(--ink);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

.gemth-platforms__item + .gemth-platforms__item { border-left: 1px solid rgba(242, 230, 208, .3); }

.gemth-platforms__item i {
  font-size: 1.45em;
  line-height: 1;
  color: var(--gold-hi);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

.gemth-platforms__note {
  margin-top: 10px;
  font-size: clamp(14px, 1.05vw, 17px);
  color: var(--ink-2);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

.gemth-hero__scroll {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 26px auto 0;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  color: var(--gold-hi);
  animation: bounce 2.2s infinite;
}

.gemth-hero__scroll:hover { background: rgba(214, 166, 74, .15); }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ซ่อนเนื้อหาที่ GSAP จะเล่น intro ระหว่างรอ script โหลด (กันภาพกระพริบ)
   class นี้ถูกเอาออกโดย animations.js หรือ fallback timeout ใน <head> */
.gemth-gsap-pending .gemth-topbar,
.gemth-gsap-pending .gemth-hero__inner,
.gemth-gsap-pending .gemth-social-rail { visibility: hidden; }

/* ระหว่าง intro: ยก element ที่ขยับเป็น GPU layer ล่วงหน้า
   (เอา class ออกเมื่อ intro จบ เพื่อคืนหน่วยความจำ GPU) */
.gemth-is-intro .gemth-hero__bg { will-change: transform; }

.gemth-is-intro .gemth-topbar,
.gemth-is-intro .gemth-hero__trio,
.gemth-is-intro .gemth-hero__logo,
.gemth-is-intro .gemth-hero__tagline,
.gemth-is-intro .gemth-hero__sub,
.gemth-is-intro .gemth-hero__cta,
.gemth-is-intro .gemth-platforms__item,
.gemth-is-intro .gemth-platforms__note,
.gemth-is-intro .gemth-social-rail__item { will-change: transform, opacity; }

/* ---------- 7.5 Hero store buttons ---------- */
.gemth-hero__stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.gemth-hero__stores[hidden] { display: none; }

/* สเตจ Pre-store ให้ปุ่มสโตร์ใหญ่กว่าปกติ เพราะเป็น call to action หลักของช่วงนั้น */
.gemth-hero__stores--lg .gemth-hero__badge,
.gemth-hero__stores--lg .gemth-hero__store--pc { --badge-h: 60px; }

.gemth-hero__stores-label {
  display: block;
  width: 100%;
  margin-bottom: 2px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  color: var(--gold-hi);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

.gemth-hero__stores-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* --- badge ทางการของ Apple / Google ---
   ความสูงที่ "ตาเห็น" ต้องเท่ากัน แต่ไฟล์สองเจ้ามีระยะขอบในตัวไม่เท่ากัน:
   Apple SVG ไม่มีขอบเลย ส่วน Google PNG มีขอบโปร่งรอบด้าน 41/250 ของความสูง
   จึงต้องคูณชดเชย 250/168 = 1.488 ให้ Google ไม่งั้นจะดูเล็กกว่า */
.gemth-hero__badge {
  --badge-h: 48px;
  display: block;
  width: auto;
  /* ต้องปลด max-width:100% จาก reset — ไม่งั้น margin ติดลำด้านล่างจะย่อกล่องแม่
     แล้ว badge ถูกบีบแนวนอนจนสัดส่วนเพี้ยน (ผิดไกด์ไลน์ของทั้ง Apple และ Google) */
  max-width: none;
  transition: translate .2s ease, filter .2s ease;
}

.gemth-hero__badge--apple { height: var(--badge-h); }
/* ไฟล์ Play มีขอบโปร่งในตัว 41/646 รอบด้าน ทำให้ช่องไฟข้าง ๆ ดูกว้างกว่าเพื่อน
   หักระยะนั้นคืนด้วย margin ติดลบ: 3.845 (อัตราส่วนกล่อง) x 6.346% = 0.244 ของ --badge-h */
.gemth-hero__badge--play {
  height: calc(var(--badge-h) * 1.488);
  margin: calc(var(--badge-h) * -0.244);
}

a:hover > .gemth-hero__badge,
a:focus-visible > .gemth-hero__badge { translate: 0 -2px; filter: brightness(1.12); }

/* --- ปุ่ม PC สร้างด้วย CSS ให้เข้าชุดกับ badge อีกสองตัว --- */
.gemth-hero__store--pc {
  --badge-h: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: var(--badge-h);
  padding: 0 14px 0 12px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 8px;
  background: #000;
  color: #fff;
  transition: translate .2s ease, border-color .2s ease;
}

.gemth-hero__store--pc:hover,
.gemth-hero__store--pc:focus-visible { translate: 0 -2px; border-color: #fff; color: #fff; }

.gemth-hero__store--pc i { font-size: 25px; line-height: 1; }

.gemth-hero__store--pc .gemth-hero__store-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.12; }

/* ขนาดตัวอักษรอิงสัดส่วนของ badge จริง (บรรทัดบนเล็กกว่าบรรทัดล่างราวครึ่งหนึ่ง) */
.gemth-hero__store--pc .gemth-hero__store-top {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .02em;
}

.gemth-hero__store--pc .gemth-hero__store-main {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: .01em;
}

/* ---------- 14. Stage preview (เครื่องมือ ไม่ใช่ดีไซน์ของหน้าเว็บ) ----------
   ตั้งใจใช้โทนเทากลางให้ต่างจากธีมทอง จะได้ไม่ถูกเข้าใจผิดว่าเป็นส่วนหนึ่งของเว็บ */
.gemth-stagebar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1080;
  width: min(268px, calc(100vw - 36px));
  font-family: var(--font-body);
}

.gemth-stagebar__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(20, 20, 24, .95);
  color: #e8e8ee;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
  transition: border-color .2s ease, background-color .2s ease;
}

.gemth-stagebar__toggle:hover { border-color: rgba(255, 255, 255, .4); background: rgba(30, 30, 36, .97); }
.gemth-stagebar__toggle > .bi-layers-half { font-size: 17px; color: #9aa4b2; }

.gemth-stagebar__toggle-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }

.gemth-stagebar__toggle-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a93a1;
  line-height: 1.4;
}

.gemth-stagebar__current {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gemth-stagebar__caret { font-size: 13px; color: #8a93a1; transition: rotate .2s ease; }
.gemth-stagebar__toggle[aria-expanded="true"] .gemth-stagebar__caret { rotate: 180deg; }

.gemth-stagebar__panel {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(20, 20, 24, .97);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
}

.gemth-stagebar__panel[hidden] { display: none; }

/* toggle มาก่อน panel ใน DOM (ลำดับ tab ถูกต้องกว่า) แต่แถบยึดขอบล่างจอ
   ถ้าปล่อยให้ panel กางลงล่างจะตกขอบ — column-reverse ดันให้กางขึ้นบนแทน */
.gemth-stagebar { display: flex; flex-direction: column-reverse; }

/* ย้าย scroll ไปไว้ที่ panel เพราะตอนนี้มีสองลิสต์ซ้อนกัน */
.gemth-stagebar__panel { max-height: 72vh; overflow-y: auto; }

.gemth-stagebar__list { display: flex; flex-direction: column; gap: 2px; }

.gemth-stagebar__group {
  margin: 6px 4px 4px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a93a1;
}

.gemth-stagebar__group:first-child { margin-top: 2px; }

.gemth-stagebar__item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #cfd5de;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.gemth-stagebar__item:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.gemth-stagebar__item.gemth-is-active { background: #3d6be0; color: #fff; }

.gemth-stagebar__date {
  flex: 0 0 auto;
  min-width: 48px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #8a93a1;
}

.gemth-stagebar__item.gemth-is-active .gemth-stagebar__date { color: rgba(255, 255, 255, .75); }

.gemth-stagebar__note {
  margin-top: 6px;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1.5;
  color: #767f8c;
}

/* สเตจสั่งซ่อน section ทั้งก้อน */
.gemth-section[hidden] { display: none; }

/* ---------- 8. Campaign ---------- */
.gemth-counter {
  position: relative;
  max-width: 600px;
  margin: 0 auto 48px;
  padding: 28px 44px 26px;
  text-align: center;
  background: linear-gradient(180deg, rgba(30, 19, 10, .9), rgba(16, 10, 5, .92));
  border: 1px solid transparent;
  border-image: url("../img/frame-ornament.webp") 180 / 44px / 0 stretch;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

.gemth-counter__label {
  display: block;
  font-size: 14px;
  color: var(--gold);
}

.gemth-counter__value-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.gemth-counter__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.15;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 2px 8px rgba(214, 166, 74, .35));
}

.gemth-counter__unit { font-family: var(--font-head); color: var(--gold-hi); font-size: 16px; }

.gemth-counter__progress { margin-top: 14px; padding-bottom: 22px; }

.gemth-counter__bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(214, 166, 74, .35);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6);
  overflow: hidden;
}

.gemth-counter__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a8702a 0%, #f1c872 70%, #fff0c2 100%);
  box-shadow: 0 0 12px rgba(246, 201, 110, .6);
  transition: width 1.4s cubic-bezier(.22, .61, .36, 1);
}

.gemth-counter__scale { position: relative; height: 0; }

.gemth-counter__scale span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--muted);
}

.gemth-counter__scale span:last-child { transform: translateX(-100%); }

.gemth-milestones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.gemth-mcard {
  --w: calc((100% - 18px * 4) / 5);
  flex: 0 0 var(--w);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 14px 22px;
  border: 1px solid transparent;
  border-image: url("../img/card-locked.webp") 34 34 42 34 fill / 16px 16px 20px 16px / 0 stretch;
  transition: translate .25s ease, filter .25s ease;
}

.gemth-mcard:hover { translate: 0 -4px; filter: brightness(1.08); }

.gemth-mcard.gemth-is-unlocked {
  border-image-source: url("../img/card-active.webp");
  filter: drop-shadow(0 0 16px rgba(246, 201, 110, .35));
}

.gemth-mcard.gemth-is-unlocked:hover { filter: brightness(1.08) drop-shadow(0 0 20px rgba(246, 201, 110, .5)); }

.gemth-mcard__step {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* tag สถานะลอยทับขอบล่างของรูปไอเทม (อยู่ใน .gemth-mcard__emblem) */
.gemth-mcard__state {
  position: absolute;
  left: 50%;
  bottom: -4px;
  z-index: 2;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  border: 1px solid rgba(214, 166, 74, .35);
  border-radius: 999px;
  background: rgba(10, 6, 3, .88);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .6);
}

.gemth-mcard.gemth-is-unlocked .gemth-mcard__state {
  color: #2a1706;
  font-weight: 600;
  background: var(--grad-gold);
  border-color: #fbe3a3;
}

.gemth-mcard__number {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ลายพวงหรีดจาง ๆ รองหลังไอคอนไอเทม */
.gemth-mcard__emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  margin: 8px 0 18px;
  isolation: isolate;
}

.gemth-mcard__emblem::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/item-emblem.webp") center / contain no-repeat;
  opacity: .14;
  filter: sepia(.4) saturate(.8);
}

.gemth-mcard.gemth-is-unlocked .gemth-mcard__emblem::before { opacity: .2; }

.gemth-mcard__icon {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .6));
}

.gemth-mcard__reward {
  margin-top: auto;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.gemth-mcard__reward span { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; }

.gemth-campaign__cta { text-align: center; margin-top: 44px; }
.gemth-campaign__cta .gemth-btn-art { width: min(320px, 82vw); }
.gemth-campaign__note { margin-top: 10px; font-size: 13px; color: var(--ink-2); }

/* ---------- 8.5 News & quick menu ---------- */
.gemth-news__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: start;
}

.gemth-news__main { min-width: 0; }

/* ----- แบนเนอร์ไฮไลต์ 16:9 ----- */
.gemth-hlbanner {
  position: relative;
  padding: 10px;
  border: 1px solid transparent;
  border-image: url("../img/card-locked.webp") 34 34 42 34 fill / 16px 16px 20px 16px / 0 stretch;
}

.gemth-hlbanner__viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 3px;
  background: #0b0704;
}

.gemth-hlbanner__track { position: absolute; inset: 0; }

/* สลับสไลด์ด้วย opacity ล้วน — ไม่ขยับ layout จึงไม่มีการคำนวณตำแหน่งใหม่ทุกเฟรม */
.gemth-hlbanner__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .55s ease, visibility .55s ease;
}

.gemth-hlbanner__slide.gemth-is-active { opacity: 1; visibility: visible; }

.gemth-hlbanner__link { display: block; height: 100%; }

.gemth-hlbanner__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gemth-hlbanner__caption {
  position: absolute;
  inset: auto 0 0 0;
  display: block;
  padding: 44px 22px 18px;
  background: linear-gradient(180deg, rgba(10, 6, 3, 0) 0%, rgba(10, 6, 3, .82) 55%, rgba(10, 6, 3, .96) 100%);
}

.gemth-hlbanner__eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

.gemth-hlbanner__title {
  display: block;
  margin-top: 3px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.4;
  color: #fff7e6;
}

.gemth-hlbanner__link:hover .gemth-hlbanner__title { color: var(--gold-hi); }

.gemth-hlbanner__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: rgba(10, 6, 3, .7);
  color: var(--gold-hi);
  font-size: 18px;
  opacity: 0;
  transition: opacity .2s ease, background-color .2s ease;
}

.gemth-hlbanner__nav--prev { left: 12px; }
.gemth-hlbanner__nav--next { right: 12px; }

.gemth-hlbanner:hover .gemth-hlbanner__nav,
.gemth-hlbanner__nav:focus-visible { opacity: 1; }
.gemth-hlbanner__nav:hover { background: rgba(214, 166, 74, .3); }

.gemth-hlbanner__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.gemth-hlbanner__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.gemth-hlbanner__dot.gemth-is-active { background: var(--grad-gold); transform: scale(1.25); }

/* ----- ลิสต์ข่าว ----- */
.gemth-newslist {
  margin-top: 24px;
  border: 1px solid var(--gold-faint);
  border-radius: 4px;
  background: rgba(18, 11, 5, .55);
}

.gemth-newslist__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--gold-faint);
  background: linear-gradient(90deg, rgba(120, 78, 30, .5), rgba(48, 30, 13, .25));
}

.gemth-newslist__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 20px;
  color: #fff7e6;
}

.gemth-newslist__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.gemth-newslist__more {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: auto;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(10, 6, 3, .35);
  color: var(--gold-hi);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.gemth-newslist__more i {
  font-size: 12px;
  transition: translate .2s ease;
}

.gemth-newslist__more:hover,
.gemth-newslist__more:focus-visible {
  color: #fff7e6;
  border-color: #fbe3a3;
  background: rgba(120, 78, 30, .4);
}

.gemth-newslist__more:hover i { translate: 2px 0; }

.gemth-newslist__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.gemth-newslist__chip {
  padding: 5px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.gemth-newslist__chip:hover { color: var(--gold-hi); }

.gemth-newslist__chip.gemth-is-active {
  color: #2a1706;
  font-weight: 600;
  background: var(--grad-gold);
  border-color: #fbe3a3;
}

.gemth-newslist__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.gemth-newscard {
  border: 1px solid var(--gold-faint);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(18, 11, 5, .9);
  transition: border-color .2s ease, translate .2s ease, box-shadow .2s ease;
}

.gemth-newscard[hidden] { display: none; }

.gemth-newscard:hover {
  translate: 0 -3px;
  border-color: var(--gold-line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5);
}

.gemth-newscard__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* thumb 16:9 เต็มความกว้างการ์ด แล้วหัวข้อเรียงลงมาด้านล่าง */
.gemth-newscard__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b0704;
}

.gemth-newscard__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.gemth-newscard__link:hover .gemth-newscard__thumb img { transform: scale(1.06); }

/* ไล่เฉดมืดขอบล่างของ thumb ให้ต่อเนื่องกับตัวการ์ด ไม่เป็นรอยตัดแข็ง ๆ */
.gemth-newscard__thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(180deg, rgba(18, 11, 5, 0) 0%, rgba(18, 11, 5, .85) 100%);
  pointer-events: none;
}

.gemth-newscard__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
  padding: 12px 14px 13px;
}

/* ป้ายหมวดลอยทับมุมบนซ้ายของ thumb */
.gemth-newscard__tag {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
  padding: 2px 10px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--gold-hi);
  background: rgba(10, 6, 3, .8);
  backdrop-filter: blur(2px);
}

.gemth-newscard__tag--promotion { color: #ffcf8a; border-color: rgba(246, 201, 110, .6); }
.gemth-newscard__tag--notice    { color: #ffb9a4; border-color: rgba(255, 138, 115, .45); }
.gemth-newscard__tag--update    { color: #a9d4ff; border-color: rgba(120, 175, 235, .45); }

.gemth-newscard__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  /* จองที่ไว้ 2 บรรทัดเสมอ แล้วตัดที่ 2 บรรทัด — หัวข้อสั้นหรือยาวการ์ดก็สูงเท่ากัน
     ถ้าไม่จอง min-height ไว้ แถวที่หัวข้อสั้นจะเตี้ยกว่าแถวอื่นจนกริดดูเหลื่อม */
  min-height: 3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gemth-newscard__link:hover .gemth-newscard__title { color: var(--gold-hi); }

.gemth-newscard__time {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.gemth-newslist__empty { padding: 34px 18px; text-align: center; color: var(--muted); }

/* ----- skeleton ขณะโหลดข่าวจาก WordPress ----- */
@keyframes gemth-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gemth-skeleton {
  display: block;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .11) 50%, rgba(255, 255, 255, .05) 75%);
  background-size: 200% 100%;
  animation: gemth-skeleton-shimmer 1.35s ease infinite;
}

.gemth-skeleton--banner {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.gemth-newscard--skeleton { pointer-events: none; }

.gemth-newscard--skeleton .gemth-newscard__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gemth-skeleton--thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 0;
}

.gemth-newscard--skeleton .gemth-newscard__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 16px;
}

.gemth-skeleton--title {
  height: 16px;
  width: 92%;
}

.gemth-skeleton--date {
  height: 13px;
  width: 42%;
}

.gemth-hlbanner__slide--skeleton .gemth-skeleton--banner {
  position: absolute;
  inset: 0;
}

@media (prefers-reduced-motion: reduce) {
  .gemth-skeleton { animation: none; }
}

/* ----- เมนูลัดด้านขวา -----
   ปุ่มเป็นไฟล์ภาพสำเร็จจาก Figma (กรอบ + ตัวหนังสือ + ตัวละคร อยู่ในรูปแล้ว)
   CSS จึงเหลือแค่การจัดวาง ระยะกลุ่ม และเอฟเฟกต์ hover
   ข้อความอยู่ใน alt ของ <img> เพื่อให้ screen reader กับ SEO ยังอ่านได้ */
.gemth-qmenu { display: flex; flex-direction: column; gap: 22px; }

.gemth-qmenu__group { display: flex; flex-direction: column; gap: 10px; }

.gemth-qmenu__btn {
  display: block;
  line-height: 0;
  border-radius: 6px;
  /* ใช้ translate แยกจาก transform ตามแบบเดียวกับปุ่มอื่นในหน้านี้ */
  transition: translate .2s ease, filter .2s ease;
}

.gemth-qmenu__img {
  display: block;
  width: 100%;
  height: auto;
}

/* ป้ายไทล์มีไว้สำหรับจอเล็กเท่านั้น จอใหญ่ใช้ภาพปุ่มจาก Figma */
.gemth-qmenu__label { display: none; }

.gemth-qmenu__btn:hover,
.gemth-qmenu__btn:focus-visible {
  translate: 0 -2px;
  filter: brightness(1.08) drop-shadow(0 0 14px rgba(246, 201, 110, .45));
}

/* ---------- 9. Characters ---------- */
.gemth-char-tabs__nav-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
  scroll-snap-type: x proximity;
  padding: 6px 4px 10px;
  margin-bottom: 22px;
}

.gemth-char-tabs__nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  min-width: max-content;
  margin: 0;
  /* safe center = จัดกลางเมื่อพอดีจอ แต่ชิดซ้ายเมื่อล้น
     (กัน tab แรกหลุดออกนอกพื้นที่จนเลื่อน/กดไม่ได้) */
  justify-content: center;
  justify-content: safe center;
}

.gemth-char-tabs__nav .nav-item { display: flex; }

.gemth-char-tab {
  scroll-snap-align: center;
  min-width: 168px;
  padding: 8px 18px 8px 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: linear-gradient(180deg, rgba(40, 26, 14, .85), rgba(20, 13, 7, .9));
  border: 1px solid rgba(214, 166, 74, .35);
  border-radius: 3px;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, translate .2s ease;
}

.gemth-char-tab:hover { border-color: var(--gold); translate: 0 -2px; }

/* หน้าตัวละครในปุ่ม */
.gemth-char-tab__face {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(214, 166, 74, .55), rgba(138, 90, 28, .55));
  transition: background .2s ease, box-shadow .2s ease;
}

.gemth-char-tab__face img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(.55) brightness(.8);
  transition: filter .2s ease;
}

.gemth-char-tab:hover .gemth-char-tab__face img { filter: grayscale(.2) brightness(.95); }

.gemth-char-tab__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gemth-char-tab__class {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}

.gemth-char-tab__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.5;
}

.gemth-char-tab.active {
  border-color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(120, 78, 30, .75), rgba(48, 30, 13, .9));
  box-shadow: 0 0 0 1px rgba(246, 217, 143, .35), 0 0 18px rgba(246, 201, 110, .35), inset 0 0 14px rgba(246, 201, 110, .2);
}

.gemth-char-tab.active .gemth-char-tab__class { color: var(--gold-hi); }
.gemth-char-tab.active .gemth-char-tab__name { color: #fff7e6; }
.gemth-char-tab.active .gemth-char-tab__face { background: var(--grad-gold); box-shadow: 0 0 12px rgba(246, 201, 110, .55); }
.gemth-char-tab.active .gemth-char-tab__face img { filter: none; }

.gemth-char-panel {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
  background: linear-gradient(135deg, rgba(34, 22, 12, .95), rgba(16, 10, 5, .96));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

/* กรอบลวดลายทอง วาดทับด้านบนสุด เพื่อไม่ให้รูปตัวละครบังมุมกรอบ */
.gemth-char-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid transparent;
  border-image: url("../img/frame-ornament.webp") 180 / 44px / 0 stretch;
  pointer-events: none;
}

.gemth-char-panel__art {
  position: relative;
  margin: 0;
  min-height: 460px;
  overflow: hidden;
}

.gemth-char-panel__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
}

.gemth-char-panel__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 10, 5, 0) 70%, rgba(20, 13, 7, .9) 100%);
}

.tab-pane.active .gemth-char-panel__art img { animation: art-in .7s ease-out both; }

@keyframes art-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: none; }
}

.gemth-char-panel__info { padding: 38px 44px 36px 30px; }

.gemth-char-panel__class {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.gemth-char-panel__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 50px);
  line-height: 1.15;
  letter-spacing: .05em;
  margin-top: 2px;
}

.gemth-char-panel__slogan {
  margin: 6px 0 16px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 19px;
  color: #fff7e6;
}

.gemth-char-panel__story p {
  font-size: 14.5px;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.gemth-char-panel__quote {
  margin: 16px 0 0;
  padding: 10px 16px;
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(214, 166, 74, .2), rgba(214, 166, 74, 0));
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 16px;
  color: var(--gold-hi);
}

.gemth-char-panel__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 48px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--gold-faint);
}

.gemth-char-panel__stats dt {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.gemth-char-panel__stats dd { margin: 2px 0 0; font-size: 15px; font-weight: 500; color: var(--ink); }

/* ---------- 9.5 Ranking ---------- */
/* คุมคอลัมน์ทั้งหัวตารางและทุกแถวจากตัวแปรเดียว แก้ทีเดียวขยับพร้อมกัน */
.gemth-rank {
  --rank-cols: 96px minmax(0, 1.25fr) minmax(0, 1fr) 132px 132px;
}

.gemth-rank__tabsets {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 34px;
  justify-content: center;
  margin-bottom: 22px;
}

.gemth-rank__tabset { display: flex; align-items: center; gap: 12px; }

.gemth-rank__tabset-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.gemth-rank__tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.gemth-rank__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 108px;
  padding: 8px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(38, 23, 10, .9), rgba(22, 14, 6, .9));
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.gemth-rank__tab-th { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.3; }

.gemth-rank__tab-en {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

.gemth-rank__tab:hover { color: var(--gold-hi); border-color: var(--gold); }

.gemth-rank__tab.gemth-is-active {
  color: #2a1706;
  background: var(--grad-gold);
  border-color: #fbe3a3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 16px rgba(246, 201, 110, .35);
}

.gemth-rank__tab.gemth-is-active .gemth-rank__tab-en { color: rgba(42, 23, 6, .75); }

/* ----- กรอบตาราง ----- */
.gemth-rank__panel {
  border: 1px solid transparent;
  border-image: url("../img/card-locked.webp") 34 34 42 34 fill / 16px 16px 20px 16px / 0 stretch;
  padding: 14px;
}

.gemth-rank__head,
.gemth-rank__row {
  display: grid;
  grid-template-columns: var(--rank-cols);
  align-items: center;
  gap: 12px;
}

.gemth-rank__head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 16px;
  background: linear-gradient(180deg, #211408 0%, #1b1007 100%);
  border-bottom: 1px solid var(--gold-line);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* กล่องเลื่อน — 20 อันดับไม่ดันหน้าให้ยาวเกินไป */
.gemth-rank__scroll {
  max-height: 560px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
}

.gemth-rank__scroll::-webkit-scrollbar { width: 8px; }
.gemth-rank__scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, .35); }
.gemth-rank__scroll::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 999px; }

.gemth-rank__row {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(214, 166, 74, .12);
  transition: background-color .2s ease;
}

.gemth-rank__row:last-child { border-bottom: 0; }
.gemth-rank__row:nth-child(even) { background: rgba(214, 166, 74, .04); }
.gemth-rank__row:hover { background: rgba(214, 166, 74, .1); }

/* จัดกลางคอลัมน์ ให้เลข 4 ลงไปตรงแนวกับเหรียญ 1–3 */
.gemth-rank__c-rank {
  display: flex;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.gemth-rank__c-name { font-weight: 600; font-size: 16px; color: var(--ink); }
.gemth-rank__c-family,
.gemth-rank__c-class { font-size: 15px; color: var(--ink-2); }

.gemth-rank__c-score {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  background: var(--grad-gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gemth-rank__head .gemth-rank__c-score { text-align: right; }

/* ----- 3 อันดับแรก ----- */
.gemth-rank__row--top { padding: 14px 16px; }

.gemth-rank__row--top .gemth-rank__c-name { font-size: 18px; color: #fff7e6; }

/* ภาพเหรียญ 192px ย่อลงแสดงที่ 44px — จอความละเอียดสูงยังคม */
.gemth-rank__medal {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55));
}

.gemth-rank__row--1 { background: linear-gradient(90deg, rgba(214, 166, 74, .26), rgba(214, 166, 74, .05) 70%); }
.gemth-rank__row--2 { background: linear-gradient(90deg, rgba(198, 202, 210, .2), rgba(198, 202, 210, .04) 70%); }
.gemth-rank__row--3 { background: linear-gradient(90deg, rgba(186, 120, 62, .22), rgba(186, 120, 62, .04) 70%); }

.gemth-rank__note { margin-top: 12px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- 10. Feature carousel ---------- */
.gemth-fcarousel {
  position: relative;
  --slide-w: min(780px, 68vw);
  --peek: 68%;
  --nav-w: 46px;     /* ความกว้างปุ่มลูกศร */
  --nav-gap: 18px;   /* ระยะห่างจากขอบการ์ด active */
  padding: 0 clamp(16px, 5vw, 72px);
}

.gemth-fcarousel__stage {
  position: relative;
  height: calc(var(--slide-w) * 500 / 1024);
  overflow: hidden;
}

.gemth-fslide {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--slide-w);
  transform: translateX(-50%) scale(.7);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: transform .85s cubic-bezier(.22, .61, .36, 1), opacity .85s ease, filter .85s ease;
}

.gemth-fslide__banner {
  position: relative;
  aspect-ratio: 1024 / 500;
  overflow: hidden;
  border: 2px solid #b8893f;
  outline: 1px solid rgba(246, 217, 143, .35);
  outline-offset: 3px;
  background: var(--bg-2);
}

.gemth-fslide__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gemth-fslide[data-pos="0"] {
  transform: translateX(-50%) scale(1);
  opacity: 1;
  z-index: 3;
  pointer-events: auto;
}

.gemth-fslide[data-pos="0"] .gemth-fslide__banner {
  box-shadow: 0 0 0 1px rgba(246, 217, 143, .5), 0 0 34px rgba(246, 201, 110, .35), 0 20px 50px rgba(0, 0, 0, .6);
}

.gemth-fslide[data-pos="-1"],
.gemth-fslide[data-pos="1"] {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
  filter: brightness(.5) saturate(.85);
}

.gemth-fslide[data-pos="-1"] { transform: translateX(calc(-50% - var(--peek))) translateY(8%) scale(.8); }
.gemth-fslide[data-pos="1"]  { transform: translateX(calc(-50% + var(--peek))) translateY(8%) scale(.8); }

.gemth-fslide[data-pos="-1"]:hover,
.gemth-fslide[data-pos="1"]:hover { filter: brightness(.7); }

.gemth-fcarousel__nav {
  position: absolute;
  top: calc(var(--slide-w) * 9 / 32);
  z-index: 5;
  width: var(--nav-w);
  height: calc(var(--nav-w) * 1.66);
  padding: 0;
  border: 0;
  background: none;
  translate: 0 -50%;
  transition: filter .2s ease, translate .2s ease;
}

.gemth-fcarousel__nav img { width: 100%; height: 100%; object-fit: contain; }

.gemth-fcarousel__nav:hover,
.gemth-fcarousel__nav:focus-visible { filter: brightness(1.15) drop-shadow(0 0 10px rgba(246, 201, 110, .6)); }

/* วางชิดขอบซ้าย/ขวาของการ์ด active (กึ่งกลางจอ ± ครึ่งความกว้างการ์ด)
   max(4px, …) กันลูกศรหลุดขอบจอบนหน้าจอแคบ */
.gemth-fcarousel__nav--prev { left: max(4px, calc(50% - var(--slide-w) / 2 - var(--nav-gap) - var(--nav-w))); }
.gemth-fcarousel__nav--next { right: max(4px, calc(50% - var(--slide-w) / 2 - var(--nav-gap) - var(--nav-w))); }
.gemth-fcarousel__nav--prev:hover { translate: -3px -50%; }
.gemth-fcarousel__nav--next:hover { translate: 3px -50%; }

.gemth-fcarousel__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.gemth-fcarousel__dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  transition: width .25s ease, background-color .25s ease;
}

.gemth-fcarousel__dot:hover { background: rgba(214, 166, 74, .35); }

.gemth-fcarousel__dot.gemth-is-active {
  width: 30px;
  background: var(--grad-gold);
  border-color: var(--gold-hi);
}

/* ---------- 11. Footer ---------- */
.gemth-footer {
  background: #0c0804;
  border-top: 1px solid rgba(214, 166, 74, .3);
  padding: 34px 16px 30px;
}

.gemth-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gold-faint);
}

.gemth-footer__brand img { height: 46px; width: auto; }

.gemth-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  font-size: 14px;
}

.gemth-footer__links li + li::before {
  content: "·";
  margin: 0 12px;
  color: var(--muted);
}

.gemth-footer__links a { color: var(--ink-2); }
.gemth-footer__links a:hover { color: var(--gold-hi); }

.gemth-footer__social { display: flex; gap: 10px; }

.gemth-footer__social a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  color: var(--gold-hi);
  transition: background-color .2s ease, color .2s ease;
}

.gemth-footer__social a:hover { background: var(--grad-gold); color: #2a1706; }

.gemth-footer__ci {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  margin-inline: auto;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  text-align: center;
}

.gemth-footer__ci img {
  display: block;
  width: min(493px, 100%);
  height: auto;
  margin: 0 auto 12px;
}

.gemth-footer__ci p { margin: 0; }

/* ---------- 12. Modals ---------- */
.modal-backdrop.show { opacity: .78; }

.gemth-modal .modal-dialog { max-width: 520px; }

.gemth-modal .modal-content {
  position: relative;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  border-image: url("../img/frame-panel.webp") 180 fill / 64px / 0 stretch;
  padding: 50px 50px 42px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}

.gemth-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: var(--gold-hi);
  font-size: 15px;
  transition: background-color .2s ease;
}

.gemth-modal__close:hover { background: rgba(214, 166, 74, .25); }

.gemth-modal__head { text-align: center; margin-bottom: 22px; }

.gemth-modal__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.35;
  color: #fff7e6;
}

.gemth-modal__sub { margin-top: 6px; font-size: 14px; color: var(--ink-2); }

.gemth-field + .gemth-field { margin-top: 16px; }

.gemth-field__label {
  display: block !important;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--gold-hi) !important;
  text-transform: none !important;
}

.gemth-req { color: var(--danger); }

.gemth-field__control { position: relative; }

.gemth-field__control i {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  color: var(--gold) !important;
  font-size: 16px;
  line-height: 1 !important;
  pointer-events: none;
}

/* ธีม Newspaper ใส่พื้นขาว ขอบเทา และความสูงคงที่ให้ input[type=email]/tel
   จึงล็อกทุกค่าที่ทำให้ช่องกรอกไม่ตรงกับหน้า index */
.gemth-field__input {
  --field-fs: 15px;
  --field-py: 12px;
  --field-pl: 42px;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: var(--field-py) 14px var(--field-py) var(--field-pl) !important;
  text-indent: 0 !important;
  font-family: var(--font-body) !important;
  font-size: var(--field-fs) !important;
  font-weight: 400 !important;
  font-style: normal !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: var(--ink) !important;
  background: rgba(0, 0, 0, .45) !important;
  background-image: none !important;
  border: 1px solid rgba(214, 166, 74, .38) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.gemth-field__input::placeholder {
  color: rgba(212, 195, 166, .45) !important;
  opacity: 1 !important;
  font-style: normal !important;
}

.gemth-field__input:hover,
.gemth-field__input:focus {
  color: var(--ink) !important;
  background: rgba(0, 0, 0, .45) !important;
  background-image: none !important;
}

.gemth-field__input:focus {
  border-color: var(--gold-hi) !important;
  box-shadow: 0 0 0 3px rgba(214, 166, 74, .22) !important;
  outline: none !important;
}

.gemth-field__input.gemth-is-invalid { border-color: var(--danger) !important; }
.gemth-field__input.gemth-is-invalid:focus { box-shadow: 0 0 0 3px rgba(255, 138, 115, .2) !important; }

.gemth-field__input:-webkit-autofill,
.gemth-field__input:-webkit-autofill:hover,
.gemth-field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px #140e09 inset !important;
  transition: background-color 9999s ease-out;
}

.gemth-email-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.gemth-email-row__local {
  flex: 1 1 55%;
  min-width: 0;
}

.gemth-email-row__domain {
  flex: 1 1 45%;
  min-width: 0;
}

.gemth-email-row__domain .gemth-field__input {
  --field-pl: 12px;
  padding-right: 34px !important;
  cursor: pointer;
}

.gemth-email-row__domain::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gold);
  pointer-events: none;
  transition: border-top-color .2s ease;
}

.gemth-email-row__domain:focus-within::after {
  border-top-color: var(--gold-hi);
}

.gemth-email-row__domain:has(.gemth-is-invalid)::after {
  border-top-color: var(--danger);
}

.gemth-field__select {
  color-scheme: dark;
  background-color: rgba(0, 0, 0, .45) !important;
  color: var(--ink) !important;
}

.gemth-field__select:invalid {
  color: rgba(212, 195, 166, .45) !important;
}

.gemth-field__input.gemth-field__select:hover,
.gemth-field__input.gemth-field__select:focus {
  color: var(--ink) !important;
  background: rgba(0, 0, 0, .52) !important;
  background-image: none !important;
}

.gemth-field__input.gemth-field__select:hover {
  border-color: rgba(214, 166, 74, .55) !important;
}

.gemth-field__select option,
.gemth-field__select optgroup {
  background-color: var(--bg-2);
  color: var(--ink);
}

.gemth-field__select optgroup {
  color: var(--gold-hi);
  font-weight: 600;
  font-style: normal;
}

.gemth-field__select option:checked {
  background: linear-gradient(180deg, rgba(214, 166, 74, .28) 0%, rgba(138, 90, 28, .35) 100%);
  color: var(--gold-hi);
}

.gemth-field__hint { margin-top: 5px; font-size: 12px; color: var(--muted); }
.gemth-field__error { margin-top: 5px; font-size: 13px; color: var(--danger); }

.gemth-pdpa {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--gold-faint);
  border-radius: 4px;
  background: rgba(0, 0, 0, .3);
}

.gemth-pdpa__check {
  position: relative;
  display: flex;
  gap: 12px;
  cursor: pointer;
}

.gemth-pdpa__check input {
  position: absolute !important;
  opacity: 0 !important;
  width: 20px !important;
  height: 20px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.gemth-pdpa__box {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: rgba(0, 0, 0, .4);
  color: #2a1706;
  font-size: 14px;
  transition: background-color .15s ease;
}

.gemth-pdpa__box i { opacity: 0; transition: opacity .15s ease; }

.gemth-pdpa__check input:checked + .gemth-pdpa__box { background: var(--grad-gold); border-color: var(--gold-hi); }
.gemth-pdpa__check input:checked + .gemth-pdpa__box i { opacity: 1; }
.gemth-pdpa__check input:focus-visible + .gemth-pdpa__box { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.gemth-pdpa__check input.gemth-is-invalid + .gemth-pdpa__box { border-color: var(--danger); }

.gemth-pdpa__text { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.gemth-pdpa__text a { text-decoration: underline; }

.gemth-modal__foot {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* success */
.gemth-modal--success .modal-content { text-align: center; }

.gemth-success__icon {
  width: 72px;
  height: 72px;
  margin: 4px auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-gold);
  color: #2a1706;
  font-size: 38px;
  box-shadow: 0 0 0 6px rgba(214, 166, 74, .18), 0 0 30px rgba(246, 201, 110, .5);
  animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.gemth-success__text { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }
.gemth-success__text strong { color: var(--gold-hi); font-weight: 600; }

/* .modal-content เป็น flex column → eyebrow ถูกยืดเต็มกว้างแล้วชิดซ้าย จึงจัดกลางเอง */
.gemth-modal--success .gemth-eyebrow { align-self: center; }

.gemth-success__hint { margin-top: 18px; font-size: 13px; color: var(--muted); }

.gemth-success__actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 13. Responsive ---------- */

/* จอใหญ่ (desktop): ขยายภาพรวมตัวหนังสือทั้งหน้า
   กติกา — ตัวหนังสือที่เล็กที่สุดของเว็บนี้ต้องไม่ต่ำกว่า 16px
   (เขียนรวมไว้ที่เดียวเพื่อให้ตรวจ/ปรับสเกลทั้งหน้าได้จากบล็อกเดียว) */
@media (min-width: 1200px) {
  /* section ข่าวสาร */
  .gemth-hlbanner__eyebrow  { font-size: 16px; }
  .gemth-hlbanner__title    { font-size: clamp(21px, 1.5vw, 24px); }
  .gemth-newslist__title    { font-size: 22px; }
  .gemth-newslist__more     { font-size: 14px; padding: 6px 14px; }
  .gemth-newslist__chip     { font-size: 16px; padding: 6px 15px; }
  .gemth-newscard__tag      { font-size: 16px; }
  .gemth-newscard__title    { font-size: 17px; }
  .gemth-newscard__time     { font-size: 16px; }
  .gemth-newslist__empty    { font-size: 17px; }
  .gemth-hlbanner__nav      { font-size: 20px; }
  .gemth-hero__badge,
  .gemth-hero__store--pc    { --badge-h: 54px; }
  .gemth-hero__stores--lg .gemth-hero__badge,
  .gemth-hero__stores--lg .gemth-hero__store--pc { --badge-h: 68px; }
  .gemth-hero__stores-label { font-size: 20px; }

  /* section ranking */
  .gemth-rank__tabset-label { font-size: 16px; }
  .gemth-rank__tab-th       { font-size: 18px; }
  .gemth-rank__tab-en       { font-size: 16px; }
  .gemth-rank__head         { font-size: 16px; }
  .gemth-rank__c-rank       { font-size: 19px; }
  .gemth-rank__c-name       { font-size: 18px; }
  .gemth-rank__c-family,
  .gemth-rank__c-class      { font-size: 17px; }
  .gemth-rank__c-score      { font-size: 19px; }
  .gemth-rank__note         { font-size: 16px; }
  .gemth-rank__row--top .gemth-rank__c-name { font-size: 20px; }
  .gemth-rank__medal        { width: 56px; height: 56px; }
  body    { font-size: 17px; }
  .gemth-section { font-size: 17px; }

  /* ปุ่ม */
  .gemth-btn-gold,
  .gemth-btn-line { font-size: 17px; padding: 13px 24px; }
  .gemth-btn-gold--sm,
  .gemth-btn-line--sm { font-size: 16px; padding: 11px 20px; }
  .gemth-btn-sound { width: 46px; height: 46px; padding: 0; font-size: 21px; }

  /* หัวข้อ section */
  .gemth-eyebrow       { font-size: 16px; }
  .gemth-section__title { font-size: clamp(40px, 3.6vw, 50px); }
  .gemth-section__desc  { font-size: 18px; }

  .gemth-platforms__item { font-size: clamp(20px, 1.5vw, 23px); }
  .gemth-platforms__note { font-size: 17px; }

  .gemth-social-rail__item::after { font-size: 16px; }

  /* counter */
  .gemth-counter        { max-width: 680px; }
  .gemth-counter__label { font-size: 18px; }
  .gemth-counter__value { font-size: clamp(60px, 6vw, 72px); }
  .gemth-counter__unit  { font-size: 20px; }
  .gemth-counter__scale span { font-size: 16px; }

  /* milestone cards */
  .gemth-mcard              { padding: 22px 14px 24px; }
  .gemth-mcard__step        { font-size: 16px; letter-spacing: .1em; }
  .gemth-mcard__state       { font-size: 16px; padding: 4px 14px; }
  .gemth-mcard__number      { font-size: clamp(32px, 2.4vw, 38px); }
  .gemth-mcard__reward      { font-size: 18px; }
  .gemth-mcard__reward span { font-size: 16px; }
  .gemth-campaign__note     { font-size: 18px; }

  /* characters */
  .gemth-char-tab__class      { font-size: 16px; letter-spacing: .08em; }
  .gemth-char-tab__name       { font-size: 20px; }
  .gemth-char-panel__class    { font-size: 16px; }
  .gemth-char-panel__name     { font-size: clamp(50px, 4.4vw, 58px); }
  .gemth-char-panel__slogan   { font-size: 23px; }
  .gemth-char-panel__story p  { font-size: 17px; }
  .gemth-char-panel__quote    { font-size: 19px; }
  .gemth-char-panel__stats dt { font-size: 16px; letter-spacing: .12em; }
  .gemth-char-panel__stats dd { font-size: 18px; }

  /* footer */
  .gemth-footer__links { font-size: 17px; }
  .gemth-footer__ci    { font-size: 16px; }

  /* modal / form */
  .gemth-modal__close { font-size: 17px; width: 40px; height: 40px; }
  .gemth-modal__title { font-size: 32px; }
  .gemth-modal__sub   { font-size: 16px; }
  .gemth-modal__foot  { font-size: 16px; }
  .gemth-field__label    { font-size: 16px; }
  .gemth-field__input    { --field-fs: 17px; --field-py: 13px; --field-pl: 44px; }
  .gemth-field__control i { font-size: 18px; }
  .gemth-field__hint,
  .gemth-field__error    { font-size: 16px; }
  .gemth-pdpa__text      { font-size: 16px; }
  .gemth-pdpa__box       { font-size: 16px; }
  .gemth-success__text   { font-size: 18px; }
  .gemth-success__hint   { font-size: 16px; }
}

@media (max-width: 1199.98px) {
  .gemth-news__layout { grid-template-columns: minmax(0, 1fr) 272px; gap: 20px; }
  .gemth-mcard { --w: calc((100% - 18px * 2) / 3); max-width: 240px; }
  .gemth-fcarousel { --slide-w: min(720px, 72vw); --peek: 64%; }
}

@media (max-width: 991.98px) {
  /* เครื่องจอเล็กโหลด PC Client ไปก็ใช้ไม่ได้ ซ่อนปุ่มไปเลย */
  .gemth-hero__store--pc { display: none; }

  /* จอกลางลงมา: เมนูยุบเป็นแฮมเบอร์เกอร์ กางเป็นแผงใต้ top bar */
  .gemth-topnav__burger {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--gold-line);
    border-radius: 4px;
    background: rgba(10, 6, 3, .35);
    color: var(--gold-hi);
    font-size: 20px;
    cursor: pointer;
  }

  .gemth-topnav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 10px 14px 14px;
    border-bottom: 1px solid var(--gold-line);
    background: rgba(12, 8, 4, .98);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .55);
    max-height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
  }

  .gemth-topnav.gemth-is-open { display: block; }
  .gemth-topnav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .gemth-topnav__link { width: 100%; justify-content: space-between; padding: 11px 12px; }

  .gemth-topnav__sub {
    position: static;
    min-width: 0;
    margin: 2px 0 4px 12px;
    border: 0;
    border-left: 1px solid var(--gold-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
  }


  /* จอกลาง: ตัดคอลัมน์คลาสออก เหลือข้อมูลที่จำเป็น */
  .gemth-rank { --rank-cols: 74px minmax(0, 1.3fr) minmax(0, 1fr) 108px; }
  .gemth-rank__c-class { display: none; }
  /* จอกลาง: เมนูลัดลงมาอยู่ใต้ข่าว แล้วเรียงเป็นกริด 2 ช่อง */
  .gemth-news__layout { grid-template-columns: minmax(0, 1fr); }
  /* จอเล็ก: เมนูลัดขึ้นก่อนเนื้อหาข่าว เพราะเป็นทางลัดที่คนกดบ่อยกว่า */
  .gemth-news__aside { order: -1; }

  /* ภาพปุ่มจาก Figma มีสัดส่วนคงที่ พอบีบเหลือ 3 คอลัมน์บนจอเล็กจะอ่านไม่ออก
     จึงสลับไปใช้ไทล์ CSS ไอคอน+ข้อความแทน แล้วเรียง 3 ช่องต่อแถว
     display:contents ที่กลุ่ม = ดันปุ่มทั้ง 7 ขึ้นมาอยู่ในกริดเดียวกัน */
  .gemth-qmenu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .gemth-qmenu__group { display: contents; }

  /* ปุ่มเติมเงินกินเต็มแถวและขึ้นก่อน — อีก 6 ปุ่มจึงลงตัวพอดี 2 แถวเต็ม
     (ถ้าปล่อยตามลำดับเดิมจะเหลือปุ่มโดดท้ายแถว) */
  .gemth-qmenu__cell--wide { grid-column: 1 / -1; order: -1; }

  /* เต็มแถวแล้ววางไอคอนกับข้อความเรียงแนวนอนสวยกว่าซ้อนกัน */
  .gemth-qmenu__cell--wide .gemth-qmenu__label { flex-direction: row; gap: 10px; padding: 11px 8px; }
  .gemth-qmenu__cell--wide .gemth-qmenu__label .bi { font-size: 22px; }
  .gemth-qmenu__cell--wide .gemth-qmenu__label-th { font-size: 16px; }

  .gemth-qmenu__img { display: none; }

  .gemth-qmenu__btn {
    display: flex;
    min-height: 100%;
    border: 1px solid var(--gold-line);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(38, 23, 10, .96), rgba(22, 14, 6, .96));
    box-shadow: inset 0 1px 0 rgba(246, 217, 143, .14);
    line-height: normal;
  }

  .gemth-qmenu__btn:hover,
  .gemth-qmenu__btn:focus-visible {
    translate: 0 -2px;
    border-color: var(--gold-hi);
    filter: none;
    box-shadow: inset 0 1px 0 rgba(246, 217, 143, .3), 0 0 14px rgba(246, 201, 110, .3);
  }

  .gemth-qmenu__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 8px 13px;
    text-align: center;
  }

  .gemth-qmenu__label .bi { font-size: 24px; line-height: 1; color: var(--gold-hi); }

  .gemth-qmenu__label-th {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    background: var(--grad-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* ปุ่มเติมเงินยังต้องเด่นกว่าเพื่อนเหมือนตอนเป็นภาพ */
  .gemth-qmenu__btn--accent {
    border-color: #fbe3a3;
    background: linear-gradient(180deg, #7a3f0c, #b4671a 55%, #dd9330);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 16px rgba(246, 201, 110, .3);
  }

  .gemth-qmenu__btn--accent .bi { color: #fff6de; }

  .gemth-qmenu__btn--accent .gemth-qmenu__label-th {
    background: linear-gradient(180deg, #fffdf6 0%, #fff4d2 55%, #ffe1a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(74, 34, 4, .9));
  }
  .gemth-section { padding: 80px 0 88px; }
  .gemth-social-rail { --rail-btn: 46px; left: 12px; }
  .gemth-social-rail__list { gap: 12px; padding: 12px 8px !important; }
  .gemth-social-rail__item { font-size: 19px; }

  /* จอเล็ก: แท็บตัวละครเป็น grid ตัดบรรทัดเอง — ไม่ล้นจอ กดได้ครบทุกตัว */
  .gemth-char-tabs__nav-wrap {
    overflow: visible;
    padding: 0;
    margin-bottom: 20px;
  }

  .gemth-char-tabs__nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  .gemth-char-tab { width: 100%; min-width: 0; padding: 8px 10px 8px 8px; gap: 10px; }

  .gemth-char-panel__info { padding: 30px 32px 30px 22px; }
  .gemth-char-panel__story p { font-size: 14px; }

  .gemth-fcarousel { --slide-w: min(680px, 78vw); --peek: 58%; }
}

@media (max-width: 767.98px) {

  /* มือถือ: แถวกลายเป็นการ์ด เลขอันดับอยู่ซ้าย ข้อมูลที่เหลือซ้อนลงมา */
  .gemth-rank__head { display: none; }
  .gemth-rank__tabsets { gap: 12px 20px; }
  .gemth-rank__tabset { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
  .gemth-rank__tabs { justify-content: center; }
  .gemth-rank__tab { flex: 1 1 0; min-width: 0; padding: 7px 10px; }

  .gemth-rank__row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas: 'medal name score' 'medal family score';
    gap: 2px 12px;
    padding: 12px 10px;
  }
  .gemth-rank__row .gemth-rank__c-rank   { grid-area: medal; }
  .gemth-rank__row .gemth-rank__c-name   { grid-area: name; }
  .gemth-rank__row .gemth-rank__c-family { grid-area: family; font-size: 14px; }
  .gemth-rank__row .gemth-rank__c-score  { grid-area: score; align-self: center; }
  .gemth-rank__panel { padding: 10px; border-image-width: 30px; }
  .gemth-rank__scroll { max-height: 460px; }
  .gemth-newslist__grid { grid-template-columns: minmax(0, 1fr); }
  .gemth-newslist__head { padding: 12px 14px; gap: 8px; }
  .gemth-newslist__toolbar { gap: 8px; }
  .gemth-newslist__more { font-size: 12px; padding: 4px 10px; margin-left: auto; }
  .gemth-newslist__more i { font-size: 11px; }
  .gemth-newslist__grid { gap: 14px; padding: 14px; }
  .gemth-newscard__body { padding: 11px 12px 12px; }
  .gemth-hlbanner { padding: 34px 8px 8px; }
  .gemth-hlbanner__caption { padding: 34px 14px 14px; }
  .gemth-hlbanner__nav { display: none; }
  body { font-size: 15px; }
  :root { --topbar-h: 58px; }

  .gemth-brand__logo { height: 36px; }
  .gemth-topbar__actions { gap: 8px; }

  .gemth-hero { --trio-w: min(760px, 132vw); padding-bottom: 40px; }
  .gemth-hero__cast { margin-left: 50%; transform: translateX(-50%); }
  .gemth-hero__body { --glow-size: 150vw; --glow-y: 58%; }
  .gemth-hero__sub { font-size: 16px; }
  .gemth-hero__sub--lg { font-size: 30px; }
  .gemth-platforms__item { padding: 2px 14px; font-size: 17px; }
  .gemth-platforms__note { font-size: 14px; }

  .gemth-section__frame { inset: 8px; }
  .gemth-section { padding: 64px 0 72px; }
  .gemth-characters { padding-bottom: 40px; }
  .gemth-section__head { margin-bottom: 32px; }

  .gemth-counter { padding: 22px 26px 20px; border-image-width: 30px; }

  .gemth-milestones { gap: 12px; }
  .gemth-mcard { --w: calc((100% - 12px) / 2); max-width: none; padding: 16px 10px 18px; }
  .gemth-mcard__emblem { width: 100px; height: 100px; margin: 6px 0 16px; }
  .gemth-mcard__icon { width: 58px; height: 58px; }
  .gemth-mcard__reward { font-size: 13px; }

  .gemth-char-panel { grid-template-columns: 1fr; }
  .gemth-char-panel::after { border-image-width: 30px; }
  .gemth-char-panel__art { min-height: 0; aspect-ratio: 4 / 3; }
  .gemth-char-panel__art img { object-position: 50% 12%; }
  .gemth-char-panel__art::after { background: linear-gradient(180deg, rgba(16, 10, 5, 0) 62%, rgba(20, 13, 7, .96) 100%); }
  .gemth-char-panel__info { padding: 4px 22px 28px; }
  .gemth-char-panel__slogan { font-size: 17px; }
  .gemth-char-panel__stats { gap: 12px 28px; }

  /* social rail -> แถบลอยด้านล่าง */
  .gemth-social-rail {
    left: 50%;
    top: auto;
    bottom: 12px;
    transform: translateX(-50%);
  }
  .gemth-social-rail__list { flex-direction: row; gap: 12px; padding: 8px 14px !important; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
  .gemth-social-rail__item { font-size: 19px; }
  .gemth-social-rail__item::after { display: none !important; }

  .gemth-footer { padding-bottom: 100px; }
  .gemth-stagebar { right: 10px; bottom: 76px; }
  .gemth-hero__stores { gap: 8px; }
  .gemth-hero__stores-row { gap: 9px; }
  .gemth-hero__stores-label { font-size: 16px; }
  .gemth-hero__badge,
  .gemth-hero__store--pc { --badge-h: 42px; }
  .gemth-hero__stores--lg .gemth-hero__badge,
  .gemth-hero__stores--lg .gemth-hero__store--pc { --badge-h: 50px; }
  .gemth-hero__store--pc { padding: 0 12px 0 10px; gap: 7px; }
  .gemth-hero__store--pc i { font-size: 22px; }
  .gemth-hero__store--pc .gemth-hero__store-main { font-size: 17px; }
  .gemth-hero__store--pc .gemth-hero__store-top { font-size: 10px; }
  .gemth-footer__top { flex-direction: column; align-items: center; text-align: center; }
  .gemth-footer__links { justify-content: center; }
  .gemth-footer__ci { text-align: center; }

  .gemth-fcarousel { --slide-w: 88vw; --peek: 52%; padding: 0; --nav-w: 32px; --nav-gap: 6px; }

  .gemth-modal .modal-content {
    border-image-width: 44px;
    padding: 44px 26px 32px;
  }
  .gemth-modal__title { font-size: 24px; }
}

@media (max-width: 575.98px) {
  .gemth-email-row { flex-direction: column; }

  .gemth-qmenu { gap: 8px; }
  .gemth-qmenu__label { padding: 10px 5px 11px; gap: 5px; }
  .gemth-qmenu__label .bi { font-size: 21px; }
  .gemth-qmenu__label-th { font-size: 12.5px; }
  /* ปุ่มลงทะเบียนแสดงข้อความตลอด ส่วนปุ่มไอคอนบีบให้เป็นสี่เหลี่ยมจัตุรัส */
  .gemth-btn-gold--sm { height: 40px; padding: 0 14px; font-size: 13px; }
  .gemth-btn-line--sm { width: 40px; height: 40px; padding: 0; font-size: 17px; }
  .gemth-btn-sound { width: 38px; height: 38px; font-size: 16px; }
  .gemth-btn-sound.gemth-is-off::after { width: 23px; }
  .gemth-topbar__actions { gap: 6px; }
  .gemth-brand__logo { height: 32px; }

  .gemth-char-tabs__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .gemth-char-tab { gap: 8px; padding: 6px 8px 6px 6px; }
  .gemth-char-tab__face { width: 40px; height: 40px; }
  .gemth-char-tab__class { font-size: 10px; letter-spacing: .08em; }
  .gemth-char-tab__name { font-size: 13px; letter-spacing: .03em; }

  /* จอแคบ: แถวแพลตฟอร์มตัดบรรทัด — ตัดเส้นคั่นออก ไม่งั้นตัวที่ขึ้นบรรทัดใหม่
     จะมีขีดค้างอยู่ข้างหน้าเหมือนเรนเดอร์พลาด ใช้ระยะห่างคั่นแทน */
  .gemth-platforms { gap: 4px 0; }
  .gemth-platforms__item { padding: 2px 12px; font-size: 16px; }
  .gemth-platforms__item + .gemth-platforms__item { border-left: 0; }

  .gemth-counter__scale span { font-size: 10px; }

  .gemth-success__actions .gemth-btn-gold,
  .gemth-success__actions .gemth-btn-line { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
