/* wolf-ai.css: the Wolf AI card (wolf-ai.js), bottom right on every page.
   Option C, 2026-11-05. --wg-install-banner-h (pwa_head.php) lifts it over the iOS
   "Add to Home Screen" banner; tournament.php's sign-up bar lifts it too. */
.wai-launch{
  position:fixed;right:20px;bottom:calc(20px + var(--wg-install-banner-h,0px));z-index:450;
  height:48px;padding:0 18px 0 6px;gap:10px;border-radius:999px;
  display:flex;align-items:center;cursor:pointer;
  background:#102032;border:1px solid rgba(50,167,235,.45);color:var(--fg,#e8eaf0);
  font:inherit;font-size:.88rem;font-weight:700;line-height:1;white-space:nowrap;
  box-shadow:0 8px 24px rgba(0,0,0,.45);transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.wai-launch img{width:36px;height:36px;border-radius:50%;display:block}
.wai-launch:hover{transform:translateY(-2px);border-color:var(--brand,#32a7eb);box-shadow:0 10px 28px rgba(0,0,0,.5)}
.wai-launch:focus-visible{outline:2px solid var(--brand,#32a7eb);outline-offset:2px}
.wai-launch[aria-expanded="true"]{border-color:var(--brand,#32a7eb)}
.wai-dot{display:none;position:absolute;top:4px;left:36px;width:10px;height:10px;border-radius:50%;
  background:var(--brand,#32a7eb);border:2px solid #102032}
.wai-launch.wai-new .wai-dot{display:block}
body.tn-sticky-on .wai-launch{bottom:calc(88px + var(--wg-install-banner-h,0px))}
body.tn-sticky-on .wai-panel{bottom:calc(148px + var(--wg-install-banner-h,0px))}

.wai-panel{
  position:fixed;right:20px;bottom:calc(80px + var(--wg-install-banner-h,0px));z-index:451;
  width:360px;max-width:calc(100vw - 40px);max-height:min(560px,calc(100vh - 120px));
  display:flex;flex-direction:column;
  background:var(--bg2,#0d1219);color:var(--fg,#e8eaf0);border:1px solid rgba(255,255,255,.1);border-radius:12px;
  box-shadow:0 16px 44px rgba(0,0,0,.55);overflow:hidden;
  animation:wai-in .16s ease;
}
.wai-panel[hidden]{display:none}
@keyframes wai-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

.wai-head{display:flex;align-items:center;gap:11px;padding:10px 8px 10px 14px;border-bottom:1px solid var(--border,rgba(255,255,255,.07))}
.wai-head-img{border-radius:8px;flex-shrink:0;display:block}
.wai-title{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.wai-title b{font-size:.9rem}
.wai-title span{font-size:.72rem;color:var(--muted,#7a8499)}
.wai-x{width:44px;height:44px;display:flex;align-items:center;justify-content:center;flex-shrink:0;
  background:none;border:none;border-radius:8px;color:var(--fg2,#b0b8c8);cursor:pointer}
.wai-x:hover{color:var(--fg,#e8eaf0);background:rgba(255,255,255,.05)}
.wai-x:focus-visible{outline:2px solid var(--brand,#32a7eb)}

.wai-log{flex:1;min-height:90px;overflow-y:auto;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;gap:10px}
.wai-msg{max-width:88%;padding:9px 12px;font-size:.84rem;line-height:1.5;overflow-wrap:anywhere}
.wai-msg p{margin:0}
.wai-msg p+p,.wai-msg ul,.wai-msg ol{margin-top:6px}
.wai-msg ul,.wai-msg ol{margin-bottom:0;padding-left:18px}
.wai-msg code{font-family:ui-monospace,Consolas,monospace;font-size:.78rem;background:var(--inset,#0a1120);border:1px solid var(--inset-border,#1b2840);padding:0 5px;border-radius:4px}
.wai-msg a{color:var(--brand,#32a7eb)}
.wai-a{align-self:flex-start;background:var(--bg3,#0f1520);border:1px solid var(--border,rgba(255,255,255,.07));border-radius:4px 12px 12px 12px}
.wai-q{align-self:flex-end;background:var(--brand,#32a7eb);color:#06121c;font-weight:600;border-radius:12px 4px 12px 12px;white-space:pre-wrap}
.wai-err{align-self:flex-start;background:rgba(224,82,96,.08);border:1px solid rgba(224,82,96,.3);color:var(--red-soft,#fca5a5);border-radius:4px 12px 12px 12px}
.wai-sub,.wai-time{font-size:.7rem;color:var(--muted,#7a8499)}
.wai-time{margin-top:6px}
.wai-quote{border-left:2px solid var(--border-brand,rgba(50,167,235,.25));padding-left:8px;color:var(--fg2,#b0b8c8)}
.wai-wait{display:flex;align-items:center;gap:6px;color:var(--fg2,#b0b8c8)}
.wai-wait .wai-time{margin:0}
.wai-dots{display:inline-flex;gap:3px}
.wai-dots i{width:5px;height:5px;border-radius:50%;background:var(--brand,#32a7eb);animation:wai-dot 1s infinite ease-in-out}
.wai-dots i:nth-child(2){animation-delay:.15s}.wai-dots i:nth-child(3){animation-delay:.3s}
@keyframes wai-dot{0%,80%,100%{opacity:.25}40%{opacity:1}}

.wai-chips{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 10px}
.wai-chips[hidden]{display:none}
.wai-chip{min-height:36px;padding:6px 12px;border-radius:999px;cursor:pointer;text-align:left;
  border:1px solid rgba(50,167,235,.3);background:rgba(50,167,235,.07);color:#cfe9fa;font:inherit;font-size:.76rem;line-height:1.3}
.wai-chip:hover{background:rgba(50,167,235,.15);border-color:var(--brand,#32a7eb)}
.wai-chip:focus-visible{outline:2px solid var(--brand,#32a7eb);outline-offset:1px}
.wai-more{display:block;padding:0 14px 10px;font-size:.8rem;font-weight:600;color:var(--brand,#32a7eb);text-decoration:none}
.wai-more:hover{text-decoration:underline}

.wai-form{display:flex;gap:8px;padding:10px 14px 14px;border-top:1px solid var(--border,rgba(255,255,255,.07))}
.wai-input{flex:1;min-width:0;height:44px;box-sizing:border-box;padding:0 12px;border-radius:8px;
  border:1px solid var(--inset-border,#1b2840);background:var(--inset,#0a1120);color:var(--fg,#e8eaf0);font:inherit;font-size:.86rem}
.wai-input:focus{outline:none;border-color:var(--brand,#32a7eb)}
.wai-send{width:44px;height:44px;flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:pointer;
  border:none;border-radius:8px;background:var(--brand,#32a7eb);color:#06121c}
.wai-send:disabled{opacity:.45;cursor:default}
.wai-send:focus-visible{outline:2px solid #fff;outline-offset:2px}
.wai-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Phones: the card is a bottom sheet and the pill steps aside while it's open. */
@media (max-width:600px){
  .wai-launch{right:14px;bottom:calc(14px + var(--wg-install-banner-h,0px));height:44px;padding:0 14px 0 5px;font-size:.82rem}
  .wai-launch img{width:34px;height:34px}
  .wai-dot{left:33px}
  .wai-open .wai-launch{display:none}
  .wai-panel,body.tn-sticky-on .wai-panel{left:0;right:0;bottom:0;width:auto;max-width:none;
    max-height:min(78vh,620px);border-radius:16px 16px 0 0;border-left:0;border-right:0;border-bottom:0;
    border-top:1px solid rgba(50,167,235,.35);box-shadow:0 -12px 40px rgba(0,0,0,.6)}
  .wai-form{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))}
  .wai-input{font-size:16px} /* under 16px iOS zooms the page on focus */
}
@media (prefers-reduced-motion:reduce){
  .wai-launch,.wai-panel{transition:none;animation:none}
  .wai-dots i{animation:none;opacity:.7}
}
@media print{.wai-launch,.wai-panel{display:none!important}}
