/* Shieldfall Wiki · สีชุดเดียวกับหน้าแรก (public/index.html) · ภาพทั้งหมดเป็นภาพเจนจาก /play/img */
:root {
  --night: #2a1a10; --night2: #3a2416; --cream: #fff8ec; --paper: #fffdf7; --ink: #3a2414; --ink-soft: #6b5240; --mute: #9a8470;
  --teal: #2bb8c4; --teal-deep: #15838d; --coral: #e8553f; --gold: #ffbf3c; --line: rgba(90, 52, 24, .14);
  --r0: #a89a86; --r1: #a89a86; --r2: #4cae4c; --r3: #3d8fe0; --r4: #a05ce0; --r5: #f0a020;
  --radius: 18px; --shadow: 0 1px 2px rgba(60, 30, 10, .08), 0 6px 18px rgba(60, 30, 10, .07);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 16px/1.65 "IBM Plex Sans Thai", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: "Mali", "IBM Plex Sans Thai", sans-serif; line-height: 1.25; margin: 0; }
p { margin: 0; }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.loading { padding: 80px 0; text-align: center; color: var(--mute); }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(42, 26, 16, .94); backdrop-filter: blur(8px); color: #fff; }
.nav .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.nav .home { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: "Mali", sans-serif; font-weight: 700; font-size: 19px; }
.nav .wtag { text-decoration: none; font-family: "Mali", sans-serif; font-weight: 700; font-size: 13px; color: var(--night); background: var(--gold); border-radius: 999px; padding: 2px 10px; }
.search { flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 0 14px; height: 40px; }
.search:focus-within { background: rgba(255, 255, 255, .16); border-color: var(--gold); }
.search svg { width: 18px; height: 18px; fill: rgba(255, 255, 255, .7); flex: none; }
.search input { all: unset; flex: 1; min-width: 0; font-size: 15px; color: #fff; }
.search input::placeholder { color: rgba(255, 255, 255, .55); }
.nav .play { text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 16px; border-radius: 999px; background: var(--gold); color: var(--ink); white-space: nowrap; }
.nav .play:hover { background: #ffd36e; }
.sres { position: absolute; left: 50%; transform: translateX(-50%); top: 58px; width: min(560px, 100% - 24px); max-height: min(70vh, 560px); overflow: auto; background: var(--paper); color: var(--ink); border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); padding: 6px; }
.sres a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
.sres a:hover, .sres a.on { background: #fdf0d8; }
.sres img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.sres b { display: block; font-weight: 600; }
.sres small { color: var(--mute); font-size: 12.5px; }
.sres .none { padding: 18px; text-align: center; color: var(--mute); }

/* layout */
.layout { display: grid; grid-template-columns: 210px 1fr; gap: 32px; padding: 28px 0 64px; }
.layout > * { min-width: 0; }
.side { position: sticky; top: 86px; align-self: start; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink-soft); }
.side a img { width: 28px; height: 28px; object-fit: contain; }
.side a:hover { background: #fbecd2; color: var(--ink); }
.side a.on { background: var(--night); color: #fff; }
.side a .n { margin-left: auto; font-size: 12px; opacity: .6; }
main { min-width: 0; outline: none; }

/* hero */
.hero { position: relative; border-radius: 26px; overflow: hidden; color: #fff; background: var(--night); min-height: 300px; display: flex; align-items: flex-end; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(42, 26, 16, .94) 25%, rgba(42, 26, 16, .55) 65%, rgba(42, 26, 16, .25)), linear-gradient(180deg, rgba(42, 26, 16, 0) 40%, rgba(42, 26, 16, .7)); }
.hero .in { position: relative; z-index: 1; padding: 36px; }
.hero .eyebrow { color: var(--gold); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); margin: 4px 0 8px; }
.hero p { max-width: 620px; color: rgba(255, 255, 255, .86); }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.counts span { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); padding: 4px 12px; border-radius: 999px; font-size: 14px; }
.counts b { color: var(--gold); font-family: "Mali", sans-serif; margin-right: 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 22px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 158px; padding: 14px 16px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); text-decoration: none; overflow: hidden; transition: transform .15s; }
.tile:hover { transform: translateY(-3px); }
.tile img { position: absolute; right: 4px; top: 8px; width: 86px; height: 86px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .18)); }
.tile b { font-family: "Mali", sans-serif; font-size: 19px; position: relative; }
.tile small { color: var(--mute); position: relative; }

/* section headers */
.ph { margin-bottom: 18px; }
.ph .crumb { font-size: 13.5px; color: var(--mute); }
.ph .crumb a { text-decoration: none; color: var(--teal-deep); }
.ph h1 { font-size: clamp(28px, 3.6vw, 40px); margin-top: 2px; }
.ph p { color: var(--ink-soft); margin-top: 6px; max-width: 760px; }
h2.sec { font-size: 24px; margin: 36px 0 12px; display: flex; align-items: center; gap: 10px; }
h2.sec img { width: 34px; height: 34px; object-fit: contain; }
h2.sec small { font-family: "IBM Plex Sans Thai", sans-serif; font-size: 14px; color: var(--mute); font-weight: 400; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.chip img { width: 18px; height: 18px; }
.chip:hover { border-color: var(--ink-soft); }
.chip.on { background: var(--night); border-color: var(--night); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.filters .gap { width: 10px; }

/* grid cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 10px 12px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); text-decoration: none; text-align: center; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--rc, var(--line)); }
.card .pic { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rc, #e9dcc4) 26%, transparent), transparent 70%); }
.card .pic img { max-width: 86%; max-height: 86%; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .2)); }
.card b { font-weight: 600; font-size: 15px; margin-top: 6px; line-height: 1.3; }
.card small { color: var(--mute); font-size: 12.5px; }
.card .el { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; }
.stars { color: var(--rc); font-size: 13px; letter-spacing: 1px; line-height: 1; }
.r0, .r1 { --rc: var(--r1); } .r2 { --rc: var(--r2); } .r3 { --rc: var(--r3); } .r4 { --rc: var(--r4); } .r5 { --rc: var(--r5); }
.r5.card { background: linear-gradient(180deg, #fff6df, var(--paper) 60%); }

/* detail */
.hero2 { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.stage { position: relative; border-radius: 24px; padding: 18px; background: radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--rc, #e9dcc4) 40%, #fff8ec), #f4e6cc 75%); box-shadow: var(--shadow); aspect-ratio: 1; display: grid; place-items: center; cursor: zoom-in; }
.stage img { max-width: 92%; max-height: 92%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(60, 30, 10, .25)); }
.stage .face { position: absolute; left: 12px; bottom: 12px; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; background: #fff; box-shadow: var(--shadow); object-fit: cover; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: #f3e5cb; color: var(--ink-soft); }
.tag img { width: 18px; height: 18px; }
.tag.rc { background: color-mix(in srgb, var(--rc) 18%, #fff); color: color-mix(in srgb, var(--rc) 70%, #000); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--paper); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.stat small { display: block; color: var(--mute); font-size: 12.5px; }
.stat b { font-family: "Mali", sans-serif; font-size: 22px; }
.stat .bar { height: 6px; border-radius: 3px; background: #f0e2c8; margin-top: 6px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--rc, var(--teal)); border-radius: 3px; }
.note { color: var(--mute); font-size: 13.5px; margin-top: 10px; }

.skills { display: flex; flex-direction: column; gap: 10px; }
.skill { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; background: var(--paper); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); }
.skill img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #f3e5cb; }
.skill h4 { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.skill h4 .tag { font-family: "IBM Plex Sans Thai", sans-serif; font-size: 12px; font-weight: 500; padding: 1px 8px; }
.skill h4 .ult { background: #ffe6b3; color: #8a5200; }
.skill p { color: var(--ink-soft); font-size: 14.5px; margin-top: 3px; }

/* tables */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; font-size: 14.5px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { background: #f6e8cf; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl img.ic { width: 34px; height: 34px; object-fit: contain; display: inline-block; vertical-align: middle; margin-right: 8px; }
.tbl a { text-decoration: none; font-weight: 600; }
.tbl a:hover { color: var(--teal-deep); }
.tscroll { overflow-x: auto; border-radius: 16px; }
.mons { display: flex; flex-wrap: wrap; gap: 4px; }
.mons a img { width: 34px; height: 34px; object-fit: contain; }

/* floor blocks */
.floor { display: grid; grid-template-columns: 200px 1fr; gap: 20px; background: var(--paper); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.floor .bossbox { border-radius: 16px; background: radial-gradient(circle at 50% 60%, #ffe2b8, #f3dcc0 75%); display: grid; place-items: center; aspect-ratio: 1; text-decoration: none; position: relative; }
.floor .bossbox img { max-width: 88%; max-height: 82%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(60, 30, 10, .3)); }
.floor .bossbox span { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-weight: 600; font-size: 13px; }
.floor h3 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.floor h3 .num { width: 40px; height: 40px; border-radius: 12px; background: var(--night); color: var(--gold); display: grid; place-items: center; font-size: 20px; }
.kv { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0; font-size: 14.5px; color: var(--ink-soft); }
.kv b { color: var(--ink); }
.zone { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line); }
.zone:first-of-type { border-top: 0; }
.zone .zn { min-width: 150px; }
.zone .zn b { display: block; }
.zone .zn small { color: var(--mute); }

/* boss cards */
.bosses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.boss { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.boss .bpic { background: radial-gradient(circle at 50% 70%, #5a3220, var(--night) 80%); aspect-ratio: 16/11; display: grid; place-items: center; cursor: zoom-in; }
.boss .bpic img { max-width: 78%; max-height: 86%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.boss .bin { padding: 12px 16px 16px; }
.boss h3 { font-size: 19px; }
.boss .sub { color: var(--mute); font-size: 13px; }
.boss .hpatk { display: flex; gap: 14px; margin: 8px 0; font-size: 14px; }
.boss .hpatk b { font-family: "Mali", sans-serif; font-size: 17px; }
.moves { display: flex; flex-wrap: wrap; gap: 4px; }
.moves span { font-size: 12.5px; background: #fde4dc; color: #9b2f1d; padding: 1px 8px; border-radius: 999px; }

/* misc */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.box { background: var(--paper); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); }
.box h3 { font-size: 19px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.box h3 img { width: 32px; height: 32px; object-fit: contain; }
.box ul { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.box li + li { margin-top: 4px; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.steps .box { position: relative; padding-top: 44px; }
.steps .box::before { counter-increment: s; content: counter(s); position: absolute; top: 14px; left: 18px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--night); font-family: "Mali", sans-serif; font-weight: 700; display: grid; place-items: center; }
.elem { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 14px 0; }
.elem .e { text-align: center; }
.elem .e img { width: 64px; height: 64px; margin: 0 auto; }
.elem .arrow { font-size: 22px; color: var(--coral); }
.rates { display: flex; height: 20px; border-radius: 10px; overflow: hidden; margin: 10px 0 6px; }
.rates i { display: block; height: 100%; background: var(--rc); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--rc); }
.fxq { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; background: #e3f4f5; color: var(--teal-deep); margin: 1px 0; }
.empty { padding: 40px; text-align: center; color: var(--mute); }

.zoom { position: fixed; inset: 0; z-index: 50; background: rgba(20, 12, 6, .86); display: grid; place-items: center; cursor: zoom-out; }
.zoom[hidden], .sres[hidden] { display: none; }
.zoom img { max-width: min(92vw, 720px); max-height: 88vh; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .6)); }

footer { background: var(--night); color: rgba(255, 255, 255, .7); font-size: 14px; padding: 26px 0; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 14px; padding-top: 12px; }
  .side { position: sticky; top: 62px; z-index: 10; margin: 0 -16px; padding: 8px 16px; background: rgba(255, 248, 236, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .side a { flex: none; padding: 6px 10px; font-size: 14px; }
  .side a img { width: 22px; height: 22px; }
  .side a .n { display: none; }
  html { scroll-padding-top: 130px; }
  .hero2 { grid-template-columns: 1fr; }
  .stage { max-width: 340px; margin: 0 auto; width: 100%; }
  .floor { grid-template-columns: 1fr; }
  .floor .bossbox { max-width: 220px; }
  .cols2 { grid-template-columns: 1fr; }
  .hero .in { padding: 22px; }
  .nav .home span { display: none; }
  .nav .wrap { gap: 8px; }
  .search { min-width: 0; padding: 0 10px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 130px; padding: 12px; }
  .tile img { width: 64px; height: 64px; }
  .tile b { font-size: 17px; }
  .tile small { font-size: 12.5px; line-height: 1.4; }
  .nav .play { padding: 7px 12px; font-size: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
  .zone { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .card, .tile { transition: none; } }

/* เนื้อเรื่อง #/story (wiki.js pStory) */
.lore-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 26px; }
.lore-toc a, .lore-toc span { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-size: 14px; line-height: 1.3; }
.lore-toc img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; margin-bottom: 4px; }
.lore-toc small { color: var(--mute); font-size: 12px; }
.lore-toc .lk { opacity: .7; } .lore-toc .lk img { filter: grayscale(1) brightness(.55) blur(6px); } .lore-toc .lk b { font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.lore-ep { margin-bottom: 34px; scroll-margin-top: 80px; }
.lore-top { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.lore-top video { width: 100%; aspect-ratio: 4 / 5; border-radius: 16px; background: var(--night); display: block; }
.lore-top p { margin: 0 0 8px; } .lore-in { margin-top: 12px !important; padding: 8px 12px; border-radius: 12px; background: #e7f4df; color: #2f5a2a; font-size: 14.5px; }
.lore-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.lore-strip button { padding: 0; border: 0; background: none; cursor: zoom-in; } .lore-strip img { width: 100%; border-radius: 12px; display: block; }
@media (max-width: 720px) { .lore-top { grid-template-columns: 1fr; } .lore-top video { max-width: 360px; margin: 0 auto; } .lore-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
