/* ═══ หน้าทดลอง: เมนู | ห้องแชต LINE | แผงทีมงาน ═══ */
.demo { max-width: 1480px; margin: 0 auto; padding: 8px 16px 24px; display: grid; grid-template-columns: 330px minmax(360px, 1fr) 340px; gap: 18px; align-items: start; }
.dm-menu, .dm-hud { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding: 16px; scrollbar-width: thin; scrollbar-color: rgba(245, 158, 11, .4) transparent; }

/* ── เมนูซ้าย ── */
.dm-game { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dm-game img { border-radius: 16px; box-shadow: 0 8px 26px hsla(var(--hue), 90%, 55%, .4); }
.dm-game small { color: var(--muted); font-size: .76rem; }
.dm-game .ver { font-family: var(--mono); color: var(--cyan); }
.dm-game b { display: block; font-size: 1.2rem; line-height: 1.2; }
.dm-live { font-size: .76rem; color: var(--muted); }
.dm-live b { display: inline; font-size: .8rem; color: #bfa5fa; }
.dm-swap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--muted); transition: .3s; }
.dm-swap:hover { color: #fff; border-color: var(--primary); transform: rotate(-90deg); }
.dm-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px 0; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); }
.dm-tabs button { border: 0; background: none; padding: 8px 4px; border-radius: 10px; font-size: .78rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; transition: .25s; }
.dm-tabs button .ico { font-size: 1.05rem; }
.dm-tabs button.on { background: linear-gradient(135deg, rgba(245, 158, 11, .45), rgba(191, 165, 250, .2)); color: #fff; box-shadow: 0 4px 16px rgba(245, 158, 11, .3); }
.dm-pane { display: none; } .dm-pane.on { display: block; animation: pane-in .4s var(--ease); }
.dm-run { width: 100%; padding: 15px; font-size: 1.02rem; overflow: hidden; }
.dm-hint { color: var(--muted); font-size: .82rem; text-align: center; margin: 10px 0 14px; }
.dm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; position: relative; }
.dm-steps::before { content: ""; position: absolute; left: 23px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--primary), var(--accent)); opacity: .3; }
.dm-steps button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 9px 10px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, .03); transition: .25s; position: relative; }
.dm-steps button:hover { border-color: var(--primary); background: rgba(245, 158, 11, .1); }
.dm-steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: .8rem; background: var(--surface-solid); border: 2px solid var(--dim); flex: none; transition: .3s; }
.dm-steps b { display: block; font-size: .92rem; }
.dm-steps small { color: var(--muted); font-size: .76rem; }
.dm-steps code, .dm-howbet code, .cmd code, .explain code { font-family: ui-monospace, Consolas, monospace; background: rgba(191, 165, 250, .12); color: #bfa5fa; padding: 1px 7px; border-radius: 6px; font-size: .82em; }
.dm-steps li.done .n { border-color: var(--accent); background: var(--accent); color: #04120e; }
.dm-steps li.now button { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(139, 92, 246, .3), 0 0 22px rgba(139, 92, 246, .2); }
.dm-steps li.now .n { border-color: var(--cyan); animation: gentle 1.6s ease-in-out infinite; }
@keyframes gentle { 50% { box-shadow: 0 0 0 6px rgba(139, 92, 246, .18); } }
.dm-howbet { margin-top: 16px; padding: 14px; border-radius: 14px; background: rgba(0, 0, 0, .2); border: 1px dashed var(--border-hi); }
.dm-howbet h4 { font-size: .9rem; display: flex; gap: 8px; align-items: center; }
.dm-howbet ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .84rem; }
.dm-howbet li { display: flex; gap: 10px; align-items: center; } .dm-howbet li span { color: var(--muted); }
.cmd-list { display: grid; gap: 8px; }
.cmd { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, .03); transition: .25s; }
.cmd:hover { border-color: var(--primary); background: rgba(245, 158, 11, .1); transform: translateX(3px); }
.cmd .ci { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; background: linear-gradient(135deg, rgba(245, 158, 11, .35), rgba(139, 92, 246, .18)); }
.cmd b { display: block; font-size: .9rem; } .cmd small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.cmd code { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd.fire { animation: fire .6s var(--spring); } .cmd.fire .ci { animation: ico-pulse .6s; }
@keyframes fire { 30% { transform: scale(.97); box-shadow: 0 0 0 2px var(--accent), 0 0 30px rgba(191, 165, 250, .4); } }

/* ── โทรศัพท์ + ห้องแชต ── */
.dm-chat { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone { position: relative; width: 100%; max-width: 440px; padding: 12px; border-radius: 46px; background: linear-gradient(145deg, #17291f, #08130f); box-shadow: 0 0 0 2px #243d2f, 0 40px 90px rgba(0, 0, 0, .6), 0 0 80px hsla(var(--hue), 90%, 55%, .15); }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; border-radius: 20px; background: #020705; z-index: 5; }
.chat { position: relative; height: min(76vh, 780px); min-height: 520px; border-radius: 36px; overflow: hidden; display: flex; flex-direction: column; background: #8cabd9;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 18px 18px; }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 46px 14px 10px; background: #2b3a55; color: #fff; z-index: 2; }
.chat-top .back { font-size: 1.8rem; line-height: 1; opacity: .8; }
.chat-title { flex: 1; min-width: 0; } .chat-title b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chat-title small { opacity: .7; font-size: .72rem; }
.chat-icons { display: flex; gap: 12px; opacity: .85; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 10px 14px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; scrollbar-width: none; }
.chat-list::-webkit-scrollbar { display: none; }
.chat-new { position: absolute; bottom: 70px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; border: 0; background: #2b3a55; color: #fff; font-size: .78rem; padding: 6px 14px; border-radius: 99px; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); transition: .3s; }
.chat-new.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.chat-input { display: flex; align-items: center; gap: 10px; padding: 9px 12px 16px; background: #fff; color: #333; }
.chat-input .plus { font-size: 1.5rem; color: #888; line-height: 1; }
.chat-input .field { flex: 1; min-height: 34px; border-radius: 18px; background: #f1f2f5; padding: 6px 14px; font-size: .9rem; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.chat-input .field:empty::before { content: "Aa"; color: #aaa; }
.chat-input .field.typing::after { content: ""; width: 2px; height: 1.1em; background: #06c755; margin-left: 2px; animation: caret .7s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.chat-input .send { color: #06c755; font-size: 1.1rem; }

.msg-day { align-self: center; font-size: .7rem; color: #fff; background: rgba(0, 0, 0, .18); padding: 2px 10px; border-radius: 99px; margin: 4px 0; }
.msg-sys { align-self: center; font-size: .72rem; color: #fff; background: rgba(0, 0, 0, .22); padding: 3px 12px; border-radius: 99px; animation: msg-in .35s var(--ease); max-width: 90%; text-align: center; }
.msg { display: flex; gap: 7px; align-items: flex-start; max-width: 100%; animation: msg-in .35s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.msg.out { justify-content: flex-end; animation-name: msg-out; }
@keyframes msg-out { from { opacity: 0; transform: translateX(16px) scale(.96); } }
.msg .av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 700; font-size: .95rem;
  background: linear-gradient(135deg, hsl(var(--h, 200), 70%, 55%), hsl(calc(var(--h, 200) + 50), 75%, 45%)); }
.msg .av img { width: 100%; height: 100%; object-fit: cover; }
.msg .av-bot { background: #20180a; box-shadow: 0 0 0 2px #06c755; } .msg .av-bot img { width: 100%; height: 100%; object-fit: cover; }
.msg .col { min-width: 0; max-width: calc(100% - 44px); display: flex; flex-direction: column; }
.msg.out .col { align-items: flex-end; max-width: 82%; }
.msg .nm { font-size: .7rem; color: #fff; margin: 0 0 2px 4px; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.msg .row { display: flex; align-items: flex-end; gap: 4px; }
.msg.out .row { flex-direction: row-reverse; }
.msg .meta { display: flex; flex-direction: column; align-items: flex-end; font-size: .6rem; color: rgba(255, 255, 255, .9); white-space: nowrap; line-height: 1.25; }
.msg.in .meta { align-items: flex-start; }
.role-tag { background: rgba(0, 0, 0, .25); padding: 0 5px; border-radius: 4px; margin: 1px 0; }
.bubble { position: relative; background: #fff; color: #111; border-radius: 16px; padding: 7px 11px; font-size: .86rem; line-height: 1.45; word-break: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.msg.in.txt .bubble { border-top-left-radius: 4px; }
.msg.out .bubble { background: #a3e57d; border-top-right-radius: 4px; }
.msg.bot-txt .bubble { font-size: .8rem; }
.msg.card .bubble, .msg.photo .bubble { padding: 0; background: none; box-shadow: none; }
.msg.typing .bubble { display: flex; gap: 4px; padding: 11px 13px; }
.msg.typing .bubble i { width: 6px; height: 6px; border-radius: 50%; background: #9aa; animation: dots 1s infinite; }
.msg.typing .bubble i:nth-child(2) { animation-delay: .15s; } .msg.typing .bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 30% { transform: translateY(-4px); background: #06c755; } }
.quote { font-size: .72rem; color: #555; border-left: 3px solid #06c755; padding: 2px 6px; margin-bottom: 4px; background: rgba(0, 0, 0, .05); border-radius: 4px; }

/* ── การ์ด Flex (สีตามของจริง) ── */
.flex { width: 250px; background: #fff; color: #222; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); font-size: .8rem; }
.flex.giga { width: 284px; }
.fx-head { background: linear-gradient(150deg, #09203f, #537895); color: #fff; padding: 12px 14px; }
.fx-head b { display: block; font-size: .95rem; line-height: 1.35; }
.fx-head span { font-size: .74rem; opacity: .85; }
.fx-body { padding: 10px 14px 12px; }
.fx-body.center { text-align: center; }
.fx-scroll { max-height: 230px; overflow-y: auto; scrollbar-width: thin; }
.fx-pl { font-size: .74rem; padding: 3px 0; border-bottom: 1px dashed #eee; }
.fx-pl .c { color: #888; } .fx-pl .n { font-weight: 600; } .fx-pl .b { color: #2c3e50; }
.fx-res { font-size: 1.7rem; font-weight: 800; color: #e03131; line-height: 1.3; margin: 6px 0 4px; }
.fx-hint { color: #666; font-size: .72rem; margin-top: 6px; }
.fx-title { padding: 12px 14px 4px; font-weight: 700; font-size: .92rem; color: #09203f; }
.fx-chip { margin: 4px auto 8px; display: table; background: #eef2ff; color: #3730a3; border-radius: 99px; padding: 3px 12px; font-size: .76rem; font-weight: 600; }
.fx-cols { display: grid; grid-template-columns: 1fr 74px 74px; gap: 4px; padding: 0 14px 4px; font-size: .7rem; font-weight: 700; border-bottom: 1px solid #eee; }
.fx-st { display: grid; grid-template-columns: 1fr 74px 74px; gap: 4px; align-items: center; padding: 4px 0; font-size: .72rem; border-bottom: 1px dashed #f0f0f0; }
.fx-st .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-st .pill { text-align: center; border-radius: 99px; padding: 1px 4px; font-weight: 700; color: #fff; font-size: .68rem; }
.fx-st .pill.up { background: #196f3d; } .fx-st .pill.down { background: #ff0000; } .fx-st .pill.tie { background: #000; }
.fx-st .bal { text-align: right; color: #2c3e50; }
.fx-pet { font-size: .7rem; color: #0f766e; background: #ecfdf5; border-radius: 6px; padding: 2px 6px; margin: 2px 0 4px; animation: pet-glow 1.6s ease-in-out infinite; }
@keyframes pet-glow { 50% { box-shadow: 0 0 0 2px #34d399; } }
.fx-foot { font-size: .68rem; color: #888; text-align: center; padding: 6px; border-top: 1px solid #eee; }
.fx-kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #eee; font-size: .78rem; text-align: left; }
.fx-kv span { color: #666; } .fx-kv b { text-align: right; } .fx-kv b.g { color: #196f3d; }
.fx-kv .bar { display: inline-block; width: 60px; height: 6px; border-radius: 9px; background: #eee; vertical-align: middle; overflow: hidden; } .fx-kv .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7c6aff, #00d4aa); }
.fx-btn { margin-top: 10px; background: #06c755; color: #fff; text-align: center; border-radius: 8px; padding: 8px; font-weight: 700; font-size: .8rem; }
.fx-warn { font-size: .72rem; color: #b45309; background: #fffbeb; border-radius: 6px; padding: 5px 7px; margin-top: 8px; text-align: left; }
.fx-mem-top { display: flex; gap: 10px; align-items: center; padding: 14px; background: linear-gradient(135deg, #1e1b4b, #0f766e); color: #fff; }
.fx-mem-top .av, .fx-king .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, hsl(var(--h, 200), 70%, 55%), hsl(calc(var(--h, 200) + 50), 75%, 45%)); box-shadow: 0 0 0 2px #fbbf24; }
.fx-mem-top b { display: block; } .fx-mem-top small { opacity: .8; }
.fx-mem .fx-kv { margin: 0 14px; } .fx-mem { padding-bottom: 10px; }
.fx-status { padding: 16px 14px; text-align: center; }
.fx-status .ic { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; color: #fff; background: #16a34a; animation: pop .5s var(--spring); }
.fx-status.bad .ic { background: #dc2626; }
.fx-status b { display: block; font-size: .95rem; margin-bottom: 4px; } .fx-status p { margin: 2px 0; font-size: .76rem; color: #444; }
@keyframes pop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
.fx-qr-head { background: linear-gradient(135deg, #4c1d95, #0e7490); color: #fff; font-weight: 700; padding: 11px 14px; font-size: .88rem; }
.fx-qr { position: relative; width: 140px; height: 140px; margin: 4px auto 8px; display: grid; grid-template-columns: repeat(11, 1fr); gap: 1px; padding: 8px; background: #fff; border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
.fx-qr i { background: #fff; } .fx-qr i.on { background: #111; }
.fx-qr .scan { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #06c755, transparent); box-shadow: 0 0 10px #06c755; animation: qr-scan 1.6s ease-in-out infinite alternate; }
@keyframes qr-scan { from { top: 6px; } to { top: 130px; } }
.fx-road { display: flex; flex-wrap: wrap; gap: 5px; }
.fx-road span { font-size: .68rem; padding: 3px 7px; border-radius: 6px; color: #fff; background: var(--c); }
.fx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fx-grid span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; background: #f4f6fb; border-radius: 10px; font-size: .72rem; font-weight: 600; }
.fx-grid i { font-style: normal; font-size: 1.3rem; }
.flex.fx-img { width: 260px; }
.fx-open { position: relative; height: 150px; background: radial-gradient(circle at 30% 40%, hsl(var(--hue), 80%, 45%), #0b1020 70%); color: #fff; display: flex; align-items: flex-end; overflow: hidden; }
.fx-open-art { position: absolute; inset: 0; } .fx-open-art img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.fx-open-glow { position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, hsla(var(--hue), 90%, 70%, .35), transparent 30%); animation: ico-spin 4s linear infinite; }
.fx-open-txt { position: relative; padding: 12px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); width: 100%; }
.fx-open-txt small { opacity: .85; } .fx-open-txt b { display: block; font-size: 1.3rem; } .fx-open-txt span { font-size: .74rem; opacity: .9; }
.fx-poster { height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; text-align: center; padding: 10px; background: radial-gradient(circle at 50% 30%, hsl(var(--hue), 80%, 50%), #0b1020 75%); }
.fx-poster .e { font-size: 2.6rem; animation: floaty 3s ease-in-out infinite; } .fx-poster b { font-size: 1rem; } .fx-poster span { font-size: .72rem; opacity: .85; }
.fx-dark { background: #0b0d18; color: #fff; }
.fx-king { position: relative; text-align: center; padding: 16px 14px 18px; overflow: hidden; background: radial-gradient(circle at 50% 0, #713f12, #0b0d18 70%); }
.fx-king .crown { font-size: 2rem; animation: floaty 2.4s ease-in-out infinite; }
.fx-king small { display: block; color: #fde68a; letter-spacing: .14em; font-size: .68rem; margin-bottom: 8px; }
.fx-king .av { margin: 0 auto 6px; width: 54px; height: 54px; }
.fx-king b { display: block; font-size: 1rem; } .fx-king span { color: #4ade80; font-weight: 700; }
.fx-king .rays { position: absolute; inset: -60%; background: repeating-conic-gradient(rgba(251, 191, 36, .12) 0 10deg, transparent 10deg 20deg); animation: ico-spin 14s linear infinite; z-index: -0; pointer-events: none; mix-blend-mode: screen; }
.fx-board { margin: 6px 0 2px; }

/* กระดานผล */
.die { width: 38px; height: 38px; border-radius: 9px; background: #fff; border: 2px solid #e5e7eb; box-shadow: inset 0 -3px 0 #e5e7eb, 0 3px 8px rgba(0, 0, 0, .15); display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 5px; margin: 0 3px; animation: roll .7s var(--spring); }
.die i { width: 7px; height: 7px; border-radius: 50%; background: #111; align-self: center; justify-self: center; }
.die.d1 i { grid-area: 2 / 2; background: #e03131; width: 9px; height: 9px; }
.die.d2 i:nth-child(1) { grid-area: 1 / 1; } .die.d2 i:nth-child(2) { grid-area: 3 / 3; }
.die.d3 i:nth-child(1) { grid-area: 1 / 1; } .die.d3 i:nth-child(2) { grid-area: 2 / 2; } .die.d3 i:nth-child(3) { grid-area: 3 / 3; }
.die.d4 i:nth-child(1) { grid-area: 1 / 1; } .die.d4 i:nth-child(2) { grid-area: 1 / 3; } .die.d4 i:nth-child(3) { grid-area: 3 / 1; } .die.d4 i:nth-child(4) { grid-area: 3 / 3; }
.die.d4 i { background: #e03131; }
.die.d5 i:nth-child(1) { grid-area: 1 / 1; } .die.d5 i:nth-child(2) { grid-area: 1 / 3; } .die.d5 i:nth-child(3) { grid-area: 2 / 2; } .die.d5 i:nth-child(4) { grid-area: 3 / 1; } .die.d5 i:nth-child(5) { grid-area: 3 / 3; }
.die.d6 i:nth-child(1) { grid-area: 1 / 1; } .die.d6 i:nth-child(2) { grid-area: 2 / 1; } .die.d6 i:nth-child(3) { grid-area: 3 / 1; } .die.d6 i:nth-child(4) { grid-area: 1 / 3; } .die.d6 i:nth-child(5) { grid-area: 2 / 3; } .die.d6 i:nth-child(6) { grid-area: 3 / 3; }
@keyframes roll { 0% { transform: rotate(-200deg) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
.b-dice { display: flex; justify-content: center; }
.b-gates { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.b-gates span { min-width: 30px; padding: 4px 6px; border-radius: 8px; background: #f1f5f9; font-weight: 700; font-size: .78rem; color: #64748b; }
.b-gates span.on { background: #e03131; color: #fff; box-shadow: 0 0 0 3px #fecaca; animation: pop .5s var(--spring); }
.b-gates.big span { padding: 8px 8px; }
.pc { width: 46px; height: 64px; border-radius: 7px; background: #fff; border: 1px solid #d1d5db; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; animation: flip .6s var(--ease); }
.pc b { font-size: 1.1rem; } .pc i { font-style: normal; font-size: 1.2rem; } .pc.r { color: #dc2626; } .pc.b { color: #111; }
@keyframes flip { from { transform: rotateY(90deg); } }
.b-td, .b-bac { display: flex; align-items: center; justify-content: center; gap: 14px; }
.b-td > div { display: flex; flex-direction: column; align-items: center; gap: 3px; } .b-td small { font-size: .68rem; color: #666; }
.b-td em, .b-bac em { font-style: normal; font-weight: 800; color: #94a3b8; font-size: .8rem; }
.b-bac > div { padding: 8px 14px; border-radius: 10px; color: #fff; text-align: center; } .b-bac .p1 { background: #2563eb; } .b-bac .p2 { background: #dc2626; }
.b-bac small { display: block; font-size: .66rem; opacity: .9; } .b-bac b { font-size: 1.4rem; }
.b-pk { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pk { border-radius: 8px; padding: 4px 2px; background: #f1f5f9; position: relative; animation: pop .4s var(--spring) backwards; }
.pk small { display: block; font-size: .6rem; color: #64748b; } .pk b { font-size: 1rem; } .pk em { position: absolute; top: -5px; right: -3px; font-style: normal; font-size: .55rem; background: #f59e0b; color: #fff; border-radius: 4px; padding: 0 3px; }
.pk.bank, .pk.kwan { background: #1e293b; color: #fff; } .pk.bank small, .pk.kwan small { color: #cbd5e1; }
.pk.w { background: #dcfce7; } .pk.l { background: #fee2e2; } .pk.t { background: #e5e7eb; }
.b-pk .pk:nth-child(2) { animation-delay: .05s; } .b-pk .pk:nth-child(3) { animation-delay: .1s; } .b-pk .pk:nth-child(4) { animation-delay: .15s; } .b-pk .pk:nth-child(5) { animation-delay: .2s; } .b-pk .pk:nth-child(6) { animation-delay: .25s; } .b-pk .pk:nth-child(7) { animation-delay: .3s; }
.b-hhh { display: flex; justify-content: center; gap: 8px; }
.b-hhh span { width: 54px; height: 60px; border-radius: 12px; background: #fff7ed; border: 2px solid #fed7aa; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.6rem; animation: roll .6s var(--spring) backwards; }
.b-hhh span:nth-child(2) { animation-delay: .1s; } .b-hhh span:nth-child(3) { animation-delay: .2s; }
.b-hhh small { font-size: .62rem; color: #9a3412; }
.b-scratch { margin: 0 auto; width: 120px; padding: 10px; border-radius: 14px; background: linear-gradient(135deg, #e5e7eb, #9ca3af); position: relative; overflow: hidden; }
.b-scratch span { display: block; font-size: 2.2rem; font-weight: 800; } .b-scratch.top span { color: #111; } .b-scratch.bot span { color: #dc2626; }
.b-scratch::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, #cbd5e1 0 6px, #94a3b8 6px 12px); animation: scratch 1s ease-out forwards; }
@keyframes scratch { to { transform: translateX(110%); } }
.b-rank { display: flex; justify-content: center; gap: 6px; }
.b-rank span { display: flex; flex-direction: column; align-items: center; padding: 6px 7px; border-radius: 10px; background: #f8fafc; animation: pop .5s var(--spring) backwards; }
.b-rank span:nth-child(2) { animation-delay: .1s; } .b-rank span:nth-child(3) { animation-delay: .2s; } .b-rank span:nth-child(4) { animation-delay: .3s; }
.b-rank em { font-style: normal; } .b-rank b { font-size: .9rem; } .b-rank small { font-size: .6rem; color: #64748b; }
.b-wheel span { display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; font-size: 1.6rem; font-weight: 800; color: #fff; border: 5px solid #fbbf24; animation: roll .9s var(--spring); }
.b-wheel .black { background: #111; } .b-wheel .red { background: #dc2626; } .b-wheel .gold { background: linear-gradient(135deg, #f59e0b, #fde68a); color: #713f12; }
.b-rocket { display: flex; flex-direction: column; align-items: center; } .b-rocket span { font-size: 2rem; animation: launch 1s var(--ease); } .b-rocket b { font-size: 1.6rem; } .b-rocket small { color: #666; font-size: .7rem; }
@keyframes launch { from { transform: translateY(30px); opacity: 0; } }

/* สลิป */
.slip { width: 200px; background: linear-gradient(180deg, #e8f7ee, #fff 40%); color: #111; border-radius: 14px; padding: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); font-size: .74rem; }
.slip-top { color: #16a34a; font-weight: 700; } .slip b { display: block; font-size: 1.4rem; margin: 2px 0; } .slip small { color: #666; }
.slip-row { display: flex; justify-content: space-between; border-top: 1px dashed #ddd; padding-top: 4px; margin-top: 4px; }
.slip-qr { width: 40px; height: 40px; margin: 8px 0 0 auto; background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 8px 8px; }

/* ── ปุ่มคุม ── */
.dm-ctrl { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 99px; }
.dm-ctrl > button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255, 255, 255, .04); display: grid; place-items: center; transition: .2s; }
.dm-ctrl > button:hover { border-color: var(--primary); background: rgba(245, 158, 11, .18); }
.speed { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(0, 0, 0, .25); }
.speed button { border: 0; background: none; padding: 6px 12px; border-radius: 99px; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.speed button.on { background: var(--primary); color: #fff; box-shadow: 0 0 14px rgba(245, 158, 11, .6); }
.is-paused .chat { filter: saturate(.6) brightness(.85); }
.is-paused .dm-ctrl > button:first-child { border-color: var(--amber); color: var(--amber); animation: gentle 1.4s infinite; }
.is-running #btn-full { opacity: .65; pointer-events: none; }

/* ── แผงทีมงาน ── */
.dm-hud { display: flex; flex-direction: column; gap: 12px; --scan-h: 900px; }
.hud-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hud-head h3 { font-size: 1.05rem; margin: 0; } .hud-head .eyebrow { margin-bottom: 2px; font-size: .66rem; }
.hud-ring { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.hud-ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.hud-ring .trk { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 8; }
.hud-ring .val { fill: none; stroke: url(#rg); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; transition: stroke-dashoffset .8s var(--ease); filter: drop-shadow(0 0 6px rgba(139, 92, 246, .6)); }
.hud-ring .dash { fill: none; stroke: rgba(245, 158, 11, .35); stroke-width: 1; stroke-dasharray: 2 6; transform-origin: center; animation: ico-spin 20s linear infinite; }
.ring-txt { position: absolute; left: 0; top: 0; width: 120px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-txt small { color: var(--muted); font-size: .66rem; } .ring-txt b { font-family: var(--mono); font-size: 1.3rem; } .ring-txt span { font-size: .64rem; color: var(--cyan); max-width: 90px; line-height: 1.2; }
.ring-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ring-steps li { font-size: .76rem; padding: 4px 10px; border-radius: 8px; color: var(--dim); border: 1px solid transparent; position: relative; }
.ring-steps li.on { color: #bfa5fa; } .ring-steps li.on::before { content: "✓ "; }
.ring-steps li.now { color: #fff; border-color: rgba(139, 92, 246, .4); background: rgba(139, 92, 246, .08); }
.hud-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hud-kpis div { padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--border); }
.hud-kpis span { display: block; font-size: .68rem; color: var(--muted); }
.hud-kpis b { font-family: var(--mono); font-size: 1.15rem; display: inline-block; } .hud-kpis b.up { color: #4ade80; } .hud-kpis b.down { color: var(--red); }
.hud-card { padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .2); border: 1px solid var(--border); position: relative; }
.hud-card h4 { font-size: .84rem; display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 10px; }
.hud-card h4 small { font-weight: 400; color: var(--dim); font-size: .68rem; }
.opt-bars { display: grid; gap: 7px; }
.ob { display: grid; grid-template-columns: 74px 1fr 64px; gap: 8px; align-items: center; font-size: .74rem; }
.ob .l { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob .t { height: 10px; border-radius: 9px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.ob .t i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 40%, transparent), var(--c)); box-shadow: 0 0 10px var(--c); transition: width .6s var(--spring); position: relative; }
.ob .t i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: sheen 2s linear infinite; }
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ob b { text-align: right; font-family: var(--mono); font-size: .72rem; }
#rate-chart { width: 100%; height: 70px; display: block; }
.road { display: flex; flex-wrap: wrap; gap: 5px; }
.road span { font-size: .7rem; padding: 3px 8px; border-radius: 7px; background: rgba(245, 158, 11, .18); border: 1px solid rgba(245, 158, 11, .35); }
.road span.new { animation: pop .5s var(--spring); background: rgba(191, 165, 250, .2); border-color: var(--accent); }
.road .empty { background: none; border: 0; color: var(--dim); }
.explain { border-color: rgba(245, 158, 11, .4); background: linear-gradient(160deg, rgba(245, 158, 11, .14), rgba(0, 0, 0, .2)); font-size: .84rem; color: var(--muted); }
.explain h4 { justify-content: flex-start; color: #fff; } .explain h4 .ico { color: var(--amber); }
.explain p { margin: 0 0 8px; } .explain .how { color: var(--text); }
.explain.flash { animation: ex-flash .8s var(--ease); }
@keyframes ex-flash { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .7); } 100% { box-shadow: 0 0 0 14px rgba(245, 158, 11, 0); } }
.tg-pop { position: fixed; right: 20px; top: 90px; width: 290px; border-radius: 16px; overflow: hidden; background: #17212b; color: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); z-index: 70; transform: translateX(120%); transition: transform .5s var(--spring); }
.tg-pop.show { transform: none; }
.tg-head { background: #2aabee; padding: 8px 12px; font-weight: 700; font-size: .84rem; display: flex; gap: 8px; align-items: center; }
.tg-body { padding: 10px 12px; font-size: .8rem; } .tg-body p { margin: 3px 0; color: #c7d2dc; }

/* ── มือถือ/แท็บเล็ต ── */
.dm-mnav, .dm-scrim { display: none; }
@media (max-width: 1280px) { .demo { grid-template-columns: 300px minmax(340px, 1fr) 300px; } }
@media (max-width: 1100px) {
  .demo { grid-template-columns: 1fr; padding: 0 0 80px; }
  .dm-chat { padding: 0 8px; }
  .phone { max-width: 520px; padding: 0; border-radius: 22px; background: none; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
  .phone-notch { display: none; }
  .chat { border-radius: 22px; height: calc(100vh - 210px); min-height: 440px; }
  .chat-top { padding-top: 12px; }
  .dm-menu, .dm-hud { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 78vh; z-index: 65; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .45s var(--ease); background-color: #09150f; padding-bottom: 90px; }
  .sheet-menu .dm-menu, .sheet-hud .dm-hud { transform: none; }
  .dm-menu::before, .dm-hud::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--dim); margin: -4px auto 12px; }
  .dm-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 64; opacity: 0; pointer-events: none; transition: .3s; }
  .sheet-menu .dm-scrim, .sheet-hud .dm-scrim { opacity: 1; pointer-events: auto; }
  .dm-mnav { display: grid; grid-template-columns: 1fr 1.2fr 1fr; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 66; border-radius: 20px; padding: 6px; gap: 6px; }
  .dm-mnav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .74rem; color: var(--muted); padding: 6px; border-radius: 14px; }
  .dm-mnav button .ico { font-size: 1.25rem; }
  .dm-mnav .go { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(245, 158, 11, .45); }
  .tg-pop { top: auto; bottom: 90px; right: 10px; left: 10px; width: auto; }
  .pg-demo .fab { bottom: 92px; }
  .pg-demo .foot { display: none; }
}
@media (max-width: 420px) { .flex { width: 232px; } .flex.giga { width: 252px; } .fx-cols, .fx-st { grid-template-columns: 1fr 64px 64px; } }
/* ⚠️ อย่าใช้ .ct ในเมนูคำสั่ง — ชนกับปุ่มติดต่อใน app.css */
.cmd .cmd-t { min-width: 0; }
@media (max-width: 1100px) { .dm-ctrl { align-self: flex-start; margin-left: 8px; } }
/* แถบเลือกรูปแบบกินที่ด้านบน → ห้องแชตเตี้ยลงให้พอดีจอ */
@media (min-width: 1101px) { .chat { height: min(calc(100vh - 250px), 760px); min-height: 480px; } }
