/* tac-ui.css — HUD แบบเกมแทคติก (FAA.tacui) · โหลดหลัง game.css
   หน้าต่างกระดาษ parchment + ขอบน้ำตาลสองชั้น + แถบหัวน้ำเงินเข้ม + เส้นทอง · เงาตันไม่ฟุ้ง */
:root {
  --tu-ink: #2b1a0c;        /* ตัวหนังสือบนกระดาษ (contrast > 12:1) */
  --tu-ink2: #5a3d22;       /* ตัวรอง (≥ 7:1 บน #f3e6c4) */
  --tu-brown: #3a2312;      /* เส้นขอบนอก */
  --tu-tan: #a9824c;        /* เส้นขอบใน */
  --tu-gold: #e2b54a;
  --tu-gold2: #f7dc8a;
  --tu-blue: #0d3a78;
  --tu-blue2: #1a56a6;
  --tu-night: #0a2147;
  --tu-paper: #fbf3dd;
  --tu-paper2: #ecdcb3;
  --tu-red: #c42c22;
  --tu-green: #1d8a4a;
}

/* ---------- หน้าต่าง ---------- */
.tu-win {
  position: relative; color: var(--tu-ink);
  border: 2px solid var(--tu-brown); border-radius: 6px;
  background-color: var(--tu-paper);
  background-image:
    radial-gradient(circle at 3px 3px, var(--tu-gold) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 3px) 3px, var(--tu-gold) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 3px calc(100% - 3px), var(--tu-gold) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 3px) calc(100% - 3px), var(--tu-gold) 0 1.6px, transparent 2.2px),
    repeating-radial-gradient(circle at 17% 23%, rgba(120,80,30,.045) 0 1px, transparent 1px 5px),
    repeating-radial-gradient(circle at 81% 67%, rgba(120,80,30,.04) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(97deg, rgba(255,255,255,.18) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, var(--tu-paper) 0%, #f3e6c4 55%, var(--tu-paper2) 100%);
  box-shadow: inset 0 0 0 1px #fffaea, inset 0 0 0 2px var(--tu-tan), inset 0 -6px 10px -6px rgba(110,70,25,.25), 0 3px 0 rgba(32,16,4,.45);
  font-family: var(--f, "Noto Sans Thai", sans-serif);
}
.tu-win-title {
  position: relative; margin: 0; display: flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; min-height: 24px;
  font: 600 .8rem/1.2 var(--fh, Kanit, sans-serif); letter-spacing: .02em; color: #fff;
  background: linear-gradient(180deg, #2a66b8 0%, var(--tu-blue) 48%, var(--tu-night) 100%);
  border-bottom: 1px solid var(--tu-gold);
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 1px 0 #6b4a20;
  text-shadow: 0 1px 0 #041633;
}
.tu-win-title::after { content: ""; flex: 1; height: 1px; margin-left: 6px; background: linear-gradient(90deg, var(--tu-gold), transparent); opacity: .75; }
.tu-gem { width: 7px; height: 7px; transform: rotate(45deg); background: linear-gradient(135deg, var(--tu-gold2), #b9821f); box-shadow: 0 0 0 1px #3a2312; flex: 0 0 auto; }
.tu-win-body { position: relative; padding: 8px 10px; }
.tu-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* ---------- ถุงมือชี้ ---------- */
.tu-glove { width: 30px; height: 22px; display: block; overflow: visible; filter: drop-shadow(1px 1.5px 0 rgba(30,15,4,.55)); }

/* ---------- การ์ดยูนิต ---------- */
.tu-card { display: flex; gap: 8px; align-items: stretch; padding: 7px 9px 7px 7px; min-width: 0; }
.tu-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.tu-por-slot { flex: 0 0 auto; display: flex; }
.tu-por {
  position: relative; width: 52px; height: 52px; border-radius: 4px; overflow: hidden; display: block;
  border: 2px solid var(--tu-brown);
  box-shadow: inset 0 0 0 1.5px var(--tu-gold), 0 2px 0 rgba(32,16,4,.35);
  background: radial-gradient(90% 80% at 50% 30%, #6fa6e6 0%, #2a5fae 55%, #123a78 100%);
}
.side-patient .tu-por { background: radial-gradient(90% 80% at 50% 30%, #f6b3a0 0%, #c2554a 58%, #7c2420 100%); }
.tu-por img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; image-rendering: auto; }
.tu-por.pix img { image-rendering: pixelated; }
.tu-por.wide img { width: 300%; max-width: none; left: -6%; height: 120%; top: -14%; object-fit: cover; object-position: 0 40%; }
.tu-por.tall img { object-position: 50% 4%; height: 230%; }
.tu-por::after { content: ""; position: absolute; inset: 0; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); background: linear-gradient(160deg, rgba(255,255,255,.22) 0 22%, transparent 23%); pointer-events: none; }
.tu-por .tu-ico { width: 100%; height: 100%; }
.tu-card-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tu-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.tu-name { font: 600 .92rem/1.2 var(--fh, Kanit, sans-serif); color: var(--tu-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tu-job { font: 500 .7rem/1.25 var(--fh, Kanit, sans-serif); color: var(--tu-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-ally .tu-name { color: #0b2f66; }
.side-patient .tu-name { color: #8a1c15; }
.tu-lv { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 2px; padding: 1px 6px; border-radius: 3px;
  background: linear-gradient(180deg, #164f9e, var(--tu-night)); color: #fff; border: 1px solid var(--tu-brown); box-shadow: inset 0 0 0 1px rgba(226,181,74,.7); }
.tu-lv[hidden], .tu-job[hidden] { display: none; }
.tu-lv small { font: 600 .58rem/1 var(--fh, Kanit, sans-serif); color: var(--tu-gold2); }
.tu-lv b { font: 700 .82rem/1.1 var(--fh, Kanit, sans-serif); font-variant-numeric: tabular-nums; }

/* แถบ HP/MP แบ่งช่อง */
.tu-stat { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 5px; }
.tu-stat-l { font: 700 .66rem/1 var(--fh, Kanit, sans-serif); letter-spacing: .04em; color: var(--tu-blue); }
.tu-mp .tu-stat-l { color: #6a2fa0; }
.tu-stat-n { font: 600 .78rem/1 var(--fh, Kanit, sans-serif); font-variant-numeric: tabular-nums; color: var(--tu-ink); white-space: nowrap; min-width: 4.4em; text-align: right; }
.tu-stat-n small { font-size: .66rem; color: var(--tu-ink2); font-weight: 500; }
.tu-bar {
  position: relative; display: block; height: 10px; border-radius: 2px; overflow: hidden;
  background: linear-gradient(180deg, #160d05, #3b2614);
  border: 1px solid var(--tu-brown); box-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.tu-bar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.tu-bar-lag { width: 0; background: #ffe7a6; transition: width .55s cubic-bezier(.3,.7,.3,1); }
.tu-bar-lag.down { background: linear-gradient(180deg, #ff8a7a, #d63a2c); }
.tu-bar-lag.up { background: linear-gradient(180deg, #e9ffd8, #9fe39a); transition-duration: .18s; }
.tu-bar-fill { width: 0; transition: width .5s cubic-bezier(.3,.7,.3,1);
  background: linear-gradient(180deg, #b6f59a 0%, #4dc35c 45%, #1f8a3d 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.55); }
.tu-bar[data-tone="warn"] .tu-bar-fill { background: linear-gradient(180deg, #fff0a2 0%, #f0c23a 45%, #c48a12 100%); }
.tu-bar[data-tone="bad"] .tu-bar-fill { background: linear-gradient(180deg, #ffb2a4 0%, #ec4d3a 45%, #a8241a 100%); }
.tu-bar[data-tone="mp"] .tu-bar-fill { background: linear-gradient(180deg, #c8d6ff 0%, #6f86f0 45%, #3443b8 100%); }
.tu-bar-seg { right: 0; z-index: 1; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(20,10,2,.75) calc(10% - 1px) 10%); }
.tu-bar.tu-now i { transition: none !important; }
.tu-hit .tu-bar { animation: tuBarHit .42s ease-out; }
.tu-heal .tu-bar { animation: tuBarHeal .6s ease-out; }
@keyframes tuBarHit { 0% { box-shadow: 0 0 0 2px #ff5040; } 100% { box-shadow: 0 1px 0 rgba(255,255,255,.6); } }
@keyframes tuBarHeal { 0% { box-shadow: 0 0 0 2px #7fe07a; } 100% { box-shadow: 0 1px 0 rgba(255,255,255,.6); } }

.tu-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.tu-chip { font: 600 .64rem/1.3 var(--fh, Kanit, sans-serif); padding: 0 6px; border-radius: 999px; color: #fff; background: #5d4a33; border: 1px solid var(--tu-brown); }
.tu-chip.k-bad { background: #a8241a; }
.tu-chip.k-warn { background: #8a5a00; }
.tu-chip.k-good { background: #17733d; }
.tu-chip.k-info { background: #1a4f96; }

.tu-delta { position: absolute; right: 14px; top: 4px; z-index: 3; pointer-events: none; font: 700 1.05rem/1 var(--fh, Kanit, sans-serif);
  color: #fff; -webkit-text-stroke: 3px #7a120c; paint-order: stroke fill; animation: tuDelta 1.05s ease-out forwards; }
.tu-delta.heal { -webkit-text-stroke-color: #0c5a28; }
@keyframes tuDelta { 0% { transform: translateY(8px) scale(.6); opacity: 0; } 18% { transform: translateY(-4px) scale(1.15); opacity: 1; } 70% { transform: translateY(-10px); opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
.tu-shake { animation: tuShake .36s ease-out; }
.tu-glow { animation: tuGlow .7s ease-out; }
@keyframes tuShake { 0%,100% { translate: 0 0; } 20% { translate: -4px 0; } 40% { translate: 3px 0; } 60% { translate: -2px 0; } 80% { translate: 1px 0; } }
@keyframes tuGlow { 0% { box-shadow: inset 0 0 0 1px #fffaea, inset 0 0 0 3px #6fd36b, 0 3px 0 rgba(32,16,4,.45); } 100% { box-shadow: inset 0 0 0 1px #fffaea, inset 0 0 0 2px var(--tu-tan), 0 3px 0 rgba(32,16,4,.45); } }

/* ---------- เมนูคำสั่ง ---------- */
.tu-menu .tu-win-body { padding: 5px 6px 6px 28px; }
.tu-cmds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.tu-cmd-b {
  display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 34px; padding: 3px 8px;
  border: 0; border-radius: 3px; background: transparent; text-align: left; color: var(--tu-ink);
  font: 600 .95rem/1.2 var(--fh, Kanit, sans-serif);
}
.tu-menu.pick .tu-cmd-b { min-height: 44px; cursor: pointer; }
.tu-cmd-h { font: 500 .68rem/1.25 var(--f, sans-serif); color: var(--tu-ink2); }
.tu-cmd + .tu-cmd { border-top: 1px dashed rgba(120,84,40,.35); }
.tu-cmd.on .tu-cmd-b {
  color: #fff; text-shadow: 0 1px 0 #041633;
  background: linear-gradient(90deg, var(--tu-blue2) 0%, var(--tu-blue) 70%, rgba(13,58,120,.0) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 2px 0 0 var(--tu-gold);
}
.tu-cmd.on .tu-cmd-h { color: #ffe9a8; }
.tu-cmd.off .tu-cmd-b { color: #8b7454; }
.tu-cmd.off .tu-cmd-l { text-decoration: line-through; text-decoration-color: rgba(120,84,40,.5); }
.tu-menu.pick .tu-cmd-b:hover:not(:disabled) { background: rgba(26,86,166,.12); }
.tu-menu.pick .tu-cmd.on .tu-cmd-b:hover { background: linear-gradient(90deg, var(--tu-blue2) 0%, var(--tu-blue) 70%, rgba(13,58,120,0) 100%); }
.tu-cmd-b:focus-visible { outline: 3px solid #ffb400; outline-offset: -1px; }
.tu-ptr { position: absolute; left: -2px; top: 0; margin-top: -11px; z-index: 2; pointer-events: none; transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.tu-ptr.tu-now { transition: none; }
.tu-ptr .tu-glove { animation: tuPoint .9s ease-in-out infinite; }
@keyframes tuPoint { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.tu-menu.tu-pulse .tu-cmd.on .tu-cmd-b { animation: tuSel .32s ease-out; }
@keyframes tuSel { 0% { filter: brightness(1.6); } 100% { filter: none; } }

/* ---------- ลำดับเทิร์น ---------- */
.tu-order {
  display: flex; align-items: center; gap: 6px; padding: 0 7px 5px;
  border-radius: 6px; border: 2px solid var(--tu-brown);
  background: linear-gradient(180deg, rgba(23,60,118,.94), rgba(8,26,58,.94));
  box-shadow: inset 0 0 0 1px rgba(226,181,74,.75), 0 2px 0 rgba(0,0,0,.35);
  color: #fff; max-width: 100%;
}
.tu-order:not(.vert) .tu-order-cap { display: none; }
.tu-order-cap { font: 700 .62rem/1 var(--fh, Kanit, sans-serif); color: var(--tu-gold2); writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; padding: 2px 0; border-right: 1px solid rgba(226,181,74,.5); padding-left: 3px; }
.tu-order-list { list-style: none; margin: 0; padding: 7px 2px 0; display: flex; gap: 6px; min-width: 0; overflow: visible; flex-wrap: nowrap; }
.tu-oc { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .35s cubic-bezier(.3,.7,.3,1), opacity .3s; }
.tu-oc.tu-in { animation: tuIn .35s ease-out; }
@keyframes tuIn { from { opacity: 0; transform: translateY(-8px) scale(.7); } }
.tu-oc-face { position: relative; width: 34px; height: 34px; border-radius: 4px; overflow: hidden; display: block;
  border: 2px solid #c9d6ea; background: radial-gradient(90% 80% at 50% 30%, #6fa6e6, #123a78); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.tu-oc.k-patient .tu-oc-face { border-color: #ffb3a8; background: radial-gradient(90% 80% at 50% 30%, #f6b3a0, #7c2420); }
.tu-oc.k-npc .tu-oc-face { border-color: #cfc6b4; background: radial-gradient(90% 80% at 50% 30%, #d6d0c2, #6c6455); }
.tu-oc.k-ally .tu-oc-face { border-color: #a8f0c4; background: radial-gradient(90% 80% at 50% 30%, #c8f5dc, #2d7f52); }
.tu-oc.k-ambulance .tu-oc-face { border-color: #ffe08a; background: radial-gradient(90% 80% at 50% 30%, #fff6d8, #c99a2e); }
.tu-oc-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; image-rendering: auto; }
.tu-oc-face.pix img { image-rendering: pixelated; }
.tu-oc-face.wide img { width: 300%; max-width: none; height: 120%; top: -14%; left: -6%; object-position: 0 40%; }
.tu-oc-face.tall img { height: 230%; object-position: 50% 4%; }
.tu-oc-face .tu-ico { width: 100%; height: 100%; }
.tu-oc.now .tu-oc-face { border-color: var(--tu-gold2); box-shadow: 0 0 0 2px var(--tu-brown), 0 0 0 3px var(--tu-gold); }
.tu-oc.now::before { content: ""; position: absolute; top: -7px; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top: 6px solid var(--tu-gold2); border-bottom: 0; z-index: 2; animation: tuBob .8s ease-in-out infinite; filter: drop-shadow(0 1px 0 #3a2312); }
@keyframes tuBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(2px); } }
.tu-oc-ct { display: block; width: 34px; height: 4px; border-radius: 2px; background: #061632; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.tu-oc-ct i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fc8ff, #e9f6ff); transition: width .5s ease; }
.tu-oc.now .tu-oc-ct i { background: linear-gradient(90deg, #f0b93a, #fff0b2); }
.tu-oc.k-ambulance .tu-oc-ct i { background: linear-gradient(90deg, #ff7a5c, #ffd2c4); }
.tu-oc-txt { display: none; }
.tu-oc-n { font: 600 .74rem/1.2 var(--fh, Kanit, sans-serif); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tu-oc-v { font: 500 .64rem/1.2 var(--fh, Kanit, sans-serif); color: #cfe0ff; font-variant-numeric: tabular-nums; }
.tu-oc.now .tu-oc-v { color: var(--tu-gold2); }

/* ---------- แถบประกาศ ---------- */
.tu-banner { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; }
.tu-banner::before { content: ""; position: absolute; inset: 0; background: rgba(4,12,28,.28); opacity: 0; transition: opacity .25s; }
.tu-banner.show::before { opacity: 1; }
.tu-banner.hide::before { opacity: 0; }
.tu-banner.in-box { position: absolute; z-index: 9; border-radius: inherit; }
.tu-band {
  --bc1: rgba(14,52,110,.0); --bc2: rgba(10,38,84,.93); --tc: #fff; --oc: var(--tu-gold);
  position: relative; width: 100%; padding: 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--bc1) 0%, var(--bc2) 18%, var(--bc2) 82%, var(--bc1) 100%);
  transform: scaleY(0); opacity: 0; transition: transform .26s cubic-bezier(.2,.9,.3,1.2), opacity .2s;
}
.tu-band-t { display: flex; flex-direction: column; align-items: center; transform: translateX(60vw); opacity: 0; transition: transform .38s cubic-bezier(.15,.85,.25,1.05) .08s, opacity .25s .08s; }
.tu-band-main {
  font: 700 clamp(1.6rem, 7.4vw, 2.6rem)/1.15 var(--fh, Kanit, sans-serif); letter-spacing: .03em; color: var(--tc);
  -webkit-text-stroke: 5px #0a1a36; paint-order: stroke fill; text-shadow: 0 3px 0 #0a1a36; white-space: nowrap;
}
.tu-band-sub { font: 600 .85rem/1.3 var(--fh, Kanit, sans-serif); color: var(--tu-gold2); -webkit-text-stroke: 3px #0a1a36; paint-order: stroke fill; }
.tu-orn { display: flex; align-items: center; width: min(92%, 460px); height: 8px; transform: scaleX(0); transition: transform .4s cubic-bezier(.2,.8,.3,1) .05s; }
.tu-orn i { flex: 1; height: 0; border-top: 1px solid var(--oc); border-bottom: 1px solid var(--oc); padding-top: 2px; opacity: .95; }
.tu-orn i:first-child { background: none; -webkit-mask: linear-gradient(90deg, transparent, #000 40%); mask: linear-gradient(90deg, transparent, #000 40%); }
.tu-orn i:last-child { -webkit-mask: linear-gradient(270deg, transparent, #000 40%); mask: linear-gradient(270deg, transparent, #000 40%); }
.tu-orn b { width: 9px; height: 9px; margin: 0 8px; transform: rotate(45deg); background: var(--oc); box-shadow: 0 0 0 1.5px #0a1a36, -14px 14px 0 -2px var(--oc), 14px -14px 0 -2px var(--oc); flex: 0 0 auto; }
.tu-banner.show .tu-band { transform: scaleY(1); opacity: 1; }
.tu-banner.show .tu-band-t { transform: translateX(0); opacity: 1; }
.tu-banner.show .tu-orn { transform: scaleX(1); }
.tu-banner.hide .tu-band { transform: scaleY(0); opacity: 0; transition-delay: .1s; }
.tu-banner.hide .tu-band-t { transform: translateX(-60vw); opacity: 0; transition: transform .3s cubic-bezier(.6,0,.9,.4), opacity .3s; }
.tu-banner.k-start .tu-band-main { color: #fff6d6; }
.tu-banner.k-clear .tu-band { --bc2: rgba(120,78,8,.92); --oc: #fff0b2; }
.tu-banner.k-clear .tu-band-main { color: #fff3c4; -webkit-text-stroke-color: #4a2a00; text-shadow: 0 3px 0 #4a2a00; }
.tu-banner.k-fail .tu-band { --bc2: rgba(110,16,12,.92); --oc: #ffb3a8; }
.tu-banner.k-fail .tu-band-main { -webkit-text-stroke-color: #3a0604; text-shadow: 0 3px 0 #3a0604; }
.tu-banner.k-turn .tu-band { padding: 7px 16px; }
.tu-banner.k-turn .tu-band-main { font-size: clamp(1.2rem, 5.6vw, 1.8rem); }
.tu-banner.k-info .tu-band { --bc2: rgba(30,40,56,.9); --oc: #d8e2f0; }
.tu-banner.k-info .tu-band-main { font-size: clamp(1.15rem, 5.2vw, 1.7rem); white-space: normal; text-align: center; }
.tu-banner.in-box .tu-band-main { font-size: clamp(1.3rem, 6.4vw, 2.2rem); }

/* ---------- ผิวกล่องบทพูด (FAA.say) · ใส่คลาส tac-skin ที่ .dlg หรือบรรพบุรุษ ---------- */
.tac-skin .dlg-box, .dlg.tac-skin .dlg-box {
  color: var(--tu-ink); outline: 0; border: 2px solid var(--tu-brown); border-radius: 6px;
  background: repeating-linear-gradient(97deg, rgba(255,255,255,.18) 0 1px, transparent 1px 9px), linear-gradient(180deg, var(--tu-paper) 0%, #f3e6c4 55%, var(--tu-paper2) 100%);
  box-shadow: inset 0 0 0 1px #fffaea, inset 0 0 0 2px var(--tu-tan), 0 3px 0 rgba(32,16,4,.45);
}
.tac-skin .dlg-who { background: linear-gradient(180deg, #2a66b8, var(--tu-night)); color: #fff; border: 2px solid var(--tu-brown); box-shadow: inset 0 0 0 1px var(--tu-gold); border-radius: 4px; }
.tac-skin .dlg-text { color: var(--tu-ink); }
.tac-skin .dlg-face { border: 2px solid var(--tu-brown); box-shadow: inset 0 0 0 1.5px var(--tu-gold); background: radial-gradient(90% 80% at 50% 30%, #6fa6e6, #123a78); border-radius: 4px; }
.tac-skin .dlg-more { border-top-color: var(--tu-blue); }

/* ---------- เลย์เอาต์ HUD รอบเวที ---------- */
.tu-hud { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; width: 100%; }
.tu-hud-stage { position: relative; min-width: 0; }
.tu-hud-stage > .tu-order.tu-over { position: absolute; left: 6px; top: 6px; z-index: 8; max-width: calc(100% - 12px); }
.tu-hud-side { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 6px; align-items: start; min-width: 0; }
.tu-hud-cards { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-self: stretch; }
.tu-hud-cards > .tu-card { flex: 1 1 0; }
.tu-hud-side > .tu-menu { align-self: stretch; }
.tu-hud .tu-card .tu-por { width: 46px; height: 46px; }
.tu-hud .tu-card { padding: 5px 8px 6px 6px; gap: 7px; }
/* จอแคบมาก (320) */
.tu-hud.narrow .tu-hud-side { grid-template-columns: 108px minmax(0, 1fr); }
.tu-hud.narrow .tu-card .tu-por { width: 38px; height: 38px; }
.tu-hud.narrow .tu-stat { grid-template-columns: 18px 1fr auto; gap: 3px; }
.tu-hud.narrow .tu-stat-n { min-width: 0; font-size: .72rem; }
.tu-hud.narrow .tu-lv { display: none; }
.tu-hud.narrow .tu-cmd-b { font-size: .86rem; padding-inline: 6px; }
.tu-hud.narrow .tu-menu .tu-win-body { padding-left: 24px; }
.tu-hud.narrow .tu-glove { width: 26px; height: 19px; }
/* จอกว้าง: เวทีซ้าย คอลัมน์ข้างขวา */
.tu-hud.wide { grid-template-columns: minmax(0, 1fr) 232px; gap: 10px; align-items: start; }
.tu-hud.wide .tu-hud-side { grid-template-columns: 1fr; gap: 8px; }
.tu-hud.wide .tu-hud-side > .tu-menu { order: 2; }
.tu-hud.wide .tu-hud-cards { order: 1; }
.tu-hud.wide .tu-card .tu-por { width: 54px; height: 54px; }
.tu-hud.wide .tu-cmd-b { min-height: 40px; }

/* ลำดับเทิร์นแนวตั้งเมื่ออยู่ในคอลัมน์ / ตั้ง .vert เอง */
.tu-order.vert { flex-direction: column; align-items: stretch; }
.tu-order.vert .tu-order-cap { writing-mode: horizontal-tb; transform: none; border: 0; border-bottom: 1px solid rgba(226,181,74,.5); padding: 2px 4px 4px; }
.tu-order.vert .tu-order-list { flex-direction: column; }
.tu-order.vert .tu-oc { flex-direction: row; gap: 7px; }
.tu-order.vert .tu-oc-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tu-order.vert .tu-oc.now::before { top: 50%; left: -6px; margin: -5px 0 0; border: 5px solid transparent; border-left: 6px solid var(--tu-gold2); border-right: 0; }
.tu-order.vert .tu-order-list { padding: 4px 0 0 6px; gap: 5px; }
.tu-order.vert .tu-oc-ct { width: 46px; height: 5px; align-self: center; }
.tu-order.vert { padding: 4px 8px 8px; }

@media (prefers-reduced-motion: reduce) {
  .tu-ptr, .tu-ptr .tu-glove, .tu-bar i, .tu-oc, .tu-oc-ct i, .tu-band, .tu-band-t, .tu-orn, .tu-banner::before { transition: none !important; animation: none !important; }
  .tu-glove, .tu-oc.now::before, .tu-shake, .tu-glow, .tu-hit .tu-bar, .tu-heal .tu-bar, .tu-oc.tu-in { animation: none !important; }
  .tu-banner.hide .tu-band-t { transform: none; }
}

/* ---------- รอบ 14e: รูปผู้ป่วยในการ์ดหน่วย/ลำดับเทิร์น ครอปที่หน้า ----------
   ภาพนิ่ง pNN-still เป็นทั้งตัว ถ้า cover ทั้งภาพ หน้าเหลือ 3–6px ไม่เข้าคู่กับรูปหน้าฮีโร่/NPC
   --hx/--hy = กึ่งกลางศีรษะ (สัดส่วนของภาพ) · --s = กว้างภาพ / กว้างกรอบ · --ar = กว้าง/สูงของภาพ
   clamp() กันขอบภาพหลุดเข้ามาในกรอบ · ภาพใหม่ที่ไม่อยู่ในรายการจะกลับไปใช้กฎ .wide/.tall เดิม
   เปลี่ยนไฟล์ภาพนิ่งเมื่อไหร่ ต้องแก้ --ar และจุดโฟกัสให้ตรง · คง --s ไม่เกิน ~2.6 ไม่งั้นภาพขยายจนเบลอ */
img[src*="p01-still"]{--hx:.17;--hy:.10;--s:1.79;--ar:.797}
img[src*="p02-still"]{--hx:.15;--hy:.07;--s:2.6;--ar:.767}
img[src*="p03-still"]{--hx:.45;--hy:.07;--s:1.28;--ar:.285}
img[src*="p04-still"]{--hx:.40;--hy:.13;--s:1.71;--ar:.759}
img[src*="p05-still"]{--hx:.45;--hy:.13;--s:1.64;--ar:.799}
img[src*="p06-still"]{--hx:.07;--hy:.22;--s:2.63;--ar:1.756}
img[src*="p07-still"]{--hx:.45;--hy:.13;--s:1.46;--ar:.651}
img[src*="p08-still"]{--hx:.06;--hy:.20;--s:2.9;--ar:1.931}
img[src*="p09-still"]{--hx:.45;--hy:.10;--s:1.63;--ar:.542}
img[src*="p10-still"]{--hx:.40;--hy:.14;--s:2.0;--ar:.755}
img[src*="p11-still"]{--hx:.30;--hy:.12;--s:1.92;--ar:.725}
img[src*="p12-still"]{--hx:.50;--hy:.12;--s:1.42;--ar:.631}
img[src*="p13-still"]{--hx:.50;--hy:.08;--s:1.3;--ar:.281}
img[src*="p14-still"]{--hx:.45;--hy:.10;--s:1.87;--ar:.706}
img[src*="p15-still"]{--hx:.20;--hy:.10;--s:2.28;--ar:.863}
.tu-por > img[src*="-still."], .tu-oc-face > img[src*="-still."] {
  inset: auto; max-width: none; object-fit: fill;
  width: calc(var(--s) * 100%); height: auto;
  left: clamp(calc(100% - var(--s) * 100%), calc(50% - var(--hx) * var(--s) * 100%), 0%);
  top: clamp(calc(100% - var(--s) / var(--ar) * 100%), calc(50% - var(--hy) * var(--s) / var(--ar) * 100%), 0%);
}
