/* Creator Quest V3 · สไตล์การ์ดเกมเดียวกับอินฟลูจำเป็น: เส้นน้ำตาลหนา การ์ดครีม สีลูกกวาด */
:root {
  --ink: #2b2118; --paper: #fff3dc; --cream: #fffaf0; --muted: #7a6654;
  --pink: #ff8fbd; --yel: #ffd23f; --mint: #5fd6b4; --sky: #7cc8f2; --orange: #ff9d5c; --lav: #b9a3f5; --bad: #e5484d;
  --r: 22px; --line: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { color: var(--ink); font-family: Anuphan, system-ui, sans-serif; line-height: 1.4; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(circle, #ffffff88 1.5px, transparent 1.6px) 0 0 / 22px 22px, linear-gradient(160deg, #e6dcff, #ffe9c7 55%, #fff3dc); background-attachment: fixed; }
h1, h2, h3, .disp { font-family: Mitr, Anuphan, sans-serif; font-weight: 600; line-height: 1.25; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.muted { color: var(--muted); }
.num { font-family: Anuphan, sans-serif !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.offline::after { content: 'กำลังต่อใหม่…'; position: fixed; top: 0; left: 0; right: 0; background: var(--ink); color: var(--paper); text-align: center; padding: 6px; z-index: 99; }

/* สีประจำตัวเลือก */
.c-yel { --c: var(--yel); } .c-sky { --c: var(--sky); } .c-mint { --c: var(--mint); } .c-pink { --c: var(--pink); } .c-orange { --c: var(--orange); } .c-lav { --c: var(--lav); }

.btn { border: var(--line) solid var(--ink); background: var(--pink); border-radius: 18px; padding: .5em 1.2em; min-height: 52px;
  font-family: Mitr, sans-serif; font-weight: 600; font-size: 1.15rem; box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: var(--cream); } .btn.yel { background: var(--yel); } .btn.mint { background: var(--mint); }
.btn:disabled { opacity: .4; }

.panel { background: var(--cream); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: 0 6px 0 var(--ink); }
.chip { display: inline-flex; align-items: center; gap: .35em; background: var(--c, var(--yel)); border: 3px solid var(--ink); border-radius: 999px; padding: .1em .7em; font-family: Mitr, sans-serif; font-weight: 600; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }

.av { --bg: var(--paper); --s: 3.2rem; width: var(--s); height: var(--s); font-size: calc(var(--s) * .58); border-radius: 50%; background: var(--bg); border: var(--line) solid var(--ink);
  display: inline-grid; place-items: center; line-height: 1; flex: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

.art { position: relative; display: block; overflow: hidden; background: var(--paper); }
.art .fb { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2em; }
.art img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }

/* แถบพลัง */
.pw { display: grid; gap: 6px; }
.pw div { display: grid; grid-template-columns: 8.5em 1fr; align-items: center; gap: .5em; font-weight: 700; font-size: .9rem; }
.pw i { display: block; height: 14px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; }
.pw i b { display: block; height: 100%; background: var(--k); }

@keyframes pop { from { transform: scale(.8); opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
.conf { position: fixed; top: -20px; font-size: 1.6rem; pointer-events: none; z-index: 80; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* การ์ดคาแรคเตอร์ */
.cc { background: var(--cream); border: var(--line) solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 var(--ink); outline: 7px solid var(--c); outline-offset: -11px; padding: 14px 16px 18px; display: grid; gap: 12px; min-width: 0; }
.cc-top { position: relative; }
.cc-top > .art { aspect-ratio: 1.35; border: var(--line) solid var(--ink); border-radius: 18px; }
.cc-top .cc-av { --s: 4rem; position: absolute; left: 10px; bottom: -22px; }
.cc-badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.cc-name { text-align: center; margin-top: 6px; }
.cc-name small { display: block; font-weight: 700; color: var(--muted); }
.cc-name b { display: block; font-family: Mitr, sans-serif; font-size: 1.45rem; line-height: 1.2; }
.cc-rows { display: grid; gap: 8px; }
.cc-row { display: grid; grid-template-columns: 2.8rem 1fr; gap: .6rem; align-items: center; }
.cc-row .mini { width: 2.8rem; height: 2.8rem; border: 3px solid var(--ink); border-radius: 12px; font-size: .7rem; }
.cc-row small { display: block; color: var(--muted); font-weight: 700; font-size: .78rem; }
.cc-row b { display: block; font-family: Mitr, sans-serif; font-weight: 600; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
