/*
  style.css — หน้าตาของเกม
  โทนสีเย็นให้เข้ากับฉากน้ำแข็ง
*/

:root {
  --bg: #12161f;
  --panel: #1c2230;
  --panel-2: #262d3d;
  --line: #36405a;
  --text: #e4ecf4;
  --muted: #8794ab;
  --gold: #e0b24c;
  --green: #7fb069;
  --ice: #9fd8e0;
  --bad: #d9704f;
  --shadow: 0 2px 0 rgba(0,0,0,.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

h1 { font-size: 15px; margin: 0; letter-spacing: 1px; }
h2 { font-size: 12px; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
h2 + div + h2 { margin-top: 18px; }

/* ---------- แถบบน ---------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

#resources { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }

.res { display: flex; align-items: baseline; gap: 5px; }
.res.outside .res-amt { color: var(--ice); }
.res-icon { font-size: 14px; }
.res-amt { font-weight: bold; min-width: 44px; }
.res-rate { color: var(--green); font-size: 11px; }

#btn-newgame {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 3px 10px; cursor: pointer; font-family: inherit; font-size: 11px;
}
#btn-newgame:hover { color: var(--text); border-color: var(--muted); }

/* ---------- โครงหน้า ---------- */

main {
  display: grid;
  grid-template-columns: 340px 1fr 1fr;
  gap: 18px;
  padding: 18px 16px 40px;
  max-width: 1320px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 1200px) { main { grid-template-columns: 340px 1fr; max-width: 900px; } }
@media (max-width: 820px)  { main { grid-template-columns: 1fr; max-width: 420px; } }

/* ---------- การ์ด ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.card-body, .journey-body { padding: 9px 11px; }
.card-title { display: flex; align-items: center; gap: 7px; font-weight: bold; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 11px; }
.rate { color: var(--green); margin-top: 5px; font-size: 12px; }

.pill {
  font-size: 10px; font-weight: normal; border: 1px solid var(--line);
  padding: 0 5px; color: var(--muted);
}
.pill.trait { color: var(--gold); border-color: var(--gold); }
.pill.cold { color: var(--ice); border-color: var(--ice); }
.pill.bad { color: var(--bad); border-color: var(--bad); }

.warn {
  margin-top: 5px; font-size: 11px; color: var(--bad);
  border-left: 2px solid var(--bad); padding-left: 7px;
}

/* ---------- ฉาก ---------- */

.scene {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-bottom: 1px solid var(--line);
  background: #0b0e14;
  overflow: hidden;
}

.scene img {
  display: block; width: 100%; height: 100%;
  image-rendering: pixelated;   /* ภาพพิกเซลต้องคมเป็นเหลี่ยม ห้ามเบลอ */
}

/* ---------- ตัวละครแบบซ้อนชั้น ---------- */

.actor {
  position: absolute;
  width: 24px; height: 34px;
  transform: translate(-50%, -100%);
  transition: left .12s linear, top .12s linear;   /* เดินลื่นแม้เกมอัปเดตเป็นจังหวะ */
}

.actor::after {   /* เงาใต้เท้า ทำให้ดูตั้งอยู่บนพื้นจริง */
  content: ''; position: absolute; left: 50%; bottom: -1px;
  width: 14px; height: 4px; margin-left: -7px;
  border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(1px); z-index: -1;
}

.actor .layer {
  position: absolute; left: 0; top: 0;
  width: 24px; height: 34px;
  background-repeat: no-repeat;
  background-size: 96px 170px;      /* 4 เฟรม x 5 ท่า */
  image-rendering: pixelated;
  animation: sprite-frames .9s steps(4) infinite;
}
/* ชั้นอาวุธกว้าง 38 (เผื่อข้างละ 7) เพราะอาวุธเอียงออกนอกตัว ล้นกรอบ 24 (27 ก.ย.) */
.actor .layer.wlayer {
  left: -7px; width: 38px;
  background-size: 152px 170px; --sheet-w: 152px;
}

@keyframes sprite-frames {
  from { background-position-x: 0; }
  to   { background-position-x: calc(var(--sheet-w, 96px) * -1); }
}

/* แถวของแผ่นภาพ = ท่าทาง */
.actor.idle   .layer { background-position-y: 0;      animation-duration: 1.6s; }
.actor.walk   .layer { background-position-y: -34px;  animation-duration: .6s; }
.actor.work   .layer { background-position-y: -68px;  animation-duration: 1.1s; }
.actor.attack .layer { background-position-y: -102px; animation-duration: .7s; }
.actor.hurt   .layer { background-position-y: -136px; animation-duration: .9s; }

/* ตัวละครชุดใหม่ (27 ก.ย. เซิฟทดลอง) กรอบ 48x56 วางให้เท้าตรงกับตัวเก่า (กล่อง .actor ยัง 24x34 เท่าเดิม
   จุดยืน/ทางเดินทั้งหมดใช้ต่อได้) · ตัวอยู่กลางกรอบที่ x 20.5 เท้าแถว 52 */
.actor.nc .layer {
  left: -9px; top: -20px; width: 48px; height: 56px;
  background-size: 192px 336px; --sheet-w: 192px;
}
.actor.nc .layer.wlayer { left: -9px; width: 48px; background-size: 192px 336px; --sheet-w: 192px; }
.actor.nc.idle   .layer { background-position-y: 0; }
.actor.nc.walk   .layer { background-position-y: -56px; }
.actor.nc.work   .layer { background-position-y: -112px; }
.actor.nc.attack .layer { background-position-y: -168px; }
.actor.nc.hurt   .layer { background-position-y: -224px; }
/* ท่ายิงธนู (แถวที่ 6) สาย Bow ตอนสู้ (27 ก.ย. จ๊อบ) · ออกสกิล Piercing Shot = ธนูเรืองฟ้า */
.actor.nc.shoot  .layer { background-position-y: -280px; animation-duration: .8s; }
.actor.nc.skillshot .wlayer { filter: drop-shadow(0 0 1px #e8fbff) drop-shadow(0 0 3px #7fd8ff) drop-shadow(0 0 5px rgba(80,180,255,.8)); }
/* ลูกแก้ววิญญาณ (ช่องหัว) ลอยข้างไหล่ซ้าย ขึ้นลงช้าๆ */
.actor .orb {
  position: absolute; left: -9px; top: 1px; width: 12px; height: 12px;   /* ลูกแก้ววาดด้วยโค้ด (tools/make_orb_icons.py orb(12)) จ๊อบขอเล็กลงจาก 15 */
  image-rendering: pixelated; pointer-events: none;
  animation: orb-bob 2.4s ease-in-out infinite;
}
/* อาวุธ +10 ตัวใหม่: ออร่าดำแทนแดง (27 ก.ย. จ๊อบ) · +9 ทองคงเดิม · สายฟ้าอยู่ในชั้น .bolts */
.actor.nc.wglow10 .wlayer {
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 2px rgba(0,0,0,.95)) drop-shadow(0 0 4px rgba(20,0,30,.85));
}
/* +9 ตัวใหม่: ออร่าทองเข้มขึ้นให้เท่าออร่าดำของ +10 (เดิมบางจนดูเหมือนไม่มี) */
.actor.nc.wglow9 .wlayer {
  filter: drop-shadow(0 0 1px #fff2c0) drop-shadow(0 0 2px rgba(255,208,96,.95)) drop-shadow(0 0 4px rgba(255,180,50,.9));
}
.actor .bolts {
  position: absolute; left: 0; top: 0; width: 24px; height: 34px; pointer-events: none;
  animation: bolt-flicker 0.9s steps(1) infinite;
}
.actor.wglow9 .bolts  { filter: drop-shadow(0 0 1px rgba(255,220,120,.9)); }
.actor.wglow10 .bolts { filter: drop-shadow(0 0 1px rgba(200,225,255,.9)); animation-duration: .7s; }
@keyframes bolt-flicker {
  0%   { opacity: 1; }
  12%  { opacity: 0; }
  30%  { opacity: 1; }
  38%  { opacity: 0; }
  62%  { opacity: 1; }
  70%  { opacity: 0; }
  85%  { opacity: 0; }
}

/* ลูกแก้วตีบวก: ออร่าสีเดียวกับอาวุธ + สายฟ้าเล็ก (27 ก.ย. จ๊อบเลือกแบบจัดเต็ม) */
.actor .orb.oglow8  { filter: drop-shadow(0 0 1px #e0b0ff) drop-shadow(0 0 3px #a24dff); }
.actor .orb.oglow9  { filter: drop-shadow(0 0 1px #fff2c0) drop-shadow(0 0 2px rgba(255,208,96,.95)) drop-shadow(0 0 4px rgba(255,180,50,.9)); }
.actor .orb.oglow10 { filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 2px rgba(0,0,0,.95)) drop-shadow(0 0 4px rgba(20,0,30,.85)); }
.actor .orb .obolt {
  position: absolute; left: -1px; top: -1px; width: 14px; height: 14px;
  background-size: 42px 14px; image-rendering: pixelated;
  animation: obolt-frames .45s steps(3) infinite, bolt-flicker .8s steps(1) infinite;
}
@keyframes obolt-frames { from { background-position-x: 0; } to { background-position-x: -42px; } }

/* คนที่ถูกขับไล่กลับมาล้างแค้น: ยืนฝั่งศัตรู หันหน้าเข้าหาทีม (กลับด้านทั้งตัว) · ป้ายสีม่วงเข้ม (28 ก.ย.) */
.actor.grudge { transform: translate(-50%, -100%) scaleX(-1); }
.actor.grudge .tag { transform: translateX(-50%) scaleX(-1); }
.pill.grudge-foe { color: #d8b4ff; border-color: #6d3fa0; background: rgba(60, 20, 90, .5); }

/* รูปบนการ์ด: ตัวใหม่กรอบใหญ่กว่า ตัดส่วนเกิน (อาวุธ) ให้อยู่ในช่อง ไม่แสดงลูกแก้ว */
.portrait { overflow: hidden; }
.portrait .actor .orb { display: none; }
@keyframes orb-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

.actor .tag {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 2px; padding: 0 3px; font-size: 9px; white-space: nowrap;
  color: var(--text); background: rgba(10,12,18,.88); border: 1px solid var(--line);
  opacity: 0; transition: opacity .12s; pointer-events: none;
}
.actor:hover .tag { opacity: 1; }

/* ---------- มอนสเตอร์ ---------- */

.monster {
  position: absolute;
  /* ภาพต้นฉบับหันหน้าไปทางซ้ายอยู่แล้ว ทีมมาจากซ้ายเสมอ จึงไม่ต้องกลับด้าน */
  transform: translate(-50%, -100%);
}
.monster i {
  display: block;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  animation: sprite-frames .8s steps(4) infinite;
}
.monster.idle   i { background-position-y: 0; }
.monster.attack i { background-position-y: calc(var(--frame-h) * -1); }
.monster.hurt   i { background-position-y: calc(var(--frame-h) * -2); }
/* ท่าใหม่ 27 ก.ย. (แผ่น 5 แถว): ใกล้ตาย · ตาย (ครั้งเดียวค้างเฟรมสุดท้าย) · ท่าชั่วคราวตอนเล่นยก */
.monster.dying  i { background-position-y: calc(var(--frame-h) * -3); }
.monster.death  i { background-position-y: calc(var(--frame-h) * -4); }
.monster.act-attack i { background-position-y: calc(var(--frame-h) * -1); }
.monster.act-hurt   i { background-position-y: calc(var(--frame-h) * -2); }
.monster .tag {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  font-size: 9px; white-space: nowrap; color: var(--bad);
  background: rgba(10,12,18,.88); border: 1px solid var(--line); padding: 0 3px;
}

/* ---------- เส้นทาง ---------- */

.nodes { display: flex; gap: 4px; margin: 7px 0; flex-wrap: wrap; }

.node {
  width: 22px; height: 22px; line-height: 20px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  font-family: inherit; font-size: 11px; cursor: pointer; padding: 0;
}
.node.safe { color: var(--green); border-color: #3d5a3a; }
.node.risky { color: var(--bad); }
.node.on { background: var(--ice); border-color: var(--ice); color: #10151c; font-weight: bold; }
.nodes.plain .node { cursor: default; }
.nodes.plain .node.done { background: #2b3a44; color: var(--ice); }

.party-line { margin-top: 7px; font-size: 11px; }

.warmth { display: flex; align-items: center; gap: 7px; margin: 7px 0; font-size: 11px; color: var(--ice); }
.warmth .bar { flex: 1; }
.warmth .bar i { background: var(--ice); }

.hpline { font-size: 11px; color: var(--bad); }

.send {
  background: var(--green); border: 1px solid var(--green); color: #16210f;
  font-weight: bold; padding: 5px 16px; cursor: pointer; font-family: inherit; font-size: 12px;
}
.send:hover:not(:disabled) { filter: brightness(1.15); }
.send:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- ชาวบ้าน ---------- */

.villager { padding: 9px 11px; }
.villager.away { opacity: .6; }

.vrow { display: flex; gap: 10px; align-items: flex-start; }

/* ช่องรูปตัวละครในการ์ด ตัวยืนนิ่งให้ดูหน้าตา */
.portrait {
  position: relative; width: 30px; height: 38px; flex: none;
  background: #10151d; border: 1px solid var(--line);
}
.portrait .actor { left: 50%; top: 100%; transition: none; }

.vinfo { flex: 1; min-width: 0; }

.stats { display: flex; gap: 12px; margin: 4px 0; font-size: 11px; color: var(--muted); }
.stats b { color: var(--text); font-size: 12px; }

.bar { height: 4px; background: var(--panel-2); border: 1px solid var(--line); margin: 5px 0; }
.bar i { display: block; height: 100%; background: var(--green); }

.jobs { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 7px; }

.job {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  padding: 2px 8px; cursor: pointer; font-family: inherit; font-size: 11px;
}
.job:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.job.on { background: var(--gold); border-color: var(--gold); color: #1a1a1a; font-weight: bold; }
.job.party.on { background: var(--ice); border-color: var(--ice); color: #10151c; }
.job:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- บันทึกเหตุการณ์ ---------- */

#log {
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 10px; max-height: 260px; overflow-y: auto;
}

.log-line { font-size: 11px; color: var(--muted); padding: 1px 0; }
.log-line:first-child { color: var(--text); }
.log-line.fight { color: #c9a06a; }
.log-line.win { color: var(--green); }
.log-line.bad { color: var(--bad); }
.log-line.loot { color: var(--ice); }
.log-line.go { color: var(--text); }

/* ---------- ปุ่มเลือกปลายทาง ---------- */

.sites {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 8px 0;
}

.site {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 3px 7px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site b { color: var(--text); margin-right: 3px; }
.site:hover { border-color: var(--muted); color: var(--text); }
.site.safe { color: var(--green); }
.site.risky { color: var(--bad); }
.site.claimed { color: var(--gold); border-color: #574b2c; }
.site.on { background: var(--ice); border-color: var(--ice); color: #10151c; font-weight: bold; }
.site.on b { color: #10151c; }

/* ---------- ของสวมใส่ ---------- */

.gear { display: flex; gap: 3px; margin-top: 5px; }

.slot {
  width: 15px; height: 15px; line-height: 13px; text-align: center;
  border: 1px solid var(--line); font-size: 9px; color: var(--muted);
  background: #141a24; cursor: default;
}
.slot.empty { opacity: .45; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.chip { border: 1px solid var(--line); padding: 0 5px; font-size: 10px; }

/* ---------- โรงตีเหล็กกับพ่อค้า ---------- */

.recipe, .goods {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 7px;
}
.cost { font-size: 11px; margin-top: 4px; }
.cost .ok { color: var(--green); }
.cost .no { color: var(--bad); }
.cost span + span::before { content: ''; }

.card.trader { border-color: var(--gold); }
.card.trader .card-title { color: var(--gold); }

/* ---------- เหตุการณ์ที่ต้องตัดสินใจ ---------- */

.choice {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--gold);
  background: rgba(224,178,76,.07);
  font-size: 11px;
}
.choice .jobs { margin-top: 6px; }

.job.auto.on { background: var(--ice); border-color: var(--ice); color: #10151c; font-weight: bold; }

.job.revive { border-color: var(--gold); color: var(--gold); }
.site.spent { opacity: .45; }
.villager .pill.bad { margin-left: 2px; }

/* ---------- รายการของ ---------- */

.item-list {
  margin-top: 8px;
  max-height: 340px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.item-list.short { max-height: 200px; }

.item {
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
}
.item.empty { opacity: .4; }

.item-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item-name { font-size: 11px; }
.item-slot { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.item-stats { font-size: 10px; color: var(--text); opacity: .85; }
.item-stats .off { color: var(--bad); }

.tiny-note { font-size: 10px; color: var(--muted); margin-top: 3px; }
.job.tiny { font-size: 10px; padding: 1px 6px; }
.gain { color: var(--green); }

.gear-panel {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.villager { cursor: pointer; }
.villager .jobs, .villager .gear-panel { cursor: default; }

/* ---------- ออร่าของคนที่ใส่ของระดับสูง ---------- */

.actor.aura .layer { filter: drop-shadow(0 0 2px var(--glow)); }
.actor.aura1 { --glow: rgba(111,143,208,.75); }
.actor.aura2 { --glow: rgba(140,190,255,.95); }
.actor.aura3 { --glow: rgba(224,178,76,1); }
.actor.aura4 { --glow: rgba(230,60,50,1); }   /* ใส่ Mystical */

/* วงแสงใต้เท้า เต้นช้าๆ ให้รู้ว่าเรืองอยู่ */
.actor.aura::before {
  content: '';
  position: absolute;
  left: 50%; bottom: -3px;
  width: 22px; height: 8px;
  margin-left: -11px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 70%);
  animation: aura-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
.actor.aura3::before, .actor.aura4::before { width: 30px; margin-left: -15px; height: 10px; }

@keyframes aura-pulse {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50%      { opacity: .9;  transform: scale(1.15); }
}

/* ประกายลอยขึ้น เฉพาะของระดับตำนานกับ Mystical */
.actor.aura3::after, .actor.aura4::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 6px;
  width: 2px; height: 2px; margin-left: -1px;
  background: var(--glow);
  box-shadow: -6px -6px 0 var(--glow), 5px -11px 0 var(--glow), -3px -16px 0 var(--glow);
  animation: aura-motes 2.6s linear infinite;
  opacity: .9;
  pointer-events: none;
  border-radius: 0;
}

@keyframes aura-motes {
  0%   { transform: translateY(0);     opacity: 0; }
  30%  { opacity: .9; }
  100% { transform: translateY(-16px); opacity: 0; }
}

/* ---------- เลเวล ---------- */

.pill.lvl { color: var(--ice); border-color: var(--ice); }

.bar.exp { height: 3px; margin-top: 3px; }
.bar.exp i { background: var(--ice); }

/* ตัวที่อยู่แถวหลังของฝูง ให้ดูจมลงไปในระยะ */
.monster.back i { filter: brightness(.82); }

/* ตัวที่เพิ่งถูกล้ม (27 ก.ย.): เล่นท่าตาย (ทรุด→นอน) ค้างไว้ราว 1.5 วิ แล้วจางหาย · 2.4 วิ = FOE_DEATH_MS ใน ui.js */
.monster.down {
  animation: monster-fade 2.4s linear forwards;
  pointer-events: none;
}
@keyframes monster-fade {
  0%, 62% { opacity: 1; }
  100%    { opacity: 0; }
}
@keyframes monster-death {
  from { background-position-x: 0; }
  to   { background-position-x: calc(var(--sheet-w) * -0.75); }
}

/* แถบความทนของตัวเดี่ยว ใช้แทนตัวเลขเพราะเลือดของมันไม่ใช่จำนวนตัว */
.bar.foe { height: 5px; margin-top: 3px; }
.bar.foe i { background: var(--bad); }

/* ปุ่มโหมดอัตโนมัติบนแถบบน ต้องกดได้ทุกเมื่อไม่ว่าทีมจะอยู่ไหน */
#btn-auto {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 3px 10px; cursor: pointer; font-family: inherit; font-size: 11px;
}
#btn-auto:hover { color: var(--text); border-color: var(--muted); }
#btn-auto.on { background: var(--ice); border-color: var(--ice); color: #10151c; font-weight: bold; }

/* ปุ่มเรียกทีมกลับ มีเฉพาะตอนเล่นเอง เป็นข้อได้เปรียบของคนที่นั่งดู */
.job.recall { border-color: var(--gold); color: var(--gold); margin-top: 6px; }
.job.recall:hover { background: var(--gold); color: #1a1a1a; }

/* =====================================================================
   จัดหน้าจอใหม่ (26 ก.ย.) — แท็บ การ์ดชาวบ้านแบบย่อ หมู่บ้านแบบรายการ
   ===================================================================== */

/* ---------- แท็บ ---------- */

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--ice); border-bottom-color: var(--ice); }
.tab span { color: var(--muted); font-size: 10px; }
.tab-page.hidden { display: none; }

/* ---------- การ์ดชาวบ้านแบบย่อ ---------- */

.villager { padding: 7px 9px; margin-bottom: 6px; }
.villager .vrow { align-items: center; }
.villager .portrait { width: 28px; height: 36px; }
.villager .card-title { font-size: 12px; gap: 5px; }

.statline {
  display: flex; gap: 9px; font-size: 10px; color: var(--muted); margin: 1px 0 3px;
}
.statline b { color: var(--text); }

.bars .bar { margin: 2px 0; }
.bars .bar.exp { margin-top: 1px; }

.chev { color: var(--muted); font-size: 11px; padding-left: 4px; }
.villager.open { border-color: var(--muted); }

.vdetail {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}
.vdetail .jobs { margin-top: 5px; }
.vdetail .gear-panel { border-top: none; margin-top: 4px; padding-top: 0; }

/* ป้ายสถานะเล็กๆ บนชื่อ เห็นได้โดยไม่ต้องกางการ์ด */
.flag {
  font-size: 9px; font-weight: normal; padding: 0 4px;
  border: 1px solid var(--line); color: var(--muted); text-transform: lowercase;
}
.flag.out   { color: var(--ice);  border-color: #2e5560; }
.flag.party { color: var(--ice);  border-color: var(--ice); }
.flag.bad   { color: var(--bad);  border-color: var(--bad); }
.flag.gold  { color: var(--gold); border-color: var(--gold); }

/* ---------- หมู่บ้านแบบรายการ ---------- */

.site-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.site-row {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.site-row:hover { border-color: var(--muted); }
.site-row.on { border-color: var(--ice); background: #1f2a36; }
.site-row img {
  width: 34px; height: 34px; image-rendering: pixelated; display: block;
  border: 1px solid var(--line);
}
.site-name { font-weight: bold; }
.site-crew { color: var(--muted); font-size: 10px; }
.site-rate { color: var(--green); font-size: 10px; min-width: 38px; text-align: right; }

/* ---------- สรุปทริปล่าสุดย้ายไปอยู่ใต้ช่องเดินทาง ---------- */

#haul .card { margin-top: 10px; }
#haul:empty { display: none; }

/* =====================================================================
   ธีมพิกเซล (26 ก.ย.) — วางทับของเดิมทั้งหมด ถ้าอยากกลับไปแบบเรียบ
   ลบตั้งแต่บรรทัดนี้ลงไปได้เลย
   ===================================================================== */

:root {
  --bg-top: #0c1020;
  --bg-bottom: #1a1830;
  --frame-dark: #080a12;
  --frame-mid: #2a3348;
  --frame-hi: #52617f;
  --panel: #182032;
  --panel-2: #212a3e;
  --line: #34405a;
}

/* ---------- ท้องฟ้ากลางคืนกับหิมะ ---------- */

body {
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(120,150,210,.10), transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* หิมะตกเบาๆ ทั้งหน้า ทำด้วยจุดสีขาวซ้อนหลายชั้นที่เลื่อนลงช้าๆ ไม่ใช้โค้ด */
body[data-zone="ice"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 90px 120px, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 230px 180px, rgba(255,255,255,.5), transparent),
    radial-gradient(2px 2px at 300px 90px, rgba(255,255,255,.3), transparent);
  background-size: 320px 240px;
  animation: snowfall 26s linear infinite;
  opacity: .7;
}
@keyframes snowfall {
  from { background-position: 0 0; }
  to   { background-position: -60px 240px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-zone="ice"]::before { animation: none; }
}

main, #topbar { position: relative; z-index: 1; }

/* ---------- กรอบแผงแบบพิกเซล ----------
   ขอบเข้มด้านนอก ขอบสว่างด้านบนซ้าย ขอบมืดด้านล่างขวา
   มุมตัดเป็นขั้นแบบหน้าต่างเกมเก่า */

.card, #log, .site-row, .villager {
  background: var(--panel);
  border: 2px solid var(--frame-dark);
  box-shadow:
    inset 2px 2px 0 var(--frame-hi),
    inset -2px -2px 0 var(--frame-mid),
    0 3px 0 rgba(0,0,0,.45);
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px),
                     calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px);
}

.villager.open, .site-row.on {
  box-shadow:
    inset 2px 2px 0 var(--ice),
    inset -2px -2px 0 #2e5560,
    0 3px 0 rgba(0,0,0,.45);
}

/* ฉากใส่กรอบรูปเหมือนหน้าต่างมองออกไปข้างนอก */
.scene {
  border: 2px solid var(--frame-dark);
  box-shadow: inset 0 0 0 2px var(--frame-mid);
  outline: 1px solid var(--frame-hi);
  outline-offset: -4px;
}
.card > .scene { border-left: 0; border-right: 0; border-top: 0; }

/* ---------- แถบบน ---------- */

#topbar {
  background: linear-gradient(180deg, #1c2438 0%, #141a2a 100%);
  border-bottom: 2px solid var(--frame-dark);
  box-shadow: 0 2px 0 var(--frame-mid), 0 5px 0 rgba(0,0,0,.35);
}
#topbar h1 {
  color: var(--ice);
  text-shadow: 2px 2px 0 var(--frame-dark), 0 0 12px rgba(159,216,224,.25);
  letter-spacing: 2px;
}

.res {
  background: rgba(8,10,18,.55);
  border: 1px solid var(--frame-mid);
  padding: 2px 8px 2px 5px;
}

/* ---------- หัวข้อ ---------- */

h2 {
  color: var(--ice);
  opacity: .85;
  display: flex;
  align-items: center;
  gap: 8px;
}
h2::after {
  content: '';
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--frame-mid) 0 4px, transparent 4px 6px);
}

/* ---------- ปุ่ม ----------
   ทรงพิกเซลนูน กดแล้วยุบลงหนึ่งพิกเซล */

.job, .send, #btn-auto, #btn-newgame, .node, .site {
  border: 2px solid var(--frame-dark) !important;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.14), inset -1px -1px 0 rgba(0,0,0,.35), 0 2px 0 var(--frame-dark);
  transition: transform .05s;
}
.job:active:not(:disabled), .send:active:not(:disabled), #btn-auto:active, #btn-newgame:active,
.node:active, .site:active {
  transform: translateY(2px);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,.3);
}
.send { padding: 6px 18px; letter-spacing: 1px; }

/* ---------- แถบพลัง ประสบการณ์ ความอบอุ่น ----------
   ขอบพิกเซลและขีดแบ่งเป็นช่อง อ่านเป็นหลอดพลังในเกม */

.bar {
  height: 6px;
  background: var(--frame-dark);
  border: 1px solid var(--frame-mid);
  position: relative;
}
.bar i {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.bar::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(8,10,18,.55) 9px 10px);
  pointer-events: none;
}
.bar.exp { height: 4px; }
.bar.foe { height: 7px; }

/* ---------- แท็บแบบแฟ้ม ---------- */

.tabs { border-bottom: 2px solid var(--frame-mid); gap: 3px; }
.tab {
  background: var(--panel-2);
  border: 2px solid var(--frame-dark);
  border-bottom: none;
  margin-bottom: 0;
  padding: 5px 11px 4px;
}
.tab.on {
  background: var(--panel);
  color: var(--ice);
  box-shadow: inset 0 2px 0 var(--ice);
}

/* ---------- บันทึกเหตุการณ์ ---------- */

#log { background: rgba(10,13,22,.88); }
.log-line { border-left: 2px solid transparent; padding-left: 5px; }
.log-line.win  { border-left-color: var(--green); }
.log-line.bad  { border-left-color: var(--bad); }
.log-line.loot { border-left-color: var(--ice); }
.log-line.fight{ border-left-color: #c9a06a; }

/* แถบเลื่อนให้เข้าธีม */
#log::-webkit-scrollbar, .item-list::-webkit-scrollbar { width: 8px; }
#log::-webkit-scrollbar-track, .item-list::-webkit-scrollbar-track { background: var(--frame-dark); }
#log::-webkit-scrollbar-thumb, .item-list::-webkit-scrollbar-thumb { background: var(--frame-mid); border: 1px solid var(--frame-hi); }

/* ---------- ช่องรูปชาวบ้าน ---------- */

.portrait {
  background: radial-gradient(ellipse at 50% 90%, #2a3550 0%, #0d111b 75%);
  border: 2px solid var(--frame-dark);
  box-shadow: inset 0 0 0 1px var(--frame-mid);
}

/* แถบทรัพยากรกะทัดรัด ไม่ให้ตกบรรทัดสองชั้น */
#resources { gap: 6px; }
.res { padding: 1px 7px 1px 4px; gap: 4px; }
.res-amt { min-width: 0; }
.res-rate:empty, .res-rate:blank { display: none; }

/* ---------- ไอคอนพิกเซล ---------- */

.ico {
  width: 20px; height: 20px;
  image-rendering: pixelated;
  vertical-align: middle;
  display: inline-block;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,.6));
}
.ico.sm { width: 14px; height: 14px; margin-right: 3px; opacity: .85; }
.ico.xs { width: 12px; height: 12px; margin-right: 2px; filter: none; }
.ico.it { width: 20px; height: 20px; margin: -3px 4px -2px 0; }   /* ไอคอนของหน้าชื่อของ (ตามเทียร์) */

.res { align-items: center; }

/* ช่องสวมใส่เป็นกรอบไอคอน ช่องว่างจางลง ช่องที่มีของขอบเป็นสีตามระดับ */
.gear { gap: 3px; }
.slot {
  width: 22px; height: 22px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--frame-dark);
  border: 1px solid var(--frame-mid);
}
.slot .ico { width: 16px; height: 16px; filter: none; }
.slot.empty .ico { opacity: .22; filter: grayscale(1); }

.item-slot { display: inline-flex; align-items: center; }
.pill.lvl, .flag { display: inline-flex; align-items: center; }

.warmth .ico { width: 16px; height: 16px; }

/* =====================================================================
   UI จัดเต็ม (26 ก.ย.) — พื้นหลังทิวเขา โลโก้ ไอคอนชุดสอง
   ===================================================================== */

/* ---------- พื้นหลังตามโซน ----------
   กรอบเกมเป็นกลางใช้ได้ทุกโซน ส่วนพื้นหลังกับอากาศผูกกับ body[data-zone]
   ภาพติดขอบล่างของจอ ทับด้วยเงามืดด้านบนให้ตัวหนังสือยังอ่านง่าย
   โซนใหม่: ก๊อปกฎนี้ เปลี่ยนชื่อโซนกับชื่อไฟล์ภาพ */
body[data-zone="ice"] {
  background:
    linear-gradient(180deg, rgba(8,10,20,.72) 0%, rgba(8,10,20,.45) 45%, rgba(8,10,20,.15) 100%),
    url(../assets/ui/backdrop_ice.jpg) center bottom / cover no-repeat fixed,
    var(--bg-top);
}

/* แผงทึบเกือบเต็ม เห็นพื้นหลังลอดนิดๆ ที่ขอบ */
.card, .site-row, .villager { background: rgba(24,32,50,.94); }
#log { background: rgba(10,13,22,.9); }

/* ---------- โลโก้ ---------- */
#topbar h1 { margin: 0; line-height: 0; }
#logo {
  height: 32px;              /* 2 ต.ค. โลโก้ Tower & Trail ตัวทอง+ส่วนดำ ตัดวงเทาออก (570x88 ย่อลง) · จอ 1280 สูง 32 กว้าง ~207 ยังไม่ดันแถบทรัพยากรตกบรรทัด */
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.6));
}

html body #topbar #logo { image-rendering: auto; }   /* โลโก้เป็นภาพละเอียดย่อลง ต้องย่อแบบนุ่ม ไม่ใช่แบบพิกเซล (แบบพิกเซลขอบจะหยัก) */
@media (min-width: 1400px) { #logo { height: 42px; } }   /* จอกว้าง ที่พอ โลโก้ใหญ่ขึ้น */

/* ---------- ไอคอนในหัวข้อ แท็บ ปุ่ม ---------- */
h2 .ico { width: 20px; height: 20px; margin-right: -2px; opacity: 1; }
h2 { opacity: 1; }

.tab { display: inline-flex; align-items: center; gap: 5px; }
.tab .ico { width: 16px; height: 16px; filter: none; opacity: .75; }
.tab.on .ico { opacity: 1; }

button .ico { width: 16px; height: 16px; margin: -2px 5px 0 0; filter: none; }
#btn-auto { display: inline-flex; align-items: center; }
#btn-auto:not(.on) .ico { opacity: .6; filter: grayscale(.6); }

.card-title .ico { width: 18px; height: 18px; margin-right: 2px; }

/* ค่าพลังเป็นไอคอนแทนตัวย่อ STR AGI WIT */
.statline span { display: inline-flex; align-items: center; }
.statline .ico.xs { width: 12px; height: 12px; margin-right: 3px; }

/* ---------- กรอบไม้ ----------
   ฉากเป็นหน้าต่างกรอบไม้มองออกไปข้างนอก ส่วนบันทึกกับสรุปทริปเป็นป้ายไม้
   ภาพกรอบ 18x18 จาก tools/make_ui.py ขยาย 2 เท่าให้พิกเซลเป็นเหลี่ยมชัด
   ขนาดฉากนับแค่ข้างใน กรอบงอกออกไปข้างนอก ภาพฉากจะได้แสดงขนาดจริง 320 ไม่ถูกย่อ */
.scene, .card > .scene {
  box-sizing: content-box;
  width: min(320px, calc(100% - 24px));
  max-width: none;
  border: 12px solid transparent;
  border-image: url(../assets/ui/frame_wood.png) 6 / 12px round;
  image-rendering: pixelated;
  outline: none;
  box-shadow: none;
  margin: 0 auto;
}

#log, #haul .card, #workshop .card, #store .card {
  border: 12px solid transparent;
  border-image: url(../assets/ui/frame_wood.png) 6 / 12px round;
  image-rendering: pixelated;
  clip-path: none;
  box-shadow: 0 4px 0 rgba(0,0,0,.45);
}
#log { padding: 4px 6px; }

/* แถบบนมีคานไม้พาดด้านล่าง ใช้ขอบล่างของภาพกรอบเดียวกัน */
#topbar {
  border-style: solid;
  border-color: transparent;
  border-width: 0 0 12px 0;
  border-image: url(../assets/ui/frame_wood.png) 6 / 0 0 12px 0 round;
  image-rendering: pixelated;
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
}

/* =====================================================================
   ของที่หมู่บ้านต้องใช้ (26 ก.ย.) — อัปเกรด อาหารสุทธิ ความทนทาน
   ===================================================================== */

.res-rate.neg { color: var(--bad); }
.res.hungry { border-color: var(--bad); box-shadow: inset 0 0 0 1px rgba(217,112,79,.35); }

.site-lv { font-size: 9px; color: var(--gold); margin-left: 6px; font-weight: normal; }

.upgrade {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.up-head { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: bold; }
.up-head .muted { font-weight: normal; }
.up-cost { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 2px; font-size: 11px; }
.cost-item { display: inline-flex; align-items: center; gap: 3px; }
.upgrade .jobs { margin: 4px 0; }
#arrival-info { margin-top: 3px; }

.dur { font-size: 10px; color: var(--muted); }
.dur.low { color: var(--gold); }
.dur.broken { color: var(--bad); }
.slot.worn { opacity: .75; }
.slot.broken { border-color: var(--bad) !important; opacity: .6; }

/* ---------- พ่อค้าตลาดมืดในฉากหน้าหมู่บ้าน ----------
   ภาพจาก tools/import_trader.py แสดงขนาดจริง ขยับตัวขึ้นลงช้าๆ ให้รู้ว่ามีชีวิต */
.trader-npc {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  z-index: 2;
}
.trader-npc i {
  display: block;
  width: var(--trader-w, 61px);
  height: var(--trader-h, 52px);
  background: url(../assets/sprites/trader.png) no-repeat 0 0 / 100% 100%;
  image-rendering: pixelated;
  animation: trader-breathe 2.4s steps(2) infinite;
}
.trader-npc::after {
  content: ''; position: absolute; left: 50%; bottom: -1px;
  width: 36px; height: 5px; margin-left: -18px;
  border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(1px); z-index: -1;
}
.trader-npc:hover i { filter: drop-shadow(0 0 2px rgba(224,178,76,.95)); }
@keyframes trader-breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1px); }
}
/* มาถึง: เดินเข้ามาจากถนนทางซ้ายล่าง */
.trader-npc.arrive { animation: trader-arrive 3.2s linear both; }
@keyframes trader-arrive {
  from { transform: translate(calc(-50% - 90px), calc(-100% + 30px)); opacity: 0; }
  15%  { opacity: 1; }
  to   { transform: translate(-50%, -100%); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .trader-npc i, .trader-npc.arrive { animation: none; }
}

/* ---------- อัปของสวมใส่ ---------- */
.item-name .plus { color: var(--ice); font-size: 11px; }
.item-name .plus.high { color: var(--gold); text-shadow: 0 0 6px rgba(224,178,76,.55); }
.enh { margin-left: 6px; }
.enh-cost { display: inline-flex; gap: 8px; margin-left: 6px; font-size: 10px; vertical-align: middle; }
.enh-max { margin-left: 8px; font-size: 10px; color: var(--gold); }
.log-line.gold { border-left-color: var(--gold); color: var(--gold); }

/* =====================================================================
   หน้าต่างอัปของ (26 ก.ย.) — ค้อนตี แถบลุ้น เฉลยผล
   ===================================================================== */

.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 6, 12, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-box {
  position: relative;
  width: min(380px, 100%);
  background: rgba(20, 26, 40, .98);
  border: 12px solid transparent;
  border-image: url(../assets/ui/frame_wood.png) 6 / 12px round;
  image-rendering: pixelated;
  padding: 10px 14px 14px;
  box-shadow: 0 10px 0 rgba(0,0,0,.5);
}
.t-close {
  position: absolute; top: 2px; right: 6px;
  background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer;
}
.t-close:hover { color: var(--text); }
.t-title { display: flex; align-items: center; gap: 6px; font-weight: bold; color: var(--ice); margin-bottom: 8px; }

/* เวทีตีของ */
.t-stage {
  position: relative; height: 96px; margin: 4px 0 8px;
  background: radial-gradient(ellipse at 50% 80%, #3a2a1c 0%, #120d0a 70%);
  border: 2px solid var(--frame-dark);
  overflow: hidden;
}
.t-item { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); }
.t-item .ico { width: 48px; height: 48px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.7)); }
.t-hammer { position: absolute; left: 56%; top: 6px; transform-origin: 80% 90%; transform: rotate(35deg); }
.t-hammer .ico { width: 36px; height: 36px; }
.t-sparks { position: absolute; left: 50%; bottom: 40px; width: 2px; height: 2px; opacity: 0; }

.phase-striking .t-hammer { animation: t-hit calc(var(--strike-ms, 1800ms) / 3) ease-in 3; }
.phase-striking .t-sparks { animation: t-spark calc(var(--strike-ms, 1800ms) / 3) ease-out 3; }
.phase-striking .t-item { animation: t-shake calc(var(--strike-ms, 1800ms) / 3) linear 3; }
@keyframes t-hit {
  0%   { transform: rotate(35deg); }
  70%  { transform: rotate(-40deg); }
  78%  { transform: rotate(-32deg); }
  100% { transform: rotate(35deg); }
}
@keyframes t-spark {
  0%, 65% { opacity: 0; box-shadow: none; }
  72% { opacity: 1; box-shadow: -10px -6px 0 #ffd27a, 9px -9px 0 #fff2c0, -4px -14px 0 #ffb347, 13px -2px 0 #ffd27a; }
  100% { opacity: 0; box-shadow: -22px -16px 0 #ffd27a, 20px -20px 0 #fff2c0, -8px -28px 0 #ffb347, 26px -6px 0 #ffd27a; }
}
@keyframes t-shake {
  0%, 68% { transform: translateX(-50%); }
  72% { transform: translate(calc(-50% + 2px), 1px); }
  78% { transform: translate(calc(-50% - 2px), 0); }
  100% { transform: translateX(-50%); }
}

/* ผล */
.t-result {
  position: absolute; left: 0; right: 0; top: 34%;
  text-align: center; font-weight: bold; font-size: 20px; letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
  animation: t-pop .5s ease-out both;
}
.t-result.up { color: var(--ice); }
.t-result.up.big { color: var(--gold); font-size: 26px; text-shadow: 2px 2px 0 #000, 0 0 12px rgba(224,178,76,.9); }
.t-result.stay { color: var(--muted); font-size: 15px; }
.t-result.down { color: var(--bad); font-size: 16px; }
@keyframes t-pop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}
.res-up .t-stage { box-shadow: inset 0 0 24px rgba(159,216,224,.45); }
.res-big .t-stage { animation: t-flash 1.2s ease-out; box-shadow: inset 0 0 40px rgba(224,178,76,.8); }
.res-big { animation: t-quake .45s linear; }
.res-down .t-stage { box-shadow: inset 0 0 24px rgba(217,112,79,.5); }
@keyframes t-flash { 0% { background-color: #fff3c4; } 100% { background-color: transparent; } }
@keyframes t-quake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); } 80% { transform: translate(3px, 1px); }
}

.t-name { font-weight: bold; text-align: center; margin-bottom: 4px; }
.t-line { font-size: 11px; text-align: center; color: var(--muted); margin: 2px 0; }
.t-line b { color: var(--text); }
.t-line.gold { color: var(--gold); }
.t-chance { color: var(--gold) !important; }
.bad-txt { color: var(--bad); }
.t-cost { display: flex; justify-content: center; gap: 14px; margin: 8px 0 6px; font-size: 12px; }
.t-charms { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; font-size: 11px; }
.charm { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.charm.off { opacity: .45; cursor: default; }
.t-bar { height: 6px; margin: 8px 0; background: var(--frame-dark); border: 1px solid var(--frame-mid); }
.t-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c9a06a, var(--gold)); }
.phase-striking .t-bar i { animation: t-fill var(--strike-ms, 1800ms) linear forwards; }
@keyframes t-fill { from { width: 0; } to { width: 100%; } }
.t-strike {
  display: block; width: 100%; padding: 8px; font-family: inherit; font-weight: bold; letter-spacing: 2px;
  color: #2a1a0e; background: linear-gradient(180deg, #f0c870, #c9923e); cursor: pointer;
  border: 2px solid var(--frame-dark);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.4), 0 3px 0 var(--frame-dark);
}
.t-strike:disabled { filter: grayscale(.8) brightness(.6); cursor: default; }
.t-strike:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 1px 1px 0 rgba(0,0,0,.3); }

@media (prefers-reduced-motion: reduce) {
  .phase-striking .t-hammer, .phase-striking .t-sparks, .phase-striking .t-item,
  .res-big, .res-big .t-stage, .t-result { animation: none; }
}

/* ของช่วยอัปในแท็บ Forge */
.charm-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 11px; }
.charm-have { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- อาวุธ +8 +9 +10 เรืองแสงเฉพาะตัวอาวุธ ---------- */
/* จ๊อบกำหนดสี: +8 ม่วง / +9 ทอง / +10 แดง */
.actor.wglow8  .wlayer { filter: drop-shadow(0 0 1px #e0b0ff) drop-shadow(0 0 3px #a24dff) drop-shadow(0 0 4px rgba(162,77,255,.7)); }
.actor.wglow9  .wlayer { filter: drop-shadow(0 0 1px #fff2c0) drop-shadow(0 0 3px #e0b24c) drop-shadow(0 0 4px rgba(224,178,76,.6)); }
.actor.wglow10 .wlayer { filter: drop-shadow(0 0 1px #ffc0b0) drop-shadow(0 0 3px #ff3b2f) drop-shadow(0 0 5px rgba(255,40,30,.7)); }
.actor .wspark {
  position: absolute; left: 70%; top: 40%;
  width: 2px; height: 2px; background: #ffd0c0;
  box-shadow: 3px -5px 0 #ff3b2f, -4px -9px 0 #ffd0c0, 5px -13px 0 #ff3b2f;
  animation: aura-motes 1.3s linear infinite;
  pointer-events: none;
}
.plus.p8  { color: #c58bff !important; text-shadow: 0 0 6px rgba(162,77,255,.7); }
.plus.p9  { color: var(--gold) !important; text-shadow: 0 0 6px rgba(224,178,76,.8); }
.plus.p10 { color: #ff5a4a !important; text-shadow: 0 0 6px rgba(255,40,30,.8); }
.t-result.up.big.p8  { color: #c58bff; }
.t-result.up.big.p10 { color: #ff5a4a; text-shadow: 2px 2px 0 #000, 0 0 12px rgba(255,40,30,.9); }

/* ---------- แถวของที่ใส่ในการ์ดแบบย่อ ----------
   ขอบกับพื้นจางๆ เป็นสีเกรด (สีมาจาก style ของแต่ละช่อง ใช้ currentColor) */
.villager .gear { display: flex; gap: 2px; margin: 2px 0 3px; }
.villager .slot { width: 18px; height: 18px; }
.villager .slot .ico { width: 14px; height: 14px; }
.villager .slot:not(.empty) {
  box-shadow: inset 0 0 0 1px currentColor;
  background: color-mix(in srgb, currentColor 18%, var(--frame-dark));
}

/* ---------- ปุ่ม New Game ท้ายหน้า กับหน้าต่างยืนยัน ---------- */
#footer {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: 10px 16px 28px;
}
.confirm-box { width: min(340px, 100%); text-align: center; }
.c-title { font-weight: bold; font-size: 14px; color: var(--ice); margin: 4px 0 8px; }
.c-title.warn { color: var(--bad); }
.c-text { font-size: 12px; color: var(--muted); line-height: 1.5; }
.c-btns { display: flex; gap: 10px; margin-top: 14px; }
.c-btn {
  flex: 1; padding: 8px; font-family: inherit; font-weight: bold; letter-spacing: 1px; cursor: pointer;
  border: 2px solid var(--frame-dark);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.2), 0 3px 0 var(--frame-dark);
}
.c-btn.no  { background: var(--panel-2); color: var(--text); }
.c-btn.yes { background: #7a2e22; color: #ffd9cf; }
.c-btn:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.c-btn:active { transform: translateY(2px); box-shadow: inset 1px 1px 0 rgba(0,0,0,.3); }

/* มอนสเตอร์ภาพหันซ้าย ฉากที่ทีมมาจากทางขวาต้องกลับด้านให้หันหาทีม */
.monster.flip i { transform: scaleX(-1); }

/* รูปในเกมลากออกไม่ได้ คลุมเลือกไม่ได้ (คู่กับ guardImages ใน main.js) */
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.scene, .actor, .monster, .trader-npc { user-select: none; -webkit-user-select: none; }

/* ---------- รายชื่อชาวบ้านเป็นกล่องเลื่อน (จ๊อบขอ 26 ก.ย.) ----------
   สูงอย่างน้อย 700px เพราะการ์ดตอนกางที่ใส่ของครบ 7 ช่องสูงราว 684px ต้องเห็นได้ทั้งใบ
   จอสูงกว่านั้นยืดเต็มจอ ลบแถบบนกับแท็บออก */
#tab-villagers {
  position: relative;
  max-height: max(700px, calc(100vh - 150px));
  overflow-y: auto;
  padding-right: 4px;
}
#tab-villagers::-webkit-scrollbar { width: 8px; }
#tab-villagers::-webkit-scrollbar-track { background: var(--frame-dark); }
#tab-villagers::-webkit-scrollbar-thumb { background: var(--frame-mid); border: 1px solid var(--frame-hi); }

/* =====================================================================
   ล็อกหน้าเกมให้พอดีจอ (26 ก.ย. จ๊อบขอ) — ไม่เลื่อนทั้งหน้า ช่องไหนยาวเลื่อนเฉพาะในช่อง
   จอกว้าง 4 ช่อง: ทางเดิน · หมู่บ้าน · ชาวบ้าน · บันทึก
   จอกลาง 3 ช่อง: บันทึกไปอยู่ใต้หมู่บ้าน / จอแคบกว่า 1100px เลื่อนหน้าแบบเดิม
   ===================================================================== */

.log-foot { display: flex; justify-content: center; padding: 10px 0 2px; }
#col-log #haul .card { margin-top: 0; margin-bottom: 12px; }

@media (min-width: 1100px) {
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; }
  #topbar { flex: none; }
  main {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    padding: 12px 16px;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }
  main > section {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
  }
  #col-journey { grid-area: trail; }
  #col-village { grid-area: village; }
  #col-people  { grid-area: people; display: flex; flex-direction: column; overflow: hidden; }
  #col-log     { grid-area: log; display: flex; flex-direction: column; overflow: hidden; }

  /* แท็บอยู่กับที่ เนื้อหาใต้แท็บเลื่อนเอง */
  #col-people .tabs { flex: none; }
  #col-people .tab-page { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
  #col-people .tab-page.hidden { display: none; }
  #tab-villagers { max-height: none; }

  /* บันทึกยืดเต็มที่ที่เหลือของช่อง */
  #col-log > h2 { flex: none; }
  #col-log #log { flex: 1; min-height: 80px; max-height: none; }
  #col-log .log-foot { flex: none; }

  main > section::-webkit-scrollbar, #col-people .tab-page::-webkit-scrollbar { width: 8px; }
  main > section::-webkit-scrollbar-track, #col-people .tab-page::-webkit-scrollbar-track { background: var(--frame-dark); }
  main > section::-webkit-scrollbar-thumb, #col-people .tab-page::-webkit-scrollbar-thumb { background: var(--frame-mid); border: 1px solid var(--frame-hi); }
}

@media (min-width: 1400px) {
  main {
    grid-template-columns: 352px minmax(360px, 1fr) minmax(360px, 1fr) 300px;   /* 352 = ฉาก 320 + กรอบ 24 + แถบเลื่อน ภาพเท่าช่องหมู่บ้าน */
    grid-template-areas: "trail village people log";
  }
}

@media (min-width: 1100px) and (max-width: 1399px) {
  main {
    grid-template-columns: 352px minmax(340px, 1fr) minmax(340px, 1fr);
    grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas: "trail village people" "trail log people";
  }
}

/* ---------- การ์ดชาวบ้านตอนกาง เตี้ยลง ----------
   ปุ่ม Take off กับ Refine ขึ้นไปอยู่บรรทัดเดียวกับค่าพลังของชิ้นนั้น
   จากชิ้นละสามบรรทัดเหลือสองบรรทัด การ์ดที่ใส่ของครบจะพอดีกล่องรายชื่อบนจอสูง 744px */
.gear-panel .item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  align-items: center;
}
.gear-panel .item .item-head { grid-column: 1 / -1; }
.gear-panel .item .item-stats { grid-column: 1; }
.gear-panel .item > .jobs { grid-column: 2; margin: 0; flex-wrap: nowrap; justify-content: flex-end; }
.gear-panel .item.empty { display: block; }

/* ปุ่มไล่ชาวบ้านออก อยู่ท้ายการ์ด ชิดขวา สีจางจนกว่าจะชี้ */
.dismiss-row { display: flex; justify-content: flex-end; margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.job.dismiss { color: var(--muted); opacity: .8; }
.job.dismiss:hover { color: var(--bad); border-color: var(--bad) !important; opacity: 1; }

/* ---------- การ์ดผู้สร้างกับลิงก์ร้าน ---------- */
.card.creator {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 10px 0 0;
  flex: none;
}
.creator-pic {
  width: 52px; height: 52px; flex: none;
  image-rendering: auto;          /* รูปวาดเรียบ ไม่ใช่พิกเซล ย่อแบบนุ่ม */
  border: 2px solid var(--frame-dark);
  box-shadow: 0 0 0 1px var(--frame-hi);
  border-radius: 6px;
}
.creator-text { min-width: 0; }
.creator-text .card-title { font-size: 12px; margin-bottom: 1px; }
.creator-text .muted { font-size: 10px; line-height: 1.35; }
.shop-link {
  display: inline-block; margin-top: 5px; padding: 3px 9px;
  font-size: 11px; font-weight: bold; text-decoration: none;
  color: #2a1a0e; background: linear-gradient(180deg, #f0c870, #c9923e);
  border: 2px solid var(--frame-dark);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.4), 0 2px 0 var(--frame-dark);
}
.shop-link:hover { filter: brightness(1.08); }
.shop-link:active { transform: translateY(2px); box-shadow: inset 1px 1px 0 rgba(0,0,0,.3); }

/* ช่องหมู่บ้าน: ภาพฉากขึ้นบนสุดระดับเดียวกับภาพทางเดิน ข้อมูลกับรายชื่อแคมป์อยู่ใต้ภาพ */
.village-scene { margin-bottom: 10px; }
.card.site-info { margin-bottom: 10px; }

/* สรุปทริปล่าสุดชิดล่างของช่องทางเดิน */
@media (min-width: 1100px) {
  #col-journey { display: flex; flex-direction: column; }
  #col-journey > #haul { margin-top: auto; padding-top: 10px; }
}
#col-journey #haul .card { margin-bottom: 0; }

/* ปุ่มเต็มจอ ข้างปุ่ม Auto */
#btn-fullscreen {
  margin-left: 6px; padding: 2px 8px; font-size: 15px; line-height: 1;
  background: var(--panel-2); color: var(--text); cursor: pointer; font-family: inherit;
  border: 2px solid var(--frame-dark);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.14), inset -1px -1px 0 rgba(0,0,0,.35), 0 2px 0 var(--frame-dark);
}
#btn-fullscreen:hover { color: var(--ice); }
#btn-fullscreen.on { color: var(--gold); }
#btn-fullscreen:active { transform: translateY(2px); box-shadow: inset 1px 1px 0 rgba(0,0,0,.3); }


/* =====================================================================
   UI ชุดหน้าต่างไม้ (26 ก.ย. จ๊อบดูร่างแล้วโอเค ให้ใช้จริง)
   1. ทุกช่องเป็นหน้าต่างกรอบไม้สูงเท่ากัน ป้ายหัวช่องห้อยใต้คาน
   2. ของข้างในโทนน้ำตาลเข้มชุดเดียว เลิกโทนเทาฟ้า
   3. ฟอนต์พิกเซล (ลอง Pixelify Sans → Tiny5 → จบที่ DotGothic16 ทั้งเกม ดูท้ายไฟล์)
   4. ทรัพยากรอยู่กลางแถบบน
   ร่างเดิมอยู่ที่ tools/mockup/ ถ้าจะปรับหน้าตาอีก แก้ตรงนี้ได้เลย
   ===================================================================== */

/* ฟอนต์: ย้ายไปใช้ DotGothic16 ทั้งเกมแล้ว ดูท้ายไฟล์ (Tiny5 เลิกใช้ ตัวเล็กอ่านไม่ออก) */


:root {
  --panel: #231c17;
  --panel-2: #2c231c;
  --line: #4a3a2c;
  --frame-dark: #120d0a;
  --frame-mid: #3d3026;
  --frame-hi: #6f5641;
  --muted: #a8977f;
  --text: #f0e6d6;
  --pix: var(--base-font);
}

/* ---------- ช่องทั้งสี่เป็นหน้าต่างกรอบไม้ ---------- */
@media (min-width: 1100px) {
  main { gap: 12px; padding: 10px 12px 12px; }
  main > section {
    background: rgba(20, 15, 12, .93);
    border: 12px solid transparent;
    border-image: url(../assets/ui/frame_wood.png) 6 / 12px round;
    image-rendering: pixelated;
    padding: 34px 8px 8px;
    position: relative;
  }
  /* แท็บของช่องชาวบ้านทำหน้าที่เป็นหัวช่องแทนป้าย */
  #col-people { padding-top: 8px; }
}

/* ป้ายหัวช่อง ฝังอยู่บนคานไม้ด้านบนของหน้าต่าง สีไม้เท่ากรอบ (จ๊อบบอกแบบแรกโดดไป) */
main > section > h2 {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0 12px 3px;
  background: linear-gradient(180deg, #8a5a32 0%, #6e4526 100%);
  border: 2px solid #1e130c;
  border-top: 0;                /* ห้อยต่อจากคานไม้ด้านบน ไม่มีเส้นคั่น */
  box-shadow: none;
  color: #f1dcb6;
  font-family: var(--pix);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: none;
  text-shadow: 1px 1px 0 #2a180c;
  white-space: nowrap;
  opacity: 1;
  z-index: 3;
}
@media (min-width: 1100px) {
  main > section { padding-top: 26px; }
}
main > section > h2::after { display: none; }
main > section > h2 .ico { width: 14px; height: 14px; margin-right: 4px; filter: none; vertical-align: -2px; }
/* ช่องบันทึก: หัวข้อ Log อยู่กลางช่อง ไม่ใช่หัวช่อง */
#col-log > h2 {
  position: static; transform: none; align-self: center; margin: 8px 0 6px;
  font-size: 12px; padding: 2px 12px 3px;
}
#col-log { padding-top: 8px !important; }

/* ภาพฉากในหน้าต่างไม้ ใช้กรอบบางแบบหน้าต่างมองออกไป ไม่ซ้อนไม้สองชั้น */
.scene, .card > .scene {
  border: 3px solid var(--frame-dark);
  border-image: none;
  box-shadow: inset 0 0 0 1px var(--frame-hi), 0 3px 0 rgba(0,0,0,.4);
  outline: 1px solid var(--frame-mid);
}
#log, #haul .card, #workshop .card, #store .card {
  border: 2px solid var(--frame-dark);
  border-image: none;
  box-shadow: inset 1px 1px 0 var(--frame-hi), inset -1px -1px 0 var(--frame-mid);
}

/* ---------- ของข้างในโทนเดียวกัน ---------- */
.card, .site-row, .villager, #log {
  background: var(--panel);
  box-shadow: inset 2px 2px 0 var(--frame-hi), inset -2px -2px 0 var(--frame-mid), 0 2px 0 rgba(0,0,0,.45);
}
.villager.open, .site-row.on {
  box-shadow: inset 2px 2px 0 var(--gold), inset -2px -2px 0 #6b5220, 0 2px 0 rgba(0,0,0,.45);
}
.site-row.on { background: #33281e; }

.tabs { border-bottom-color: var(--frame-hi); }
.tab { background: var(--panel-2); color: var(--muted); font-family: var(--pix); font-size: 13px; letter-spacing: 0; text-transform: none; }
.tab.on { background: var(--panel); color: #fff4dc; box-shadow: inset 0 2px 0 var(--gold); }
.tab span { color: var(--muted); }

.job, .site, .node {
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--pix);
  font-size: 12px;
}
.job.on, .site.on, .node.on { background: var(--gold); color: #2a1a0e; }
.site.claimed { color: var(--green); }

/* ปุ่มหลักใช้ทองแบบเดียวกับปุ่ม Refine */
.send {
  font-family: var(--pix); font-size: 14px; font-weight: 600;
  background: linear-gradient(180deg, #f0c870, #c9923e) !important;
  color: #2a1a0e !important;
}
.send:disabled { filter: grayscale(.8) brightness(.55); }

/* ---------- ตัวหนังสือ ---------- */
.card-title, .site-name, .t-title, .c-title, .up-head { font-family: var(--pix); font-weight: 600; letter-spacing: .3px; }
.card-title { font-size: 14px; }
.villager .card-title { font-size: 14px; }
.res-amt, .statline b, .site-rate, .site-crew, .pill, .flag { font-family: var(--pix); }
.res-amt { font-size: 15px; }

/* ---------- แถบบน ---------- */
#topbar { justify-content: space-between; }
#resources { flex: 0 1 auto; justify-content: center; margin: 0 auto; }
.res {
  background: rgba(18, 13, 10, .7);
  border: 1px solid var(--frame-hi);
  padding: 3px 10px 3px 6px;
}
#btn-auto { font-family: var(--pix); font-size: 13px; }

/* ---------- ขนาดฟอนต์ Tiny5 (26 ก.ย. จ๊อบเจอเลขข้างดาวเลเวลอ่านไม่ออก) ----------
   Tiny5 เป็นพิกเซลตัวเล็ก ต่ำกว่า ~13px อ่านไม่ออก และคมพอดีที่ 16px (พิกเซลละ 2 จุด)
   ใช้ Tiny5 เฉพาะของตัวใหญ่ที่ 16px / ของตัวเล็กกลับไปใช้ตัวหนังสือเดิมที่อ่านชัดตอนเล็ก */
:root { --base-font: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; }

.card-title, .villager .card-title, .tab, .send, #btn-auto, .res-amt,
main > section > h2, .t-title, .c-title { font-size: 16px; }
main > section > h2 { padding: 0 12px 2px; }
#col-log > h2 { font-size: 16px; }
.tab { padding: 3px 10px 3px; }
#btn-auto { font-size: 14px; }

/* ตัวเล็กทั้งหมดใช้ตัวหนังสือเดิม (บางตัวอยู่ในหัวข้อที่เป็น Tiny5 เลยต้องตั้งตรงๆ) */
.pill, .flag, .site-lv, .statline, .statline b, .site-crew, .site-rate, .site-name,
.job, .job.tiny, .site, .node, .up-head, .cost, .cost-item, .enh-cost, .enh-max,
.tab span, .item-name, .item-slot, .t-line, .gain {
  font-family: var(--base-font);
}
.pill.lvl { font-size: 11px; font-weight: bold; color: var(--text); }
.statline b { font-size: 11px; }
.creator-text .card-title { font-size: 16px; }

/* =====================================================================
   ฟอนต์เดียวทั้งเกม DotGothic16 + หัวช่องแบบไม่มีกล่อง (26 ก.ย. จ๊อบขอ)
   จ๊อบอยากให้ทั้งเกมฟอนต์เดียวกัน Tiny5 ตัวเล็กอ่านไม่ออก ส่วน DotGothic16 ขนาด 11px ยังอ่านเลขได้ชัด
   สัญญาอนุญาต SIL OFL 1.1 อยู่ที่ assets/fonts/DotGothic16-OFL.txt
   ===================================================================== */
@font-face {
  font-family: 'DotGothic16';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/DotGothic16-latin.woff2) format('woff2');
}
:root {
  --base-font: 'DotGothic16', ui-monospace, Consolas, monospace;
  --pix: 'DotGothic16', ui-monospace, Consolas, monospace;
}
body, button, input { font-family: var(--base-font); }
/* ฟอนต์นี้ไม่มีตัวหนา บังคับหนาจะเบลอ */
b, strong, .card-title, .site-name, .pill.lvl, .statline b, .res-amt { font-weight: normal; }

/* ป้ายหัวช่อง: ไม่มีกล่องแล้ว ตัวหนังสือสีครีมกลางช่อง มีเส้นประดับสองข้าง (จ๊อบบอกป้ายกล่องยังจัดตา) */
main > section > h2, #col-log > h2 {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: #e3cfa9;
  font-size: 16px;
  text-shadow: 1px 1px 0 #000;
}
main > section > h2::before, main > section > h2::after {
  content: '';
  display: block;
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--frame-hi) 0 4px, transparent 4px 7px);
  opacity: .8;
}
@media (min-width: 1100px) {
  main > section { padding-top: 8px; }
}

/* =====================================================================
   ระบบขนาดชุดเดียวทั้งเกม (26 ก.ย. จ๊อบเห็นไอคอน ตัวหนังสือ กรอบ ไม่สมส่วนกัน)
   ป้าย 18px · ปุ่มเล็ก 24px · ปุ่มหลัก 30px · ไอคอนในปุ่ม/แท็บ 16px · ไอคอนในป้าย 12px
   ทุกอย่างจัดกึ่งกลางแนวตั้งด้วย inline-flex + line-height 1
   ===================================================================== */

/* ป้าย: เลเวล สถานะ ความหนาว */
.pill, .flag {
  display: inline-flex; align-items: center; gap: 3px;
  height: 18px; padding: 0 6px;
  font-size: 11px; line-height: 1;
  vertical-align: middle;
  text-transform: none;
}
.pill .ico, .flag .ico, .pill.lvl .ico { width: 12px; height: 12px; margin: 0; filter: none; }
.card-title { align-items: center; gap: 6px; line-height: 1.2; }

/* ช่องตัวเลขเส้นทาง */
.nodes { gap: 4px; }
.node {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  font-size: 12px; line-height: 1;
}

/* ช่องทรัพยากรบนแถบบน */
.res { height: 30px; align-items: center; gap: 6px; padding: 0 10px 0 6px; }
.res .ico { width: 18px; height: 18px; }
.res-amt { font-size: 15px; line-height: 1; min-width: 0; }
.res-rate { font-size: 11px; line-height: 1; }

/* แท็บ */
.tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; font-size: 15px; line-height: 1; }
.tab .ico { width: 16px; height: 16px; opacity: .85; }
.tab.on .ico { opacity: 1; }
.tab span { font-size: 11px; line-height: 1; }

/* ปุ่ม */
.job, .site {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  font-size: 12px; line-height: 1;
}
.job .ico, .site .ico { width: 14px; height: 14px; margin: 0; }
.send { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 16px; font-size: 14px; line-height: 1; }
.send .ico { width: 16px; height: 16px; margin: 0; }
#btn-auto { height: 30px; padding: 0 12px; gap: 6px; line-height: 1; }
#btn-auto .ico { width: 16px; height: 16px; margin: 0; }
#btn-fullscreen { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; padding: 0; }

/* บรรทัดค่าพลังในการ์ด */
.statline { font-size: 11px; align-items: center; gap: 10px; line-height: 1; }
.statline .ico.xs { width: 12px; height: 12px; }

/* ช่องเส้นทางที่ผ่านมาแล้ว เดิมสีฟ้าเทาหลงมาจากธีมเก่า เปลี่ยนเป็นโทนไม้ */
.nodes.plain .node.done { background: #3a2f24; color: var(--muted); }
.nodes.plain .node { background: var(--panel-2); }
.nodes.plain .node.on { background: var(--gold); color: #2a1a0e; }

/* แถวแคมป์: เลเวลกับป้ายพ่อค้า ขนาดและระยะเท่ากัน */
.site-name { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.site-lv { font-size: 11px; margin-left: 0; }
.site-name .flag { height: 16px; }

/* หน้าต่างตีบวกกับหน้าต่างยืนยัน เดิมพื้นน้ำเงินหลงมาจากธีมเก่า */
.modal-box { background: rgba(28, 22, 18, .98); }
.t-title, .c-title { color: #e3cfa9; }
.c-title.warn { color: var(--bad); }
.t-stage { border-color: var(--frame-dark); }

/* ---------- ตัวหลงถิ่น มอนพิเศษ และภาพของเหตุการณ์ (26 ก.ย.) ---------- */

/* ตัวหลงถิ่น ใหญ่กว่าปกติ แสงแดงอมส้มรอบตัว ให้รู้ว่าไม่ใช่มอนสเตอร์ประจำฉาก */
.monster.stray i, .monster.special i, .monster.lurk i { transform: scale(1.35); transform-origin: 50% 100%; }
.monster.flip.stray i, .monster.flip.special i, .monster.flip.lurk i { transform: scale(-1.35, 1.35); }
/* ตัวหลงถิ่น (28 ก.ย. จ๊อบ): ขอบแดงเดิมกลืนกับทราย → ควันดำเป็นเปลวรอบตัว ทั้งสองแมพ (.mfx.smoke ท้ายไฟล์) */
/* มอนพิเศษ แสงฟ้าอมทองเต้นเป็นจังหวะ */
.monster.special i { animation: sprite-frames .8s steps(4) infinite, special-glow 1.6s ease-in-out infinite; }
@keyframes special-glow {
  0%, 100% { filter: drop-shadow(0 0 1px #fff3c4) drop-shadow(0 0 3px rgba(159,216,224,.8)); }
  50%      { filter: drop-shadow(0 0 2px #fff3c4) drop-shadow(0 0 7px rgba(224,178,76,.95)); }
}
/* ตอนยังตัดสินใจ เห็นแค่เงาดำอยู่ข้างหน้า ยังไม่รู้ว่าตัวอะไร */
.monster.lurk i { filter: brightness(0) drop-shadow(0 0 2px rgba(0,0,0,.6)); opacity: .82; animation-duration: 1.6s; }

.pill.stray-foe { color: var(--bad); border-color: var(--bad); }
.pill.rare-foe  { color: var(--gold); border-color: var(--gold); }

/* ป้ายเด้งกลางฉากตอนเจอมอนพิเศษ */
.enc-banner {
  position: absolute; left: 50%; top: 14%; z-index: 400;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; white-space: nowrap;
  font-size: 13px; color: var(--gold);
  background: rgba(10,12,18,.9); border: 2px solid var(--gold);
  box-shadow: 0 0 10px rgba(224,178,76,.55);
  animation: enc-pop 4s ease-out forwards; pointer-events: none;
}
.scene .enc-banner img { width: 16px; height: 16px; }
@keyframes enc-pop {
  0%   { opacity: 0; transform: translateX(-50%) scale(.6); }
  10%  { opacity: 1; transform: translateX(-50%) scale(1.08); }
  18%  { transform: translateX(-50%) scale(1); }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

/* คนหลงทางนั่งโบกมือข้างทาง */
.actor.stranger { animation: stranger-wave 1.2s ease-in-out infinite; }
@keyframes stranger-wave { 0%, 100% { margin-top: 0; } 50% { margin-top: -2px; } }

/* ของในฉาก เช่นเลื่อนจมน้ำแข็ง แสดงขนาดจริง */
.prop { position: absolute; transform: translate(-50%, -100%); pointer-events: none; }
.scene .prop img { width: auto; height: auto; image-rendering: pixelated; }

/* พายุหิมะ ฉากขาวโพลน หิมะพัดเฉียงแรง */
.scene.whiteout::after {
  content: ''; position: absolute; inset: 0; z-index: 390; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12px 20px, rgba(255,255,255,.95), transparent),
    radial-gradient(1.5px 1.5px at 70px 90px, rgba(255,255,255,.85), transparent),
    radial-gradient(2px 2px at 130px 40px, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 40px 140px, rgba(255,255,255,.8), transparent),
    linear-gradient(rgba(230,240,248,.55), rgba(230,240,248,.7));
  background-size: 160px 160px, 160px 160px, 160px 160px, 160px 160px, 100% 100%;
  animation: whiteout-blow .9s linear infinite;
}
@keyframes whiteout-blow {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: -160px 80px, -160px 80px, -160px 80px, -160px 80px, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scene.whiteout::after, .monster.special i, .actor.stranger { animation: none; }
}

/* ผลคราฟล่าสุด ใต้ปุ่ม Forge กรอบกับชื่อเป็นสีตามระดับ (26 ก.ย.) */
.forged {
  position: relative; margin-top: 6px; padding: 6px 8px;
  border: 2px solid; background: rgba(10,12,18,.55);
}
.forged.pop { animation: forged-pop .35s ease-out; }
.forged .item-name { font-size: 12px; }
.forged-tag {
  float: right; font-size: 10px; padding: 0 4px; border: 1px solid;
}
@keyframes forged-pop {
  0%   { transform: scale(.92); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .forged { animation: none; } }

/* ---------- ระดับตัวละคร: กรอบสีหลังรูปบนการ์ด (26 ก.ย.) ---------- */
.portrait[class*="tier-"] {
  border-color: var(--tier);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.5);
  background: radial-gradient(ellipse at 50% 90%, color-mix(in srgb, var(--tier) 38%, #0d111b) 0%, #0d111b 78%);
}
.portrait.tier-common { border-color: var(--frame-dark); box-shadow: inset 0 0 0 1px var(--frame-mid); }
.portrait.tier-legendary { box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), 0 0 4px rgba(224,178,76,.55); }
.portrait.tier-mystical { animation: tier-red 1.8s ease-in-out infinite; }
@keyframes tier-red {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), 0 0 3px rgba(230,60,50,.55); }
  50%      { box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), 0 0 8px rgba(230,60,50,.95); }
}
@media (prefers-reduced-motion: reduce) { .portrait.tier-mystical { animation: none; } }

/* ---------- หน้าประตู ---------- */
.gate .card-body { padding: 6px 8px; }
.gate-head {
  display: flex; align-items: center; gap: 5px; width: 100%;
  background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.gate-title { font-size: 12px; margin-right: 4px; }
.gate-head .chev { margin-left: auto; color: var(--muted); }
.portrait.mini { width: 22px; height: 28px; overflow: hidden; }
.portrait.mini .actor { transform: translate(-50%, -100%) scale(.8); transform-origin: 50% 100%; }
.gate-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.gate-row .card-title { font-size: 12px; gap: 5px; }
.gate-min { display: block; margin-top: 8px; font-size: 10px; }
.gate-min select { font: inherit; font-size: 10px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }

/* เลือกคนออกแลก */
.swap-list { max-height: 50vh; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.swap-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.swap-row:hover { border-color: var(--gold); }
.swap-name { font-size: 12px; }
.swap-meta { margin-left: auto; font-size: 10px; color: var(--muted); text-align: right; line-height: 1.5; }

/* นักรบรับจ้างในร้าน */
.goods.merc { display: flex; gap: 8px; align-items: flex-start; }

/* ---------- ร้านค้าประจำหมู่บ้าน (26 ก.ย.) ---------- */
.store-npc { position: absolute; transform: translate(-50%, -100%); cursor: pointer; }
.scene .store-npc img { position: absolute; left: 0; top: 0; width: auto; height: auto; image-rendering: pixelated; }
.store-front { z-index: 3; pointer-events: none; }
.store-npc:hover .store-front { filter: drop-shadow(0 0 2px rgba(224,178,76,.9)); }
.card.store .store-row .jobs { margin-top: 3px; }

/* ป้ายงานบนการ์ดชาวบ้าน ชิดขวาของแถวชื่อ ชื่อยาวตัดท้ายเป็น ... (26 ก.ย.) */
.villager .card-title { min-width: 0; }
.flag.job-tag { margin-left: auto; max-width: 48%; min-width: 0; overflow: hidden; }
.flag.job-tag .jt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag.job-tag.res-wood  { color: #c89a6a; border-color: #7a5a3a; }
.flag.job-tag.res-food  { color: var(--green); border-color: #3d5a3a; }
.flag.job-tag.res-stone { color: #b8bcc4; border-color: #5a5e66; }
.flag.job-tag.rest      { color: var(--ice); border-color: var(--ice); }
.flag.job-tag.party     { color: var(--gold); border-color: var(--gold); }
.flag.job-tag.out       { color: #6fa8d8; border-color: #2e4a66; }
.flag.job-tag.idle      { color: var(--muted); border-color: var(--line); }
.flag.job-tag.dead      { color: var(--bad); border-color: var(--bad); }

/* =====================================================================
   ธีม UI ตามโซน — โซนหิมะ (26 ก.ย.)
   กฎ: UI เปลี่ยนตามโซน โลโก้ ไอคอน สีระดับของ ใช้ร่วมทุกโซน
   รอบนี้จ๊อบเลือก "แบบ Y" จากหน้าร่าง tools/mockup/noframe.html: ไม่มีกรอบภาพ หน้าต่างใส เส้นขอบบางสีฟ้าอ่อน
   ปุ่ม แท็บ แถบเลื่อน เรียบบางเข้าชุดกัน ไม่มีของตกแต่งน้ำแข็ง
   ลองแล้วไม่เอา: กรอบไม้ย้อมฟ้า, กรอบวาดเองมีหิมะ/แท่งน้ำแข็ง, ชุดกรอบ Iceblock (ดูนานแล้วขัดตา),
   ความวาว/ประกาย, หิมะตกทั้งจอ, ลายเกล็ดหิมะ
   เพิ่มโซนใหม่ = ก๊อปบล็อกนี้ เปลี่ยน data-zone กับตัวแปรสี
   ===================================================================== */
body[data-zone="ice"] {
  --panel: rgba(12, 28, 46, .80);
  --panel-2: rgba(26, 50, 76, .85);
  --line: #3f6788;
  --frame-dark: #06101c;
  --frame-mid: #2c5070;
  --frame-hi: #8cbad8;
  --muted: #9fbad2;
  --text: #eef7fd;
  --accent: #c6f0ff;
  --edge: rgba(160, 205, 232, .55);      /* เส้นขอบบาง ใช้ทั้งหน้าต่าง การ์ด ปุ่ม */
  --edge-hi: rgba(200, 235, 252, .9);
}
body[data-zone="ice"]::before { display: none; }     /* หิมะตกทั้งจอ จ๊อบให้เอาออก */

/* หน้าต่างทั้งสี่ช่อง: ใส เห็นฉากหลัง เส้นขอบบาง */
@media (min-width: 1100px) {
  body[data-zone="ice"] main > section {
    border: 1px solid var(--edge);
    border-image: none;
    border-radius: 3px;
    padding: 12px 10px 10px;
    background: rgba(8, 18, 32, .34);
    box-shadow: inset 0 0 0 1px rgba(6, 16, 28, .6), 0 2px 8px rgba(0, 0, 0, .35);
  }
}

/* หัวช่อง */
body[data-zone="ice"] main > section > h2,
body[data-zone="ice"] #col-log > h2 {
  color: #e2f5ff;
  text-shadow: 1px 1px 0 #02060c;
}
body[data-zone="ice"] main > section > h2::before,
body[data-zone="ice"] main > section > h2::after {
  background: repeating-linear-gradient(90deg, var(--edge) 0 4px, transparent 4px 7px);
  opacity: 1;
}

/* แถบบน */
body[data-zone="ice"] #topbar {
  border-image: none;
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(20, 42, 66, .92), rgba(8, 18, 32, .92));
}
body[data-zone="ice"] .res {
  background: rgba(14, 32, 52, .85);
  border: 1px solid var(--edge) !important;
  box-shadow: none;
}

/* ภาพฉาก */
body[data-zone="ice"] .scene,
body[data-zone="ice"] .card > .scene {
  border: 1px solid var(--edge);
  border-image: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
  outline: none;
}

/* การ์ดข้างใน */
body[data-zone="ice"] .card,
body[data-zone="ice"] .site-row,
body[data-zone="ice"] .villager,
body[data-zone="ice"] #log {
  background: rgba(10, 24, 40, .78);
  border: 1px solid rgba(120, 170, 205, .35) !important;
  border-image: none;
  border-radius: 2px;
  box-shadow: none;
}
body[data-zone="ice"] .villager.open,
body[data-zone="ice"] .site-row.on {
  background: rgba(22, 46, 70, .9);
  border-color: var(--edge-hi) !important;
  box-shadow: 0 0 6px rgba(160, 220, 250, .25);
}
body[data-zone="ice"] .tabs { border-bottom: 1px solid var(--edge); }

/* ปุ่ม แท็บ เลขเส้นทาง: เรียบ บาง เข้าชุดกับเส้นขอบ */
body[data-zone="ice"] .job,
body[data-zone="ice"] .site,
body[data-zone="ice"] .node,
body[data-zone="ice"] .tab,
body[data-zone="ice"] .t-strike,
body[data-zone="ice"] .shop-link {
  border: 1px solid var(--edge) !important;
  border-image: none !important;
  border-radius: 2px;
  background: rgba(26, 52, 80, .75) !important;
  box-shadow: none !important;
  color: #e6f3ff !important;
  text-shadow: none;
}
body[data-zone="ice"] .job:hover,
body[data-zone="ice"] .site:hover,
body[data-zone="ice"] .tab:hover { border-color: var(--edge-hi) !important; background: rgba(40, 72, 104, .85) !important; }
body[data-zone="ice"] .tab span { color: inherit !important; opacity: .7; }
body[data-zone="ice"] .job.on,
body[data-zone="ice"] .site.on,
body[data-zone="ice"] .node.on,
body[data-zone="ice"] .nodes.plain .node.on,
body[data-zone="ice"] .tab.on {
  background: rgba(198, 240, 255, .9) !important;
  border-color: #e8f8ff !important;
  color: #0b1b2a !important;
}
body[data-zone="ice"] .tab.on span { color: #0b1b2a !important; }
body[data-zone="ice"] .site.claimed { color: var(--green) !important; }
/* ปุ่มหลัก (Send out) เด่นกว่าปุ่มอื่นด้วยพื้นทึบสีอ่อน */
body[data-zone="ice"] .send {
  border: 1px solid #e8f8ff !important;
  border-image: none !important;
  border-radius: 2px;
  background: rgba(198, 240, 255, .92) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.35) !important;
  color: #0b1b2a !important;
}
body[data-zone="ice"] .job:disabled,
body[data-zone="ice"] .send:disabled { filter: grayscale(.7) brightness(.7); }

/* แถบพลัง */
body[data-zone="ice"] .bar { background: rgba(6, 16, 28, .8); border: 1px solid rgba(120, 170, 205, .35); }

/* แถบเลื่อน: เส้นบางมน สีเดียวกับเส้นขอบ (เดิมเป็นแท่งหนามีขอบ จ๊อบบอกไม่เข้ากับ UI) */
body[data-zone="ice"] * { scrollbar-width: thin; scrollbar-color: rgba(160, 205, 232, .5) transparent; }
body[data-zone="ice"] ::-webkit-scrollbar { width: 6px !important; height: 6px !important; }
body[data-zone="ice"] ::-webkit-scrollbar-track { background: transparent !important; border: 0 !important; }
body[data-zone="ice"] ::-webkit-scrollbar-thumb {
  background: rgba(160, 205, 232, .45) !important;
  border: 0 !important;
  border-radius: 3px;
}
body[data-zone="ice"] ::-webkit-scrollbar-thumb:hover { background: rgba(200, 235, 252, .75) !important; }

/* =====================================================================
   ธีม UI ตามโซน — ทะเลทราย The Scorched East (27 ก.ย. หน้าทดลอง)
   จ๊อบตกลง: แบบ Y เหมือนหิมะ แค่เปลี่ยนสี · โลโก้ ไอคอน สีระดับของ ใช้ร่วมทุกโซน
   จ๊อบเลือกโทน A ทรายทอง (27 ก.ย.) จากที่ลอง 3 โทน · ลองแล้วไม่เอา: B ดินเผาพลบค่ำ, C ทะเลทรายกลางคืน
   สีทุกอย่างอยู่ในตัวแปร กฎด้านล่างเหมือนของหิมะทุกบรรทัด
   ===================================================================== */
body[data-zone="desert"] {
  --panel: rgba(46, 30, 16, .80);
  --panel-2: rgba(70, 46, 26, .85);
  --line: #8a6a3e;
  --frame-dark: #1a0f06;
  --frame-mid: #6e5030;
  --frame-hi: #e0c088;
  --muted: #d2b98e;
  --text: #fbf3e4;
  --accent: #ffe2a8;
  --edge: rgba(226, 190, 120, .55);
  --edge-hi: rgba(250, 226, 170, .9);
  --win-bg: rgba(36, 22, 10, .34);
  --win-inset: rgba(22, 12, 4, .6);
  --title: #fdebc6;
  --bar-top: rgba(70, 46, 22, .92);
  --bar-bot: rgba(34, 20, 8, .92);
  --res-bg: rgba(52, 34, 16, .85);
  --card-bg: rgba(40, 26, 12, .78);
  --card-line: rgba(210, 168, 104, .35);
  --card-on: rgba(76, 52, 26, .9);
  --card-glow: rgba(250, 210, 140, .25);
  --btn-bg: rgba(84, 58, 30, .75);
  --btn-hover: rgba(110, 78, 42, .85);
  --btn-text: #fff3dc;
  --on-bg: rgba(246, 218, 158, .92);
  --on-line: #fff4dc;
  --on-text: #2a1a08;
  --bar-bg: rgba(26, 14, 4, .8);
  --scroll: rgba(226, 190, 120, .5);
  --scroll-hi: rgba(250, 226, 170, .8);
  --sky-1: #3a1e2e; --sky-2: #a2502e; --sky-3: #e8a45a; --dune-1: #6a3c1c; --dune-2: #3a200e;
}
body[data-zone="desert"]::before { display: none; }

/* พื้นหลัง: ภาพเนินทรายพลบค่ำ (backdrop_desert.jpg) ถ้ายังไม่มีภาพ เห็นท้องฟ้ากับเนินทรายที่วาดด้วยสี */
body[data-zone="desert"] {
  background:
    linear-gradient(180deg, rgba(10,6,4,.70) 0%, rgba(10,6,4,.42) 45%, rgba(10,6,4,.12) 100%),
    url(../assets/ui/backdrop_desert.jpg) center bottom / cover no-repeat fixed,
    radial-gradient(120% 40% at 30% 100%, var(--dune-2) 60%, transparent 61%) fixed,
    radial-gradient(90% 34% at 85% 100%, var(--dune-1) 60%, transparent 61%) fixed,
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 80%) fixed;
}

@media (min-width: 1100px) {
  body[data-zone="desert"] main > section {
    border: 1px solid var(--edge);
    border-image: none;
    border-radius: 3px;
    padding: 12px 10px 10px;
    background: var(--win-bg);
    box-shadow: inset 0 0 0 1px var(--win-inset), 0 2px 8px rgba(0, 0, 0, .35);
  }
}
body[data-zone="desert"] main > section > h2,
body[data-zone="desert"] #col-log > h2 { color: var(--title); text-shadow: 1px 1px 0 #0a0502; }
body[data-zone="desert"] main > section > h2::before,
body[data-zone="desert"] main > section > h2::after {
  background: repeating-linear-gradient(90deg, var(--edge) 0 4px, transparent 4px 7px);
  opacity: 1;
}
body[data-zone="desert"] #topbar {
  border-image: none;
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(180deg, var(--bar-top), var(--bar-bot));
}
body[data-zone="desert"] .res { background: var(--res-bg); border: 1px solid var(--edge) !important; box-shadow: none; }
body[data-zone="desert"] .scene,
body[data-zone="desert"] .card > .scene {
  border: 1px solid var(--edge); border-image: none; box-shadow: 0 2px 6px rgba(0,0,0,.45); outline: none;
}
body[data-zone="desert"] .card,
body[data-zone="desert"] .site-row,
body[data-zone="desert"] .villager,
body[data-zone="desert"] #log {
  background: var(--card-bg);
  border: 1px solid var(--card-line) !important;
  border-image: none;
  border-radius: 2px;
  box-shadow: none;
}
body[data-zone="desert"] .villager.open,
body[data-zone="desert"] .site-row.on {
  background: var(--card-on); border-color: var(--edge-hi) !important; box-shadow: 0 0 6px var(--card-glow);
}
body[data-zone="desert"] .tabs { border-bottom: 1px solid var(--edge); }
body[data-zone="desert"] .job,
body[data-zone="desert"] .site,
body[data-zone="desert"] .node,
body[data-zone="desert"] .tab,
body[data-zone="desert"] .t-strike,
body[data-zone="desert"] .shop-link {
  border: 1px solid var(--edge) !important;
  border-image: none !important;
  border-radius: 2px;
  background: var(--btn-bg) !important;
  box-shadow: none !important;
  color: var(--btn-text) !important;
  text-shadow: none;
}
body[data-zone="desert"] .job:hover,
body[data-zone="desert"] .site:hover,
body[data-zone="desert"] .tab:hover { border-color: var(--edge-hi) !important; background: var(--btn-hover) !important; }
body[data-zone="desert"] .tab span { color: inherit !important; opacity: .7; }
body[data-zone="desert"] .job.on,
body[data-zone="desert"] .site.on,
body[data-zone="desert"] .node.on,
body[data-zone="desert"] .nodes.plain .node.on,
body[data-zone="desert"] .tab.on {
  background: var(--on-bg) !important; border-color: var(--on-line) !important; color: var(--on-text) !important;
}
body[data-zone="desert"] .tab.on span { color: var(--on-text) !important; }
body[data-zone="desert"] .site.claimed { color: var(--green) !important; }
body[data-zone="desert"] .send {
  border: 1px solid var(--on-line) !important;
  border-image: none !important;
  border-radius: 2px;
  background: var(--on-bg) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.35) !important;
  color: var(--on-text) !important;
}
body[data-zone="desert"] .job:disabled,
body[data-zone="desert"] .send:disabled { filter: grayscale(.7) brightness(.7); }
body[data-zone="desert"] .bar { background: var(--bar-bg); border: 1px solid var(--card-line); }
body[data-zone="desert"] * { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
body[data-zone="desert"] ::-webkit-scrollbar { width: 6px !important; height: 6px !important; }
body[data-zone="desert"] ::-webkit-scrollbar-track { background: transparent !important; border: 0 !important; }
body[data-zone="desert"] ::-webkit-scrollbar-thumb { background: var(--scroll) !important; border: 0 !important; border-radius: 3px; }
body[data-zone="desert"] ::-webkit-scrollbar-thumb:hover { background: var(--scroll-hi) !important; }

/* ---------- ปุ่ม Warp (27 ก.ย.) ใช้ทรงเดียวกับปุ่ม Auto ---------- */
#btn-warp {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; line-height: 1;
  font-family: var(--pix); font-size: 14px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--edge, var(--line)); border-radius: 2px;
}
#btn-warp .ico { width: 16px; height: 16px; margin: 0; }
#btn-warp:hover:not(:disabled) { border-color: var(--edge-hi, var(--muted)); }
#btn-warp:disabled { cursor: default; opacity: .5; filter: grayscale(.8); }

/* หน้าต่างเลือกคนตอนวาร์ป */
.warp-row .warp-check {
  width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid var(--line); text-align: center; line-height: 14px; font-size: 12px;
}
.warp-row.on { border-color: var(--gold); }
.warp-row.on .warp-check { background: var(--gold); color: #1a1208; border-color: var(--gold); }
.confirm-box .jobs .muted { align-self: center; font-size: 11px; }

/* จอจางดำแล้วสว่างขึ้นตอนวาร์ป */
.warp-flash { position: fixed; inset: 0; z-index: 9000; background: #000; pointer-events: none; animation: warp-fade 1.2s ease-out forwards; }
@keyframes warp-fade { 0% { opacity: 1; } 35% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .warp-flash { animation-duration: .3s; } }

/* ช่องพักคน */
.card.held .gate-title { color: var(--gold); }
.held-row .jobs { margin-top: 4px; }

/* พายุทราย ฉากส้มฝุ่นตลบ ทรายพัดเฉียง (แทนพายุหิมะในทะเลทราย) */
.scene.sandstorm::after {
  content: ''; position: absolute; inset: 0; z-index: 390; pointer-events: none;
  background-image:
    radial-gradient(2px 1px at 12px 20px, rgba(255,214,150,.95), transparent),
    radial-gradient(1.5px 1px at 70px 90px, rgba(240,190,120,.85), transparent),
    radial-gradient(2px 1px at 130px 40px, rgba(255,220,160,.9), transparent),
    radial-gradient(1.5px 1px at 40px 140px, rgba(230,170,100,.8), transparent),
    linear-gradient(rgba(214,140,70,.5), rgba(190,110,50,.65));
  background-size: 160px 160px, 160px 160px, 160px 160px, 160px 160px, 100% 100%;
  animation: sand-blow .7s linear infinite;
}
@keyframes sand-blow {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: -160px 30px, -160px 30px, -160px 30px, -160px 30px, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .scene.sandstorm::after { animation: none; } }

/* ---------- เอฟเฟกต์การต่อสู้ (27 ก.ย. หน้าทดลอง) ----------
   ui.js spawnFx วางชั้นลอยในกล่องฉาก เลื่อนเฟรมเอง · --flip = -1 เมื่อพุ่งไปทางซ้าย */
.scene .vfx, .t-stage .vfx {   /* .t-stage = หน้าต่างตีบวก (สายฟ้า +9/+10 · 1 ต.ค.) */
  position: absolute; display: block; pointer-events: none;
  image-rendering: pixelated; background-repeat: no-repeat;
  transform: translate(-50%, -50%) scaleX(var(--flip, 1)) scale(var(--s, 1));
}
.scene .vfx-miss {
  position: absolute; pointer-events: none; z-index: 380;
  transform: translate(-50%, -50%);
  font: 11px var(--pix); color: #e8e4dc; text-shadow: 1px 1px 0 #000;
  animation: vfx-miss .9s ease-out forwards;
}
@keyframes vfx-miss {
  0%   { opacity: 0; margin-top: 0; }
  15%  { opacity: 1; }
  100% { opacity: 0; margin-top: -14px; }
}

/* บรรทัดสกิลในการ์ดชาวบ้าน (27 ก.ย.) */
.skill-line { margin: 3px 0; font-size: 11px; color: var(--gold); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.skill-line.muted { color: var(--muted); }
.skill-line .muted { font-size: 10px; }

/* ท่าตายของมอน เล่นครั้งเดียวแล้วค้างเฟรมสุดท้าย · อยู่ท้ายไฟล์ให้ชนะกฎแสงของมอนพิเศษ */
.monster.death i, .monster.special.death i { animation: monster-death .6s steps(3) forwards; }

/* รองเท้ากับความเร็วเดิน (27 ก.ย.) */
.pace { color: var(--green); }
.pace.slow { color: var(--bad); }
.pace-line { font-size: 11px; }

/* ปุ่มขายถึงทอง สีเตือนให้รู้ว่าแรง (27 ก.ย.) */
.job.warn-btn { color: var(--gold); border-color: var(--gold); }

/* หัวหมวดรายชื่อชาวบ้าน (27 ก.ย.) */
.vgroup-head {
  margin: 8px 2px 3px; padding-bottom: 2px; font-size: 11px; letter-spacing: .5px;
  color: var(--gold); border-bottom: 1px solid var(--line);
}
.vgroup-head:first-child { margin-top: 0; }

/* กรอบ Drops (27 ก.ย.) */
.pill.trail { color: var(--gold); border-color: var(--gold); }
.pill.home  { color: var(--green); border-color: var(--green); }
.found-at { font-size: 10px; margin-top: 1px; }

/* ร้าน = บ้านในฉาก (27 ก.ย.) ภาพบ้านทับตำแหน่งเดิมพอดี ชี้แล้วเรืองแสงทองรอบรูปบ้าน แบบพ่อค้าตลาดมืด */
.store-home { position: absolute; cursor: pointer; }
.scene .store-home img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.store-home:hover img { filter: drop-shadow(0 0 1px rgba(255,236,170,1)) drop-shadow(0 0 3px rgba(224,178,76,.95)); }
.trip-time { font-size: 11px; margin: 1px 0 2px; }


/* =====================================================================
   ระบบสู้ใหม่ (28 ก.ย.): ช่องเลือดทีม · ค่าบนการ์ด · เอฟเฟคประจำตัวมอน
   ===================================================================== */

/* ช่องเลือดทีม ใต้ฉาก เหนือ Drops แถวละ 2 คน · เขียว >50% เหลือง 25–50% แดง <25% ล้ม = เทา */
.hp-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  margin: 9px 0 2px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(8, 12, 20, .45);
}
.hp-cell .hp-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 11px; }
.hp-name { display: flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; white-space: nowrap; }
.hp-name .ico { width: 13px; height: 13px; flex: none; }
.hp-num { color: #7fd07f; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hp-bar { height: 5px; margin-top: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.hp-bar i { display: block; height: 100%; width: 100%; background: #6cc36c; transition: width .25s linear; }
.hp-cell.mid .hp-num { color: #e0c050; }
.hp-cell.mid .hp-bar i { background: #e0c050; }
.hp-cell.low .hp-num { color: #e5604c; }
.hp-cell.low .hp-bar i { background: #e5604c; }
.hp-cell.down { opacity: .5; }
.hp-cell.down .hp-num, .hp-cell.down .hp-name { color: var(--muted); }
.hp-cell.down .ico { filter: grayscale(1); }

/* HP บนการ์ดชาวบ้าน แทนแถบ stamina */
.hpnum { font-size: 11px; color: #7fd07f; line-height: 1.3; }
.hpnum.mid { color: #e0c050; }
.hpnum.low { color: #e5604c; }

/* ค่าที่ใช้สู้จริง (รวมของ) ตอนกางการ์ด */
.cstats { display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 4px 0 7px; font-size: 11px; }
.cstats .cs em { font-style: normal; color: var(--muted); margin-right: 4px; }
.item-stats .spc { color: var(--ice); }

.pill.boss-foe { color: var(--gold); border-color: var(--gold); }
.scene .vfx-miss.crit { color: var(--gold); font-size: 12px; }
.scene .vfx-miss.skill { color: #a6e4ff; font-size: 12px; }

/* ---------- เอฟเฟคประจำตัวมอน (ทำด้วยโค้ด ไม่เจนภาพ) ---------- */
.monster .mfx { position: absolute; pointer-events: none; left: 50%; }
.monster .mfx.back { z-index: -1; }
.monster.down .mfx { opacity: 0; transition: opacity .6s; }

/* ควันดำเป็นเปลว: ตัวหลงถิ่นทุกแมพ + Mirage Wraith (ชั้นหลังเข้ม ชั้นหน้าจาง) */
.monster .mfx.smoke {
  bottom: -6%; width: 135%; height: 175%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 42% 18% at 50% 90%, rgba(6, 5, 10, .9), transparent 72%),
    radial-gradient(ellipse 30% 30% at 44% 62%, rgba(6, 5, 10, .75), transparent 70%),
    radial-gradient(ellipse 22% 28% at 58% 42%, rgba(6, 5, 10, .65), transparent 70%),
    radial-gradient(ellipse 14% 22% at 47% 22%, rgba(6, 5, 10, .55), transparent 70%),
    radial-gradient(ellipse 8% 16% at 54% 6%, rgba(6, 5, 10, .45), transparent 70%);
  filter: blur(2.5px);
  animation: smoke-rise 1.3s ease-in-out infinite alternate;
}
.monster .mfx.front.smoke { opacity: .35; animation-delay: -.65s; height: 120%; }
.monster.stray .mfx.smoke { width: 180%; height: 235%; }
.monster.stray .mfx.front.smoke { height: 160%; }
@keyframes smoke-rise {
  0%   { transform: translateX(-50%) scale(1, .94); }
  50%  { transform: translateX(-52%) scale(1.04, 1.02); }
  100% { transform: translateX(-48%) scale(1.07, 1.1) translateY(-3%); }
}

/* บอส: ออร่าเรืองเป็นจังหวะ + หมอกลอยจากพื้น · หนาว = ฟ้าน้ำแข็ง · ทะเลทราย = ส้มทราย */
.monster.fx-boss-ice i  { animation: sprite-frames .8s steps(4) infinite, boss-glow-ice 1.8s ease-in-out infinite; }
.monster.fx-boss-sand i { animation: sprite-frames .8s steps(4) infinite, boss-glow-sand 1.8s ease-in-out infinite; }
.monster.death.fx-boss-ice i, .monster.death.fx-boss-sand i { animation: monster-death .6s steps(3) forwards; }
@keyframes boss-glow-ice {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(130, 210, 255, .85)) drop-shadow(0 0 6px rgba(60, 170, 255, .55)); }
  50%      { filter: drop-shadow(0 0 2px rgba(160, 225, 255, .95)) drop-shadow(0 0 9px rgba(60, 170, 255, .75)); }
}
@keyframes boss-glow-sand {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 190, 110, .85)) drop-shadow(0 0 6px rgba(255, 130, 30, .55)); }
  50%      { filter: drop-shadow(0 0 2px rgba(255, 210, 140, .95)) drop-shadow(0 0 9px rgba(255, 130, 30, .75)); }
}
/* แสงจางด้านหลังตัวบอส (เบาลงตามที่จ๊อบขอ ให้ใกล้ภาพร่าง) */
.monster.fx-boss-ice::before, .monster.fx-boss-sand::before {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 140%; height: 110%; z-index: -2;
  transform: translateX(-50%); pointer-events: none; border-radius: 50%;
  animation: boss-halo 1.8s ease-in-out infinite;
}
.monster.fx-boss-ice::before  { background: radial-gradient(ellipse at 50% 60%, rgba(90, 190, 255, .28), transparent 65%); }
.monster.fx-boss-sand::before { background: radial-gradient(ellipse at 50% 60%, rgba(255, 150, 50, .28), transparent 65%); }
.monster.death.fx-boss-ice::before, .monster.death.fx-boss-sand::before { display: none; }
@keyframes boss-halo {
  0%, 100% { opacity: .55; transform: translateX(-50%) scale(.96); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.04); }
}
/* หมอก/ฝุ่นหนาที่เท้าบอส ชั้นหลังสูงถึงราวเอว ชั้นหน้าคลุมโคน (ตามภาพร่างที่จ๊อบชอบ) */
.monster .mfx.boss-ice, .monster .mfx.boss-sand {
  bottom: -14%; width: 220%; height: 80%;
  transform: translateX(-50%);
  filter: blur(3px);
  animation: boss-mist 3s ease-in-out infinite alternate;
}
.monster .mfx.front.boss-ice, .monster .mfx.front.boss-sand {
  bottom: -16%; width: 170%; height: 38%; opacity: .85; animation-delay: -1.5s;
}
.monster .mfx.boss-ice {
  background:
    radial-gradient(ellipse 30% 40% at 20% 76%, rgba(66, 92, 132, .95), transparent 72%),
    radial-gradient(ellipse 34% 44% at 42% 68%, rgba(76, 104, 145, .95), transparent 72%),
    radial-gradient(ellipse 34% 42% at 62% 72%, rgba(70, 98, 138, .95), transparent 72%),
    radial-gradient(ellipse 30% 40% at 82% 76%, rgba(64, 90, 130, .95), transparent 72%),
    radial-gradient(ellipse 24% 34% at 32% 40%, rgba(95, 128, 168, .8), transparent 72%),
    radial-gradient(ellipse 24% 34% at 68% 38%, rgba(95, 128, 168, .8), transparent 72%);
}
.monster .mfx.front.boss-ice {
  background:
    radial-gradient(ellipse 32% 55% at 25% 58%, rgba(128, 160, 196, .95), transparent 72%),
    radial-gradient(ellipse 36% 60% at 55% 52%, rgba(140, 172, 206, .95), transparent 72%),
    radial-gradient(ellipse 30% 55% at 80% 60%, rgba(124, 156, 192, .95), transparent 72%);
}
.monster .mfx.boss-sand {
  background:
    radial-gradient(ellipse 22% 30% at 18% 78%, rgba(105, 62, 28, .95), transparent 70%),
    radial-gradient(ellipse 26% 34% at 40% 70%, rgba(125, 78, 38, .95), transparent 70%),
    radial-gradient(ellipse 26% 32% at 62% 74%, rgba(115, 70, 32, .95), transparent 70%),
    radial-gradient(ellipse 22% 30% at 84% 78%, rgba(100, 60, 26, .95), transparent 70%),
    radial-gradient(ellipse 18% 26% at 30% 42%, rgba(140, 92, 48, .7), transparent 70%),
    radial-gradient(ellipse 18% 26% at 70% 40%, rgba(140, 92, 48, .7), transparent 70%);
}
.monster .mfx.front.boss-sand {
  background:
    radial-gradient(ellipse 26% 45% at 25% 60%, rgba(170, 118, 64, .9), transparent 70%),
    radial-gradient(ellipse 30% 50% at 55% 55%, rgba(185, 130, 72, .9), transparent 70%),
    radial-gradient(ellipse 24% 45% at 80% 62%, rgba(165, 112, 60, .9), transparent 70%);
}
@keyframes boss-mist {
  0%   { transform: translateX(-53%) scale(1, 1); }
  100% { transform: translateX(-47%) scale(1.06, 1.18) translateY(-6%); }
}
@media (prefers-reduced-motion: reduce) {
  .monster .mfx, .monster.fx-boss-ice i, .monster.fx-boss-sand i { animation: none; }
}

/* ---------- ลดตัวหนังสือ (28 ก.ย. จ๊อบ) ---------- */
.site-title .pill.full { color: var(--gold); border-color: var(--gold); }
.upgrade .up-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.upgrade .up-line .cost { margin: 0; }
.villager .gear button.slot { cursor: pointer; font: inherit; position: relative; }
.villager .gear .slot.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.gear .slot { position: relative; }
/* ช่องของเซ็ต Deepwarden (30 ก.ย. จ๊อบ): กรอบหายใจ + แสงเฉียงผ่านทุก 5 วิ แบบกรอบชื่อคนตั้งต้น (.actor.starter .tag) · แดง/ทอง */
.slot.set-red { animation: set-glow-red 1.6s ease-in-out infinite; }
.slot.set-gold { animation: set-glow-gold 1.6s ease-in-out infinite; }
.slot.set-red::after, .slot.set-gold::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 0%, transparent 42%, var(--sweep) 50%, transparent 58%, transparent 100%);
  background-size: 300% 100%; animation: starter-sweep 5s ease-in-out infinite;
}
.slot.set-red::after { --sweep: rgba(255,120,100,.7); }
.slot.set-gold::after { --sweep: rgba(255,226,140,.75); }
@keyframes set-glow-red { 0%, 100% { box-shadow: inset 0 0 0 1px #8a2a24, 0 0 0 rgba(224,69,58,0); border-color: #8a2a24; }
                          50% { box-shadow: inset 0 0 0 1px #ff6a5a, 0 0 5px rgba(255,90,70,.9); border-color: #ff6a5a; } }
@keyframes set-glow-gold { 0%, 100% { box-shadow: inset 0 0 0 1px #8a6a24, 0 0 0 rgba(224,178,76,0); border-color: #8a6a24; }
                           50% { box-shadow: inset 0 0 0 1px #ffd76a, 0 0 5px rgba(255,210,100,.9); border-color: #ffd76a; } }
.gear .slot.set-red .splus, .gear .slot.set-gold .splus { z-index: 1; }
/* กางการ์ดแล้วช่องของเป็นปุ่ม -> โดนกฎ button .ico (เว้นขวา 5 ยกขึ้น 2) ไอคอนเลื่อนจากกลางช่อง (30 ก.ย. จ๊อบเจอ ตั้งแต่รุ่นเก่า) */
.gear .slot .ico { margin: 0; }
.gear .slot .splus {
  position: absolute; right: -3px; bottom: -4px; font: 8px/1 var(--pix, monospace); color: var(--gold);
  text-shadow: 1px 1px 0 #000;
}
.skill-line .sk { border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; font-size: 10px; line-height: 15px; cursor: help; }
.skill-line .sk.on { color: var(--gold); }
.skill-line .sk.on.warn { color: var(--bad); }
.skill-line .sk.off { color: var(--muted); opacity: .6; }
.drop-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 11px; }
.drop-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.drop-line .ico { width: 14px; height: 14px; vertical-align: -3px; margin-right: 3px; }

/* =====================================================================
   กล่องข้อความตอนชี้เมาส์ (28 ก.ย. tooltip.js) จ๊อบเลือกแบบ C กรอบพิกเซลหนา เงาแข็ง
   สีตามโซนจากตัวแปรของ body[data-zone] · ลองแล้วไม่เอา: A เรียบบางมีลูกศร, B แถบหัวเรื่อง+เส้นคั่น
   ===================================================================== */
#tip {
  position: fixed; z-index: 9999; pointer-events: none;
  max-width: 260px; font: 12px/1.45 var(--pix); color: var(--text);
  background: var(--frame-dark); padding: 7px 10px;
  border: 2px solid var(--frame-hi); outline: 2px solid var(--frame-dark);
  box-shadow: inset 0 0 0 2px var(--frame-mid), 5px 5px 0 rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s;
}
#tip.on { opacity: 1; transform: none; }
#tip .tip-h { color: var(--accent); text-shadow: 1px 1px 0 #000; margin-bottom: 3px; }
#tip .tip-b { color: var(--text); }

/* =====================================================================
   การ์ดตัวละคร: ช่องของสวมใส่ใหญ่ขึ้น ย้ายไปฝั่งขวาที่ว่าง (28 ก.ย. จ๊อบเลือกแบบ A: แถวเดียว 7 ช่อง 24px)
   ต้นเหตุจริง: จ๊อบมองเลขตีบวกไม่เห็น (.splus 8px ลอยทับขอบ) · ลองแล้วไม่เอา: B สองแถว 4+3 (การ์ดสูงขึ้น ป้ายเลขชนแถวล่าง)
   จัดด้วย grid ใน .vinfo: ชื่อเต็มแถวบน · ค่าพลัง+HP ซ้าย · ของขวา · หลอด EXP เต็มแถวล่าง
   ใช้ตามความกว้างของการ์ดเอง (container query) ไม่ใช่ความกว้างจอ: จอเล็กการ์ดแคบ 7 ช่องใหญ่ไม่พอ ใช้แบบเดิม
   ===================================================================== */
.card.villager { container-type: inline-size; }
@container (min-width: 480px) {
  .villager .vinfo {
    display: grid; grid-template-columns: 224px 1fr; column-gap: 10px; align-items: center;
    grid-template-areas: "title title" "stat gear" "hp gear" "exp exp";
  }
  /* ให้ทุกการ์ดตรงกันลงมา (จ๊อบ): ฝั่งซ้ายกว้างเท่ากันทุกใบ แถวของจึงเริ่มที่เดียวกัน · ค่า STR/AGI/WIT ช่องละเท่ากัน */
  .villager .statline { gap: 6px; }
  .villager .statline > span:nth-child(-n+3) { min-width: 38px; }
  /* ป้ายเลเวลหน้าชื่อ กว้างเท่ากัน (เลข 1-2 หลัก) ชื่อจึงเริ่มตรงกัน */
  .villager .card-title > .pill.lvl:first-child { min-width: 42px; justify-content: center; box-sizing: border-box; }
  .villager .vinfo > .card-title { grid-area: title; }
  .villager .vinfo > .statline { grid-area: stat; }
  .villager .vinfo > .bars { display: contents; }
  .villager .vinfo .hpnum { grid-area: hp; }
  .villager .vinfo .bar.exp { grid-area: exp; }
  /* 24px (จ๊อบ: 28 ใหญ่ไป ให้มีช่องว่างเหนือ/ใต้ ระหว่างป้ายงานกับหลอด EXP) */
  .villager .vinfo > .gear { grid-area: gear; margin: 3px 0; display: flex; justify-content: space-evenly; }
  .villager .slot { width: 24px; height: 24px; }
  .villager .slot .ico { width: 19px; height: 19px; }
  /* เลขตีบวก: ป้ายพื้นเข้มอยู่ในกรอบช่องเอง ไม่ล้นลงไปทับหลอด EXP (จ๊อบ: รอบแรกป้ายตกไปทับ) */
  .villager .gear .slot .splus {
    font-size: 9px; line-height: 1; right: 0; bottom: 0; padding: 0 1px;
    background: rgba(8, 11, 16, .92); color: var(--gold);
  }
}

/* =====================================================================
   เลขดาเมจ/ฮีลในฉากสู้ (29 ก.ย. จ๊อบ) ui.js spawnNum · ขนาดเท่า miss 11px ขอบดำบาง 1px รอบตัว
   เด้งแล้วโค้งออกซ้าย/ขวา (--dir) เล็กลงเหมือนไกลออกไป ราว 0.9 วิ · miss ยังใช้แบบเดิม (.vfx-miss)
   ===================================================================== */
.scene .dmg-num {
  position: absolute; pointer-events: none; z-index: 385; white-space: nowrap;
  font: 11px var(--pix); color: #eef7fd; font-style: normal;
  text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000,
               1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
  transform: translate(-50%, -50%);
  animation: dmg-arc .9s linear forwards;
}
.scene .dmg-num.crit { color: #ffd45a; }
.scene .dmg-num.hurt { color: #ff6a5a; }
.scene .dmg-num.heal { color: #8dff7a; }
/* คริกับฮีลลอยขึ้นตรงแบบคำว่า miss (29 ก.ย. จ๊อบ) ไม่โค้ง ไม่เล็กลง */
.scene .dmg-num.crit, .scene .dmg-num.heal { animation: vfx-miss .9s ease-out forwards; }
@keyframes dmg-arc {
  0%   { opacity: 0; transform: translate(-50%, -50%) translate(0, 0) scale(1.15); }
  8%   { opacity: 1; }
  25%  { transform: translate(-50%, -50%) translate(calc(var(--dir, 1) * 8.5px), -5.4px) scale(1); }
  50%  { transform: translate(-50%, -50%) translate(calc(var(--dir, 1) * 17px), -6.5px) scale(.85); }
  70%  { opacity: 1; }
  75%  { transform: translate(-50%, -50%) translate(calc(var(--dir, 1) * 25.5px), -4.1px) scale(.7); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(calc(var(--dir, 1) * 34px), 4px) scale(.55); }
}
@media (prefers-reduced-motion: reduce) { .scene .dmg-num { animation-duration: .6s; } }

/* ⚔ ดาเมจรวมรายคนของศึกในแผงเลือด · คนตีมากสุดสีทอง */
.hp-dmg { font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; display: flex; flex-wrap: nowrap; gap: 6px; white-space: nowrap; overflow: hidden; }   /* 3 ยอดเลขยาวสุด (9,999 / 99.9k) กว้างรวม 140 จากช่อง 143 px */
.hp-dmg .hd.top { color: var(--gold, #e0b24c); }
.hp-dmg .hh { color: #7fd07f; }
.hp-dmg .hg { color: #e5796a; display: inline-flex; align-items: center; gap: 3px; }   /* หยดเลือด ดาเมจที่โดนรวม (29 ก.ย.) */
.hp-dmg .hg .ico { width: 11px; height: 11px; image-rendering: auto; }   /* ไฟล์ 24 px ย่อแบบลื่น ไม่ใช่พิกเซลเหลี่ยม */

/* หลอดเลือดมอนใต้เท้า (29 ก.ย. จ๊อบ) ui.js foeBarHtml · จุดยืนมอน = เท้า (monster ใช้ translate -50% -100%) */
.scene .foe-hp {
  position: absolute; pointer-events: none; height: 3px;
  transform: translate(-50%, 3px);
  background: rgba(0, 0, 0, .65); box-shadow: 0 0 0 1px rgba(0, 0, 0, .8);
}
.scene .foe-hp i { display: block; height: 100%; background: #e0493a; transition: width .2s linear; }
.scene .foe-hp.boss { height: 5px; }

/* ไอคอนสกิล (29 ก.ย.) · ตอนออกสกิลลอยขึ้นแบบ miss · แถวสกิลบนการ์ด ยังไม่ปลด = เทา + เลขเลเวล */
.skill-line .sk-ico { position: relative; display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; cursor: help; }
.skill-line .sk-ico img { width: 20px; height: 20px; image-rendering: pixelated; }
.skill-line .sk-ico.off img { filter: grayscale(1) brightness(.55); }
.skill-line .sk-ico.warn img { filter: grayscale(.6); }
.skill-line .sk-ico b { position: absolute; right: -3px; bottom: -3px; font: 9px/1 var(--pix); color: var(--muted); text-shadow: 1px 1px 0 #000; }

/* ---------- 4 คนตั้งต้น (29 ก.ย. จ๊อบ เลือกแบบ A+B) ----------
   ชี้แล้วกรอบชื่อแดง ค่อยๆ สว่าง-หรี่ + แสงเฉียงผ่านหนึ่งครั้งทุก 5 วิ · พูดเป็นกล่องเหนือหัว */
.actor.starter .tag { color: #ffd9d4; border-color: #e0453a;
  background: linear-gradient(115deg, rgba(10,12,18,.9) 0%, rgba(10,12,18,.9) 42%, rgba(255,120,100,.75) 50%, rgba(10,12,18,.9) 58%, rgba(10,12,18,.9) 100%);
  background-size: 300% 100%; animation: starter-sweep 5s ease-in-out infinite, starter-glow 1.6s ease-in-out infinite; }
@keyframes starter-sweep { 0% { background-position: 100% 0; } 16% { background-position: 0% 0; } 100% { background-position: 0% 0; } }
@keyframes starter-glow { 0%, 100% { box-shadow: 0 0 0 rgba(224,69,58,0); border-color: #8a2a24; }
                          50% { box-shadow: 0 0 5px rgba(255,90,70,.9); border-color: #ff6a5a; } }
.actor .say { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 14px; z-index: 5;
  width: max-content; max-width: 120px; white-space: normal; pointer-events: none;
  font: 8px/1.35 var(--pix); color: #1a1e26; background: #f2efe6; border: 1px solid #1a1e26;
  padding: 2px 5px; border-radius: 2px; box-shadow: 1px 1px 0 rgba(0,0,0,.5); animation: starter-say-in .25s ease-out; }
.actor .say::after { content: ''; position: absolute; left: 50%; bottom: -4px; margin-left: -3px;
  border: 3px solid transparent; border-top-color: #1a1e26; border-bottom: 0; }
@keyframes starter-say-in { from { opacity: 0; transform: translateX(-50%) translateY(3px); } to { opacity: 1; transform: translateX(-50%); } }
.log-line.starter { border-left-color: #e0453a; }
.log-line .say-q { color: #ffb4a8; font-style: normal; }
.c-say { margin-top: 8px; color: #ffb4a8; }
.portrait .actor .say { display: none; }

/* ล็อกทีม (29 ก.ย.) */
.keep-row { margin-top: 6px; }
#btn-keepparty.keep-on { border-color: var(--gold, #e0b24c); color: var(--gold, #e0b24c); }
.keep-note { margin-top: 4px; }

/* ทีมหันซ้ายตอนสู้ในฉากที่ตั้งไว้ (FIGHT_SPOTS.flipParty) */
.actor.face-left { transform: translate(-50%, -100%) scaleX(-1); }
.actor.face-left .tag, .actor.face-left .say { transform: translateX(-50%) scaleX(-1); }

/* ค่าพลังส่วนที่ได้จากของ (30 ก.ย.) */
.statline .stat-gear { color: #8fdc6e; margin-left: 2px; font-size: .85em; }

/* =====================================================================
   หอคอย (30 ก.ย. 2026 · หน้าตาที่จ๊อบผ่านในเซิฟทดลอง tools/sandbox/tower_preview.*)
   ===================================================================== */

/* ---- ฉากทั้งสามขนาดเท่ากัน 322 (ภาพ 320 + ขอบ) (จ๊อบ: The Trail กับ Village ไม่เท่ากันมานาน) ---- */
#journey .scene.big, #buildings .village-scene, #tower-scene {
  width: 322px; height: 322px; max-width: none; aspect-ratio: auto; margin-left: auto; margin-right: auto; flex: none;
}
/* จอกว้าง: ฉาก 3 คอลัมน์กว้างเท่ากัน · ขวาสุด การ์ดตัวละครบน ~65% บันทึกล่าง ~35% (จ๊อบ) */
@media (min-width: 1400px) {
  main { grid-template-columns: 352px 352px 352px minmax(300px, 1fr);
         grid-template-rows: minmax(0, 65fr) minmax(0, 35fr);
         grid-template-areas: "trail village tower people" "trail village tower log"; }
  #col-tower { grid-area: tower; }
}
/* จอกลาง: ฉาก 3 คอลัมน์บน การ์ดกับบันทึกลงแถวล่าง เลื่อนทั้งหน้า */
@media (min-width: 1100px) and (max-width: 1399px) {
  html, body { height: auto; overflow: auto; }
  main { grid-template-columns: 352px 352px 352px; grid-template-rows: auto 640px;
         grid-template-areas: "trail village tower" "people people log"; }
  #col-tower { grid-area: tower; }
}
#col-tower h2 img.twi { width: 16px; height: 16px; image-rendering: pixelated; }
#col-people .tabs { gap: 3px; flex-wrap: wrap; }   /* 5 แท็บ (1 ต.ค. เพิ่ม Village Store) ช่องแคบขึ้นสองแถว ไม่ให้แท็บท้ายโดนตัด */
#col-people .tabs .tab { flex: 1 1 auto; justify-content: center; }
#col-people .tabs .tab { padding-left: 6px; padding-right: 6px; white-space: nowrap; gap: 4px; }   /* Tower Shop ห้ามขึ้นสองบรรทัด */
#col-people .tabs .tab img.twi { width: 16px; height: 16px; image-rendering: pixelated; }

/* ---- ฉากหอคอย: ชั้นปกติ deep_shaft · ชั้นบอส miners_shrine ---- */
#tower-scene { position: relative; overflow: hidden; border: 1px solid var(--frame-dark, #080a12);
  background: #0b0e14 url(../assets/scenes_tower/deep_shaft.png) 0 0 / 320px 320px no-repeat; image-rendering: pixelated; }
#tower-scene.boss { background-image: url(../assets/scenes_tower/miners_shrine.png); }
#tw-stage { position: absolute; inset: 0; }

/* ป้าย ENTER TOWER (แบบ B3 จ๊อบผ่าน): คานพาดขอบบน โซ่ 2 เส้นโยกแบบสี่เหลี่ยมด้านขนาน ป้ายตั้งตรงตลอด */
#tower-scene img.tw-beam { position: absolute; left: 0; top: 0; width: 320px; height: 32px; display: block; image-rendering: pixelated; z-index: 3; }   /* .scene img ของเกมยืดรูปเต็มฉาก ต้องชนะ */
.tw-chain { position: absolute; top: 28px; width: 10px; height: 106px; background: url(../assets/tower/chain.png) 0 0 / 10px 106px;
  image-rendering: pixelated; transform-origin: 50% 0; animation: tw-chain 3.2s ease-in-out infinite; z-index: 3; }
.tw-chain.l { left: 91px; } .tw-chain.r { left: 219px; }
button.tw-sign { position: absolute; left: 60px; top: 130px; width: 200px; height: 52px; padding: 0; border: 0; cursor: pointer; z-index: 3;
  background: url(../assets/tower/sign.png) 0 0 / 200px 52px; image-rendering: pixelated; box-shadow: none;
  animation: tw-sign 3.2s ease-in-out infinite; clip-path: none; }
button.tw-sign span { display: block; padding-top: 16px; font: 18px/34px var(--pix, monospace); letter-spacing: 3px; color: #2a1406;
  text-shadow: 1px 1px 0 rgba(214,160,104,.55), -1px -1px 0 rgba(20,8,2,.8); }
#tower-scene:hover .tw-chain, #tower-scene:hover button.tw-sign { animation-duration: 2.2s; }
button.tw-sign:hover { filter: brightness(1.18) drop-shadow(0 0 8px rgba(255,190,90,.55)); background-color: transparent; }
button.tw-sign[data-why] { filter: grayscale(.5) brightness(.85); }
@keyframes tw-chain { 0%, 100% { transform: rotate(4deg); } 50% { transform: rotate(-4deg); } }
@keyframes tw-sign { 0%, 100% { transform: translateX(-7.3px); } 50% { transform: translateX(7.3px); } }
@media (prefers-reduced-motion: reduce) { .tw-chain, button.tw-sign { animation: none; } }

/* ---- มอนในหอคอย: สีตัว + ออร่าตามช่วงชั้น (1–10 ไม่มี · แล้วตามสีเกรดของ) ---- */
#tower-scene .monster.tw-common    { --tw-c: 216,212,200; filter: url(#twf-common) drop-shadow(0 0 2px rgba(var(--tw-c),.9)); }
#tower-scene .monster.tw-fine      { --tw-c: 127,176,105; filter: url(#twf-fine) drop-shadow(0 0 2px rgba(var(--tw-c),.95)); }
#tower-scene .monster.tw-rare      { --tw-c: 111,143,208; filter: url(#twf-rare) drop-shadow(0 0 2px rgba(var(--tw-c),.95)); }
#tower-scene .monster.tw-legendary { --tw-c: 224,178,76;  filter: url(#twf-legendary) drop-shadow(0 0 2px rgba(var(--tw-c),.95)); }
#tower-scene .monster.tw-mystical  { --tw-c: 224,69,58;   filter: url(#twf-mystical) drop-shadow(0 0 2px rgba(var(--tw-c),.95)); }
/* สีตัวใช้ฟิลเตอร์ SVG ที่ tower.js ฝังไว้ (towerTintFilters) */
#tower-scene .monster.tw-band::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: 70%; height: 10px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(ellipse at center, rgba(var(--tw-c),.55), transparent 70%); pointer-events: none; z-index: -1;
  animation: tw-aura 1.8s ease-in-out infinite; }
#tower-scene .monster.down::after { display: none; }
@keyframes tw-aura { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---- ประกาศชั้น: ชั้นปกติขาวไล่เทา · บอสแดง · แวบเดียวแล้วจาง (จ๊อบ) ---- */
.tw-banner { position: absolute; left: 0; right: 0; top: 34%; z-index: 1000;   /* มอนใช้ z ตามความลึก ป้ายต้องอยู่บนสุด */
  text-align: center; pointer-events: none; animation: tw-in 2.6s ease-out forwards; }
.tw-banner span { position: relative; display: inline-block; padding: 4px 14px 5px; font: 26px var(--pix, monospace); letter-spacing: 4px;
  color: transparent; -webkit-background-clip: text; background-clip: text; background-repeat: no-repeat; background-size: 300% 100%, 100% 100%;
  background-image: linear-gradient(110deg, transparent 42%, #ffffff 50%, transparent 58%), linear-gradient(180deg, #ffffff 0%, #d8dce4 45%, #7c828e 55%, #c4c9d2 100%);
  filter: drop-shadow(2px 2px 0 #0a0c10) drop-shadow(0 0 6px rgba(210,225,255,.45)); animation: tw-shine 1.1s .35s ease-in-out 1 both; }
.tw-banner::before { content: ''; position: absolute; left: 10%; right: 10%; top: 50%; height: 34px; margin-top: -17px; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(8,8,10,.72), transparent 72%); }
.tw-banner.boss span { font-size: 22px; background-image: linear-gradient(110deg, transparent 42%, #fff0ea 50%, transparent 58%), linear-gradient(180deg, #ffd0c0 0%, #ff6a4a 45%, #9a1c10 55%, #e0453a 100%);
  filter: drop-shadow(2px 2px 0 #1a0504) drop-shadow(0 0 7px rgba(255,80,60,.6)); }
.tw-spark { position: absolute; width: 3px; height: 3px; background: #fff; box-shadow: 0 0 4px #bcd4ff; z-index: 1001; opacity: 0; pointer-events: none; animation: tw-spark 1.6s ease-out forwards; }
.tw-spark.boss { background: #fff0e0; box-shadow: 0 0 4px #ff8a6a; }
@keyframes tw-in { 0% { opacity: 0; transform: translateY(6px) scale(.96); } 12% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes tw-shine { from { background-position: 100% 0, 0 0; } to { background-position: 0 0, 0 0; } }
@keyframes tw-spark { 0% { opacity: 0; transform: scale(.4); } 20% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(.2) translateY(-8px); } }

/* ---- ใต้ฉาก: แผงเลือดแบบเดิม + ปุ่ม Fall back กลางแถบ ข้อความกลางปุ่ม (ไอคอนไม่นับ) ---- */
#tower-under .hp-panel { margin-top: 6px; }
#tower-under .jobs.fb { display: flex; justify-content: center; margin: 6px 0 0; }
#tower-under .jobs.fb button.fallback { position: relative; width: auto; padding: 0 34px; height: 24px; display: flex; align-items: center; }
#tower-under button.fallback .ico { position: absolute; left: 12px; top: 50%; margin: 0; transform: translateY(-50%); }

/* ---- ทีมหอคอย + Records (ใต้ฉาก) · ร้าน (แท็บ Tower Shop) ---- */
#tab-tower { margin-top: 6px; }
.tw-sec { margin-bottom: 4px; padding: 5px 8px; }
#towershop .tw-sec { margin-bottom: 10px; padding: 8px 10px; }
.tw-h { font: 13px var(--pix, monospace); color: var(--ice); margin-bottom: 4px; }
.tw-h .tw-purse { float: right; color: #d8d2e6; }
.tw-team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tw-m { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 3px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; cursor: pointer; }
.tw-m:hover { border-color: var(--muted); }
.tw-m.empty { justify-content: center; color: var(--muted); border-style: dashed; min-height: 82px; }
.tw-nm { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-sec .jobs { margin-top: 5px; }
.tw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; text-align: center; }
.tw-stats div { background: var(--panel-2); border: 1px solid var(--line); padding: 2px 0; }
.tw-stats b { display: block; font: 13px/1.2 var(--pix, monospace); color: var(--text); }
.tw-stats b.coin { color: #d8d2e6; }
.tw-stats span { font-size: 10px; color: var(--muted); }
img.dcoin { width: 14px; height: 14px; vertical-align: -3px; margin-right: 2px; image-rendering: pixelated; }
.tw-stats img.dcoin { width: 16px; height: 16px; }
.tw-tabs2 { display: flex; gap: 4px; margin-bottom: 6px; }
.tw-tabs2 .job.on { color: var(--text); border-color: var(--gold); }
.tw-tabs2 .job.on.red { border-color: #e0453a; }
#towershop .shop { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
#towershop .shop .it { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 4px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; }
#towershop .shop .it:hover { border-color: var(--muted); }
#towershop .shop .it .nm { font-size: 9px; color: var(--muted); }
#towershop .shop .it .slot { position: relative; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
#towershop .shop .it .slot.set-gold { color: #e0b24c; border-color: #e0b24c; }
#towershop .shop .it .slot.set-red { color: #e0453a; border-color: #e0453a; }
#towershop .shop .it .slot img { width: 30px; height: 30px; margin: 0; image-rendering: pixelated; }
#towershop .shop .it .slot.plain img { width: 24px; height: 24px; }
#towershop .shop .it.poor { opacity: .5; }
#towershop .bonus { margin-top: 7px; font-size: 11px; color: var(--muted); line-height: 1.5; border-top: 1px dashed var(--line); padding-top: 6px; }
#towershop .bonus b { color: var(--text); font-weight: normal; }
#towershop .tw-note { margin-top: 6px; font-size: 10px; }

/* ---- ป้ายบนการ์ด: ม่วงโทน Dark Coin · พื้นม่วง = อยู่ในหอคอย · ขอบม่วง = จัดทีมแล้วอยู่บ้าน ---- */
.flag.job-tag.tower-team { color: #c9a8ff; border-color: #6a4a9a; }
.flag.job-tag.tower-in   { color: #e0ccff; border-color: #9a6ad8; background: rgba(90,50,140,.35); }
.flag.job-tag img.twi, .job img.twi { width: 12px; height: 12px; image-rendering: pixelated; margin-right: 3px; vertical-align: -2px; }
.job.tower.on { border-color: #9a6ad8; }

/* ---- ปุ่มเลือกปลายทาง = กล่องเลขแบบ .node (แถวเส้นทางตอนเดินทาง) ---- */
#journey .sites.nodes { display: flex; flex-wrap: wrap; gap: 4px; }
#journey .node.site-node { width: auto; min-width: 24px; padding: 0 5px; cursor: pointer; }
#journey .node.site-node.claimed { color: var(--gold); border-color: #574b2c; }
#journey .node.site-node:hover { border-color: var(--muted); }

/* ---- โบนัสเซ็ตบนการ์ด: ป้าย ◆ n/6 (พับ) · แถวเดียวต่อเซ็ต เฉพาะที่ได้จริง (กาง) ---- */
.pill.tw-setpill.gold, .pill.tw-setname.gold { color: var(--gold); border-color: #8a6a24; }
.pill.tw-setpill.red, .pill.tw-setname.red { color: #ff7a6a; border-color: #8a2a24; }
.tw-setrows { margin: 5px 0 2px; display: flex; flex-direction: column; gap: 3px; }
.tw-setrow { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.tw-setrow .tw-fx { font-size: 10px; padding: 0 5px; line-height: 16px; color: var(--green); border: 1px solid #3d5a3a; background: rgba(60,90,58,.18); white-space: nowrap; }
.tw-setrow.red .tw-fx { color: #ffb0a0; border-color: #6a2a24; background: rgba(120,30,24,.2); }
.tw-setrow .tw-none { font-size: 10px; color: var(--muted); }
