/* The lobby is home. Secondary tasks are full-screen pages, not floating dialogs. */
#menu[data-page='lobby'] .selection-workspace,
#menu[data-page='match'] #partyHome {
  display: none;
}
#menu[data-page='match'] .deployment-loadout,
#menu[data-page='match'] #editLoadout,
#menu[data-page='match'] #deploy,
#menu[data-page='match'] #partyReady {
  display: none;
}
#menu[data-page='match'] #cancelMatch,
#menu[data-page='match'] #applyMatch {
  display: block;
}
#menu .selection-title h1 {
  font-size: 28px;
}
.party-home {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px;
  padding: 28px max(28px, calc((100vw - 1800px) / 2));
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}
.party-people {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.party-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.party-section-heading h2 {
  font-size: 24px;
  margin: 0;
}
.party-section-heading span {
  font-size: 15px;
  font-weight: 500;
  color: #afc7be;
}
.party-roster {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  padding: 0;
  margin: 0;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.party-roster li {
  border: 1px solid #78968c66;
  border-radius: 8px;
  background: #1c3941;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 22px;
  min-width: 0;
  position: relative;
}
.party-roster li[data-ready='true'] {
  border-color: #bad58f;
  background: #294841;
}
.party-roster li.empty {
  background: #132c34;
  border-style: dashed;
  color: #89a69b;
}
.party-roster b {
  font-size: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.party-roster small {
  font-size: 13px;
  letter-spacing: 1px;
  color: #b5ccc0;
}
.party-roster span {
  font-size: 17px;
  color: #bfd1c2;
}
.party-roster button {
  align-self: start;
}
.party-roster .seat-number {
  font-size: 34px;
  color: #9db8ae66;
  position: absolute;
  right: 16px;
  top: 12px;
  font-weight: 800;
}
#partyNotice {
  font-size: 17px;
  line-height: 1.4;
  color: #d4d8ba;
  margin: 0;
  min-height: 48px;
}
.party-match {
  border: 1px solid #78968c66;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  min-height: 0;
  background: #172d34;
  display: flex;
  align-items: flex-end;
}
#partyMapPreview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}
.party-match-copy {
  position: relative;
  padding: 30px;
  width: 100%;
  background: linear-gradient(0deg, #0e252dfa 65%, #0e252d00);
  padding-top: 90px;
}
.party-match-copy h2 {
  font-size: 36px;
  line-height: 1.05;
  margin: 12px 0;
}
.party-match-copy p {
  font-size: 18px;
  margin: 10px 0;
  color: #d3ddcc;
}
.party-match-copy .secondary {
  margin-top: 12px;
  min-height: 46px;
}
#partyReady,
#applyMatch,
#cancelMatch {
  min-height: 50px;
  font-size: 18px;
  min-width: 150px;
}
#partyReady {
  margin-left: auto;
}
#menu #deploy {
  font-size: 20px;
  letter-spacing: 0;
  min-width: 200px;
}
#coopPanel {
  padding: 0;
  background: #102932;
  z-index: 80;
  align-items: stretch;
}
#coopPanel .coop-dialog {
  width: 100%;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 28px max(28px, calc((100vw - 1500px) / 2));
  gap: 22px;
  box-sizing: border-box;
  background: linear-gradient(125deg, #193a43, #10252d);
}
#coopPanel .screen-tabs {
  flex-shrink: 0;
}
#coopPanel .screen-tabs button[aria-selected='true'] {
  background: #d6d99d;
  color: #17323a;
}
.party-page-content {
  flex: 1;
  min-height: 0;
}
.invite-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 44px;
  padding-top: 24px;
}
.invite-layout > div,
.invite-layout aside {
  min-width: 0;
}
.invite-layout h3 {
  font-size: 34px;
  margin: 12px 0 22px;
}
.invite-layout aside h3 {
  font-size: 24px;
}
.invite-layout p {
  margin: 16px 0;
}
.join-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 1.5fr;
  gap: 40px;
  padding-top: 24px;
}
.join-layout input {
  margin: 12px 0;
}
.join-layout h3 {
  font-size: 28px;
  margin: 0 0 15px;
}
.join-layout p {
  margin: 10px 0 20px;
}
.party-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 24px;
}
.party-profile label {
  white-space: nowrap;
}
#coopName {
  margin: 0;
  max-width: 260px;
}
#coopLeave {
  margin-left: auto;
}
#coopPanel .coop-roster {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
#coopPanel .coop-roster li {
  gap: 12px;
  padding: 18px;
  min-width: 0;
}
#coopPanel .coop-roster button {
  min-height: 36px;
  padding: 6px;
}
#coopHint {
  margin-top: 18px;
}
#coopPanel #coopStatus {
  margin: 0;
  flex-shrink: 0;
}
#arsenal,
#matchSettings,
#results {
  padding: 0;
  background: #122d35;
}
#arsenal .arsenal-dialog,
#matchSettings .settings-dialog,
#results .result-dialog {
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  padding-inline: max(24px, calc((100vw - 1800px) / 2));
}
#results #backMenu,
#results #nextContract {
  display: none;
}
@media (max-width: 1000px) {
  .party-home {
    gap: 16px;
    padding: 18px;
  }
  .party-roster {
    gap: 10px;
  }
  .party-roster li {
    padding: 15px;
  }
  .party-roster b {
    font-size: 18px;
  }
  .party-roster span {
    font-size: 15px;
  }
  .party-match-copy {
    padding: 22px;
    padding-top: 65px;
  }
  .party-match-copy h2 {
    font-size: 30px;
  }
  .party-match-copy p {
    font-size: 16px;
  }
  #coopPanel .coop-dialog {
    padding: 20px;
  }
  .invite-layout {
    gap: 24px;
  }
  #coopPanel .coop-roster li {
    padding: 12px;
  }
}
@media (max-height: 600px) {
  .party-home {
    padding: 12px 18px;
    gap: 16px;
  }
  .party-people {
    gap: 8px;
  }
  .party-section-heading h2 {
    font-size: 19px;
  }
  .party-roster {
    gap: 8px;
  }
  .party-roster li {
    padding: 10px 14px;
    gap: 5px;
  }
  .party-roster b {
    font-size: 17px;
  }
  .party-roster small {
    font-size: 11px;
  }
  .party-roster span {
    font-size: 14px;
  }
  .party-roster .seat-number {
    font-size: 23px;
    right: 10px;
    top: 8px;
  }
  #partyNotice {
    font-size: 13px;
    min-height: 32px;
  }
  .party-match-copy {
    padding: 16px;
    padding-top: 45px;
  }
  .party-match-copy h2 {
    font-size: 26px;
    margin: 6px 0;
  }
  .party-match-copy p {
    font-size: 14px;
    margin: 7px 0;
  }
  .party-match-copy .secondary {
    min-height: 36px;
    margin-top: 6px;
    padding: 7px 12px;
  }
  #partyReady,
  #applyMatch,
  #cancelMatch {
    min-height: 42px;
    font-size: 15px;
  }
  #menu #deploy {
    font-size: 16px;
  }
  #coopPanel .coop-dialog {
    padding: 12px 20px;
    gap: 10px;
  }
  #coopPanel .coop-heading h2 {
    font-size: 24px;
  }
  .invite-layout,
  .join-layout {
    padding-top: 0;
    gap: 24px;
  }
  .invite-layout h3 {
    font-size: 28px;
    margin: 5px 0 10px;
  }
  .invite-layout aside h3 {
    font-size: 20px;
  }
  .invite-layout p {
    font-size: 14px;
    margin: 10px 0;
  }
  .join-layout p {
    margin: 6px 0 12px;
  }
  .join-layout h3 {
    font-size: 22px;
  }
  .party-profile {
    margin: 0 0 10px;
  }
  .party-profile label {
    font-size: 13px;
  }
  .party-roster button {
    padding: 5px 8px;
    min-height: 30px;
    font-size: 12px;
  }
  #coopPanel .coop-roster li {
    padding: 10px;
    gap: 6px;
  }
  #coopHint {
    font-size: 13px;
    margin-top: 8px;
  }
}
@media (max-width: 700px) and (min-height: 601px) {
  .party-home {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .party-roster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 1fr;
  }
  .party-roster li {
    padding: 10px;
  }
  .party-roster b {
    font-size: 14px;
  }
  .party-roster span {
    font-size: 12px;
  }
  .party-match-copy {
    padding: 18px;
  }
  .invite-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .invite-layout aside {
    display: none;
  }
  .join-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  #coopPanel .coop-roster {
    grid-template-columns: 1fr 1fr;
  }
  .party-profile {
    flex-wrap: wrap;
  }
}
@media (max-width: 700px) and (max-height: 600px) {
  .party-home {
    gap: 10px;
    padding: 8px 12px;
    grid-template-columns: 1.1fr 1fr;
  }
  .party-section-heading h2 {
    font-size: 16px;
  }
  .party-section-heading span {
    font-size: 12px;
  }
  .party-roster li {
    padding: 8px;
    gap: 4px;
  }
  .party-roster b {
    font-size: 14px;
  }
  .party-roster span {
    font-size: 12px;
  }
  .party-roster small {
    font-size: 10px;
  }
  .party-roster .seat-number {
    display: none;
  }
  .party-match-copy {
    padding: 12px;
    padding-top: 30px;
  }
  .party-match-copy h2 {
    font-size: 23px;
  }
  .party-match-copy .selection-kicker {
    display: none;
  }
  .party-match-copy p {
    font-size: 12px;
    margin: 5px 0;
  }
  #partyNotice {
    font-size: 11px;
    min-height: 28px;
  }
  .party-roster button {
    min-height: 28px;
    font-size: 11px;
  }
  #coopPanel .coop-dialog {
    padding: 10px 14px;
    gap: 8px;
  }
  #coopPanel .screen-tabs button {
    font-size: 13px;
    min-height: 34px;
    padding: 7px 12px;
  }
  .invite-layout {
    grid-template-columns: 1fr;
  }
  .invite-layout aside {
    display: none;
  }
  .invite-layout h3 {
    font-size: 26px;
  }
  .coop-invite {
    flex-wrap: nowrap;
  }
  #coopPanel .coop-roster {
    gap: 6px;
  }
  #coopPanel .coop-roster li {
    padding: 7px;
    gap: 5px;
  }
  #coopPanel .coop-roster b {
    font-size: 13px;
  }
  #coopPanel .coop-roster span {
    font-size: 11px;
  }
  #coopPanel .coop-roster button {
    font-size: 11px;
    min-height: 30px;
  }
  #coopHint {
    font-size: 11px;
    margin-top: 6px;
  }
  .party-profile {
    gap: 8px;
  }
  .party-profile label {
    display: none;
  }
  #coopName {
    max-width: 150px;
  }
  .party-profile button {
    font-size: 12px !important;
    padding: 7px !important;
    min-height: 44px;
  }
  #coopPanel #coopStatus {
    font-size: 12px;
    min-height: 16px;
  }
  .join-layout {
    grid-template-columns: 1fr 1.3fr;
    gap: 16px;
  }
  .join-layout p {
    font-size: 13px;
  }
}

@media (max-height: 400px) {
  .party-roster {
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .party-roster li {
    min-height: 0;
    padding: 6px 8px;
    gap: 3px;
  }
  .party-roster .empty button {
    display: none;
  }
  .party-roster b {
    line-height: 1.15;
  }
  .party-roster small,
  .party-roster span {
    line-height: 1.2;
  }
}
/* Match preparation belongs beside the people who are playing. */
#menu[data-page='lobby'] .deployment-loadout {
  display: none;
}
#menu[data-page='lobby'] #deploy {
  margin-left: auto;
}
.party-people {
  gap: 12px;
}
.party-format {
  font-size: 15px;
  line-height: 1.35;
  color: #b6ccc1;
  margin: 0;
}
#partyRoster {
  flex: 0 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: none;
  gap: 12px;
}
#partyHome[data-members='1'] .party-member {
  grid-column: 1/-1;
}
#partyRoster .party-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'identity status' 'faction faction' 'weapons weapons';
  justify-content: initial;
  padding: 16px;
  gap: 12px;
  min-height: 0;
  border-left: 3px solid #78968c;
}
#partyRoster [data-team='0'] {
  border-left-color: #80c1d4;
}
#partyRoster [data-team='1'] {
  border-left-color: #ed9a77;
}
.member-identity {
  grid-area: identity;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.member-identity b {
  font-size: 21px;
}
.member-identity small {
  font-size: 11px;
  letter-spacing: 0.7px;
}
#partyRoster .member-status {
  grid-area: status;
  align-self: center;
  font-size: 13px;
  color: #b7cbbf;
}
#partyRoster [data-ready='true'] .member-status {
  color: #d8edaa;
}
.member-faction {
  grid-area: faction;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
}
.member-faction .faction-choice {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  margin: 0;
  align-self: stretch;
  border: 1px solid #78968c77;
  border-radius: 5px;
  background: #112d35;
  color: #b9c9bf;
  font-size: 16px;
  letter-spacing: 0;
}
.faction-choice[data-team='0'][aria-pressed='true'] {
  color: #d5f5ff;
  border-color: #80c1d4;
  background: #285365;
}
.faction-choice[data-team='1'][aria-pressed='true'] {
  color: #ffe2d2;
  border-color: #ed9a77;
  background: #623e32;
}
.faction-choice:disabled {
  opacity: 0.6;
}
.faction-choice:focus-visible {
  outline: 2px solid #f4de9d;
  outline-offset: 3px;
}
#partyRoster .faction-label {
  font-size: 16px;
  font-weight: 650;
}
#partyRoster [data-team='0'] .faction-label {
  color: #80c1d4;
}
#partyRoster [data-team='1'] .faction-label {
  color: #ed9a77;
}
.member-weapons {
  grid-area: weapons;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid #91ac9950;
  padding-top: 10px;
}
#partyRoster .member-weapon {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  color: #d4dac4;
  font-size: 11px;
  line-height: 1.2;
}
.member-weapon svg {
  display: block;
  width: 100%;
  height: 24px;
  max-width: 90px;
  flex-shrink: 0;
}
#partyRoster .member-weapon span {
  font-size: 10px;
  color: #c1cdbf;
  white-space: nowrap;
}
.party-invite-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  gap: 12px;
  flex-shrink: 0;
}
.party-invite-bar > span {
  color: #a4beb2;
  font-size: 15px;
}
.party-invite-bar button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
  letter-spacing: 0;
}
.party-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
}
.party-sides > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  background: #15323b;
  border: 1px solid #819e9066;
  border-radius: 6px;
}
.party-sides [data-team='0'] b {
  color: #80c1d4;
}
.party-sides [data-team='1'] b {
  color: #ed9a77;
}
.party-sides b {
  font-size: 18px;
}
.party-sides span {
  font-size: 15px;
}
.party-sides small {
  font-size: 13px;
  color: #b3c7bb;
}
#partyHome[data-members='3'] #partySides,
#partyHome[data-members='4'] #partySides {
  display: none;
}
#partyNotice {
  min-height: 40px;
  font-size: 15px;
}
@media (max-width: 1100px) {
  #partyRoster .party-member {
    padding: 12px;
    gap: 10px;
  }
  .member-identity b {
    font-size: 18px;
  }
  .member-faction .faction-choice {
    font-size: 14px;
    padding: 7px 9px;
  }
  .party-sides > div {
    padding: 12px;
  }
  .party-sides span {
    font-size: 13px;
  }
}
@media (min-height: 601px) and (max-width: 700px) {
  #partyRoster {
    grid-template-columns: 1fr 1fr;
  }
  .party-home {
    grid-template-rows: auto minmax(180px, 1fr);
  }
  .party-sides {
    display: none;
  }
  #partyRoster .member-status {
    font-size: 12px;
  }
  .member-identity b {
    font-size: 16px;
  }
}
@media (max-height: 700px) {
  .party-sides {
    display: none;
  }
  #partyRoster .party-member {
    padding: 10px 12px;
    gap: 8px;
  }
  .member-identity b {
    font-size: 18px;
  }
  .member-weapons {
    padding-top: 7px;
  }
  .member-weapon svg {
    height: 20px;
  }
  #partyNotice {
    min-height: 28px;
    font-size: 13px;
  }
  .party-people {
    gap: 9px;
  }
}
@media (max-height: 500px) {
  .party-people {
    gap: 7px;
  }
  .party-format {
    display: none;
  }
  #partyRoster {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  #partyRoster .party-member {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(90px, 1fr) auto;
    grid-template-areas: 'identity faction status';
    gap: 8px;
    padding: 5px 8px;
    align-items: center;
  }
  .member-identity {
    gap: 1px;
  }
  #partyRoster .member-identity small {
    display: none;
  }
  .member-identity b {
    font-size: 14px !important;
  }
  #partyRoster .member-status {
    font-size: 11px;
    max-width: 50px;
  }
  .member-faction {
    min-height: 28px;
    gap: 5px;
  }
  .member-faction .faction-choice {
    min-height: 34px;
    padding: 5px 4px;
    font-size: 12px;
  }
  .member-faction .faction-label {
    font-size: 12px !important;
  }
  .member-weapons {
    display: none;
  }
  .party-invite-bar > span {
    font-size: 12px;
  }
  .party-invite-bar button {
    min-height: 32px;
    font-size: 12px;
    padding: 6px 10px;
  }
  #partyNotice {
    font-size: 11px;
    min-height: 26px;
  }
  .party-section-heading h2 {
    font-size: 16px;
  }
}
@media (max-height: 350px) {
  .party-people {
    gap: 5px;
  }
  #partyRoster {
    gap: 4px;
  }
  #partyRoster .party-member {
    padding: 3px 6px;
    gap: 6px;
  }
  .member-faction {
    min-height: 23px;
  }
  .member-faction .faction-choice {
    min-height: 30px;
    font-size: 11px;
  }
  .party-invite-bar button {
    min-height: 30px;
  }
  #partyNotice {
    min-height: 24px;
  }
}
