/* Party window (party.js). Builds on ui.css: .sys-window, .sw-head, .sw-body, .sys-btn, .sec-h, kbd. */
#party { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 8; background: rgba(0, 4, 12, 0.45); pointer-events: auto; }
#party.hidden { display: none; }
#party [hidden] { display: none !important; }
.party-win.sys-window { width: min(780px, 96vw); max-height: calc(var(--vh) * 96); padding-bottom: 14px; }
.party-win .sw-icon { width: 20px; padding: 0; }
.party-win .sw-icon svg { width: 13px; height: 13px; }
.pt-body.sw-body { display: grid; grid-template-columns: minmax(230px, 1fr) 1.3fr; gap: 22px; padding: 14px 22px 4px; text-align: left; font-size: 16px; touch-action: pan-y; overscroll-behavior: contain; }

/* left: create / join, or the code + invite */
.pt-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pt-out, .pt-in { display: flex; flex-direction: column; gap: 10px; }
.pt-side .sys-btn { min-height: 46px; padding: 8px 16px; font-size: 17px; }
.pt-or { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sys-dim); }
.pt-or::before, .pt-or::after { content: ''; flex: 1; border-top: 1px dashed rgba(79, 195, 255, 0.3); }
.pt-join { display: flex; gap: 8px; }
.pt-input, .pt-link {
  min-width: 0; font-family: var(--font); font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--sys-border);
  box-shadow: inset 0 0 12px rgba(79, 195, 255, 0.15); outline: none; user-select: text; -webkit-user-select: text;
}
.pt-input { flex: 1; min-height: 46px; padding: 6px 12px; font-size: 24px; letter-spacing: 0.32em; text-align: center; text-transform: uppercase; }
.pt-input::placeholder { color: rgba(143, 180, 204, 0.5); letter-spacing: 0.2em; }
.pt-input:focus { border-color: #bff0ff; box-shadow: 0 0 14px #7fd0ff, inset 0 0 14px rgba(127, 208, 255, 0.25); }
.pt-in .sec-h { margin-bottom: -4px; }
.pt-code { font-family: 'Silkscreen', var(--font); font-size: 40px; line-height: 1.1; letter-spacing: 0.22em; color: #fff; text-shadow: 0 0 14px var(--sys-border); }
.pt-link { width: 100%; box-sizing: border-box; padding: 5px 8px; font-size: 13px; font-weight: 600; color: var(--sys-dim); }
.pt-status { margin: 0; font-size: 14px; color: var(--sys-dim); }
.pt-status.s-online { color: var(--ok); }
.pt-msg { margin: 0; min-height: 1.2em; font-size: 15px; font-weight: 700; color: var(--ok); }
.pt-msg.bad { color: #ffb0b0; }

/* right: members (you first, then open slots) */
.pt-members { min-width: 0; }
.pt-members .sec-h b { float: right; color: #fff; letter-spacing: 0.08em; }
.pt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pt-m {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-areas: 'dot who zn' 'dot who cs'; align-items: center; column-gap: 10px;
  min-height: 48px; padding: 4px 10px; box-sizing: border-box; background: rgba(8, 22, 44, 0.7); border: 1px solid rgba(79, 195, 255, 0.3);
}
.pt-m .dot { grid-area: dot; width: 9px; height: 9px; transform: rotate(45deg); background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pt-m .who { grid-area: who; min-width: 0; line-height: 1.15; }
.pt-m .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; color: #fff; }
.pt-m .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--sys-dim); }
.pt-m .zn { grid-area: zn; font-size: 13px; font-weight: 700; color: var(--sys-text); text-align: right; }
.pt-m .cs { grid-area: cs; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ok); text-align: right; }
.pt-m.you { border-color: #8fe0ff; box-shadow: inset 0 0 12px rgba(79, 195, 255, 0.18); }
.pt-m.you .cs { color: #8fe0ff; }
.pt-m.you .dot { background: #8fe0ff; box-shadow: 0 0 8px #8fe0ff; }
.pt-m.c-connecting .dot, .pt-m.c-connecting .cs { background: none; color: var(--gold); }
.pt-m.c-connecting .dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: flicker 1.2s infinite; }
.pt-m.c-lost .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: flicker 1s infinite; }
.pt-m.c-lost .cs { color: #ffb0b0; }
.pt-m.open { display: flex; justify-content: center; border-style: dashed; border-color: rgba(79, 195, 255, 0.2); background: rgba(4, 10, 22, 0.5); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(143, 180, 204, 0.6); }

.pt-foot { display: flex; align-items: center; gap: 14px; padding: 10px 22px 0; }
.pt-foot .sys-btn { min-height: 44px; padding: 8px 18px; font-size: 16px; }
.pt-foot .sys-btn kbd { margin-left: 6px; height: 17px; font-size: 11px; }
.pt-hint { flex: 1; text-align: center; font-size: 14px; color: var(--sys-dim); }
.pt-foot [data-p="close"] { margin-left: auto; }

/* phone landscape: everything on one screen, finger-sized targets */
@media (max-height: 460px) {
  .party-win.sys-window { max-height: calc(var(--vh) * 98); padding-bottom: 8px; }
  .party-win .sw-head { padding: 6px 14px 5px; font-size: 16px; }
  .pt-body.sw-body { gap: 14px; padding: 8px 14px 2px; }
  .pt-side, .pt-out, .pt-in { gap: 7px; }
  .pt-code { font-size: 30px; }
  .pt-list { gap: 4px; }
  .pt-m { min-height: 44px; padding: 2px 8px; }
  .pt-m .who b { font-size: 15px; }
  .pt-m .who small { font-size: 12px; }
  .pt-foot { padding: 6px 14px 0; gap: 8px; }
  .pt-hint { font-size: 12px; }
}
@media (max-width: 560px) {
  .pt-body.sw-body { grid-template-columns: 1fr; }
  .pt-hint { display: none; }
}
