/* Fixes to the build's own UI that hold whatever the theme (serve-decoded.mjs injects this before the theme's stylesheet).
   The build's stylesheet loads after this one, so a rule that competes with one of the build's needs !important. */

/* skill tree: the build squeezes a tree into 300 px of height, so a long one (13 rows) shrank its icons to ~14 px.
   Keep every cell at least 56 px wide (46 px on touch screens) and let the pane scroll instead. */
#win-skills .sk-board { width: min(100%, calc(var(--bw) * 64px), max(calc(var(--sk-board-h) * var(--ar)), calc(var(--bw) * 56px))) !important; }
body.touch #win-skills .sk-board { width: min(100%, calc(var(--bw) * 64px), max(calc(var(--sk-board-h) * var(--ar)), calc(var(--bw) * 46px))) !important; }
@media (orientation: landscape) and (max-height: 520px) {
  body.touch #win-skills .sk-board { width: min(100cqw, calc(var(--bw) * 64px), max(calc(100cqh * var(--ar)), calc(var(--bw) * 46px))) !important; }
}

/* emoticons over heads: the build plays a picture strip once (0.11 s a frame) and then holds the last frame for 3.5 s,
   so most of the time it looks still. Loop the strip for as long as it shows (a CSS animation wins over the build's
   inline frame position), and give the one-picture emoticons a little bounce. The strip's frame count is in its
   background-size (frames × 100 %). */
@keyframes emo-strip { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@keyframes emo-bob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.08); } }
@keyframes emo-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tag-emote { transform-origin: 50% 100%; }
.tag-emote[style*="background-size: 800%"] { animation: emo-strip .88s steps(7, jump-none) infinite; }
.tag-emote[style*="background-size: 700%"] { animation: emo-strip .77s steps(6, jump-none) infinite; }
.tag-emote[style*="background-size: 600%"] { animation: emo-strip .66s steps(5, jump-none) infinite; }
.tag-emote[style*="background-size: 500%"] { animation: emo-strip .55s steps(4, jump-none) infinite; }
.tag-emote[style*="background-size: 400%"] { animation: emo-strip .44s steps(3, jump-none) infinite; }
.tag-emote[style*="background-size: 300%"] { animation: emo-strip .33s steps(2, jump-none) infinite; }
.tag-emote[style*="background-size: 200%"] { animation: emo-strip .44s steps(1, jump-none) infinite; }
.tag-emote[style*="background-size: 100%"] { animation: emo-pop .18s ease-out, emo-bob .9s ease-in-out .18s infinite; }

/* the bag's page tabs (ช่อง 1 / 2 / 3): the row also holds "used", lock, bin and sort, which left the tabs ~90 px — a
   scrolling strip with one cut-off label and an arrow over it. The tabs get a row of their own, full width, equal parts */
.inv-bar { flex-wrap: wrap; row-gap: 6px; }
.inv-bar > .inv-tabs { flex: 1 0 100%; order: -1; max-width: none; }
.inv-bar > .inv-tabs > .tab { flex: 1 1 0; min-width: 0; }
.inv-bar > .inv-used { margin-right: auto; }

/* ---- workshop scenes (fixes.js): forge for crafting, scroll + magnifier for appraisal, magic circle for pet evolution.
   A layer over the window's body; the card holds the drawn scene and the outcome under it. */
.fx-layer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(38, 22, 12, .62); backdrop-filter: blur(2px); border-radius: 0 0 14px 14px; cursor: pointer; animation: fx-in .2s ease-out; overflow: hidden; }
.fx-layer.fx-fixed { position: fixed; inset: 0; z-index: 9000; border-radius: 0; }
/* the card fits the height too (a phone held sideways is ~375 px tall): scene + ~150 px of caption and foot */
.fx-fixed .fx-card { width: min(94vw, 460px, calc((100vh - 165px) * 1.636)); width: min(94vw, 460px, calc((100dvh - 165px) * 1.636)); }
.fx-fixed.fx-evo .fx-card { width: min(94vw, 460px, calc((100vh - 165px) * 1.5)); width: min(94vw, 460px, calc((100dvh - 165px) * 1.5)); }
.fx-opt.wide { max-width: 100%; }
.fx-layer.fx-out { animation: fx-fade .25s ease-in forwards; }
@keyframes fx-in { from { opacity: 0; } }
@keyframes fx-fade { to { opacity: 0; } }
.fx-card { width: min(94%, 460px); background: #fff8ec; border: 3px solid #8b5e3c; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 0 0 2px #f3dfbf;
  overflow: hidden; animation: fx-pop .28s cubic-bezier(.3,1.5,.5,1); }
@keyframes fx-pop { from { transform: scale(.86); opacity: 0; } }
.fx-scene { position: relative; aspect-ratio: 360 / 220; overflow: hidden; border-bottom: 3px solid #8b5e3c; }
.fx-evo .fx-scene { aspect-ratio: 360 / 240; }
.fx-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-cap { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px 2px; text-align: center; min-height: 84px; box-sizing: border-box; justify-content: center; }
.fx-title { font-size: 18px; color: #5a3a22; }
.fx-sub { font-size: 13px; color: #8a6a4e; line-height: 1.35; }
.fx-big { font-size: 34px; line-height: 1; color: #f2a516; -webkit-text-stroke: 1.5px #7a4a10; text-shadow: 0 3px 0 #7a4a10, 0 0 14px rgba(255,200,60,.8); animation: fx-bounce .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes fx-bounce { from { transform: scale(.2); } }
.fx-foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px 8px; font-size: 12px; color: #a08060; }
.fx-fast { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.fx-fast input { accent-color: #e98a2c; margin: 0; }
.fx-item { position: absolute; transform: translate(-50%, -50%); }
.fx-icon { position: relative; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.fx-item.fx-shine .fx-icon { filter: drop-shadow(0 0 3px #fff6c0) drop-shadow(0 0 9px #ffc531); }
.fx-item.fx-dim .fx-icon { filter: grayscale(.8) brightness(.55) drop-shadow(0 2px 2px rgba(0,0,0,.5)); transition: filter .3s; }
.fx-scene > i { position: absolute; border-radius: 50%; pointer-events: none; }
.fx-spark { background: #fff3b0; box-shadow: 0 0 6px 2px #ffae2a; }
.fx-ember { background: #ff9a3a; box-shadow: 0 0 5px 1px #ff6a1a; }
.fx-star { background: #ffe38a; filter: drop-shadow(0 0 4px #ffc23a); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); border-radius: 0 !important; }
.fx-star.t-violet { background: #f0e2ff; filter: drop-shadow(0 0 4px #c49bff); }
.fx-star.t-blue { background: #d8f4ff; filter: drop-shadow(0 0 4px #5ec8ff); }
.fx-star.t-gold { background: #fff0a0; filter: drop-shadow(0 0 4px #ffb81f); }
.fx-star.t-plain { background: #f5e6c8; filter: none; }
.fx-smoke { background: radial-gradient(circle, rgba(120,110,105,.85), rgba(80,72,68,0) 70%); }
.fx-smoke.v { background: radial-gradient(circle, rgba(150,120,190,.75), rgba(80,60,110,0) 70%); }
.fx-mote { background: #e9dcff; box-shadow: 0 0 8px 2px #a77bff; }
/* forge */
.fx-hammer { transform-origin: 302px 112.5px; transform: rotate(42deg); }
.fx-fl { transform-box: fill-box; transform-origin: 50% 100%; animation: fx-flick .5s ease-in-out infinite alternate; }
.fx-fl.f2 { animation-duration: .38s; animation-delay: -.2s; }
.fx-fl.f3 { animation-duration: .3s; animation-delay: -.1s; }
@keyframes fx-flick { from { transform: scale(1, 1) skewX(-3deg); } to { transform: scale(.92, 1.12) skewX(4deg); } }
.fx-coalglow, .fx-warm { animation: fx-breathe 1.4s ease-in-out infinite alternate; }
@keyframes fx-breathe { to { opacity: .35; } }
.fx-hotglow { transform-box: fill-box; transform-origin: center; }
.tone-arcane .fx-fl.f1 { fill: #6a5cff; } .tone-arcane .fx-fl.f2 { fill: #8fb8ff; } .tone-arcane .fx-fl.f3 { fill: #e6f2ff; }
.tone-arcane .fx-coalglow { fill: #6a7dff; } .tone-arcane .fx-spark { background: #e6f0ff; box-shadow: 0 0 6px 2px #7aa8ff; }
.tone-element .fx-fl.f1 { fill: #2fbf7a; } .tone-element .fx-fl.f2 { fill: #ffd34a; } .tone-element .fx-fl.f3 { fill: #ff6a6a; }
.fx-burst { position: absolute; width: 0; height: 0; }
.fx-rays { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,226,120,.75) 0 8deg, rgba(255,226,120,0) 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: fx-spin 4s linear infinite, fx-in .3s ease-out; }
.fx-glow { position: absolute; left: -48px; top: -48px; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, rgba(255,240,170,.95), rgba(255,190,60,0) 70%); animation: fx-in .3s; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.fx-crack { position: absolute; left: -32px; top: -32px; width: 64px; height: 64px; filter: drop-shadow(0 0 3px #ff2a2a); animation: fx-in .15s; }
.fx-layer.fx-bad .fx-scene::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent 40%, rgba(220,30,30,.55)); animation: fx-redflash .6s ease-out forwards; pointer-events: none; }
@keyframes fx-redflash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: .45; } }
.fx-layer.fx-bad .fx-title { color: #c4362a; }
.fx-layer.fx-warn .fx-title { color: #7a6a5e; }
.fx-forge.fx-ok .fx-title { color: #c47a0e; }
/* appraisal */
.fx-paper { transform-box: view-box; transform-origin: 180px 106px; }
.fx-candle { transform-box: fill-box; transform-origin: 50% 100%; animation: fx-flick .45s ease-in-out infinite alternate; }
.fx-scene { container-type: inline-size; }
.fx-paperbox { position: absolute; transform: translate(-50%, -50%); width: 56%; height: 62%; display: flex; flex-direction: column; align-items: center; gap: 1.2cqw; pointer-events: none; }
.fx-pname { font-size: clamp(11px, 3.6cqw, 15px); color: #5a3a22; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-plines { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 1.2cqw 1.4cqw; width: 100%; }
.fx-opt { flex: 0 0 auto; max-width: 48%; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(10px, 3.1cqw, 13px); font-weight: 700; padding: .3cqw 2cqw; border-radius: 99px; background: rgba(255,255,255,.6); border: 1px solid #d9bf8e; color: #6a4a2a; }
.fx-opt.t-blue, .fx-title.t-blue { color: #1f7fc2; } .fx-opt.t-blue { border-color: #8fcaf0; }
.fx-opt.t-violet, .fx-title.t-violet { color: #7a3fd0; } .fx-opt.t-violet { border-color: #c4a2f2; }
.fx-opt.t-gold, .fx-title.t-gold { color: #c27a00; } .fx-opt.t-gold { border-color: #f0c45a; background: rgba(255,240,190,.8); }
.fx-mag { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.fx-mag svg { width: 100%; height: 100%; display: block; }
.fx-stamp { position: absolute; padding: .6cqw 2.2cqw; border-radius: 1.4cqw; border: 3px double #d0402a; color: #d0402a; white-space: nowrap;
  font-weight: 800; font-size: clamp(10px, 3.2cqw, 14px); background: rgba(255,240,230,.4); transform: translate(-50%, -50%) rotate(-14deg); opacity: 0; letter-spacing: .02em; }
.fx-stamp.t-gold { border-color: #c98a00; color: #c98a00; } .fx-stamp.t-violet { border-color: #7a3fd0; color: #7a3fd0; } .fx-stamp.t-blue { border-color: #1f7fc2; color: #1f7fc2; }
/* pet evolution */
.fx-c1, .fx-c2, .fx-c3 { transform-box: view-box; transform-origin: 0 0; }
.fx-c1 { animation: fx-spin 18s linear infinite; } .fx-c2 { animation: fx-spin 12s linear infinite reverse; } .fx-c3 { animation: fx-spin 7s linear infinite; }
.fx-charge .fx-c1 { animation-duration: 3s; } .fx-charge .fx-c2 { animation-duration: 2s; } .fx-charge .fx-c3 { animation-duration: 1.2s; }
.fx-stars circle { animation: fx-twinkle 2.4s ease-in-out infinite alternate; }
@keyframes fx-twinkle { to { opacity: .2; } }
.fx-floorglow { animation: fx-breathe 1.2s ease-in-out infinite alternate; }
.fx-charge .fx-floorglow { animation-duration: .35s; }
.fx-pillar { opacity: 0; transform-box: view-box; transform-origin: 180px 0; }
.fx-pet { animation: fx-float 2s ease-in-out infinite alternate; }
@keyframes fx-float { from { margin-top: -3px; } to { margin-top: 5px; } }
.fx-charge .fx-pet .fx-icon { animation: fx-throb .3s ease-in-out infinite alternate; }
@keyframes fx-throb { to { filter: brightness(1.8) drop-shadow(0 0 10px #c9a0ff); } }
.fx-orb { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e4d2ff 30%, #a77bff 65%, #5a2fc0); box-shadow: 0 0 18px 4px rgba(185,140,255,.7); }
.fx-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fx-evo.fx-bad .fx-c1, .fx-evo.fx-bad .fx-c2, .fx-evo.fx-bad .fx-c3 { animation-play-state: paused; opacity: .35; transition: opacity .6s; }
.fx-evo.fx-ok .fx-title { font-size: 20px; }
@media (prefers-reduced-motion: reduce) { .fx-rays, .fx-c1, .fx-c2, .fx-c3, .fx-fl, .fx-stars circle { animation: none !important; } }

/* ---- 3-digit levels (cap 310 since phase 43): the HUD's level digits squeeze a little so "310" stays on its badge */
#hud-self > span:has(> i:nth-child(3)) { transform: scaleX(.8); transform-origin: left center; }

/* ---- footprints & auras window (fixes.js, phase 59): Game menu → รอยเท้า & ออร่า. Built on the build's .win, so the
   theme dresses the frame / title / close button; the list inside is ours. */
#win-sdfoot { --sdf-ink: #3b2d20; --sdf-soft: #8a6a4e; --sdf-line: #e6cfae; --sdf-card: #fffdf8; --sdf-ok: #3d8f4a; --sdf-bad: #c8483f; --sdf-gold: #e0a019; }
#win-sdfoot .sdf-body { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; max-height: min(64vh, 560px); max-height: min(64dvh, 560px); color: var(--sdf-ink); }
#win-sdfoot .sdf-body > * { flex-shrink: 0; } /* the list scrolls; the tabs / wallet keep their height */
#win-sdfoot .sdf-tabs { display: flex; gap: 6px; }
#win-sdfoot .sdf-tabs .tab { flex: 1 1 0; }
#win-sdfoot .sdf-tabs small { opacity: .7; margin-left: 3px; }
#win-sdfoot .sdf-wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: #f6e7cf; }
#win-sdfoot .sdf-wallet > span:not(.sdf-hint) { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
#win-sdfoot .sdf-hint { margin-left: auto; font-size: 11px; color: var(--sdf-soft); }
#win-sdfoot .sdf-g { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; font: 700 9px/1 system-ui, sans-serif; font-style: normal; color: #6b4300; background: linear-gradient(#ffe48a, #f0b53a); box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
#win-sdfoot .sdf-g.fc { color: #fff; background: linear-gradient(#7fd0ff, #2f8fd8); }
#win-sdfoot .sdf-note { padding: 6px 10px; border-radius: 10px; background: #e5f5e2; color: #2f6f37; font-size: 13px; animation: sdf-in .25s ease-out; }
#win-sdfoot .sdf-list { display: flex; flex-direction: column; gap: 7px; }
#win-sdfoot .sdf-card { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--sdf-line); border-radius: 12px; background: var(--sdf-card); }
#win-sdfoot .sdf-card.own { border-color: #d6b98e; }
#win-sdfoot .sdf-card.wearing { border-color: var(--sdf-gold); background: linear-gradient(90deg, #fff4d6, var(--sdf-card) 60%); box-shadow: 0 0 0 2px rgba(240, 181, 58, .25); }
#win-sdfoot .sdf-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#win-sdfoot .sdf-name { font-weight: 700; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
#win-sdfoot .sdf-desc { font-size: 12px; color: var(--sdf-soft); line-height: 1.3; }
#win-sdfoot .sdf-tag { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: #efe1c9; color: #7a5a3a; }
#win-sdfoot .sdf-tag.on { background: var(--sdf-gold); color: #fff; }
#win-sdfoot .sdf-tag.own { background: #dff0dc; color: #2f6f37; }
#win-sdfoot .sdf-tag.time { background: #e3eefc; color: #2b5d9b; }
#win-sdfoot .sdf-stats { display: flex; flex-wrap: wrap; gap: 4px; }
#win-sdfoot .sdf-stats > span { font-size: 11px; padding: 1px 7px; border-radius: 8px; background: #fbe9e2; color: #a2462c; font-weight: 600; }
#win-sdfoot .sdf-cost { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 1px; }
#win-sdfoot .center { justify-content: center; }
#win-sdfoot .sdf-c { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 7px 2px 3px; border-radius: 9px; background: #f3e8d6; color: var(--sdf-ink); max-width: 100%; }
#win-sdfoot .sdf-c b { color: var(--sdf-ok); }
#win-sdfoot .sdf-c.lack, #win-sdfoot .sdf-c.lack b { color: var(--sdf-bad); }
#win-sdfoot .sdf-c.free { padding-left: 7px; color: var(--sdf-ok); font-weight: 700; }
#win-sdfoot .sdf-c.lv { padding-left: 7px; }
#win-sdfoot .sdf-in { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
#win-sdfoot .sdf-ico { flex: none; width: 32px; height: 32px; margin: -6px -4px -6px -6px; background-repeat: no-repeat; transform: scale(.62); }
#win-sdfoot .sdf-ico.none { background: #e2d2b8; border-radius: 6px; }
#win-sdfoot .sdf-act { display: flex; flex-direction: column; gap: 5px; align-items: stretch; min-width: 68px; }
#win-sdfoot .sdf-act .btn { white-space: nowrap; }
#win-sdfoot .sdf-buy:disabled { opacity: .5; filter: grayscale(.6); }
#win-sdfoot .sdf-empty { padding: 26px 10px; text-align: center; color: var(--sdf-soft); }
#win-sdfoot .sdf-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; padding: 6px 10px 8px; font-size: 12px; color: var(--sdf-soft); }
#win-sdfoot .sdf-chk { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
/* the effect's little picture: a round badge in its two colours, the glyph breathing */
.sdf-prev { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 50% 62%, var(--c2) 0%, var(--c1) 58%, color-mix(in srgb, var(--c1) 55%, #000) 100%);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--c1) 45%, transparent), 0 4px 10px color-mix(in srgb, var(--c1) 45%, transparent); }
.sdf-prev svg { width: 58%; height: 58%; fill: currentColor; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); animation: sdf-breathe 2.4s ease-in-out infinite; }
.sdf-prev::after { content: ''; position: absolute; inset: -30%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,255,255,.55) 80%, transparent 90%); animation: sdf-spin 3.2s linear infinite; mix-blend-mode: overlay; }
.sdf-prev.fx-rainbow { background: conic-gradient(#ff5a5a, #ffd34a, #6fe36f, #5ad1ff, #9a7bff, #ff5ab4, #ff5a5a); }
.sdf-prev.fx-shadow { color: #d9b8ff; }
.sdf-prev.fx-none, .sdf-prev.fx-basic { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e6cfae; }
.sdf-prev.fx-none::after, .sdf-prev.fx-basic::after { display: none; }
.sdf-prev.big { width: 76px; height: 76px; margin: 0 auto 4px; }
.sdf-prev.mini { width: 30px; height: 30px; }
@keyframes sdf-breathe { 50% { transform: scale(1.12) translateY(-1px); } }
@keyframes sdf-spin { to { transform: rotate(1turn); } }
@keyframes sdf-in { from { opacity: 0; transform: translateY(-4px); } }
#win-sdfoot .sdf-ask { position: absolute; inset: 0; z-index: 5; border-radius: inherit; display: grid; place-items: center; padding: 12px; background: rgba(59, 45, 32, .45); backdrop-filter: blur(1.5px); animation: sdf-in .18s ease-out; }
#win-sdfoot .sdf-askbox { width: min(100%, 320px); display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: center; padding: 14px; border-radius: 14px; background: #fffaf1; border: 3px solid #8b5e3c; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
#win-sdfoot .sdf-row { display: flex; gap: 8px; justify-content: center; }
#win-sdfoot .sdf-row .btn { flex: 1 1 0; }
/* phase 75: aura tiers 1–6 — stars on the card, the tier line, the upgrade button and its box; the badge glows more
   with the tier (fixes.js __sdFoot: TIER_TXT, stars, upHtml) */
#win-sdfoot .sdf-tier { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 11px; color: #8a5a2b; font-weight: 600; }
.sdf-stars { display: inline-flex; gap: 1px; font-size: 13px; line-height: 1; }
.sdf-stars i { font-style: normal; color: #dccbb0; text-shadow: 0 1px 0 #fff; }
.sdf-stars i.on { color: #ffb820; text-shadow: 0 0 4px rgba(255, 190, 40, .7), 0 1px 0 #8a5300; }
.sdf-stars.t5 i.on { color: #ff8a3a; text-shadow: 0 0 5px rgba(255, 138, 58, .75), 0 1px 0 #7a3300; }
.sdf-stars.t6 i.on { color: #ff6ad5; text-shadow: 0 0 6px rgba(255, 106, 213, .85), 0 1px 0 #7a1d5f; animation: sdf-twink 1.6s ease-in-out infinite; }
@keyframes sdf-twink { 50% { filter: brightness(1.35); } }
#win-sdfoot .sdf-tag.max { background: linear-gradient(90deg, #ff6ad5, #ffb820); color: #fff; }
html body #win-sdfoot .sdf-act .btn.sdf-upb { background: linear-gradient(#ffe07a, #f5a623) !important; color: #5a2f00 !important; border: 2px solid #b8650a !important; box-shadow: 0 2px 0 #9a5208, inset 0 1px 0 rgba(255,255,255,.6) !important; font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,.5); } /* the theme paints .btn with !important */
html body #win-sdfoot .sdf-act .btn.sdf-upb.lack { filter: saturate(.45); opacity: .8; }
#win-sdfoot .sdf-card.tier4 > .sdf-prev, #win-sdfoot .sdf-card.tier5 > .sdf-prev { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ffc23a, 0 0 12px rgba(255, 190, 40, .75); }
#win-sdfoot .sdf-card.tier6 > .sdf-prev { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff6ad5, 0 0 16px rgba(255, 106, 213, .85); }
#win-sdfoot .sdf-upbox { width: min(100%, 360px); }
#win-sdfoot .sdf-upline { display: flex; justify-content: center; align-items: center; gap: 8px; }
#win-sdfoot .sdf-upline .sdf-stars { font-size: 15px; }
#win-sdfoot .sdf-arrow { color: #c0782a; font-weight: 700; }
#win-sdfoot .sdf-upfx { font-size: 12px; color: #8a5a2b; font-weight: 600; }
#win-sdfoot .sdf-upstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; }
#win-sdfoot .sdf-upstats > div { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 10px; background: #f6ecdc; }
#win-sdfoot .sdf-upstats > div.nx { background: #fff0cf; box-shadow: inset 0 0 0 1.5px #ffc23a; }
#win-sdfoot .sdf-upstats small { font-size: 10px; color: var(--sdf-soft); font-weight: 700; }
#win-sdfoot .sdf-upstats span { font-size: 11px; font-weight: 600; color: #a2462c; }
#win-sdfoot .sdf-upstats .nx span { color: #2f7a1f; }
#win-sdfoot .sdf-uplack { font-size: 12px; color: var(--sdf-bad); font-weight: 600; }
html body #win-sdfoot .sdf-row .btn.sdf-upgo { background: linear-gradient(#ffe07a, #f5a623) !important; color: #5a2f00 !important; border: 2px solid #b8650a !important; box-shadow: 0 2px 0 #9a5208, inset 0 1px 0 rgba(255,255,255,.6) !important; font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
html body #win-sdfoot .sdf-row .btn.sdf-upgo:disabled { opacity: .5; filter: grayscale(.6); }
/* phase 75: the mail button (#btn-mailnote, the build's dark round with a line envelope) drawn — img/mail.svg, the
   theme's cream round button with a pink envelope and a heart seal; the unread count stays on it */
html body #hud #btn-mailnote.mail-note { background: url(img/mail.svg) center / 100% 100% no-repeat !important; border: 0 !important; box-shadow: none !important; width: 36px; height: 36px; transition: transform .15s; }
html body #hud #btn-mailnote.mail-note > svg.ico { display: none !important; }
html body #hud #btn-mailnote.mail-note:hover { transform: scale(1.08) rotate(-4deg); }
html body #hud #btn-mailnote.mail-note .mn-count { z-index: 1; }
.sdf-pill { position: fixed; left: 50%; top: max(64px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 9000; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 22px;
  background: rgba(255, 250, 241, .96); border: 2px solid #8b5e3c; color: #3b2d20; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.3); animation: sdf-in .2s ease-out; max-width: calc(100vw - 24px); }
@media (max-width: 520px) {
  #win-sdfoot .sdf-card { grid-template-columns: 44px 1fr; }
  #win-sdfoot .sdf-card > .sdf-prev { width: 44px; height: 44px; }
  #win-sdfoot .sdf-act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  #win-sdfoot .sdf-hint { margin-left: 0; flex-basis: 100%; }
}

/* the character creation screen's look step (phase 61, fixes.js __sdCc): style tiles, colour swatches, face tiles and
   chips, random and camera buttons — in place of the build's two arrows (hidden). The build's tokens, so a theme
   recolours it. */
.cc-panel.sdcc-on .cc-step .cc-stepper { display: none !important; }
.sdcc { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 8px; }
.sdcc-tools { display: flex; align-items: center; gap: 8px; }
.sdcc-tools .sdcc-rand { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px !important; white-space: nowrap; }
.sdcc-tools .sdcc-rand svg { width: 18px; height: 18px; color: var(--co-or, #f5841c); flex: none; }
.sdcc-tools .sdcc-cam { flex: 1; margin: 0; }
.sdcc-tools .sdcc-cam .seg-btn { min-height: 36px; font-size: var(--fs-sm); }
.sdcc-sec { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 10px 10px; box-shadow: 0 2px 0 var(--line); }
.sdcc-sec > header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 26px; }
.sdcc-sec > header b { font-weight: 700; color: var(--ink); }
.sdcc-sec > header b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--co-sky, var(--sky-500)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--co-sky, #38b4ea) 30%, transparent); }
.sdcc-cur { flex: 1; text-align: right; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdcc-arr { display: inline-flex; gap: 4px; }
.sdcc-arr button { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 700 18px/1 system-ui, sans-serif; padding: 0 0 2px; cursor: pointer; }
.sdcc-arr button:hover { background: var(--sky-100); color: var(--ink); }
.sdcc-grid { display: grid; gap: 6px; }
.sdcc-hair { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sdcc-faces { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sdcc-special { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sdcc-tile, .sdcc-face, .sdcc-chip, .sdcc-sw { cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s, background .15s; }
.sdcc-tile { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--line); background: radial-gradient(circle at 50% 35%, #fff, var(--surface)); padding: 3px 3px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sdcc-tile svg { width: 78%; height: auto; flex: 1; min-height: 0; filter: drop-shadow(0 1px 0 #0000001f); }
.sdcc-tile span { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sdcc-face { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line); background: radial-gradient(circle at 50% 35%, #fff, #ffe9d4); color: var(--ink-2); font-weight: 700; font-size: var(--fs-md); }
.sdcc-chip { min-height: 32px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdcc-tile:hover, .sdcc-face:hover, .sdcc-chip:hover { border-color: var(--sky-300); transform: translateY(-1px); }
:is(.sdcc-tile, .sdcc-face, .sdcc-chip).on { border-color: var(--co-sky, var(--sky-500)); background: color-mix(in srgb, var(--co-sky, #38b4ea) 14%, var(--card)); color: var(--co-sky-ink, var(--ink)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--co-sky, #38b4ea) 35%, transparent); }
.sdcc-tile.on span { color: var(--co-sky-d, var(--sky-700)); }
.sdcc-subhead { margin: 8px 0 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.sdcc-subhead::after { content: ""; flex: 1; border-top: 2px dashed var(--line); }
.sdcc-swatches { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
.sdcc-sw { aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; background: none; display: grid; place-items: center; }
.sdcc-sw i { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffffffa6 0 18%, transparent 42%), var(--sc, #888); box-shadow: inset 0 -2px 0 #0000002e, 0 0 0 1.5px #0000003d; }
.sdcc-sw.own i { outline: 2px dashed #ffffffd9; outline-offset: -6px; }
.sdcc-sw:hover i { transform: scale(1.08); }
.sdcc-sw.on i { box-shadow: inset 0 -2px 0 #0000002e, 0 0 0 2px #fff, 0 0 0 4px var(--co-sky, var(--sky-500)); }
.sdcc-sw:disabled { cursor: not-allowed; opacity: .35; }
@media (max-width: 560px), (max-height: 560px) {
  .sdcc-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sdcc-special { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 520px) {
  .sdcc { gap: 6px; margin-bottom: 4px; }
  .sdcc-sec { padding: 6px 8px 8px; }
  .sdcc-sec > header { margin-bottom: 6px; }
  .sdcc-tools .sdcc-rand, .sdcc-tools .sdcc-cam .seg-btn { min-height: 32px; }
}

/* PC: the number bar (1–0, #hotbar-1) sits above the F1–F10 bar (#hotbar-2) — the build stacks F on top. Each bar can
   still be dragged anywhere with the menu's "จัดหน้าจอ" (layout parts hotNum / hotF, detachable). Phase 64c. */
body:not(.touch) #hotbars > #hotbar-1 { order: -1; }

/* PC: the footprints & auras window's own button on the right, under the events column (fixes.js #sd-rdock, phase
   64d) — our icon (img/aura.png: two footprints in a golden magic circle) floating like the menu's icons, a soft aura
   glow turning behind it in the worn aura's colours, two twinkles, and the menu's label pill. Phones keep the entry in
   the Game menu; on a PC it leaves the Game menu. */
#sd-rdock { position: absolute; right: 12px; top: 330px; z-index: 5; /* under the menu panel (6) */ display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
#sd-rdock > * { pointer-events: auto; }
body.touch #sd-rdock { display: none; }
body:not(.touch) #hud-game .sdf-btn { display: none; }
/* phase 77: our own pictures (aura, boss hunt, fashion shop, buddy) without the theme's round badge — the picture alone,
   as the theme draws its own icons (the user's ask: "เอาอันกลมๆ นี้ออก" for the Game menu and the minimap column) */
html body #hud-game .mbtn:is(.sdf-btn, .sdb-mbtn, .sds-mbtn, .sdy-mbtn) .mbtn-ico { background: none !important; border-radius: 0 !important; width: 40px !important; height: 40px !important; }
html body #hud-game .mbtn:is(.sds-mbtn, .sdy-mbtn) .mbtn-ico img, html body #hud-game .sdb-mbtn .mbtn-ico .sdb-mark { width: 40px; height: 40px; filter: drop-shadow(0 1px 1.5px rgba(40, 24, 10, .55)); }
html body #hud #hud-map .hud-ibtn:is(.sdb-ibtn, .sds-ibtn, .sdy-ibtn) { background: none !important; border: 0 !important; }
html body #hud #hud-map .hud-ibtn:is(.sds-ibtn, .sdy-ibtn) img, html body #hud #hud-map .sdb-ibtn .sdb-dico { width: 32px; height: 32px; filter: drop-shadow(0 1px 1.5px rgba(40, 24, 10, .55)); }
/* phase 76: on the left edge, in the Game button's column just above it (fixes.js dockHome) — the column places it */
#hud-edge > #sd-rdock { position: static; margin: 0 0 14px; align-self: center; }
.sd-aura-btn { --a1: #b06cff; --a2: #ff9fe0; position: relative; width: 62px; height: 62px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; transition: transform .15s ease; }
.sd-aura-btn:hover { transform: translateY(-2px) scale(1.07); }
.sd-aura-btn:active { transform: scale(.94); }
.sd-aura-btn .sda-ring { position: absolute; inset: 6px; border-radius: 50%; background: conic-gradient(from 0deg, var(--a1), var(--a2), #fff2a8, var(--a2), var(--a1)); filter: blur(7px); opacity: .6; animation: sda-spin 6s linear infinite; }
.sd-aura-btn:hover .sda-ring { opacity: .9; animation-duration: 2.2s; }
.sd-aura-btn .sda-ico { position: relative; width: 56px; height: 56px; background: url(img/aura.png) center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(40, 24, 10, .5)); animation: sda-bob 3.2s ease-in-out infinite; }
.sd-aura-btn .sda-spark { position: absolute; width: 8px; height: 8px; background: #fffbe0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 3px var(--a2)); animation: sda-twinkle 2.4s ease-in-out infinite; }
.sd-aura-btn .sda-spark.s1 { top: 18px; left: 4px; }
.sd-aura-btn .sda-spark.s2 { top: 40px; right: 2px; width: 6px; height: 6px; animation-delay: 1.2s; }
.sd-aura-btn small { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); white-space: nowrap; padding: 1px 7px 0; border-radius: 7px; font-size: 11px; line-height: 15px;
  color: #fff4e0; background: rgba(52, 36, 22, .72); }
.sd-aura-btn.worn small::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 4px; vertical-align: 1px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--a1)); box-shadow: 0 0 4px var(--a1); }
@keyframes sda-spin { to { transform: rotate(360deg); } }
@keyframes sda-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes sda-twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .sd-aura-btn .sda-ring, .sd-aura-btn .sda-ico, .sd-aura-btn .sda-spark { animation: none; } }
#win-sdfoot .sdf-head-ico { flex: none; width: 30px; height: 30px; margin: -4px 2px -4px 0; background: center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(40, 24, 10, .4)); } /* phase 64d: our drawn icon in the head */
#hud-game .sdf-btn .sdf-mico { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(40, 24, 10, .45)); pointer-events: none; } /* phase 64d */

/* ---- the character window, laid out anew on a PC (fixes.js __sdChar, phase 64f): equipment left, the character in
   the middle, stat tabs right, side tabs on the right edge. Only #win-char.sdc (the class is added on a PC only). */
#win-char.sdc { --win-w: 900px !important; width: min(900px, calc(100vw - 72px)) !important; max-width: none !important; overflow: visible !important; }
#win-ability.sdc-merged { display: none !important; }
#win-char.sdc .sdc-old { display: none !important; }
#win-char.sdc #char-body { overflow: visible !important; padding: 10px 12px 12px !important; }
#win-char.sdc .sdc-grid { display: grid; grid-template-columns: 148px 252px minmax(0, 1fr); gap: 12px; height: min(540px, calc(100vh - 140px)); min-height: 380px; }
#win-char.sdc .sdc-col { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
#win-char.sdc :is(.sdc-left, .sdc-right, .sdc-plate) { border-radius: 14px; background: linear-gradient(#fbfaf7, #ece8e0); border: 1.5px solid #d5cfc4; box-shadow: inset 0 1px 0 #fff; }
/* the window's name in a ribbon between two little wings (our Meta AI drawing, split in halves) */
#win-char.sdc .win-head { justify-content: center; position: relative; }
#win-char.sdc .win-head > svg { display: none; }
#win-char.sdc .win-head .win-close { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
#win-char.sdc .win-title { position: relative; overflow: visible !important; margin: 0 auto; padding: 2px 22px !important; border-radius: 99px; background: linear-gradient(#ffffffd0, #ffffff50) !important; }
#win-char.sdc .win-title::before, #win-char.sdc .win-title::after { content: ""; position: absolute; top: 50%; width: 42px; height: 42px; transform: translateY(-50%); background: url(img/wings.png) 0 50% / 84px 84px no-repeat; pointer-events: none; }
#win-char.sdc .win-title::before { right: calc(100% - 6px); }
#win-char.sdc .win-title::after { left: calc(100% - 6px); background-position: 100% 50%; }

/* ---- left: equipment / costume as round slots in two columns */
#win-char.sdc .sdc-left { padding: 8px 6px; overflow: auto; }
#win-char.sdc .sdc-left[data-side="equip"] .sdc-lpane[data-side="cos"], #win-char.sdc .sdc-left[data-side="cos"] .sdc-lpane[data-side="equip"] { display: none; }
#win-char.sdc .sdc-lpane > h4 { margin: 0 auto 8px !important; padding: 3px 12px !important; width: max-content; max-width: 100%; border-radius: 99px; background: linear-gradient(#7cc8f8, #2f8fdc); color: #fff !important; font-size: 12px !important; text-shadow: 0 1px 0 #1b5c98; border: 1.5px solid #1b5c98; }
#win-char.sdc .sdc-lpane > h4::before, #win-char.sdc .sdc-lpane > h4::after { display: none !important; }
#win-char.sdc .sdc-left :is(.char-equip, .cos-grid) { display: grid !important; grid-template-columns: repeat(2, 50px) !important; gap: 6px 10px !important; justify-content: center; margin: 0 !important; }
#win-char.sdc .sdc-left :is(.eq-cell, .eq-lock) { position: relative; width: 50px !important; height: 50px !important; margin: 0 !important; padding: 0 !important; display: grid !important; place-items: center; }
#win-char.sdc .sdc-left :is(.eq-cell, .eq-lock) > .slot { width: 50px !important; height: 50px !important; border-radius: 50% !important; overflow: hidden;
  background: radial-gradient(circle at 35% 28%, #ffffff, #ebe7e0 58%, #cfc8bc) !important; border: 2px solid #b9b1a4 !important; box-shadow: inset 0 2px 5px #00000026, 0 2px 3px #00000026 !important; }
#win-char.sdc .sdc-left .eq-cell.filled > .slot { background: radial-gradient(circle at 35% 28%, #ffffff, #dff1fb 58%, #a9d4ef) !important; border-color: #5fa8dc !important; }
#win-char.sdc .sdc-left .eq-cell > .eq-name { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; text-align: center; font-size: 10px !important; line-height: 1.05; color: #9a9184 !important; pointer-events: none; margin: 0 !important; background: none !important; }
#win-char.sdc .sdc-left .eq-cell.filled > .eq-name { display: none; }
#win-char.sdc .sdc-left .eq-lock > .eq-name { display: none; }
#win-char.sdc .sdc-left .char-costume { display: flex; flex-direction: column; gap: 8px; }
#win-char.sdc .sdc-left .cos-closet { display: flex; flex-direction: column; gap: 4px; }
#win-char.sdc .sdc-left .cos-view { display: flex !important; flex-direction: column; gap: 3px; padding: 4px !important; border-radius: 12px !important; height: auto !important; }
#win-char.sdc .sdc-left .cos-view .seg-btn { width: 100%; min-height: 26px; border-radius: 9px !important; font-size: 12px; }
/* the three closet buttons: the build draws them from a picture with the words in it (cut off in a narrow column) —
   here they are our own pills with the words written out (phase 64h) */
#win-char.sdc .sdc-left .cos-closet .men-wrap { position: relative !important; width: 100% !important; height: 30px !important; }
#win-char.sdc .sdc-left .cos-closet .men { position: static !important; width: 100% !important; height: 30px !important; transform: none !important; }
#win-char.sdc .sdc-left .cos-closet .men-button { position: relative !important; inset: auto !important; width: 100% !important; height: 30px !important; transform: none !important;
  background: linear-gradient(#9ad8ff, #4aa9ec 55%, #2b86d6) !important; border: 1.5px solid #1b5c98 !important; border-radius: 99px !important; box-shadow: inset 0 1px 0 #ffffff80, 0 1px 2px #00000033 !important;
  display: flex !important; align-items: center; gap: 4px; padding: 0 8px 0 4px !important; cursor: pointer; overflow: hidden; }
#win-char.sdc .sdc-left .cos-closet .cos-closet-fav .men-button { background: linear-gradient(#ffd08f, #f6a04a 55%, #ef7f1d) !important; border-color: #b85b10 !important; }
#win-char.sdc .sdc-left .cos-closet .men-button::before { content: ""; flex: none; width: 22px; height: 22px; background: url(img/costume.png) center / contain no-repeat; filter: drop-shadow(0 1px 1px #0005); }
#win-char.sdc .sdc-left .cos-closet .men-button::after { flex: 1; min-width: 0; text-align: left; color: #fff; font-size: 11px; font-weight: 800; line-height: 1.1; text-shadow: 0 1px 0 #0006; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-char.sdc .sdc-left .cos-closet .cos-closet-fav .men-button::after { content: "ตู้ชุดที่ชอบใส่"; }
#win-char.sdc .sdc-left .cos-closet .cos-closet-piece .men-button::after { content: "ตู้ชุดแยกส่วน"; }
#win-char.sdc .sdc-left .cos-closet .cos-closet-one .men-button::after { content: "ตู้ชุดชิ้นเดียว"; }
#win-char.sdc .sdc-left .cos-closet .men-button:hover { filter: brightness(1.07); }
#win-char.sdc .sdc-left .cos-hint { font-size: 10px; line-height: 1.3; margin: 0; }

/* ---- middle: the character tall, then the name plate */
#win-char.sdc .sdc-mid .char-preview { flex: 1 1 auto; height: auto !important; min-height: 240px; margin: 0 !important; border-radius: 16px; border: 1.5px solid #c9d8e2;
  background: radial-gradient(ellipse 60% 14% at 50% 88%, #ffffffe0, #ffffff00), linear-gradient(#cfe9f8, #eef8fe 55%, #dde9f0) !important; box-shadow: inset 0 0 0 3px #ffffffa8; }
#win-char.sdc .sdc-mid .char-preview > canvas { inset: 0 !important; width: 100% !important; height: 100% !important; }
#win-char.sdc .sdc-plate { padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#win-char.sdc .sdc-plate .char-top { display: flex !important; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; width: 100%; margin: 0 !important; }
#win-char.sdc .sdc-plate .char-who { text-align: center; min-width: 0; flex: 1 1 calc(100% - 64px); }
#win-char.sdc .sdc-plate .char-who :is(b, small) { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
#win-char.sdc .sdc-plate .char-who b { display: block; font-size: 16px; }
#win-char.sdc .sdc-plate .char-extra { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 0 !important; }
#win-char.sdc .sdc-plate .char-guarder-btn { width: 100%; }

/* ---- right: tabs and panes */
#win-char.sdc .sdc-right { padding: 8px 10px; }
#win-char.sdc .sdc-tabs { display: flex; gap: 6px; flex: none; }
#win-char.sdc .sdc-tab { flex: 1 1 0; height: 32px; border-radius: 99px; border: 1.5px solid #c7c0b5; background: linear-gradient(#ffffff, #e6e1d8); font: inherit; font-weight: 800; font-size: 13px; color: #5e5a54; cursor: pointer; box-shadow: inset 0 1px 0 #fff, 0 1px 2px #0000001f; }
#win-char.sdc .sdc-tab:hover { filter: brightness(1.04); }
#win-char.sdc .sdc-tab.on { background: linear-gradient(#7cc8f8, #2f8fdc); color: #fff; border-color: #1b5c98; text-shadow: 0 1px 0 #1b5c98; }
#win-char.sdc .sdc-pane { display: none; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 2px 4px 2px 0; }
#win-char.sdc .sdc-right[data-tab="stats"] .sdc-pane[data-p="stats"], #win-char.sdc .sdc-right[data-tab="ability"] .sdc-pane[data-p="ability"], #win-char.sdc .sdc-right[data-tab="other"] .sdc-pane[data-p="other"] { display: block; }
#win-char.sdc .sdc-pane .char-bars { display: flex !important; flex-direction: column; gap: 6px; margin: 2px 0 10px !important; }
#win-char.sdc .sdc-pane .char-bar { display: grid !important; grid-template-columns: 38px 1fr; align-items: center; gap: 6px; }
#win-char.sdc .sdc-pane .char-bar > span { font-weight: 800; font-size: 12px; color: #5e5a54; }
#win-char.sdc .sdc-pane .char-bar .bar { height: 18px !important; border-radius: 99px !important; }
#win-char.sdc .sdc-pane .char-stats { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
#win-char.sdc .sdc-pane .char-stats > .stat { border-radius: 99px !important; background: linear-gradient(#ebe8e2, #dad5cc) !important; border: 1px solid #c6bfb3 !important; min-height: 34px; padding: 4px 10px !important; margin: 0 !important; }
#win-char.sdc .sdc-pane .char-stats > .stat .stat-name { font-weight: 800; color: #5e5a54; }
#win-char.sdc .sdc-pane .char-stats > .stat .stat-v { font-size: 15px; color: #383633; }
/* while planning points the controls need the whole width */
#win-char.sdc .sdc-pane:has(.stat-plan:not([hidden])) .char-stats { grid-template-columns: 1fr; }
#win-char.sdc .sdc-pane :is(.stat-head, h4) { margin: 10px 0 6px !important; }
#win-char.sdc .sdc-pane .stat-reset { margin-top: 8px; display: flex; justify-content: center; }
#win-char.sdc .sdc-pane[data-p="ability"] > * { width: 100% !important; }

/* ---- side tabs on the right edge (outside the window, like tabs of a binder) */
#win-char.sdc .sdc-side { position: absolute; top: 58px; left: calc(100% - 2px); display: flex; flex-direction: column; gap: 6px; }
#win-char.sdc .sdc-side > button { width: 54px; height: 64px; padding: 4px 2px; border-radius: 0 12px 12px 0; border: 1.5px solid #b9b1a4; border-left: 0; cursor: pointer;
  background: linear-gradient(90deg, #ddd8ce, #fbfaf7 40%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font: inherit; font-size: 10px; font-weight: 800; color: #5e5a54; box-shadow: 2px 2px 5px #00000030; }
#win-char.sdc .sdc-side > button:hover { filter: brightness(1.05); }
#win-char.sdc .sdc-side > button.on { background: linear-gradient(90deg, #b9e0f8, #ffffff 45%); color: #1b5c98; border-color: #5fa8dc; }
#win-char.sdc .sdc-side > button img { width: 32px; height: 32px; object-fit: contain; filter: drop-shadow(0 1px 1px #0000004d); }
/* smaller screens: the same layout, smaller */
@media (max-width: 1000px) { #win-char.sdc .sdc-grid { grid-template-columns: 128px 200px minmax(0, 1fr); gap: 8px; }
  #win-char.sdc .sdc-left :is(.char-equip, .cos-grid) { grid-template-columns: repeat(2, 44px) !important; gap: 6px 8px !important; }
  #win-char.sdc .sdc-left :is(.eq-cell, .eq-lock), #win-char.sdc .sdc-left :is(.eq-cell, .eq-lock) > .slot { width: 44px !important; height: 44px !important; }
  #win-char.sdc .sdc-left .eq-cell > .eq-name { font-size: 9px !important; padding: 4px; }
  #win-char.sdc .sdc-pane .char-stats { grid-template-columns: 1fr; } }
@media (max-width: 760px) { #win-char.sdc .sdc-grid { grid-template-columns: 112px 150px minmax(0, 1fr); gap: 6px; } #win-char.sdc .sdc-mid .char-preview { min-height: 160px; } }
@media (max-height: 640px) { #win-char.sdc .sdc-grid { min-height: 320px; } }

/* ---- phase 67: the boss hunt window "ล่าบอส" (fixes.js __sdBoss) — a list of bosses, the boss in 3D, rewards + story,
   its timetable and the way there; the bar while a boss is up on your map; the result */
#win-sdboss { --b-ink: #3b2d20; --b-soft: #8a6a4e; --b-line: #e6cfae; --b-card: #fffdf8; --b-red: #d2463a; --b-gold: #e0a019; --win-w: 1060px; width: min(1060px, calc(100vw - 16px)); }
#win-sdboss .win-head { gap: 6px; }
#win-sdboss .sdb-head-ico { width: 26px; height: 26px; display: inline-grid; place-items: center; margin-right: 2px; }
.sdb-mark { display: inline-grid; place-items: center; width: 100%; height: 100%; object-fit: contain; }
.sdb-mark svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px rgba(60, 30, 10, .35)); }
#win-sdboss .sdb-body { display: grid; grid-template-columns: 250px minmax(300px, 1fr) 300px; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px 10px; height: min(600px, calc(100dvh - 170px)); min-height: 380px; color: var(--b-ink); overflow: hidden; }
/* left: tabs + the list */
#win-sdboss .sdb-left { display: flex; flex-direction: column; min-height: 0; gap: 6px; grid-row: 1 / 3; }
#win-sdboss .sdb-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: #f1e2c8; box-shadow: inset 0 1px 2px rgba(90, 60, 30, .18); }
#win-sdboss .sdb-tab { flex: 1 1 0; position: relative; border: 0; border-radius: 9px; padding: 7px 4px; font: inherit; font-weight: 700; font-size: 14px; color: var(--b-soft); background: transparent; cursor: pointer; }
#win-sdboss .sdb-tab.active { color: #fff; background: linear-gradient(180deg, #c8754a, #a2502c); box-shadow: 0 2px 0 #7a3a1c, inset 0 1px 0 rgba(255, 255, 255, .35); text-shadow: 0 1px 0 rgba(80, 30, 10, .5); }
#win-sdboss .sdb-dot { position: absolute; top: -4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-style: normal; font-size: 11px; line-height: 16px; color: #fff; background: var(--b-red); box-shadow: 0 0 0 2px #fff; animation: sdb-pulse 1.4s ease-in-out infinite; }
#win-sdboss .sdb-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 4px; }
#win-sdboss .sdb-card { display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px; border: 2px solid var(--b-line); border-radius: 12px; background: var(--b-card); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
#win-sdboss .sdb-card:hover { transform: translateX(2px); border-color: #d9b483; }
#win-sdboss .sdb-card.sel { border-color: #c8754a; background: linear-gradient(90deg, #fff1df, #fffaf2); box-shadow: 0 0 0 2px rgba(200, 117, 74, .25), 0 3px 8px rgba(120, 70, 30, .18); }
#win-sdboss .sdb-card.up { border-color: #e2685b; }
#win-sdboss .sdb-card.up .sdb-pic { box-shadow: 0 0 0 2px #e2685b, 0 0 10px rgba(226, 104, 91, .7); }
.sdb-pic { flex: 0 0 auto; width: 58px; height: 58px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, #5b4a78, #241a33 72%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.sdb-pic img { width: 100%; height: 100%; object-fit: cover; }
.sdb-pic .sdb-mark-slot { width: 70%; height: 70%; display: grid; }
.sdb-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #ffd98a; animation: sdb-rot 0.9s linear infinite; }
#win-sdboss .sdb-cmain { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
#win-sdboss .sdb-cname { font-weight: 800; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-sdboss .sdb-cname em { font-style: normal; font-weight: 700; font-size: 11px; color: #fff; background: #8a6a4e; border-radius: 6px; padding: 0 5px; margin-left: 5px; vertical-align: 1px; }
#win-sdboss .sdb-ctitle { font-size: 11px; color: var(--b-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-sdboss .sdb-csched { font-size: 11px; color: #6b5440; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdb-st { font-size: 11px; font-weight: 700; }
.sdb-st.next { color: #7b6aa8; }
.sdb-st.over { color: #9a8a7a; }
.sdb-st.up { color: var(--b-red, #d2463a); }
.sdb-st.up i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; animation: sdb-pulse 1.1s ease-in-out infinite; }
#win-sdboss .sdb-empty { padding: 24px 8px; text-align: center; color: var(--b-soft); }
/* middle: the boss */
#win-sdboss .sdb-stage { position: relative; min-height: 0; border-radius: 14px; overflow: hidden; background: radial-gradient(ellipse at 50% 92%, rgba(255, 170, 90, .45), transparent 46%), radial-gradient(circle at 50% 40%, #4d3b6b, #1d1529 70%); box-shadow: inset 0 0 0 2px rgba(255, 220, 170, .25), inset 0 -30px 60px rgba(0, 0, 0, .35); }
#win-sdboss .sdb-sky { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 255, 255, .7), transparent), radial-gradient(1px 1px at 72% 12%, rgba(255, 255, 255, .6), transparent), radial-gradient(1.5px 1.5px at 86% 34%, rgba(255, 240, 200, .6), transparent), radial-gradient(1px 1px at 30% 40%, rgba(255, 255, 255, .5), transparent), radial-gradient(1px 1px at 55% 24%, rgba(255, 255, 255, .55), transparent); pointer-events: none; }
#win-sdboss .sdb-stage::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 9%; height: 16%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 190, 110, .35), transparent 70%); pointer-events: none; }
#win-sdboss .sdb-cv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
#win-sdboss .sdb-stage.no3d .sdb-cv { display: none; }
#win-sdboss .sdb-plate { position: absolute; z-index: 2; left: 12px; top: 10px; right: 12px; display: flex; flex-direction: column; gap: 1px; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); pointer-events: none; }
#win-sdboss .sdb-plate b { font-size: 24px; line-height: 1.15; letter-spacing: .5px; background: linear-gradient(180deg, #fff6d8, #ffc85a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 2px rgba(60, 20, 0, .7)); }
#win-sdboss .sdb-plate span { font-size: 13px; color: #f3dcc0; }
#win-sdboss .sdb-plate em { font-style: normal; font-size: 12px; color: #d8c8ff; }
#win-sdboss .sdb-state { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); pointer-events: none; }
.sdb-badge { padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 800; color: #3b2d20; background: linear-gradient(180deg, #fff2c8, #f1c46a); text-shadow: none; box-shadow: 0 2px 0 #a0702a; }
.sdb-badge.up { color: #fff; background: linear-gradient(180deg, #ff7a62, #c8362a); box-shadow: 0 2px 0 #7a1a12, 0 0 12px rgba(255, 90, 70, .7); animation: sdb-pulse 1.2s ease-in-out infinite; }
.sdb-badge.over { color: #fff; background: linear-gradient(180deg, #9a8a7a, #6e5f50); box-shadow: 0 2px 0 #4a3e33; }
#win-sdboss .sdb-big { font-size: 15px; font-weight: 700; }
#win-sdboss .sdb-cd { font-size: 13px; color: #ffe1a6; }
.sdb-hp { position: relative; flex: 1 1 160px; height: 14px; border-radius: 8px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); overflow: hidden; }
.sdb-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ff8a6a, #d33a2a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); transition: width .4s ease; }
.sdb-hp b { position: relative; display: block; text-align: center; font-size: 10px; line-height: 14px; color: #fff; text-shadow: 0 1px 2px #000; }
/* right: rewards + story */
#win-sdboss .sdb-info { min-height: 0; overflow-y: auto; padding: 8px 10px; border-radius: 14px; background: var(--b-card); border: 2px solid var(--b-line); }
#win-sdboss .sdb-ihead { display: flex; flex-direction: column; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 2px dashed var(--b-line); }
#win-sdboss .sdb-ihead b { font-size: 18px; }
#win-sdboss .sdb-ihead span { font-size: 12px; color: var(--b-soft); }
#win-sdboss .sdb-info h4 { margin: 10px 0 5px; font-size: 13px; color: #8a4a26; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
#win-sdboss .sdb-info h4::before { content: ""; width: 4px; height: 13px; border-radius: 2px; background: #c8754a; align-self: center; }
#win-sdboss .sdb-info h4 small { font-weight: 400; font-size: 11px; color: var(--b-soft); }
#win-sdboss .sdb-dmg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#win-sdboss .sdb-rrow { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid #f1e4cf; }
#win-sdboss .sdb-rrow:last-of-type { border-bottom: 0; }
#win-sdboss .sdb-rl { flex: 0 0 84px; font-size: 12px; font-weight: 700; color: #6b4a30; display: flex; flex-direction: column; }
#win-sdboss .sdb-rl small { font-weight: 400; font-size: 10px; color: var(--b-soft); }
#win-sdboss .sdb-rrow.tier .sdb-rl { flex-basis: 108px; }
#win-sdboss .sdb-ri { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#win-sdboss .sdb-story { margin: 0; font-size: 12.5px; line-height: 1.65; color: #5a4532; white-space: pre-line; }
#win-sdboss .sdb-note { font-size: 11px; color: var(--b-soft); margin-top: 4px; }
#win-sdboss .sdb-warn { margin: 6px 0 2px; padding: 4px 8px; border-radius: 8px; font-size: 12px; color: #9a3a20; background: #ffe9dc; border: 1px solid #f3c0a4; }
.sdb-it { position: relative; flex: 0 0 auto; width: var(--s); height: var(--s); border-radius: 8px; background: linear-gradient(180deg, #fff8ea, #f3e1c2); box-shadow: inset 0 0 0 1.5px #dcc29c, 0 1px 2px rgba(90, 60, 30, .2); }
.sdb-iti { position: absolute; inset: 2px; overflow: hidden; border-radius: 6px; }
.sdb-iti img { position: absolute; transform-origin: 0 0; image-rendering: auto; max-width: none; }
.sdb-it b { position: absolute; right: 1px; bottom: -1px; font-size: 11px; line-height: 1; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.sdb-gold { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 3px; border-radius: 12px; font-size: 12px; font-weight: 800; color: #6b4a10; background: #fff1c4; box-shadow: inset 0 0 0 1.5px #e8c36a; }
.sdb-gold i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; color: #7a4a00; background: radial-gradient(circle at 35% 30%, #fff3a8, #e0a019); }
.sdb-coin { padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #5a3a8a; background: #efe6ff; box-shadow: inset 0 0 0 1px #cdb8f2; }
/* bottom: timetable + the way there */
#win-sdboss .sdb-foot { grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border-radius: 14px; background: linear-gradient(180deg, #fff6e8, #f6e4c8); border: 2px solid var(--b-line); }
#win-sdboss .sdb-sched { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
#win-sdboss .sdb-fl { font-size: 12px; font-weight: 800; color: #8a4a26; margin-right: 2px; }
#win-sdboss .sdb-days { display: inline-flex; gap: 3px; }
#win-sdboss .sdb-days i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: #b8a48e; background: #fffaf2; box-shadow: inset 0 0 0 1.5px #e6d4bb; }
#win-sdboss .sdb-days i.on { color: #fff; background: linear-gradient(180deg, #d98a5a, #b0562e); box-shadow: 0 1px 0 #7a3a1c; }
#win-sdboss .sdb-days i.today { outline: 2px solid #ffcf6a; outline-offset: 1px; }
#win-sdboss .sdb-times { display: inline-flex; gap: 4px; }
.sdb-chip { padding: 3px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #7a6248; background: #fffaf2; box-shadow: inset 0 0 0 1.5px #e6d4bb; white-space: nowrap; }
.sdb-chip.on { color: #fff; background: #8a6a4e; box-shadow: none; }
#win-sdboss .sdb-go { flex: 0 0 auto; min-width: 150px; padding: 9px 16px; font-size: 15px; font-weight: 800; }
#win-sdboss .sdb-go.hot { color: #fff; background: linear-gradient(180deg, #ff7a62, #c8362a); box-shadow: 0 3px 0 #7a1a12, 0 0 14px rgba(255, 90, 70, .55); animation: sdb-pulse 1.3s ease-in-out infinite; }
.sdb-thumbcv { position: fixed; left: 0; top: 0; width: 132px; height: 132px; opacity: 0; pointer-events: none; z-index: -1; }
@keyframes sdb-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
@keyframes sdb-rot { to { transform: rotate(360deg); } }
/* the button beside the minimap (with the build's quest list / world map / minimap buttons) */
#hud-map .sdb-ibtn { position: relative; overflow: visible; }
#hud-map .sdb-ibtn .sdb-dico { width: 26px; height: 26px; display: grid; place-items: center; }
#hud-map .sdb-ibtn.up { box-shadow: 0 0 0 2px #ff7a62, 0 0 10px rgba(255, 90, 70, .75); animation: sdb-pulse 1s ease-in-out infinite; }
#hud-map .sdb-ibtn .sdb-live { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: #e2463a; box-shadow: 0 0 0 2px #fff, 0 0 8px #ff5a4a; }
.sdb-mbtn .mbtn-ico { display: grid; place-items: center; }
.sdb-mbtn .mbtn-ico .sdb-mark { width: 30px; height: 30px; }
/* the bar while a boss is up on your map */
#sd-bhud { position: absolute; z-index: 6; top: 92px; left: 10px; width: min(360px, calc(100vw - 24px)); display: flex; gap: 8px; align-items: center; padding: 6px 10px 6px 6px; border-radius: 14px; color: #fff; background: linear-gradient(180deg, rgba(60, 30, 40, .9), rgba(30, 16, 24, .9)); box-shadow: 0 0 0 2px rgba(255, 140, 110, .55), 0 6px 16px rgba(0, 0, 0, .35); cursor: pointer; pointer-events: auto; }
#sd-bhud.raid { box-shadow: 0 0 0 2px rgba(190, 150, 255, .7), 0 6px 16px rgba(0, 0, 0, .35); }
#sd-bhud .sdb-hico { flex: 0 0 auto; width: 40px; height: 40px; display: grid; }
#sd-bhud .sdb-hmain { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#sd-bhud .sdb-hname { display: flex; align-items: baseline; gap: 6px; font-size: 13px; white-space: nowrap; }
#sd-bhud .sdb-hname b { color: #ffd98a; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
#sd-bhud .sdb-hname em { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 6px; background: rgba(255, 255, 255, .15); }
#sd-bhud .sdb-htime { margin-left: auto; font-weight: 700; color: #ffe1a6; }
#sd-bhud .sdb-hp { flex: 0 0 auto; height: 12px; }
#sd-bhud .sdb-hp b { line-height: 12px; }
#sd-bhud .sdb-hme { font-size: 11px; color: #f0d8c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the result */
#sd-bres { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(30, 18, 10, .35); pointer-events: auto; }
#sd-bres .sdb-rbox { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 14px; border-radius: 18px; color: #3b2d20; background: linear-gradient(180deg, #fffaf0, #f7e6cb); box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px #c8754a, 0 16px 36px rgba(60, 30, 10, .45); animation: win-in .34s cubic-bezier(.3, 1.5, .5, 1); }
#sd-bres .sdb-rbox.lose { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px #9a8a7a, 0 16px 36px rgba(60, 30, 10, .45); }
#sd-bres .sdb-rhead { display: flex; gap: 10px; align-items: center; }
#sd-bres .sdb-rhead > .sdb-mark-slot { width: 52px; height: 52px; display: grid; flex: 0 0 auto; }
#sd-bres .sdb-rhead div { display: flex; flex-direction: column; }
#sd-bres .sdb-rhead b { font-size: 19px; color: #a2502c; }
#sd-bres .sdb-rbox.lose .sdb-rhead b { color: #6e5f50; }
#sd-bres .sdb-rhead span { font-size: 12px; color: #8a6a4e; }
#sd-bres .sdb-rme { margin: 10px 0 6px; padding: 7px 10px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px #ecd8b8; font-size: 13px; }
#sd-bres .sdb-rme b { font-size: 16px; color: #c8362a; }
#sd-bres .sdb-rgot { margin: 6px 0; }
#sd-bres .sdb-rgot > span { font-size: 12px; font-weight: 800; color: #8a4a26; }
#sd-bres .sdb-rgot > div { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; }
#sd-bres .sdb-rtab { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }
#sd-bres .sdb-rtab th { text-align: left; font-size: 11px; color: #8a6a4e; padding: 3px 4px; border-bottom: 1.5px solid #e6cfae; }
#sd-bres .sdb-rtab td { padding: 3px 4px; border-bottom: 1px solid #f1e4cf; }
#sd-bres .sdb-rtab tr.me td { background: #fff1d6; font-weight: 800; }
#sd-bres .sdb-rrow2 { display: flex; justify-content: flex-end; margin-top: 10px; }
/* smaller screens: the panel under the boss, the list a strip on top */
@media (max-width: 1000px) {
  #win-sdboss .sdb-body { grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: minmax(220px, 1fr) minmax(0, 1fr) auto; height: min(680px, calc(100dvh - 130px)); }
  #win-sdboss .sdb-left { grid-row: 1 / 4; }
  #win-sdboss .sdb-info { grid-column: 2; }
  #win-sdboss .sdb-foot { grid-column: 2; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  #win-sdboss .sdb-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 230px auto auto; height: auto; max-height: calc(100dvh - 70px); overflow-y: auto; }
  #win-sdboss .sdb-left { grid-row: auto; }
  #win-sdboss .sdb-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  #win-sdboss .sdb-card { flex: 0 0 210px; }
  #win-sdboss .sdb-info, #win-sdboss .sdb-foot { grid-column: 1; }
  #win-sdboss .sdb-info { overflow: visible; }
  #win-sdboss .sdb-plate b { font-size: 19px; }
  #win-sdboss .sdb-go { flex: 1 1 100%; }
}
#win-sdboss .sdb-tab { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
#win-sdboss .sdb-tico { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(60, 30, 10, .35)); }
/* short screens (a phone on its side): the list stays on the left, the right side (boss, rewards, timetable) scrolls */
@media (max-height: 560px) {
  #win-sdboss .sdb-body { height: calc(100dvh - 66px); min-height: 0; grid-template-columns: 196px minmax(0, 1fr); grid-template-rows: 190px max-content max-content; align-content: start; overflow-y: auto; gap: 6px; padding: 6px 8px 8px; }
  #win-sdboss .sdb-left { grid-row: 1 / 4; position: sticky; top: 0; height: calc(100dvh - 82px); }
  #win-sdboss .sdb-info { grid-column: 2; overflow: visible; min-height: max-content; }
  #win-sdboss .sdb-foot { grid-column: 2; flex-wrap: wrap; }
  #win-sdboss .sdb-go { flex: 1 1 100%; }
  #win-sdboss .sdb-plate b { font-size: 19px; }
  #win-sdboss .sdb-card { padding: 4px; gap: 6px; }
  #win-sdboss .sdb-pic { width: 46px; height: 46px; }
  #win-sdboss .sdb-tab { font-size: 13px; padding: 6px 2px; white-space: nowrap; gap: 3px; }
  #win-sdboss .sdb-tico { width: 18px; height: 18px; }
}
/* phase 67b: drops (with their chance) and what the trophy buys */
.sdb-it .sdb-rate { position: absolute; left: -2px; top: -5px; padding: 0 3px; border-radius: 5px; font-style: normal; font-size: 9px; line-height: 13px; font-weight: 800; color: #fff; background: #8a6a4e; box-shadow: 0 0 0 1px #fff; }
#win-sdboss .sdb-exch { display: flex; flex-direction: column; gap: 4px; }
#win-sdboss .sdb-xrow { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 8px; background: #fbf3e4; }
#win-sdboss .sdb-xget { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; }
#win-sdboss .sdb-xget em { font-style: normal; font-size: 11.5px; font-weight: 700; color: #5a4532; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-sdboss .sdb-xarrow { font-style: normal; color: #b0562e; font-weight: 800; }
#win-sdboss .sdb-xpay { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
#win-sdboss .sdb-xbtn { margin-top: 6px; width: 100%; }

/* ---- phase 67c: the fashion shop "ร้านแฟชั่น" (fixes.js __sdShop) */
#win-sdshop { --s-ink: #3b2d20; --s-soft: #8a6a4e; --s-line: #e6cfae; --s-card: #fffdf8; --s-lilac: #b48cf0; --win-w: 1080px; width: min(1080px, calc(100vw - 16px)); }
#win-sdshop .win-head { gap: 6px; }
#win-sdshop .sds-head-ico { width: 28px; height: 28px; object-fit: contain; }
#win-sdshop .sds-bal { margin-left: auto; margin-right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 3px; border-radius: 12px; font-weight: 800; font-size: 13px; color: #4a2f7a; background: #f1e8ff; box-shadow: inset 0 0 0 1.5px #d2bdf5; }
.sds-bal i, .sds-price i { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 8.5px; font-weight: 800; color: #fff; background: radial-gradient(circle at 35% 30%, #c9a8ff, #7a4fd0); }
#win-sdshop .sds-body { position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; padding: 8px 10px 10px; height: min(600px, calc(100dvh - 170px)); min-height: 380px; color: var(--s-ink); overflow: hidden; }
#win-sdshop .sds-nav { display: flex; flex-direction: column; gap: 5px; min-height: 0; padding: 6px; border-radius: 14px; background: #f6ead6; box-shadow: inset 0 1px 3px rgba(90, 60, 30, .15); }
#win-sdshop .sds-cat { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border: 0; border-radius: 10px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--s-soft); background: transparent; cursor: pointer; text-align: left; }
#win-sdshop .sds-cat small { font-size: 11px; color: #b09478; }
#win-sdshop .sds-cat:hover { background: #fff6e8; }
#win-sdshop .sds-cat.on { color: #fff; background: linear-gradient(180deg, #a77be8, #7f52c9); box-shadow: 0 2px 0 #5a3696, inset 0 1px 0 rgba(255, 255, 255, .35); }
#win-sdshop .sds-cat.on small { color: #efe4ff; }
#win-sdshop .sds-grow { flex: 1; }
#win-sdshop .sds-side { position: relative; padding: 8px; border: 0; border-radius: 12px; font: inherit; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(180deg, #9a7a5a, #7a5a3e); box-shadow: 0 2px 0 #4f3824; cursor: pointer; }
#win-sdshop .sds-side.cart { background: linear-gradient(180deg, #c8754a, #a2502c); box-shadow: 0 2px 0 #7a3a1c; }
#win-sdshop .sds-side b { position: absolute; top: -6px; right: 8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font-size: 11px; line-height: 18px; color: #fff; background: #e2463a; box-shadow: 0 0 0 2px #fff; }
#win-sdshop .sds-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
#win-sdshop .sds-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#win-sdshop .sds-filt { display: inline-flex; gap: 3px; padding: 3px; border-radius: 12px; background: #3f3350; }
#win-sdshop .sds-tab { padding: 5px 16px; border: 0; border-radius: 9px; font: inherit; font-weight: 700; font-size: 13px; color: #d8cbe8; background: transparent; cursor: pointer; }
#win-sdshop .sds-tab.on { color: #3b2d20; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
#win-sdshop .sds-q { flex: 1 1 140px; min-width: 120px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--s-line); font: inherit; background: #fffaf2; }
#win-sdshop .sds-sort { padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--s-line); font: inherit; background: #fffaf2; }
#win-sdshop .sds-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
#win-sdshop .sds-card { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 0; padding: 8px 10px 6px; border-radius: 14px; cursor: pointer; background: radial-gradient(circle at 50% 55%, rgba(200, 160, 255, .45), rgba(200, 160, 255, 0) 45%), var(--s-card); box-shadow: 0 0 0 2.5px #d9c3f7, 0 0 12px rgba(160, 110, 240, .35), 0 3px 8px rgba(90, 60, 30, .15); transition: transform .12s ease, box-shadow .12s ease; }
#win-sdshop .sds-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2.5px #b48cf0, 0 0 18px rgba(160, 110, 240, .6), 0 6px 12px rgba(90, 60, 30, .2); }
#win-sdshop .sds-card.incart { box-shadow: 0 0 0 3px #c8754a, 0 0 14px rgba(200, 117, 74, .5); }
#win-sdshop .sds-name { width: 100%; text-align: center; font-weight: 800; font-size: 14px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#win-sdshop .sds-tags { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 2px; }
.sds-flag, .sds-kind { font-style: normal; padding: 0 6px; border-radius: 7px; font-size: 10px; line-height: 15px; font-weight: 800; color: #fff; background: #8a6a4e; }
.sds-flag.new { background: #3d9a5a; }
.sds-flag.hot { background: #e2563a; }
.sds-flag.sale { background: #d08a10; }
.sds-kind { color: #6b4a9a; background: #efe6ff; }
#win-sdshop .sds-pic { flex: 1 1 auto; min-height: 0; width: 100%; display: grid; place-items: center; overflow: hidden; }
#win-sdshop .sds-pic .sds-dress { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(60, 30, 80, .25)); }
.sds-noprev { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sds-noprev small { font-size: 10.5px; color: var(--s-soft, #8a6a4e); }
.sds-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(160, 110, 240, .25); border-top-color: #9a6ce8; animation: sdb-rot .9s linear infinite; }
#win-sdshop .sds-line { width: 90%; height: 1px; margin: 2px 0 4px; background: linear-gradient(90deg, transparent, #d9c3a3, transparent); }
#win-sdshop .sds-foot { width: 100%; display: flex; align-items: center; justify-content: space-between; }
#win-sdshop .sds-cartbtn { display: inline-flex; align-items: center; gap: 1px; padding: 2px 7px; border: 0; border-radius: 9px; font: inherit; font-weight: 800; font-size: 12px; color: #8a6a4e; background: #f3e6d2; cursor: pointer; }
#win-sdshop .sds-cartbtn.on { color: #fff; background: #c8754a; }
#win-sdshop .sds-cartbtn svg { width: 15px; height: 15px; margin-left: 1px; }
.sds-price { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 16px; color: #4a2f7a; }
.sds-price.big { font-size: 20px; }
.sds-price.lack { color: #c8362a; }
#win-sdshop .sds-pager { display: flex; justify-content: center; align-items: center; gap: 12px; font-weight: 800; color: var(--s-soft); }
#win-sdshop .sds-pager button { width: 32px; height: 28px; border: 0; border-radius: 9px; font: inherit; font-size: 18px; line-height: 1; color: #fff; background: #8a6a4e; cursor: pointer; }
#win-sdshop .sds-pager button:disabled { opacity: .35; cursor: default; }
#win-sdshop .sds-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--s-soft); }
#win-sdshop .sds-note { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; padding: 7px 16px; border-radius: 12px; font-weight: 700; color: #fff; background: rgba(60, 40, 90, .92); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.sds-it { position: relative; flex: 0 0 auto; width: var(--s); height: var(--s); border-radius: 8px; background: linear-gradient(180deg, #fff8ea, #f3e1c2); box-shadow: inset 0 0 0 1.5px #dcc29c; }
.sds-it > span { position: absolute; inset: 2px; overflow: hidden; border-radius: 6px; }
.sds-it img { position: absolute; transform-origin: 0 0; max-width: none; }
.sds-it b { position: absolute; right: 1px; bottom: -1px; font-size: 11px; line-height: 1; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
/* the outfit large / the cart */
#win-sdshop .sds-modal { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(40, 24, 50, .45); }
#win-sdshop .sds-box { position: relative; display: flex; gap: 14px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 14px; border-radius: 18px; background: linear-gradient(180deg, #fffaf0, #f7e6cb); box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px #b48cf0, 0 16px 36px rgba(60, 30, 80, .45); }
#win-sdshop .sds-box.cartbox { flex-direction: column; width: 520px; gap: 8px; }
#win-sdshop .sds-x { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; font-size: 18px; color: #fff; background: #8a6a4e; cursor: pointer; }
#win-sdshop .sds-bigwrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#win-sdshop .sds-big { position: relative; width: 300px; height: 380px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 55%, rgba(200, 160, 255, .55), rgba(200, 160, 255, 0) 55%), #fffdf8; box-shadow: inset 0 0 0 2px #e6d4f7; }
#win-sdshop .sds-big .pv-canvas, .sds-thumbhost .pv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#win-sdshop .sds-bigwrap small { font-size: 11px; color: var(--s-soft); }
#win-sdshop .sds-dinfo { display: flex; flex-direction: column; gap: 8px; width: 330px; min-height: 0; overflow-y: auto; padding-right: 4px; }
#win-sdshop .sds-dname { font-size: 20px; color: #4a2f7a; padding-right: 28px; }
#win-sdshop .sds-dinfo .sds-tags { justify-content: flex-start; }
#win-sdshop .sds-desc { margin: 0; font-size: 12.5px; color: #5a4532; line-height: 1.55; }
#win-sdshop .sds-in > span { font-size: 12px; font-weight: 800; color: #8a4a26; }
#win-sdshop .sds-in > div { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
#win-sdshop .sds-crow { display: flex; align-items: center; gap: 6px; }
#win-sdshop .sds-crow em { font-style: normal; font-size: 12.5px; }
#win-sdshop .sds-dfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
#win-sdshop .sds-buy { color: #fff; background: linear-gradient(180deg, #a77be8, #7f52c9); box-shadow: 0 3px 0 #5a3696; }
#win-sdshop .sds-hint { font-size: 11px; color: var(--s-soft); }
#win-sdshop .sds-clist { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
#win-sdshop .sds-crow2 { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px #ecd8b8; }
#win-sdshop .sds-crow2 img { width: 44px; height: 54px; object-fit: contain; }
#win-sdshop .sds-crow2 em { flex: 1; font-style: normal; font-weight: 700; font-size: 13px; }
.sds-thumbhost { position: fixed; left: 0; top: 0; width: 170px; height: 210px; opacity: 0; pointer-events: none; z-index: -1; }
.sds-mbtn .mbtn-ico { display: grid; place-items: center; }
.sds-mbtn .mbtn-ico img { width: 30px; height: 30px; object-fit: contain; }
#hud-map .sds-ibtn { display: grid; place-items: center; }
#hud-map .sds-ibtn img { width: 26px; height: 26px; object-fit: contain; }
/* smaller screens */
@media (max-width: 900px) {
  #win-sdshop .sds-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-height: 560px) {
  #win-sdshop .sds-body { height: calc(100dvh - 66px); min-height: 0; grid-template-columns: 132px minmax(0, 1fr); gap: 6px; padding: 6px; }
  #win-sdshop .sds-cat { padding: 6px 8px; font-size: 12.5px; }
  #win-sdshop .sds-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  #win-sdshop .sds-name { font-size: 12px; }
  #win-sdshop .sds-tags { display: none; }
  #win-sdshop .sds-price { font-size: 13px; }
  #win-sdshop .sds-box { flex-direction: row; padding: 10px; }
  #win-sdshop .sds-big { width: 200px; height: calc(100dvh - 140px); }
  #win-sdshop .sds-dinfo { width: 280px; max-height: calc(100dvh - 120px); }
}

/* ---- phase 68: the buddy "เพื่อนคู่หู" (fixes.js __sdBuddy) */
#win-sdbuddy { --y-ink: #3b2d20; --y-soft: #8a6a4e; --y-line: #e6cfae; --y-card: #fffdf8; --win-w: 760px; width: min(760px, calc(100vw - 16px)); }
#win-sdbuddy .sdy-head-ico { width: 28px; height: 28px; object-fit: contain; margin-right: 4px; }
#win-sdbuddy .sdy-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 10px; padding: 8px 10px 10px; height: min(560px, calc(100dvh - 170px)); min-height: 360px; color: var(--y-ink); overflow: hidden; }
#win-sdbuddy .sdy-left { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; }
#win-sdbuddy .sdy-pv { position: relative; width: 100%; flex: 1 1 auto; min-height: 0; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 58%, rgba(255, 170, 200, .5), rgba(255, 170, 200, 0) 55%), #fffaf2; box-shadow: inset 0 0 0 2px #f1d9e2; }
#win-sdbuddy .sdy-pv .pv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#win-sdbuddy .sdy-noav { width: 96px; }
#win-sdbuddy .sdy-left small { font-size: 11px; color: var(--y-soft); }
#win-sdbuddy .sdy-right { min-height: 0; overflow-y: auto; padding: 4px 6px 8px 2px; display: flex; flex-direction: column; gap: 8px; }
#win-sdbuddy .sdy-right > * { flex-shrink: 0; }
#win-sdbuddy .sdy-title { margin: 0; font-size: 20px; color: #a2406a; }
#win-sdbuddy .sdy-sub { font-size: 12.5px; color: var(--y-soft); }
#win-sdbuddy .sdy-sub em { font-style: normal; font-weight: 700; color: #9a8a7a; }
#win-sdbuddy .sdy-sub em.ok { color: #3d8f4a; }
#win-sdbuddy .sdy-lead { margin: 0; font-size: 12.5px; line-height: 1.6; color: #5a4532; }
#win-sdbuddy .sdy-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#win-sdbuddy .sdy-f > span:first-child { flex: 0 0 52px; font-size: 12.5px; font-weight: 800; color: #8a4a26; }
#win-sdbuddy .sdy-name { flex: 1 1 140px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--y-line); font: inherit; background: #fffaf2; }
#win-sdbuddy .sdy-jobs, #win-sdbuddy .sdy-modes { display: flex; gap: 5px; flex-wrap: wrap; }
.sdy-chip { padding: 5px 12px; border: 0; border-radius: 10px; font: inherit; font-weight: 700; font-size: 12.5px; color: #8a6a4e; background: #f6ead6; cursor: pointer; }
.sdy-chip.on { color: #fff; background: linear-gradient(180deg, #e27aa2, #c24f7c); box-shadow: 0 2px 0 #8e2e55; }
#win-sdbuddy .sdy-steps { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
#win-sdbuddy .sdy-steps button { width: 24px; height: 24px; border: 0; border-radius: 7px; font: inherit; font-weight: 800; color: #fff; background: #8a6a4e; cursor: pointer; }
#win-sdbuddy .sdy-steps b { display: inline-block; min-width: 22px; text-align: center; }
#win-sdbuddy .sdy-bon { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 10px; font-size: 12px; color: #6b4a30; background: #fff3f6; box-shadow: inset 0 0 0 1.5px #f3d0dc; }
#win-sdbuddy .sdy-bon span.got { color: #c24f7c; font-weight: 800; }
#win-sdbuddy .sdy-bon span.got::before { content: "✓ "; }
#win-sdbuddy .sdy-bon small { font-size: 10.5px; color: var(--y-soft); }
#win-sdbuddy .sdy-go { padding: 10px; font-size: 15px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #e27aa2, #c24f7c); box-shadow: 0 3px 0 #8e2e55; }
#win-sdbuddy .sdy-bar { position: relative; height: 18px; border-radius: 9px; background: #efe2cf; overflow: hidden; box-shadow: inset 0 1px 2px rgba(90, 60, 30, .2); }
#win-sdbuddy .sdy-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #7fd38a, #3d9a5a); transition: width .4s ease; }
#win-sdbuddy .sdy-bar.rel i { background: linear-gradient(180deg, #ff9cc2, #e2527f); }
#win-sdbuddy .sdy-bar u { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .8); }
#win-sdbuddy .sdy-bar b { position: relative; display: block; text-align: center; font-size: 11px; line-height: 18px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
#win-sdbuddy .sdy-stats { display: flex; gap: 6px; flex-wrap: wrap; }
#win-sdbuddy .sdy-stats span { padding: 3px 9px; border-radius: 9px; font-size: 12px; color: #6b4a30; background: #fffaf2; box-shadow: inset 0 0 0 1.5px #ecd8b8; }
#win-sdbuddy h4 { margin: 4px 0 0; font-size: 13px; color: #8a4a26; display: flex; align-items: baseline; gap: 6px; }
#win-sdbuddy h4 small { font-weight: 400; font-size: 11px; color: var(--y-soft); }
#win-sdbuddy .sdy-acts { display: flex; gap: 6px; flex-wrap: wrap; }
#win-sdbuddy .sdy-bye { color: #b0402a; }
#win-sdbuddy .sdy-gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; }
#win-sdbuddy .sdy-g { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 0; border-radius: 10px; font: inherit; text-align: left; background: #fffaf2; box-shadow: inset 0 0 0 1.5px #ecd8b8; cursor: pointer; }
#win-sdbuddy .sdy-g:hover { box-shadow: inset 0 0 0 2px #e27aa2; }
#win-sdbuddy .sdy-g span { display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 1.25; }
#win-sdbuddy .sdy-g small { font-size: 10px; color: var(--y-soft); }
#win-sdbuddy .sdy-empty { color: var(--y-soft); text-align: center; padding: 20px; }
#win-sdbuddy .sdy-empty.sm { grid-column: 1 / -1; padding: 6px; font-size: 12px; }
.sdy-it { position: relative; flex: 0 0 auto; width: var(--s); height: var(--s); border-radius: 8px; background: linear-gradient(180deg, #fff8ea, #f3e1c2); box-shadow: inset 0 0 0 1.5px #dcc29c; }
.sdy-it > span { position: absolute; inset: 2px; overflow: hidden; border-radius: 6px; }
.sdy-it img { position: absolute; transform-origin: 0 0; max-width: none; }
.sdy-it b { position: absolute; right: 1px; bottom: -1px; font-size: 10px; line-height: 1; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.sdy-mbtn .mbtn-ico { display: grid; place-items: center; }
.sdy-mbtn .mbtn-ico img { width: 30px; height: 30px; object-fit: contain; }
#hud-map .sdy-ibtn { display: grid; place-items: center; }
#hud-map .sdy-ibtn img { width: 26px; height: 26px; object-fit: contain; }
/* the card under the player's frame */
#sd-bdhud { position: absolute; z-index: 6; top: 92px; left: 10px; width: 200px; display: flex; gap: 6px; align-items: center; padding: 5px 8px 5px 5px; border-radius: 12px; color: #fff; background: linear-gradient(180deg, rgba(90, 40, 60, .88), rgba(50, 22, 36, .88)); box-shadow: 0 0 0 2px rgba(255, 160, 200, .55), 0 4px 12px rgba(0, 0, 0, .3); cursor: pointer; pointer-events: auto; }
#sd-bdhud > img { width: 34px; height: 34px; object-fit: contain; }
#sd-bdhud .sdy-cmain { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#sd-bdhud .sdy-cname { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sd-bdhud .sdy-cname b { color: #ffd0e2; }
#sd-bdhud .sdy-cname em { font-style: normal; color: #ff8a8a; }
#sd-bdhud .sdy-hp { position: relative; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .45); overflow: hidden; }
#sd-bdhud .sdy-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #8de39a, #3d9a5a); }
#sd-bdhud .sdy-rel { font-size: 11px; color: #ffc2d8; }
#sd-bhud { top: var(--sd-bh-top, 92px) !important; }
@media (max-height: 560px) {
  #win-sdbuddy .sdy-body { height: calc(100dvh - 66px); min-height: 0; grid-template-columns: 170px minmax(0, 1fr); padding: 6px; }
  #sd-bdhud { top: 70px; width: 170px; }
}
#win-sdbuddy .sdy-bar.rel b { color: #7a2a4a; text-shadow: 0 1px 0 rgba(255, 255, 255, .75); }

/* ==== stall signs: tools/build-signs.mjs writes this block from design/signs — edit there ==== */
/* ---- phase 69h: the stall signs in the user's own design (a picture they sent: wooden frames round a parchment board,
   the kind's emblem sticking out at the top-left corner, little ornaments on the frame). Pieces drawn as SVG in
   design/signs/*.svg; tools/build-signs.mjs puts them in here as data: URLs and writes this block into fixes.css.
   · SELL  = red wooden frame, a red / cream scalloped awning over the board, a red price tag on its rope, a red "ขาย"
             pill, a leaf on the bottom-left corner and a daisy on the bottom-right
   · BUY   = teal wooden frame, a sack of money with a bunny on it and bunny gold coins, a teal "รับซื้อ" pill, a sprig
             of leaves on the top-right corner
   · PREMIUM (kiosk) = gold frame round a purple board, a purple tag with a crown (sell) or the sack wearing a crown (buy),
             a yellow "พรีเมียม" pill (+ the teal "รับซื้อ"), a gold star on the bottom-right corner
   Each rule starts with .tag: the build's stylesheet is injected after fixes.css, a rule of the same weight would lose. */
.tag .tag-stall.tag-stall { /* (doubled: also above the build's own .tag-stall.buy / .kiosk boards) */
  --frame: #d2553c; --frame-dk: #5a2414; --board-a: #fffaf0; --board-b: #f5e1bd; --ink: #5a2a10; --rivet: #e8b45a;
  color: var(--ink); text-shadow: none; width: max-content; max-width: 15em; gap: 0; align-items: center;
  padding: .5em .95em .48em 2.75em; margin-bottom: .55em; border: .26em solid var(--frame); border-radius: .75em;
  background:
    radial-gradient(circle at .42em .42em, var(--rivet) .13em, var(--frame-dk) .18em, #0000 .21em),
    radial-gradient(circle at calc(100% - .42em) .42em, var(--rivet) .13em, var(--frame-dk) .18em, #0000 .21em),
    radial-gradient(circle at .42em calc(100% - .42em), var(--rivet) .13em, var(--frame-dk) .18em, #0000 .21em),
    radial-gradient(circle at calc(100% - .42em) calc(100% - .42em), var(--rivet) .13em, var(--frame-dk) .18em, #0000 .21em),
    repeating-linear-gradient(90deg, #0000 0 2.2em, #b8864a0d 2.2em 2.35em),
    linear-gradient(var(--board-a), var(--board-b));
  box-shadow: 0 0 0 .12em var(--frame-dk), inset 0 0 0 .09em #00000026, inset 0 .22em 0 #ffffff80, 0 .24em 0 .1em var(--frame-dk), 0 .45em .8em #0a082866;
}
.tag .tag-stall.tag-stall:hover { filter: brightness(1.07); box-shadow: 0 0 0 .12em var(--frame-dk), inset 0 0 0 .09em #00000026, inset 0 .22em 0 #ffffff80, 0 .24em 0 .1em var(--frame-dk), 0 0 0 .32em #fff6, 0 .45em .9em #0a08288c; }
.tag .tag-stall .ts-ico { position: absolute; z-index: 2; left: -1.4em; top: -1.55em; width: 3.95em; height: 3.95em; border-radius: 0; box-shadow: none; filter: drop-shadow(0 .12em 0 #0003); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M43 27C43 13 57 8 59 18C61 27 50 29 46 24' fill='none' stroke='%234a2414' stroke-width='7' stroke-linecap='round'/%3E%3Cpath d='M43 27C43 13 57 8 59 18C61 27 50 29 46 24' fill='none' stroke='%23e0a85a' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M43 27C43 13 57 8 59 18C61 27 50 29 46 24' fill='none' stroke='%23a86a2a' stroke-width='1.2' stroke-dasharray='2 2.5'/%3E%3Cg transform='rotate(-26 32 36)'%3E%3Cpath d='M12 21h29l13 15-13 15H12a5 5 0 0 1-5-5V26a5 5 0 0 1 5-5z' fill='%23e6432f' stroke='%234a1a10' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M12 21h29l13 15-1.6 1.8C47 30 40 27 12 27a5 5 0 0 0-5 1V26a5 5 0 0 1 5-5z' fill='%23ff7a5c' opacity='.55'/%3E%3Cpath d='M13 25h26.5l10 11-10 11H13a2.5 2.5 0 0 1-2.5-2.5v-17A2.5 2.5 0 0 1 13 25z' fill='none' stroke='%23fff3e6' stroke-width='1.7' stroke-dasharray='3.2 2.6' stroke-linecap='round'/%3E%3Crect x='15' y='30' width='21' height='12' rx='4' fill='%23fff6ec' stroke='%234a1a10' stroke-width='2'/%3E%3Cpath d='M19.5 36h7.5M30.5 36h1.5' stroke='%23e6432f' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='45' cy='36' r='3.4' fill='%23fff6ec' stroke='%234a1a10' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.tag .tag-stall .ts-ico > svg, .tag .tag-stall .ts-ico > .ico { display: none; }
/* the pills on a row above the title: ts-line's children join ts-text's grid (pills in row 1 in their DOM order — the
   premium pill, then "ขาย" / "รับซื้อ" — and the title across row 2); the sign is max-content wide */
.tag .tag-stall .ts-text { display: grid; grid-template-columns: auto auto 1fr; justify-items: start; align-items: center; column-gap: .3em; row-gap: .1em; }
.tag .tag-stall .ts-line { display: contents; }
.tag .tag-stall .ts-title { grid-row: 2; grid-column: 1 / -1; font-size: 1.18em; font-weight: 800; line-height: 1.15; max-width: 11em; }
.tag .tag-stall .ts-line::before, .tag .tag-stall .ts-buy, .tag .tag-stall .ts-kind {
  grid-row: 1; border-radius: 1em; padding: .02em .6em .06em; font-size: .74em; font-weight: 800; line-height: 1.45; letter-spacing: 0; text-transform: none;
  margin: 0; align-self: center; box-shadow: 0 0 0 .11em var(--pill-dk), inset 0 .13em 0 #ffffff66, 0 .14em 0 var(--pill-dk);
}
/* sell */
.tag .tag-stall:not(.buy) .ts-line::before { content: 'ขาย'; display: block; color: #fff; background: linear-gradient(#f2604a, #cf3a26); --pill-dk: #6e1a10; }
.tag .tag-stall:not(.kiosk):not(.buy)::before { content: ''; top: -.98em; left: 1.7em; right: .55em; height: 1.28em; border-radius: 0; -webkit-mask: none; mask: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30' preserveAspectRatio='none'%3E%3Cpath d='M4 4h112v16a5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-12 0z' fill='%23fff4e6'/%3E%3Cg fill='%23e6432f'%3E%3Cpath d='M14 4h10v16a5 5 0 0 1-10 0z'/%3E%3Cpath d='M34 4h10v16a5 5 0 0 1-10 0z'/%3E%3Cpath d='M54 4h10v16a5 5 0 0 1-10 0z'/%3E%3Cpath d='M74 4h10v16a5 5 0 0 1-10 0z'/%3E%3Cpath d='M94 4h10v16a5 5 0 0 1-10 0z'/%3E%3C/g%3E%3Cpath d='M4 4h112v16a5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-10 0 5 5 0 0 1-12 0z' fill='none' stroke='%234a1a10' stroke-width='2.6' stroke-linejoin='round'/%3E%3Crect x='2' y='1.5' width='116' height='5' rx='2.5' fill='%23c43a28' stroke='%234a1a10' stroke-width='2.2'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; filter: drop-shadow(0 .1em 0 #0002); }
.tag .tag-stall:not(.kiosk):not(.buy):not(.lifted)::after { content: ''; position: absolute; pointer-events: none; left: -.55em; right: -.5em; bottom: -.62em; height: 1.35em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E%3Cg stroke='%232f4a12' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M18 26C8 28 2 20 4 10c9 0 16 6 14 16z' fill='%237cc243'/%3E%3Cpath d='M18 26C17 16 23 8 34 7c2 11-6 19-16 19z' fill='%2394d454'/%3E%3Cpath d='M18 26C14 20 10 15 6 12M18 26c4-6 8-11 13-16' fill='none' stroke='%233f6a18' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E") left bottom / auto 100% no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg stroke='%236a4a2a' stroke-width='1.6' fill='%23fffdf5'%3E%3Ccircle cx='16' cy='7.5' r='5.5'/%3E%3Ccircle cx='24.5' cy='13.5' r='5.5'/%3E%3Ccircle cx='21.5' cy='23.5' r='5.5'/%3E%3Ccircle cx='10.5' cy='23.5' r='5.5'/%3E%3Ccircle cx='7.5' cy='13.5' r='5.5'/%3E%3Ccircle cx='16' cy='16' r='5' fill='%23ffd23a'/%3E%3C/g%3E%3C/svg%3E") right bottom / auto 78% no-repeat; }
/* buy */
.tag .tag-stall.buy { --frame: #45b8a8; --frame-dk: #164d47; --pill-dk: #0b4a50; }
.tag .tag-stall.buy .ts-ico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 64'%3E%3Cg stroke='%234a2a14' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M31 25C21 31 19 50 30 57C40 63 58 62 64 51C70 39 60 28 53 25Z' fill='%23f6e6c6'/%3E%3Cpath d='M33 47C38 58 55 58 62 49' fill='none' stroke='%23e7cfa2' stroke-width='3'/%3E%3Cpath d='M33 25C28 18 33 11 38 15C39 8 47 7 48 13C53 9 59 15 54 25Z' fill='%23f6e6c6'/%3E%3Cpath d='M32 24.5C40 28 47 28 55 24.5' fill='none' stroke='%23d9463a' stroke-width='4.2' stroke-linecap='round'/%3E%3Cpath d='M54 25c4-5 10-3 9 1-1 3-6 3-9-1zM54 25c2 4 7 9 4 11-3 1-5-5-4-11z' fill='%23e0533f'/%3E%3Cg fill='none' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M41 40c-2-5-1-9 1-9s2 4 0 9M48 40c1-5 3-8 4-7 2 1 0 5-3 8'/%3E%3Cpath d='M39 44c0-4 4-6 7-6s7 2 7 6-4 6-7 6-7-2-7-6z' fill='%23fff8ea'/%3E%3C/g%3E%3Ccircle cx='43.5' cy='44' r='1' fill='%234a2a14' stroke='none'/%3E%3Ccircle cx='48.5' cy='44' r='1' fill='%234a2a14' stroke='none'/%3E%3Cpath d='M45.3 46.3q.7.8 1.4 0' fill='none' stroke-width='1.2'/%3E%3Cpath d='M5 48v4c0 3 6 5 12 5s12-2 12-5v-4' fill='%23e9a419'/%3E%3Cellipse cx='17' cy='48' rx='12' ry='5' fill='%23ffd34a'/%3E%3Cellipse cx='17' cy='48' rx='8' ry='3.1' fill='none' stroke='%23d99a12' stroke-width='1.4'/%3E%3Cpath d='M3 40v4c0 3 6 5 12 5s12-2 12-5v-4' fill='%23e9a419'/%3E%3Cellipse cx='15' cy='40' rx='12' ry='5' fill='%23ffd34a'/%3E%3Cellipse cx='15' cy='40' rx='8' ry='3.1' fill='none' stroke='%23d99a12' stroke-width='1.4'/%3E%3Ccircle cx='23' cy='50' r='11' fill='%23ffd34a'/%3E%3Ccircle cx='23' cy='50' r='7.8' fill='%23ffe27a' stroke='%23d99a12' stroke-width='1.4'/%3E%3Cpath d='M20.5 49c-1-3-.5-5 .5-5s1.2 2 0 5M25.5 49c1-3 .5-5-.5-5s-1.2 2 0 5' fill='none' stroke='%23c98a10' stroke-width='1.3'/%3E%3Cpath d='M19.5 51.5c0-2 1.6-3 3.5-3s3.5 1 3.5 3-1.6 3-3.5 3-3.5-1-3.5-3z' fill='none' stroke='%23c98a10' stroke-width='1.3'/%3E%3C/g%3E%3Cg stroke='%234a2a14' stroke-width='1.6' stroke-linejoin='round' fill='%23ffd23a'%3E%3Cpath d='M60 10l3-7 3 1.4-4.4 6.4z'/%3E%3Cpath d='M65 15l6-3.4 1.2 2.6-6.8 2.4z'/%3E%3C/g%3E%3C/svg%3E"); left: -1.65em; top: -1.5em; width: 4.3em; }
.tag .tag-stall.buy .ts-buy { display: block; color: #fff; background: linear-gradient(#3ccbd2, #138e98); --pill-dk: #0b4a50; }
.tag .tag-stall.buy:not(.kiosk)::before { content: ''; top: -.8em; left: auto; right: -.7em; width: 2em; height: 1.6em; border-radius: 0; -webkit-mask: none; mask: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E%3Cg stroke='%232f4a12' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M10 26C4 18 8 8 18 6c3 9-1 17-8 20z' fill='%237cc243'/%3E%3Cpath d='M12 26C14 15 24 10 36 12c-2 11-12 15-24 14z' fill='%2394d454'/%3E%3Cpath d='M10 26c2-6 4-12 7-17M12 26c6-5 13-9 21-12' fill='none' stroke='%233f6a18' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
/* premium */
.tag .tag-stall.kiosk { --frame: #f2b41e; --frame-dk: #6a3e05; --board-a: #9358d6; --board-b: #6630a6; --ink: #fff6e2; --rivet: #ffe08a; }
.tag .tag-stall.kiosk .ts-title { text-shadow: 0 .08em 0 #3a1560, .06em 0 0 #3a1560, -.06em 0 0 #3a1560, 0 -.06em 0 #3a1560; }
.tag .tag-stall.kiosk .ts-kind { display: block; color: #5a2d00; background: linear-gradient(#ffe77a, #f7bd1e); --pill-dk: #6a3e05; }
.tag .tag-stall.kiosk:not(.buy) .ts-line::before { content: none; display: none; }
.tag .tag-stall.kiosk .ts-ico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 64'%3E%3Cpath d='M41 25C41 11 55 6 57 16C59 25 48 27 44 22' fill='none' stroke='%234a2414' stroke-width='7' stroke-linecap='round'/%3E%3Cpath d='M41 25C41 11 55 6 57 16C59 25 48 27 44 22' fill='none' stroke='%23e0a85a' stroke-width='4' stroke-linecap='round'/%3E%3Cg transform='rotate(-26 30 34)'%3E%3Cpath d='M10 19h29l13 15-13 15H10a5 5 0 0 1-5-5V24a5 5 0 0 1 5-5z' fill='%238a4cd0' stroke='%232e1050' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M10 19h29l13 15-1.6 1.8C45 28 38 25 10 25a5 5 0 0 0-5 1V24a5 5 0 0 1 5-5z' fill='%23b783f0' opacity='.55'/%3E%3Cpath d='M11 23h26.5l10 11-10 11H11a2.5 2.5 0 0 1-2.5-2.5v-17A2.5 2.5 0 0 1 11 23z' fill='none' stroke='%23f4ecff' stroke-width='1.7' stroke-dasharray='3.2 2.6' stroke-linecap='round'/%3E%3Crect x='13' y='28' width='21' height='12' rx='4' fill='%23f8f2ff' stroke='%232e1050' stroke-width='2'/%3E%3Cpath d='M17.5 34h7.5M28.5 34h1.5' stroke='%238a4cd0' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='43' cy='34' r='3.4' fill='%23f8f2ff' stroke='%232e1050' stroke-width='2'/%3E%3C/g%3E%3Cg transform='translate(36 36) rotate(-8)' stroke='%235a3200' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M2 20L0 6l8 6 7-10 7 10 8-6-2 14z' fill='%23ffcc2e'/%3E%3Cpath d='M3 16h26' fill='none' stroke='%23e09a10' stroke-width='1.6'/%3E%3Ccircle cx='15' cy='13' r='2.6' fill='%23ff4a4a' stroke-width='1.6'/%3E%3Ccircle cx='0' cy='6' r='2' fill='%23ffe27a' stroke-width='1.4'/%3E%3Ccircle cx='15' cy='2' r='2' fill='%23ffe27a' stroke-width='1.4'/%3E%3Ccircle cx='30' cy='6' r='2' fill='%23ffe27a' stroke-width='1.4'/%3E%3C/g%3E%3Cg stroke='%234a2a14' stroke-width='1.6' stroke-linejoin='round' fill='%23ffd23a'%3E%3Cpath d='M58 9l3-7 3 1.4-4.4 6.4z'/%3E%3Cpath d='M63 14l6-3.4 1.2 2.6-6.8 2.4z'/%3E%3C/g%3E%3C/svg%3E"); width: 4.3em; }
.tag .tag-stall.kiosk.buy .ts-ico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 64'%3E%3Cg stroke='%234a2a14' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M29 29C19 35 18 52 28 58C38 63 56 62 62 52C68 40 58 32 51 29Z' fill='%23f6e6c6'/%3E%3Cpath d='M31 29C26 22 31 16 36 19C37 13 45 12 46 18C51 14 57 20 52 29Z' fill='%23f6e6c6'/%3E%3Cpath d='M30 28.5C38 32 45 32 53 28.5' fill='none' stroke='%23d9463a' stroke-width='4.2' stroke-linecap='round'/%3E%3Cpath d='M52 29c4-5 10-3 9 1-1 3-6 3-9-1zM52 29c2 4 7 9 4 11-3 1-5-5-4-11z' fill='%23e0533f'/%3E%3Cg fill='none' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M39 44c-2-5-1-9 1-9s2 4 0 9M46 44c1-5 3-8 4-7 2 1 0 5-3 8'/%3E%3Cpath d='M37 48c0-4 4-6 7-6s7 2 7 6-4 6-7 6-7-2-7-6z' fill='%23fff8ea'/%3E%3C/g%3E%3Ccircle cx='41.5' cy='48' r='1' fill='%234a2a14' stroke='none'/%3E%3Ccircle cx='46.5' cy='48' r='1' fill='%234a2a14' stroke='none'/%3E%3Ccircle cx='16' cy='52' r='11' fill='%23ffd34a'/%3E%3Ccircle cx='16' cy='52' r='7.8' fill='%23ffe27a' stroke='%23d99a12' stroke-width='1.4'/%3E%3Cpath d='M13.5 51c-1-3-.5-5 .5-5s1.2 2 0 5M18.5 51c1-3 .5-5-.5-5s-1.2 2 0 5' fill='none' stroke='%23c98a10' stroke-width='1.3'/%3E%3Cpath d='M12.5 53.5c0-2 1.6-3 3.5-3s3.5 1 3.5 3-1.6 3-3.5 3-3.5-1-3.5-3z' fill='none' stroke='%23c98a10' stroke-width='1.3'/%3E%3C/g%3E%3Cg transform='translate(26 1)' stroke='%235a3200' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M2 18L0 5l8 5 7-9 7 9 8-5-2 13z' fill='%23ffcc2e'/%3E%3Cpath d='M3 14.5h26' fill='none' stroke='%23e09a10' stroke-width='1.6'/%3E%3Ccircle cx='15' cy='11.5' r='2.6' fill='%23ff4a4a' stroke-width='1.6'/%3E%3Ccircle cx='0' cy='5' r='2' fill='%23ffe27a' stroke-width='1.4'/%3E%3Ccircle cx='15' cy='1.5' r='2' fill='%23ffe27a' stroke-width='1.4'/%3E%3Ccircle cx='30' cy='5' r='2' fill='%23ffe27a' stroke-width='1.4'/%3E%3C/g%3E%3Cg stroke='%234a2a14' stroke-width='1.6' stroke-linejoin='round' fill='%23ffd23a'%3E%3Cpath d='M60 12l3-7 3 1.4-4.4 6.4z'/%3E%3Cpath d='M65 17l6-3.4 1.2 2.6-6.8 2.4z'/%3E%3C/g%3E%3C/svg%3E"); }
.tag .tag-stall.kiosk::before { content: none; }
.tag .tag-stall.kiosk:not(.lifted)::after { content: ''; position: absolute; pointer-events: none; right: -.62em; bottom: -.6em; width: 1.55em; height: 1.55em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.5l4 8.6 9.3 1.1-6.9 6.4 1.9 9.2L16 23.2l-8.3 4.6 1.9-9.2-6.9-6.4 9.3-1.1z' fill='%23ffd23a' stroke='%236a4200' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M16 7l2.4 5.2' stroke='%23fff3b0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
/* ==== end of the stall signs ==== */

/* ---- phase 71: the status panel (top left) in the user's design (design/hud/hud-kit.webp, assembled as in their mock-up):
   a big gold ring round the portrait, the brown "LV.n" plate on its upper left, a parchment panel behind with HP / AP /
   EXP in their own colours, glossy red / blue / gold bars in tan troughs, white numbers with a dark edge. The pieces were
   cut by tools/blender/cut_hud.py into fixes/img/hud/; the plate's number comes from fixes.js (#self-lvd data-lv).
   Replaces the build's classic Seal bar (body.hud-kub) — sizes are before the build's own scale (--hs). */
body.hud-kub #hud-self { width: 270px !important; height: 72px !important; border: 0 !important; border-image: none !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; overflow: visible !important; }
body.hud-kub #hud-self::before { content: ''; position: absolute; left: 62px; top: 7px; width: 207px; height: 58px; box-sizing: border-box; pointer-events: none; z-index: 0;
  border-style: solid; border-width: 0; border-image: url(img/hud/panel.png) 70 90 70 90 fill / 16px 20px 16px 20px stretch; filter: drop-shadow(0 3px 4px #2a1d1240); }
body.hud-kub #hud-self .self-ava { position: absolute !important; left: 14px !important; top: 5px !important; width: 58px !important; height: 58px !important; z-index: 2; }
body.hud-kub #hud-self .self-ava::after { content: ''; position: absolute; inset: -7px; pointer-events: none; z-index: 3; background: url(img/hud/ring.png) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 3px #2a1d1250); }
body.hud-kub #hud-self #self-ring { width: 100% !important; height: 100% !important; border-radius: 50% !important; overflow: hidden !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; background: radial-gradient(circle at 50% 38%, #fff7dc, #f6d58e 70%, #e9b968) !important; display: block !important; }
body.hud-kub #hud-self #self-ring img { width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 50%; display: block; }
body.hud-kub #hud-self #self-prem { position: absolute; inset: auto -4px -3px auto !important; z-index: 4; }
body.hud-kub #hud-self #self-lvd { position: absolute !important; left: 0 !important; top: -1px !important; width: 48px !important; height: 21px !important; z-index: 5; display: flex !important; align-items: center; justify-content: center; transform: none !important;
  background: url(img/hud/plate.png) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 2px #2a1d1255); }
body.hud-kub #hud-self #self-lvd > i { display: none !important; }
/* three digits (Lv 100–310): a wider plate reaching a little further left, the number a touch narrower */
body.hud-kub #hud-self #self-lvd[data-len="3"] { left: -5px !important; width: 58px !important; }
body.hud-kub #hud-self #self-lvd[data-len="3"]::before { font-size: 10.6px; letter-spacing: -.45px; }
body.hud-kub #hud-self #self-lvd::before { content: 'LV.' attr(data-lv); margin-top: 1px; font: 900 11px/1 Georgia, 'Times New Roman', serif; letter-spacing: -.2px; color: #fff3d8; -webkit-text-stroke: 2.2px #3a2010; paint-order: stroke fill; white-space: nowrap; }
body.hud-kub #hud-self .self-main { position: static !important; display: block !important; }
/* (html … : the cocoa theme's "border: 0 !important" on these bars — loaded later — would also reset the trough's border-image) */
html body.hud-kub #hud-self .bar { position: absolute !important; left: 110px !important; right: auto !important; width: 147px !important; height: 12px !important; z-index: 2; overflow: visible !important; background: none !important; box-shadow: none !important; border-radius: 0 !important;
  border-style: solid !important; border-width: 0 !important; border-image: url(img/hud/trough.png) 0 40 fill / 0 6px stretch !important; }
body.hud-kub #hud-self #bar-hp { top: 13px !important; }
body.hud-kub #hud-self #bar-mp { top: 29.5px !important; }
body.hud-kub #hud-self #bar-exp { top: 46px !important; }
body.hud-kub #hud-self .bar i { position: absolute !important; left: 1px; top: 1px; bottom: 1px; height: auto !important; max-width: calc(100% - 2px); min-width: 0; border-radius: 0 !important; box-shadow: none !important; background: none !important;
  border-style: solid; border-width: 0; border-image: url(img/hud/fill-hp.png) 0 36 fill / 0 5px stretch; }
body.hud-kub #hud-self #bar-mp i { border-image-source: url(img/hud/fill-ap.png); }
body.hud-kub #hud-self #bar-exp i { border-image-source: url(img/hud/fill-exp.png); }
body.hud-kub #hud-self .bar span { position: absolute !important; inset: 0 !important; z-index: 2; display: flex !important; align-items: center; justify-content: center; font: 800 10.2px/1 var(--font) !important; letter-spacing: .2px; color: #fff !important; -webkit-text-stroke: 2.4px #3d2414 !important; paint-order: stroke fill; text-shadow: none !important; white-space: nowrap; }
body.hud-kub #hud-self #bar-exp span { justify-content: flex-start; padding-left: 20%; }
body.hud-kub #hud-self .bar::before { position: absolute; right: calc(100% + 5px); top: 50%; transform: translateY(-50%); font: 900 12.5px/1 Georgia, 'Times New Roman', serif; letter-spacing: -.3px; -webkit-text-stroke: 2.6px #fffaf0; paint-order: stroke fill; }
body.hud-kub #hud-self #bar-hp::before { content: 'HP'; color: #e8473f; }
body.hud-kub #hud-self #bar-mp::before { content: 'AP'; color: #1f97dd; }
body.hud-kub #hud-self #bar-exp::before { content: 'EXP'; color: #6b4526; }

/* ---- phase 72: the chat box shows faintly while it isn't in use (the user's ask) — whole again under the mouse, while
   typing (#hud.chatting), opened large (#hud.chat-expanded) or with anything in it focused */
#hud #hud-chat { transition: opacity .3s ease; }
#hud:not(.chatting):not(.chat-expanded) #hud-chat:not(:hover):not(:focus-within) { opacity: .4; }

/* ---- phase 72b: the chat's channel tabs (ทั่วไป / กระซิบ / ตะโกน / ปาร์ตี้ / กิลด์) — five tabs in a ~190px row: the build
   lets the row scroll sideways but hides its scrollbar, so with a mouse the last ones (ปาร์ตี้, กิลด์) could not be reached
   (the user's report). Tighter tabs, a faded edge on the side that has more, and fixes.js turns the mouse wheel and a
   drag into sideways scrolling and keeps the chosen tab in view. */
#hud #chat-tabs .ct-tab { flex: 0 0 auto; padding: 0 8px !important; }
#hud #chat-tabs { scroll-behavior: smooth; }
#hud #chat-tabs.sd-more-r { -webkit-mask: linear-gradient(90deg, #000 calc(100% - 22px), #0000); mask: linear-gradient(90deg, #000 calc(100% - 22px), #0000); }
#hud #chat-tabs.sd-more-l { -webkit-mask: linear-gradient(90deg, #0000, #000 22px); mask: linear-gradient(90deg, #0000, #000 22px); }
#hud #chat-tabs.sd-more-l.sd-more-r { -webkit-mask: linear-gradient(90deg, #0000, #000 22px, #000 calc(100% - 22px), #0000); mask: linear-gradient(90deg, #0000, #000 22px, #000 calc(100% - 22px), #0000); }
#hud #chat-tabs.sd-dragging { scroll-behavior: auto; cursor: grabbing; }

/* ---- phase 72c: a monster's HP bar goes with its name — both only over the monster under the mouse or the selected
   one (the build's "hide monster names" setting, on by default now: serve-decoded.mjs; np-quiet = its name is hidden) */
.tag.tag-monster.np-quiet .tag-hp { visibility: hidden; }

/* ---- phase 73: the hotbars (1–0 #hotbar-1, F1–F10 #hotbar-2) in the user's kit (design/hud/hotbar-kit.webp, cut by
   tools/blender/cut_hud.py + hotbar_ornament.py into fixes/img/hotbar/): a parchment panel in a gold frame (9-slice, so the
   corners keep their shape) with the gold ornament back on top in the middle, pale green slots (salmon under the mouse /
   while pressed), gold arrow buttons for the page, the keys in the same font, dark brown with a light edge. Each bar has
   a grip on its left (fixes.js __sdHotDrag) to drag it anywhere; double-click the grip puts it back. */
html body #hotbars .hotbar { position: relative; background: none !important; box-shadow: none !important; border-radius: 0 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border: 0 !important; border-style: solid !important; border-image: url(img/hotbar/panel-plain.png) 75 70 70 70 fill / 14px 13px 13px 13px stretch !important;
  padding: 12px 15px 11px !important; gap: 5px !important; }
html body #hotbars .hotbar::after { content: ''; position: absolute; top: 0; left: 50%; width: 37px; height: 14px; transform: translateX(-50%); pointer-events: none; background: url(img/hotbar/ornament.png) 0 0 / 100% 100% no-repeat; }
html body #hotbars .hotbar .hot { background: url(img/hotbar/slot.png) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 9px !important; box-shadow: none !important; }
html body #hotbars .hotbar .hot:hover, html body #hotbars .hotbar .hot:active { background-image: url(img/hotbar/slot-on.png) !important; }
html body #hotbars .hotbar .hot .icon { inset: 4px !important; border-radius: 6px; }
html body #hotbars .hotbar .hot-key { color: #4a2814 !important; -webkit-text-stroke: 2.5px #fff7e6 !important; paint-order: stroke fill; font-weight: 800; text-shadow: none !important; }
html body #hotbars .hot-page .hp-btn { background: url(img/hotbar/arrow-up.png) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; width: 22px; height: 16px; padding: 0; }
html body #hotbars .hot-page .hp-btn:last-child { background-image: url(img/hotbar/arrow-down.png) !important; }
html body #hotbars .hot-page .hp-btn > svg { display: none !important; }
html body #hotbars .hot-page .hp-btn:hover { filter: brightness(1.1); }
html body #hotbars .hot-page .hp-num { color: #4a2814 !important; -webkit-text-stroke: 2.5px #fff7e6; paint-order: stroke fill; font-weight: 800; }
/* the grip */
#hotbars .sd-hgrip { position: absolute; left: -15px; top: 50%; width: 14px; height: 30px; transform: translateY(-50%); z-index: 3; cursor: grab; touch-action: none; border-radius: 7px 0 0 7px;
  background: radial-gradient(circle, #6b4320 1.3px, #0000 1.8px) 0 0 / 6px 6px, linear-gradient(#f7d98a, #d9a63e); background-clip: padding-box; border: 1.5px solid #6b4320; border-right: 0; box-shadow: -1px 2px 3px #0004; opacity: .75; }
#hotbars .sd-hgrip:hover { opacity: 1; }
#hotbars .hotbar.sd-hmoving { opacity: .9; }
#hotbars .hotbar.sd-hmoving .sd-hgrip { cursor: grabbing; }
/* page 2 of the 1–0 bar: the build tints the keys and the page number lilac — here a cocoa pill on the number only */
html body #hotbars .hotbar .hot-key { background: none !important; box-shadow: none !important; }
html body #hotbars #hotbar-1 .hp-num { background: none !important; box-shadow: none !important; padding: 0 2px; }
html body #hotbars #hotbar-1[data-page="2"] .hp-num { background: linear-gradient(#d39448, #8a5220) !important; color: #fff6e0 !important; -webkit-text-stroke: 0 !important; border-radius: 7px; padding: 0 4px; box-shadow: 0 0 0 1.5px #fff7e6 !important; }

/* ==== phase 80: whisper windows, one per partner as in Ragnarok Online (fixes.js __sdPm) — the cocoa windows' manner:
   parchment, a brown title bar to drag, pink names for them, blue for you; minimised = the title bar only, blinking
   pink while a new whisper waits ==== */
html body .sd-pm { position: fixed; z-index: 40; width: 290px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; border: 2px solid #8b5e3c; border-radius: 12px;
  background: #fffaf1; box-shadow: 0 8px 22px rgba(40, 24, 10, .38); font-size: 13px; color: #3b2d20; overflow: hidden; pointer-events: auto; }
html body .sd-pm .sd-pm-head { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 9px; background: linear-gradient(#ad7d52, #8b5e3c); color: #fff6e6; cursor: move; user-select: none; touch-action: none; }
html body .sd-pm .sd-pm-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ff8cc0; box-shadow: 0 0 6px #ff7ab8; }
html body .sd-pm .sd-pm-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
html body .sd-pm .sd-pm-title b { color: #ffe08a; font-weight: 700; }
html body .sd-pm .sd-pm-head button { flex: none; width: 22px; height: 22px; padding: 0; border: 0 !important; border-radius: 6px; background: rgba(255, 255, 255, .18) !important; color: #fff !important;
  font: 700 15px/22px system-ui, sans-serif; text-align: center; cursor: pointer; box-shadow: none !important; }
html body .sd-pm .sd-pm-head button:hover { background: rgba(255, 255, 255, .34) !important; }
html body .sd-pm .sd-pm-log { height: 160px; overflow-y: auto; padding: 6px 9px; display: flex; flex-direction: column; gap: 3px; background: #fffdf8; overscroll-behavior: contain; }
html body .sd-pm .sd-pm-log .ln { line-height: 1.4; word-break: break-word; }
html body .sd-pm .sd-pm-log .ln b { font-weight: 700; }
html body .sd-pm .sd-pm-log .ln.them b { color: #c2357a; }
html body .sd-pm .sd-pm-log .ln.me b { color: #2b6cb0; }
html body .sd-pm .sd-pm-log .ln.sys { color: #9a6b3f; font-style: italic; font-size: 12px; }
html body .sd-pm .sd-pm-form { display: flex; gap: 5px; padding: 6px; border-top: 1.5px solid #ead8bd; background: #f6ecdc; margin: 0; }
html body .sd-pm .sd-pm-in { flex: 1; min-width: 0; height: 28px; border: 1.5px solid #d6b98e !important; border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff !important; color: #3b2d20 !important; outline: none; box-shadow: none !important; }
html body .sd-pm .sd-pm-in:focus { border-color: #c0782a !important; box-shadow: 0 0 0 2px rgba(240, 154, 26, .25) !important; }
html body .sd-pm .sd-pm-send { flex: none; height: 28px; padding: 0 12px; border: 2px solid #b8650a !important; border-radius: 8px; background: linear-gradient(#ffe07a, #f5a623) !important; color: #5a2f00 !important; font-weight: 700; cursor: pointer; box-shadow: none !important; }
html body .sd-pm.min { width: 210px; }
html body .sd-pm.min .sd-pm-log, html body .sd-pm.min .sd-pm-form { display: none; }
html body .sd-pm.blink .sd-pm-head { animation: sd-pm-blink 1s ease-in-out infinite; }
@keyframes sd-pm-blink { 50% { background: linear-gradient(#ff9fc8, #d9578a); } }

/* ==== phase 81: the auto-reply (fixes.js __sdPm) — a round button in the chat box's header beside its filter (the
   theme's round like its neighbours, a speech bubble with an A; green ring and dot while on), the same in each whisper
   window's header, and its small panel ==== */
html body #hud-chat .chat-head .sd-auto-btn { position: relative; flex: none; display: grid; place-items: center; }
html body #hud-chat .chat-head .sd-auto-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html body #hud-chat .chat-head .sd-auto-btn.on { box-shadow: 0 0 0 2px #3fbf5f, 0 0 8px rgba(63, 191, 95, .6) !important; color: #2f8a3f !important; }
html body #hud-chat .chat-head .sd-auto-btn .sd-auto-dot { display: none; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: #3fbf5f; box-shadow: 0 0 0 2px #fff; }
html body #hud-chat .chat-head .sd-auto-btn.on .sd-auto-dot { display: block; }
html body .sd-pm .sd-pm-head .sd-pm-ab svg { width: 15px; height: 15px; display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html body .sd-pm.auto .sd-pm-head .sd-pm-ab { background: #3fbf5f !important; }
html body .sd-pm.auto .sd-pm-title::after { content: "ตอบอัตโนมัติ"; margin-left: 6px; padding: 0 5px; border-radius: 6px; background: #3fbf5f; color: #fff; font-size: 10px; font-weight: 700; vertical-align: 1px; }
html body .sd-pm-auto { position: fixed; z-index: 60; width: 270px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; gap: 7px; padding: 0 0 10px; border: 2px solid #8b5e3c; border-radius: 12px;
  background: #fffaf1; box-shadow: 0 8px 22px rgba(40, 24, 10, .38); color: #3b2d20; font-size: 13px; overflow: hidden; }
html body .sd-pm-auto .sd-pa-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 10px; background: linear-gradient(#ad7d52, #8b5e3c); color: #fff6e6; font-weight: 700; }
html body .sd-pm-auto .sd-pa-x { width: 22px; height: 22px; padding: 0; border: 0 !important; border-radius: 6px; background: rgba(255, 255, 255, .18) !important; color: #fff !important; font: 700 15px/22px system-ui, sans-serif; cursor: pointer; box-shadow: none !important; }
html body .sd-pm-auto .sd-pa-on { display: flex; align-items: flex-start; gap: 7px; margin: 0 10px; cursor: pointer; font-weight: 600; line-height: 1.35; }
html body .sd-pm-auto .sd-pa-on input { flex: none; width: 17px; height: 17px; margin: 1px 0 0; accent-color: #3fbf5f; }
html body .sd-pm-auto .sd-pa-text { margin: 0 10px; resize: none; border: 1.5px solid #d6b98e !important; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; background: #fff !important; color: #3b2d20 !important; outline: none; box-shadow: none !important; }
html body .sd-pm-auto .sd-pa-text:focus { border-color: #c0782a !important; box-shadow: 0 0 0 2px rgba(240, 154, 26, .25) !important; }
html body .sd-pm-auto .sd-pa-hint { margin: 0 10px; font-size: 11px; color: #8a6a4a; line-height: 1.4; }
html body .sd-pm-auto .sd-pa-row { display: flex; justify-content: flex-end; margin: 0 10px; }
html body .sd-pm-auto .sd-pa-save { height: 28px; padding: 0 16px; border: 2px solid #b8650a !important; border-radius: 8px; background: linear-gradient(#ffe07a, #f5a623) !important; color: #5a2f00 !important; font-weight: 700; cursor: pointer; box-shadow: none !important; }
/* phase 82: "<name> กำลังพิมพ์…" between the conversation and the line to type in (fixes.js __sdPm showTyping) */
html body .sd-pm .sd-pm-typing { padding: 2px 10px 3px; background: #fffdf8; color: #9a6b3f; font-size: 12px; font-style: italic; }
html body .sd-pm .sd-pm-typing[hidden] { display: none; }
html body .sd-pm .sd-pm-typing b { color: #c2357a; font-style: normal; }
html body .sd-pm .sd-pm-typing i { display: inline-block; font-style: normal; font-weight: 700; animation: sd-pm-dot 1.2s ease-in-out infinite; }
html body .sd-pm .sd-pm-typing i:nth-child(3) { animation-delay: .2s; }
html body .sd-pm .sd-pm-typing i:nth-child(4) { animation-delay: .4s; }
html body .sd-pm.min .sd-pm-typing { display: none; }
@keyframes sd-pm-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
/* ==== phase 85: the GM commands window (fixes.js __sdGmc) — opened from the GM window's head ==== */
#win-sdgmc .sd-gmc-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; max-height: min(70vh, 620px); max-height: min(70dvh, 620px); }
#win-sdgmc .sd-gmc-q { width: 100%; height: 32px; padding: 0 10px; border-radius: 8px; border: 1.5px solid #d6b98e; background: #fff; color: #3b2d20; font: inherit; outline: none; }
#win-sdgmc .sd-gmc-q:focus { border-color: #c0782a; box-shadow: 0 0 0 2px rgba(240, 154, 26, .25); }
#win-sdgmc .sd-gmc-hint { font-size: 11px; color: #8a6a4a; line-height: 1.4; }
#win-sdgmc .sd-gmc-grp h4 { margin: 6px 0 4px; font-size: 13px; color: #8b5e3c; border-bottom: 1.5px solid #ead8bd; padding-bottom: 3px; }
#win-sdgmc .sd-gmc-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; }
#win-sdgmc .sd-gmc-row:nth-child(even) { background: rgba(234, 216, 189, .35); }
#win-sdgmc .sd-gmc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#win-sdgmc .sd-gmc-main code { font: 600 12px/1.35 ui-monospace, Consolas, monospace; color: #2b5d9b; word-break: break-word; }
#win-sdgmc .sd-gmc-main span { font-size: 12px; color: #5b4532; line-height: 1.35; }
#win-sdgmc .sd-gmc-act { flex: none; display: flex; gap: 4px; }
#win-sdgmc .sd-gmc-act .btn { white-space: nowrap; }
html body #win-sdgmc .sd-gmc-act .btn.sd-gmc-run { background: linear-gradient(#ffe07a, #f5a623) !important; color: #5a2f00 !important; border-color: #b8650a !important; }
#win-sdgmc .sd-gmc-none { padding: 20px; text-align: center; color: #8a6a4a; }

/* ==================================================================================================================
   Seal Duran — start screens "แบบใหม่" (phase 88; the user's ask: a new login / channel / character select / creation
   look + changeable backgrounds). Our own look: dark smoked-glass panels with a thin gold rim and gold corner marks,
   gold titles and gold primary buttons, dark fields with a gold focus ring, the background art clear (no blur) with a
   vignette and a slow drift, rising embers. Only while body.sd-v2 (fixes.js __sdStart, admin "หน้าเข้าเกม" → แบบใหม่);
   only the four start screens — the HUD and windows keep the cocoa theme. The build's / theme's colour tokens are turned
   dark inside these screens, so most of their parts follow; the rest is set here. */
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) {
  --v2-gold: #e2b866; --v2-gold-l: #f6dfa2; --v2-gold-d: #9a6a2a; --v2-ink: #f3e9d6; --v2-ink-2: #cdbb98; --v2-ink-3: #9c8a6c;
  --v2-line: rgba(226, 184, 102, .42); --v2-line-2: rgba(226, 184, 102, .2); --v2-field: rgba(6, 4, 2, .55);
  --v2-panel: linear-gradient(180deg, rgba(38, 29, 19, .9), rgba(15, 11, 7, .93));
  --v2-corners:
    linear-gradient(var(--v2-gold), var(--v2-gold)) left 7px top 7px / 16px 2px no-repeat,
    linear-gradient(var(--v2-gold), var(--v2-gold)) left 7px top 7px / 2px 16px no-repeat,
    linear-gradient(var(--v2-gold), var(--v2-gold)) right 7px top 7px / 16px 2px no-repeat,
    linear-gradient(var(--v2-gold), var(--v2-gold)) right 7px top 7px / 2px 16px no-repeat,
    linear-gradient(var(--v2-gold), var(--v2-gold)) left 7px bottom 7px / 16px 2px no-repeat,
    linear-gradient(var(--v2-gold), var(--v2-gold)) left 7px bottom 7px / 2px 16px no-repeat,
    linear-gradient(var(--v2-gold), var(--v2-gold)) right 7px bottom 7px / 16px 2px no-repeat,
    linear-gradient(var(--v2-gold), var(--v2-gold)) right 7px bottom 7px / 2px 16px no-repeat;
  /* the build's / cocoa theme's tokens, dark: cards, lines, text; the sky (accent) scale becomes gold, dark to light */
  --ink: #f3e9d6 !important; --ink-2: #cdbb98 !important; --ink-3: #9c8a6c !important; --ink-soft: #cdbb98 !important;
  --surface: rgba(255, 236, 190, .05) !important; --surface-solid: #1c150e !important; --card: rgba(255, 236, 190, .06) !important;
  --sunken: rgba(0, 0, 0, .3) !important; --line: rgba(226, 184, 102, .22) !important; --line-strong: rgba(226, 184, 102, .4) !important;
  --sky-50: #241b12 !important; --sky-100: #2e2317 !important; --sky-200: #3d2e1d !important; --sky-300: #6b5130 !important; --sky-400: #a07a3e !important;
  --sky-500: #c99a4c !important; --sky-600: #e2b866 !important; --sky-700: #f0d08e !important; --sky-800: #fbe9b8 !important;
  --c-sky-50: #241b12 !important; --c-sky-100: #2e2317 !important; --c-sky-200: #3d2e1d !important; --c-sky-300: #6b5130 !important; --c-sky-400: #a07a3e !important;
  --c-sky-500: #c99a4c !important; --c-sky-600: #e2b866 !important; --c-sky-700: #f0d08e !important; --c-sky-800: #fbe9b8 !important;
  --co-panel: #1c150e; --co-panel-2: #2a2016; --co-rim: #c99a4c; --co-rim-l: rgba(226, 184, 102, .3); --co-ink: #0d0905;
  --co-sky: #e2b866; --co-sky-d: #b8842f; --co-sky-ink: #2b1a06; --co-text: #f3e9d6; --co-text-2: #cdbb98;
  --ring: 0 0 0 3px rgba(226, 184, 102, .3) !important;
  color: var(--v2-ink);
}
/* backgrounds: the art clear and a little darker, drifting slowly; a vignette instead of the dot pattern */
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading)::before { filter: brightness(.8) saturate(1.08) !important; transform-origin: 62% 42%; }
html body.sd-v2 :is(#screen-login, #screen-chan, #loading)::before { animation: sdv2-drift 46s ease-in-out infinite alternate; }
html body.sd-v2 :is(#screen-login, #screen-chan, #loading)::after {
  background: radial-gradient(ellipse 85% 78% at 50% 46%, transparent 38%, rgba(6, 4, 2, .7) 100%),
    linear-gradient(180deg, rgba(6, 4, 2, .5) 0%, transparent 20%, transparent 64%, rgba(6, 4, 2, .8) 100%) !important;
}
@keyframes sdv2-drift { from { transform: scale(1.03); } to { transform: scale(1.11) translate(-1.4%, -1.1%); } }
html body.sd-v2 :is(#screen-login, #screen-chan, #loading) > .deco { display: none !important; }
/* rising embers (fixes.js adds .sdv2-embers with its <i>s) */
.sdv2-embers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.sdv2-embers i { position: absolute; bottom: -12px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, #fff6d8 0%, #f2c46a 45%, rgba(226, 150, 60, 0) 72%); opacity: 0;
  animation: sdv2-ember var(--d) linear var(--w) infinite; }
@keyframes sdv2-ember { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 70% { opacity: .55; } 100% { transform: translate(var(--dx), -105vh); opacity: 0; } }
body:not(.sd-v2) .sdv2-embers, body:not(.sd-v2) .sdv2-news { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  html body.sd-v2 :is(#screen-login, #screen-chan, #loading)::before { animation: none; }
  .sdv2-embers { display: none; }
}

/* ---- shared parts: panels, titles, buttons, fields */
html body.sd-v2 :is(#screen-login .auth-card, #screen-chan .chan-card, #chars-select .cs-panel, #create-form .cc-panel, #loading .loading-box, .sdv2-news) {
  background: var(--v2-corners), var(--v2-panel) !important;
  border: 1px solid var(--v2-line) !important; border-image: none !important; border-radius: 14px !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 236, 190, .12), inset 0 0 0 4px rgba(255, 236, 190, .025), 0 24px 60px rgba(0, 0, 0, .55) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.1); backdrop-filter: blur(8px) saturate(1.1);
  color: var(--v2-ink) !important;
}
html body.sd-v2 :is(#create-form .cc-head, #chars-select .cs-head) h2, html body.sd-v2 #screen-chan .chan-title {
  border: 0 !important; border-image: none !important; background: none !important; padding: 2px 0 !important;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--v2-gold-l) !important; -webkit-text-stroke: 0 !important; paint-order: normal;
  font-size: 20px !important; font-weight: 700; letter-spacing: .06em;
  text-shadow: 0 2px 0 #1a0f04, 0 0 14px rgba(226, 184, 102, .35) !important;
}
html body.sd-v2 :is(#create-form .cc-head, #chars-select .cs-head) h2::before, html body.sd-v2 :is(#create-form .cc-head, #chars-select .cs-head) h2::after,
html body.sd-v2 #screen-chan .chan-title::before, html body.sd-v2 #screen-chan .chan-title::after {
  content: "" !important; display: block !important; position: static !important; width: 34px; height: 9px; flex: none;
  background: linear-gradient(var(--v2-gold), var(--v2-gold)) center / 100% 1px no-repeat,
    radial-gradient(circle, var(--v2-gold) 0 2.2px, transparent 2.8px) right center / 9px 9px no-repeat !important;
  -webkit-mask: linear-gradient(90deg, transparent, #000 40%); mask: linear-gradient(90deg, transparent, #000 40%);
}
html body.sd-v2 :is(#create-form .cc-head, #chars-select .cs-head) h2::after, html body.sd-v2 #screen-chan .chan-title::after { transform: scaleX(-1); }

html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn {
  border: 1px solid var(--v2-line-2) !important; border-image: none !important; border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(64, 49, 32, .92), rgba(33, 25, 16, .96)) !important;
  color: var(--v2-ink) !important; text-shadow: 0 1px 0 #000 !important; font-weight: 700; padding: 0 16px !important;
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .12), 0 2px 8px rgba(0, 0, 0, .35) !important; filter: none;
}
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn:hover { border-color: var(--v2-line) !important; filter: brightness(1.12); }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn:is(.primary, .gold) {
  background: linear-gradient(180deg, #f8e5ad 0%, #e2b866 40%, #b07c2c 100%) !important; border-color: #fbe9b8 !important;
  color: #2b1a06 !important; text-shadow: 0 1px 0 rgba(255, 245, 215, .55) !important; letter-spacing: .03em;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(120, 70, 10, .35), 0 6px 18px rgba(226, 160, 60, .28) !important;
}
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn:is(.primary, .gold):hover { filter: brightness(1.07) saturate(1.05); box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 22px rgba(240, 190, 90, .45) !important; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn svg { color: currentColor; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn.ghost { background: rgba(12, 9, 6, .45) !important; border-color: var(--v2-line-2) !important; box-shadow: none !important; color: var(--v2-ink-2) !important; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn.sm { padding: 0 12px !important; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) .btn.icon { padding: 0 !important; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars) :is(.icon-btn, .cs-arrow) {
  background: rgba(14, 10, 6, .7) !important; border: 1px solid var(--v2-line) !important; color: var(--v2-gold-l) !important; box-shadow: 0 2px 8px rgba(0, 0, 0, .4) !important;
}
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars) select.btn option { background: #1c150e; color: #f3e9d6; }
html body.sd-v2 :is(#screen-login, #screen-chars) .field label, html body.sd-v2 #create-form .cc-label { color: var(--v2-ink-2) !important; font-weight: 600; letter-spacing: .02em; }
html body.sd-v2 :is(#screen-login, #screen-chars) .field-hint, html body.sd-v2 #screen-chars .hint { color: var(--v2-ink-3) !important; }
html body.sd-v2 #screen-login .input-wrap, html body.sd-v2 #create-form input:not([type=checkbox]):not([type=radio]) {
  background: var(--v2-field) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 10px !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5) !important; color: var(--v2-ink) !important;
}
html body.sd-v2 #screen-login .input-wrap input { background: transparent !important; border-color: transparent !important; box-shadow: none !important; color: var(--v2-ink) !important; -webkit-text-fill-color: var(--v2-ink); caret-color: var(--v2-gold-l); }
html body.sd-v2 #screen-login .input-wrap input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #120d08 inset !important; -webkit-text-fill-color: var(--v2-ink) !important; }
html body.sd-v2 #screen-login .input-wrap:focus-within, html body.sd-v2 #create-form input:not([type=checkbox]):not([type=radio]):focus {
  border-color: var(--v2-gold) !important; outline: none !important; box-shadow: 0 0 0 3px rgba(226, 184, 102, .22), inset 0 2px 5px rgba(0, 0, 0, .5) !important;
}
html body.sd-v2 :is(#screen-login, #screen-chars) input::placeholder { color: rgba(243, 233, 214, .32) !important; -webkit-text-fill-color: rgba(243, 233, 214, .32) !important; }
/* fields the build adds outside .input-wrap (the recovery PIN, the forgot / change password steps) */
html body.sd-v2 #screen-login .auth-card :is(input:not([type=checkbox]):not([type=radio]), textarea, select:not(.btn)):not(.input-wrap *) {
  background: var(--v2-field) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 10px !important; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5) !important; color: var(--v2-ink) !important;
}
html body.sd-v2 #screen-login .auth-card :is(input:not([type=checkbox]):not([type=radio]), textarea, select:not(.btn)):not(.input-wrap *):focus { border-color: var(--v2-gold) !important; outline: none !important; box-shadow: 0 0 0 3px rgba(226, 184, 102, .22), inset 0 2px 5px rgba(0, 0, 0, .5) !important; }
html body.sd-v2 #screen-login .input-wrap :is(svg, .ico), html body.sd-v2 #screen-login .input-wrap button { color: var(--v2-gold) !important; }
html body.sd-v2 :is(#screen-login, #screen-chars) input[type=checkbox] { accent-color: var(--v2-gold); }
html body.sd-v2 :is(#screen-login, #screen-chars) .link-btn { color: var(--v2-gold-l) !important; }
html body.sd-v2 :is(#screen-login, #screen-chars) .link-btn:hover { color: #fff3cf !important; text-decoration: underline; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars) .msg { text-shadow: 0 1px 0 #000; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars) .chip { background: rgba(0, 0, 0, .35) !important; border: 1px solid var(--v2-line-2) !important; color: var(--v2-gold-l) !important; }

/* ---- login */
html body.sd-v2 #screen-login .auth-hero .logo { filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .65)) drop-shadow(0 0 34px rgba(226, 184, 102, .22)); }
html body.sd-v2 #screen-login .auth-tag {
  color: var(--v2-ink) !important; text-shadow: 0 2px 4px #000, 0 0 12px rgba(0, 0, 0, .8) !important; -webkit-text-stroke: 0 !important;
  letter-spacing: .03em;
  background: rgba(10, 7, 4, .6) !important; border: 1px solid var(--v2-line-2) !important; box-shadow: 0 4px 14px rgba(0, 0, 0, .4) !important;
}
html body.sd-v2 #screen-login .auth-tag::before, html body.sd-v2 #screen-login .auth-tag::after { content: ""; display: inline-block; vertical-align: middle; margin: 0 8px; width: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--v2-gold)); }
html body.sd-v2 #screen-login .auth-tag::after { transform: scaleX(-1); }
html body.sd-v2 #screen-login .auth-card { padding-top: 18px !important; }
html body.sd-v2 #screen-login .auth-card::before, html body.sd-v2 #screen-login .auth-card::after { display: none !important; }
html body.sd-v2 #screen-login .auth-tabs { background: rgba(0, 0, 0, .32) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 11px !important; padding: 3px !important; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45) !important; gap: 3px; }
html body.sd-v2 #screen-login .auth-tabs .tab {
  border: 0 !important; border-image: none !important; background: none !important; border-radius: 8px !important; box-shadow: none !important;
  color: var(--v2-ink-3) !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; transition: color .15s, background .15s;
}
html body.sd-v2 #screen-login .auth-tabs .tab:hover { color: var(--v2-ink) !important; }
html body.sd-v2 #screen-login .auth-tabs .tab:is(.active, .on, [aria-selected=true]) {
  background: linear-gradient(180deg, rgba(226, 184, 102, .3), rgba(226, 184, 102, .1)) !important; color: var(--v2-gold-l) !important;
  box-shadow: inset 0 0 0 1px rgba(226, 184, 102, .45), 0 0 12px rgba(226, 184, 102, .15) !important; text-shadow: 0 1px 0 #000 !important;
}
html body.sd-v2 #screen-login :is(.auth-row, .auth-switch, .check, .consent) { color: var(--v2-ink-2) !important; }
html body.sd-v2 #screen-login :is(.guest-card, .reg-closed) { background: rgba(0, 0, 0, .3) !important; border-color: var(--v2-line-2) !important; color: var(--v2-ink) !important; }
html body.sd-v2 #screen-login .pane-head h3 { color: var(--v2-gold-l) !important; }
html body.sd-v2 #screen-login .auth-foot :is(.btn, .server-pill) { background: rgba(12, 9, 6, .62) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 99px !important; color: var(--v2-ink-2) !important; box-shadow: 0 2px 10px rgba(0, 0, 0, .4) !important; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html body.sd-v2 #screen-login .auth-foot .server-pill { color: var(--v2-ink) !important; }
/* short screens (a phone on its side): the build lays these over the logo — no pill there, just the text */
@media (max-height: 560px) { html body.sd-v2 #screen-login .auth-foot :is(.btn, .server-pill) { background: none !important; border-color: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: 0 1px 2px #000, 0 0 6px #000 !important; } }
/* the news panel (fixes.js: the newest patch notes, under the logo on wide screens) */
.sdv2-news { position: relative; width: min(380px, 100%); margin-top: 18px; padding: 15px 18px 14px; text-align: left; pointer-events: auto; }
.sdv2-news h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: .06em; color: var(--v2-gold-l); text-shadow: 0 1px 0 #000; }
.sdv2-news h4::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--v2-line), transparent); }
.sdv2-news ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sdv2-news li button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--v2-ink); font-size: 13px; }
.sdv2-news li button:hover, .sdv2-news li button:focus-visible { background: rgba(226, 184, 102, .1); }
.sdv2-news .n-lb { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; color: #2b1a06; background: linear-gradient(180deg, #f6dfa2, #d1a24e); white-space: nowrap; }
.sdv2-news .n-lb.fix { background: linear-gradient(180deg, #b9d9f0, #6fa3c8); }
.sdv2-news .n-tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdv2-news .n-dt { font-size: 11px; color: var(--v2-ink-3); white-space: nowrap; }
.sdv2-news .n-all { all: unset; display: block; width: fit-content; margin: 6px 4px 0 auto; font-size: 12px; color: var(--v2-gold); cursor: pointer; text-align: right; }
.sdv2-news .n-all:hover { color: var(--v2-gold-l); text-decoration: underline; }
@media (max-width: 860px), (max-height: 600px) { .sdv2-news { display: none !important; } }

/* ---- channel select */
html body.sd-v2 #screen-chan .chan-bar-top { background: linear-gradient(180deg, rgba(8, 5, 2, .75), transparent) !important; border: 0 !important; box-shadow: none !important; }
html body.sd-v2 #screen-chan .chan-user { color: var(--v2-ink) !important; }
html body.sd-v2 #screen-chan .chan-sub { color: var(--v2-ink-2) !important; text-shadow: 0 1px 2px #000; background: none !important; border: 0 !important; box-shadow: none !important; }
html body.sd-v2 #screen-chan .chan-card { transition: border-color .15s, transform .15s, box-shadow .15s; }
html body.sd-v2 #screen-chan .chan-card:hover { border-color: var(--v2-gold) !important; transform: translateY(-2px); }
html body.sd-v2 #screen-chan .chan-card .chan-name { color: var(--v2-gold-l) !important; }
html body.sd-v2 #screen-chan .chan-card :is(.chan-last, .chan-rec) { background: linear-gradient(180deg, #f6dfa2, #d1a24e) !important; color: #2b1a06 !important; border-color: transparent !important; box-shadow: 0 2px 6px rgba(0, 0, 0, .45) !important; text-shadow: none !important; }
html body.sd-v2 #screen-chan .chan-head { background: rgba(10, 7, 4, .6) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 14px !important; padding: 8px 18px !important; box-shadow: 0 6px 20px rgba(0, 0, 0, .4) !important; }
html body.sd-v2 #screen-chan .chan-card .chan-badge { background: rgba(0, 0, 0, .35) !important; border: 1px solid var(--v2-line) !important; color: var(--v2-gold-l) !important; }

/* ---- character select */
html body.sd-v2 #screen-chars .cs-top { background: linear-gradient(180deg, rgba(8, 5, 2, .78), rgba(8, 5, 2, .35) 70%, transparent) !important; border: 0 !important; box-shadow: none !important; }
html body.sd-v2 #screen-chars .cs-logo { filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .6)); }
html body.sd-v2 #screen-chars .lastinfo { color: var(--v2-ink) !important; text-shadow: 0 1px 2px #000; background: rgba(10, 7, 4, .55) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 10px !important; }
html body.sd-v2 #screen-chars .lastinfo-sub { color: var(--v2-ink-2) !important; }
html body.sd-v2 #screen-chars .lastinfo-warn { color: #ffc46b !important; }
html body.sd-v2 #screen-chars .cs-chan { background: rgba(12, 9, 6, .62) !important; border: 1px solid var(--v2-line-2) !important; color: var(--v2-ink) !important; }
html body.sd-v2 #chars-preview::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse 95% 85% at 38% 50%, transparent 55%, rgba(6, 4, 2, .5) 100%); }
html body.sd-v2 #chars-preview .cs-plate { background: rgba(12, 9, 6, .72) !important; border: 1px solid var(--v2-line-2) !important; color: var(--v2-ink) !important; box-shadow: 0 2px 8px rgba(0, 0, 0, .45) !important; }
html body.sd-v2 #chars-preview .cs-plate small { color: var(--v2-ink-2) !important; }
html body.sd-v2 #chars-preview .cs-plate.sel { border-color: var(--v2-gold) !important; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 16px rgba(226, 184, 102, .35) !important; }
html body.sd-v2 #chars-preview .cs-plate.sel b { color: var(--v2-gold-l) !important; }
html body.sd-v2 #chars-select .cs-panel { padding: 16px 14px 12px !important; }
html body.sd-v2 #chars-select .cs-head .chip { right: 2px; }
html body.sd-v2 #chars-select .cs-info { background: rgba(0, 0, 0, .28) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 12px !important; box-shadow: none !important; }
html body.sd-v2 #chars-select .cs-info-main b { color: var(--v2-gold-l) !important; }
html body.sd-v2 #chars-select .cs-info-main small { color: var(--v2-ink-2) !important; }
html body.sd-v2 #chars-select .cs-card {
  background: linear-gradient(90deg, rgba(255, 236, 190, .06), rgba(255, 236, 190, .02)) !important; border: 1px solid var(--v2-line-2) !important;
  border-radius: 11px !important; box-shadow: none !important; color: var(--v2-ink) !important; transition: border-color .15s, background .15s, box-shadow .15s;
}
html body.sd-v2 #chars-select .cs-card:hover { border-color: var(--v2-line) !important; background: linear-gradient(90deg, rgba(255, 236, 190, .1), rgba(255, 236, 190, .03)) !important; }
html body.sd-v2 #chars-select .cs-card.selected {
  border-color: var(--v2-gold) !important; background: linear-gradient(90deg, rgba(226, 184, 102, .26), rgba(226, 184, 102, .05)) !important;
  box-shadow: inset 3px 0 0 var(--v2-gold), 0 0 0 1px rgba(0, 0, 0, .5), 0 0 18px rgba(226, 184, 102, .16) !important;
}
html body.sd-v2 #chars-select .cs-card .cs-main b { color: var(--v2-ink) !important; }
html body.sd-v2 #chars-select .cs-card.selected .cs-main b { color: var(--v2-gold-l) !important; }
html body.sd-v2 #chars-select .cs-card .cs-main small { color: var(--v2-ink-2) !important; }
html body.sd-v2 #chars-select .cs-card .cs-lv { color: var(--v2-gold) !important; background: none !important; font-weight: 800; text-shadow: 0 1px 0 #000; }
html body.sd-v2 #chars-select .cs-card.vacant { background: rgba(0, 0, 0, .18) !important; border-style: dashed !important; box-shadow: none !important; color: var(--v2-ink-2) !important; }
html body.sd-v2 #chars-select .cs-card.vacant:hover { border-color: var(--v2-gold) !important; color: var(--v2-gold-l) !important; }
html body.sd-v2 #chars-select .cs-plus { background: rgba(0, 0, 0, .35) !important; color: var(--v2-gold) !important; border-color: var(--v2-line) !important; }
html body.sd-v2 :is(#chars-select, #create-form) .cc-job-ico { box-shadow: 0 0 0 2px rgba(10, 7, 4, .9), 0 0 0 3px rgba(226, 184, 102, .55) !important; }
html body.sd-v2 #chars-select .cs-actions { border-top: 1px solid var(--v2-line-2); padding-top: 10px; }
html body.sd-v2 #chars-select .cs-keys { color: var(--v2-ink-3) !important; }

/* ---- character creation */
html body.sd-v2 #create-form .cc-panel { padding-top: 14px !important; }
html body.sd-v2 #create-form .cc-steps li button { color: var(--v2-ink-3) !important; }
html body.sd-v2 #create-form .cc-stepno {
  background: radial-gradient(circle at 50% 35%, #3b2c1c, #150f09) !important; border: 1px solid var(--v2-line) !important; border-radius: 50% !important;
  color: var(--v2-ink-2) !important; -webkit-text-stroke: 0 !important; box-shadow: 0 2px 6px rgba(0, 0, 0, .5) !important;
}
html body.sd-v2 #create-form .cc-steps li.active .cc-stepno {
  background: radial-gradient(circle at 50% 30%, #fbe9b8, #e2b866 55%, #a5722a) !important; border-color: #fbe9b8 !important;
  color: #2b1a06 !important; -webkit-text-stroke: 0 !important; box-shadow: 0 0 0 3px rgba(226, 184, 102, .22), 0 0 16px rgba(226, 184, 102, .45) !important;
}
html body.sd-v2 #create-form .cc-steps li.done .cc-stepno { color: var(--v2-gold-l) !important; border-color: var(--v2-gold) !important; }
html body.sd-v2 #create-form .cc-steps li:is(.active, .done) button { color: var(--v2-gold-l) !important; }
html body.sd-v2 #create-form .cc-steps li + li::before { background: repeating-linear-gradient(90deg, rgba(226, 184, 102, .28) 0 6px, transparent 6px 10px) !important; }
html body.sd-v2 #create-form .cc-steps li.done + li::before, html body.sd-v2 #create-form .cc-steps li.done::before, html body.sd-v2 #create-form .cc-steps li.active::before { background: repeating-linear-gradient(90deg, var(--v2-gold) 0 6px, transparent 6px 10px) !important; }
html body.sd-v2 #create-form :is(.seg, .sdcc-cam) { background: rgba(0, 0, 0, .32) !important; border: 1px solid var(--v2-line-2) !important; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4) !important; }
html body.sd-v2 #create-form .seg-btn { background: none !important; border: 0 !important; color: var(--v2-ink-2) !important; box-shadow: none !important; text-shadow: none !important; }
html body.sd-v2 #create-form .seg-btn.active { background: linear-gradient(180deg, rgba(226, 184, 102, .32), rgba(226, 184, 102, .12)) !important; color: var(--v2-gold-l) !important; box-shadow: inset 0 0 0 1px rgba(226, 184, 102, .5) !important; }
html body.sd-v2 #create-form .cc-job { background: linear-gradient(180deg, rgba(255, 236, 190, .06), rgba(255, 236, 190, .02)) !important; border: 1px solid var(--v2-line-2) !important; border-radius: 12px !important; box-shadow: none !important; color: var(--v2-ink) !important; transition: border-color .15s, background .15s; }
html body.sd-v2 #create-form .cc-job:hover { border-color: var(--v2-line) !important; }
html body.sd-v2 #create-form .cc-job.selected { border-color: var(--v2-gold) !important; background: linear-gradient(180deg, rgba(226, 184, 102, .26), rgba(226, 184, 102, .07)) !important; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 18px rgba(226, 184, 102, .18) !important; }
html body.sd-v2 #create-form .cc-job .cc-job-main b { color: var(--v2-ink) !important; }
html body.sd-v2 #create-form .cc-job.selected .cc-job-main b { color: var(--v2-gold-l) !important; }
html body.sd-v2 #create-form .cc-job .cc-job-main small { color: var(--v2-ink-2) !important; }
html body.sd-v2 #create-form :is(.cc-jobdetail, .cc-sumcard, .sdcc-sec) { background: rgba(0, 0, 0, .28) !important; border: 1px solid var(--v2-line-2) !important; box-shadow: none !important; border-radius: 12px !important; color: var(--v2-ink) !important; }
html body.sd-v2 #create-form :is(.sec-title, .sdcc-sec header b) { color: var(--v2-gold-l) !important; }
html body.sd-v2 #create-form :is(.cc-statrow span, .sdcc-cur, .sdcc-subhead, .hint) { color: var(--v2-ink-2) !important; }
html body.sd-v2 #create-form .bar { border-color: #0d0905 !important; box-shadow: inset 0 2px 3px #000a, 0 0 0 1px rgba(226, 184, 102, .35) !important; }
html body.sd-v2 #create-form :is(.sdcc-tile, .sdcc-face, .sdcc-chip) { background: radial-gradient(circle at 50% 30%, rgba(255, 236, 190, .1), rgba(0, 0, 0, .25)) !important; border-color: var(--v2-line-2) !important; color: var(--v2-ink-2) !important; }
html body.sd-v2 #create-form :is(.sdcc-tile, .sdcc-face, .sdcc-chip):hover { border-color: var(--v2-line) !important; }
html body.sd-v2 #create-form :is(.sdcc-tile, .sdcc-face, .sdcc-chip).on { border-color: var(--v2-gold) !important; background: radial-gradient(circle at 50% 30%, rgba(226, 184, 102, .35), rgba(226, 184, 102, .08)) !important; color: var(--v2-gold-l) !important; box-shadow: 0 0 0 2px rgba(226, 184, 102, .25), 0 0 12px rgba(226, 184, 102, .25) !important; }
html body.sd-v2 #create-form .sdcc-tile span { color: var(--v2-ink-3) !important; }
html body.sd-v2 #create-form .sdcc-tile.on span { color: var(--v2-gold-l) !important; }
html body.sd-v2 #create-form .sdcc-sw.on { box-shadow: 0 0 0 2px #0d0905, 0 0 0 4px var(--v2-gold) !important; }
html body.sd-v2 #create-form .sdcc-arr button { background: rgba(0, 0, 0, .35) !important; border: 1px solid var(--v2-line-2) !important; color: var(--v2-gold-l) !important; }
html body.sd-v2 #create-form .cc-summary { color: var(--v2-ink) !important; }
html body.sd-v2 #create-form .cc-nav { border-top: 1px solid var(--v2-line-2); padding-top: 10px; }

/* ---- loading */
html body.sd-v2 #loading .loading-logo { filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .65)) drop-shadow(0 0 30px rgba(226, 184, 102, .2)); }
html body.sd-v2 #loading .loading-mascot { display: none !important; }
html body.sd-v2 #loading .loading-box { padding: 16px 22px 14px !important; width: min(560px, calc(100vw - 32px)); }
html body.sd-v2 #loading #loading-text { color: var(--v2-gold-l) !important; text-shadow: 0 1px 0 #000 !important; -webkit-text-stroke: 0 !important; letter-spacing: .04em; }
html body.sd-v2 #loading #loading-bar { background: #0d0905 !important; border: 1px solid #000 !important; box-shadow: inset 0 2px 4px #000, 0 0 0 1px rgba(226, 184, 102, .4) !important; }
html body.sd-v2 #loading #loading-bar i { background: linear-gradient(90deg, #8a5a1e, #e2b866 70%, #fbe9b8) !important; box-shadow: 0 0 12px rgba(240, 190, 90, .55), inset 0 1px 0 rgba(255, 255, 255, .45) !important; }
html body.sd-v2 #loading #loading-bar span { color: #fff7e2 !important; text-shadow: 0 1px 2px #000 !important; -webkit-text-stroke: 0 !important; }
html body.sd-v2 #loading .loading-tip { color: var(--v2-ink-2) !important; text-shadow: 0 1px 0 #000 !important; background: rgba(0, 0, 0, .32) !important; border: 1px solid var(--v2-line-2) !important; box-shadow: none !important; }

/* phase 88: the admin's backgrounds hide the build's art until theirs is ready (fixes.js adds html.sd-bg-ready; a slow or
   missing answer shows the build's art after 2.5 s anyway) */
html:not(.sd-bg-ready) body :is(#screen-login, #screen-chan, #screen-chars, #loading)::before { opacity: 0; animation: sd-bg-late .5s 2.5s forwards !important; }
@keyframes sd-bg-late { to { opacity: 1; } }
html.sd-bg-ready body :is(#screen-login, #screen-chan, #screen-chars, #loading)::before { transition: opacity .5s; }
html body.sd-v2 :is(#screen-login, #screen-chan, #screen-chars, #loading) { background-color: #0c0906 !important; }

/* ---- phase 91: the server window "เลือกเซิร์ฟเวอร์" (fixes.js __sdSrv) — regions left, channels as tiles right */
#win-sdsrv { --win-w: 760px; width: min(760px, 96vw) !important; }
#win-sdsrv .sd-srv-body { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; padding: 10px 12px 12px; max-height: min(72vh, 600px); max-height: min(72dvh, 600px); overflow: auto; color: #3b2d20; }
#win-sdsrv h4 { margin: 0 0 6px; font-size: 13px; color: #8b5e3c; border-bottom: 1.5px solid #ead8bd; padding-bottom: 3px; }
#win-sdsrv .sd-srv-rlist { display: flex; flex-direction: column; gap: 6px; }
#win-sdsrv .sd-srv-r { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fffdf8; border: 2px solid #e6cba4; box-shadow: 0 2px 0 #e6cba4; }
#win-sdsrv .sd-srv-r.other { cursor: pointer; }
#win-sdsrv .sd-srv-r.other:hover { border-color: #38b4ea; }
#win-sdsrv .sd-srv-r.here { border-color: #e2a53a; background: linear-gradient(90deg, #fff4dc, #fffdf8); box-shadow: 0 0 0 2px rgba(226, 165, 58, .25), 0 2px 0 #d8a24a; }
#win-sdsrv .sd-srv-r.off { opacity: .65; }
#win-sdsrv .sd-srv-code { min-width: 40px; padding: 4px 6px; border-radius: 8px; text-align: center; font-weight: 800; font-size: 13px; letter-spacing: .04em; color: #fff; background: linear-gradient(180deg, #4a6fa8, #2c4a7a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
#win-sdsrv .sd-srv-r.here .sd-srv-code { color: #5a3a08; background: linear-gradient(180deg, #fbe39e, #e2b05a); }
#win-sdsrv .sd-srv-rmain { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#win-sdsrv .sd-srv-rmain b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#win-sdsrv .ping { font-size: 12px; font-weight: 600; color: #8a735c; }
#win-sdsrv .ping.good { color: #2f8a3c; } #win-sdsrv .ping.mid { color: #c27a12; } #win-sdsrv .ping.bad { color: #c0392b; }
#win-sdsrv .ping em { font-style: normal; color: #2f8a3c; }
#win-sdsrv .sd-srv-rn { font-weight: 700; font-size: 13px; white-space: nowrap; }
#win-sdsrv .sd-srv-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.55; color: #6a5440; }
#win-sdsrv .sd-srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 7px; }
#win-sdsrv .sd-srv-ch { all: unset; box-sizing: border-box; position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 4px 6px; padding: 6px 8px 7px; border-radius: 10px; background: #fffdf8; border: 2px solid #e6cba4; box-shadow: 0 2px 0 #e6cba4; cursor: pointer; transition: transform .12s, border-color .12s; }
#win-sdsrv .sd-srv-ch:hover { transform: translateY(-1px); border-color: #38b4ea; }
#win-sdsrv .sd-srv-ch[aria-disabled=true] { cursor: default; transform: none; }
#win-sdsrv .sd-srv-no { grid-row: 1; min-width: 30px; height: 30px; padding: 0 4px; display: grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: 16px; color: #fff; background: linear-gradient(180deg, #34b07a, #1e7f57); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
#win-sdsrv .sd-srv-ch.busy .sd-srv-no { background: linear-gradient(180deg, #f3b13a, #d0861a); }
#win-sdsrv .sd-srv-ch.full .sd-srv-no { background: linear-gradient(180deg, #e2604f, #b83a2c); }
#win-sdsrv .sd-srv-ch.full { opacity: .8; }
#win-sdsrv .sd-srv-ch.here { border-color: #e2a53a; background: linear-gradient(180deg, #fff4dc, #fffdf8); box-shadow: 0 0 0 2px rgba(226, 165, 58, .3), 0 2px 0 #d8a24a; }
#win-sdsrv .sd-srv-pp { justify-self: end; display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: #5b4532; }
#win-sdsrv .sd-srv-pp svg { width: 13px; height: 13px; fill: #8a735c; }
#win-sdsrv .sd-srv-bar { grid-column: 1 / -1; display: block; height: 5px; border-radius: 99px; background: #ead8bd; overflow: hidden; }
#win-sdsrv .sd-srv-bar i { display: block; height: 100%; border-radius: inherit; background: #34b07a; }
#win-sdsrv .sd-srv-ch.busy .sd-srv-bar i { background: #e89a22; }
#win-sdsrv .sd-srv-ch.full .sd-srv-bar i { background: #d24b3c; }
#win-sdsrv .sd-srv-tag { position: absolute; top: -8px; right: 6px; padding: 0 6px; border-radius: 99px; font-size: 10px; font-weight: 700; color: #fff; background: #e2a53a; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
#win-sdsrv .sd-srv-ch.full .sd-srv-tag { background: #c0392b; }
#win-sdsrv .sd-srv-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: #6a5440; }
#win-sdsrv .sd-srv-legend span { display: inline-flex; align-items: center; gap: 5px; }
#win-sdsrv .lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
#win-sdsrv .lg.free { background: #2a9a6a; } #win-sdsrv .lg.busy { background: #e89a22; } #win-sdsrv .lg.full { background: #d24b3c; }
#win-sdsrv .lg.here { background: #fff4dc; box-shadow: inset 0 0 0 2px #e2a53a; }
#win-sdsrv .sd-srv-ask { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #fff4dc; border: 1.5px solid #e6cba4; font-size: 13px; }
#win-sdsrv .sd-srv-ask span { flex: 1; min-width: 160px; }
#win-sdsrv .sd-srv-empty { grid-column: 1 / -1; padding: 16px; text-align: center; color: #8a735c; font-size: 13px; }
/* short screens (a phone on its side): two columns still, the channels in view — compact regions, no note */
@media (max-height: 480px) {
  #win-sdsrv .sd-srv-body { grid-template-columns: minmax(170px, 230px) 1fr; gap: 10px; padding: 6px 8px 8px; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); }
  #win-sdsrv .sd-srv-note { display: none; }
  #win-sdsrv .sd-srv-r { padding: 5px 8px; gap: 6px; }
  #win-sdsrv .sd-srv-rmain b { font-size: 12.5px; }
  #win-sdsrv .sd-srv-code { min-width: 34px; padding: 3px 4px; font-size: 12px; }
  #win-sdsrv .sd-srv-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
  #win-sdsrv .sd-srv-legend { margin-top: 6px; font-size: 11px; }
}
/* narrow screens: one column, the channels first */
@media (max-width: 560px) {
  #win-sdsrv .sd-srv-body { grid-template-columns: 1fr; }
  #win-sdsrv .sd-srv-right { order: -1; }
  #win-sdsrv .sd-srv-note { display: none; }
}
#win-sdsrv .sd-srv-ask .btn { min-width: 68px; }
