/* หน้าจอนอกเกม: boot · title · consent · server · charSelect · charCreate · popup ระบบ · directory
 * กฎ: ใช้ตัวแปรจาก theme.css เท่านั้น (สีโปร่งแสงใช้ color-mix)
 */

/* ---------- โครงร่วม ---------- */
.og {
  position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  animation: fade .35s;
}
.og-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; flex: none; }
.og-title { font-size: 18px; font-weight: 700; color: var(--moon); text-align: center; flex: 1; min-width: 0; text-shadow: 0 0 18px color-mix(in srgb, var(--moon-glow) 40%, transparent); }
.og-body { flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 4px 18px 18px; }
.og-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); flex: none; }
.og-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; flex: none;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--frame); box-shadow: 0 -8px 24px color-mix(in srgb, var(--bg) 70%, transparent);
}
.og-ver { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.linkbtn { background: none; border: 0; padding: 4px 2px; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; min-height: 28px; }
.linkbtn:hover { color: var(--gold); text-decoration-color: var(--gold); }
.linkbtn.danger { color: var(--danger); text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.linkbtn.danger:hover { color: var(--danger); text-decoration-color: var(--danger); }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.spinner.lg { width: 44px; height: 44px; border-width: 4px; }
.og-art { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
button.card { color: var(--text); font: inherit; text-align: left; cursor: pointer; }

@keyframes og-float { 50% { transform: translateY(-8px); } }
@keyframes og-glow { 50% { box-shadow: 0 0 60px color-mix(in srgb, var(--moon) 60%, transparent), 0 0 140px color-mix(in srgb, var(--moon-glow) 35%, transparent); } }
@keyframes og-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes og-shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* ---------- boot ---------- */
.boot { align-items: center; justify-content: center; cursor: pointer; }
.boot-center { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 16px; width: min(460px, 100%); }
.boot-orb { width: 110px; height: 110px; animation: og-glow 3.2s ease-in-out infinite, og-float 6s ease-in-out infinite; }
.boot-logo { animation: og-rise .6s ease-out; }
.boot-prog { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.boot-prog .bar { height: 10px; }
.boot-prog .bar > i { transition: width .12s linear; background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--moon) 45%, transparent), transparent), linear-gradient(var(--exp-hi), var(--gold-2)); background-size: 200% 100%, 100% 100%; animation: og-shimmer 1.6s linear infinite; }
.boot-tip { display: flex; align-items: flex-start; gap: 8px; min-height: 42px; font-size: 13px; color: var(--text-2); width: 100%; }
.boot-tip .tag { flex: none; }
.boot-tip-text.in { animation: og-rise .4s ease-out; }
.boot-ver { position: absolute; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); }
.boot-skip { position: absolute; left: 0; right: 0; bottom: calc(30px + env(safe-area-inset-bottom)); text-align: center; animation: pulse 2.4s ease-in-out infinite; }

/* ---------- title ---------- */
.ttl-status { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 60%; padding: 5px 10px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.ttl-status:hover { border-color: var(--frame-hi); }
.ttl-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: center; width: min(1080px, 100%); margin: 0 auto; padding: 8px 22px; }
.ttl-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; animation: og-rise .5s ease-out; }
.ttl-orb { width: 128px; height: 128px; animation: og-glow 4s ease-in-out infinite, og-float 7s ease-in-out infinite; }
.ttl-hero .logo .l1 { font-size: 42px; font-weight: 400; margin: 0; }
.ttl-tagline { color: var(--text-2); text-align: center; margin: 0; max-width: 420px; }
.ttl-actions { display: flex; flex-direction: column; gap: 10px; width: min(340px, 100%); margin-top: 6px; }
.ttl-start { min-height: 54px; font-size: 18px; letter-spacing: .02em; box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 35%, transparent); }
.ttl-start:not(:disabled):hover { box-shadow: 0 0 34px color-mix(in srgb, var(--gold) 55%, transparent); }
.ttl-acc { margin: 2px 0 0; line-height: 1.5; }
.ttl-news { display: flex; flex-direction: column; max-height: min(420px, 62vh); min-height: 0; animation: og-rise .6s ease-out; }
.ttl-news-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; border-bottom: 1px solid var(--line); }
.ttl-news-head h3 { font-size: 14px; color: var(--moon); }
.ttl-news-list { overflow-y: auto; min-height: 0; padding: 2px 4px 6px; }
.ttl-notice { width: 100%; background: none; border: 0; color: var(--text); font: inherit; font-size: 13px; text-align: left; min-height: 40px; border-radius: var(--r-sm); }
.ttl-notice .tag { flex: none; }
.ttl-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ttl-faq details summary { cursor: pointer; list-style-position: inside; }
.ttl-faq details p { margin: 8px 0 0; color: var(--text-2); }
.ttl-doc { max-height: 58vh; overflow-y: auto; }
.auth-keep { margin: 8px 0 12px; line-height: 1.55; border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.auth-provs { gap: 8px; margin-bottom: 10px; }
.auth-gbtn-wrap { display: flex; justify-content: center; margin: 10px 0; min-height: 44px; }
.auth-prov { justify-content: flex-start; min-height: 42px; text-align: left; }
.auth-g { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); font-weight: 800; flex: none; }
.auth-email .row .input { flex: 1; }
.set-row { margin-bottom: 10px; }

/* ---------- consent ---------- */
.cn { padding: 18px 14px; }
.cn-box { width: min(780px, 100%); margin: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; animation: pop .25s; }
.cn-box.moon-frame { padding: 30px 28px 22px; }
@media (max-width: 760px) { .cn-box.moon-frame { padding: 20px 16px 14px; } }
.cn-head { display: flex; align-items: center; gap: 12px; }
.cn-head h2 { font-size: 20px; color: var(--moon); }
.cn-head p { margin: 2px 0 0; }
.cn-tabs { margin-bottom: 0; }
.cn-doc { max-height: 38vh; overflow-y: auto; padding: 12px 14px; line-height: 1.65; color: var(--text-2); font-size: 13.5px; }
.cn-docbody > p { margin: 0 0 10px; }
.cn-docbody section { margin-bottom: 12px; }
.cn-docbody h4 { font-size: 14px; color: var(--gold); margin-bottom: 3px; }
.cn-docbody section p { margin: 0; }
.cn-docbody ul { margin: 4px 0 0; padding-left: 20px; }
.cn-table-wrap { overflow-x: auto; }
.cn-table { font-size: 12.5px; min-width: 460px; }
.cn-table td { vertical-align: top; }
.cn-checks { display: flex; flex-direction: column; gap: 8px; }
.cn-all { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cn-check .linkbtn { margin-left: 4px; font-size: 12px; min-height: 0; padding: 0 2px; }
.cn-req { margin-left: 6px; font-size: 10.5px; padding: 0 6px; vertical-align: 1px; }
.cn-foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.cn-need { text-align: right; }

/* ---------- server ---------- */
/* D-077: หน้าเลือกเซิร์ฟกินพื้นที่น้อยลง ~70% — กล่องเดียวตรงกลางจอแทนเต็มหน้าจอ รายชื่อเซิร์ฟเลื่อนในกรอบเล็ก */
.srv-compact { display: flex; align-items: center; justify-content: center; padding: 16px; }
.srv-panel { width: min(420px, 92vw); max-height: 84vh; display: flex; flex-direction: column; gap: 8px; padding: 26px 20px 16px; overflow: hidden; }
.srv-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.srv-foot-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.srv-panel .srv-list { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 4px; }
.srv-body { width: min(760px, 100%); }
.srv-hint { margin: 0 0 12px; text-align: center; }
.srv-list { gap: 10px; }
.srv-card { padding: 0; overflow: hidden; transition: border-color .15s, box-shadow .15s; animation: og-rise .35s ease-out backwards; }
.srv-card:nth-child(2) { animation-delay: .05s; } .srv-card:nth-child(3) { animation-delay: .1s; } .srv-card:nth-child(4) { animation-delay: .15s; }
.srv-card.off { opacity: .6; }
.srv-card.off .srv-head { cursor: not-allowed; }
.srv-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px 8px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.srv-head:hover .srv-name { color: var(--gold); }
.srv-glyph { font-size: 26px; flex: none; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--moon) 40%, transparent)); }
.srv-main { display: flex; flex-direction: column; gap: 4px; }
.srv-name { font-size: 15.5px; font-weight: 700; transition: color .12s; }
.srv-tags { gap: 4px; }
.srv-ping { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.srv-chev { width: 14px; color: var(--muted); flex: none; }
.srv-note { margin: 0; padding: 0 14px 12px 52px; }
.srv-load { padding: 0 14px 12px 52px; }
.srv-loadrow { gap: 8px; }
.srv-lvl { min-width: 54px; text-align: right; }
.bar.lv-smooth > i { background: var(--ok); }
.bar.lv-busy > i { background: var(--warn); }
.bar.lv-full > i { background: var(--danger); }
.srv-chs { padding: 10px 14px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, transparent); animation: fade .2s; }
.srv-ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.srv-ch { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; min-height: 52px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: border-color .12s, background .12s; }
.srv-ch:hover:not(:disabled) { border-color: var(--frame-hi); }
.srv-ch.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface-2)); box-shadow: inset 0 0 0 1px var(--gold); }
.srv-ch:disabled { opacity: .45; cursor: not-allowed; }
.srv-legend { gap: 6px 14px; justify-content: center; margin-top: 14px; }
.srv-foot { width: 100%; }
.srv-sum { display: flex; flex-direction: column; min-width: 0; }
.srv-sum-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- character select ---------- */
.cs-srv { cursor: pointer; font: inherit; font-size: 12px; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 18px; align-items: start; }
.cs-count .h-sec { margin: 0; }
.cs-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.cs-card {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden;
  min-height: 200px; border-radius: var(--r); background: linear-gradient(var(--surface-2), var(--surface)); border: 1px solid var(--line-2);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
  animation: og-rise .35s ease-out backwards;
}
.cs-card:hover { border-color: var(--frame-hi); transform: translateY(-2px); }
.cs-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 22px color-mix(in srgb, var(--gold) 30%, transparent); }
.cs-card.deleted { filter: grayscale(.9); opacity: .7; }
.cs-card.deleted.selected { opacity: .9; }
.cs-thumb { display: block; height: 130px; padding: 6px 6px 0; background: radial-gradient(ellipse at 50% 90%, color-mix(in srgb, var(--moon-glow) 18%, transparent), transparent 70%); }
.cs-thumb .ph-art { font-size: 10.5px; text-align: center; padding: 4px; }
.cs-meta { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 35%, transparent); }
.cs-cname { font-size: 14px; }
.cs-delflag { position: absolute; top: 6px; left: 6px; right: 6px; justify-content: center; font-size: 10.5px; }
.cs-card.empty { align-items: center; justify-content: center; gap: 6px; border-style: dashed; background: color-mix(in srgb, var(--surface) 50%, transparent); color: var(--muted); }
.cs-card.empty:hover { color: var(--gold); border-color: var(--gold); }
.cs-plus { font-size: 30px; line-height: 1; }
.cs-guest { margin: 12px 0 0; text-align: center; }
.cs-preview { position: sticky; top: 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; animation: og-rise .35s ease-out; }
.cs-art { position: relative; height: 260px; border-radius: var(--r); overflow: hidden; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--moon-glow) 25%, transparent), transparent 65%), var(--bg-2); border: 1px solid var(--line); }
.cs-art > .og-art, .cs-art > .ph-art { position: relative; z-index: 1; }
.cs-art-glow { position: absolute; left: 20%; right: 20%; bottom: 8px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--bg) 70%, transparent); filter: blur(6px); }
.cs-art.deleted { filter: grayscale(1); opacity: .7; }
.cs-info { display: flex; flex-direction: column; gap: 8px; }
.cs-pname { font-size: 22px; color: var(--moon); word-break: break-word; }
.cs-kv { margin: 2px 0; }
.cs-delnote { border-color: color-mix(in srgb, var(--danger) 45%, transparent); line-height: 1.5; }
.cs-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 2px; }
.cs-actions .btn.danger.sm { align-self: flex-end; }
.cs-empty .btn { margin-top: 12px; }
.cs-del-list { margin: 6px 0 12px; padding-left: 18px; color: var(--text-2); }

/* ---------- character create ---------- */
.cc-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 18px; align-items: start; }
.cc-pick { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cc-pick > p { margin: 0; }
.cc-step { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); margin-top: 6px; }
.cc-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-size: 12px; font-weight: 800; flex: none; }
.cc-gender { align-self: flex-start; }
.cc-gender button { min-height: 34px; padding: 4px 18px; font-size: 14px; }
.cc-jobs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cc-job {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; min-height: 96px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .12s, transform .12s, background .12s;
}
.cc-job:hover { border-color: var(--frame-hi); transform: translateY(-2px); }
.cc-job.selected { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); box-shadow: 0 0 0 1px var(--gold), 0 0 16px color-mix(in srgb, var(--gold) 25%, transparent); }
.cc-jglyph { font-size: 26px; line-height: 1.1; }
.cc-jname { font-size: 13px; font-weight: 700; text-align: center; }
.cc-stars { color: var(--gold); font-size: 11px; letter-spacing: 1px; }
.cc-note { margin-top: 4px !important; border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--text-2); }
.cc-detail { position: sticky; top: 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cc-art { position: relative; height: 240px; border-radius: var(--r); overflow: hidden; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--moon-glow) 22%, transparent), transparent 65%), var(--bg-2); border: 1px solid var(--line); }
.cc-tier { position: absolute; left: 8px; top: 8px; z-index: 2; }
.cc-info { display: flex; flex-direction: column; gap: 4px; }
.cc-jhead { gap: 8px; }
.cc-jtitle { font-size: 20px; color: var(--moon); }
.cc-desc { margin: 2px 0 0; color: var(--text-2); }
.cc-info .h-sec { margin: 8px 0 2px; }
.cc-branches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cc-branches li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
.cc-bnum { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); font-size: 10.5px; font-weight: 700; }
.cc-info > p.tiny { margin: 2px 0 0; }
.cc-statbox { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; align-items: center; }
.cc-radar { width: 124px; height: 124px; overflow: visible; }
.cc-radar .rg { fill: none; stroke: var(--line-2); stroke-width: .6; }
.cc-radar .rd { fill: color-mix(in srgb, var(--gold) 35%, transparent); stroke: var(--gold); stroke-width: 1.4; stroke-linejoin: round; transition: all .25s; }
.cc-radar text { fill: var(--muted); font: 700 7.5px var(--font); text-anchor: middle; dominant-baseline: middle; }
.cc-stats { display: flex; flex-direction: column; gap: 5px; }
.cc-stat { display: flex; align-items: center; gap: 8px; }
.cc-sk { width: 28px; font-size: 11px; font-weight: 700; color: var(--text-2); }
.cc-stat .bar.thin { height: 7px; }
.cc-foot { align-items: flex-start; }
.cc-step-name { margin-top: 8px; white-space: nowrap; }
.cc-namebox { display: flex; flex-direction: column; gap: 3px; max-width: 420px; }
.cc-msg { min-height: 16px; }
.cc-create { flex: none; }
.cc-busts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cc-bust { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-2); border: 1px solid transparent; border-radius: var(--r); background: none; padding: 4px 2px; cursor: pointer; font: inherit; }
.cc-bust .cc-jglyph, .cc-bust > :first-child { width: 100%; }
.cc-bust:hover { border-color: var(--frame-hi); }
.cc-bust.selected { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); color: var(--text); }

/* ---------- popup ระบบ ---------- */
.sys-update {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: calc(var(--z-modal) - 5);
  display: flex; gap: 12px; width: min(340px, calc(100vw - 32px)); padding: 12px 14px; border-color: var(--gold);
  box-shadow: var(--shadow-lg), 0 0 24px color-mix(in srgb, var(--gold) 20%, transparent); animation: og-rise .3s ease-out;
}
.sys-update.sys-shake { animation: og-shake .4s; }
@keyframes og-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.sys-update-ico { font-size: 24px; line-height: 1; }
.sys-update-t { font-weight: 700; color: var(--gold); }
.sys-update-act { margin-top: 8px; gap: 6px; }
.sys-pill {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: calc(var(--z-modal) - 5);
  min-height: 32px; padding: 4px 12px; border-radius: 16px; border: 1px solid var(--gold); background: var(--surface-2);
  color: var(--gold); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); animation: og-rise .3s ease-out;
}
.sys-pill:hover { background: var(--surface-3); }
.sys-overlay { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px; background: var(--scrim); backdrop-filter: blur(3px); animation: fade .2s; }
.sys-dc { width: min(360px, 100%); padding: 22px 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: pop .2s; }
.sys-dc h3 { font-size: 17px; color: var(--moon); }
.sys-dc p { margin: 0; min-height: 20px; }
.sys-dc-ico { height: 52px; display: grid; place-items: center; }
.sys-dc-x { font-size: 38px; }
.sys-dc-bar { width: 100%; }
.sys-dc-act { justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.sys-maint-cd { margin: 10px 0; }
.sys-maint-t { font-size: 32px; font-weight: 800; color: var(--warn); letter-spacing: .04em; }
.sys-news { gap: 8px; }
.sys-news-item { padding: 10px 12px; }
.sys-news-item summary { cursor: pointer; gap: 8px; list-style: none; }
.sys-news-item summary::-webkit-details-marker { display: none; }
.sys-news-item p { margin: 8px 0 0; color: var(--text-2); }
.sys-news-meta { gap: 8px; margin-bottom: 6px; }
.sys-news-body { margin: 6px 0 0; }

/* ---------- directory ---------- */
.dir { background: radial-gradient(ellipse at 50% -10%, var(--surface-2), var(--bg) 60%); }
.dir-top { position: sticky; top: 0; z-index: 3; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dir-top .og-title { text-align: left; }
.dir-body { display: flex; flex-direction: column; gap: 26px; padding-top: 16px; }
.dir-body > section > p { margin: 2px 0 10px; }
.dir-sec { display: flex; align-items: center; gap: 8px; }
.dir-sec h3 { font-size: 15px; color: var(--gold); }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dir-card { display: flex; gap: 12px; align-items: flex-start; transition: border-color .12s, transform .12s; }
.dir-card:hover, .dir-pop:hover { border-color: var(--frame-hi); transform: translateY(-1px); }
.dir-txt { display: flex; flex-direction: column; gap: 4px; }
.dir-txt code { font-family: ui-monospace, monospace; }
.dir-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); background: var(--surface-3); font-size: 22px; flex: none; }
.dir-ico.sm { width: 34px; height: 34px; font-size: 18px; }
.dir-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.dir-group { padding: 10px; }
.dir-ghead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; color: var(--moon); }
.dir-wins { display: flex; flex-direction: column; gap: 4px; }
.dir-win { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.dir-win:hover:not(:disabled) { border-color: var(--frame-hi); background: var(--surface-2); }
.dir-win:disabled { opacity: .5; cursor: not-allowed; }
.dir-pops { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.dir-pop { display: flex; align-items: center; gap: 10px; padding: 10px; transition: border-color .12s, transform .12s; }
.dir-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.dir-tools .card p { margin: 4px 0 8px; }
.dir-tools code { font-family: ui-monospace, monospace; color: var(--info); word-break: break-word; }
.dir-code { display: block; white-space: pre-wrap; max-height: 160px; overflow: auto; margin-top: 6px; }

/* ---------- มือถือแนวตั้ง / จอแคบ ---------- */
@media (max-width: 760px) {
  .og-top { padding: 10px 12px; }
  .og-title { font-size: 16px; }
  .og-body { padding: 4px 12px 14px; }
  .og-bar { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .og-foot { justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }

  .boot-orb { width: 84px; height: 84px; }

  .ttl-status { max-width: 55%; }
  .ttl-main { grid-template-columns: 1fr; gap: 18px; padding: 6px 14px 10px; align-content: start; }
  .ttl-orb { width: 92px; height: 92px; }
  .ttl-hero .logo .l1 { font-size: 26px; }
  .ttl-news { max-height: none; }
  .ttl-links { justify-content: center; }

  .cn { padding: 10px 8px; }
  .cn-box { padding: 14px 12px; }
  .cn-head h2 { font-size: 17px; }
  .cn-doc { max-height: 34vh; }
  .cn-foot { flex-wrap: wrap; }
  .cn-foot .btn.primary { flex: 1; }
  .cn-need { order: -1; width: 100%; text-align: left; }

  .srv-note, .srv-load { padding-left: 14px; }
  .srv-ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srv-foot .btn.lg { padding: 10px 16px; }

  .cs-srv { max-width: 38%; }
  .cs-main { grid-template-columns: 1fr; gap: 12px; }
  .cs-slots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cs-card { flex: 0 0 132px; min-height: 176px; scroll-snap-align: start; }
  .cs-card:hover { transform: none; }
  .cs-thumb { height: 108px; }
  .cs-preview { position: static; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
  .cs-art { height: 190px; }
  .cs-pname { font-size: 18px; }

  .cc-main { grid-template-columns: 1fr; }
  .cc-jobs { grid-template-columns: repeat(5, minmax(60px, 1fr)); overflow-x: auto; }
  .cc-job { min-height: 84px; padding: 8px 2px 6px; }
  .cc-jglyph { font-size: 22px; }
  .cc-jname { font-size: 11.5px; }
  .cc-detail { position: static; }
  .cc-art { height: 190px; }
  .cc-foot { flex-wrap: wrap; }
  .cc-step-name { width: 100%; margin-top: 0; }
  .cc-namebox { max-width: none; }

  .dir-top { gap: 8px; }
}
@media (max-width: 420px) {
  .cs-preview { grid-template-columns: 1fr; }
  .cs-art { height: 200px; }
  .cc-jobs { grid-template-columns: repeat(5, 64px); }
  .srv-ch-grid { grid-template-columns: 1fr 1fr; }
  .srv-ping .num { font-size: 11px; }
}

/* ---------- มือถือแนวนอน (เช่น 812×375) ---------- */
@media (max-height: 480px) {
  .og-top { padding: 6px 14px; }
  .og-bar { padding: 6px 14px calc(6px + env(safe-area-inset-bottom)); }
  .og-foot { padding: 4px 14px calc(4px + env(safe-area-inset-bottom)); }

  .boot-center { gap: 10px; padding: 10px 16px; }
  .boot-orb { width: 64px; height: 64px; }
  .boot-skip { display: none; }

  .ttl-main { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 16px; padding: 0 16px; align-items: start; }
  .ttl-hero { gap: 8px; }
  .ttl-orb { width: 58px; height: 58px; }
  .ttl-hero .logo .l1 { font-size: 24px; }
  .ttl-tagline { display: none; }
  .ttl-start { min-height: 44px; font-size: 16px; }
  .ttl-news { max-height: calc(100vh - 110px); }

  .cn-doc { max-height: 40vh; }

  .cs-main { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 12px; }
  .cs-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cs-card { min-height: 0; }
  .cs-thumb { height: 72px; }
  .cs-preview { display: grid; grid-template-columns: 110px minmax(0, 1fr); padding: 10px; gap: 10px; }
  .cs-art { height: 170px; }
  .cs-pname { font-size: 17px; }

  .cc-main { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 12px; }
  .cc-job { min-height: 74px; padding: 6px 2px; }
  .cc-jglyph { font-size: 20px; }
  .cc-art { height: 130px; }
  .cc-statbox { grid-template-columns: 96px minmax(0, 1fr); }
  .cc-radar { width: 96px; height: 96px; }
  .cc-foot { flex-wrap: nowrap; }
  .cc-step-name { width: auto; margin-top: 8px; }
}

/* ================= Animation Studio (#/studio) ================= */
.studio { position: fixed; inset: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% -20%, #232b58, #0b0e1c 60%); color: var(--text); font-family: var(--font); }
.st-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--frame); background: linear-gradient(180deg, #232b58, #151a36); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.st-brand { display: flex; flex-direction: column; line-height: 1.2; }
.st-brand b { font-family: var(--font-display); color: var(--gold); font-size: 17px; letter-spacing: .04em; }
.st-brand span { font-size: 12px; color: var(--text-2); opacity: .8; }
.st-tabs button { padding: 6px 14px; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.st-dirty { color: #ffcf8a; font-size: 12px; }
.st-main { flex: 1; min-height: 0; overflow: auto; }
.st-anim { display: grid; grid-template-columns: 260px minmax(0, 1fr) 330px; gap: 12px; padding: 12px 16px; height: 100%; min-height: 640px; box-sizing: border-box; }
.st-map { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; padding: 12px 16px; height: 100%; min-height: 560px; box-sizing: border-box; }
.st-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.st-left, .st-right { overflow-y: auto; padding-right: 4px; }
.st-col > section { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: linear-gradient(170deg, rgba(34,42,80,.92), rgba(18,22,44,.94)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.45); }
.st-col h4 { margin: 0 0 8px; font-family: var(--font-thai-display); font-size: 13.5px; color: var(--gold); letter-spacing: .02em; }
.st-center { min-width: 0; }
.st-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-bar .seg button { min-width: 30px; }
.st-canvas-wrap { position: relative; flex: 1; min-height: 320px; border-radius: 10px; overflow: hidden; border: 1px solid var(--frame); box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.st-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.st-sheet { cursor: crosshair; }
.st-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); background: rgba(11,14,28,.7); }
.st-jobs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.st-job { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); font-size: 10px; cursor: pointer; min-width: 0; }
.st-job .job-ava { width: 34px; height: 34px; }
.st-job span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-job.on { border-color: var(--gold); color: var(--text); box-shadow: inset 0 0 0 1px var(--gold), 0 0 10px rgba(243,207,116,.25); }
.st-anims { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.st-animbtn { display: flex; flex-direction: column; align-items: flex-start; padding: 5px 9px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; cursor: pointer; }
.st-animbtn b { font-weight: 600; font-size: 13px; }
.st-animbtn.on { border-color: var(--gold); background: linear-gradient(#3a4478, #283060); }
.st-gap { gap: 6px; margin-top: 8px; }
.st-warn { margin-top: 8px; padding: 6px 8px; border-radius: 6px; font-size: 12px; color: #ffcf8a; background: rgba(255,160,60,.1); border: 1px solid rgba(255,160,60,.35); }
.st-sl { display: grid; grid-template-columns: 1fr 1.1fr 44px; align-items: center; gap: 6px; margin: 5px 0; font-size: 12px; }
.st-sl input[type=range] { width: 100%; accent-color: var(--gold); }
.st-sl output { text-align: right; font-variant-numeric: tabular-nums; color: var(--gold); }
.st-sl-inline { grid-template-columns: auto 110px; margin: 0; }
.st-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; }
.st-chk input { accent-color: var(--gold); }
.st-strip { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 4px; min-height: 84px; align-items: flex-start; }
.st-thumb { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; border-radius: 7px; background: #161a30; border: 1px solid var(--line-2); color: var(--text-2); font-size: 11px; cursor: pointer; font-variant-numeric: tabular-nums; }
.st-thumb.on { border-color: var(--gold); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.st-ftools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.st-editor { width: 100%; height: 300px; display: block; border-radius: 8px; border: 1px solid var(--frame); cursor: grab; touch-action: none; }
.st-editor:focus-visible, .st-preview:focus-visible, .st-mapcv:focus-visible { outline: 2px solid var(--frame-hi); outline-offset: 2px; }
.st-fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.st-fields label { display: flex; flex-direction: column; font-size: 10.5px; color: var(--text-2); }
.st-fields input { width: 100%; padding: 3px 4px; font-size: 12px; }
.st-pvmodes { display: flex; flex-wrap: wrap; margin-bottom: 6px; }
.st-pvmodes button { flex: 1; font-size: 12px; padding: 5px 4px; }
.st-preview { width: 100%; height: 250px; display: block; border-radius: 8px; border: 1px solid var(--frame); }
.st-tools { display: flex; flex-direction: column; gap: 6px; }
.st-mapwrap { min-height: 480px; }
.st-mapcv { cursor: crosshair; }
.st-json { width: 100%; min-height: 280px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: pre; }
.st-newanims { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
@media (max-width: 1180px) {
  .st-anim { grid-template-columns: 240px minmax(0, 1fr); }
  .st-anim .st-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 760px) {
  .st-anim, .st-map { grid-template-columns: 1fr; height: auto; }
  .st-canvas-wrap { min-height: 360px; flex: none; height: 60vh; }
  .st-actions { margin-left: 0; }
}

/* สร้างตัวละคร: ภาพตัวอย่างอาชีพ (แค่ตัวอย่าง — เข้าเกมจริงเป็น Beginner เสมอ) */
.cc-art { height: 340px; display: flex; justify-content: center; align-items: flex-end; animation: fade .3s; }
.cc-art .class-art { height: 100%; width: auto; }
@media (max-width: 1180px) { .cc-art { height: 280px; } }
@media (max-width: 760px) { .cc-art { height: 240px; } }
.cc-branches li { padding: 0; border: 0; background: none; }

/* ================= คู่มืออาชีพ (#/guide + หน้าต่าง guide) ================= */
.cg-screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% -20%, #232b58, #0b0e1c 60%); color: var(--text); }
.cg-page { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.cg { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; }
.cg-list { display: flex; flex-direction: column; gap: 5px; position: sticky; top: 0; }
.cg-job { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.cg-job .job-ava { width: 34px; height: 34px; }
.cg-jn { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cg-jn b { font-size: 13.5px; }
.cg-job:hover { border-color: var(--frame-hi); }
.cg-job.on { border-color: var(--gold); background: linear-gradient(#3a4478, #283060); box-shadow: inset 0 0 0 1px var(--gold); }
.cg-stars { color: var(--gold); font-size: 10.5px; letter-spacing: 1px; white-space: nowrap; }
.cg-body { min-width: 0; }
.cg-intro { margin: 0 0 10px; }
.cg-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cg-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line-2); background: radial-gradient(ellipse at 50% 80%, rgba(159,216,255,.12), transparent 70%), var(--bg-2); color: var(--text); cursor: pointer; font: inherit; font-weight: 600; }
.cg-card .class-art { width: 100%; }
.cg-card:hover { border-color: var(--gold); }
.cg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.cg-head h3 { margin: 0; font-size: 21px; color: var(--moon, var(--gold)); display: flex; align-items: center; gap: 8px; }
.cg-head h3 .job-ava { width: 36px; height: 36px; }
.cg-desc { flex-basis: 100%; margin: 0; color: var(--text-2); }
.cg-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; }
.cg-big { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 420px; border-radius: 12px; border: 1px solid var(--frame); background: radial-gradient(ellipse at 50% 88%, rgba(159,216,255,.2), transparent 62%), linear-gradient(#1a2044, #0e1128); overflow: hidden; }
.cg-bigart { height: 100%; width: auto; }
.cg-cap { position: absolute; left: 10px; top: 10px; }
.cg-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cg-tier, .cg-branch { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.cg-tier .class-art { width: 100%; }
.cg-tier.on, .cg-branch.on { border-color: var(--gold); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 0 10px rgba(243,207,116,.2); }
.cg-branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cg-branch { text-align: center; }
.cg-branch .class-art { width: 78%; }
.cg-branch > span { display: flex; flex-direction: column; line-height: 1.2; color: var(--text); font-weight: 600; }
.cg-stats { display: grid; gap: 4px; }
.cg-stat { display: grid; grid-template-columns: 34px 1fr 22px; align-items: center; gap: 6px; font-size: 11.5px; }
.cg-skills { display: flex; flex-direction: column; gap: 6px; }
.cg-skill { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: start; }
.cg-skill .slot { width: 40px; height: 40px; }
.cg-side .h-sec { margin-top: 10px; }
.cg-side .h-sec:first-child { margin-top: 0; }
@media (max-width: 980px) { .cg-main { grid-template-columns: 1fr; } .cg-big { height: 340px; } }
@media (max-width: 700px) {
  .cg { grid-template-columns: 1fr; }
  .cg-list { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .cg-job { flex: none; grid-template-columns: 30px auto; }
  .cg-job .cg-stars { display: none; }
  .cg-big { height: 300px; }
}

/* ==========================================================================
   D-072: หน้า boot/title = นครจันทรา (Moon Capital) — อนุมัติแล้ว จาก handoff moon-capital-auth-v1
   ขอบเขต: เปลี่ยนฉากหลังและใส่กรอบทองแกะลาย "Luna" เฉพาะหน้า boot กับ title เท่านั้น (.sky-capital, .moon-frame)
   ไม่แตะ .sky ทั่วไป (consent/server/charSelect/charCreate/directory ยังใช้ทุ่ง Moonwell ตามเดิม)
   ========================================================================== */
.sky.sky-capital {
  background: url("../../../../assets/screens/moon-capital-overview.jpg") center 42% / cover no-repeat;
  transform: scale(1.03);
  animation: cap-drift 30s ease-in-out infinite alternate;
}
.sky.sky-capital::before { content: none; }
.sky.sky-capital::after {
  display: block; content: ""; position: absolute; inset: 0; height: auto;
  background:
    linear-gradient(90deg, rgba(4, 14, 30, .88) 0%, rgba(4, 16, 32, .6) 38%, rgba(4, 16, 33, .12) 74%),
    linear-gradient(0deg, rgba(4, 13, 24, .9), transparent 30%, rgba(5, 15, 29, .2) 78%, rgba(4, 13, 27, .55));
}
.capital-rays, .capital-motes { position: fixed; inset: 0; pointer-events: none; }
.capital-rays {
  background:
    radial-gradient(ellipse at 66% 12%, rgba(254, 237, 177, .22), transparent 38%),
    radial-gradient(ellipse at 52% 95%, rgba(88, 182, 208, .16), transparent 52%);
  mix-blend-mode: screen; animation: cap-glow 7s ease-in-out infinite alternate;
}
.capital-motes {
  background-image:
    radial-gradient(2px 2px at 12% 22%, #fff7cf 90%, transparent), radial-gradient(2px 2px at 76% 33%, #fff7cf 90%, transparent),
    radial-gradient(2px 2px at 51% 13%, #d9eafa 90%, transparent), radial-gradient(2px 2px at 86% 72%, #fff7cf 90%, transparent),
    radial-gradient(2px 2px at 31% 79%, #e8f9ff 90%, transparent), radial-gradient(2px 2px at 63% 63%, #fff7cf 90%, transparent);
  filter: drop-shadow(0 0 7px #fff1ae); opacity: .6; animation: cap-twinkle 5s ease-in-out infinite alternate;
}
@keyframes cap-drift { to { transform: scale(1.065) translate(-1%, .4%); } }
@keyframes cap-glow { to { opacity: .55; } }
@keyframes cap-twinkle { to { opacity: .22; transform: translateY(-8px); } }

/* กรอบทองแกะลาย "Luna": เส้นทองหลายชั้น + มุมจันทร์เสี้ยว + ตราอัญมณีกลางกรอบบน */
.moon-frame { position: relative; border: 2px solid #bb8e45; border-radius: 22px; overflow: visible;
  background: linear-gradient(135deg, rgba(17, 37, 68, .94), rgba(8, 22, 44, .88));
  box-shadow: 0 0 0 5px rgba(8, 21, 39, .85), 0 0 0 6px rgba(228, 178, 83, .48), 0 22px 80px rgba(0, 0, 0, .45), inset 0 0 0 4px rgba(254, 217, 139, .26), inset 0 0 45px rgba(130, 190, 218, .1); }
.moon-frame::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(252, 221, 147, .6); border-radius: 14px; pointer-events: none; box-shadow: inset 0 0 0 3px rgba(241, 209, 136, .09); }
.moon-frame::after { content: ""; position: absolute; inset: 17px; border: 1px solid rgba(235, 190, 104, .16); border-radius: 9px; pointer-events: none; }
.moon-frame > * { position: relative; z-index: 3; }
.moon-corner { position: absolute; width: 84px; height: 84px; z-index: 2; pointer-events: none;
  background: url("../../../../assets/screens/moon-capital-corner.svg") center/contain no-repeat; filter: drop-shadow(0 0 6px rgba(241, 197, 100, .37)); }
.moon-corner.tl { top: -7px; left: -7px; } .moon-corner.tr { top: -7px; right: -7px; transform: scaleX(-1); }
.moon-corner.bl { bottom: -7px; left: -7px; transform: scaleY(-1); } .moon-corner.br { bottom: -7px; right: -7px; transform: scale(-1); }
.moon-finial { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); width: min(64%, 380px); height: 48px; z-index: 2; pointer-events: none;
  background: url("../../../../assets/screens/moon-capital-finial.svg") center/contain no-repeat; filter: drop-shadow(0 2px 4px #051222); }
.moon-frame--sm .moon-corner { width: 54px; height: 54px; }
.moon-frame--sm .moon-finial { width: 54%; height: 32px; top: -15px; }

/* วงแหวนจันทร์เสี้ยว (แทน moon-orb เดิมบนหน้า boot/title): วงแหวนทอง + จันทร์เสี้ยวใน (สร้างด้วย inset box-shadow แบบต้นฉบับ ไม่ใช้ภาพ) */
.moon-orb.moon-crest { position: relative; display: grid; place-items: center; background: transparent;
  border: 1px solid rgba(246, 224, 161, .56); box-shadow: 0 0 0 5px rgba(234, 191, 105, .15), 0 0 30px rgba(238, 199, 98, .35), inset 0 0 20px rgba(244, 218, 145, .1); }
.moon-crest::before, .moon-crest::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; pointer-events: none; }
.moon-crest::before { border: 1px dashed rgba(249, 229, 173, .65); animation: cap-rotate 28s linear infinite; }
.moon-crest::after { inset: -9px; border: 1px solid rgba(253, 228, 155, .28); }
.moon-crescent { width: 56%; height: 56%; max-width: 62px; max-height: 62px; border-radius: 50%; background: transparent; transform: rotate(-15deg);
  box-shadow: inset 21px -7px 0 2px #f8e5ab, -12px 0 22px -14px #fff, 0 0 24px rgba(255, 228, 153, .32); }
.cap-star { position: absolute; color: #fbe6a8; text-shadow: 0 0 10px #fff1be; pointer-events: none; z-index: 4; }
@keyframes cap-rotate { to { transform: rotate(360deg); } }

.cap-eyebrow { font: 500 10px "Cinzel", serif; letter-spacing: .32em; color: #efd69f; display: flex; justify-content: center; align-items: center; gap: 12px; text-transform: uppercase; }
.cap-eyebrow span { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, #dec589); }
.cap-eyebrow span:last-child { background: linear-gradient(90deg, #dec589, transparent); }

/* boot: กรอบครอบเนื้อหากลางจอ */
.boot-center.moon-frame { padding: 40px 40px 32px; gap: 14px; }
.boot-center .cap-star.s1 { left: -10px; top: 40%; } .boot-center .cap-star.s2 { right: -8px; top: 32%; font-size: 12px; }
.boot-prog { margin-top: 6px; }

/* title: hero (ซ้าย) + news (ขวา) เป็นกรอบทองทั้งคู่ */
.ttl-hero.moon-frame { padding: 40px 38px 34px; }
.ttl-news.moon-frame { padding: 30px 26px 16px; }
.ttl-hero .cap-star.s1 { left: -12px; top: 38%; } .ttl-hero .cap-star.s2 { right: -10px; top: 30%; font-size: 12px; }

@media (max-width: 760px) {
  .moon-corner { width: 56px; height: 56px; } .moon-finial { width: 58%; height: 34px; top: -16px; }
  .boot-center.moon-frame { padding: 32px 20px 26px; } .ttl-hero.moon-frame { padding: 30px 20px 26px; } .ttl-news.moon-frame { padding: 24px 18px 14px; }
}
@media (max-height: 480px) {
  .moon-corner { width: 46px; height: 46px; } .moon-finial { width: 52%; height: 28px; top: -13px; }
  .boot-center.moon-frame { padding: 16px 20px 14px; gap: 8px; } .ttl-hero.moon-frame { padding: 16px 18px 12px; } .ttl-news.moon-frame { padding: 16px 16px 8px; }
  .cap-eyebrow { font-size: 8px; letter-spacing: .22em; }
}
@media (prefers-reduced-motion: reduce) {
  .sky.sky-capital, .capital-rays, .capital-motes, .moon-orb.crescent::before { animation: none !important; }
}
