/* ENH-22 v2 (2026-11-14) Tara - the website twin of the in-game Guide overlay (guide.ps1): the same chat-head avatar (a
   glowing teal disc, her body inside the ring, her waving hand over it, a pulsing "?" badge; 12 frames at 11 fps) and the
   same messenger panel (dark rounded card, a gold header with her face + "online - here to help", her bubbles with her
   face beside them, gold bubbles for the visitor, pill chips, a round gold send button).
   Strict CSP: every rule lives here; no inline style anywhere. z-index 55 = above the HUD (50), below the menu (60).
   Art: tara-body.png / tara-hand.png / tara-face.png = the launcher's strip_body / strip_hand / strip (12 frames of 128 px).
   v3 (2026-11-15, ISS-236): on screens wider than 600 px she sits just ABOVE the bottom HUD bar (var(--bar)), so she no longer
   covers the bar's server clock; phones keep bottom 12 px (the bar hides its clock there). The open panel's height then leaves
   room for BOTH HUD bars (100vh - 2 x var(--bar) - 100 px: the chat head + gaps), so its top never goes above the top bar. */
.kg{
  --kg-ui:var(--ui,'Barlow Condensed','Arial Narrow',sans-serif); --kg-disp:var(--disp,'Cinzel',Georgia,serif);
  --kg-text:'Segoe UI',system-ui,-apple-system,Roboto,Arial,sans-serif;
  --kg-gold:#e8c766; --kg-gold-d:#c9a54a; --kg-gold-t:#f1d27a; --kg-ink:#f2eee4; --kg-dim:#9c968a; --kg-hint:#6e6a60;
  --kg-out:var(--out,cubic-bezier(.16,1,.3,1));
  position:fixed;right:20px;bottom:calc(var(--bar,46px) + 10px);z-index:55;display:flex;flex-direction:column;align-items:flex-end;gap:12px;
  font:400 14px/1.4 var(--kg-text);color:var(--kg-ink);text-align:left}
.kg[hidden],.kg [hidden]{display:none!important}
.kg *{box-sizing:border-box}
.kg-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* ---- the chat head: her body inside the disc, the hand over the ring (frames 128 px shown at 92 px) ---- */
.kg-btn{position:relative;width:64px;height:64px;margin:6px 6px 0 0;padding:0;border:0;background:none;cursor:pointer;overflow:visible;
  border-radius:50%;transition:transform .25s var(--kg-out)}
.kg-disc{position:absolute;inset:0;border-radius:50%;overflow:hidden;
  background:radial-gradient(circle at 50% 30%,#35929a 0,#1b4a55 65%,#132530 100%);
  box-shadow:0 0 0 2px var(--kg-gold),0 0 14px rgba(232,199,102,.75),0 8px 22px rgba(0,0,0,.55)}
.kg-body,.kg-hand{position:absolute;left:-14px;top:-14px;width:92px;height:92px;background-repeat:no-repeat;background-size:1104px 92px;
  background-position:0 0;animation:kgWave 1.09s steps(12) infinite}
.kg-body{background-image:url(tara-body.png)}
.kg-hand{background-image:url(tara-hand.png);pointer-events:none}
.kg-badge{position:absolute;left:50px;top:-6px;width:18px;height:18px;border-radius:50%;background:var(--kg-gold);border:1.5px solid #fff6dd;
  color:#16141a;font:700 11px/15px var(--kg-text);text-align:center;animation:kgPulse .55s ease-in-out infinite alternate;pointer-events:none}
.kg.kg-seen .kg-badge{display:none}
.kg-btn:hover,.kg-btn:focus-visible{transform:translateY(-2px);outline:none}
.kg-btn:focus-visible .kg-disc{box-shadow:0 0 0 2px var(--kg-gold),0 0 0 5px rgba(232,199,102,.35),0 0 18px rgba(232,199,102,.85)}
@keyframes kgWave{from{background-position:0 0}to{background-position:-1104px 0}}
@keyframes kgPulse{from{opacity:.55}to{opacity:1}}

/* ---- the greeting bubble beside her ---- */
.kg-bubble{position:relative;max-width:250px;margin:0;padding:10px 13px;cursor:pointer;border-radius:14px 14px 3px 14px;
  background:#2e2a36;border:1px solid rgba(201,165,74,.6);color:var(--kg-ink);font:400 14px/1.35 var(--kg-text);
  box-shadow:0 10px 28px rgba(0,0,0,.55);animation:kgIn .5s var(--kg-out) both}

/* ---- her messenger panel ---- */
.kg-panel{width:min(360px,calc(100vw - 28px));height:min(470px,calc(100vh - 2 * var(--bar,46px) - 100px));display:flex;flex-direction:column;overflow:hidden;
  border-radius:20px;border:1px solid rgba(201,165,74,.6);background:linear-gradient(180deg,rgba(30,26,38,.96),rgba(17,15,21,.96));
  box-shadow:0 14px 40px rgba(0,0,0,.6);animation:kgIn .35s var(--kg-out) both}
.kg-head{display:flex;align-items:center;gap:9px;padding:9px 12px;background:rgba(232,199,102,.2);border-bottom:1px solid rgba(201,165,74,.35)}
.kg-face,.kg-mini{flex:none;border-radius:50%;background-image:url(tara-face.png);background-repeat:no-repeat}
.kg-face{width:34px;height:34px;border:1.5px solid var(--kg-gold-d);background-size:637.5px 53.125px;background-position:-9.56px -1.06px}
.kg-who{display:flex;flex-direction:column;gap:2px;line-height:1.15;min-width:0}
.kg-who b{font:700 16px/1.1 var(--kg-disp);letter-spacing:.06em;color:var(--kg-gold-t)}
.kg-who span{display:flex;align-items:center;gap:5px;font:400 11px/1.2 var(--kg-text);color:var(--kg-dim)}
.kg-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#5fd068}
.kg-x{margin-left:auto;width:32px;height:32px;flex:none;border:0;border-radius:50%;background:none;color:var(--kg-gold-d);font:400 15px/1 var(--kg-text);cursor:pointer}
.kg-x:hover,.kg-x:focus-visible{background:rgba(232,199,102,.15);color:var(--kg-gold-t);outline:none}

.kg-log{flex:1;overflow-y:auto;padding:10px 10px 4px;display:flex;flex-direction:column;gap:6px;overscroll-behavior:contain;scrollbar-width:none}
.kg-log::-webkit-scrollbar{display:none}
.kg-row{display:flex;align-items:flex-end;gap:6px;margin-right:30px}
.kg-mini{width:24px;height:24px;background-size:450px 37.5px;background-position:-6.75px -.75px}
.kg-msg{max-width:250px;margin:0;padding:7px 11px;font:400 13.5px/1.4 var(--kg-text);white-space:pre-line;overflow-wrap:anywhere}
.kg-tara{background:#2e2a36;color:var(--kg-ink);border-radius:14px 14px 14px 3px}
.kg-you{align-self:flex-end;margin-left:40px;background:#e0be5e;color:#16141a;border-radius:14px 14px 3px 14px}
.kg-typing{letter-spacing:.2em;color:var(--kg-gold-t);min-width:44px}

.kg-chips{display:flex;flex-wrap:wrap;gap:6px;padding:4px 10px 4px}
.kg-chips:empty{display:none}
.kg-chips button{margin:0;padding:5px 10px;border-radius:13px;border:1px solid #8a743a;background:#24202a;color:var(--kg-gold-t);
  font:400 12px/1.2 var(--kg-text);cursor:pointer;text-align:left}
.kg-chips button:hover,.kg-chips button:focus-visible{border-color:var(--kg-gold);background:#2f2a36;outline:none}

.kg-form{display:flex;align-items:center;gap:8px;margin:0;padding:6px 12px 12px}
.kg-form input{flex:1;min-width:0;height:36px;margin:0;padding:0 14px;border-radius:17px;background:#2a2730;border:1px solid #5a5040;
  color:var(--kg-ink);font:400 14px/1 var(--kg-text)}
.kg-form input::placeholder{color:var(--kg-hint)}
.kg-form input:focus{outline:none;border-color:var(--kg-gold-d)}
.kg-send{width:36px;height:36px;flex:none;margin:0;padding:0;border:0;border-radius:50%;background:var(--kg-gold-d);color:#16141a;
  font:400 16px/1 var(--kg-text);cursor:pointer}
.kg-send:hover,.kg-send:focus-visible{background:var(--kg-gold);outline:none}
.kg-send:disabled{opacity:.55;cursor:default}

@keyframes kgIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* phones: a smaller chat head; the open panel is a full-width sheet at the bottom and the chat head steps aside */
@media (max-width:600px){
  .kg{right:12px;bottom:12px}
  .kg-bubble{max-width:210px;font-size:13px}
  .kg-panel{position:fixed;left:0;right:0;bottom:0;width:100%;height:min(72vh,520px);border-radius:18px 18px 0 0;border-bottom:0}
  .kg.kg-open .kg-btn{display:none}
}
/* reduced motion: she stands still (frame 1), the badge does not pulse, no slide-ins */
@media (prefers-reduced-motion:reduce){
  .kg-body,.kg-hand,.kg-badge,.kg-bubble,.kg-panel{animation:none}
  .kg-btn{transition:none}
}
