/*
 * ⭐ เข้าเกมตรงจากการ์ดเชิญ (000361 · 2026-10-30) — ฉากเปิดเกม · แถบ 🎯 ภารกิจของฉัน / 🎮 เกมอื่น · ป๊อปอัปในหน้าเกม
 *
 * มาร์กอัปสร้างโดย `live-hub-fun.js` (ไม่มีใน view) · สีจากธีมของเกม (`--gt1/2/3` · 128 แบบ `hub-themes.css`)
 * + สีของหน้า hub (`--hb-*`) · ⚠️ คลาส `hgo-*` ทั้งหมด · คีย์เฟรม `hgo-*` · prefers-reduced-motion = นิ่ง
 */

/* ⚠️ ไม่พึ่ง reset ของ live.css — ป๊อปอัป width:100% + padding ต้องไม่ล้นจอ */
.hgo-intro, .hgo-intro *, .hgo-dock, .hgo-dock *, .hgo-sheet, .hgo-sheet * { box-sizing: border-box; }

/* ═════ ฉากเปิดเกม (เข้าจากการ์ด / สลับเกม) ═════ */
.hgo-intro { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
  color: #fff; background: var(--gt3, #0b0716); animation: hgo-fade .25s ease both; pointer-events: none; }
.hgo-intro > .hgo-intro__scene { z-index: 0; }
.hgo-intro > :not(.hgo-intro__scene) { position: relative; z-index: 1; }
.hgo-intro.is-out { animation: hgo-out .45s ease forwards; }
.hgo-intro__ring { position: absolute !important; left: 50%; top: 50%; width: 170px; height: 170px; margin: -122px 0 0 -85px; }
.hgo-intro__ring i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--gt2, #ffd968);
  border-right-color: color-mix(in srgb, var(--gt2, #ffd968) 40%, transparent); animation: hgo-spin 1.1s linear infinite; }
.hgo-intro__ring i:nth-child(2) { inset: 16px; border-top-color: var(--gt1, #7ff0ff); animation-duration: .8s; animation-direction: reverse; }
.hgo-intro__ring i:nth-child(3) { inset: -14px; border-width: 1px; border-color: color-mix(in srgb, var(--gt2, #ffd968) 35%, transparent); animation: hgo-pulse 1.1s ease-out infinite; }
.hgo-intro__ico { font-size: 64px; line-height: 1; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .55)); animation: hgo-pop .6s cubic-bezier(.2, 1.6, .4, 1) both, hgo-bob 1.4s .6s ease-in-out infinite; }
.hgo-intro__t { margin-top: 26px; font-size: 22px; font-weight: 800; text-shadow: 0 4px 18px rgba(0, 0, 0, .6); animation: hgo-up .45s .15s ease both; }
.hgo-intro__s { font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--gt2, #ffd968) 80%, #fff); animation: hgo-up .45s .3s ease both; }

/* ═════ แถบติดล่างการ์ดเกม ═════ */
.hgo-dock { position: sticky; bottom: -16px; z-index: 3; display: flex; gap: 8px; margin: 0 -16px -16px; padding: 14px 12px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hb-panel, #14151d) 0%, transparent), color-mix(in srgb, var(--hb-panel, #14151d) 97%, transparent) 22%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 0 0 24px 24px; }
.hgo-dock[hidden] { display: none; }
.hgo-dock__b { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 0 12px;
  border-radius: 16px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 800; color: var(--hb-ink, #f2f1ec);
  background: color-mix(in srgb, var(--hb-ink, #f2f1ec) 7%, transparent); border: 1px solid color-mix(in srgb, var(--hb-gold, #ffd968) 30%, var(--hb-line, #2a2c37));
  transition: transform .2s, background .2s, box-shadow .2s; }
.hgo-dock__b span { font-size: 18px; }
.hgo-dock__b b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hgo-dock__b em { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; font-style: normal; font-size: 11.5px; font-weight: 800;
  color: #241600; background: var(--hb-gold, #ffd968); box-shadow: 0 0 14px color-mix(in srgb, var(--hb-gold, #ffd968) 70%, transparent); }
.hgo-dock__b em.is-n { color: var(--hb-ink, #f2f1ec); background: color-mix(in srgb, var(--hb-ink, #f2f1ec) 14%, transparent); box-shadow: none; }
.hgo-dock__b.is-hot { border-color: color-mix(in srgb, var(--hb-gold, #ffd968) 75%, transparent); animation: hgo-glow 2s ease-in-out infinite; }
.hgo-dock__b.is-hot em { animation: hgo-pop .5s cubic-bezier(.2, 1.6, .4, 1) both, hgo-bob 1.6s .5s ease-in-out infinite; }
.hgo-dock__b:active { transform: scale(.97); }
.hgo-dock__b:focus-visible { outline: 2px solid var(--hb-gold, #ffd968); outline-offset: 2px; }

/* ═════ ป๊อปอัปในหน้าเกม (แผ่นเลื่อนจากล่าง) ═════ */
.hgo-sheet { position: absolute; inset: 0; z-index: 7; display: grid; align-items: end; justify-items: center; }
.hgo-sheet__back { position: absolute; inset: 0; background: rgba(3, 4, 10, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.hgo-sheet__box { position: relative; width: min(460px, 100%); max-height: min(82dvh, 720px); display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 10px;
  padding: 8px 14px 16px; border-radius: 26px 26px 0 0; color: var(--hb-ink, #f2f1ec); overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gt1, #7c3aed) 22%, var(--hb-panel, #14151d)), var(--hb-panel, #14151d) 45%);
  border: 1px solid color-mix(in srgb, var(--gt2, #ffd968) 40%, var(--hb-line, #2a2c37)); border-bottom: 0;
  box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, .8), inset 0 1px 0 color-mix(in srgb, var(--gt2, #ffd968) 35%, transparent);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.hgo-sheet.is-on .hgo-sheet__back { opacity: 1; }
.hgo-sheet.is-on .hgo-sheet__box { transform: none; }
.hgo-sheet__grip { justify-self: center; width: 42px; height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--hb-ink, #f2f1ec) 25%, transparent); }
.hgo-sheet__head { display: flex; align-items: center; gap: 10px; }
.hgo-sheet__head > b { font-size: 16px; }
.hgo-sheet__head .hb-game__pts { margin-left: auto; }
.hgo-sheet__head .hb-x { margin-left: 0; }
.hgo-sheet__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 10px; align-content: start; padding-bottom: 6px; }

/* ── 🎯 ภารกิจ ── */
.hgo-sum { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px;
  background: color-mix(in srgb, var(--gt1, #7c3aed) 14%, transparent); border: 1px solid color-mix(in srgb, var(--gt2, #ffd968) 28%, transparent); }
.hgo-sum > span:last-child { display: grid; gap: 2px; min-width: 0; }
.hgo-sum > span:last-child b { font-size: 13.5px; }
.hgo-sum > span:last-child small { font-size: 11px; color: var(--hb-dim, #9aa0b4); }
.hgo-ring { position: relative; flex: none; width: 60px; height: 60px; display: grid; place-content: center; text-align: center; border-radius: 50%;
  /* 🔴 ไม่ใช้ `--p` — live-hub.css ลงทะเบียน `@property --p` เป็นตัวเลข → ค่า % ใช้ไม่ได้ กลายเป็น 0 (วงแหวนว่างเปล่า · เจอตอน render 10-30) */
  background: conic-gradient(var(--gt2, #ffd968) var(--hgo-p, 0%), color-mix(in srgb, var(--hb-ink, #f2f1ec) 10%, transparent) 0); }
.hgo-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--hb-panel, #14151d); }
.hgo-ring b, .hgo-ring small { position: relative; line-height: 1.1; }
.hgo-ring b { font-size: 14px; }
.hgo-ring small { font-size: 9.5px; color: var(--hb-dim, #9aa0b4); }
.hgo-mis { display: grid; gap: 8px; }
.hgo-mis__r { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: color-mix(in srgb, var(--hb-ink, #f2f1ec) 5%, transparent);
  border: 1px solid transparent; animation: hgo-up .4s ease both; animation-delay: calc(var(--i, 0) * 45ms); }
.hgo-mis__r.is-ready { border-color: color-mix(in srgb, var(--hb-gold, #ffd968) 60%, transparent); background: color-mix(in srgb, var(--hb-gold, #ffd968) 9%, transparent); }
.hgo-mis__r.is-done { opacity: .62; }
.hgo-mis__ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; font-size: 17px; background: color-mix(in srgb, var(--hb-ink, #f2f1ec) 8%, transparent); }
.hgo-mis__r.is-ready .hgo-mis__ic { animation: hgo-bob 1.6s ease-in-out infinite; }
.hgo-mis__t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.hgo-mis__t b { font-size: 13px; line-height: 1.35; }
.hgo-mis__t small { font-size: 11px; color: var(--hb-dim, #9aa0b4); font-variant-numeric: tabular-nums; }
.hgo-bar { position: relative; display: block; height: 6px; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--hb-ink, #f2f1ec) 10%, transparent); }
.hgo-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--gt1, #7c3aed), var(--gt2, #ffd968));
  box-shadow: 0 0 10px color-mix(in srgb, var(--gt2, #ffd968) 60%, transparent); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.hgo-mis__pts { flex: none; font-size: 12px; font-weight: 800; color: var(--hb-gold, #ffd968); }
.hgo-claim { flex: none; min-height: 36px; padding: 0 12px; }

/* ── 🎮 เกมอื่น ── */
.hgo-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hgo-g { position: relative; display: grid; justify-items: start; gap: 3px; min-height: 128px; padding: 12px; border-radius: 18px; overflow: hidden; isolation: isolate;
  cursor: pointer; text-align: left; font: inherit; color: #fff; background: var(--gt3, #0b0716);
  border: 1px solid color-mix(in srgb, var(--gt2, #ffd968) 45%, transparent); animation: hgo-up .4s ease both; animation-delay: calc(var(--i, 0) * 55ms);
  transition: transform .2s, box-shadow .2s; }
.hgo-g > .hgo-g__scene { z-index: 0; opacity: .85; }
.hgo-g > :not(.hgo-g__scene) { position: relative; z-index: 1; }
.hgo-g::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .55)); }
.hgo-g__ico { font-size: 30px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.hgo-g b { margin-top: auto; font-size: 13.5px; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.hgo-g small { font-size: 10.5px; color: rgba(255, 255, 255, .82); }
.hgo-g em { margin-top: 2px; padding: 3px 9px; border-radius: 99px; font-style: normal; font-size: 11px; font-weight: 800; color: #241600; background: var(--gt2, #ffd968); }
.hgo-g:not(:disabled):hover, .hgo-g:not(:disabled):focus-visible { transform: translateY(-2px); box-shadow: 0 14px 30px -16px var(--gt2, #ffd968); outline: none; }
.hgo-g.is-dim em { color: #fff; background: rgba(255, 255, 255, .18); }
.hgo-g.is-cur { cursor: default; opacity: .7; }
.hgo-g.is-cur em { color: #fff; background: rgba(255, 255, 255, .22); }
.hgo-g:not(.is-dim):not(.is-cur) .hgo-g__ico { animation: hgo-bob 2s ease-in-out infinite; }

@keyframes hgo-fade { from { opacity: 0; } }
@keyframes hgo-out { to { opacity: 0; transform: scale(1.04); } }
@keyframes hgo-spin { to { transform: rotate(360deg); } }
@keyframes hgo-pulse { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
@keyframes hgo-pop { from { transform: scale(.2) rotate(-25deg); opacity: 0; } }
@keyframes hgo-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@keyframes hgo-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes hgo-glow { 50% { box-shadow: 0 0 22px -4px color-mix(in srgb, var(--hb-gold, #ffd968) 70%, transparent); } }

/* ═════ 000362 ล็อกอินในแอป LINE — วงหมุน · ปุ่มล็อกอินเองโผล่หลัง 6 วิ (liff.js กำลังพาเข้าอยู่) ═════ */
.hb-late { visibility: hidden; animation: hgo-late 0s linear 6s forwards; }
.hb-dim > .hb-late { display: block; }
.hb-spin { display: inline-block; width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: hgo-spin .8s linear infinite; }
@keyframes hgo-late { to { visibility: visible; } }

@media (max-width: 360px) {
  .hgo-games { grid-template-columns: minmax(0, 1fr); }
  .hgo-dock__b { font-size: 12.5px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hgo-intro, .hgo-intro *, .hgo-dock *, .hgo-sheet, .hgo-sheet *, .hgo-dock__b { animation: none !important; transition: none !important; }
  /* ⚠️ live-hub.css ปิด animation ทุกตัวใน `.hb` → ปุ่มที่รอแอนิเมชันจะซ่อนถาวร — โชว์เลย */
  .hb .hb-late, .hb-late { visibility: visible; }
}
