/* Co-op signpost */
.coop-panel{width:min(760px,94vw);max-height:90vh;overflow:auto}
.coop-card,.coop-request-editor,.coop-list{display:grid;gap:8px}
.coop-card,.coop-request-editor{padding:12px;border:1px solid rgba(255,255,255,.13);border-radius:10px;background:rgba(8,13,11,.58);margin-bottom:12px}
.coop-request-editor label{font-weight:900;font-size:12px;letter-spacing:.08em;text-transform:uppercase}
.coop-request-editor input,.coop-search input{min-width:0;width:100%;box-sizing:border-box}
.coop-actions,.coop-search,.coop-row-actions{display:flex;gap:8px;align-items:center}
.coop-search{margin-bottom:10px}
.coop-search input{flex:1}
.coop-list{margin-bottom:14px}
.coop-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 12px;border:1px solid rgba(255,255,255,.1);border-radius:9px;background:rgba(255,255,255,.035)}
.coop-row>div:first-child{display:grid;gap:3px;min-width:0}
.coop-row strong{font-size:13px}
.coop-row small{font-size:11px;opacity:.72;overflow-wrap:anywhere}
.coop-row-actions{flex:0 0 auto}
.coop-row-actions button{padding:7px 10px;font-size:10px}
@media(max-width:620px){
  .coop-row,.coop-search,.coop-actions{align-items:stretch;flex-direction:column}
  .coop-row-actions{width:100%}
  .coop-row-actions button{flex:1}
}


.coop-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:10px 0 12px;padding:4px;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:rgba(7,12,10,.65)}
.coop-tabs button{min-height:38px;padding:7px 10px;background:transparent;color:#8fa89d;border:1px solid transparent}
.coop-tabs button.active{background:#22362e;color:#eff8f3;border-color:#4d6d60}
.coop-pane{min-height:0}
.coop-pane>h3:first-child{margin-top:4px}
.coop-lobby-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.coop-lobby-head h3{margin:4px 0 8px}
.coop-lobby-tools{display:flex;gap:6px}
.coop-lobby-tools button{min-height:34px;padding:6px 9px;font-size:9px}
.coop-request-editor select{width:100%;box-sizing:border-box;min-height:44px;border:1px solid #3a4c45;background:#0b1310;color:white;border-radius:10px;padding:10px;margin:5px 0 8px}
@media(max-width:620px){
  .coop-lobby-head{align-items:stretch;flex-direction:column}
  .coop-lobby-tools{width:100%}
  .coop-lobby-tools button{flex:1}
}

/* Co-op invitation / membership dialogue. Intentionally independent from the
   signpost panel so invitations can arrive anywhere without pausing co-op. */
.coop-notice-modal{z-index:80;background:rgba(3,8,7,.72);backdrop-filter:blur(3px)}
.coop-notice-panel{width:min(420px,calc(100vw - 30px));display:grid;gap:12px;padding:20px;border:1px solid #496c5d;background:#101d18;box-shadow:0 18px 54px rgba(0,0,0,.52)}
.coop-notice-eyebrow{color:#89bda6;font-size:9px;font-weight:900;letter-spacing:.12em}
.coop-notice-panel h2{margin:0;font-size:21px;line-height:1.14}
.coop-notice-copy{margin:0;color:#b7c9c1;font-size:11px;line-height:1.45}
.coop-notice-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin-top:3px}
.coop-notice-actions button{min-height:44px}
@media(max-width:430px){.coop-notice-panel{padding:17px}.coop-notice-panel h2{font-size:19px}}


/* Keep the co-op controls together so chat always sits directly below the
   teammate status, including when a rescue countdown appears. Leave the
   right-hand minimap clear on mobile, and pass world taps through unused space. */
.coop-overlay{
  position:fixed;
  z-index:9;
  top:38px;
  left:10px;
  width:min(350px,calc(100vw - 153px));
  max-width:calc(100vw - 20px);
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:4px;
  pointer-events:none;
  font-family:'WaveVar2';
}
.coop-hud{
  position:relative;
  z-index:2;
  min-height:32px;
  display:flex;
  align-items:stretch;
  gap:5px;
  pointer-events:none;
}
.coop-hud-menu-wrap{
  position:relative;
  flex:0 0 32px;
  pointer-events:auto;
}
.coop-hud-menu-button{
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  min-width:32px;
  min-height:32px;
  padding:0;
  border:1px solid rgba(255,255,255,.16);
  border-radius:7px;
  background:rgba(7,12,15,.86);
  color:#eef5f1;
  font:900 19px/1 'WaveVar2';
  box-shadow:0 4px 12px rgba(0,0,0,.18);
  touch-action:manipulation;
}
.coop-hud-menu-button[aria-expanded="true"]{border-color:#7ea995;background:rgba(20,38,31,.94)}
.coop-hud-menu{
  position:absolute;
  top:calc(100% + 5px);
  left:0;
  width:176px;
  padding:5px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:9px;
  background:rgba(10,18,15,.96);
  box-shadow:0 12px 30px rgba(0,0,0,.42);
}
.coop-hud-menu button{
  width:100%;
  min-height:36px;
  margin:1px 0;
  border:0;
  border-radius:7px;
  background:#1f3830;
  color:#e7f6ed;
  font:900 9px 'WaveVar2';
  touch-action:manipulation;
}
.coop-hud-menu #coopHudLeave{background:#3a2020;color:#ffd9d9}
.coop-hud-menu button:active{transform:translateY(1px)}
.coop-hud-members{
  flex:1 1 auto;
  min-width:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
}
/* One teammate fills both tracks rather than leaving an empty teammate slot. */
.coop-hud-member:only-child{grid-column:1/-1}
.coop-hud-member{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto 4px;
  gap:2px 5px;
  align-items:center;
  padding:4px 6px 3px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:7px;
  background:rgba(7,12,15,.82);
  box-shadow:0 4px 12px rgba(0,0,0,.16);
  backdrop-filter:blur(3px);
}
.coop-hud-member.offline{opacity:.58}
.coop-hud-member-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#eef5f1;
  font-size:9px;
  font-weight:900;
  letter-spacing:.02em;
}
.coop-hud-member-hp{
  color:#dfe9e4;
  font-size:8px;
  font-weight:900;
  white-space:nowrap;
}
.coop-hud-health{
  grid-column:1/-1;
  position:relative;
  height:4px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(0,0,0,.58);
}
.coop-hud-health>span{
  position:absolute;
  inset:0 auto 0 0;
  width:0;
  border-radius:inherit;
  background:linear-gradient(90deg,#42b85b,#7fe88e);
  transition:width .12s linear;
}
.coop-hud-member.downed .coop-hud-health>span{background:#c75d67}
.coop-rescue-countdown{
  align-self:flex-start;
  max-width:100%;
  padding:5px 8px;
  border:1px solid rgba(255,173,124,.42);
  border-radius:8px;
  background:rgba(35,15,16,.9);
  color:#ffe1ac;
  font:900 10px/1.3 'WaveVar2';
  letter-spacing:.02em;
  pointer-events:none;
}

/* A smaller single-line preview stays under the teammate bars. The expanded
   transcript remains scrollable and resizable, with full-width touch controls. */
.coop-chat{
  position:relative;
  z-index:1;
  width:min(220px,100%);
  min-width:0;
  color:#eaf4ee;
  font-family:'WaveVar2';
  font-size:9px;
  pointer-events:auto;
}
.coop-chat-peek{
  display:block;
  width:100%;
  min-height:24px;
  padding:4px 7px;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  border:1px solid #436054;
  border-radius:7px;
  background:rgba(7,17,14,.94);
  color:inherit;
  font:inherit;
  cursor:pointer;
  touch-action:manipulation;
}
.coop-chat.expanded .coop-chat-peek{display:none}
.coop-chat-expanded{
  display:flex;
  flex-direction:column;
  width:100%;
  height:210px;
  min-width:min(185px,100%);
  min-height:136px;
  max-width:calc(100vw - 22px);
  max-height:min(55dvh,520px);
  resize:both;
  overflow:hidden;
  border:1px solid #507866;
  border-radius:9px;
  background:rgba(7,17,14,.97);
  box-shadow:0 12px 34px #0008;
}
.coop-chat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:6px 9px;
  border-bottom:1px solid #345143;
  font-size:10px;
  letter-spacing:.06em;
}
.coop-chat-head button{
  min-width:30px;
  min-height:26px;
  padding:0 6px;
  border:0;
  background:#263e33;
  color:#e7f6ed;
}
.coop-chat-messages{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:7px 9px;
  display:flex;
  flex-direction:column;
  gap:4px;
  user-select:text;
}
.coop-chat-entry{overflow-wrap:anywhere;line-height:1.45}
.coop-chat-time{font-size:9px;color:#91ac9e;margin-right:5px}
.coop-chat-sender{font-weight:900;color:#a8d6b8;margin-right:4px}
.coop-chat-form{display:flex;gap:5px;padding:7px;border-top:1px solid #345143}
.coop-chat-form input{
  flex:1 1 auto;
  min-width:0;
  height:32px;
  padding:5px 8px;
  border:1px solid #4a6b59;
  border-radius:6px;
  background:#101e18;
  color:white;
  font:inherit;
}
.coop-chat-form button{
  flex:0 0 auto;
  padding:4px 9px;
  background:#315841;
  border:1px solid #6b987c;
  color:white;
  font:900 9px 'WaveVar2';
}
@media(max-width:620px){
  .coop-overlay{top:36px;width:min(310px,calc(100vw - 153px))}
  .coop-hud-member-name{font-size:8px}
  .coop-chat{width:min(200px,100%)}
  .coop-chat-expanded{height:174px}
}
/* Extremely narrow screens need two stacked cards to keep both HP values legible. */
@media(max-width:360px){
  .coop-hud-members{grid-template-columns:minmax(0,1fr)}
}

