:root {
  --ink: #5b3b46;
  --ink-soft: #8a6672;
  --card: rgba(255, 252, 248, 0.92);
  --line: rgba(160, 110, 120, 0.22);
  --pink: #ff8fab;
  --pink-d: #f06d93;
  --mint: #8fd8c0;
  --shadow: 0 6px 18px rgba(120, 60, 80, 0.18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #ffe8d6;
  font-family: 'Mali', 'Sarabun', system-ui, sans-serif;
  color: var(--ink);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; }
#game { position: fixed; inset: 0; display: block; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; left: 0; right: 0; top: calc(8px + var(--safe-t));
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0 10px; pointer-events: none; gap: 8px;
}
#hud > * { pointer-events: auto; }
.hud-card {
  background: var(--card); border-radius: 20px; padding: 8px 10px 9px;
  box-shadow: var(--shadow); width: 236px; max-width: 58vw; cursor: pointer;
  border: 2px solid #fff;
}
.cat-head { display: flex; gap: 8px; align-items: center; }
#cat-avatar { width: 46px; height: 46px; border-radius: 50%; background: #fff1e6; flex: none; border: 2px solid #ffd6e0; }
.cat-name { font-weight: 700; font-size: 17px; line-height: 1.1; }
.cat-sub { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bond { font-size: 13px; color: #e7b6c6; letter-spacing: 1px; }
.bond .on { color: #ff6b8b; }
.bond small { margin-left: 4px; color: var(--ink-soft); font-size: 10px; letter-spacing: 0; }
.stats { margin-top: 6px; display: grid; gap: 3px; }
.stat { display: flex; align-items: center; gap: 6px; }
.stat .ico { width: 18px; text-align: center; font-size: 13px; }
.stat .bar { flex: 1; height: 9px; border-radius: 6px; background: #f3e6e9; overflow: hidden; }
.stat .bar i { display: block; height: 100%; border-radius: 6px; transition: width .4s; }
.stat.mid .bar i { filter: saturate(.7); }
.stat.low .bar { animation: lowblink 1s infinite; background: #ffd0d6; }
.stat.low .ico { animation: shake .6s infinite; }
@keyframes lowblink { 50% { box-shadow: 0 0 0 2px #ff6b6b; } }
@keyframes shake { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pill {
  background: var(--card); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 6px; font-size: 15px; border: 2px solid #fff; min-height: 38px;
}
.coin-ico {
  width: 20px; height: 20px; border-radius: 50%; display: inline-block; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff6b0, #ffd23f 45%, #e8a800);
  box-shadow: inset 0 -2px 0 rgba(160,100,0,.35), 0 1px 2px rgba(160,100,0,.3);
}
.coin-ico::after { content: '🐾'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; filter: sepia(1) saturate(3) hue-rotate(-10deg) brightness(.75); }
.pill.coin b { color: #d48a00; min-width: 28px; text-align: right; }
.pill.time.preview { background: #efe6ff; }
.round {
  width: 48px; height: 48px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  font-size: 22px; border: 2px solid #fff; display: grid; place-items: center;
}
.round.small { width: 40px; height: 40px; font-size: 18px; }

/* ---------- ปุ่มลัดด้านล่าง ---------- */
/* ธีมแถบล่าง: กรอบไม้สีน้ำตาลอ่อน + ปุ่มกระดาษครีมแบบเฟอร์นิเจอร์ในเกม (เข้ากับห้อง/ร้านไม้) */
#actions {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + var(--safe-b));
  display: flex; gap: 7px; padding: 9px 11px 11px; border-radius: 24px;
  background:
    repeating-linear-gradient(90deg, rgba(120,70,40,.06) 0 2px, transparent 2px 22px),
    linear-gradient(#e9b98a, #d79c6c);
  border: 3px solid #8a5a3c;
  box-shadow: inset 0 2px 0 rgba(255,236,210,.7), inset 0 -3px 0 rgba(110,60,30,.25), 0 6px 0 #6e4329, 0 10px 22px rgba(90,45,30,.28);
  max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none;
}
#actions::-webkit-scrollbar { display: none; }
.act {
  flex: none; width: 64px; height: 66px; border-radius: 18px;
  background: linear-gradient(#fffaf1, #fdeedb 70%, #f6dcc0);
  border: 2px solid #b27e57;
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 #9a6644, 0 5px 8px rgba(90,45,30,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #6b3f26; transition: transform .08s, box-shadow .08s;
}
.act:hover { background: linear-gradient(#fffdf8, #fff3e3 70%, #fbe5cc); }
.act:active { transform: translateY(4px); box-shadow: inset 0 2px 0 #fff, 0 0 0 #9a6644, 0 1px 3px rgba(90,45,30,.25); }
.act .ico { font-size: 26px; line-height: 1; height: 32px; display: grid; place-items: center; }
.act .ico img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 1px 0 rgba(110,60,30,.25)); }
.act .lbl { font-size: 11px; font-weight: 700; letter-spacing: .1px; }
.act.on { background: linear-gradient(#fff8d6, #ffe7a3); border-color: #c99436; box-shadow: inset 0 2px 0 #fff, 0 4px 0 #b9852e, 0 5px 8px rgba(120,80,20,.25); }
.act.off { opacity: .55; }

/* ---------- Toast ---------- */
#toasts {
  position: fixed; left: 50%; top: calc(150px + var(--safe-t)); transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; z-index: 20;
  width: min(92vw, 420px);
}
.toast {
  background: rgba(255, 255, 255, .96); padding: 9px 16px; border-radius: 16px; box-shadow: var(--shadow);
  font-size: 14px; text-align: center; opacity: 0; transform: translateY(-8px) scale(.96); transition: all .3s;
  border: 2px solid #ffd6e0;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- Sheet ---------- */
#sheet {
  position: fixed; inset: 0; background: rgba(90, 50, 70, .25); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30;
}
#sheet.open { opacity: 1; pointer-events: auto; }
.sheet-box {
  background: #fffaf6; width: min(560px, 100vw); max-height: 78vh; overflow: auto; border-radius: 26px 26px 0 0;
  padding: 14px 16px calc(18px + var(--safe-b)); transform: translateY(30px); transition: transform .25s;
  touch-action: pan-y;
}
#sheet.open .sheet-box { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; margin-bottom: 10px; }
.pose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pose {
  background: #fff; border-radius: 18px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 2px 0 #f0d5dc; font-size: 13px; font-weight: 600; min-height: 104px;
}
.pose canvas { width: 72px; height: 72px; }
.pose.locked { opacity: .5; filter: grayscale(.7); }
.tip { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin: 10px 0 0; }
.info p { line-height: 1.6; margin-top: 0; }
.info-row { display: flex; justify-content: space-between; padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.settings { display: grid; gap: 8px; }
.wide { padding: 14px; border-radius: 16px; background: #fff; box-shadow: 0 2px 0 #f0d5dc; font-size: 15px; text-align: left; }
.wide.on { background: #eafff5; }
.wide.danger { background: #fff0f0; color: #c0485b; }

/* ---------- หน้ารับเลี้ยง ---------- */
#adopt {
  position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #fff3e6, #ffd9e4 60%, #e9dcff); overflow: auto; padding: 16px;
  touch-action: pan-y;
}
#adopt.open { display: flex; }
.adopt-box { width: min(520px, 100%); background: rgba(255,255,255,.85); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); border: 3px solid #fff; margin: auto; }
.adopt-box h1 { margin: 0; text-align: center; font-size: 26px; }
.breed-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.breed { background: #fff; border-radius: 18px; padding: 4px 2px 8px; display: flex; flex-direction: column; align-items: center; font-size: 12.5px; font-weight: 600; border: 3px solid transparent; box-shadow: 0 2px 0 #f0d5dc; }
.breed canvas { width: 72px; height: 72px; }
.breed.sel { border-color: var(--pink); background: #fff3f7; }
.name-row { display: flex; gap: 8px; margin-top: 14px; }
.name-row input { flex: 1; font: inherit; font-size: 18px; padding: 10px 14px; border-radius: 16px; border: 2px solid #ffd6e0; outline: none; color: var(--ink); text-align: center; }
.pers-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.chip { padding: 9px 14px; border-radius: 999px; background: #fff; box-shadow: 0 2px 0 #f0d5dc; font-size: 14px; border: 2px solid transparent; }
.chip.sel { border-color: var(--pink); background: #fff3f7; }
.big-go { display: block; width: 100%; margin-top: 14px; padding: 16px; border-radius: 20px; font-size: 20px; font-weight: 700; color: #fff; background: linear-gradient(#ffa3bd, var(--pink-d)); box-shadow: 0 4px 0 #d0557a; }

#loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 20px; background: #ffe8d6; z-index: 50; }

.act .lbl { white-space: nowrap; }
.act { position: relative; }
.act.alert::after {
  content: '!'; position: absolute; top: -5px; right: -4px; width: 20px; height: 20px; border-radius: 50%;
  background: #ff5a6e; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center;
  border: 2px solid #fff; animation: bounce 1s infinite;
}
@keyframes bounce { 50% { transform: translateY(-3px); } }

/* แถบค่าสถานะเปลี่ยน */
.stat.up .bar { animation: flashUp .7s; }
.stat.down .bar { animation: flashDown .7s; }
@keyframes flashUp { 30% { box-shadow: 0 0 0 3px #8fe3a8; transform: scaleY(1.25); } }
@keyframes flashDown { 30% { box-shadow: 0 0 0 3px #ff8c96; transform: scaleY(1.25); } }

/* สิ่งที่แมวต้องการ */
.needs { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.need { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #f4eef0; white-space: nowrap; }
.need.warn { background: #fff1d6; color: #a86a00; }
.need.bad { background: #ffe0e4; color: #c0485b; animation: lowblink 1.2s infinite; }
.need.ok { background: #e7f8ee; color: #3f8a5c; }

/* แถบโหมดเครื่องมือ */
#tool {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,.96); box-shadow: var(--shadow); border: 2px solid #ffd6e0;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 15; max-width: calc(100vw - 20px);
}
#tool.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#tool .done { padding: 9px 16px; border-radius: 999px; background: linear-gradient(#ffa3bd, var(--pink-d)); color: #fff; font-weight: 700; font-size: 14px; flex: none; }

.pill.time { cursor: pointer; }

/* โหมดแต่งห้อง */
#decor { display: none; }
body.decorating #actions, body.decorating #tool { display: none; }
body.decorating #hud-left { opacity: .45; pointer-events: none; }
body.decorating #decor {
  display: block; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(8px + var(--safe-b));
  width: min(560px, calc(100vw - 16px)); background: rgba(255, 252, 248, .95); border-radius: 24px;
  box-shadow: var(--shadow); border: 2px solid #fff; padding: 10px 10px 8px; z-index: 12;
}
.decor-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.decor-title { display: flex; flex-direction: column; min-width: 0; }
.decor-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decor-title small { font-size: 11px; color: var(--ink-soft); }
.decor-tools { display: flex; gap: 6px; flex: none; }
.dbtn { width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(#fff, #ffeef3); box-shadow: 0 3px 0 #f3c6d3; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dbtn span { font-size: 20px; line-height: 1.1; }
.dbtn small { font-size: 10.5px; font-weight: 600; }
.dbtn.ok { background: linear-gradient(#c9f5da, #8fe3b0); box-shadow: 0 3px 0 #5fbf86; }
.dbtn.ghost { background: #f5f0f2; box-shadow: 0 3px 0 #e2d6db; }
.dbtn:active { transform: translateY(3px); box-shadow: none; }
.inv-title { font-size: 11.5px; color: var(--ink-soft); margin: 8px 2px 4px; }
.inv-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; touch-action: pan-x; scrollbar-width: thin; }
.inv-card { flex: none; width: 84px; background: #fff; border-radius: 16px; padding: 4px 4px 6px; display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 600; box-shadow: 0 2px 0 #f0d5dc; position: relative; }
.inv-card canvas { width: 56px; height: 56px; }
.inv-card span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.inv-card .cnt { position: absolute; top: 3px; right: 6px; font-style: normal; color: var(--pink-d); }
.inv-empty { font-size: 12.5px; color: var(--ink-soft); padding: 14px 6px; }

/* อีโมจิใช้ฟอนต์สีของระบบ (กันฟอนต์ไทยไปแย่งวาดเป็นขาวดำ) */
.pi, .emo, .mi, .npc, .act .ico, .fi, .big, .need, .round { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Mali', sans-serif; }
#town:not([data-view="map"])::before, #town:not([data-view="map"])::after { display: none; }
#town::before {
  content: '☁️        ☀️            ☁️'; position: absolute; top: 46px; left: 0; right: 0; text-align: center; font-size: 34px; opacity: .8; pointer-events: none;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; white-space: pre;
}
#town::after {
  content: '🏠🌳🏡🌲🏘️🌳🏠'; position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 40px; letter-spacing: 6px; opacity: .9; pointer-events: none;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
}
.town-head, .town-body { position: relative; z-index: 1; }
.town-head { margin-top: 0; }

/* ปุ่มไฟ / เหรียญเด้ง / ป้ายความหายาก */
.round.on { background: linear-gradient(#fff6c8, #ffe28a); }
.pill.coin.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.18); } }
.rar { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: #fff; white-space: nowrap; }
.rar.common { background: #9fb1c4; }
.rar.rare { background: #4aa3ff; }
.rar.legend { background: linear-gradient(90deg, #ffb300, #ff7ad1); }

/* ---------- เมือง ---------- */
#town {
  position: fixed; inset: 0; z-index: 25; display: none; flex-direction: column;
  background: linear-gradient(#bfe8ff 0%, #e8f7ff 35%, #c9efb9 36%, #a6dd94 100%); overflow: hidden;
}
#town.open { display: flex; }
.town-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 8px; }
.town-head b { flex: 1; font-size: 19px; }
.town-body { flex: 1; overflow-y: auto; padding: 6px 12px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; align-items: stretch; width: min(560px, 100%); margin: 0 auto; touch-action: pan-y; }
.place { display: grid; grid-template-columns: 70px 1fr; grid-template-rows: auto auto; text-align: left; align-items: center; column-gap: 12px; padding: 16px; border-radius: 24px; color: #4a3040; box-shadow: 0 5px 0 rgba(0,0,0,.08), var(--shadow); border: 3px solid #fff; }
.place .pi { grid-row: span 2; font-size: 48px; text-align: center; }
.place b { font-size: 19px; }
.place small { font-size: 12.5px; opacity: .8; }
.place.dock { background: linear-gradient(135deg, #b9e6ff, #7cc8f2); }
.place.park { background: linear-gradient(135deg, #d7f7c4, #9fdd86); }
.place.dig { background: linear-gradient(135deg, #f6e2c3, #d9b07c); }
.place.market { background: linear-gradient(135deg, #ffe0ea, #ffb3c8); }
.place:active { transform: translateY(3px); }
.dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: #ff5a6e; color: #fff; font-size: 11px; font-weight: 700; }
.tabs { display: flex; gap: 5px; background: rgba(255,255,255,.7); padding: 5px; border-radius: 18px; }
.tab { flex: 1; padding: 10px 4px; border-radius: 14px; background: transparent; font-size: 13.5px; font-weight: 600; }
.tab.on { background: #fff; box-shadow: 0 2px 0 #f0d5dc; }
.panel { background: rgba(255,252,248,.95); border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.shop-card { background: #fff; border-radius: 18px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; box-shadow: 0 2px 0 #f0d5dc; border: 2px solid transparent; font-size: 13px; }
.shop-card.rare { border-color: #bfe0ff; }
.shop-card.legend { border-color: #ffd36e; background: linear-gradient(#fffaf0, #fff); }
.shop-card.on { border-color: var(--pink); background: #fff3f7; }
.sc-ic { height: 70px; display: grid; place-items: center; }
.sc-ic canvas { width: 64px; height: 64px; }
.sc-meta { display: flex; gap: 4px; align-items: center; font-size: 11px; color: var(--ink-soft); flex-wrap: wrap; justify-content: center; }
.emo { font-size: 38px; }
.sell-row { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 6px; background: #fff; border-radius: 16px; padding: 8px 10px; }
.sell-row .emo { font-size: 28px; text-align: center; }
.sell-row .nm { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; gap: 2px; }
.sell-row .nm small { font-weight: 400; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 3px; }
.order { display: grid; grid-template-columns: 50px 1fr; gap: 4px 10px; background: #fff; border-radius: 18px; padding: 10px 12px; align-items: center; }
.order .npc { font-size: 40px; grid-row: span 2; text-align: center; }
.order .ob { display: flex; flex-direction: column; gap: 2px; }
.order .ob small { color: var(--ink-soft); font-size: 12px; }
.order .wants { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.want { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #fff0f0; color: #c0485b; }
.want.ok { background: #e7f8ee; color: #3f8a5c; }
.order .pill-btn { grid-column: 2; justify-self: end; }
.order.done { opacity: .55; }

/* กาชา */
.gacha { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.machine { width: 190px; }
.machine.shake { animation: shake2 .9s; }
@keyframes shake2 { 10%,30%,50%,70%,90% { transform: rotate(-4deg); } 20%,40%,60%,80% { transform: rotate(4deg); } }
.dome { position: relative; height: 150px; border-radius: 95px 95px 20px 20px; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.95), rgba(220,240,255,.6) 60%, rgba(180,215,240,.7)); border: 6px solid #ff8fab; overflow: hidden; }
.dome i { position: absolute; left: var(--x); top: var(--y); width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(var(--c) 50%, #fff 50%); border: 2px solid rgba(0,0,0,.08); }
.machine .base { height: 80px; background: linear-gradient(#ff8fab, #f06d93); border-radius: 0 0 22px 22px; position: relative; }
.machine .slot { position: absolute; left: 20px; top: 26px; width: 50px; height: 36px; background: #5a2a3a; border-radius: 10px; }
.machine .knob { position: absolute; right: 26px; top: 18px; width: 46px; height: 46px; border-radius: 50%; background: #ffd36e; display: grid; place-items: center; font-size: 26px; color: #b07800; font-weight: 700; }
.odds { font-size: 12.5px; text-align: center; line-height: 1.8; }
.gacha-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.gacha-btns .big-go { margin-top: 0; flex: 1; min-width: 160px; font-size: 17px; }
.big-go.ticket { background: linear-gradient(#c9b6ff, #9b7be8); box-shadow: 0 4px 0 #7a5bc8; }
.reveal { position: fixed; inset: 0; z-index: 60; background: rgba(60,30,60,.55); display: grid; place-items: center; overflow: hidden; }
.reveal-card { width: min(320px, 88vw); background: #fffaf6; border-radius: 28px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; animation: popin .45s cubic-bezier(.2,1.6,.4,1); border: 4px solid #fff; }
.reveal-card canvas { width: 120px; height: 120px; }
.reveal-card h2 { margin: 4px 0 0; font-size: 20px; }
.reveal.rare .reveal-card { border-color: #8fc8ff; box-shadow: 0 0 40px #8fc8ff; }
.reveal.legend .reveal-card { border-color: #ffd36e; box-shadow: 0 0 60px #ffd36e; }
@keyframes popin { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }
.conf { position: absolute; top: -20px; left: var(--x); width: 9px; height: 14px; background: var(--c); border-radius: 3px; animation: fall 2.4s var(--d) linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.login-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: 100%; }
.lday { background: #fff; border-radius: 12px; padding: 5px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; border: 2px solid #f3e6e9; }
.lday small { font-size: 9.5px; color: var(--ink-soft); }
.lday .coin-ico { width: 16px; height: 16px; }
.lday .coin-ico::after { font-size: 8px; }
.lday.got { opacity: .45; }
.lday.now { border-color: var(--pink); background: #fff3f7; transform: scale(1.08); }

/* ---------- HUD ขวา: เลเวล / ปุ่ม / เทศกาล ---------- */
.hud-btns { display: grid; grid-template-columns: repeat(3, 40px); gap: 6px; direction: rtl; }
.hud-btns .round.small { position: relative; }
.badge-on::after { content: ''; position: absolute; top: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; background: #ff5a6e; border: 2px solid #fff; }
.pill.lvl { cursor: pointer; flex-direction: column; align-items: stretch; gap: 2px; padding: 5px 12px; min-height: 0; }
.pill.lvl b { font-size: 13px; }
.xpbar { display: block; width: 74px; height: 6px; border-radius: 3px; background: #efe4ea; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #8fd3ff, #b48cff); }
.fest-pill { background: linear-gradient(90deg, #ffe7c2, #ffd1e1); border-radius: 999px; padding: 5px 10px; font-size: 12px; box-shadow: var(--shadow); border: 2px solid #fff; cursor: pointer; white-space: nowrap; font-family: 'Segoe UI Emoji', 'Mali', sans-serif; }

/* เควสต์ / สมุด */
.quests { display: flex; flex-direction: column; gap: 8px; }
.lvl-card, .fest-card { background: linear-gradient(135deg, #eef6ff, #f6eeff); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.fest-card { background: linear-gradient(135deg, #fff1dc, #ffe3ee); }
.lvl-card small, .fest-card small { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.xpline { height: 9px; border-radius: 5px; background: #fff; overflow: hidden; }
.xpline i { display: block; height: 100%; background: linear-gradient(90deg, #8fe3b0, #4cc38a); transition: width .4s; }
.quest { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; }
.quest .qb { display: flex; flex-direction: column; gap: 4px; }
.quest .qb small { color: var(--ink-soft); font-size: 11.5px; display: flex; align-items: center; gap: 3px; }
.quest.done { border: 2px solid #8fe3b0; }
.quest.claimed { opacity: .5; }
.wide:disabled { opacity: .6; }
.chip.glow { box-shadow: 0 0 0 2px #ffd36e, 0 0 12px #ffd36e; }
.book { display: flex; flex-direction: column; gap: 10px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; }
.book-item { background: #fff; border-radius: 16px; padding: 6px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; font-size: 12px; border: 2px solid transparent; min-height: 104px; }
.book-item canvas { width: 60px; height: 60px; object-fit: contain; }
.book-item small { font-size: 10.5px; color: var(--ink-soft); }
.book-item.rare { border-color: #cfe6ff; }
.book-item.legend { border-color: #ffe08a; }
.book-item.no canvas, .book-item.no .emo { filter: brightness(0) opacity(.18); }
.book-item.no b { color: #b9a9b0; }
.album { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.album img { width: 100%; border-radius: 12px; box-shadow: var(--shadow); cursor: pointer; }
.menu-card .swatch { width: 64px; height: 44px; border-radius: 12px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }

/* ---------- โหมดถ่ายรูป ---------- */
body.photo #hud, body.photo #actions, body.photo #tool, body.photo #decor { display: none; }
#photo { display: none; }
#photo.open { display: block; }
.ph-layer { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.ph-stk { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: grab; touch-action: none; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); user-select: none; }
.ph-frame { position: fixed; inset: 0; border: 14px solid rgba(255,250,242,.9); border-bottom-width: 46px; pointer-events: none; z-index: 19; }
.ph-top { position: fixed; top: calc(8px + var(--safe-t)); left: 10px; right: 10px; display: flex; align-items: center; gap: 10px; z-index: 21; }
.ph-tip { background: rgba(255,255,255,.85); padding: 6px 12px; border-radius: 999px; font-size: 12px; }
.ph-bottom { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(54px + var(--safe-b)); width: min(560px, calc(100vw - 16px)); background: rgba(255,252,248,.92); border-radius: 22px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 21; box-shadow: var(--shadow); }
.ph-row { display: flex; gap: 6px; overflow-x: auto; width: 100%; padding-bottom: 2px; touch-action: pan-x; }
.ph-row .chip { flex: none; padding: 7px 12px; font-size: 13px; }
.stk { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #fff; font-size: 24px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; box-shadow: 0 2px 0 #f0d5dc; }
.shutter { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 5px solid #ff8fab; font-size: 26px; box-shadow: var(--shadow); font-family: 'Segoe UI Emoji', sans-serif; }
.shutter:active { transform: scale(.92); }
.flash { position: fixed; inset: 0; background: #fff; z-index: 70; animation: flash .45s forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }
.photo-prev img { width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.photo-prev .reveal-card { width: min(420px, 92vw); }
.photo-prev .mg-btns { flex-wrap: wrap; }

/* ---------- ตัวละครคน / เมือง ---------- */
#fade { position: fixed; inset: 0; background: #fff6fa; opacity: 0; pointer-events: none; transition: opacity .28s; z-index: 80; }
#fade.on { opacity: 1; pointer-events: auto; }
.pill.energy { min-height: 0; padding: 4px 10px; gap: 4px; font-size: 12px; font-family: 'Segoe UI Emoji', 'Mali', sans-serif; }
.xpbar.en { width: 54px; }
.xpbar.en i { background: linear-gradient(90deg, #ffd23f, #ff9f5a); }
#minimap { position: fixed; right: 10px; top: calc(306px + var(--safe-t)); width: 112px; height: 112px; z-index: 6; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(120,60,80,.25)); }
#quest-tracker {
  position: fixed; left: 10px; top: calc(186px + var(--safe-t)); max-width: min(240px, 58vw); z-index: 6;
  background: rgba(255, 250, 235, .94); border-radius: 14px; padding: 7px 10px; box-shadow: var(--shadow); border: 2px solid #ffe08a;
  display: flex; flex-direction: column; gap: 2px; cursor: pointer; font-size: 12px;
}
#quest-tracker:empty { display: none; }
#quest-tracker small { color: var(--ink-soft); font-size: 11px; line-height: 1.35; }
#quest-tracker.done { border-color: #a6e3a1; }
body.decorating #quest-tracker, body.photo #quest-tracker, body.photo #minimap { display: none; }
@media (max-width: 420px) {
  #quest-tracker { top: calc(176px + var(--safe-t)); max-width: 52vw; }
  #minimap { width: 96px; height: 96px; top: calc(318px + var(--safe-t)); }
}

/* หน้าสร้างตัวละคร */
#creator { position: fixed; inset: 0; z-index: 45; display: none; background: radial-gradient(circle at 30% 20%, #fff3e6, #ffd9e4 60%, #e9dcff); overflow: auto; padding: 14px; touch-action: pan-y; }
#creator.open { display: flex; }
.cr-box { width: min(560px, 100%); margin: auto; background: rgba(255,255,255,.88); border-radius: 28px; padding: 16px; border: 3px solid #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.cr-box h1 { margin: 0; text-align: center; font-size: 23px; }
.cr-stage { display: grid; place-items: center; }
.cr-stage canvas { width: 180px; height: 180px; border-radius: 24px; }
.cr-panel { display: flex; flex-direction: column; gap: 8px; }
.cr-row { display: flex; flex-direction: column; gap: 4px; }
.cr-label { font-weight: 700; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.cr-label small { font-weight: 400; color: #b07800; display: inline-flex; align-items: center; gap: 3px; }
.cr-opts { display: flex; flex-wrap: wrap; gap: 5px; }
.cr-opt { padding: 7px 11px; border-radius: 999px; background: #fff; box-shadow: 0 2px 0 #f0d5dc; font-size: 13px; border: 2px solid transparent; }
.cr-opt.sel { border-color: var(--pink); background: #fff3f7; }
.cr-opt.sw { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #e8d6dc; }
.cr-opt.sw.sel { box-shadow: 0 0 0 3px var(--pink); }
.cr-name { font: inherit; font-size: 17px; padding: 10px 14px; border-radius: 16px; border: 2px solid #ffd6e0; outline: none; color: var(--ink); text-align: center; }

/* กล่องบทสนทนา */
#dialog { position: fixed; inset: 0; z-index: 32; display: none; align-items: flex-end; justify-content: center; background: rgba(60,30,50,.12); }
#dialog.open { display: flex; }
.dlg { display: flex; gap: 10px; width: min(600px, calc(100vw - 16px)); margin-bottom: calc(10px + var(--safe-b)); background: #fffaf6; border-radius: 24px; padding: 12px; border: 3px solid #fff; box-shadow: var(--shadow); animation: popin .3s; }
.dlg-pic { width: 72px; height: 72px; border-radius: 18px; background: linear-gradient(#ffe3ee, #e9dcff); flex: none; }
.dlg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dlg-name { font-size: 15px; }
.dlg-name small { color: var(--ink-soft); font-size: 11.5px; }
.dlg-name .hearts { color: #ff6b8b; font-size: 12px; letter-spacing: 1px; }
.dlg-text { margin: 0; min-height: 40px; font-size: 14.5px; line-height: 1.5; }
.dlg-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.dlg-btns .pill-btn { padding: 8px 12px; font-size: 13px; }

/* กระเป๋า / จดหมาย */
.bag-cap { font-size: 13px; margin-bottom: 8px; }
.bag-cap small { color: var(--ink-soft); }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
.bag-slot { aspect-ratio: 1; border-radius: 14px; background: #fff; box-shadow: 0 2px 0 #f0d5dc; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px; }
.bag-slot.empty { background: #f6eef1; box-shadow: none; border: 2px dashed #ead7de; }
.bag-slot .emo { font-size: 26px; }
.bag-slot i { position: absolute; top: 2px; right: 6px; font-style: normal; font-weight: 700; font-size: 12px; color: var(--pink-d); }
.bag-slot small { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bag-slot.rare { border: 2px solid #bfe0ff; }
.bag-slot.legend { border: 2px solid #ffd36e; }
.letter { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; background: #fff; border-radius: 16px; padding: 10px; margin-bottom: 6px; }
.letter p { margin: 2px 0; font-size: 13px; }
.letter small { color: #b07800; }
.letter.new { border: 2px solid #ffb3c6; }

/* ร้าน / ตู้เสื้อผ้าคน */
.shop-head { display: flex; flex-direction: column; margin-bottom: 8px; }
.shop-head small { color: var(--ink-soft); font-size: 12px; }
.sc-btns { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.sc-btns .pill-btn { padding: 7px 10px; font-size: 12.5px; }
.pill-btn s { opacity: .6; font-size: 11px; }
.shop-card.locked { opacity: .6; }
.tag { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.tag.f { background: #ffe3ea; color: #d9466a; }
.tag.m { background: #e3efff; color: #3f6fd9; }
.tag.a { background: #eef7e8; color: #3f8a5c; }
.tag.set { background: #fff3c4; color: #a07a10; }
.tag.cp { background: #ffe8f6; color: #c04090; }
.tag.rare { background: #e3f1ff; color: #2a7ad9; }
.dress-top { display: flex; gap: 10px; align-items: center; }
.dress-pv { width: 110px; height: 110px; border-radius: 20px; background: linear-gradient(#fff3f7, #efe6ff); flex: none; }
.dress-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dress-info small { color: var(--ink-soft); }
.sets { display: flex; flex-wrap: wrap; gap: 4px; }
.setchip { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: #f4eef0; }
.setchip.on { background: #fff3c4; color: #8a6200; font-weight: 700; }
.favs { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0; }
.favs .chip { padding: 6px 10px; font-size: 12px; }
.dress .subtabs { margin-bottom: 8px; }
.dress .subtabs .chip { padding: 6px 10px; font-size: 12.5px; }
.swatches { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.swatches .sw { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #e1d2d8; }
.swatches .sw.sel { box-shadow: 0 0 0 2px var(--pink); }
#tool .done.alt { background: linear-gradient(#c9f5da, #8fe3b0); color: #22603b; }
.menu-card:disabled { opacity: .55; }
body[data-scene="town"] #hud-left, body[data-scene="shop"] #hud-left { transform: scale(.92); transform-origin: top left; }

/* ---------- ออนไลน์ / บัญชี ---------- */
.pill.net { min-height: 0; padding: 4px 10px; gap: 5px; font-size: 13px; cursor: pointer; font-family: 'Segoe UI Emoji', 'Mali', sans-serif; }
.pill.net small { font-size: 10.5px; color: var(--ink-soft); font-family: 'Mali', sans-serif; white-space: nowrap; }
.pill.net.online { background: #eafff2; }
.pill.net.offline, .pill.net.error { background: #fff1e0; }
.pill.net.syncing span, .pill.net.connecting span { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.consent .reveal-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.consent-login { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e3d4ea; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.consent-login .tip { margin: 0; }
.consent-login .acct-form { width: 100%; }
.consent .privacy { font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); text-align: left; background: #f7f2ff; border-radius: 14px; padding: 10px 12px; margin: 4px 0; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 13px; text-align: left; margin: 6px 0; }
.acct { background: #f2fbff; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.acct > small { color: var(--ink-soft); }
.acct-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.acct-row span { color: var(--ink-soft); }
.acct-row .code { font-family: monospace; font-size: 16px; letter-spacing: 2px; color: #3f6fd9; }
.acct-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acct-form input { flex: 1 1 140px; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 12px; border: 2px solid #d9ecf5; outline: none; min-width: 0; }
.acct-form small { width: 100%; color: var(--ink-soft); }
.acct-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.gbtn { min-height: 44px; }

/* ---------- มินิเกม ---------- */
#mg { position: fixed; inset: 0; z-index: 50; display: none; background: #000; }
#mg.open { display: block; }
#mg canvas { position: absolute; inset: 0; touch-action: none; }
.mg-top { position: absolute; left: 0; right: 0; top: calc(8px + var(--safe-t)); display: flex; align-items: center; gap: 10px; padding: 0 12px; pointer-events: none; }
.mg-top > * { pointer-events: auto; }
.mg-title { flex: 1; font-size: 16px; text-shadow: 0 1px 0 #fff; }
.mg-hud { background: rgba(255,255,255,.92); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 15px; box-shadow: var(--shadow); }
.mg-intro, .mg-result { position: absolute; inset: 0; display: none; place-items: center; background: rgba(60,30,60,.35); padding: 16px; }
.mg-intro.open, .mg-result.open { display: grid; }
.mg-card { width: min(360px, 92vw); background: #fffaf6; border-radius: 28px; padding: 20px; text-align: center; border: 4px solid #fff; box-shadow: var(--shadow); animation: popin .4s cubic-bezier(.2,1.5,.4,1); }
.mg-card .big { font-size: 56px; }
.mg-card h2 { margin: 4px 0 8px; }
.mg-card p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.mg-coins { font-size: 30px; font-weight: 700; color: #d48a00; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0; }
.mg-coins .coin-ico { width: 30px; height: 30px; }
.mg-list { display: flex; flex-direction: column; gap: 5px; max-height: 40vh; overflow-y: auto; }
.mg-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 6px 10px; text-align: left; font-size: 14px; }
.mg-row i { font-style: normal; font-size: 11px; color: var(--ink-soft); }
.mg-row.rare { border: 2px solid #bfe0ff; }
.mg-row.legend { border: 2px solid #ffd36e; }
.mg-btns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.mg-btns .pill-btn { padding: 12px 20px; font-size: 15px; }

/* เมนูอาหาร */
.food { display: grid; gap: 8px; }
.food-card { display: grid; grid-template-columns: 44px 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; background: #fff; border-radius: 18px; padding: 10px 12px; box-shadow: 0 2px 0 #f0d5dc; }
.food-card .fi { font-size: 32px; grid-row: span 2; text-align: center; }
.food-card .fb { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.food-card .fb small { color: var(--ink-soft); font-size: 11.5px; }
.food-card .fb .badge { align-self: flex-start; margin-left: 0; }
.food-card .fb .eff { color: #7a5aa0; }
.food-card .fn { font-weight: 700; color: var(--ink-soft); align-self: start; }
.food-card .fbtn { grid-column: 2 / 4; display: flex; gap: 6px; justify-content: flex-end; }
.badge { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: #f0f0f0; margin-left: 4px; white-space: nowrap; font-weight: 600; }
.badge.like { background: #ffe3ea; color: #d9466a; }
.badge.dislike { background: #e9e9f2; color: #6a6a8a; }
.badge.unk { background: #fff6d8; color: #a07a10; }
.pill-btn { padding: 8px 14px; border-radius: 999px; background: #f6eef1; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.pill-btn.main { background: linear-gradient(#ffb4c8, #ff8fab); color: #fff; }
.pill-btn.locked { background: #f3ece6; color: #a08a7a; box-shadow: none; }
.food .food-nobowl { text-align: left; }
.pill-btn:disabled { opacity: .4; }
.coin-ico.sm { width: 14px; height: 14px; }
.coin-ico.sm::after { font-size: 7px; }
.coin-pill { font-size: 13px; background: #fff6d6; color: #b07800; padding: 3px 9px; border-radius: 999px; margin-left: 6px; display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.bowl-status { background: #f7f2ff; border-radius: 16px; padding: 10px 12px; font-size: 13px; line-height: 1.7; }

/* เมนูดูแล/เล่น */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.menu-card { background: #fff; border-radius: 20px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 3px 0 #f0d5dc; text-align: center; border: 2px solid transparent; }
.menu-card .mi { font-size: 34px; line-height: 1; }
.menu-card .mi img { width: 52px; height: 52px; object-fit: contain; display: block; }
.menu-card b { font-size: 15px; }
.menu-card small { font-size: 11.5px; color: var(--ink-soft); }
.menu-card.warn { border-color: #ff9aa8; background: #fff5f6; }
.menu-card:active { transform: translateY(2px); }
@media (max-width: 420px) {
  .breed-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .breed canvas { width: 60px; height: 60px; }
  #actions { gap: 5px; padding: 7px 7px 9px; }
  .act { width: 53px; height: 60px; border-radius: 15px; }
  .act .ico { font-size: 23px; height: 28px; }
  .act .ico img { width: 29px; height: 29px; }
  .act .lbl { font-size: 10px; }
  .hud-card { width: 190px; padding: 6px 8px 7px; }
  .stats { gap: 2px; }
  .cat-name { font-size: 15px; }
  #toasts { top: calc(140px + var(--safe-t)); }
}

/* ================= สังคม: เพื่อน / แชท / พลาซ่า (เฟส 3) ================= */
#btn-social { position: relative; }
#btn-social[data-n]:not([data-n=""])::after { content: attr(data-n); width: auto; height: auto; min-width: 16px; padding: 0 3px; font-size: 10px; line-height: 14px; color: #fff; text-align: center; }
.social { display: flex; flex-direction: column; gap: 10px; }
.my-code { background: #fff8e6; border-radius: 14px; padding: 8px 12px; font-size: 13px; }
.my-code b { letter-spacing: 2px; font-size: 15px; color: #b5651d; user-select: all; }
.social .tabs { flex-wrap: wrap; }
.social .tab { font-size: 12.5px; min-width: 70px; }
.social-body { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.friend-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 6px 10px; box-shadow: 0 2px 0 #f0d5dc; }
.sc-ava { width: 44px; height: 44px; border-radius: 50%; background: #ffeef3; display: grid; place-items: center; overflow: hidden; flex: none; font-size: 22px; }
.sc-ava canvas { width: 100%; height: 100%; }
.pf-top .sc-ava { width: 72px; height: 72px; }
.fr-info { flex: 1; min-width: 0; cursor: pointer; }
.fr-info b { font-size: 14px; }
.fr-st { font-size: 11.5px; color: var(--ink-soft); }
.fr-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.fr-btns .round.small { width: 36px; height: 36px; font-size: 16px; position: relative; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9b8bf; margin-right: 4px; vertical-align: middle; }
.dot.on { background: #3ccf7a; box-shadow: 0 0 0 2px #d6f7e3; }
.nb { position: absolute; top: -4px; right: -4px; background: #ff5a6e; color: #fff; font-style: normal; font-size: 10px; border-radius: 999px; padding: 0 4px; line-height: 15px; }
.search-row { display: flex; gap: 6px; }
.search-row input, .cp-row input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 999px; border: 2px solid #f0d5dc; font: inherit; font-size: 14px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #fff; border-radius: 12px; }
.rank-row.me { background: #fff3f7; }
.rank-row .rk { width: 26px; text-align: center; }
.rank-row b { flex: 1; font-size: 13.5px; }
.rank-row .rv { font-size: 12px; color: var(--ink-soft); }
.choose { display: flex; flex-direction: column; gap: 8px; }
.wide.alt { background: #f6eef1; text-align: center; }
.pf-top { display: flex; gap: 12px; align-items: center; }
.pf-name { font-size: 17px; }
.pf-btns, .pf-safety { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-safety { border-top: 1px dashed #f0d5dc; padding-top: 8px; }
.pill-btn.warn { background: #fff0f0; color: #c0485b; }
.chat .chat-list { display: flex; flex-direction: column; gap: 6px; max-height: 44vh; min-height: 140px; overflow-y: auto; padding: 4px; }
.msg { display: flex; align-items: flex-end; gap: 4px; max-width: 85%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .mb { background: #fff; border-radius: 16px 16px 16px 4px; padding: 7px 11px; font-size: 14px; box-shadow: 0 1px 0 #f0d5dc; word-break: break-word; white-space: pre-wrap; }
.msg.mine .mb { background: #ffe1ea; border-radius: 16px 16px 4px 16px; }
.msg.sticker .mb { background: none; box-shadow: none; font-size: 34px; padding: 0; }
.msg .mb img { max-width: 200px; border-radius: 10px; display: block; cursor: zoom-in; }
.msg small { font-size: 10px; color: var(--ink-soft); }
.msg-more { background: none; font-size: 14px; color: var(--ink-soft); padding: 0 4px; }
.composer { display: flex; flex-direction: column; gap: 6px; }
.cp-row { display: flex; gap: 6px; align-items: center; }
.cp-extra { display: flex; flex-direction: column; gap: 6px; max-height: 24vh; overflow-y: auto; }
.cp-presets, .cp-stickers, .cb-emotes { display: flex; flex-wrap: wrap; gap: 4px; }
.cp-presets .chip { padding: 6px 10px; font-size: 12.5px; }
.chip.big { padding: 4px 8px; font-size: 20px; }
.safe-note { flex: 1; font-size: 11.5px; color: #3b7a57; }
.plaza-pill { position: fixed; top: calc(env(safe-area-inset-top) + 64px); left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.9); border-radius: 999px; padding: 4px 12px; font-size: 12px; box-shadow: 0 2px 0 #f0d5dc; z-index: 6; pointer-events: auto; cursor: pointer; white-space: nowrap; }
.plaza-pill.down { background: #fff1e0; }
.plaza-pill .spin { display: inline-block; animation: spin 1s linear infinite; }
.chatbar { position: fixed; left: 8px; bottom: calc(env(safe-area-inset-bottom) + 84px); width: min(360px, calc(100vw - 16px)); background: rgba(255,253,248,.97); border-radius: 18px; padding: 8px; box-shadow: 0 6px 24px rgba(90,50,60,.18); z-index: 20; display: flex; flex-direction: column; gap: 6px; }
.cb-head { display: flex; align-items: center; gap: 6px; }
.cb-head b { font-size: 13.5px; }
.cb-head small { flex: 1; font-size: 11px; color: var(--ink-soft); }
.cb-head .round.small { width: 30px; height: 30px; font-size: 13px; }
.cb-log { max-height: 120px; overflow-y: auto; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.cb-line { cursor: pointer; word-break: break-word; }
.cb-line b { color: #3d6fb5; }
.chatbar .cp-extra { max-height: 18vh; }
.privacy { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border-radius: 12px; padding: 7px 10px; font-size: 13px; }
.pv-row small { color: var(--ink-soft); font-size: 11px; }
.pv-row select { font: inherit; font-size: 13px; border-radius: 10px; border: 2px solid #f0d5dc; padding: 3px 6px; }
.pv-blocked { display: flex; flex-direction: column; gap: 4px; }

/* ---------- ร้านเสริมสวยแมว (salon.js) ---------- */
.salon { display: flex; flex-direction: column; gap: 8px; }
.salon-cv { width: 100%; max-width: 300px; aspect-ratio: 300 / 190; margin: 0 auto; display: block; border-radius: 14px; }
.salon-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; }
.salon-lab { font-size: 12px; color: #8a7470; min-width: 46px; }
.salon .sw { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.salon .sw i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #f0dccb; cursor: pointer; display: block; }
.salon .sw i.on { box-shadow: 0 0 0 2.5px #ff7fa6; }
.salon .sw i.none { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #eee 4px, #eee 8px); }
.salon input[type=color] { width: 32px; height: 26px; padding: 1px; border: 1.5px solid #f0dccb; border-radius: 8px; background: #fff; }
.salon input[type=range] { accent-color: #ff7fa6; width: 150px; }
.salon .big-go:disabled { opacity: .55; }
.breed-grid .breed .rar { font-size: 10px; color: #b07ad8; display: block; }
.breed-grid .breed.rare { box-shadow: inset 0 0 0 2px #c9a7ff; }
.breed-grid .breed.epic { box-shadow: inset 0 0 0 2px #ffc94a; }

/* ============================================================
 * เศรษฐกิจพรีเมียม: เพชร ร้านเพชร โฆษณา กล่องยืนยัน
 * ============================================================ */
.gem-ico {
  width: 18px; height: 18px; display: inline-block; vertical-align: -3px; position: relative;
  background: linear-gradient(160deg, #e9fbff 0%, #8fe3ff 35%, #4fb8f0 60%, #b78cff 100%);
  clip-path: polygon(50% 100%, 0 38%, 22% 6%, 78% 6%, 100% 38%);
  filter: drop-shadow(0 1px 0 rgba(60,90,160,.35));
}
.gem-ico::after { content: ''; position: absolute; left: 24%; top: 14%; width: 26%; height: 18%; background: rgba(255,255,255,.85); border-radius: 50%; transform: rotate(-20deg); }
.gem-ico.sm { width: 13px; height: 13px; vertical-align: -2px; }
.pill.gem { cursor: pointer; font: inherit; color: inherit; }
.pill.gem b { color: #3f86d9; min-width: 22px; text-align: right; }
.pill.gem .plus { font-style: normal; font-weight: 800; color: #fff; background: linear-gradient(#7fd0ff, #4a9eea); border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-size: 13px; line-height: 1; }
.pill.gem.bump { animation: bump .5s; }

.gemshop .gs-bal { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-weight: 700; margin-bottom: 8px; }
.gemshop .gs-bal > span { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: 999px; padding: 3px 10px; box-shadow: 0 2px 0 #f0d5dc; }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gs-card { position: relative; background: #fff; border: 2px solid #f3e6e9; border-radius: 18px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.gs-card .gs-ic { font-size: 34px; min-height: 72px; display: grid; place-items: center; }
.gs-card .gs-ic canvas { width: 72px; height: 72px; }
.gs-card .gs-what { font-size: 12px; color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.gs-card .gs-tag { position: absolute; top: -8px; right: -4px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(#ff8fab, #ff5f8a); border-radius: 999px; padding: 2px 8px; box-shadow: 0 2px 0 #d94a74; }
.gs-card.pack.hot { border-color: #8fd3ff; background: linear-gradient(#f2fbff, #fff); }
.gs-card.wear.legend { border-color: #c9a7ff; background: linear-gradient(#f8f2ff, #fff); }
.gs-card.owned { opacity: .7; }
.pill-btn.gem { background: linear-gradient(#8fd8ff, #4a9eea) !important; color: #fff; box-shadow: 0 3px 0 #2f78c0 !important; }
.tip.test { background: #fff7d6; border-radius: 12px; padding: 6px 10px; }
.tip.warn { background: #ffecec; border-radius: 12px; padding: 6px 10px; }
.tip.small { font-size: 11.5px; opacity: .8; }
.shop-card.gemonly { border-color: #c9a7ff; background: linear-gradient(#f8f2ff, #fff); }
.tag.gem { background: #e9dcff; color: #6a3fc8; }

.ad-list { display: flex; flex-direction: column; gap: 8px; }
.ad-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 8px 10px; border: 2px solid #f3e6e9; }
.ad-row > div { flex: 1; display: flex; flex-direction: column; }
.ad-row small { color: var(--ink-soft); font-size: 11.5px; }
.ad-row .ad-ic { font-size: 26px; width: 34px; text-align: center; }
.ad-row.done { opacity: .55; }

.ad-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(40,25,35,.72); display: grid; place-items: center; animation: fadein .2s; }
.ad-box { position: relative; width: min(340px, 88vw); background: #fffaf6; border-radius: 24px; padding: 22px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border: 4px solid #fff; }
.ad-box .ad-tag { position: absolute; top: 8px; left: 10px; font-size: 11px; font-weight: 700; color: #fff; background: #9a8a92; border-radius: 6px; padding: 1px 6px; }
.ad-box .ad-art { font-size: 54px; }
.ad-box small { color: var(--ink-soft); }
.ad-box .ad-count { font-weight: 700; color: #d9628a; min-height: 20px; }

.reveal.confirm .reveal-card p { margin: 6px 0 10px; line-height: 1.5; }
.confirm-btns { display: flex; gap: 10px; }
.big-go.ad { background: linear-gradient(#8fd8ff, #4a9eea); box-shadow: 0 4px 0 #2f78c0; }
.lday.gem { border-color: #bfe3ff; }
.lday .lgem { font-style: normal; font-size: 10.5px; color: #3f86d9; font-weight: 700; display: inline-flex; align-items: center; gap: 1px; }
.quest.ach { align-items: center; }
.quest .ach-ic { font-size: 26px; width: 34px; text-align: center; }
.quest .qb small + .xpline { margin-top: 2px; }
.tabs .tab.badge-on { position: relative; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.pill-btn.gem .gem-ico, .big-go.ad .gem-ico { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }

/* ============================================================
 * ธีม HUD ซ้าย/ขวา + แผนที่ย่อ — ไม้สีน้ำตาลอ่อน + กระดาษครีม (เข้าชุดกับแถบปุ่มล่าง)
 * ============================================================ */
:root { --wood: #8a5a3c; --wood-m: #b27e57; --wood-l: #d79c6c; --cream: #fffaf1; --cream-d: #fdeedb; --wood-ink: #6b3f26; }
.hud-card {
  background:
    radial-gradient(circle at 12px 12px, rgba(138,90,60,.35) 2.2px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 12px) 12px, rgba(138,90,60,.35) 2.2px, transparent 2.6px),
    linear-gradient(#fffaf1, #fdf0de);
  border: 3px solid var(--wood); border-radius: 20px;
  box-shadow: inset 0 0 0 2px #f6dcc0, inset 0 2px 0 #fff, 0 5px 0 #6e4329, 0 9px 18px rgba(90,45,30,.25);
  color: var(--wood-ink);
}
.hud-card .cat-name { color: var(--wood-ink); }
.hud-card .cat-sub { color: #9a6c52; }
#cat-avatar { border: 3px solid var(--wood-l); background: #fff3e2; box-shadow: 0 2px 0 var(--wood-m); }
.stat .bar { background: #f1dfcb; box-shadow: inset 0 1px 2px rgba(110,60,30,.18); height: 10px; }
.stat .bar i { box-shadow: inset 0 -2px 0 rgba(0,0,0,.08), inset 0 2px 0 rgba(255,255,255,.35); }

#quest-tracker {
  background: linear-gradient(#fffaf1, #fdeedb); border: 3px solid var(--wood); color: var(--wood-ink);
  box-shadow: inset 0 0 0 2px #f6dcc0, 0 4px 0 #6e4329, 0 8px 14px rgba(90,45,30,.22);
}
#quest-tracker small { color: #9a6c52; }
#quest-tracker .qt-when { display: block; margin-top: 3px; padding-top: 3px; border-top: 1px dashed #ecd3b8; }
#quest-tracker .qt-when i { font-style: normal; color: #c0485b; font-weight: 600; }
#quest-tracker .qt-when.on i { color: #3f9a5a; }
#quest-tracker .qt-when .hud-ic { width: 13px; height: 13px; vertical-align: -2px; }
.q-when { display: block; width: 100%; color: #9a6c52; font-size: 11.5px; line-height: 1.45; margin-top: 2px; }
.q-when i { font-style: normal; color: #c0485b; font-weight: 600; }
.q-when.on i { color: #3f9a5a; }
.q-when .hud-ic { width: 13px; height: 13px; vertical-align: -2px; }
#quest-tracker.done { border-color: #5f9a52; }

.hud-right .pill, .hud-right .round, .fest-pill {
  background: linear-gradient(#fffaf1, #fdeedb 70%, #f6dcc0); border: 2px solid var(--wood-m); color: var(--wood-ink);
  box-shadow: inset 0 2px 0 #fff, 0 3px 0 #9a6644, 0 5px 8px rgba(90,45,30,.2);
}
.hud-right .round:active, .hud-right button.pill:active { transform: translateY(3px); box-shadow: inset 0 2px 0 #fff, 0 0 0 #9a6644; }
.hud-right .pill.coin { border-color: #c99436; }
.hud-right .pill.coin b { color: #a8670a; }
.hud-right .pill.gem b { color: #2f6fb8; }
.hud-right .pill.time.preview { background: linear-gradient(#f6efff, #e6dafc); }
.hud-right .pill.net.online { background: linear-gradient(#f2fff4, #dcf5e2); border-color: #6aa86b; }
.hud-right .pill.net small { color: #9a6c52; }
.xpbar { background: #f1dfcb; box-shadow: inset 0 1px 2px rgba(110,60,30,.18); }
.hud-btns { background: linear-gradient(#e9b98a, #d79c6c); border: 2px solid var(--wood); border-radius: 18px; padding: 5px; box-shadow: inset 0 2px 0 rgba(255,236,210,.7), 0 4px 0 #6e4329; }
.fest-pill { border-color: #d0885a; background: linear-gradient(#fff4dc, #ffe2c6); }

/* แผนที่ย่อ: ย้ายไปซ้าย ใต้การ์ดแมว/ภารกิจ (ตำแหน่ง top ตั้งจาก townmap.js ตามความสูงการ์ดจริง) */
#minimap { left: 10px; right: auto; top: calc(250px + var(--safe-t)); width: 104px; height: 104px; filter: drop-shadow(0 4px 0 #6e4329) drop-shadow(0 6px 10px rgba(90,45,30,.25)); }
@media (max-width: 420px) { #minimap { width: 88px; height: 88px; right: auto; } }

/* ไอคอนวาดมือ (G.Icons) แทนอีโมจิ — ขนาดตามตัวอักษรของกล่องที่อยู่ */
img.icon-img { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: middle; display: inline-block; }
.sc-ic .emo img.icon-img { width: 64px; height: 64px; }
.menu-card .mi img.icon-img { width: 52px; height: 52px; }
.mg-row img.icon-img { width: 30px; height: 30px; }
.want img.icon-img { width: 20px; height: 20px; }
.title-ico img.icon-img { width: 30px; height: 30px; vertical-align: -8px; }
img.icon-img.title { width: 28px; height: 28px; vertical-align: -7px; }

/* HUD ขวา: บอร์ดไม้แผ่นเดียว ป้ายครีมกว้างเท่ากัน (เข้าชุดกับการ์ดแมวซ้าย/แถบปุ่มล่าง) */
.hud-right {
  align-items: stretch; width: 132px; padding: 7px 7px 8px; gap: 5px; border-radius: 20px;
  background: linear-gradient(#e9b98a, #d79c6c); border: 3px solid var(--wood);
  box-shadow: inset 0 2px 0 rgba(255,236,210,.75), inset 0 -3px 0 rgba(110,60,30,.18), 0 4px 0 #6e4329, 0 8px 14px rgba(90,45,30,.25);
}
.hud-right > .pill, .hud-right > .fest-pill { width: 100%; justify-content: space-between; border-radius: 12px; box-shadow: inset 0 2px 0 #fff, 0 2px 0 #9a6644; }
.hud-right > .pill.lvl { align-items: stretch; }
.hud-right .hud-btns { background: rgba(110,60,30,.16); border: 0; box-shadow: inset 0 2px 3px rgba(80,40,20,.25); border-radius: 14px; padding: 5px; justify-content: center; }
.hud-right .fest-pill { font-size: 11.5px; padding: 4px 8px; }
.lvl-star { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
@media (max-width: 420px) { .hud-right { width: 112px; padding: 5px; } }
.hud-right .pill.net small, .hud-right .fest-pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .hud-right .pill.net small { font-size: 9.5px; } .hud-right .fest-pill { font-size: 10px; } }
.gs-ic img.icon-img { width: 64px; height: 64px; }
.gs-bal img.icon-img { width: 20px; height: 20px; vertical-align: -5px; }
.gs-what img.icon-img { width: 18px; height: 18px; vertical-align: -4px; }
.gs-furns { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; margin-top: 4px; }
.gs-furns .gs-furn img.icon-img { width: 30px; height: 30px; }
.gs-furns small { width: 100%; font-size: 10.5px; color: var(--ink-soft); }
.ad-ic img.icon-img { width: 36px; height: 36px; }
.mg-card .mg-art img.icon-img { width: 120px; height: 120px; }
img.icon-img.hud-ic { width: 20px; height: 20px; vertical-align: -5px; }

/* กาชา: เวทีไม้ + ตู้วาดมือ + แคปซูลลอย */
.gacha-stage { position: relative; margin: 4px auto 10px; width: min(300px, 86%); aspect-ratio: 1 / 1; border-radius: 26px;
  background: radial-gradient(circle at 50% 40%, #fff6ea 0 45%, #fde6d2 46% 70%, #f6d2b8 71%); border: 4px solid var(--wood);
  box-shadow: inset 0 3px 0 #fff, inset 0 -6px 0 rgba(110,60,30,.12), 0 5px 0 #6e4329, 0 10px 18px rgba(90,45,30,.2); }
.gacha-stage .gacha-art { position: absolute; inset: 8% 10% 4%; display: grid; place-items: center; background: none; border: 0; box-shadow: none; }
.gacha-stage .gacha-art img.icon-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(90,45,30,.25)); }
.gacha-stage .gcap { position: absolute; left: var(--x); top: var(--y); width: 15%; animation: gcap 2.6s ease-in-out infinite; animation-delay: var(--d); }
.gacha-stage .gcap img.icon-img { width: 100%; height: auto; }
@keyframes gcap { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-8px) rotate(8deg); } }
.gacha-stage .machine.shake, .gacha-stage .gacha-art.shake { animation: gshake .18s linear infinite; }
@keyframes gshake { 0% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } 100% { transform: rotate(-3deg); } }
.reveal-card .capsule-art img.icon-img { width: 72px; height: 72px; animation: gcap 1.4s ease-in-out infinite; }
.gacha .gacha-stage .machine.gacha-art { width: auto; height: auto; margin: 0; padding: 0; position: absolute; inset: 8% 12% 5%; }
.gacha .gacha-stage .machine.gacha-art img.icon-img { width: 100%; height: 100%; max-height: 100%; }
.gacha .gacha-stage .machine.gacha-art { display: block; } .gacha .gacha-stage .machine.gacha-art img.icon-img { display: block; object-fit: contain; }

/* แถบขวา: ปุ่มกลมใช้ไอคอนวาดมือ · แถบล่าง: ป้ายชื่อไม่ล้นขอบปุ่ม (ui.js ย่อฟอนต์อัตโนมัติถ้ายังยาว) */
.hud-btns .round img.icon-img.hud-ic { width: 26px; height: 26px; vertical-align: middle; filter: drop-shadow(0 1px 0 rgba(110,60,30,.25)); }
.hud-right .pill.time #time-ico img.hud-ic, .hud-right .pill.net span img.hud-ic { width: 22px; height: 22px; }
.hud-right .pill.energy img.hud-ic { width: 18px; height: 18px; vertical-align: -4px; }
.hud-right .fest-pill img.hud-ic { width: 18px; height: 18px; vertical-align: -4px; }
.act { width: 68px; padding: 0 3px; overflow: hidden; }
.act .lbl { display: block; max-width: 100%; overflow: hidden; text-align: center; letter-spacing: -.2px; }
@media (max-width: 520px) { .act { width: 56px; } }

/* สมุดสะสม: ภาพวาดมือ (ปลา/ของสะสม/ความลับ) · ช่องความลับเป็นการ์ดไม้ */
.book .subtabs .chip img.hud-ic { width: 20px; height: 20px; vertical-align: -5px; }
.book-item .book-pic { height: 60px; display: grid; place-items: center; }
.book-item .book-pic img.icon-img { width: 60px; height: 52px; }
.book-item.secret { background: linear-gradient(#fffaf1, #fdeedb 70%, #f6dcc0); border: 2px solid var(--wood-m); box-shadow: inset 0 2px 0 #fff, 0 3px 0 #9a6644; color: var(--wood-ink); }
.book-item.secret.no .emo { filter: none; opacity: .85; }
.book-item.secret.no b { color: #9a6c52; }
.book-item.secret small.hint { color: #8a5a3c; background: rgba(255,255,255,.6); border-radius: 8px; padding: 2px 5px; }
.ach-ic img.icon-img { width: 34px; height: 34px; }
.quests .tabs .tab img.hud-ic, .inv-title img.hud-ic, .lvl-card img.hud-ic { width: 20px; height: 20px; vertical-align: -5px; }
#quest-tracker img.hud-ic { width: 16px; height: 16px; vertical-align: -3px; }

/* กาชา: รายการของในตู้ */
.gacha-list { margin: 10px 2px 2px; background: linear-gradient(#fffaf1, #fdeedb); border: 2px solid var(--wood-m); border-radius: 16px; padding: 6px 10px 8px; box-shadow: inset 0 2px 0 #fff, 0 3px 0 #9a6644; color: var(--wood-ink); text-align: left; }
.gacha-list summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.gacha-list summary small { font-weight: 400; color: #9a6c52; }
.gl-head { margin: 8px 0 4px; font-size: 12px; }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.gl-item { background: #fff; border-radius: 12px; border: 2px solid #f0e2d2; padding: 4px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 11.5px; gap: 1px; }
.gl-item.rare { border-color: #cfe6ff; } .gl-item.legend { border-color: #ffd36a; background: #fffbea; }
.gl-item.own { opacity: .6; }
.gl-item .gl-ic img.icon-img { width: 44px; height: 44px; }
.gl-item small { font-size: 10px; color: #9a6c52; }
.gl-only { color: #c98a00; }
.gl-sum { margin-top: 8px; line-height: 1.5; }

/* ปุ่มกลมในแถบขวา: เดิม 3×40px + ช่องว่าง กว้างกว่าบอร์ด → ปุ่มซ้ายล้นกรอบ · ให้ยืดตามความกว้างบอร์ดแทน */
.hud-right .hud-btns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 5px; box-sizing: border-box; width: 100%; }
.hud-right .hud-btns .round.small { width: 100%; max-width: 36px; height: auto; aspect-ratio: 1 / 1; justify-self: center; padding: 0; display: grid; place-items: center; overflow: hidden; }
.hud-right .hud-btns .round img.icon-img.hud-ic { width: 70%; height: 70%; }

/* โหมดถ่ายรูป (รีโมเดล): สติกเกอร์วาดมือ แบบการถ่ายหลายรูป กรอบตัดภาพ นับถอยหลัง */
.ph-bottom { background: linear-gradient(#fffaf1, #fdeedb); border: 3px solid var(--wood); box-shadow: inset 0 2px 0 #fff, 0 4px 0 #6e4329, 0 8px 16px rgba(90,45,30,.25); }
.ph-modes .chip img.hud-ic { width: 18px; height: 18px; vertical-align: -4px; }
.stk { display: grid; place-items: center; border: 2px solid #f0d5c0; background: #fff; box-shadow: 0 2px 0 #d9b89a; }
.stk img.icon-img { width: 34px; height: 34px; }
.ph-stk img.icon-img { width: var(--sz, 44px); height: var(--sz, 44px); pointer-events: none; }
.shutter { display: grid; place-items: center; background: linear-gradient(#fff, #ffeef3); }
.shutter img.icon-img { width: 38px; height: 38px; }
.shutter:disabled { opacity: .5; }
.ph-frame.crop { inset: auto; border: 4px dashed rgba(255,255,255,.95); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(40,20,30,.38); }
.ph-frame.crop.sticker { border-radius: 44px; border-style: solid; border-width: 8px; }
.ph-badge { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); background: #ff8fab; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.ph-count { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 22; font: 700 96px Mali, sans-serif; color: #fff; text-shadow: 0 4px 0 #ff8fab, 0 8px 18px rgba(0,0,0,.3); pointer-events: none; }
.ph-count.pop { animation: phpop .6s ease-out; }
@keyframes phpop { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: translate(-50%, -50%) scale(1); } }
.photo-prev img.tall { max-height: 62vh; width: auto; max-width: 100%; }
.photo-prev img.cut { background: repeating-conic-gradient(#f3e6ea 0 25%, #fff 0 50%) 0 0 / 18px 18px; border-radius: 12px; }

/* ถ่ายหลายรูป: กดชัตเตอร์ทีละรูป · ปุ่มถ่ายใหม่ + ตัวนับบนปุ่มชัตเตอร์ */
.ph-redo { position: absolute; right: 8px; bottom: 8px; pointer-events: auto; background: rgba(255,255,255,.92); border: 2px solid #ff8fab; color: #c0486b; font: 700 12px Mali, sans-serif; padding: 4px 10px; border-radius: 999px; box-shadow: 0 2px 0 #e7a3b5; }
.shutter { position: relative; }
.shutter[data-prog]:not([data-prog=""])::after { content: attr(data-prog); position: absolute; right: -14px; top: -6px; background: #ff8fab; color: #fff; font: 700 12px Mali, sans-serif; padding: 2px 7px; border-radius: 999px; border: 2px solid #fff; }

/* แผงถ่ายรูป: ทุกแถว (แบบถ่าย/ฟิลเตอร์/สติกเกอร์) ตัดขึ้นบรรทัดใหม่ จัดกึ่งกลาง ไม่ต้องเลื่อนข้าง */
.ph-row { flex-wrap: wrap; justify-content: center; overflow: visible; touch-action: auto; padding: 2px 0; }
.ph-stks { gap: 6px; }
.ph-stks .stk { width: 40px; height: 40px; border-radius: 12px; }
.ph-stks .stk img.icon-img { width: 30px; height: 30px; }
@media (max-width: 420px) { .ph-stks .stk { width: 36px; height: 36px; } .ph-stks .stk img.icon-img { width: 27px; height: 27px; } .ph-row .chip { padding: 6px 10px; font-size: 12px; } }
.ph-stks { max-width: 330px; margin: 0 auto; } /* 14 ชิ้น = 2 แถว แถวละ 7 สมดุล */
@media (max-width: 420px) { .ph-stks { max-width: 300px; } }

/* สุขภาพแมว (คลินิกหมอใจดี) */
.health-card { background: linear-gradient(#f4fbff, #e6f5fd); border: 2px solid #a9d6ea; border-radius: 14px; padding: 6px 10px; }
.health-card.sick { background: linear-gradient(#fff3f4, #ffe3e6); border-color: #f2a3ad; }
.health-card .due, .svc-note .due { color: #d9485f; }
.health-card small { display: block; margin-top: 4px; color: #6b8797; font-size: 11px; }
.sell-row .svc-note { display: block; margin-top: 2px; }
.sell-row.due { background: #fff4f5; box-shadow: inset 0 0 0 2px #f6b6c0; }

/* พ่อค้าเร่ลึกลับ + ปุ่มบทสนทนามีไอคอนวาดมือ */
.dlg-btns .pill-btn img.hud-ic { width: 20px; height: 20px; vertical-align: -5px; margin-right: 2px; }
.merchant-intro { background: linear-gradient(#f6efff, #ece2fb); border: 2px solid #c9b3ef; border-radius: 14px; padding: 8px 12px; color: #5b4a7a; }
.merchant-intro img.hud-ic { width: 22px; height: 22px; vertical-align: -6px; }
.merchant-card { background: linear-gradient(#fffdf6, #fbf3ff); }
.merchant-card .sc-ic img.icon-img { width: 72px; height: 72px; }
.merchant-card .sc-meta small { color: #8a7aa6; font-size: 10.5px; }
.merchant-card .sc-desc { font-size: 10.5px; color: #9a7f86; line-height: 1.35; margin: 2px 0 4px; }
.merchant-card.sold { opacity: .55; filter: grayscale(.4); }

/* หน้าตั้งค่า: ป้ายไม้ครีม + ไอคอนวาดมือ + สวิตช์ */
.settings { gap: 7px; }
.set-title { font: 700 12px Mali, sans-serif; color: #9a6c52; margin: 6px 4px -2px; letter-spacing: .3px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px; background: linear-gradient(#fffaf1, #fdeedb 75%, #f6dcc0); border: 2px solid var(--wood-m, #b27e57); box-shadow: inset 0 2px 0 #fff, 0 3px 0 #9a6644; color: var(--wood-ink, #6b3f26); }
.set-row img.set-ic { width: 34px; height: 34px; flex: none; object-fit: contain; filter: drop-shadow(0 1px 0 rgba(110,60,30,.2)); }
.set-tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.set-tx b { font-size: 14px; }
.set-tx small { font-size: 11px; color: #9a7a62; }
.set-row.danger { background: linear-gradient(#fff6f4, #fde4e0); border-color: #d99a8f; }
.set-row.armed { box-shadow: inset 0 2px 0 #fff, 0 3px 0 #b34b4b, 0 0 0 3px rgba(224,100,122,.35); }
.set-switch { flex: none; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: #e9d6c2; border: 2px solid #c9a27c; color: #8a6a52; font: 700 12px Mali, sans-serif; box-shadow: inset 0 2px 3px rgba(110,60,30,.18); }
.set-switch i { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 #b8957a; transition: transform .15s; }
.set-switch.on { background: #ffc6d4; border-color: #ff8fab; color: #c0486b; flex-direction: row-reverse; padding: 3px 3px 3px 10px; }
.set-foot { text-align: center; }
.set-foot img.set-ic { width: 18px; height: 18px; vertical-align: -4px; }
.acct { background: linear-gradient(#f2fbff, #e3f3fc) !important; border: 2px solid #a9d6ea; border-radius: 16px; box-shadow: inset 0 2px 0 #fff, 0 3px 0 #7fb4c9; }
.acct > b img.set-ic { width: 26px; height: 26px; vertical-align: -7px; }
.acct .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e0647a; margin-right: 4px; vertical-align: 0; }
.acct .dot.on { background: #5fbf7a; }
.mg-left { margin: 6px 0 2px; font-size: 13px; color: #6b3f26; background: #fff3dc; border-radius: 999px; padding: 4px 12px; display: inline-block; }
.mg-left.none { background: #ffe3e6; color: #c0486b; }
.mg-card .big-go:disabled { filter: grayscale(.6); opacity: .7; }
.sell-row .px { font-size: 10px; margin-left: 4px; } .sell-row .px.up { color: #3f8a5c; } .sell-row .px.down { color: #c0485b; }

/* ข้อมูลแมว + การ์ดแมว HUD: ไอคอนวาดมือ ป้ายไม้ครีม */
.stat .ico img.stat-ic { width: 18px; height: 18px; vertical-align: middle; }
.cat-info { display: grid; gap: 8px; }
.ci-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: linear-gradient(#fffaf1, #fdeedb 75%, #f6dcc0); border: 2px solid var(--wood-m); box-shadow: inset 0 2px 0 #fff, 0 3px 0 #9a6644; color: var(--wood-ink); }
.ci-pic canvas { width: 88px; height: 88px; border-radius: 50%; background: #fff3e2; border: 3px solid var(--wood-l); box-shadow: 0 2px 0 var(--wood-m); }
.ci-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ci-meta b { font-size: 18px; }
.ci-meta small { color: #9a6c52; font-size: 12px; line-height: 1.35; }
.ci-card { padding: 8px 12px; border-radius: 16px; background: #fffaf3; border: 2px solid #ecd3b8; box-shadow: 0 2px 0 #e0c2a2; display: grid; gap: 6px; color: var(--wood-ink); }
.ci-stat { display: grid; grid-template-columns: 22px 78px 1fr 30px; align-items: center; gap: 6px; font-size: 13px; }
.ci-stat img.stat-ic { width: 22px; height: 22px; }
.ci-stat .bar { height: 10px; border-radius: 6px; background: #f1dfcb; overflow: hidden; box-shadow: inset 0 1px 2px rgba(110,60,30,.18); }
.ci-stat .bar i { display: block; height: 100%; border-radius: 6px; }
.ci-stat b { text-align: right; }
.ci-count { grid-template-columns: 1fr 1fr; }
.ci-count > div { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ci-count b { margin-left: auto; }
.cat-info .inv-title img.hud-ic { width: 20px; height: 20px; vertical-align: -5px; }

/* เหรียญ/เพชร/ตั๋ว: ภาพวาดมือชุดเดียวกันทั้งเกม (แทนรูปวาดด้วย CSS + อีโมจิ) */
.coin-ico { background: url(../assets/ui/coin.png) center / contain no-repeat !important; border: 0 !important; box-shadow: none !important; }
.coin-ico::after { content: none !important; }
.gem-ico { background: url(../assets/icons/g_gem1.png) center / contain no-repeat !important; border: 0 !important; box-shadow: none !important; transform: none !important; clip-path: none !important; }
.gem-ico::after, .gem-ico::before { content: none !important; }
.gemshop .tabs .tab img.tab-ic, .gs-bal .tag img.tab-ic { width: 22px; height: 22px; vertical-align: -6px; margin-right: 2px; }

/* ===== ระบบไลฟ์: วงล้อ ข่าว จดหมาย พาส ข้อมูลของฉัน (js/live.js) ===== */
img.icon-img.rw-ic { width: 28px; height: 28px; vertical-align: -8px; }
img.icon-img.news-ic { width: 46px; height: 46px; flex: none; }
img.icon-img.sc-img { width: 56px; height: 56px; }
.news { display: grid; gap: 8px; }
.news-card { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 16px; background: linear-gradient(#fffaf1, #fdeedb); border: 2px solid var(--wood-m); box-shadow: inset 0 2px 0 #fff, 0 3px 0 #9a6644; color: var(--wood-ink); }
.news-card b { display: block; } .news-card small { color: #9a6c52; font-size: 12px; }
.wheel-wrap { display: grid; gap: 8px; justify-items: center; }
.wheel-stage { position: relative; width: min(320px, 82vw); aspect-ratio: 1; }
.wheel-cv { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 8px #8a5a3c, 0 0 0 12px #e9b98a, 0 8px 18px rgba(90,45,30,.3); background: #fff; }
.wheel-pin { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #e0647a; filter: drop-shadow(0 3px 0 #8a5a3c); }
.wheel-info { text-align: center; }
.mailbox .mail-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 14px; background: #fffaf3; border: 2px solid #ecd3b8; margin-bottom: 7px; color: var(--wood-ink); }
.mailbox .mail-row > img.icon-img { width: 34px; height: 34px; flex: none; }
.mailbox .mail-row > div { flex: 1; min-width: 0; }
.mailbox .mail-row b { display: block; } .mailbox .mail-row small { color: #9a6c52; font-size: 11px; }
.mailbox .mail-row p { margin: 4px 0; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.mailbox .mail-row.unread { border-color: #ff8fab; background: #fff5f8; }
.mailbox .mail-row.gift { border-color: #ffd36a; }
.mailbox .mail-row.dm.mine { background: #f2fbff; border-color: #a9d6ea; }
.mail-att { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.mail-act { flex: none; display: grid; gap: 4px; }
.giftshop .gift-note, .set-code, .pf-bio { width: 100%; box-sizing: border-box; border: 2px solid #ecd3b8; border-radius: 12px; padding: 8px 10px; font: 13px Mali, sans-serif; background: #fffdf8; color: var(--wood-ink); }
.set-code { margin-top: 6px; }
/* ---------- รายงานบั๊ก / ช่วงทดสอบ (js/telemetry.js) ---------- */
.feedback { display: grid; gap: 10px; }
.feedback .fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.feedback .fb-text { width: 100%; box-sizing: border-box; min-height: 110px; resize: vertical; border: 2px solid #ecd3b8; border-radius: 12px; padding: 8px 10px; font: 14px Mali, sans-serif; background: #fffdf8; color: var(--wood-ink); }
.feedback .fb-meta { color: var(--ink-soft); font-size: 11.5px; line-height: 1.5; }
.set-sec.tele .set-tx small a { color: #b0663a; text-decoration: underline; white-space: nowrap; }
.test-banner { display: block; margin: 0 0 8px; padding: 6px 10px; border-radius: 12px; background: #fff3cf; border: 2px dashed #e9bf5a; color: #7a5520; font-size: 12px; line-height: 1.45; text-align: center; }
.pf-bio { min-height: 60px; resize: vertical; }
/* ---------- แบทเทิลพาส (โทนกรมท่า-ทอง หรูหรา) ---------- */
.bpass { --bp-gold: #f3cf7a; --bp-gold2: #c9952e; --bp-navy: #2a2350; --bp-navy2: #463a7a; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.bpass > * { min-width: 0; }
.bpass .bp-head { position: relative; overflow: hidden; padding: 12px 14px; border-radius: 18px; color: #fff6e0;
  background: radial-gradient(120% 140% at 100% 0%, #6b4fa0 0%, transparent 55%), linear-gradient(135deg, var(--bp-navy), var(--bp-navy2));
  border: 2px solid var(--bp-gold); box-shadow: inset 0 0 0 2px rgba(255,236,180,.25), 0 6px 16px rgba(42,35,80,.25);
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.bp-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,240,200,.18) 50%, transparent 65%); animation: bpShine 4.5s ease-in-out infinite; pointer-events: none; }
@keyframes bpShine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.bp-title { display: grid; gap: 1px; }
.bp-title b { font: 700 18px Mali, sans-serif; color: var(--bp-gold); text-shadow: 0 1px 0 #6a4a10; }
.bp-title small, .bp-how { color: #d9cdf2; font-size: 11px; }
.bp-season { justify-self: start; font: 700 9.5px sans-serif; letter-spacing: 2px; color: #2a2350; background: linear-gradient(#ffe9a8, var(--bp-gold2)); padding: 2px 8px; border-radius: 999px; }
.bp-lvbadge { width: 58px; height: 58px; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1; color: #4a3208;
  background: radial-gradient(circle at 35% 30%, #fff5cf, var(--bp-gold) 45%, var(--bp-gold2)); border: 2px solid #fff2c4; box-shadow: 0 0 0 2px var(--bp-gold2), 0 3px 8px rgba(0,0,0,.3); }
.bp-lvbadge b { font: 800 20px Mali, sans-serif; } .bp-lvbadge small { font-size: 9px; }
.bp-xp { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; } .bp-xp small { color: #fff1c8; font-size: 11px; white-space: nowrap; }
.bp-xpbar { flex: 1; height: 10px; border-radius: 6px; background: rgba(0,0,0,.35); box-shadow: inset 0 1px 2px rgba(0,0,0,.4); overflow: hidden; }
.bp-xpbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffe39a, #f0b43c); box-shadow: 0 0 8px rgba(255,214,120,.8); transition: width .4s; }
.bp-how { grid-column: 1 / -1; line-height: 1.5; } .bp-eta { color: #ffe39a; font-weight: 700; font-size: 11.5px; }
.bp-show { display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; padding: 10px; border-radius: 18px; background: linear-gradient(160deg, #fffaf0, #fbefd6); border: 1.5px solid #e8cf96; }
.bp-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bp-feat { position: relative; border-radius: 14px; padding: 6px 4px 18px; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 35%, #fff, #fbe7b8); border: 1.5px solid var(--bp-gold); box-shadow: inset 0 0 0 2px #fff7e0; overflow: hidden; }
.bp-feat .bp-rw .coin-ico, .bp-feat .bp-rw .gem-ico { display: none; }
.bp-feat .rw-ic, .bp-feat img.icon-img.rw-ic { width: 46px; height: 46px; object-fit: contain; vertical-align: 0; }
.bp-feat em { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); font: 700 10px Mali, sans-serif; font-style: normal; color: #fff; background: var(--bp-navy2); border-radius: 999px; padding: 0 7px; }
.bp-info { display: grid; gap: 4px; align-content: center; font-size: 12px; color: #5a4030; }
.bp-info b { font: 700 14px Mali, sans-serif; color: #7a4a10; }
.bp-info ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.bp-info li::before { content: '✦ '; color: var(--bp-gold2); }
.bp-worth { font-size: 11.5px; color: #8a5a3c; } .bp-worth s { color: #b48e78; } .bp-worth b { color: #c0392b; font-size: 14px; }
.bp-worth i { font-style: normal; font-weight: 700; color: #fff; background: #e0566f; border-radius: 6px; padding: 0 5px; margin-left: 2px; }
.bp-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bp-buy { border: 0; border-radius: 16px; padding: 8px 10px; cursor: pointer; display: grid; line-height: 1.15; color: #4a3208;
  background: linear-gradient(#fff2bf, var(--bp-gold) 55%, var(--bp-gold2)); box-shadow: 0 3px 0 #9a6d1c, inset 0 1px 0 #fffbe6; font-family: inherit; }
.bp-buy small { font-size: 11.5px; } .bp-buy b { font: 800 18px Mali, sans-serif; }
.bp-buy.plus { color: #fff; background: linear-gradient(135deg, #6b4fa0, var(--bp-navy)); box-shadow: 0 3px 0 #1a1535, inset 0 0 0 2px rgba(243,207,122,.7); }
.bp-buy.plus b { color: var(--bp-gold); }
.bp-buy:active { transform: translateY(2px); box-shadow: none; }
.bp-ad { grid-column: 1 / -1; border: 1.5px dashed #c9b6e8; background: #f6f1ff; color: #5a4a8a; border-radius: 999px; padding: 6px; font: inherit; font-size: 12.5px; cursor: pointer; }
.bp-ad:disabled { opacity: .5; }
.bp-rows { display: flex; gap: 4px; border-radius: 18px; padding: 8px 6px 4px; background: linear-gradient(#f7f2ff, #fff8ee); border: 1.5px solid #e6dcf3; }
.bp-track { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.bp-col { flex: none; width: 92px; display: grid; grid-template-rows: 110px 28px 84px; gap: 4px; }
.bp-col:not(.open) .bp-cell { filter: saturate(.55); opacity: .72; }
.bp-cell { position: relative; overflow: hidden; border-radius: 14px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; font-size: 11.5px; font-weight: 600; color: #6a4a32;
  background: #fffdf8; border: 1.5px solid #ead9c2; }
.bp-cell.prem { background: linear-gradient(170deg, #fffaf0, #fde9b8); border: 1.5px solid #e2b85a; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.bp-cell.prem.item { background: radial-gradient(circle at 50% 30%, #fff, #fbe0a0 80%); border-color: var(--bp-gold2); }
.bp-col.feat .bp-cell.prem { border-width: 2px; box-shadow: inset 0 0 0 2px #fff6d8, 0 0 0 2px rgba(201,149,46,.25); }
.bp-col.feat .bp-cell.prem::before { content: '★'; position: absolute; top: 3px; right: 6px; color: var(--bp-gold2); font-size: 11px; }
.bp-cell.can { border-color: #ff8fab; box-shadow: 0 0 0 3px rgba(255,143,171,.35); animation: bpPulse 1.6s ease-in-out infinite; }
@keyframes bpPulse { 50% { box-shadow: 0 0 0 5px rgba(255,143,171,.15); } }
.bp-cell.got .bp-rw { opacity: .4; }
.bp-rw { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; align-items: center; max-width: 100%; }
.bp-rw small { display: block; width: 100%; font-size: 9.5px; font-weight: 500; color: #8a6a52; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.bp-cell .rw-ic, .bp-cell img.icon-img.rw-ic { width: 40px; height: 40px; object-fit: contain; vertical-align: 0; }
.bp-cell.free .rw-ic, .bp-cell.free img.icon-img.rw-ic { width: 32px; height: 32px; }
.bp-claim { border: 0; border-radius: 999px; padding: 2px 14px; font: 700 12px Mali, sans-serif; color: #fff; background: linear-gradient(#ff9fb6, #f0668a); box-shadow: 0 2px 0 #c44a6b; cursor: pointer; }
.bp-got { position: absolute; inset: auto 0 6px; margin: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #fff; background: #4cc38a; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.bp-lock { position: absolute; top: 4px; left: 5px; font-style: normal; font-size: 11px; opacity: .8; }
.bp-cell.prem.lock { filter: none; }
.bp-lv { position: relative; display: grid; place-items: center; }
.bp-lv::before { content: ''; position: absolute; left: -4px; right: -4px; top: 50%; height: 4px; transform: translateY(-50%); background: #e3d6ef; }
.bp-col.open .bp-lv::before { background: linear-gradient(90deg, var(--bp-gold), var(--bp-gold2)); }
.bp-lv span { position: relative; min-width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 12px Mali, sans-serif; color: #8a7aa8; background: #fff; border: 2px solid #d9cceb; }
.bp-col.open .bp-lv span { color: #4a3208; background: radial-gradient(circle at 35% 30%, #fff5cf, var(--bp-gold) 60%, var(--bp-gold2)); border-color: #fff2c4; box-shadow: 0 0 0 1.5px var(--bp-gold2); }
.bp-col.next .bp-lv span { color: #fff; background: var(--bp-navy2); border-color: var(--bp-gold); }
@media (max-width: 420px) { .bp-show { grid-template-columns: 1fr; } }
.profile { display: grid; gap: 8px; }
.pf-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: linear-gradient(#fffaf1, #fdeedb 75%, #f6dcc0); border: 2px solid var(--wood-m); box-shadow: inset 0 2px 0 #fff, 0 3px 0 #9a6644; color: var(--wood-ink); }
.pf-pic canvas { width: 120px; height: 120px; border-radius: 18px; background: #fff3e2; border: 3px solid var(--wood-l); }
.pf-meta { display: flex; flex-direction: column; gap: 3px; }
.pf-meta > b { font-size: 18px; } .pf-meta small { color: #9a6c52; font-size: 12px; }
.pf-mood { font-size: 13px; }
.pf-wear { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-friends { display: grid; gap: 6px; }
.pf-friend { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: #fffaf3; border: 2px solid #ecd3b8; }
.pf-friend span { flex: 1; font-weight: 700; color: var(--wood-ink); } .pf-friend small { color: #9a6c52; }
.acc-grid .shop-card .sc-ic img.icon-img { width: 56px; height: 56px; }
.hud-right .pill.energy { flex-direction: column; align-items: stretch; gap: 3px; }
.hud-right .pill.energy .en-row { display: flex; align-items: center; gap: 4px; }
.hud-right .pill.energy .en-row .xpbar { flex: 1; }
.xpbar.hu i { background: linear-gradient(90deg, #ffb36b, #ff8a5a); }
.xpbar.hu.low i { background: #e0647a; animation: pulse 1s infinite alternate; }
.mem-board { margin: 8px auto; max-width: 280px; text-align: left; background: #fffaf3; border: 2px solid #ecd3b8; border-radius: 14px; padding: 8px 12px; font-size: 13px; color: var(--wood-ink); }
.mem-row { display: flex; gap: 6px; } .mem-row .nm { flex: 1; } .mem-row.me { color: #c0486b; font-weight: 700; }
.wheel-cv { box-shadow: 0 8px 18px rgba(90,45,30,.3) !important; }
.wheel-pin { top: -10px; border-left-width: 18px; border-right-width: 18px; border-top: 34px solid #ff8fab; filter: drop-shadow(0 0 0 #fff) drop-shadow(0 3px 0 #b45a6a); }
.wheel-pin::after { content: ''; position: absolute; left: -7px; top: -30px; width: 14px; height: 14px; border-radius: 50%; background: #fff; opacity: .9; }
.wheel-wrap .big-go:disabled, .wheel-wrap .pill-btn:disabled { filter: grayscale(.7); opacity: .55; box-shadow: none; }
.cr-outfits { gap: 6px; } .cr-opt.cr-outfit { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; width: 76px; border-radius: 14px; } .cr-opt.cr-outfit canvas { width: 44px; height: 44px; } .cr-opt.cr-outfit small { font-size: 10px; line-height: 1.15; }
.cr-opt.cr-acc { display: inline-flex; align-items: center; gap: 4px; } img.icon-img.cr-acc-ic { width: 24px; height: 24px; }
.cr-box h1 { font-size: 22px; }
.breed-locked { margin: 8px 0; background: #fffaf3; border: 2px solid #ecd3b8; border-radius: 16px; padding: 6px 10px; color: var(--wood-ink); } .breed-locked summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.breed.locked { filter: grayscale(.85) brightness(1.05); opacity: .6; cursor: default; pointer-events: none; } .breed.locked small.rar { font-size: 9.5px; }

/* รางวัลเข้าเกมรายวัน: ป้ายไม้ครีม */
.login-card { background: linear-gradient(#fffaf1, #fdeedb) !important; border: 4px solid var(--wood) !important; box-shadow: inset 0 0 0 3px #f6dcc0, 0 6px 0 #6e4329, 0 14px 30px rgba(90,45,30,.35) !important; color: var(--wood-ink); }
.login-ribbon { position: relative; margin: -4px auto 2px; display: flex; align-items: center; gap: 8px; justify-content: center; background: linear-gradient(#ff9fb8, #ff7fa0); color: #fff; border-radius: 14px; padding: 6px 18px; box-shadow: 0 3px 0 #c95a78; }
.login-ribbon h2 { margin: 0; font-size: 19px; color: #fff; text-shadow: 0 2px 0 rgba(150,50,80,.35); }
img.icon-img.login-gift { width: 38px; height: 38px; margin: -10px 0; filter: drop-shadow(0 2px 0 rgba(120,40,60,.3)); }
.login-sub { color: #9a6c52 !important; }
.login-card .lday { background: #fff; border: 2px solid #ecd3b8; box-shadow: 0 2px 0 #e0c2a2; position: relative; padding: 6px 2px 5px; }
.login-card .lday small { color: #9a6c52; font-weight: 700; }
.login-card .lday b { color: #a8670a; font-size: 13px; }
img.icon-img.lday-ic { width: 30px; height: 30px; }
.lday.big img.icon-img.lday-ic { width: 38px; height: 38px; }
.lday-xs { display: flex; align-items: center; gap: 1px; min-height: 18px; }
img.icon-img.lday-x { width: 18px; height: 18px; }
.login-card .lday.now { border-color: #ff8fab; background: #fff3f7; box-shadow: 0 2px 0 #e7a3b5, 0 0 0 3px rgba(255,143,171,.3); }
.login-card .lday.big { background: linear-gradient(#fffbe6, #ffeec2); border-color: #e6b54a; }
.login-card .lday.got { opacity: .55; }
.lday-ok { position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #5fbf7a; color: #fff; font: 700 10px/16px Mali, sans-serif; font-style: normal; text-align: center; }

/* กันการ์ดล้นกรอบ: คอลัมน์ grid ให้หดได้ (minmax 0) + รูปไม่ดันความกว้าง */
.breed-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.breed { min-width: 0; overflow: hidden; }
.breed canvas { width: 100%; max-width: 84px; height: auto; aspect-ratio: 1; }
.breed span, .breed small { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.breed-locked { overflow: hidden; }
.breed-locked .breed-grid { gap: 6px; }
.breed-locked .breed canvas { max-width: 64px; }
.breed.locked { box-shadow: 0 2px 0 #eadbd0 !important; border-color: transparent !important; }
.login-card { width: min(380px, 94vw) !important; box-sizing: border-box; padding: 16px 12px !important; }
.login-row { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 3px !important; }
.login-card .lday { min-width: 0; overflow: hidden; padding: 5px 1px 4px !important; }
.login-card .lday small { font-size: 9px; white-space: nowrap; }
.login-card .lday b { font-size: 12px; }
.login-card img.icon-img.lday-ic { width: 100%; max-width: 30px; height: auto; aspect-ratio: 1; }
.login-card .lday.big img.icon-img.lday-ic { max-width: 34px; }
.login-card .lday-xs { flex-wrap: wrap; justify-content: center; }
.login-card .lday .lgem { font-size: 9.5px; }
.login-card img.icon-img.lday-x { width: 15px; height: 15px; }
.login-ribbon { max-width: 100%; box-sizing: border-box; padding: 6px 12px; }
.login-ribbon h2 { font-size: 17px; white-space: nowrap; }

/* หุ่นแยกชิ้น: ปุ่มเลือกผม/ตา/ปาก/ชิ้นเสื้อผ้าในหน้าสร้างตัวละคร */
.cr-opts.cr-rig { gap: 6px; }
.cr-opt.cr-rigopt { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 78px; padding: 4px 4px 5px; border-radius: 14px; }
.cr-opt.cr-rigopt canvas { width: 48px; height: 48px; border-radius: 12px; background: #fff3e2; }
.cr-opt.cr-rigopt small { font-size: 10px; line-height: 1.15; text-align: center; }
.rig-grid .shop-card .sc-ic canvas { width: 64px; height: 64px; }

/* ---------- ตู้เสื้อผ้า: ใส่แยกชิ้น ---------- */
.mix-row { margin: 8px 0 10px; }
.mix-label { font-weight: 700; color: #7a4a2e; margin: 0 2px 4px; font-size: 14px; }
.mix-opts { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.mix-opt { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 3px 5px; border-radius: 12px; border: 2px solid #ead3b5; background: #fffaf2; cursor: pointer; }
.mix-opt canvas { width: 56px; height: 56px; }
.mix-opt small { font-size: 10.5px; line-height: 1.15; color: #6b4a35; text-align: center; max-width: 66px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mix-opt.sel { border-color: #e58c5a; background: #ffeede; box-shadow: 0 0 0 2px rgba(229,140,90,.25); }
.mix-opt { position: relative; }
.mix-opt.trial { border-style: dashed; }
.mix-opt .mix-try { position: absolute; top: 3px; right: 3px; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: #e58c5a; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.shop-week.sale { color: #c2410c; font-weight: 700; }

/* นาฬิกา + วันในสัปดาห์ บรรทัดเดียว */
#time-txt { white-space: nowrap; font-size: .92em; letter-spacing: -.2px; }


/* ---------- เลือกแบบบ้าน (หลังรับเลี้ยงแมว) ---------- */
.house-pick { display: grid; gap: 10px; }
.hp-big { height: 230px; display: grid; place-items: center; border-radius: 22px; background: radial-gradient(circle at 50% 70%, #d9f0c4, #bfe3a6 60%, #a8d68c); box-shadow: inset 0 -10px 20px rgba(80,120,60,.18); }
.hp-big img { max-height: 210px; max-width: 92%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(60,80,40,.25)); }
.hp-name { text-align: center; display: grid; } .hp-name b { font: 700 17px Mali, sans-serif; } .hp-name small { color: #8a6a52; }
.hp-colors { display: flex; justify-content: center; gap: 10px; }
.hp-sw { border: 0; background: none; display: grid; justify-items: center; gap: 2px; cursor: pointer; font: inherit; }
.hp-sw i { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px #e6d4c4; }
.hp-sw.sel i { box-shadow: 0 0 0 3px #ff8fab; } .hp-sw small { font-size: 11px; color: #8a6a52; }
.hp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.hp-card { border: 2px solid #f0dccd; background: #fffaf5; border-radius: 16px; padding: 6px 4px; display: grid; justify-items: center; gap: 2px; cursor: pointer; font: inherit; }
.hp-card img { width: 100%; height: 64px; object-fit: contain; } .hp-card span { font-size: 11px; line-height: 1.2; text-align: center; }
.hp-card.sel { border-color: #ff8fab; background: #fff0f5; box-shadow: 0 0 0 2px rgba(255,143,171,.3); }

/* ---------- โชว์รูมรถ / ร้านแมว ---------- */
.garage { display: grid; gap: 6px; margin-bottom: 8px; }
.garage-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 14px; background: #f4f8ff; border: 1.5px solid #d6e2f4; }
.garage-row.sel { border-color: #4a5d9a; background: #eef3ff; }
.g-info { display: grid; gap: 3px; } .g-info small { color: #5a6a8a; }
.g-sw { display: flex; flex-wrap: wrap; gap: 4px; }
.g-c { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c9d2e2; cursor: pointer; padding: 0; }
.g-c.sel { box-shadow: 0 0 0 2.5px #33447a; }
.pet-special { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.ps-card { display: grid; justify-items: center; gap: 1px; padding: 4px 2px; border-radius: 12px; background: #f7f2ff; filter: grayscale(.25); text-align: center; }
.ps-card small { font-size: 9.5px; line-height: 1.15; } .ps-card .tag { font-size: 8.5px; }
.pet-view { display: grid; justify-items: center; gap: 8px; text-align: center; }

/* ---------- ข้อเสนอพิเศษตอนเข้าเกม (โทนพลัมเข้ม-ทอง · กระดาษงาช้าง เส้นทองบาง เรียบ ไม่ฉูดฉาด) ---------- */
.reveal.offer { z-index: 120; background: rgba(28,20,36,.55); }
.offer-card { --ink: #2e2338; --ink2: #4a3a58; --gold: #c9a35c; --gold-l: #e9d6a6; --ivory: #fffaf1; --paper: #f8f0e3; --muted: #8a7462;
  position: relative; width: min(520px, 94vw); max-height: 92vh; overflow-y: auto; padding: 0; text-align: left; display: block;
  background: var(--paper); border: 1px solid var(--gold); border-radius: 22px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(201,163,92,.55), 0 24px 60px rgba(20,12,30,.45); }
.of-head { position: relative; padding: 22px 20px 18px; text-align: center; color: var(--gold-l); border-radius: 21px 21px 0 0;
  background: radial-gradient(90% 120% at 50% 0%, #4b3a5e 0%, var(--ink) 70%); border-bottom: 1px solid var(--gold); }
.of-head::after { content: ''; position: absolute; left: 22px; right: 22px; bottom: 6px; border-bottom: 1px solid rgba(201,163,92,.35); }
.of-crest .of-crown { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.of-kick { display: block; font-size: 11px; letter-spacing: 3px; color: var(--gold); margin-top: 2px; }
.of-head h2 { margin: 2px 0 4px; font: 700 26px Mali, sans-serif; color: #f6e7c1; letter-spacing: .5px; }
.of-head p { margin: 0; font-size: 12px; color: #cdbfd8; }
.of-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(233,214,166,.6); background: transparent; color: var(--gold-l); font-size: 13px; cursor: pointer; }
.of-body { padding: 4px 16px 6px; }
.of-sec { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--ink2); font: 700 13.5px Mali, sans-serif; }
.of-sec::before, .of-sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.of-sec::after { background: linear-gradient(90deg, var(--gold), transparent); }
.of-sec span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.of-si { width: 22px; height: 22px; object-fit: contain; }
.of-special { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.of-pack { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 5px; text-align: center; padding: 16px 10px 10px; border-radius: 16px;
  background: var(--ivory); border: 1px solid var(--gold-l); box-shadow: inset 0 0 0 3px var(--ivory), inset 0 0 0 4px rgba(201,163,92,.35); }
.of-pack.owned { opacity: .65; }
.of-ribbon { position: absolute; top: 12px; left: -30px; width: 110px; transform: rotate(-38deg); text-align: center; font-style: normal; font: 700 10.5px Mali, sans-serif; color: #fff7e4; background: #8e2f3c; padding: 3px 0; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.of-ic { display: grid; place-items: center; } .of-ic .icon-img, .of-ic img { width: 60px; height: 60px; object-fit: contain; }
.of-ic.sm .icon-img, .of-ic.sm img { width: 40px; height: 40px; }
.of-name { font: 700 14.5px Mali, sans-serif; color: var(--ink); }
.of-what { font-size: 12px; font-weight: 600; color: #5a4636; } .of-dot { font-style: normal; color: var(--gold); margin: 0 4px; }
.of-furn { display: flex; gap: 2px; justify-content: center; } .of-furn .icon-img { width: 28px; height: 28px; }
.of-price { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.of-price s { color: var(--muted); font-size: 12px; } .of-price b { font: 800 22px Mali, sans-serif; color: var(--ink); }
.of-got { font-size: 12px; color: var(--muted); }
.of-buy { width: 100%; border: 0; border-radius: 12px; padding: 9px 10px; cursor: pointer; font: 700 13.5px Mali, sans-serif; color: #f6e7c1; letter-spacing: .3px;
  background: linear-gradient(180deg, #4b3a5e, var(--ink)); box-shadow: inset 0 0 0 1px rgba(233,214,166,.45), 0 2px 0 #1a1222; }
.of-buy:disabled { opacity: .5; }
.of-buy:active, .of-pricebtn:active { transform: translateY(1px); }
.of-once { font-size: 10px; color: var(--muted); }
.of-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; background: var(--ivory); border: 1px solid var(--gold-l); }
.of-txt b { display: block; font-size: 13.5px; color: var(--ink); } .of-txt small { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; }
.of-pricebtn { border: 1px solid var(--gold); background: #fffdf8; color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 800 13.5px Mali, sans-serif; cursor: pointer; white-space: nowrap; }
.of-pricebtn:hover { background: var(--ink); color: #f6e7c1; }
.of-link { display: block; margin: -2px 0 0 auto; border: 0; background: none; color: var(--ink2); font: inherit; font-size: 12px; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer; }
.of-gems { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.of-gem { position: relative; display: grid; justify-items: center; gap: 3px; padding: 14px 6px 10px; border-radius: 14px; background: var(--ivory); border: 1px solid var(--gold-l); text-align: center; }
.of-gem b { font-size: 13.5px; color: var(--ink); } .of-gem small { font-size: 10.5px; color: var(--muted); }
.of-gem.hot { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.of-hot { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink); background: var(--gold-l); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.of-note { margin: 8px 16px 0; font-size: 11px; color: var(--muted); text-align: center; }
.of-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px 14px; margin-top: 8px; border-top: 1px solid rgba(201,163,92,.35); }
.of-skip { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.of-foot .pill-btn { background: transparent; border: 1px solid var(--gold); color: var(--ink2); box-shadow: none; }
@media (max-width: 420px) { .of-gems { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ---------- มินิเกมลอยกระทง ---------- */
.kt-make { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: min(460px, 92vw); max-height: 88vh; overflow-y: auto; display: grid; gap: 8px; text-align: center;
  background: linear-gradient(170deg, rgba(255,250,240,.97), rgba(255,236,206,.97)); border: 2px solid #e8b85a; box-shadow: 0 10px 40px rgba(20,20,60,.45); }
.kt-make h2 { margin: 0; font: 800 20px Mali, sans-serif; color: #7a4a10; }
.kt-pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.kt-pick button { border: 2px solid #f0dcc0; background: #fffaf2; border-radius: 14px; padding: 4px; cursor: pointer; }
.kt-pick button img { width: 100%; height: 52px; object-fit: contain; }
.kt-pick button.sel { border-color: #f0a030; background: #fff1d0; box-shadow: 0 0 0 2px rgba(240,160,48,.35); }
.kt-name { font: 700 14px Mali, sans-serif; color: #8a5a20; }
.kt-lab { text-align: left; font-weight: 700; color: #6a4520; font-size: 13px; } .kt-lab small { font-weight: 400; color: #a07a52; }
.kt-wish { width: 100%; box-sizing: border-box; border: 2px solid #f0d0a0; border-radius: 14px; padding: 9px 12px; font: inherit; font-size: 14px; background: #fff; }
.kt-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; } .kt-chips .chip { font-size: 11.5px; }
.kt-sum { display: flex; gap: 10px; align-items: center; justify-content: center; text-align: left; }
.kt-sum img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255,200,100,.8)); }
.kt-sum p { margin: 0; font-size: 13px; }

.mg-hud:empty { display: none; } /* มินิเกมที่ไม่มีคะแนน (ลอยกระทง) */

/* ของเล่นที่ยังไม่ได้ซื้อ (เมนูเล่นด้วยกัน) */
.menu-card.locked .mi { filter: grayscale(.85); opacity: .55; }
.menu-card.locked small { color: #b07a5a; }
.shop-card .sc-ic .emo img { width: 56px; height: 56px; object-fit: contain; }

/* ไอคอนวาดมือแทนอีโมจิ (แถบแต่งห้อง) */
.dbtn span img { width: 30px; height: 30px; object-fit: contain; display: block; }
.decor-title .dt-ic { width: 24px; height: 24px; object-fit: contain; vertical-align: -6px; }
.inv-empty .ie-ic, .inv-title .it-ic { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; }

/* ไอคอนวาดมือเล็กในชิป/ป้ายตู้เสื้อผ้า (แทนอีโมจิ) */
.chip-ic { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; }
.chip-ic.off { filter: grayscale(1); opacity: .45; }
.tag .chip-ic { width: 14px; height: 14px; vertical-align: -3px; }
.tip .chip-ic { width: 20px; height: 20px; vertical-align: -5px; }

/* อีโมจิที่แปลงเป็นไอคอนวาดมือ (js/emojify.js) */
img.emo-ic { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.28em; margin: 0 .05em; display: inline-block; }
.dbtn span img.emo-ic, .mi img.emo-ic, .act .ico img.emo-ic { width: 100%; height: 100%; max-width: 32px; max-height: 32px; }
h1 img.emo-ic, h2 img.emo-ic { width: 1.1em; height: 1.1em; }

.order .npc .npc-face { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; background: #fff3e6; }

/* ปุ่มรับรางวัลเควสต์ทั้งหมด */
.claim-all { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 8px 0 4px; padding: 11px; border: 0; border-radius: 16px; cursor: pointer;
  font: 700 15px Mali, sans-serif; color: #fff; background: linear-gradient(180deg, #ff9fb6, #f0668a); box-shadow: 0 3px 0 #c44a6b, 0 6px 14px rgba(240,102,138,.3); }
.claim-all img { width: 24px; height: 24px; }
.claim-all i { font-style: normal; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #fff; color: #e0466f; font-size: 13px; }
.claim-all:disabled { opacity: .6; }
.claim-all:active { transform: translateY(2px); box-shadow: 0 1px 0 #c44a6b; }
/* ---------- ฉายา (js/titles.js) ---------- */
.title-tag { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 2px 6px; padding: 1px 9px 1px 7px; border-radius: 999px; background: var(--tg-bg); border: 1.5px solid var(--tg-edge); color: var(--tg-ink); font-size: 11.5px; font-weight: 700; line-height: 1.5; vertical-align: middle; white-space: nowrap; }
.title-tag i { width: 9px; height: 9px; background: var(--tg-edge); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.title-pick { display: grid; gap: 6px; margin-bottom: 6px; }
.title-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 14px; background: #fffdf8; border: 2px solid #ecd3b8; text-align: left; }
.title-opt .title-tag { margin-left: 0; }
.title-opt small { color: var(--ink-soft); font-size: 11.5px; }
.title-opt.on { border-color: #e2b04a; background: #fff8e3; }
.title-opt.locked { opacity: .55; }
