/* =============================================================
   Qi Cultivation — ambient HUD, onboarding, nudge, menu dot
   Reuses --qg-* tokens from qg-game.css.
   ============================================================= */

/* ---------------- collapsed pill + panel wrapper ---------------- */
.qg-hud { position: fixed; right: 18px; bottom: 18px; z-index: 99990; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.qg-hud-pill {
    position: relative; width: 58px; height: 58px; border-radius: 50%; cursor: pointer;
    border: 2px solid var(--tier, #4f8dff);
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--tier) 30%, #12141c), #12141c);
    box-shadow: 0 8px 24px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center;
    transition: transform .18s; padding: 0;
}
.qg-hud-pill:hover { transform: scale(1.08); }
.qg-hud-ring { position: absolute; inset: -2px; width: 62px; height: 62px; transform: rotate(-90deg); }
.qg-ring-bg { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 3; }
.qg-ring-fg { fill: none; stroke: var(--tier, #4f8dff); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.qg-hud-gem { font-size: 22px; color: #fff; line-height: 1; z-index: 1; }
.qg-hud-dot { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: #ff3b3b; border: 2px solid #12141c; box-shadow: 0 0 0 0 rgba(255,59,59,.6); animation: qg-dot 1.6s infinite; }
@keyframes qg-dot { 0% { box-shadow: 0 0 0 0 rgba(255,59,59,.6); } 70% { box-shadow: 0 0 0 10px rgba(255,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); } }
.qg-has-claim { animation: qg-pill-glow 2.4s ease-in-out infinite; }
@keyframes qg-pill-glow { 0%,100% { box-shadow: 0 8px 24px rgba(0,0,0,.4); } 50% { box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 22px var(--tier); } }

/* ---------------- expandable panel ---------------- */
.qg-hud-panel {
    width: 300px; max-width: calc(100vw - 36px);
    background: var(--qg-panel, #171a22); color: var(--qg-text, #e6e8ee);
    border: 1px solid var(--qg-line, #2a2f3a); border-left: 4px solid var(--tier, #4f8dff);
    border-radius: 14px; padding: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
    transform-origin: bottom right; transform: scale(.6) translateY(20px); opacity: 0; pointer-events: none;
    transition: transform .22s cubic-bezier(.2,.9,.3,1.2), opacity .22s;
}
.qg-hud-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.qg-hud-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qg-hud-gem2 { font-size: 26px; color: var(--tier); }
.qg-hud-realm { font-weight: 800; font-size: 15px; }
.qg-hud-realm .qg-hanzi { font-family: 'Georgia', serif; opacity: .8; font-weight: 400; }
.qg-hud-sub { font-size: 11.5px; color: var(--qg-muted, #99a0ae); margin-top: 2px; }
.qg-hud-ready { color: var(--qg-gold, #f4c95d); }
.qg-hud-close { margin-left: auto; background: none; border: none; color: var(--qg-muted); font-size: 22px; line-height: 1; cursor: pointer; align-self: flex-start; }
.qg-hud-bar { height: 8px; border-radius: 999px; background: var(--qg-panel-2, #1e222c); overflow: hidden; margin-bottom: 10px; }
.qg-hud-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--tier), color-mix(in srgb, var(--tier) 50%, var(--qg-gold, #f4c95d))); transition: width .6s; }
.qg-hud-wallet { font-size: 13px; color: var(--qg-muted); margin-bottom: 10px; }
.qg-hud-dev { font-size: 12px; color: var(--qg-crimson, #e5533c); font-weight: 700; margin-bottom: 10px; }
.qg-hud-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.qg-hud-reset { font-size: 11px; color: var(--qg-muted); margin-bottom: 8px; }
.qg-hud-full { display: block; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--tier); text-decoration: none; padding-top: 8px; border-top: 1px solid var(--qg-line); }

/* HUD toast */
.qg-hud-toast { position: fixed; bottom: 90px; right: 18px; z-index: 99991; background: var(--qg-panel, #171a22); color: var(--qg-text, #e6e8ee); border: 1px solid var(--qg-line, #2a2f3a); border-left: 4px solid var(--qg-jade, #35c496); padding: 11px 15px; border-radius: 10px; font-size: 13px; font-weight: 600; max-width: 320px; box-shadow: 0 12px 30px rgba(0,0,0,.45); opacity: 0; transform: translateY(12px); transition: .3s; }
.qg-hud-toast.show { opacity: 1; transform: none; }
.qg-hud-toast.qg-toast--bad { border-left-color: var(--qg-crimson, #e5533c); }
.qg-hud-toast.qg-toast--epic { border-left-color: var(--qg-gold, #f4c95d); background: linear-gradient(120deg, color-mix(in srgb, var(--qg-gold) 18%, var(--qg-panel)), var(--qg-panel)); }

/* ---------------- logged-out chapter nudge ---------------- */
.qg-nudge {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px); z-index: 99990;
    display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 24px));
    background: rgba(18,20,28,.97); color: #fff; border: 1px solid rgba(255,255,255,.12); border-left: 4px solid var(--qg-gold, #f4c95d);
    padding: 12px 14px; border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.5); opacity: 0; transition: .35s;
}
.qg-nudge.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.qg-nudge-ico { font-size: 24px; color: var(--qg-gold, #f4c95d); }
.qg-nudge-txt { flex: 1; font-size: 13px; line-height: 1.4; }
.qg-nudge-txt b { color: var(--qg-gold, #f4c95d); }
.qg-nudge-x { background: none; border: none; color: rgba(255,255,255,.6); font-size: 20px; cursor: pointer; line-height: 1; }
@media (max-width: 520px) { .qg-nudge { flex-wrap: wrap; } .qg-nudge-txt { flex-basis: 100%; } }

/* ---------------- onboarding modal ---------------- */
.qg-ob-overlay { position: fixed; inset: 0; z-index: 99995; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6,8,14,.72); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.qg-ob-overlay.show { opacity: 1; }
.qg-ob-modal {
    position: relative; width: min(460px, 100%); max-height: 90vh; overflow: auto; text-align: center;
    background: linear-gradient(160deg, #1b1f2b, #12141c); color: #e6e8ee;
    border: 1px solid #2a2f3a; border-radius: 18px; padding: 30px 26px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
    transform: scale(.85) translateY(14px); transition: transform .35s cubic-bezier(.2,.9,.3,1.2);
}
.qg-ob-overlay.show .qg-ob-modal { transform: none; }
.qg-ob-seal { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-family: 'Georgia', serif; font-size: 68px; color: var(--qg-gold, #f4c95d); opacity: .1; pointer-events: none; }
.qg-ob-modal h2 { font-size: 24px; margin: 6px 0 6px; }
.qg-ob-lead { color: #99a0ae; font-size: 13.5px; margin: 0 0 18px; }
.qg-ob-gems { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 14px; }
.qg-ob-gem { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 16px; min-width: 84px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--ec); box-shadow: 0 0 22px color-mix(in srgb, var(--ec) 30%, transparent); animation: qg-ob-pop .5s backwards; }
@keyframes qg-ob-pop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.qg-ob-ico { font-size: 34px; }
.qg-ob-name { font-size: 12px; font-weight: 800; color: var(--ec); }
.qg-ob-rare { font-size: 13px; font-weight: 800; color: var(--qg-gold, #f4c95d); margin-bottom: 10px; animation: qg-ob-shine 1.6s ease-in-out infinite; }
@keyframes qg-ob-shine { 0%,100% { opacity: .8; } 50% { opacity: 1; text-shadow: 0 0 14px var(--qg-gold, #f4c95d); } }
.qg-ob-mult { font-size: 15px; margin: 4px 0 16px; }
.qg-ob-mult b { color: var(--qg-gold, #f4c95d); font-size: 20px; }
.qg-ob-tips { list-style: none; padding: 0; margin: 0 0 22px; text-align: left; display: inline-block; }
.qg-ob-tips li { font-size: 13.5px; color: #c7ccd6; margin-bottom: 8px; }
.qg-ob-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------------- nav menu dot ---------------- */
.qg-menu-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; margin-left: 4px; vertical-align: super; animation: qg-dot 1.6s infinite; }

@media (max-width: 600px) {
    .qg-hud { right: 12px; bottom: 12px; }
    .qg-hud-pill { width: 52px; height: 52px; }
}
