/* ==========================================================================================
   CAPE CLASH - hqchat.css - W126 (D31, step 5): the HEADQUARTERS page's four buttons, the CHAT tab and the HQ STORE card.
   Markup: built by index.html buildHq() and public/js/hqchat.js. Tokens come from index.html's :root (--ink --paper --pow).
   Laid out for 360x640 and 390x844: one column, every tappable thing 44px or taller, nothing wider than the screen.
   ========================================================================================== */

/* ---- the four buttons (the old three-row tab strip, now MEMBERS | CHAT | DONATE | HQ STORE) ---- */
#hqTabs{width:100%;max-width:420px;box-sizing:border-box;}
#hqTabs .hqTab{position:relative;font-size:10.5px;letter-spacing:.2px;padding:6px 0;min-width:0;white-space:nowrap;}
#hqScr #hqBody{width:100%;max-width:420px;}
/* the page is pinned to the top, so the title never jumps when a shorter tab is picked (the shared .screen.center would centre it) */
#hqScr.screen.center::before{margin-top:0;}

/* D32: a button that is not open yet stays where it is, greyed, with a padlock - it is still tappable and says why */
#hqTabs .hqTab.locked{opacity:.6;filter:grayscale(.55);}
#hqTabs .hqTab.locked.on{opacity:1;filter:none;}
#hqTabs .hqTab .hqLockIc{position:absolute;top:2px;right:3px;width:10px;height:10px;}
.hqGrey{opacity:.5;filter:grayscale(.7);}

/* ---- MEMBERS: who is online (only a friend's status is known to the page) ---- */
.hqOnTxt{color:#5ad2a0;font-weight:900;}

/* ---- HQ STORE: the coming-soon card ---- */
.hqSoon{position:relative;margin:6px auto 4px;width:min(260px,86%);aspect-ratio:1/1;display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;color:var(--ink);}
.hqSoon::before{content:'';position:absolute;inset:0;z-index:0;background:var(--pow);border:0;
  clip-path:polygon(50% 0,60% 14%,76% 7%,79% 24%,95% 27%,88% 42%,100% 53%,86% 63%,92% 79%,75% 80%,69% 96%,55% 87%,41% 99%,35% 83%,18% 88%,19% 70%,3% 62%,14% 49%,2% 36%,18% 31%,17% 14%,34% 19%);
  filter:drop-shadow(0 4px 0 #b8901a);}
.hqSoon>*{position:relative;z-index:1;}
.hqSoonBig{font-family:'Bangers',cursive;font-size:34px;letter-spacing:2px;line-height:.95;transform:rotate(-4deg);max-width:60%;}
.hqSoonSub{font-family:'Bangers',cursive;font-size:17px;letter-spacing:1.5px;margin-top:6px;transform:rotate(-4deg);}

/* ---- CHAT ---- */
#hqScr.hqChat #hqSub{display:none;}
.hcRoot{width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:5px;text-align:left;}
.hcHead{font-size:11px;font-weight:900;letter-spacing:.5px;color:#9d93c4;text-align:center;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.hcListWrap{position:relative;}
.hcList{box-sizing:border-box;width:100%;height:clamp(190px,calc(100vh - 390px),520px);height:clamp(190px,calc(100dvh - 390px),520px);
  overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
  display:flex;flex-direction:column;gap:9px;padding:9px 8px 6px;
  border:2px solid #4a3f72;border-radius:12px;background:#120d28;}
.hcEmpty{margin:auto;text-align:center;font-size:12px;font-weight:900;letter-spacing:.6px;color:#9d93c4;padding:14px 8px;}
.hcEmpty[hidden]{display:none;}
.hcLine{display:flex;flex-direction:column;align-items:flex-start;max-width:88%;align-self:flex-start;min-width:0;}
.hcLine.mine{align-self:flex-end;align-items:flex-end;}
.hcLine.hcFirst{margin-top:auto;}
.hcMeta{display:flex;align-items:baseline;gap:7px;max-width:100%;margin:0 7px 2px;font-size:10px;font-weight:900;letter-spacing:.5px;color:#9d93c4;}
.hcWho{color:#d8d2ea;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.hcAgo{flex:0 0 auto;white-space:nowrap;}
.hcBubble{position:relative;display:block;max-width:100%;box-sizing:border-box;margin:0;text-align:left;
  font-family:inherit;font-size:13.5px;font-weight:800;line-height:1.35;color:var(--paper);
  background:#2a2050;border:2px solid #4a3f72;border-radius:14px 14px 14px 4px;padding:8px 12px;min-height:38px;
  white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;}
.hcBubble::after{content:'';position:absolute;left:-2px;bottom:-9px;width:12px;height:10px;background:#2a2050;
  clip-path:polygon(0 0,100% 0,0 100%);}
button.hcBubble{min-height:44px;cursor:pointer;display:flex;align-items:center;gap:8px;}
button.hcBubble:active{background:#352a66;}
.hcText{min-width:0;flex:1 1 auto;}
.hcDots{flex:0 0 auto;font-size:13px;line-height:1;letter-spacing:1px;color:#9d93c4;}
.hcLine.mine .hcBubble{background:var(--pow);color:var(--ink);border-color:var(--ink);border-radius:14px 14px 4px 14px;}
.hcLine.mine .hcBubble::after{left:auto;right:-2px;background:var(--pow);clip-path:polygon(0 0,100% 0,100% 100%);}
.hcPill{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:3;min-height:44px;padding:0 16px;
  font-family:'Bangers',cursive;font-size:16px;letter-spacing:1.5px;color:var(--ink);background:var(--pow);
  border:3px solid var(--ink);border-radius:999px;box-shadow:0 4px 0 #b8901a;cursor:pointer;white-space:nowrap;}
.hcPill.hidden{display:none;}
.hcNet{font-size:11px;font-weight:900;letter-spacing:.4px;color:#ff9a8a;text-align:center;min-height:0;}
.hcNet:empty{display:none;}
.hcNote{font-size:10.5px;font-weight:800;letter-spacing:.3px;color:#9d93c4;text-align:center;line-height:1.35;}
.hcErr{font-size:12px;font-weight:900;letter-spacing:.4px;color:#bdb3d8;text-align:center;}
.hcErr.bad{color:#ff9a8a;}
.hcErr:empty{display:none;}
.hcRow{position:sticky;bottom:0;z-index:4;display:flex;align-items:center;gap:6px;margin:0;
  padding:6px 0 4px;background:var(--ink);}
.hcInput{flex:1 1 auto;min-width:0;box-sizing:border-box;min-height:48px;padding:0 10px;
  font-family:inherit;font-size:16px;font-weight:800;letter-spacing:.3px;color:var(--paper);
  background:#120d28;border:2px solid #4a3f72;border-radius:10px;}
.hcInput::placeholder{color:#7d739f;}
.hcInput:focus{outline:none;border-color:var(--pow);}
.hcCount{flex:0 0 auto;min-width:38px;text-align:right;font-size:10px;font-weight:900;letter-spacing:.3px;color:#9d93c4;}
.hcCount.near{color:#ff9a8a;}
.bigBtn.hcSend{flex:0 0 auto;min-width:76px;min-height:48px;padding:0 14px;font-size:20px;box-shadow:0 4px 0 #b8901a;}
.bigBtn.hcSend:disabled{opacity:.55;filter:grayscale(.6);cursor:default;}
/* 1.0m RC2 Q8 (J's phone: MEMBERS spilled out of its button): on a narrow phone the four HQ tabs sit two by two, every label whole */
@media (max-width:380px){#hqTabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}#hqTabs .hqTab{font-size:12px;padding:7px 4px;white-space:normal;line-height:1.15}}
/* 1.0m RC2 Q8: tab labels never under 11 px; a long member name shortens with ... inside its row instead of running off the screen */
#hqTabs .hqTab{font-size:11px}
@media (max-width:380px){#hqTabs .hqTab{font-size:12px}}
#hqScr .hqRow{min-width:0;max-width:100%;box-sizing:border-box}
#hqScr .hqRow .hvMain,#hqScr .hqRow > div{min-width:0}
#hqScr .hvMain .hqWho{display:block;max-width:100%;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
/* 1.0m RC2 repair (Q8): a long member name wraps onto a second line inside its row instead of losing its end to ... */
