/* Co-op: lobby modal, HUD chip, pings. Only visible while a co-op session is open. */
.coop-card .note { margin: 0; font-size: 13px; line-height: 1.5; color: #B4C0B6; }
.coop-card .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.coop-mission { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.coop-mission b { color: #F3F6F2; font-weight: 500; }
.coop-code { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 16vw, 84px); letter-spacing: 0.22em; line-height: 1; color: var(--green); text-align: center; padding: 12px 0 10px 0.22em; user-select: all; -webkit-user-select: all; }
.coop-hint { text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--muted); margin-top: -6px; }
.coop-label { display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--muted); }
#coop-code-in { height: 72px; width: 100%; box-sizing: border-box; padding: 0 12px; background: #0B110D; border: 1px solid #2E7A47; color: #F3F6F2; font-family: var(--display); font-weight: 800; font-size: 46px; letter-spacing: 0.3em; text-align: center; text-transform: uppercase; }
#coop-code-in:focus { outline: 2px solid var(--green); outline-offset: 1px; }
#coop-code-in::placeholder { color: #2B3A2F; }
.btn.coop-war { align-self: flex-end; }
#btn-coop { color: #8EC0FF; } #btn-coop small { color: var(--muted); }

#coop-hud { position: absolute; right: 10px; bottom: 90px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 5; pointer-events: none; }
#coop-hud > * { pointer-events: auto; }
#coop-chip { padding: 6px 10px; background: rgba(7, 10, 8, 0.92); border: 1px solid var(--line2, #2B3A2F); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: #B4C0B6; white-space: nowrap; }
#coop-chip b { color: #8EC0FF; font-weight: 500; }
#coop-chip.ok span { color: var(--green); } #coop-chip.lost span { color: var(--amber, #F2B544); }
#coop-ping { height: 36px; min-width: 84px; padding: 0 14px; background: rgba(7, 10, 8, 0.92); border: 1px solid #8EC0FF; color: #8EC0FF; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; }
#coop-pings { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 360px; }
#coop-pings.hidden { display: none; }
#coop-pings button { height: 40px; padding: 0 12px; background: rgba(7, 10, 8, 0.94); border: 1px solid var(--pc); color: var(--pc); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; }
body.coop-pinging #game { cursor: crosshair !important; }
#roster-list .row.coop-theirs { opacity: 0.38; pointer-events: none; }
#roster-list .row.coop-theirs .r-top i::after { content: ' · PARTNER'; color: #8EC0FF; }

.coop-ping-mark { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
.coop-ping-mark i { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border: 2px solid var(--pc); border-radius: 50%; animation: coop-ping 0.9s ease-out infinite; }
.coop-ping-mark span { position: absolute; left: 0; top: 20px; transform: translateX(-50%); padding: 2px 6px; background: rgba(7, 10, 8, 0.9); color: var(--pc); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; white-space: nowrap; }
@keyframes coop-ping { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  #coop-hud { right: 8px; bottom: 84px; }
  body.coop-on #toast { bottom: 178px; }
  #coop-chip { font-size: 9px; padding: 5px 8px; }
  #coop-ping { height: 40px; }
  #coop-pings { max-width: calc(100vw - 120px); }
  #coop-pings button { height: 44px; }
  .coop-card { max-height: calc(var(--vh, 100vh) - 24px); overflow: auto; }
}
body.cinematic #coop-hud { display: none !important; }

/* ---------- v1.9 quick match ---------- */
.coop-card { width: min(480px, calc(100% - 24px)); }
.coop-card .modal-tabs { overflow-x: auto; scrollbar-width: none; }
.coop-card .modal-tabs button { white-space: nowrap; flex: 0 0 auto; }
.coop-card .modal-tabs .modal-x { margin-left: auto; }
.coop-card .modal-tabs [data-ctab="quick"] { color: #8EC0FF; }
.coop-card .modal-tabs [data-ctab="quick"].active { color: var(--green); }
#coop-quick-pane { display: flex; flex-direction: column; gap: 14px; }
#coop-quick-pane.hidden { display: none; }
.qm-stage { display: flex; align-items: center; gap: 18px; min-height: 120px; }
.qm-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.qm-radar { position: relative; flex: 0 0 112px; width: 112px; height: 112px; border-radius: 50%; border: 1px solid #2E7A47; overflow: hidden;
  background: radial-gradient(circle, rgba(124, 255, 154, 0.10) 0, rgba(124, 255, 154, 0.03) 55%, transparent 70%), repeating-linear-gradient(0deg, transparent 0 13px, rgba(124, 255, 154, 0.06) 13px 14px), repeating-linear-gradient(90deg, transparent 0 13px, rgba(124, 255, 154, 0.06) 13px 14px), #08100B; }
.qm-radar .ring { position: absolute; border: 1px solid rgba(124, 255, 154, 0.22); border-radius: 50%; }
.qm-radar .r1 { inset: 18px; } .qm-radar .r2 { inset: 38px; }
.qm-radar .sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(124, 255, 154, 0) 0deg, rgba(124, 255, 154, 0) 280deg, rgba(124, 255, 154, 0.45) 358deg, rgba(124, 255, 154, 0) 360deg); opacity: 0.35; }
.qm-radar .blip { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); opacity: 0; }
.qm-radar .b1 { left: 72%; top: 30%; } .qm-radar .b2 { left: 30%; top: 66%; }
#coop-quick-pane[data-state="searching"] .sweep, #coop-quick-pane[data-state="matched"] .sweep { opacity: 1; animation: qm-sweep 2.2s linear infinite; }
#coop-quick-pane[data-state="searching"] .blip { animation: qm-blip 2.2s linear infinite; }
#coop-quick-pane[data-state="searching"] .b2 { animation-delay: 1.1s; }
#coop-quick-pane[data-state="matched"] .b1 { opacity: 1; background: #8EC0FF; box-shadow: 0 0 10px #8EC0FF; }
#coop-quick-pane[data-state="matched"] .qm-radar { border-color: #8EC0FF; }
@keyframes qm-sweep { to { transform: rotate(360deg); } }
@keyframes qm-blip { 0%, 60% { opacity: 0; } 66% { opacity: 1; } 100% { opacity: 0; } }
.qm-idle-txt { display: flex; flex-direction: column; gap: 10px; }
.qm-search-txt, .qm-found { display: none; flex-direction: column; gap: 4px; }
#coop-quick-pane:not([data-state="idle"]) .qm-idle-txt { display: none; }
#coop-quick-pane[data-state="searching"] .qm-search-txt { display: flex; }
#coop-quick-pane[data-state="matched"] .qm-found { display: flex; }
.qm-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--green); animation: qm-pulse 1.4s ease-in-out infinite; }
@keyframes qm-pulse { 50% { opacity: 0.45; } }
.qm-elapsed { font-family: var(--display); font-weight: 800; font-size: 48px; line-height: 1; color: #F3F6F2; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.qm-look { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); min-height: 14px; }
.qm-look i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dim); box-shadow: 0 0 6px var(--green-dim); flex: 0 0 auto; }
.qm-found span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: #8EC0FF; }
.qm-found b { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; color: #F3F6F2; letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qm-found em { font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--muted); line-height: 1.5; }
#btn-quickmatch { color: #8EC0FF; } #btn-quickmatch small { color: var(--muted); }

/* ---------- v1.9 connection quality / partner names ---------- */
#coop-chip em.rtt { font-style: normal; color: #B4C0B6; }
#coop-chip em.rtt i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: currentColor; }
#coop-chip em.rtt.good { color: var(--green); } #coop-chip em.rtt.fair { color: var(--amber); } #coop-chip em.rtt.poor { color: var(--red); }
#roster-list .row.coop-theirs[data-partner] .r-top i::after { content: none; }
#roster-list .row.coop-theirs .r-role[data-partner]::after { content: ' · ' attr(data-partner); color: #8EC0FF; }
.log-line.comms { color: #8EC0FF; }

/* ---------- v1.9 quick comms ---------- */
.coop-btns { display: flex; gap: 6px; }
#coop-comms { height: 36px; min-width: 96px; padding: 0 12px; background: rgba(7, 10, 8, 0.92); border: 1px solid var(--green-dim); color: var(--green); font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; }
#coop-comms small { font-size: 9px; color: var(--muted); margin-left: 4px; border: 1px solid var(--line2); padding: 0 4px; }
#coop-comms.on { background: rgba(124, 255, 154, 0.14); }
#qc-grid .red, .qc-r-item.red, .qc-bubble.red { --qc: #E0533D; }
#qc-grid .amber, .qc-r-item.amber, .qc-bubble.amber { --qc: #F2B544; }
#qc-grid .blue, .qc-r-item.blue, .qc-bubble.blue { --qc: #8EC0FF; }
#qc-grid .green, .qc-r-item.green, .qc-bubble.green { --qc: #7CFF9A; }
#qc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: 460px; max-width: calc(100vw - 20px); padding: 6px; background: rgba(7, 10, 8, 0.94); border: 1px solid var(--line2); }
#qc-grid.hidden { display: none; }
#qc-grid button { position: relative; height: 44px; padding: 0 6px 0 20px; background: #0B110D; border: 1px solid var(--line2); border-left: 3px solid var(--qc); color: #E6EBE4; font-family: var(--body); font-weight: 600; font-size: 13px; text-align: left; line-height: 1.1; }
#qc-grid button em { position: absolute; left: 6px; top: 4px; font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--muted); }
#qc-grid button:hover { background: #13201A; } #qc-grid button:active { background: #17271D; }

.qc-bubble { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 4; animation: qc-life 3.6s ease forwards; }
.qc-inner { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 10px)); display: flex; flex-direction: column; align-items: center; }
.qc-b-head { display: flex; align-items: center; gap: 6px; padding: 3px 8px 2px; background: rgba(7, 10, 8, 0.95); border: 1px solid var(--qc); border-bottom: none; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--qc); white-space: nowrap; }
.qc-b-text { position: relative; padding: 5px 12px 6px; background: rgba(7, 10, 8, 0.95); border: 1px solid var(--qc); border-left-width: 3px; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.1; letter-spacing: 0.04em; color: #F3F6F2; white-space: nowrap; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); }
.qc-b-text::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 9px; height: 9px; margin-left: -5px; background: #070A08; border-right: 1px solid var(--qc); border-bottom: 1px solid var(--qc); transform: rotate(45deg); }
.qc-wave { display: inline-flex; align-items: flex-end; gap: 1px; height: 8px; }
.qc-wave b { width: 2px; background: var(--qc); animation: qc-wave 0.5s ease-in-out infinite alternate; }
.qc-wave b:nth-child(1) { height: 4px; } .qc-wave b:nth-child(2) { height: 8px; animation-delay: 0.15s; } .qc-wave b:nth-child(3) { height: 5px; animation-delay: 0.3s; }
@keyframes qc-wave { to { transform: scaleY(0.35); } }
@keyframes qc-life { 0% { opacity: 0; } 6% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }

#qc-radial { position: fixed; z-index: 60; width: 0; height: 0; pointer-events: none; }
#qc-radial::before { content: ''; position: absolute; left: -260px; top: -200px; width: 520px; height: 400px; border-radius: 50%; background: radial-gradient(closest-side, rgba(7, 10, 8, 0.84) 0, rgba(7, 10, 8, 0.72) 78%, rgba(7, 10, 8, 0) 100%); }
.qc-r-hub { position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 1px solid #2E7A47; background: rgba(7, 10, 8, 0.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.qc-r-hub b { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.2em; color: var(--green); }
.qc-r-hub span { font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; color: var(--muted); line-height: 1.4; }
.qc-r-item { position: absolute; left: -62px; top: -18px; width: 124px; height: 36px; pointer-events: auto; background: rgba(11, 17, 13, 0.97); border: 1px solid var(--line2); border-left: 3px solid var(--qc); color: #E6EBE4; font-family: var(--body); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.08s, border-color 0.08s; }
.qc-r-item em { font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.qc-r-item.hot, .qc-r-item:hover { background: #17271D; border-color: var(--qc); color: #fff; box-shadow: 0 0 0 1px var(--qc), 0 0 16px rgba(0, 0, 0, 0.6); }

@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .coop-card .modal-tabs button { padding: 0 8px; letter-spacing: 0.1em; }
  .qm-stage { gap: 14px; }
  .qm-radar { flex-basis: 92px; width: 92px; height: 92px; }
  .qm-elapsed { font-size: 40px; } .qm-found b { font-size: 32px; }
  #qc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 290px; }
  #qc-grid button { height: 46px; font-size: 14px; }
  #coop-comms { height: 40px; min-width: 88px; }
  #coop-comms small { display: none; }
  .qc-b-text { font-size: 16px; padding: 4px 9px 5px; }
}
#coop-quick-msg:empty { display: none; }
