/* =====================================================================
   Cyfar-Ro — ธีมเมืองท่า Alberta (ฟ้า-ขาว-ทอง ให้เข้ากับวิดีโอปก)
   โครงไฟล์: 1) ตัวแปร  2) พื้นฐาน  3) ปุ่ม  4) Header  5) Hero
             6) Journey/ทะเล/สะพานท่าเรือ/ตัวละคร  7) Panel  8) แต่ละ section
             9) Footer  10) Modal  11) Responsive
   ===================================================================== */

/* ---------- 1) ตัวแปร (แก้สีทั้งเว็บได้ที่นี่) ---------- */
:root {
  /* พื้นกระดาษ/การ์ด โทนฟ้าอ่อน */
  --paper-50:  #f6fbff;
  --paper-100: #e8f3fc;
  --paper-200: #d2e6f7;
  --paper-300: #b4d4ef;
  --paper-400: #7fb3de;
  /* กรมท่า (ตัวหนังสือ/กรอบ) */
  --navy-700: #1d4f80;
  --navy-800: #143a62;
  --navy-900: #0b2340;
  --ink: #12304f;
  --muted: #4f6e8e;
  /* สีเน้น */
  --coral: #e2593b;
  --sea: #1f86c7;
  --sea-light: #4fb6ea;
  --sea-dark: #0f5a8c;
  --gold: #f2b33d;
  --gold-light: #ffd978;
  --gold-dark: #a8641a;
  --green: #22915a;
  /* ไม้ (กล่อง/กระบะดอกไม้) */
  --wood: #b98552;
  --wood-dark: #7a4f2a;

  --font-head: 'Kanit', system-ui, sans-serif;
  --font-body: 'Sarabun', system-ui, sans-serif;

  --header-h: 64px;
  /* ตำแหน่งกึ่งกลางทางเดินปูหิน (ทางเดินของตัวละคร) */
  --road-x: calc(50% - 423px);
  --path-w: 200px;
  --k: 1;            /* ขนาดบ้าน/ต้นไม้ในแถวบ้าน (มือถือย่อลง) */
  --panel-left: calc(50% - 258px);
  --radius: 16px;

  /* ลายเชือกเรือ (ใช้แทนลายกระเบื้องเดิม) */
  --rope: repeating-linear-gradient(-60deg, #f3dca6 0 4px, #c9974f 4px 7px, #a8763a 7px 8px);
}

/* ---------- 2) พื้นฐาน ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--navy-900);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--sea-dark); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sea-light); outline-offset: 2px; }
.center { text-align: center; }
.note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* ---------- 3) ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  padding: 10px 22px; border-radius: 12px; border: 2px solid transparent;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(3px); }
.btn--sm { padding: 6px 14px; font-size: 14px; border-radius: 10px; }
.btn--lg { padding: 14px 32px; font-size: 19px; }
.btn--block { width: 100%; }
.btn--gold {
  color: #4a2410; border-color: var(--gold-dark);
  background: linear-gradient(#ffe08a, #f2a52d);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 #8a4f12;
}
.btn--gold:active { box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 1px 0 #8a4f12; }
.btn--sea {
  color: #fff; border-color: var(--sea-dark);
  background: linear-gradient(var(--sea-light), var(--sea));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 4px 0 var(--sea-dark);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.btn--sea:active { box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 1px 0 var(--sea-dark); }
.btn--ghost { color: var(--paper-100); border-color: rgba(210,230,247,.5); background: transparent; }
.btn--ghost:hover { background: rgba(210,230,247,.12); }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 4) Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background .3s, box-shadow .3s;
}
.header::after { /* แถบลายกระเบื้องใต้ header */
  content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px;
  background: var(--rope); opacity: 0; transition: opacity .3s;
}
.header.is-scrolled, .header.nav-open { background: rgba(11, 35, 64, .94); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.header.is-scrolled::after { opacity: 1; }
.header__inner {
  max-width: 1440px; height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__img { /* โลโก้ Cyfar-Ro บนแถบเมนู — ครึ่งหนึ่งของโลโก้ท้ายเว็บ (90px → 45px) */
  display: block; height: 45px; width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45)); transition: transform .2s;
}
.logo:hover .logo__img { transform: scale(1.04); }
.logo__mark { /* ซุ้มประตูโค้ง */
  width: 26px; height: 30px; border-radius: 13px 13px 3px 3px;
  background: linear-gradient(var(--gold-light), var(--gold));
  box-shadow: inset 0 0 0 5px var(--gold), inset 0 0 0 9px var(--sea);
}
.logo__text {
  font-family: var(--font-head); font-weight: 800; font-size: 26px; letter-spacing: .08em; white-space: nowrap;
  background: linear-gradient(#fff3c4, var(--gold) 60%, #d07a22);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { flex: 1; display: flex; justify-content: center; gap: 4px; }
.nav__link {
  position: relative; padding: 8px 14px; border-radius: 8px;
  font-family: var(--font-head); font-weight: 500; font-size: 16px;
  color: var(--paper-100); text-decoration: none; transition: color .2s, background .2s;
}
.nav__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav__link.is-active { color: var(--gold-light); }
.nav__link.is-active::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; width: 8px; height: 8px; margin-left: -4px;
  background: var(--gold); transform: rotate(45deg);
}
.nav-toggle { display: none; width: 40px; height: 40px; border: 0; background: none; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 9px; width: 22px; height: 2px; background: var(--paper-100); border-radius: 2px; transition: .25s;
}
.nav-toggle span { top: 19px; }
.nav-toggle span::before { content: ''; left: 0; top: -7px; }
.nav-toggle span::after { content: ''; left: 0; top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

.lvbar { display: flex; align-items: center; gap: 8px; }
.lvbar__avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: top;
  background: var(--paper-200); border: 2px solid var(--gold);
}
.lvbar__info { display: flex; flex-direction: column; gap: 3px; min-width: 110px; }
.lvbar__level { font-family: var(--font-head); font-size: 13px; color: var(--paper-100); line-height: 1; }
.lvbar__level b { color: var(--gold-light); font-size: 15px; }
.lvbar__track { height: 8px; border-radius: 6px; background: rgba(0,0,0,.45); border: 1px solid rgba(210,230,247,.35); overflow: hidden; }
.lvbar__fill { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--sea-light), var(--gold)); transition: transform .15s linear; }

.bgm {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 10px; border: 1px solid rgba(210,230,247,.35); background: rgba(0,0,0,.25);
  color: var(--paper-100); font-family: var(--font-head); font-size: 13px;
}
.bgm__icon { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bgm__icon i { width: 3px; height: 4px; background: var(--paper-200); border-radius: 1px; }
.bgm.is-playing .bgm__icon i { background: var(--gold); animation: eq .9s ease-in-out infinite; }
.bgm.is-playing .bgm__icon i:nth-child(2) { animation-delay: .2s; }
.bgm.is-playing .bgm__icon i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---------- 5) Hero (วิดีโอปก) ---------- */
.hero {
  position: relative; min-height: max(100vh, 640px); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: var(--header-h) 20px 92px;
  background: #cfd8ea url(../assets/video/cover-poster.webp) center / cover no-repeat;
}
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
}
.hero__shade { /* เงาด้านบนให้เมนูอ่านง่าย + เงาด้านล่างให้ปุ่มเด่น */
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14,18,48,.62) 0, rgba(14,18,48,0) 150px),
    linear-gradient(0deg, rgba(11,35,64,.55) 0, rgba(11,35,64,0) 42%);
}
.hero__clouds { position: absolute; left: 0; bottom: -1px; width: 100%; height: 130px; }
.hero__content { position: relative; z-index: 2; text-align: center; max-width: 760px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero__tagline {
  display: inline-block; margin: 0 auto 20px; padding: 6px 18px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 500; font-size: 18px; color: #fff;
  background: rgba(20,22,60,.45); backdrop-filter: blur(4px); text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.hero__cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; margin: 22px 0 0; padding: 6px 16px; border-radius: 999px;
  background: rgba(11,35,64,.55); border: 1px solid rgba(210,230,247,.35); color: var(--paper-100); font-size: 15px;
}
.status-pill b { color: #fff; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa; }
.is-online .status-dot { background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: ping 2s infinite; }
.is-maintenance .status-dot { background: var(--gold); }
.is-offline .status-dot { background: #e5484d; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.scroll-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--font-head); color: var(--navy-700); text-decoration: none; font-weight: 600; font-size: 14px;
}
.scroll-hint i { width: 14px; height: 14px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 6px; } }

/* ---------- 6) Journey: ลานหินเมือง Alberta + ทางเดินมีรั้ว + แถวบ้าน + ตัวละคร ---------- */
.journey {
  position: relative; padding: 0 0 40px; overflow: hidden;
  /* พื้นหินแผ่นของเมือง Alberta (texture จริงจาก data.grf) */
  background: url(../assets/images/alberta/ground.webp) 0 0 / 200px 200px, #cdc8c0;
}
/* ทางเดินปูหิน (ทางเดินของตัวละคร) */
.street {
  position: absolute; z-index: 0; top: 0; bottom: 0;
  left: calc(var(--road-x) - var(--path-w) / 2); width: var(--path-w);
  /* ทางเดินหินกลม (texture จริง) */
  background: url(../assets/images/alberta/cobble.webp) center top / 140px 140px, #c9cdd6;
  box-shadow: inset 0 0 22px rgba(30,40,60,.25);
}
.street::before, .street::after { /* รั้วขาวหัวเสาฟ้า + แนวหญ้าด้านนอก */
  content: ''; position: absolute; top: 0; bottom: 0; width: 34px;
}
.street::before {
  left: -24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='56'%3E%3Crect x='4' y='0' width='4' height='56' fill='%23ffffff' stroke='%23a9b8c8'/%3E%3Crect x='12' y='0' width='4' height='56' fill='%23ffffff' stroke='%23a9b8c8'/%3E%3Crect x='2' y='4' width='16' height='16' rx='3' fill='%23ffffff' stroke='%238ea2b9' stroke-width='1.5'/%3E%3Crect x='4' y='6' width='12' height='12' rx='2' fill='%232f6fc0'/%3E%3Crect x='6' y='8' width='5' height='3' rx='1' fill='%236fa6e6'/%3E%3C/svg%3E") right top / 20px 56px repeat-y, url(../assets/images/alberta/grass.webp) 0 0 / 96px 96px;
}
.street::after {
  right: -24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='56'%3E%3Crect x='4' y='0' width='4' height='56' fill='%23ffffff' stroke='%23a9b8c8'/%3E%3Crect x='12' y='0' width='4' height='56' fill='%23ffffff' stroke='%23a9b8c8'/%3E%3Crect x='2' y='4' width='16' height='16' rx='3' fill='%23ffffff' stroke='%238ea2b9' stroke-width='1.5'/%3E%3Crect x='4' y='6' width='12' height='12' rx='2' fill='%232f6fc0'/%3E%3Crect x='6' y='8' width='5' height='3' rx='1' fill='%236fa6e6'/%3E%3C/svg%3E") left top / 20px 56px repeat-y, url(../assets/images/alberta/grass.webp) 0 0 / 96px 96px;
}

/* แถวบ้านคั่นระหว่าง section */
.town-row { position: relative; z-index: 1; height: calc(285px * var(--k)); pointer-events: none; }
.town-row__side {
  position: absolute; bottom: 0; height: 100%;
  display: flex; align-items: flex-end; gap: calc(10px * var(--k)); overflow: hidden; padding-bottom: calc(18px * var(--k));
}
.town-row__side--left  { left: 0; width: calc(var(--road-x) - var(--path-w) / 2 - 30px); justify-content: flex-end; }
.town-row__side--right { left: calc(var(--road-x) + var(--path-w) / 2 + 30px); right: 0; justify-content: flex-start; }
.town-row__side::before { /* สนามหญ้าใต้แถวบ้าน */
  content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: calc(112px * var(--k));
  background: url(../assets/images/alberta/grass.webp) 0 0 / 128px 128px, #4f8f3a;
  border: 3px solid #b9c2cc; box-shadow: 0 4px 0 rgba(11,35,64,.12);
}
.town-row__side--left::before  { border-radius: 0 40px 40px 0; border-left: 0; }
.town-row__side--right::before { border-radius: 40px 0 0 40px; border-right: 0; }
/* แถวท่าเรือ: ซ้าย = ท่าหิน, ขวา = ทะเล */
.town-row--harbor .town-row__side--left::before { background: url(../assets/images/alberta/stone.webp) 0 0 / 96px 96px, #b9c2cc; }
.town-row--harbor .town-row__side--right::before { /* น้ำทะเลจากเกมจริง (data.grf texture\워터\water000–031 = แบบที่ Alberta ใช้) เรียงเป็นแผ่นเดียว 32 เฟรม */
  --wt: calc(160px * var(--k));
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0) 35%, rgba(5,30,60,.18)),
              url(../assets/images/alberta/water.webp) 0 0 / var(--wt) auto repeat-x, #1d6a9c;
  height: calc(150px * var(--k));
}
.town-row--harbor .town-row__side--right { container-type: inline-size; }
.town-row--harbor .town-row__side--right::before { animation: water-flow 14s linear infinite, water-frame 3.2s steps(32) infinite; }
@keyframes water-flow { to { background-position-x: 0, calc(-2 * var(--wt)); } }   /* น้ำไหลสวนทาง = เรือดูเหมือนแล่นไปข้างหน้า */
@keyframes water-frame { to { background-position-y: 0, calc(-32 * var(--wt)); } }  /* เปลี่ยนเฟรมน้ำแบบในเกม */

/* เรือแล่น: เลื่อนจากซ้ายไปขวาข้ามทะเล แล้ววนกลับ (หัวเรือหันขวา) */
.sail {
  position: absolute; left: 0; bottom: calc(22px * var(--k)); z-index: 1;
  animation: sail 44s linear infinite; animation-delay: var(--delay, 0s);
}
@keyframes sail { from { transform: translateX(-105%); } to { transform: translateX(100cqw); } }
.sail__hull { display: block; animation: ship-rock 3.6s ease-in-out infinite; transform-origin: 50% 85%; }
.sail:nth-child(2) .sail__hull { animation-delay: -1.2s; }
.sail:nth-child(3) .sail__hull { animation-delay: -2.4s; }
@keyframes ship-rock {          /* ลอยขึ้นลง + โคลงซ้ายขวาตามคลื่น */
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(calc(-3px * var(--k))) rotate(-1.2deg); }
  50%      { transform: translateY(calc(1px * var(--k))) rotate(0deg); }
  75%      { transform: translateY(calc(-2px * var(--k))) rotate(1deg); }
}
.sail .bld--model { display: block; filter: drop-shadow(0 10px 6px rgba(8,40,80,.35)); }
.sail__wake {   /* ฟองน้ำท้ายเรือ */
  position: absolute; left: -22%; bottom: 6%; width: 55%; height: calc(16px * var(--k));
  border-radius: 50%; filter: blur(1.5px); transform-origin: right center;
  background: linear-gradient(to left, rgba(255,255,255,.85), rgba(255,255,255,.35) 45%, rgba(255,255,255,0));
  animation: wake 1.8s ease-in-out infinite;
}
@keyframes wake { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.85); opacity: .6; } }
.bld { position: relative; z-index: 1; flex: none; }
.bld.flip { transform: scaleX(-1); }
/* โมเดลจริง (render จาก data.grf) — ขนาดตามสัดส่วนจริง × --k */
.bld--model {
  width: calc(var(--w) * 1px * var(--k)); height: auto;
  filter: drop-shadow(0 8px 5px rgba(11,35,64,.28));
}
.stage { position: relative; z-index: 2; padding: 18px 0; }

.walker {
  position: fixed; z-index: 1; top: 40vh; left: calc(var(--road-x) - 60px); width: 120px;
  opacity: 0; transform: translateY(20px); transition: opacity .4s, transform .4s; pointer-events: none;
}
.walker.is-on { opacity: 1; transform: none; }
.walker.is-entering { opacity: 0; transform: translateY(46px) scale(.55); filter: brightness(2) blur(1px); transition: opacity .6s, transform .6s, filter .6s; }
.walker__sprite {
  display: block; width: 100%; aspect-ratio: 160 / 314;
  background: url(../assets/images/char/front.webp) center bottom / contain no-repeat;
  filter: drop-shadow(0 6px 4px rgba(10,35,70,.35));
}
.walker__sprite::before { /* โหลดภาพท่าอื่นไว้ล่วงหน้า กันภาพกระพริบ */
  content: ''; position: absolute; width: 1px; height: 1px; opacity: 0;
  background: url(../assets/images/char/back.webp), url(../assets/images/char/side.webp);
}
.walker__sprite.is-back { background-image: url(../assets/images/char/back.webp); }
.walker__sprite.is-idle { background-image: url(../assets/images/char/side.webp); transform: scaleX(-1); }
.walker__levelup {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%); opacity: 0; white-space: nowrap;
  font-family: var(--font-head); font-weight: 800; font-size: 20px; color: var(--gold-light);
  text-shadow: 0 2px 0 #7a3b0e, 0 0 12px rgba(255,200,80,.9);
}
.walker__levelup.show { animation: lvup 1.4s ease-out; }
@keyframes lvup {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  70% { opacity: 1; transform: translate(-50%, -24px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -40px); }
}

.bld--mob {
  height: calc(84px * var(--k)); width: auto; margin-bottom: 6px;
  filter: drop-shadow(0 6px 3px rgba(11,35,64,.25)); animation: bobbing 3.2s ease-in-out infinite;
}
.town-row:nth-of-type(even) .bld--mob { animation-delay: -1.6s; }
@keyframes bobbing { 50% { transform: translateY(-5px); } }

/* ---------- 7) Panel (กรอบเนื้อหา) ---------- */
.panel {
  position: relative;
  margin-left: max(24px, var(--panel-left));
  width: min(940px, calc(100% - max(24px, var(--panel-left)) - 24px));
  padding: 34px 38px 38px;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 30%, #fbfdff 0%, var(--paper-50) 55%, var(--paper-100) 100%);
  border: 3px solid #1d4f80;
  box-shadow: 0 0 0 4px var(--paper-300), 0 0 0 7px var(--navy-700), 0 22px 44px rgba(10,35,70,.4);
}
.panel::before { /* แถบกระเบื้องบนหัวกรอบ */
  content: ''; position: absolute; left: 22px; right: 22px; top: -3px; height: 7px;
  background: var(--rope); border-radius: 0 0 6px 6px;
}
.panel__head { text-align: center; margin-bottom: 24px; }
.panel__kicker {
  margin: 0; font-family: var(--font-head); font-size: 13px; font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase; color: var(--sea);
}
.panel__title { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; color: var(--navy-800); }
.panel__title::after {
  content: ''; display: block; width: 120px; height: 6px; margin: 12px auto 0; border-radius: 3px;
  background: var(--rope);
}
.subhead { font-size: 20px; font-weight: 600; color: var(--navy-700); margin: 26px 0 14px; }
.panel .subhead:first-child { margin-top: 0; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 7px 18px; border-radius: 999px; border: 2px solid var(--paper-300);
  background: #fbfdff; font-family: var(--font-head); font-weight: 500; color: var(--muted); transition: .2s;
}
.tab:hover { border-color: var(--paper-400); color: var(--navy-700); }
.tab.is-active { background: var(--navy-700); border-color: var(--navy-700); color: var(--paper-50); }

/* Badge */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 6px; font-family: var(--font-head);
  font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; line-height: 1.6;
}
.badge--announce { background: var(--coral); }
.badge--update { background: var(--sea); }
.badge--event { background: var(--gold-dark); }
.badge--home { background: linear-gradient(90deg, var(--coral), var(--gold-dark)); margin-bottom: 8px; }

/* ---------- 8) Sections ---------- */
/* ข่าว — การ์ด 3 คอลัมน์ */
.tabs--news { justify-content: flex-start; gap: 6px; }
.tabs--news .tab {
  padding: 5px 14px; border-radius: 8px; font-size: 14px; border-width: 1.5px;
  background: #fff; border-color: var(--paper-300); color: var(--navy-700);
}
.tabs--news .tab:hover { border-color: var(--sea-light); color: var(--sea-dark); }
.tabs--news .tab.is-active {
  background: linear-gradient(180deg, #2f8fe0, #1565c0); border-color: #1565c0; color: #fff;
  box-shadow: 0 3px 8px rgba(21,101,192,.3);
}
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.news-card {
  container-type: inline-size;
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  background: #fff; border: 1.5px solid var(--paper-300); border-radius: 14px;
  box-shadow: 0 4px 12px rgba(10,35,70,.08); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.news-card:hover { transform: translateY(-3px); border-color: var(--sea-light); box-shadow: 0 10px 22px rgba(10,35,70,.16); }
.news-card__thumb { position: relative; aspect-ratio: 2 / 1; margin: 8px 8px 0; border-radius: 10px; overflow: hidden; background: var(--paper-100); }
.news-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.news-card:hover .news-card__thumb img { transform: scale(1.04); }
.news-card__thumb .badge { position: absolute; left: 8px; top: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.news-card__body { padding: 10px 12px 4px; flex: 1; }
.news-card__title {
  font-size: 15.5px; font-weight: 700; color: var(--navy-900); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__excerpt {
  margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px 12px 12px; min-width: 0; }
.news-card__time { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-card__time::before { /* ไอคอนนาฬิกา */
  content: ''; flex: none; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid currentColor;
  background: linear-gradient(currentColor, currentColor) 50% 25% / 1.5px 35% no-repeat,
              linear-gradient(currentColor, currentColor) 70% 55% / 30% 1.5px no-repeat;
}
.btn-read {
  flex: none; padding: 5px 12px; border: 0; border-radius: 999px;
  font-family: var(--font-head); font-size: 12.5px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, #3b9cf0, #1565c0); box-shadow: 0 3px 8px rgba(21,101,192,.35);
  transition: filter .2s, transform .12s;
}
.btn-read { text-decoration: none; display: inline-block; }
.news-card { cursor: pointer; }
.news-card__thumb { display: block; cursor: pointer; }
.btn-read:hover { filter: brightness(1.1); }
.btn-read:active { transform: translateY(1px); }
.news-more { text-align: center; margin-top: 16px; }
@container (max-width: 268px) { .news-card__time .lbl { display: none; } }   /* การ์ดแคบ: ซ่อนคำว่า "โพสต์ล่าสุด :" ให้เวลาแสดงครบ */
.news-more .btn[hidden] { display: none; }
.badge--promo { background: #d9467a; }
.badge--hot { background: linear-gradient(90deg, #f05a28, #f2a52d); }
.badge--system { background: var(--navy-700); }
.empty { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--muted); }

/* ข้อมูลเซิร์ฟเวอร์ — แถบสถานะสด + แท็บ */
.srv-live { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.srv-live__item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: #fff;
  box-shadow: 0 4px 10px rgba(10,35,70,.18);
}
.srv-live__item > span { font-size: 12.5px; color: #b9d6f2; }
.srv-live__item b { font-family: var(--font-head); font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa; }
.live-dot.is-online { background: #4ade80; animation: ping 2s infinite; }
.live-dot.is-maintenance { background: var(--gold); }
.live-dot.is-offline { background: #e5484d; }
.srv-tabs { margin-bottom: 14px; }
.srv-pane { display: flex; flex-direction: column; gap: 16px; animation: fadeIn .3s ease; }

.srv-block { padding: 16px 18px 18px; border-radius: 14px; background: #fff; border: 1.5px solid var(--paper-300); box-shadow: 0 3px 10px rgba(10,35,70,.06); }
.srv-block__title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 10px;
  font-size: 18px; font-weight: 600; color: var(--navy-800); border-bottom: 2px dashed var(--paper-200);
}
.it-icon, .sk-icon { flex: none; width: 32px; height: 32px; }
.sk-icon { border-radius: 6px; box-shadow: 0 1px 3px rgba(10,35,70,.25); background: #fff; }
.it-icon { filter: drop-shadow(0 2px 2px rgba(10,35,70,.25)); }
.sk-icon--title { width: 30px; height: 30px; }
.srv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.srv-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; background: var(--paper-100); color: var(--navy-700); }
.srv-note--warn { background: #fdecea; color: #a5321d; }

/* ภาพรวม */
.srv-hero { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.srv-hero__item {
  position: relative; overflow: hidden; text-align: center; padding: 14px 8px 12px; border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--paper-100)); border: 1.5px solid var(--paper-300);
}
.srv-hero__item::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--rope); }
.srv-hero__item span { display: block; font-size: 12.5px; color: var(--muted); }
.srv-hero__item b { display: block; margin-top: 2px; font-family: var(--font-head); font-size: clamp(17px, 1.6vw, 24px); font-weight: 700; color: var(--sea-dark); line-height: 1.2; white-space: nowrap; }
.srv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.srv-tile { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--paper-50); border: 1px solid var(--paper-200); }
.srv-tile__label { font-size: 13px; color: var(--muted); }
.srv-tile__value { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--navy-800); line-height: 1.25; }
.srv-tile small { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-family: var(--font-head); font-size: 14px; font-weight: 500; }
.chip--off { background: #fdecea; color: #a5321d; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.chip--day { background: var(--gold-light); color: #5a3205; }

/* เรต */
.rate-list { display: flex; flex-direction: column; gap: 8px; }
.rate { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--paper-50); border: 1px solid var(--paper-200); }
.rate b { font-family: var(--font-head); font-size: 22px; color: var(--sea-dark); }
.srv-table { width: 100%; border-collapse: collapse; }
.srv-table th { background: var(--navy-700); color: #fff; font-family: var(--font-head); font-weight: 500; padding: 8px 10px; text-align: left; font-size: 14px; }
.srv-table td { padding: 8px 10px; border-top: 1px solid var(--paper-200); }
.srv-table td b { font-family: var(--font-head); color: var(--sea-dark); font-size: 17px; }
.srv-table tbody tr:nth-child(even) { background: var(--paper-50); }

/* กิลด์วอร์ */
.war-hero {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 16px; color: #fff;
  background: radial-gradient(circle at 10% 50%, rgba(255,217,120,.25), transparent 40%), linear-gradient(135deg, var(--navy-900), var(--sea-dark));
  box-shadow: 0 8px 20px rgba(10,35,70,.25);
}
.war-hero .it-icon { width: 64px; height: 64px; }
.war-hero__kicker { font-family: var(--font-head); letter-spacing: .15em; text-transform: uppercase; font-size: 12.5px; color: #b9d6f2; }
.war-hero__days { display: flex; gap: 6px; margin: 4px 0; }
.war-hero__time { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--gold-light); }
.war-hero__members { text-align: center; padding: 8px 16px; border-radius: 12px; background: rgba(255,255,255,.1); }
.war-hero__members b { display: block; font-family: var(--font-head); font-size: 34px; line-height: 1; color: #fff; }
.war-hero__members span { font-size: 12px; color: #b9d6f2; }
.timeline { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.timeline li { position: relative; padding: 10px 14px 10px 16px; background: var(--paper-100); border: 1px solid var(--paper-200); }
.timeline li:first-child { border-radius: 10px 0 0 10px; }
.timeline li:last-child { border-radius: 0 10px 10px 0; background: #fff4d6; border-color: #f2d58a; }
.timeline time { display: block; font-family: var(--font-head); font-weight: 600; color: var(--navy-800); }
.timeline span { font-size: 14px; color: var(--muted); }
.skill-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--paper-50); border: 1px solid var(--paper-200); }
.skill-row b { display: block; font-family: var(--font-head); color: var(--navy-800); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.tag--ok { background: #e3f6ea; color: #1d7a45; }

/* สกิล */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.skill-chip {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px;
  background: var(--paper-50); border: 1px solid var(--paper-200); font-weight: 600; font-size: 14px; color: var(--navy-800);
}
.skill-chip--ban { background: #fff5f3; border-color: #f4c7bd; }
.skill-chip--ban .sk-icon { filter: grayscale(.35); }
.skill-chip--ban::after {
  content: 'BAN'; margin-left: auto; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  color: #fff; background: var(--coral);
}
.balance { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.balance__item { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--paper-50); border: 1px solid var(--paper-200); }
.balance__icons { display: flex; flex-wrap: wrap; gap: 4px; max-width: 68px; flex: none; align-content: flex-start; }
.balance__body b { display: block; font-family: var(--font-head); font-weight: 600; color: var(--navy-800); line-height: 1.3; margin-bottom: 2px; }
.balance__body ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink); }
.balance__body li { margin: 1px 0; }

/* การ์ด */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.card-item { margin: 0; text-align: center; }
.card-item__art {
  position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden;
  box-shadow: 0 3px 8px rgba(10,35,70,.25); transition: transform .2s, box-shadow .2s;
}
.card-item__art img { width: 100%; height: 100%; object-fit: cover; }
.card-item:hover .card-item__art { transform: translateY(-3px) scale(1.04); box-shadow: 0 10px 18px rgba(10,35,70,.3); }
.card-item__tag {
  position: absolute; right: -26px; top: 10px; width: 100px; transform: rotate(35deg); padding: 2px 0;
  font-family: var(--font-head); font-size: 11px; font-weight: 700; color: #fff; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.is-ban .card-item__tag { background: var(--coral); }
.is-nodrop .card-item__tag { background: var(--navy-700); font-size: 10px; }
.card-item figcaption { margin-top: 6px; line-height: 1.25; }
.card-item figcaption b { display: block; font-size: 13px; color: var(--navy-800); }
.card-item figcaption small { font-size: 11.5px; color: var(--muted); }

/* คำสั่ง & ระบบ */
.cmd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.cmd { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--paper-200); font-size: 14px; }
.cmd code {
  flex: none; min-width: 108px; padding: 3px 10px; border-radius: 6px; text-align: center;
  font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; font-weight: 700; color: #fff; background: var(--navy-800);
}
.check-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.check-list li { position: relative; padding: 4px 0 4px 26px; font-size: 14px; }
.check-list li::before {
  content: '✓'; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--sea);
}

/* เริ่มเล่น */
.steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.step {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18px 12px 16px; border-radius: 12px; background: #fbfdff; border: 2px solid var(--paper-300);
}
.step b { font-family: var(--font-head); font-size: 18px; color: var(--navy-800); }
.step span:last-child { font-size: 14px; color: var(--muted); }
.step__num {
  width: 40px; height: 40px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 20px; color: #4a2410;
  background: linear-gradient(#ffe08a, #f2a52d); border: 2px solid var(--gold-dark);
}
.step:not(:last-child)::after {
  content: ''; position: absolute; right: -13px; top: 50%; width: 12px; height: 12px; margin-top: -6px; z-index: 1;
  border-top: 3px solid var(--paper-400); border-right: 3px solid var(--paper-400); transform: rotate(45deg);
}
.start-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 30px; align-items: start; margin-top: 28px; }

/* ฟอร์ม */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label, .field .label { font-weight: 600; font-size: 14.5px; color: var(--navy-700); }
.field input:not([type=radio]):not([type=checkbox]) {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 2px solid var(--paper-300);
  background: #ffffff; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #8fb0cc; }
.field input:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(31,134,199,.2); }
.field.has-error input { border-color: var(--coral); }
.field__err { min-height: 0; font-size: 13px; color: var(--coral); }
.field__err:empty { display: none; }
.choice { display: flex; gap: 20px; }
.choice label, .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
.choice input, .check input { width: 18px; height: 18px; accent-color: var(--sea); }

/* ดาวน์โหลด */
.dl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dl {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: #fbfdff; border: 2px solid var(--paper-300); color: var(--ink); transition: .2s;
}
.dl:hover { border-color: var(--sea); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(10,35,70,.15); }
.dl__icon {
  flex: none; position: relative; width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(var(--sea-light), var(--sea)); box-shadow: 0 3px 0 var(--sea-dark);
}
.dl__icon::before { content: ''; position: absolute; left: 50%; top: 9px; width: 4px; height: 15px; margin-left: -2px; background: #fff; border-radius: 2px; }
.dl__icon::after {
  content: ''; position: absolute; left: 50%; top: 15px; width: 10px; height: 10px; margin-left: -6px;
  border-right: 4px solid #fff; border-bottom: 4px solid #fff; transform: rotate(45deg);
}
.dl__info { display: flex; flex-direction: column; line-height: 1.35; }
.dl__info b { font-family: var(--font-head); font-weight: 600; }
.dl__info small { color: var(--muted); }
.req { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: rgba(79,182,234,.18); font-size: 14px; display: flex; flex-direction: column; }
.req b { font-family: var(--font-head); color: var(--navy-700); }

/* แผนที่โลก */
.wm-sub { margin: -12px 0 14px; text-align: center; color: var(--muted); font-size: 14px; }
.wm-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 14px; }
.wm-counts div { padding: 10px 12px; border-radius: 12px; text-align: center; background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: #fff; }
.wm-counts dt { font-size: 12.5px; color: #b9d6f2; }
.wm-counts dd { margin: 0; font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.wm-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wm-search { flex: 1 1 280px; }
.wm-search input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px; border: 2px solid var(--paper-300); font: inherit; color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%234f6e8e' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M13 13l4 4'/%3E%3C/svg%3E") 13px center no-repeat;
}
.wm-search input:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(31,134,199,.18); }
.wm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.wm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; border: 2px solid; }
.lg--mvp { border-color: #e5484d; background: #fde3e3; }
.lg--boss { border-color: #f2a52d; background: #fff1d6; }
.lg--town { border-color: var(--gold); background: var(--gold-light); }
.lg--soon { border-color: #9aa8b8; background: #dfe5ec; }
.wm-hint { display: none; margin: 0 0 6px; text-align: center; font-size: 12.5px; color: var(--muted); }
.wm-empty { text-align: center; color: var(--coral); font-weight: 600; margin: 0 0 8px; }
.wm-scroll { overflow-x: auto; border-radius: 14px; }
.wm-canvas {
  position: relative; min-width: 640px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #2f7fbf, #164b7c 75%), #164b7c;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15), 0 6px 16px rgba(10,35,70,.2);
}
.wm-canvas::before { /* ลายคลื่นทะเลจาง ๆ */
  content: ''; position: absolute; inset: 0; opacity: .25;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40'%3E%3Cpath d='M5 20q8-7 16 0t16 0' fill='none' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 0 0 / 80px 40px;
}
/* พื้นหลังแผนที่โลกของเกม (tools/worldmap_bg.json) — ช่องแผนที่โปร่งให้เห็นภาพพื้นหลัง */
.wm-canvas.has-bg { min-width: 760px; background: #2d5560 center / 100% 100% no-repeat; }
.wm-canvas.has-bg::before { display: none; }
.has-bg .mt { border-width: 1.5px; border-color: rgba(255,255,255,.75); border-radius: 3px; background: rgba(20,45,35,.18); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.has-bg .mt-img { opacity: .55; transition: opacity .15s; }
.has-bg .mt:hover .mt-img, .has-bg .mt:focus-visible .mt-img { opacity: 1; }
.has-bg .mt.town { border-color: var(--gold); }
.has-bg .mt.town .mt-img { opacity: .35; }
.has-bg .mt.soon { filter: grayscale(.7); background: rgba(25,35,45,.3); border-color: rgba(220,228,236,.6); }
.has-bg .mt.soon .mt-img { opacity: .22; }
.has-bg .mt-l { padding: 1px 0; font-size: 9px; letter-spacing: -.3px; }   /* ชื่อแมพยาว (prt_fild05) พอดีช่อง */
.has-bg .mt.town .mt-l { font-size: 10px; letter-spacing: 0; }
.has-bg .mt.soon:hover .mt-img { opacity: .9; }
.mt {
  position: absolute; padding: 0; border: 2px solid rgba(255,255,255,.55); border-radius: 4px; overflow: hidden; cursor: pointer;
  background: #3b6b4a; transition: transform .15s, box-shadow .15s, opacity .2s, filter .2s; z-index: 1;
}
.mt:hover, .mt:focus-visible { transform: scale(1.18); z-index: 5; box-shadow: 0 6px 16px rgba(0,0,0,.45); border-color: #fff; }
.mt-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt-l {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 2px; font-size: 9.5px; line-height: 1.2; font-weight: 600; color: #fff; text-align: center;
  background: rgba(11,35,64,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt.town { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242,179,61,.6); }
.mt.town .mt-l { background: linear-gradient(90deg, #a8641a, #f2b33d); color: #fff; font-size: 10px; }
.mt.has-mvp { border-color: #e5484d; }
.mt.has-boss { border-color: #f2a52d; }
.mt.none:not(.town) { cursor: default; }
.mt.soon { filter: grayscale(.85) brightness(.75); border-color: #9aa8b8; }
.mt-soon {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) rotate(-12deg); padding: 0 4px; border-radius: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: .05em; color: #fff; background: rgba(11,35,64,.85);
}
.mt-boss { position: absolute; right: 1px; top: 1px; width: 44%; height: 44%; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.has-mvp .mt-boss { box-shadow: 0 0 0 2px #e5484d; }
.has-boss .mt-boss { box-shadow: 0 0 0 2px #f2a52d; }
.mt-boss .mob-img { max-width: 90%; max-height: 90%; }
.mt.dim { opacity: .18; filter: grayscale(1); }
.wm-dun-title { margin-top: 24px; }
.wm-dun-title small { font-size: 12px; letter-spacing: .2em; color: var(--muted); font-weight: 500; }
.dun-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dun { padding: 10px 12px 12px; border-radius: 12px; background: #fff; border: 1.5px solid var(--paper-300); transition: opacity .2s; }
.dun.big { grid-column: 1 / -1; }
.dun.dim { opacity: .3; }
.dun__h { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--navy-800); }
.dun__h small { font-weight: 400; color: var(--muted); font-size: 12px; }
.dun__floors { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.mt.isdun { position: relative; aspect-ratio: 1; width: 100%; border-color: var(--paper-300); background: #2b3a4a; }
.mt.isdun .mt-l { font-size: 9px; }

/* รูปมอน + ธาตุ */
.mob-img { display: inline-block; width: 28px; height: 28px; object-fit: contain; flex: none; image-rendering: auto; }
.mob-img--ph { display: inline-grid; place-items: center; border-radius: 50%; font-family: var(--font-head); font-weight: 700; font-size: 13px; color: #fff; background: #8a97a6; }
.el-Water { background: #3b8fd9; } .el-Earth { background: #a5763c; } .el-Fire { background: #e25b35; } .el-Wind { background: #4fae6d; }
.el-Poison { background: #8a4bb8; } .el-Holy { background: #d4a72c; } .el-Dark { background: #4b4560; } .el-Ghost { background: #8d84b5; }
.el-Undead { background: #6b5e57; } .el-Neutral { background: #8a97a6; }
.el { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }

/* tooltip */
.wm-tip {
  position: fixed; left: 0; top: 0; z-index: 60; width: 300px; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: #fff; border-radius: 12px; border: 1.5px solid var(--paper-300); box-shadow: 0 12px 30px rgba(10,35,70,.3); overflow: hidden;
}
.wm-tip.show { opacity: 1; }
.wt-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--navy-800); color: #fff; }
.wt-h b { font-family: var(--font-head); font-weight: 600; }
.wt-h small { color: #b9d6f2; font-size: 11.5px; }
.wt-b { list-style: none; margin: 0; padding: 6px 8px; }
.wt-b li { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; font-size: 12.5px; }
.wt-b li.t-mvp { background: #fde9e9; } .wt-b li.t-boss { background: #fff4dc; }
.wt-n { font-weight: 600; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-n em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--coral); }
.wt-a { color: var(--sea-dark); font-weight: 700; }
.wt-r { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.wt-more { padding: 0 12px 4px; font-size: 12px; color: var(--muted); }
.wt-f { padding: 6px 12px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--paper-200); background: var(--paper-50); }
.wt-empty { padding: 12px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* popup รายละเอียดแผนที่ */
.map-modal__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-right: 30px; }
.map-modal__head img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; border: 2px solid var(--paper-300); }
.map-modal__head .modal__title { margin: 0; }
.mob-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mob-table th { background: var(--navy-700); color: #fff; font-family: var(--font-head); font-weight: 500; padding: 7px 8px; text-align: left; font-size: 13px; white-space: nowrap; }
.mob-table td { padding: 6px 8px; border-top: 1px solid var(--paper-200); vertical-align: middle; }
.mob-table tr.t-mvp td { background: #fde9e9; } .mob-table tr.t-boss td { background: #fff4dc; }
.mob-table tr.is-link { cursor: pointer; transition: background .12s; }
.mob-table tr.is-link:hover td, .mob-table tr.is-link:focus-visible td { background: #e3f1fc; }
.mob-table tr.is-link:focus-visible { outline: 2px solid var(--sea); outline-offset: -2px; }
.mob-table tr.is-link td:first-child b { text-decoration: underline dotted rgba(29,79,128,.5); text-underline-offset: 3px; }
.db-back { display: inline-flex; align-items: center; margin: -14px 0 12px; padding: 4px 12px; border: 1px solid var(--paper-300); border-radius: 999px;
  background: #fff; color: var(--sea-dark); font: inherit; font-size: 13.5px; cursor: pointer; }
.db-back:hover { border-color: var(--sea); background: var(--paper-100); }
.mob-cell { display: flex; align-items: center; gap: 8px; }
.mob-cell .mob-img { width: 36px; height: 36px; }
.mob-cell b { display: block; color: var(--navy-800); }
.mob-type { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 5px; color: #fff; }
.mob-type--mvp { background: #e5484d; } .mob-type--boss { background: #f2a52d; }

/* ตาราง (เลื่อนแนวนอนได้) */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 2px solid var(--paper-300); }


/* ---------- 9) Footer ---------- */
.footer { position: relative; background: var(--navy-900); color: var(--paper-200); padding: 48px 20px 36px; text-align: center; }
.footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--rope); }
.footer__inner { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.footer__links a { color: var(--paper-100); text-decoration: none; }
.footer__links a:hover { color: var(--gold-light); }
.footer__social { display: flex; gap: 10px; }
.footer__copy { margin: 4px 0 0; font-size: 14px; }
.footer__logos { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }   /* Cyfar-Ro + EGS เรียงต่อกัน สูงเท่ากัน */
.footer__brand { display: block; line-height: 0; }
.footer__brand img, .footer__studio { display: block; height: 90px; width: auto; }
.footer__brand img { filter: drop-shadow(0 6px 12px rgba(0,0,0,.45)); transition: transform .2s; }
.footer__brand:hover img { transform: scale(1.04); }
.footer__studio { filter: drop-shadow(0 0 6px rgba(210,230,255,.45)) drop-shadow(0 0 2px rgba(255,255,255,.5)); }   /* เรืองแสงอ่อน ๆ ให้ตัวหนังสือสีน้ำเงินเข้มอ่านได้บนพื้นกรมท่า */
@media (max-width: 420px) { .footer__logos { gap: 18px; } .footer__brand img, .footer__studio { height: 74px; } }
.footer__legal { margin: 0; font-size: 12.5px; color: rgba(210,230,247,.55); }

.to-top {
  position: fixed; z-index: 40; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(#ffe08a, #f2a52d); border: 2px solid var(--gold-dark); box-shadow: 0 4px 0 #8a4f12;
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: .3s;
}
.to-top::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -3px 0 0 -6px;
  border-left: 3px solid #4a2410; border-top: 3px solid #4a2410; transform: rotate(45deg);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ฐานข้อมูลเกม: แท็บ แผนที่โลก / ไอเทม / มอนสเตอร์ (js/database.js) */
.db-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; margin: 0 0 20px; border-radius: 14px; background: var(--paper-200); }
.db-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--navy-700); font-family: var(--font-head); font-size: 16px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s;
}
.db-tab img { width: 26px; height: 26px; object-fit: contain; }
.db-tab:hover { background: rgba(255,255,255,.6); }
.db-tab.is-active { background: linear-gradient(135deg, var(--navy-800), var(--sea-dark)); color: #fff; box-shadow: 0 3px 10px rgba(11,35,64,.25); }
.db-pane > .wm-sub { margin-top: -6px; }
.db-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.db-select {
  padding: 9px 30px 9px 12px; border-radius: 999px; border: 2px solid var(--paper-300); font: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%234f6e8e' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 12px center no-repeat;
}
.db-select:focus { outline: none; border-color: var(--sea); }
.db-chips { margin-bottom: 8px; }
.chip--filter { border: 2px solid var(--paper-300); background: #fff; color: var(--navy-700); cursor: pointer; gap: 6px; }
.chip--filter small { font-size: 12px; color: var(--muted); font-weight: 400; }
.chip--filter:hover { border-color: var(--sea-light); }
.chip--filter.is-active { background: var(--sea); border-color: var(--sea); color: #fff; }
.chip--filter.is-active small { color: #d6ecfa; }
.db-count { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.db-loading { margin: 0; padding: 26px 10px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.db-icon { width: 30px; height: 30px; object-fit: contain; flex: none; image-rendering: pixelated; }
.db-icon--ph { display: inline-grid; place-items: center; border-radius: 6px; background: var(--paper-200); color: var(--muted); font-size: 13px; image-rendering: auto; }
.db-icon--lg { width: 56px; height: 56px; padding: 6px; border-radius: 12px; background: #fff; border: 2px solid var(--paper-300); }
.db-mob { width: 100%; height: 100%; object-fit: contain; }
.db-mob--ph { display: grid; place-items: center; border-radius: 50%; width: 42px; height: 42px; margin: auto; color: #fff; font-family: var(--font-head); font-weight: 700; }

/* รายการไอเทม */
.db-list { display: grid; gap: 4px; }
.db-row {
  display: grid; grid-template-columns: 38px 1fr auto auto; align-items: center; gap: 4px 12px; width: 100%; padding: 7px 12px; text-align: left;
  border: 1px solid var(--paper-200); border-radius: 10px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s;
}
.db-row:hover { border-color: var(--sea-light); background: var(--paper-50); }
.db-row__main { display: flex; flex-direction: column; min-width: 0; }
.db-row__main b { font-family: var(--font-head); font-weight: 500; font-size: 15.5px; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-row__main small { font-size: 12.5px; color: var(--muted); }
.db-row__stat { font-size: 13.5px; font-weight: 600; color: var(--sea-dark); white-space: nowrap; }
.db-row__by { font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--paper-100); white-space: nowrap; }

/* การ์ดมอนสเตอร์ */
.mob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.mob-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; border: 1px solid var(--paper-200); border-radius: 12px;
  background: #fff; font: inherit; color: var(--ink); cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.mob-card:hover { transform: translateY(-2px); border-color: var(--sea-light); box-shadow: 0 6px 16px rgba(11,35,64,.12); }
.mob-card.t-boss { border-color: #f5c77a; background: linear-gradient(135deg, #fff, #fff8ea); }
.mob-card.t-mvp { border-color: #f0a3a5; background: linear-gradient(135deg, #fff, #fff0f0); }
.mob-card__img { flex: none; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 10px; background: var(--paper-50); overflow: hidden; }
.mob-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mob-card__body b { font-family: var(--font-head); font-weight: 500; font-size: 15.5px; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-card__body small { font-size: 12.5px; color: var(--muted); }
.mob-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.mob-card__tags .tag { background: var(--paper-100); color: var(--navy-700); font-weight: 500; font-size: 12px; }
.mob-type { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.mob-type--boss { background: #fff1d6; color: #9a5a00; }
.mob-type--mvp { background: #fde3e3; color: #b42328; }

/* popup รายละเอียดไอเทม/มอน */
.db-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-right: 34px; }
.db-head .modal__title { margin-bottom: 4px; padding-right: 0; }
.db-head .modal__meta { margin: 0; }
.db-head__sprite { flex: none; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 14px; background: #fff; border: 2px solid var(--paper-300); overflow: hidden; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 0 0 6px; }
.kv div { padding: 7px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--paper-200); }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-head); font-size: 16px; color: var(--navy-800); word-break: break-word; }
.db-sub { margin: 18px 0 8px; font-size: 18px; color: var(--navy-800); }
.db-sub2 { margin: 10px 0 6px; font-size: 15px; color: var(--sea-dark); }
.sc-list { margin: 0; padding: 10px 12px 10px 30px; border-radius: 10px; background: #fff; border: 1px solid var(--paper-200); }
.sc-list li { margin: 2px 0; }
.sc-list .cond { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--gold-light); color: #5a3205; font-size: 12.5px; }
.sc-list code { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; }
.drop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.drop {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; text-align: left;
  border: 1px solid var(--paper-200); border-radius: 10px; background: #fff; font: inherit; color: var(--ink); cursor: pointer;
}
.drop:hover { border-color: var(--sea-light); background: var(--paper-50); }
.drop > .db-mob, .drop > .db-icon { width: 38px; height: 38px; }
.drop .db-mob--ph { width: 32px; height: 32px; font-size: 13px; }
.drop span { display: flex; flex-direction: column; min-width: 0; }
.drop b { font-weight: 600; font-size: 14px; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop small { font-size: 12px; color: var(--muted); }
.drop em { font-style: normal; font-family: var(--font-head); font-weight: 600; color: var(--sea-dark); font-size: 14px; }
.drop.is-card { border-color: #f5c77a; background: #fffaf0; }
.spawn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.spawn-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 7px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--paper-200); }
.spawn-list li b { font-family: var(--font-head); font-weight: 500; color: var(--navy-800); }
.spawn-list li small { color: var(--muted); }
.spawn-list li span { margin-left: auto; font-size: 13.5px; color: var(--sea-dark); }
.spawn-list li em { font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #dfe5ec; color: #5b6878; }
.spawn-list li.soon { opacity: .75; }
.spawn-list li.is-link { cursor: pointer; transition: border-color .12s, background .12s; }
.spawn-list li.is-link:hover, .spawn-list li.is-link:focus-visible { border-color: var(--sea-light); background: #e3f1fc; outline: none; opacity: 1; }
.spawn-list li.is-link b { text-decoration: underline dotted rgba(29,79,128,.5); text-underline-offset: 3px; }
#modalMap .db-back { margin: -14px 0 12px; }

@media (max-width: 760px) {
  .db-tab { flex-direction: column; gap: 2px; font-size: 14px; padding: 7px 4px; }
  .db-tab img { width: 24px; height: 24px; }
  .db-tools .db-select { flex: 1 1 30%; min-width: 0; }
  .db-row { grid-template-columns: 34px 1fr auto; padding: 6px 10px; }
  .db-row__by { display: none; }
  .mob-grid { grid-template-columns: 1fr 1fr; }
  .mob-card { flex-direction: column; text-align: center; padding: 8px 6px; }
  .mob-card__body { align-items: center; width: 100%; }
  .mob-card .mob-card__tags { justify-content: center; }
  .db-head__sprite { width: 72px; height: 72px; }
  .kv { grid-template-columns: 1fr 1fr; }
  .drop-list { grid-template-columns: 1fr; }
}

/* หน้าอ่านข่าว (news.html) */
.article-page {
  padding: calc(var(--header-h) + 28px) 16px 56px; min-height: 70vh;
  background: url(../assets/images/alberta/ground.webp) 0 0 / 200px 200px, #cdc8c0;
}
.article-wrap { max-width: 900px; margin: 0 auto; }
.article-page .panel { margin: 0 0 22px; width: 100%; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; padding: 6px 14px; width: fit-content; max-width: 100%;
  border-radius: 999px; background: rgba(11,35,64,.82); color: var(--paper-200); font-size: 14px; }
.crumbs a { color: var(--paper-100); text-decoration: none; }
.crumbs a:hover { color: var(--gold-light); }
.crumbs b { color: var(--gold-light); font-weight: 600; }
.article { padding-top: 26px; }
.article__cover { margin: 0 0 20px; aspect-ratio: 2 / 1; border-radius: 12px; overflow: hidden; background: var(--paper-100); border: 2px solid var(--paper-300); }
.article__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.article__title { margin: 0 0 18px; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.35; color: var(--navy-800); }
.article__body { font-size: 17px; line-height: 1.85; padding-top: 18px; border-top: 2px dashed var(--paper-300); }
.article__body p { margin: 0 0 14px; }
.article__body ul, .article__body ol { margin: 0 0 14px; padding-left: 24px; }
.article__body li { margin-bottom: 6px; }
.article__body code { padding: 1px 7px; border-radius: 6px; background: var(--paper-200); color: var(--navy-800); font-size: .92em; }
.article__body img { max-width: 100%; border-radius: 10px; }
.article__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--paper-300); }
.article__missing { text-align: center; padding: 30px 0; }
.article__missing p { color: var(--muted); }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 22px; }
.article-nav__item {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; text-decoration: none; min-width: 0;
  background: rgba(246,251,255,.95); border: 2px solid var(--paper-300); color: var(--ink); transition: border-color .15s, transform .15s;
}
.article-nav__item:hover { border-color: var(--sea-light); transform: translateY(-2px); }
.article-nav__item.is-next { text-align: right; }
.article-nav__item.is-empty { visibility: hidden; }
.article-nav__item small { color: var(--sea-dark); font-weight: 600; }
.article-nav__item b { font-family: var(--font-head); font-weight: 500; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-more .subhead { margin-top: 0; }
.news-card--link { text-decoration: none; color: inherit; }
@media (max-width: 760px) {
  .article-page { padding: calc(var(--header-h) + 16px) 10px 40px; }
  .article-page .panel { padding: 22px 16px 24px; }
  .article__body { font-size: 16px; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav__item.is-empty { display: none; }
}

/* กิลด์ที่ลงทะเบียนแล้ว — ฉากกิลด์วอร์ (js/guildwar.js) */
.gw-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; margin: -8px 0 14px; }
.gw-count { margin: 0; padding: 4px 16px; border-radius: 999px; background: linear-gradient(135deg, var(--navy-800), var(--sea-dark)); color: #fff; font-family: var(--font-head); font-size: 16px; }
.gw-count b { color: var(--gold-light); font-size: 22px; }
.gw-when { margin: 0; color: var(--muted); font-size: 14.5px; }
.gw-when b { color: var(--navy-800); font-weight: 600; margin: 0 2px; }
.gw-field {
  position: relative; height: 440px; overflow: hidden; border-radius: 14px; border: 3px solid var(--navy-700);
  box-shadow: inset 0 0 40px rgba(0,0,0,.35), 0 6px 18px rgba(10,35,70,.25);
  /* กำแพงปราสาท + ลานหิน (texture จริงของ prtg_cas01 จาก data.grf) */
  background: linear-gradient(180deg, rgba(0,0,0,0) 0, rgba(0,0,0,0) 30%, rgba(30,20,10,.45) 34%, rgba(0,0,0,0) 40%), #8d8778;
  user-select: none;
}
.gw-field.bg-on {                          /* โหลดภาพเมื่อเลื่อนใกล้ถึง (main.js → data-lazy-bg) */
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0, rgba(0,0,0,0) 30%, rgba(30,20,10,.45) 34%, rgba(0,0,0,0) 40%),
    url(../assets/images/guildwar/wall.webp) 0 0 / auto 34% repeat-x,
    url(../assets/images/guildwar/floor.webp) 0 0 / 160px 160px, #8d8778;
}
.gw-field::after { /* แสงขอบฉาก */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 20000;
  background: radial-gradient(ellipse at 50% 62%, rgba(0,0,0,0) 55%, rgba(10,15,30,.38) 100%);
}
.gw-emp {
  position: absolute; left: 50%; pointer-events: none; transform-origin: 50% 100%;
  /* Emperium: โมเดล 3D จริงจาก data.grf (data/model/길드전/엠펠리움.rsm) หมุนรอบตัว 36 เฟรม — เปลี่ยนเฟรมใน guildwar.js */
  background: 0 0 no-repeat;               /* ภาพใส่เมื่อเลื่อนใกล้ถึง (.is-loaded) */
  filter: drop-shadow(0 0 8px rgba(255,214,90,.75)); animation: gwEmp 2.6s ease-in-out infinite;
}
.gw-emp.is-loaded { background-image: url(../assets/images/guildwar/emperium.webp); }
.gw-emp::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 92px; height: 26px; margin: 0 0 -10px -46px; border-radius: 50%; z-index: -1;
  background: radial-gradient(rgba(255,220,120,.6), rgba(255,220,120,0) 70%); }
@keyframes gwEmp { 50% { filter: drop-shadow(0 0 16px rgba(255,230,140,1)); } }
.gw-unit { position: absolute; left: 0; top: 0; cursor: pointer; outline: none; will-change: transform; }
.gw-sprite { position: absolute; inset: 0; background-repeat: no-repeat; image-rendering: pixelated; }
.gw-shadow { position: absolute; width: 34px; height: 12px; margin: -6px 0 0 -17px; border-radius: 50%; background: rgba(0,0,0,.32); }
.gw-unit.is-hit .gw-sprite { filter: brightness(1.8) saturate(.6); }
.gw-emblem { position: absolute; width: 24px; height: 24px; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.gw-emblem__img, .gw-slot__emblem { display: block; width: 24px; height: 24px; image-rendering: pixelated; }
.gw-emblem--none { background: linear-gradient(135deg, var(--sea), var(--navy-700)); border: 2px solid #fff; border-radius: 4px; }
.gw-name {
  position: absolute; transform: translate(-50%, -100%); padding: 2px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none;
  background: rgba(11,35,64,.9); color: #fff; font-family: var(--font-head); font-size: 14px; line-height: 1.3; text-align: center;
  opacity: 0; transition: opacity .15s;
}
.gw-name small { display: block; font-family: var(--font-body); font-size: 11px; color: var(--paper-300); }
.gw-unit.is-focus .gw-name { opacity: 1; }
.gw-unit.is-focus .gw-sprite { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px var(--gold)); }
.gw-unit:not(.has-guild) .gw-name { background: rgba(80,90,105,.9); }
.gw-dmg {
  position: absolute; transform: translateX(-50%); pointer-events: none; font-family: var(--font-head); font-weight: 700; font-size: 17px;
  color: #fff; -webkit-text-stroke: 1px #000; paint-order: stroke fill; text-shadow: 0 1px 0 #000; animation: gwDmg .9s ease-out forwards;
}
.gw-dmg.is-crit { color: #ffd84a; font-size: 21px; }
@keyframes gwDmg { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -4px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -38px) scale(1); } }
.gw-hint { margin: 10px 0 14px; text-align: center; font-size: 13.5px; color: var(--muted); }
.gw-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: gw; }
.gw-slot {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 34px; border-radius: 10px; min-width: 0;
  background: #fff; border: 2px solid var(--paper-200); transition: border-color .15s, background .15s; counter-increment: gw; cursor: default;
}
.gw-slot::before { content: counter(gw); position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 20px; text-align: center;
  font-family: var(--font-head); font-size: 13px; color: var(--muted); }
.gw-slot span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.gw-slot b { font-family: var(--font-head); font-weight: 500; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-slot small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-slot.is-focus { border-color: var(--gold); background: #fffaf0; }
.gw-slot.is-empty { background: transparent; border-style: dashed; border-color: var(--paper-300); }
.gw-slot.is-empty b { color: var(--muted); font-weight: 400; }
.gw-emblem--empty { border: 2px dashed var(--paper-400); border-radius: 4px; }
@media (max-width: 1080px) { .gw-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .gw-field { height: 340px; }
  .gw-list { grid-template-columns: 1fr 1fr; gap: 6px; }
  .gw-slot { padding: 6px 8px 6px 28px; gap: 8px; }
  .gw-slot::before { left: 4px; }
}
@media (prefers-reduced-motion: reduce) { .gw-emp { animation: none; } }

/* โซนนักสำรวจ (js/explorer.js) — เมืองจำลองจาก data.grf */
.explore-zone { --gs: 1; position: relative; z-index: 2; padding: 0 24px 50px; margin-bottom: -40px; }
.explore-zone::before { /* พื้นทรายในเมือง Morocc (texture จริง) — เริ่มที่เท้ากำแพง ปิดทางเดินด้านล่าง */
  content: ''; position: absolute; left: 0; right: 0; top: calc(226px * var(--gs)); bottom: 0; z-index: -1;
  background: #c9a46a; box-shadow: inset 0 18px 24px -14px rgba(60,35,10,.55);
}
.explore-zone.bg-on::before { background: url(../assets/images/explorer/morocc/sand.webp) 0 0 / 160px 160px, #c9a46a; }
.ex-gate { position: relative; height: calc(270px * var(--gs)); margin: 0 -24px 26px; pointer-events: none; }
.ex-gate__img { position: absolute; top: 0; left: calc(var(--road-x) - 360px * var(--gs)); width: calc(720px * var(--gs)); height: auto;
  filter: drop-shadow(0 10px 10px rgba(40,25,10,.35)); }
.ex-gate__wall { position: absolute; top: 0; height: 100%; background: 0 0 / calc(160px * var(--gs)) 100% repeat-x;
  filter: drop-shadow(0 10px 10px rgba(40,25,10,.3)); }
.explore-zone.bg-on .ex-gate__wall { background-image: url(../assets/images/explorer/morocc/wall.webp); }
.ex-gate__wall--l { left: 0; width: max(0px, calc(var(--road-x) - 360px * var(--gs) + 1px)); background-position: right top; }
.ex-gate__wall--r { left: calc(var(--road-x) + 360px * var(--gs) - 1px); right: 0; }
.ex-head { /* ป้ายโทนหินทราย Morocc — กรอบเดียวกับแผนที่ด้านล่าง (.ex-frame) */
  position: relative; width: fit-content; max-width: 100%; margin: 0 auto 18px; padding: 18px 34px 16px; text-align: center; border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 25%, #fff8e8 0%, #f6e6c4 55%, #ead2a0 100%);
  border: 4px solid #6b4a24; box-shadow: 0 0 0 3px #e8c88a, 0 0 0 7px #4a3218, inset 0 0 0 1px rgba(255,248,232,.7), 0 14px 30px rgba(40,25,10,.4);
}
.ex-head .panel__kicker { color: #b0661c; }
.ex-head .panel__title { color: #4a2c10; text-shadow: 0 1px 0 rgba(255,248,232,.8); }
.ex-head .panel__title::after { display: none; }
.ex-sub { margin: 6px 0 0; color: #6e5233; font-size: 14.5px; }
.ex-sub b { color: #a8481a; }
.ex-frame {
  position: relative; width: min(1320px, 100%); height: min(640px, 76vh); margin: 0 auto; overflow: hidden; outline: none;
  border-radius: 16px; border: 4px solid #6b4a24; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M3 2l7 19 2.5-7.5L20 11z' fill='%23fff3c4' stroke='%235a3205' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, pointer;
  background: #2a1d10; box-shadow: 0 0 0 3px #e8c88a, 0 0 0 7px #4a3218, 0 24px 50px rgba(10,20,40,.45);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  contain: strict;   /* แยกการจัดหน้า/วาดภาพของแผนที่ออกจากทั้งหน้า (ลดงานตอนสร้างแผนที่ + ตอนตัวละครเดิน) */
}
.ex-frame:focus-visible { box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px #4a3218, 0 24px 50px rgba(10,20,40,.45); }
.ex-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.ex-tiles, .ex-ents { position: absolute; inset: 0; }
.ex-tile { position: absolute; width: 512px; height: 512px; display: block; pointer-events: none; }
.ex-ent { position: absolute; left: 0; top: 0; pointer-events: none; }
.ex-ent__spr { position: absolute; inset: 0; background-repeat: no-repeat; }
.ex-ent__shadow { position: absolute; width: 36px; height: 12px; margin: -6px 0 0 -18px; border-radius: 50%; background: rgba(0,0,0,.3); }
.ex-npc { pointer-events: auto; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='24'%3E%3Cpath d='M3 3h20v13H12l-5 5v-5H3z' fill='%23fff' stroke='%231d4f80' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='9.5' r='1.6' fill='%231d4f80'/%3E%3Ccircle cx='13' cy='9.5' r='1.6' fill='%231d4f80'/%3E%3Ccircle cx='18' cy='9.5' r='1.6' fill='%231d4f80'/%3E%3C/svg%3E") 4 4, pointer; outline: none; }
.ex-npc:hover .ex-ent__spr, .ex-npc:focus-visible .ex-ent__spr, .ex-npc.is-talking .ex-ent__spr { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px #7fc4ff); }
.ex-ent__name {
  position: absolute; transform: translateX(-50%) scale(1.18);   /* หักล้างการย่อตัวละคร (SPR_K) ให้ตัวหนังสือคมชัด */ transform-origin: 50% 0; white-space: nowrap; pointer-events: none;
  font-family: var(--font-body); font-weight: 700; font-size: 12px; color: #fff; text-shadow: 0 0 2px #000, 0 1px 1px #000, 1px 0 1px #000, -1px 0 1px #000;
}
.ex-npc .ex-ent__name { color: #bfe3ff; }
.ex-player.is-hidden { opacity: 0; }
.ex-player.is-warp { animation: exWarp 1.1s ease-out; }
.ex-player.is-warp::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 70px; height: 150%; margin-left: -35px; border-radius: 40px 40px 50% 50%;
  background: linear-gradient(0deg, rgba(255,240,180,.85), rgba(160,220,255,.35) 60%, rgba(160,220,255,0)); animation: exBeam 1.1s ease-out forwards; }
@keyframes exWarp { 0% { opacity: 0; filter: brightness(3); } 60% { opacity: 1; filter: brightness(1.6); } 100% { opacity: 1; filter: none; } }
@keyframes exBeam { 0% { opacity: 0; transform: scaleY(.2); transform-origin: 50% 100%; } 30% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; transform: scaleY(1.2); } }
.ex-marker { position: absolute; width: 30px; height: 14px; margin: -7px 0 0 -15px; border: 2px solid #ffe66b; border-radius: 50%; opacity: 0; pointer-events: none; z-index: 1; }
.ex-marker.is-bad { border-color: #ff5a4a; }
.ex-marker.show { animation: exMark .6s ease-out; }
@keyframes exMark { 0% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(.5); } }
/* HUD แบบในเกม */
.ex-ui { position: absolute; z-index: 5; }
.ex-hud { left: 10px; top: 10px; padding: 4px 12px; border-radius: 8px; background: rgba(20,24,40,.72); color: #fff; font-size: 14px; border: 1px solid rgba(255,255,255,.25); pointer-events: none; }
.ex-hud b { color: var(--gold-light); font-family: var(--font-head); font-weight: 600; }
.ex-mini { right: 10px; top: 10px; width: 150px; height: 150px; border-radius: 8px; overflow: hidden; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 4px 12px rgba(0,0,0,.4); cursor: crosshair; background: #000; }
.ex-mini img { width: 100%; height: 100%; display: block; opacity: .92; }
.ex-mini__me, .ex-mini__npc { position: absolute; width: 8px; height: 8px; margin: 0 0 -4px -4px; border-radius: 50%; pointer-events: none; }
.ex-mini__me { left: var(--px, 50%); bottom: var(--py, 50%); background: #ff4d4d; box-shadow: 0 0 0 2px #fff; z-index: 2; }
.ex-mini__npc { width: 6px; height: 6px; margin: 0 0 -3px -3px; background: #6fd0ff; box-shadow: 0 0 0 1.5px #0b2340; pointer-events: auto; }
.ex-zoom { right: 10px; top: 168px; display: flex; flex-direction: column; gap: 4px; }
.ex-zoom button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.5); background: rgba(20,24,40,.72); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.ex-zoom button:hover { background: rgba(31,134,199,.85); }
/* หน้าต่างพูดคุยแบบ NPC ในเกม */
.ex-dialog {
  left: 50%; bottom: 16px; transform: translateX(-50%); width: min(460px, calc(100% - 24px)); padding: 12px 16px 10px; cursor: default;
  background: linear-gradient(#ffffff, #f2f4f7); border: 1px solid #8c96a6; border-radius: 10px; box-shadow: 0 0 0 3px rgba(255,255,255,.6), 0 10px 26px rgba(0,0,0,.45);
  color: #111; font-size: 15px; line-height: 1.6; animation: fadeIn .2s ease;
}
.ex-dialog__name { margin: 0 0 4px; color: #1b4fa8; font-weight: 700; }
.ex-dialog__text { min-height: 48px; }
.ex-dialog__text b { color: #b4232a; }
.ex-dialog__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.ex-btn { padding: 4px 14px; border-radius: 6px; border: 1px solid #9aa4b4; background: linear-gradient(#ffffff, #dfe5ee); color: #1d2b44; font: inherit; font-size: 14px; cursor: pointer; }
.ex-btn:hover, .ex-btn:focus-visible { background: linear-gradient(#fff8dc, #ffe08a); border-color: #c79a2c; outline: none; }
/* ป้ายห้องแชทบนหัว NPC (waitingroom) + ร้านค้า NPC */
.ex-chat {
  position: absolute; transform: translate(-50%, -100%) scale(1.18); transform-origin: 50% 100%; white-space: nowrap; pointer-events: none;
  padding: 2px 10px 3px; border-radius: 6px; background: linear-gradient(#fffef6, #f1ead2); border: 1px solid #6b5a2e; box-shadow: 0 2px 0 rgba(0,0,0,.25);
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700; color: #3a2d0c; line-height: 1.3;
}
.ex-chat::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: #3f8ee0; vertical-align: 0; }
.ex-dialog.is-shop { width: min(600px, calc(100% - 24px)); }
.ex-shop__head { margin: 2px 0 6px; } .ex-shop__head small { color: #66708a; }
.ex-shop__note { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: #eef7ea; color: #2f5b2a; font-size: 13.5px; line-height: 1.5; }
.ex-shop__note span { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 999px; background: #3c9b46; color: #fff; font-weight: 700; font-size: 12px; }
.ex-shop__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px; max-height: min(240px, 38vh); overflow: auto; padding: 2px; }
.ex-shop__item { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #d3d9e3; border-radius: 6px;
  background: #fff; font: inherit; font-size: 13px; text-align: left; color: #1d2b44; cursor: pointer; }
.ex-shop__item:hover, .ex-shop__item:focus-visible { border-color: #c79a2c; background: #fff8dc; outline: none; }
.ex-shop__item img, .ex-shop__item i { width: 24px; height: 24px; }
.ex-shop__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-shop__item em { font-style: normal; font-size: 12px; color: #a8641a; white-space: nowrap; }
.ex-shop__loading { grid-column: 1 / -1; margin: 10px 0; text-align: center; color: #66708a; }
.ex-stat { display: block; font-size: 12px; color: #cfe3f7; }
.ex-item { display: inline-flex; align-items: center; gap: 4px; margin: 0 1px; padding: 0 4px 0 1px; border: 0; border-radius: 5px; background: none;
  color: inherit; font: inherit; cursor: pointer; vertical-align: middle; }
.ex-item:hover { background: #fff3cc; text-decoration: underline; }
.ex-icon { width: 24px; height: 24px; flex: none; image-rendering: pixelated; vertical-align: middle; }
.ex-sys--item .ex-icon { margin: -3px 3px -3px 0; }
.ex-sys--item { border: 1px solid #c6d6ee; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.ex-sys--item:hover { background: #fff8dc; border-color: #c79a2c; }
.ex-sys { display: inline-block; margin: 2px 0; padding: 1px 8px; border-radius: 6px; background: #eef3fb; color: #2a4f86; font-size: 13px; }
.ex-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #f3dca6; font-family: var(--font-head); font-size: 18px; }
/* ล่ามอน (explorer.js) — มอนสเตอร์ / แผงแต้ม / ไอเทมที่ดรอป */
.ex-mob { pointer-events: auto; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M3 3l11 11M3 3h5M3 3v5' stroke='%23fff' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M3 3l11 11M3 3h5M3 3v5' stroke='%23b3261e' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M12 17l5-5 3 3-5 5z' fill='%23b3261e' stroke='%23fff'/%3E%3C/svg%3E") 3 3, crosshair; }
.ex-mob .ex-ent__name { color: #ffd1d1; opacity: 0; transition: opacity .15s; }
.ex-mob:hover .ex-ent__name, .ex-mob.is-target .ex-ent__name { opacity: 1; }
.ex-mob:hover .ex-ent__spr { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px #ff8a80); }
.ex-mob.is-target .ex-ent__spr { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #ff3b30); }
.ex-mob.is-dead { pointer-events: none; }
.ex-mob.is-dead .ex-ent__shadow { opacity: 0; transition: opacity .4s; }
.ex-mob.is-gone { opacity: 0; transition: opacity .4s; }
.ex-mob.is-spawn { animation: exMobIn .8s ease-out; }
@keyframes exMobIn { 0% { opacity: 0; filter: brightness(2.2); } 100% { opacity: 1; filter: none; } }
.ex-mini__mob { position: absolute; width: 4px; height: 4px; margin: 0 0 -2px -2px; border-radius: 50%; background: #ff8a3d; box-shadow: 0 0 0 1px #3a1200; pointer-events: none; }
.ex-mini__mob[hidden] { display: none; }
.ex-hunt { left: 10px; top: 62px; max-width: min(300px, calc(100% - 190px)); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 10px;
  border-radius: 8px; background: rgba(20,24,40,.8); color: #fff; font-size: 13px; border: 1px solid rgba(255,255,255,.25); cursor: default; }
.ex-hunt[hidden] { display: none; }
.ex-hunt__title { color: #ffb4a8; font-family: var(--font-head); font-weight: 600; }
.ex-hunt a { color: #9fd6ff; font-weight: 600; }
.ex-hunt__pts { color: var(--gold-light); font-size: 15px; }
.ex-hunt__pending { color: #b8f5c8; font-size: 12px; }
.ex-hunt__btns { display: flex; gap: 6px; margin-left: auto; }
.ex-hunt__btns button, .ex-hunt__btns a { padding: 2px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.1); color: #fff;
  font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.ex-hunt__btns button:hover, .ex-hunt__btns a:hover { background: rgba(31,134,199,.85); }
.ex-hunt__drops { flex: 1 1 100%; margin-top: 4px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.2); }
.ex-hunt__drops p { margin: 0 0 4px; font-size: 12px; color: #cfe3f7; }
.ex-hunt__drops ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ex-hunt__drops li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 5px; cursor: pointer; }
.ex-hunt__drops li:hover { background: rgba(255,255,255,.12); }
.ex-hunt__drops em { font-style: normal; font-weight: 700; color: var(--gold-light); }
.ex-hunt__drops .ex-hunt__note { margin: 6px 0 0; }
.ex-hunt__drops .ex-hunt__note b { color: #fff; }
.ex-toast { left: 50%; top: 12px; transform: translate(-50%, -8px); max-width: min(520px, calc(100% - 200px)); padding: 8px 14px; border-radius: 10px; opacity: 0; pointer-events: none;
  background: rgba(20,24,40,.9); color: #fff; font-size: 14px; line-height: 1.5; text-align: center; border: 1px solid rgba(255,255,255,.3); transition: opacity .25s, transform .25s; }
.ex-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ex-toast.is-warn { border-color: #ffb36b; }
.ex-toast.is-good { border-color: #7be39b; background: rgba(16,58,36,.92); }
.ex-toast a { color: #9fd6ff; font-weight: 600; }
.ex-toast small { display: block; font-size: 12px; color: #cfe3f7; }
.ex-toast b { color: var(--gold-light); }
.ex-drop { position: absolute; z-index: 99998; display: flex; align-items: center; gap: 3px; transform: translate(-50%, -50%); pointer-events: none;
  animation: exDrop 3.3s ease-out both; }
.ex-drop img { width: 24px; height: 24px; image-rendering: pixelated; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.ex-drop span { padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
@keyframes exDrop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  12% { opacity: 1; transform: translate(calc(-50% + var(--dx) * .5), calc(-50% - 36px)) scale(1.1); }
  25% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); }
  85% { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) - 18px)); }
}
.ex-float { position: absolute; z-index: 99999; transform: translate(-50%, 0); pointer-events: none; color: #ffd75e; font: 800 16px var(--font-head);
  text-shadow: 0 0 3px #000, 0 2px 2px #000; animation: exFloat 1.4s ease-out forwards; white-space: nowrap; }
@keyframes exFloat { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }
.acc-member { margin-bottom: 10px; }

/* cutin ของสคริปต์ NPC (เช่นวงล้อ Lucky Spin) — ตำแหน่งแบบในเกม 0 ซ้ายล่าง · 1 กลางล่าง · 2 ขวาล่าง · 3/4 กลางจอ */
.ex-cutin { pointer-events: none; width: min(340px, 58%); aspect-ratio: 1; }
.ex-cutin[hidden] { display: none; }
.ex-cutin img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.45)); }
.ex-cutin.is-pos0 { left: 12px; bottom: 12px; }
.ex-cutin.is-pos1 { left: 50%; bottom: 12px; transform: translateX(-50%); }
.ex-cutin.is-pos2 { right: 12px; bottom: 12px; }
.ex-cutin.is-pos3, .ex-cutin.is-pos4 { left: 50%; top: 46%; transform: translate(-50%, -50%); }
.ex-cutin__pointer { position: absolute; left: 50%; top: -6px; width: 0; height: 0; margin-left: -14px; border: 14px solid transparent; border-top: 26px solid #e5484d;
  border-bottom: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.ex-cutin__pointer::after { content: ''; position: absolute; left: -6px; top: -24px; width: 12px; height: 12px; border-radius: 50%; background: #fff3c4; }
.ex-dialog:not([hidden]) ~ .ex-cutin.is-pos4, .ex-cutin.is-pos4:has(~ .ex-dialog:not([hidden])) { top: 40%; }
.ex-toast.is-ann { border-color: #ffd75e; background: rgba(60,40,0,.92); }
.ex-ann { color: #ffe680; font-weight: 600; }
@media (max-width: 760px) { .ex-cutin { width: min(260px, 70%); } }

@media (max-width: 760px) {
  .explore-zone { --gs: .5; padding: 0 10px 46px; }
  .ex-gate { margin: 0 -10px 18px; }
  .ex-head { padding: 14px 18px 12px; }
  .ex-frame { height: 70vh; border-width: 3px; }
  .ex-mini { width: 96px; height: 96px; }
  .ex-zoom { top: 112px; }
  .ex-hud { font-size: 12.5px; }
  .ex-dialog { font-size: 14px; bottom: 10px; }
  .ex-hunt { top: 60px; max-width: calc(100% - 128px); font-size: 12px; }
  .ex-toast { top: auto; bottom: 12px; max-width: calc(100% - 24px); font-size: 13px; }
}

/* พ่อค้าเครดิตที่ลงทะเบียน (js/merchants.js) — พ่อค้า/แม่ค้าเดินข้างทางเดินฝั่งซ้าย */
.mc-layer { position: absolute; left: 0; top: 0; width: calc(var(--road-x) - var(--path-w) / 2 - 30px); height: 100%; z-index: 3; pointer-events: none; }
.mc { position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; will-change: transform; outline: none; }
.mc__spr { position: absolute; inset: 0; background-repeat: no-repeat; }
.mc__shadow { position: absolute; width: 36px; height: 12px; margin: -6px 0 0 -18px; border-radius: 50%; background: rgba(0,0,0,.28); }
.mc:hover .mc__spr, .mc:focus-visible .mc__spr { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px var(--gold)); }
.mc__logo { position: absolute; transform: translate(-50%, -100%); padding: 2px; border-radius: 6px; background: rgba(255,255,255,.92);
  border: 1.5px solid #a8641a; box-shadow: 0 2px 4px rgba(0,0,0,.3); line-height: 0; }
.mc__logo img, .mc__logo i { display: block; width: 24px; height: 24px; object-fit: contain; }
.mc__name { position: absolute; transform: translateX(-50%); white-space: nowrap; pointer-events: none; padding: 0 6px; border-radius: 4px;
  font-family: var(--font-head); font-size: 12.5px; font-weight: 500; color: #fff; background: rgba(90,50,5,.72); }
.mc__say {
  position: absolute; transform: translate(-50%, -100%); max-width: 190px; width: max-content; padding: 4px 10px; border-radius: 10px; pointer-events: none;
  background: #fff; border: 1.5px solid #5a3205; color: #2a1a05; font-size: 13px; line-height: 1.35; text-align: center; box-shadow: 0 3px 8px rgba(0,0,0,.25);
  opacity: 0; z-index: 2;
}
.mc__say::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -6px; border: 6px solid transparent; border-top-color: #5a3205; border-bottom: 0; }
.mc__say.show { animation: mcSay 5s ease forwards; }
@keyframes mcSay { 0% { opacity: 0; transform: translate(-50%, -90%); } 6%, 85% { opacity: 1; transform: translate(-50%, -100%); } 100% { opacity: 0; transform: translate(-50%, -100%); } }
.mc-card {
  position: absolute; z-index: 100000; width: 270px; padding: 12px 14px 12px; border-radius: 12px; pointer-events: auto;
  background: linear-gradient(#fffdf6, #f6ecd6); border: 2px solid #a8641a; box-shadow: 0 10px 26px rgba(40,25,5,.35); font-size: 14px; color: #3a2a10;
}
.mc-card p { margin: 6px 0 0; line-height: 1.5; }
.mc-card__x { position: absolute; right: 6px; top: 4px; border: 0; background: none; font-size: 20px; line-height: 1; color: #8a6a3a; cursor: pointer; }
.mc-card__head { display: flex; align-items: center; gap: 10px; padding-right: 16px; }
.mc-card__head img { width: 36px; height: 36px; object-fit: contain; padding: 3px; border-radius: 8px; background: #fff; border: 1px solid #d8c29a; }
.mc-card__head b { display: block; font-family: var(--font-head); font-size: 16px; color: #5a3205; line-height: 1.3; }
.mc-card__head small { color: #8a6a3a; }
.mc-card__ok { display: inline-block; margin: 8px 0 2px; padding: 1px 10px; border-radius: 999px; background: #e3f6ea; color: #1d7a45; font-size: 12.5px; font-weight: 700; }
.mc-card__kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 6px 0 0; }
.mc-card__kv div { padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.75); border: 1px solid #e3d3b3; }
.mc-card__kv dt { font-size: 11.5px; color: #8a6a3a; } .mc-card__kv dd { margin: 0; font-weight: 700; font-size: 13px; color: #5a3205; }
.mc-card__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mc-btn { flex: 1; padding: 5px 8px; border-radius: 8px; text-align: center; font-family: var(--font-head); font-size: 13.5px; color: #fff; text-decoration: none; }
.mc-btn--facebook { background: #1877f2; } .mc-btn--line { background: #06c755; } .mc-btn--discord { background: #5865f2; }
.mc-btn:hover { filter: brightness(1.1); }
.mc-card__warn { font-size: 11.5px; color: #9a5a00; line-height: 1.4; }

/* ---------- ระบบสมาชิก (forms.js + api/) ---------- */
.captcha:empty { display: none; }
.captcha { margin: 6px 0 14px; min-height: 65px; display: flex; justify-content: center; }
.form-mode { margin: 10px 0 0; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45;
  color: #7a4f2a; background: #fff6df; border: 1px dashed #e5bf72; text-align: center; }
.auth-btn { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-btn.is-user { background: linear-gradient(#fff, #e8f4fc); color: var(--sea-dark); border: 2px solid var(--sea-light); box-shadow: none; }
.auth-btn.is-user::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2px #c9f0d8; vertical-align: 1px; }
.acc-sub { margin: 14px 0 10px; font-size: 16px; }
.acc-chars { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.acc-chars li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 12px;
  border-radius: 10px; background: #f3f8fc; border: 1px solid #d8e7f3; }
.acc-chars b { font-family: var(--font-head); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.acc-chars span { grid-column: 1; font-size: 13px; color: var(--muted); }
.acc-chars em { grid-row: 1 / span 2; grid-column: 2; font-style: normal; font-size: 12px; font-weight: 600; color: var(--green);
  background: #e3f6ea; padding: 3px 8px; border-radius: 99px; }
.acc-chars .acc-empty { display: block; color: var(--muted); font-size: 14px; text-align: center; background: #fafcfe; border-style: dashed; }

/* ---------- แชร์ข่าวรับแต้ม (share.js) ---------- */
.btn--fb { background: linear-gradient(#3b82f6, #1864d6); color: #fff; border: 0; box-shadow: 0 3px 0 #0f4aa3; }
.btn--fb:hover { filter: brightness(1.06); }
.btn--fb:active { box-shadow: 0 1px 0 #0f4aa3; transform: translateY(2px); }
.share-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 22px 0 0;
  padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #eef5ff, #fff8e6); border: 2px solid #cfe0f7; }
.share-box.is-done { background: #f0faf4; border-color: #bfe6cf; }
.share-box__main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 320px; }
.share-box__icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #1877f2; color: #fff; font: 700 24px/1 Arial, sans-serif; box-shadow: 0 2px 0 #0f4aa3; }
.share-box__text { display: grid; gap: 2px; min-width: 0; }
.share-box__text b { font-family: var(--font-head); font-weight: 600; color: var(--navy-800); font-size: 16px; }
.share-box__text small { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.share-box__text small a { color: var(--sea-dark); font-weight: 600; }
.share-box.is-done .share-box__text small { color: var(--green); font-weight: 600; }
.share-box__reward { flex: none; padding: 4px 10px; border-radius: 99px; font: 600 13px var(--font-head); color: #7a4f2a;
  background: linear-gradient(var(--gold-light), var(--gold)); box-shadow: 0 2px 0 var(--gold-dark); }
.share-box__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-box__rule { order: 3; flex: 1 1 100%; margin: 0; padding: 7px 10px; border-radius: 8px; font-size: 13px; line-height: 1.5;
  color: #7a4f2a; background: rgba(255,255,255,.7); border: 1px dashed #e5bf72; }
.share-box__rule b { color: #1864d6; }
.acc-points { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; margin: 6px 0 0; padding: 10px 14px;
  border-radius: 12px; background: linear-gradient(135deg, #fff8e6, #fff1cc); border: 1px solid #f0d28f; }
.acc-points[hidden] { display: none; }
.acc-points span { font-weight: 600; color: #7a4f2a; }
.acc-points b { font: 700 22px var(--font-head); color: var(--gold-dark); text-align: right; }
.acc-points small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
@media (max-width: 560px) {
  .share-box__actions, .share-box__actions .btn { width: 100%; }
}

/* ---------- หน้าสมาชิก (member.html / js/member.js) ---------- */
.member { padding-top: 26px; }
.mb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.mb-head .panel__title { margin: 0; }
.mb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.mb-stat { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #f3f8fc; border: 1px solid #d8e7f3; }
.mb-stat small { color: var(--muted); font-weight: 600; }
.mb-stat b { font: 700 28px/1.1 var(--font-head); color: var(--navy-800); }
.mb-stat span { font-size: 12.5px; color: var(--muted); }
.mb-stat a { color: var(--sea-dark); font-weight: 600; }
.mb-stat--gold { background: linear-gradient(135deg, #fff8e6, #fff1cc); border-color: #f0d28f; }
.mb-stat--gold b { color: var(--gold-dark); }
.mb-howto { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #effaf3; border: 1px dashed #9fd8b4; color: #1d5b39; font-size: 14.5px; line-height: 1.6; }
.mb-howto small { display: block; color: #4b7a5f; font-size: 12.5px; }
.mb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mb-empty, .mb-login p { color: var(--muted); }
.mb-empty a, .mb-login a { color: var(--sea-dark); font-weight: 600; }
.mb-login { text-align: center; padding: 20px 0 6px; }
.mb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mb-table th { text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--paper-300); white-space: nowrap; }
.mb-table td { padding: 9px 10px; border-bottom: 1px solid #e3edf6; vertical-align: top; }
.mb-table td:first-child { white-space: nowrap; color: var(--muted); }
.mb-table a { color: var(--sea-dark); font-weight: 600; }
.mb-minus { color: var(--coral); font-weight: 700; }
.mb-plus { color: var(--green); font-weight: 700; }
.mb-item { display: inline-flex; align-items: center; gap: 5px; margin: 1px 2px 1px 0; padding: 2px 8px 2px 3px; border-radius: 99px; background: #fff; border: 1px solid #d8e7f3; font-size: 13px; }
.mb-item img, .mb-item i { width: 24px; height: 24px; flex: none; }
.mb-item i { border-radius: 50%; background: var(--paper-200); }
.mb-item.is-claimed { opacity: .7; }
.mb-flag { font-style: normal; font-size: 11.5px; font-weight: 700; color: #b36b00; margin: 0 8px 0 2px; }
.mb-flag.is-claimed { color: var(--green); }
.mb-none { color: var(--muted); font-size: 13px; }
.mb-pending { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mb-pending li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: #fff8e6; border: 1px solid #f0d28f; }
.mb-pending small { color: var(--muted); font-size: 12px; padding-left: 4px; }
.mb-pending .mb-item { background: transparent; border: 0; font-size: 14px; font-weight: 600; }
.mb-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) {
  .mb-stats { grid-template-columns: 1fr 1fr; }
  .mb-stats .mb-stat--gold { grid-column: 1 / -1; }
  .mb-table thead { display: none; }
  .mb-table, .mb-table tbody, .mb-table tr, .mb-table td { display: block; width: 100%; }
  .mb-table tr { padding: 8px 0; border-bottom: 1px solid #e3edf6; }
  .mb-table td { border: 0; padding: 2px 0; }
  .mb-table td::before { content: attr(data-th) ': '; color: var(--muted); font-size: 12.5px; }
}

/* แอนิเมชันที่อยู่นอกจอ: หยุดชั่วคราว (main.js) — ประหยัด CPU/แบตเตอรี่ ภาพที่เห็นเหมือนเดิม */
.anim-off, .anim-off *, .anim-off *::before, .anim-off *::after { animation-play-state: paused !important; }

/* ---------- 10) Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(20, 10, 5, .72); backdrop-filter: blur(3px); animation: fadeIn .2s ease;
}
.modal__box {
  position: relative; width: min(440px, 100%); max-height: 86vh; overflow: auto;
  padding: 34px 30px 28px; border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 30%, #fbfdff 0%, var(--paper-50) 55%, var(--paper-100) 100%);
  border: 3px solid #1d4f80; box-shadow: 0 0 0 4px var(--paper-300), 0 0 0 7px var(--navy-700), 0 24px 60px rgba(0,0,0,.5);
}
.modal__box--wide { width: min(660px, 100%); }
.modal__close {
  position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--paper-300); background: #fbfdff;
}
.modal__close::before, .modal__close::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 2.5px; margin: -1px 0 0 -8px;
  background: var(--navy-700); border-radius: 2px; transform: rotate(45deg);
}
.modal__close::after { transform: rotate(-45deg); }
.modal__title { font-size: 26px; color: var(--navy-800); margin-bottom: 16px; padding-right: 30px; }
.modal__title.center { padding-right: 0; }
.modal__meta { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.modal__body p { margin: 0 0 10px; }
.rules { padding-left: 22px; }
.rules li { margin-bottom: 6px; }
.msg-icon {
  width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-size: 36px; font-weight: 700; color: #fff;
}
.msg-icon--success { background: var(--green); }
.msg-icon--success::before { content: '✓'; }
.msg-icon--error { background: var(--coral); }
.msg-icon--error::before { content: '!'; }
.msg-icon--info { background: var(--sea); }
.msg-icon--info::before { content: 'i'; }
#modalMsg p { margin: 0 0 20px; }

/* ---------- 11) Responsive ---------- */
@media (max-width: 1240px) {
  .nav__link { padding: 8px 10px; font-size: 15px; }
  .bgm__txt { display: none; }
}

/* แท็บเล็ต + มือถือ: ใช้ภาพพื้นหลังแบบมือถือ กรอบเนื้อหาเต็มความกว้าง */
@media (max-width: 1080px) and (min-width: 761px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .srv-hero { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1080px) {
  :root { --header-h: 58px; --road-x: 23vw; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: rgba(11,35,64,.97); border-bottom: 5px solid var(--sea);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .25s;
  }
  .nav-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav__link { padding: 12px 8px; font-size: 17px; border-bottom: 1px solid rgba(210,230,247,.12); }
  .nav__link.is-active::after { left: auto; right: 10px; top: 50%; margin-top: -4px; }
  .logo { margin-right: auto; }
  .lvbar__info { min-width: 80px; }

  :root { --path-w: 20vw; --k: .8; }
  .town-row__side--left { display: none; }
  .street::before, .street::after { width: 26px; }
  .journey { background-size: 150px 150px, auto; }
  .street::before { left: -18px; }
  .street::after { right: -18px; }
  .stage { padding: 14px 0; }
  .panel { margin: 0 auto; width: calc(100% - 32px); max-width: 760px; padding: 30px 22px 28px; }
  .walker { left: calc(var(--road-x) - 6.5vw); width: 13vw; max-width: 100px; top: auto; bottom: 6vh; }
}

@media (max-width: 760px) {
  .lvbar__info { display: none; }
  .header .btn--gold { padding: 6px 10px; font-size: 13px; }
  .logo__text { font-size: 20px; letter-spacing: .04em; }
  .logo__img { height: 40px; }
  .hero__tagline { font-size: 15px; border-radius: 14px; }
  .btn--lg { padding: 12px 22px; font-size: 17px; }

  .news-grid { grid-template-columns: 1fr; gap: 12px; }
  .tabs--news { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .tabs--news .tab { flex: none; }
  .srv-live { grid-template-columns: 1fr 1fr; }
  .srv-hero { grid-template-columns: 1fr 1fr; }
  .srv-hero__item:last-child { grid-column: 1 / -1; }
  .srv-hero__item b { font-size: 20px; }
  .srv-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .srv-tile__value { font-size: 19px; }
  .war-hero { padding: 16px; gap: 12px; }
  .war-hero .it-icon { width: 48px; height: 48px; }
  .war-hero__time { font-size: 21px; white-space: nowrap; }
  .srv-cols, .balance, .cmd-grid, .check-list, .timeline { grid-template-columns: 1fr; }
  .timeline li:first-child { border-radius: 10px 10px 0 0; } .timeline li:last-child { border-radius: 0 0 10px 10px; }
  .war-hero { grid-template-columns: auto 1fr; } .war-hero__members { grid-column: 1 / -1; }
  .srv-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .srv-tabs .tab { flex: none; }
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .skill-grid { grid-template-columns: 1fr; }
  .srv-block { padding: 14px 12px; }
  .steps { grid-template-columns: 1fr; }
  .step { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; text-align: left; padding: 12px 14px; }
  .step__num { margin: 0; grid-row: span 2; }
  .step b { font-size: 16px; }
  .step:not(:last-child)::after { display: none; }
  .start-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .wm-counts { grid-template-columns: 1fr 1fr; }
  .wm-hint { display: block; }
  .wm-sub { display: none; }
  .wm-counts dd { font-size: 20px; }
  .dun-grid { grid-template-columns: 1fr; }
  .wm-legend { font-size: 12px; }
  .mob-table { font-size: 13px; }
  :root { --k: .56; }
  .town-row--harbor .sail:nth-child(3) { display: none; }
}

@media (max-aspect-ratio: 1/1) {
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 128vw); padding-bottom: 84px;
          background: linear-gradient(#f4f7fb, #cdc8c0); }
  .hero__video { height: calc(var(--header-h) + 150vw); bottom: auto; object-position: 50% 30%; }
  .hero__shade { height: calc(var(--header-h) + 150vw);
    background: linear-gradient(180deg, rgba(14,18,48,.62) 0, rgba(14,18,48,0) 120px),
                linear-gradient(0deg, rgba(244,247,251,.95) 0, rgba(244,247,251,0) 26%); }
  .hero__clouds { height: 90px; }
  .hero__tagline { background: rgba(11,35,64,.6); }
}

@media (max-width: 400px) {
  .bgm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sail { animation: none !important; transform: translateX(calc(var(--i, 0) * 1px)); }
  .sail:nth-child(2) { left: 36%; } .sail:nth-child(3) { left: 72%; }
  .sail__wake { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ตาราง REFINE OPTION ในข่าว (js/refine.js + js/refine-data.js) */
.article-wrap--wide { max-width: 1240px; }
.modal__box--xl { width: min(1120px, 100%); }
.refine { margin: 6px 0 4px; font-size: 15px; line-height: 1.5; }
.rf-groups { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 5px; margin: 0 0 14px; border-radius: 14px; background: var(--paper-200); }
.rf-group {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--navy-700); font-family: var(--font-head); transition: background .15s, color .15s;
}
.rf-group b { font-size: 19px; font-weight: 600; }
.rf-group small { font-size: 13px; color: var(--muted); font-family: var(--font-body); }
.rf-group img { width: 24px; height: 24px; padding: 4px; box-sizing: content-box; border-radius: 8px; background: rgba(255,255,255,.75); }
.rf-group:hover { background: rgba(255,255,255,.6); }
.rf-group.is-active { background: linear-gradient(135deg, var(--navy-800), var(--sea-dark)); color: #fff; box-shadow: 0 3px 10px rgba(11,35,64,.25); }
.rf-group.is-active small { color: var(--paper-200); }
.rf-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin: 0 0 10px; }
.rf-cats { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 520px; min-width: 0; max-width: 100%; }
.rf-cat { padding: 4px 12px 4px 6px; line-height: 1.3; }
.rf-cat img { width: 24px; height: 24px; }
.rf-search { flex: 0 1 230px; margin-left: auto; }
.rf-search input {
  width: 100%; padding: 8px 14px 8px 34px; border-radius: 999px; border: 2px solid var(--paper-300); font: inherit; font-size: 14.5px; color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234f6e8e' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") 12px center no-repeat;
}
.rf-search input:focus { outline: none; border-color: var(--sea); }
.rf-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0 0 12px; border-bottom: 2px dashed var(--paper-300); }
.rf-jump:empty { display: none; }
.rf-jump__item {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 5px; border-radius: 999px; text-decoration: none; font-size: 14px;
  background: var(--paper-50); border: 1px solid var(--paper-300); color: var(--navy-800); transition: border-color .15s, background .15s;
}
.rf-jump__item:hover { border-color: var(--sea-light); background: #fff; }
.rf-jump__item img { width: 24px; height: 24px; }
.rf-item {
  margin: 0 0 18px; border-radius: 14px; overflow: hidden; background: #fff; border: 2px solid var(--paper-300);
  box-shadow: 0 4px 14px rgba(11,35,64,.08); scroll-margin-top: calc(var(--header-h) + 14px);
}
.rf-item.is-flash { animation: rf-flash 1.2s ease-out; }
@keyframes rf-flash { 0%, 30% { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242,179,61,.45); } }
.rf-item__head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: linear-gradient(135deg, var(--navy-800), var(--sea-dark)); color: #fff; }
.rf-item__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: radial-gradient(circle, #fff 55%, var(--paper-100)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.rf-item__icon img { width: 24px; height: 24px; }
.rf-item__name { margin: 0; font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.25; color: #fff; }
.rf-item__name small { font-size: 15px; font-weight: 500; color: var(--gold-light); }
.rf-item__cat { margin-left: auto; padding: 2px 12px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 13px; color: var(--paper-100); white-space: nowrap; }
.rf-wrap { overflow-x: auto; }
.rf-also { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; background: var(--paper-50); border-bottom: 1px solid var(--paper-200); }
.rf-also > small { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.rf-also__item { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--paper-300); font-size: 13.5px; font-weight: 600; color: var(--navy-800); }
.rf-also__item:has(img) { padding-left: 4px; }
.rf-also__item img { width: 24px; height: 24px; }
.rf-also__item small { color: var(--muted); font-weight: 400; }
.rf-nogvg { display: inline-block; padding: 0 5px; border-radius: 4px; background: #a5321d; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.rf-table { width: 100%; min-width: calc(74px + var(--cols, 9) * 112px); border-collapse: separate; border-spacing: 0; font-size: 13.5px; line-height: 1.4; }
.rf-table th, .rf-table td { padding: 7px 8px; text-align: center; vertical-align: middle; }
.rf-table thead th {
  background: var(--paper-100); color: var(--navy-800); font-family: var(--font-head); font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid var(--paper-300); vertical-align: bottom;
}
.rf-table td { border-top: 1px solid var(--paper-200); border-left: 1px solid var(--paper-100); color: var(--ink); }
.rf-table td b { color: var(--sea-dark); font-weight: 700; white-space: nowrap; }
.rf-table td.is-empty { color: var(--paper-400); }
.rf-table td.is-new { background: #fff6dc; }
.rf-table td.is-new b { color: var(--gold-dark); }
.rf-table tbody tr:nth-child(even) td:not(.is-new) { background: var(--paper-50); }
.rf-table tbody tr:hover td { background: #e3f1fc; }
.rf-table .rf-lv { position: sticky; left: 0; z-index: 1; width: 74px; background: #fff; border-right: 2px solid var(--paper-200); }
.rf-table thead .rf-lv { z-index: 2; background: var(--paper-100); }
.rf-table tbody .rf-lv { border-top: 1px solid var(--paper-200); }
.rf-lv span { display: inline-block; min-width: 46px; padding: 2px 8px; border-radius: 999px; font-family: var(--font-head); font-size: 14px; font-weight: 600; }
.rf-t1 .rf-lv span { background: var(--paper-200); color: var(--navy-700); }
.rf-t2 .rf-lv span { background: var(--sea); color: #fff; }
.rf-t3 .rf-lv span { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #5a3205; }
.rf-t4 .rf-lv span { background: linear-gradient(135deg, #ff9b6b, var(--coral)); color: #fff; box-shadow: 0 0 0 2px rgba(226,89,59,.25); }
.rf-empty { margin: 0; padding: 26px 10px; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .rf-group { flex-direction: column; gap: 2px; padding: 8px 6px; }
  .rf-group b { font-size: 17px; }
  .rf-group img { display: none; }
  .rf-tools { flex-direction: column; align-items: stretch; }
  .rf-cats { flex-wrap: nowrap; flex-basis: auto; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .rf-cat { flex: none; }
  .rf-search { flex-basis: auto; margin-left: 0; }
  .rf-jump { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rf-jump__item { flex: none; }
  .rf-item__head { padding: 9px 12px; gap: 10px; }
  .rf-item__name { font-size: 17px; }
  .rf-item__cat { display: none; }
  .rf-table { font-size: 13px; min-width: calc(62px + var(--cols, 9) * 100px); }
  .rf-table .rf-lv { width: 62px; }
  .rf-lv span { min-width: 40px; padding: 2px 6px; font-size: 13px; }
}

/* ข่าวระบบร้านค้านักผจญภัย (js/adventure.js + js/adventure-data.js) */
.adv { margin: 6px 0 4px; font-size: 15px; line-height: 1.55; }
.adv-steps { counter-reset: st; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px !important; padding: 0 !important; list-style: none; }
.adv-steps li { counter-increment: st; position: relative; margin: 0 !important; padding: 14px 14px 14px 58px; border-radius: 14px; background: #fff; border: 2px solid var(--paper-300); }
.adv-steps li::before {
  content: counter(st); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy-800), var(--sea-dark)); color: #fff; font-family: var(--font-head); font-weight: 600;
}
.adv-steps b { display: block; font-family: var(--font-head); font-weight: 600; color: var(--navy-800); font-size: 16.5px; }
.adv-steps span { display: block; font-size: 14px; color: var(--muted); line-height: 1.5; }
.adv-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px !important; padding: 0 !important; list-style: none; }
.adv-facts li { margin: 0 !important; padding: 10px 14px; border-radius: 12px; background: var(--paper-100); border: 1px solid var(--paper-300); line-height: 1.35; }
.adv-facts small { display: block; font-size: 12.5px; color: var(--muted); }
.adv-facts b { display: block; font-family: var(--font-head); font-weight: 600; color: var(--sea-dark); font-size: 17px; }
.adv-facts span { font-size: 13.5px; color: var(--ink); }
.adv-h { margin: 6px 0 10px; font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--navy-800); }
.adv-h small { font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.adv-rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 0 0 18px; }
.adv-reward {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #fffaf0, #fff3d6); border: 2px solid #f0d08a; line-height: 1.35;
}
.adv-reward__icon { grid-row: span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 2px #f3dca6; }
.adv-reward b { font-family: var(--font-head); font-weight: 600; color: var(--navy-800); font-size: 16.5px; }
.adv-reward small { display: block; font-size: 12.5px; color: var(--muted); }
.adv-reward p { margin: 0 !important; color: var(--gold-dark); font-size: 14px; }
.adv-reward p b { color: var(--gold-dark); font-size: 18px; }
.adv-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.adv-tools .rf-search { flex: 1 1 260px; max-width: 360px; margin: 0; }
.adv-wrap { border-radius: 14px; overflow: hidden; border: 2px solid var(--paper-300); background: #fff; }
.adv-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.adv-table th { background: var(--navy-800); color: #fff; font-family: var(--font-head); font-weight: 500; font-size: 14px; padding: 9px 12px; text-align: left; }
.adv-table td { padding: 7px 12px; border-top: 1px solid var(--paper-200); vertical-align: middle; }
.adv-table tbody tr:nth-child(even) td { background: var(--paper-50); }
.adv-table tbody tr:hover td { background: #e3f1fc; }
.adv-item { display: flex; align-items: center; gap: 10px; }
.adv-item img { width: 24px; height: 24px; flex: none; }
.adv-item b { font-weight: 600; color: var(--navy-800); }
.adv-table .adv-pt { width: 150px; text-align: right; white-space: nowrap; }
td.adv-pt b { color: var(--sea-dark); font-size: 15.5px; }
.adv-by { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.adv-by span { padding: 1px 9px; border-radius: 999px; background: var(--paper-100); border: 1px solid var(--paper-300); font-size: 13px; color: var(--navy-700); white-space: nowrap; }
.adv-by small { color: var(--muted); }
.adv-by .is-empty { background: none; border: 0; color: var(--paper-400); }
@media (max-width: 760px) {
  .adv-steps, .adv-facts { grid-template-columns: 1fr; gap: 8px; }
  .adv-tools .rf-search { max-width: none; }
  .adv-tools .db-select { flex: 1 1 100%; }
  .adv-table thead { display: none; }
  .adv-table, .adv-table tbody, .adv-table tr { display: block; }
  .adv-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 12px; border-top: 1px solid var(--paper-200); }
  .adv-table tbody tr:nth-child(even) { background: var(--paper-50); }
  .adv-table td { padding: 0; border: 0; background: none !important; }
  .adv-table .adv-pt { width: auto; }
  .adv-by { grid-column: 1 / -1; }
}

/* ข่าวออปชันเทียร์ (js/tier.js + js/tier-data.js) — ใช้ปุ่ม/ค้นหาร่วมกับ REFINE (.rf-*) */
.tier { margin: 6px 0 4px; font-size: 15px; line-height: 1.5; }
.tier .rf-cat { text-decoration: none; }
.tr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tr-card {
  border-radius: 14px; overflow: hidden; background: #fff; border: 2px solid var(--paper-300);
  box-shadow: 0 4px 14px rgba(11,35,64,.08); scroll-margin-top: calc(var(--header-h) + 14px);
}
.tr-card.is-flash { animation: rf-flash 1.2s ease-out; }
.tr-card__head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: linear-gradient(135deg, var(--navy-800), var(--sea-dark)); color: #fff; }
.tr-card__head h3 { margin: 0; font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.25; color: #fff; }
.tr-card__head h3 small { font-size: 13.5px; font-weight: 400; color: var(--paper-200); margin-left: 4px; }
.tr-badge { margin-left: auto; padding: 2px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #5a3205; font-family: var(--font-head); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tr-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; background: var(--paper-50); border-bottom: 1px solid var(--paper-200); }
.tr-item { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 4px; border-radius: 999px; background: #fff; border: 1px solid var(--paper-300); font-size: 14px; color: var(--navy-800); font-weight: 600; }
.tr-item img { width: 24px; height: 24px; }
.tr-item small { color: var(--muted); font-weight: 400; }
.tr-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tr-table th, .tr-table td { padding: 7px 12px; border-top: 1px solid var(--paper-200); vertical-align: middle; }
.tr-table thead th { border-top: 0; background: var(--paper-100); color: var(--navy-800); font-family: var(--font-head); font-size: 13px; font-weight: 500; text-align: left; }
.tr-table tbody th { font-weight: 600; color: var(--navy-800); text-align: left; }
.tr-table tbody tr:nth-child(even) > * { background: var(--paper-50); }
.tr-table .tr-min, .tr-table .tr-max { width: 70px; text-align: center; white-space: nowrap; }
.tr-table td.tr-min { color: #c0392b; font-weight: 700; }
.tr-table td.tr-max { color: var(--green); font-weight: 700; }
.tr-table .tr-range { width: 34%; }
.tr-table thead .tr-range { text-align: center; }
.tr-bar { position: relative; display: block; height: 10px; border-radius: 999px; background: var(--paper-200); overflow: hidden; }
.tr-bar i { position: absolute; top: 0; bottom: 0; }
.tr-bar__neg { left: 0; background: linear-gradient(90deg, #f3a59a, #e8796a); }
.tr-bar__pos { background: linear-gradient(90deg, #8fd9b0, var(--green)); }
.tr-bar b { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--navy-800); }
@media (max-width: 960px) { .tr-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .tr-card__head { padding: 9px 12px; gap: 10px; }
  .tr-card__head h3 { font-size: 17px; }
  .tr-table { font-size: 13.5px; }
  .tr-table th, .tr-table td { padding: 7px 8px; }
  .tr-table .tr-min, .tr-table .tr-max { width: 54px; }
  .tr-table .tr-range { width: 28%; }
}

/* ข่าว Enchantment System (js/enchant.js + js/enchant-data.js) — ตารางใช้ .adv-* ร่วมกัน */
.en { margin: 6px 0 4px; font-size: 15px; line-height: 1.55; --imm: #e0a21c; --epic: #8e44ad; --sr: #1f6fd1; --r: #22915a; --nor: #7f8c99; }
.en-hero {
  margin: 0 0 14px; padding: 18px 18px 14px; border-radius: 16px; color: #fff; text-align: center;
  background: radial-gradient(circle at 20% 0%, rgba(255,217,120,.35), transparent 45%), radial-gradient(circle at 85% 100%, rgba(186,120,255,.4), transparent 50%), linear-gradient(135deg, #1b2350, #3a1f63 55%, #143a62);
  box-shadow: 0 6px 20px rgba(27,35,80,.25);
}
.en-hero__title { margin: 0 0 12px !important; font-family: var(--font-head); font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(90deg, #ffe9a8, #ffd25a, #fff3c9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.en-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px !important; padding: 0 !important; list-style: none; }
.en-facts li { margin: 0 !important; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); line-height: 1.35; }
.en-facts small { display: block; font-size: 12.5px; color: #cdd6f6; }
.en-facts b { display: block; font-family: var(--font-head); font-size: 17px; font-weight: 600; color: #fff; }
.en-facts span { font-size: 13px; color: #e5e9fb; }
.en-facts .en-fact--imm { background: linear-gradient(135deg, rgba(255,210,90,.3), rgba(255,210,90,.12)); border-color: rgba(255,214,110,.55); }
.en-facts .en-fact--imm b { color: #ffe08a; }
.en-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.en-badge { display: inline-block; min-width: 72px; padding: 2px 10px; border-radius: 999px; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: #fff; text-align: center; }
.en-badge.en-imm { background: linear-gradient(135deg, #ffd25a, var(--imm)); color: #4a2f00; box-shadow: 0 0 0 2px rgba(255,210,90,.35); }
.en-badge.en-epic { background: linear-gradient(135deg, #b16ad3, var(--epic)); }
.en-badge.en-sr { background: linear-gradient(135deg, #4f9cf0, var(--sr)); }
.en-badge.en-r { background: linear-gradient(135deg, #47b77c, var(--r)); }
.en-badge.en-nor { background: linear-gradient(135deg, #a3adb8, var(--nor)); }
.en-info { margin: 0 0 18px !important; padding: 12px 16px 12px 36px !important; border-radius: 14px; background: var(--paper-100); border: 1px solid var(--paper-300); }
.en-info li { margin: 0 0 4px !important; }
.en-info li::marker { color: var(--gold-dark); }
.en-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 5px; margin: 0 0 12px; border-radius: 14px; background: var(--paper-200); }
.en-tab { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--navy-700); cursor: pointer; font-family: var(--font-head); line-height: 1.3; transition: background .15s, color .15s; }
.en-tab b { font-size: 16.5px; font-weight: 600; }
.en-tab small { font-size: 12.5px; color: var(--muted); font-family: var(--font-body); }
.en-tab:hover { background: rgba(255,255,255,.6); }
.en-tab.is-active { background: linear-gradient(135deg, #3a1f63, var(--navy-800)); color: #fff; box-shadow: 0 3px 10px rgba(11,35,64,.25); }
.en-tab.is-active small { color: var(--paper-200); }
.en-rune { margin: 0 0 20px; }
.en-dist { display: flex; height: 26px; margin: 0 0 10px; border-radius: 999px; overflow: hidden; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--paper-300); }
.en-dist span { display: grid; place-items: center; min-width: 6px; font-family: var(--font-head); font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; }
.en-dist .en-imm { background: linear-gradient(135deg, #ffd25a, var(--imm)); color: #4a2f00; }
.en-dist .en-epic { background: var(--epic); } .en-dist .en-sr { background: var(--sr); } .en-dist .en-r { background: var(--r); } .en-dist .en-nor { background: var(--nor); }
.en-gem { display: inline-block; width: 22px; height: 22px; flex: none; transform: rotate(45deg) scale(.78); border-radius: 5px; box-shadow: inset -3px -3px 0 rgba(0,0,0,.18), inset 3px 3px 0 rgba(255,255,255,.45); }
.en-gem.en-imm { background: linear-gradient(135deg, #fff1b8, #ffd25a 45%, var(--imm)); }
.en-gem.en-epic { background: linear-gradient(135deg, #e3c2f2, #b16ad3 45%, var(--epic)); }
.en-gem.en-sr { background: linear-gradient(135deg, #cfe4ff, #4f9cf0 45%, var(--sr)); }
.en-gem.en-r { background: linear-gradient(135deg, #c9efd9, #47b77c 45%, var(--r)); }
.en-gem.en-nor { background: linear-gradient(135deg, #eef1f4, #a3adb8 45%, var(--nor)); }
.en-table th:first-child { width: 110px; }
.en-row.en-imm td { background: #fff8e4 !important; }
.en-row.en-imm .adv-item b { color: #8a5a00; }
.en-row.en-epic .adv-item b { color: #6c2c8c; }
.en-row.en-sr .adv-item b { color: #17519a; }
.en-fx { font-size: 14px; }
.en-nogvg { display: inline-block; margin: 2px 0; padding: 0 8px; border-radius: 6px; background: #fdecea; color: #a5321d; font-size: 13px; font-weight: 600; white-space: nowrap; }
.en-nogvg i { font-style: normal; font-size: 11px; padding: 0 4px; border-radius: 4px; background: #a5321d; color: #fff; margin-left: 2px; }
.en-table .adv-pt small, .en-shop small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.en-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.en-salvage { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 8px; }
.en-sv { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 2px solid var(--paper-300); }
.en-sv > b { font-family: var(--font-head); font-weight: 600; color: var(--navy-800); }
.en-sv span { margin-left: auto; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.en-sv span b { color: var(--sea-dark); font-size: 17px; }
.en-sv.en-imm { border-color: #f0d08a; background: #fffaf0; }
.en-shop .adv-item span b { display: block; }
.en-shop td.en-z { color: var(--gold-dark); font-weight: 700; }
.en-shop .adv-pt { width: 90px; }
.en-noimg { width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--paper-200) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%237fb3de' stroke-width='2'%3E%3Cpath d='M2 5l5-3 5 3v4l-5 3-5-3z'/%3E%3C/svg%3E") center no-repeat; }
@media (max-width: 960px) { .en-cols { grid-template-columns: 1fr; } .en-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .en-hero { padding: 14px 12px 12px; }
  .en-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .en-table tr { grid-template-columns: auto 1fr auto; }
  .en-table td:nth-child(2) { grid-column: 2 / 3; }
  .en-table td.en-fx { grid-column: 1 / -1; }
  .en-table td:last-child { grid-row: 1; grid-column: 3; }
  .en-dist span { font-size: 11px; }
  .en-dist span.is-small { font-size: 0; }
  .en-table tr.en-imm { background: #fff8e4; }
  .en-table tr.en-imm td { background: none !important; }
}

/* ข่าว RefineRate & Refine Bonus (js/refinerate.js + js/refinerate-data.js) — ใช้ .en-info/.en-tab/.adv-table ร่วมกัน */
.rr { margin: 6px 0 4px; font-size: 15px; line-height: 1.55; }
.rr-sec { margin: 0 0 22px; padding: 16px 18px 18px; border-radius: 16px; background: #fff; border: 2px solid var(--paper-300); box-shadow: 0 4px 14px rgba(11,35,64,.06); }
.rr-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; padding: 0 0 10px; border-bottom: 2px dashed var(--paper-300); font-family: var(--font-head); }
.rr-h span { font-size: 22px; font-weight: 700; color: var(--navy-800); }
.rr-h small { font-size: 14px; color: var(--muted); font-family: var(--font-body); }
.rr-h4 { margin: 16px 0 10px; font-family: var(--font-head); font-size: 17px; font-weight: 600; color: var(--navy-800); }
.rr-ores { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.rr-ore { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 5px; border-radius: 999px; background: var(--paper-50); border: 1px solid var(--paper-300); font-weight: 600; color: var(--navy-800); font-size: 14px; }
.rr-ore img { width: 24px; height: 24px; }
.rr .en-info { margin-bottom: 14px !important; }
.rr-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rr-for { margin: 0 0 8px !important; font-size: 14px; color: var(--muted); }
.rr-for b { color: var(--navy-800); }
.rr-wrap { overflow-x: auto; }
.rr-rate { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 3px; font-size: 14.5px; }
.rr-rate th { padding: 6px 4px; font-family: var(--font-head); font-weight: 500; font-size: 13.5px; color: var(--navy-800); text-align: center; }
.rr-rate thead th { background: var(--paper-100); border-radius: 8px; }
.rr-rate tbody th { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding-left: 8px; white-space: nowrap; }
.rr-rate td { padding: 8px 2px; border-radius: 8px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.rr-legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.rr-legend i { width: 120px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, hsl(120 72% 70%), hsl(60 72% 70%), hsl(0 72% 72%)); }
.rr-costume { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: linear-gradient(135deg, #fffaf0, #fff3d6); border: 2px solid #f0d08a; }
.rr-costume b { font-family: var(--font-head); font-weight: 600; color: var(--gold-dark); margin-right: 4px; }
.rr-costume span { padding: 2px 12px; border-radius: 999px; background: #fff; border: 1px solid #f0d08a; font-size: 14px; color: #6b4a10; }
.rr-note { margin: 10px 0 0 !important; font-size: 13.5px; color: var(--muted); }
.rr-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.rr-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; text-align: center; line-height: 1.3;
  background: linear-gradient(180deg, #fff, var(--paper-50)); border: 2px solid var(--paper-300); }
.rr-slot i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--paper-100); font-style: normal; }
.rr-slot b { font-family: var(--font-head); font-weight: 600; color: var(--navy-800); font-size: 15px; }
.rr-slot small { font-size: 12px; color: var(--sea-dark); font-weight: 600; }
.rr-wrap--box { border-radius: 14px; border: 2px solid var(--paper-300); background: #fff; }
.rr-bonus { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14.5px; }
.rr-bonus th { padding: 9px 8px; background: var(--navy-800); color: #fff; font-family: var(--font-head); font-weight: 500; font-size: 13.5px; text-align: center; }
.rr-bonus td { padding: 7px 8px; border-top: 1px solid var(--paper-200); text-align: center; }
.rr-bonus tbody tr:nth-child(even) td { background: var(--paper-50); }
.rr-bonus td b { color: var(--green); }
.rr-bonus td.is-empty { color: var(--paper-400); }
.rr-bonus .rf-lv { width: 80px; }
.rr-fx { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rr-fx__box { margin: 0; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: #0e1a2e; border: 2px solid var(--paper-300); }
.rr-fx__box img, .rr-fx__box video { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #0e1a2e; }
.rr-fx__box.is-empty { background: repeating-linear-gradient(45deg, var(--paper-50) 0 12px, var(--paper-100) 12px 24px); border-style: dashed; border-color: var(--paper-400); }
.rr-fx__wait { display: grid; place-items: center; aspect-ratio: 1; color: var(--paper-400); font-size: 13.5px; font-weight: 600; }
.rr-fx__box figcaption { padding: 7px 8px; text-align: center; font-family: var(--font-head); font-weight: 600; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--navy-800), var(--sea-dark)); }
@media (max-width: 760px) {
  .rr-sec { padding: 14px 12px 14px; }
  .rr-tabs { grid-template-columns: 1fr; }
  .rr-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rr-fx { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rr-legend { justify-content: center; }
  .rr-bonus { font-size: 13px; }
}
